From 35b16ab7a8294abd093e7eed36260b46f1c4942e Mon Sep 17 00:00:00 2001 From: Arthur Ozga Date: Wed, 7 Jun 2017 14:01:42 -0700 Subject: [PATCH 001/237] temp --- src/harness/fourslash.ts | 14 ++++++++++++++ src/harness/harnessLanguageService.ts | 3 +++ src/server/client.ts | 4 ++++ src/server/protocol.ts | 15 +++++++++++++++ src/server/session.ts | 11 +++++++++++ src/services/services.ts | 11 +++++++++++ src/services/shims.ts | 12 ++++++++++++ src/services/types.ts | 1 + tests/cases/fourslash/fourslash.ts | 1 + tests/cases/fourslash/isInMultiLineComment.ts | 6 ++++++ 10 files changed, 78 insertions(+) create mode 100644 tests/cases/fourslash/isInMultiLineComment.ts diff --git a/src/harness/fourslash.ts b/src/harness/fourslash.ts index fc50e71478eab..ed29e74f66f3d 100644 --- a/src/harness/fourslash.ts +++ b/src/harness/fourslash.ts @@ -2427,6 +2427,16 @@ namespace FourSlash { } } + public verifyIsInMultiLineComment(negative: boolean) { + const expected = !negative; + const position = this.currentCaretPosition; + const fileName = this.activeFile.fileName; + const actual = this.languageService.getIsInMultiLineComment(fileName, position); + if (expected !== actual) { + this.raiseError(`verifyIsInDocComment failed: at position '${position}' in '${fileName}', expected '${expected}'.`); + } + } + private clarifyNewlines(str: string) { return str.replace(/\r?\n/g, lineEnding => { const representation = lineEnding === "\r\n" ? "CRLF" : "LF"; @@ -3577,6 +3587,10 @@ namespace FourSlashInterface { this.state.verifyCodeFixAvailable(this.negative); } + public isInMultiLineComment() { + this.state.verifyIsInMultiLineComment(this.negative); + } + public applicableRefactorAvailableAtMarker(markerName: string) { this.state.verifyApplicableRefactorAvailableAtMarker(this.negative, markerName); } diff --git a/src/harness/harnessLanguageService.ts b/src/harness/harnessLanguageService.ts index 7aefb0f3a1fc3..c67dde5f67b32 100644 --- a/src/harness/harnessLanguageService.ts +++ b/src/harness/harnessLanguageService.ts @@ -483,6 +483,9 @@ namespace Harness.LanguageService { getDocCommentTemplateAtPosition(fileName: string, position: number): ts.TextInsertion { return unwrapJSONCallResult(this.shim.getDocCommentTemplateAtPosition(fileName, position)); } + getIsInMultiLineComment(fileName: string, position: number): boolean { + return unwrapJSONCallResult(this.shim.getIsInMultiLineComment(fileName, position)); + } isValidBraceCompletionAtPosition(fileName: string, position: number, openingBrace: number): boolean { return unwrapJSONCallResult(this.shim.isValidBraceCompletionAtPosition(fileName, position, openingBrace)); } diff --git a/src/server/client.ts b/src/server/client.ts index e29261f724446..779d3bce6bf64 100644 --- a/src/server/client.ts +++ b/src/server/client.ts @@ -672,6 +672,10 @@ namespace ts.server { return notImplemented(); } + getIsInMultiLineComment(_fileName: string, _position: number): boolean { + return notImplemented(); + } + isValidBraceCompletionAtPosition(_fileName: string, _position: number, _openingBrace: number): boolean { return notImplemented(); } diff --git a/src/server/protocol.ts b/src/server/protocol.ts index 8d85ad125d588..2df147a4d377a 100644 --- a/src/server/protocol.ts +++ b/src/server/protocol.ts @@ -84,6 +84,7 @@ namespace ts.server.protocol { export type TodoComments = "todoComments"; export type Indentation = "indentation"; export type DocCommentTemplate = "docCommentTemplate"; + export type IsInMultiLineComment = "isInMultiLineComment"; /* @internal */ export type CompilerOptionsDiagnosticsFull = "compilerOptionsDiagnostics-full"; /* @internal */ @@ -237,6 +238,20 @@ namespace ts.server.protocol { body?: TodoComment[]; } + /** + * A request to determine if the caret is inside a multi-line comment. + */ + export interface IsInMultiLineCommentRequest extends FileLocationRequest { + command: CommandTypes.IsInMultiLineComment; + } + + /** + * Response for TodoCommentRequest request. + */ + export interface IsInMultiLineCommentResponse extends Response { + body?: { isInMultiLineComment: boolean }; + } + /** * Request to obtain outlining spans in file. */ diff --git a/src/server/session.ts b/src/server/session.ts index bae53dcafe8a0..a79e572e11b0b 100644 --- a/src/server/session.ts +++ b/src/server/session.ts @@ -194,6 +194,7 @@ namespace ts.server { export const TodoComments: protocol.CommandTypes.TodoComments = "todoComments"; export const Indentation: protocol.CommandTypes.Indentation = "indentation"; export const DocCommentTemplate: protocol.CommandTypes.DocCommentTemplate = "docCommentTemplate"; + export const IsInMultiLineComment: protocol.CommandTypes.IsInMultiLineComment = "isInMultiLineComment"; /* @internal */ export const CompilerOptionsDiagnosticsFull: protocol.CommandTypes.CompilerOptionsDiagnosticsFull = "compilerOptionsDiagnostics-full"; /* @internal */ @@ -1049,6 +1050,13 @@ namespace ts.server { return project.getLanguageService(/*ensureSynchronized*/ false).getDocCommentTemplateAtPosition(file, position); } + private getIsInMultiLineComment(args: protocol.FileLocationRequestArgs) { + const { file, project } = this.getFileAndProjectWithoutRefreshingInferredProjects(args); + const scriptInfo = project.getScriptInfoForNormalizedPath(file); + const position = this.getPosition(args, scriptInfo); + return project.getLanguageService(/*ensureSynchronized*/ false).getIsInMultiLineComment(file, position); + } + private getIndentation(args: protocol.IndentationRequestArgs) { const { file, project } = this.getFileAndProjectWithoutRefreshingInferredProjects(args); const position = this.getPosition(args, project.getScriptInfoForNormalizedPath(file)); @@ -1782,6 +1790,9 @@ namespace ts.server { [CommandNames.DocCommentTemplate]: (request: protocol.DocCommentTemplateRequest) => { return this.requiredResponse(this.getDocCommentTemplate(request.arguments)); }, + [CommandNames.IsInMultiLineComment]: (request: protocol.IsInMultiLineCommentRequest) => { + return this.requiredResponse(this.getIsInMultiLineComment(request.arguments)); + }, [CommandNames.Format]: (request: protocol.FormatRequest) => { return this.requiredResponse(this.getFormattingEditsForRange(request.arguments)); }, diff --git a/src/services/services.ts b/src/services/services.ts index 1a1ac47847ff8..83c94e91c583f 100644 --- a/src/services/services.ts +++ b/src/services/services.ts @@ -1779,6 +1779,16 @@ namespace ts { return JsDoc.getDocCommentTemplateAtPosition(getNewLineOrDefaultFromHost(host), syntaxTreeCache.getCurrentSourceFile(fileName), position); } + function getIsInMultiLineComment(_fileName: string, position: number): boolean { + const sourceFile = syntaxTreeCache.getCurrentSourceFile(_fileName); + const token = getTokenAtPosition(sourceFile, position); + const _triviaWidth = token.getLeadingTriviaWidth(sourceFile); _triviaWidth; + const _text = token.getText(sourceFile); _text; + const _fullText = token.getFullText(sourceFile); _fullText; + // TODO: distinguish multi-line and single line comments... + return token.getFullStart() <= position && position < token.getStart(sourceFile, /*includeJsDocComment*/ false); + } + function isValidBraceCompletionAtPosition(fileName: string, position: number, openingBrace: number): boolean { // '<' is currently not supported, figuring out if we're in a Generic Type vs. a comparison is too // expensive to do during typing scenarios @@ -2030,6 +2040,7 @@ namespace ts { getFormattingEditsForDocument, getFormattingEditsAfterKeystroke, getDocCommentTemplateAtPosition, + getIsInMultiLineComment, isValidBraceCompletionAtPosition, getCodeFixesAtPosition, getEmitOutput, diff --git a/src/services/shims.ts b/src/services/shims.ts index 498c1834a60ab..3ce553d552e72 100644 --- a/src/services/shims.ts +++ b/src/services/shims.ts @@ -247,6 +247,11 @@ namespace ts { */ getDocCommentTemplateAtPosition(fileName: string, position: number): string; + /** + * Returns JSON-encoded value of the type TextInsertion. + */ + getIsInMultiLineComment(fileName: string, position: number): string; + /** * Returns JSON-encoded boolean to indicate whether we should support brace location * at the current position. @@ -935,6 +940,13 @@ namespace ts { ); } + public getIsInMultiLineComment(fileName: string, position: number): string { + return this.forwardJSONCall( + `getIsInMultiLineComment('${fileName}', ${position})`, + () => this.languageService.getIsInMultiLineComment(fileName, position) + ); + } + /// NAVIGATE TO /** Return a list of symbols that are interesting to navigate to */ diff --git a/src/services/types.ts b/src/services/types.ts index 6c64ce5b9ba65..20505378882a0 100644 --- a/src/services/types.ts +++ b/src/services/types.ts @@ -257,6 +257,7 @@ namespace ts { getFormattingEditsAfterKeystroke(fileName: string, position: number, key: string, options: FormatCodeOptions | FormatCodeSettings): TextChange[]; getDocCommentTemplateAtPosition(fileName: string, position: number): TextInsertion; + getIsInMultiLineComment(fileName: string, position: number): boolean; isValidBraceCompletionAtPosition(fileName: string, position: number, openingBrace: number): boolean; diff --git a/tests/cases/fourslash/fourslash.ts b/tests/cases/fourslash/fourslash.ts index 3fada673f354d..3af3464138af6 100644 --- a/tests/cases/fourslash/fourslash.ts +++ b/tests/cases/fourslash/fourslash.ts @@ -150,6 +150,7 @@ declare namespace FourSlashInterface { implementationListIsEmpty(): void; isValidBraceCompletionAtPosition(openingBrace?: string): void; codeFixAvailable(): void; + isInMultiLineComment(): void; applicableRefactorAvailableAtMarker(markerName: string): void; codeFixDiagnosticsAvailableAtMarkers(markerNames: string[], diagnosticCode?: number): void; applicableRefactorAvailableForRange(): void; diff --git a/tests/cases/fourslash/isInMultiLineComment.ts b/tests/cases/fourslash/isInMultiLineComment.ts new file mode 100644 index 0000000000000..4d6c8d6af1ab3 --- /dev/null +++ b/tests/cases/fourslash/isInMultiLineComment.ts @@ -0,0 +1,6 @@ +/// + +//// /* blach /*m0*/ */ let x = 10; + +goTo.marker("m0"); +verify.isInMultiLineComment(); \ No newline at end of file From a819e4ed172405bffe6fb419483bdccaeb1de16b Mon Sep 17 00:00:00 2001 From: Arthur Ozga Date: Wed, 7 Jun 2017 16:43:13 -0700 Subject: [PATCH 002/237] isInMultiLineComment --- src/services/services.ts | 17 +++++---- tests/cases/fourslash/isInMultiLineComment.ts | 36 +++++++++++++++++-- .../fourslash/isInMultiLineCommentEOF.ts | 12 +++++++ 3 files changed, 56 insertions(+), 9 deletions(-) create mode 100644 tests/cases/fourslash/isInMultiLineCommentEOF.ts diff --git a/src/services/services.ts b/src/services/services.ts index 8da654140e0eb..1f85ad427f555 100644 --- a/src/services/services.ts +++ b/src/services/services.ts @@ -1791,12 +1791,17 @@ namespace ts { function getIsInMultiLineComment(_fileName: string, position: number): boolean { const sourceFile = syntaxTreeCache.getCurrentSourceFile(_fileName); - const token = getTokenAtPosition(sourceFile, position, /*includeJsDocComment*/ true); - const _triviaWidth = token.getLeadingTriviaWidth(sourceFile); _triviaWidth; - const _text = token.getText(sourceFile); _text; - const _fullText = token.getFullText(sourceFile); _fullText; - // TODO: distinguish multi-line and single line comments... - return token.getFullStart() <= position && position < token.getStart(sourceFile, /*includeJsDocComment*/ false); + const token = getTokenAtPosition(sourceFile, position, /*includeJsDocComment*/ false); + const leadingCommentRanges = getLeadingCommentRangesOfNode(token, sourceFile); + + for (const range of leadingCommentRanges) { + // We need to extend the range when in an unclosed multi-line comment. + if (range.pos < position && (position < range.end || position === range.end && position === sourceFile.getFullWidth())) { + return range.kind === SyntaxKind.MultiLineCommentTrivia; + } + } + + return false; } function isValidBraceCompletionAtPosition(fileName: string, position: number, openingBrace: number): boolean { diff --git a/tests/cases/fourslash/isInMultiLineComment.ts b/tests/cases/fourslash/isInMultiLineComment.ts index 4d6c8d6af1ab3..ebcac7215f9da 100644 --- a/tests/cases/fourslash/isInMultiLineComment.ts +++ b/tests/cases/fourslash/isInMultiLineComment.ts @@ -1,6 +1,36 @@ /// -//// /* blach /*m0*/ */ let x = 10; +//// /* x */ +//// /** x */ +//// // x +//// let x = 1; -goTo.marker("m0"); -verify.isInMultiLineComment(); \ No newline at end of file + +for (let i = 1; i < 7; ++i) { + goTo.position(i); + verify.isInMultiLineComment(); +} + +for (let i = 0; i < 2; ++i) { + goTo.position(i * 7); + verify.not.isInMultiLineComment(); +} + +const jsDocStart = 8; + +for (let i = 1; i < 8; ++i) { + goTo.position(jsDocStart + i); + verify.isInMultiLineComment(); +} + +for (let i = 0; i < 2; ++i) { + goTo.position(jsDocStart + i * 8); + verify.not.isInMultiLineComment(); +} + +const singleLineCommentStart = 17; + +for (let i = 0; i < 5; ++i) { + goTo.position(singleLineCommentStart + i); + verify.not.isInMultiLineComment(); +} diff --git a/tests/cases/fourslash/isInMultiLineCommentEOF.ts b/tests/cases/fourslash/isInMultiLineCommentEOF.ts new file mode 100644 index 0000000000000..2e34264b1f61e --- /dev/null +++ b/tests/cases/fourslash/isInMultiLineCommentEOF.ts @@ -0,0 +1,12 @@ +/// + +// @Filename: f1.ts +//// /* /*0*/ blah /*1*/ */ + +// @Filename: f2.ts +//// /* /*2*/ blah /*3*/ + +for (let i = 0; i < 4; ++i) { + goTo.marker(`${i}`); + verify.isInMultiLineComment(); +} \ No newline at end of file From 8f28a0264ffcaa75e99617f9888f46e6c8f2ff41 Mon Sep 17 00:00:00 2001 From: Arthur Ozga Date: Thu, 8 Jun 2017 17:08:07 -0700 Subject: [PATCH 003/237] indent block comments according to first line --- src/harness/fourslash.ts | 28 +++++++++---------- src/harness/harnessLanguageService.ts | 6 ++-- src/server/client.ts | 4 +-- src/server/protocol.ts | 13 ++------- src/server/session.ts | 8 +++--- src/services/formatting/formatting.ts | 21 ++++++++++++++ src/services/formatting/smartIndenter.ts | 7 ++++- src/services/services.ts | 22 ++++----------- src/services/shims.ts | 25 +++++++++-------- src/services/types.ts | 3 +- tests/cases/fourslash/fourslash.ts | 2 +- tests/cases/fourslash/isInMultiLineComment.ts | 10 +++---- .../fourslash/isInMultiLineCommentEOF.ts | 2 +- 13 files changed, 81 insertions(+), 70 deletions(-) diff --git a/src/harness/fourslash.ts b/src/harness/fourslash.ts index aa3097debadae..54b5b48da2b40 100644 --- a/src/harness/fourslash.ts +++ b/src/harness/fourslash.ts @@ -2427,16 +2427,6 @@ namespace FourSlash { } } - public verifyIsInMultiLineComment(negative: boolean) { - const expected = !negative; - const position = this.currentCaretPosition; - const fileName = this.activeFile.fileName; - const actual = this.languageService.getIsInMultiLineComment(fileName, position); - if (expected !== actual) { - this.raiseError(`verifyIsInDocComment failed: at position '${position}' in '${fileName}', expected '${expected}'.`); - } - } - private clarifyNewlines(str: string) { return str.replace(/\r?\n/g, lineEnding => { const representation = lineEnding === "\r\n" ? "CRLF" : "LF"; @@ -2510,6 +2500,16 @@ namespace FourSlash { } } + public verifyisInMultiLineCommentAtPosition(negative: boolean) { + const expected = !negative; + const position = this.currentCaretPosition; + const fileName = this.activeFile.fileName; + const actual = this.languageService.getisInMultiLineCommentAtPosition(fileName, position); + if (expected !== actual) { + this.raiseError(`verifyIsInDocComment failed: at position '${position}' in '${fileName}', expected '${expected}'.`); + } + } + /* Check number of navigationItems which match both searchValue and matchKind, if a filename is passed in, limit the results to that file. @@ -3583,12 +3583,12 @@ namespace FourSlashInterface { this.state.verifyBraceCompletionAtPosition(this.negative, openingBrace); } - public codeFixAvailable() { - this.state.verifyCodeFixAvailable(this.negative); + public isInMultiLineCommentAtPosition() { + this.state.verifyisInMultiLineCommentAtPosition(this.negative); } - public isInMultiLineComment() { - this.state.verifyIsInMultiLineComment(this.negative); + public codeFixAvailable() { + this.state.verifyCodeFixAvailable(this.negative); } public applicableRefactorAvailableAtMarker(markerName: string) { diff --git a/src/harness/harnessLanguageService.ts b/src/harness/harnessLanguageService.ts index c67dde5f67b32..c3a09b3926f5c 100644 --- a/src/harness/harnessLanguageService.ts +++ b/src/harness/harnessLanguageService.ts @@ -483,12 +483,12 @@ namespace Harness.LanguageService { getDocCommentTemplateAtPosition(fileName: string, position: number): ts.TextInsertion { return unwrapJSONCallResult(this.shim.getDocCommentTemplateAtPosition(fileName, position)); } - getIsInMultiLineComment(fileName: string, position: number): boolean { - return unwrapJSONCallResult(this.shim.getIsInMultiLineComment(fileName, position)); - } isValidBraceCompletionAtPosition(fileName: string, position: number, openingBrace: number): boolean { return unwrapJSONCallResult(this.shim.isValidBraceCompletionAtPosition(fileName, position, openingBrace)); } + getisInMultiLineCommentAtPosition(fileName: string, position: number): boolean { + return unwrapJSONCallResult(this.shim.getisInMultiLineCommentAtPosition(fileName, position)); + } getCodeFixesAtPosition(): ts.CodeAction[] { throw new Error("Not supported on the shim."); } diff --git a/src/server/client.ts b/src/server/client.ts index 69727a18e6026..5a162c1041d96 100644 --- a/src/server/client.ts +++ b/src/server/client.ts @@ -672,11 +672,11 @@ namespace ts.server { return notImplemented(); } - getIsInMultiLineComment(_fileName: string, _position: number): boolean { + isValidBraceCompletionAtPosition(_fileName: string, _position: number, _openingBrace: number): boolean { return notImplemented(); } - isValidBraceCompletionAtPosition(_fileName: string, _position: number, _openingBrace: number): boolean { + getisInMultiLineCommentAtPosition(_fileName: string, _position: number): boolean { return notImplemented(); } diff --git a/src/server/protocol.ts b/src/server/protocol.ts index 1cfe617ca72af..299ba4fceedeb 100644 --- a/src/server/protocol.ts +++ b/src/server/protocol.ts @@ -8,6 +8,7 @@ namespace ts.server.protocol { /* @internal */ BraceFull = "brace-full", BraceCompletion = "braceCompletion", + isInMultiLineComment = "isInMultiLineComment", Change = "change", Close = "close", Completions = "completions", @@ -85,7 +86,6 @@ namespace ts.server.protocol { TodoComments = "todoComments", Indentation = "indentation", DocCommentTemplate = "docCommentTemplate", - IsInMultiLineComment = "isInMultiLineComment", /* @internal */ CompilerOptionsDiagnosticsFull = "compilerOptionsDiagnostics-full", /* @internal */ @@ -242,15 +242,8 @@ namespace ts.server.protocol { /** * A request to determine if the caret is inside a multi-line comment. */ - export interface IsInMultiLineCommentRequest extends FileLocationRequest { - command: CommandTypes.IsInMultiLineComment; - } - - /** - * Response for TodoCommentRequest request. - */ - export interface IsInMultiLineCommentResponse extends Response { - body?: { isInMultiLineComment: boolean }; + export interface IsInMultiLineCommentAtPositionRequest extends FileLocationRequest { + command: CommandTypes.isInMultiLineComment; } /** diff --git a/src/server/session.ts b/src/server/session.ts index abebdb5fae9ef..e4e900ddce72d 100644 --- a/src/server/session.ts +++ b/src/server/session.ts @@ -961,11 +961,11 @@ namespace ts.server { return project.getLanguageService(/*ensureSynchronized*/ false).getDocCommentTemplateAtPosition(file, position); } - private getIsInMultiLineComment(args: protocol.FileLocationRequestArgs) { + private getisInMultiLineCommentAtPosition(args: protocol.FileLocationRequestArgs) { const { file, project } = this.getFileAndProjectWithoutRefreshingInferredProjects(args); const scriptInfo = project.getScriptInfoForNormalizedPath(file); const position = this.getPosition(args, scriptInfo); - return project.getLanguageService(/*ensureSynchronized*/ false).getIsInMultiLineComment(file, position); + return project.getLanguageService(/*ensureSynchronized*/ false).getisInMultiLineCommentAtPosition(file, position); } private getIndentation(args: protocol.IndentationRequestArgs) { @@ -1701,8 +1701,8 @@ namespace ts.server { [CommandNames.DocCommentTemplate]: (request: protocol.DocCommentTemplateRequest) => { return this.requiredResponse(this.getDocCommentTemplate(request.arguments)); }, - [CommandNames.IsInMultiLineComment]: (request: protocol.IsInMultiLineCommentRequest) => { - return this.requiredResponse(this.getIsInMultiLineComment(request.arguments)); + [CommandNames.isInMultiLineComment]: (request: protocol.IsInMultiLineCommentAtPositionRequest) => { + return this.requiredResponse(this.getisInMultiLineCommentAtPosition(request.arguments)); }, [CommandNames.Format]: (request: protocol.FormatRequest) => { return this.requiredResponse(this.getFormattingEditsForRange(request.arguments)); diff --git a/src/services/formatting/formatting.ts b/src/services/formatting/formatting.ts index 531b768f6d80f..fa49ee852b1e4 100644 --- a/src/services/formatting/formatting.ts +++ b/src/services/formatting/formatting.ts @@ -1117,6 +1117,27 @@ namespace ts.formatting { } } + /** + * @returns -1 iff the position is not in a multi-line comment. + */ + export function getIndentationOfEnclosingMultiLineComment(sourceFile: SourceFile, position: number): number { + const token = getTokenAtPosition(sourceFile, position, /*includeJsDocComment*/ false); + const leadingCommentRanges = getLeadingCommentRangesOfNode(token, sourceFile); + if (leadingCommentRanges) { + loop: for (const range of leadingCommentRanges) { + // We need to extend the range when in an unclosed multi-line comment. + if (range.pos < position && (position < range.end || position === range.end && position === sourceFile.getFullWidth())) { + if (range.kind === SyntaxKind.MultiLineCommentTrivia) { + return range.pos - getLineStartPositionForPosition(range.pos, sourceFile); + } + break loop; + } + } + } + return -1; + } + + function getOpenTokenForList(node: Node, list: Node[]) { switch (node.kind) { case SyntaxKind.Constructor: diff --git a/src/services/formatting/smartIndenter.ts b/src/services/formatting/smartIndenter.ts index 18b0479c85a30..8acab0e66034f 100644 --- a/src/services/formatting/smartIndenter.ts +++ b/src/services/formatting/smartIndenter.ts @@ -38,12 +38,17 @@ namespace ts.formatting { // no indentation in string \regex\template literals const precedingTokenIsLiteral = isStringOrRegularExpressionOrTemplateLiteral(precedingToken.kind); - if (precedingTokenIsLiteral && precedingToken.getStart(sourceFile) <= position && precedingToken.end > position) { + if (precedingTokenIsLiteral && precedingToken.getStart(sourceFile) <= position && position < precedingToken.end) { return 0; } const lineAtPosition = sourceFile.getLineAndCharacterOfPosition(position).line; + const indentationOfEnclosingMultiLineComment = getIndentationOfEnclosingMultiLineComment(sourceFile, position); + if (indentationOfEnclosingMultiLineComment !== -1) { + return indentationOfEnclosingMultiLineComment; + } + // indentation is first non-whitespace character in a previous line // for block indentation, we should look for a line which contains something that's not // whitespace. diff --git a/src/services/services.ts b/src/services/services.ts index 1f85ad427f555..ab398db7c3556 100644 --- a/src/services/services.ts +++ b/src/services/services.ts @@ -1789,21 +1789,6 @@ namespace ts { return JsDoc.getDocCommentTemplateAtPosition(getNewLineOrDefaultFromHost(host), syntaxTreeCache.getCurrentSourceFile(fileName), position); } - function getIsInMultiLineComment(_fileName: string, position: number): boolean { - const sourceFile = syntaxTreeCache.getCurrentSourceFile(_fileName); - const token = getTokenAtPosition(sourceFile, position, /*includeJsDocComment*/ false); - const leadingCommentRanges = getLeadingCommentRangesOfNode(token, sourceFile); - - for (const range of leadingCommentRanges) { - // We need to extend the range when in an unclosed multi-line comment. - if (range.pos < position && (position < range.end || position === range.end && position === sourceFile.getFullWidth())) { - return range.kind === SyntaxKind.MultiLineCommentTrivia; - } - } - - return false; - } - function isValidBraceCompletionAtPosition(fileName: string, position: number, openingBrace: number): boolean { // '<' is currently not supported, figuring out if we're in a Generic Type vs. a comparison is too // expensive to do during typing scenarios @@ -1833,6 +1818,11 @@ namespace ts { return true; } + function getisInMultiLineCommentAtPosition(fileName: string, position: number): boolean { + const sourceFile = syntaxTreeCache.getCurrentSourceFile(fileName); + return ts.formatting.getIndentationOfEnclosingMultiLineComment(sourceFile, position) !== -1; + } + function getTodoComments(fileName: string, descriptors: TodoCommentDescriptor[]): TodoComment[] { // Note: while getting todo comments seems like a syntactic operation, we actually // treat it as a semantic operation here. This is because we expect our host to call @@ -2054,8 +2044,8 @@ namespace ts { getFormattingEditsForDocument, getFormattingEditsAfterKeystroke, getDocCommentTemplateAtPosition, - getIsInMultiLineComment, isValidBraceCompletionAtPosition, + getisInMultiLineCommentAtPosition, getCodeFixesAtPosition, getEmitOutput, getNonBoundSourceFile, diff --git a/src/services/shims.ts b/src/services/shims.ts index 3ce553d552e72..75c5e8445c13a 100644 --- a/src/services/shims.ts +++ b/src/services/shims.ts @@ -247,11 +247,6 @@ namespace ts { */ getDocCommentTemplateAtPosition(fileName: string, position: number): string; - /** - * Returns JSON-encoded value of the type TextInsertion. - */ - getIsInMultiLineComment(fileName: string, position: number): string; - /** * Returns JSON-encoded boolean to indicate whether we should support brace location * at the current position. @@ -259,6 +254,11 @@ namespace ts { */ isValidBraceCompletionAtPosition(fileName: string, position: number, openingBrace: number): string; + /** + * Returns JSON-encoded boolean to indicate whether the caret at the current position is in a multi-line comment. + */ + getisInMultiLineCommentAtPosition(fileName: string, position: number): string; + getEmitOutput(fileName: string): string; getEmitOutputObject(fileName: string): EmitOutput; } @@ -840,6 +840,14 @@ namespace ts { ); } + /// GET IS IN MULTI-LINE COMMENT + public getisInMultiLineCommentAtPosition(fileName: string, position: number): string { + return this.forwardJSONCall( + `getisInMultiLineCommentAtPosition('${fileName}', ${position})`, + () => this.languageService.getisInMultiLineCommentAtPosition(fileName, position) + ); + } + /// GET SMART INDENT public getIndentationAtPosition(fileName: string, position: number, options: string /*Services.EditorOptions*/): string { return this.forwardJSONCall( @@ -940,13 +948,6 @@ namespace ts { ); } - public getIsInMultiLineComment(fileName: string, position: number): string { - return this.forwardJSONCall( - `getIsInMultiLineComment('${fileName}', ${position})`, - () => this.languageService.getIsInMultiLineComment(fileName, position) - ); - } - /// NAVIGATE TO /** Return a list of symbols that are interesting to navigate to */ diff --git a/src/services/types.ts b/src/services/types.ts index 62d2db1b65c89..3a7a14d3dbced 100644 --- a/src/services/types.ts +++ b/src/services/types.ts @@ -257,10 +257,11 @@ namespace ts { getFormattingEditsAfterKeystroke(fileName: string, position: number, key: string, options: FormatCodeOptions | FormatCodeSettings): TextChange[]; getDocCommentTemplateAtPosition(fileName: string, position: number): TextInsertion; - getIsInMultiLineComment(fileName: string, position: number): boolean; isValidBraceCompletionAtPosition(fileName: string, position: number, openingBrace: number): boolean; + getisInMultiLineCommentAtPosition(fileName: string, position: number): boolean; + getCodeFixesAtPosition(fileName: string, start: number, end: number, errorCodes: number[], formatOptions: FormatCodeSettings): CodeAction[]; getApplicableRefactors(fileName: string, positionOrRaneg: number | TextRange): ApplicableRefactorInfo[]; getRefactorCodeActions(fileName: string, formatOptions: FormatCodeSettings, positionOrRange: number | TextRange, refactorName: string): CodeAction[] | undefined; diff --git a/tests/cases/fourslash/fourslash.ts b/tests/cases/fourslash/fourslash.ts index 3984a074fd9d3..96cc152f0fff1 100644 --- a/tests/cases/fourslash/fourslash.ts +++ b/tests/cases/fourslash/fourslash.ts @@ -149,8 +149,8 @@ declare namespace FourSlashInterface { typeDefinitionCountIs(expectedCount: number): void; implementationListIsEmpty(): void; isValidBraceCompletionAtPosition(openingBrace?: string): void; + isInMultiLineCommentAtPosition(): void; codeFixAvailable(): void; - isInMultiLineComment(): void; applicableRefactorAvailableAtMarker(markerName: string): void; codeFixDiagnosticsAvailableAtMarkers(markerNames: string[], diagnosticCode?: number): void; applicableRefactorAvailableForRange(): void; diff --git a/tests/cases/fourslash/isInMultiLineComment.ts b/tests/cases/fourslash/isInMultiLineComment.ts index ebcac7215f9da..39aac71a8bd7b 100644 --- a/tests/cases/fourslash/isInMultiLineComment.ts +++ b/tests/cases/fourslash/isInMultiLineComment.ts @@ -8,29 +8,29 @@ for (let i = 1; i < 7; ++i) { goTo.position(i); - verify.isInMultiLineComment(); + verify.isInMultiLineCommentAtPosition(); } for (let i = 0; i < 2; ++i) { goTo.position(i * 7); - verify.not.isInMultiLineComment(); + verify.not.isInMultiLineCommentAtPosition(); } const jsDocStart = 8; for (let i = 1; i < 8; ++i) { goTo.position(jsDocStart + i); - verify.isInMultiLineComment(); + verify.isInMultiLineCommentAtPosition(); } for (let i = 0; i < 2; ++i) { goTo.position(jsDocStart + i * 8); - verify.not.isInMultiLineComment(); + verify.not.isInMultiLineCommentAtPosition(); } const singleLineCommentStart = 17; for (let i = 0; i < 5; ++i) { goTo.position(singleLineCommentStart + i); - verify.not.isInMultiLineComment(); + verify.not.isInMultiLineCommentAtPosition(); } diff --git a/tests/cases/fourslash/isInMultiLineCommentEOF.ts b/tests/cases/fourslash/isInMultiLineCommentEOF.ts index 2e34264b1f61e..2b65a95834026 100644 --- a/tests/cases/fourslash/isInMultiLineCommentEOF.ts +++ b/tests/cases/fourslash/isInMultiLineCommentEOF.ts @@ -8,5 +8,5 @@ for (let i = 0; i < 4; ++i) { goTo.marker(`${i}`); - verify.isInMultiLineComment(); + verify.isInMultiLineCommentAtPosition(); } \ No newline at end of file From b02963b2380f8cd4c2675a72f974552e5acd7f1e Mon Sep 17 00:00:00 2001 From: Arthur Ozga Date: Fri, 9 Jun 2017 14:43:28 -0700 Subject: [PATCH 004/237] make indent work with trailing comments --- src/harness/fourslash.ts | 8 +-- src/harness/harnessLanguageService.ts | 2 +- src/server/client.ts | 2 +- src/server/session.ts | 2 +- src/services/formatting/formatting.ts | 35 +++++++---- src/services/formatting/smartIndenter.ts | 18 +++--- src/services/services.ts | 6 +- src/services/shims.ts | 2 +- src/services/types.ts | 2 +- tests/cases/fourslash/isInMultiLineComment.ts | 58 +++++++++++-------- 10 files changed, 79 insertions(+), 56 deletions(-) diff --git a/src/harness/fourslash.ts b/src/harness/fourslash.ts index 54b5b48da2b40..080614fc62357 100644 --- a/src/harness/fourslash.ts +++ b/src/harness/fourslash.ts @@ -2500,13 +2500,13 @@ namespace FourSlash { } } - public verifyisInMultiLineCommentAtPosition(negative: boolean) { + public verifyIsInMultiLineCommentAtPosition(negative: boolean) { const expected = !negative; const position = this.currentCaretPosition; const fileName = this.activeFile.fileName; - const actual = this.languageService.getisInMultiLineCommentAtPosition(fileName, position); + const actual = this.languageService.isInMultiLineCommentAtPosition(fileName, position); if (expected !== actual) { - this.raiseError(`verifyIsInDocComment failed: at position '${position}' in '${fileName}', expected '${expected}'.`); + this.raiseError(`verifyIsInMultiLineCommentAtPosition failed: at position '${position}' in '${fileName}', expected '${expected}'.`); } } @@ -3584,7 +3584,7 @@ namespace FourSlashInterface { } public isInMultiLineCommentAtPosition() { - this.state.verifyisInMultiLineCommentAtPosition(this.negative); + this.state.verifyIsInMultiLineCommentAtPosition(this.negative); } public codeFixAvailable() { diff --git a/src/harness/harnessLanguageService.ts b/src/harness/harnessLanguageService.ts index c3a09b3926f5c..962f9a0df5dcf 100644 --- a/src/harness/harnessLanguageService.ts +++ b/src/harness/harnessLanguageService.ts @@ -486,7 +486,7 @@ namespace Harness.LanguageService { isValidBraceCompletionAtPosition(fileName: string, position: number, openingBrace: number): boolean { return unwrapJSONCallResult(this.shim.isValidBraceCompletionAtPosition(fileName, position, openingBrace)); } - getisInMultiLineCommentAtPosition(fileName: string, position: number): boolean { + isInMultiLineCommentAtPosition(fileName: string, position: number): boolean { return unwrapJSONCallResult(this.shim.getisInMultiLineCommentAtPosition(fileName, position)); } getCodeFixesAtPosition(): ts.CodeAction[] { diff --git a/src/server/client.ts b/src/server/client.ts index 5a162c1041d96..0e66516da4090 100644 --- a/src/server/client.ts +++ b/src/server/client.ts @@ -676,7 +676,7 @@ namespace ts.server { return notImplemented(); } - getisInMultiLineCommentAtPosition(_fileName: string, _position: number): boolean { + isInMultiLineCommentAtPosition(_fileName: string, _position: number): boolean { return notImplemented(); } diff --git a/src/server/session.ts b/src/server/session.ts index e4e900ddce72d..9657c66623847 100644 --- a/src/server/session.ts +++ b/src/server/session.ts @@ -965,7 +965,7 @@ namespace ts.server { const { file, project } = this.getFileAndProjectWithoutRefreshingInferredProjects(args); const scriptInfo = project.getScriptInfoForNormalizedPath(file); const position = this.getPosition(args, scriptInfo); - return project.getLanguageService(/*ensureSynchronized*/ false).getisInMultiLineCommentAtPosition(file, position); + return project.getLanguageService(/*ensureSynchronized*/ false).isInMultiLineCommentAtPosition(file, position); } private getIndentation(args: protocol.IndentationRequestArgs) { diff --git a/src/services/formatting/formatting.ts b/src/services/formatting/formatting.ts index fa49ee852b1e4..7feba4b7dd242 100644 --- a/src/services/formatting/formatting.ts +++ b/src/services/formatting/formatting.ts @@ -1118,23 +1118,36 @@ namespace ts.formatting { } /** - * @returns -1 iff the position is not in a multi-line comment. + * Gets the indentation level of the multi-line comment enclosing position, + * and a negative value if the position is not in a multi-line comment. */ - export function getIndentationOfEnclosingMultiLineComment(sourceFile: SourceFile, position: number): number { - const token = getTokenAtPosition(sourceFile, position, /*includeJsDocComment*/ false); - const leadingCommentRanges = getLeadingCommentRangesOfNode(token, sourceFile); - if (leadingCommentRanges) { - loop: for (const range of leadingCommentRanges) { + export function getIndentationOfEnclosingMultiLineComment(sourceFile: SourceFile, position: number, options: EditorSettings): number { + const range = getRangeOfEnclosingComment(sourceFile, position, SyntaxKind.MultiLineCommentTrivia); + if (range) { + const commentStart = range.pos; + const commentLineStart = getLineStartPositionForPosition(commentStart, sourceFile); + const { column, character } = SmartIndenter.findFirstNonWhitespaceCharacterAndColumn(commentLineStart, commentStart, sourceFile, options); + return range.pos - character + column; + } + return undefined; + } + + export function getRangeOfEnclosingComment(sourceFile: SourceFile, position: number, kind: CommentKind): CommentRange | undefined { + const precedingToken = findPrecedingToken(position, sourceFile); + const trailingRangesOfPreviousToken = precedingToken && getTrailingCommentRanges(sourceFile.text, precedingToken.end); + const leadingCommentRangesOfNextToken = getLeadingCommentRangesOfNode(getTokenAtPosition(sourceFile, position, /*includeJsDocComment*/ false), sourceFile); + const commentRanges = trailingRangesOfPreviousToken && leadingCommentRangesOfNextToken ? + trailingRangesOfPreviousToken.concat(leadingCommentRangesOfNextToken) : + trailingRangesOfPreviousToken || leadingCommentRangesOfNextToken; + if (commentRanges) { + for (const range of commentRanges) { // We need to extend the range when in an unclosed multi-line comment. if (range.pos < position && (position < range.end || position === range.end && position === sourceFile.getFullWidth())) { - if (range.kind === SyntaxKind.MultiLineCommentTrivia) { - return range.pos - getLineStartPositionForPosition(range.pos, sourceFile); - } - break loop; + return range.kind === kind ? range : undefined; } } } - return -1; + return undefined; } diff --git a/src/services/formatting/smartIndenter.ts b/src/services/formatting/smartIndenter.ts index 8acab0e66034f..c5aee567a41f5 100644 --- a/src/services/formatting/smartIndenter.ts +++ b/src/services/formatting/smartIndenter.ts @@ -44,8 +44,8 @@ namespace ts.formatting { const lineAtPosition = sourceFile.getLineAndCharacterOfPosition(position).line; - const indentationOfEnclosingMultiLineComment = getIndentationOfEnclosingMultiLineComment(sourceFile, position); - if (indentationOfEnclosingMultiLineComment !== -1) { + const indentationOfEnclosingMultiLineComment = getIndentationOfEnclosingMultiLineComment(sourceFile, position, options); + if (indentationOfEnclosingMultiLineComment >= 0) { return indentationOfEnclosingMultiLineComment; } @@ -410,13 +410,13 @@ namespace ts.formatting { return findFirstNonWhitespaceColumn(lineStart, lineStart + lineAndCharacter.character, sourceFile, options); } - /* - Character is the actual index of the character since the beginning of the line. - Column - position of the character after expanding tabs to spaces - "0\t2$" - value of 'character' for '$' is 3 - value of 'column' for '$' is 6 (assuming that tab size is 4) - */ + /** + * Character is the actual index of the character since the beginning of the line. + * Column - position of the character after expanding tabs to spaces. + * "0\t2$" + * value of 'character' for '$' is 3 + * value of 'column' for '$' is 6 (assuming that tab size is 4) + */ export function findFirstNonWhitespaceCharacterAndColumn(startPos: number, endPos: number, sourceFile: SourceFileLike, options: EditorSettings) { let character = 0; let column = 0; diff --git a/src/services/services.ts b/src/services/services.ts index ab398db7c3556..294afec602992 100644 --- a/src/services/services.ts +++ b/src/services/services.ts @@ -1818,9 +1818,9 @@ namespace ts { return true; } - function getisInMultiLineCommentAtPosition(fileName: string, position: number): boolean { + function isInMultiLineCommentAtPosition(fileName: string, position: number): boolean { const sourceFile = syntaxTreeCache.getCurrentSourceFile(fileName); - return ts.formatting.getIndentationOfEnclosingMultiLineComment(sourceFile, position) !== -1; + return !!ts.formatting.getRangeOfEnclosingComment(sourceFile, position, SyntaxKind.MultiLineCommentTrivia); } function getTodoComments(fileName: string, descriptors: TodoCommentDescriptor[]): TodoComment[] { @@ -2045,7 +2045,7 @@ namespace ts { getFormattingEditsAfterKeystroke, getDocCommentTemplateAtPosition, isValidBraceCompletionAtPosition, - getisInMultiLineCommentAtPosition, + isInMultiLineCommentAtPosition, getCodeFixesAtPosition, getEmitOutput, getNonBoundSourceFile, diff --git a/src/services/shims.ts b/src/services/shims.ts index 75c5e8445c13a..fd2ba1cca7297 100644 --- a/src/services/shims.ts +++ b/src/services/shims.ts @@ -844,7 +844,7 @@ namespace ts { public getisInMultiLineCommentAtPosition(fileName: string, position: number): string { return this.forwardJSONCall( `getisInMultiLineCommentAtPosition('${fileName}', ${position})`, - () => this.languageService.getisInMultiLineCommentAtPosition(fileName, position) + () => this.languageService.isInMultiLineCommentAtPosition(fileName, position) ); } diff --git a/src/services/types.ts b/src/services/types.ts index 3a7a14d3dbced..bbd9fa9986cf3 100644 --- a/src/services/types.ts +++ b/src/services/types.ts @@ -260,7 +260,7 @@ namespace ts { isValidBraceCompletionAtPosition(fileName: string, position: number, openingBrace: number): boolean; - getisInMultiLineCommentAtPosition(fileName: string, position: number): boolean; + isInMultiLineCommentAtPosition(fileName: string, position: number): boolean; getCodeFixesAtPosition(fileName: string, start: number, end: number, errorCodes: number[], formatOptions: FormatCodeSettings): CodeAction[]; getApplicableRefactors(fileName: string, positionOrRaneg: number | TextRange): ApplicableRefactorInfo[]; diff --git a/tests/cases/fourslash/isInMultiLineComment.ts b/tests/cases/fourslash/isInMultiLineComment.ts index 39aac71a8bd7b..58e4e4d333749 100644 --- a/tests/cases/fourslash/isInMultiLineComment.ts +++ b/tests/cases/fourslash/isInMultiLineComment.ts @@ -1,36 +1,46 @@ /// //// /* x */ -//// /** x */ +//// /** +//// * @param this doesn't make sense here. +//// */ //// // x -//// let x = 1; +//// let x = 1; /* +//// * +const firstCommentStart = 0; +const firstCommentEnd = 7; +goTo.position(firstCommentStart); +verify.not.isInMultiLineCommentAtPosition(); -for (let i = 1; i < 7; ++i) { - goTo.position(i); - verify.isInMultiLineCommentAtPosition(); -} +goTo.position(firstCommentStart + 1); +verify.isInMultiLineCommentAtPosition(); +goTo.position(firstCommentEnd - 1); +verify.isInMultiLineCommentAtPosition(); -for (let i = 0; i < 2; ++i) { - goTo.position(i * 7); - verify.not.isInMultiLineCommentAtPosition(); -} +goTo.position(firstCommentEnd); +verify.not.isInMultiLineCommentAtPosition(); -const jsDocStart = 8; +const multilineJsDocStart = firstCommentEnd + 1; +const multilineJsDocEnd = multilineJsDocStart + 49; -for (let i = 1; i < 8; ++i) { - goTo.position(jsDocStart + i); - verify.isInMultiLineCommentAtPosition(); -} +goTo.position(multilineJsDocStart); +verify.not.isInMultiLineCommentAtPosition(); +goTo.position(multilineJsDocStart + 1); +verify.isInMultiLineCommentAtPosition(); +goTo.position(multilineJsDocEnd - 1); +verify.isInMultiLineCommentAtPosition(); +goTo.position(multilineJsDocEnd); +verify.not.isInMultiLineCommentAtPosition(); -for (let i = 0; i < 2; ++i) { - goTo.position(jsDocStart + i * 8); - verify.not.isInMultiLineCommentAtPosition(); -} +const singleLineCommentStart = multilineJsDocEnd + 1; -const singleLineCommentStart = 17; +goTo.position(singleLineCommentStart + 1); +verify.not.isInMultiLineCommentAtPosition(); -for (let i = 0; i < 5; ++i) { - goTo.position(singleLineCommentStart + i); - verify.not.isInMultiLineCommentAtPosition(); -} +const postNodeCommentStart = singleLineCommentStart + 16; + +goTo.position(postNodeCommentStart); +verify.not.isInMultiLineCommentAtPosition(); +goTo.position(postNodeCommentStart + 1); +verify.isInMultiLineCommentAtPosition(); From 8fc3fd9a20fb30e8602d20c68c799449497a7870 Mon Sep 17 00:00:00 2001 From: Arthur Ozga Date: Fri, 9 Jun 2017 18:02:42 -0700 Subject: [PATCH 005/237] request returns span --- src/harness/fourslash.ts | 14 +++++++++----- src/harness/harnessLanguageService.ts | 4 ++-- src/server/client.ts | 2 +- src/server/protocol.ts | 16 ++++++++++++---- src/server/session.ts | 9 +++++---- src/services/formatting/formatting.ts | 6 +++--- src/services/services.ts | 7 ++++--- src/services/shims.ts | 11 +++++------ src/services/types.ts | 2 +- 9 files changed, 42 insertions(+), 29 deletions(-) diff --git a/src/harness/fourslash.ts b/src/harness/fourslash.ts index 080614fc62357..3feb5c0b19d27 100644 --- a/src/harness/fourslash.ts +++ b/src/harness/fourslash.ts @@ -2500,13 +2500,17 @@ namespace FourSlash { } } - public verifyIsInMultiLineCommentAtPosition(negative: boolean) { + public verifySpanOfEnclosingComment(negative: boolean, onlyMultiLine: boolean) { const expected = !negative; const position = this.currentCaretPosition; const fileName = this.activeFile.fileName; - const actual = this.languageService.isInMultiLineCommentAtPosition(fileName, position); + const actual = !!this.languageService.getSpanOfEnclosingComment(fileName, position, /*onlyMultiLine*/ onlyMultiLine); if (expected !== actual) { - this.raiseError(`verifyIsInMultiLineCommentAtPosition failed: at position '${position}' in '${fileName}', expected '${expected}'.`); + this.raiseError(`verifySpanOfEnclosingComment failed: + position: '${position}' + fileName: '${fileName}' + onlyMultiLine: '${onlyMultiLine}' + expected: '${expected}'.`); } } @@ -3583,8 +3587,8 @@ namespace FourSlashInterface { this.state.verifyBraceCompletionAtPosition(this.negative, openingBrace); } - public isInMultiLineCommentAtPosition() { - this.state.verifyIsInMultiLineCommentAtPosition(this.negative); + public isInCommentAtPosition(onlyMultiLine: boolean) { + this.state.verifySpanOfEnclosingComment(this.negative, onlyMultiLine); } public codeFixAvailable() { diff --git a/src/harness/harnessLanguageService.ts b/src/harness/harnessLanguageService.ts index 962f9a0df5dcf..6d7eee5757f08 100644 --- a/src/harness/harnessLanguageService.ts +++ b/src/harness/harnessLanguageService.ts @@ -486,8 +486,8 @@ namespace Harness.LanguageService { isValidBraceCompletionAtPosition(fileName: string, position: number, openingBrace: number): boolean { return unwrapJSONCallResult(this.shim.isValidBraceCompletionAtPosition(fileName, position, openingBrace)); } - isInMultiLineCommentAtPosition(fileName: string, position: number): boolean { - return unwrapJSONCallResult(this.shim.getisInMultiLineCommentAtPosition(fileName, position)); + getSpanOfEnclosingComment(fileName: string, position: number, onlyMultiLine: boolean): ts.TextSpan { + return unwrapJSONCallResult(this.shim.getSpanOfEnclosingComment(fileName, position, onlyMultiLine)); } getCodeFixesAtPosition(): ts.CodeAction[] { throw new Error("Not supported on the shim."); diff --git a/src/server/client.ts b/src/server/client.ts index 0e66516da4090..5e5a6fcfcd5dd 100644 --- a/src/server/client.ts +++ b/src/server/client.ts @@ -676,7 +676,7 @@ namespace ts.server { return notImplemented(); } - isInMultiLineCommentAtPosition(_fileName: string, _position: number): boolean { + getSpanOfEnclosingComment(_fileName: string, _position: number, _onlyMultiLine: boolean): TextSpan { return notImplemented(); } diff --git a/src/server/protocol.ts b/src/server/protocol.ts index 299ba4fceedeb..0dc510c4f6e70 100644 --- a/src/server/protocol.ts +++ b/src/server/protocol.ts @@ -8,7 +8,7 @@ namespace ts.server.protocol { /* @internal */ BraceFull = "brace-full", BraceCompletion = "braceCompletion", - isInMultiLineComment = "isInMultiLineComment", + GetSpanOfEnclosingComment = "getSpanOfEnclosingComment", Change = "change", Close = "close", Completions = "completions", @@ -240,10 +240,18 @@ namespace ts.server.protocol { } /** - * A request to determine if the caret is inside a multi-line comment. + * A request to determine if the caret is inside a comment. */ - export interface IsInMultiLineCommentAtPositionRequest extends FileLocationRequest { - command: CommandTypes.isInMultiLineComment; + export interface SpanOfEnclosingCommentRequest extends FileLocationRequest { + command: CommandTypes.GetSpanOfEnclosingComment; + arguments: SpanOfEnclosingCommentRequestArgs; + } + + export interface SpanOfEnclosingCommentRequestArgs extends FileLocationRequestArgs { + /** + * Requires that the enclosing span be a multi-line comment, or else the request returns undefined. + */ + onlyMultiLine: boolean; } /** diff --git a/src/server/session.ts b/src/server/session.ts index 9657c66623847..2be7cade587f8 100644 --- a/src/server/session.ts +++ b/src/server/session.ts @@ -961,11 +961,12 @@ namespace ts.server { return project.getLanguageService(/*ensureSynchronized*/ false).getDocCommentTemplateAtPosition(file, position); } - private getisInMultiLineCommentAtPosition(args: protocol.FileLocationRequestArgs) { + private getSpanOfEnclosingComment(args: protocol.SpanOfEnclosingCommentRequestArgs) { const { file, project } = this.getFileAndProjectWithoutRefreshingInferredProjects(args); const scriptInfo = project.getScriptInfoForNormalizedPath(file); + const onlyMultiLine = args.onlyMultiLine; const position = this.getPosition(args, scriptInfo); - return project.getLanguageService(/*ensureSynchronized*/ false).isInMultiLineCommentAtPosition(file, position); + return project.getLanguageService(/*ensureSynchronized*/ false).getSpanOfEnclosingComment(file, position, onlyMultiLine); } private getIndentation(args: protocol.IndentationRequestArgs) { @@ -1701,8 +1702,8 @@ namespace ts.server { [CommandNames.DocCommentTemplate]: (request: protocol.DocCommentTemplateRequest) => { return this.requiredResponse(this.getDocCommentTemplate(request.arguments)); }, - [CommandNames.isInMultiLineComment]: (request: protocol.IsInMultiLineCommentAtPositionRequest) => { - return this.requiredResponse(this.getisInMultiLineCommentAtPosition(request.arguments)); + [CommandNames.GetSpanOfEnclosingComment]: (request: protocol.SpanOfEnclosingCommentRequest) => { + return this.requiredResponse(this.getSpanOfEnclosingComment(request.arguments)); }, [CommandNames.Format]: (request: protocol.FormatRequest) => { return this.requiredResponse(this.getFormattingEditsForRange(request.arguments)); diff --git a/src/services/formatting/formatting.ts b/src/services/formatting/formatting.ts index 7feba4b7dd242..08d2bd8361688 100644 --- a/src/services/formatting/formatting.ts +++ b/src/services/formatting/formatting.ts @@ -1122,7 +1122,7 @@ namespace ts.formatting { * and a negative value if the position is not in a multi-line comment. */ export function getIndentationOfEnclosingMultiLineComment(sourceFile: SourceFile, position: number, options: EditorSettings): number { - const range = getRangeOfEnclosingComment(sourceFile, position, SyntaxKind.MultiLineCommentTrivia); + const range = getRangeOfEnclosingComment(sourceFile, position, /*onlyMultiLine*/ true); if (range) { const commentStart = range.pos; const commentLineStart = getLineStartPositionForPosition(commentStart, sourceFile); @@ -1132,7 +1132,7 @@ namespace ts.formatting { return undefined; } - export function getRangeOfEnclosingComment(sourceFile: SourceFile, position: number, kind: CommentKind): CommentRange | undefined { + export function getRangeOfEnclosingComment(sourceFile: SourceFile, position: number, onlyMultiLine: boolean): CommentRange | undefined { const precedingToken = findPrecedingToken(position, sourceFile); const trailingRangesOfPreviousToken = precedingToken && getTrailingCommentRanges(sourceFile.text, precedingToken.end); const leadingCommentRangesOfNextToken = getLeadingCommentRangesOfNode(getTokenAtPosition(sourceFile, position, /*includeJsDocComment*/ false), sourceFile); @@ -1143,7 +1143,7 @@ namespace ts.formatting { for (const range of commentRanges) { // We need to extend the range when in an unclosed multi-line comment. if (range.pos < position && (position < range.end || position === range.end && position === sourceFile.getFullWidth())) { - return range.kind === kind ? range : undefined; + return onlyMultiLine && range.kind !== SyntaxKind.MultiLineCommentTrivia ? undefined : range; } } } diff --git a/src/services/services.ts b/src/services/services.ts index 294afec602992..8234a1005226a 100644 --- a/src/services/services.ts +++ b/src/services/services.ts @@ -1818,9 +1818,10 @@ namespace ts { return true; } - function isInMultiLineCommentAtPosition(fileName: string, position: number): boolean { + function getSpanOfEnclosingComment(fileName: string, position: number, onlyMultiLine: boolean) { const sourceFile = syntaxTreeCache.getCurrentSourceFile(fileName); - return !!ts.formatting.getRangeOfEnclosingComment(sourceFile, position, SyntaxKind.MultiLineCommentTrivia); + const range = ts.formatting.getRangeOfEnclosingComment(sourceFile, position, onlyMultiLine); + return range && createTextSpanFromRange(range); } function getTodoComments(fileName: string, descriptors: TodoCommentDescriptor[]): TodoComment[] { @@ -2045,7 +2046,7 @@ namespace ts { getFormattingEditsAfterKeystroke, getDocCommentTemplateAtPosition, isValidBraceCompletionAtPosition, - isInMultiLineCommentAtPosition, + getSpanOfEnclosingComment, getCodeFixesAtPosition, getEmitOutput, getNonBoundSourceFile, diff --git a/src/services/shims.ts b/src/services/shims.ts index fd2ba1cca7297..2e9825e145749 100644 --- a/src/services/shims.ts +++ b/src/services/shims.ts @@ -255,9 +255,9 @@ namespace ts { isValidBraceCompletionAtPosition(fileName: string, position: number, openingBrace: number): string; /** - * Returns JSON-encoded boolean to indicate whether the caret at the current position is in a multi-line comment. + * Returns a JSON-encoded TextSpan | undefined indicating the range of the enclosing comment, if it exists. */ - getisInMultiLineCommentAtPosition(fileName: string, position: number): string; + getSpanOfEnclosingComment(fileName: string, position: number, onlyMultiLine: boolean): string; getEmitOutput(fileName: string): string; getEmitOutputObject(fileName: string): EmitOutput; @@ -840,11 +840,10 @@ namespace ts { ); } - /// GET IS IN MULTI-LINE COMMENT - public getisInMultiLineCommentAtPosition(fileName: string, position: number): string { + public getSpanOfEnclosingComment(fileName: string, position: number, onlyMultiLine: boolean): string { return this.forwardJSONCall( - `getisInMultiLineCommentAtPosition('${fileName}', ${position})`, - () => this.languageService.isInMultiLineCommentAtPosition(fileName, position) + `getSpanOfEnclosingComment('${fileName}', ${position})`, + () => this.languageService.getSpanOfEnclosingComment(fileName, position, onlyMultiLine) ); } diff --git a/src/services/types.ts b/src/services/types.ts index bbd9fa9986cf3..73bf75b5508d7 100644 --- a/src/services/types.ts +++ b/src/services/types.ts @@ -260,7 +260,7 @@ namespace ts { isValidBraceCompletionAtPosition(fileName: string, position: number, openingBrace: number): boolean; - isInMultiLineCommentAtPosition(fileName: string, position: number): boolean; + getSpanOfEnclosingComment(fileName: string, position: number, onlyMultiLine: boolean): TextSpan; getCodeFixesAtPosition(fileName: string, start: number, end: number, errorCodes: number[], formatOptions: FormatCodeSettings): CodeAction[]; getApplicableRefactors(fileName: string, positionOrRaneg: number | TextRange): ApplicableRefactorInfo[]; From cc880915d5b1077477387fb6e4d16cb2fa21e30d Mon Sep 17 00:00:00 2001 From: Arthur Ozga Date: Fri, 9 Jun 2017 21:19:29 -0700 Subject: [PATCH 006/237] fix offsetting and tests --- src/services/formatting/formatting.ts | 5 ++-- tests/cases/fourslash/fourslash.ts | 2 +- tests/cases/fourslash/isInMultiLineComment.ts | 23 ++++++++++--------- .../fourslash/isInMultiLineCommentEOF.ts | 12 ---------- 4 files changed, 16 insertions(+), 26 deletions(-) delete mode 100644 tests/cases/fourslash/isInMultiLineCommentEOF.ts diff --git a/src/services/formatting/formatting.ts b/src/services/formatting/formatting.ts index 08d2bd8361688..b5cede24e95b5 100644 --- a/src/services/formatting/formatting.ts +++ b/src/services/formatting/formatting.ts @@ -1127,7 +1127,7 @@ namespace ts.formatting { const commentStart = range.pos; const commentLineStart = getLineStartPositionForPosition(commentStart, sourceFile); const { column, character } = SmartIndenter.findFirstNonWhitespaceCharacterAndColumn(commentLineStart, commentStart, sourceFile, options); - return range.pos - character + column; + return column + /*length after whitespace ends*/ range.pos - (commentLineStart + character); } return undefined; } @@ -1142,7 +1142,8 @@ namespace ts.formatting { if (commentRanges) { for (const range of commentRanges) { // We need to extend the range when in an unclosed multi-line comment. - if (range.pos < position && (position < range.end || position === range.end && position === sourceFile.getFullWidth())) { + if (range.pos < position && position < range.end || + position === range.end && (range.kind === SyntaxKind.SingleLineCommentTrivia || position === sourceFile.getFullWidth())) { return onlyMultiLine && range.kind !== SyntaxKind.MultiLineCommentTrivia ? undefined : range; } } diff --git a/tests/cases/fourslash/fourslash.ts b/tests/cases/fourslash/fourslash.ts index 96cc152f0fff1..67ab1d2a2e24d 100644 --- a/tests/cases/fourslash/fourslash.ts +++ b/tests/cases/fourslash/fourslash.ts @@ -149,7 +149,7 @@ declare namespace FourSlashInterface { typeDefinitionCountIs(expectedCount: number): void; implementationListIsEmpty(): void; isValidBraceCompletionAtPosition(openingBrace?: string): void; - isInMultiLineCommentAtPosition(): void; + isInCommentAtPosition(onlyMultiLine: boolean): void; codeFixAvailable(): void; applicableRefactorAvailableAtMarker(markerName: string): void; codeFixDiagnosticsAvailableAtMarkers(markerNames: string[], diagnosticCode?: number): void; diff --git a/tests/cases/fourslash/isInMultiLineComment.ts b/tests/cases/fourslash/isInMultiLineComment.ts index 58e4e4d333749..3dc8a6e15d138 100644 --- a/tests/cases/fourslash/isInMultiLineComment.ts +++ b/tests/cases/fourslash/isInMultiLineComment.ts @@ -11,36 +11,37 @@ const firstCommentStart = 0; const firstCommentEnd = 7; goTo.position(firstCommentStart); -verify.not.isInMultiLineCommentAtPosition(); +verify.not.isInCommentAtPosition(/*onlyMultiLine*/ true); goTo.position(firstCommentStart + 1); -verify.isInMultiLineCommentAtPosition(); +verify.isInCommentAtPosition(/*onlyMultiLine*/ true); goTo.position(firstCommentEnd - 1); -verify.isInMultiLineCommentAtPosition(); +verify.isInCommentAtPosition(/*onlyMultiLine*/ true); goTo.position(firstCommentEnd); -verify.not.isInMultiLineCommentAtPosition(); +verify.not.isInCommentAtPosition(/*onlyMultiLine*/ true); const multilineJsDocStart = firstCommentEnd + 1; const multilineJsDocEnd = multilineJsDocStart + 49; goTo.position(multilineJsDocStart); -verify.not.isInMultiLineCommentAtPosition(); +verify.not.isInCommentAtPosition(/*onlyMultiLine*/ true); goTo.position(multilineJsDocStart + 1); -verify.isInMultiLineCommentAtPosition(); +verify.isInCommentAtPosition(/*onlyMultiLine*/ true); goTo.position(multilineJsDocEnd - 1); -verify.isInMultiLineCommentAtPosition(); +verify.isInCommentAtPosition(/*onlyMultiLine*/ true); goTo.position(multilineJsDocEnd); -verify.not.isInMultiLineCommentAtPosition(); +verify.not.isInCommentAtPosition(/*onlyMultiLine*/ true); const singleLineCommentStart = multilineJsDocEnd + 1; goTo.position(singleLineCommentStart + 1); -verify.not.isInMultiLineCommentAtPosition(); +verify.not.isInCommentAtPosition(/*onlyMultiLine*/ true); +verify.isInCommentAtPosition(/*onlyMultiLine*/ false); const postNodeCommentStart = singleLineCommentStart + 16; goTo.position(postNodeCommentStart); -verify.not.isInMultiLineCommentAtPosition(); +verify.not.isInCommentAtPosition(/*onlyMultiLine*/ true); goTo.position(postNodeCommentStart + 1); -verify.isInMultiLineCommentAtPosition(); +verify.isInCommentAtPosition(/*onlyMultiLine*/ true); diff --git a/tests/cases/fourslash/isInMultiLineCommentEOF.ts b/tests/cases/fourslash/isInMultiLineCommentEOF.ts deleted file mode 100644 index 2b65a95834026..0000000000000 --- a/tests/cases/fourslash/isInMultiLineCommentEOF.ts +++ /dev/null @@ -1,12 +0,0 @@ -/// - -// @Filename: f1.ts -//// /* /*0*/ blah /*1*/ */ - -// @Filename: f2.ts -//// /* /*2*/ blah /*3*/ - -for (let i = 0; i < 4; ++i) { - goTo.marker(`${i}`); - verify.isInMultiLineCommentAtPosition(); -} \ No newline at end of file From 2a2595fc5fe997df5659a1f867a2688ada68e1e1 Mon Sep 17 00:00:00 2001 From: Arthur Ozga Date: Mon, 19 Jun 2017 10:57:47 -0700 Subject: [PATCH 007/237] apply formatting after parse error --- src/services/formatting/formatting.ts | 4 +--- tests/cases/fourslash/formatOnEnterEmptyBlock.ts | 16 ++++++++++++++++ tests/cases/fourslash/fourslash.ts | 2 +- 3 files changed, 18 insertions(+), 4 deletions(-) create mode 100644 tests/cases/fourslash/formatOnEnterEmptyBlock.ts diff --git a/src/services/formatting/formatting.ts b/src/services/formatting/formatting.ts index 531b768f6d80f..2450cdca604fa 100644 --- a/src/services/formatting/formatting.ts +++ b/src/services/formatting/formatting.ts @@ -363,7 +363,6 @@ namespace ts.formatting { // formatting context is used by rules provider const formattingContext = new FormattingContext(sourceFile, requestKind, options); - let previousRangeHasError: boolean; let previousRange: TextRangeWithKind; let previousParent: Node; let previousRangeStartLine: number; @@ -848,7 +847,7 @@ namespace ts.formatting { const rangeHasError = rangeContainsError(range); let lineAdded: boolean; - if (!rangeHasError && !previousRangeHasError) { + if (!rangeHasError) { if (!previousRange) { // trim whitespaces starting from the beginning of the span up to the current line const originalStart = sourceFile.getLineAndCharacterOfPosition(originalRange.pos); @@ -863,7 +862,6 @@ namespace ts.formatting { previousRange = range; previousParent = parent; previousRangeStartLine = rangeStart.line; - previousRangeHasError = rangeHasError; return lineAdded; } diff --git a/tests/cases/fourslash/formatOnEnterEmptyBlock.ts b/tests/cases/fourslash/formatOnEnterEmptyBlock.ts new file mode 100644 index 0000000000000..fd24edf4e5fde --- /dev/null +++ b/tests/cases/fourslash/formatOnEnterEmptyBlock.ts @@ -0,0 +1,16 @@ +/// + +//// if (true) { +//// } +//// if () { +//// } + +format.setOption("PlaceOpenBraceOnNewLineForControlBlocks", true); +format.document(); +verify.currentFileContentIs( +`if (true) +{ +} +if () +{ +}`); diff --git a/tests/cases/fourslash/fourslash.ts b/tests/cases/fourslash/fourslash.ts index 767701a2af66e..69a1551635c0a 100644 --- a/tests/cases/fourslash/fourslash.ts +++ b/tests/cases/fourslash/fourslash.ts @@ -329,7 +329,7 @@ declare namespace FourSlashInterface { setFormatOptions(options: FormatCodeOptions): any; selection(startMarker: string, endMarker: string): void; onType(posMarker: string, key: string): void; - setOption(name: string, value: number | string | boolean): void; + setOption(name: keyof FormatCodeOptions, value: number | string | boolean): void; } class cancellation { resetCancelled(): void; From 0dcc8deace445bf7ac069e226025e224abccfe04 Mon Sep 17 00:00:00 2001 From: Arthur Ozga Date: Mon, 19 Jun 2017 11:13:58 -0700 Subject: [PATCH 008/237] update tests --- tests/cases/fourslash/formatEmptyParamList.ts | 2 +- tests/cases/fourslash/formattingOnConstructorSignature.ts | 4 ++-- tests/cases/fourslash/formattingSkippedTokens.ts | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/cases/fourslash/formatEmptyParamList.ts b/tests/cases/fourslash/formatEmptyParamList.ts index a5372010baa88..46c5e0072bb6b 100644 --- a/tests/cases/fourslash/formatEmptyParamList.ts +++ b/tests/cases/fourslash/formatEmptyParamList.ts @@ -2,4 +2,4 @@ ////function f( f: function){/*1*/ goTo.marker("1"); edit.insert("}"); -verify.currentLineContentIs("function f(f: function){ }") \ No newline at end of file +verify.currentLineContentIs("function f(f: function) { }") \ No newline at end of file diff --git a/tests/cases/fourslash/formattingOnConstructorSignature.ts b/tests/cases/fourslash/formattingOnConstructorSignature.ts index 6b91396e532e9..209527e8257db 100644 --- a/tests/cases/fourslash/formattingOnConstructorSignature.ts +++ b/tests/cases/fourslash/formattingOnConstructorSignature.ts @@ -4,6 +4,6 @@ /////*2*/type Stylet = { new () {} } format.document(); goTo.marker("1"); -verify.currentLineContentIs("interface Gourai { new() {} }"); +verify.currentLineContentIs("interface Gourai { new() { } }"); goTo.marker("2"); -verify.currentLineContentIs("type Stylet = { new() {} }"); \ No newline at end of file +verify.currentLineContentIs("type Stylet = { new() { } }"); \ No newline at end of file diff --git a/tests/cases/fourslash/formattingSkippedTokens.ts b/tests/cases/fourslash/formattingSkippedTokens.ts index d3e76e9735474..caf65d1dc2fcb 100644 --- a/tests/cases/fourslash/formattingSkippedTokens.ts +++ b/tests/cases/fourslash/formattingSkippedTokens.ts @@ -14,7 +14,7 @@ verify.currentLineContentIs('foo(): Bar { }'); goTo.marker('2'); verify.currentLineContentIs('function Foo() # { }'); goTo.marker('3'); -verify.currentLineContentIs('4 +:5'); +verify.currentLineContentIs('4 +: 5'); goTo.marker('4'); verify.currentLineContentIs(' : T) { }'); goTo.marker('5'); From 37d4116ae0e69f31425cbd560e0fdf2ad61d10b6 Mon Sep 17 00:00:00 2001 From: Arthur Ozga Date: Mon, 19 Jun 2017 14:22:56 -0700 Subject: [PATCH 009/237] rename test --- ...tOnEnterEmptyBlock.ts => formatIfWithEmptyCondition.ts} | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) rename tests/cases/fourslash/{formatOnEnterEmptyBlock.ts => formatIfWithEmptyCondition.ts} (74%) diff --git a/tests/cases/fourslash/formatOnEnterEmptyBlock.ts b/tests/cases/fourslash/formatIfWithEmptyCondition.ts similarity index 74% rename from tests/cases/fourslash/formatOnEnterEmptyBlock.ts rename to tests/cases/fourslash/formatIfWithEmptyCondition.ts index fd24edf4e5fde..6e949900e22fc 100644 --- a/tests/cases/fourslash/formatOnEnterEmptyBlock.ts +++ b/tests/cases/fourslash/formatIfWithEmptyCondition.ts @@ -1,16 +1,11 @@ /// -//// if (true) { -//// } //// if () { //// } format.setOption("PlaceOpenBraceOnNewLineForControlBlocks", true); format.document(); verify.currentFileContentIs( -`if (true) -{ -} -if () +`if () { }`); From 660a63d82eeb69588acdbbacd2279f47ef6a568d Mon Sep 17 00:00:00 2001 From: Ron Buckton Date: Mon, 19 Jun 2017 14:53:32 -0700 Subject: [PATCH 010/237] Emit class annotation comment on downlevel classes --- src/compiler/transformers/es2015.ts | 4 +- tests/baselines/reference/2dArrays.js | 6 +- ...onAmbientClassWithSameNameAndCommonRoot.js | 2 +- ...hModuleMemberThatUsesClassTypeParameter.js | 12 +- ...GenericClassStaticFunctionOfTheSameName.js | 2 +- ...GenericClassStaticFunctionOfTheSameName.js | 2 +- ...dStaticFunctionUsingClassPrivateStatics.js | 2 +- ...nctionAndExportedFunctionThatShareAName.js | 4 +- ...ionAndNonExportedFunctionThatShareAName.js | 4 +- ...ticVariableAndExportedVarThatShareAName.js | 4 +- ...VariableAndNonExportedVarThatShareAName.js | 4 +- ...ClassAndModuleWithSameNameAndCommonRoot.js | 4 +- .../baselines/reference/ClassDeclaration10.js | 2 +- .../baselines/reference/ClassDeclaration11.js | 2 +- .../baselines/reference/ClassDeclaration13.js | 2 +- .../baselines/reference/ClassDeclaration14.js | 2 +- .../baselines/reference/ClassDeclaration15.js | 2 +- .../baselines/reference/ClassDeclaration21.js | 2 +- .../baselines/reference/ClassDeclaration22.js | 2 +- .../baselines/reference/ClassDeclaration24.js | 2 +- .../baselines/reference/ClassDeclaration25.js | 2 +- .../baselines/reference/ClassDeclaration26.js | 2 +- .../baselines/reference/ClassDeclaration8.js | 2 +- .../baselines/reference/ClassDeclaration9.js | 2 +- ...onWithInvalidConstOnPropertyDeclaration.js | 2 +- ...nWithInvalidConstOnPropertyDeclaration2.js | 2 +- .../reference/ES5For-ofTypeCheck10.js | 2 +- .../baselines/reference/ES5SymbolProperty2.js | 2 +- .../baselines/reference/ES5SymbolProperty3.js | 2 +- .../baselines/reference/ES5SymbolProperty4.js | 2 +- .../baselines/reference/ES5SymbolProperty5.js | 2 +- .../baselines/reference/ES5SymbolProperty6.js | 2 +- .../baselines/reference/ES5SymbolProperty7.js | 2 +- .../EnumAndModuleWithSameNameAndCommonRoot.js | 2 +- .../baselines/reference/ExportAssignment7.js | 2 +- .../baselines/reference/ExportAssignment8.js | 2 +- ...ichExtendsInterfaceWithInaccessibleType.js | 2 +- ...sClassHeritageListMemberTypeAnnotations.js | 6 +- ...naccessibleTypeInIndexerTypeAnnotations.js | 4 +- ...accessibleTypeInTypeParameterConstraint.js | 6 +- ...TypesInParameterAndReturnTypeAnnotation.js | 4 +- ...ccessibleTypesInParameterTypeAnnotation.js | 4 +- ...InaccessibleTypesInReturnTypeAnnotation.js | 4 +- ...WithAccessibleTypesOnItsExportedMembers.js | 4 +- ...hAccessibleTypesInMemberTypeAnnotations.js | 2 +- ...sibleTypesInNestedMemberTypeAnnotations.js | 2 +- ...cTypeWithInaccessibleTypeAsTypeArgument.js | 2 +- .../reference/MemberAccessorDeclaration15.js | 2 +- ...ModuleAndClassWithSameNameAndCommonRoot.js | 4 +- .../ModuleAndEnumWithSameNameAndCommonRoot.js | 2 +- ...ModuleWithExportedAndNonExportedClasses.js | 8 +- ...leWithExportedAndNonExportedImportAlias.js | 2 +- .../NonInitializedExportInInternalModule.js | 4 +- tests/baselines/reference/ParameterList6.js | 2 +- tests/baselines/reference/ParameterList7.js | 2 +- tests/baselines/reference/Protected1.js | 2 +- tests/baselines/reference/Protected3.js | 2 +- tests/baselines/reference/Protected4.js | 2 +- tests/baselines/reference/Protected5.js | 2 +- tests/baselines/reference/Protected6.js | 2 +- tests/baselines/reference/Protected7.js | 2 +- tests/baselines/reference/Protected9.js | 2 +- ...ortedAndNonExportedClassesOfTheSameName.js | 8 +- ...tedAndNonExportedLocalVarsOfTheSameName.js | 2 +- ...rgeEachWithExportedClassesOfTheSameName.js | 8 +- ...eEachWithExportedLocalVarsOfTheSameName.js | 2 +- ...rgeEachWithExportedModulesOfTheSameName.js | 4 +- ...esWithTheSameNameAndDifferentCommonRoot.js | 2 +- ...ModulesWithTheSameNameAndSameCommonRoot.js | 2 +- .../reference/TypeGuardWithArrayUnion.js | 2 +- .../reference/abstractClassInLocalScope.js | 4 +- .../abstractClassInLocalScopeIsAbstract.js | 4 +- tests/baselines/reference/abstractProperty.js | 4 +- .../reference/abstractPropertyNegative.js | 16 +- .../accessInstanceMemberFromStaticMethod01.js | 2 +- .../accessOverriddenBaseClassMember1.js | 4 +- .../accessStaticMemberFromInstanceMethod01.js | 2 +- .../reference/accessibilityModifiers.js | 6 +- .../accessorParameterAccessibilityModifier.js | 2 +- tests/baselines/reference/accessorWithES3.js | 4 +- tests/baselines/reference/accessorWithES5.js | 4 +- .../reference/accessorWithInitializer.js | 2 +- ...sorWithMismatchedAccessibilityModifiers.js | 8 +- .../reference/accessorWithRestParam.js | 2 +- .../accessorsAreNotContextuallyTyped.js | 2 +- tests/baselines/reference/accessorsEmit.js | 6 +- .../reference/accessorsNotAllowedInES3.js | 2 +- .../accessors_spec_section-4.5_error-cases.js | 2 +- .../accessors_spec_section-4.5_inference.js | 6 +- .../additionOperatorWithAnyAndEveryType.js | 2 +- .../additionOperatorWithInvalidOperands.js | 2 +- tests/baselines/reference/aliasAssignments.js | 2 +- tests/baselines/reference/aliasBug.js | 4 +- tests/baselines/reference/aliasErrors.js | 4 +- .../reference/aliasInaccessibleModule2.js | 2 +- .../reference/aliasUsageInAccessorsOfClass.js | 6 +- .../baselines/reference/aliasUsageInArray.js | 4 +- .../aliasUsageInFunctionExpression.js | 4 +- .../reference/aliasUsageInGenericFunction.js | 4 +- .../reference/aliasUsageInIndexerOfClass.js | 8 +- .../reference/aliasUsageInObjectLiteral.js | 4 +- .../reference/aliasUsageInOrExpression.js | 4 +- ...aliasUsageInTypeArgumentOfExtendsClause.js | 8 +- .../reference/aliasUsageInVarAssignment.js | 4 +- .../allowSyntheticDefaultImports1.js | 2 +- .../allowSyntheticDefaultImports2.js | 2 +- .../allowSyntheticDefaultImports3.js | 2 +- ...ntExternalModuleInAnotherExternalModule.js | 2 +- .../ambiguousCallsWhereReturnTypesAgree.js | 4 +- .../reference/ambiguousOverloadResolution.js | 4 +- .../amdImportNotAsPrimaryExpression.js | 2 +- tests/baselines/reference/amdModuleName1.js | 2 +- tests/baselines/reference/amdModuleName2.js | 2 +- tests/baselines/reference/anonterface.js | 2 +- .../reference/anonymousClassExpression1.js | 2 +- .../reference/anonymousClassExpression2.js | 4 +- .../reference/anyAsGenericFunctionCall.js | 2 +- .../anyAssignabilityInInheritance.js | 6 +- .../reference/anyAssignableToEveryType.js | 2 +- .../reference/anyAssignableToEveryType2.js | 6 +- .../reference/anyIdenticalToItself.js | 2 +- .../reference/apparentTypeSubtyping.js | 8 +- .../reference/apparentTypeSupertype.js | 4 +- tests/baselines/reference/argsInScope.js | 2 +- .../argumentsUsedInObjectLiteralProperty.js | 2 +- .../baselines/reference/arithAssignTyping.js | 2 +- .../reference/arrayAssignmentTest1.js | 6 +- .../reference/arrayAssignmentTest2.js | 6 +- .../reference/arrayAssignmentTest3.js | 4 +- .../reference/arrayAssignmentTest4.js | 2 +- .../reference/arrayAssignmentTest5.js | 2 +- .../reference/arrayAssignmentTest6.js | 2 +- .../reference/arrayBestCommonTypes.js | 16 +- .../reference/arrayLiteralContextualType.js | 4 +- .../reference/arrayLiteralTypeInference.js | 6 +- tests/baselines/reference/arrayLiterals.js | 8 +- .../arrayLiteralsWithRecursiveGenerics.js | 6 +- .../reference/arrayOfExportedClass.js | 4 +- .../reference/arrayOfFunctionTypes3.js | 2 +- ...rayOfSubtypeIsAssignableToReadonlyArray.js | 6 +- .../arrayReferenceWithoutTypeArgs.js | 2 +- tests/baselines/reference/arrayconcat.js | 2 +- .../reference/arrowFunctionContexts.js | 8 +- .../reference/arrowFunctionExpressions.js | 2 +- .../arrowFunctionInConstructorArgument1.js | 2 +- tests/baselines/reference/asOperatorASI.js | 2 +- tests/baselines/reference/asiAbstract.js | 6 +- tests/baselines/reference/asiInES6Classes.js | 2 +- .../reference/asiPublicPrivateProtected.js | 14 +- .../assertInWrapSomeTypeParameter.js | 2 +- .../reference/assignAnyToEveryType.js | 2 +- .../reference/assignEveryTypeToAny.js | 2 +- .../reference/assignToExistingClass.js | 4 +- ...assignToObjectTypeWithPrototypeProperty.js | 2 +- .../reference/assignmentCompatBug3.js | 2 +- ...CompatInterfaceWithStringIndexSignature.js | 2 +- .../reference/assignmentCompatOnNew.js | 2 +- .../assignmentCompatWithCallSignatures3.js | 8 +- .../assignmentCompatWithCallSignatures4.js | 8 +- .../assignmentCompatWithCallSignatures5.js | 8 +- .../assignmentCompatWithCallSignatures6.js | 8 +- ...ssignmentCompatWithConstructSignatures3.js | 8 +- ...ssignmentCompatWithConstructSignatures4.js | 8 +- ...ssignmentCompatWithConstructSignatures5.js | 8 +- ...ssignmentCompatWithConstructSignatures6.js | 8 +- ...ricCallSignaturesWithOptionalParameters.js | 8 +- .../assignmentCompatWithNumericIndexer.js | 6 +- .../assignmentCompatWithNumericIndexer3.js | 6 +- .../assignmentCompatWithObjectMembers.js | 8 +- .../assignmentCompatWithObjectMembers2.js | 4 +- .../assignmentCompatWithObjectMembers3.js | 4 +- .../assignmentCompatWithObjectMembers4.js | 20 +- .../assignmentCompatWithObjectMembers5.js | 2 +- ...entCompatWithObjectMembersAccessibility.js | 12 +- ...mentCompatWithObjectMembersNumericNames.js | 4 +- ...nmentCompatWithObjectMembersOptionality.js | 6 +- ...mentCompatWithObjectMembersOptionality2.js | 6 +- ...mpatWithObjectMembersStringNumericNames.js | 8 +- .../assignmentCompatWithOverloads.js | 2 +- .../assignmentCompatWithStringIndexer.js | 8 +- .../assignmentCompatWithStringIndexer3.js | 2 +- .../reference/assignmentCompatability10.js | 2 +- .../reference/assignmentCompatability39.js | 2 +- .../reference/assignmentCompatability40.js | 2 +- .../reference/assignmentCompatability41.js | 2 +- .../reference/assignmentCompatability42.js | 2 +- .../reference/assignmentCompatability8.js | 2 +- .../reference/assignmentCompatability9.js | 2 +- .../reference/assignmentLHSIsValue.js | 4 +- .../assignmentNonObjectTypeConstraints.js | 4 +- .../assignmentToParenthesizedIdentifiers.js | 2 +- .../reference/assignmentToReferenceTypes.js | 2 +- tests/baselines/reference/assignments.js | 2 +- ...asyncArrowFunctionCapturesArguments_es5.js | 2 +- .../asyncArrowFunctionCapturesThis_es5.js | 2 +- .../asyncAwaitIsolatedModules_es5.js | 2 +- tests/baselines/reference/asyncAwait_es5.js | 2 +- tests/baselines/reference/asyncClass_es5.js | 2 +- .../reference/asyncConstructor_es5.js | 2 +- ...unctionDeclarationCapturesArguments_es5.js | 2 +- tests/baselines/reference/asyncGetter_es5.js | 2 +- .../reference/asyncImportedPromise_es5.js | 4 +- .../reference/asyncMethodWithSuper_es5.js | 4 +- .../reference/asyncQualifiedReturnType_es5.js | 2 +- tests/baselines/reference/asyncSetter_es5.js | 2 +- .../reference/augmentExportEquals4.js | 2 +- .../reference/augmentExportEquals6.js | 4 +- .../reference/augmentedTypesClass.js | 4 +- .../reference/augmentedTypesClass2.js | 6 +- .../reference/augmentedTypesClass2a.js | 2 +- .../reference/augmentedTypesClass3.js | 8 +- .../reference/augmentedTypesClass4.js | 4 +- .../baselines/reference/augmentedTypesEnum.js | 2 +- .../reference/augmentedTypesEnum2.js | 2 +- .../augmentedTypesExternalModule1.js | 2 +- .../reference/augmentedTypesFunction.js | 4 +- .../reference/augmentedTypesInterface.js | 2 +- .../reference/augmentedTypesModules.js | 16 +- .../reference/augmentedTypesModules2.js | 2 +- .../reference/augmentedTypesModules3.js | 4 +- .../reference/augmentedTypesModules3b.js | 6 +- .../reference/augmentedTypesModules4.js | 2 +- .../baselines/reference/augmentedTypesVar.js | 4 +- .../autoAsiForStaticsInClassDeclaration.js | 2 +- tests/baselines/reference/autoLift2.js | 2 +- tests/baselines/reference/autolift3.js | 2 +- tests/baselines/reference/autolift4.js | 4 +- tests/baselines/reference/avoid.js | 2 +- .../reference/awaitClassExpression_es5.js | 2 +- tests/baselines/reference/badArraySyntax.js | 2 +- tests/baselines/reference/badThisBinding.js | 2 +- tests/baselines/reference/baseCheck.js | 12 +- .../reference/baseConstraintOfDecorator.js | 2 +- .../reference/baseIndexSignatureResolution.js | 4 +- .../reference/baseTypeAfterDerivedType.js | 2 +- .../reference/baseTypeOrderChecking.js | 8 +- .../reference/baseTypePrivateMemberClash.js | 4 +- .../baseTypeWrappingInstantiationChain.js | 10 +- tests/baselines/reference/bases.js | 4 +- .../bestCommonTypeOfConditionalExpressions.js | 6 +- ...bestCommonTypeOfConditionalExpressions2.js | 6 +- .../reference/bestCommonTypeOfTuple2.js | 12 +- tests/baselines/reference/bind1.js | 2 +- .../binopAssignmentShouldHaveType.js | 2 +- .../bitwiseNotOperatorWithAnyOtherType.js | 2 +- .../bitwiseNotOperatorWithBooleanType.js | 2 +- .../bitwiseNotOperatorWithNumberType.js | 2 +- .../bitwiseNotOperatorWithStringType.js | 2 +- .../blockScopedClassDeclarationAcrossFiles.js | 2 +- ...kScopedFunctionDeclarationInStrictClass.js | 2 +- .../blockScopedNamespaceDifferentFile.js | 2 +- .../blockScopedVariablesUseBeforeDef.js | 16 +- ...ctionWithIncorrectNumberOfTypeArguments.js | 4 +- ...allGenericFunctionWithZeroTypeArguments.js | 4 +- ...callNonGenericFunctionWithTypeArguments.js | 4 +- tests/baselines/reference/callOnClass.js | 2 +- .../callOverloadViaElementAccessExpression.js | 2 +- tests/baselines/reference/callOverloads1.js | 2 +- tests/baselines/reference/callOverloads2.js | 2 +- tests/baselines/reference/callOverloads3.js | 2 +- tests/baselines/reference/callOverloads4.js | 2 +- tests/baselines/reference/callOverloads5.js | 2 +- ...allSignatureAssignabilityInInheritance2.js | 8 +- ...allSignatureAssignabilityInInheritance3.js | 8 +- ...allSignatureAssignabilityInInheritance4.js | 8 +- ...allSignatureAssignabilityInInheritance5.js | 8 +- ...allSignatureAssignabilityInInheritance6.js | 8 +- ...tureWithOptionalParameterAndInitializer.js | 2 +- ...ureWithoutReturnTypeAnnotationInference.js | 6 +- ...sWithAccessibilityModifiersOnParameters.js | 2 +- .../callSignaturesWithDuplicateParameters.js | 2 +- .../callSignaturesWithOptionalParameters.js | 2 +- .../callSignaturesWithOptionalParameters2.js | 2 +- ...callSignaturesWithParameterInitializers.js | 2 +- ...allSignaturesWithParameterInitializers2.js | 2 +- tests/baselines/reference/callWithSpread.js | 4 +- .../cannotInvokeNewOnErrorExpression.js | 2 +- ...captureSuperPropertyAccessInSuperCall01.js | 4 +- .../reference/captureThisInSuperCall.js | 4 +- .../reference/capturedLetConstInLoop10.js | 4 +- .../reference/capturedLetConstInLoop13.js | 2 +- .../reference/capturedLetConstInLoop9.js | 4 +- .../capturedParametersInInitializers1.js | 2 +- .../capturedParametersInInitializers2.js | 4 +- tests/baselines/reference/castParentheses.js | 2 +- tests/baselines/reference/castingTuple.js | 10 +- .../baselines/reference/chainedAssignment1.js | 6 +- .../baselines/reference/chainedAssignment3.js | 4 +- .../reference/chainedAssignmentChecking.js | 6 +- ...arameterConstrainedToOtherTypeParameter.js | 8 +- ...rameterConstrainedToOtherTypeParameter2.js | 4 +- .../reference/checkForObjectTooStrict.js | 6 +- .../reference/checkJsxChildrenProperty10.js | 2 +- .../reference/checkJsxChildrenProperty11.js | 2 +- .../reference/checkJsxChildrenProperty12.js | 4 +- .../reference/checkJsxChildrenProperty13.js | 4 +- .../reference/checkJsxChildrenProperty3.js | 2 +- .../reference/checkJsxChildrenProperty4.js | 2 +- .../reference/checkJsxChildrenProperty5.js | 2 +- .../reference/checkJsxChildrenProperty6.js | 2 +- .../reference/checkJsxChildrenProperty7.js | 2 +- .../reference/checkJsxChildrenProperty8.js | 2 +- .../checkSuperCallBeforeThisAccessing1.js | 4 +- .../checkSuperCallBeforeThisAccessing2.js | 4 +- .../checkSuperCallBeforeThisAccessing3.js | 6 +- .../checkSuperCallBeforeThisAccessing4.js | 4 +- .../checkSuperCallBeforeThisAccessing5.js | 4 +- .../checkSuperCallBeforeThisAccessing6.js | 4 +- .../checkSuperCallBeforeThisAccessing7.js | 4 +- .../checkSuperCallBeforeThisAccessing8.js | 4 +- .../checkSwitchStatementIfCaseTypeIsString.js | 2 +- .../reference/circularImportAlias.js | 4 +- .../reference/circularIndexedAccessErrors.js | 4 +- .../baselines/reference/circularReference.js | 4 +- .../circularTypeAliasForUnionWithClass.js | 6 +- .../circularTypeofWithFunctionModule.js | 4 +- tests/baselines/reference/class2.js | 2 +- .../reference/classAbstractAccessor.js | 2 +- .../reference/classAbstractAsIdentifier.js | 2 +- ...bstractAssignabilityConstructorFunction.js | 2 +- .../classAbstractClinterfaceAssignability.js | 2 +- .../reference/classAbstractConstructor.js | 2 +- .../classAbstractConstructorAssignability.js | 6 +- .../reference/classAbstractCrashedOnce.js | 4 +- .../reference/classAbstractExtends.js | 10 +- .../reference/classAbstractFactoryFunction.js | 4 +- .../reference/classAbstractGeneric.js | 14 +- .../classAbstractImportInstantiation.js | 2 +- .../reference/classAbstractInAModule.js | 4 +- .../reference/classAbstractInheritance.js | 20 +- .../reference/classAbstractInstantiations1.js | 6 +- .../reference/classAbstractInstantiations2.js | 16 +- .../reference/classAbstractManyKeywords.js | 8 +- .../classAbstractMergedDeclaration.js | 16 +- .../classAbstractMethodInNonAbstractClass.js | 4 +- .../classAbstractMethodWithImplementation.js | 2 +- .../classAbstractMixedWithModifiers.js | 2 +- .../reference/classAbstractOverloads.js | 4 +- .../classAbstractOverrideWithAbstract.js | 12 +- .../reference/classAbstractProperties.js | 2 +- .../reference/classAbstractSingleLineDecl.js | 6 +- .../reference/classAbstractSuperCalls.js | 10 +- .../classAbstractUsingAbstractMethod1.js | 6 +- .../classAbstractUsingAbstractMethods2.js | 18 +- .../classAndInterfaceWithSameName.js | 4 +- .../reference/classAndVariableWithSameName.js | 4 +- .../classAppearsToHaveMembersOfObject.js | 2 +- .../baselines/reference/classBlockScoping.js | 4 +- .../reference/classBodyWithStatements.js | 6 +- .../reference/classCannotExtendVar.js | 2 +- .../classConstructorAccessibility.js | 12 +- .../classConstructorAccessibility2.js | 12 +- .../classConstructorAccessibility3.js | 8 +- .../classConstructorAccessibility4.js | 12 +- .../classConstructorAccessibility5.js | 6 +- .../classConstructorOverloadsAccessibility.js | 8 +- ...classConstructorParametersAccessibility.js | 8 +- ...lassConstructorParametersAccessibility2.js | 8 +- ...lassConstructorParametersAccessibility3.js | 4 +- .../classDeclarationBlockScoping1.js | 4 +- .../classDeclarationBlockScoping2.js | 4 +- ...edBeforeDefinitionInFunctionDeclaration.js | 2 +- ...clarationMergedInModuleWithContinuation.js | 4 +- .../classDeclaredBeforeClassFactory.js | 4 +- .../classDoesNotDependOnBaseTypes.js | 4 +- .../classDoesNotDependOnPrivateMember.js | 2 +- tests/baselines/reference/classExpression.js | 6 +- tests/baselines/reference/classExpression1.js | 2 +- tests/baselines/reference/classExpression2.js | 4 +- tests/baselines/reference/classExpression3.js | 6 +- tests/baselines/reference/classExpression4.js | 2 +- tests/baselines/reference/classExpression5.js | 2 +- .../classExpressionExtendingAbstractClass.js | 4 +- .../reference/classExpressionTest1.js | 2 +- .../reference/classExpressionTest2.js | 2 +- .../classExpressionWithDecorator1.js | 2 +- ...onWithResolutionOfNamespaceOfSameName01.js | 2 +- .../classExpressionWithStaticProperties1.js | 2 +- .../classExpressionWithStaticProperties2.js | 2 +- .../classExpressionWithStaticProperties3.js | 2 +- tests/baselines/reference/classExpressions.js | 2 +- .../reference/classExtendingBuiltinType.js | 20 +- .../reference/classExtendingClass.js | 8 +- .../reference/classExtendingClassLikeType.js | 12 +- .../reference/classExtendingNonConstructor.js | 14 +- .../baselines/reference/classExtendingNull.js | 4 +- .../reference/classExtendingPrimitive.js | 20 +- .../reference/classExtendingPrimitive2.js | 4 +- .../reference/classExtendingQualifiedName.js | 4 +- .../reference/classExtendingQualifiedName2.js | 4 +- .../reference/classExtendsAcrossFiles.js | 8 +- ...sMergedWithModuleNotReferingConstructor.js | 4 +- ...tendsClauseClassNotReferringConstructor.js | 4 +- .../reference/classExtendsEveryObjectType.js | 12 +- .../reference/classExtendsEveryObjectType2.js | 4 +- .../reference/classExtendsInterface.js | 8 +- .../classExtendsInterfaceInExpression.js | 2 +- .../classExtendsInterfaceInModule.js | 6 +- ...sInterfaceThatExtendsClassWithPrivates1.js | 4 +- .../baselines/reference/classExtendsItself.js | 6 +- .../reference/classExtendsItselfIndirectly.js | 12 +- .../classExtendsItselfIndirectly2.js | 12 +- .../classExtendsItselfIndirectly3.js | 12 +- .../classExtendsMultipleBaseClasses.js | 6 +- tests/baselines/reference/classExtendsNull.js | 4 +- ...classExtendsShadowedConstructorFunction.js | 4 +- .../classExtendsValidConstructorFunction.js | 2 +- .../classHeritageWithTrailingSeparator.js | 4 +- .../classImplementingInterfaceIndexer.js | 2 +- .../reference/classImplementsClass1.js | 4 +- .../reference/classImplementsClass2.js | 6 +- .../reference/classImplementsClass3.js | 6 +- .../reference/classImplementsClass4.js | 6 +- .../reference/classImplementsClass5.js | 6 +- .../reference/classImplementsClass6.js | 6 +- .../classImplementsImportedInterface.js | 2 +- .../classImplementsMergedClassInterface.js | 8 +- tests/baselines/reference/classIndexer.js | 2 +- tests/baselines/reference/classIndexer2.js | 2 +- tests/baselines/reference/classIndexer3.js | 4 +- tests/baselines/reference/classIndexer4.js | 2 +- tests/baselines/reference/classInheritence.js | 4 +- tests/baselines/reference/classInsideBlock.js | 2 +- .../reference/classIsSubtypeOfBaseType.js | 6 +- .../classMemberInitializerScoping.js | 4 +- .../classMemberInitializerWithLamdaScoping.js | 4 +- ...classMemberInitializerWithLamdaScoping2.js | 2 +- ...classMemberInitializerWithLamdaScoping3.js | 2 +- ...classMemberInitializerWithLamdaScoping4.js | 2 +- ...classMemberInitializerWithLamdaScoping5.js | 2 +- .../classMemberWithMissingIdentifier.js | 2 +- .../classMemberWithMissingIdentifier2.js | 2 +- .../reference/classMethodWithKeywordName1.js | 2 +- tests/baselines/reference/classOrder1.js | 2 +- tests/baselines/reference/classOrder2.js | 4 +- tests/baselines/reference/classOrderBug.js | 6 +- .../reference/classOverloadForFunction.js | 2 +- .../reference/classOverloadForFunction2.js | 2 +- .../reference/classPropertyAsPrivate.js | 2 +- .../reference/classPropertyAsProtected.js | 2 +- .../classPropertyIsPublicByDefault.js | 2 +- .../reference/classSideInheritance1.js | 4 +- .../reference/classSideInheritance2.js | 4 +- .../reference/classSideInheritance3.js | 6 +- .../reference/classStaticPropertyTypeGuard.js | 2 +- .../reference/classTypeParametersInStatics.js | 2 +- tests/baselines/reference/classUpdateTests.js | 36 +-- .../classWithBaseClassButNoConstructor.js | 12 +- .../reference/classWithConstructors.js | 12 +- .../reference/classWithDuplicateIdentifier.js | 6 +- .../baselines/reference/classWithEmptyBody.js | 4 +- .../reference/classWithEmptyTypeParameter.js | 2 +- .../reference/classWithMultipleBaseClasses.js | 6 +- .../classWithNoConstructorOrBaseClass.js | 4 +- ...hOnlyPublicMembersEquivalentToInterface.js | 2 +- ...OnlyPublicMembersEquivalentToInterface2.js | 2 +- .../reference/classWithOptionalParameter.js | 4 +- ...ssWithOverloadImplementationOfWrongName.js | 2 +- ...sWithOverloadImplementationOfWrongName2.js | 2 +- .../classWithPredefinedTypesAsNames.js | 8 +- .../classWithPredefinedTypesAsNames2.js | 2 +- .../reference/classWithPrivateProperty.js | 2 +- .../reference/classWithProtectedProperty.js | 4 +- .../reference/classWithPublicProperty.js | 2 +- .../classWithSemicolonClassElement1.js | 2 +- .../classWithSemicolonClassElement2.js | 2 +- .../reference/classWithStaticMembers.js | 4 +- .../classWithTwoConstructorDefinitions.js | 4 +- .../classWithoutExplicitConstructor.js | 4 +- tests/baselines/reference/classdecl.js | 20 +- tests/baselines/reference/clinterfaces.js | 8 +- .../cloduleAcrossModuleDefinitions.js | 2 +- .../reference/cloduleAndTypeParameters.js | 4 +- .../reference/cloduleSplitAcrossFiles.js | 2 +- .../reference/cloduleStaticMembers.js | 2 +- .../reference/cloduleWithDuplicateMember1.js | 2 +- .../reference/cloduleWithDuplicateMember2.js | 2 +- .../cloduleWithPriorInstantiatedModule.js | 4 +- .../cloduleWithPriorUninstantiatedModule.js | 4 +- .../cloduleWithRecursiveReference.js | 2 +- .../reference/clodulesDerivedClasses.js | 4 +- .../collisionArgumentsClassConstructor.js | 20 +- .../collisionArgumentsClassMethod.js | 4 +- ...lisionCodeGenModuleWithAccessorChildren.js | 10 +- ...ionCodeGenModuleWithConstructorChildren.js | 6 +- ...ionCodeGenModuleWithMemberClassConflict.js | 6 +- ...odeGenModuleWithMemberInterfaceConflict.js | 2 +- ...ollisionCodeGenModuleWithMethodChildren.js | 8 +- ...ollisionCodeGenModuleWithModuleChildren.js | 2 +- ...llisionCodeGenModuleWithModuleReopening.js | 8 +- ...collisionCodeGenModuleWithPrivateMember.js | 4 +- .../collisionCodeGenModuleWithUnicodeNames.js | 2 +- .../collisionExportsRequireAndClass.js | 24 +- ...ionExportsRequireAndInternalModuleAlias.js | 2 +- ...quireAndInternalModuleAliasInGlobalFile.js | 2 +- .../collisionExportsRequireAndModule.js | 24 +- .../collisionRestParameterClassConstructor.js | 16 +- .../collisionRestParameterClassMethod.js | 4 +- .../collisionRestParameterUnderscoreIUsage.js | 2 +- ...llisionSuperAndLocalFunctionInAccessors.js | 6 +- ...isionSuperAndLocalFunctionInConstructor.js | 6 +- .../collisionSuperAndLocalFunctionInMethod.js | 6 +- ...ollisionSuperAndLocalFunctionInProperty.js | 4 +- .../collisionSuperAndLocalVarInAccessors.js | 6 +- .../collisionSuperAndLocalVarInConstructor.js | 6 +- .../collisionSuperAndLocalVarInMethod.js | 6 +- .../collisionSuperAndLocalVarInProperty.js | 4 +- .../collisionSuperAndNameResolution.js | 4 +- .../reference/collisionSuperAndParameter.js | 6 +- .../reference/collisionSuperAndParameter1.js | 4 +- ...perAndPropertyNameAsConstuctorParameter.js | 10 +- ...collisionThisExpressionAndClassInGlobal.js | 2 +- ...ionThisExpressionAndLocalVarInAccessors.js | 4 +- ...nThisExpressionAndLocalVarInConstructor.js | 4 +- ...lisionThisExpressionAndLocalVarInMethod.js | 2 +- ...sionThisExpressionAndLocalVarInProperty.js | 4 +- ...xpressionAndLocalVarWithSuperExperssion.js | 6 +- ...ollisionThisExpressionAndModuleInGlobal.js | 2 +- ...ollisionThisExpressionAndNameResolution.js | 2 +- .../collisionThisExpressionAndParameter.js | 6 +- ...ionAndPropertyNameAsConstuctorParameter.js | 8 +- ...ommaOperatorWithSecondOperandObjectType.js | 2 +- .../reference/commentBeforeStaticMethod1.js | 2 +- .../reference/commentOnClassAccessor1.js | 2 +- .../reference/commentOnClassAccessor2.js | 2 +- .../reference/commentOnClassMethod1.js | 2 +- .../commentOnDecoratedClassDeclaration.js | 4 +- .../reference/commentOnSignature1.js | 2 +- .../reference/commentOnStaticMember1.js | 2 +- tests/baselines/reference/commentsClass.js | 16 +- .../reference/commentsClassMembers.js | 4 +- .../reference/commentsCommentParsing.js | 2 +- .../reference/commentsDottedModuleName.js | 2 +- .../reference/commentsExternalModules.js | 4 +- .../reference/commentsExternalModules2.js | 4 +- .../reference/commentsExternalModules3.js | 4 +- .../baselines/reference/commentsFormatting.js | 8 +- .../reference/commentsInheritance.js | 8 +- tests/baselines/reference/commentsModules.js | 18 +- .../reference/commentsMultiModuleMultiFile.js | 10 +- .../commentsMultiModuleSingleFile.js | 8 +- .../reference/commentsOnReturnStatement1.js | 2 +- .../reference/commentsOnStaticMembers.js | 2 +- .../baselines/reference/commentsOverloads.js | 12 +- .../reference/commentsTypeParameters.js | 2 +- .../reference/commentsemitComments.js | 4 +- .../commonJSImportAsPrimaryExpression.js | 2 +- .../commonJSImportNotAsPrimaryExpression.js | 2 +- .../comparisonOperatorWithIdenticalObjects.js | 10 +- ...ithNoRelationshipObjectsOnCallSignature.js | 6 +- ...lationshipObjectsOnConstructorSignature.js | 6 +- ...thNoRelationshipObjectsOnIndexSignature.js | 6 +- ...nshipObjectsOnInstantiatedCallSignature.js | 6 +- ...jectsOnInstantiatedConstructorSignature.js | 6 +- ...atorWithNoRelationshipObjectsOnProperty.js | 8 +- ...peratorWithSubtypeObjectOnCallSignature.js | 4 +- ...WithSubtypeObjectOnConstructorSignature.js | 4 +- ...eratorWithSubtypeObjectOnIndexSignature.js | 4 +- ...ubtypeObjectOnInstantiatedCallSignature.js | 4 +- ...bjectOnInstantiatedConstructorSignature.js | 4 +- ...isonOperatorWithSubtypeObjectOnProperty.js | 12 +- .../reference/complexClassRelationships.js | 16 +- .../reference/complexNarrowingWithAny.js | 18 +- ...catedGenericRecursiveBaseClassReference.js | 2 +- .../baselines/reference/complicatedPrivacy.js | 12 +- .../reference/compoundAssignmentLHSIsValue.js | 4 +- ...poundExponentiationAssignmentLHSIsValue.js | 4 +- .../reference/computedPropertyNames12_ES5.js | 2 +- .../reference/computedPropertyNames13_ES5.js | 2 +- .../reference/computedPropertyNames14_ES5.js | 2 +- .../reference/computedPropertyNames15_ES5.js | 2 +- .../reference/computedPropertyNames16_ES5.js | 2 +- .../reference/computedPropertyNames17_ES5.js | 2 +- .../reference/computedPropertyNames21_ES5.js | 2 +- .../reference/computedPropertyNames22_ES5.js | 2 +- .../reference/computedPropertyNames23_ES5.js | 2 +- .../reference/computedPropertyNames24_ES5.js | 4 +- .../reference/computedPropertyNames25_ES5.js | 4 +- .../reference/computedPropertyNames26_ES5.js | 4 +- .../reference/computedPropertyNames27_ES5.js | 4 +- .../reference/computedPropertyNames28_ES5.js | 4 +- .../reference/computedPropertyNames29_ES5.js | 2 +- .../reference/computedPropertyNames2_ES5.js | 2 +- .../reference/computedPropertyNames30_ES5.js | 4 +- .../reference/computedPropertyNames31_ES5.js | 4 +- .../reference/computedPropertyNames32_ES5.js | 2 +- .../reference/computedPropertyNames33_ES5.js | 2 +- .../reference/computedPropertyNames34_ES5.js | 2 +- .../reference/computedPropertyNames36_ES5.js | 6 +- .../reference/computedPropertyNames37_ES5.js | 6 +- .../reference/computedPropertyNames38_ES5.js | 6 +- .../reference/computedPropertyNames39_ES5.js | 6 +- .../reference/computedPropertyNames3_ES5.js | 2 +- .../reference/computedPropertyNames40_ES5.js | 6 +- .../reference/computedPropertyNames41_ES5.js | 6 +- .../reference/computedPropertyNames42_ES5.js | 6 +- .../reference/computedPropertyNames43_ES5.js | 8 +- .../reference/computedPropertyNames44_ES5.js | 8 +- .../reference/computedPropertyNames45_ES5.js | 8 +- ...mputedPropertyNamesDeclarationEmit1_ES5.js | 2 +- ...mputedPropertyNamesDeclarationEmit2_ES5.js | 2 +- .../computedPropertyNamesOnOverloads_ES5.js | 2 +- .../computedPropertyNamesSourceMap1_ES5.js | 2 +- ...dPropertyNamesSourceMap1_ES5.sourcemap.txt | 2 +- .../reference/concatClassAndString.js | 2 +- ...onditionalOperatorConditionIsObjectType.js | 2 +- .../conditionalOperatorWithIdenticalBCT.js | 6 +- .../conditionalOperatorWithoutIdenticalBCT.js | 6 +- .../reference/conflictMarkerDiff3Trivia1.js | 2 +- .../reference/conflictMarkerDiff3Trivia2.js | 2 +- .../reference/conflictMarkerTrivia1.js | 2 +- .../reference/conflictMarkerTrivia2.js | 2 +- ...nstDeclarationShadowedByVarDeclaration3.js | 2 +- .../reference/constEnumMergingWithValues2.js | 2 +- .../reference/constantOverloadFunction.js | 8 +- .../constantOverloadFunctionNoSubtypeError.js | 8 +- ...nstraintCheckInGenericBaseTypeReference.js | 10 +- .../constraintSatisfactionWithAny.js | 6 +- .../constraintSatisfactionWithEmptyObject.js | 4 +- ...straintsThatReferenceOtherContstraints1.js | 4 +- .../constraintsUsedInPrototypeProperty.js | 2 +- ...uctSignatureAssignabilityInInheritance2.js | 8 +- ...uctSignatureAssignabilityInInheritance3.js | 8 +- ...uctSignatureAssignabilityInInheritance4.js | 8 +- ...uctSignatureAssignabilityInInheritance5.js | 8 +- ...uctSignatureAssignabilityInInheritance6.js | 8 +- ...eWithAccessibilityModifiersOnParameters.js | 6 +- ...WithAccessibilityModifiersOnParameters2.js | 6 +- ...nstructSignaturesWithIdenticalOverloads.js | 4 +- .../constructSignaturesWithOverloads.js | 4 +- .../constructSignaturesWithOverloads2.js | 4 +- ...WithOverloadsThatDifferOnlyByReturnType.js | 4 +- .../constructableDecoratorOnClass01.js | 4 +- .../constructorArgWithGenericCallSignature.js | 2 +- tests/baselines/reference/constructorArgs.js | 4 +- .../reference/constructorArgsErrors1.js | 2 +- .../reference/constructorArgsErrors2.js | 2 +- .../reference/constructorArgsErrors3.js | 2 +- .../reference/constructorArgsErrors4.js | 2 +- .../reference/constructorArgsErrors5.js | 2 +- ...constructorDefaultValuesReferencingThis.js | 6 +- ...uctorFunctionTypeIsAssignableToBaseType.js | 6 +- ...ctorFunctionTypeIsAssignableToBaseType2.js | 6 +- .../constructorHasPrototypeProperty.js | 8 +- ...structorImplementationWithDefaultValues.js | 6 +- ...tructorImplementationWithDefaultValues2.js | 6 +- ...constructorInvocationWithTooFewTypeArgs.js | 2 +- .../reference/constructorOverloads1.js | 2 +- .../reference/constructorOverloads2.js | 4 +- .../reference/constructorOverloads3.js | 2 +- .../reference/constructorOverloads8.js | 4 +- .../constructorOverloadsWithDefaultValues.js | 4 +- ...structorOverloadsWithOptionalParameters.js | 4 +- .../constructorParameterProperties.js | 4 +- .../constructorParameterProperties2.js | 8 +- .../constructorParameterShadowsOuterScopes.js | 4 +- ...tructorParametersInVariableDeclarations.js | 4 +- ...adowExternalNamesInVariableDeclarations.js | 4 +- .../constructorReturningAPrimitive.js | 4 +- .../constructorReturnsInvalidType.js | 2 +- .../reference/constructorStaticParamName.js | 2 +- .../constructorStaticParamNameErrors.js | 2 +- ...nstructorWithAssignableReturnExpression.js | 10 +- .../reference/constructorWithCapturedSuper.js | 8 +- .../constructorWithExpressionLessReturn.js | 8 +- ...constructorWithIncompleteTypeAnnotation.js | 12 +- .../constructorsWithSpecializedSignatures.js | 4 +- .../contextualTypeAppliedToVarArgs.js | 2 +- .../reference/contextualTypeWithTuple.js | 4 +- tests/baselines/reference/contextualTyping.js | 6 +- .../reference/contextualTyping.sourcemap.txt | 22 +- .../baselines/reference/contextualTyping10.js | 2 +- .../baselines/reference/contextualTyping11.js | 2 +- .../baselines/reference/contextualTyping12.js | 2 +- .../baselines/reference/contextualTyping14.js | 2 +- .../baselines/reference/contextualTyping15.js | 2 +- .../baselines/reference/contextualTyping3.js | 2 +- .../baselines/reference/contextualTyping4.js | 2 +- .../baselines/reference/contextualTyping5.js | 2 +- .../contextualTypingArrayOfLambdas.js | 6 +- ...contextualTypingOfConditionalExpression.js | 6 +- ...ontextualTypingOfConditionalExpression2.js | 6 +- ...TypedClassExpressionMethodDeclaration01.js | 6 +- ...TypedClassExpressionMethodDeclaration02.js | 6 +- .../controlFlowPropertyDeclarations.js | 4 +- .../controlFlowPropertyInitializer.js | 2 +- .../controlFlowSuperPropertyAccess.js | 4 +- .../baselines/reference/convertKeywordsYes.js | 30 +-- tests/baselines/reference/covariance1.js | 2 +- .../crashInresolveReturnStatement.js | 6 +- ...urcePropertyIsRelatableToTargetProperty.js | 4 +- ...rashIntypeCheckObjectCreationExpression.js | 2 +- .../reference/crashOnMethodSignatures.js | 2 +- .../reference/crashRegressionTest.js | 4 +- tests/baselines/reference/createArray.js | 2 +- .../reference/customTransforms/after.js | 2 +- .../reference/customTransforms/before.js | 2 +- .../reference/customTransforms/both.js | 2 +- .../baselines/reference/declFileAccessors.js | 4 +- .../declFileAliasUseBeforeDeclaration.js | 2 +- .../reference/declFileClassExtendsNull.js | 2 +- .../declFileClassWithIndexSignature.js | 2 +- ...assWithStaticMethodReturningConstructor.js | 2 +- .../reference/declFileConstructors.js | 32 +-- .../reference/declFileExportImportChain.js | 2 +- .../reference/declFileExportImportChain2.js | 2 +- ...declFileForClassWithMultipleBaseClasses.js | 6 +- ...leForClassWithPrivateOverloadedFunction.js | 2 +- .../declFileForFunctionTypeAsTypeParameter.js | 4 +- .../reference/declFileForTypeParameters.js | 2 +- ...ileGenericClassWithGenericExtendedClass.js | 6 +- .../reference/declFileGenericType.js | 8 +- .../reference/declFileGenericType2.js | 4 +- .../declFileImportChainInExportAssignment.js | 2 +- ...eclFileImportedTypeUseInTypeArgPosition.js | 2 +- .../reference/declFileInternalAliases.js | 2 +- tests/baselines/reference/declFileMethods.js | 4 +- ...ModuleAssignmentInObjectLiteralProperty.js | 2 +- .../reference/declFileModuleContinuation.js | 2 +- .../declFileModuleWithPropertyOfTypeModule.js | 2 +- .../declFilePrivateMethodOverloads.js | 2 +- .../reference/declFilePrivateStatic.js | 2 +- .../declFileTypeAnnotationArrayType.js | 8 +- .../declFileTypeAnnotationParenType.js | 2 +- .../declFileTypeAnnotationTupleType.js | 8 +- .../declFileTypeAnnotationTypeAlias.js | 6 +- .../declFileTypeAnnotationTypeLiteral.js | 6 +- .../declFileTypeAnnotationTypeQuery.js | 8 +- .../declFileTypeAnnotationTypeReference.js | 8 +- .../declFileTypeAnnotationUnionType.js | 8 +- ...eTypeAnnotationVisibilityErrorAccessors.js | 8 +- ...ationVisibilityErrorParameterOfFunction.js | 6 +- ...tionVisibilityErrorReturnTypeOfFunction.js | 6 +- ...eTypeAnnotationVisibilityErrorTypeAlias.js | 10 +- ...ypeAnnotationVisibilityErrorTypeLiteral.js | 4 +- ...ationVisibilityErrorVariableDeclaration.js | 6 +- .../reference/declFileTypeofClass.js | 4 +- .../declFileTypeofInAnonymousType.js | 2 +- ...lictingWithClassReferredByExtendsClause.js | 4 +- ...dsClauseThatHasItsContainerNameConflict.js | 4 +- ...rnalModuleNameConflictsInExtendsClause1.js | 2 +- ...rnalModuleNameConflictsInExtendsClause2.js | 2 +- ...rnalModuleNameConflictsInExtendsClause3.js | 2 +- tests/baselines/reference/declInput-2.js | 6 +- tests/baselines/reference/declInput.js | 2 +- tests/baselines/reference/declInput3.js | 2 +- tests/baselines/reference/declInput4.js | 6 +- .../declarationEmitClassMemberNameConflict.js | 8 +- ...declarationEmitClassMemberNameConflict2.js | 2 +- .../declarationEmitClassPrivateConstructor.js | 8 +- ...declarationEmitClassPrivateConstructor2.js | 4 +- ...ionEmitDestructuringParameterProperties.js | 6 +- ...eclarationEmitDestructuringPrivacyError.js | 2 +- .../declarationEmitDetachedComment1.js | 6 +- .../declarationEmitExpressionInExtends.js | 4 +- .../declarationEmitExpressionInExtends2.js | 4 +- .../declarationEmitExpressionInExtends3.js | 12 +- .../declarationEmitExpressionInExtends4.js | 8 +- .../declarationEmitExpressionInExtends5.js | 4 +- ...ationEmitImportInExportAssignmentModule.js | 2 +- ...faceWithNonEntityNameExpressionHeritage.js | 2 +- .../reference/declarationEmitNameConflicts.js | 8 +- .../declarationEmitNameConflicts2.js | 2 +- .../declarationEmitNameConflicts3.js | 4 +- .../declarationEmitParameterProperty.js | 2 +- .../declarationEmitProtectedMembers.js | 8 +- .../reference/declarationEmitReadonly.js | 2 +- .../declarationEmitThisPredicates01.js | 4 +- ...tionEmitThisPredicatesWithPrivateName01.js | 4 +- .../declarationFileOverwriteError.js | 2 +- .../declarationFileOverwriteErrorWithOut.js | 2 +- tests/baselines/reference/declarationFiles.js | 8 +- .../reference/declarationMerging1.js | 2 +- .../reference/declarationMerging2.js | 2 +- .../reference/declareDottedExtend.js | 4 +- ...ifierAsBeginningOfStatementExpression01.js | 2 +- .../reference/decoratorCallGeneric.js | 2 +- .../decoratorChecksFunctionBodies.js | 2 +- ...ratorInstantiateModulesInFunctionBodies.js | 2 +- .../baselines/reference/decoratorMetadata.js | 4 +- ...taForMethodWithNoReturnTypeAnnotation01.js | 2 +- .../decoratorMetadataOnInferredType.js | 4 +- ...orMetadataRestParameterWithImportedType.js | 8 +- .../decoratorMetadataWithConstructorType.js | 4 +- ...adataWithImportDeclarationNameCollision.js | 4 +- ...dataWithImportDeclarationNameCollision2.js | 4 +- ...dataWithImportDeclarationNameCollision3.js | 4 +- ...dataWithImportDeclarationNameCollision4.js | 4 +- ...dataWithImportDeclarationNameCollision5.js | 4 +- ...dataWithImportDeclarationNameCollision6.js | 4 +- ...dataWithImportDeclarationNameCollision7.js | 4 +- ...dataWithImportDeclarationNameCollision8.js | 4 +- .../baselines/reference/decoratorOnClass1.js | 2 +- .../baselines/reference/decoratorOnClass2.js | 2 +- .../baselines/reference/decoratorOnClass3.js | 2 +- .../baselines/reference/decoratorOnClass4.js | 2 +- .../baselines/reference/decoratorOnClass5.js | 2 +- .../baselines/reference/decoratorOnClass8.js | 2 +- .../baselines/reference/decoratorOnClass9.js | 4 +- .../reference/decoratorOnClassAccessor1.js | 2 +- .../reference/decoratorOnClassAccessor2.js | 2 +- .../reference/decoratorOnClassAccessor3.js | 2 +- .../reference/decoratorOnClassAccessor4.js | 2 +- .../reference/decoratorOnClassAccessor5.js | 2 +- .../reference/decoratorOnClassAccessor6.js | 2 +- .../reference/decoratorOnClassAccessor7.js | 12 +- .../reference/decoratorOnClassAccessor8.js | 12 +- .../reference/decoratorOnClassConstructor1.js | 2 +- .../reference/decoratorOnClassConstructor2.js | 4 +- .../reference/decoratorOnClassConstructor3.js | 4 +- .../reference/decoratorOnClassConstructor4.js | 6 +- .../decoratorOnClassConstructorParameter1.js | 2 +- .../decoratorOnClassConstructorParameter4.js | 2 +- .../reference/decoratorOnClassMethod1.js | 2 +- .../reference/decoratorOnClassMethod10.js | 2 +- .../reference/decoratorOnClassMethod11.js | 2 +- .../reference/decoratorOnClassMethod12.js | 4 +- .../reference/decoratorOnClassMethod2.js | 2 +- .../reference/decoratorOnClassMethod3.js | 2 +- .../reference/decoratorOnClassMethod8.js | 2 +- .../decoratorOnClassMethodOverload1.js | 2 +- .../decoratorOnClassMethodOverload2.js | 2 +- .../decoratorOnClassMethodParameter1.js | 2 +- .../reference/decoratorOnClassProperty1.js | 2 +- .../reference/decoratorOnClassProperty10.js | 2 +- .../reference/decoratorOnClassProperty11.js | 2 +- .../reference/decoratorOnClassProperty2.js | 2 +- .../reference/decoratorOnClassProperty3.js | 2 +- .../reference/decoratorOnClassProperty6.js | 2 +- .../reference/decoratorOnClassProperty7.js | 2 +- .../decoratorWithUnderscoreMethod.js | 2 +- .../decrementOperatorWithAnyOtherType.js | 2 +- ...eratorWithAnyOtherTypeInvalidOperations.js | 2 +- .../decrementOperatorWithNumberType.js | 2 +- ...OperatorWithNumberTypeInvalidOperations.js | 2 +- ...ementOperatorWithUnsupportedBooleanType.js | 2 +- ...rementOperatorWithUnsupportedStringType.js | 2 +- .../reference/defaultArgsInOverloads.js | 2 +- .../reference/defaultExportsCannotMerge02.js | 2 +- .../reference/defaultExportsCannotMerge03.js | 2 +- .../baselines/reference/defaultIndexProps1.js | 2 +- .../baselines/reference/defaultIndexProps2.js | 2 +- .../defaultValueInConstructorOverload1.js | 2 +- .../deleteOperatorInvalidOperations.js | 2 +- .../deleteOperatorWithAnyOtherType.js | 2 +- .../deleteOperatorWithBooleanType.js | 2 +- .../reference/deleteOperatorWithNumberType.js | 2 +- .../reference/deleteOperatorWithStringType.js | 2 +- .../reference/dependencyViaImportAlias.js | 2 +- ...edClassConstructorWithExplicitReturns01.js | 4 +- ...tructorWithExplicitReturns01.sourcemap.txt | 6 +- ...derivedClassConstructorWithoutSuperCall.js | 12 +- ...ClassFunctionOverridesBaseClassAccessor.js | 4 +- .../derivedClassIncludesInheritedMembers.js | 8 +- ...idesIndexersWithAssignmentCompatibility.js | 8 +- .../derivedClassOverridesPrivateFunction1.js | 4 +- .../derivedClassOverridesPrivates.js | 8 +- .../derivedClassOverridesProtectedMembers.js | 4 +- .../derivedClassOverridesProtectedMembers2.js | 8 +- .../derivedClassOverridesProtectedMembers3.js | 22 +- .../derivedClassOverridesProtectedMembers4.js | 6 +- .../derivedClassOverridesPublicMembers.js | 8 +- .../derivedClassOverridesWithoutSubtype.js | 8 +- .../derivedClassParameterProperties.js | 24 +- ...dClassSuperCallsInNonConstructorMembers.js | 4 +- .../derivedClassSuperCallsWithThisArg.js | 10 +- .../reference/derivedClassTransitivity.js | 6 +- .../reference/derivedClassTransitivity2.js | 6 +- .../reference/derivedClassTransitivity3.js | 6 +- .../reference/derivedClassTransitivity4.js | 6 +- .../reference/derivedClassWithAny.js | 6 +- ...ivateInstanceShadowingProtectedInstance.js | 4 +- ...hPrivateInstanceShadowingPublicInstance.js | 4 +- ...thPrivateStaticShadowingProtectedStatic.js | 4 +- ...sWithPrivateStaticShadowingPublicStatic.js | 4 +- .../derivedClassWithoutExplicitConstructor.js | 8 +- ...derivedClassWithoutExplicitConstructor2.js | 8 +- ...derivedClassWithoutExplicitConstructor3.js | 12 +- tests/baselines/reference/derivedClasses.js | 6 +- .../reference/derivedGenericClassWithAny.js | 6 +- ...sesHiddenBaseCallViaSuperPropertyAccess.js | 4 +- ...edTypeCallingBaseImplWithOptionalParams.js | 2 +- .../derivedTypeDoesNotRequireExtendsClause.js | 6 +- .../destructuringParameterDeclaration1ES5.js | 4 +- ...cturingParameterDeclaration1ES5iterable.js | 4 +- .../destructuringParameterDeclaration2.js | 2 +- .../destructuringParameterDeclaration4.js | 2 +- .../destructuringParameterDeclaration5.js | 8 +- .../destructuringParameterProperties1.js | 6 +- .../destructuringParameterProperties2.js | 2 +- .../destructuringParameterProperties3.js | 2 +- .../destructuringParameterProperties5.js | 2 +- .../destructuringWithGenericParameter.js | 2 +- .../destructuringWithNewExpression.js | 2 +- .../detachedCommentAtStartOfConstructor1.js | 2 +- .../detachedCommentAtStartOfConstructor2.js | 2 +- .../detachedCommentAtStartOfFunctionBody1.js | 2 +- .../detachedCommentAtStartOfFunctionBody2.js | 2 +- ...detachedCommentAtStartOfLambdaFunction1.js | 2 +- ...detachedCommentAtStartOfLambdaFunction2.js | 2 +- .../reference/differentTypesWithSameName.js | 4 +- .../directDependenceBetweenTypeAliases.js | 4 +- .../disallowLineTerminatorBeforeArrow.js | 2 +- .../reference/dottedSymbolResolution1.js | 2 +- .../reference/downlevelLetConst16.js | 4 +- .../reference/duplicateAnonymousInners1.js | 6 +- .../duplicateAnonymousModuleClasses.js | 12 +- .../reference/duplicateClassElements.js | 2 +- .../duplicateConstructorOverloadSignature.js | 2 +- .../duplicateConstructorOverloadSignature2.js | 2 +- .../reference/duplicateExportAssignments.js | 4 +- .../duplicateIdentifierComputedName.js | 2 +- .../duplicateIdentifierDifferentModifiers.js | 4 +- .../duplicateIdentifierDifferentSpelling.js | 2 +- ...ateIdentifiersAcrossContainerBoundaries.js | 10 +- ...uplicateIdentifiersAcrossFileBoundaries.js | 10 +- .../reference/duplicateLocalVariable1.js | 4 +- .../reference/duplicateLocalVariable2.js | 4 +- .../reference/duplicateNumericIndexers.js | 2 +- .../reference/duplicatePropertyNames.js | 2 +- .../reference/duplicateStringIndexers.js | 2 +- .../duplicateSymbolsExportMatching.js | 2 +- .../reference/duplicateTypeParameters2.js | 4 +- .../reference/duplicateVariablesByScope.js | 2 +- tests/baselines/reference/elaboratedErrors.js | 2 +- .../emitArrowFunctionWhenUsingArguments12.js | 2 +- .../emitBundleWithPrologueDirectives1.js | 4 +- .../reference/emitBundleWithShebang1.js | 4 +- .../reference/emitBundleWithShebang2.js | 8 +- ...BundleWithShebangAndPrologueDirectives1.js | 4 +- ...BundleWithShebangAndPrologueDirectives2.js | 8 +- .../emitCapturingThisInTupleDestructuring2.js | 2 +- ...tionWithPropertyAccessInHeritageClause1.js | 4 +- .../emitClassExpressionInDeclarationFile.js | 10 +- .../emitClassExpressionInDeclarationFile2.js | 8 +- .../reference/emitDecoratorMetadata_object.js | 2 +- .../emitDecoratorMetadata_restArgs.js | 4 +- .../reference/emitDefaultParametersMethod.js | 6 +- .../reference/emitMemberAccessExpression.js | 4 +- .../reference/emitRestParametersMethod.js | 4 +- ...BeforeEmitParameterPropertyDeclaration1.js | 4 +- ...SuperCallBeforeEmitPropertyDeclaration1.js | 4 +- ...arationAndParameterPropertyDeclaration1.js | 4 +- .../reference/emitThisInSuperMethodCall.js | 4 +- ...mitter.asyncGenerators.classMethods.es5.js | 20 +- .../reference/emptyGenericParamList.js | 2 +- tests/baselines/reference/emptyModuleName.js | 2 +- .../reference/emptyTypeArgumentListWithNew.js | 2 +- .../baselines/reference/enumAssignability.js | 2 +- .../enumAssignabilityInInheritance.js | 6 +- .../reference/enumAssignmentCompat.js | 2 +- .../reference/enumAssignmentCompat2.js | 2 +- .../reference/enumGenericTypeClash.js | 2 +- .../enumIsNotASubtypeOfAnythingButNumber.js | 6 +- ...rorForwardReferenceForwadingConstructor.js | 4 +- .../errorRecoveryInClassDeclaration.js | 2 +- tests/baselines/reference/errorSuperCalls.js | 10 +- .../reference/errorSuperPropertyAccess.js | 10 +- tests/baselines/reference/errorSupression1.js | 2 +- .../reference/errorsInGenericTypeReference.js | 16 +- tests/baselines/reference/es3-amd.js | 2 +- .../reference/es3-declaration-amd.js | 2 +- .../baselines/reference/es3-sourcemap-amd.js | 2 +- .../reference/es3-sourcemap-amd.sourcemap.txt | 2 +- .../reference/es3defaultAliasIsQuoted.js | 2 +- tests/baselines/reference/es5-amd.js | 2 +- tests/baselines/reference/es5-commonjs.js | 2 +- tests/baselines/reference/es5-commonjs4.js | 2 +- .../reference/es5-declaration-amd.js | 2 +- tests/baselines/reference/es5-souremap-amd.js | 2 +- .../reference/es5-souremap-amd.sourcemap.txt | 2 +- tests/baselines/reference/es5-system.js | 2 +- tests/baselines/reference/es5-umd.js | 2 +- tests/baselines/reference/es5-umd2.js | 2 +- tests/baselines/reference/es5-umd3.js | 2 +- tests/baselines/reference/es5-umd4.js | 2 +- .../es5ExportDefaultClassDeclaration.js | 2 +- .../es5ExportDefaultClassDeclaration2.js | 2 +- .../es5ExportDefaultClassDeclaration3.js | 2 +- .../baselines/reference/es5ExportEqualsDts.js | 2 +- .../es5ModuleInternalNamedImports.js | 2 +- .../reference/es5ModuleWithModuleGenAmd.js | 2 +- .../es5ModuleWithModuleGenCommonjs.js | 2 +- .../es5ModuleWithoutModuleGenTarget.js | 2 +- tests/baselines/reference/es5andes6module.js | 2 +- .../reference/es6ClassSuperCodegenBug.js | 4 +- tests/baselines/reference/es6ClassTest.js | 4 +- tests/baselines/reference/es6ClassTest2.js | 24 +- tests/baselines/reference/es6ClassTest3.js | 2 +- tests/baselines/reference/es6ClassTest5.js | 4 +- tests/baselines/reference/es6ClassTest7.js | 2 +- tests/baselines/reference/es6ClassTest8.js | 6 +- tests/baselines/reference/es6DeclOrdering.js | 2 +- .../baselines/reference/es6ExportAllInEs5.js | 2 +- .../reference/es6ExportClauseInEs5.js | 2 +- ...ExportClauseWithoutModuleSpecifierInEs5.js | 2 +- .../reference/es6ImportDefaultBindingDts.js | 2 +- ...efaultBindingFollowedWithNamedImportDts.js | 12 +- ...faultBindingFollowedWithNamedImportDts1.js | 2 +- ...tBindingFollowedWithNamespaceBindingDts.js | 2 +- ...BindingFollowedWithNamespaceBindingDts1.js | 2 +- .../reference/es6ImportNameSpaceImportDts.js | 2 +- .../reference/es6ImportNamedImportDts.js | 28 +-- ...rtNamedImportInIndirectExportAssignment.js | 2 +- .../es6ImportNamedImportWithTypesAndValues.js | 4 +- tests/baselines/reference/es6MemberScoping.js | 4 +- .../reference/es6modulekindWithES5Target.js | 6 +- .../reference/es6modulekindWithES5Target11.js | 2 +- .../reference/es6modulekindWithES5Target12.js | 2 +- .../reference/es6modulekindWithES5Target2.js | 2 +- .../reference/es6modulekindWithES5Target3.js | 2 +- .../reference/es6modulekindWithES5Target4.js | 2 +- .../baselines/reference/escapedIdentifiers.js | 8 +- .../reference/everyTypeAssignableToAny.js | 2 +- .../everyTypeWithAnnotationAndInitializer.js | 6 +- ...TypeWithAnnotationAndInvalidInitializer.js | 8 +- .../reference/everyTypeWithInitializer.js | 6 +- ...xhaustiveSwitchWithWideningLiteralTypes.js | 4 +- .../baselines/reference/exportAlreadySeen.js | 2 +- .../reference/exportAssignClassAndModule.js | 2 +- .../reference/exportAssignNonIdentifier.js | 2 +- .../exportAssignmentAndDeclaration.js | 2 +- .../reference/exportAssignmentClass.js | 2 +- .../exportAssignmentConstrainedGenericType.js | 2 +- .../reference/exportAssignmentGenericType.js | 2 +- .../exportAssignmentOfGenericType1.js | 4 +- .../exportAssignmentTopLevelClodule.js | 2 +- .../reference/exportAssignmentWithExports.js | 4 +- tests/baselines/reference/exportBinding.js | 2 +- .../exportClassExtendingIntersection.js | 6 +- tests/baselines/reference/exportCodeGen.js | 4 +- .../exportDeclarationInInternalModule.js | 8 +- .../reference/exportDefaultAbstractClass.js | 6 +- .../reference/exportDefaultProperty.js | 2 +- .../reference/exportDefaultProperty2.js | 2 +- .../reference/exportEqualsProperty.js | 2 +- .../reference/exportEqualsProperty2.js | 2 +- tests/baselines/reference/exportImport.js | 2 +- .../baselines/reference/exportImportAlias.js | 6 +- .../reference/exportImportAndClodule.js | 2 +- .../exportNonInitializedVariablesAMD.js | 4 +- .../exportNonInitializedVariablesCommonJS.js | 4 +- .../exportNonInitializedVariablesSystem.js | 4 +- .../exportNonInitializedVariablesUMD.js | 4 +- .../reference/exportNonVisibleType.js | 4 +- .../baselines/reference/exportPrivateType.js | 4 +- .../reference/exportStarFromEmptyModule.js | 4 +- tests/baselines/reference/exportVisibility.js | 2 +- .../exportingContainingVisibleType.js | 2 +- .../reference/exportsAndImports1-amd.js | 2 +- .../baselines/reference/exportsAndImports1.js | 2 +- .../reference/exportsAndImports3-amd.js | 2 +- .../baselines/reference/exportsAndImports3.js | 2 +- tests/baselines/reference/extBaseClass1.js | 8 +- tests/baselines/reference/extBaseClass2.js | 4 +- .../extendAndImplementTheSameBaseType.js | 4 +- .../extendAndImplementTheSameBaseType2.js | 4 +- .../extendBaseClassBeforeItsDeclared.js | 4 +- .../extendClassExpressionFromModule.js | 4 +- .../extendConstructSignatureInInterface.js | 2 +- tests/baselines/reference/extendFromAny.js | 2 +- .../reference/extendNonClassSymbol1.js | 4 +- .../reference/extendNonClassSymbol2.js | 2 +- .../extendPrivateConstructorClass.js | 2 +- ...xtendingClassFromAliasAndUsageInIndexer.js | 6 +- .../reference/extendsClauseAlreadySeen.js | 4 +- .../reference/extendsClauseAlreadySeen2.js | 4 +- .../reference/extendsUntypedModule.js | 2 +- tests/baselines/reference/externModule.js | 2 +- .../reference/externalModuleAssignToVar.js | 6 +- .../externalModuleExportingGenericClass.js | 2 +- .../reference/externalModuleQualification.js | 4 +- tests/baselines/reference/fatArrowSelf.js | 4 +- .../reference/fieldAndGetterWithSameName.js | 2 +- ...ilesEmittingIntoSameOutputWithOutOption.js | 2 +- .../fillInMissingTypeArgsOnConstructCalls.js | 2 +- tests/baselines/reference/flowInFinally1.js | 2 +- tests/baselines/reference/fluentClasses.js | 6 +- tests/baselines/reference/for-inStatements.js | 6 +- .../reference/for-inStatementsInvalid.js | 4 +- tests/baselines/reference/forStatements.js | 6 +- .../forStatementsMultipleInvalidDecl.js | 8 +- tests/baselines/reference/forgottenNew.js | 2 +- .../reference/forwardRefInClassProperties.js | 2 +- tests/baselines/reference/funClodule.js | 2 +- .../functionAndPropertyNameConflict.js | 2 +- .../reference/functionArgShadowing.js | 6 +- tests/baselines/reference/functionCall5.js | 2 +- tests/baselines/reference/functionCall7.js | 2 +- .../functionConstraintSatisfaction.js | 4 +- .../functionConstraintSatisfaction2.js | 4 +- .../functionConstraintSatisfaction3.js | 4 +- ...ctionExpressionAndLambdaMatchesFunction.js | 2 +- .../functionExpressionContextualTyping1.js | 4 +- .../reference/functionImplementationErrors.js | 8 +- .../reference/functionImplementations.js | 8 +- .../functionLikeInParameterInitializer.js | 2 +- .../reference/functionLiteralForOverloads2.js | 4 +- .../reference/functionOverloadErrors.js | 2 +- .../baselines/reference/functionOverloads5.js | 2 +- .../baselines/reference/functionOverloads6.js | 2 +- .../baselines/reference/functionOverloads7.js | 2 +- .../reference/functionOverloadsOutOfOrder.js | 4 +- ...tionOverloadsRecursiveGenericReturnType.js | 4 +- .../reference/functionSubtypingOfVarArgs.js | 4 +- .../reference/functionSubtypingOfVarArgs2.js | 4 +- .../reference/functionWithSameNameAsField.js | 2 +- .../reference/functionsInClassExpressions.js | 2 +- ...nsMissingReturnStatementsAndExpressions.js | 2 +- tests/baselines/reference/fuzzy.js | 2 +- .../reference/generatedContextualTyping.js | 222 +++++++++--------- .../generativeRecursionWithTypeOf.js | 2 +- .../genericArrayWithoutTypeAnnotation.js | 2 +- .../genericAssignmentCompatWithInterfaces1.js | 2 +- .../genericBaseClassLiteralProperty.js | 4 +- .../genericBaseClassLiteralProperty2.js | 6 +- .../genericCallTypeArgumentInference.js | 2 +- ...allWithConstraintsTypeArgumentInference.js | 8 +- .../genericCallWithFixedArguments.js | 4 +- .../genericCallWithFunctionTypedArguments4.js | 4 +- .../genericCallWithObjectTypeArgs.js | 6 +- .../genericCallWithObjectTypeArgs2.js | 6 +- ...ricCallWithObjectTypeArgsAndConstraints.js | 6 +- ...icCallWithObjectTypeArgsAndConstraints2.js | 4 +- ...icCallWithObjectTypeArgsAndConstraints3.js | 6 +- ...icCallWithObjectTypeArgsAndConstraints4.js | 4 +- ...icCallWithObjectTypeArgsAndConstraints5.js | 4 +- .../genericCallbacksAndClassHierarchy.js | 8 +- .../reference/genericCallsWithoutParens.js | 2 +- .../genericClassExpressionInFunction.js | 16 +- ...entingGenericInterfaceFromAnotherModule.js | 2 +- ...sInheritsConstructorFromNonGenericClass.js | 6 +- ...cClassPropertyInheritanceSpecialization.js | 6 +- .../reference/genericClassStaticMethod.js | 4 +- ...icClassWithFunctionTypedMemberArguments.js | 10 +- ...icClassWithObjectTypeArgsAndConstraints.js | 10 +- .../genericClassWithStaticFactory.js | 4 +- ...nericClassWithStaticsUsingTypeArguments.js | 2 +- tests/baselines/reference/genericClasses0.js | 2 +- tests/baselines/reference/genericClasses1.js | 2 +- tests/baselines/reference/genericClasses2.js | 2 +- tests/baselines/reference/genericClasses3.js | 4 +- tests/baselines/reference/genericClasses4.js | 2 +- .../reference/genericClassesInModule.js | 4 +- .../reference/genericClassesInModule2.js | 4 +- .../reference/genericCloduleInModule.js | 2 +- .../reference/genericCloduleInModule2.js | 2 +- .../reference/genericCloneReturnTypes.js | 2 +- .../reference/genericCloneReturnTypes2.js | 2 +- .../baselines/reference/genericConstraint1.js | 2 +- .../baselines/reference/genericConstraint2.js | 2 +- .../reference/genericConstraintDeclaration.js | 2 +- ...genericConstraintOnExtendedBuiltinTypes.js | 4 +- ...enericConstraintOnExtendedBuiltinTypes2.js | 4 +- .../genericConstructExpressionWithoutArgs.js | 4 +- .../genericDerivedTypeWithSpecializedBase.js | 4 +- .../genericDerivedTypeWithSpecializedBase2.js | 4 +- ...genericFunctionsWithOptionalParameters3.js | 2 +- tests/baselines/reference/genericGetter.js | 2 +- tests/baselines/reference/genericGetter2.js | 4 +- tests/baselines/reference/genericGetter3.js | 4 +- .../baselines/reference/genericImplements.js | 10 +- .../genericInheritedDefaultConstructors.js | 4 +- .../baselines/reference/genericInstanceOf.js | 2 +- .../genericInterfaceImplementation.js | 2 +- .../genericInterfacesWithoutTypeArguments.js | 2 +- .../reference/genericMemberFunction.js | 6 +- ...ricMergedDeclarationUsingTypeParameter2.js | 2 +- .../genericObjectCreationWithoutTypeArgs.js | 2 +- .../reference/genericObjectLitReturnType.js | 2 +- .../reference/genericOfACloduleType1.js | 6 +- .../reference/genericOfACloduleType2.js | 6 +- .../reference/genericOverloadSignatures.js | 2 +- .../reference/genericPrototypeProperty.js | 2 +- .../reference/genericPrototypeProperty2.js | 8 +- .../reference/genericPrototypeProperty3.js | 8 +- ...ericRecursiveImplicitConstructorErrors2.js | 4 +- ...ericRecursiveImplicitConstructorErrors3.js | 6 +- .../reference/genericReturnTypeFromGetter1.js | 2 +- .../genericReversingTypeParameters.js | 2 +- .../genericReversingTypeParameters2.js | 2 +- .../reference/genericSpecializations1.js | 6 +- .../reference/genericSpecializations2.js | 8 +- .../reference/genericSpecializations3.js | 8 +- .../reference/genericStaticAnyTypeFunction.js | 2 +- .../reference/genericTypeAssertions1.js | 2 +- .../reference/genericTypeAssertions2.js | 4 +- .../reference/genericTypeAssertions4.js | 6 +- .../reference/genericTypeAssertions6.js | 4 +- .../reference/genericTypeConstraints.js | 8 +- ...genericTypeReferenceWithoutTypeArgument.js | 10 +- ...enericTypeReferenceWithoutTypeArgument2.js | 4 +- .../genericTypeReferencesRequireTypeArgs.js | 2 +- .../genericTypeUsedWithoutTypeArguments1.js | 2 +- .../genericTypeWithCallableMembers.js | 2 +- .../genericTypeWithNonGenericBaseMisMatch.js | 2 +- .../reference/genericWithCallSignatures1.js | 2 +- .../genericWithIndexerOfTypeParameterType1.js | 2 +- .../genericWithIndexerOfTypeParameterType2.js | 8 +- .../genericWithOpenTypeParameters1.js | 2 +- tests/baselines/reference/generics3.js | 2 +- tests/baselines/reference/generics4.js | 2 +- tests/baselines/reference/generics4NoError.js | 2 +- .../genericsWithDuplicateTypeParameters1.js | 2 +- .../genericsWithoutTypeParameters1.js | 6 +- ...hImpliedReturnTypeAndFunctionClassMerge.js | 2 +- .../reference/getAndSetAsMemberNames.js | 10 +- .../reference/getAndSetNotIdenticalType.js | 2 +- .../reference/getAndSetNotIdenticalType2.js | 4 +- .../reference/getAndSetNotIdenticalType3.js | 4 +- .../reference/getEmitOutput-pp.baseline | 4 +- .../reference/getEmitOutput.baseline | 4 +- ...etEmitOutputDeclarationMultiFiles.baseline | 4 +- ...etEmitOutputDeclarationSingleFile.baseline | 4 +- .../getEmitOutputExternalModule.baseline | 2 +- .../getEmitOutputExternalModule2.baseline | 4 +- .../reference/getEmitOutputMapRoots.baseline | 2 +- .../reference/getEmitOutputNoErrors.baseline | 2 +- .../getEmitOutputOnlyOneFile.baseline | 2 +- .../reference/getEmitOutputOutFile.baseline | 4 +- .../getEmitOutputSingleFile.baseline | 4 +- .../getEmitOutputSingleFile2.baseline | 4 +- .../reference/getEmitOutputSourceMap.baseline | 2 +- .../getEmitOutputSourceMap2.baseline | 2 +- .../getEmitOutputSourceRoot.baseline | 2 +- ...getEmitOutputSourceRootMultiFiles.baseline | 4 +- .../getEmitOutputTsxFile_Preserve.baseline | 2 +- .../getEmitOutputTsxFile_React.baseline | 2 +- .../getEmitOutputWithDeclarationFile.baseline | 2 +- ...getEmitOutputWithDeclarationFile2.baseline | 2 +- .../getEmitOutputWithEmitterErrors.baseline | 2 +- .../getEmitOutputWithEmitterErrors2.baseline | 2 +- .../getSetAccessorContextualTyping.js | 2 +- .../reference/getterControlFlowStrictNull.js | 4 +- .../reference/getterMissingReturnError.js | 2 +- .../getterThatThrowsShouldNotNeedReturn.js | 2 +- .../baselines/reference/gettersAndSetters.js | 2 +- .../gettersAndSettersAccessibility.js | 2 +- .../reference/gettersAndSettersErrors.js | 4 +- .../reference/gettersAndSettersTypesAgree.js | 2 +- tests/baselines/reference/giant.js | 28 +-- .../reference/globalIsContextualKeyword.js | 2 +- .../reference/grammarAmbiguities1.js | 4 +- .../heterogeneousArrayAndOverloads.js | 2 +- .../reference/heterogeneousArrayLiterals.js | 6 +- .../reference/ifDoWhileStatements.js | 10 +- .../illegalModifiersOnClassElements.js | 2 +- .../illegalSuperCallsInConstructor.js | 4 +- .../implementClausePrecedingExtends.js | 4 +- .../implementGenericWithMismatchedTypes.js | 4 +- .../implementInterfaceAnyMemberWithVoid.js | 2 +- .../implementPublicPropertyAsPrivate.js | 2 +- ...ngAnInterfaceExtendingClassWithPrivates.js | 10 +- ...gAnInterfaceExtendingClassWithPrivates2.js | 28 +-- ...AnInterfaceExtendingClassWithProtecteds.js | 18 +- .../reference/implementsClauseAlreadySeen.js | 4 +- .../reference/implementsInClassExpression.js | 2 +- .../implicitAnyAnyReturningFunction.js | 2 +- .../reference/implicitAnyCastedValue.js | 4 +- .../implicitAnyDeclareMemberWithoutType2.js | 2 +- ...plicitAnyDeclareTypePropertyWithoutType.js | 2 +- .../implicitAnyFromCircularInference.js | 4 +- ...tAnyFunctionInvocationWithAnyArguements.js | 2 +- ...mplicitAnyFunctionReturnNullOrUndefined.js | 2 +- .../reference/implicitAnyGenerics.js | 4 +- ...itAnyGetAndSetAccessorWithAnyReturnType.js | 6 +- .../baselines/reference/implicitAnyInCatch.js | 2 +- .../reference/implicitAnyWidenToAny.js | 2 +- .../reference/importAliasIdentifiers.js | 4 +- .../importAndVariableDeclarationConflict2.js | 2 +- .../baselines/reference/importAsBaseClass.js | 4 +- ...portCallExpressionNoModuleKindSpecified.js | 4 +- tests/baselines/reference/importDecl.js | 8 +- .../importDeclarationUsedAsTypeQuery.js | 2 +- tests/baselines/reference/importHelpers.js | 12 +- tests/baselines/reference/importHelpersAmd.js | 4 +- .../importHelpersInIsolatedModules.js | 12 +- .../reference/importHelpersNoHelpers.js | 12 +- .../reference/importHelpersNoModule.js | 12 +- .../reference/importHelpersOutFile.js | 6 +- .../reference/importHelpersSystem.js | 4 +- .../reference/importImportOnlyModule.js | 2 +- .../reference/importInTypePosition.js | 2 +- .../reference/importShadowsGlobalName.js | 4 +- tests/baselines/reference/importStatements.js | 2 +- .../reference/importUsedInExtendsList1.js | 4 +- .../import_reference-exported-alias.js | 2 +- .../import_reference-to-type-alias.js | 2 +- ...ar-referencing-an-imported-module-alias.js | 2 +- .../importedAliasesInTypePositions.js | 4 +- .../reference/importedModuleAddToGlobal.js | 2 +- .../reference/importedModuleClassNameClash.js | 2 +- .../reference/inOperatorWithGeneric.js | 2 +- ...atibleAssignmentOfIdenticallyNamedTypes.js | 2 +- .../baselines/reference/incompatibleTypes.js | 8 +- .../reference/incorrectClassOverloadChain.js | 2 +- .../reference/incrementOnTypeParameter.js | 2 +- .../incrementOperatorWithAnyOtherType.js | 2 +- ...eratorWithAnyOtherTypeInvalidOperations.js | 2 +- .../incrementOperatorWithNumberType.js | 2 +- ...OperatorWithNumberTypeInvalidOperations.js | 2 +- ...ementOperatorWithUnsupportedBooleanType.js | 2 +- ...rementOperatorWithUnsupportedStringType.js | 2 +- .../baselines/reference/indexClassByNumber.js | 2 +- .../indexSignatureMustHaveTypeAnnotation.js | 4 +- .../reference/indexSignatureTypeCheck2.js | 2 +- ...indexSignatureWithAccessibilityModifier.js | 2 +- .../indexSignatureWithInitializer.js | 2 +- .../indexSignatureWithInitializer1.js | 2 +- .../indexSignatureWithoutTypeAnnotation1.js | 2 +- tests/baselines/reference/indexTypeCheck.js | 2 +- .../reference/indexWithoutParamType2.js | 2 +- .../reference/indexedAccessRelation.js | 6 +- .../reference/indexedAccessTypeConstraints.js | 6 +- tests/baselines/reference/indexer2A.js | 4 +- tests/baselines/reference/indexerA.js | 4 +- .../baselines/reference/indexerAsOptional.js | 2 +- .../reference/indexerConstraints2.js | 16 +- .../indexerReturningTypeParameter1.js | 2 +- .../indexerSignatureWithRestParam.js | 2 +- .../reference/indexersInClassType.js | 2 +- .../reference/indirectSelfReference.js | 4 +- .../reference/indirectSelfReferenceGeneric.js | 4 +- .../inferFromGenericFunctionReturnTypes1.js | 2 +- .../inferFromGenericFunctionReturnTypes2.js | 2 +- ...inferParameterWithMethodCallInitializer.js | 4 +- .../reference/inferSetterParamType.js | 4 +- .../inferentialTypingUsingApparentType3.js | 6 +- .../inferringClassMembersFromAssignments.js | 2 +- .../reference/infinitelyExpandingOverloads.js | 6 +- .../infinitelyExpandingTypesNonGenericBase.js | 6 +- .../inheritFromGenericTypeParameter.js | 2 +- ...mePrivatePropertiesFromDifferentOrigins.js | 4 +- ...SameNamePrivatePropertiesFromSameOrigin.js | 6 +- ...meNamePropertiesWithDifferentVisibility.js | 4 +- tests/baselines/reference/inheritance.js | 16 +- tests/baselines/reference/inheritance1.js | 14 +- ...itanceGrandParentPrivateMemberCollision.js | 6 +- ...tPrivateMemberCollisionWithPublicMember.js | 6 +- ...tPublicMemberCollisionWithPrivateMember.js | 6 +- ...ritanceMemberAccessorOverridingAccessor.js | 4 +- ...heritanceMemberAccessorOverridingMethod.js | 4 +- ...ritanceMemberAccessorOverridingProperty.js | 4 +- ...inheritanceMemberFuncOverridingAccessor.js | 4 +- .../inheritanceMemberFuncOverridingMethod.js | 4 +- ...inheritanceMemberFuncOverridingProperty.js | 4 +- ...ritanceMemberPropertyOverridingAccessor.js | 4 +- ...heritanceMemberPropertyOverridingMethod.js | 4 +- ...ritanceMemberPropertyOverridingProperty.js | 4 +- .../inheritanceOfGenericConstructorMethod1.js | 4 +- .../inheritanceOfGenericConstructorMethod2.js | 8 +- ...ritanceStaticAccessorOverridingAccessor.js | 4 +- ...heritanceStaticAccessorOverridingMethod.js | 4 +- ...ritanceStaticAccessorOverridingProperty.js | 4 +- ...inheritanceStaticFuncOverridingAccessor.js | 4 +- ...eStaticFuncOverridingAccessorOfFuncType.js | 4 +- .../inheritanceStaticFuncOverridingMethod.js | 4 +- ...inheritanceStaticFuncOverridingProperty.js | 4 +- ...eStaticFuncOverridingPropertyOfFuncType.js | 4 +- ...taticFunctionOverridingInstanceProperty.js | 4 +- .../inheritanceStaticMembersCompatible.js | 4 +- .../inheritanceStaticMembersIncompatible.js | 4 +- ...ritanceStaticPropertyOverridingAccessor.js | 4 +- ...heritanceStaticPropertyOverridingMethod.js | 4 +- ...ritanceStaticPropertyOverridingProperty.js | 4 +- .../inheritedConstructorWithRestParams.js | 4 +- .../inheritedConstructorWithRestParams2.js | 8 +- .../inheritedModuleMembersForClodule.js | 6 +- ...initializerReferencingConstructorLocals.js | 4 +- ...ializerReferencingConstructorParameters.js | 8 +- tests/baselines/reference/innerAliases.js | 4 +- tests/baselines/reference/innerAliases2.js | 2 +- .../reference/innerBoundLambdaEmit.js | 2 +- tests/baselines/reference/innerExtern.js | 2 +- .../innerTypeParameterShadowingOuterOne2.js | 4 +- .../instanceAndStaticDeclarations1.js | 2 +- .../instanceMemberAssignsToClassPrototype.js | 2 +- .../reference/instanceMemberInitialization.js | 2 +- .../reference/instanceOfAssignability.js | 12 +- .../reference/instanceOfInExternalModules.js | 2 +- ...nstancePropertiesInheritedIntoClassType.js | 8 +- .../reference/instancePropertyInClassType.js | 4 +- .../reference/instanceSubtypeCheck2.js | 4 +- .../baselines/reference/instanceofOperator.js | 2 +- .../instanceofOperatorWithInvalidOperands.js | 2 +- .../instanceofOperatorWithLHSIsObject.js | 2 +- ...nstanceofWithStructurallyIdenticalTypes.js | 14 +- ...ericClassWithWrongNumberOfTypeArguments.js | 4 +- ...ntiateGenericClassWithZeroTypeArguments.js | 4 +- ...tantiateNonGenericTypeWithTypeArguments.js | 2 +- .../instantiatedBaseTypeConstraints.js | 2 +- .../baselines/reference/instantiatedModule.js | 2 +- .../instantiatedReturnTypeContravariance.js | 4 +- tests/baselines/reference/intTypeCheck.js | 2 +- .../reference/interfaceClassMerging.js | 4 +- .../reference/interfaceClassMerging2.js | 4 +- .../reference/interfaceContextualType.js | 2 +- .../reference/interfaceDeclaration1.js | 2 +- .../reference/interfaceDeclaration2.js | 2 +- .../reference/interfaceDeclaration3.js | 22 +- .../reference/interfaceDeclaration4.js | 8 +- .../reference/interfaceDeclaration5.js | 2 +- .../reference/interfaceExtendingClass.js | 2 +- .../reference/interfaceExtendingClass2.js | 2 +- .../interfaceExtendingClassWithPrivates.js | 2 +- .../interfaceExtendingClassWithPrivates2.js | 6 +- .../interfaceExtendingClassWithProtecteds.js | 2 +- .../interfaceExtendingClassWithProtecteds2.js | 6 +- .../reference/interfaceExtendsClass1.js | 10 +- .../interfaceExtendsClassWithPrivate1.js | 4 +- .../interfaceExtendsClassWithPrivate2.js | 6 +- .../interfaceExtendsObjectIntersection.js | 22 +- ...nterfaceExtendsObjectIntersectionErrors.js | 10 +- .../reference/interfaceImplementation1.js | 4 +- .../reference/interfaceImplementation2.js | 2 +- .../reference/interfaceImplementation3.js | 2 +- .../reference/interfaceImplementation4.js | 2 +- .../reference/interfaceImplementation5.js | 12 +- .../reference/interfaceImplementation6.js | 8 +- .../reference/interfaceImplementation7.js | 2 +- .../reference/interfaceImplementation8.js | 16 +- .../reference/interfaceInReopenedModule.js | 2 +- .../reference/interfaceInheritance.js | 2 +- .../interfacePropertiesWithSameName3.js | 4 +- .../baselines/reference/interfaceSubtyping.js | 2 +- .../interfaceWithMultipleDeclarations.js | 2 +- .../interfaceWithPropertyOfEveryType.js | 2 +- ...faceWithPropertyThatIsPrivateInBaseType.js | 4 +- ...aceWithPropertyThatIsPrivateInBaseType2.js | 4 +- tests/baselines/reference/interfacedecl.js | 2 +- .../interfacedeclWithIndexerErrors.js | 2 +- .../baselines/reference/internalAliasClass.js | 2 +- ...alAliasClassInsideLocalModuleWithExport.js | 2 +- ...liasClassInsideLocalModuleWithoutExport.js | 2 +- ...sideLocalModuleWithoutExportAccessError.js | 2 +- ...liasClassInsideTopLevelModuleWithExport.js | 2 +- ...sClassInsideTopLevelModuleWithoutExport.js | 2 +- .../internalAliasInitializedModule.js | 2 +- ...alizedModuleInsideLocalModuleWithExport.js | 2 +- ...zedModuleInsideLocalModuleWithoutExport.js | 2 +- ...sideLocalModuleWithoutExportAccessError.js | 2 +- ...zedModuleInsideTopLevelModuleWithExport.js | 2 +- ...ModuleInsideTopLevelModuleWithoutExport.js | 2 +- ...leMergedWithClassNotReferencingInstance.js | 2 +- ...thClassNotReferencingInstanceNoConflict.js | 2 +- ...leMergedWithClassNotReferencingInstance.js | 2 +- ...thClassNotReferencingInstanceNoConflict.js | 2 +- tests/baselines/reference/intrinsics.js | 4 +- .../reference/invalidAssignmentsToVoid.js | 2 +- .../reference/invalidBooleanAssignments.js | 2 +- .../invalidImportAliasIdentifiers.js | 2 +- .../reference/invalidInstantiatedModule.js | 2 +- .../invalidModuleWithStatementsOfEveryKind.js | 30 +-- .../invalidMultipleVariableDeclarations.js | 8 +- .../reference/invalidNestedModules.js | 6 +- .../reference/invalidNewTarget.es5.js | 2 +- .../reference/invalidNumberAssignments.js | 2 +- .../reference/invalidReferenceSyntax1.js | 2 +- .../reference/invalidReturnStatements.js | 4 +- .../baselines/reference/invalidStaticField.js | 4 +- .../reference/invalidStringAssignments.js | 2 +- .../invalidSyntaxNamespaceImportWithAMD.js | 2 +- ...nvalidSyntaxNamespaceImportWithCommonjs.js | 2 +- .../invalidSyntaxNamespaceImportWithSystem.js | 2 +- ...nvalidThisEmitInContextualObjectLiteral.js | 2 +- tests/baselines/reference/invalidTypeNames.js | 2 +- .../reference/invalidUndefinedAssignments.js | 2 +- .../reference/invalidUndefinedValues.js | 2 +- .../reference/invalidVoidAssignments.js | 2 +- .../baselines/reference/invalidVoidValues.js | 2 +- ...okingNonGenericMethodWithTypeArguments1.js | 2 +- ...okingNonGenericMethodWithTypeArguments2.js | 2 +- .../isDeclarationVisibleNodeKinds.js | 2 +- .../isolatedModulesImportExportElision.js | 2 +- .../reference/isolatedModulesReExportType.js | 2 +- ...ationClassMethodContainingArrowFunction.js | 2 +- .../jsFileCompilationEmitBlockedCorrectly.js | 2 +- .../jsFileCompilationEmitDeclarations.js | 2 +- ...ileCompilationEmitTrippleSlashReference.js | 2 +- ...eclarationsWithJsFileReferenceWithNoOut.js | 2 +- ...nDeclarationsWithJsFileReferenceWithOut.js | 2 +- ...clarationsWithJsFileReferenceWithOutDir.js | 2 +- ...eclarationsWithJsFileReferenceWithNoOut.js | 2 +- ...tDeclarationsWithJsFileReferenceWithOut.js | 2 +- ...ationWithDeclarationEmitPathSameAsInput.js | 2 +- .../jsFileCompilationWithMapFileAsJs.js | 2 +- ...leCompilationWithMapFileAsJs.sourcemap.txt | 2 +- ...ationWithMapFileAsJsWithInlineSourceMap.js | 2 +- ...pFileAsJsWithInlineSourceMap.sourcemap.txt | 2 +- ...ileCompilationWithMapFileAsJsWithOutDir.js | 2 +- ...ionWithMapFileAsJsWithOutDir.sourcemap.txt | 2 +- .../reference/jsFileCompilationWithOut.js | 2 +- ...OutDeclarationFileNameSameAsInputJsFile.js | 2 +- .../reference/jsFileCompilationWithoutOut.js | 2 +- .../reference/jsObjectsMarkedAsOpenEnded.js | 2 +- .../baselines/reference/jsdocInTypeScript.js | 2 +- .../reference/jsxAndTypeAssertion.js | 2 +- .../jsxFactoryQualifiedNameWithEs5.js | 2 +- .../baselines/reference/jsxInExtendsClause.js | 4 +- tests/baselines/reference/jsxViaImport.2.js | 2 +- tests/baselines/reference/jsxViaImport.js | 2 +- .../reference/keyofAndIndexedAccess.js | 30 +-- .../reference/keyofAndIndexedAccessErrors.js | 2 +- tests/baselines/reference/lambdaArgCrash.js | 4 +- tests/baselines/reference/lambdaPropSelf.js | 4 +- tests/baselines/reference/libMembers.js | 2 +- tests/baselines/reference/lift.js | 4 +- tests/baselines/reference/listFailure.js | 6 +- tests/baselines/reference/literalTypes2.js | 4 +- .../literalTypesWidenInParameterPosition.js | 2 +- .../literalsInComputedProperties1.js | 2 +- .../baselines/reference/localClassesInLoop.js | 2 +- tests/baselines/reference/localTypes1.js | 26 +- tests/baselines/reference/localTypes2.js | 6 +- tests/baselines/reference/localTypes3.js | 6 +- tests/baselines/reference/localTypes5.js | 4 +- .../logicalNotOperatorWithAnyOtherType.js | 2 +- .../logicalNotOperatorWithBooleanType.js | 2 +- .../logicalNotOperatorWithNumberType.js | 2 +- .../logicalNotOperatorWithStringType.js | 2 +- .../reference/looseThisTypeInFunctions.js | 2 +- tests/baselines/reference/m7Bugs.js | 4 +- tests/baselines/reference/mappedTypeErrors.js | 2 +- tests/baselines/reference/mappedTypes3.js | 2 +- .../reference/mappedTypesAndObjects.js | 2 +- .../reference/matchReturnTypeInAllBranches.js | 2 +- .../memberAccessMustUseModuleInstances.js | 2 +- ...FunctionOverloadMixingStaticAndInstance.js | 8 +- .../memberFunctionsWithPrivateOverloads.js | 4 +- .../memberFunctionsWithPublicOverloads.js | 4 +- ...mberFunctionsWithPublicPrivateOverloads.js | 4 +- tests/baselines/reference/memberScope.js | 2 +- .../reference/memberVariableDeclarations1.js | 4 +- .../reference/mergedClassInterface.js | 4 +- .../reference/mergedDeclarations5.js | 4 +- .../reference/mergedDeclarations6.js | 4 +- .../mergedInheritedClassInterface.js | 8 +- .../mergedInterfacesWithInheritedPrivates.js | 6 +- .../mergedInterfacesWithInheritedPrivates2.js | 8 +- .../mergedInterfacesWithInheritedPrivates3.js | 10 +- .../mergedInterfacesWithMultipleBases.js | 12 +- .../mergedInterfacesWithMultipleBases2.js | 20 +- .../mergedInterfacesWithMultipleBases3.js | 10 +- .../mergedInterfacesWithMultipleBases4.js | 10 +- .../mergedModuleDeclarationCodeGen.js | 4 +- .../mergedModuleDeclarationCodeGen5.js | 2 +- .../reference/metadataOfClassFromAlias.js | 4 +- .../reference/metadataOfClassFromAlias2.js | 4 +- .../reference/metadataOfClassFromModule.js | 4 +- .../reference/metadataOfEventAlias.js | 2 +- .../reference/metadataOfStringLiteral.js | 2 +- tests/baselines/reference/metadataOfUnion.js | 6 +- .../reference/metadataOfUnionWithNull.js | 4 +- .../methodContainingLocalFunction.js | 8 +- .../methodSignatureDeclarationEmit1.js | 2 +- .../mismatchedClassConstructorVariable.js | 4 +- .../reference/mismatchedGenericArguments1.js | 4 +- .../reference/missingDecoratorType.js | 2 +- .../missingFunctionImplementation.js | 18 +- .../missingImportAfterModuleImport.js | 2 +- .../missingPropertiesOfClassExpression.js | 4 +- .../reference/missingReturnStatement.js | 2 +- .../reference/missingReturnStatement1.js | 2 +- tests/baselines/reference/missingSelf.js | 4 +- .../reference/missingTypeArguments1.js | 22 +- .../reference/missingTypeArguments2.js | 2 +- .../mixedStaticAndInstanceClassMembers.js | 4 +- .../reference/mixinAccessModifiers.js | 24 +- .../reference/mixinClassesAnnotated.js | 10 +- .../reference/mixinClassesAnonymous.js | 12 +- .../reference/mixinClassesMembers.js | 4 +- .../reference/mixinPrivateAndProtected.js | 14 +- .../mixingStaticAndInstanceOverloads.js | 10 +- ...ifierOnClassDeclarationMemberInFunction.js | 2 +- ...difierOnClassExpressionMemberInFunction.js | 2 +- .../reference/modifierOnParameter1.js | 2 +- .../reference/moduleAliasInterface.js | 12 +- tests/baselines/reference/moduleAsBaseType.js | 4 +- .../reference/moduleAssignmentCompat1.js | 6 +- .../reference/moduleAssignmentCompat2.js | 6 +- .../reference/moduleAssignmentCompat4.js | 4 +- .../reference/moduleAugmentationGlobal1.js | 2 +- .../reference/moduleAugmentationGlobal2.js | 2 +- .../reference/moduleAugmentationGlobal3.js | 2 +- .../moduleAugmentationImportsAndExports1.js | 4 +- .../moduleAugmentationImportsAndExports2.js | 4 +- .../moduleAugmentationImportsAndExports3.js | 4 +- .../moduleAugmentationImportsAndExports4.js | 4 +- .../moduleAugmentationImportsAndExports5.js | 4 +- .../moduleAugmentationImportsAndExports6.js | 4 +- .../moduleAugmentationsBundledOutput1.js | 6 +- .../reference/moduleAugmentationsImports1.js | 4 +- .../reference/moduleAugmentationsImports2.js | 4 +- .../reference/moduleAugmentationsImports3.js | 4 +- .../reference/moduleAugmentationsImports4.js | 4 +- .../reference/moduleClassArrayCodeGenTest.js | 4 +- .../baselines/reference/moduleCodeGenTest5.js | 4 +- tests/baselines/reference/moduleCrashBug1.js | 2 +- .../reference/moduleDuplicateIdentifiers.js | 4 +- .../reference/moduleElementsInWrongContext.js | 2 +- .../moduleElementsInWrongContext2.js | 2 +- .../moduleElementsInWrongContext3.js | 2 +- tests/baselines/reference/moduleExports1.js | 2 +- .../moduleImportedForTypeArgumentPosition.js | 4 +- .../reference/moduleInTypePosition1.js | 2 +- .../moduleMemberWithoutTypeAnnotation1.js | 10 +- tests/baselines/reference/moduleMerge.js | 4 +- .../reference/moduleMergeConstructor.js | 2 +- .../baselines/reference/moduleNewExportBug.js | 2 +- tests/baselines/reference/moduleNoneErrors.js | 2 +- .../baselines/reference/modulePrologueAMD.js | 2 +- .../reference/modulePrologueCommonjs.js | 2 +- .../reference/modulePrologueSystem.js | 2 +- .../baselines/reference/modulePrologueUmd.js | 2 +- .../reference/moduleRedifinitionErrors.js | 2 +- .../reference/moduleReopenedTypeOtherBlock.js | 4 +- .../reference/moduleReopenedTypeSameBlock.js | 4 +- .../reference/moduleResolutionWithSymlinks.js | 2 +- ...moduleResolutionWithSymlinks_withOutDir.js | 2 +- tests/baselines/reference/moduleScopingBug.js | 2 +- .../reference/moduleVisibilityTest1.js | 4 +- .../reference/moduleVisibilityTest2.js | 4 +- .../reference/moduleVisibilityTest3.js | 4 +- .../moduleWithStatementsOfEveryKind.js | 20 +- tests/baselines/reference/moduledecl.js | 10 +- .../baselines/reference/multiImportExport.js | 2 +- .../reference/multiModuleClodule1.js | 2 +- .../multipleClassPropertyModifiers.js | 2 +- .../multipleClassPropertyModifiersErrors.js | 2 +- .../reference/multipleDeclarations.js | 4 +- .../reference/multipleDefaultExports01.js | 2 +- .../reference/multipleDefaultExports03.js | 4 +- .../reference/multipleExportDefault3.js | 2 +- .../reference/multipleExportDefault4.js | 2 +- .../reference/multipleExportDefault5.js | 2 +- .../reference/multipleInheritance.js | 20 +- .../reference/multipleNumericIndexers.js | 4 +- .../reference/multipleStringIndexers.js | 4 +- tests/baselines/reference/multivar.js | 4 +- .../mutuallyRecursiveGenericBaseTypes2.js | 4 +- tests/baselines/reference/nameCollision.js | 2 +- tests/baselines/reference/nameCollisions.js | 12 +- ...nctionExpressionAssignedToClassProperty.js | 2 +- tests/baselines/reference/namespaces2.js | 2 +- .../reference/narrowTypeByInstanceof.js | 4 +- .../reference/narrowedConstInMethod.js | 2 +- .../narrowingGenericTypeFromInstanceof01.js | 4 +- .../reference/narrowingOfDottedNames.js | 4 +- .../negateOperatorWithAnyOtherType.js | 2 +- .../negateOperatorWithBooleanType.js | 2 +- .../reference/negateOperatorWithNumberType.js | 2 +- .../reference/negateOperatorWithStringType.js | 2 +- .../reference/nestedClassDeclaration.js | 6 +- tests/baselines/reference/nestedLoops.js | 2 +- tests/baselines/reference/nestedSelf.js | 2 +- tests/baselines/reference/neverType.js | 2 +- tests/baselines/reference/newArrays.js | 4 +- .../reference/newOnInstanceSymbol.js | 2 +- tests/baselines/reference/newOperator.js | 4 +- .../reference/newOperatorConformance.js | 6 +- .../reference/newOperatorErrorCases.js | 6 +- tests/baselines/reference/newTarget.es5.js | 4 +- tests/baselines/reference/newWithSpread.js | 2 +- tests/baselines/reference/newWithSpreadES5.js | 2 +- ...CollisionThisExpressionAndClassInGlobal.js | 2 +- ...ionThisExpressionAndLocalVarInAccessors.js | 4 +- ...nThisExpressionAndLocalVarInConstructor.js | 4 +- ...lisionThisExpressionAndLocalVarInMethod.js | 2 +- ...sionThisExpressionAndLocalVarInProperty.js | 4 +- .../reference/noConstraintInReturnType1.js | 2 +- tests/baselines/reference/noEmitHelpers.js | 4 +- tests/baselines/reference/noEmitHelpers2.js | 2 +- .../baselines/reference/noErrorsInCallback.js | 2 +- ...ImplicitAnyDestructuringInPrivateMethod.js | 2 +- .../noImplicitAnyForMethodParameters.js | 4 +- .../noImplicitAnyMissingGetAccessor.js | 4 +- .../noImplicitAnyMissingSetAccessor.js | 4 +- .../noImplicitAnyParametersInClass.js | 2 +- .../noImplicitReturnInConstructors.js | 2 +- .../reference/noTypeArgumentOnReturnType1.js | 2 +- ...enericClassExtendingGenericClassWithAny.js | 4 +- ...onGenericTypeReferenceWithTypeArguments.js | 4 +- .../reference/nonIdenticalTypeConstraints.js | 12 +- .../reference/nonInstantiatedModule.js | 2 +- .../nonMergedDeclarationsAndOverloads.js | 2 +- .../baselines/reference/nonPrimitiveNarrow.js | 2 +- tests/baselines/reference/null.js | 2 +- .../reference/nullAssignableToEveryType.js | 2 +- .../nullIsSubtypeOfEverythingButUndefined.js | 6 +- .../reference/numericClassMembers1.js | 6 +- ...icIndexerConstrainsPropertyDeclarations.js | 2 +- ...cIndexerConstrainsPropertyDeclarations2.js | 6 +- .../reference/numericIndexerConstraint.js | 2 +- .../reference/numericIndexerConstraint1.js | 2 +- .../reference/numericIndexerConstraint2.js | 2 +- .../reference/numericIndexerConstraint3.js | 6 +- .../reference/numericIndexerConstraint4.js | 4 +- .../reference/numericIndexerTyping2.js | 4 +- .../reference/numericIndexingResults.js | 2 +- .../baselines/reference/numericMethodName1.js | 2 +- .../numericNamedPropertyDuplicates.js | 2 +- .../numericStringNamedPropertyEquivalence.js | 2 +- ...ctCreationExpressionInFunctionParameter.js | 2 +- ...objectCreationOfElementAccessExpression.js | 16 +- tests/baselines/reference/objectFreeze.js | 2 +- tests/baselines/reference/objectIndexer.js | 2 +- .../reference/objectLitArrayDeclNoNew.js | 2 +- .../objectLiteralDeclarationGeneration1.js | 2 +- .../reference/objectMembersOnTypes.js | 2 +- .../reference/objectRestParameterES5.js | 2 +- tests/baselines/reference/objectSpread.js | 2 +- .../reference/objectSpreadNegative.js | 6 +- ...objectTypeHidingMembersOfExtendedObject.js | 6 +- .../objectTypeHidingMembersOfObject.js | 2 +- ...peHidingMembersOfObjectAssignmentCompat.js | 2 +- ...eHidingMembersOfObjectAssignmentCompat2.js | 2 +- .../reference/objectTypePropertyAccess.js | 2 +- .../objectTypeWithDuplicateNumericProperty.js | 2 +- .../objectTypeWithNumericProperty.js | 2 +- .../objectTypeWithRecursiveWrappedProperty.js | 2 +- ...objectTypeWithRecursiveWrappedProperty2.js | 2 +- ...ecursiveWrappedPropertyCheckedNominally.js | 4 +- ...ypeWithStringIndexerHidingObjectIndexer.js | 2 +- ...bjectTypeWithStringNamedNumericProperty.js | 2 +- ...hStringNamedPropertyOfIllegalCharacters.js | 2 +- .../reference/objectTypesIdentity.js | 6 +- .../reference/objectTypesIdentity2.js | 6 +- .../objectTypesIdentityWithCallSignatures.js | 6 +- .../objectTypesIdentityWithCallSignatures2.js | 6 +- ...yWithCallSignaturesDifferingParamCounts.js | 6 +- ...IdentityWithCallSignaturesWithOverloads.js | 6 +- ...ectTypesIdentityWithConstructSignatures.js | 6 +- ...ctTypesIdentityWithConstructSignatures2.js | 4 +- ...ConstructSignaturesDifferingParamCounts.js | 4 +- ...tTypesIdentityWithGenericCallSignatures.js | 6 +- ...TypesIdentityWithGenericCallSignatures2.js | 6 +- ...ricCallSignaturesDifferingByConstraints.js | 6 +- ...icCallSignaturesDifferingByConstraints2.js | 8 +- ...icCallSignaturesDifferingByConstraints3.js | 12 +- ...ericCallSignaturesDifferingByReturnType.js | 6 +- ...ricCallSignaturesDifferingByReturnType2.js | 6 +- ...lSignaturesDifferingTypeParameterCounts.js | 6 +- ...llSignaturesDifferingTypeParameterNames.js | 6 +- ...WithGenericCallSignaturesOptionalParams.js | 6 +- ...ithGenericCallSignaturesOptionalParams2.js | 6 +- ...ithGenericCallSignaturesOptionalParams3.js | 6 +- ...nstructSignaturesDifferingByConstraints.js | 4 +- ...structSignaturesDifferingByConstraints2.js | 6 +- ...structSignaturesDifferingByConstraints3.js | 10 +- ...onstructSignaturesDifferingByReturnType.js | 4 +- ...nstructSignaturesDifferingByReturnType2.js | 4 +- ...tSignaturesDifferingTypeParameterCounts.js | 4 +- ...ctSignaturesDifferingTypeParameterNames.js | 4 +- ...enericConstructSignaturesOptionalParams.js | 4 +- ...nericConstructSignaturesOptionalParams2.js | 4 +- ...nericConstructSignaturesOptionalParams3.js | 4 +- ...objectTypesIdentityWithNumericIndexers1.js | 10 +- ...objectTypesIdentityWithNumericIndexers2.js | 14 +- ...objectTypesIdentityWithNumericIndexers3.js | 10 +- .../objectTypesIdentityWithOptionality.js | 6 +- .../objectTypesIdentityWithPrivates.js | 10 +- .../objectTypesIdentityWithPrivates2.js | 4 +- .../objectTypesIdentityWithPrivates3.js | 8 +- .../objectTypesIdentityWithPublics.js | 6 +- .../objectTypesIdentityWithStringIndexers.js | 10 +- .../objectTypesIdentityWithStringIndexers2.js | 14 +- .../objectTypesWithOptionalProperties.js | 4 +- .../objectTypesWithOptionalProperties2.js | 4 +- .../objectTypesWithPredefinedTypesAsName.js | 10 +- .../objectTypesWithPredefinedTypesAsName2.js | 2 +- .../optionalArgsWithDefaultValues.js | 2 +- .../optionalConstructorArgInSuper.js | 4 +- tests/baselines/reference/optionalMethods.js | 6 +- .../reference/optionalParamArgsTest.js | 4 +- .../reference/optionalParamInOverride.js | 4 +- .../reference/optionalParameterProperty.js | 4 +- .../optionalParamterAndVariableDeclaration.js | 2 +- ...optionalParamterAndVariableDeclaration2.js | 2 +- .../reference/optionalPropertiesInClasses.js | 6 +- .../reference/optionalSetterParam.js | 2 +- tests/baselines/reference/out-flag.js | 2 +- .../reference/out-flag.sourcemap.txt | 4 +- tests/baselines/reference/out-flag2.js | 4 +- .../reference/out-flag2.sourcemap.txt | 6 +- tests/baselines/reference/out-flag3.js | 4 +- .../reference/out-flag3.sourcemap.txt | 13 +- .../baselines/reference/outModuleConcatAmd.js | 4 +- .../outModuleConcatAmd.sourcemap.txt | 4 +- .../reference/outModuleConcatSystem.js | 4 +- .../outModuleConcatSystem.sourcemap.txt | 4 +- .../reference/outModuleTripleSlashRefs.js | 6 +- .../outModuleTripleSlashRefs.sourcemap.txt | 20 +- tests/baselines/reference/overload1.js | 6 +- tests/baselines/reference/overload2.js | 2 +- .../reference/overloadAssignmentCompat.js | 2 +- tests/baselines/reference/overloadCallTest.js | 2 +- .../reference/overloadConsecutiveness.js | 2 +- .../overloadEquivalenceWithStatics.js | 2 +- .../overloadGenericFunctionWithRestArgs.js | 4 +- .../reference/overloadModifiersMustAgree.js | 2 +- .../overloadOnConstConstraintChecks1.js | 10 +- .../overloadOnConstConstraintChecks2.js | 6 +- .../overloadOnConstConstraintChecks3.js | 6 +- .../overloadOnConstConstraintChecks4.js | 8 +- ...nstInBaseWithBadImplementationInDerived.js | 2 +- .../reference/overloadOnConstInCallback1.js | 2 +- .../reference/overloadOnConstInheritance4.js | 2 +- .../overloadOnConstNoAnyImplementation2.js | 2 +- ...verloadOnConstNoNonSpecializedSignature.js | 2 +- .../overloadOnConstNoStringImplementation2.js | 2 +- .../overloadOnConstantsInvalidOverload1.js | 8 +- ...verloadOnGenericClassAndNonGenericClass.js | 12 +- .../baselines/reference/overloadResolution.js | 8 +- .../overloadResolutionClassConstructors.js | 18 +- .../overloadResolutionConstructors.js | 8 +- ...overloadResolutionOnDefaultConstructor1.js | 2 +- .../overloadResolutionOverNonCTLambdas.js | 2 +- .../reference/overloadReturnTypes.js | 2 +- .../overloadedStaticMethodSpecialization.js | 2 +- .../reference/overloadingOnConstants1.js | 8 +- .../reference/overloadingOnConstants2.js | 6 +- ...esolutionWithConstraintCheckingDeferred.js | 2 +- .../reference/overloadsWithinClasses.js | 6 +- .../overrideBaseIntersectionMethod.js | 6 +- .../overridingPrivateStaticMembers.js | 4 +- .../reference/paramPropertiesInSignatures.js | 2 +- ...meterInitializerBeforeDestructuringEmit.js | 2 +- ...parameterInitializersForwardReferencing.js | 2 +- .../parameterNamesInTypeParameterList.js | 2 +- .../parameterPropertyInConstructor2.js | 2 +- ...ameterPropertyInitializerInInitializers.js | 2 +- .../parameterPropertyOutsideConstructor.js | 2 +- ...ameterPropertyReferencingOtherParameter.js | 2 +- .../parameterReferenceInInitializer1.js | 2 +- .../parameterReferencesOtherParameter1.js | 4 +- .../parameterReferencesOtherParameter2.js | 4 +- .../parametersWithNoAnnotationAreAny.js | 2 +- .../reference/parseErrorInHeritageClause1.js | 2 +- tests/baselines/reference/parser0_004152.js | 2 +- tests/baselines/reference/parser509546.js | 2 +- tests/baselines/reference/parser509546_1.js | 2 +- tests/baselines/reference/parser509546_2.js | 2 +- tests/baselines/reference/parser509630.js | 4 +- tests/baselines/reference/parser509667.js | 2 +- tests/baselines/reference/parser509668.js | 2 +- tests/baselines/reference/parser512084.js | 2 +- tests/baselines/reference/parser553699.js | 4 +- tests/baselines/reference/parser585151.js | 2 +- tests/baselines/reference/parser618973.js | 2 +- tests/baselines/reference/parser642331.js | 2 +- tests/baselines/reference/parser642331_1.js | 2 +- .../parserAccessibilityAfterStatic1.js | 2 +- .../parserAccessibilityAfterStatic10.js | 2 +- .../parserAccessibilityAfterStatic11.js | 2 +- .../parserAccessibilityAfterStatic14.js | 2 +- .../parserAccessibilityAfterStatic2.js | 2 +- .../parserAccessibilityAfterStatic3.js | 2 +- .../parserAccessibilityAfterStatic4.js | 2 +- .../parserAccessibilityAfterStatic5.js | 2 +- .../parserAccessibilityAfterStatic6.js | 2 +- .../parserAccessibilityAfterStatic7.js | 2 +- tests/baselines/reference/parserAccessors1.js | 2 +- tests/baselines/reference/parserAccessors2.js | 2 +- tests/baselines/reference/parserAstSpans1.js | 12 +- tests/baselines/reference/parserClass1.js | 2 +- tests/baselines/reference/parserClass2.js | 2 +- .../reference/parserClassDeclaration1.js | 2 +- .../reference/parserClassDeclaration10.js | 2 +- .../reference/parserClassDeclaration11.js | 2 +- .../reference/parserClassDeclaration12.js | 2 +- .../reference/parserClassDeclaration13.js | 2 +- .../reference/parserClassDeclaration14.js | 2 +- .../reference/parserClassDeclaration15.js | 2 +- .../reference/parserClassDeclaration16.js | 2 +- .../reference/parserClassDeclaration19.js | 2 +- .../reference/parserClassDeclaration2.js | 2 +- .../reference/parserClassDeclaration20.js | 2 +- .../reference/parserClassDeclaration21.js | 2 +- .../reference/parserClassDeclaration22.js | 2 +- .../reference/parserClassDeclaration23.js | 2 +- .../reference/parserClassDeclaration24.js | 2 +- .../reference/parserClassDeclaration25.js | 2 +- .../reference/parserClassDeclaration26.js | 2 +- .../reference/parserClassDeclaration3.js | 2 +- .../reference/parserClassDeclaration4.js | 2 +- .../reference/parserClassDeclaration5.js | 2 +- .../reference/parserClassDeclaration6.js | 2 +- .../reference/parserClassDeclaration8.js | 2 +- .../reference/parserClassDeclaration9.js | 2 +- .../parserClassDeclarationIndexSignature1.js | 2 +- .../parserConstructorDeclaration1.js | 2 +- .../parserConstructorDeclaration10.js | 2 +- .../parserConstructorDeclaration11.js | 2 +- .../parserConstructorDeclaration12.js | 2 +- .../parserConstructorDeclaration2.js | 2 +- .../parserConstructorDeclaration3.js | 2 +- .../parserConstructorDeclaration4.js | 2 +- .../parserConstructorDeclaration5.js | 2 +- .../parserConstructorDeclaration6.js | 2 +- .../parserConstructorDeclaration7.js | 2 +- .../parserConstructorDeclaration8.js | 2 +- .../parserConstructorDeclaration9.js | 2 +- .../reference/parserES3Accessors1.js | 2 +- .../reference/parserES3Accessors2.js | 2 +- .../parserES5ComputedPropertyName10.js | 2 +- .../parserES5ComputedPropertyName11.js | 2 +- .../parserES5ComputedPropertyName7.js | 2 +- .../parserES5ComputedPropertyName9.js | 2 +- .../reference/parserES5SymbolIndexer2.js | 2 +- .../reference/parserES5SymbolProperty5.js | 2 +- .../reference/parserES5SymbolProperty6.js | 2 +- .../reference/parserES5SymbolProperty7.js | 2 +- .../parserErrantSemicolonInClass1.js | 2 +- .../parserErrorRecoveryIfStatement1.js | 2 +- .../parserErrorRecoveryIfStatement2.js | 2 +- .../parserErrorRecoveryIfStatement3.js | 2 +- .../parserErrorRecoveryIfStatement4.js | 2 +- .../parserErrorRecoveryIfStatement5.js | 2 +- .../parserErrorRecoveryIfStatement6.js | 2 +- .../reference/parserErrorRecovery_Block3.js | 2 +- .../parserErrorRecovery_ClassElement1.js | 4 +- .../parserErrorRecovery_ClassElement2.js | 2 +- .../parserErrorRecovery_ClassElement3.js | 2 +- ...rrorRecovery_ExtendsOrImplementsClause1.js | 2 +- ...rrorRecovery_ExtendsOrImplementsClause2.js | 2 +- ...rrorRecovery_ExtendsOrImplementsClause3.js | 2 +- ...rrorRecovery_ExtendsOrImplementsClause4.js | 2 +- ...rrorRecovery_ExtendsOrImplementsClause5.js | 2 +- ...ErrorRecovery_IncompleteMemberVariable1.js | 2 +- ...ErrorRecovery_IncompleteMemberVariable2.js | 2 +- .../parserErrorRecovery_ParameterList6.js | 2 +- .../parserErrorRecovery_SourceUnit1.js | 4 +- .../parserErrorRecovery_SwitchStatement2.js | 4 +- .../reference/parserExportAssignment7.js | 2 +- .../reference/parserExportAssignment8.js | 2 +- .../reference/parserGenericClass1.js | 2 +- .../reference/parserGenericClass2.js | 2 +- .../reference/parserGenericConstraint1.js | 2 +- .../reference/parserGenericConstraint2.js | 2 +- .../reference/parserGenericConstraint3.js | 2 +- .../reference/parserGenericConstraint4.js | 2 +- .../reference/parserGenericConstraint5.js | 2 +- .../reference/parserGenericConstraint6.js | 2 +- .../reference/parserGenericConstraint7.js | 2 +- .../parserGenericsInTypeContexts1.js | 2 +- .../parserGenericsInTypeContexts2.js | 2 +- .../parserGetAccessorWithTypeParameters1.js | 2 +- .../parserIndexMemberDeclaration1.js | 2 +- .../parserIndexMemberDeclaration10.js | 2 +- .../parserIndexMemberDeclaration2.js | 2 +- .../parserIndexMemberDeclaration3.js | 2 +- .../parserIndexMemberDeclaration4.js | 2 +- .../parserIndexMemberDeclaration5.js | 2 +- .../parserIndexMemberDeclaration6.js | 2 +- .../parserIndexMemberDeclaration7.js | 2 +- .../parserIndexMemberDeclaration8.js | 2 +- .../parserIndexMemberDeclaration9.js | 2 +- ...InvalidIdentifiersInVariableStatements1.js | 2 +- .../reference/parserMemberAccessor1.js | 2 +- .../parserMemberAccessorDeclaration1.js | 2 +- .../parserMemberAccessorDeclaration10.js | 2 +- .../parserMemberAccessorDeclaration11.js | 2 +- .../parserMemberAccessorDeclaration12.js | 2 +- .../parserMemberAccessorDeclaration13.js | 2 +- .../parserMemberAccessorDeclaration14.js | 2 +- .../parserMemberAccessorDeclaration15.js | 2 +- .../parserMemberAccessorDeclaration16.js | 2 +- .../parserMemberAccessorDeclaration17.js | 2 +- .../parserMemberAccessorDeclaration18.js | 2 +- .../parserMemberAccessorDeclaration2.js | 2 +- .../parserMemberAccessorDeclaration3.js | 2 +- .../parserMemberAccessorDeclaration4.js | 2 +- .../parserMemberAccessorDeclaration5.js | 2 +- .../parserMemberAccessorDeclaration6.js | 2 +- .../parserMemberAccessorDeclaration7.js | 2 +- .../parserMemberAccessorDeclaration8.js | 2 +- .../parserMemberAccessorDeclaration9.js | 2 +- .../parserMemberFunctionDeclaration1.js | 2 +- .../parserMemberFunctionDeclaration2.js | 2 +- .../parserMemberFunctionDeclaration3.js | 2 +- .../parserMemberFunctionDeclaration4.js | 2 +- .../parserMemberFunctionDeclaration5.js | 2 +- ...erMemberFunctionDeclarationAmbiguities1.js | 2 +- .../parserMemberVariableDeclaration1.js | 2 +- .../parserMemberVariableDeclaration2.js | 2 +- .../parserMemberVariableDeclaration3.js | 2 +- .../parserMemberVariableDeclaration4.js | 2 +- .../parserMemberVariableDeclaration5.js | 2 +- .../parserMissingLambdaOpenBrace1.js | 2 +- .../reference/parserParameterList1.js | 2 +- .../reference/parserParameterList10.js | 2 +- .../reference/parserParameterList16.js | 2 +- .../reference/parserParameterList17.js | 2 +- .../reference/parserParameterList2.js | 2 +- .../reference/parserParameterList3.js | 2 +- .../reference/parserParameterList6.js | 2 +- .../reference/parserParameterList7.js | 2 +- .../reference/parserParameterList9.js | 2 +- .../baselines/reference/parserRealSource1.js | 6 +- .../baselines/reference/parserRealSource10.js | 18 +- .../baselines/reference/parserRealSource11.js | 100 ++++---- .../baselines/reference/parserRealSource12.js | 6 +- .../baselines/reference/parserRealSource14.js | 4 +- .../baselines/reference/parserRealSource4.js | 12 +- .../baselines/reference/parserRealSource5.js | 2 +- .../baselines/reference/parserRealSource6.js | 6 +- .../baselines/reference/parserRealSource7.js | 2 +- .../baselines/reference/parserRealSource8.js | 4 +- .../baselines/reference/parserRealSource9.js | 2 +- .../parserSetAccessorWithTypeAnnotation1.js | 2 +- .../parserSetAccessorWithTypeParameters1.js | 2 +- .../reference/parserSuperExpression1.js | 4 +- .../reference/parserSuperExpression2.js | 2 +- .../reference/parserSuperExpression3.js | 2 +- .../reference/parserSuperExpression4.js | 4 +- tests/baselines/reference/parserUnicode3.js | 2 +- tests/baselines/reference/parserharness.js | 32 +-- tests/baselines/reference/parserindenter.js | 2 +- ...sRecoversWhenHittingUnexpectedSemicolon.js | 2 +- .../reference/partiallyAmbientClodule.js | 2 +- ...artiallyAnnotatedFunctionInferenceError.js | 4 +- ...tatedFunctionInferenceWithTypeParameter.js | 4 +- .../partiallyDiscriminantedUnions.js | 4 +- .../reference/plusOperatorWithAnyOtherType.js | 2 +- .../reference/plusOperatorWithBooleanType.js | 2 +- .../reference/plusOperatorWithNumberType.js | 2 +- .../reference/plusOperatorWithStringType.js | 2 +- .../prespecializedGenericMembers1.js | 4 +- .../reference/primitiveConstraints2.js | 2 +- tests/baselines/reference/primitiveMembers.js | 4 +- .../reference/primitiveTypeAsClassName.js | 2 +- .../reference/privacyAccessorDeclFile.js | 146 ++++++------ .../privacyCannotNameAccessorDeclFile.js | 12 +- .../privacyCannotNameVarTypeDeclFile.js | 12 +- ...nalModuleExportAssignmentOfGenericClass.js | 2 +- ...arameterReferenceInConstructorParameter.js | 4 +- tests/baselines/reference/privacyClass.js | 84 +++---- .../privacyClassExtendsClauseDeclFile.js | 64 ++--- .../privacyClassImplementsClauseDeclFile.js | 48 ++-- tests/baselines/reference/privacyFunc.js | 22 +- ...FunctionCannotNameParameterTypeDeclFile.js | 20 +- ...acyFunctionCannotNameReturnTypeDeclFile.js | 12 +- .../privacyFunctionParameterDeclFile.js | 84 +++---- .../privacyFunctionReturnTypeDeclFile.js | 84 +++---- tests/baselines/reference/privacyGetter.js | 24 +- tests/baselines/reference/privacyGloClass.js | 36 +-- tests/baselines/reference/privacyGloFunc.js | 48 ++-- tests/baselines/reference/privacyGloGetter.js | 12 +- tests/baselines/reference/privacyGloImport.js | 6 +- .../reference/privacyGloImportParseErrors.js | 6 +- .../reference/privacyGloInterface.js | 6 +- tests/baselines/reference/privacyGloVar.js | 12 +- tests/baselines/reference/privacyImport.js | 12 +- .../reference/privacyImportParseErrors.js | 12 +- tests/baselines/reference/privacyInterface.js | 12 +- ...yLocalInternalReferenceImportWithExport.js | 8 +- ...calInternalReferenceImportWithoutExport.js | 8 +- ...elAmbientExternalModuleImportWithExport.js | 4 +- ...mbientExternalModuleImportWithoutExport.js | 4 +- ...pLevelInternalReferenceImportWithExport.js | 8 +- ...velInternalReferenceImportWithoutExport.js | 8 +- .../privacyTypeParameterOfFunction.js | 16 +- .../privacyTypeParameterOfFunctionDeclFile.js | 56 ++--- .../reference/privacyTypeParametersOfClass.js | 16 +- .../privacyTypeParametersOfClassDeclFile.js | 56 ++--- .../privacyTypeParametersOfInterface.js | 8 +- ...rivacyTypeParametersOfInterfaceDeclFile.js | 24 +- tests/baselines/reference/privacyVar.js | 24 +- .../baselines/reference/privacyVarDeclFile.js | 84 +++---- .../reference/privateAccessInSubclass1.js | 4 +- ...ivateClassPropertyAccessibleWithinClass.js | 4 +- ...lassPropertyAccessibleWithinNestedClass.js | 4 +- tests/baselines/reference/privateIndexer.js | 6 +- .../privateInstanceMemberAccessibility.js | 4 +- .../reference/privateInstanceVisibility.js | 4 +- .../reference/privateInterfaceProperties.js | 4 +- .../privatePropertyUsingObjectType.js | 2 +- ...tedMembersAreNotAccessibleDestructuring.js | 4 +- .../privateStaticMemberAccessibility.js | 4 +- .../privateStaticNotAccessibleInClodule.js | 2 +- .../privateStaticNotAccessibleInClodule2.js | 4 +- .../baselines/reference/privateVisibility.js | 4 +- tests/baselines/reference/privateVisibles.js | 2 +- .../reference/project/declarationDir/amd/a.js | 2 +- .../project/declarationDir/amd/subfolder/b.js | 2 +- .../project/declarationDir/amd/subfolder/c.js | 2 +- .../project/declarationDir/node/a.js | 2 +- .../declarationDir/node/subfolder/b.js | 2 +- .../declarationDir/node/subfolder/c.js | 2 +- .../project/declarationDir2/amd/out/a.js | 2 +- .../declarationDir2/amd/out/subfolder/b.js | 2 +- .../declarationDir2/amd/out/subfolder/c.js | 2 +- .../project/declarationDir2/node/out/a.js | 2 +- .../declarationDir2/node/out/subfolder/b.js | 2 +- .../declarationDir2/node/out/subfolder/c.js | 2 +- .../project/declarationDir3/amd/out.js | 6 +- .../declarationsCascadingImports/amd/m4.js | 2 +- .../declarationsCascadingImports/node/m4.js | 2 +- .../declarationsGlobalImport/amd/glo_m4.js | 2 +- .../declarationsGlobalImport/node/glo_m4.js | 2 +- .../amd/private_m4.js | 2 +- .../node/private_m4.js | 2 +- .../amd/fncOnly_m4.js | 2 +- .../node/fncOnly_m4.js | 2 +- .../amd/m4.js | 2 +- .../node/m4.js | 2 +- .../declarationsMultipleTimesImport/amd/m4.js | 2 +- .../node/m4.js | 2 +- .../amd/m4.js | 2 +- .../node/m4.js | 2 +- .../declarationsSimpleImport/amd/m4.js | 2 +- .../declarationsSimpleImport/node/m4.js | 2 +- .../amd/main.js | 2 +- .../node/main.js | 2 +- .../amd/main.js | 2 +- .../node/main.js | 2 +- .../emitDecoratorMetadataSystemJS/amd/main.js | 2 +- .../node/main.js | 2 +- .../amd/main.js | 2 +- .../node/main.js | 2 +- .../amd/main.js | 2 +- .../node/main.js | 2 +- .../amd/ref/m1.js | 2 +- .../amd/ref/m2.js | 2 +- .../amd/test.js | 2 +- .../node/ref/m1.js | 2 +- .../node/ref/m2.js | 2 +- .../node/test.js | 2 +- .../amd/outdir/simple/ref/m1.js | 2 +- .../amd/outdir/simple/ref/m2.js | 2 +- .../amd/outdir/simple/test.js | 2 +- .../node/outdir/simple/ref/m1.js | 2 +- .../node/outdir/simple/ref/m2.js | 2 +- .../node/outdir/simple/test.js | 2 +- .../amd/bin/test.js | 6 +- .../node/bin/test.js | 4 +- .../amd/bin/outAndOutDirFile.js | 6 +- .../node/bin/outAndOutDirFile.js | 4 +- .../amd/diskFile1.js | 2 +- .../amd/ref/m1.js | 2 +- .../amd/test.js | 2 +- .../node/diskFile1.js | 2 +- .../node/ref/m1.js | 2 +- .../node/test.js | 2 +- .../outputdir_module_multifolder/ref/m1.js | 2 +- .../outputdir_module_multifolder/test.js | 2 +- .../outputdir_module_multifolder_ref/m2.js | 2 +- .../outputdir_module_multifolder/ref/m1.js | 2 +- .../outputdir_module_multifolder/test.js | 2 +- .../outputdir_module_multifolder_ref/m2.js | 2 +- .../amd/bin/test.js | 6 +- .../amd/m1.js | 2 +- .../amd/test.js | 2 +- .../node/m1.js | 2 +- .../node/test.js | 2 +- .../amd/outdir/simple/m1.js | 2 +- .../amd/outdir/simple/test.js | 2 +- .../node/outdir/simple/m1.js | 2 +- .../node/outdir/simple/test.js | 2 +- .../amd/bin/test.js | 4 +- .../amd/ref/m1.js | 2 +- .../amd/test.js | 2 +- .../node/ref/m1.js | 2 +- .../node/test.js | 2 +- .../amd/outdir/simple/ref/m1.js | 2 +- .../amd/outdir/simple/test.js | 2 +- .../node/outdir/simple/ref/m1.js | 2 +- .../node/outdir/simple/test.js | 2 +- .../amd/bin/test.js | 4 +- .../amd/diskFile1.js | 2 +- .../amd/ref/m1.js | 2 +- .../amd/test.js | 2 +- .../node/diskFile1.js | 2 +- .../node/ref/m1.js | 2 +- .../node/test.js | 2 +- .../simple/outputdir_multifolder/ref/m1.js | 2 +- .../simple/outputdir_multifolder/test.js | 2 +- .../simple/outputdir_multifolder_ref/m2.js | 2 +- .../simple/outputdir_multifolder/ref/m1.js | 2 +- .../simple/outputdir_multifolder/test.js | 2 +- .../simple/outputdir_multifolder_ref/m2.js | 2 +- .../amd/bin/test.js | 6 +- .../node/bin/test.js | 6 +- .../amd/m1.js | 2 +- .../amd/test.js | 2 +- .../node/m1.js | 2 +- .../node/test.js | 2 +- .../amd/outdir/simple/m1.js | 2 +- .../amd/outdir/simple/test.js | 2 +- .../node/outdir/simple/m1.js | 2 +- .../node/outdir/simple/test.js | 2 +- .../amd/bin/test.js | 4 +- .../node/bin/test.js | 4 +- .../amd/test.js | 2 +- .../node/test.js | 2 +- .../amd/outdir/simple/test.js | 2 +- .../node/outdir/simple/test.js | 2 +- .../amd/bin/test.js | 2 +- .../node/bin/test.js | 2 +- .../amd/ref/m1.js | 2 +- .../amd/test.js | 2 +- .../node/ref/m1.js | 2 +- .../node/test.js | 2 +- .../amd/outdir/simple/ref/m1.js | 2 +- .../amd/outdir/simple/test.js | 2 +- .../node/outdir/simple/ref/m1.js | 2 +- .../node/outdir/simple/test.js | 2 +- .../amd/bin/test.js | 4 +- .../node/bin/test.js | 4 +- .../amd/ref/m1.js | 2 +- .../amd/ref/m2.js | 2 +- .../amd/test.js | 2 +- .../node/ref/m1.js | 2 +- .../node/ref/m2.js | 2 +- .../node/test.js | 2 +- .../amd/outdir/simple/ref/m1.js | 2 +- .../amd/outdir/simple/ref/m2.js | 2 +- .../amd/outdir/simple/test.js | 2 +- .../node/outdir/simple/ref/m1.js | 2 +- .../node/outdir/simple/ref/m2.js | 2 +- .../node/outdir/simple/test.js | 2 +- .../amd/bin/test.js | 6 +- .../node/bin/test.js | 4 +- .../amd/bin/outAndOutDirFile.js | 6 +- .../node/bin/outAndOutDirFile.js | 4 +- .../amd/diskFile1.js | 2 +- .../amd/ref/m1.js | 2 +- .../amd/test.js | 2 +- .../node/diskFile1.js | 2 +- .../node/ref/m1.js | 2 +- .../node/test.js | 2 +- .../outputdir_module_multifolder/ref/m1.js | 2 +- .../outputdir_module_multifolder/test.js | 2 +- .../outputdir_module_multifolder_ref/m2.js | 2 +- .../outputdir_module_multifolder/ref/m1.js | 2 +- .../outputdir_module_multifolder/test.js | 2 +- .../outputdir_module_multifolder_ref/m2.js | 2 +- .../amd/bin/test.js | 6 +- .../amd/m1.js | 2 +- .../amd/test.js | 2 +- .../node/m1.js | 2 +- .../node/test.js | 2 +- .../amd/outdir/simple/m1.js | 2 +- .../amd/outdir/simple/test.js | 2 +- .../node/outdir/simple/m1.js | 2 +- .../node/outdir/simple/test.js | 2 +- .../amd/bin/test.js | 4 +- .../amd/ref/m1.js | 2 +- .../amd/test.js | 2 +- .../node/ref/m1.js | 2 +- .../node/test.js | 2 +- .../amd/outdir/simple/ref/m1.js | 2 +- .../amd/outdir/simple/test.js | 2 +- .../node/outdir/simple/ref/m1.js | 2 +- .../node/outdir/simple/test.js | 2 +- .../amd/bin/test.js | 4 +- .../amd/diskFile1.js | 2 +- .../amd/ref/m1.js | 2 +- .../amd/test.js | 2 +- .../node/diskFile1.js | 2 +- .../node/ref/m1.js | 2 +- .../node/test.js | 2 +- .../simple/outputdir_multifolder/ref/m1.js | 2 +- .../simple/outputdir_multifolder/test.js | 2 +- .../simple/outputdir_multifolder_ref/m2.js | 2 +- .../simple/outputdir_multifolder/ref/m1.js | 2 +- .../simple/outputdir_multifolder/test.js | 2 +- .../simple/outputdir_multifolder_ref/m2.js | 2 +- .../amd/bin/test.js | 6 +- .../node/bin/test.js | 6 +- .../amd/m1.js | 2 +- .../amd/test.js | 2 +- .../node/m1.js | 2 +- .../node/test.js | 2 +- .../amd/outdir/simple/m1.js | 2 +- .../amd/outdir/simple/test.js | 2 +- .../node/outdir/simple/m1.js | 2 +- .../node/outdir/simple/test.js | 2 +- .../amd/bin/test.js | 4 +- .../node/bin/test.js | 4 +- .../amd/test.js | 2 +- .../node/test.js | 2 +- .../amd/outdir/simple/test.js | 2 +- .../node/outdir/simple/test.js | 2 +- .../amd/bin/test.js | 2 +- .../node/bin/test.js | 2 +- .../amd/ref/m1.js | 2 +- .../amd/test.js | 2 +- .../node/ref/m1.js | 2 +- .../node/test.js | 2 +- .../amd/outdir/simple/ref/m1.js | 2 +- .../amd/outdir/simple/test.js | 2 +- .../node/outdir/simple/ref/m1.js | 2 +- .../node/outdir/simple/test.js | 2 +- .../amd/bin/test.js | 4 +- .../node/bin/test.js | 4 +- .../amd/ref/m1.js | 2 +- .../amd/ref/m2.js | 2 +- .../amd/test.js | 2 +- .../node/ref/m1.js | 2 +- .../node/ref/m2.js | 2 +- .../node/test.js | 2 +- .../amd/outdir/simple/ref/m1.js | 2 +- .../amd/outdir/simple/ref/m2.js | 2 +- .../amd/outdir/simple/test.js | 2 +- .../node/outdir/simple/ref/m1.js | 2 +- .../node/outdir/simple/ref/m2.js | 2 +- .../node/outdir/simple/test.js | 2 +- .../amd/bin/test.js | 6 +- .../node/bin/test.js | 4 +- .../amd/bin/outAndOutDirFile.js | 6 +- .../node/bin/outAndOutDirFile.js | 4 +- .../amd/diskFile1.js | 2 +- .../amd/ref/m1.js | 2 +- .../amd/test.js | 2 +- .../node/diskFile1.js | 2 +- .../node/ref/m1.js | 2 +- .../node/test.js | 2 +- .../outputdir_module_multifolder/ref/m1.js | 2 +- .../outputdir_module_multifolder/test.js | 2 +- .../outputdir_module_multifolder_ref/m2.js | 2 +- .../outputdir_module_multifolder/ref/m1.js | 2 +- .../outputdir_module_multifolder/test.js | 2 +- .../outputdir_module_multifolder_ref/m2.js | 2 +- .../amd/bin/test.js | 6 +- .../maprootUrlModuleSimpleNoOutdir/amd/m1.js | 2 +- .../amd/test.js | 2 +- .../maprootUrlModuleSimpleNoOutdir/node/m1.js | 2 +- .../node/test.js | 2 +- .../amd/outdir/simple/m1.js | 2 +- .../amd/outdir/simple/test.js | 2 +- .../node/outdir/simple/m1.js | 2 +- .../node/outdir/simple/test.js | 2 +- .../amd/bin/test.js | 4 +- .../amd/ref/m1.js | 2 +- .../amd/test.js | 2 +- .../node/ref/m1.js | 2 +- .../node/test.js | 2 +- .../amd/outdir/simple/ref/m1.js | 2 +- .../amd/outdir/simple/test.js | 2 +- .../node/outdir/simple/ref/m1.js | 2 +- .../node/outdir/simple/test.js | 2 +- .../amd/bin/test.js | 4 +- .../amd/diskFile1.js | 2 +- .../amd/ref/m1.js | 2 +- .../maprootUrlMultifolderNoOutdir/amd/test.js | 2 +- .../node/diskFile1.js | 2 +- .../node/ref/m1.js | 2 +- .../node/test.js | 2 +- .../simple/outputdir_multifolder/ref/m1.js | 2 +- .../simple/outputdir_multifolder/test.js | 2 +- .../simple/outputdir_multifolder_ref/m2.js | 2 +- .../simple/outputdir_multifolder/ref/m1.js | 2 +- .../simple/outputdir_multifolder/test.js | 2 +- .../simple/outputdir_multifolder_ref/m2.js | 2 +- .../amd/bin/test.js | 6 +- .../node/bin/test.js | 6 +- .../maprootUrlSimpleNoOutdir/amd/m1.js | 2 +- .../maprootUrlSimpleNoOutdir/amd/test.js | 2 +- .../maprootUrlSimpleNoOutdir/node/m1.js | 2 +- .../maprootUrlSimpleNoOutdir/node/test.js | 2 +- .../amd/outdir/simple/m1.js | 2 +- .../amd/outdir/simple/test.js | 2 +- .../node/outdir/simple/m1.js | 2 +- .../node/outdir/simple/test.js | 2 +- .../amd/bin/test.js | 4 +- .../node/bin/test.js | 4 +- .../maprootUrlSingleFileNoOutdir/amd/test.js | 2 +- .../maprootUrlSingleFileNoOutdir/node/test.js | 2 +- .../amd/outdir/simple/test.js | 2 +- .../node/outdir/simple/test.js | 2 +- .../amd/bin/test.js | 2 +- .../node/bin/test.js | 2 +- .../maprootUrlSubfolderNoOutdir/amd/ref/m1.js | 2 +- .../maprootUrlSubfolderNoOutdir/amd/test.js | 2 +- .../node/ref/m1.js | 2 +- .../maprootUrlSubfolderNoOutdir/node/test.js | 2 +- .../amd/outdir/simple/ref/m1.js | 2 +- .../amd/outdir/simple/test.js | 2 +- .../node/outdir/simple/ref/m1.js | 2 +- .../node/outdir/simple/test.js | 2 +- .../amd/bin/test.js | 4 +- .../node/bin/test.js | 4 +- .../amd/ref/m1.js | 2 +- .../amd/ref/m2.js | 2 +- .../amd/test.js | 2 +- .../node/ref/m1.js | 2 +- .../node/ref/m2.js | 2 +- .../node/test.js | 2 +- .../amd/outdir/simple/ref/m1.js | 2 +- .../amd/outdir/simple/ref/m2.js | 2 +- .../amd/outdir/simple/test.js | 2 +- .../node/outdir/simple/ref/m1.js | 2 +- .../node/outdir/simple/ref/m2.js | 2 +- .../node/outdir/simple/test.js | 2 +- .../amd/bin/test.js | 6 +- .../node/bin/test.js | 4 +- .../amd/bin/outAndOutDirFile.js | 6 +- .../node/bin/outAndOutDirFile.js | 4 +- .../amd/diskFile1.js | 2 +- .../amd/ref/m1.js | 2 +- .../amd/test.js | 2 +- .../node/diskFile1.js | 2 +- .../node/ref/m1.js | 2 +- .../node/test.js | 2 +- .../outputdir_module_multifolder/ref/m1.js | 2 +- .../outputdir_module_multifolder/test.js | 2 +- .../outputdir_module_multifolder_ref/m2.js | 2 +- .../outputdir_module_multifolder/ref/m1.js | 2 +- .../outputdir_module_multifolder/test.js | 2 +- .../outputdir_module_multifolder_ref/m2.js | 2 +- .../amd/bin/test.js | 6 +- .../amd/m1.js | 2 +- .../amd/test.js | 2 +- .../node/m1.js | 2 +- .../node/test.js | 2 +- .../amd/outdir/simple/m1.js | 2 +- .../amd/outdir/simple/test.js | 2 +- .../node/outdir/simple/m1.js | 2 +- .../node/outdir/simple/test.js | 2 +- .../amd/bin/test.js | 4 +- .../amd/ref/m1.js | 2 +- .../amd/test.js | 2 +- .../node/ref/m1.js | 2 +- .../node/test.js | 2 +- .../amd/outdir/simple/ref/m1.js | 2 +- .../amd/outdir/simple/test.js | 2 +- .../node/outdir/simple/ref/m1.js | 2 +- .../node/outdir/simple/test.js | 2 +- .../amd/bin/test.js | 4 +- .../amd/diskFile1.js | 2 +- .../amd/ref/m1.js | 2 +- .../amd/test.js | 2 +- .../node/diskFile1.js | 2 +- .../node/ref/m1.js | 2 +- .../node/test.js | 2 +- .../simple/outputdir_multifolder/ref/m1.js | 2 +- .../simple/outputdir_multifolder/test.js | 2 +- .../simple/outputdir_multifolder_ref/m2.js | 2 +- .../simple/outputdir_multifolder/ref/m1.js | 2 +- .../simple/outputdir_multifolder/test.js | 2 +- .../simple/outputdir_multifolder_ref/m2.js | 2 +- .../amd/bin/test.js | 6 +- .../node/bin/test.js | 6 +- .../amd/m1.js | 2 +- .../amd/test.js | 2 +- .../node/m1.js | 2 +- .../node/test.js | 2 +- .../amd/outdir/simple/m1.js | 2 +- .../amd/outdir/simple/test.js | 2 +- .../node/outdir/simple/m1.js | 2 +- .../node/outdir/simple/test.js | 2 +- .../amd/bin/test.js | 4 +- .../node/bin/test.js | 4 +- .../amd/test.js | 2 +- .../node/test.js | 2 +- .../amd/outdir/simple/test.js | 2 +- .../node/outdir/simple/test.js | 2 +- .../amd/bin/test.js | 2 +- .../node/bin/test.js | 2 +- .../amd/ref/m1.js | 2 +- .../amd/test.js | 2 +- .../node/ref/m1.js | 2 +- .../node/test.js | 2 +- .../amd/outdir/simple/ref/m1.js | 2 +- .../amd/outdir/simple/test.js | 2 +- .../node/outdir/simple/ref/m1.js | 2 +- .../node/outdir/simple/test.js | 2 +- .../amd/bin/test.js | 4 +- .../node/bin/test.js | 4 +- .../outMixedSubfolderNoOutdir/amd/ref/m1.js | 2 +- .../outMixedSubfolderNoOutdir/amd/ref/m2.js | 2 +- .../outMixedSubfolderNoOutdir/amd/test.js | 2 +- .../outMixedSubfolderNoOutdir/node/ref/m1.js | 2 +- .../outMixedSubfolderNoOutdir/node/ref/m2.js | 2 +- .../outMixedSubfolderNoOutdir/node/test.js | 2 +- .../amd/outdir/simple/ref/m1.js | 2 +- .../amd/outdir/simple/ref/m2.js | 2 +- .../amd/outdir/simple/test.js | 2 +- .../node/outdir/simple/ref/m1.js | 2 +- .../node/outdir/simple/ref/m2.js | 2 +- .../node/outdir/simple/test.js | 2 +- .../amd/bin/test.js | 6 +- .../node/bin/test.js | 4 +- .../amd/bin/outAndOutDirFile.js | 6 +- .../node/bin/outAndOutDirFile.js | 4 +- .../amd/diskFile0.js | 2 +- .../amd/ref/m1.js | 2 +- .../outModuleMultifolderNoOutdir/amd/test.js | 2 +- .../node/diskFile0.js | 2 +- .../node/ref/m1.js | 2 +- .../outModuleMultifolderNoOutdir/node/test.js | 2 +- .../outputdir_module_multifolder/ref/m1.js | 2 +- .../outputdir_module_multifolder/test.js | 2 +- .../outputdir_module_multifolder_ref/m2.js | 2 +- .../outputdir_module_multifolder/ref/m1.js | 2 +- .../outputdir_module_multifolder/test.js | 2 +- .../outputdir_module_multifolder_ref/m2.js | 2 +- .../amd/bin/test.js | 6 +- .../project/outModuleSimpleNoOutdir/amd/m1.js | 2 +- .../outModuleSimpleNoOutdir/amd/test.js | 2 +- .../outModuleSimpleNoOutdir/node/m1.js | 2 +- .../outModuleSimpleNoOutdir/node/test.js | 2 +- .../amd/outdir/simple/m1.js | 2 +- .../amd/outdir/simple/test.js | 2 +- .../node/outdir/simple/m1.js | 2 +- .../node/outdir/simple/test.js | 2 +- .../amd/bin/test.js | 4 +- .../outModuleSubfolderNoOutdir/amd/ref/m1.js | 2 +- .../outModuleSubfolderNoOutdir/amd/test.js | 2 +- .../outModuleSubfolderNoOutdir/node/ref/m1.js | 2 +- .../outModuleSubfolderNoOutdir/node/test.js | 2 +- .../amd/outdir/simple/ref/m1.js | 2 +- .../amd/outdir/simple/test.js | 2 +- .../node/outdir/simple/ref/m1.js | 2 +- .../node/outdir/simple/test.js | 2 +- .../amd/bin/test.js | 4 +- .../outMultifolderNoOutdir/amd/diskFile0.js | 2 +- .../outMultifolderNoOutdir/amd/ref/m1.js | 2 +- .../outMultifolderNoOutdir/amd/test.js | 2 +- .../outMultifolderNoOutdir/node/diskFile0.js | 2 +- .../outMultifolderNoOutdir/node/ref/m1.js | 2 +- .../outMultifolderNoOutdir/node/test.js | 2 +- .../simple/outputdir_multifolder/ref/m1.js | 2 +- .../simple/outputdir_multifolder/test.js | 2 +- .../simple/outputdir_multifolder_ref/m2.js | 2 +- .../simple/outputdir_multifolder/ref/m1.js | 2 +- .../simple/outputdir_multifolder/test.js | 2 +- .../simple/outputdir_multifolder_ref/m2.js | 2 +- .../amd/bin/test.js | 6 +- .../node/bin/test.js | 6 +- .../project/outSimpleNoOutdir/amd/m1.js | 2 +- .../project/outSimpleNoOutdir/amd/test.js | 2 +- .../project/outSimpleNoOutdir/node/m1.js | 2 +- .../project/outSimpleNoOutdir/node/test.js | 2 +- .../amd/outdir/simple/m1.js | 2 +- .../amd/outdir/simple/test.js | 2 +- .../node/outdir/simple/m1.js | 2 +- .../node/outdir/simple/test.js | 2 +- .../amd/bin/test.js | 4 +- .../node/bin/test.js | 4 +- .../project/outSingleFileNoOutdir/amd/test.js | 2 +- .../outSingleFileNoOutdir/node/test.js | 2 +- .../amd/outdir/simple/test.js | 2 +- .../node/outdir/simple/test.js | 2 +- .../amd/bin/test.js | 2 +- .../node/bin/test.js | 2 +- .../outSubfolderNoOutdir/amd/ref/m1.js | 2 +- .../project/outSubfolderNoOutdir/amd/test.js | 2 +- .../outSubfolderNoOutdir/node/ref/m1.js | 2 +- .../project/outSubfolderNoOutdir/node/test.js | 2 +- .../amd/outdir/simple/ref/m1.js | 2 +- .../amd/outdir/simple/test.js | 2 +- .../node/outdir/simple/ref/m1.js | 2 +- .../node/outdir/simple/test.js | 2 +- .../amd/bin/test.js | 4 +- .../node/bin/test.js | 4 +- .../amd/testGlo.js | 8 +- .../node/testGlo.js | 8 +- .../reference/project/prologueEmit/amd/out.js | 4 +- .../project/prologueEmit/node/out.js | 4 +- .../amd/li'b/class'A.js | 2 +- .../amd/m'ain.js | 2 +- .../node/li'b/class'A.js | 2 +- .../node/m'ain.js | 2 +- .../amd/diskFile0.js | 2 +- .../amd/foo.js | 2 +- .../node/diskFile0.js | 2 +- .../node/foo.js | 2 +- .../amd/bar/bar.js | 2 +- .../amd/src/ts/foo/foo.js | 2 +- .../node/bar/bar.js | 2 +- .../node/src/ts/foo/foo.js | 2 +- .../amd/diskFile0.js | 2 +- .../amd/foo.js | 2 +- .../node/diskFile0.js | 2 +- .../node/foo.js | 2 +- .../amd/diskFile0.js | 2 +- .../amd/foo.js | 2 +- .../node/diskFile0.js | 2 +- .../node/foo.js | 2 +- .../amd/test.js | 2 +- .../node/test.js | 2 +- .../amd/test.js | 2 +- .../node/test.js | 2 +- .../outdir/simple/FolderB/FolderC/fileC.js | 2 +- .../amd/outdir/simple/FolderB/fileB.js | 2 +- .../outdir/simple/FolderB/FolderC/fileC.js | 2 +- .../node/outdir/simple/FolderB/fileB.js | 2 +- .../amd/outdir/simple/FolderC/fileC.js | 2 +- .../amd/outdir/simple/fileB.js | 2 +- .../node/outdir/simple/FolderC/fileC.js | 2 +- .../node/outdir/simple/fileB.js | 2 +- .../outdir/simple/FolderB/FolderC/fileC.js | 2 +- .../amd/outdir/simple/FolderB/fileB.js | 2 +- .../outdir/simple/FolderB/FolderC/fileC.js | 2 +- .../node/outdir/simple/FolderB/fileB.js | 2 +- .../amd/ref/m1.js | 2 +- .../amd/ref/m2.js | 2 +- .../amd/test.js | 2 +- .../node/ref/m1.js | 2 +- .../node/ref/m2.js | 2 +- .../node/test.js | 2 +- .../amd/outdir/simple/ref/m1.js | 2 +- .../amd/outdir/simple/ref/m2.js | 2 +- .../amd/outdir/simple/test.js | 2 +- .../node/outdir/simple/ref/m1.js | 2 +- .../node/outdir/simple/ref/m2.js | 2 +- .../node/outdir/simple/test.js | 2 +- .../amd/bin/test.js | 6 +- .../node/bin/test.js | 4 +- .../amd/bin/outAndOutDirFile.js | 6 +- .../node/bin/outAndOutDirFile.js | 4 +- .../amd/diskFile1.js | 2 +- .../amd/ref/m1.js | 2 +- .../amd/test.js | 2 +- .../node/diskFile1.js | 2 +- .../node/ref/m1.js | 2 +- .../node/test.js | 2 +- .../outputdir_module_multifolder/ref/m1.js | 2 +- .../outputdir_module_multifolder/test.js | 2 +- .../outputdir_module_multifolder_ref/m2.js | 2 +- .../outputdir_module_multifolder/ref/m1.js | 2 +- .../outputdir_module_multifolder/test.js | 2 +- .../outputdir_module_multifolder_ref/m2.js | 2 +- .../amd/bin/test.js | 6 +- .../amd/m1.js | 2 +- .../amd/test.js | 2 +- .../node/m1.js | 2 +- .../node/test.js | 2 +- .../amd/outdir/simple/m1.js | 2 +- .../amd/outdir/simple/test.js | 2 +- .../node/outdir/simple/m1.js | 2 +- .../node/outdir/simple/test.js | 2 +- .../amd/bin/test.js | 4 +- .../amd/ref/m1.js | 2 +- .../amd/test.js | 2 +- .../node/ref/m1.js | 2 +- .../node/test.js | 2 +- .../amd/outdir/simple/ref/m1.js | 2 +- .../amd/outdir/simple/test.js | 2 +- .../node/outdir/simple/ref/m1.js | 2 +- .../node/outdir/simple/test.js | 2 +- .../amd/bin/test.js | 4 +- .../amd/diskFile1.js | 2 +- .../amd/ref/m1.js | 2 +- .../amd/test.js | 2 +- .../node/diskFile1.js | 2 +- .../node/ref/m1.js | 2 +- .../node/test.js | 2 +- .../simple/outputdir_multifolder/ref/m1.js | 2 +- .../simple/outputdir_multifolder/test.js | 2 +- .../simple/outputdir_multifolder_ref/m2.js | 2 +- .../simple/outputdir_multifolder/ref/m1.js | 2 +- .../simple/outputdir_multifolder/test.js | 2 +- .../simple/outputdir_multifolder_ref/m2.js | 2 +- .../amd/bin/test.js | 6 +- .../node/bin/test.js | 6 +- .../amd/m1.js | 2 +- .../amd/test.js | 2 +- .../node/m1.js | 2 +- .../node/test.js | 2 +- .../amd/outdir/simple/m1.js | 2 +- .../amd/outdir/simple/test.js | 2 +- .../node/outdir/simple/m1.js | 2 +- .../node/outdir/simple/test.js | 2 +- .../amd/bin/test.js | 4 +- .../node/bin/test.js | 4 +- .../amd/test.js | 2 +- .../node/test.js | 2 +- .../amd/outdir/simple/test.js | 2 +- .../node/outdir/simple/test.js | 2 +- .../amd/bin/test.js | 2 +- .../node/bin/test.js | 2 +- .../amd/ref/m1.js | 2 +- .../amd/test.js | 2 +- .../node/ref/m1.js | 2 +- .../node/test.js | 2 +- .../amd/outdir/simple/ref/m1.js | 2 +- .../amd/outdir/simple/test.js | 2 +- .../node/outdir/simple/ref/m1.js | 2 +- .../node/outdir/simple/test.js | 2 +- .../amd/bin/test.js | 4 +- .../node/bin/test.js | 4 +- .../amd/ref/m1.js | 2 +- .../amd/ref/m2.js | 2 +- .../amd/test.js | 2 +- .../node/ref/m1.js | 2 +- .../node/ref/m2.js | 2 +- .../node/test.js | 2 +- .../amd/outdir/simple/ref/m1.js | 2 +- .../amd/outdir/simple/ref/m2.js | 2 +- .../amd/outdir/simple/test.js | 2 +- .../node/outdir/simple/ref/m1.js | 2 +- .../node/outdir/simple/ref/m2.js | 2 +- .../node/outdir/simple/test.js | 2 +- .../amd/bin/test.js | 6 +- .../node/bin/test.js | 4 +- .../amd/bin/outAndOutDirFile.js | 6 +- .../node/bin/outAndOutDirFile.js | 4 +- .../amd/diskFile1.js | 2 +- .../amd/ref/m1.js | 2 +- .../amd/test.js | 2 +- .../node/diskFile1.js | 2 +- .../node/ref/m1.js | 2 +- .../node/test.js | 2 +- .../outputdir_module_multifolder/ref/m1.js | 2 +- .../outputdir_module_multifolder/test.js | 2 +- .../outputdir_module_multifolder_ref/m2.js | 2 +- .../outputdir_module_multifolder/ref/m1.js | 2 +- .../outputdir_module_multifolder/test.js | 2 +- .../outputdir_module_multifolder_ref/m2.js | 2 +- .../amd/bin/test.js | 6 +- .../amd/m1.js | 2 +- .../amd/test.js | 2 +- .../node/m1.js | 2 +- .../node/test.js | 2 +- .../amd/outdir/simple/m1.js | 2 +- .../amd/outdir/simple/test.js | 2 +- .../node/outdir/simple/m1.js | 2 +- .../node/outdir/simple/test.js | 2 +- .../amd/bin/test.js | 4 +- .../amd/ref/m1.js | 2 +- .../amd/test.js | 2 +- .../node/ref/m1.js | 2 +- .../node/test.js | 2 +- .../amd/outdir/simple/ref/m1.js | 2 +- .../amd/outdir/simple/test.js | 2 +- .../node/outdir/simple/ref/m1.js | 2 +- .../node/outdir/simple/test.js | 2 +- .../amd/bin/test.js | 4 +- .../amd/diskFile1.js | 2 +- .../amd/ref/m1.js | 2 +- .../amd/test.js | 2 +- .../node/diskFile1.js | 2 +- .../node/ref/m1.js | 2 +- .../node/test.js | 2 +- .../simple/outputdir_multifolder/ref/m1.js | 2 +- .../simple/outputdir_multifolder/test.js | 2 +- .../simple/outputdir_multifolder_ref/m2.js | 2 +- .../simple/outputdir_multifolder/ref/m1.js | 2 +- .../simple/outputdir_multifolder/test.js | 2 +- .../simple/outputdir_multifolder_ref/m2.js | 2 +- .../amd/bin/test.js | 6 +- .../node/bin/test.js | 6 +- .../amd/m1.js | 2 +- .../amd/test.js | 2 +- .../node/m1.js | 2 +- .../node/test.js | 2 +- .../amd/outdir/simple/m1.js | 2 +- .../amd/outdir/simple/test.js | 2 +- .../node/outdir/simple/m1.js | 2 +- .../node/outdir/simple/test.js | 2 +- .../amd/bin/test.js | 4 +- .../node/bin/test.js | 4 +- .../amd/test.js | 2 +- .../node/test.js | 2 +- .../amd/outdir/simple/test.js | 2 +- .../node/outdir/simple/test.js | 2 +- .../amd/bin/test.js | 2 +- .../node/bin/test.js | 2 +- .../amd/ref/m1.js | 2 +- .../amd/test.js | 2 +- .../node/ref/m1.js | 2 +- .../node/test.js | 2 +- .../amd/outdir/simple/ref/m1.js | 2 +- .../amd/outdir/simple/test.js | 2 +- .../node/outdir/simple/ref/m1.js | 2 +- .../node/outdir/simple/test.js | 2 +- .../amd/bin/test.js | 4 +- .../node/bin/test.js | 4 +- .../amd/ref/m1.js | 2 +- .../amd/ref/m2.js | 2 +- .../amd/test.js | 2 +- .../node/ref/m1.js | 2 +- .../node/ref/m2.js | 2 +- .../node/test.js | 2 +- .../amd/outdir/simple/ref/m1.js | 2 +- .../amd/outdir/simple/ref/m2.js | 2 +- .../amd/outdir/simple/test.js | 2 +- .../node/outdir/simple/ref/m1.js | 2 +- .../node/outdir/simple/ref/m2.js | 2 +- .../node/outdir/simple/test.js | 2 +- .../amd/bin/test.js | 6 +- .../node/bin/test.js | 4 +- .../amd/bin/outAndOutDirFile.js | 6 +- .../node/bin/outAndOutDirFile.js | 4 +- .../amd/diskFile1.js | 2 +- .../amd/ref/m1.js | 2 +- .../amd/test.js | 2 +- .../node/diskFile1.js | 2 +- .../node/ref/m1.js | 2 +- .../node/test.js | 2 +- .../outputdir_module_multifolder/ref/m1.js | 2 +- .../outputdir_module_multifolder/test.js | 2 +- .../outputdir_module_multifolder_ref/m2.js | 2 +- .../outputdir_module_multifolder/ref/m1.js | 2 +- .../outputdir_module_multifolder/test.js | 2 +- .../outputdir_module_multifolder_ref/m2.js | 2 +- .../amd/bin/test.js | 6 +- .../sourcemapModuleSimpleNoOutdir/amd/m1.js | 2 +- .../sourcemapModuleSimpleNoOutdir/amd/test.js | 2 +- .../sourcemapModuleSimpleNoOutdir/node/m1.js | 2 +- .../node/test.js | 2 +- .../amd/outdir/simple/m1.js | 2 +- .../amd/outdir/simple/test.js | 2 +- .../node/outdir/simple/m1.js | 2 +- .../node/outdir/simple/test.js | 2 +- .../amd/bin/test.js | 4 +- .../amd/ref/m1.js | 2 +- .../amd/test.js | 2 +- .../node/ref/m1.js | 2 +- .../node/test.js | 2 +- .../amd/outdir/simple/ref/m1.js | 2 +- .../amd/outdir/simple/test.js | 2 +- .../node/outdir/simple/ref/m1.js | 2 +- .../node/outdir/simple/test.js | 2 +- .../amd/bin/test.js | 4 +- .../amd/diskFile1.js | 2 +- .../amd/ref/m1.js | 2 +- .../sourcemapMultifolderNoOutdir/amd/test.js | 2 +- .../node/diskFile1.js | 2 +- .../node/ref/m1.js | 2 +- .../sourcemapMultifolderNoOutdir/node/test.js | 2 +- .../simple/outputdir_multifolder/ref/m1.js | 2 +- .../simple/outputdir_multifolder/test.js | 2 +- .../simple/outputdir_multifolder_ref/m2.js | 2 +- .../simple/outputdir_multifolder/ref/m1.js | 2 +- .../simple/outputdir_multifolder/test.js | 2 +- .../simple/outputdir_multifolder_ref/m2.js | 2 +- .../amd/bin/test.js | 6 +- .../node/bin/test.js | 6 +- .../project/sourcemapSimpleNoOutdir/amd/m1.js | 2 +- .../sourcemapSimpleNoOutdir/amd/test.js | 2 +- .../sourcemapSimpleNoOutdir/node/m1.js | 2 +- .../sourcemapSimpleNoOutdir/node/test.js | 2 +- .../amd/outdir/simple/m1.js | 2 +- .../amd/outdir/simple/test.js | 2 +- .../node/outdir/simple/m1.js | 2 +- .../node/outdir/simple/test.js | 2 +- .../amd/bin/test.js | 4 +- .../node/bin/test.js | 4 +- .../sourcemapSingleFileNoOutdir/amd/test.js | 2 +- .../sourcemapSingleFileNoOutdir/node/test.js | 2 +- .../amd/outdir/simple/test.js | 2 +- .../node/outdir/simple/test.js | 2 +- .../amd/bin/test.js | 2 +- .../node/bin/test.js | 2 +- .../sourcemapSubfolderNoOutdir/amd/ref/m1.js | 2 +- .../sourcemapSubfolderNoOutdir/amd/test.js | 2 +- .../sourcemapSubfolderNoOutdir/node/ref/m1.js | 2 +- .../sourcemapSubfolderNoOutdir/node/test.js | 2 +- .../amd/outdir/simple/ref/m1.js | 2 +- .../amd/outdir/simple/test.js | 2 +- .../node/outdir/simple/ref/m1.js | 2 +- .../node/outdir/simple/test.js | 2 +- .../amd/bin/test.js | 4 +- .../node/bin/test.js | 4 +- .../amd/ref/m1.js | 2 +- .../amd/ref/m2.js | 2 +- .../amd/test.js | 2 +- .../node/ref/m1.js | 2 +- .../node/ref/m2.js | 2 +- .../node/test.js | 2 +- .../amd/outdir/simple/ref/m1.js | 2 +- .../amd/outdir/simple/ref/m2.js | 2 +- .../amd/outdir/simple/test.js | 2 +- .../node/outdir/simple/ref/m1.js | 2 +- .../node/outdir/simple/ref/m2.js | 2 +- .../node/outdir/simple/test.js | 2 +- .../amd/bin/test.js | 6 +- .../node/bin/test.js | 4 +- .../amd/bin/outAndOutDirFile.js | 6 +- .../node/bin/outAndOutDirFile.js | 4 +- .../amd/diskFile1.js | 2 +- .../amd/ref/m1.js | 2 +- .../amd/test.js | 2 +- .../node/diskFile1.js | 2 +- .../node/ref/m1.js | 2 +- .../node/test.js | 2 +- .../outputdir_module_multifolder/ref/m1.js | 2 +- .../outputdir_module_multifolder/test.js | 2 +- .../outputdir_module_multifolder_ref/m2.js | 2 +- .../outputdir_module_multifolder/ref/m1.js | 2 +- .../outputdir_module_multifolder/test.js | 2 +- .../outputdir_module_multifolder_ref/m2.js | 2 +- .../amd/bin/test.js | 6 +- .../amd/m1.js | 2 +- .../amd/test.js | 2 +- .../node/m1.js | 2 +- .../node/test.js | 2 +- .../amd/outdir/simple/m1.js | 2 +- .../amd/outdir/simple/test.js | 2 +- .../node/outdir/simple/m1.js | 2 +- .../node/outdir/simple/test.js | 2 +- .../amd/bin/test.js | 4 +- .../amd/ref/m1.js | 2 +- .../amd/test.js | 2 +- .../node/ref/m1.js | 2 +- .../node/test.js | 2 +- .../amd/outdir/simple/ref/m1.js | 2 +- .../amd/outdir/simple/test.js | 2 +- .../node/outdir/simple/ref/m1.js | 2 +- .../node/outdir/simple/test.js | 2 +- .../amd/bin/test.js | 4 +- .../amd/diskFile1.js | 2 +- .../amd/ref/m1.js | 2 +- .../amd/test.js | 2 +- .../node/diskFile1.js | 2 +- .../node/ref/m1.js | 2 +- .../node/test.js | 2 +- .../simple/outputdir_multifolder/ref/m1.js | 2 +- .../simple/outputdir_multifolder/test.js | 2 +- .../simple/outputdir_multifolder_ref/m2.js | 2 +- .../simple/outputdir_multifolder/ref/m1.js | 2 +- .../simple/outputdir_multifolder/test.js | 2 +- .../simple/outputdir_multifolder_ref/m2.js | 2 +- .../amd/bin/test.js | 6 +- .../node/bin/test.js | 6 +- .../sourcerootUrlSimpleNoOutdir/amd/m1.js | 2 +- .../sourcerootUrlSimpleNoOutdir/amd/test.js | 2 +- .../sourcerootUrlSimpleNoOutdir/node/m1.js | 2 +- .../sourcerootUrlSimpleNoOutdir/node/test.js | 2 +- .../amd/outdir/simple/m1.js | 2 +- .../amd/outdir/simple/test.js | 2 +- .../node/outdir/simple/m1.js | 2 +- .../node/outdir/simple/test.js | 2 +- .../amd/bin/test.js | 4 +- .../node/bin/test.js | 4 +- .../amd/test.js | 2 +- .../node/test.js | 2 +- .../amd/outdir/simple/test.js | 2 +- .../node/outdir/simple/test.js | 2 +- .../amd/bin/test.js | 2 +- .../node/bin/test.js | 2 +- .../amd/ref/m1.js | 2 +- .../amd/test.js | 2 +- .../node/ref/m1.js | 2 +- .../node/test.js | 2 +- .../amd/outdir/simple/ref/m1.js | 2 +- .../amd/outdir/simple/test.js | 2 +- .../node/outdir/simple/ref/m1.js | 2 +- .../node/outdir/simple/test.js | 2 +- .../amd/bin/test.js | 4 +- .../node/bin/test.js | 4 +- .../amd/fs.js | 2 +- .../node/fs.js | 2 +- tests/baselines/reference/promiseChaining.js | 2 +- tests/baselines/reference/promiseChaining1.js | 2 +- tests/baselines/reference/promiseChaining2.js | 2 +- tests/baselines/reference/properties.js | 2 +- .../reference/properties.sourcemap.txt | 2 +- .../reference/propertiesAndIndexers.js | 4 +- .../propertiesAndIndexersForNumericNames.js | 2 +- tests/baselines/reference/propertyAccess.js | 4 +- ...rtyAccessOnTypeParameterWithConstraints.js | 2 +- ...tyAccessOnTypeParameterWithConstraints2.js | 6 +- ...tyAccessOnTypeParameterWithConstraints3.js | 6 +- ...tyAccessOnTypeParameterWithConstraints4.js | 2 +- ...tyAccessOnTypeParameterWithConstraints5.js | 6 +- ...AccessOnTypeParameterWithoutConstraints.js | 2 +- .../reference/propertyAccessibility1.js | 2 +- .../reference/propertyAccessibility2.js | 2 +- .../propertyAndAccessorWithSameName.js | 6 +- .../propertyAndFunctionWithSameName.js | 4 +- .../propertyIdentityWithPrivacyMismatch.js | 4 +- .../propertyNameWithoutTypeAnnotation.js | 2 +- .../reference/propertyNamedPrototype.js | 2 +- .../reference/propertyNamesOfReservedWords.js | 2 +- .../propertyNamesWithStringLiteral.js | 2 +- tests/baselines/reference/propertyOrdering.js | 4 +- .../baselines/reference/propertyOrdering2.js | 2 +- .../propertyParameterWithQuestionMark.js | 2 +- .../reference/propertyWrappedInTry.js | 2 +- ...ectedClassPropertyAccessibleWithinClass.js | 4 +- ...lassPropertyAccessibleWithinNestedClass.js | 4 +- ...sPropertyAccessibleWithinNestedSubclass.js | 8 +- ...PropertyAccessibleWithinNestedSubclass1.js | 20 +- ...edClassPropertyAccessibleWithinSubclass.js | 4 +- ...dClassPropertyAccessibleWithinSubclass2.js | 10 +- ...dClassPropertyAccessibleWithinSubclass3.js | 4 +- .../protectedInstanceMemberAccessibility.js | 6 +- tests/baselines/reference/protectedMembers.js | 28 +-- ...icClassPropertyAccessibleWithinSubclass.js | 8 +- ...cClassPropertyAccessibleWithinSubclass2.js | 6 +- .../protectedStaticNotAccessibleInClodule.js | 2 +- .../protoAsIndexInIndexExpression.js | 2 +- tests/baselines/reference/protoInIndexer.js | 2 +- ...prototypeInstantiatedWithBaseConstraint.js | 2 +- tests/baselines/reference/publicIndexer.js | 6 +- ...emberImplementedAsPrivateInDerivedClass.js | 2 +- ...solution-does-not-affect-class-heritage.js | 2 +- .../reference/quotedAccessorName1.js | 2 +- .../reference/quotedAccessorName2.js | 2 +- .../reference/quotedFunctionName1.js | 2 +- .../reference/quotedFunctionName2.js | 2 +- .../reference/quotedPropertyName1.js | 2 +- .../reference/quotedPropertyName2.js | 2 +- .../reference/quotedPropertyName3.js | 2 +- .../raiseErrorOnParameterProperty.js | 2 +- .../reference/reachabilityChecks1.js | 2 +- .../readonlyConstructorAssignment.js | 10 +- .../readonlyInConstructorParameters.js | 6 +- .../reference/readonlyInDeclarationFile.js | 2 +- .../readonlyInNonPropertyParameters.js | 2 +- tests/baselines/reference/readonlyMembers.js | 2 +- tests/baselines/reference/readonlyReadonly.js | 2 +- .../baselines/reference/reassignStaticProp.js | 2 +- .../reference/recursiveBaseCheck3.js | 4 +- .../reference/recursiveBaseCheck4.js | 2 +- .../reference/recursiveBaseCheck5.js | 2 +- .../reference/recursiveBaseCheck6.js | 2 +- .../recursiveBaseConstructorCreation1.js | 4 +- ...ssInstantiationsWithDefaultConstructors.js | 4 +- .../reference/recursiveClassReferenceTest.js | 10 +- .../recursiveClassReferenceTest.sourcemap.txt | 20 +- .../reference/recursiveCloduleReference.js | 2 +- .../reference/recursiveComplicatedClasses.js | 10 +- ...siveExportAssignmentAndFindAliasedType1.js | 2 +- ...siveExportAssignmentAndFindAliasedType2.js | 2 +- ...siveExportAssignmentAndFindAliasedType3.js | 2 +- ...siveExportAssignmentAndFindAliasedType4.js | 2 +- ...siveExportAssignmentAndFindAliasedType5.js | 2 +- ...siveExportAssignmentAndFindAliasedType6.js | 2 +- ...siveExportAssignmentAndFindAliasedType7.js | 2 +- .../reference/recursiveFunctionTypes.js | 2 +- .../reference/recursiveFunctionTypes1.js | 2 +- .../reference/recursiveGetterAccess.js | 2 +- .../reference/recursiveInheritance3.js | 2 +- tests/baselines/reference/recursiveMods.js | 2 +- .../reference/recursiveProperties.js | 4 +- .../recursiveSpecializationOfSignatures.js | 2 +- .../recursiveTypeInGenericConstraint.js | 6 +- ...rameterConstraintReferenceLacksTypeArgs.js | 2 +- .../recursiveTypeParameterReferenceError1.js | 4 +- .../reference/recursiveTypeRelations.js | 2 +- .../recursiveTypesUsedAsFunctionParameters.js | 4 +- ...sivelySpecializedConstructorDeclaration.js | 4 +- .../reference/reexportClassDefinition.js | 4 +- .../reference/reexportedMissingAlias.js | 2 +- .../reference/requireEmitSemicolon.js | 4 +- .../requiredInitializedParameter2.js | 2 +- .../requiredInitializedParameter3.js | 2 +- .../requiredInitializedParameter4.js | 2 +- ...lveTypeAliasWithSameLetDeclarationName1.js | 2 +- ...lassDeclarationWhenInBaseTypeResolution.js | 200 ++++++++-------- .../baselines/reference/restParamModifier.js | 2 +- .../baselines/reference/restParamModifier2.js | 2 +- .../restParameterAssignmentCompatibility.js | 6 +- ...estParameterWithoutAnnotationIsAnyArray.js | 2 +- .../restParametersOfNonArrayTypes.js | 2 +- .../restParametersOfNonArrayTypes2.js | 4 +- .../restParametersWithArrayTypeAnnotations.js | 4 +- .../reference/returnInConstructor1.js | 18 +- tests/baselines/reference/returnStatements.js | 4 +- .../reference/returnTypeTypeArguments.js | 14 +- .../reference/returnValueInSetter.js | 2 +- tests/baselines/reference/scannerClass2.js | 2 +- tests/baselines/reference/scannertest1.js | 2 +- .../reference/scopeCheckClassProperty.js | 4 +- ...peCheckExtendedClassInsidePublicMethod2.js | 4 +- ...peCheckExtendedClassInsideStaticMethod1.js | 4 +- .../scopeCheckInsidePublicMethod1.js | 2 +- .../scopeCheckInsideStaticMethod1.js | 2 +- .../reference/scopeCheckStaticInitializer.js | 4 +- .../reference/scopeResolutionIdentifiers.js | 2 +- tests/baselines/reference/scopeTests.js | 4 +- tests/baselines/reference/selfInCallback.js | 2 +- tests/baselines/reference/selfInLambdas.js | 2 +- tests/baselines/reference/selfRef.js | 2 +- .../selfReferencesInFunctionParameters.js | 2 +- .../reference/selfReferencingFile.js | 2 +- .../reference/selfReferencingFile2.js | 2 +- .../reference/selfReferencingFile3.js | 2 +- .../baselines/reference/setterBeforeGetter.js | 2 +- tests/baselines/reference/setterWithReturn.js | 2 +- .../reference/shadowPrivateMembers.js | 4 +- .../reference/shadowedInternalModule.js | 2 +- .../sigantureIsSubTypeIfTheyAreIdentical.js | 2 +- .../baselines/reference/sourceMap-Comments.js | 2 +- .../sourceMap-Comments.sourcemap.txt | 4 +- .../reference/sourceMap-FileWithComments.js | 2 +- .../sourceMap-FileWithComments.sourcemap.txt | 4 +- tests/baselines/reference/sourceMapSample.js | 2 +- .../reference/sourceMapSample.sourcemap.txt | 4 +- .../reference/sourceMapValidationClass.js | 2 +- .../sourceMapValidationClass.sourcemap.txt | 2 +- ...apValidationClassWithDefaultConstructor.js | 2 +- ...nClassWithDefaultConstructor.sourcemap.txt | 2 +- ...aultConstructorAndCapturedThisStatement.js | 2 +- ...ctorAndCapturedThisStatement.sourcemap.txt | 2 +- ...sWithDefaultConstructorAndExtendsClause.js | 4 +- ...tConstructorAndExtendsClause.sourcemap.txt | 6 +- .../reference/sourceMapValidationClasses.js | 2 +- .../sourceMapValidationClasses.sourcemap.txt | 4 +- .../sourceMapValidationDecorators.js | 2 +- ...ourceMapValidationDecorators.sourcemap.txt | 2 +- .../sourceMapValidationExportAssignment.js | 2 +- ...apValidationExportAssignment.sourcemap.txt | 2 +- ...ceMapValidationExportAssignmentCommonjs.js | 2 +- ...tionExportAssignmentCommonjs.sourcemap.txt | 2 +- .../reference/sourceMapValidationImport.js | 2 +- .../sourceMapValidationImport.sourcemap.txt | 4 +- .../sourceMapValidationWithComments.js | 2 +- ...rceMapValidationWithComments.sourcemap.txt | 2 +- .../sourceMapWithCaseSensitiveFileNames.js | 4 +- ...apWithCaseSensitiveFileNames.sourcemap.txt | 6 +- ...eMapWithCaseSensitiveFileNamesAndOutDir.js | 4 +- ...eSensitiveFileNamesAndOutDir.sourcemap.txt | 4 +- ...ultipleFilesWithFileEndingWithInterface.js | 2 +- ...sWithFileEndingWithInterface.sourcemap.txt | 4 +- .../sourceMapWithNonCaseSensitiveFileNames.js | 4 +- ...ithNonCaseSensitiveFileNames.sourcemap.txt | 6 +- ...pWithNonCaseSensitiveFileNamesAndOutDir.js | 4 +- ...eSensitiveFileNamesAndOutDir.sourcemap.txt | 4 +- .../sourcemapValidationDuplicateNames.js | 2 +- ...emapValidationDuplicateNames.sourcemap.txt | 4 +- .../specializationOfExportedClass.js | 2 +- .../specializedInheritedConstructors1.js | 6 +- .../specializedLambdaTypeArguments.js | 2 +- .../specializedOverloadWithRestParameters.js | 4 +- ...reIsNotSubtypeOfNonSpecializedSignature.js | 6 +- ...atureIsSubtypeOfNonSpecializedSignature.js | 6 +- .../reference/spreadIntersectionJsx.js | 4 +- tests/baselines/reference/spreadMethods.js | 2 +- .../reference/staticAndMemberFunctions.js | 2 +- .../staticAndNonStaticPropertiesSameName.js | 2 +- ...nonymousTypeNotReferencingTypeParameter.js | 6 +- .../baselines/reference/staticAsIdentifier.js | 2 +- .../reference/staticClassMemberError.js | 4 +- tests/baselines/reference/staticClassProps.js | 2 +- tests/baselines/reference/staticFactory1.js | 4 +- tests/baselines/reference/staticGetter1.js | 2 +- tests/baselines/reference/staticGetter2.js | 2 +- .../reference/staticGetterAndSetter.js | 2 +- tests/baselines/reference/staticIndexer.js | 2 +- tests/baselines/reference/staticIndexers.js | 6 +- .../baselines/reference/staticInheritance.js | 4 +- .../reference/staticInstanceResolution.js | 2 +- .../reference/staticInstanceResolution2.js | 4 +- .../reference/staticInstanceResolution3.js | 2 +- .../reference/staticInstanceResolution4.js | 2 +- .../reference/staticInstanceResolution5.js | 2 +- .../staticInterfaceAssignmentCompat.js | 2 +- .../staticMemberAccessOffDerivedType1.js | 4 +- ...mberAssignsToConstructorFunctionMembers.js | 2 +- .../reference/staticMemberExportAccess.js | 2 +- .../reference/staticMemberInitialization.js | 2 +- ...AndPublicMemberOfAnotherClassAssignment.js | 4 +- .../staticMemberWithStringAndNumberNames.js | 2 +- .../staticMembersUsingClassTypeParameter.js | 6 +- .../staticMethodReferencingTypeArgument1.js | 2 +- ...dWithTypeParameterExtendsClauseDeclFile.js | 6 +- ...icMethodsReferencingClassTypeParameters.js | 2 +- .../reference/staticModifierAlreadySeen.js | 2 +- .../reference/staticMustPrecedePublic.js | 2 +- .../reference/staticOffOfInstance1.js | 2 +- .../reference/staticOffOfInstance2.js | 2 +- tests/baselines/reference/staticPropSuper.js | 10 +- .../staticPropertyAndFunctionWithSameName.js | 4 +- .../reference/staticPropertyNameConflicts.js | 60 ++--- .../reference/staticPropertyNotInClassType.js | 4 +- .../reference/staticPrototypeProperty.js | 4 +- .../staticPrototypePropertyOnClass.js | 8 +- tests/baselines/reference/staticVisibility.js | 4 +- tests/baselines/reference/statics.js | 2 +- .../reference/staticsInConstructorBodies.js | 2 +- .../reference/staticsNotInScopeInClodule.js | 2 +- .../reference/strictModeInConstructor.js | 14 +- .../reference/strictModeReservedWord.js | 2 +- ...trictModeReservedWordInClassDeclaration.js | 16 +- .../strictModeUseContextualKeyword.js | 2 +- .../reference/stringIndexerAndConstructor.js | 2 +- .../reference/stringIndexerAssignments2.js | 6 +- ...ngIndexerConstrainsPropertyDeclarations.js | 2 +- ...gIndexerConstrainsPropertyDeclarations2.js | 6 +- .../reference/stringIndexingResults.js | 2 +- .../stringLiteralTypeIsSubtypeOfString.js | 2 +- ...gLiteralTypesInImplementationSignatures.js | 2 +- ...LiteralTypesInImplementationSignatures2.js | 2 +- .../reference/stringNamedPropertyAccess.js | 2 +- .../stringNamedPropertyDuplicates.js | 2 +- tests/baselines/reference/stripInternal1.js | 2 +- ...ubSubClassCanAccessProtectedConstructor.js | 6 +- tests/baselines/reference/subtypesOfAny.js | 6 +- .../reference/subtypesOfTypeParameter.js | 10 +- .../subtypesOfTypeParameterWithConstraints.js | 60 ++--- ...subtypesOfTypeParameterWithConstraints2.js | 6 +- ...subtypesOfTypeParameterWithConstraints4.js | 22 +- ...OfTypeParameterWithRecursiveConstraints.js | 42 ++-- tests/baselines/reference/subtypesOfUnion.js | 6 +- .../reference/subtypingTransitivity.js | 6 +- .../reference/subtypingWithCallSignatures2.js | 8 +- .../reference/subtypingWithCallSignatures3.js | 8 +- .../reference/subtypingWithCallSignatures4.js | 8 +- .../subtypingWithConstructSignatures2.js | 8 +- .../subtypingWithConstructSignatures3.js | 8 +- .../subtypingWithConstructSignatures4.js | 8 +- .../subtypingWithConstructSignatures5.js | 8 +- .../subtypingWithConstructSignatures6.js | 8 +- .../reference/subtypingWithNumericIndexer.js | 16 +- .../reference/subtypingWithNumericIndexer3.js | 18 +- .../reference/subtypingWithNumericIndexer4.js | 10 +- .../reference/subtypingWithNumericIndexer5.js | 14 +- .../reference/subtypingWithObjectMembers.js | 30 +-- .../reference/subtypingWithObjectMembers4.js | 16 +- .../reference/subtypingWithObjectMembers5.js | 12 +- ...subtypingWithObjectMembersAccessibility.js | 16 +- ...ubtypingWithObjectMembersAccessibility2.js | 28 +-- .../reference/subtypingWithStringIndexer.js | 16 +- .../reference/subtypingWithStringIndexer3.js | 18 +- .../reference/subtypingWithStringIndexer4.js | 10 +- tests/baselines/reference/super.js | 8 +- tests/baselines/reference/super1.js | 20 +- tests/baselines/reference/super2.js | 12 +- tests/baselines/reference/superAccess.js | 4 +- tests/baselines/reference/superAccess2.js | 4 +- .../reference/superAccessInFatArrow1.js | 4 +- .../reference/superCallArgsMustMatch.js | 4 +- .../reference/superCallAssignResult.js | 4 +- .../superCallBeforeThisAccessing1.js | 4 +- .../superCallBeforeThisAccessing2.js | 4 +- .../superCallBeforeThisAccessing3.js | 4 +- .../superCallBeforeThisAccessing4.js | 4 +- .../superCallBeforeThisAccessing5.js | 2 +- .../superCallBeforeThisAccessing6.js | 4 +- .../superCallBeforeThisAccessing7.js | 4 +- .../superCallBeforeThisAccessing8.js | 4 +- ...allFromClassThatDerivesFromGenericType1.js | 2 +- ...allFromClassThatDerivesFromGenericType2.js | 2 +- ...eButWithIncorrectNumberOfTypeArguments1.js | 4 +- ...sFromGenericTypeButWithNoTypeArguments1.js | 4 +- ...ivesNonGenericTypeButWithTypeArguments1.js | 4 +- .../superCallFromClassThatHasNoBaseType1.js | 4 +- .../superCallInConstructorWithNoBaseType.js | 4 +- .../reference/superCallInNonStaticMethod.js | 4 +- .../reference/superCallInStaticMethod.js | 4 +- .../superCallInsideClassDeclaration.js | 8 +- .../superCallInsideClassExpression.js | 8 +- .../superCallInsideObjectLiteralExpression.js | 4 +- .../reference/superCallOutsideConstructor.js | 4 +- .../superCallParameterContextualTyping1.js | 4 +- .../superCallParameterContextualTyping2.js | 4 +- .../superCallParameterContextualTyping3.js | 4 +- .../reference/superCallWithCommentEmit01.js | 4 +- .../superCallWithMissingBaseClass.js | 2 +- tests/baselines/reference/superCalls.js | 8 +- .../reference/superCallsInConstructor.js | 6 +- tests/baselines/reference/superErrors.js | 4 +- .../superHasMethodsFromMergedInterface.js | 4 +- .../baselines/reference/superInCatchBlock1.js | 4 +- .../reference/superInConstructorParam1.js | 4 +- tests/baselines/reference/superInLambdas.js | 10 +- .../reference/superInObjectLiterals_ES5.js | 4 +- tests/baselines/reference/superNewCall1.js | 4 +- .../reference/superPropertyAccess.js | 4 +- .../reference/superPropertyAccess1.js | 4 +- .../reference/superPropertyAccess2.js | 4 +- ...essInComputedPropertiesOfNestedType_ES5.js | 6 +- .../superPropertyAccessInSuperCall01.js | 4 +- .../reference/superPropertyAccessNoError.js | 4 +- .../reference/superPropertyAccess_ES5.js | 8 +- ...perPropertyInConstructorBeforeSuperCall.js | 6 +- .../reference/superSymbolIndexedAccess5.js | 4 +- .../reference/superSymbolIndexedAccess6.js | 4 +- .../superWithGenericSpecialization.js | 4 +- .../baselines/reference/superWithGenerics.js | 2 +- .../reference/superWithTypeArgument.js | 4 +- .../reference/superWithTypeArgument2.js | 4 +- .../reference/superWithTypeArgument3.js | 4 +- ...side-object-literal-getters-and-setters.js | 4 +- .../reference/switchAssignmentCompat.js | 2 +- .../switchCasesExpressionTypeMismatch.js | 2 +- .../switchComparableCompatForBrands.js | 2 +- tests/baselines/reference/switchStatements.js | 4 +- tests/baselines/reference/systemModule17.js | 2 +- tests/baselines/reference/systemModule3.js | 4 +- tests/baselines/reference/systemModule6.js | 2 +- .../systemModuleDeclarationMerging.js | 2 +- .../reference/systemModuleExportDefault.js | 4 +- .../systemModuleNonTopLevelModuleMembers.js | 4 +- .../reference/systemModuleWithSuperClass.js | 4 +- .../taggedTemplateWithConstructableTag01.js | 2 +- .../reference/targetTypeBaseCalls.js | 4 +- ...emplateStringsArrayTypeDefinedInES5Mode.js | 2 +- .../baselines/reference/testContainerList.js | 2 +- tests/baselines/reference/thisBinding.js | 4 +- tests/baselines/reference/thisBinding2.js | 2 +- tests/baselines/reference/thisCapture1.js | 2 +- ...essionInCallExpressionWithTypeArguments.js | 2 +- .../thisExpressionOfGenericObject.js | 2 +- tests/baselines/reference/thisInAccessors.js | 6 +- ...thisInArrowFunctionInStaticInitializer1.js | 2 +- .../reference/thisInConstructorParameter1.js | 2 +- .../reference/thisInConstructorParameter2.js | 2 +- .../reference/thisInGenericStaticMembers.js | 4 +- .../reference/thisInInnerFunctions.js | 2 +- .../thisInInstanceMemberInitializer.js | 4 +- .../reference/thisInInvalidContexts.js | 10 +- .../thisInInvalidContextsExternalModule.js | 10 +- tests/baselines/reference/thisInLambda.js | 4 +- .../reference/thisInObjectLiterals.js | 2 +- .../reference/thisInOuterClassBody.js | 2 +- .../thisInPropertyBoundDeclarations.js | 6 +- .../reference/thisInStaticMethod1.js | 2 +- tests/baselines/reference/thisInStatics.js | 2 +- tests/baselines/reference/thisInSuperCall.js | 8 +- tests/baselines/reference/thisInSuperCall1.js | 4 +- tests/baselines/reference/thisInSuperCall2.js | 6 +- tests/baselines/reference/thisInSuperCall3.js | 4 +- .../reference/thisTypeAndConstraints.js | 4 +- .../reference/thisTypeAsConstraint.js | 2 +- tests/baselines/reference/thisTypeErrors.js | 6 +- tests/baselines/reference/thisTypeErrors2.js | 6 +- .../reference/thisTypeInAccessors.js | 4 +- .../baselines/reference/thisTypeInClasses.js | 8 +- .../reference/thisTypeInFunctions.js | 14 +- .../reference/thisTypeInFunctionsNegative.js | 14 +- .../reference/thisWhenTypeCheckFails.js | 2 +- .../reference/throwInEnclosingStatements.js | 2 +- tests/baselines/reference/throwStatements.js | 6 +- .../reference/tooManyTypeParameters1.js | 2 +- tests/baselines/reference/topLevel.js | 2 +- ...railingCommaInHeterogenousArrayLiteral1.js | 2 +- ...gCommasInFunctionParametersAndArguments.js | 2 +- .../reference/trailingCommasInGetter.js | 2 +- .../transitiveTypeArgumentInference1.js | 2 +- ...ata when transpile with CommonJS option.js | 2 +- ...adata when transpile with System option.js | 2 +- ... with emit decorators and emit metadata.js | 2 +- .../reference/tsxAttributeResolution10.js | 2 +- .../reference/tsxAttributeResolution11.js | 2 +- .../reference/tsxAttributeResolution15.js | 2 +- .../reference/tsxAttributeResolution16.js | 2 +- .../reference/tsxAttributeResolution9.js | 2 +- .../tsxCorrectlyParseLessThanComparison1.js | 2 +- .../tsxDefaultAttributesResolution1.js | 2 +- .../tsxDefaultAttributesResolution2.js | 2 +- .../tsxDefaultAttributesResolution3.js | 2 +- .../baselines/reference/tsxDefaultImports.js | 2 +- .../baselines/reference/tsxDynamicTagName5.js | 2 +- .../baselines/reference/tsxDynamicTagName7.js | 2 +- .../baselines/reference/tsxDynamicTagName8.js | 2 +- .../baselines/reference/tsxDynamicTagName9.js | 2 +- .../reference/tsxElementResolution.js | 6 +- .../reference/tsxElementResolution19.js | 2 +- tests/baselines/reference/tsxEmit1.js | 2 +- tests/baselines/reference/tsxEmit3.js | 4 +- .../reference/tsxEmit3.sourcemap.txt | 8 +- .../reference/tsxExternalModuleEmit1.js | 4 +- .../reference/tsxGenericAttributesType3.js | 4 +- .../reference/tsxGenericAttributesType4.js | 4 +- .../reference/tsxGenericAttributesType5.js | 4 +- .../reference/tsxGenericAttributesType6.js | 4 +- .../reference/tsxGenericAttributesType9.js | 2 +- tests/baselines/reference/tsxReactEmit1.js | 2 +- .../tsxSpreadAttributesResolution1.js | 2 +- .../tsxSpreadAttributesResolution10.js | 2 +- .../tsxSpreadAttributesResolution11.js | 2 +- .../tsxSpreadAttributesResolution12.js | 2 +- .../tsxSpreadAttributesResolution2.js | 2 +- .../tsxSpreadAttributesResolution3.js | 2 +- .../tsxSpreadAttributesResolution4.js | 4 +- .../tsxSpreadAttributesResolution5.js | 4 +- .../tsxSpreadAttributesResolution6.js | 2 +- .../tsxSpreadAttributesResolution7.js | 2 +- .../tsxSpreadAttributesResolution8.js | 2 +- .../tsxSpreadAttributesResolution9.js | 2 +- .../tsxStatelessFunctionComponents2.js | 2 +- tests/baselines/reference/tsxTypeErrors.js | 2 +- .../reference/tsxUnionElementType3.js | 8 +- .../reference/tsxUnionElementType4.js | 8 +- .../reference/tsxUnionTypeComponent1.js | 4 +- .../reference/twoAccessorsWithSameName.js | 6 +- .../reference/twoAccessorsWithSameName2.js | 6 +- tests/baselines/reference/typeAliases.js | 2 +- .../reference/typeAliasesForObjectTypes.js | 2 +- .../typeArgumentInferenceOrdering.js | 2 +- ...peArgumentInferenceWithClassExpression1.js | 4 +- ...peArgumentInferenceWithClassExpression2.js | 4 +- ...peArgumentInferenceWithClassExpression3.js | 4 +- tests/baselines/reference/typeAssertions.js | 6 +- .../reference/typeCheckTypeArgument.js | 4 +- .../typeConstraintsWithConstructSignatures.js | 2 +- .../baselines/reference/typeGuardFunction.js | 8 +- .../reference/typeGuardFunctionErrors.js | 8 +- .../reference/typeGuardFunctionGenerics.js | 6 +- .../reference/typeGuardFunctionOfFormThis.js | 18 +- .../typeGuardFunctionOfFormThisErrors.js | 6 +- tests/baselines/reference/typeGuardInClass.js | 4 +- .../reference/typeGuardOfFormExpr1AndExpr2.js | 2 +- .../reference/typeGuardOfFormExpr1OrExpr2.js | 2 +- .../reference/typeGuardOfFormInstanceOf.js | 8 +- .../reference/typeGuardOfFormIsType.js | 6 +- .../reference/typeGuardOfFormThisMember.js | 6 +- .../typeGuardOfFormThisMemberErrors.js | 6 +- .../reference/typeGuardOfFormTypeOfBoolean.js | 2 +- ...eGuardOfFormTypeOfEqualEqualHasNoEffect.js | 2 +- ...ypeGuardOfFormTypeOfNotEqualHasNoEffect.js | 2 +- .../reference/typeGuardOfFormTypeOfNumber.js | 2 +- .../reference/typeGuardOfFormTypeOfOther.js | 2 +- .../reference/typeGuardOfFormTypeOfString.js | 2 +- .../reference/typeGuardsInClassAccessors.js | 2 +- .../reference/typeGuardsInClassMethods.js | 2 +- .../reference/typeGuardsInProperties.js | 2 +- .../reference/typeGuardsNestedAssignments.js | 2 +- .../reference/typeGuardsOnClassProperty.js | 2 +- .../reference/typeGuardsTypeParameters.js | 2 +- .../reference/typeIdentityConsidersBrands.js | 8 +- .../reference/typeInferenceLiteralUnion.js | 2 +- .../typeInferenceReturnTypeCallback.js | 4 +- tests/baselines/reference/typeMatch1.js | 4 +- tests/baselines/reference/typeMatch2.js | 4 +- tests/baselines/reference/typeName1.js | 2 +- tests/baselines/reference/typeOfPrototype.js | 2 +- tests/baselines/reference/typeOfSuperCall.js | 4 +- tests/baselines/reference/typeOfThis.js | 4 +- .../reference/typeOfThisInAccessor.js | 4 +- .../typeOfThisInConstructorParamList.js | 2 +- .../typeOfThisInFunctionExpression.js | 2 +- .../reference/typeOfThisInInstanceMember.js | 2 +- .../reference/typeOfThisInInstanceMember2.js | 2 +- .../reference/typeOfThisInMemberFunctions.js | 6 +- .../reference/typeOfThisInStaticMembers.js | 4 +- .../reference/typeOfThisInStaticMembers2.js | 4 +- .../reference/typeOfThisInStatics.js | 2 +- .../typeParamExtendsOtherTypeParam.js | 4 +- .../reference/typeParameterAsBaseClass.js | 4 +- .../reference/typeParameterAsBaseType.js | 4 +- .../reference/typeParameterAsTypeArgument.js | 2 +- .../reference/typeParameterAssignability3.js | 4 +- .../typeParameterAssignmentCompat1.js | 2 +- ...ypeParameterDirectlyConstrainedToItself.js | 4 +- .../typeParameterExplicitlyExtendsAny.js | 2 +- .../reference/typeParameterExtendingUnion1.js | 6 +- .../reference/typeParameterExtendingUnion2.js | 6 +- .../reference/typeParameterInConstraint1.js | 2 +- ...eParameterIndirectlyConstrainedToItself.js | 6 +- .../typeParameterListWithTrailingComma1.js | 2 +- .../typeParameterUsedAsConstraint.js | 12 +- ...ParameterUsedAsTypeParameterConstraint4.js | 2 +- .../typeParameterWithInvalidConstraintType.js | 2 +- ...eParametersAndParametersInComputedNames.js | 2 +- .../typeParametersAreIdenticalToThemselves.js | 4 +- .../typeParametersAvailableInNestedScope.js | 2 +- .../typeParametersInStaticAccessors.js | 2 +- .../typeParametersInStaticMethods.js | 2 +- .../typeParametersInStaticProperties.js | 2 +- tests/baselines/reference/typeQueryOnClass.js | 4 +- .../reference/typeQueryWithReservedWords.js | 2 +- .../reference/typeReferenceDirectives9.js | 2 +- .../baselines/reference/typeRelationships.js | 4 +- tests/baselines/reference/typeResolution.js | 20 +- .../reference/typeResolution.sourcemap.txt | 49 ++-- .../reference/typeUsedAsValueError.js | 2 +- .../baselines/reference/typeValueConflict1.js | 4 +- .../baselines/reference/typeValueConflict2.js | 6 +- .../reference/typeVariableTypeGuards.js | 6 +- .../reference/typedGenericPrototypeMember.js | 2 +- .../reference/typeofANonExportedType.js | 6 +- .../reference/typeofAmbientExternalModules.js | 4 +- .../reference/typeofAnExportedType.js | 6 +- tests/baselines/reference/typeofClass.js | 2 +- tests/baselines/reference/typeofClass2.js | 4 +- .../reference/typeofClassWithPrivates.js | 2 +- .../reference/typeofExternalModules.js | 4 +- .../reference/typeofInternalModules.js | 2 +- .../reference/typeofModuleWithoutExports.js | 2 +- .../typeofOperatorWithAnyOtherType.js | 2 +- .../typeofOperatorWithBooleanType.js | 2 +- .../reference/typeofOperatorWithNumberType.js | 2 +- .../reference/typeofOperatorWithStringType.js | 2 +- tests/baselines/reference/typeofProperty.js | 8 +- .../reference/typeofUsedBeforeBlockScoped.js | 2 +- .../typesWithDuplicateTypeParameters.js | 4 +- .../reference/typesWithPrivateConstructor.js | 4 +- .../typesWithProtectedConstructor.js | 4 +- .../reference/typesWithPublicConstructor.js | 4 +- .../typesWithSpecializedCallSignatures.js | 8 +- ...typesWithSpecializedConstructSignatures.js | 8 +- tests/baselines/reference/undeclaredBase.js | 2 +- tests/baselines/reference/undeclaredMethod.js | 2 +- .../undefinedAssignableToEveryType.js | 2 +- .../undefinedIsSubtypeOfEverything.js | 48 ++-- .../reference/undefinedTypeAssignment4.js | 2 +- .../baselines/reference/underscoreMapFirst.js | 2 +- .../underscoreThisInDerivedClass01.js | 4 +- .../underscoreThisInDerivedClass02.js | 4 +- .../unexpectedStatementBlockTerminator.js | 4 +- .../unexportedInstanceClassVariables.js | 4 +- ...nSubtypeIfEveryConstituentTypeIsSubtype.js | 6 +- .../reference/unionTypeEquivalence.js | 4 +- .../reference/unionTypeFromArrayLiteral.js | 8 +- .../unionTypePropertyAccessibility.js | 8 +- ...unionTypeWithRecursiveSubtypeReduction1.js | 8 +- ...unionTypeWithRecursiveSubtypeReduction2.js | 8 +- .../reference/unionTypesAssignability.js | 6 +- .../unknownSymbolInGenericReturnType.js | 2 +- tests/baselines/reference/unknownSymbols1.js | 10 +- .../reference/unknownTypeArgOnCall.js | 2 +- .../unqualifiedCallToClassStatic1.js | 2 +- .../reference/unspecializedConstraints.js | 10 +- ...untypedFunctionCallsWithTypeParameters1.js | 4 +- .../reference/unusedClassesinModule1.js | 2 +- .../reference/unusedClassesinNamespace1.js | 2 +- .../reference/unusedClassesinNamespace2.js | 4 +- .../reference/unusedClassesinNamespace3.js | 4 +- .../reference/unusedClassesinNamespace4.js | 6 +- .../reference/unusedClassesinNamespace5.js | 6 +- .../reference/unusedGetterInClass.js | 2 +- .../unusedIdentifiersConsolidated1.js | 16 +- .../reference/unusedImportDeclaration.js | 2 +- tests/baselines/reference/unusedImports1.js | 2 +- tests/baselines/reference/unusedImports10.js | 2 +- tests/baselines/reference/unusedImports11.js | 2 +- tests/baselines/reference/unusedImports12.js | 2 +- tests/baselines/reference/unusedImports2.js | 2 +- tests/baselines/reference/unusedImports3.js | 2 +- tests/baselines/reference/unusedImports4.js | 2 +- tests/baselines/reference/unusedImports5.js | 2 +- tests/baselines/reference/unusedImports6.js | 2 +- tests/baselines/reference/unusedImports7.js | 2 +- tests/baselines/reference/unusedImports8.js | 2 +- tests/baselines/reference/unusedImports9.js | 2 +- .../reference/unusedInterfaceinNamespace4.js | 2 +- .../reference/unusedInterfaceinNamespace5.js | 2 +- .../reference/unusedInvalidTypeArguments.js | 6 +- .../reference/unusedLocalProperty.js | 2 +- .../reference/unusedLocalsAndParameters.js | 4 +- .../unusedLocalsAndParametersDeferred.js | 4 +- ...edLocalsAndParametersOverloadSignatures.js | 2 +- .../reference/unusedLocalsInMethod1.js | 2 +- .../reference/unusedLocalsInMethod2.js | 2 +- .../reference/unusedLocalsInMethod3.js | 2 +- .../reference/unusedLocalsinConstructor1.js | 2 +- .../reference/unusedLocalsinConstructor2.js | 2 +- .../unusedMultipleParameter1InContructor.js | 2 +- .../unusedMultipleParameter2InContructor.js | 2 +- ...dMultipleParameters1InMethodDeclaration.js | 2 +- ...dMultipleParameters2InMethodDeclaration.js | 2 +- .../reference/unusedParameterProperty1.js | 2 +- .../reference/unusedParameterProperty2.js | 2 +- .../reference/unusedParametersInLambda1.js | 2 +- .../reference/unusedParametersInLambda2.js | 2 +- .../reference/unusedParametersThis.js | 2 +- .../unusedParametersinConstructor1.js | 2 +- .../unusedParametersinConstructor2.js | 2 +- .../unusedParametersinConstructor3.js | 2 +- .../reference/unusedPrivateMembers.js | 10 +- .../reference/unusedPrivateMethodInClass1.js | 2 +- .../reference/unusedPrivateMethodInClass2.js | 2 +- .../reference/unusedPrivateMethodInClass3.js | 2 +- .../reference/unusedPrivateMethodInClass4.js | 2 +- .../unusedPrivateVariableInClass1.js | 2 +- .../unusedPrivateVariableInClass2.js | 2 +- .../unusedPrivateVariableInClass3.js | 2 +- .../unusedPrivateVariableInClass4.js | 2 +- .../unusedPrivateVariableInClass5.js | 2 +- .../reference/unusedSetterInClass.js | 2 +- .../unusedSingleParameterInContructor.js | 2 +- ...nusedSingleParameterInMethodDeclaration.js | 2 +- .../reference/unusedTypeParameterInLambda1.js | 2 +- .../reference/unusedTypeParameterInLambda2.js | 2 +- .../reference/unusedTypeParameterInLambda3.js | 2 +- .../reference/unusedTypeParameterInMethod1.js | 2 +- .../reference/unusedTypeParameterInMethod2.js | 2 +- .../reference/unusedTypeParameterInMethod3.js | 2 +- .../reference/unusedTypeParameterInMethod4.js | 2 +- .../reference/unusedTypeParameterInMethod5.js | 2 +- .../reference/unusedTypeParameters1.js | 2 +- .../reference/unusedTypeParameters2.js | 2 +- .../reference/unusedTypeParameters3.js | 2 +- .../reference/unusedTypeParameters5.js | 2 +- .../reference/unusedTypeParameters6.js | 2 +- .../reference/unusedTypeParameters7.js | 2 +- .../reference/unusedTypeParameters8.js | 2 +- .../reference/unusedTypeParameters9.js | 4 +- .../reference/unusedVariablesinNamespaces2.js | 2 +- .../reference/unusedVariablesinNamespaces3.js | 2 +- ...ngModuleWithExportImportInValuePosition.js | 2 +- .../reference/validNullAssignments.js | 2 +- .../reference/validUndefinedAssignments.js | 2 +- .../reference/validUseOfThisInSuper.js | 4 +- .../varArgConstructorMemberParameter.js | 6 +- .../reference/varArgsOnConstructorTypes.js | 4 +- tests/baselines/reference/varAsID.js | 4 +- tests/baselines/reference/vararg.js | 2 +- tests/baselines/reference/vardecl.js | 4 +- ...eclaratorResolvedDuringContextualTyping.js | 4 +- tests/baselines/reference/visSyntax.js | 2 +- .../reference/visibilityOfTypeParameters.js | 2 +- .../reference/voidOperatorWithAnyOtherType.js | 2 +- .../reference/voidOperatorWithBooleanType.js | 2 +- .../reference/voidOperatorWithNumberType.js | 2 +- .../reference/voidOperatorWithStringType.js | 2 +- tests/baselines/reference/weakType.js | 2 +- tests/baselines/reference/withImportDecl.js | 2 +- .../reference/withStatementErrors.js | 2 +- tests/baselines/reference/witness.js | 8 +- .../wrappedAndRecursiveConstraints.js | 2 +- .../wrappedAndRecursiveConstraints2.js | 2 +- .../wrappedAndRecursiveConstraints3.js | 2 +- .../wrappedAndRecursiveConstraints4.js | 2 +- 3603 files changed, 7534 insertions(+), 7524 deletions(-) diff --git a/src/compiler/transformers/es2015.ts b/src/compiler/transformers/es2015.ts index 4146574fe12b3..8674fb9bce108 100644 --- a/src/compiler/transformers/es2015.ts +++ b/src/compiler/transformers/es2015.ts @@ -840,7 +840,7 @@ namespace ts { outer.end = skipTrivia(currentText, node.pos); setEmitFlags(outer, EmitFlags.NoComments); - return createParen( + const result = createParen( createCall( outer, /*typeArguments*/ undefined, @@ -849,6 +849,8 @@ namespace ts { : [] ) ); + addSyntheticLeadingComment(result, SyntaxKind.MultiLineCommentTrivia, "* @class "); + return result; } /** diff --git a/tests/baselines/reference/2dArrays.js b/tests/baselines/reference/2dArrays.js index 62133e770ff9f..cb98b231e88e8 100644 --- a/tests/baselines/reference/2dArrays.js +++ b/tests/baselines/reference/2dArrays.js @@ -16,17 +16,17 @@ class Board { } //// [2dArrays.js] -var Cell = (function () { +var Cell = /** @class */ (function () { function Cell() { } return Cell; }()); -var Ship = (function () { +var Ship = /** @class */ (function () { function Ship() { } return Ship; }()); -var Board = (function () { +var Board = /** @class */ (function () { function Board() { } Board.prototype.allShipsSunk = function () { diff --git a/tests/baselines/reference/AmbientModuleAndNonAmbientClassWithSameNameAndCommonRoot.js b/tests/baselines/reference/AmbientModuleAndNonAmbientClassWithSameNameAndCommonRoot.js index ca67e5a70c263..b9338ff0ab505 100644 --- a/tests/baselines/reference/AmbientModuleAndNonAmbientClassWithSameNameAndCommonRoot.js +++ b/tests/baselines/reference/AmbientModuleAndNonAmbientClassWithSameNameAndCommonRoot.js @@ -25,7 +25,7 @@ var p = new A.Point(0, 0); // unexpected error here, bug 840000 //// [classPoint.js] var A; (function (A) { - var Point = (function () { + var Point = /** @class */ (function () { function Point(x, y) { this.x = x; this.y = y; diff --git a/tests/baselines/reference/ClassAndModuleThatMergeWithModuleMemberThatUsesClassTypeParameter.js b/tests/baselines/reference/ClassAndModuleThatMergeWithModuleMemberThatUsesClassTypeParameter.js index 09f7befae07de..f266c117dff68 100644 --- a/tests/baselines/reference/ClassAndModuleThatMergeWithModuleMemberThatUsesClassTypeParameter.js +++ b/tests/baselines/reference/ClassAndModuleThatMergeWithModuleMemberThatUsesClassTypeParameter.js @@ -51,7 +51,7 @@ module clodule4 { //// [ClassAndModuleThatMergeWithModuleMemberThatUsesClassTypeParameter.js] // all expected to be errors -var clodule1 = (function () { +var clodule1 = /** @class */ (function () { function clodule1() { } return clodule1; @@ -59,20 +59,20 @@ var clodule1 = (function () { (function (clodule1) { function f(x) { } })(clodule1 || (clodule1 = {})); -var clodule2 = (function () { +var clodule2 = /** @class */ (function () { function clodule2() { } return clodule2; }()); (function (clodule2) { var x; - var D = (function () { + var D = /** @class */ (function () { function D() { } return D; }()); })(clodule2 || (clodule2 = {})); -var clodule3 = (function () { +var clodule3 = /** @class */ (function () { function clodule3() { } return clodule3; @@ -80,13 +80,13 @@ var clodule3 = (function () { (function (clodule3) { clodule3.y = { id: T }; })(clodule3 || (clodule3 = {})); -var clodule4 = (function () { +var clodule4 = /** @class */ (function () { function clodule4() { } return clodule4; }()); (function (clodule4) { - var D = (function () { + var D = /** @class */ (function () { function D() { } return D; diff --git a/tests/baselines/reference/ClassAndModuleThatMergeWithModulesExportedGenericFunctionAndGenericClassStaticFunctionOfTheSameName.js b/tests/baselines/reference/ClassAndModuleThatMergeWithModulesExportedGenericFunctionAndGenericClassStaticFunctionOfTheSameName.js index 6e12244542ea9..abe399154dd1c 100644 --- a/tests/baselines/reference/ClassAndModuleThatMergeWithModulesExportedGenericFunctionAndGenericClassStaticFunctionOfTheSameName.js +++ b/tests/baselines/reference/ClassAndModuleThatMergeWithModulesExportedGenericFunctionAndGenericClassStaticFunctionOfTheSameName.js @@ -16,7 +16,7 @@ module clodule { //// [ClassAndModuleThatMergeWithModulesExportedGenericFunctionAndGenericClassStaticFunctionOfTheSameName.js] -var clodule = (function () { +var clodule = /** @class */ (function () { function clodule() { } clodule.fn = function (id) { }; diff --git a/tests/baselines/reference/ClassAndModuleThatMergeWithModulesExportedGenericFunctionAndNonGenericClassStaticFunctionOfTheSameName.js b/tests/baselines/reference/ClassAndModuleThatMergeWithModulesExportedGenericFunctionAndNonGenericClassStaticFunctionOfTheSameName.js index 6d04d636eb23d..4bd5f9c7d370f 100644 --- a/tests/baselines/reference/ClassAndModuleThatMergeWithModulesExportedGenericFunctionAndNonGenericClassStaticFunctionOfTheSameName.js +++ b/tests/baselines/reference/ClassAndModuleThatMergeWithModulesExportedGenericFunctionAndNonGenericClassStaticFunctionOfTheSameName.js @@ -16,7 +16,7 @@ module clodule { //// [ClassAndModuleThatMergeWithModulesExportedGenericFunctionAndNonGenericClassStaticFunctionOfTheSameName.js] -var clodule = (function () { +var clodule = /** @class */ (function () { function clodule() { } clodule.fn = function (id) { }; diff --git a/tests/baselines/reference/ClassAndModuleThatMergeWithModulesExportedStaticFunctionUsingClassPrivateStatics.js b/tests/baselines/reference/ClassAndModuleThatMergeWithModulesExportedStaticFunctionUsingClassPrivateStatics.js index d3ae3cb0bcf27..6620c4fabf87e 100644 --- a/tests/baselines/reference/ClassAndModuleThatMergeWithModulesExportedStaticFunctionUsingClassPrivateStatics.js +++ b/tests/baselines/reference/ClassAndModuleThatMergeWithModulesExportedStaticFunctionUsingClassPrivateStatics.js @@ -16,7 +16,7 @@ module clodule { //// [ClassAndModuleThatMergeWithModulesExportedStaticFunctionUsingClassPrivateStatics.js] -var clodule = (function () { +var clodule = /** @class */ (function () { function clodule() { } clodule.sfn = function (id) { return 42; }; diff --git a/tests/baselines/reference/ClassAndModuleThatMergeWithStaticFunctionAndExportedFunctionThatShareAName.js b/tests/baselines/reference/ClassAndModuleThatMergeWithStaticFunctionAndExportedFunctionThatShareAName.js index c6b463fa5fdf6..de0bb3cd400a6 100644 --- a/tests/baselines/reference/ClassAndModuleThatMergeWithStaticFunctionAndExportedFunctionThatShareAName.js +++ b/tests/baselines/reference/ClassAndModuleThatMergeWithStaticFunctionAndExportedFunctionThatShareAName.js @@ -23,7 +23,7 @@ module A { } //// [ClassAndModuleThatMergeWithStaticFunctionAndExportedFunctionThatShareAName.js] -var Point = (function () { +var Point = /** @class */ (function () { function Point(x, y) { this.x = x; this.y = y; @@ -37,7 +37,7 @@ var Point = (function () { })(Point || (Point = {})); var A; (function (A) { - var Point = (function () { + var Point = /** @class */ (function () { function Point(x, y) { this.x = x; this.y = y; diff --git a/tests/baselines/reference/ClassAndModuleThatMergeWithStaticFunctionAndNonExportedFunctionThatShareAName.js b/tests/baselines/reference/ClassAndModuleThatMergeWithStaticFunctionAndNonExportedFunctionThatShareAName.js index 7741290babc5b..50acdf1b9dadc 100644 --- a/tests/baselines/reference/ClassAndModuleThatMergeWithStaticFunctionAndNonExportedFunctionThatShareAName.js +++ b/tests/baselines/reference/ClassAndModuleThatMergeWithStaticFunctionAndNonExportedFunctionThatShareAName.js @@ -23,7 +23,7 @@ module A { } //// [ClassAndModuleThatMergeWithStaticFunctionAndNonExportedFunctionThatShareAName.js] -var Point = (function () { +var Point = /** @class */ (function () { function Point(x, y) { this.x = x; this.y = y; @@ -36,7 +36,7 @@ var Point = (function () { })(Point || (Point = {})); var A; (function (A) { - var Point = (function () { + var Point = /** @class */ (function () { function Point(x, y) { this.x = x; this.y = y; diff --git a/tests/baselines/reference/ClassAndModuleThatMergeWithStaticVariableAndExportedVarThatShareAName.js b/tests/baselines/reference/ClassAndModuleThatMergeWithStaticVariableAndExportedVarThatShareAName.js index 05f14d26369d4..db07e83eb7f81 100644 --- a/tests/baselines/reference/ClassAndModuleThatMergeWithStaticVariableAndExportedVarThatShareAName.js +++ b/tests/baselines/reference/ClassAndModuleThatMergeWithStaticVariableAndExportedVarThatShareAName.js @@ -23,7 +23,7 @@ module A { } //// [ClassAndModuleThatMergeWithStaticVariableAndExportedVarThatShareAName.js] -var Point = (function () { +var Point = /** @class */ (function () { function Point(x, y) { this.x = x; this.y = y; @@ -36,7 +36,7 @@ var Point = (function () { })(Point || (Point = {})); var A; (function (A) { - var Point = (function () { + var Point = /** @class */ (function () { function Point(x, y) { this.x = x; this.y = y; diff --git a/tests/baselines/reference/ClassAndModuleThatMergeWithStaticVariableAndNonExportedVarThatShareAName.js b/tests/baselines/reference/ClassAndModuleThatMergeWithStaticVariableAndNonExportedVarThatShareAName.js index 90c7523b93171..246acf9af117b 100644 --- a/tests/baselines/reference/ClassAndModuleThatMergeWithStaticVariableAndNonExportedVarThatShareAName.js +++ b/tests/baselines/reference/ClassAndModuleThatMergeWithStaticVariableAndNonExportedVarThatShareAName.js @@ -23,7 +23,7 @@ module A { } //// [ClassAndModuleThatMergeWithStaticVariableAndNonExportedVarThatShareAName.js] -var Point = (function () { +var Point = /** @class */ (function () { function Point(x, y) { this.x = x; this.y = y; @@ -36,7 +36,7 @@ var Point = (function () { })(Point || (Point = {})); var A; (function (A) { - var Point = (function () { + var Point = /** @class */ (function () { function Point(x, y) { this.x = x; this.y = y; diff --git a/tests/baselines/reference/ClassAndModuleWithSameNameAndCommonRoot.js b/tests/baselines/reference/ClassAndModuleWithSameNameAndCommonRoot.js index b800ca2d24bd9..a6ca39648ae61 100644 --- a/tests/baselines/reference/ClassAndModuleWithSameNameAndCommonRoot.js +++ b/tests/baselines/reference/ClassAndModuleWithSameNameAndCommonRoot.js @@ -45,7 +45,7 @@ var X; (function (X) { var Y; (function (Y) { - var Point = (function () { + var Point = /** @class */ (function () { function Point(x, y) { this.x = x; this.y = y; @@ -71,7 +71,7 @@ var X; var cl = new X.Y.Point(1, 1); var cl = X.Y.Point.Origin; // error not expected here same as bug 83996 ? //// [simple.js] -var A = (function () { +var A = /** @class */ (function () { function A() { } return A; diff --git a/tests/baselines/reference/ClassDeclaration10.js b/tests/baselines/reference/ClassDeclaration10.js index 6c56000948964..f3ffaa17f90d7 100644 --- a/tests/baselines/reference/ClassDeclaration10.js +++ b/tests/baselines/reference/ClassDeclaration10.js @@ -5,7 +5,7 @@ class C { } //// [ClassDeclaration10.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } return C; diff --git a/tests/baselines/reference/ClassDeclaration11.js b/tests/baselines/reference/ClassDeclaration11.js index 28705f5dfe02c..908956b4eb670 100644 --- a/tests/baselines/reference/ClassDeclaration11.js +++ b/tests/baselines/reference/ClassDeclaration11.js @@ -5,7 +5,7 @@ class C { } //// [ClassDeclaration11.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } C.prototype.foo = function () { }; diff --git a/tests/baselines/reference/ClassDeclaration13.js b/tests/baselines/reference/ClassDeclaration13.js index faabbb3b3c20d..1f72cf9de3430 100644 --- a/tests/baselines/reference/ClassDeclaration13.js +++ b/tests/baselines/reference/ClassDeclaration13.js @@ -5,7 +5,7 @@ class C { } //// [ClassDeclaration13.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } C.prototype.bar = function () { }; diff --git a/tests/baselines/reference/ClassDeclaration14.js b/tests/baselines/reference/ClassDeclaration14.js index ab08fd56c34e0..724f1a222d7ab 100644 --- a/tests/baselines/reference/ClassDeclaration14.js +++ b/tests/baselines/reference/ClassDeclaration14.js @@ -5,7 +5,7 @@ class C { } //// [ClassDeclaration14.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } return C; diff --git a/tests/baselines/reference/ClassDeclaration15.js b/tests/baselines/reference/ClassDeclaration15.js index 39c2b7280492c..f5040f9c63b93 100644 --- a/tests/baselines/reference/ClassDeclaration15.js +++ b/tests/baselines/reference/ClassDeclaration15.js @@ -5,7 +5,7 @@ class C { } //// [ClassDeclaration15.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } return C; diff --git a/tests/baselines/reference/ClassDeclaration21.js b/tests/baselines/reference/ClassDeclaration21.js index 00bd52cf0bad1..9b26af46b7cd1 100644 --- a/tests/baselines/reference/ClassDeclaration21.js +++ b/tests/baselines/reference/ClassDeclaration21.js @@ -5,7 +5,7 @@ class C { } //// [ClassDeclaration21.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } C.prototype[1] = function () { }; diff --git a/tests/baselines/reference/ClassDeclaration22.js b/tests/baselines/reference/ClassDeclaration22.js index 2e9c98d8da3c7..35c13c8bb0f32 100644 --- a/tests/baselines/reference/ClassDeclaration22.js +++ b/tests/baselines/reference/ClassDeclaration22.js @@ -5,7 +5,7 @@ class C { } //// [ClassDeclaration22.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } C.prototype["bar"] = function () { }; diff --git a/tests/baselines/reference/ClassDeclaration24.js b/tests/baselines/reference/ClassDeclaration24.js index 25bf0d144875a..6eee844cbbd23 100644 --- a/tests/baselines/reference/ClassDeclaration24.js +++ b/tests/baselines/reference/ClassDeclaration24.js @@ -3,7 +3,7 @@ class any { } //// [ClassDeclaration24.js] -var any = (function () { +var any = /** @class */ (function () { function any() { } return any; diff --git a/tests/baselines/reference/ClassDeclaration25.js b/tests/baselines/reference/ClassDeclaration25.js index 26c2988ab47cb..e19ce48c137e3 100644 --- a/tests/baselines/reference/ClassDeclaration25.js +++ b/tests/baselines/reference/ClassDeclaration25.js @@ -10,7 +10,7 @@ class List implements IList { //// [ClassDeclaration25.js] -var List = (function () { +var List = /** @class */ (function () { function List() { } return List; diff --git a/tests/baselines/reference/ClassDeclaration26.js b/tests/baselines/reference/ClassDeclaration26.js index 97e1428132e57..40be8d7baeba2 100644 --- a/tests/baselines/reference/ClassDeclaration26.js +++ b/tests/baselines/reference/ClassDeclaration26.js @@ -6,7 +6,7 @@ class C { } //// [ClassDeclaration26.js] -var C = (function () { +var C = /** @class */ (function () { function C() { this.foo = 10; } diff --git a/tests/baselines/reference/ClassDeclaration8.js b/tests/baselines/reference/ClassDeclaration8.js index ec065a6cc4727..71271ab1d8be0 100644 --- a/tests/baselines/reference/ClassDeclaration8.js +++ b/tests/baselines/reference/ClassDeclaration8.js @@ -4,7 +4,7 @@ class C { } //// [ClassDeclaration8.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } return C; diff --git a/tests/baselines/reference/ClassDeclaration9.js b/tests/baselines/reference/ClassDeclaration9.js index 30e9c66be8fc2..a61c6a564ccfb 100644 --- a/tests/baselines/reference/ClassDeclaration9.js +++ b/tests/baselines/reference/ClassDeclaration9.js @@ -4,7 +4,7 @@ class C { } //// [ClassDeclaration9.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } return C; diff --git a/tests/baselines/reference/ClassDeclarationWithInvalidConstOnPropertyDeclaration.js b/tests/baselines/reference/ClassDeclarationWithInvalidConstOnPropertyDeclaration.js index d5c3b3d63f4fc..c4cab7cc9396c 100644 --- a/tests/baselines/reference/ClassDeclarationWithInvalidConstOnPropertyDeclaration.js +++ b/tests/baselines/reference/ClassDeclarationWithInvalidConstOnPropertyDeclaration.js @@ -4,7 +4,7 @@ class AtomicNumbers { } //// [ClassDeclarationWithInvalidConstOnPropertyDeclaration.js] -var AtomicNumbers = (function () { +var AtomicNumbers = /** @class */ (function () { function AtomicNumbers() { } AtomicNumbers.H = 1; diff --git a/tests/baselines/reference/ClassDeclarationWithInvalidConstOnPropertyDeclaration2.js b/tests/baselines/reference/ClassDeclarationWithInvalidConstOnPropertyDeclaration2.js index 7dda5cb832e30..847264e596983 100644 --- a/tests/baselines/reference/ClassDeclarationWithInvalidConstOnPropertyDeclaration2.js +++ b/tests/baselines/reference/ClassDeclarationWithInvalidConstOnPropertyDeclaration2.js @@ -5,7 +5,7 @@ class C { } //// [ClassDeclarationWithInvalidConstOnPropertyDeclaration2.js] -var C = (function () { +var C = /** @class */ (function () { function C() { this.x = 10; } diff --git a/tests/baselines/reference/ES5For-ofTypeCheck10.js b/tests/baselines/reference/ES5For-ofTypeCheck10.js index c4cfafe51990c..85d44ca255005 100644 --- a/tests/baselines/reference/ES5For-ofTypeCheck10.js +++ b/tests/baselines/reference/ES5For-ofTypeCheck10.js @@ -16,7 +16,7 @@ for (var v of new StringIterator) { } //// [ES5For-ofTypeCheck10.js] // In ES3/5, you cannot for...of over an arbitrary iterable. -var StringIterator = (function () { +var StringIterator = /** @class */ (function () { function StringIterator() { } StringIterator.prototype.next = function () { diff --git a/tests/baselines/reference/ES5SymbolProperty2.js b/tests/baselines/reference/ES5SymbolProperty2.js index 0cfe717ae56ea..3de8541a6c94d 100644 --- a/tests/baselines/reference/ES5SymbolProperty2.js +++ b/tests/baselines/reference/ES5SymbolProperty2.js @@ -14,7 +14,7 @@ module M { var M; (function (M) { var Symbol; - var C = (function () { + var C = /** @class */ (function () { function C() { } C.prototype[Symbol.iterator] = function () { }; diff --git a/tests/baselines/reference/ES5SymbolProperty3.js b/tests/baselines/reference/ES5SymbolProperty3.js index 084f79bd077f2..362fcfc7375ed 100644 --- a/tests/baselines/reference/ES5SymbolProperty3.js +++ b/tests/baselines/reference/ES5SymbolProperty3.js @@ -9,7 +9,7 @@ class C { //// [ES5SymbolProperty3.js] var Symbol; -var C = (function () { +var C = /** @class */ (function () { function C() { } C.prototype[Symbol.iterator] = function () { }; diff --git a/tests/baselines/reference/ES5SymbolProperty4.js b/tests/baselines/reference/ES5SymbolProperty4.js index eca71ac989c00..f756a730d52d8 100644 --- a/tests/baselines/reference/ES5SymbolProperty4.js +++ b/tests/baselines/reference/ES5SymbolProperty4.js @@ -9,7 +9,7 @@ class C { //// [ES5SymbolProperty4.js] var Symbol; -var C = (function () { +var C = /** @class */ (function () { function C() { } C.prototype[Symbol.iterator] = function () { }; diff --git a/tests/baselines/reference/ES5SymbolProperty5.js b/tests/baselines/reference/ES5SymbolProperty5.js index 828d29abbfb02..c146b8dd5f1e5 100644 --- a/tests/baselines/reference/ES5SymbolProperty5.js +++ b/tests/baselines/reference/ES5SymbolProperty5.js @@ -9,7 +9,7 @@ class C { //// [ES5SymbolProperty5.js] var Symbol; -var C = (function () { +var C = /** @class */ (function () { function C() { } C.prototype[Symbol.iterator] = function () { }; diff --git a/tests/baselines/reference/ES5SymbolProperty6.js b/tests/baselines/reference/ES5SymbolProperty6.js index 1a9ab2734119d..f9a5adec81570 100644 --- a/tests/baselines/reference/ES5SymbolProperty6.js +++ b/tests/baselines/reference/ES5SymbolProperty6.js @@ -6,7 +6,7 @@ class C { (new C)[Symbol.iterator] //// [ES5SymbolProperty6.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } C.prototype[Symbol.iterator] = function () { }; diff --git a/tests/baselines/reference/ES5SymbolProperty7.js b/tests/baselines/reference/ES5SymbolProperty7.js index 439a2b5bd0ea3..f874c4c77cd39 100644 --- a/tests/baselines/reference/ES5SymbolProperty7.js +++ b/tests/baselines/reference/ES5SymbolProperty7.js @@ -9,7 +9,7 @@ class C { //// [ES5SymbolProperty7.js] var Symbol; -var C = (function () { +var C = /** @class */ (function () { function C() { } C.prototype[Symbol.iterator] = function () { }; diff --git a/tests/baselines/reference/EnumAndModuleWithSameNameAndCommonRoot.js b/tests/baselines/reference/EnumAndModuleWithSameNameAndCommonRoot.js index c0756a56e90db..40075310eb1f5 100644 --- a/tests/baselines/reference/EnumAndModuleWithSameNameAndCommonRoot.js +++ b/tests/baselines/reference/EnumAndModuleWithSameNameAndCommonRoot.js @@ -23,7 +23,7 @@ var enumdule; enumdule[enumdule["Blue"] = 1] = "Blue"; })(enumdule || (enumdule = {})); (function (enumdule) { - var Point = (function () { + var Point = /** @class */ (function () { function Point(x, y) { this.x = x; this.y = y; diff --git a/tests/baselines/reference/ExportAssignment7.js b/tests/baselines/reference/ExportAssignment7.js index 461631e0e7d0d..6b07750257e1c 100644 --- a/tests/baselines/reference/ExportAssignment7.js +++ b/tests/baselines/reference/ExportAssignment7.js @@ -6,7 +6,7 @@ export = B; //// [ExportAssignment7.js] "use strict"; -var C = (function () { +var C = /** @class */ (function () { function C() { } return C; diff --git a/tests/baselines/reference/ExportAssignment8.js b/tests/baselines/reference/ExportAssignment8.js index d09630080125a..dbfad003b749b 100644 --- a/tests/baselines/reference/ExportAssignment8.js +++ b/tests/baselines/reference/ExportAssignment8.js @@ -6,7 +6,7 @@ export class C { //// [ExportAssignment8.js] "use strict"; -var C = (function () { +var C = /** @class */ (function () { function C() { } return C; diff --git a/tests/baselines/reference/ExportClassWhichExtendsInterfaceWithInaccessibleType.js b/tests/baselines/reference/ExportClassWhichExtendsInterfaceWithInaccessibleType.js index 0d8fbb8eb30e9..94faa0dd4b34c 100644 --- a/tests/baselines/reference/ExportClassWhichExtendsInterfaceWithInaccessibleType.js +++ b/tests/baselines/reference/ExportClassWhichExtendsInterfaceWithInaccessibleType.js @@ -22,7 +22,7 @@ module A { //// [ExportClassWhichExtendsInterfaceWithInaccessibleType.js] var A; (function (A) { - var Point2d = (function () { + var Point2d = /** @class */ (function () { function Point2d(x, y) { this.x = x; this.y = y; diff --git a/tests/baselines/reference/ExportClassWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.js b/tests/baselines/reference/ExportClassWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.js index c3084700547b1..93708cd8b5e87 100644 --- a/tests/baselines/reference/ExportClassWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.js +++ b/tests/baselines/reference/ExportClassWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.js @@ -33,14 +33,14 @@ var __extends = (this && this.__extends) || (function () { })(); var A; (function (A) { - var Point = (function () { + var Point = /** @class */ (function () { function Point() { } return Point; }()); A.Point = Point; A.Origin = { x: 0, y: 0 }; - var Point3d = (function (_super) { + var Point3d = /** @class */ (function (_super) { __extends(Point3d, _super); function Point3d() { return _super !== null && _super.apply(this, arguments) || this; @@ -49,7 +49,7 @@ var A; }(Point)); A.Point3d = Point3d; A.Origin3d = { x: 0, y: 0, z: 0 }; - var Line = (function () { + var Line = /** @class */ (function () { function Line(start, end) { this.start = start; this.end = end; diff --git a/tests/baselines/reference/ExportClassWithInaccessibleTypeInIndexerTypeAnnotations.js b/tests/baselines/reference/ExportClassWithInaccessibleTypeInIndexerTypeAnnotations.js index 0496e349fa65c..7642a6cbe871a 100644 --- a/tests/baselines/reference/ExportClassWithInaccessibleTypeInIndexerTypeAnnotations.js +++ b/tests/baselines/reference/ExportClassWithInaccessibleTypeInIndexerTypeAnnotations.js @@ -18,12 +18,12 @@ module A { //// [ExportClassWithInaccessibleTypeInIndexerTypeAnnotations.js] var A; (function (A) { - var Point = (function () { + var Point = /** @class */ (function () { function Point() { } return Point; }()); - var points = (function () { + var points = /** @class */ (function () { function points() { } return points; diff --git a/tests/baselines/reference/ExportClassWithInaccessibleTypeInTypeParameterConstraint.js b/tests/baselines/reference/ExportClassWithInaccessibleTypeInTypeParameterConstraint.js index fe4308281d125..ecadd1fb60124 100644 --- a/tests/baselines/reference/ExportClassWithInaccessibleTypeInTypeParameterConstraint.js +++ b/tests/baselines/reference/ExportClassWithInaccessibleTypeInTypeParameterConstraint.js @@ -37,13 +37,13 @@ var __extends = (this && this.__extends) || (function () { })(); var A; (function (A) { - var Point = (function () { + var Point = /** @class */ (function () { function Point() { } return Point; }()); A.Origin = { x: 0, y: 0 }; - var Point3d = (function (_super) { + var Point3d = /** @class */ (function (_super) { __extends(Point3d, _super); function Point3d() { return _super !== null && _super.apply(this, arguments) || this; @@ -52,7 +52,7 @@ var A; }(Point)); A.Point3d = Point3d; A.Origin3d = { x: 0, y: 0, z: 0 }; - var Line = (function () { + var Line = /** @class */ (function () { function Line(start, end) { this.start = start; this.end = end; diff --git a/tests/baselines/reference/ExportFunctionWithAccessibleTypesInParameterAndReturnTypeAnnotation.js b/tests/baselines/reference/ExportFunctionWithAccessibleTypesInParameterAndReturnTypeAnnotation.js index 421c896539b5b..2d7e408d81ba6 100644 --- a/tests/baselines/reference/ExportFunctionWithAccessibleTypesInParameterAndReturnTypeAnnotation.js +++ b/tests/baselines/reference/ExportFunctionWithAccessibleTypesInParameterAndReturnTypeAnnotation.js @@ -18,13 +18,13 @@ module A { //// [ExportFunctionWithAccessibleTypesInParameterAndReturnTypeAnnotation.js] var A; (function (A) { - var Point = (function () { + var Point = /** @class */ (function () { function Point() { } return Point; }()); A.Point = Point; - var Line = (function () { + var Line = /** @class */ (function () { function Line(start, end) { this.start = start; this.end = end; diff --git a/tests/baselines/reference/ExportFunctionWithInaccessibleTypesInParameterTypeAnnotation.js b/tests/baselines/reference/ExportFunctionWithInaccessibleTypesInParameterTypeAnnotation.js index d33bcba793da8..ac8e36d42224a 100644 --- a/tests/baselines/reference/ExportFunctionWithInaccessibleTypesInParameterTypeAnnotation.js +++ b/tests/baselines/reference/ExportFunctionWithInaccessibleTypesInParameterTypeAnnotation.js @@ -18,12 +18,12 @@ module A { //// [ExportFunctionWithInaccessibleTypesInParameterTypeAnnotation.js] var A; (function (A) { - var Point = (function () { + var Point = /** @class */ (function () { function Point() { } return Point; }()); - var Line = (function () { + var Line = /** @class */ (function () { function Line(start, end) { this.start = start; this.end = end; diff --git a/tests/baselines/reference/ExportFunctionWithInaccessibleTypesInReturnTypeAnnotation.js b/tests/baselines/reference/ExportFunctionWithInaccessibleTypesInReturnTypeAnnotation.js index dbd21ebe9e66f..b2abc1a4d31fc 100644 --- a/tests/baselines/reference/ExportFunctionWithInaccessibleTypesInReturnTypeAnnotation.js +++ b/tests/baselines/reference/ExportFunctionWithInaccessibleTypesInReturnTypeAnnotation.js @@ -18,13 +18,13 @@ module A { //// [ExportFunctionWithInaccessibleTypesInReturnTypeAnnotation.js] var A; (function (A) { - var Point = (function () { + var Point = /** @class */ (function () { function Point() { } return Point; }()); A.Point = Point; - var Line = (function () { + var Line = /** @class */ (function () { function Line(start, end) { this.start = start; this.end = end; diff --git a/tests/baselines/reference/ExportModuleWithAccessibleTypesOnItsExportedMembers.js b/tests/baselines/reference/ExportModuleWithAccessibleTypesOnItsExportedMembers.js index b06288ae09315..401962dd2616f 100644 --- a/tests/baselines/reference/ExportModuleWithAccessibleTypesOnItsExportedMembers.js +++ b/tests/baselines/reference/ExportModuleWithAccessibleTypesOnItsExportedMembers.js @@ -23,7 +23,7 @@ module A { //// [ExportModuleWithAccessibleTypesOnItsExportedMembers.js] var A; (function (A) { - var Point = (function () { + var Point = /** @class */ (function () { function Point(x, y) { this.x = x; this.y = y; @@ -34,7 +34,7 @@ var A; var B; (function (B) { B.Origin = new Point(0, 0); - var Line = (function () { + var Line = /** @class */ (function () { function Line(start, end) { } Line.fromOrigin = function (p) { diff --git a/tests/baselines/reference/ExportObjectLiteralAndObjectTypeLiteralWithAccessibleTypesInMemberTypeAnnotations.js b/tests/baselines/reference/ExportObjectLiteralAndObjectTypeLiteralWithAccessibleTypesInMemberTypeAnnotations.js index e9f3c10e189f4..0990c9bf2bd2d 100644 --- a/tests/baselines/reference/ExportObjectLiteralAndObjectTypeLiteralWithAccessibleTypesInMemberTypeAnnotations.js +++ b/tests/baselines/reference/ExportObjectLiteralAndObjectTypeLiteralWithAccessibleTypesInMemberTypeAnnotations.js @@ -14,7 +14,7 @@ module A { //// [ExportObjectLiteralAndObjectTypeLiteralWithAccessibleTypesInMemberTypeAnnotations.js] var A; (function (A) { - var Point = (function () { + var Point = /** @class */ (function () { function Point(x, y) { this.x = x; this.y = y; diff --git a/tests/baselines/reference/ExportObjectLiteralAndObjectTypeLiteralWithAccessibleTypesInNestedMemberTypeAnnotations.js b/tests/baselines/reference/ExportObjectLiteralAndObjectTypeLiteralWithAccessibleTypesInNestedMemberTypeAnnotations.js index 7a480ed44730a..b454d785e9c7a 100644 --- a/tests/baselines/reference/ExportObjectLiteralAndObjectTypeLiteralWithAccessibleTypesInNestedMemberTypeAnnotations.js +++ b/tests/baselines/reference/ExportObjectLiteralAndObjectTypeLiteralWithAccessibleTypesInNestedMemberTypeAnnotations.js @@ -14,7 +14,7 @@ module A { //// [ExportObjectLiteralAndObjectTypeLiteralWithAccessibleTypesInNestedMemberTypeAnnotations.js] var A; (function (A) { - var Point = (function () { + var Point = /** @class */ (function () { function Point(x, y) { this.x = x; this.y = y; diff --git a/tests/baselines/reference/ExportVariableOfGenericTypeWithInaccessibleTypeAsTypeArgument.js b/tests/baselines/reference/ExportVariableOfGenericTypeWithInaccessibleTypeAsTypeArgument.js index 3c4b5bad16b78..e194bc3f8099c 100644 --- a/tests/baselines/reference/ExportVariableOfGenericTypeWithInaccessibleTypeAsTypeArgument.js +++ b/tests/baselines/reference/ExportVariableOfGenericTypeWithInaccessibleTypeAsTypeArgument.js @@ -11,7 +11,7 @@ module A { //// [ExportVariableOfGenericTypeWithInaccessibleTypeAsTypeArgument.js] var A; (function (A) { - var B = (function () { + var B = /** @class */ (function () { function B() { } return B; diff --git a/tests/baselines/reference/MemberAccessorDeclaration15.js b/tests/baselines/reference/MemberAccessorDeclaration15.js index e2db7b2527e0e..42c4cb760145c 100644 --- a/tests/baselines/reference/MemberAccessorDeclaration15.js +++ b/tests/baselines/reference/MemberAccessorDeclaration15.js @@ -4,7 +4,7 @@ class C { } //// [MemberAccessorDeclaration15.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } Object.defineProperty(C.prototype, "Foo", { diff --git a/tests/baselines/reference/ModuleAndClassWithSameNameAndCommonRoot.js b/tests/baselines/reference/ModuleAndClassWithSameNameAndCommonRoot.js index cf26604952726..699e7ce7678c5 100644 --- a/tests/baselines/reference/ModuleAndClassWithSameNameAndCommonRoot.js +++ b/tests/baselines/reference/ModuleAndClassWithSameNameAndCommonRoot.js @@ -48,7 +48,7 @@ var X; var Y; (function (Y) { // duplicate identifier - var Point = (function () { + var Point = /** @class */ (function () { function Point(x, y) { this.x = x; this.y = y; @@ -64,7 +64,7 @@ var A; A.Instance = new A(); })(A || (A = {})); // duplicate identifier -var A = (function () { +var A = /** @class */ (function () { function A() { } return A; diff --git a/tests/baselines/reference/ModuleAndEnumWithSameNameAndCommonRoot.js b/tests/baselines/reference/ModuleAndEnumWithSameNameAndCommonRoot.js index fa38dae129849..740d02edd17ff 100644 --- a/tests/baselines/reference/ModuleAndEnumWithSameNameAndCommonRoot.js +++ b/tests/baselines/reference/ModuleAndEnumWithSameNameAndCommonRoot.js @@ -19,7 +19,7 @@ var y = new enumdule.Point(0, 0); //// [ModuleAndEnumWithSameNameAndCommonRoot.js] var enumdule; (function (enumdule) { - var Point = (function () { + var Point = /** @class */ (function () { function Point(x, y) { this.x = x; this.y = y; diff --git a/tests/baselines/reference/ModuleWithExportedAndNonExportedClasses.js b/tests/baselines/reference/ModuleWithExportedAndNonExportedClasses.js index 185aa3c580e02..26d014f16c2f3 100644 --- a/tests/baselines/reference/ModuleWithExportedAndNonExportedClasses.js +++ b/tests/baselines/reference/ModuleWithExportedAndNonExportedClasses.js @@ -36,24 +36,24 @@ var ag2 = new A.A2(); //// [ModuleWithExportedAndNonExportedClasses.js] var A; (function (A_1) { - var A = (function () { + var A = /** @class */ (function () { function A() { } return A; }()); A_1.A = A; - var AG = (function () { + var AG = /** @class */ (function () { function AG() { } return AG; }()); A_1.AG = AG; - var A2 = (function () { + var A2 = /** @class */ (function () { function A2() { } return A2; }()); - var AG2 = (function () { + var AG2 = /** @class */ (function () { function AG2() { } return AG2; diff --git a/tests/baselines/reference/ModuleWithExportedAndNonExportedImportAlias.js b/tests/baselines/reference/ModuleWithExportedAndNonExportedImportAlias.js index bdaff287a97be..e1c36200005c5 100644 --- a/tests/baselines/reference/ModuleWithExportedAndNonExportedImportAlias.js +++ b/tests/baselines/reference/ModuleWithExportedAndNonExportedImportAlias.js @@ -42,7 +42,7 @@ var line = Geometry.Lines.Line; //// [ModuleWithExportedAndNonExportedImportAlias.js] var B; (function (B) { - var Line = (function () { + var Line = /** @class */ (function () { function Line(start, end) { this.start = start; this.end = end; diff --git a/tests/baselines/reference/NonInitializedExportInInternalModule.js b/tests/baselines/reference/NonInitializedExportInInternalModule.js index 129dd104282f6..e1df1d41f5483 100644 --- a/tests/baselines/reference/NonInitializedExportInInternalModule.js +++ b/tests/baselines/reference/NonInitializedExportInInternalModule.js @@ -40,7 +40,7 @@ var Inner; var ; let; var ; - var A = (function () { + var A = /** @class */ (function () { function A() { } return A; @@ -58,7 +58,7 @@ var Inner; Inner.b1 = 1; Inner.c1 = 'a'; Inner.d1 = 1; - var D = (function () { + var D = /** @class */ (function () { function D() { } return D; diff --git a/tests/baselines/reference/ParameterList6.js b/tests/baselines/reference/ParameterList6.js index e6238e3f0b8e8..dea859e0f58ff 100644 --- a/tests/baselines/reference/ParameterList6.js +++ b/tests/baselines/reference/ParameterList6.js @@ -5,7 +5,7 @@ class C { } //// [ParameterList6.js] -var C = (function () { +var C = /** @class */ (function () { function C(C) { } return C; diff --git a/tests/baselines/reference/ParameterList7.js b/tests/baselines/reference/ParameterList7.js index 394d2cb733c70..9b252c780614d 100644 --- a/tests/baselines/reference/ParameterList7.js +++ b/tests/baselines/reference/ParameterList7.js @@ -6,7 +6,7 @@ class C1 { } //// [ParameterList7.js] -var C1 = (function () { +var C1 = /** @class */ (function () { function C1(p3) { this.p3 = p3; } // OK diff --git a/tests/baselines/reference/Protected1.js b/tests/baselines/reference/Protected1.js index 57bd4175632ab..13e017acadfe3 100644 --- a/tests/baselines/reference/Protected1.js +++ b/tests/baselines/reference/Protected1.js @@ -3,7 +3,7 @@ protected class C { } //// [Protected1.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } return C; diff --git a/tests/baselines/reference/Protected3.js b/tests/baselines/reference/Protected3.js index 4171d64df7a09..29b1f96effe8e 100644 --- a/tests/baselines/reference/Protected3.js +++ b/tests/baselines/reference/Protected3.js @@ -4,7 +4,7 @@ class C { } //// [Protected3.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } return C; diff --git a/tests/baselines/reference/Protected4.js b/tests/baselines/reference/Protected4.js index 098fe70118da1..35bce025cb864 100644 --- a/tests/baselines/reference/Protected4.js +++ b/tests/baselines/reference/Protected4.js @@ -4,7 +4,7 @@ class C { } //// [Protected4.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } C.prototype.m = function () { }; diff --git a/tests/baselines/reference/Protected5.js b/tests/baselines/reference/Protected5.js index fe79c7399a3be..24356999d616c 100644 --- a/tests/baselines/reference/Protected5.js +++ b/tests/baselines/reference/Protected5.js @@ -4,7 +4,7 @@ class C { } //// [Protected5.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } C.m = function () { }; diff --git a/tests/baselines/reference/Protected6.js b/tests/baselines/reference/Protected6.js index 65a1eea3d6b1c..654543a2df77d 100644 --- a/tests/baselines/reference/Protected6.js +++ b/tests/baselines/reference/Protected6.js @@ -4,7 +4,7 @@ class C { } //// [Protected6.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } C.m = function () { }; diff --git a/tests/baselines/reference/Protected7.js b/tests/baselines/reference/Protected7.js index 5232d932e9d30..41211f13b3b07 100644 --- a/tests/baselines/reference/Protected7.js +++ b/tests/baselines/reference/Protected7.js @@ -4,7 +4,7 @@ class C { } //// [Protected7.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } C.prototype.m = function () { }; diff --git a/tests/baselines/reference/Protected9.js b/tests/baselines/reference/Protected9.js index d7c0d8eae2aa5..63c542f6d4f1c 100644 --- a/tests/baselines/reference/Protected9.js +++ b/tests/baselines/reference/Protected9.js @@ -4,7 +4,7 @@ class C { } //// [Protected9.js] -var C = (function () { +var C = /** @class */ (function () { function C(p) { this.p = p; } diff --git a/tests/baselines/reference/TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName.js b/tests/baselines/reference/TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName.js index 4c5ea297d27ee..134c14e3a8ecb 100644 --- a/tests/baselines/reference/TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName.js +++ b/tests/baselines/reference/TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName.js @@ -43,7 +43,7 @@ var l: X.Y.Z.Line; //// [TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName.js] var A; (function (A) { - var Point = (function () { + var Point = /** @class */ (function () { function Point() { } return Point; @@ -51,7 +51,7 @@ var A; A.Point = Point; })(A || (A = {})); (function (A) { - var Point = (function () { + var Point = /** @class */ (function () { function Point() { } Point.prototype.fromCarthesian = function (p) { @@ -69,7 +69,7 @@ var X; (function (Y) { var Z; (function (Z) { - var Line = (function () { + var Line = /** @class */ (function () { function Line() { } return Line; @@ -83,7 +83,7 @@ var X; (function (Y) { var Z; (function (Z) { - var Line = (function () { + var Line = /** @class */ (function () { function Line() { } return Line; diff --git a/tests/baselines/reference/TwoInternalModulesThatMergeEachWithExportedAndNonExportedLocalVarsOfTheSameName.js b/tests/baselines/reference/TwoInternalModulesThatMergeEachWithExportedAndNonExportedLocalVarsOfTheSameName.js index 028934ae99f3e..16c37108d3f0a 100644 --- a/tests/baselines/reference/TwoInternalModulesThatMergeEachWithExportedAndNonExportedLocalVarsOfTheSameName.js +++ b/tests/baselines/reference/TwoInternalModulesThatMergeEachWithExportedAndNonExportedLocalVarsOfTheSameName.js @@ -60,7 +60,7 @@ var A; var Origin = "0,0"; var Utils; (function (Utils) { - var Plane = (function () { + var Plane = /** @class */ (function () { function Plane(tl, br) { this.tl = tl; this.br = br; diff --git a/tests/baselines/reference/TwoInternalModulesThatMergeEachWithExportedClassesOfTheSameName.js b/tests/baselines/reference/TwoInternalModulesThatMergeEachWithExportedClassesOfTheSameName.js index e98ed836f7bc9..9e7c7d46aee56 100644 --- a/tests/baselines/reference/TwoInternalModulesThatMergeEachWithExportedClassesOfTheSameName.js +++ b/tests/baselines/reference/TwoInternalModulesThatMergeEachWithExportedClassesOfTheSameName.js @@ -35,7 +35,7 @@ module X { //// [TwoInternalModulesThatMergeEachWithExportedClassesOfTheSameName.js] var A; (function (A) { - var Point = (function () { + var Point = /** @class */ (function () { function Point() { } return Point; @@ -44,7 +44,7 @@ var A; })(A || (A = {})); (function (A) { // expected error - var Point = (function () { + var Point = /** @class */ (function () { function Point() { } return Point; @@ -57,7 +57,7 @@ var X; (function (Y) { var Z; (function (Z) { - var Line = (function () { + var Line = /** @class */ (function () { function Line() { } return Line; @@ -72,7 +72,7 @@ var X; var Z; (function (Z) { // expected error - var Line = (function () { + var Line = /** @class */ (function () { function Line() { } return Line; diff --git a/tests/baselines/reference/TwoInternalModulesThatMergeEachWithExportedLocalVarsOfTheSameName.js b/tests/baselines/reference/TwoInternalModulesThatMergeEachWithExportedLocalVarsOfTheSameName.js index a68614c0ed478..b0565965b9f08 100644 --- a/tests/baselines/reference/TwoInternalModulesThatMergeEachWithExportedLocalVarsOfTheSameName.js +++ b/tests/baselines/reference/TwoInternalModulesThatMergeEachWithExportedLocalVarsOfTheSameName.js @@ -52,7 +52,7 @@ var A; A.Origin = { x: 0, y: 0 }; var Utils; (function (Utils) { - var Plane = (function () { + var Plane = /** @class */ (function () { function Plane(tl, br) { this.tl = tl; this.br = br; diff --git a/tests/baselines/reference/TwoInternalModulesThatMergeEachWithExportedModulesOfTheSameName.js b/tests/baselines/reference/TwoInternalModulesThatMergeEachWithExportedModulesOfTheSameName.js index c8412b336dc89..c3c05c722539d 100644 --- a/tests/baselines/reference/TwoInternalModulesThatMergeEachWithExportedModulesOfTheSameName.js +++ b/tests/baselines/reference/TwoInternalModulesThatMergeEachWithExportedModulesOfTheSameName.js @@ -55,7 +55,7 @@ var X; (function (Y) { var Z; (function (Z) { - var Line = (function () { + var Line = /** @class */ (function () { function Line() { } return Line; @@ -69,7 +69,7 @@ var X; (function (Y) { var Z; (function (Z) { - var Line = (function () { + var Line = /** @class */ (function () { function Line() { } return Line; diff --git a/tests/baselines/reference/TwoInternalModulesWithTheSameNameAndDifferentCommonRoot.js b/tests/baselines/reference/TwoInternalModulesWithTheSameNameAndDifferentCommonRoot.js index 86a1190ed0673..4b6ee2b14e4bd 100644 --- a/tests/baselines/reference/TwoInternalModulesWithTheSameNameAndDifferentCommonRoot.js +++ b/tests/baselines/reference/TwoInternalModulesWithTheSameNameAndDifferentCommonRoot.js @@ -53,7 +53,7 @@ var otherRoot; A.Origin = { x: 0, y: 0 }; var Utils; (function (Utils) { - var Plane = (function () { + var Plane = /** @class */ (function () { function Plane(tl, br) { this.tl = tl; this.br = br; diff --git a/tests/baselines/reference/TwoInternalModulesWithTheSameNameAndSameCommonRoot.js b/tests/baselines/reference/TwoInternalModulesWithTheSameNameAndSameCommonRoot.js index c5c4cfdb2ca9b..d221274edd87b 100644 --- a/tests/baselines/reference/TwoInternalModulesWithTheSameNameAndSameCommonRoot.js +++ b/tests/baselines/reference/TwoInternalModulesWithTheSameNameAndSameCommonRoot.js @@ -56,7 +56,7 @@ var A; A.Origin = { x: 0, y: 0 }; var Utils; (function (Utils) { - var Plane = (function () { + var Plane = /** @class */ (function () { function Plane(tl, br) { this.tl = tl; this.br = br; diff --git a/tests/baselines/reference/TypeGuardWithArrayUnion.js b/tests/baselines/reference/TypeGuardWithArrayUnion.js index 8dc7207e9db74..c8e2e0ed8b534 100644 --- a/tests/baselines/reference/TypeGuardWithArrayUnion.js +++ b/tests/baselines/reference/TypeGuardWithArrayUnion.js @@ -11,7 +11,7 @@ function saySize(message: Message | Message[]) { //// [TypeGuardWithArrayUnion.js] -var Message = (function () { +var Message = /** @class */ (function () { function Message() { } return Message; diff --git a/tests/baselines/reference/abstractClassInLocalScope.js b/tests/baselines/reference/abstractClassInLocalScope.js index d841911b0bf09..f221245ece7ea 100644 --- a/tests/baselines/reference/abstractClassInLocalScope.js +++ b/tests/baselines/reference/abstractClassInLocalScope.js @@ -19,12 +19,12 @@ var __extends = (this && this.__extends) || (function () { }; })(); (function () { - var A = (function () { + var A = /** @class */ (function () { function A() { } return A; }()); - var B = (function (_super) { + var B = /** @class */ (function (_super) { __extends(B, _super); function B() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/abstractClassInLocalScopeIsAbstract.js b/tests/baselines/reference/abstractClassInLocalScopeIsAbstract.js index a513ce3d88e07..88aceb2dd7842 100644 --- a/tests/baselines/reference/abstractClassInLocalScopeIsAbstract.js +++ b/tests/baselines/reference/abstractClassInLocalScopeIsAbstract.js @@ -19,12 +19,12 @@ var __extends = (this && this.__extends) || (function () { }; })(); (function () { - var A = (function () { + var A = /** @class */ (function () { function A() { } return A; }()); - var B = (function (_super) { + var B = /** @class */ (function (_super) { __extends(B, _super); function B() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/abstractProperty.js b/tests/baselines/reference/abstractProperty.js index f4b2d432f24af..396af46ae6dd5 100644 --- a/tests/baselines/reference/abstractProperty.js +++ b/tests/baselines/reference/abstractProperty.js @@ -32,12 +32,12 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var B = (function () { +var B = /** @class */ (function () { function B() { } return B; }()); -var C = (function (_super) { +var C = /** @class */ (function (_super) { __extends(C, _super); function C() { var _this = _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/abstractPropertyNegative.js b/tests/baselines/reference/abstractPropertyNegative.js index 5ff6708b89aa8..a95d4edbfb4ca 100644 --- a/tests/baselines/reference/abstractPropertyNegative.js +++ b/tests/baselines/reference/abstractPropertyNegative.js @@ -54,12 +54,12 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var B = (function () { +var B = /** @class */ (function () { function B() { } return B; }()); -var C = (function (_super) { +var C = /** @class */ (function (_super) { __extends(C, _super); function C() { var _this = _super !== null && _super.apply(this, arguments) || this; @@ -75,12 +75,12 @@ var C = (function (_super) { }(B)); var c = new C(); c.ro = "error: lhs of assignment can't be readonly"; -var WrongTypeProperty = (function () { +var WrongTypeProperty = /** @class */ (function () { function WrongTypeProperty() { } return WrongTypeProperty; }()); -var WrongTypePropertyImpl = (function (_super) { +var WrongTypePropertyImpl = /** @class */ (function (_super) { __extends(WrongTypePropertyImpl, _super); function WrongTypePropertyImpl() { var _this = _super !== null && _super.apply(this, arguments) || this; @@ -89,12 +89,12 @@ var WrongTypePropertyImpl = (function (_super) { } return WrongTypePropertyImpl; }(WrongTypeProperty)); -var WrongTypeAccessor = (function () { +var WrongTypeAccessor = /** @class */ (function () { function WrongTypeAccessor() { } return WrongTypeAccessor; }()); -var WrongTypeAccessorImpl = (function (_super) { +var WrongTypeAccessorImpl = /** @class */ (function (_super) { __extends(WrongTypeAccessorImpl, _super); function WrongTypeAccessorImpl() { return _super !== null && _super.apply(this, arguments) || this; @@ -106,7 +106,7 @@ var WrongTypeAccessorImpl = (function (_super) { }); return WrongTypeAccessorImpl; }(WrongTypeAccessor)); -var WrongTypeAccessorImpl2 = (function (_super) { +var WrongTypeAccessorImpl2 = /** @class */ (function (_super) { __extends(WrongTypeAccessorImpl2, _super); function WrongTypeAccessorImpl2() { var _this = _super !== null && _super.apply(this, arguments) || this; @@ -115,7 +115,7 @@ var WrongTypeAccessorImpl2 = (function (_super) { } return WrongTypeAccessorImpl2; }(WrongTypeAccessor)); -var AbstractAccessorMismatch = (function () { +var AbstractAccessorMismatch = /** @class */ (function () { function AbstractAccessorMismatch() { } Object.defineProperty(AbstractAccessorMismatch.prototype, "p1", { diff --git a/tests/baselines/reference/accessInstanceMemberFromStaticMethod01.js b/tests/baselines/reference/accessInstanceMemberFromStaticMethod01.js index 763be0568dcc8..58999225820c0 100644 --- a/tests/baselines/reference/accessInstanceMemberFromStaticMethod01.js +++ b/tests/baselines/reference/accessInstanceMemberFromStaticMethod01.js @@ -8,7 +8,7 @@ class C { } //// [accessInstanceMemberFromStaticMethod01.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } C.prototype.bar = function () { diff --git a/tests/baselines/reference/accessOverriddenBaseClassMember1.js b/tests/baselines/reference/accessOverriddenBaseClassMember1.js index 1fdf137a7e751..30aedee17f10f 100644 --- a/tests/baselines/reference/accessOverriddenBaseClassMember1.js +++ b/tests/baselines/reference/accessOverriddenBaseClassMember1.js @@ -26,7 +26,7 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var Point = (function () { +var Point = /** @class */ (function () { function Point(x, y) { this.x = x; this.y = y; @@ -36,7 +36,7 @@ var Point = (function () { }; return Point; }()); -var ColoredPoint = (function (_super) { +var ColoredPoint = /** @class */ (function (_super) { __extends(ColoredPoint, _super); function ColoredPoint(x, y, color) { var _this = _super.call(this, x, y) || this; diff --git a/tests/baselines/reference/accessStaticMemberFromInstanceMethod01.js b/tests/baselines/reference/accessStaticMemberFromInstanceMethod01.js index fd8ee14b2e143..342067c9e125b 100644 --- a/tests/baselines/reference/accessStaticMemberFromInstanceMethod01.js +++ b/tests/baselines/reference/accessStaticMemberFromInstanceMethod01.js @@ -8,7 +8,7 @@ class C { } //// [accessStaticMemberFromInstanceMethod01.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } C.bar = function () { diff --git a/tests/baselines/reference/accessibilityModifiers.js b/tests/baselines/reference/accessibilityModifiers.js index ef092976ba8a0..c7d1efc2b4da6 100644 --- a/tests/baselines/reference/accessibilityModifiers.js +++ b/tests/baselines/reference/accessibilityModifiers.js @@ -46,7 +46,7 @@ class E { //// [accessibilityModifiers.js] // No errors -var C = (function () { +var C = /** @class */ (function () { function C() { } C.privateMethod = function () { }; @@ -85,7 +85,7 @@ var C = (function () { return C; }()); // Errors, accessibility modifiers must precede static -var D = (function () { +var D = /** @class */ (function () { function D() { } D.privateMethod = function () { }; @@ -124,7 +124,7 @@ var D = (function () { return D; }()); // Errors, multiple accessibility modifier -var E = (function () { +var E = /** @class */ (function () { function E() { } E.prototype.method = function () { }; diff --git a/tests/baselines/reference/accessorParameterAccessibilityModifier.js b/tests/baselines/reference/accessorParameterAccessibilityModifier.js index b0667ddc7266e..c2484d848c8ed 100644 --- a/tests/baselines/reference/accessorParameterAccessibilityModifier.js +++ b/tests/baselines/reference/accessorParameterAccessibilityModifier.js @@ -5,7 +5,7 @@ class C { } //// [accessorParameterAccessibilityModifier.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } Object.defineProperty(C.prototype, "X", { diff --git a/tests/baselines/reference/accessorWithES3.js b/tests/baselines/reference/accessorWithES3.js index 84ea219547891..36ea6317f08ba 100644 --- a/tests/baselines/reference/accessorWithES3.js +++ b/tests/baselines/reference/accessorWithES3.js @@ -22,7 +22,7 @@ var y = { //// [accessorWithES3.js] // error to use accessors in ES3 mode -var C = (function () { +var C = /** @class */ (function () { function C() { } Object.defineProperty(C.prototype, "x", { @@ -34,7 +34,7 @@ var C = (function () { }); return C; }()); -var D = (function () { +var D = /** @class */ (function () { function D() { } Object.defineProperty(D.prototype, "x", { diff --git a/tests/baselines/reference/accessorWithES5.js b/tests/baselines/reference/accessorWithES5.js index 549ecd25e6513..ccd2c3e7573d8 100644 --- a/tests/baselines/reference/accessorWithES5.js +++ b/tests/baselines/reference/accessorWithES5.js @@ -19,7 +19,7 @@ var y = { } //// [accessorWithES5.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } Object.defineProperty(C.prototype, "x", { @@ -31,7 +31,7 @@ var C = (function () { }); return C; }()); -var D = (function () { +var D = /** @class */ (function () { function D() { } Object.defineProperty(D.prototype, "x", { diff --git a/tests/baselines/reference/accessorWithInitializer.js b/tests/baselines/reference/accessorWithInitializer.js index 2d2e03a05da57..a573e244f3b25 100644 --- a/tests/baselines/reference/accessorWithInitializer.js +++ b/tests/baselines/reference/accessorWithInitializer.js @@ -5,7 +5,7 @@ class C { } //// [accessorWithInitializer.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } Object.defineProperty(C.prototype, "X", { diff --git a/tests/baselines/reference/accessorWithMismatchedAccessibilityModifiers.js b/tests/baselines/reference/accessorWithMismatchedAccessibilityModifiers.js index c33259a82b611..fa68ac3e0056f 100644 --- a/tests/baselines/reference/accessorWithMismatchedAccessibilityModifiers.js +++ b/tests/baselines/reference/accessorWithMismatchedAccessibilityModifiers.js @@ -32,7 +32,7 @@ class F { } //// [accessorWithMismatchedAccessibilityModifiers.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } Object.defineProperty(C.prototype, "x", { @@ -46,7 +46,7 @@ var C = (function () { }); return C; }()); -var D = (function () { +var D = /** @class */ (function () { function D() { } Object.defineProperty(D.prototype, "x", { @@ -60,7 +60,7 @@ var D = (function () { }); return D; }()); -var E = (function () { +var E = /** @class */ (function () { function E() { } Object.defineProperty(E.prototype, "x", { @@ -74,7 +74,7 @@ var E = (function () { }); return E; }()); -var F = (function () { +var F = /** @class */ (function () { function F() { } Object.defineProperty(F, "x", { diff --git a/tests/baselines/reference/accessorWithRestParam.js b/tests/baselines/reference/accessorWithRestParam.js index 63169b3cacb2b..0ba0ebc062f4d 100644 --- a/tests/baselines/reference/accessorWithRestParam.js +++ b/tests/baselines/reference/accessorWithRestParam.js @@ -5,7 +5,7 @@ class C { } //// [accessorWithRestParam.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } Object.defineProperty(C.prototype, "X", { diff --git a/tests/baselines/reference/accessorsAreNotContextuallyTyped.js b/tests/baselines/reference/accessorsAreNotContextuallyTyped.js index 9047eebae6610..7ec27cbb9267a 100644 --- a/tests/baselines/reference/accessorsAreNotContextuallyTyped.js +++ b/tests/baselines/reference/accessorsAreNotContextuallyTyped.js @@ -15,7 +15,7 @@ var r = c.x(''); // string //// [accessorsAreNotContextuallyTyped.js] // accessors are not contextually typed -var C = (function () { +var C = /** @class */ (function () { function C() { } Object.defineProperty(C.prototype, "x", { diff --git a/tests/baselines/reference/accessorsEmit.js b/tests/baselines/reference/accessorsEmit.js index 7276c04e28e36..dc2f24f076b66 100644 --- a/tests/baselines/reference/accessorsEmit.js +++ b/tests/baselines/reference/accessorsEmit.js @@ -16,12 +16,12 @@ class Test2 { } //// [accessorsEmit.js] -var Result = (function () { +var Result = /** @class */ (function () { function Result() { } return Result; }()); -var Test = (function () { +var Test = /** @class */ (function () { function Test() { } Object.defineProperty(Test.prototype, "Property", { @@ -34,7 +34,7 @@ var Test = (function () { }); return Test; }()); -var Test2 = (function () { +var Test2 = /** @class */ (function () { function Test2() { } Object.defineProperty(Test2.prototype, "Property", { diff --git a/tests/baselines/reference/accessorsNotAllowedInES3.js b/tests/baselines/reference/accessorsNotAllowedInES3.js index 2d26c0643f9d5..fa3eb8e7b8d74 100644 --- a/tests/baselines/reference/accessorsNotAllowedInES3.js +++ b/tests/baselines/reference/accessorsNotAllowedInES3.js @@ -6,7 +6,7 @@ var y = { get foo() { return 3; } }; //// [accessorsNotAllowedInES3.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } Object.defineProperty(C.prototype, "x", { diff --git a/tests/baselines/reference/accessors_spec_section-4.5_error-cases.js b/tests/baselines/reference/accessors_spec_section-4.5_error-cases.js index 2832e70e13875..11d45b206432b 100644 --- a/tests/baselines/reference/accessors_spec_section-4.5_error-cases.js +++ b/tests/baselines/reference/accessors_spec_section-4.5_error-cases.js @@ -14,7 +14,7 @@ class LanguageSpec_section_4_5_error_cases { } //// [accessors_spec_section-4.5_error-cases.js] -var LanguageSpec_section_4_5_error_cases = (function () { +var LanguageSpec_section_4_5_error_cases = /** @class */ (function () { function LanguageSpec_section_4_5_error_cases() { } Object.defineProperty(LanguageSpec_section_4_5_error_cases.prototype, "AnnotatedSetter_SetterFirst", { diff --git a/tests/baselines/reference/accessors_spec_section-4.5_inference.js b/tests/baselines/reference/accessors_spec_section-4.5_inference.js index 8d9ef160e2ea6..bda4035bb912a 100644 --- a/tests/baselines/reference/accessors_spec_section-4.5_inference.js +++ b/tests/baselines/reference/accessors_spec_section-4.5_inference.js @@ -35,19 +35,19 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var A = (function () { +var A = /** @class */ (function () { function A() { } return A; }()); -var B = (function (_super) { +var B = /** @class */ (function (_super) { __extends(B, _super); function B() { return _super !== null && _super.apply(this, arguments) || this; } return B; }(A)); -var LanguageSpec_section_4_5_inference = (function () { +var LanguageSpec_section_4_5_inference = /** @class */ (function () { function LanguageSpec_section_4_5_inference() { } Object.defineProperty(LanguageSpec_section_4_5_inference.prototype, "InferredGetterFromSetterAnnotation", { diff --git a/tests/baselines/reference/additionOperatorWithAnyAndEveryType.js b/tests/baselines/reference/additionOperatorWithAnyAndEveryType.js index c95256930420c..82559b521dd85 100644 --- a/tests/baselines/reference/additionOperatorWithAnyAndEveryType.js +++ b/tests/baselines/reference/additionOperatorWithAnyAndEveryType.js @@ -41,7 +41,7 @@ var r20 = a + ((a: string) => { return a }); //// [additionOperatorWithAnyAndEveryType.js] function foo() { } -var C = (function () { +var C = /** @class */ (function () { function C() { } C.foo = function () { }; diff --git a/tests/baselines/reference/additionOperatorWithInvalidOperands.js b/tests/baselines/reference/additionOperatorWithInvalidOperands.js index 897559b5cf322..fe7a332b5eef1 100644 --- a/tests/baselines/reference/additionOperatorWithInvalidOperands.js +++ b/tests/baselines/reference/additionOperatorWithInvalidOperands.js @@ -42,7 +42,7 @@ var r20 = E.a + M; //// [additionOperatorWithInvalidOperands.js] function foo() { } -var C = (function () { +var C = /** @class */ (function () { function C() { } C.foo = function () { }; diff --git a/tests/baselines/reference/aliasAssignments.js b/tests/baselines/reference/aliasAssignments.js index c21fe575e764f..7ec8941dd0960 100644 --- a/tests/baselines/reference/aliasAssignments.js +++ b/tests/baselines/reference/aliasAssignments.js @@ -16,7 +16,7 @@ y = moduleA; // should be error //// [aliasAssignments_moduleA.js] "use strict"; exports.__esModule = true; -var someClass = (function () { +var someClass = /** @class */ (function () { function someClass() { } return someClass; diff --git a/tests/baselines/reference/aliasBug.js b/tests/baselines/reference/aliasBug.js index 99d45bf1ae067..502bc9e11a715 100644 --- a/tests/baselines/reference/aliasBug.js +++ b/tests/baselines/reference/aliasBug.js @@ -22,7 +22,7 @@ function use() { //// [aliasBug.js] var foo; (function (foo) { - var Provide = (function () { + var Provide = /** @class */ (function () { function Provide() { } return Provide; @@ -32,7 +32,7 @@ var foo; (function (bar) { var baz; (function (baz) { - var boo = (function () { + var boo = /** @class */ (function () { function boo() { } return boo; diff --git a/tests/baselines/reference/aliasErrors.js b/tests/baselines/reference/aliasErrors.js index 970ea3c54a34c..54edb24fff32d 100644 --- a/tests/baselines/reference/aliasErrors.js +++ b/tests/baselines/reference/aliasErrors.js @@ -33,7 +33,7 @@ function use() { //// [aliasErrors.js] var foo; (function (foo) { - var Provide = (function () { + var Provide = /** @class */ (function () { function Provide() { } return Provide; @@ -43,7 +43,7 @@ var foo; (function (bar) { var baz; (function (baz) { - var boo = (function () { + var boo = /** @class */ (function () { function boo() { } return boo; diff --git a/tests/baselines/reference/aliasInaccessibleModule2.js b/tests/baselines/reference/aliasInaccessibleModule2.js index b16bcf6cd72ee..be208c07ca275 100644 --- a/tests/baselines/reference/aliasInaccessibleModule2.js +++ b/tests/baselines/reference/aliasInaccessibleModule2.js @@ -14,7 +14,7 @@ var M; (function (M) { var N; (function (N) { - var C = (function () { + var C = /** @class */ (function () { function C() { } return C; diff --git a/tests/baselines/reference/aliasUsageInAccessorsOfClass.js b/tests/baselines/reference/aliasUsageInAccessorsOfClass.js index 883cbb84ee310..605bafa4b4f34 100644 --- a/tests/baselines/reference/aliasUsageInAccessorsOfClass.js +++ b/tests/baselines/reference/aliasUsageInAccessorsOfClass.js @@ -30,7 +30,7 @@ class C2 { //// [aliasUsage1_backbone.js] "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); -var Model = (function () { +var Model = /** @class */ (function () { function Model() { } return Model; @@ -50,7 +50,7 @@ var __extends = (this && this.__extends) || (function () { })(); Object.defineProperty(exports, "__esModule", { value: true }); var Backbone = require("./aliasUsage1_backbone"); -var VisualizationModel = (function (_super) { +var VisualizationModel = /** @class */ (function (_super) { __extends(VisualizationModel, _super); function VisualizationModel() { return _super !== null && _super.apply(this, arguments) || this; @@ -62,7 +62,7 @@ exports.VisualizationModel = VisualizationModel; "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var moduleA = require("./aliasUsage1_moduleA"); -var C2 = (function () { +var C2 = /** @class */ (function () { function C2() { } Object.defineProperty(C2.prototype, "A", { diff --git a/tests/baselines/reference/aliasUsageInArray.js b/tests/baselines/reference/aliasUsageInArray.js index 1ccbc958aec35..aab66957f3ec1 100644 --- a/tests/baselines/reference/aliasUsageInArray.js +++ b/tests/baselines/reference/aliasUsageInArray.js @@ -24,7 +24,7 @@ var xs2: typeof moduleA[] = [moduleA]; //// [aliasUsageInArray_backbone.js] "use strict"; exports.__esModule = true; -var Model = (function () { +var Model = /** @class */ (function () { function Model() { } return Model; @@ -44,7 +44,7 @@ var __extends = (this && this.__extends) || (function () { })(); exports.__esModule = true; var Backbone = require("./aliasUsageInArray_backbone"); -var VisualizationModel = (function (_super) { +var VisualizationModel = /** @class */ (function (_super) { __extends(VisualizationModel, _super); function VisualizationModel() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/aliasUsageInFunctionExpression.js b/tests/baselines/reference/aliasUsageInFunctionExpression.js index de661ae803e30..6855a8eea50a6 100644 --- a/tests/baselines/reference/aliasUsageInFunctionExpression.js +++ b/tests/baselines/reference/aliasUsageInFunctionExpression.js @@ -23,7 +23,7 @@ f = (x) => moduleA; //// [aliasUsageInFunctionExpression_backbone.js] "use strict"; exports.__esModule = true; -var Model = (function () { +var Model = /** @class */ (function () { function Model() { } return Model; @@ -43,7 +43,7 @@ var __extends = (this && this.__extends) || (function () { })(); exports.__esModule = true; var Backbone = require("./aliasUsageInFunctionExpression_backbone"); -var VisualizationModel = (function (_super) { +var VisualizationModel = /** @class */ (function (_super) { __extends(VisualizationModel, _super); function VisualizationModel() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/aliasUsageInGenericFunction.js b/tests/baselines/reference/aliasUsageInGenericFunction.js index 2ca49ea8dfc33..46398d251e8cb 100644 --- a/tests/baselines/reference/aliasUsageInGenericFunction.js +++ b/tests/baselines/reference/aliasUsageInGenericFunction.js @@ -27,7 +27,7 @@ var r2 = foo({ a: null }); //// [aliasUsageInGenericFunction_backbone.js] "use strict"; exports.__esModule = true; -var Model = (function () { +var Model = /** @class */ (function () { function Model() { } return Model; @@ -47,7 +47,7 @@ var __extends = (this && this.__extends) || (function () { })(); exports.__esModule = true; var Backbone = require("./aliasUsageInGenericFunction_backbone"); -var VisualizationModel = (function (_super) { +var VisualizationModel = /** @class */ (function (_super) { __extends(VisualizationModel, _super); function VisualizationModel() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/aliasUsageInIndexerOfClass.js b/tests/baselines/reference/aliasUsageInIndexerOfClass.js index 81084b8b92fa6..9591be38642de 100644 --- a/tests/baselines/reference/aliasUsageInIndexerOfClass.js +++ b/tests/baselines/reference/aliasUsageInIndexerOfClass.js @@ -29,7 +29,7 @@ class N2 { //// [aliasUsageInIndexerOfClass_backbone.js] "use strict"; exports.__esModule = true; -var Model = (function () { +var Model = /** @class */ (function () { function Model() { } return Model; @@ -49,7 +49,7 @@ var __extends = (this && this.__extends) || (function () { })(); exports.__esModule = true; var Backbone = require("./aliasUsageInIndexerOfClass_backbone"); -var VisualizationModel = (function (_super) { +var VisualizationModel = /** @class */ (function (_super) { __extends(VisualizationModel, _super); function VisualizationModel() { return _super !== null && _super.apply(this, arguments) || this; @@ -61,13 +61,13 @@ exports.VisualizationModel = VisualizationModel; "use strict"; exports.__esModule = true; var moduleA = require("./aliasUsageInIndexerOfClass_moduleA"); -var N = (function () { +var N = /** @class */ (function () { function N() { this.x = moduleA; } return N; }()); -var N2 = (function () { +var N2 = /** @class */ (function () { function N2() { } return N2; diff --git a/tests/baselines/reference/aliasUsageInObjectLiteral.js b/tests/baselines/reference/aliasUsageInObjectLiteral.js index 6f4adfae58c98..20096e09f3e57 100644 --- a/tests/baselines/reference/aliasUsageInObjectLiteral.js +++ b/tests/baselines/reference/aliasUsageInObjectLiteral.js @@ -24,7 +24,7 @@ var c: { y: { z: IHasVisualizationModel } } = { y: { z: moduleA } }; //// [aliasUsageInObjectLiteral_backbone.js] "use strict"; exports.__esModule = true; -var Model = (function () { +var Model = /** @class */ (function () { function Model() { } return Model; @@ -44,7 +44,7 @@ var __extends = (this && this.__extends) || (function () { })(); exports.__esModule = true; var Backbone = require("./aliasUsageInObjectLiteral_backbone"); -var VisualizationModel = (function (_super) { +var VisualizationModel = /** @class */ (function (_super) { __extends(VisualizationModel, _super); function VisualizationModel() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/aliasUsageInOrExpression.js b/tests/baselines/reference/aliasUsageInOrExpression.js index 178ccaaee230d..c05abd8fb7285 100644 --- a/tests/baselines/reference/aliasUsageInOrExpression.js +++ b/tests/baselines/reference/aliasUsageInOrExpression.js @@ -27,7 +27,7 @@ var f: { x: IHasVisualizationModel } = <{ x: IHasVisualizationModel }>null ? { x //// [aliasUsageInOrExpression_backbone.js] "use strict"; exports.__esModule = true; -var Model = (function () { +var Model = /** @class */ (function () { function Model() { } return Model; @@ -47,7 +47,7 @@ var __extends = (this && this.__extends) || (function () { })(); exports.__esModule = true; var Backbone = require("./aliasUsageInOrExpression_backbone"); -var VisualizationModel = (function (_super) { +var VisualizationModel = /** @class */ (function (_super) { __extends(VisualizationModel, _super); function VisualizationModel() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/aliasUsageInTypeArgumentOfExtendsClause.js b/tests/baselines/reference/aliasUsageInTypeArgumentOfExtendsClause.js index 5ac28396fba69..ee78e98f75de0 100644 --- a/tests/baselines/reference/aliasUsageInTypeArgumentOfExtendsClause.js +++ b/tests/baselines/reference/aliasUsageInTypeArgumentOfExtendsClause.js @@ -27,7 +27,7 @@ class D extends C { //// [aliasUsageInTypeArgumentOfExtendsClause_backbone.js] "use strict"; exports.__esModule = true; -var Model = (function () { +var Model = /** @class */ (function () { function Model() { } return Model; @@ -47,7 +47,7 @@ var __extends = (this && this.__extends) || (function () { })(); exports.__esModule = true; var Backbone = require("./aliasUsageInTypeArgumentOfExtendsClause_backbone"); -var VisualizationModel = (function (_super) { +var VisualizationModel = /** @class */ (function (_super) { __extends(VisualizationModel, _super); function VisualizationModel() { return _super !== null && _super.apply(this, arguments) || this; @@ -69,12 +69,12 @@ var __extends = (this && this.__extends) || (function () { })(); exports.__esModule = true; var moduleA = require("./aliasUsageInTypeArgumentOfExtendsClause_moduleA"); -var C = (function () { +var C = /** @class */ (function () { function C() { } return C; }()); -var D = (function (_super) { +var D = /** @class */ (function (_super) { __extends(D, _super); function D() { var _this = _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/aliasUsageInVarAssignment.js b/tests/baselines/reference/aliasUsageInVarAssignment.js index a85d61fd34cad..ef1953d2e6b6c 100644 --- a/tests/baselines/reference/aliasUsageInVarAssignment.js +++ b/tests/baselines/reference/aliasUsageInVarAssignment.js @@ -23,7 +23,7 @@ var m: typeof moduleA = i; //// [aliasUsageInVarAssignment_backbone.js] "use strict"; exports.__esModule = true; -var Model = (function () { +var Model = /** @class */ (function () { function Model() { } return Model; @@ -43,7 +43,7 @@ var __extends = (this && this.__extends) || (function () { })(); exports.__esModule = true; var Backbone = require("./aliasUsageInVarAssignment_backbone"); -var VisualizationModel = (function (_super) { +var VisualizationModel = /** @class */ (function (_super) { __extends(VisualizationModel, _super); function VisualizationModel() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/allowSyntheticDefaultImports1.js b/tests/baselines/reference/allowSyntheticDefaultImports1.js index a659eb60151c3..fee1d13770630 100644 --- a/tests/baselines/reference/allowSyntheticDefaultImports1.js +++ b/tests/baselines/reference/allowSyntheticDefaultImports1.js @@ -13,7 +13,7 @@ export class Foo { //// [b.js] "use strict"; exports.__esModule = true; -var Foo = (function () { +var Foo = /** @class */ (function () { function Foo() { } return Foo; diff --git a/tests/baselines/reference/allowSyntheticDefaultImports2.js b/tests/baselines/reference/allowSyntheticDefaultImports2.js index 93c13617e4a66..5dc8472d58bc8 100644 --- a/tests/baselines/reference/allowSyntheticDefaultImports2.js +++ b/tests/baselines/reference/allowSyntheticDefaultImports2.js @@ -17,7 +17,7 @@ System.register([], function (exports_1, context_1) { return { setters: [], execute: function () { - Foo = (function () { + Foo = /** @class */ (function () { function Foo() { } return Foo; diff --git a/tests/baselines/reference/allowSyntheticDefaultImports3.js b/tests/baselines/reference/allowSyntheticDefaultImports3.js index 74b1dcb776dec..45fb821a4e234 100644 --- a/tests/baselines/reference/allowSyntheticDefaultImports3.js +++ b/tests/baselines/reference/allowSyntheticDefaultImports3.js @@ -18,7 +18,7 @@ System.register([], function (exports_1, context_1) { return { setters: [], execute: function () { - Foo = (function () { + Foo = /** @class */ (function () { function Foo() { } return Foo; diff --git a/tests/baselines/reference/ambientExternalModuleInAnotherExternalModule.js b/tests/baselines/reference/ambientExternalModuleInAnotherExternalModule.js index 0e5bb55036c79..d6db77b6050ef 100644 --- a/tests/baselines/reference/ambientExternalModuleInAnotherExternalModule.js +++ b/tests/baselines/reference/ambientExternalModuleInAnotherExternalModule.js @@ -13,7 +13,7 @@ var x = ext; //// [ambientExternalModuleInAnotherExternalModule.js] define(["require", "exports", "ext"], function (require, exports, ext) { "use strict"; - var D = (function () { + var D = /** @class */ (function () { function D() { } return D; diff --git a/tests/baselines/reference/ambiguousCallsWhereReturnTypesAgree.js b/tests/baselines/reference/ambiguousCallsWhereReturnTypesAgree.js index 06a558d1ba5e3..6937384136dda 100644 --- a/tests/baselines/reference/ambiguousCallsWhereReturnTypesAgree.js +++ b/tests/baselines/reference/ambiguousCallsWhereReturnTypesAgree.js @@ -29,7 +29,7 @@ class TestClass2 { //// [ambiguousCallsWhereReturnTypesAgree.js] -var TestClass = (function () { +var TestClass = /** @class */ (function () { function TestClass() { } TestClass.prototype.bar = function (x) { @@ -39,7 +39,7 @@ var TestClass = (function () { }; return TestClass; }()); -var TestClass2 = (function () { +var TestClass2 = /** @class */ (function () { function TestClass2() { } TestClass2.prototype.bar = function (x) { diff --git a/tests/baselines/reference/ambiguousOverloadResolution.js b/tests/baselines/reference/ambiguousOverloadResolution.js index 12d0f01cf4a6b..059fb86e66c70 100644 --- a/tests/baselines/reference/ambiguousOverloadResolution.js +++ b/tests/baselines/reference/ambiguousOverloadResolution.js @@ -19,12 +19,12 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var A = (function () { +var A = /** @class */ (function () { function A() { } return A; }()); -var B = (function (_super) { +var B = /** @class */ (function (_super) { __extends(B, _super); function B() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/amdImportNotAsPrimaryExpression.js b/tests/baselines/reference/amdImportNotAsPrimaryExpression.js index 40bb07fa9c3b7..fe0a9be2a085d 100644 --- a/tests/baselines/reference/amdImportNotAsPrimaryExpression.js +++ b/tests/baselines/reference/amdImportNotAsPrimaryExpression.js @@ -35,7 +35,7 @@ var e: number = 0; define(["require", "exports"], function (require, exports) { "use strict"; exports.__esModule = true; - var C1 = (function () { + var C1 = /** @class */ (function () { function C1() { this.m1 = 42; } diff --git a/tests/baselines/reference/amdModuleName1.js b/tests/baselines/reference/amdModuleName1.js index f17166319c0b1..4fc15202c0dc2 100644 --- a/tests/baselines/reference/amdModuleName1.js +++ b/tests/baselines/reference/amdModuleName1.js @@ -13,7 +13,7 @@ export = Foo; define("NamedModule", ["require", "exports"], function (require, exports) { "use strict"; /// - var Foo = (function () { + var Foo = /** @class */ (function () { function Foo() { this.x = 5; } diff --git a/tests/baselines/reference/amdModuleName2.js b/tests/baselines/reference/amdModuleName2.js index 4143183c6f53f..7e65e8a4d18be 100644 --- a/tests/baselines/reference/amdModuleName2.js +++ b/tests/baselines/reference/amdModuleName2.js @@ -15,7 +15,7 @@ define("SecondModuleName", ["require", "exports"], function (require, exports) { "use strict"; /// /// - var Foo = (function () { + var Foo = /** @class */ (function () { function Foo() { this.x = 5; } diff --git a/tests/baselines/reference/anonterface.js b/tests/baselines/reference/anonterface.js index 041b90cb56cec..3c4e04cd23c82 100644 --- a/tests/baselines/reference/anonterface.js +++ b/tests/baselines/reference/anonterface.js @@ -17,7 +17,7 @@ c.m(function(n) { return "hello: "+n; },18); //// [anonterface.js] var M; (function (M) { - var C = (function () { + var C = /** @class */ (function () { function C() { } C.prototype.m = function (fn, n2) { diff --git a/tests/baselines/reference/anonymousClassExpression1.js b/tests/baselines/reference/anonymousClassExpression1.js index 6774665ae6efe..7223b816b9031 100644 --- a/tests/baselines/reference/anonymousClassExpression1.js +++ b/tests/baselines/reference/anonymousClassExpression1.js @@ -5,7 +5,7 @@ function f() { //// [anonymousClassExpression1.js] function f() { - return typeof (function () { + return typeof /** @class */ (function () { function class_1() { } return class_1; diff --git a/tests/baselines/reference/anonymousClassExpression2.js b/tests/baselines/reference/anonymousClassExpression2.js index a1da8d5fb10a9..275ce0bd527fe 100644 --- a/tests/baselines/reference/anonymousClassExpression2.js +++ b/tests/baselines/reference/anonymousClassExpression2.js @@ -23,7 +23,7 @@ while (0) { // note: repros with `while (0);` too // but it's less inscrutable and more obvious to put it *inside* the loop while (0) { - var A = (function () { + var A = /** @class */ (function () { function A() { } A.prototype.methodA = function () { @@ -31,7 +31,7 @@ while (0) { }; return A; }()); - var B = (function () { + var B = /** @class */ (function () { function B() { } B.prototype.methodB = function () { diff --git a/tests/baselines/reference/anyAsGenericFunctionCall.js b/tests/baselines/reference/anyAsGenericFunctionCall.js index 3c3eddccb1e81..085e1065a07c2 100644 --- a/tests/baselines/reference/anyAsGenericFunctionCall.js +++ b/tests/baselines/reference/anyAsGenericFunctionCall.js @@ -16,7 +16,7 @@ var d = x(x); var x; var a = x(); var b = x('hello'); -var C = (function () { +var C = /** @class */ (function () { function C() { } return C; diff --git a/tests/baselines/reference/anyAssignabilityInInheritance.js b/tests/baselines/reference/anyAssignabilityInInheritance.js index a156abe8ab23c..6871d6738aca7 100644 --- a/tests/baselines/reference/anyAssignabilityInInheritance.js +++ b/tests/baselines/reference/anyAssignabilityInInheritance.js @@ -99,13 +99,13 @@ var r3 = foo3(a); // any var r3 = foo3(a); // any var r3 = foo3(a); // any var r3 = foo3(a); // any -var A = (function () { +var A = /** @class */ (function () { function A() { } return A; }()); var r3 = foo3(a); // any -var A2 = (function () { +var A2 = /** @class */ (function () { function A2() { } return A2; @@ -123,7 +123,7 @@ function f() { } f.bar = 1; })(f || (f = {})); var r3 = foo3(a); // any -var CC = (function () { +var CC = /** @class */ (function () { function CC() { } return CC; diff --git a/tests/baselines/reference/anyAssignableToEveryType.js b/tests/baselines/reference/anyAssignableToEveryType.js index f02660e17ec56..d6b2303de48dc 100644 --- a/tests/baselines/reference/anyAssignableToEveryType.js +++ b/tests/baselines/reference/anyAssignableToEveryType.js @@ -47,7 +47,7 @@ function foo(x: T, y: U, z: V) { //// [anyAssignableToEveryType.js] var a; -var C = (function () { +var C = /** @class */ (function () { function C() { } return C; diff --git a/tests/baselines/reference/anyAssignableToEveryType2.js b/tests/baselines/reference/anyAssignableToEveryType2.js index 9a4534296a49e..28b4ab7148d90 100644 --- a/tests/baselines/reference/anyAssignableToEveryType2.js +++ b/tests/baselines/reference/anyAssignableToEveryType2.js @@ -132,12 +132,12 @@ interface I20 { //// [anyAssignableToEveryType2.js] // any is not a subtype of any other types, but is assignable, all the below should work -var A = (function () { +var A = /** @class */ (function () { function A() { } return A; }()); -var A2 = (function () { +var A2 = /** @class */ (function () { function A2() { } return A2; @@ -150,7 +150,7 @@ function f() { } (function (f) { f.bar = 1; })(f || (f = {})); -var c = (function () { +var c = /** @class */ (function () { function c() { } return c; diff --git a/tests/baselines/reference/anyIdenticalToItself.js b/tests/baselines/reference/anyIdenticalToItself.js index cfbaff6585cfb..d88abadeed1be 100644 --- a/tests/baselines/reference/anyIdenticalToItself.js +++ b/tests/baselines/reference/anyIdenticalToItself.js @@ -14,7 +14,7 @@ class C { //// [anyIdenticalToItself.js] function foo(x, y) { } -var C = (function () { +var C = /** @class */ (function () { function C() { } Object.defineProperty(C.prototype, "X", { diff --git a/tests/baselines/reference/apparentTypeSubtyping.js b/tests/baselines/reference/apparentTypeSubtyping.js index df266c20951ef..ed5b58a12fb56 100644 --- a/tests/baselines/reference/apparentTypeSubtyping.js +++ b/tests/baselines/reference/apparentTypeSubtyping.js @@ -34,26 +34,26 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var Base = (function () { +var Base = /** @class */ (function () { function Base() { } return Base; }()); // is String (S) a subtype of U extends String (T)? Would only be true if we used the apparent type of U (T) -var Derived = (function (_super) { +var Derived = /** @class */ (function (_super) { __extends(Derived, _super); function Derived() { return _super !== null && _super.apply(this, arguments) || this; } return Derived; }(Base)); -var Base2 = (function () { +var Base2 = /** @class */ (function () { function Base2() { } return Base2; }()); // is U extends String (S) a subtype of String (T)? Apparent type of U is String so it succeeds -var Derived2 = (function (_super) { +var Derived2 = /** @class */ (function (_super) { __extends(Derived2, _super); function Derived2() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/apparentTypeSupertype.js b/tests/baselines/reference/apparentTypeSupertype.js index 16d43e8316c0d..a34f3dbe9583b 100644 --- a/tests/baselines/reference/apparentTypeSupertype.js +++ b/tests/baselines/reference/apparentTypeSupertype.js @@ -24,13 +24,13 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var Base = (function () { +var Base = /** @class */ (function () { function Base() { } return Base; }()); // is String (S) a subtype of U extends String (T)? Would only be true if we used the apparent type of U (T) -var Derived = (function (_super) { +var Derived = /** @class */ (function (_super) { __extends(Derived, _super); function Derived() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/argsInScope.js b/tests/baselines/reference/argsInScope.js index a38bc77803980..4ddfe09f13aed 100644 --- a/tests/baselines/reference/argsInScope.js +++ b/tests/baselines/reference/argsInScope.js @@ -12,7 +12,7 @@ c.P(1,2,3); //// [argsInScope.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } C.prototype.P = function (ii, j, k) { diff --git a/tests/baselines/reference/argumentsUsedInObjectLiteralProperty.js b/tests/baselines/reference/argumentsUsedInObjectLiteralProperty.js index 753afb809a271..23c534a8c5384 100644 --- a/tests/baselines/reference/argumentsUsedInObjectLiteralProperty.js +++ b/tests/baselines/reference/argumentsUsedInObjectLiteralProperty.js @@ -8,7 +8,7 @@ class A { } //// [argumentsUsedInObjectLiteralProperty.js] -var A = (function () { +var A = /** @class */ (function () { function A() { } A.createSelectableViewModel = function (initialState, selectedValue) { diff --git a/tests/baselines/reference/arithAssignTyping.js b/tests/baselines/reference/arithAssignTyping.js index 38f6718175bc1..7bb31b2804533 100644 --- a/tests/baselines/reference/arithAssignTyping.js +++ b/tests/baselines/reference/arithAssignTyping.js @@ -15,7 +15,7 @@ f >>>= 1; // error f ^= 1; // error //// [arithAssignTyping.js] -var f = (function () { +var f = /** @class */ (function () { function f() { } return f; diff --git a/tests/baselines/reference/arrayAssignmentTest1.js b/tests/baselines/reference/arrayAssignmentTest1.js index 511d37b175222..f04bf8e850948 100644 --- a/tests/baselines/reference/arrayAssignmentTest1.js +++ b/tests/baselines/reference/arrayAssignmentTest1.js @@ -96,14 +96,14 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var C1 = (function () { +var C1 = /** @class */ (function () { function C1() { } C1.prototype.IM1 = function () { return null; }; C1.prototype.C1M1 = function () { return null; }; return C1; }()); -var C2 = (function (_super) { +var C2 = /** @class */ (function (_super) { __extends(C2, _super); function C2() { return _super !== null && _super.apply(this, arguments) || this; @@ -111,7 +111,7 @@ var C2 = (function (_super) { C2.prototype.C2M1 = function () { return null; }; return C2; }(C1)); -var C3 = (function () { +var C3 = /** @class */ (function () { function C3() { } C3.prototype.CM3M1 = function () { return 3; }; diff --git a/tests/baselines/reference/arrayAssignmentTest2.js b/tests/baselines/reference/arrayAssignmentTest2.js index 233ea1b115903..001a2eb3126a3 100644 --- a/tests/baselines/reference/arrayAssignmentTest2.js +++ b/tests/baselines/reference/arrayAssignmentTest2.js @@ -70,14 +70,14 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var C1 = (function () { +var C1 = /** @class */ (function () { function C1() { } C1.prototype.IM1 = function () { return null; }; C1.prototype.C1M1 = function () { return null; }; return C1; }()); -var C2 = (function (_super) { +var C2 = /** @class */ (function (_super) { __extends(C2, _super); function C2() { return _super !== null && _super.apply(this, arguments) || this; @@ -85,7 +85,7 @@ var C2 = (function (_super) { C2.prototype.C2M1 = function () { return null; }; return C2; }(C1)); -var C3 = (function () { +var C3 = /** @class */ (function () { function C3() { } C3.prototype.CM3M1 = function () { return 3; }; diff --git a/tests/baselines/reference/arrayAssignmentTest3.js b/tests/baselines/reference/arrayAssignmentTest3.js index 6e586c738d7af..965da445a2ba8 100644 --- a/tests/baselines/reference/arrayAssignmentTest3.js +++ b/tests/baselines/reference/arrayAssignmentTest3.js @@ -18,12 +18,12 @@ var xx = new a(null, 7, new B()); // The following gives no error // Michal saw no error if he used number instead of B, // but I do... -var B = (function () { +var B = /** @class */ (function () { function B() { } return B; }()); -var a = (function () { +var a = /** @class */ (function () { function a(x, y, z) { this.x = x; this.y = y; diff --git a/tests/baselines/reference/arrayAssignmentTest4.js b/tests/baselines/reference/arrayAssignmentTest4.js index 31e826a06412f..da900089c9d1a 100644 --- a/tests/baselines/reference/arrayAssignmentTest4.js +++ b/tests/baselines/reference/arrayAssignmentTest4.js @@ -25,7 +25,7 @@ arr_any = c3; // should be an error - is //// [arrayAssignmentTest4.js] -var C3 = (function () { +var C3 = /** @class */ (function () { function C3() { } C3.prototype.CM3M1 = function () { return 3; }; diff --git a/tests/baselines/reference/arrayAssignmentTest5.js b/tests/baselines/reference/arrayAssignmentTest5.js index f5bd3e882b562..71c84f374ee6c 100644 --- a/tests/baselines/reference/arrayAssignmentTest5.js +++ b/tests/baselines/reference/arrayAssignmentTest5.js @@ -36,7 +36,7 @@ module Test { //// [arrayAssignmentTest5.js] var Test; (function (Test) { - var Bug = (function () { + var Bug = /** @class */ (function () { function Bug() { } Bug.prototype.onEnter = function (line, state, offset) { diff --git a/tests/baselines/reference/arrayAssignmentTest6.js b/tests/baselines/reference/arrayAssignmentTest6.js index 1e24137ddbaf0..8ed75d26b1988 100644 --- a/tests/baselines/reference/arrayAssignmentTest6.js +++ b/tests/baselines/reference/arrayAssignmentTest6.js @@ -23,7 +23,7 @@ module Test { //// [arrayAssignmentTest6.js] var Test; (function (Test) { - var Bug = (function () { + var Bug = /** @class */ (function () { function Bug() { } Bug.prototype.tokenize = function (line, tokens, includeStates) { diff --git a/tests/baselines/reference/arrayBestCommonTypes.js b/tests/baselines/reference/arrayBestCommonTypes.js index 3a0ab1a5cf5ab..cb425609754ae 100644 --- a/tests/baselines/reference/arrayBestCommonTypes.js +++ b/tests/baselines/reference/arrayBestCommonTypes.js @@ -120,24 +120,24 @@ var __extends = (this && this.__extends) || (function () { })(); var EmptyTypes; (function (EmptyTypes) { - var base = (function () { + var base = /** @class */ (function () { function base() { } return base; }()); - var base2 = (function () { + var base2 = /** @class */ (function () { function base2() { } return base2; }()); - var derived = (function (_super) { + var derived = /** @class */ (function (_super) { __extends(derived, _super); function derived() { return _super !== null && _super.apply(this, arguments) || this; } return derived; }(base)); - var f = (function () { + var f = /** @class */ (function () { function f() { } f.prototype.voidIfAny = function (x, y) { @@ -179,24 +179,24 @@ var EmptyTypes; })(EmptyTypes || (EmptyTypes = {})); var NonEmptyTypes; (function (NonEmptyTypes) { - var base = (function () { + var base = /** @class */ (function () { function base() { } return base; }()); - var base2 = (function () { + var base2 = /** @class */ (function () { function base2() { } return base2; }()); - var derived = (function (_super) { + var derived = /** @class */ (function (_super) { __extends(derived, _super); function derived() { return _super !== null && _super.apply(this, arguments) || this; } return derived; }(base)); - var f = (function () { + var f = /** @class */ (function () { function f() { } f.prototype.voidIfAny = function (x, y) { diff --git a/tests/baselines/reference/arrayLiteralContextualType.js b/tests/baselines/reference/arrayLiteralContextualType.js index 8d42bc209280d..2d48085c80ff3 100644 --- a/tests/baselines/reference/arrayLiteralContextualType.js +++ b/tests/baselines/reference/arrayLiteralContextualType.js @@ -30,14 +30,14 @@ foo(arr); // ok because arr is Array not {}[] bar(arr); // ok because arr is Array not {}[] //// [arrayLiteralContextualType.js] -var Giraffe = (function () { +var Giraffe = /** @class */ (function () { function Giraffe() { this.name = "Giraffe"; this.neckLength = "3m"; } return Giraffe; }()); -var Elephant = (function () { +var Elephant = /** @class */ (function () { function Elephant() { this.name = "Elephant"; this.trunkDiameter = "20cm"; diff --git a/tests/baselines/reference/arrayLiteralTypeInference.js b/tests/baselines/reference/arrayLiteralTypeInference.js index d9b830e818415..eabffbb8a2ea1 100644 --- a/tests/baselines/reference/arrayLiteralTypeInference.js +++ b/tests/baselines/reference/arrayLiteralTypeInference.js @@ -62,19 +62,19 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var Action = (function () { +var Action = /** @class */ (function () { function Action() { } return Action; }()); -var ActionA = (function (_super) { +var ActionA = /** @class */ (function (_super) { __extends(ActionA, _super); function ActionA() { return _super !== null && _super.apply(this, arguments) || this; } return ActionA; }(Action)); -var ActionB = (function (_super) { +var ActionB = /** @class */ (function (_super) { __extends(ActionB, _super); function ActionB() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/arrayLiterals.js b/tests/baselines/reference/arrayLiterals.js index 8041ac399f045..77daabbe22960 100644 --- a/tests/baselines/reference/arrayLiterals.js +++ b/tests/baselines/reference/arrayLiterals.js @@ -55,7 +55,7 @@ var stringArrArr = [[''], [""]]; var stringArr = ['', ""]; var numberArr = [0, 0.0, 0x00, 1e1]; var boolArr = [false, true, false, true]; -var C = (function () { +var C = /** @class */ (function () { function C() { } return C; @@ -67,12 +67,12 @@ var classTypeArray; // Should OK, not be a parse error var context1 = [{ a: '', b: 0, c: '' }, { a: "", b: 3, c: 0 }]; var context2 = [{ a: '', b: 0, c: '' }, { a: "", b: 3, c: 0 }]; // Contextual type C with numeric index signature of type Base makes array literal of Derived have type Base[] -var Base = (function () { +var Base = /** @class */ (function () { function Base() { } return Base; }()); -var Derived1 = (function (_super) { +var Derived1 = /** @class */ (function (_super) { __extends(Derived1, _super); function Derived1() { return _super !== null && _super.apply(this, arguments) || this; @@ -80,7 +80,7 @@ var Derived1 = (function (_super) { return Derived1; }(Base)); ; -var Derived2 = (function (_super) { +var Derived2 = /** @class */ (function (_super) { __extends(Derived2, _super); function Derived2() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/arrayLiteralsWithRecursiveGenerics.js b/tests/baselines/reference/arrayLiteralsWithRecursiveGenerics.js index 8321a572178d3..e1a19867f7c8b 100644 --- a/tests/baselines/reference/arrayLiteralsWithRecursiveGenerics.js +++ b/tests/baselines/reference/arrayLiteralsWithRecursiveGenerics.js @@ -36,19 +36,19 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var List = (function () { +var List = /** @class */ (function () { function List() { } return List; }()); -var DerivedList = (function (_super) { +var DerivedList = /** @class */ (function (_super) { __extends(DerivedList, _super); function DerivedList() { return _super !== null && _super.apply(this, arguments) || this; } return DerivedList; }(List)); -var MyList = (function () { +var MyList = /** @class */ (function () { function MyList() { } return MyList; diff --git a/tests/baselines/reference/arrayOfExportedClass.js b/tests/baselines/reference/arrayOfExportedClass.js index f305aacbe65f7..2a41475c1cd33 100644 --- a/tests/baselines/reference/arrayOfExportedClass.js +++ b/tests/baselines/reference/arrayOfExportedClass.js @@ -26,7 +26,7 @@ export = Road; //// [arrayOfExportedClass_0.js] "use strict"; -var Car = (function () { +var Car = /** @class */ (function () { function Car() { } return Car; @@ -34,7 +34,7 @@ var Car = (function () { module.exports = Car; //// [arrayOfExportedClass_1.js] "use strict"; -var Road = (function () { +var Road = /** @class */ (function () { function Road() { } Road.prototype.AddCars = function (cars) { diff --git a/tests/baselines/reference/arrayOfFunctionTypes3.js b/tests/baselines/reference/arrayOfFunctionTypes3.js index 5a822e67508f2..758e11f6f1fc5 100644 --- a/tests/baselines/reference/arrayOfFunctionTypes3.js +++ b/tests/baselines/reference/arrayOfFunctionTypes3.js @@ -30,7 +30,7 @@ var r7 = r6(''); // any not string // valid uses of arrays of function types var x = [function () { return 1; }, function () { }]; var r2 = x[0](); -var C = (function () { +var C = /** @class */ (function () { function C() { } return C; diff --git a/tests/baselines/reference/arrayOfSubtypeIsAssignableToReadonlyArray.js b/tests/baselines/reference/arrayOfSubtypeIsAssignableToReadonlyArray.js index b2164a07b81f6..f056e96eaed29 100644 --- a/tests/baselines/reference/arrayOfSubtypeIsAssignableToReadonlyArray.js +++ b/tests/baselines/reference/arrayOfSubtypeIsAssignableToReadonlyArray.js @@ -30,19 +30,19 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var A = (function () { +var A = /** @class */ (function () { function A() { } return A; }()); -var B = (function (_super) { +var B = /** @class */ (function (_super) { __extends(B, _super); function B() { return _super !== null && _super.apply(this, arguments) || this; } return B; }(A)); -var C = (function (_super) { +var C = /** @class */ (function (_super) { __extends(C, _super); function C() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/arrayReferenceWithoutTypeArgs.js b/tests/baselines/reference/arrayReferenceWithoutTypeArgs.js index 3d427bfa9b42d..867395c44cf1b 100644 --- a/tests/baselines/reference/arrayReferenceWithoutTypeArgs.js +++ b/tests/baselines/reference/arrayReferenceWithoutTypeArgs.js @@ -4,7 +4,7 @@ class X { } //// [arrayReferenceWithoutTypeArgs.js] -var X = (function () { +var X = /** @class */ (function () { function X() { } X.prototype.f = function (a) { }; diff --git a/tests/baselines/reference/arrayconcat.js b/tests/baselines/reference/arrayconcat.js index 76250642a599a..8730fff8c41ee 100644 --- a/tests/baselines/reference/arrayconcat.js +++ b/tests/baselines/reference/arrayconcat.js @@ -29,7 +29,7 @@ class parser { } //// [arrayconcat.js] -var parser = (function () { +var parser = /** @class */ (function () { function parser() { } parser.prototype.m = function () { diff --git a/tests/baselines/reference/arrowFunctionContexts.js b/tests/baselines/reference/arrowFunctionContexts.js index e2407db768a5c..452348e7301c6 100644 --- a/tests/baselines/reference/arrowFunctionContexts.js +++ b/tests/baselines/reference/arrowFunctionContexts.js @@ -112,12 +112,12 @@ with (window) { var p = function () { return _this; }; } // Arrow function as argument to super call -var Base = (function () { +var Base = /** @class */ (function () { function Base(n) { } return Base; }()); -var Derived = (function (_super) { +var Derived = /** @class */ (function (_super) { __extends(Derived, _super); function Derived() { var _this = _super.call(this, function () { return _this; }) || this; @@ -154,12 +154,12 @@ var M2; var p = function () { return _this; }; } // Arrow function as argument to super call - var Base = (function () { + var Base = /** @class */ (function () { function Base(n) { } return Base; }()); - var Derived = (function (_super) { + var Derived = /** @class */ (function (_super) { __extends(Derived, _super); function Derived() { var _this = _super.call(this, function () { return _this; }) || this; diff --git a/tests/baselines/reference/arrowFunctionExpressions.js b/tests/baselines/reference/arrowFunctionExpressions.js index 66f53d32dba9a..19b7651b1e778 100644 --- a/tests/baselines/reference/arrowFunctionExpressions.js +++ b/tests/baselines/reference/arrowFunctionExpressions.js @@ -144,7 +144,7 @@ var p10 = function (_a) { }; // Arrow function used in class member initializer // Arrow function used in class member function -var MyClass = (function () { +var MyClass = /** @class */ (function () { function MyClass() { var _this = this; this.m = function (n) { return n + 1; }; diff --git a/tests/baselines/reference/arrowFunctionInConstructorArgument1.js b/tests/baselines/reference/arrowFunctionInConstructorArgument1.js index 9d1c8f9d99558..f80b870692958 100644 --- a/tests/baselines/reference/arrowFunctionInConstructorArgument1.js +++ b/tests/baselines/reference/arrowFunctionInConstructorArgument1.js @@ -6,7 +6,7 @@ var c = new C(() => { return asdf; } ) // should error //// [arrowFunctionInConstructorArgument1.js] -var C = (function () { +var C = /** @class */ (function () { function C(x) { } return C; diff --git a/tests/baselines/reference/asOperatorASI.js b/tests/baselines/reference/asOperatorASI.js index 10b6f90f714af..342dc03d2ef90 100644 --- a/tests/baselines/reference/asOperatorASI.js +++ b/tests/baselines/reference/asOperatorASI.js @@ -12,7 +12,7 @@ as(Foo); // should emit //// [asOperatorASI.js] -var Foo = (function () { +var Foo = /** @class */ (function () { function Foo() { } return Foo; diff --git a/tests/baselines/reference/asiAbstract.js b/tests/baselines/reference/asiAbstract.js index c17e1911e4ed9..27ae841ac4294 100644 --- a/tests/baselines/reference/asiAbstract.js +++ b/tests/baselines/reference/asiAbstract.js @@ -17,19 +17,19 @@ class C3 { //// [asiAbstract.js] abstract; -var NonAbstractClass = (function () { +var NonAbstractClass = /** @class */ (function () { function NonAbstractClass() { } return NonAbstractClass; }()); -var C2 = (function () { +var C2 = /** @class */ (function () { function C2() { } C2.prototype.nonAbstractFunction = function () { }; return C2; }()); -var C3 = (function () { +var C3 = /** @class */ (function () { function C3() { } return C3; diff --git a/tests/baselines/reference/asiInES6Classes.js b/tests/baselines/reference/asiInES6Classes.js index d315809d25676..375f0e4bc65da 100644 --- a/tests/baselines/reference/asiInES6Classes.js +++ b/tests/baselines/reference/asiInES6Classes.js @@ -23,7 +23,7 @@ class Foo { //// [asiInES6Classes.js] -var Foo = (function () { +var Foo = /** @class */ (function () { function Foo() { this.defaults = { done: false diff --git a/tests/baselines/reference/asiPublicPrivateProtected.js b/tests/baselines/reference/asiPublicPrivateProtected.js index 12faef5316b6c..7c9b9d7eb72e1 100644 --- a/tests/baselines/reference/asiPublicPrivateProtected.js +++ b/tests/baselines/reference/asiPublicPrivateProtected.js @@ -42,14 +42,14 @@ class ClassWithThreeMembers { //// [asiPublicPrivateProtected.js] public; -var NonPublicClass = (function () { +var NonPublicClass = /** @class */ (function () { function NonPublicClass() { } NonPublicClass.prototype.s = function () { }; return NonPublicClass; }()); -var NonPublicClass2 = (function () { +var NonPublicClass2 = /** @class */ (function () { function NonPublicClass2() { } NonPublicClass2.prototype.nonPublicFunction = function () { @@ -57,14 +57,14 @@ var NonPublicClass2 = (function () { return NonPublicClass2; }()); private; -var NonPrivateClass = (function () { +var NonPrivateClass = /** @class */ (function () { function NonPrivateClass() { } NonPrivateClass.prototype.s = function () { }; return NonPrivateClass; }()); -var NonPrivateClass2 = (function () { +var NonPrivateClass2 = /** @class */ (function () { function NonPrivateClass2() { } NonPrivateClass2.prototype.nonPrivateFunction = function () { @@ -72,21 +72,21 @@ var NonPrivateClass2 = (function () { return NonPrivateClass2; }()); protected; -var NonProtectedClass = (function () { +var NonProtectedClass = /** @class */ (function () { function NonProtectedClass() { } NonProtectedClass.prototype.s = function () { }; return NonProtectedClass; }()); -var NonProtectedClass2 = (function () { +var NonProtectedClass2 = /** @class */ (function () { function NonProtectedClass2() { } NonProtectedClass2.prototype.nonProtectedFunction = function () { }; return NonProtectedClass2; }()); -var ClassWithThreeMembers = (function () { +var ClassWithThreeMembers = /** @class */ (function () { function ClassWithThreeMembers() { } return ClassWithThreeMembers; diff --git a/tests/baselines/reference/assertInWrapSomeTypeParameter.js b/tests/baselines/reference/assertInWrapSomeTypeParameter.js index 698ba439ab72f..da31d1910727f 100644 --- a/tests/baselines/reference/assertInWrapSomeTypeParameter.js +++ b/tests/baselines/reference/assertInWrapSomeTypeParameter.js @@ -6,7 +6,7 @@ class C> { } //// [assertInWrapSomeTypeParameter.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } C.prototype.foo = function (x) { diff --git a/tests/baselines/reference/assignAnyToEveryType.js b/tests/baselines/reference/assignAnyToEveryType.js index 3feade2c911c8..351c041523fc9 100644 --- a/tests/baselines/reference/assignAnyToEveryType.js +++ b/tests/baselines/reference/assignAnyToEveryType.js @@ -63,7 +63,7 @@ var E; var g = x; var g2 = E.A; g2 = x; -var C = (function () { +var C = /** @class */ (function () { function C() { } return C; diff --git a/tests/baselines/reference/assignEveryTypeToAny.js b/tests/baselines/reference/assignEveryTypeToAny.js index 408d7992913a1..07bfbaddebc11 100644 --- a/tests/baselines/reference/assignEveryTypeToAny.js +++ b/tests/baselines/reference/assignEveryTypeToAny.js @@ -82,7 +82,7 @@ var f = E.A; x = f; var g; x = g; -var C = (function () { +var C = /** @class */ (function () { function C() { } return C; diff --git a/tests/baselines/reference/assignToExistingClass.js b/tests/baselines/reference/assignToExistingClass.js index 3e21479186ded..baa7dc3cc7329 100644 --- a/tests/baselines/reference/assignToExistingClass.js +++ b/tests/baselines/reference/assignToExistingClass.js @@ -18,12 +18,12 @@ module Test { //// [assignToExistingClass.js] var Test; (function (Test) { - var Mocked = (function () { + var Mocked = /** @class */ (function () { function Mocked() { } return Mocked; }()); - var Tester = (function () { + var Tester = /** @class */ (function () { function Tester() { } Tester.prototype.willThrowError = function () { diff --git a/tests/baselines/reference/assignToObjectTypeWithPrototypeProperty.js b/tests/baselines/reference/assignToObjectTypeWithPrototypeProperty.js index 48bb9f1131af2..ac2b7368361f8 100644 --- a/tests/baselines/reference/assignToObjectTypeWithPrototypeProperty.js +++ b/tests/baselines/reference/assignToObjectTypeWithPrototypeProperty.js @@ -4,7 +4,7 @@ var p: XEvent = XEvent.prototype; var x: {prototype: XEvent} = XEvent; //// [assignToObjectTypeWithPrototypeProperty.js] -var XEvent = (function () { +var XEvent = /** @class */ (function () { function XEvent() { } return XEvent; diff --git a/tests/baselines/reference/assignmentCompatBug3.js b/tests/baselines/reference/assignmentCompatBug3.js index a72ea1d439ec9..0a080ff5da473 100644 --- a/tests/baselines/reference/assignmentCompatBug3.js +++ b/tests/baselines/reference/assignmentCompatBug3.js @@ -37,7 +37,7 @@ function makePoint(x, y) { } }; } -var C = (function () { +var C = /** @class */ (function () { function C() { } Object.defineProperty(C.prototype, "x", { diff --git a/tests/baselines/reference/assignmentCompatInterfaceWithStringIndexSignature.js b/tests/baselines/reference/assignmentCompatInterfaceWithStringIndexSignature.js index 68d14d9f0c81d..13448bc57a460 100644 --- a/tests/baselines/reference/assignmentCompatInterfaceWithStringIndexSignature.js +++ b/tests/baselines/reference/assignmentCompatInterfaceWithStringIndexSignature.js @@ -17,7 +17,7 @@ Biz(new Foo()); //// [assignmentCompatInterfaceWithStringIndexSignature.js] -var Foo = (function () { +var Foo = /** @class */ (function () { function Foo() { } Foo.prototype.Boz = function () { }; diff --git a/tests/baselines/reference/assignmentCompatOnNew.js b/tests/baselines/reference/assignmentCompatOnNew.js index 6b553fef44602..14d9fb5071ee2 100644 --- a/tests/baselines/reference/assignmentCompatOnNew.js +++ b/tests/baselines/reference/assignmentCompatOnNew.js @@ -7,7 +7,7 @@ bar(Foo); // Error, but should be allowed //// [assignmentCompatOnNew.js] -var Foo = (function () { +var Foo = /** @class */ (function () { function Foo() { } return Foo; diff --git a/tests/baselines/reference/assignmentCompatWithCallSignatures3.js b/tests/baselines/reference/assignmentCompatWithCallSignatures3.js index 58fd19326ee9a..7d4a52f0a9522 100644 --- a/tests/baselines/reference/assignmentCompatWithCallSignatures3.js +++ b/tests/baselines/reference/assignmentCompatWithCallSignatures3.js @@ -111,26 +111,26 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var Base = (function () { +var Base = /** @class */ (function () { function Base() { } return Base; }()); -var Derived = (function (_super) { +var Derived = /** @class */ (function (_super) { __extends(Derived, _super); function Derived() { return _super !== null && _super.apply(this, arguments) || this; } return Derived; }(Base)); -var Derived2 = (function (_super) { +var Derived2 = /** @class */ (function (_super) { __extends(Derived2, _super); function Derived2() { return _super !== null && _super.apply(this, arguments) || this; } return Derived2; }(Derived)); -var OtherDerived = (function (_super) { +var OtherDerived = /** @class */ (function (_super) { __extends(OtherDerived, _super); function OtherDerived() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/assignmentCompatWithCallSignatures4.js b/tests/baselines/reference/assignmentCompatWithCallSignatures4.js index 3703089500681..90f3e8307fd47 100644 --- a/tests/baselines/reference/assignmentCompatWithCallSignatures4.js +++ b/tests/baselines/reference/assignmentCompatWithCallSignatures4.js @@ -112,26 +112,26 @@ var __extends = (this && this.__extends) || (function () { })(); var Errors; (function (Errors) { - var Base = (function () { + var Base = /** @class */ (function () { function Base() { } return Base; }()); - var Derived = (function (_super) { + var Derived = /** @class */ (function (_super) { __extends(Derived, _super); function Derived() { return _super !== null && _super.apply(this, arguments) || this; } return Derived; }(Base)); - var Derived2 = (function (_super) { + var Derived2 = /** @class */ (function (_super) { __extends(Derived2, _super); function Derived2() { return _super !== null && _super.apply(this, arguments) || this; } return Derived2; }(Derived)); - var OtherDerived = (function (_super) { + var OtherDerived = /** @class */ (function (_super) { __extends(OtherDerived, _super); function OtherDerived() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/assignmentCompatWithCallSignatures5.js b/tests/baselines/reference/assignmentCompatWithCallSignatures5.js index 17ebf51308bc1..4e8c11a7fbb07 100644 --- a/tests/baselines/reference/assignmentCompatWithCallSignatures5.js +++ b/tests/baselines/reference/assignmentCompatWithCallSignatures5.js @@ -77,26 +77,26 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var Base = (function () { +var Base = /** @class */ (function () { function Base() { } return Base; }()); -var Derived = (function (_super) { +var Derived = /** @class */ (function (_super) { __extends(Derived, _super); function Derived() { return _super !== null && _super.apply(this, arguments) || this; } return Derived; }(Base)); -var Derived2 = (function (_super) { +var Derived2 = /** @class */ (function (_super) { __extends(Derived2, _super); function Derived2() { return _super !== null && _super.apply(this, arguments) || this; } return Derived2; }(Derived)); -var OtherDerived = (function (_super) { +var OtherDerived = /** @class */ (function (_super) { __extends(OtherDerived, _super); function OtherDerived() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/assignmentCompatWithCallSignatures6.js b/tests/baselines/reference/assignmentCompatWithCallSignatures6.js index 905ef43278625..34cbf0748f7be 100644 --- a/tests/baselines/reference/assignmentCompatWithCallSignatures6.js +++ b/tests/baselines/reference/assignmentCompatWithCallSignatures6.js @@ -54,26 +54,26 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var Base = (function () { +var Base = /** @class */ (function () { function Base() { } return Base; }()); -var Derived = (function (_super) { +var Derived = /** @class */ (function (_super) { __extends(Derived, _super); function Derived() { return _super !== null && _super.apply(this, arguments) || this; } return Derived; }(Base)); -var Derived2 = (function (_super) { +var Derived2 = /** @class */ (function (_super) { __extends(Derived2, _super); function Derived2() { return _super !== null && _super.apply(this, arguments) || this; } return Derived2; }(Derived)); -var OtherDerived = (function (_super) { +var OtherDerived = /** @class */ (function (_super) { __extends(OtherDerived, _super); function OtherDerived() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/assignmentCompatWithConstructSignatures3.js b/tests/baselines/reference/assignmentCompatWithConstructSignatures3.js index 25f267c19c899..ed5cc0543ce1a 100644 --- a/tests/baselines/reference/assignmentCompatWithConstructSignatures3.js +++ b/tests/baselines/reference/assignmentCompatWithConstructSignatures3.js @@ -111,26 +111,26 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var Base = (function () { +var Base = /** @class */ (function () { function Base() { } return Base; }()); -var Derived = (function (_super) { +var Derived = /** @class */ (function (_super) { __extends(Derived, _super); function Derived() { return _super !== null && _super.apply(this, arguments) || this; } return Derived; }(Base)); -var Derived2 = (function (_super) { +var Derived2 = /** @class */ (function (_super) { __extends(Derived2, _super); function Derived2() { return _super !== null && _super.apply(this, arguments) || this; } return Derived2; }(Derived)); -var OtherDerived = (function (_super) { +var OtherDerived = /** @class */ (function (_super) { __extends(OtherDerived, _super); function OtherDerived() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/assignmentCompatWithConstructSignatures4.js b/tests/baselines/reference/assignmentCompatWithConstructSignatures4.js index 879b24a3dde82..dc8d6915d1059 100644 --- a/tests/baselines/reference/assignmentCompatWithConstructSignatures4.js +++ b/tests/baselines/reference/assignmentCompatWithConstructSignatures4.js @@ -112,26 +112,26 @@ var __extends = (this && this.__extends) || (function () { })(); var Errors; (function (Errors) { - var Base = (function () { + var Base = /** @class */ (function () { function Base() { } return Base; }()); - var Derived = (function (_super) { + var Derived = /** @class */ (function (_super) { __extends(Derived, _super); function Derived() { return _super !== null && _super.apply(this, arguments) || this; } return Derived; }(Base)); - var Derived2 = (function (_super) { + var Derived2 = /** @class */ (function (_super) { __extends(Derived2, _super); function Derived2() { return _super !== null && _super.apply(this, arguments) || this; } return Derived2; }(Derived)); - var OtherDerived = (function (_super) { + var OtherDerived = /** @class */ (function (_super) { __extends(OtherDerived, _super); function OtherDerived() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/assignmentCompatWithConstructSignatures5.js b/tests/baselines/reference/assignmentCompatWithConstructSignatures5.js index b2d722c679171..7b96bd54b5c46 100644 --- a/tests/baselines/reference/assignmentCompatWithConstructSignatures5.js +++ b/tests/baselines/reference/assignmentCompatWithConstructSignatures5.js @@ -77,26 +77,26 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var Base = (function () { +var Base = /** @class */ (function () { function Base() { } return Base; }()); -var Derived = (function (_super) { +var Derived = /** @class */ (function (_super) { __extends(Derived, _super); function Derived() { return _super !== null && _super.apply(this, arguments) || this; } return Derived; }(Base)); -var Derived2 = (function (_super) { +var Derived2 = /** @class */ (function (_super) { __extends(Derived2, _super); function Derived2() { return _super !== null && _super.apply(this, arguments) || this; } return Derived2; }(Derived)); -var OtherDerived = (function (_super) { +var OtherDerived = /** @class */ (function (_super) { __extends(OtherDerived, _super); function OtherDerived() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/assignmentCompatWithConstructSignatures6.js b/tests/baselines/reference/assignmentCompatWithConstructSignatures6.js index 6c68a3edbfeb1..a1951dfcbbdc4 100644 --- a/tests/baselines/reference/assignmentCompatWithConstructSignatures6.js +++ b/tests/baselines/reference/assignmentCompatWithConstructSignatures6.js @@ -54,26 +54,26 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var Base = (function () { +var Base = /** @class */ (function () { function Base() { } return Base; }()); -var Derived = (function (_super) { +var Derived = /** @class */ (function (_super) { __extends(Derived, _super); function Derived() { return _super !== null && _super.apply(this, arguments) || this; } return Derived; }(Base)); -var Derived2 = (function (_super) { +var Derived2 = /** @class */ (function (_super) { __extends(Derived2, _super); function Derived2() { return _super !== null && _super.apply(this, arguments) || this; } return Derived2; }(Derived)); -var OtherDerived = (function (_super) { +var OtherDerived = /** @class */ (function (_super) { __extends(OtherDerived, _super); function OtherDerived() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/assignmentCompatWithGenericCallSignaturesWithOptionalParameters.js b/tests/baselines/reference/assignmentCompatWithGenericCallSignaturesWithOptionalParameters.js index 87977de1ab9f4..78e657f5cb003 100644 --- a/tests/baselines/reference/assignmentCompatWithGenericCallSignaturesWithOptionalParameters.js +++ b/tests/baselines/reference/assignmentCompatWithGenericCallSignaturesWithOptionalParameters.js @@ -134,7 +134,7 @@ module GenericSignaturesValid { // call signatures in derived types must have the same or fewer optional parameters as the target for assignment var ClassTypeParam; (function (ClassTypeParam) { - var Base = (function () { + var Base = /** @class */ (function () { function Base() { var _this = this; this.init = function () { @@ -163,12 +163,12 @@ var ClassTypeParam; })(ClassTypeParam || (ClassTypeParam = {})); var GenericSignaturesInvalid; (function (GenericSignaturesInvalid) { - var Base2 = (function () { + var Base2 = /** @class */ (function () { function Base2() { } return Base2; }()); - var Target = (function () { + var Target = /** @class */ (function () { function Target() { } return Target; @@ -206,7 +206,7 @@ var GenericSignaturesInvalid; })(GenericSignaturesInvalid || (GenericSignaturesInvalid = {})); var GenericSignaturesValid; (function (GenericSignaturesValid) { - var Base2 = (function () { + var Base2 = /** @class */ (function () { function Base2() { var _this = this; this.init = function () { diff --git a/tests/baselines/reference/assignmentCompatWithNumericIndexer.js b/tests/baselines/reference/assignmentCompatWithNumericIndexer.js index e05538472fe33..23719df9126ff 100644 --- a/tests/baselines/reference/assignmentCompatWithNumericIndexer.js +++ b/tests/baselines/reference/assignmentCompatWithNumericIndexer.js @@ -55,7 +55,7 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var A = (function () { +var A = /** @class */ (function () { function A() { } return A; @@ -69,12 +69,12 @@ a = b2; b2 = a; // error var Generics; (function (Generics) { - var A = (function () { + var A = /** @class */ (function () { function A() { } return A; }()); - var B = (function (_super) { + var B = /** @class */ (function (_super) { __extends(B, _super); function B() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/assignmentCompatWithNumericIndexer3.js b/tests/baselines/reference/assignmentCompatWithNumericIndexer3.js index 6ea115fde33fc..1270283351ba7 100644 --- a/tests/baselines/reference/assignmentCompatWithNumericIndexer3.js +++ b/tests/baselines/reference/assignmentCompatWithNumericIndexer3.js @@ -52,7 +52,7 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var A = (function () { +var A = /** @class */ (function () { function A() { } return A; @@ -61,7 +61,7 @@ var a; var b; a = b; // error b = a; // ok -var B2 = (function (_super) { +var B2 = /** @class */ (function (_super) { __extends(B2, _super); function B2() { return _super !== null && _super.apply(this, arguments) || this; @@ -73,7 +73,7 @@ a = b2; // ok b2 = a; // error var Generics; (function (Generics) { - var A = (function () { + var A = /** @class */ (function () { function A() { } return A; diff --git a/tests/baselines/reference/assignmentCompatWithObjectMembers.js b/tests/baselines/reference/assignmentCompatWithObjectMembers.js index 2bef0f9f5c4bd..2589f464c5315 100644 --- a/tests/baselines/reference/assignmentCompatWithObjectMembers.js +++ b/tests/baselines/reference/assignmentCompatWithObjectMembers.js @@ -90,12 +90,12 @@ module ObjectTypes { // no errors expected var SimpleTypes; (function (SimpleTypes) { - var S = (function () { + var S = /** @class */ (function () { function S() { } return S; }()); - var T = (function () { + var T = /** @class */ (function () { function T() { } return T; @@ -130,12 +130,12 @@ var SimpleTypes; })(SimpleTypes || (SimpleTypes = {})); var ObjectTypes; (function (ObjectTypes) { - var S = (function () { + var S = /** @class */ (function () { function S() { } return S; }()); - var T = (function () { + var T = /** @class */ (function () { function T() { } return T; diff --git a/tests/baselines/reference/assignmentCompatWithObjectMembers2.js b/tests/baselines/reference/assignmentCompatWithObjectMembers2.js index d1eda3808fee8..08452e3d210c9 100644 --- a/tests/baselines/reference/assignmentCompatWithObjectMembers2.js +++ b/tests/baselines/reference/assignmentCompatWithObjectMembers2.js @@ -45,12 +45,12 @@ a2 = t; //// [assignmentCompatWithObjectMembers2.js] // members N and M of types S and T have the same name, same accessibility, same optionality, and N is assignable M // additional optional properties do not cause errors -var S = (function () { +var S = /** @class */ (function () { function S() { } return S; }()); -var T = (function () { +var T = /** @class */ (function () { function T() { } return T; diff --git a/tests/baselines/reference/assignmentCompatWithObjectMembers3.js b/tests/baselines/reference/assignmentCompatWithObjectMembers3.js index 82b72c84485a7..58c6321faa620 100644 --- a/tests/baselines/reference/assignmentCompatWithObjectMembers3.js +++ b/tests/baselines/reference/assignmentCompatWithObjectMembers3.js @@ -45,12 +45,12 @@ a2 = t; //// [assignmentCompatWithObjectMembers3.js] // members N and M of types S and T have the same name, same accessibility, same optionality, and N is assignable M // additional optional properties do not cause errors -var S = (function () { +var S = /** @class */ (function () { function S() { } return S; }()); -var T = (function () { +var T = /** @class */ (function () { function T() { } return T; diff --git a/tests/baselines/reference/assignmentCompatWithObjectMembers4.js b/tests/baselines/reference/assignmentCompatWithObjectMembers4.js index bdd502ee02715..375b9ab3e057c 100644 --- a/tests/baselines/reference/assignmentCompatWithObjectMembers4.js +++ b/tests/baselines/reference/assignmentCompatWithObjectMembers4.js @@ -105,31 +105,31 @@ var __extends = (this && this.__extends) || (function () { })(); var OnlyDerived; (function (OnlyDerived) { - var Base = (function () { + var Base = /** @class */ (function () { function Base() { } return Base; }()); - var Derived = (function (_super) { + var Derived = /** @class */ (function (_super) { __extends(Derived, _super); function Derived() { return _super !== null && _super.apply(this, arguments) || this; } return Derived; }(Base)); - var Derived2 = (function (_super) { + var Derived2 = /** @class */ (function (_super) { __extends(Derived2, _super); function Derived2() { return _super !== null && _super.apply(this, arguments) || this; } return Derived2; }(Base)); - var S = (function () { + var S = /** @class */ (function () { function S() { } return S; }()); - var T = (function () { + var T = /** @class */ (function () { function T() { } return T; @@ -164,31 +164,31 @@ var OnlyDerived; })(OnlyDerived || (OnlyDerived = {})); var WithBase; (function (WithBase) { - var Base = (function () { + var Base = /** @class */ (function () { function Base() { } return Base; }()); - var Derived = (function (_super) { + var Derived = /** @class */ (function (_super) { __extends(Derived, _super); function Derived() { return _super !== null && _super.apply(this, arguments) || this; } return Derived; }(Base)); - var Derived2 = (function (_super) { + var Derived2 = /** @class */ (function (_super) { __extends(Derived2, _super); function Derived2() { return _super !== null && _super.apply(this, arguments) || this; } return Derived2; }(Base)); - var S = (function () { + var S = /** @class */ (function () { function S() { } return S; }()); - var T = (function () { + var T = /** @class */ (function () { function T() { } return T; diff --git a/tests/baselines/reference/assignmentCompatWithObjectMembers5.js b/tests/baselines/reference/assignmentCompatWithObjectMembers5.js index 9ed799abdb2c9..86302977ecbab 100644 --- a/tests/baselines/reference/assignmentCompatWithObjectMembers5.js +++ b/tests/baselines/reference/assignmentCompatWithObjectMembers5.js @@ -15,7 +15,7 @@ c = i; // error i = c; // error //// [assignmentCompatWithObjectMembers5.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } return C; diff --git a/tests/baselines/reference/assignmentCompatWithObjectMembersAccessibility.js b/tests/baselines/reference/assignmentCompatWithObjectMembersAccessibility.js index 997c5f7a0c9b2..efe6857f933a7 100644 --- a/tests/baselines/reference/assignmentCompatWithObjectMembersAccessibility.js +++ b/tests/baselines/reference/assignmentCompatWithObjectMembersAccessibility.js @@ -114,7 +114,7 @@ module TargetIsPublic { var TargetIsPublic; (function (TargetIsPublic) { // targets - var Base = (function () { + var Base = /** @class */ (function () { function Base() { } return Base; @@ -123,12 +123,12 @@ var TargetIsPublic; var b; var i; // sources - var D = (function () { + var D = /** @class */ (function () { function D() { } return D; }()); - var E = (function () { + var E = /** @class */ (function () { function E() { } return E; @@ -159,7 +159,7 @@ var TargetIsPublic; })(TargetIsPublic || (TargetIsPublic = {})); (function (TargetIsPublic) { // targets - var Base = (function () { + var Base = /** @class */ (function () { function Base() { } return Base; @@ -168,12 +168,12 @@ var TargetIsPublic; var b; var i; // sources - var D = (function () { + var D = /** @class */ (function () { function D() { } return D; }()); - var E = (function () { + var E = /** @class */ (function () { function E() { } return E; diff --git a/tests/baselines/reference/assignmentCompatWithObjectMembersNumericNames.js b/tests/baselines/reference/assignmentCompatWithObjectMembersNumericNames.js index 92f088c2f101e..e021f3e22e62e 100644 --- a/tests/baselines/reference/assignmentCompatWithObjectMembersNumericNames.js +++ b/tests/baselines/reference/assignmentCompatWithObjectMembersNumericNames.js @@ -45,12 +45,12 @@ a2 = t; //// [assignmentCompatWithObjectMembersNumericNames.js] // members N and M of types S and T have the same name, same accessibility, same optionality, and N is assignable M // numeric named properties work correctly, no errors expected -var S = (function () { +var S = /** @class */ (function () { function S() { } return S; }()); -var T = (function () { +var T = /** @class */ (function () { function T() { } return T; diff --git a/tests/baselines/reference/assignmentCompatWithObjectMembersOptionality.js b/tests/baselines/reference/assignmentCompatWithObjectMembersOptionality.js index b5274280b3111..299d1fea0dfa6 100644 --- a/tests/baselines/reference/assignmentCompatWithObjectMembersOptionality.js +++ b/tests/baselines/reference/assignmentCompatWithObjectMembersOptionality.js @@ -100,19 +100,19 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var Base = (function () { +var Base = /** @class */ (function () { function Base() { } return Base; }()); -var Derived = (function (_super) { +var Derived = /** @class */ (function (_super) { __extends(Derived, _super); function Derived() { return _super !== null && _super.apply(this, arguments) || this; } return Derived; }(Base)); -var Derived2 = (function (_super) { +var Derived2 = /** @class */ (function (_super) { __extends(Derived2, _super); function Derived2() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/assignmentCompatWithObjectMembersOptionality2.js b/tests/baselines/reference/assignmentCompatWithObjectMembersOptionality2.js index d83f3182531ed..2b4d9fd462b3f 100644 --- a/tests/baselines/reference/assignmentCompatWithObjectMembersOptionality2.js +++ b/tests/baselines/reference/assignmentCompatWithObjectMembersOptionality2.js @@ -103,19 +103,19 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var Base = (function () { +var Base = /** @class */ (function () { function Base() { } return Base; }()); -var Derived = (function (_super) { +var Derived = /** @class */ (function (_super) { __extends(Derived, _super); function Derived() { return _super !== null && _super.apply(this, arguments) || this; } return Derived; }(Base)); -var Derived2 = (function (_super) { +var Derived2 = /** @class */ (function (_super) { __extends(Derived2, _super); function Derived2() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/assignmentCompatWithObjectMembersStringNumericNames.js b/tests/baselines/reference/assignmentCompatWithObjectMembersStringNumericNames.js index 80d0ac84de712..30e81f3f19f08 100644 --- a/tests/baselines/reference/assignmentCompatWithObjectMembersStringNumericNames.js +++ b/tests/baselines/reference/assignmentCompatWithObjectMembersStringNumericNames.js @@ -90,12 +90,12 @@ module NumbersAndStrings { // string named numeric properties work correctly, errors below unless otherwise noted var JustStrings; (function (JustStrings) { - var S = (function () { + var S = /** @class */ (function () { function S() { } return S; }()); - var T = (function () { + var T = /** @class */ (function () { function T() { } return T; @@ -130,12 +130,12 @@ var JustStrings; })(JustStrings || (JustStrings = {})); var NumbersAndStrings; (function (NumbersAndStrings) { - var S = (function () { + var S = /** @class */ (function () { function S() { } return S; }()); - var T = (function () { + var T = /** @class */ (function () { function T() { } return T; diff --git a/tests/baselines/reference/assignmentCompatWithOverloads.js b/tests/baselines/reference/assignmentCompatWithOverloads.js index 68dd818e4a875..8955dd409755a 100644 --- a/tests/baselines/reference/assignmentCompatWithOverloads.js +++ b/tests/baselines/reference/assignmentCompatWithOverloads.js @@ -40,7 +40,7 @@ g = f1; // OK g = f2; // Error g = f3; // Error g = f4; // Error -var C = (function () { +var C = /** @class */ (function () { function C(x) { } return C; diff --git a/tests/baselines/reference/assignmentCompatWithStringIndexer.js b/tests/baselines/reference/assignmentCompatWithStringIndexer.js index 8f3b23cfffb52..e57d1e7bf2cfc 100644 --- a/tests/baselines/reference/assignmentCompatWithStringIndexer.js +++ b/tests/baselines/reference/assignmentCompatWithStringIndexer.js @@ -65,7 +65,7 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var A = (function () { +var A = /** @class */ (function () { function A() { } return A; @@ -79,12 +79,12 @@ a = b2; // ok b2 = a; // error var Generics; (function (Generics) { - var A = (function () { + var A = /** @class */ (function () { function A() { } return A; }()); - var B = (function (_super) { + var B = /** @class */ (function (_super) { __extends(B, _super); function B() { return _super !== null && _super.apply(this, arguments) || this; @@ -95,7 +95,7 @@ var Generics; var a1; a1 = b1; // ok b1 = a1; // error - var B2 = (function (_super) { + var B2 = /** @class */ (function (_super) { __extends(B2, _super); function B2() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/assignmentCompatWithStringIndexer3.js b/tests/baselines/reference/assignmentCompatWithStringIndexer3.js index f0a3439f25f7c..d3306949906e2 100644 --- a/tests/baselines/reference/assignmentCompatWithStringIndexer3.js +++ b/tests/baselines/reference/assignmentCompatWithStringIndexer3.js @@ -31,7 +31,7 @@ a = b1; // error b1 = a; // error var Generics; (function (Generics) { - var A = (function () { + var A = /** @class */ (function () { function A() { } return A; diff --git a/tests/baselines/reference/assignmentCompatability10.js b/tests/baselines/reference/assignmentCompatability10.js index bde7af81e2c14..c21d0d57abdaf 100644 --- a/tests/baselines/reference/assignmentCompatability10.js +++ b/tests/baselines/reference/assignmentCompatability10.js @@ -19,7 +19,7 @@ var __test1__; })(__test1__ || (__test1__ = {})); var __test2__; (function (__test2__) { - var classWithPublicAndOptional = (function () { + var classWithPublicAndOptional = /** @class */ (function () { function classWithPublicAndOptional(one, two) { this.one = one; this.two = two; diff --git a/tests/baselines/reference/assignmentCompatability39.js b/tests/baselines/reference/assignmentCompatability39.js index 3dfdbee632d96..6a2c4e88e30b8 100644 --- a/tests/baselines/reference/assignmentCompatability39.js +++ b/tests/baselines/reference/assignmentCompatability39.js @@ -19,7 +19,7 @@ var __test1__; })(__test1__ || (__test1__ = {})); var __test2__; (function (__test2__) { - var classWithTwoPublic = (function () { + var classWithTwoPublic = /** @class */ (function () { function classWithTwoPublic(one, two) { this.one = one; this.two = two; diff --git a/tests/baselines/reference/assignmentCompatability40.js b/tests/baselines/reference/assignmentCompatability40.js index c7e671dfdd3cb..ecfd29d6213dc 100644 --- a/tests/baselines/reference/assignmentCompatability40.js +++ b/tests/baselines/reference/assignmentCompatability40.js @@ -19,7 +19,7 @@ var __test1__; })(__test1__ || (__test1__ = {})); var __test2__; (function (__test2__) { - var classWithPrivate = (function () { + var classWithPrivate = /** @class */ (function () { function classWithPrivate(one) { this.one = one; } diff --git a/tests/baselines/reference/assignmentCompatability41.js b/tests/baselines/reference/assignmentCompatability41.js index 21b36ce92f122..dbba1e012621a 100644 --- a/tests/baselines/reference/assignmentCompatability41.js +++ b/tests/baselines/reference/assignmentCompatability41.js @@ -19,7 +19,7 @@ var __test1__; })(__test1__ || (__test1__ = {})); var __test2__; (function (__test2__) { - var classWithTwoPrivate = (function () { + var classWithTwoPrivate = /** @class */ (function () { function classWithTwoPrivate(one, two) { this.one = one; this.two = two; diff --git a/tests/baselines/reference/assignmentCompatability42.js b/tests/baselines/reference/assignmentCompatability42.js index c6baff4617070..98ddf0bd4ec38 100644 --- a/tests/baselines/reference/assignmentCompatability42.js +++ b/tests/baselines/reference/assignmentCompatability42.js @@ -19,7 +19,7 @@ var __test1__; })(__test1__ || (__test1__ = {})); var __test2__; (function (__test2__) { - var classWithPublicPrivate = (function () { + var classWithPublicPrivate = /** @class */ (function () { function classWithPublicPrivate(one, two) { this.one = one; this.two = two; diff --git a/tests/baselines/reference/assignmentCompatability8.js b/tests/baselines/reference/assignmentCompatability8.js index 38459e41cfa08..b0aa9b4374f33 100644 --- a/tests/baselines/reference/assignmentCompatability8.js +++ b/tests/baselines/reference/assignmentCompatability8.js @@ -19,7 +19,7 @@ var __test1__; })(__test1__ || (__test1__ = {})); var __test2__; (function (__test2__) { - var classWithPublic = (function () { + var classWithPublic = /** @class */ (function () { function classWithPublic(one) { this.one = one; } diff --git a/tests/baselines/reference/assignmentCompatability9.js b/tests/baselines/reference/assignmentCompatability9.js index 051155ad1ddc8..04fcec488b6f6 100644 --- a/tests/baselines/reference/assignmentCompatability9.js +++ b/tests/baselines/reference/assignmentCompatability9.js @@ -19,7 +19,7 @@ var __test1__; })(__test1__ || (__test1__ = {})); var __test2__; (function (__test2__) { - var classWithOptional = (function () { + var classWithOptional = /** @class */ (function () { function classWithOptional(one) { this.one = one; } diff --git a/tests/baselines/reference/assignmentLHSIsValue.js b/tests/baselines/reference/assignmentLHSIsValue.js index 34e0df7cacd88..bc129cb2ca2b5 100644 --- a/tests/baselines/reference/assignmentLHSIsValue.js +++ b/tests/baselines/reference/assignmentLHSIsValue.js @@ -84,7 +84,7 @@ var __extends = (this && this.__extends) || (function () { // expected error for all the LHS of assignments var value; // this -var C = (function () { +var C = /** @class */ (function () { function C() { this = value; } @@ -120,7 +120,7 @@ value; // array literals '' = value[0], '' = value[1]; // super -var Derived = (function (_super) { +var Derived = /** @class */ (function (_super) { __extends(Derived, _super); function Derived() { var _this = _super.call(this) || this; diff --git a/tests/baselines/reference/assignmentNonObjectTypeConstraints.js b/tests/baselines/reference/assignmentNonObjectTypeConstraints.js index 7bce8d5443eaf..35d6d7c1ff327 100644 --- a/tests/baselines/reference/assignmentNonObjectTypeConstraints.js +++ b/tests/baselines/reference/assignmentNonObjectTypeConstraints.js @@ -25,12 +25,12 @@ function foo(x) { } foo(5); foo(0 /* A */); -var A = (function () { +var A = /** @class */ (function () { function A() { } return A; }()); -var B = (function () { +var B = /** @class */ (function () { function B() { } return B; diff --git a/tests/baselines/reference/assignmentToParenthesizedIdentifiers.js b/tests/baselines/reference/assignmentToParenthesizedIdentifiers.js index 67d0c25f45ff3..543a54ca10e94 100644 --- a/tests/baselines/reference/assignmentToParenthesizedIdentifiers.js +++ b/tests/baselines/reference/assignmentToParenthesizedIdentifiers.js @@ -126,7 +126,7 @@ var E; })(E || (E = {})); E = undefined; // Error (E) = undefined; // Error -var C = (function () { +var C = /** @class */ (function () { function C() { } return C; diff --git a/tests/baselines/reference/assignmentToReferenceTypes.js b/tests/baselines/reference/assignmentToReferenceTypes.js index e201b0bacabc9..b593240aec35d 100644 --- a/tests/baselines/reference/assignmentToReferenceTypes.js +++ b/tests/baselines/reference/assignmentToReferenceTypes.js @@ -26,7 +26,7 @@ function g(x) { //// [assignmentToReferenceTypes.js] // Should all be allowed M = null; -var C = (function () { +var C = /** @class */ (function () { function C() { } return C; diff --git a/tests/baselines/reference/assignments.js b/tests/baselines/reference/assignments.js index 739c8bd279567..8143490083424 100644 --- a/tests/baselines/reference/assignments.js +++ b/tests/baselines/reference/assignments.js @@ -41,7 +41,7 @@ I = null; // Error // Assign to a parameter // Assign to an interface M = null; // Error -var C = (function () { +var C = /** @class */ (function () { function C() { } return C; diff --git a/tests/baselines/reference/asyncArrowFunctionCapturesArguments_es5.js b/tests/baselines/reference/asyncArrowFunctionCapturesArguments_es5.js index e73ef6ddd4d78..f9937c0dd6336 100644 --- a/tests/baselines/reference/asyncArrowFunctionCapturesArguments_es5.js +++ b/tests/baselines/reference/asyncArrowFunctionCapturesArguments_es5.js @@ -8,7 +8,7 @@ class C { //// [asyncArrowFunctionCapturesArguments_es5.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } C.prototype.method = function () { diff --git a/tests/baselines/reference/asyncArrowFunctionCapturesThis_es5.js b/tests/baselines/reference/asyncArrowFunctionCapturesThis_es5.js index 5c9727bddabeb..e475cbb1e3aaa 100644 --- a/tests/baselines/reference/asyncArrowFunctionCapturesThis_es5.js +++ b/tests/baselines/reference/asyncArrowFunctionCapturesThis_es5.js @@ -7,7 +7,7 @@ class C { //// [asyncArrowFunctionCapturesThis_es5.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } C.prototype.method = function () { diff --git a/tests/baselines/reference/asyncAwaitIsolatedModules_es5.js b/tests/baselines/reference/asyncAwaitIsolatedModules_es5.js index 335bd8a340ec9..2c4f827be5389 100644 --- a/tests/baselines/reference/asyncAwaitIsolatedModules_es5.js +++ b/tests/baselines/reference/asyncAwaitIsolatedModules_es5.js @@ -147,7 +147,7 @@ var o = { }); }); } }; -var C = (function () { +var C = /** @class */ (function () { function C() { } C.prototype.m1 = function () { diff --git a/tests/baselines/reference/asyncAwait_es5.js b/tests/baselines/reference/asyncAwait_es5.js index f49f4472b133d..653082be8d668 100644 --- a/tests/baselines/reference/asyncAwait_es5.js +++ b/tests/baselines/reference/asyncAwait_es5.js @@ -144,7 +144,7 @@ var o = { }); }); } }; -var C = (function () { +var C = /** @class */ (function () { function C() { } C.prototype.m1 = function () { diff --git a/tests/baselines/reference/asyncClass_es5.js b/tests/baselines/reference/asyncClass_es5.js index a552349118aee..9989e0ef3d7eb 100644 --- a/tests/baselines/reference/asyncClass_es5.js +++ b/tests/baselines/reference/asyncClass_es5.js @@ -3,7 +3,7 @@ async class C { } //// [asyncClass_es5.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } return C; diff --git a/tests/baselines/reference/asyncConstructor_es5.js b/tests/baselines/reference/asyncConstructor_es5.js index 95470ccf9b0dc..df48dbd634889 100644 --- a/tests/baselines/reference/asyncConstructor_es5.js +++ b/tests/baselines/reference/asyncConstructor_es5.js @@ -5,7 +5,7 @@ class C { } //// [asyncConstructor_es5.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } return C; diff --git a/tests/baselines/reference/asyncFunctionDeclarationCapturesArguments_es5.js b/tests/baselines/reference/asyncFunctionDeclarationCapturesArguments_es5.js index 8881ad555a762..aa642819add4c 100644 --- a/tests/baselines/reference/asyncFunctionDeclarationCapturesArguments_es5.js +++ b/tests/baselines/reference/asyncFunctionDeclarationCapturesArguments_es5.js @@ -10,7 +10,7 @@ class C { //// [asyncFunctionDeclarationCapturesArguments_es5.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } C.prototype.method = function () { diff --git a/tests/baselines/reference/asyncGetter_es5.js b/tests/baselines/reference/asyncGetter_es5.js index a9c7f6355d313..3e5faa41f35da 100644 --- a/tests/baselines/reference/asyncGetter_es5.js +++ b/tests/baselines/reference/asyncGetter_es5.js @@ -5,7 +5,7 @@ class C { } //// [asyncGetter_es5.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } Object.defineProperty(C.prototype, "foo", { diff --git a/tests/baselines/reference/asyncImportedPromise_es5.js b/tests/baselines/reference/asyncImportedPromise_es5.js index 8a6ec4240caf0..ea9cf265a8a28 100644 --- a/tests/baselines/reference/asyncImportedPromise_es5.js +++ b/tests/baselines/reference/asyncImportedPromise_es5.js @@ -22,7 +22,7 @@ var __extends = (this && this.__extends) || (function () { }; })(); Object.defineProperty(exports, "__esModule", { value: true }); -var Task = (function (_super) { +var Task = /** @class */ (function (_super) { __extends(Task, _super); function Task() { return _super !== null && _super.apply(this, arguments) || this; @@ -69,7 +69,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) { }; Object.defineProperty(exports, "__esModule", { value: true }); var task_1 = require("./task"); -var Test = (function () { +var Test = /** @class */ (function () { function Test() { } Test.prototype.example = function () { diff --git a/tests/baselines/reference/asyncMethodWithSuper_es5.js b/tests/baselines/reference/asyncMethodWithSuper_es5.js index c68b1ed036fef..a2931b9f8e15d 100644 --- a/tests/baselines/reference/asyncMethodWithSuper_es5.js +++ b/tests/baselines/reference/asyncMethodWithSuper_es5.js @@ -51,14 +51,14 @@ class B extends A { } //// [asyncMethodWithSuper_es5.js] -var A = (function () { +var A = /** @class */ (function () { function A() { } A.prototype.x = function () { }; return A; }()); -var B = (function (_super) { +var B = /** @class */ (function (_super) { __extends(B, _super); function B() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/asyncQualifiedReturnType_es5.js b/tests/baselines/reference/asyncQualifiedReturnType_es5.js index 3cae9ea6b5610..601dc8b3c476e 100644 --- a/tests/baselines/reference/asyncQualifiedReturnType_es5.js +++ b/tests/baselines/reference/asyncQualifiedReturnType_es5.js @@ -10,7 +10,7 @@ async function f(): X.MyPromise { //// [asyncQualifiedReturnType_es5.js] var X; (function (X) { - var MyPromise = (function (_super) { + var MyPromise = /** @class */ (function (_super) { __extends(MyPromise, _super); function MyPromise() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/asyncSetter_es5.js b/tests/baselines/reference/asyncSetter_es5.js index a260ae67bd1b4..c1f1295ae97c6 100644 --- a/tests/baselines/reference/asyncSetter_es5.js +++ b/tests/baselines/reference/asyncSetter_es5.js @@ -5,7 +5,7 @@ class C { } //// [asyncSetter_es5.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } Object.defineProperty(C.prototype, "foo", { diff --git a/tests/baselines/reference/augmentExportEquals4.js b/tests/baselines/reference/augmentExportEquals4.js index 3ca522bbc0865..be6c6859ba76e 100644 --- a/tests/baselines/reference/augmentExportEquals4.js +++ b/tests/baselines/reference/augmentExportEquals4.js @@ -26,7 +26,7 @@ let b = x.b; //// [file1.js] define(["require", "exports"], function (require, exports) { "use strict"; - var foo = (function () { + var foo = /** @class */ (function () { function foo() { } return foo; diff --git a/tests/baselines/reference/augmentExportEquals6.js b/tests/baselines/reference/augmentExportEquals6.js index 1f6904a4664c6..99c6c1602bd76 100644 --- a/tests/baselines/reference/augmentExportEquals6.js +++ b/tests/baselines/reference/augmentExportEquals6.js @@ -30,13 +30,13 @@ let c = x.B.b; //// [file1.js] define(["require", "exports"], function (require, exports) { "use strict"; - var foo = (function () { + var foo = /** @class */ (function () { function foo() { } return foo; }()); (function (foo) { - var A = (function () { + var A = /** @class */ (function () { function A() { } return A; diff --git a/tests/baselines/reference/augmentedTypesClass.js b/tests/baselines/reference/augmentedTypesClass.js index b9c263971b3c1..01c39c98a1a49 100644 --- a/tests/baselines/reference/augmentedTypesClass.js +++ b/tests/baselines/reference/augmentedTypesClass.js @@ -9,7 +9,7 @@ enum c4 { One } // error //// [augmentedTypesClass.js] //// class then var -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } c1.prototype.foo = function () { }; @@ -17,7 +17,7 @@ var c1 = (function () { }()); var c1 = 1; // error //// class then enum -var c4 = (function () { +var c4 = /** @class */ (function () { function c4() { } c4.prototype.foo = function () { }; diff --git a/tests/baselines/reference/augmentedTypesClass2.js b/tests/baselines/reference/augmentedTypesClass2.js index 0896a03a92558..a289446e53fdb 100644 --- a/tests/baselines/reference/augmentedTypesClass2.js +++ b/tests/baselines/reference/augmentedTypesClass2.js @@ -33,7 +33,7 @@ class c44 { //// [augmentedTypesClass2.js] // Checking class with other things in type space not value space // class then interface -var c11 = (function () { +var c11 = /** @class */ (function () { function c11() { } c11.prototype.foo = function () { @@ -43,7 +43,7 @@ var c11 = (function () { }()); // class then class - covered // class then enum -var c33 = (function () { +var c33 = /** @class */ (function () { function c33() { } c33.prototype.foo = function () { @@ -56,7 +56,7 @@ var c33 = (function () { })(c33 || (c33 = {})); ; // class then import -var c44 = (function () { +var c44 = /** @class */ (function () { function c44() { } c44.prototype.foo = function () { diff --git a/tests/baselines/reference/augmentedTypesClass2a.js b/tests/baselines/reference/augmentedTypesClass2a.js index ba1f26c775d0a..cbda0bb256536 100644 --- a/tests/baselines/reference/augmentedTypesClass2a.js +++ b/tests/baselines/reference/augmentedTypesClass2a.js @@ -6,7 +6,7 @@ var c2 = () => { } //// [augmentedTypesClass2a.js] //// class then function -var c2 = (function () { +var c2 = /** @class */ (function () { function c2() { } c2.prototype.foo = function () { }; diff --git a/tests/baselines/reference/augmentedTypesClass3.js b/tests/baselines/reference/augmentedTypesClass3.js index 3a4877707c680..d2ad63161b541 100644 --- a/tests/baselines/reference/augmentedTypesClass3.js +++ b/tests/baselines/reference/augmentedTypesClass3.js @@ -15,13 +15,13 @@ class c5c { public foo() { } } //// [augmentedTypesClass3.js] // class then module -var c5 = (function () { +var c5 = /** @class */ (function () { function c5() { } c5.prototype.foo = function () { }; return c5; }()); -var c5a = (function () { +var c5a = /** @class */ (function () { function c5a() { } c5a.prototype.foo = function () { }; @@ -30,7 +30,7 @@ var c5a = (function () { (function (c5a) { var y = 2; })(c5a || (c5a = {})); // should be ok -var c5b = (function () { +var c5b = /** @class */ (function () { function c5b() { } c5b.prototype.foo = function () { }; @@ -40,7 +40,7 @@ var c5b = (function () { c5b.y = 2; })(c5b || (c5b = {})); // should be ok //// class then import -var c5c = (function () { +var c5c = /** @class */ (function () { function c5c() { } c5c.prototype.foo = function () { }; diff --git a/tests/baselines/reference/augmentedTypesClass4.js b/tests/baselines/reference/augmentedTypesClass4.js index e476beadf74d8..086748bad61c0 100644 --- a/tests/baselines/reference/augmentedTypesClass4.js +++ b/tests/baselines/reference/augmentedTypesClass4.js @@ -6,13 +6,13 @@ class c3 { public bar() { } } // error //// [augmentedTypesClass4.js] //// class then class -var c3 = (function () { +var c3 = /** @class */ (function () { function c3() { } c3.prototype.foo = function () { }; return c3; }()); // error -var c3 = (function () { +var c3 = /** @class */ (function () { function c3() { } c3.prototype.bar = function () { }; diff --git a/tests/baselines/reference/augmentedTypesEnum.js b/tests/baselines/reference/augmentedTypesEnum.js index 406c1a3bf6936..ff0ad93f8172f 100644 --- a/tests/baselines/reference/augmentedTypesEnum.js +++ b/tests/baselines/reference/augmentedTypesEnum.js @@ -58,7 +58,7 @@ var e4; (function (e4) { e4[e4["One"] = 0] = "One"; })(e4 || (e4 = {})); // error -var e4 = (function () { +var e4 = /** @class */ (function () { function e4() { } e4.prototype.foo = function () { }; diff --git a/tests/baselines/reference/augmentedTypesEnum2.js b/tests/baselines/reference/augmentedTypesEnum2.js index be174423d1da3..66fc96b62a044 100644 --- a/tests/baselines/reference/augmentedTypesEnum2.js +++ b/tests/baselines/reference/augmentedTypesEnum2.js @@ -32,7 +32,7 @@ var e2; e2[e2["One"] = 0] = "One"; })(e2 || (e2 = {})); ; // error -var e2 = (function () { +var e2 = /** @class */ (function () { function e2() { } e2.prototype.foo = function () { diff --git a/tests/baselines/reference/augmentedTypesExternalModule1.js b/tests/baselines/reference/augmentedTypesExternalModule1.js index 0a8b7404bd1c5..5a6a28d9989cb 100644 --- a/tests/baselines/reference/augmentedTypesExternalModule1.js +++ b/tests/baselines/reference/augmentedTypesExternalModule1.js @@ -8,7 +8,7 @@ define(["require", "exports"], function (require, exports) { "use strict"; exports.__esModule = true; exports.a = 1; - var c5 = (function () { + var c5 = /** @class */ (function () { function c5() { } c5.prototype.foo = function () { }; diff --git a/tests/baselines/reference/augmentedTypesFunction.js b/tests/baselines/reference/augmentedTypesFunction.js index 95f91a938d73e..3c6066e5bb41e 100644 --- a/tests/baselines/reference/augmentedTypesFunction.js +++ b/tests/baselines/reference/augmentedTypesFunction.js @@ -49,13 +49,13 @@ function y2a() { } // error var y2a = function () { }; // error // function then class function y3() { } // error -var y3 = (function () { +var y3 = /** @class */ (function () { function y3() { } return y3; }()); // error function y3a() { } // error -var y3a = (function () { +var y3a = /** @class */ (function () { function y3a() { } y3a.prototype.foo = function () { }; diff --git a/tests/baselines/reference/augmentedTypesInterface.js b/tests/baselines/reference/augmentedTypesInterface.js index fb8608aca956a..b74da5bbfee1f 100644 --- a/tests/baselines/reference/augmentedTypesInterface.js +++ b/tests/baselines/reference/augmentedTypesInterface.js @@ -35,7 +35,7 @@ interface i4 { //// [augmentedTypesInterface.js] // interface then interface -var i2 = (function () { +var i2 = /** @class */ (function () { function i2() { } i2.prototype.bar = function () { diff --git a/tests/baselines/reference/augmentedTypesModules.js b/tests/baselines/reference/augmentedTypesModules.js index 61dd64174d9bf..c0bb1747e6dc6 100644 --- a/tests/baselines/reference/augmentedTypesModules.js +++ b/tests/baselines/reference/augmentedTypesModules.js @@ -112,7 +112,7 @@ var m1b = 1; // error var m1c = 1; // Should be allowed var m1d; (function (m1d) { - var I = (function () { + var I = /** @class */ (function () { function I() { } I.prototype.foo = function () { }; @@ -146,7 +146,7 @@ function m2f() { } function m2g() { } ; (function (m2g) { - var C = (function () { + var C = /** @class */ (function () { function C() { } C.prototype.foo = function () { }; @@ -154,7 +154,7 @@ function m2g() { } }()); m2g.C = C; })(m2g || (m2g = {})); -var m3 = (function () { +var m3 = /** @class */ (function () { function m3() { } return m3; @@ -163,13 +163,13 @@ var m3a; (function (m3a) { var y = 2; })(m3a || (m3a = {})); -var m3a = (function () { +var m3a = /** @class */ (function () { function m3a() { } m3a.prototype.foo = function () { }; return m3a; }()); // error, class isn't ambient or declared before the module -var m3b = (function () { +var m3b = /** @class */ (function () { function m3b() { } m3b.prototype.foo = function () { }; @@ -178,7 +178,7 @@ var m3b = (function () { (function (m3b) { var y = 2; })(m3b || (m3b = {})); -var m3c = (function () { +var m3c = /** @class */ (function () { function m3c() { } m3c.prototype.foo = function () { }; @@ -197,7 +197,7 @@ var m3e; })(m3e || (m3e = {})); var m3g; (function (m3g) { - var C = (function () { + var C = /** @class */ (function () { function C() { } C.prototype.foo = function () { }; @@ -228,7 +228,7 @@ var m4c; })(m4c || (m4c = {})); var m4d; (function (m4d) { - var C = (function () { + var C = /** @class */ (function () { function C() { } C.prototype.foo = function () { }; diff --git a/tests/baselines/reference/augmentedTypesModules2.js b/tests/baselines/reference/augmentedTypesModules2.js index 9f7d3613d57c3..995a85f39600d 100644 --- a/tests/baselines/reference/augmentedTypesModules2.js +++ b/tests/baselines/reference/augmentedTypesModules2.js @@ -59,7 +59,7 @@ function m2f() { } function m2g() { } ; (function (m2g) { - var C = (function () { + var C = /** @class */ (function () { function C() { } C.prototype.foo = function () { }; diff --git a/tests/baselines/reference/augmentedTypesModules3.js b/tests/baselines/reference/augmentedTypesModules3.js index cb63acd0d3532..0537bd092b012 100644 --- a/tests/baselines/reference/augmentedTypesModules3.js +++ b/tests/baselines/reference/augmentedTypesModules3.js @@ -7,7 +7,7 @@ module m3a { var y = 2; } class m3a { foo() { } } // error, class isn't ambient or declared before the module //// [augmentedTypesModules3.js] -var m3 = (function () { +var m3 = /** @class */ (function () { function m3() { } return m3; @@ -16,7 +16,7 @@ var m3a; (function (m3a) { var y = 2; })(m3a || (m3a = {})); -var m3a = (function () { +var m3a = /** @class */ (function () { function m3a() { } m3a.prototype.foo = function () { }; diff --git a/tests/baselines/reference/augmentedTypesModules3b.js b/tests/baselines/reference/augmentedTypesModules3b.js index 02da7b41f2e0f..57957c13b8082 100644 --- a/tests/baselines/reference/augmentedTypesModules3b.js +++ b/tests/baselines/reference/augmentedTypesModules3b.js @@ -19,7 +19,7 @@ module m3g { export class C { foo() { } } } //// [augmentedTypesModules3b.js] -var m3b = (function () { +var m3b = /** @class */ (function () { function m3b() { } m3b.prototype.foo = function () { }; @@ -28,7 +28,7 @@ var m3b = (function () { (function (m3b) { var y = 2; })(m3b || (m3b = {})); -var m3c = (function () { +var m3c = /** @class */ (function () { function m3c() { } m3c.prototype.foo = function () { }; @@ -47,7 +47,7 @@ var m3e; })(m3e || (m3e = {})); var m3g; (function (m3g) { - var C = (function () { + var C = /** @class */ (function () { function C() { } C.prototype.foo = function () { }; diff --git a/tests/baselines/reference/augmentedTypesModules4.js b/tests/baselines/reference/augmentedTypesModules4.js index 5db6c42d70746..b7a776ca16435 100644 --- a/tests/baselines/reference/augmentedTypesModules4.js +++ b/tests/baselines/reference/augmentedTypesModules4.js @@ -46,7 +46,7 @@ var m4c; })(m4c || (m4c = {})); var m4d; (function (m4d) { - var C = (function () { + var C = /** @class */ (function () { function C() { } C.prototype.foo = function () { }; diff --git a/tests/baselines/reference/augmentedTypesVar.js b/tests/baselines/reference/augmentedTypesVar.js index f01cfa2e52fa5..9945737410d3a 100644 --- a/tests/baselines/reference/augmentedTypesVar.js +++ b/tests/baselines/reference/augmentedTypesVar.js @@ -47,13 +47,13 @@ var x3 = 1; var x3 = function () { }; // error // var then class var x4 = 1; // error -var x4 = (function () { +var x4 = /** @class */ (function () { function x4() { } return x4; }()); // error var x4a = 1; // error -var x4a = (function () { +var x4a = /** @class */ (function () { function x4a() { } x4a.prototype.foo = function () { }; diff --git a/tests/baselines/reference/autoAsiForStaticsInClassDeclaration.js b/tests/baselines/reference/autoAsiForStaticsInClassDeclaration.js index 5c64b8fc23f48..549a4ddccb8d7 100644 --- a/tests/baselines/reference/autoAsiForStaticsInClassDeclaration.js +++ b/tests/baselines/reference/autoAsiForStaticsInClassDeclaration.js @@ -5,7 +5,7 @@ class C { } //// [autoAsiForStaticsInClassDeclaration.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } return C; diff --git a/tests/baselines/reference/autoLift2.js b/tests/baselines/reference/autoLift2.js index ab2d2107f6ce7..002e320e85377 100644 --- a/tests/baselines/reference/autoLift2.js +++ b/tests/baselines/reference/autoLift2.js @@ -32,7 +32,7 @@ a.baz(); //// [autoLift2.js] -var A = (function () { +var A = /** @class */ (function () { function A() { this.foo; any; diff --git a/tests/baselines/reference/autolift3.js b/tests/baselines/reference/autolift3.js index 21be70763fe22..b7355aaef0e77 100644 --- a/tests/baselines/reference/autolift3.js +++ b/tests/baselines/reference/autolift3.js @@ -31,7 +31,7 @@ b.foo(); //// [autolift3.js] -var B = (function () { +var B = /** @class */ (function () { function B() { function foo() { } foo(); diff --git a/tests/baselines/reference/autolift4.js b/tests/baselines/reference/autolift4.js index d784798358e33..2e5b3b258c69a 100644 --- a/tests/baselines/reference/autolift4.js +++ b/tests/baselines/reference/autolift4.js @@ -34,7 +34,7 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var Point = (function () { +var Point = /** @class */ (function () { function Point(x, y) { this.x = x; this.y = y; @@ -45,7 +45,7 @@ var Point = (function () { Point.origin = new Point(0, 0); return Point; }()); -var Point3D = (function (_super) { +var Point3D = /** @class */ (function (_super) { __extends(Point3D, _super); function Point3D(x, y, z, m) { var _this = _super.call(this, x, y) || this; diff --git a/tests/baselines/reference/avoid.js b/tests/baselines/reference/avoid.js index 391dab5e9856b..5882fe6c3cc24 100644 --- a/tests/baselines/reference/avoid.js +++ b/tests/baselines/reference/avoid.js @@ -27,7 +27,7 @@ var y = f(); // error void fn var why = f(); // error void fn var w; w = f(); // error void fn -var C = (function () { +var C = /** @class */ (function () { function C() { } C.prototype.g = function () { diff --git a/tests/baselines/reference/awaitClassExpression_es5.js b/tests/baselines/reference/awaitClassExpression_es5.js index 1ef7338fb1287..ecd98628c15b0 100644 --- a/tests/baselines/reference/awaitClassExpression_es5.js +++ b/tests/baselines/reference/awaitClassExpression_es5.js @@ -23,7 +23,7 @@ function func() { }; return [4 /*yield*/, p]; case 1: - D = (_a.apply(void 0, [(_b.sent())])); + D = /** @class */ (_a.apply(void 0, [(_b.sent())])); return [2 /*return*/]; } }); diff --git a/tests/baselines/reference/badArraySyntax.js b/tests/baselines/reference/badArraySyntax.js index 8cc5f1cfedaef..d9888e7a61be0 100644 --- a/tests/baselines/reference/badArraySyntax.js +++ b/tests/baselines/reference/badArraySyntax.js @@ -12,7 +12,7 @@ var a6: Z[][] = new Z [ ] [ ]; //// [badArraySyntax.js] -var Z = (function () { +var Z = /** @class */ (function () { function Z() { this.x = ""; } diff --git a/tests/baselines/reference/badThisBinding.js b/tests/baselines/reference/badThisBinding.js index 06465711859eb..d4ffc6731d148 100644 --- a/tests/baselines/reference/badThisBinding.js +++ b/tests/baselines/reference/badThisBinding.js @@ -14,7 +14,7 @@ class Greeter { } //// [badThisBinding.js] -var Greeter = (function () { +var Greeter = /** @class */ (function () { function Greeter() { var _this = this; foo(function () { diff --git a/tests/baselines/reference/baseCheck.js b/tests/baselines/reference/baseCheck.js index 2b4f90d27b127..463a29e1fbee2 100644 --- a/tests/baselines/reference/baseCheck.js +++ b/tests/baselines/reference/baseCheck.js @@ -40,19 +40,19 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var C = (function () { +var C = /** @class */ (function () { function C(x, y) { } return C; }()); -var ELoc = (function (_super) { +var ELoc = /** @class */ (function (_super) { __extends(ELoc, _super); function ELoc(x) { return _super.call(this, 0, x) || this; } return ELoc; }(C)); -var ELocVar = (function (_super) { +var ELocVar = /** @class */ (function (_super) { __extends(ELocVar, _super); function ELocVar(x) { return _super.call(this, 0, loc) || this; @@ -62,7 +62,7 @@ var ELocVar = (function (_super) { }; return ELocVar; }(C)); -var D = (function (_super) { +var D = /** @class */ (function (_super) { __extends(D, _super); function D(z) { var _this = _super.call(this, _this.z) || this; @@ -71,7 +71,7 @@ var D = (function (_super) { } return D; }(C)); // too few params -var E = (function (_super) { +var E = /** @class */ (function (_super) { __extends(E, _super); function E(z) { var _this = _super.call(this, 0, _this.z) || this; @@ -80,7 +80,7 @@ var E = (function (_super) { } return E; }(C)); -var F = (function (_super) { +var F = /** @class */ (function (_super) { __extends(F, _super); function F(z) { var _this = _super.call(this, "hello", _this.z) || this; diff --git a/tests/baselines/reference/baseConstraintOfDecorator.js b/tests/baselines/reference/baseConstraintOfDecorator.js index 0bceaca2509a5..dc6ebd7397e07 100644 --- a/tests/baselines/reference/baseConstraintOfDecorator.js +++ b/tests/baselines/reference/baseConstraintOfDecorator.js @@ -23,7 +23,7 @@ var __extends = (this && this.__extends) || (function () { })(); exports.__esModule = true; function classExtender(superClass, _instanceModifier) { - return (function (_super) { + return /** @class */ (function (_super) { __extends(decoratorFunc, _super); function decoratorFunc() { var args = []; diff --git a/tests/baselines/reference/baseIndexSignatureResolution.js b/tests/baselines/reference/baseIndexSignatureResolution.js index e57e5272aded3..4053e588e446e 100644 --- a/tests/baselines/reference/baseIndexSignatureResolution.js +++ b/tests/baselines/reference/baseIndexSignatureResolution.js @@ -35,12 +35,12 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var Base = (function () { +var Base = /** @class */ (function () { function Base() { } return Base; }()); -var Derived = (function (_super) { +var Derived = /** @class */ (function (_super) { __extends(Derived, _super); function Derived() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/baseTypeAfterDerivedType.js b/tests/baselines/reference/baseTypeAfterDerivedType.js index c4ca7cf7b33a5..c7cd84283c32e 100644 --- a/tests/baselines/reference/baseTypeAfterDerivedType.js +++ b/tests/baselines/reference/baseTypeAfterDerivedType.js @@ -17,7 +17,7 @@ interface Base2 { //// [baseTypeAfterDerivedType.js] -var Derived2 = (function () { +var Derived2 = /** @class */ (function () { function Derived2() { } Derived2.prototype.method = function () { diff --git a/tests/baselines/reference/baseTypeOrderChecking.js b/tests/baselines/reference/baseTypeOrderChecking.js index 06e7dd0c681a0..1dd92d473c1c4 100644 --- a/tests/baselines/reference/baseTypeOrderChecking.js +++ b/tests/baselines/reference/baseTypeOrderChecking.js @@ -48,24 +48,24 @@ var __extends = (this && this.__extends) || (function () { }; })(); var someVariable; -var Class1 = (function () { +var Class1 = /** @class */ (function () { function Class1() { } return Class1; }()); -var Class2 = (function (_super) { +var Class2 = /** @class */ (function (_super) { __extends(Class2, _super); function Class2() { return _super !== null && _super.apply(this, arguments) || this; } return Class2; }(Class1)); -var Class3 = (function () { +var Class3 = /** @class */ (function () { function Class3() { } return Class3; }()); -var Class4 = (function (_super) { +var Class4 = /** @class */ (function (_super) { __extends(Class4, _super); function Class4() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/baseTypePrivateMemberClash.js b/tests/baselines/reference/baseTypePrivateMemberClash.js index 35eafe5543a93..b40d1f8be176a 100644 --- a/tests/baselines/reference/baseTypePrivateMemberClash.js +++ b/tests/baselines/reference/baseTypePrivateMemberClash.js @@ -9,12 +9,12 @@ class Y { interface Z extends X, Y { } //// [baseTypePrivateMemberClash.js] -var X = (function () { +var X = /** @class */ (function () { function X() { } return X; }()); -var Y = (function () { +var Y = /** @class */ (function () { function Y() { } return Y; diff --git a/tests/baselines/reference/baseTypeWrappingInstantiationChain.js b/tests/baselines/reference/baseTypeWrappingInstantiationChain.js index 7442d1e0e6a50..86be6bcf5c17b 100644 --- a/tests/baselines/reference/baseTypeWrappingInstantiationChain.js +++ b/tests/baselines/reference/baseTypeWrappingInstantiationChain.js @@ -38,30 +38,30 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var CBaseBase = (function () { +var CBaseBase = /** @class */ (function () { function CBaseBase(x) { } return CBaseBase; }()); -var CBase = (function (_super) { +var CBase = /** @class */ (function (_super) { __extends(CBase, _super); function CBase() { return _super !== null && _super.apply(this, arguments) || this; } return CBase; }(CBaseBase)); -var Parameter = (function () { +var Parameter = /** @class */ (function () { function Parameter() { } Parameter.prototype.method = function (t) { }; return Parameter; }()); -var Wrapper = (function () { +var Wrapper = /** @class */ (function () { function Wrapper() { } return Wrapper; }()); -var C = (function (_super) { +var C = /** @class */ (function (_super) { __extends(C, _super); function C() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/bases.js b/tests/baselines/reference/bases.js index 529eacfad0415..cd1f7ba94a807 100644 --- a/tests/baselines/reference/bases.js +++ b/tests/baselines/reference/bases.js @@ -31,14 +31,14 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var B = (function () { +var B = /** @class */ (function () { function B() { this.y; any; } return B; }()); -var C = (function (_super) { +var C = /** @class */ (function (_super) { __extends(C, _super); function C() { var _this = this; diff --git a/tests/baselines/reference/bestCommonTypeOfConditionalExpressions.js b/tests/baselines/reference/bestCommonTypeOfConditionalExpressions.js index efd55a9ca1856..128c9f6d43015 100644 --- a/tests/baselines/reference/bestCommonTypeOfConditionalExpressions.js +++ b/tests/baselines/reference/bestCommonTypeOfConditionalExpressions.js @@ -41,19 +41,19 @@ var __extends = (this && this.__extends) || (function () { })(); var a; var b; -var Base = (function () { +var Base = /** @class */ (function () { function Base() { } return Base; }()); -var Derived = (function (_super) { +var Derived = /** @class */ (function (_super) { __extends(Derived, _super); function Derived() { return _super !== null && _super.apply(this, arguments) || this; } return Derived; }(Base)); -var Derived2 = (function (_super) { +var Derived2 = /** @class */ (function (_super) { __extends(Derived2, _super); function Derived2() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/bestCommonTypeOfConditionalExpressions2.js b/tests/baselines/reference/bestCommonTypeOfConditionalExpressions2.js index b68b5c3d97c76..1a8d0d501141b 100644 --- a/tests/baselines/reference/bestCommonTypeOfConditionalExpressions2.js +++ b/tests/baselines/reference/bestCommonTypeOfConditionalExpressions2.js @@ -37,19 +37,19 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var Base = (function () { +var Base = /** @class */ (function () { function Base() { } return Base; }()); -var Derived = (function (_super) { +var Derived = /** @class */ (function (_super) { __extends(Derived, _super); function Derived() { return _super !== null && _super.apply(this, arguments) || this; } return Derived; }(Base)); -var Derived2 = (function (_super) { +var Derived2 = /** @class */ (function (_super) { __extends(Derived2, _super); function Derived2() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/bestCommonTypeOfTuple2.js b/tests/baselines/reference/bestCommonTypeOfTuple2.js index 39712f873bc61..a9eeb1eaaa1bc 100644 --- a/tests/baselines/reference/bestCommonTypeOfTuple2.js +++ b/tests/baselines/reference/bestCommonTypeOfTuple2.js @@ -33,35 +33,35 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var C = (function () { +var C = /** @class */ (function () { function C() { } return C; }()); -var D = (function () { +var D = /** @class */ (function () { function D() { } return D; }()); -var E = (function () { +var E = /** @class */ (function () { function E() { } return E; }()); -var F = (function (_super) { +var F = /** @class */ (function (_super) { __extends(F, _super); function F() { return _super !== null && _super.apply(this, arguments) || this; } return F; }(C)); -var C1 = (function () { +var C1 = /** @class */ (function () { function C1() { this.i = "foo"; } return C1; }()); -var D1 = (function (_super) { +var D1 = /** @class */ (function (_super) { __extends(D1, _super); function D1() { var _this = _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/bind1.js b/tests/baselines/reference/bind1.js index 93eafedf81b35..de83d56ab8ef8 100644 --- a/tests/baselines/reference/bind1.js +++ b/tests/baselines/reference/bind1.js @@ -8,7 +8,7 @@ module M { //// [bind1.js] var M; (function (M) { - var C = (function () { + var C = /** @class */ (function () { function C() { } return C; diff --git a/tests/baselines/reference/binopAssignmentShouldHaveType.js b/tests/baselines/reference/binopAssignmentShouldHaveType.js index c590efbcb5a58..c5a0357c7eed1 100644 --- a/tests/baselines/reference/binopAssignmentShouldHaveType.js +++ b/tests/baselines/reference/binopAssignmentShouldHaveType.js @@ -23,7 +23,7 @@ module Test { "use strict"; var Test; (function (Test) { - var Bug = (function () { + var Bug = /** @class */ (function () { function Bug() { } Bug.prototype.getName = function () { diff --git a/tests/baselines/reference/bitwiseNotOperatorWithAnyOtherType.js b/tests/baselines/reference/bitwiseNotOperatorWithAnyOtherType.js index 0236bd736ee94..8827aa2d57fa1 100644 --- a/tests/baselines/reference/bitwiseNotOperatorWithAnyOtherType.js +++ b/tests/baselines/reference/bitwiseNotOperatorWithAnyOtherType.js @@ -73,7 +73,7 @@ function foo() { var a; return a; } -var A = (function () { +var A = /** @class */ (function () { function A() { } A.foo = function () { diff --git a/tests/baselines/reference/bitwiseNotOperatorWithBooleanType.js b/tests/baselines/reference/bitwiseNotOperatorWithBooleanType.js index b35a5e4ba1226..00766ee43033d 100644 --- a/tests/baselines/reference/bitwiseNotOperatorWithBooleanType.js +++ b/tests/baselines/reference/bitwiseNotOperatorWithBooleanType.js @@ -42,7 +42,7 @@ var ResultIsNumber8 = ~~BOOLEAN; // ~ operator on boolean type var BOOLEAN; function foo() { return true; } -var A = (function () { +var A = /** @class */ (function () { function A() { } A.foo = function () { return false; }; diff --git a/tests/baselines/reference/bitwiseNotOperatorWithNumberType.js b/tests/baselines/reference/bitwiseNotOperatorWithNumberType.js index aab04be6dfc90..d446532caf88c 100644 --- a/tests/baselines/reference/bitwiseNotOperatorWithNumberType.js +++ b/tests/baselines/reference/bitwiseNotOperatorWithNumberType.js @@ -49,7 +49,7 @@ var ResultIsNumber13 = ~~~(NUMBER + NUMBER); var NUMBER; var NUMBER1 = [1, 2]; function foo() { return 1; } -var A = (function () { +var A = /** @class */ (function () { function A() { } A.foo = function () { return 1; }; diff --git a/tests/baselines/reference/bitwiseNotOperatorWithStringType.js b/tests/baselines/reference/bitwiseNotOperatorWithStringType.js index 366af5ecea8dd..481e75e3378a2 100644 --- a/tests/baselines/reference/bitwiseNotOperatorWithStringType.js +++ b/tests/baselines/reference/bitwiseNotOperatorWithStringType.js @@ -48,7 +48,7 @@ var ResultIsNumber14 = ~~~(STRING + STRING); var STRING; var STRING1 = ["", "abc"]; function foo() { return "abc"; } -var A = (function () { +var A = /** @class */ (function () { function A() { } A.foo = function () { return ""; }; diff --git a/tests/baselines/reference/blockScopedClassDeclarationAcrossFiles.js b/tests/baselines/reference/blockScopedClassDeclarationAcrossFiles.js index b89943b24ff4e..6559548ddff28 100644 --- a/tests/baselines/reference/blockScopedClassDeclarationAcrossFiles.js +++ b/tests/baselines/reference/blockScopedClassDeclarationAcrossFiles.js @@ -8,7 +8,7 @@ class C { } //// [foo.js] var foo; -var C = (function () { +var C = /** @class */ (function () { function C() { } return C; diff --git a/tests/baselines/reference/blockScopedFunctionDeclarationInStrictClass.js b/tests/baselines/reference/blockScopedFunctionDeclarationInStrictClass.js index 70a00a95a4111..e3a46770fd0e8 100644 --- a/tests/baselines/reference/blockScopedFunctionDeclarationInStrictClass.js +++ b/tests/baselines/reference/blockScopedFunctionDeclarationInStrictClass.js @@ -10,7 +10,7 @@ class c { } //// [blockScopedFunctionDeclarationInStrictClass.js] -var c = (function () { +var c = /** @class */ (function () { function c() { } c.prototype.method = function () { diff --git a/tests/baselines/reference/blockScopedNamespaceDifferentFile.js b/tests/baselines/reference/blockScopedNamespaceDifferentFile.js index 82d72e466e10c..1ddb284f55cc0 100644 --- a/tests/baselines/reference/blockScopedNamespaceDifferentFile.js +++ b/tests/baselines/reference/blockScopedNamespaceDifferentFile.js @@ -24,7 +24,7 @@ declare namespace A { // #15734 failed when test.ts comes before typings.d.ts var C; (function (C) { - var Name = (function () { + var Name = /** @class */ (function () { function Name(parameters) { } Name.funcData = A.AA.func(); diff --git a/tests/baselines/reference/blockScopedVariablesUseBeforeDef.js b/tests/baselines/reference/blockScopedVariablesUseBeforeDef.js index 619ee51ce75fc..b0e58c59f5f26 100644 --- a/tests/baselines/reference/blockScopedVariablesUseBeforeDef.js +++ b/tests/baselines/reference/blockScopedVariablesUseBeforeDef.js @@ -117,7 +117,7 @@ function foo2() { var x; } function foo3() { - var X = (function () { + var X = /** @class */ (function () { function X() { } X.prototype.m = function () { return x; }; @@ -126,7 +126,7 @@ function foo3() { var x; } function foo4() { - var y = (function () { + var y = /** @class */ (function () { function class_1() { } class_1.prototype.m = function () { return x; }; @@ -145,7 +145,7 @@ function foo6() { var x; } function foo7() { - var A = (function () { + var A = /** @class */ (function () { function A() { this.a = x; } @@ -154,7 +154,7 @@ function foo7() { var x; } function foo8() { - var y = (function () { + var y = /** @class */ (function () { function class_2() { this.a = x; } @@ -163,7 +163,7 @@ function foo8() { var x; } function foo9() { - var y = (_a = (function () { + var y = (_a = /** @class */ (function () { function class_3() { } return class_3; @@ -174,7 +174,7 @@ function foo9() { var _a; } function foo10() { - var A = (function () { + var A = /** @class */ (function () { function A() { } A.a = x; @@ -184,7 +184,7 @@ function foo10() { } function foo11() { function f() { - var y = (_a = (function () { + var y = (_a = /** @class */ (function () { function class_4() { } return class_4; @@ -197,7 +197,7 @@ function foo11() { } function foo12() { function f() { - var y = (function () { + var y = /** @class */ (function () { function class_5() { this.a = x; } diff --git a/tests/baselines/reference/callGenericFunctionWithIncorrectNumberOfTypeArguments.js b/tests/baselines/reference/callGenericFunctionWithIncorrectNumberOfTypeArguments.js index c40948273a6de..3f5fb14b1a953 100644 --- a/tests/baselines/reference/callGenericFunctionWithIncorrectNumberOfTypeArguments.js +++ b/tests/baselines/reference/callGenericFunctionWithIncorrectNumberOfTypeArguments.js @@ -56,7 +56,7 @@ var r2b = f2(1, ''); var f3; var r3 = f3(1, ''); var r3b = f3(1, ''); -var C = (function () { +var C = /** @class */ (function () { function C() { } C.prototype.f = function (x, y) { @@ -69,7 +69,7 @@ var r4b = (new C()).f(1, ''); var i; var r5 = i.f(1, ''); var r5b = i.f(1, ''); -var C2 = (function () { +var C2 = /** @class */ (function () { function C2() { } C2.prototype.f = function (x, y) { diff --git a/tests/baselines/reference/callGenericFunctionWithZeroTypeArguments.js b/tests/baselines/reference/callGenericFunctionWithZeroTypeArguments.js index e78ee62edc5d4..fd46b841a0284 100644 --- a/tests/baselines/reference/callGenericFunctionWithZeroTypeArguments.js +++ b/tests/baselines/reference/callGenericFunctionWithZeroTypeArguments.js @@ -44,7 +44,7 @@ var f2 = function (x) { return null; }; var r2 = f2(1); var f3; var r3 = f3(1); -var C = (function () { +var C = /** @class */ (function () { function C() { } C.prototype.f = function (x) { @@ -55,7 +55,7 @@ var C = (function () { var r4 = (new C()).f(1); var i; var r5 = i.f(1); -var C2 = (function () { +var C2 = /** @class */ (function () { function C2() { } C2.prototype.f = function (x) { diff --git a/tests/baselines/reference/callNonGenericFunctionWithTypeArguments.js b/tests/baselines/reference/callNonGenericFunctionWithTypeArguments.js index dd9a20825101a..b94a3208c5c86 100644 --- a/tests/baselines/reference/callNonGenericFunctionWithTypeArguments.js +++ b/tests/baselines/reference/callNonGenericFunctionWithTypeArguments.js @@ -52,7 +52,7 @@ var f2 = function (x) { return null; }; var r2 = f2(1); var f3; var r3 = f3(1); -var C = (function () { +var C = /** @class */ (function () { function C() { } C.prototype.f = function (x) { @@ -63,7 +63,7 @@ var C = (function () { var r4 = (new C()).f(1); var i; var r5 = i.f(1); -var C2 = (function () { +var C2 = /** @class */ (function () { function C2() { } C2.prototype.f = function (x) { diff --git a/tests/baselines/reference/callOnClass.js b/tests/baselines/reference/callOnClass.js index fbcedb9ba1ae8..1a6333945b759 100644 --- a/tests/baselines/reference/callOnClass.js +++ b/tests/baselines/reference/callOnClass.js @@ -5,7 +5,7 @@ var c = C(); //// [callOnClass.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } return C; diff --git a/tests/baselines/reference/callOverloadViaElementAccessExpression.js b/tests/baselines/reference/callOverloadViaElementAccessExpression.js index 48f3771206e2b..9dc2065678638 100644 --- a/tests/baselines/reference/callOverloadViaElementAccessExpression.js +++ b/tests/baselines/reference/callOverloadViaElementAccessExpression.js @@ -12,7 +12,7 @@ var r: string = c['foo'](1); var r2: number = c['foo'](''); //// [callOverloadViaElementAccessExpression.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } C.prototype.foo = function (x) { diff --git a/tests/baselines/reference/callOverloads1.js b/tests/baselines/reference/callOverloads1.js index 756a9099e4452..ac5a15d953c9d 100644 --- a/tests/baselines/reference/callOverloads1.js +++ b/tests/baselines/reference/callOverloads1.js @@ -18,7 +18,7 @@ f1.bar1(); Foo(); //// [callOverloads1.js] -var Foo = (function () { +var Foo = /** @class */ (function () { function Foo(x) { // WScript.Echo("Constructor function has executed"); } diff --git a/tests/baselines/reference/callOverloads2.js b/tests/baselines/reference/callOverloads2.js index 9762a6e925f96..ee1300ee5dedb 100644 --- a/tests/baselines/reference/callOverloads2.js +++ b/tests/baselines/reference/callOverloads2.js @@ -24,7 +24,7 @@ Foo(); //// [callOverloads2.js] -var Foo = (function () { +var Foo = /** @class */ (function () { function Foo(x) { // WScript.Echo("Constructor function has executed"); } diff --git a/tests/baselines/reference/callOverloads3.js b/tests/baselines/reference/callOverloads3.js index ecd6a39f5697b..f2f3498c83189 100644 --- a/tests/baselines/reference/callOverloads3.js +++ b/tests/baselines/reference/callOverloads3.js @@ -18,7 +18,7 @@ Foo("s"); //// [callOverloads3.js] -var Foo = (function () { +var Foo = /** @class */ (function () { function Foo(x) { // WScript.Echo("Constructor function has executed"); } diff --git a/tests/baselines/reference/callOverloads4.js b/tests/baselines/reference/callOverloads4.js index ea2bd8572eb3e..60757da34bd78 100644 --- a/tests/baselines/reference/callOverloads4.js +++ b/tests/baselines/reference/callOverloads4.js @@ -18,7 +18,7 @@ Foo("s"); //// [callOverloads4.js] -var Foo = (function () { +var Foo = /** @class */ (function () { function Foo(x) { // WScript.Echo("Constructor function has executed"); } diff --git a/tests/baselines/reference/callOverloads5.js b/tests/baselines/reference/callOverloads5.js index cf159d309b0f2..4ccc1f5ea2699 100644 --- a/tests/baselines/reference/callOverloads5.js +++ b/tests/baselines/reference/callOverloads5.js @@ -20,7 +20,7 @@ Foo("s"); //// [callOverloads5.js] -var Foo = (function () { +var Foo = /** @class */ (function () { function Foo(x) { // WScript.Echo("Constructor function has executed"); } diff --git a/tests/baselines/reference/callSignatureAssignabilityInInheritance2.js b/tests/baselines/reference/callSignatureAssignabilityInInheritance2.js index a71613bc545c8..70d76baf5ba65 100644 --- a/tests/baselines/reference/callSignatureAssignabilityInInheritance2.js +++ b/tests/baselines/reference/callSignatureAssignabilityInInheritance2.js @@ -81,26 +81,26 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var Base = (function () { +var Base = /** @class */ (function () { function Base() { } return Base; }()); -var Derived = (function (_super) { +var Derived = /** @class */ (function (_super) { __extends(Derived, _super); function Derived() { return _super !== null && _super.apply(this, arguments) || this; } return Derived; }(Base)); -var Derived2 = (function (_super) { +var Derived2 = /** @class */ (function (_super) { __extends(Derived2, _super); function Derived2() { return _super !== null && _super.apply(this, arguments) || this; } return Derived2; }(Derived)); -var OtherDerived = (function (_super) { +var OtherDerived = /** @class */ (function (_super) { __extends(OtherDerived, _super); function OtherDerived() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/callSignatureAssignabilityInInheritance3.js b/tests/baselines/reference/callSignatureAssignabilityInInheritance3.js index 7f9d616281bec..c86b0bd7e1201 100644 --- a/tests/baselines/reference/callSignatureAssignabilityInInheritance3.js +++ b/tests/baselines/reference/callSignatureAssignabilityInInheritance3.js @@ -128,26 +128,26 @@ var __extends = (this && this.__extends) || (function () { })(); var Errors; (function (Errors) { - var Base = (function () { + var Base = /** @class */ (function () { function Base() { } return Base; }()); - var Derived = (function (_super) { + var Derived = /** @class */ (function (_super) { __extends(Derived, _super); function Derived() { return _super !== null && _super.apply(this, arguments) || this; } return Derived; }(Base)); - var Derived2 = (function (_super) { + var Derived2 = /** @class */ (function (_super) { __extends(Derived2, _super); function Derived2() { return _super !== null && _super.apply(this, arguments) || this; } return Derived2; }(Derived)); - var OtherDerived = (function (_super) { + var OtherDerived = /** @class */ (function (_super) { __extends(OtherDerived, _super); function OtherDerived() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/callSignatureAssignabilityInInheritance4.js b/tests/baselines/reference/callSignatureAssignabilityInInheritance4.js index 6c5d7508fc936..1fc4c80345a8f 100644 --- a/tests/baselines/reference/callSignatureAssignabilityInInheritance4.js +++ b/tests/baselines/reference/callSignatureAssignabilityInInheritance4.js @@ -61,26 +61,26 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var Base = (function () { +var Base = /** @class */ (function () { function Base() { } return Base; }()); -var Derived = (function (_super) { +var Derived = /** @class */ (function (_super) { __extends(Derived, _super); function Derived() { return _super !== null && _super.apply(this, arguments) || this; } return Derived; }(Base)); -var Derived2 = (function (_super) { +var Derived2 = /** @class */ (function (_super) { __extends(Derived2, _super); function Derived2() { return _super !== null && _super.apply(this, arguments) || this; } return Derived2; }(Derived)); -var OtherDerived = (function (_super) { +var OtherDerived = /** @class */ (function (_super) { __extends(OtherDerived, _super); function OtherDerived() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/callSignatureAssignabilityInInheritance5.js b/tests/baselines/reference/callSignatureAssignabilityInInheritance5.js index fe260d62119fc..5a021653cd830 100644 --- a/tests/baselines/reference/callSignatureAssignabilityInInheritance5.js +++ b/tests/baselines/reference/callSignatureAssignabilityInInheritance5.js @@ -61,26 +61,26 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var Base = (function () { +var Base = /** @class */ (function () { function Base() { } return Base; }()); -var Derived = (function (_super) { +var Derived = /** @class */ (function (_super) { __extends(Derived, _super); function Derived() { return _super !== null && _super.apply(this, arguments) || this; } return Derived; }(Base)); -var Derived2 = (function (_super) { +var Derived2 = /** @class */ (function (_super) { __extends(Derived2, _super); function Derived2() { return _super !== null && _super.apply(this, arguments) || this; } return Derived2; }(Derived)); -var OtherDerived = (function (_super) { +var OtherDerived = /** @class */ (function (_super) { __extends(OtherDerived, _super); function OtherDerived() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/callSignatureAssignabilityInInheritance6.js b/tests/baselines/reference/callSignatureAssignabilityInInheritance6.js index c6054d2411d62..f814b36a59e94 100644 --- a/tests/baselines/reference/callSignatureAssignabilityInInheritance6.js +++ b/tests/baselines/reference/callSignatureAssignabilityInInheritance6.js @@ -64,26 +64,26 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var Base = (function () { +var Base = /** @class */ (function () { function Base() { } return Base; }()); -var Derived = (function (_super) { +var Derived = /** @class */ (function (_super) { __extends(Derived, _super); function Derived() { return _super !== null && _super.apply(this, arguments) || this; } return Derived; }(Base)); -var Derived2 = (function (_super) { +var Derived2 = /** @class */ (function (_super) { __extends(Derived2, _super); function Derived2() { return _super !== null && _super.apply(this, arguments) || this; } return Derived2; }(Derived)); -var OtherDerived = (function (_super) { +var OtherDerived = /** @class */ (function (_super) { __extends(OtherDerived, _super); function OtherDerived() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/callSignatureWithOptionalParameterAndInitializer.js b/tests/baselines/reference/callSignatureWithOptionalParameterAndInitializer.js index 14442dd6e2274..4ff809379193b 100644 --- a/tests/baselines/reference/callSignatureWithOptionalParameterAndInitializer.js +++ b/tests/baselines/reference/callSignatureWithOptionalParameterAndInitializer.js @@ -72,7 +72,7 @@ f(1); f(); f2(1); f2(1, 2); -var C = (function () { +var C = /** @class */ (function () { function C() { } C.prototype.foo = function (x) { diff --git a/tests/baselines/reference/callSignatureWithoutReturnTypeAnnotationInference.js b/tests/baselines/reference/callSignatureWithoutReturnTypeAnnotationInference.js index 99fb3a17a6f5e..9ecceb3ff4fa1 100644 --- a/tests/baselines/reference/callSignatureWithoutReturnTypeAnnotationInference.js +++ b/tests/baselines/reference/callSignatureWithoutReturnTypeAnnotationInference.js @@ -173,7 +173,7 @@ function foo9(x) { return i; } var r9 = foo9(1); -var C = (function () { +var C = /** @class */ (function () { function C() { } return C; @@ -186,7 +186,7 @@ var r10 = foo10(1); var M; (function (M) { M.x = 1; - var C = (function () { + var C = /** @class */ (function () { function C() { } return C; @@ -210,7 +210,7 @@ function foo13() { return m1; } var r13 = foo13(); -var c1 = (function () { +var c1 = /** @class */ (function () { function c1(x) { } return c1; diff --git a/tests/baselines/reference/callSignaturesWithAccessibilityModifiersOnParameters.js b/tests/baselines/reference/callSignaturesWithAccessibilityModifiersOnParameters.js index dba88c4951e21..e2a3599f0daa7 100644 --- a/tests/baselines/reference/callSignaturesWithAccessibilityModifiersOnParameters.js +++ b/tests/baselines/reference/callSignaturesWithAccessibilityModifiersOnParameters.js @@ -50,7 +50,7 @@ var f5 = function foo(x, y) { }; var f6 = function (x, y) { }; var f7 = function (x, y) { }; var f8 = function (x, y) { }; -var C = (function () { +var C = /** @class */ (function () { function C() { } C.prototype.foo = function (x, y) { }; diff --git a/tests/baselines/reference/callSignaturesWithDuplicateParameters.js b/tests/baselines/reference/callSignaturesWithDuplicateParameters.js index add9e07ea4b83..ed9d2cb3e3573 100644 --- a/tests/baselines/reference/callSignaturesWithDuplicateParameters.js +++ b/tests/baselines/reference/callSignaturesWithDuplicateParameters.js @@ -50,7 +50,7 @@ var f5 = function foo(x, x) { }; var f6 = function (x, x) { }; var f7 = function (x, x) { }; var f8 = function (x, y) { }; -var C = (function () { +var C = /** @class */ (function () { function C() { } C.prototype.foo = function (x, x) { }; diff --git a/tests/baselines/reference/callSignaturesWithOptionalParameters.js b/tests/baselines/reference/callSignaturesWithOptionalParameters.js index a0a3835c9432a..1a5aad8c0e19e 100644 --- a/tests/baselines/reference/callSignaturesWithOptionalParameters.js +++ b/tests/baselines/reference/callSignaturesWithOptionalParameters.js @@ -66,7 +66,7 @@ f(1); f(); f2(1); f2(1, 2); -var C = (function () { +var C = /** @class */ (function () { function C() { } C.prototype.foo = function (x) { }; diff --git a/tests/baselines/reference/callSignaturesWithOptionalParameters2.js b/tests/baselines/reference/callSignaturesWithOptionalParameters2.js index 973b0466a79e1..dbd8ad1f424e1 100644 --- a/tests/baselines/reference/callSignaturesWithOptionalParameters2.js +++ b/tests/baselines/reference/callSignaturesWithOptionalParameters2.js @@ -67,7 +67,7 @@ foo(); function foo2(x, y) { } foo2(1); foo2(1, 2); -var C = (function () { +var C = /** @class */ (function () { function C() { } C.prototype.foo = function (x) { }; diff --git a/tests/baselines/reference/callSignaturesWithParameterInitializers.js b/tests/baselines/reference/callSignaturesWithParameterInitializers.js index 8b53d5b29d52f..528b2a3d00e3d 100644 --- a/tests/baselines/reference/callSignaturesWithParameterInitializers.js +++ b/tests/baselines/reference/callSignaturesWithParameterInitializers.js @@ -74,7 +74,7 @@ f(1); f(); f2(1); f2(1, 2); -var C = (function () { +var C = /** @class */ (function () { function C() { } C.prototype.foo = function (x) { diff --git a/tests/baselines/reference/callSignaturesWithParameterInitializers2.js b/tests/baselines/reference/callSignaturesWithParameterInitializers2.js index fd1dd369010eb..10aaaf44b6ec2 100644 --- a/tests/baselines/reference/callSignaturesWithParameterInitializers2.js +++ b/tests/baselines/reference/callSignaturesWithParameterInitializers2.js @@ -33,7 +33,7 @@ function foo(x) { } foo(1); foo(); -var C = (function () { +var C = /** @class */ (function () { function C() { } C.prototype.foo = function (x) { diff --git a/tests/baselines/reference/callWithSpread.js b/tests/baselines/reference/callWithSpread.js index 23c1fff2d09e6..2059c7ab09018 100644 --- a/tests/baselines/reference/callWithSpread.js +++ b/tests/baselines/reference/callWithSpread.js @@ -98,7 +98,7 @@ xa[1].foo(1, 2, "abc"); (_e = xa[1]).foo.apply(_e, [1, 2].concat(a)); (_f = xa[1]).foo.apply(_f, [1, 2].concat(a, ["abc"])); (_g = xa[1]).foo.apply(_g, [1, 2, "abc"]); -var C = (function () { +var C = /** @class */ (function () { function C(x, y) { var z = []; for (var _i = 2; _i < arguments.length; _i++) { @@ -115,7 +115,7 @@ var C = (function () { }; return C; }()); -var D = (function (_super) { +var D = /** @class */ (function (_super) { __extends(D, _super); function D() { var _this = _super.call(this, 1, 2) || this; diff --git a/tests/baselines/reference/cannotInvokeNewOnErrorExpression.js b/tests/baselines/reference/cannotInvokeNewOnErrorExpression.js index 4b25c75b0aa2b..129b17acdc64d 100644 --- a/tests/baselines/reference/cannotInvokeNewOnErrorExpression.js +++ b/tests/baselines/reference/cannotInvokeNewOnErrorExpression.js @@ -8,7 +8,7 @@ var t = new M.ClassA[]; //// [cannotInvokeNewOnErrorExpression.js] var M; (function (M) { - var ClassA = (function () { + var ClassA = /** @class */ (function () { function ClassA() { } return ClassA; diff --git a/tests/baselines/reference/captureSuperPropertyAccessInSuperCall01.js b/tests/baselines/reference/captureSuperPropertyAccessInSuperCall01.js index 98ca7cb47d7e0..9ded081269f4a 100644 --- a/tests/baselines/reference/captureSuperPropertyAccessInSuperCall01.js +++ b/tests/baselines/reference/captureSuperPropertyAccessInSuperCall01.js @@ -22,13 +22,13 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var A = (function () { +var A = /** @class */ (function () { function A(f) { } A.prototype.blah = function () { return ""; }; return A; }()); -var B = (function (_super) { +var B = /** @class */ (function (_super) { __extends(B, _super); function B() { var _this = _super.call(this, function () { return _super.prototype.blah.call(_this); }) || this; diff --git a/tests/baselines/reference/captureThisInSuperCall.js b/tests/baselines/reference/captureThisInSuperCall.js index ccca2e6562fbc..0b277e348a4ae 100644 --- a/tests/baselines/reference/captureThisInSuperCall.js +++ b/tests/baselines/reference/captureThisInSuperCall.js @@ -19,12 +19,12 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var A = (function () { +var A = /** @class */ (function () { function A(p) { } return A; }()); -var B = (function (_super) { +var B = /** @class */ (function (_super) { __extends(B, _super); function B() { var _this = _super.call(this, { test: function () { return _this.someMethod(); } }) || this; diff --git a/tests/baselines/reference/capturedLetConstInLoop10.js b/tests/baselines/reference/capturedLetConstInLoop10.js index 63c114ba6e438..304486e172475 100644 --- a/tests/baselines/reference/capturedLetConstInLoop10.js +++ b/tests/baselines/reference/capturedLetConstInLoop10.js @@ -46,7 +46,7 @@ class B { } //// [capturedLetConstInLoop10.js] -var A = (function () { +var A = /** @class */ (function () { function A() { } A.prototype.foo = function () { @@ -102,7 +102,7 @@ var A = (function () { }; return A; }()); -var B = (function () { +var B = /** @class */ (function () { function B() { } B.prototype.foo = function () { diff --git a/tests/baselines/reference/capturedLetConstInLoop13.js b/tests/baselines/reference/capturedLetConstInLoop13.js index a2e0921ab1db9..cd44130f45f76 100644 --- a/tests/baselines/reference/capturedLetConstInLoop13.js +++ b/tests/baselines/reference/capturedLetConstInLoop13.js @@ -23,7 +23,7 @@ class Main { new Main(); //// [capturedLetConstInLoop13.js] -var Main = (function () { +var Main = /** @class */ (function () { function Main() { this.register("a", "b", "c"); } diff --git a/tests/baselines/reference/capturedLetConstInLoop9.js b/tests/baselines/reference/capturedLetConstInLoop9.js index 8f88855a9ade7..00fb878cc7eb5 100644 --- a/tests/baselines/reference/capturedLetConstInLoop9.js +++ b/tests/baselines/reference/capturedLetConstInLoop9.js @@ -164,7 +164,7 @@ var _loop_1 = function (x) { while (1 == 1) { _loop_2(); } - var A = (function () { + var A = /** @class */ (function () { function A() { } A.prototype.m = function () { @@ -271,7 +271,7 @@ function foo2() { } } } -var C = (function () { +var C = /** @class */ (function () { function C(N) { this.N = N; } diff --git a/tests/baselines/reference/capturedParametersInInitializers1.js b/tests/baselines/reference/capturedParametersInInitializers1.js index bc46acecad390..49b031e8b199f 100644 --- a/tests/baselines/reference/capturedParametersInInitializers1.js +++ b/tests/baselines/reference/capturedParametersInInitializers1.js @@ -18,7 +18,7 @@ function foo3(y = { x: a }, z = 1) { //// [capturedParametersInInitializers1.js] // ok - usage is deferred function foo1(y, x) { - if (y === void 0) { y = (function () { + if (y === void 0) { y = /** @class */ (function () { function class_1() { this.c = x; } diff --git a/tests/baselines/reference/capturedParametersInInitializers2.js b/tests/baselines/reference/capturedParametersInInitializers2.js index e2b492a012f4a..2e833cac00354 100644 --- a/tests/baselines/reference/capturedParametersInInitializers2.js +++ b/tests/baselines/reference/capturedParametersInInitializers2.js @@ -7,7 +7,7 @@ function foo2(y = class {[x] = x}, x = 1) { //// [capturedParametersInInitializers2.js] function foo(y, x) { - if (y === void 0) { y = (_a = (function () { + if (y === void 0) { y = (_a = /** @class */ (function () { function class_1() { } return class_1; @@ -19,7 +19,7 @@ function foo(y, x) { var _a; } function foo2(y, x) { - if (y === void 0) { y = (function () { + if (y === void 0) { y = /** @class */ (function () { function class_2() { this[x] = x; } diff --git a/tests/baselines/reference/castParentheses.js b/tests/baselines/reference/castParentheses.js index feeced645e250..e5ca16f0823eb 100644 --- a/tests/baselines/reference/castParentheses.js +++ b/tests/baselines/reference/castParentheses.js @@ -12,7 +12,7 @@ var b = (new a.b); var b = (new a).b //// [castParentheses.js] -var a = (function () { +var a = /** @class */ (function () { function a() { } return a; diff --git a/tests/baselines/reference/castingTuple.js b/tests/baselines/reference/castingTuple.js index fea3bd9a23823..3744d40d8a5bb 100644 --- a/tests/baselines/reference/castingTuple.js +++ b/tests/baselines/reference/castingTuple.js @@ -43,25 +43,25 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var A = (function () { +var A = /** @class */ (function () { function A() { this.a = 10; } return A; }()); -var C = (function () { +var C = /** @class */ (function () { function C() { } return C; }()); ; -var D = (function () { +var D = /** @class */ (function () { function D() { } return D; }()); ; -var E = (function (_super) { +var E = /** @class */ (function (_super) { __extends(E, _super); function E() { return _super !== null && _super.apply(this, arguments) || this; @@ -69,7 +69,7 @@ var E = (function (_super) { return E; }(A)); ; -var F = (function (_super) { +var F = /** @class */ (function (_super) { __extends(F, _super); function F() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/chainedAssignment1.js b/tests/baselines/reference/chainedAssignment1.js index 8f13477bdefcc..074165188ba76 100644 --- a/tests/baselines/reference/chainedAssignment1.js +++ b/tests/baselines/reference/chainedAssignment1.js @@ -23,19 +23,19 @@ c1 = c2 = c3; // a bug made this not report the same error as below c2 = c3; // Error TS111: Cannot convert Z to Y //// [chainedAssignment1.js] -var X = (function () { +var X = /** @class */ (function () { function X(z) { this.z = z; } return X; }()); -var Y = (function () { +var Y = /** @class */ (function () { function Y(z) { this.z = z; } return Y; }()); -var Z = (function () { +var Z = /** @class */ (function () { function Z() { } return Z; diff --git a/tests/baselines/reference/chainedAssignment3.js b/tests/baselines/reference/chainedAssignment3.js index c85845f6d3591..c0c0fd8c49aae 100644 --- a/tests/baselines/reference/chainedAssignment3.js +++ b/tests/baselines/reference/chainedAssignment3.js @@ -33,12 +33,12 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var A = (function () { +var A = /** @class */ (function () { function A() { } return A; }()); -var B = (function (_super) { +var B = /** @class */ (function (_super) { __extends(B, _super); function B() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/chainedAssignmentChecking.js b/tests/baselines/reference/chainedAssignmentChecking.js index 4d9fbfa48a15b..9ea4020199017 100644 --- a/tests/baselines/reference/chainedAssignmentChecking.js +++ b/tests/baselines/reference/chainedAssignmentChecking.js @@ -23,19 +23,19 @@ c1 = c2 = c3; // Should be error //// [chainedAssignmentChecking.js] -var X = (function () { +var X = /** @class */ (function () { function X(z) { this.z = z; } return X; }()); -var Y = (function () { +var Y = /** @class */ (function () { function Y(z) { this.z = z; } return Y; }()); -var Z = (function () { +var Z = /** @class */ (function () { function Z() { } return Z; diff --git a/tests/baselines/reference/chainedCallsWithTypeParameterConstrainedToOtherTypeParameter.js b/tests/baselines/reference/chainedCallsWithTypeParameterConstrainedToOtherTypeParameter.js index 99bd90139aec6..b58ad2ed28fe8 100644 --- a/tests/baselines/reference/chainedCallsWithTypeParameterConstrainedToOtherTypeParameter.js +++ b/tests/baselines/reference/chainedCallsWithTypeParameterConstrainedToOtherTypeParameter.js @@ -30,7 +30,7 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var Chain = (function () { +var Chain = /** @class */ (function () { function Chain(value) { this.value = value; } @@ -39,19 +39,19 @@ var Chain = (function () { }; return Chain; }()); -var A = (function () { +var A = /** @class */ (function () { function A() { } return A; }()); -var B = (function (_super) { +var B = /** @class */ (function (_super) { __extends(B, _super); function B() { return _super !== null && _super.apply(this, arguments) || this; } return B; }(A)); -var C = (function (_super) { +var C = /** @class */ (function (_super) { __extends(C, _super); function C() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/chainedCallsWithTypeParameterConstrainedToOtherTypeParameter2.js b/tests/baselines/reference/chainedCallsWithTypeParameterConstrainedToOtherTypeParameter2.js index 8aa5594701f25..15c723524807a 100644 --- a/tests/baselines/reference/chainedCallsWithTypeParameterConstrainedToOtherTypeParameter2.js +++ b/tests/baselines/reference/chainedCallsWithTypeParameterConstrainedToOtherTypeParameter2.js @@ -42,7 +42,7 @@ class Chain2 { } //// [chainedCallsWithTypeParameterConstrainedToOtherTypeParameter2.js] -var Chain = (function () { +var Chain = /** @class */ (function () { function Chain(value) { this.value = value; } @@ -60,7 +60,7 @@ var Chain = (function () { }; return Chain; }()); -var Chain2 = (function () { +var Chain2 = /** @class */ (function () { function Chain2(value) { this.value = value; } diff --git a/tests/baselines/reference/checkForObjectTooStrict.js b/tests/baselines/reference/checkForObjectTooStrict.js index 6d330285f6e5b..ebe87e3e1085a 100644 --- a/tests/baselines/reference/checkForObjectTooStrict.js +++ b/tests/baselines/reference/checkForObjectTooStrict.js @@ -44,21 +44,21 @@ var __extends = (this && this.__extends) || (function () { })(); var Foo; (function (Foo) { - var Object = (function () { + var Object = /** @class */ (function () { function Object() { } return Object; }()); Foo.Object = Object; })(Foo || (Foo = {})); -var Bar = (function (_super) { +var Bar = /** @class */ (function (_super) { __extends(Bar, _super); function Bar() { return _super.call(this) || this; } return Bar; }(Foo.Object)); -var Baz = (function (_super) { +var Baz = /** @class */ (function (_super) { __extends(Baz, _super); function Baz() { return _super.call(this) || this; diff --git a/tests/baselines/reference/checkJsxChildrenProperty10.js b/tests/baselines/reference/checkJsxChildrenProperty10.js index f022b28f20c28..18d1f3affa33e 100644 --- a/tests/baselines/reference/checkJsxChildrenProperty10.js +++ b/tests/baselines/reference/checkJsxChildrenProperty10.js @@ -23,7 +23,7 @@ let k3 =
{1} {"That is a number"}
; let k4 = ; //// [file.jsx] -var Button = (function () { +var Button = /** @class */ (function () { function Button() { } Button.prototype.render = function () { diff --git a/tests/baselines/reference/checkJsxChildrenProperty11.js b/tests/baselines/reference/checkJsxChildrenProperty11.js index f022b28f20c28..18d1f3affa33e 100644 --- a/tests/baselines/reference/checkJsxChildrenProperty11.js +++ b/tests/baselines/reference/checkJsxChildrenProperty11.js @@ -23,7 +23,7 @@ let k3 =
{1} {"That is a number"}
; let k4 = ; //// [file.jsx] -var Button = (function () { +var Button = /** @class */ (function () { function Button() { } Button.prototype.render = function () { diff --git a/tests/baselines/reference/checkJsxChildrenProperty12.js b/tests/baselines/reference/checkJsxChildrenProperty12.js index 0030d87483f2c..ca685d558bf23 100644 --- a/tests/baselines/reference/checkJsxChildrenProperty12.js +++ b/tests/baselines/reference/checkJsxChildrenProperty12.js @@ -46,7 +46,7 @@ var __extends = (this && this.__extends) || (function () { })(); exports.__esModule = true; var React = require("react"); -var Button = (function (_super) { +var Button = /** @class */ (function (_super) { __extends(Button, _super); function Button() { return _super !== null && _super.apply(this, arguments) || this; @@ -64,7 +64,7 @@ var Button = (function (_super) { }; return Button; }(React.Component)); -var InnerButton = (function (_super) { +var InnerButton = /** @class */ (function (_super) { __extends(InnerButton, _super); function InnerButton() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/checkJsxChildrenProperty13.js b/tests/baselines/reference/checkJsxChildrenProperty13.js index 8947e6b211f08..9848847c0882f 100644 --- a/tests/baselines/reference/checkJsxChildrenProperty13.js +++ b/tests/baselines/reference/checkJsxChildrenProperty13.js @@ -41,7 +41,7 @@ var __extends = (this && this.__extends) || (function () { })(); exports.__esModule = true; var React = require("react"); -var Button = (function (_super) { +var Button = /** @class */ (function (_super) { __extends(Button, _super); function Button() { return _super !== null && _super.apply(this, arguments) || this; @@ -54,7 +54,7 @@ var Button = (function (_super) { }; return Button; }(React.Component)); -var InnerButton = (function (_super) { +var InnerButton = /** @class */ (function (_super) { __extends(InnerButton, _super); function InnerButton() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/checkJsxChildrenProperty3.js b/tests/baselines/reference/checkJsxChildrenProperty3.js index 49247925523d0..5ec217cab2710 100644 --- a/tests/baselines/reference/checkJsxChildrenProperty3.js +++ b/tests/baselines/reference/checkJsxChildrenProperty3.js @@ -53,7 +53,7 @@ var __extends = (this && this.__extends) || (function () { })(); exports.__esModule = true; var React = require("react"); -var FetchUser = (function (_super) { +var FetchUser = /** @class */ (function (_super) { __extends(FetchUser, _super); function FetchUser() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/checkJsxChildrenProperty4.js b/tests/baselines/reference/checkJsxChildrenProperty4.js index d163ffb0f41b5..f2f0af116006b 100644 --- a/tests/baselines/reference/checkJsxChildrenProperty4.js +++ b/tests/baselines/reference/checkJsxChildrenProperty4.js @@ -58,7 +58,7 @@ var __extends = (this && this.__extends) || (function () { })(); exports.__esModule = true; var React = require("react"); -var FetchUser = (function (_super) { +var FetchUser = /** @class */ (function (_super) { __extends(FetchUser, _super); function FetchUser() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/checkJsxChildrenProperty5.js b/tests/baselines/reference/checkJsxChildrenProperty5.js index a08dae2f25214..26aa9f9aebe6e 100644 --- a/tests/baselines/reference/checkJsxChildrenProperty5.js +++ b/tests/baselines/reference/checkJsxChildrenProperty5.js @@ -44,7 +44,7 @@ var __extends = (this && this.__extends) || (function () { })(); exports.__esModule = true; var React = require("react"); -var Button = (function (_super) { +var Button = /** @class */ (function (_super) { __extends(Button, _super); function Button() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/checkJsxChildrenProperty6.js b/tests/baselines/reference/checkJsxChildrenProperty6.js index e433bc520dbe3..b8209c211c86b 100644 --- a/tests/baselines/reference/checkJsxChildrenProperty6.js +++ b/tests/baselines/reference/checkJsxChildrenProperty6.js @@ -57,7 +57,7 @@ var __extends = (this && this.__extends) || (function () { })(); exports.__esModule = true; var React = require("react"); -var Button = (function (_super) { +var Button = /** @class */ (function (_super) { __extends(Button, _super); function Button() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/checkJsxChildrenProperty7.js b/tests/baselines/reference/checkJsxChildrenProperty7.js index 6a82233f0bc09..fa31bf141e2ab 100644 --- a/tests/baselines/reference/checkJsxChildrenProperty7.js +++ b/tests/baselines/reference/checkJsxChildrenProperty7.js @@ -42,7 +42,7 @@ var __extends = (this && this.__extends) || (function () { })(); exports.__esModule = true; var React = require("react"); -var Button = (function (_super) { +var Button = /** @class */ (function (_super) { __extends(Button, _super); function Button() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/checkJsxChildrenProperty8.js b/tests/baselines/reference/checkJsxChildrenProperty8.js index a2cd6a43fa500..51f860da74c20 100644 --- a/tests/baselines/reference/checkJsxChildrenProperty8.js +++ b/tests/baselines/reference/checkJsxChildrenProperty8.js @@ -43,7 +43,7 @@ var __extends = (this && this.__extends) || (function () { })(); exports.__esModule = true; var React = require("react"); -var Button = (function (_super) { +var Button = /** @class */ (function (_super) { __extends(Button, _super); function Button() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/checkSuperCallBeforeThisAccessing1.js b/tests/baselines/reference/checkSuperCallBeforeThisAccessing1.js index 40717cb47590f..1745a82fa81e9 100644 --- a/tests/baselines/reference/checkSuperCallBeforeThisAccessing1.js +++ b/tests/baselines/reference/checkSuperCallBeforeThisAccessing1.js @@ -21,12 +21,12 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var Based = (function () { +var Based = /** @class */ (function () { function Based() { } return Based; }()); -var Derived = (function (_super) { +var Derived = /** @class */ (function (_super) { __extends(Derived, _super); function Derived() { var _this = _super.call(this) || this; diff --git a/tests/baselines/reference/checkSuperCallBeforeThisAccessing2.js b/tests/baselines/reference/checkSuperCallBeforeThisAccessing2.js index bbe56823ee595..8f5fa03e01369 100644 --- a/tests/baselines/reference/checkSuperCallBeforeThisAccessing2.js +++ b/tests/baselines/reference/checkSuperCallBeforeThisAccessing2.js @@ -21,12 +21,12 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var Based = (function () { +var Based = /** @class */ (function () { function Based() { } return Based; }()); -var Derived = (function (_super) { +var Derived = /** @class */ (function (_super) { __extends(Derived, _super); function Derived() { var _this = this; diff --git a/tests/baselines/reference/checkSuperCallBeforeThisAccessing3.js b/tests/baselines/reference/checkSuperCallBeforeThisAccessing3.js index dc7e0309ab6ae..a2d6956730997 100644 --- a/tests/baselines/reference/checkSuperCallBeforeThisAccessing3.js +++ b/tests/baselines/reference/checkSuperCallBeforeThisAccessing3.js @@ -26,16 +26,16 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var Based = (function () { +var Based = /** @class */ (function () { function Based() { } return Based; }()); -var Derived = (function (_super) { +var Derived = /** @class */ (function (_super) { __extends(Derived, _super); function Derived() { var _this = this; - var innver = (function () { + var innver = /** @class */ (function () { function innver() { this.y = true; } diff --git a/tests/baselines/reference/checkSuperCallBeforeThisAccessing4.js b/tests/baselines/reference/checkSuperCallBeforeThisAccessing4.js index b8240b27aea46..4175e683c2861 100644 --- a/tests/baselines/reference/checkSuperCallBeforeThisAccessing4.js +++ b/tests/baselines/reference/checkSuperCallBeforeThisAccessing4.js @@ -30,12 +30,12 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var Based = (function () { +var Based = /** @class */ (function () { function Based() { } return Based; }()); -var Derived = (function (_super) { +var Derived = /** @class */ (function (_super) { __extends(Derived, _super); function Derived() { var _this = this; diff --git a/tests/baselines/reference/checkSuperCallBeforeThisAccessing5.js b/tests/baselines/reference/checkSuperCallBeforeThisAccessing5.js index 9936c7d97dc2c..fb03e0052e091 100644 --- a/tests/baselines/reference/checkSuperCallBeforeThisAccessing5.js +++ b/tests/baselines/reference/checkSuperCallBeforeThisAccessing5.js @@ -18,7 +18,7 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var Based = (function () { +var Based = /** @class */ (function () { function Based() { var arg = []; for (var _i = 0; _i < arguments.length; _i++) { @@ -27,7 +27,7 @@ var Based = (function () { } return Based; }()); -var Derived = (function (_super) { +var Derived = /** @class */ (function (_super) { __extends(Derived, _super); function Derived() { var _this = _super.call(this, _this.x) || this; diff --git a/tests/baselines/reference/checkSuperCallBeforeThisAccessing6.js b/tests/baselines/reference/checkSuperCallBeforeThisAccessing6.js index a40791a4eba1f..02136b8da1df8 100644 --- a/tests/baselines/reference/checkSuperCallBeforeThisAccessing6.js +++ b/tests/baselines/reference/checkSuperCallBeforeThisAccessing6.js @@ -21,7 +21,7 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var Base = (function () { +var Base = /** @class */ (function () { function Base() { var arg = []; for (var _i = 0; _i < arguments.length; _i++) { @@ -30,7 +30,7 @@ var Base = (function () { } return Base; }()); -var Super = (function (_super) { +var Super = /** @class */ (function (_super) { __extends(Super, _super); function Super() { var _this = this; diff --git a/tests/baselines/reference/checkSuperCallBeforeThisAccessing7.js b/tests/baselines/reference/checkSuperCallBeforeThisAccessing7.js index 4cb05a35aa06f..216d40e376c56 100644 --- a/tests/baselines/reference/checkSuperCallBeforeThisAccessing7.js +++ b/tests/baselines/reference/checkSuperCallBeforeThisAccessing7.js @@ -20,12 +20,12 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var Base = (function () { +var Base = /** @class */ (function () { function Base(func) { } return Base; }()); -var Super = (function (_super) { +var Super = /** @class */ (function (_super) { __extends(Super, _super); function Super() { var _this = _super.call(this, (function () { return _this; })) || this; diff --git a/tests/baselines/reference/checkSuperCallBeforeThisAccessing8.js b/tests/baselines/reference/checkSuperCallBeforeThisAccessing8.js index 92f13921d2aed..9122b4430158d 100644 --- a/tests/baselines/reference/checkSuperCallBeforeThisAccessing8.js +++ b/tests/baselines/reference/checkSuperCallBeforeThisAccessing8.js @@ -21,7 +21,7 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var Base = (function () { +var Base = /** @class */ (function () { function Base() { var arg = []; for (var _i = 0; _i < arguments.length; _i++) { @@ -30,7 +30,7 @@ var Base = (function () { } return Base; }()); -var Super = (function (_super) { +var Super = /** @class */ (function (_super) { __extends(Super, _super); function Super() { var _this = this; diff --git a/tests/baselines/reference/checkSwitchStatementIfCaseTypeIsString.js b/tests/baselines/reference/checkSwitchStatementIfCaseTypeIsString.js index a5eb24c671680..3cbf473dc8535 100644 --- a/tests/baselines/reference/checkSwitchStatementIfCaseTypeIsString.js +++ b/tests/baselines/reference/checkSwitchStatementIfCaseTypeIsString.js @@ -12,7 +12,7 @@ class A { } //// [checkSwitchStatementIfCaseTypeIsString.js] -var A = (function () { +var A = /** @class */ (function () { function A() { } A.prototype.doIt = function (x) { diff --git a/tests/baselines/reference/circularImportAlias.js b/tests/baselines/reference/circularImportAlias.js index 7c05d6dc3d3f5..7969f8b8ef8b2 100644 --- a/tests/baselines/reference/circularImportAlias.js +++ b/tests/baselines/reference/circularImportAlias.js @@ -34,7 +34,7 @@ var __extends = (this && this.__extends) || (function () { var B; (function (B) { B.a = A; - var D = (function (_super) { + var D = /** @class */ (function (_super) { __extends(D, _super); function D() { return _super !== null && _super.apply(this, arguments) || this; @@ -45,7 +45,7 @@ var B; })(B || (B = {})); var A; (function (A) { - var C = (function () { + var C = /** @class */ (function () { function C() { } return C; diff --git a/tests/baselines/reference/circularIndexedAccessErrors.js b/tests/baselines/reference/circularIndexedAccessErrors.js index eee09e853a2fd..499d5b483e47c 100644 --- a/tests/baselines/reference/circularIndexedAccessErrors.js +++ b/tests/baselines/reference/circularIndexedAccessErrors.js @@ -41,12 +41,12 @@ function foo() { //// [circularIndexedAccessErrors.js] var x2x = x2.x; -var C1 = (function () { +var C1 = /** @class */ (function () { function C1() { } return C1; }()); -var C2 = (function () { +var C2 = /** @class */ (function () { function C2() { } return C2; diff --git a/tests/baselines/reference/circularReference.js b/tests/baselines/reference/circularReference.js index 198a886f0267c..f4542118ae7b3 100644 --- a/tests/baselines/reference/circularReference.js +++ b/tests/baselines/reference/circularReference.js @@ -39,7 +39,7 @@ exports.__esModule = true; var foo2 = require("./foo2"); var M1; (function (M1) { - var C1 = (function () { + var C1 = /** @class */ (function () { function C1() { this.m1 = new foo2.M1.C1(); this.m1.y = 10; // OK @@ -55,7 +55,7 @@ exports.__esModule = true; var foo1 = require("./foo1"); var M1; (function (M1) { - var C1 = (function () { + var C1 = /** @class */ (function () { function C1() { this.m1 = new foo1.M1.C1(); this.m1.y = 10; // Error diff --git a/tests/baselines/reference/circularTypeAliasForUnionWithClass.js b/tests/baselines/reference/circularTypeAliasForUnionWithClass.js index bac0eb66b2683..1e2dfee69f811 100644 --- a/tests/baselines/reference/circularTypeAliasForUnionWithClass.js +++ b/tests/baselines/reference/circularTypeAliasForUnionWithClass.js @@ -20,19 +20,19 @@ class I4 { //// [circularTypeAliasForUnionWithClass.js] var v0; -var I0 = (function () { +var I0 = /** @class */ (function () { function I0() { } return I0; }()); var v3; -var I3 = (function () { +var I3 = /** @class */ (function () { function I3() { } return I3; }()); var v4; -var I4 = (function () { +var I4 = /** @class */ (function () { function I4() { } return I4; diff --git a/tests/baselines/reference/circularTypeofWithFunctionModule.js b/tests/baselines/reference/circularTypeofWithFunctionModule.js index a94de5d55e20c..0acd33518cf95 100644 --- a/tests/baselines/reference/circularTypeofWithFunctionModule.js +++ b/tests/baselines/reference/circularTypeofWithFunctionModule.js @@ -24,7 +24,7 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var Foo = (function () { +var Foo = /** @class */ (function () { function Foo() { } return Foo; @@ -33,7 +33,7 @@ function maker(value) { return maker.Bar; } (function (maker) { - var Bar = (function (_super) { + var Bar = /** @class */ (function (_super) { __extends(Bar, _super); function Bar() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/class2.js b/tests/baselines/reference/class2.js index 6ef78ed46ee9a..22a253bfc1900 100644 --- a/tests/baselines/reference/class2.js +++ b/tests/baselines/reference/class2.js @@ -2,7 +2,7 @@ class foo { constructor() { static f = 3; } } //// [class2.js] -var foo = (function () { +var foo = /** @class */ (function () { function foo() { } foo.f = 3; diff --git a/tests/baselines/reference/classAbstractAccessor.js b/tests/baselines/reference/classAbstractAccessor.js index d953a4ac0c22e..de6c15aa9df7b 100644 --- a/tests/baselines/reference/classAbstractAccessor.js +++ b/tests/baselines/reference/classAbstractAccessor.js @@ -8,7 +8,7 @@ abstract class A { //// [classAbstractAccessor.js] -var A = (function () { +var A = /** @class */ (function () { function A() { } Object.defineProperty(A.prototype, "aa", { diff --git a/tests/baselines/reference/classAbstractAsIdentifier.js b/tests/baselines/reference/classAbstractAsIdentifier.js index 44a2b0d331295..c36481d3d7332 100644 --- a/tests/baselines/reference/classAbstractAsIdentifier.js +++ b/tests/baselines/reference/classAbstractAsIdentifier.js @@ -6,7 +6,7 @@ class abstract { new abstract; //// [classAbstractAsIdentifier.js] -var abstract = (function () { +var abstract = /** @class */ (function () { function abstract() { } abstract.prototype.foo = function () { return 1; }; diff --git a/tests/baselines/reference/classAbstractAssignabilityConstructorFunction.js b/tests/baselines/reference/classAbstractAssignabilityConstructorFunction.js index 523f87e5a6424..07a303ea4073b 100644 --- a/tests/baselines/reference/classAbstractAssignabilityConstructorFunction.js +++ b/tests/baselines/reference/classAbstractAssignabilityConstructorFunction.js @@ -9,7 +9,7 @@ AAA = A; // error. AAA = "asdf"; //// [classAbstractAssignabilityConstructorFunction.js] -var A = (function () { +var A = /** @class */ (function () { function A() { } return A; diff --git a/tests/baselines/reference/classAbstractClinterfaceAssignability.js b/tests/baselines/reference/classAbstractClinterfaceAssignability.js index f61fb1dbbd52d..abf4a28b4bbaf 100644 --- a/tests/baselines/reference/classAbstractClinterfaceAssignability.js +++ b/tests/baselines/reference/classAbstractClinterfaceAssignability.js @@ -25,7 +25,7 @@ AAA = A; //// [classAbstractClinterfaceAssignability.js] var I; -var A = (function () { +var A = /** @class */ (function () { function A() { } return A; diff --git a/tests/baselines/reference/classAbstractConstructor.js b/tests/baselines/reference/classAbstractConstructor.js index 4dd4ee042f027..c1e51be8cb5bd 100644 --- a/tests/baselines/reference/classAbstractConstructor.js +++ b/tests/baselines/reference/classAbstractConstructor.js @@ -4,7 +4,7 @@ abstract class A { } //// [classAbstractConstructor.js] -var A = (function () { +var A = /** @class */ (function () { function A() { } return A; diff --git a/tests/baselines/reference/classAbstractConstructorAssignability.js b/tests/baselines/reference/classAbstractConstructorAssignability.js index 8376e5c1a45a8..bff955a75d6b8 100644 --- a/tests/baselines/reference/classAbstractConstructorAssignability.js +++ b/tests/baselines/reference/classAbstractConstructorAssignability.js @@ -24,19 +24,19 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var A = (function () { +var A = /** @class */ (function () { function A() { } return A; }()); -var B = (function (_super) { +var B = /** @class */ (function (_super) { __extends(B, _super); function B() { return _super !== null && _super.apply(this, arguments) || this; } return B; }(A)); -var C = (function (_super) { +var C = /** @class */ (function (_super) { __extends(C, _super); function C() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/classAbstractCrashedOnce.js b/tests/baselines/reference/classAbstractCrashedOnce.js index 7801b61cdd922..d3a6b6b72722e 100644 --- a/tests/baselines/reference/classAbstractCrashedOnce.js +++ b/tests/baselines/reference/classAbstractCrashedOnce.js @@ -21,12 +21,12 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var foo = (function () { +var foo = /** @class */ (function () { function foo() { } return foo; }()); -var bar = (function (_super) { +var bar = /** @class */ (function (_super) { __extends(bar, _super); function bar() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/classAbstractExtends.js b/tests/baselines/reference/classAbstractExtends.js index 0f63a08d2e9f0..b36cf0f20dd7f 100644 --- a/tests/baselines/reference/classAbstractExtends.js +++ b/tests/baselines/reference/classAbstractExtends.js @@ -26,34 +26,34 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var A = (function () { +var A = /** @class */ (function () { function A() { } A.prototype.foo = function () { }; return A; }()); -var B = (function (_super) { +var B = /** @class */ (function (_super) { __extends(B, _super); function B() { return _super !== null && _super.apply(this, arguments) || this; } return B; }(A)); -var C = (function (_super) { +var C = /** @class */ (function (_super) { __extends(C, _super); function C() { return _super !== null && _super.apply(this, arguments) || this; } return C; }(B)); -var D = (function (_super) { +var D = /** @class */ (function (_super) { __extends(D, _super); function D() { return _super !== null && _super.apply(this, arguments) || this; } return D; }(B)); -var E = (function (_super) { +var E = /** @class */ (function (_super) { __extends(E, _super); function E() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/classAbstractFactoryFunction.js b/tests/baselines/reference/classAbstractFactoryFunction.js index 903faf53a508e..884b4d961d821 100644 --- a/tests/baselines/reference/classAbstractFactoryFunction.js +++ b/tests/baselines/reference/classAbstractFactoryFunction.js @@ -27,12 +27,12 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var A = (function () { +var A = /** @class */ (function () { function A() { } return A; }()); -var B = (function (_super) { +var B = /** @class */ (function (_super) { __extends(B, _super); function B() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/classAbstractGeneric.js b/tests/baselines/reference/classAbstractGeneric.js index 6d20869ba73b9..808870a01a036 100644 --- a/tests/baselines/reference/classAbstractGeneric.js +++ b/tests/baselines/reference/classAbstractGeneric.js @@ -36,33 +36,33 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var A = (function () { +var A = /** @class */ (function () { function A() { } return A; }()); -var B = (function (_super) { +var B = /** @class */ (function (_super) { __extends(B, _super); function B() { return _super !== null && _super.apply(this, arguments) || this; } return B; }(A)); -var C = (function (_super) { +var C = /** @class */ (function (_super) { __extends(C, _super); function C() { return _super !== null && _super.apply(this, arguments) || this; } return C; }(A)); // error -- inherits abstract methods -var D = (function (_super) { +var D = /** @class */ (function (_super) { __extends(D, _super); function D() { return _super !== null && _super.apply(this, arguments) || this; } return D; }(A)); // error -- inherits abstract methods -var E = (function (_super) { +var E = /** @class */ (function (_super) { __extends(E, _super); function E() { return _super !== null && _super.apply(this, arguments) || this; @@ -70,7 +70,7 @@ var E = (function (_super) { E.prototype.foo = function () { return this.t; }; return E; }(A)); -var F = (function (_super) { +var F = /** @class */ (function (_super) { __extends(F, _super); function F() { return _super !== null && _super.apply(this, arguments) || this; @@ -78,7 +78,7 @@ var F = (function (_super) { F.prototype.bar = function (t) { }; return F; }(A)); -var G = (function (_super) { +var G = /** @class */ (function (_super) { __extends(G, _super); function G() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/classAbstractImportInstantiation.js b/tests/baselines/reference/classAbstractImportInstantiation.js index 4c837d67f386b..a12853bbc1226 100644 --- a/tests/baselines/reference/classAbstractImportInstantiation.js +++ b/tests/baselines/reference/classAbstractImportInstantiation.js @@ -13,7 +13,7 @@ new myA; //// [classAbstractImportInstantiation.js] var M; (function (M) { - var A = (function () { + var A = /** @class */ (function () { function A() { } return A; diff --git a/tests/baselines/reference/classAbstractInAModule.js b/tests/baselines/reference/classAbstractInAModule.js index 4bbe7a40dc54c..52bd94e44df44 100644 --- a/tests/baselines/reference/classAbstractInAModule.js +++ b/tests/baselines/reference/classAbstractInAModule.js @@ -20,13 +20,13 @@ var __extends = (this && this.__extends) || (function () { })(); var M; (function (M) { - var A = (function () { + var A = /** @class */ (function () { function A() { } return A; }()); M.A = A; - var B = (function (_super) { + var B = /** @class */ (function (_super) { __extends(B, _super); function B() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/classAbstractInheritance.js b/tests/baselines/reference/classAbstractInheritance.js index a39ef662d7662..012f63b7ccf50 100644 --- a/tests/baselines/reference/classAbstractInheritance.js +++ b/tests/baselines/reference/classAbstractInheritance.js @@ -32,66 +32,66 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var A = (function () { +var A = /** @class */ (function () { function A() { } return A; }()); -var B = (function (_super) { +var B = /** @class */ (function (_super) { __extends(B, _super); function B() { return _super !== null && _super.apply(this, arguments) || this; } return B; }(A)); -var C = (function (_super) { +var C = /** @class */ (function (_super) { __extends(C, _super); function C() { return _super !== null && _super.apply(this, arguments) || this; } return C; }(A)); -var AA = (function () { +var AA = /** @class */ (function () { function AA() { } return AA; }()); -var BB = (function (_super) { +var BB = /** @class */ (function (_super) { __extends(BB, _super); function BB() { return _super !== null && _super.apply(this, arguments) || this; } return BB; }(AA)); -var CC = (function (_super) { +var CC = /** @class */ (function (_super) { __extends(CC, _super); function CC() { return _super !== null && _super.apply(this, arguments) || this; } return CC; }(AA)); -var DD = (function (_super) { +var DD = /** @class */ (function (_super) { __extends(DD, _super); function DD() { return _super !== null && _super.apply(this, arguments) || this; } return DD; }(BB)); -var EE = (function (_super) { +var EE = /** @class */ (function (_super) { __extends(EE, _super); function EE() { return _super !== null && _super.apply(this, arguments) || this; } return EE; }(BB)); -var FF = (function (_super) { +var FF = /** @class */ (function (_super) { __extends(FF, _super); function FF() { return _super !== null && _super.apply(this, arguments) || this; } return FF; }(CC)); -var GG = (function (_super) { +var GG = /** @class */ (function (_super) { __extends(GG, _super); function GG() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/classAbstractInstantiations1.js b/tests/baselines/reference/classAbstractInstantiations1.js index df69dbac8eead..a3c29ea7a5afd 100644 --- a/tests/baselines/reference/classAbstractInstantiations1.js +++ b/tests/baselines/reference/classAbstractInstantiations1.js @@ -37,19 +37,19 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var A = (function () { +var A = /** @class */ (function () { function A() { } return A; }()); -var B = (function (_super) { +var B = /** @class */ (function (_super) { __extends(B, _super); function B() { return _super !== null && _super.apply(this, arguments) || this; } return B; }(A)); -var C = (function (_super) { +var C = /** @class */ (function (_super) { __extends(C, _super); function C() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/classAbstractInstantiations2.js b/tests/baselines/reference/classAbstractInstantiations2.js index 7d400c9fb05b2..9b304003aa809 100644 --- a/tests/baselines/reference/classAbstractInstantiations2.js +++ b/tests/baselines/reference/classAbstractInstantiations2.js @@ -62,12 +62,12 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var A = (function () { +var A = /** @class */ (function () { function A() { } return A; }()); -var B = (function () { +var B = /** @class */ (function () { function B() { } B.prototype.foo = function () { return this.bar(); }; @@ -84,21 +84,21 @@ var BB = B; new BB; // error -- BB is of type typeof B. var x = C; new x; // okay -- undefined behavior at runtime -var C = (function (_super) { +var C = /** @class */ (function (_super) { __extends(C, _super); function C() { return _super !== null && _super.apply(this, arguments) || this; } return C; }(B)); // error -- not declared abstract -var D = (function (_super) { +var D = /** @class */ (function (_super) { __extends(D, _super); function D() { return _super !== null && _super.apply(this, arguments) || this; } return D; }(B)); // okay -var E = (function (_super) { +var E = /** @class */ (function (_super) { __extends(E, _super); function E() { return _super !== null && _super.apply(this, arguments) || this; @@ -106,7 +106,7 @@ var E = (function (_super) { E.prototype.bar = function () { return 1; }; return E; }(B)); -var F = (function (_super) { +var F = /** @class */ (function (_super) { __extends(F, _super); function F() { return _super !== null && _super.apply(this, arguments) || this; @@ -114,12 +114,12 @@ var F = (function (_super) { F.prototype.bar = function () { return 2; }; return F; }(B)); -var G = (function () { +var G = /** @class */ (function () { function G() { } return G; }()); -var H = (function () { +var H = /** @class */ (function () { function H() { } return H; diff --git a/tests/baselines/reference/classAbstractManyKeywords.js b/tests/baselines/reference/classAbstractManyKeywords.js index c2af09eb4d8f8..4ac2c96c099fd 100644 --- a/tests/baselines/reference/classAbstractManyKeywords.js +++ b/tests/baselines/reference/classAbstractManyKeywords.js @@ -7,24 +7,24 @@ import abstract class D {} //// [classAbstractManyKeywords.js] "use strict"; exports.__esModule = true; -var A = (function () { +var A = /** @class */ (function () { function A() { } return A; }()); exports["default"] = A; -var B = (function () { +var B = /** @class */ (function () { function B() { } return B; }()); exports.B = B; -var C = (function () { +var C = /** @class */ (function () { function C() { } return C; }()); -var D = (function () { +var D = /** @class */ (function () { function D() { } return D; diff --git a/tests/baselines/reference/classAbstractMergedDeclaration.js b/tests/baselines/reference/classAbstractMergedDeclaration.js index d89138bd3ff36..75fa7cb1ffb62 100644 --- a/tests/baselines/reference/classAbstractMergedDeclaration.js +++ b/tests/baselines/reference/classAbstractMergedDeclaration.js @@ -41,42 +41,42 @@ new DCC1; new DCC2; //// [classAbstractMergedDeclaration.js] -var CM = (function () { +var CM = /** @class */ (function () { function CM() { } return CM; }()); -var MC = (function () { +var MC = /** @class */ (function () { function MC() { } return MC; }()); -var CI = (function () { +var CI = /** @class */ (function () { function CI() { } return CI; }()); -var IC = (function () { +var IC = /** @class */ (function () { function IC() { } return IC; }()); -var CC1 = (function () { +var CC1 = /** @class */ (function () { function CC1() { } return CC1; }()); -var CC1 = (function () { +var CC1 = /** @class */ (function () { function CC1() { } return CC1; }()); -var CC2 = (function () { +var CC2 = /** @class */ (function () { function CC2() { } return CC2; }()); -var CC2 = (function () { +var CC2 = /** @class */ (function () { function CC2() { } return CC2; diff --git a/tests/baselines/reference/classAbstractMethodInNonAbstractClass.js b/tests/baselines/reference/classAbstractMethodInNonAbstractClass.js index b4bf0595a3e48..aa2197b1ed567 100644 --- a/tests/baselines/reference/classAbstractMethodInNonAbstractClass.js +++ b/tests/baselines/reference/classAbstractMethodInNonAbstractClass.js @@ -8,12 +8,12 @@ class B { } //// [classAbstractMethodInNonAbstractClass.js] -var A = (function () { +var A = /** @class */ (function () { function A() { } return A; }()); -var B = (function () { +var B = /** @class */ (function () { function B() { } B.prototype.foo = function () { }; diff --git a/tests/baselines/reference/classAbstractMethodWithImplementation.js b/tests/baselines/reference/classAbstractMethodWithImplementation.js index aa373d1d2040f..7debbdb83d8fd 100644 --- a/tests/baselines/reference/classAbstractMethodWithImplementation.js +++ b/tests/baselines/reference/classAbstractMethodWithImplementation.js @@ -4,7 +4,7 @@ abstract class A { } //// [classAbstractMethodWithImplementation.js] -var A = (function () { +var A = /** @class */ (function () { function A() { } A.prototype.foo = function () { }; diff --git a/tests/baselines/reference/classAbstractMixedWithModifiers.js b/tests/baselines/reference/classAbstractMixedWithModifiers.js index 5343d4a394730..77e6c83431c1e 100644 --- a/tests/baselines/reference/classAbstractMixedWithModifiers.js +++ b/tests/baselines/reference/classAbstractMixedWithModifiers.js @@ -16,7 +16,7 @@ abstract class A { } //// [classAbstractMixedWithModifiers.js] -var A = (function () { +var A = /** @class */ (function () { function A() { } return A; diff --git a/tests/baselines/reference/classAbstractOverloads.js b/tests/baselines/reference/classAbstractOverloads.js index 11a694484f3e5..1f0368a2c8445 100644 --- a/tests/baselines/reference/classAbstractOverloads.js +++ b/tests/baselines/reference/classAbstractOverloads.js @@ -25,13 +25,13 @@ abstract class B { } //// [classAbstractOverloads.js] -var A = (function () { +var A = /** @class */ (function () { function A() { } A.prototype.baz = function () { }; return A; }()); -var B = (function () { +var B = /** @class */ (function () { function B() { } return B; diff --git a/tests/baselines/reference/classAbstractOverrideWithAbstract.js b/tests/baselines/reference/classAbstractOverrideWithAbstract.js index 496dc7f241a6a..40ff68d662629 100644 --- a/tests/baselines/reference/classAbstractOverrideWithAbstract.js +++ b/tests/baselines/reference/classAbstractOverrideWithAbstract.js @@ -34,26 +34,26 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var A = (function () { +var A = /** @class */ (function () { function A() { } A.prototype.foo = function () { }; return A; }()); -var B = (function (_super) { +var B = /** @class */ (function (_super) { __extends(B, _super); function B() { return _super !== null && _super.apply(this, arguments) || this; } return B; }(A)); -var AA = (function () { +var AA = /** @class */ (function () { function AA() { } AA.prototype.foo = function () { }; return AA; }()); -var BB = (function (_super) { +var BB = /** @class */ (function (_super) { __extends(BB, _super); function BB() { return _super !== null && _super.apply(this, arguments) || this; @@ -61,14 +61,14 @@ var BB = (function (_super) { BB.prototype.bar = function () { }; return BB; }(AA)); -var CC = (function (_super) { +var CC = /** @class */ (function (_super) { __extends(CC, _super); function CC() { return _super !== null && _super.apply(this, arguments) || this; } return CC; }(BB)); // error -var DD = (function (_super) { +var DD = /** @class */ (function (_super) { __extends(DD, _super); function DD() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/classAbstractProperties.js b/tests/baselines/reference/classAbstractProperties.js index b5097bc3f0d7a..ad29455723765 100644 --- a/tests/baselines/reference/classAbstractProperties.js +++ b/tests/baselines/reference/classAbstractProperties.js @@ -14,7 +14,7 @@ abstract class A { } //// [classAbstractProperties.js] -var A = (function () { +var A = /** @class */ (function () { function A() { } return A; diff --git a/tests/baselines/reference/classAbstractSingleLineDecl.js b/tests/baselines/reference/classAbstractSingleLineDecl.js index 5dfd7081339ba..aef23d55ba644 100644 --- a/tests/baselines/reference/classAbstractSingleLineDecl.js +++ b/tests/baselines/reference/classAbstractSingleLineDecl.js @@ -13,19 +13,19 @@ new B; new C; //// [classAbstractSingleLineDecl.js] -var A = (function () { +var A = /** @class */ (function () { function A() { } return A; }()); abstract; -var B = (function () { +var B = /** @class */ (function () { function B() { } return B; }()); abstract; -var C = (function () { +var C = /** @class */ (function () { function C() { } return C; diff --git a/tests/baselines/reference/classAbstractSuperCalls.js b/tests/baselines/reference/classAbstractSuperCalls.js index 9bba784ca9360..3a249e2ac63ae 100644 --- a/tests/baselines/reference/classAbstractSuperCalls.js +++ b/tests/baselines/reference/classAbstractSuperCalls.js @@ -37,13 +37,13 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var A = (function () { +var A = /** @class */ (function () { function A() { } A.prototype.foo = function () { return 1; }; return A; }()); -var B = (function (_super) { +var B = /** @class */ (function (_super) { __extends(B, _super); function B() { return _super !== null && _super.apply(this, arguments) || this; @@ -52,7 +52,7 @@ var B = (function (_super) { B.prototype.baz = function () { return this.foo; }; return B; }(A)); -var C = (function (_super) { +var C = /** @class */ (function (_super) { __extends(C, _super); function C() { return _super !== null && _super.apply(this, arguments) || this; @@ -62,14 +62,14 @@ var C = (function (_super) { C.prototype.norf = function () { return _super.prototype.bar.call(this); }; return C; }(B)); -var AA = (function () { +var AA = /** @class */ (function () { function AA() { } AA.prototype.foo = function () { return 1; }; AA.prototype.bar = function () { return this.foo(); }; return AA; }()); -var BB = (function (_super) { +var BB = /** @class */ (function (_super) { __extends(BB, _super); function BB() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/classAbstractUsingAbstractMethod1.js b/tests/baselines/reference/classAbstractUsingAbstractMethod1.js index 8781fc6c05fc0..e83d5041e553b 100644 --- a/tests/baselines/reference/classAbstractUsingAbstractMethod1.js +++ b/tests/baselines/reference/classAbstractUsingAbstractMethod1.js @@ -28,12 +28,12 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var A = (function () { +var A = /** @class */ (function () { function A() { } return A; }()); -var B = (function (_super) { +var B = /** @class */ (function (_super) { __extends(B, _super); function B() { return _super !== null && _super.apply(this, arguments) || this; @@ -41,7 +41,7 @@ var B = (function (_super) { B.prototype.foo = function () { return 1; }; return B; }(A)); -var C = (function (_super) { +var C = /** @class */ (function (_super) { __extends(C, _super); function C() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/classAbstractUsingAbstractMethods2.js b/tests/baselines/reference/classAbstractUsingAbstractMethods2.js index 6016ab249f1a0..23d31663886b9 100644 --- a/tests/baselines/reference/classAbstractUsingAbstractMethods2.js +++ b/tests/baselines/reference/classAbstractUsingAbstractMethods2.js @@ -38,26 +38,26 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var A = (function () { +var A = /** @class */ (function () { function A() { } return A; }()); -var B = (function (_super) { +var B = /** @class */ (function (_super) { __extends(B, _super); function B() { return _super !== null && _super.apply(this, arguments) || this; } return B; }(A)); -var C = (function (_super) { +var C = /** @class */ (function (_super) { __extends(C, _super); function C() { return _super !== null && _super.apply(this, arguments) || this; } return C; }(A)); -var D = (function (_super) { +var D = /** @class */ (function (_super) { __extends(D, _super); function D() { return _super !== null && _super.apply(this, arguments) || this; @@ -65,7 +65,7 @@ var D = (function (_super) { D.prototype.foo = function () { }; return D; }(A)); -var E = (function (_super) { +var E = /** @class */ (function (_super) { __extends(E, _super); function E() { return _super !== null && _super.apply(this, arguments) || this; @@ -73,26 +73,26 @@ var E = (function (_super) { E.prototype.foo = function () { }; return E; }(A)); -var AA = (function () { +var AA = /** @class */ (function () { function AA() { } return AA; }()); -var BB = (function (_super) { +var BB = /** @class */ (function (_super) { __extends(BB, _super); function BB() { return _super !== null && _super.apply(this, arguments) || this; } return BB; }(AA)); -var CC = (function (_super) { +var CC = /** @class */ (function (_super) { __extends(CC, _super); function CC() { return _super !== null && _super.apply(this, arguments) || this; } return CC; }(AA)); -var DD = (function (_super) { +var DD = /** @class */ (function (_super) { __extends(DD, _super); function DD() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/classAndInterfaceWithSameName.js b/tests/baselines/reference/classAndInterfaceWithSameName.js index 4a5c64ee553ff..964cd8cd32247 100644 --- a/tests/baselines/reference/classAndInterfaceWithSameName.js +++ b/tests/baselines/reference/classAndInterfaceWithSameName.js @@ -13,14 +13,14 @@ module M { } //// [classAndInterfaceWithSameName.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } return C; }()); var M; (function (M) { - var D = (function () { + var D = /** @class */ (function () { function D() { } return D; diff --git a/tests/baselines/reference/classAndVariableWithSameName.js b/tests/baselines/reference/classAndVariableWithSameName.js index 1a88efcf19b43..8ceaa91a73d51 100644 --- a/tests/baselines/reference/classAndVariableWithSameName.js +++ b/tests/baselines/reference/classAndVariableWithSameName.js @@ -11,7 +11,7 @@ module M { } //// [classAndVariableWithSameName.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } return C; @@ -19,7 +19,7 @@ var C = (function () { var C = ''; // error var M; (function (M) { - var D = (function () { + var D = /** @class */ (function () { function D() { } return D; diff --git a/tests/baselines/reference/classAppearsToHaveMembersOfObject.js b/tests/baselines/reference/classAppearsToHaveMembersOfObject.js index e8f15583ebc99..e3fe521bba00a 100644 --- a/tests/baselines/reference/classAppearsToHaveMembersOfObject.js +++ b/tests/baselines/reference/classAppearsToHaveMembersOfObject.js @@ -9,7 +9,7 @@ var o2: {} = c; //// [classAppearsToHaveMembersOfObject.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } return C; diff --git a/tests/baselines/reference/classBlockScoping.js b/tests/baselines/reference/classBlockScoping.js index 3cae2d3cb7d1b..f5a642ed8fc25 100644 --- a/tests/baselines/reference/classBlockScoping.js +++ b/tests/baselines/reference/classBlockScoping.js @@ -37,7 +37,7 @@ function f(b: boolean) { function f(b) { var Foo; if (b) { - Foo = (_a = (function () { + Foo = (_a = /** @class */ (function () { function Foo() { } Foo.x = function () { @@ -53,7 +53,7 @@ function f(b) { new Foo(); } else { - var Foo_1 = (function () { + var Foo_1 = /** @class */ (function () { function Foo() { } Foo.x = function () { diff --git a/tests/baselines/reference/classBodyWithStatements.js b/tests/baselines/reference/classBodyWithStatements.js index a40d27e14ec48..24eee7089660d 100644 --- a/tests/baselines/reference/classBodyWithStatements.js +++ b/tests/baselines/reference/classBodyWithStatements.js @@ -14,13 +14,13 @@ class C3 { } //// [classBodyWithStatements.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } return C; }()); var x = 1; -var C2 = (function () { +var C2 = /** @class */ (function () { function C2() { } return C2; @@ -28,7 +28,7 @@ var C2 = (function () { function foo() { } var x = 1; var y = 2; -var C3 = (function () { +var C3 = /** @class */ (function () { function C3() { this.x = y + 1; // ok, need a var in the statement production } diff --git a/tests/baselines/reference/classCannotExtendVar.js b/tests/baselines/reference/classCannotExtendVar.js index a126a07a2eb1b..c242c99902f47 100644 --- a/tests/baselines/reference/classCannotExtendVar.js +++ b/tests/baselines/reference/classCannotExtendVar.js @@ -9,7 +9,7 @@ class Markup { //// [classCannotExtendVar.js] var Markup; -var Markup = (function () { +var Markup = /** @class */ (function () { function Markup() { } return Markup; diff --git a/tests/baselines/reference/classConstructorAccessibility.js b/tests/baselines/reference/classConstructorAccessibility.js index 4d120a3980f58..c5803fc98f676 100644 --- a/tests/baselines/reference/classConstructorAccessibility.js +++ b/tests/baselines/reference/classConstructorAccessibility.js @@ -35,19 +35,19 @@ module Generic { //// [classConstructorAccessibility.js] -var C = (function () { +var C = /** @class */ (function () { function C(x) { this.x = x; } return C; }()); -var D = (function () { +var D = /** @class */ (function () { function D(x) { this.x = x; } return D; }()); -var E = (function () { +var E = /** @class */ (function () { function E(x) { this.x = x; } @@ -58,19 +58,19 @@ var d = new D(1); // error var e = new E(1); // error var Generic; (function (Generic) { - var C = (function () { + var C = /** @class */ (function () { function C(x) { this.x = x; } return C; }()); - var D = (function () { + var D = /** @class */ (function () { function D(x) { this.x = x; } return D; }()); - var E = (function () { + var E = /** @class */ (function () { function E(x) { this.x = x; } diff --git a/tests/baselines/reference/classConstructorAccessibility2.js b/tests/baselines/reference/classConstructorAccessibility2.js index 76c8ea1911031..336df307ebb38 100644 --- a/tests/baselines/reference/classConstructorAccessibility2.js +++ b/tests/baselines/reference/classConstructorAccessibility2.js @@ -56,21 +56,21 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var BaseA = (function () { +var BaseA = /** @class */ (function () { function BaseA(x) { this.x = x; } BaseA.prototype.createInstance = function () { new BaseA(1); }; return BaseA; }()); -var BaseB = (function () { +var BaseB = /** @class */ (function () { function BaseB(x) { this.x = x; } BaseB.prototype.createInstance = function () { new BaseB(2); }; return BaseB; }()); -var BaseC = (function () { +var BaseC = /** @class */ (function () { function BaseC(x) { this.x = x; } @@ -78,7 +78,7 @@ var BaseC = (function () { BaseC.staticInstance = function () { new BaseC(4); }; return BaseC; }()); -var DerivedA = (function (_super) { +var DerivedA = /** @class */ (function (_super) { __extends(DerivedA, _super); function DerivedA(x) { var _this = _super.call(this, x) || this; @@ -90,7 +90,7 @@ var DerivedA = (function (_super) { DerivedA.staticBaseInstance = function () { new BaseA(7); }; return DerivedA; }(BaseA)); -var DerivedB = (function (_super) { +var DerivedB = /** @class */ (function (_super) { __extends(DerivedB, _super); function DerivedB(x) { var _this = _super.call(this, x) || this; @@ -102,7 +102,7 @@ var DerivedB = (function (_super) { DerivedB.staticBaseInstance = function () { new BaseB(9); }; // ok return DerivedB; }(BaseB)); -var DerivedC = (function (_super) { +var DerivedC = /** @class */ (function (_super) { __extends(DerivedC, _super); function DerivedC(x) { var _this = _super.call(this, x) || this; diff --git a/tests/baselines/reference/classConstructorAccessibility3.js b/tests/baselines/reference/classConstructorAccessibility3.js index d1bd8f38c40da..e4d06db5752a8 100644 --- a/tests/baselines/reference/classConstructorAccessibility3.js +++ b/tests/baselines/reference/classConstructorAccessibility3.js @@ -34,25 +34,25 @@ c = Bar; c = Baz; //// [classConstructorAccessibility3.js] -var Foo = (function () { +var Foo = /** @class */ (function () { function Foo(x) { this.x = x; } return Foo; }()); -var Bar = (function () { +var Bar = /** @class */ (function () { function Bar(x) { this.x = x; } return Bar; }()); -var Baz = (function () { +var Baz = /** @class */ (function () { function Baz(x) { this.x = x; } return Baz; }()); -var Qux = (function () { +var Qux = /** @class */ (function () { function Qux(x) { this.x = x; } diff --git a/tests/baselines/reference/classConstructorAccessibility4.js b/tests/baselines/reference/classConstructorAccessibility4.js index 032d4f8c13d7b..9c8b4755338bf 100644 --- a/tests/baselines/reference/classConstructorAccessibility4.js +++ b/tests/baselines/reference/classConstructorAccessibility4.js @@ -40,11 +40,11 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var A = (function () { +var A = /** @class */ (function () { function A() { } A.prototype.method = function () { - var B = (function () { + var B = /** @class */ (function () { function B() { } B.prototype.method = function () { @@ -52,7 +52,7 @@ var A = (function () { }; return B; }()); - var C = (function (_super) { + var C = /** @class */ (function (_super) { __extends(C, _super); function C() { return _super !== null && _super.apply(this, arguments) || this; @@ -62,11 +62,11 @@ var A = (function () { }; return A; }()); -var D = (function () { +var D = /** @class */ (function () { function D() { } D.prototype.method = function () { - var E = (function () { + var E = /** @class */ (function () { function E() { } E.prototype.method = function () { @@ -74,7 +74,7 @@ var D = (function () { }; return E; }()); - var F = (function (_super) { + var F = /** @class */ (function (_super) { __extends(F, _super); function F() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/classConstructorAccessibility5.js b/tests/baselines/reference/classConstructorAccessibility5.js index d409265d89ded..ff1e31952bd89 100644 --- a/tests/baselines/reference/classConstructorAccessibility5.js +++ b/tests/baselines/reference/classConstructorAccessibility5.js @@ -22,12 +22,12 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var Base = (function () { +var Base = /** @class */ (function () { function Base() { } return Base; }()); -var Derived = (function (_super) { +var Derived = /** @class */ (function (_super) { __extends(Derived, _super); function Derived() { return _super !== null && _super.apply(this, arguments) || this; @@ -35,7 +35,7 @@ var Derived = (function (_super) { Derived.make = function () { new Base(); }; // ok return Derived; }(Base)); -var Unrelated = (function () { +var Unrelated = /** @class */ (function () { function Unrelated() { } Unrelated.fake = function () { new Base(); }; // error diff --git a/tests/baselines/reference/classConstructorOverloadsAccessibility.js b/tests/baselines/reference/classConstructorOverloadsAccessibility.js index 2a173966d5d2f..eda615c2feac2 100644 --- a/tests/baselines/reference/classConstructorOverloadsAccessibility.js +++ b/tests/baselines/reference/classConstructorOverloadsAccessibility.js @@ -33,22 +33,22 @@ class D { } //// [classConstructorOverloadsAccessibility.js] -var A = (function () { +var A = /** @class */ (function () { function A() { } return A; }()); -var B = (function () { +var B = /** @class */ (function () { function B() { } return B; }()); -var C = (function () { +var C = /** @class */ (function () { function C() { } return C; }()); -var D = (function () { +var D = /** @class */ (function () { function D() { } return D; diff --git a/tests/baselines/reference/classConstructorParametersAccessibility.js b/tests/baselines/reference/classConstructorParametersAccessibility.js index 497f662a8b05f..ba8307f1bad3d 100644 --- a/tests/baselines/reference/classConstructorParametersAccessibility.js +++ b/tests/baselines/reference/classConstructorParametersAccessibility.js @@ -37,7 +37,7 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var C1 = (function () { +var C1 = /** @class */ (function () { function C1(x) { this.x = x; } @@ -45,7 +45,7 @@ var C1 = (function () { }()); var c1; c1.x; // OK -var C2 = (function () { +var C2 = /** @class */ (function () { function C2(p) { this.p = p; } @@ -53,7 +53,7 @@ var C2 = (function () { }()); var c2; c2.p; // private, error -var C3 = (function () { +var C3 = /** @class */ (function () { function C3(p) { this.p = p; } @@ -61,7 +61,7 @@ var C3 = (function () { }()); var c3; c3.p; // protected, error -var Derived = (function (_super) { +var Derived = /** @class */ (function (_super) { __extends(Derived, _super); function Derived(p) { var _this = _super.call(this, p) || this; diff --git a/tests/baselines/reference/classConstructorParametersAccessibility2.js b/tests/baselines/reference/classConstructorParametersAccessibility2.js index 7a885bbd8d61f..016a66f72e94e 100644 --- a/tests/baselines/reference/classConstructorParametersAccessibility2.js +++ b/tests/baselines/reference/classConstructorParametersAccessibility2.js @@ -37,7 +37,7 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var C1 = (function () { +var C1 = /** @class */ (function () { function C1(x) { this.x = x; } @@ -45,7 +45,7 @@ var C1 = (function () { }()); var c1; c1.x; // OK -var C2 = (function () { +var C2 = /** @class */ (function () { function C2(p) { this.p = p; } @@ -53,7 +53,7 @@ var C2 = (function () { }()); var c2; c2.p; // private, error -var C3 = (function () { +var C3 = /** @class */ (function () { function C3(p) { this.p = p; } @@ -61,7 +61,7 @@ var C3 = (function () { }()); var c3; c3.p; // protected, error -var Derived = (function (_super) { +var Derived = /** @class */ (function (_super) { __extends(Derived, _super); function Derived(p) { var _this = _super.call(this, p) || this; diff --git a/tests/baselines/reference/classConstructorParametersAccessibility3.js b/tests/baselines/reference/classConstructorParametersAccessibility3.js index f96f0171046d9..04bcd5ff6fafc 100644 --- a/tests/baselines/reference/classConstructorParametersAccessibility3.js +++ b/tests/baselines/reference/classConstructorParametersAccessibility3.js @@ -24,13 +24,13 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var Base = (function () { +var Base = /** @class */ (function () { function Base(p) { this.p = p; } return Base; }()); -var Derived = (function (_super) { +var Derived = /** @class */ (function (_super) { __extends(Derived, _super); function Derived(p) { var _this = _super.call(this, p) || this; diff --git a/tests/baselines/reference/classDeclarationBlockScoping1.js b/tests/baselines/reference/classDeclarationBlockScoping1.js index 03c6254d9ea1d..cc9c81a70d307 100644 --- a/tests/baselines/reference/classDeclarationBlockScoping1.js +++ b/tests/baselines/reference/classDeclarationBlockScoping1.js @@ -8,13 +8,13 @@ class C { } //// [classDeclarationBlockScoping1.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } return C; }()); { - var C_1 = (function () { + var C_1 = /** @class */ (function () { function C() { } return C; diff --git a/tests/baselines/reference/classDeclarationBlockScoping2.js b/tests/baselines/reference/classDeclarationBlockScoping2.js index 7cc8a064a0cbc..7d62392e19bb3 100644 --- a/tests/baselines/reference/classDeclarationBlockScoping2.js +++ b/tests/baselines/reference/classDeclarationBlockScoping2.js @@ -11,14 +11,14 @@ function f() { //// [classDeclarationBlockScoping2.js] function f() { - var C = (function () { + var C = /** @class */ (function () { function C() { } return C; }()); var c1 = C; { - var C_1 = (function () { + var C_1 = /** @class */ (function () { function C() { } return C; diff --git a/tests/baselines/reference/classDeclarationCheckUsedBeforeDefinitionInFunctionDeclaration.js b/tests/baselines/reference/classDeclarationCheckUsedBeforeDefinitionInFunctionDeclaration.js index 195cd78f35908..56bf38145a05c 100644 --- a/tests/baselines/reference/classDeclarationCheckUsedBeforeDefinitionInFunctionDeclaration.js +++ b/tests/baselines/reference/classDeclarationCheckUsedBeforeDefinitionInFunctionDeclaration.js @@ -8,7 +8,7 @@ class C2 { } function f() { new C2(); // OK } -var C2 = (function () { +var C2 = /** @class */ (function () { function C2() { } return C2; diff --git a/tests/baselines/reference/classDeclarationMergedInModuleWithContinuation.js b/tests/baselines/reference/classDeclarationMergedInModuleWithContinuation.js index 4a0edb610d526..f003d9dcfca5f 100644 --- a/tests/baselines/reference/classDeclarationMergedInModuleWithContinuation.js +++ b/tests/baselines/reference/classDeclarationMergedInModuleWithContinuation.js @@ -24,7 +24,7 @@ var __extends = (this && this.__extends) || (function () { })(); var M; (function (M) { - var N = (function () { + var N = /** @class */ (function () { function N() { } return N; @@ -35,7 +35,7 @@ var M; })(N = M.N || (M.N = {})); })(M || (M = {})); (function (M) { - var O = (function (_super) { + var O = /** @class */ (function (_super) { __extends(O, _super); function O() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/classDeclaredBeforeClassFactory.js b/tests/baselines/reference/classDeclaredBeforeClassFactory.js index 40cfd576644af..5d77b0962a971 100644 --- a/tests/baselines/reference/classDeclaredBeforeClassFactory.js +++ b/tests/baselines/reference/classDeclaredBeforeClassFactory.js @@ -19,7 +19,7 @@ var __extends = (this && this.__extends) || (function () { }; })(); // Should be OK due to hoisting -var Derived = (function (_super) { +var Derived = /** @class */ (function (_super) { __extends(Derived, _super); function Derived() { return _super !== null && _super.apply(this, arguments) || this; @@ -27,7 +27,7 @@ var Derived = (function (_super) { return Derived; }(makeBaseClass())); function makeBaseClass() { - return (function () { + return /** @class */ (function () { function Base() { } return Base; diff --git a/tests/baselines/reference/classDoesNotDependOnBaseTypes.js b/tests/baselines/reference/classDoesNotDependOnBaseTypes.js index 5b9892b9ab816..73c7530ff985a 100644 --- a/tests/baselines/reference/classDoesNotDependOnBaseTypes.js +++ b/tests/baselines/reference/classDoesNotDependOnBaseTypes.js @@ -23,12 +23,12 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var StringTreeCollectionBase = (function () { +var StringTreeCollectionBase = /** @class */ (function () { function StringTreeCollectionBase() { } return StringTreeCollectionBase; }()); -var StringTreeCollection = (function (_super) { +var StringTreeCollection = /** @class */ (function (_super) { __extends(StringTreeCollection, _super); function StringTreeCollection() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/classDoesNotDependOnPrivateMember.js b/tests/baselines/reference/classDoesNotDependOnPrivateMember.js index 3fe2c5920705e..124633d305859 100644 --- a/tests/baselines/reference/classDoesNotDependOnPrivateMember.js +++ b/tests/baselines/reference/classDoesNotDependOnPrivateMember.js @@ -9,7 +9,7 @@ module M { //// [classDoesNotDependOnPrivateMember.js] var M; (function (M) { - var C = (function () { + var C = /** @class */ (function () { function C() { } return C; diff --git a/tests/baselines/reference/classExpression.js b/tests/baselines/reference/classExpression.js index d30ddd39be888..8764060eabf28 100644 --- a/tests/baselines/reference/classExpression.js +++ b/tests/baselines/reference/classExpression.js @@ -13,13 +13,13 @@ module M { } //// [classExpression.js] -var x = (function () { +var x = /** @class */ (function () { function C() { } return C; }()); var y = { - foo: (function () { + foo: /** @class */ (function () { function C2() { } return C2; @@ -27,7 +27,7 @@ var y = { }; var M; (function (M) { - var z = (function () { + var z = /** @class */ (function () { function C4() { } return C4; diff --git a/tests/baselines/reference/classExpression1.js b/tests/baselines/reference/classExpression1.js index 05375bb810bd0..6dc9dd9d2c290 100644 --- a/tests/baselines/reference/classExpression1.js +++ b/tests/baselines/reference/classExpression1.js @@ -2,7 +2,7 @@ var v = class C {}; //// [classExpression1.js] -var v = (function () { +var v = /** @class */ (function () { function C() { } return C; diff --git a/tests/baselines/reference/classExpression2.js b/tests/baselines/reference/classExpression2.js index 7f48463e81a25..3f812bb26bb88 100644 --- a/tests/baselines/reference/classExpression2.js +++ b/tests/baselines/reference/classExpression2.js @@ -13,12 +13,12 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var D = (function () { +var D = /** @class */ (function () { function D() { } return D; }()); -var v = (function (_super) { +var v = /** @class */ (function (_super) { __extends(C, _super); function C() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/classExpression3.js b/tests/baselines/reference/classExpression3.js index 2582aa803984c..8753c370d6c28 100644 --- a/tests/baselines/reference/classExpression3.js +++ b/tests/baselines/reference/classExpression3.js @@ -17,7 +17,7 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var C = (function (_super) { +var C = /** @class */ (function (_super) { __extends(class_1, _super); function class_1() { var _this = _super !== null && _super.apply(this, arguments) || this; @@ -25,7 +25,7 @@ var C = (function (_super) { return _this; } return class_1; -}((function (_super) { +}(/** @class */ (function (_super) { __extends(class_2, _super); function class_2() { var _this = _super !== null && _super.apply(this, arguments) || this; @@ -33,7 +33,7 @@ var C = (function (_super) { return _this; } return class_2; -}((function () { +}(/** @class */ (function () { function class_3() { this.a = 1; } diff --git a/tests/baselines/reference/classExpression4.js b/tests/baselines/reference/classExpression4.js index 7bdc8bd06ef64..b2ad6db6b2c66 100644 --- a/tests/baselines/reference/classExpression4.js +++ b/tests/baselines/reference/classExpression4.js @@ -8,7 +8,7 @@ let x = (new C).foo(); //// [classExpression4.js] -var C = (function () { +var C = /** @class */ (function () { function class_1() { } class_1.prototype.foo = function () { diff --git a/tests/baselines/reference/classExpression5.js b/tests/baselines/reference/classExpression5.js index fae615d3a553c..c9c78d7df5207 100644 --- a/tests/baselines/reference/classExpression5.js +++ b/tests/baselines/reference/classExpression5.js @@ -6,7 +6,7 @@ new class { }().hi(); //// [classExpression5.js] -new (function () { +new /** @class */ (function () { function class_1() { } class_1.prototype.hi = function () { diff --git a/tests/baselines/reference/classExpressionExtendingAbstractClass.js b/tests/baselines/reference/classExpressionExtendingAbstractClass.js index 814753be4d72f..0cfe71b42ca24 100644 --- a/tests/baselines/reference/classExpressionExtendingAbstractClass.js +++ b/tests/baselines/reference/classExpressionExtendingAbstractClass.js @@ -19,12 +19,12 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var A = (function () { +var A = /** @class */ (function () { function A() { } return A; }()); -var C = (function (_super) { +var C = /** @class */ (function (_super) { __extends(class_1, _super); function class_1() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/classExpressionTest1.js b/tests/baselines/reference/classExpressionTest1.js index 6b799c12f0413..4589365f83b37 100644 --- a/tests/baselines/reference/classExpressionTest1.js +++ b/tests/baselines/reference/classExpressionTest1.js @@ -14,7 +14,7 @@ function M() { //// [classExpressionTest1.js] function M() { - var C = (function () { + var C = /** @class */ (function () { function C() { } C.prototype.f = function () { diff --git a/tests/baselines/reference/classExpressionTest2.js b/tests/baselines/reference/classExpressionTest2.js index 761af899759dd..3c9faee6c305e 100644 --- a/tests/baselines/reference/classExpressionTest2.js +++ b/tests/baselines/reference/classExpressionTest2.js @@ -14,7 +14,7 @@ function M() { //// [classExpressionTest2.js] function M() { - var m = (function () { + var m = /** @class */ (function () { function C() { } C.prototype.f = function () { diff --git a/tests/baselines/reference/classExpressionWithDecorator1.js b/tests/baselines/reference/classExpressionWithDecorator1.js index e051e05251bb6..e96bc7d46d2cb 100644 --- a/tests/baselines/reference/classExpressionWithDecorator1.js +++ b/tests/baselines/reference/classExpressionWithDecorator1.js @@ -9,7 +9,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key, return c > 3 && r && Object.defineProperty(target, key, r), r; }; var v = ; -var C = (function () { +var C = /** @class */ (function () { function C() { } C.p = 1; diff --git a/tests/baselines/reference/classExpressionWithResolutionOfNamespaceOfSameName01.js b/tests/baselines/reference/classExpressionWithResolutionOfNamespaceOfSameName01.js index e13e0de6b78b6..841f7ecbb698a 100644 --- a/tests/baselines/reference/classExpressionWithResolutionOfNamespaceOfSameName01.js +++ b/tests/baselines/reference/classExpressionWithResolutionOfNamespaceOfSameName01.js @@ -9,7 +9,7 @@ var x = class C { } //// [classExpressionWithResolutionOfNamespaceOfSameName01.js] -var x = (function () { +var x = /** @class */ (function () { function C() { } return C; diff --git a/tests/baselines/reference/classExpressionWithStaticProperties1.js b/tests/baselines/reference/classExpressionWithStaticProperties1.js index 205f59367ccba..03b67b3288626 100644 --- a/tests/baselines/reference/classExpressionWithStaticProperties1.js +++ b/tests/baselines/reference/classExpressionWithStaticProperties1.js @@ -6,7 +6,7 @@ var v = class C { }; //// [classExpressionWithStaticProperties1.js] -var v = (_a = (function () { +var v = (_a = /** @class */ (function () { function C() { } return C; diff --git a/tests/baselines/reference/classExpressionWithStaticProperties2.js b/tests/baselines/reference/classExpressionWithStaticProperties2.js index eb1c2da2e216e..f142f10cc33d9 100644 --- a/tests/baselines/reference/classExpressionWithStaticProperties2.js +++ b/tests/baselines/reference/classExpressionWithStaticProperties2.js @@ -9,7 +9,7 @@ var v = class C { }; //// [classExpressionWithStaticProperties2.js] -var v = (_a = (function () { +var v = (_a = /** @class */ (function () { function C() { } return C; diff --git a/tests/baselines/reference/classExpressionWithStaticProperties3.js b/tests/baselines/reference/classExpressionWithStaticProperties3.js index ca6f6608b7548..4a7ff96751c75 100644 --- a/tests/baselines/reference/classExpressionWithStaticProperties3.js +++ b/tests/baselines/reference/classExpressionWithStaticProperties3.js @@ -12,7 +12,7 @@ arr.forEach(C => console.log(C.y())); //// [classExpressionWithStaticProperties3.js] var arr = []; var _loop_1 = function (i) { - arr.push((_a = (function () { + arr.push((_a = /** @class */ (function () { function C() { } return C; diff --git a/tests/baselines/reference/classExpressions.js b/tests/baselines/reference/classExpressions.js index 3932fa5045b2c..0db1111e2aa6a 100644 --- a/tests/baselines/reference/classExpressions.js +++ b/tests/baselines/reference/classExpressions.js @@ -9,7 +9,7 @@ let x = class B implements A { }; //// [classExpressions.js] -var x = (function () { +var x = /** @class */ (function () { function B() { this.func = function () { }; diff --git a/tests/baselines/reference/classExtendingBuiltinType.js b/tests/baselines/reference/classExtendingBuiltinType.js index 6fdead50a442e..959a17fbc53ae 100644 --- a/tests/baselines/reference/classExtendingBuiltinType.js +++ b/tests/baselines/reference/classExtendingBuiltinType.js @@ -22,70 +22,70 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var C1 = (function (_super) { +var C1 = /** @class */ (function (_super) { __extends(C1, _super); function C1() { return _super !== null && _super.apply(this, arguments) || this; } return C1; }(Object)); -var C2 = (function (_super) { +var C2 = /** @class */ (function (_super) { __extends(C2, _super); function C2() { return _super !== null && _super.apply(this, arguments) || this; } return C2; }(Function)); -var C3 = (function (_super) { +var C3 = /** @class */ (function (_super) { __extends(C3, _super); function C3() { return _super !== null && _super.apply(this, arguments) || this; } return C3; }(String)); -var C4 = (function (_super) { +var C4 = /** @class */ (function (_super) { __extends(C4, _super); function C4() { return _super !== null && _super.apply(this, arguments) || this; } return C4; }(Boolean)); -var C5 = (function (_super) { +var C5 = /** @class */ (function (_super) { __extends(C5, _super); function C5() { return _super !== null && _super.apply(this, arguments) || this; } return C5; }(Number)); -var C6 = (function (_super) { +var C6 = /** @class */ (function (_super) { __extends(C6, _super); function C6() { return _super !== null && _super.apply(this, arguments) || this; } return C6; }(Date)); -var C7 = (function (_super) { +var C7 = /** @class */ (function (_super) { __extends(C7, _super); function C7() { return _super !== null && _super.apply(this, arguments) || this; } return C7; }(RegExp)); -var C8 = (function (_super) { +var C8 = /** @class */ (function (_super) { __extends(C8, _super); function C8() { return _super !== null && _super.apply(this, arguments) || this; } return C8; }(Error)); -var C9 = (function (_super) { +var C9 = /** @class */ (function (_super) { __extends(C9, _super); function C9() { return _super !== null && _super.apply(this, arguments) || this; } return C9; }(Array)); -var C10 = (function (_super) { +var C10 = /** @class */ (function (_super) { __extends(C10, _super); function C10() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/classExtendingClass.js b/tests/baselines/reference/classExtendingClass.js index 52b415ccb779d..e486ddf69136b 100644 --- a/tests/baselines/reference/classExtendingClass.js +++ b/tests/baselines/reference/classExtendingClass.js @@ -42,14 +42,14 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var C = (function () { +var C = /** @class */ (function () { function C() { } C.prototype.thing = function () { }; C.other = function () { }; return C; }()); -var D = (function (_super) { +var D = /** @class */ (function (_super) { __extends(D, _super); function D() { return _super !== null && _super.apply(this, arguments) || this; @@ -61,14 +61,14 @@ var r = d.foo; var r2 = d.bar; var r3 = d.thing(); var r4 = D.other(); -var C2 = (function () { +var C2 = /** @class */ (function () { function C2() { } C2.prototype.thing = function (x) { }; C2.other = function (x) { }; return C2; }()); -var D2 = (function (_super) { +var D2 = /** @class */ (function (_super) { __extends(D2, _super); function D2() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/classExtendingClassLikeType.js b/tests/baselines/reference/classExtendingClassLikeType.js index 6ba82a0a08be6..cd6c7394c19e7 100644 --- a/tests/baselines/reference/classExtendingClassLikeType.js +++ b/tests/baselines/reference/classExtendingClassLikeType.js @@ -70,14 +70,14 @@ var __extends = (this && this.__extends) || (function () { }; })(); // Error, no Base constructor function -var D0 = (function (_super) { +var D0 = /** @class */ (function (_super) { __extends(D0, _super); function D0() { return _super !== null && _super.apply(this, arguments) || this; } return D0; }(Base)); -var D1 = (function (_super) { +var D1 = /** @class */ (function (_super) { __extends(D1, _super); function D1() { var _this = _super.call(this, "abc", "def") || this; @@ -87,7 +87,7 @@ var D1 = (function (_super) { } return D1; }(getBase())); -var D2 = (function (_super) { +var D2 = /** @class */ (function (_super) { __extends(D2, _super); function D2() { var _this = _super.call(this, 10) || this; @@ -98,7 +98,7 @@ var D2 = (function (_super) { } return D2; }(getBase())); -var D3 = (function (_super) { +var D3 = /** @class */ (function (_super) { __extends(D3, _super); function D3() { var _this = _super.call(this, "abc", 42) || this; @@ -109,7 +109,7 @@ var D3 = (function (_super) { return D3; }(getBase())); // Error, no constructors with three type arguments -var D4 = (function (_super) { +var D4 = /** @class */ (function (_super) { __extends(D4, _super); function D4() { return _super !== null && _super.apply(this, arguments) || this; @@ -117,7 +117,7 @@ var D4 = (function (_super) { return D4; }(getBase())); // Error, constructor return types differ -var D5 = (function (_super) { +var D5 = /** @class */ (function (_super) { __extends(D5, _super); function D5() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/classExtendingNonConstructor.js b/tests/baselines/reference/classExtendingNonConstructor.js index bfe716b002978..770364aa63df1 100644 --- a/tests/baselines/reference/classExtendingNonConstructor.js +++ b/tests/baselines/reference/classExtendingNonConstructor.js @@ -29,49 +29,49 @@ var x; function foo() { this.x = 1; } -var C1 = (function (_super) { +var C1 = /** @class */ (function (_super) { __extends(C1, _super); function C1() { return _super !== null && _super.apply(this, arguments) || this; } return C1; }(undefined)); -var C2 = (function (_super) { +var C2 = /** @class */ (function (_super) { __extends(C2, _super); function C2() { return _super !== null && _super.apply(this, arguments) || this; } return C2; }(true)); -var C3 = (function (_super) { +var C3 = /** @class */ (function (_super) { __extends(C3, _super); function C3() { return _super !== null && _super.apply(this, arguments) || this; } return C3; }(false)); -var C4 = (function (_super) { +var C4 = /** @class */ (function (_super) { __extends(C4, _super); function C4() { return _super !== null && _super.apply(this, arguments) || this; } return C4; }(42)); -var C5 = (function (_super) { +var C5 = /** @class */ (function (_super) { __extends(C5, _super); function C5() { return _super !== null && _super.apply(this, arguments) || this; } return C5; }("hello")); -var C6 = (function (_super) { +var C6 = /** @class */ (function (_super) { __extends(C6, _super); function C6() { return _super !== null && _super.apply(this, arguments) || this; } return C6; }(x)); -var C7 = (function (_super) { +var C7 = /** @class */ (function (_super) { __extends(C7, _super); function C7() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/classExtendingNull.js b/tests/baselines/reference/classExtendingNull.js index 6725bcc7d9e5a..6c6ae8a016720 100644 --- a/tests/baselines/reference/classExtendingNull.js +++ b/tests/baselines/reference/classExtendingNull.js @@ -14,13 +14,13 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var C1 = (function (_super) { +var C1 = /** @class */ (function (_super) { __extends(C1, _super); function C1() { } return C1; }(null)); -var C2 = (function (_super) { +var C2 = /** @class */ (function (_super) { __extends(C2, _super); function C2() { } diff --git a/tests/baselines/reference/classExtendingPrimitive.js b/tests/baselines/reference/classExtendingPrimitive.js index fac6ada65eca3..14941c1ef03be 100644 --- a/tests/baselines/reference/classExtendingPrimitive.js +++ b/tests/baselines/reference/classExtendingPrimitive.js @@ -26,61 +26,61 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var C = (function (_super) { +var C = /** @class */ (function (_super) { __extends(C, _super); function C() { return _super !== null && _super.apply(this, arguments) || this; } return C; }(number)); -var C2 = (function (_super) { +var C2 = /** @class */ (function (_super) { __extends(C2, _super); function C2() { return _super !== null && _super.apply(this, arguments) || this; } return C2; }(string)); -var C3 = (function (_super) { +var C3 = /** @class */ (function (_super) { __extends(C3, _super); function C3() { return _super !== null && _super.apply(this, arguments) || this; } return C3; }(boolean)); -var C4 = (function (_super) { +var C4 = /** @class */ (function (_super) { __extends(C4, _super); function C4() { return _super !== null && _super.apply(this, arguments) || this; } return C4; }(Void)); -var C4a = (function () { +var C4a = /** @class */ (function () { function C4a() { } return C4a; }()); void {}; -var C5 = (function (_super) { +var C5 = /** @class */ (function (_super) { __extends(C5, _super); function C5() { return _super !== null && _super.apply(this, arguments) || this; } return C5; }(Null)); -var C5a = (function (_super) { +var C5a = /** @class */ (function (_super) { __extends(C5a, _super); function C5a() { } return C5a; }(null)); -var C6 = (function (_super) { +var C6 = /** @class */ (function (_super) { __extends(C6, _super); function C6() { return _super !== null && _super.apply(this, arguments) || this; } return C6; }(undefined)); -var C7 = (function (_super) { +var C7 = /** @class */ (function (_super) { __extends(C7, _super); function C7() { return _super !== null && _super.apply(this, arguments) || this; @@ -91,7 +91,7 @@ var E; (function (E) { E[E["A"] = 0] = "A"; })(E || (E = {})); -var C8 = (function (_super) { +var C8 = /** @class */ (function (_super) { __extends(C8, _super); function C8() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/classExtendingPrimitive2.js b/tests/baselines/reference/classExtendingPrimitive2.js index 2b9cd6de6b66a..54c39e507e1e4 100644 --- a/tests/baselines/reference/classExtendingPrimitive2.js +++ b/tests/baselines/reference/classExtendingPrimitive2.js @@ -16,13 +16,13 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var C4a = (function () { +var C4a = /** @class */ (function () { function C4a() { } return C4a; }()); void {}; -var C5a = (function (_super) { +var C5a = /** @class */ (function (_super) { __extends(C5a, _super); function C5a() { } diff --git a/tests/baselines/reference/classExtendingQualifiedName.js b/tests/baselines/reference/classExtendingQualifiedName.js index 24c61fd0bd681..91eb2c1a2a4a2 100644 --- a/tests/baselines/reference/classExtendingQualifiedName.js +++ b/tests/baselines/reference/classExtendingQualifiedName.js @@ -20,12 +20,12 @@ var __extends = (this && this.__extends) || (function () { })(); var M; (function (M) { - var C = (function () { + var C = /** @class */ (function () { function C() { } return C; }()); - var D = (function (_super) { + var D = /** @class */ (function (_super) { __extends(D, _super); function D() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/classExtendingQualifiedName2.js b/tests/baselines/reference/classExtendingQualifiedName2.js index 633cd4d9ef4d4..3aa0f255051d6 100644 --- a/tests/baselines/reference/classExtendingQualifiedName2.js +++ b/tests/baselines/reference/classExtendingQualifiedName2.js @@ -20,13 +20,13 @@ var __extends = (this && this.__extends) || (function () { })(); var M; (function (M) { - var C = (function () { + var C = /** @class */ (function () { function C() { } return C; }()); M.C = C; - var D = (function (_super) { + var D = /** @class */ (function (_super) { __extends(D, _super); function D() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/classExtendsAcrossFiles.js b/tests/baselines/reference/classExtendsAcrossFiles.js index 933f92cad64fd..cec93cc84985c 100644 --- a/tests/baselines/reference/classExtendsAcrossFiles.js +++ b/tests/baselines/reference/classExtendsAcrossFiles.js @@ -35,12 +35,12 @@ Object.defineProperty(exports, "__esModule", { value: true }); var a_1 = require("./a"); exports.b = { f: function () { - var A = (function () { + var A = /** @class */ (function () { function A() { } return A; }()); - var B = (function (_super) { + var B = /** @class */ (function (_super) { __extends(B, _super); function B() { return _super !== null && _super.apply(this, arguments) || this; @@ -66,12 +66,12 @@ Object.defineProperty(exports, "__esModule", { value: true }); var b_1 = require("./b"); exports.a = { f: function () { - var A = (function () { + var A = /** @class */ (function () { function A() { } return A; }()); - var B = (function (_super) { + var B = /** @class */ (function (_super) { __extends(B, _super); function B() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/classExtendsClauseClassMergedWithModuleNotReferingConstructor.js b/tests/baselines/reference/classExtendsClauseClassMergedWithModuleNotReferingConstructor.js index 3b835f8675581..f384bfef6de1e 100644 --- a/tests/baselines/reference/classExtendsClauseClassMergedWithModuleNotReferingConstructor.js +++ b/tests/baselines/reference/classExtendsClauseClassMergedWithModuleNotReferingConstructor.js @@ -24,7 +24,7 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var A = (function () { +var A = /** @class */ (function () { function A() { } return A; @@ -34,7 +34,7 @@ var A = (function () { var Foo; (function (Foo) { var A = 1; - var B = (function (_super) { + var B = /** @class */ (function (_super) { __extends(B, _super); function B() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/classExtendsClauseClassNotReferringConstructor.js b/tests/baselines/reference/classExtendsClauseClassNotReferringConstructor.js index d0377bdfc1823..4f0fc13082c6e 100644 --- a/tests/baselines/reference/classExtendsClauseClassNotReferringConstructor.js +++ b/tests/baselines/reference/classExtendsClauseClassNotReferringConstructor.js @@ -17,7 +17,7 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var A = (function () { +var A = /** @class */ (function () { function A() { } return A; @@ -25,7 +25,7 @@ var A = (function () { var Foo; (function (Foo) { var A = 1; - var B = (function (_super) { + var B = /** @class */ (function (_super) { __extends(B, _super); function B() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/classExtendsEveryObjectType.js b/tests/baselines/reference/classExtendsEveryObjectType.js index 946f2c70f910c..576fc759f769e 100644 --- a/tests/baselines/reference/classExtendsEveryObjectType.js +++ b/tests/baselines/reference/classExtendsEveryObjectType.js @@ -27,14 +27,14 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var C = (function (_super) { +var C = /** @class */ (function (_super) { __extends(C, _super); function C() { return _super !== null && _super.apply(this, arguments) || this; } return C; }(I)); // error -var C2 = (function (_super) { +var C2 = /** @class */ (function (_super) { __extends(C2, _super); function C2() { return _super !== null && _super.apply(this, arguments) || this; @@ -42,7 +42,7 @@ var C2 = (function (_super) { return C2; }({ foo: string })); // error var x; -var C3 = (function (_super) { +var C3 = /** @class */ (function (_super) { __extends(C3, _super); function C3() { return _super !== null && _super.apply(this, arguments) || this; @@ -53,7 +53,7 @@ var M; (function (M) { M.x = 1; })(M || (M = {})); -var C4 = (function (_super) { +var C4 = /** @class */ (function (_super) { __extends(C4, _super); function C4() { return _super !== null && _super.apply(this, arguments) || this; @@ -61,14 +61,14 @@ var C4 = (function (_super) { return C4; }(M)); // error function foo() { } -var C5 = (function (_super) { +var C5 = /** @class */ (function (_super) { __extends(C5, _super); function C5() { return _super !== null && _super.apply(this, arguments) || this; } return C5; }(foo)); // error -var C6 = (function (_super) { +var C6 = /** @class */ (function (_super) { __extends(C6, _super); function C6() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/classExtendsEveryObjectType2.js b/tests/baselines/reference/classExtendsEveryObjectType2.js index d8dbdbb57218f..f5b3a3d3a0a0f 100644 --- a/tests/baselines/reference/classExtendsEveryObjectType2.js +++ b/tests/baselines/reference/classExtendsEveryObjectType2.js @@ -14,14 +14,14 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var C2 = (function (_super) { +var C2 = /** @class */ (function (_super) { __extends(C2, _super); function C2() { return _super !== null && _super.apply(this, arguments) || this; } return C2; }({ foo: string })); // error -var C6 = (function (_super) { +var C6 = /** @class */ (function (_super) { __extends(C6, _super); function C6() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/classExtendsInterface.js b/tests/baselines/reference/classExtendsInterface.js index cd86c42ae0b19..ac7fd199ccf86 100644 --- a/tests/baselines/reference/classExtendsInterface.js +++ b/tests/baselines/reference/classExtendsInterface.js @@ -19,26 +19,26 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var A = (function (_super) { +var A = /** @class */ (function (_super) { __extends(A, _super); function A() { return _super !== null && _super.apply(this, arguments) || this; } return A; }(Comparable)); -var B = (function () { +var B = /** @class */ (function () { function B() { } return B; }()); -var A2 = (function (_super) { +var A2 = /** @class */ (function (_super) { __extends(A2, _super); function A2() { return _super !== null && _super.apply(this, arguments) || this; } return A2; }(Comparable2)); -var B2 = (function () { +var B2 = /** @class */ (function () { function B2() { } return B2; diff --git a/tests/baselines/reference/classExtendsInterfaceInExpression.js b/tests/baselines/reference/classExtendsInterfaceInExpression.js index 1bbdae0370e09..a7887ffaac79e 100644 --- a/tests/baselines/reference/classExtendsInterfaceInExpression.js +++ b/tests/baselines/reference/classExtendsInterfaceInExpression.js @@ -22,7 +22,7 @@ var __extends = (this && this.__extends) || (function () { function factory(a) { return null; } -var C = (function (_super) { +var C = /** @class */ (function (_super) { __extends(C, _super); function C() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/classExtendsInterfaceInModule.js b/tests/baselines/reference/classExtendsInterfaceInModule.js index 96b2906e54ffa..a6b4449b2c358 100644 --- a/tests/baselines/reference/classExtendsInterfaceInModule.js +++ b/tests/baselines/reference/classExtendsInterfaceInModule.js @@ -26,21 +26,21 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var C1 = (function (_super) { +var C1 = /** @class */ (function (_super) { __extends(C1, _super); function C1() { return _super !== null && _super.apply(this, arguments) || this; } return C1; }(M.I1)); -var C2 = (function (_super) { +var C2 = /** @class */ (function (_super) { __extends(C2, _super); function C2() { return _super !== null && _super.apply(this, arguments) || this; } return C2; }(M.I2)); -var D = (function (_super) { +var D = /** @class */ (function (_super) { __extends(D, _super); function D() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/classExtendsInterfaceThatExtendsClassWithPrivates1.js b/tests/baselines/reference/classExtendsInterfaceThatExtendsClassWithPrivates1.js index aab40d145c4d9..1b72cba2b634c 100644 --- a/tests/baselines/reference/classExtendsInterfaceThatExtendsClassWithPrivates1.js +++ b/tests/baselines/reference/classExtendsInterfaceThatExtendsClassWithPrivates1.js @@ -15,14 +15,14 @@ class D2 implements I { } //// [classExtendsInterfaceThatExtendsClassWithPrivates1.js] -var C = (function () { +var C = /** @class */ (function () { function C() { this.x = 1; } C.prototype.foo = function (x) { return x; }; return C; }()); -var D2 = (function () { +var D2 = /** @class */ (function () { function D2() { this.x = 3; } diff --git a/tests/baselines/reference/classExtendsItself.js b/tests/baselines/reference/classExtendsItself.js index 197f76edb80c6..5d49576d4bfb3 100644 --- a/tests/baselines/reference/classExtendsItself.js +++ b/tests/baselines/reference/classExtendsItself.js @@ -16,21 +16,21 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var C = (function (_super) { +var C = /** @class */ (function (_super) { __extends(C, _super); function C() { return _super !== null && _super.apply(this, arguments) || this; } return C; }(C)); // error -var D = (function (_super) { +var D = /** @class */ (function (_super) { __extends(D, _super); function D() { return _super !== null && _super.apply(this, arguments) || this; } return D; }(D)); // error -var E = (function (_super) { +var E = /** @class */ (function (_super) { __extends(E, _super); function E() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/classExtendsItselfIndirectly.js b/tests/baselines/reference/classExtendsItselfIndirectly.js index e5bd50ae80a9d..e1f280c84573f 100644 --- a/tests/baselines/reference/classExtendsItselfIndirectly.js +++ b/tests/baselines/reference/classExtendsItselfIndirectly.js @@ -22,42 +22,42 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var C = (function (_super) { +var C = /** @class */ (function (_super) { __extends(C, _super); function C() { return _super !== null && _super.apply(this, arguments) || this; } return C; }(E)); // error -var D = (function (_super) { +var D = /** @class */ (function (_super) { __extends(D, _super); function D() { return _super !== null && _super.apply(this, arguments) || this; } return D; }(C)); -var E = (function (_super) { +var E = /** @class */ (function (_super) { __extends(E, _super); function E() { return _super !== null && _super.apply(this, arguments) || this; } return E; }(D)); -var C2 = (function (_super) { +var C2 = /** @class */ (function (_super) { __extends(C2, _super); function C2() { return _super !== null && _super.apply(this, arguments) || this; } return C2; }(E2)); // error -var D2 = (function (_super) { +var D2 = /** @class */ (function (_super) { __extends(D2, _super); function D2() { return _super !== null && _super.apply(this, arguments) || this; } return D2; }(C2)); -var E2 = (function (_super) { +var E2 = /** @class */ (function (_super) { __extends(E2, _super); function E2() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/classExtendsItselfIndirectly2.js b/tests/baselines/reference/classExtendsItselfIndirectly2.js index ae3bf4ed788a4..22dedb52e9b4d 100644 --- a/tests/baselines/reference/classExtendsItselfIndirectly2.js +++ b/tests/baselines/reference/classExtendsItselfIndirectly2.js @@ -33,7 +33,7 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var C = (function (_super) { +var C = /** @class */ (function (_super) { __extends(C, _super); function C() { return _super !== null && _super.apply(this, arguments) || this; @@ -42,7 +42,7 @@ var C = (function (_super) { }(N.E)); // error var M; (function (M) { - var D = (function (_super) { + var D = /** @class */ (function (_super) { __extends(D, _super); function D() { return _super !== null && _super.apply(this, arguments) || this; @@ -53,7 +53,7 @@ var M; })(M || (M = {})); var N; (function (N) { - var E = (function (_super) { + var E = /** @class */ (function (_super) { __extends(E, _super); function E() { return _super !== null && _super.apply(this, arguments) || this; @@ -64,7 +64,7 @@ var N; })(N || (N = {})); var O; (function (O) { - var C2 = (function (_super) { + var C2 = /** @class */ (function (_super) { __extends(C2, _super); function C2() { return _super !== null && _super.apply(this, arguments) || this; @@ -73,7 +73,7 @@ var O; }(Q.E2)); // error var P; (function (P) { - var D2 = (function (_super) { + var D2 = /** @class */ (function (_super) { __extends(D2, _super); function D2() { return _super !== null && _super.apply(this, arguments) || this; @@ -84,7 +84,7 @@ var O; })(P || (P = {})); var Q; (function (Q) { - var E2 = (function (_super) { + var E2 = /** @class */ (function (_super) { __extends(E2, _super); function E2() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/classExtendsItselfIndirectly3.js b/tests/baselines/reference/classExtendsItselfIndirectly3.js index 8f004a44cfe5e..156311a5a994b 100644 --- a/tests/baselines/reference/classExtendsItselfIndirectly3.js +++ b/tests/baselines/reference/classExtendsItselfIndirectly3.js @@ -29,7 +29,7 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var C = (function (_super) { +var C = /** @class */ (function (_super) { __extends(C, _super); function C() { return _super !== null && _super.apply(this, arguments) || this; @@ -47,7 +47,7 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var D = (function (_super) { +var D = /** @class */ (function (_super) { __extends(D, _super); function D() { return _super !== null && _super.apply(this, arguments) || this; @@ -65,7 +65,7 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var E = (function (_super) { +var E = /** @class */ (function (_super) { __extends(E, _super); function E() { return _super !== null && _super.apply(this, arguments) || this; @@ -83,7 +83,7 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var C2 = (function (_super) { +var C2 = /** @class */ (function (_super) { __extends(C2, _super); function C2() { return _super !== null && _super.apply(this, arguments) || this; @@ -101,7 +101,7 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var D2 = (function (_super) { +var D2 = /** @class */ (function (_super) { __extends(D2, _super); function D2() { return _super !== null && _super.apply(this, arguments) || this; @@ -119,7 +119,7 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var E2 = (function (_super) { +var E2 = /** @class */ (function (_super) { __extends(E2, _super); function E2() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/classExtendsMultipleBaseClasses.js b/tests/baselines/reference/classExtendsMultipleBaseClasses.js index 830bf6fb988e2..a5292691416a0 100644 --- a/tests/baselines/reference/classExtendsMultipleBaseClasses.js +++ b/tests/baselines/reference/classExtendsMultipleBaseClasses.js @@ -14,17 +14,17 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var A = (function () { +var A = /** @class */ (function () { function A() { } return A; }()); -var B = (function () { +var B = /** @class */ (function () { function B() { } return B; }()); -var C = (function (_super) { +var C = /** @class */ (function (_super) { __extends(C, _super); function C() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/classExtendsNull.js b/tests/baselines/reference/classExtendsNull.js index 674b212f98e2f..f7f199ad26a52 100644 --- a/tests/baselines/reference/classExtendsNull.js +++ b/tests/baselines/reference/classExtendsNull.js @@ -23,7 +23,7 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var C = (function (_super) { +var C = /** @class */ (function (_super) { __extends(C, _super); function C() { _this = _super.call(this) || this; @@ -31,7 +31,7 @@ var C = (function (_super) { } return C; }(null)); -var D = (function (_super) { +var D = /** @class */ (function (_super) { __extends(D, _super); function D() { return Object.create(null); diff --git a/tests/baselines/reference/classExtendsShadowedConstructorFunction.js b/tests/baselines/reference/classExtendsShadowedConstructorFunction.js index 391a6e52fa3f6..75a430755b1fd 100644 --- a/tests/baselines/reference/classExtendsShadowedConstructorFunction.js +++ b/tests/baselines/reference/classExtendsShadowedConstructorFunction.js @@ -19,7 +19,7 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var C = (function () { +var C = /** @class */ (function () { function C() { } return C; @@ -27,7 +27,7 @@ var C = (function () { var M; (function (M) { var C = 1; - var D = (function (_super) { + var D = /** @class */ (function (_super) { __extends(D, _super); function D() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/classExtendsValidConstructorFunction.js b/tests/baselines/reference/classExtendsValidConstructorFunction.js index e6f9b389739ce..c3827a53819a4 100644 --- a/tests/baselines/reference/classExtendsValidConstructorFunction.js +++ b/tests/baselines/reference/classExtendsValidConstructorFunction.js @@ -18,7 +18,7 @@ var __extends = (this && this.__extends) || (function () { })(); function foo() { } var x = new foo(); // can be used as a constructor function -var C = (function (_super) { +var C = /** @class */ (function (_super) { __extends(C, _super); function C() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/classHeritageWithTrailingSeparator.js b/tests/baselines/reference/classHeritageWithTrailingSeparator.js index 4d863741adad5..4e36e83241865 100644 --- a/tests/baselines/reference/classHeritageWithTrailingSeparator.js +++ b/tests/baselines/reference/classHeritageWithTrailingSeparator.js @@ -14,12 +14,12 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var C = (function () { +var C = /** @class */ (function () { function C() { } return C; }()); -var D = (function (_super) { +var D = /** @class */ (function (_super) { __extends(D, _super); function D() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/classImplementingInterfaceIndexer.js b/tests/baselines/reference/classImplementingInterfaceIndexer.js index 532ac93d17ed7..9a97c5f06df65 100644 --- a/tests/baselines/reference/classImplementingInterfaceIndexer.js +++ b/tests/baselines/reference/classImplementingInterfaceIndexer.js @@ -7,7 +7,7 @@ class A implements I { } //// [classImplementingInterfaceIndexer.js] -var A = (function () { +var A = /** @class */ (function () { function A() { } return A; diff --git a/tests/baselines/reference/classImplementsClass1.js b/tests/baselines/reference/classImplementsClass1.js index 847dc5ba53175..0a850229c0080 100644 --- a/tests/baselines/reference/classImplementsClass1.js +++ b/tests/baselines/reference/classImplementsClass1.js @@ -3,12 +3,12 @@ class A { } class C implements A { } //// [classImplementsClass1.js] -var A = (function () { +var A = /** @class */ (function () { function A() { } return A; }()); -var C = (function () { +var C = /** @class */ (function () { function C() { } return C; diff --git a/tests/baselines/reference/classImplementsClass2.js b/tests/baselines/reference/classImplementsClass2.js index 330a9a7dece3c..beef7f44c76de 100644 --- a/tests/baselines/reference/classImplementsClass2.js +++ b/tests/baselines/reference/classImplementsClass2.js @@ -24,18 +24,18 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var A = (function () { +var A = /** @class */ (function () { function A() { } A.prototype.foo = function () { return 1; }; return A; }()); -var C = (function () { +var C = /** @class */ (function () { function C() { } return C; }()); // error -var C2 = (function (_super) { +var C2 = /** @class */ (function (_super) { __extends(C2, _super); function C2() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/classImplementsClass3.js b/tests/baselines/reference/classImplementsClass3.js index 649afb528a39e..822a0787d4adb 100644 --- a/tests/baselines/reference/classImplementsClass3.js +++ b/tests/baselines/reference/classImplementsClass3.js @@ -25,13 +25,13 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var A = (function () { +var A = /** @class */ (function () { function A() { } A.prototype.foo = function () { return 1; }; return A; }()); -var C = (function () { +var C = /** @class */ (function () { function C() { } C.prototype.foo = function () { @@ -39,7 +39,7 @@ var C = (function () { }; return C; }()); -var C2 = (function (_super) { +var C2 = /** @class */ (function (_super) { __extends(C2, _super); function C2() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/classImplementsClass4.js b/tests/baselines/reference/classImplementsClass4.js index 0d7a8661ed16a..cb94cb8d96e42 100644 --- a/tests/baselines/reference/classImplementsClass4.js +++ b/tests/baselines/reference/classImplementsClass4.js @@ -27,14 +27,14 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var A = (function () { +var A = /** @class */ (function () { function A() { this.x = 1; } A.prototype.foo = function () { return 1; }; return A; }()); -var C = (function () { +var C = /** @class */ (function () { function C() { } C.prototype.foo = function () { @@ -42,7 +42,7 @@ var C = (function () { }; return C; }()); -var C2 = (function (_super) { +var C2 = /** @class */ (function (_super) { __extends(C2, _super); function C2() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/classImplementsClass5.js b/tests/baselines/reference/classImplementsClass5.js index 4b5229bdfc6f8..5dabb84ee8f86 100644 --- a/tests/baselines/reference/classImplementsClass5.js +++ b/tests/baselines/reference/classImplementsClass5.js @@ -28,14 +28,14 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var A = (function () { +var A = /** @class */ (function () { function A() { this.x = 1; } A.prototype.foo = function () { return 1; }; return A; }()); -var C = (function () { +var C = /** @class */ (function () { function C() { this.x = 1; } @@ -44,7 +44,7 @@ var C = (function () { }; return C; }()); -var C2 = (function (_super) { +var C2 = /** @class */ (function (_super) { __extends(C2, _super); function C2() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/classImplementsClass6.js b/tests/baselines/reference/classImplementsClass6.js index fb42e9451a70a..6a9038c560673 100644 --- a/tests/baselines/reference/classImplementsClass6.js +++ b/tests/baselines/reference/classImplementsClass6.js @@ -32,7 +32,7 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var A = (function () { +var A = /** @class */ (function () { function A() { } A.bar = function () { @@ -41,7 +41,7 @@ var A = (function () { A.prototype.foo = function () { return 1; }; return A; }()); -var C = (function () { +var C = /** @class */ (function () { function C() { } C.prototype.foo = function () { @@ -49,7 +49,7 @@ var C = (function () { }; return C; }()); -var C2 = (function (_super) { +var C2 = /** @class */ (function (_super) { __extends(C2, _super); function C2() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/classImplementsImportedInterface.js b/tests/baselines/reference/classImplementsImportedInterface.js index d9d7d9eed2e05..6276dced5a7c2 100644 --- a/tests/baselines/reference/classImplementsImportedInterface.js +++ b/tests/baselines/reference/classImplementsImportedInterface.js @@ -15,7 +15,7 @@ module M2 { //// [classImplementsImportedInterface.js] var M2; (function (M2) { - var C = (function () { + var C = /** @class */ (function () { function C() { } C.prototype.foo = function () { }; diff --git a/tests/baselines/reference/classImplementsMergedClassInterface.js b/tests/baselines/reference/classImplementsMergedClassInterface.js index 67381a024672b..38e67f8bdb008 100644 --- a/tests/baselines/reference/classImplementsMergedClassInterface.js +++ b/tests/baselines/reference/classImplementsMergedClassInterface.js @@ -24,22 +24,22 @@ class C5 implements C1 { // okay } //// [classImplementsMergedClassInterface.js] -var C2 = (function () { +var C2 = /** @class */ (function () { function C2() { } return C2; }()); -var C3 = (function () { +var C3 = /** @class */ (function () { function C3() { } return C3; }()); -var C4 = (function () { +var C4 = /** @class */ (function () { function C4() { } return C4; }()); -var C5 = (function () { +var C5 = /** @class */ (function () { function C5() { } return C5; diff --git a/tests/baselines/reference/classIndexer.js b/tests/baselines/reference/classIndexer.js index dfdc6274511c5..a10aa5a435ec9 100644 --- a/tests/baselines/reference/classIndexer.js +++ b/tests/baselines/reference/classIndexer.js @@ -6,7 +6,7 @@ class C123 { } //// [classIndexer.js] -var C123 = (function () { +var C123 = /** @class */ (function () { function C123() { } return C123; diff --git a/tests/baselines/reference/classIndexer2.js b/tests/baselines/reference/classIndexer2.js index eb83ba397dcc4..0b25680d32f79 100644 --- a/tests/baselines/reference/classIndexer2.js +++ b/tests/baselines/reference/classIndexer2.js @@ -8,7 +8,7 @@ class C123 { } //// [classIndexer2.js] -var C123 = (function () { +var C123 = /** @class */ (function () { function C123() { } return C123; diff --git a/tests/baselines/reference/classIndexer3.js b/tests/baselines/reference/classIndexer3.js index 344baf039e1c0..212e3bc2d0c28 100644 --- a/tests/baselines/reference/classIndexer3.js +++ b/tests/baselines/reference/classIndexer3.js @@ -21,12 +21,12 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var C123 = (function () { +var C123 = /** @class */ (function () { function C123() { } return C123; }()); -var D123 = (function (_super) { +var D123 = /** @class */ (function (_super) { __extends(D123, _super); function D123() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/classIndexer4.js b/tests/baselines/reference/classIndexer4.js index f5258d8b5e1de..5bd287fd42aeb 100644 --- a/tests/baselines/reference/classIndexer4.js +++ b/tests/baselines/reference/classIndexer4.js @@ -11,7 +11,7 @@ interface D123 extends C123 { } //// [classIndexer4.js] -var C123 = (function () { +var C123 = /** @class */ (function () { function C123() { } return C123; diff --git a/tests/baselines/reference/classInheritence.js b/tests/baselines/reference/classInheritence.js index a43cf9c8bb852..dc4b4e17808be 100644 --- a/tests/baselines/reference/classInheritence.js +++ b/tests/baselines/reference/classInheritence.js @@ -13,14 +13,14 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var B = (function (_super) { +var B = /** @class */ (function (_super) { __extends(B, _super); function B() { return _super !== null && _super.apply(this, arguments) || this; } return B; }(A)); -var A = (function (_super) { +var A = /** @class */ (function (_super) { __extends(A, _super); function A() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/classInsideBlock.js b/tests/baselines/reference/classInsideBlock.js index e21695b974566..c858ac6290b6b 100644 --- a/tests/baselines/reference/classInsideBlock.js +++ b/tests/baselines/reference/classInsideBlock.js @@ -5,7 +5,7 @@ function foo() { //// [classInsideBlock.js] function foo() { - var C = (function () { + var C = /** @class */ (function () { function C() { } return C; diff --git a/tests/baselines/reference/classIsSubtypeOfBaseType.js b/tests/baselines/reference/classIsSubtypeOfBaseType.js index adfa94b4b7e7d..6a9826a09ae04 100644 --- a/tests/baselines/reference/classIsSubtypeOfBaseType.js +++ b/tests/baselines/reference/classIsSubtypeOfBaseType.js @@ -26,19 +26,19 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var Base = (function () { +var Base = /** @class */ (function () { function Base() { } return Base; }()); -var Derived = (function (_super) { +var Derived = /** @class */ (function (_super) { __extends(Derived, _super); function Derived() { return _super !== null && _super.apply(this, arguments) || this; } return Derived; }(Base)); -var Derived2 = (function (_super) { +var Derived2 = /** @class */ (function (_super) { __extends(Derived2, _super); function Derived2() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/classMemberInitializerScoping.js b/tests/baselines/reference/classMemberInitializerScoping.js index 8f78cfb9ac686..7fd6b6f3a7ab6 100644 --- a/tests/baselines/reference/classMemberInitializerScoping.js +++ b/tests/baselines/reference/classMemberInitializerScoping.js @@ -22,7 +22,7 @@ class CCCC { //// [classMemberInitializerScoping.js] var aaa = 1; -var CCC = (function () { +var CCC = /** @class */ (function () { function CCC(aaa) { this.y = aaa; this.y = ''; // was: error, cannot assign string to number @@ -32,7 +32,7 @@ var CCC = (function () { }()); // above is equivalent to this: var aaaa = 1; -var CCCC = (function () { +var CCCC = /** @class */ (function () { function CCCC(aaaa) { this.y = aaaa; this.y = ''; diff --git a/tests/baselines/reference/classMemberInitializerWithLamdaScoping.js b/tests/baselines/reference/classMemberInitializerWithLamdaScoping.js index 752220a4cbc5c..f7660fbec7e7e 100644 --- a/tests/baselines/reference/classMemberInitializerWithLamdaScoping.js +++ b/tests/baselines/reference/classMemberInitializerWithLamdaScoping.js @@ -31,7 +31,7 @@ class Test1 { } //// [classMemberInitializerWithLamdaScoping.js] -var Test = (function () { +var Test = /** @class */ (function () { function Test(field) { var _this = this; this.field = field; @@ -47,7 +47,7 @@ var Test = (function () { return Test; }()); var field1; -var Test1 = (function () { +var Test1 = /** @class */ (function () { function Test1(field1) { this.field1 = field1; this.messageHandler = function () { diff --git a/tests/baselines/reference/classMemberInitializerWithLamdaScoping2.js b/tests/baselines/reference/classMemberInitializerWithLamdaScoping2.js index 4cfee11b57df0..dafd3d503ebf7 100644 --- a/tests/baselines/reference/classMemberInitializerWithLamdaScoping2.js +++ b/tests/baselines/reference/classMemberInitializerWithLamdaScoping2.js @@ -20,7 +20,7 @@ class Test1 { //// [classMemberInitializerWithLamdaScoping2_0.js] var field1; //// [classMemberInitializerWithLamdaScoping2_1.js] -var Test1 = (function () { +var Test1 = /** @class */ (function () { function Test1(field1) { this.field1 = field1; this.messageHandler = function () { diff --git a/tests/baselines/reference/classMemberInitializerWithLamdaScoping3.js b/tests/baselines/reference/classMemberInitializerWithLamdaScoping3.js index d4df05f2ea353..d8c698fcd9198 100644 --- a/tests/baselines/reference/classMemberInitializerWithLamdaScoping3.js +++ b/tests/baselines/reference/classMemberInitializerWithLamdaScoping3.js @@ -22,7 +22,7 @@ var field1; //// [classMemberInitializerWithLamdaScoping3_1.js] "use strict"; exports.__esModule = true; -var Test1 = (function () { +var Test1 = /** @class */ (function () { function Test1(field1) { this.field1 = field1; this.messageHandler = function () { diff --git a/tests/baselines/reference/classMemberInitializerWithLamdaScoping4.js b/tests/baselines/reference/classMemberInitializerWithLamdaScoping4.js index 76835e757e074..a0aa11d30d6be 100644 --- a/tests/baselines/reference/classMemberInitializerWithLamdaScoping4.js +++ b/tests/baselines/reference/classMemberInitializerWithLamdaScoping4.js @@ -21,7 +21,7 @@ exports.__esModule = true; //// [classMemberInitializerWithLamdaScoping3_1.js] "use strict"; exports.__esModule = true; -var Test1 = (function () { +var Test1 = /** @class */ (function () { function Test1(field1) { this.field1 = field1; this.messageHandler = function () { diff --git a/tests/baselines/reference/classMemberInitializerWithLamdaScoping5.js b/tests/baselines/reference/classMemberInitializerWithLamdaScoping5.js index 8af2b70227149..d3e81f1f36635 100644 --- a/tests/baselines/reference/classMemberInitializerWithLamdaScoping5.js +++ b/tests/baselines/reference/classMemberInitializerWithLamdaScoping5.js @@ -12,7 +12,7 @@ class Greeter { } //// [classMemberInitializerWithLamdaScoping5.js] -var Greeter = (function () { +var Greeter = /** @class */ (function () { function Greeter(message) { this.messageHandler = function (message) { console.log(message); // This shouldnt be error diff --git a/tests/baselines/reference/classMemberWithMissingIdentifier.js b/tests/baselines/reference/classMemberWithMissingIdentifier.js index a7f1e6ffe4f8b..39582a670a472 100644 --- a/tests/baselines/reference/classMemberWithMissingIdentifier.js +++ b/tests/baselines/reference/classMemberWithMissingIdentifier.js @@ -4,7 +4,7 @@ class C { } //// [classMemberWithMissingIdentifier.js] -var C = (function () { +var C = /** @class */ (function () { function C() { this. = {}; } diff --git a/tests/baselines/reference/classMemberWithMissingIdentifier2.js b/tests/baselines/reference/classMemberWithMissingIdentifier2.js index 6d364369335f1..798774af12c09 100644 --- a/tests/baselines/reference/classMemberWithMissingIdentifier2.js +++ b/tests/baselines/reference/classMemberWithMissingIdentifier2.js @@ -4,7 +4,7 @@ class C { } //// [classMemberWithMissingIdentifier2.js] -var C = (function () { +var C = /** @class */ (function () { function C() { this. = (_a = {}, _a[name] = string, _a.VariableDeclaration = VariableDeclaration, _a); var _a; diff --git a/tests/baselines/reference/classMethodWithKeywordName1.js b/tests/baselines/reference/classMethodWithKeywordName1.js index a7cb994bfb397..5568f20978f97 100644 --- a/tests/baselines/reference/classMethodWithKeywordName1.js +++ b/tests/baselines/reference/classMethodWithKeywordName1.js @@ -4,7 +4,7 @@ class C { } //// [classMethodWithKeywordName1.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } C["try"] = function () { }; diff --git a/tests/baselines/reference/classOrder1.js b/tests/baselines/reference/classOrder1.js index 0d6d47891ea60..e4e7beb7218ed 100644 --- a/tests/baselines/reference/classOrder1.js +++ b/tests/baselines/reference/classOrder1.js @@ -12,7 +12,7 @@ a.foo(); //// [classOrder1.js] -var A = (function () { +var A = /** @class */ (function () { function A() { } A.prototype.foo = function () { diff --git a/tests/baselines/reference/classOrder2.js b/tests/baselines/reference/classOrder2.js index 13ddfd8ae8251..d20801ee0543b 100644 --- a/tests/baselines/reference/classOrder2.js +++ b/tests/baselines/reference/classOrder2.js @@ -29,7 +29,7 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var A = (function (_super) { +var A = /** @class */ (function (_super) { __extends(A, _super); function A() { return _super !== null && _super.apply(this, arguments) || this; @@ -37,7 +37,7 @@ var A = (function (_super) { A.prototype.foo = function () { this.bar(); }; return A; }(B)); -var B = (function () { +var B = /** @class */ (function () { function B() { } B.prototype.bar = function () { }; diff --git a/tests/baselines/reference/classOrderBug.js b/tests/baselines/reference/classOrderBug.js index 71f407a14f580..19023373fee2f 100644 --- a/tests/baselines/reference/classOrderBug.js +++ b/tests/baselines/reference/classOrderBug.js @@ -26,18 +26,18 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var bar = (function () { +var bar = /** @class */ (function () { function bar() { this.baz = new foo(); } return bar; }()); -var baz = (function () { +var baz = /** @class */ (function () { function baz() { } return baz; }()); -var foo = (function (_super) { +var foo = /** @class */ (function (_super) { __extends(foo, _super); function foo() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/classOverloadForFunction.js b/tests/baselines/reference/classOverloadForFunction.js index 3916289f9a569..1e0073f4d8147 100644 --- a/tests/baselines/reference/classOverloadForFunction.js +++ b/tests/baselines/reference/classOverloadForFunction.js @@ -4,7 +4,7 @@ function foo() {} //// [classOverloadForFunction.js] -var foo = (function () { +var foo = /** @class */ (function () { function foo() { } return foo; diff --git a/tests/baselines/reference/classOverloadForFunction2.js b/tests/baselines/reference/classOverloadForFunction2.js index 0571774534db2..79b594e36a73c 100644 --- a/tests/baselines/reference/classOverloadForFunction2.js +++ b/tests/baselines/reference/classOverloadForFunction2.js @@ -3,7 +3,7 @@ function bar(): string; class bar {} //// [classOverloadForFunction2.js] -var bar = (function () { +var bar = /** @class */ (function () { function bar() { } return bar; diff --git a/tests/baselines/reference/classPropertyAsPrivate.js b/tests/baselines/reference/classPropertyAsPrivate.js index 3db4b7acce430..cdcea7e56afbb 100644 --- a/tests/baselines/reference/classPropertyAsPrivate.js +++ b/tests/baselines/reference/classPropertyAsPrivate.js @@ -24,7 +24,7 @@ C.b = 1; C.foo(); //// [classPropertyAsPrivate.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } Object.defineProperty(C.prototype, "y", { diff --git a/tests/baselines/reference/classPropertyAsProtected.js b/tests/baselines/reference/classPropertyAsProtected.js index da0e166513529..56848f6680eb5 100644 --- a/tests/baselines/reference/classPropertyAsProtected.js +++ b/tests/baselines/reference/classPropertyAsProtected.js @@ -24,7 +24,7 @@ C.b = 1; C.foo(); //// [classPropertyAsProtected.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } Object.defineProperty(C.prototype, "y", { diff --git a/tests/baselines/reference/classPropertyIsPublicByDefault.js b/tests/baselines/reference/classPropertyIsPublicByDefault.js index 5a5bfa7afe888..f70ef694bb5a2 100644 --- a/tests/baselines/reference/classPropertyIsPublicByDefault.js +++ b/tests/baselines/reference/classPropertyIsPublicByDefault.js @@ -23,7 +23,7 @@ C.b = 1; C.foo(); //// [classPropertyIsPublicByDefault.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } Object.defineProperty(C.prototype, "y", { diff --git a/tests/baselines/reference/classSideInheritance1.js b/tests/baselines/reference/classSideInheritance1.js index 549d945119927..7e0abdafc435b 100644 --- a/tests/baselines/reference/classSideInheritance1.js +++ b/tests/baselines/reference/classSideInheritance1.js @@ -26,7 +26,7 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var A = (function () { +var A = /** @class */ (function () { function A() { } A.bar = function () { @@ -35,7 +35,7 @@ var A = (function () { A.prototype.foo = function () { return 1; }; return A; }()); -var C2 = (function (_super) { +var C2 = /** @class */ (function (_super) { __extends(C2, _super); function C2() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/classSideInheritance2.js b/tests/baselines/reference/classSideInheritance2.js index 9887472615f4d..36cbde8a381a8 100644 --- a/tests/baselines/reference/classSideInheritance2.js +++ b/tests/baselines/reference/classSideInheritance2.js @@ -31,14 +31,14 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var SubText = (function (_super) { +var SubText = /** @class */ (function (_super) { __extends(SubText, _super); function SubText(text, span) { return _super.call(this) || this; } return SubText; }(TextBase)); -var TextBase = (function () { +var TextBase = /** @class */ (function () { function TextBase() { } TextBase.prototype.subText = function (span) { diff --git a/tests/baselines/reference/classSideInheritance3.js b/tests/baselines/reference/classSideInheritance3.js index 9ce60d012f40d..b8eaa2424fac5 100644 --- a/tests/baselines/reference/classSideInheritance3.js +++ b/tests/baselines/reference/classSideInheritance3.js @@ -29,13 +29,13 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var A = (function () { +var A = /** @class */ (function () { function A(x) { this.x = x; } return A; }()); -var B = (function (_super) { +var B = /** @class */ (function (_super) { __extends(B, _super); function B(x, data) { var _this = _super.call(this, x) || this; @@ -44,7 +44,7 @@ var B = (function (_super) { } return B; }(A)); -var C = (function (_super) { +var C = /** @class */ (function (_super) { __extends(C, _super); function C(x) { return _super.call(this, x) || this; diff --git a/tests/baselines/reference/classStaticPropertyTypeGuard.js b/tests/baselines/reference/classStaticPropertyTypeGuard.js index 7b0a8fa0a79a7..f56d1c495122b 100644 --- a/tests/baselines/reference/classStaticPropertyTypeGuard.js +++ b/tests/baselines/reference/classStaticPropertyTypeGuard.js @@ -14,7 +14,7 @@ class A { //// [classStaticPropertyTypeGuard.js] // Repro from #8923 -var A = (function () { +var A = /** @class */ (function () { function A() { } Object.defineProperty(A.prototype, "a", { diff --git a/tests/baselines/reference/classTypeParametersInStatics.js b/tests/baselines/reference/classTypeParametersInStatics.js index e538c5ee2e399..76f7997bbcd62 100644 --- a/tests/baselines/reference/classTypeParametersInStatics.js +++ b/tests/baselines/reference/classTypeParametersInStatics.js @@ -36,7 +36,7 @@ module Editor { //// [classTypeParametersInStatics.js] var Editor; (function (Editor) { - var List = (function () { + var List = /** @class */ (function () { function List(isHead, data) { this.isHead = isHead; this.data = data; diff --git a/tests/baselines/reference/classUpdateTests.js b/tests/baselines/reference/classUpdateTests.js index 84a619d0461fa..d262fd72870f0 100644 --- a/tests/baselines/reference/classUpdateTests.js +++ b/tests/baselines/reference/classUpdateTests.js @@ -127,21 +127,21 @@ var __extends = (this && this.__extends) || (function () { // // test codegen for instance properties // -var A = (function () { +var A = /** @class */ (function () { function A() { this.p1 = 0; this.p2 = 0; } return A; }()); -var B = (function () { +var B = /** @class */ (function () { function B() { this.p1 = 0; this.p2 = 0; } return B; }()); -var C = (function () { +var C = /** @class */ (function () { function C(p1, p2, p3) { if (p1 === void 0) { p1 = 0; } if (p2 === void 0) { p2 = 0; } @@ -154,12 +154,12 @@ var C = (function () { // // test requirements for super calls // -var D = (function () { +var D = /** @class */ (function () { function D() { } return D; }()); -var E = (function (_super) { +var E = /** @class */ (function (_super) { __extends(E, _super); function E() { var _this = _super !== null && _super.apply(this, arguments) || this; @@ -168,7 +168,7 @@ var E = (function (_super) { } return E; }(D)); -var F = (function (_super) { +var F = /** @class */ (function (_super) { __extends(F, _super); function F() { var _this = this; @@ -176,7 +176,7 @@ var F = (function (_super) { } // ERROR - super call required return F; }(E)); -var G = (function (_super) { +var G = /** @class */ (function (_super) { __extends(G, _super); function G() { var _this = _super.call(this) || this; @@ -185,20 +185,20 @@ var G = (function (_super) { } // NO ERROR return G; }(D)); -var H = (function () { +var H = /** @class */ (function () { function H() { _this = _super.call(this) || this; } // ERROR - no super call allowed return H; }()); -var I = (function (_super) { +var I = /** @class */ (function (_super) { __extends(I, _super); function I() { return _super.call(this) || this; } // ERROR - no super call allowed return I; }(Object)); -var J = (function (_super) { +var J = /** @class */ (function (_super) { __extends(J, _super); function J(p1) { var _this = _super.call(this) || this; @@ -207,7 +207,7 @@ var J = (function (_super) { } return J; }(G)); -var K = (function (_super) { +var K = /** @class */ (function (_super) { __extends(K, _super); function K(p1) { var _this = this; @@ -218,7 +218,7 @@ var K = (function (_super) { } return K; }(G)); -var L = (function (_super) { +var L = /** @class */ (function (_super) { __extends(L, _super); function L(p1) { var _this = _super.call(this) || this; @@ -227,7 +227,7 @@ var L = (function (_super) { } return L; }(G)); -var M = (function (_super) { +var M = /** @class */ (function (_super) { __extends(M, _super); function M(p1) { var _this = this; @@ -241,7 +241,7 @@ var M = (function (_super) { // // test this reference in field initializers // -var N = (function () { +var N = /** @class */ (function () { function N() { this.p1 = 0; this.p2 = this.p1; @@ -252,25 +252,25 @@ var N = (function () { // // test error on property declarations within class constructors // -var O = (function () { +var O = /** @class */ (function () { function O() { this.p1 = 0; // ERROR } return O; }()); -var P = (function () { +var P = /** @class */ (function () { function P() { this.p1 = 0; // ERROR } return P; }()); -var Q = (function () { +var Q = /** @class */ (function () { function Q() { this.p1 = 0; // ERROR } return Q; }()); -var R = (function () { +var R = /** @class */ (function () { function R() { this.p1 = 0; // ERROR } diff --git a/tests/baselines/reference/classWithBaseClassButNoConstructor.js b/tests/baselines/reference/classWithBaseClassButNoConstructor.js index a9f7fbc770083..cb4b89c299af2 100644 --- a/tests/baselines/reference/classWithBaseClassButNoConstructor.js +++ b/tests/baselines/reference/classWithBaseClassButNoConstructor.js @@ -51,12 +51,12 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var Base = (function () { +var Base = /** @class */ (function () { function Base(x) { } return Base; }()); -var C = (function (_super) { +var C = /** @class */ (function (_super) { __extends(C, _super); function C() { return _super !== null && _super.apply(this, arguments) || this; @@ -66,12 +66,12 @@ var C = (function (_super) { var r = C; var c = new C(); // error var c2 = new C(1); // ok -var Base2 = (function () { +var Base2 = /** @class */ (function () { function Base2(x) { } return Base2; }()); -var D = (function (_super) { +var D = /** @class */ (function (_super) { __extends(D, _super); function D() { return _super !== null && _super.apply(this, arguments) || this; @@ -82,7 +82,7 @@ var r2 = D; var d = new D(); // error var d2 = new D(1); // ok // specialized base class -var D2 = (function (_super) { +var D2 = /** @class */ (function (_super) { __extends(D2, _super); function D2() { return _super !== null && _super.apply(this, arguments) || this; @@ -92,7 +92,7 @@ var D2 = (function (_super) { var r3 = D2; var d3 = new D(); // error var d4 = new D(1); // ok -var D3 = (function (_super) { +var D3 = /** @class */ (function (_super) { __extends(D3, _super); function D3() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/classWithConstructors.js b/tests/baselines/reference/classWithConstructors.js index 822f1e3014f03..99e485c6ba113 100644 --- a/tests/baselines/reference/classWithConstructors.js +++ b/tests/baselines/reference/classWithConstructors.js @@ -62,14 +62,14 @@ var __extends = (this && this.__extends) || (function () { })(); var NonGeneric; (function (NonGeneric) { - var C = (function () { + var C = /** @class */ (function () { function C(x) { } return C; }()); var c = new C(); // error var c2 = new C(''); // ok - var C2 = (function () { + var C2 = /** @class */ (function () { function C2(x) { } return C2; @@ -77,7 +77,7 @@ var NonGeneric; var c3 = new C2(); // error var c4 = new C2(''); // ok var c5 = new C2(1); // ok - var D = (function (_super) { + var D = /** @class */ (function (_super) { __extends(D, _super); function D() { return _super !== null && _super.apply(this, arguments) || this; @@ -90,14 +90,14 @@ var NonGeneric; })(NonGeneric || (NonGeneric = {})); var Generics; (function (Generics) { - var C = (function () { + var C = /** @class */ (function () { function C(x) { } return C; }()); var c = new C(); // error var c2 = new C(''); // ok - var C2 = (function () { + var C2 = /** @class */ (function () { function C2(x) { } return C2; @@ -105,7 +105,7 @@ var Generics; var c3 = new C2(); // error var c4 = new C2(''); // ok var c5 = new C2(1, 2); // ok - var D = (function (_super) { + var D = /** @class */ (function (_super) { __extends(D, _super); function D() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/classWithDuplicateIdentifier.js b/tests/baselines/reference/classWithDuplicateIdentifier.js index 515b1749aa3d5..45fe8333f75e7 100644 --- a/tests/baselines/reference/classWithDuplicateIdentifier.js +++ b/tests/baselines/reference/classWithDuplicateIdentifier.js @@ -14,19 +14,19 @@ class D { //// [classWithDuplicateIdentifier.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } C.prototype.a = function () { return 0; }; // error: duplicate identifier return C; }()); -var K = (function () { +var K = /** @class */ (function () { function K() { } K.prototype.b = function () { return 0; }; return K; }()); -var D = (function () { +var D = /** @class */ (function () { function D() { } return D; diff --git a/tests/baselines/reference/classWithEmptyBody.js b/tests/baselines/reference/classWithEmptyBody.js index 73654afc07b54..8fed60f296c48 100644 --- a/tests/baselines/reference/classWithEmptyBody.js +++ b/tests/baselines/reference/classWithEmptyBody.js @@ -21,7 +21,7 @@ d = { foo: '' } d = () => { } //// [classWithEmptyBody.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } return C; @@ -31,7 +31,7 @@ var o = c; c = 1; c = { foo: '' }; c = function () { }; -var D = (function () { +var D = /** @class */ (function () { function D() { return 1; } diff --git a/tests/baselines/reference/classWithEmptyTypeParameter.js b/tests/baselines/reference/classWithEmptyTypeParameter.js index c25ace495b478..94e5732754106 100644 --- a/tests/baselines/reference/classWithEmptyTypeParameter.js +++ b/tests/baselines/reference/classWithEmptyTypeParameter.js @@ -3,7 +3,7 @@ class C<> { } //// [classWithEmptyTypeParameter.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } return C; diff --git a/tests/baselines/reference/classWithMultipleBaseClasses.js b/tests/baselines/reference/classWithMultipleBaseClasses.js index 4f1170f000e75..353b22aa09dd2 100644 --- a/tests/baselines/reference/classWithMultipleBaseClasses.js +++ b/tests/baselines/reference/classWithMultipleBaseClasses.js @@ -25,19 +25,19 @@ interface I extends A, B { } //// [classWithMultipleBaseClasses.js] -var A = (function () { +var A = /** @class */ (function () { function A() { } A.prototype.foo = function () { }; return A; }()); -var B = (function () { +var B = /** @class */ (function () { function B() { } B.prototype.bar = function () { }; return B; }()); -var D = (function () { +var D = /** @class */ (function () { function D() { } D.prototype.baz = function () { }; diff --git a/tests/baselines/reference/classWithNoConstructorOrBaseClass.js b/tests/baselines/reference/classWithNoConstructorOrBaseClass.js index 908c5c435323d..40c870878e36e 100644 --- a/tests/baselines/reference/classWithNoConstructorOrBaseClass.js +++ b/tests/baselines/reference/classWithNoConstructorOrBaseClass.js @@ -17,14 +17,14 @@ var r2 = D; //// [classWithNoConstructorOrBaseClass.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } return C; }()); var c = new C(); var r = C; -var D = (function () { +var D = /** @class */ (function () { function D() { } return D; diff --git a/tests/baselines/reference/classWithOnlyPublicMembersEquivalentToInterface.js b/tests/baselines/reference/classWithOnlyPublicMembersEquivalentToInterface.js index c2942b8571f39..6a71bc490dce1 100644 --- a/tests/baselines/reference/classWithOnlyPublicMembersEquivalentToInterface.js +++ b/tests/baselines/reference/classWithOnlyPublicMembersEquivalentToInterface.js @@ -27,7 +27,7 @@ i = c; //// [classWithOnlyPublicMembersEquivalentToInterface.js] // no errors expected -var C = (function () { +var C = /** @class */ (function () { function C() { } C.prototype.y = function (a) { return null; }; diff --git a/tests/baselines/reference/classWithOnlyPublicMembersEquivalentToInterface2.js b/tests/baselines/reference/classWithOnlyPublicMembersEquivalentToInterface2.js index b97269527bee3..d04b6598b70f5 100644 --- a/tests/baselines/reference/classWithOnlyPublicMembersEquivalentToInterface2.js +++ b/tests/baselines/reference/classWithOnlyPublicMembersEquivalentToInterface2.js @@ -29,7 +29,7 @@ i = c; //// [classWithOnlyPublicMembersEquivalentToInterface2.js] // no errors expected -var C = (function () { +var C = /** @class */ (function () { function C() { } C.prototype.y = function (a) { return null; }; diff --git a/tests/baselines/reference/classWithOptionalParameter.js b/tests/baselines/reference/classWithOptionalParameter.js index 53f6bcedd9966..a7e61a1c1f6c6 100644 --- a/tests/baselines/reference/classWithOptionalParameter.js +++ b/tests/baselines/reference/classWithOptionalParameter.js @@ -13,13 +13,13 @@ class C2 { //// [classWithOptionalParameter.js] // classes do not permit optional parameters, these are errors -var C = (function () { +var C = /** @class */ (function () { function C() { } C.prototype.f = function () { }; return C; }()); -var C2 = (function () { +var C2 = /** @class */ (function () { function C2() { } C2.prototype.f = function (x) { }; diff --git a/tests/baselines/reference/classWithOverloadImplementationOfWrongName.js b/tests/baselines/reference/classWithOverloadImplementationOfWrongName.js index 1bc9f197450db..8f32085d23a92 100644 --- a/tests/baselines/reference/classWithOverloadImplementationOfWrongName.js +++ b/tests/baselines/reference/classWithOverloadImplementationOfWrongName.js @@ -6,7 +6,7 @@ class C { } //// [classWithOverloadImplementationOfWrongName.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } C.prototype.bar = function (x) { }; diff --git a/tests/baselines/reference/classWithOverloadImplementationOfWrongName2.js b/tests/baselines/reference/classWithOverloadImplementationOfWrongName2.js index 8e3d9eee62cc7..21e41c3a8d514 100644 --- a/tests/baselines/reference/classWithOverloadImplementationOfWrongName2.js +++ b/tests/baselines/reference/classWithOverloadImplementationOfWrongName2.js @@ -6,7 +6,7 @@ class C { } //// [classWithOverloadImplementationOfWrongName2.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } C.prototype.bar = function (x) { }; diff --git a/tests/baselines/reference/classWithPredefinedTypesAsNames.js b/tests/baselines/reference/classWithPredefinedTypesAsNames.js index ed2677145fb20..2fba9ebb08da6 100644 --- a/tests/baselines/reference/classWithPredefinedTypesAsNames.js +++ b/tests/baselines/reference/classWithPredefinedTypesAsNames.js @@ -8,22 +8,22 @@ class string { } //// [classWithPredefinedTypesAsNames.js] // classes cannot use predefined types as names -var any = (function () { +var any = /** @class */ (function () { function any() { } return any; }()); -var number = (function () { +var number = /** @class */ (function () { function number() { } return number; }()); -var boolean = (function () { +var boolean = /** @class */ (function () { function boolean() { } return boolean; }()); -var string = (function () { +var string = /** @class */ (function () { function string() { } return string; diff --git a/tests/baselines/reference/classWithPredefinedTypesAsNames2.js b/tests/baselines/reference/classWithPredefinedTypesAsNames2.js index 3a788caff8b68..12dacb1b8bb1c 100644 --- a/tests/baselines/reference/classWithPredefinedTypesAsNames2.js +++ b/tests/baselines/reference/classWithPredefinedTypesAsNames2.js @@ -5,7 +5,7 @@ class void {} //// [classWithPredefinedTypesAsNames2.js] // classes cannot use predefined types as names -var default_1 = (function () { +var default_1 = /** @class */ (function () { function default_1() { } return default_1; diff --git a/tests/baselines/reference/classWithPrivateProperty.js b/tests/baselines/reference/classWithPrivateProperty.js index 6e75797523fb3..1188b43c771c4 100644 --- a/tests/baselines/reference/classWithPrivateProperty.js +++ b/tests/baselines/reference/classWithPrivateProperty.js @@ -24,7 +24,7 @@ var r8: string = C.g(); //// [classWithPrivateProperty.js] // accessing any private outside the class is an error -var C = (function () { +var C = /** @class */ (function () { function C() { this.a = ''; this.b = ''; diff --git a/tests/baselines/reference/classWithProtectedProperty.js b/tests/baselines/reference/classWithProtectedProperty.js index 2bc766cd99a7e..da3c2abd24bb9 100644 --- a/tests/baselines/reference/classWithProtectedProperty.js +++ b/tests/baselines/reference/classWithProtectedProperty.js @@ -39,7 +39,7 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var C = (function () { +var C = /** @class */ (function () { function C() { this.a = ''; this.b = ''; @@ -50,7 +50,7 @@ var C = (function () { C.g = function () { return ''; }; return C; }()); -var D = (function (_super) { +var D = /** @class */ (function (_super) { __extends(D, _super); function D() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/classWithPublicProperty.js b/tests/baselines/reference/classWithPublicProperty.js index 054713264bd01..879a4db8864e4 100644 --- a/tests/baselines/reference/classWithPublicProperty.js +++ b/tests/baselines/reference/classWithPublicProperty.js @@ -22,7 +22,7 @@ var r7: string = C.f(); var r8: string = C.g(); //// [classWithPublicProperty.js] -var C = (function () { +var C = /** @class */ (function () { function C() { this.a = ''; this.b = ''; diff --git a/tests/baselines/reference/classWithSemicolonClassElement1.js b/tests/baselines/reference/classWithSemicolonClassElement1.js index 8eb904ef78636..14f5aa172d0a0 100644 --- a/tests/baselines/reference/classWithSemicolonClassElement1.js +++ b/tests/baselines/reference/classWithSemicolonClassElement1.js @@ -4,7 +4,7 @@ class C { } //// [classWithSemicolonClassElement1.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } ; diff --git a/tests/baselines/reference/classWithSemicolonClassElement2.js b/tests/baselines/reference/classWithSemicolonClassElement2.js index 22b6fa1075ee0..63c6386bb3e61 100644 --- a/tests/baselines/reference/classWithSemicolonClassElement2.js +++ b/tests/baselines/reference/classWithSemicolonClassElement2.js @@ -5,7 +5,7 @@ class C { } //// [classWithSemicolonClassElement2.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } ; diff --git a/tests/baselines/reference/classWithStaticMembers.js b/tests/baselines/reference/classWithStaticMembers.js index e4f4805b42f8b..041e64385bb37 100644 --- a/tests/baselines/reference/classWithStaticMembers.js +++ b/tests/baselines/reference/classWithStaticMembers.js @@ -30,7 +30,7 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var C = (function () { +var C = /** @class */ (function () { function C(a, b) { this.a = a; this.b = b; @@ -47,7 +47,7 @@ var C = (function () { var r = C.fn(); var r2 = r.x; var r3 = r.foo; -var D = (function (_super) { +var D = /** @class */ (function (_super) { __extends(D, _super); function D() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/classWithTwoConstructorDefinitions.js b/tests/baselines/reference/classWithTwoConstructorDefinitions.js index 397a7c8252962..2b65f40cae39f 100644 --- a/tests/baselines/reference/classWithTwoConstructorDefinitions.js +++ b/tests/baselines/reference/classWithTwoConstructorDefinitions.js @@ -10,12 +10,12 @@ class D { } //// [classWithTwoConstructorDefinitions.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } // error return C; }()); -var D = (function () { +var D = /** @class */ (function () { function D(x) { } // error return D; diff --git a/tests/baselines/reference/classWithoutExplicitConstructor.js b/tests/baselines/reference/classWithoutExplicitConstructor.js index 6b835eb35a0cc..0627bf975639b 100644 --- a/tests/baselines/reference/classWithoutExplicitConstructor.js +++ b/tests/baselines/reference/classWithoutExplicitConstructor.js @@ -16,7 +16,7 @@ var d = new D(); var d2 = new D(null); // error //// [classWithoutExplicitConstructor.js] -var C = (function () { +var C = /** @class */ (function () { function C() { this.x = 1; this.y = 'hello'; @@ -25,7 +25,7 @@ var C = (function () { }()); var c = new C(); var c2 = new C(null); // error -var D = (function () { +var D = /** @class */ (function () { function D() { this.x = 2; this.y = null; diff --git a/tests/baselines/reference/classdecl.js b/tests/baselines/reference/classdecl.js index e1e1313dae29c..e7076349db381 100644 --- a/tests/baselines/reference/classdecl.js +++ b/tests/baselines/reference/classdecl.js @@ -104,7 +104,7 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var a = (function () { +var a = /** @class */ (function () { function a(ns) { } a.prototype.pgF = function () { }; @@ -138,7 +138,7 @@ var a = (function () { }; return a; }()); -var b = (function (_super) { +var b = /** @class */ (function (_super) { __extends(b, _super); function b() { return _super !== null && _super.apply(this, arguments) || this; @@ -147,13 +147,13 @@ var b = (function (_super) { }(a)); var m1; (function (m1) { - var b = (function () { + var b = /** @class */ (function () { function b() { } return b; }()); m1.b = b; - var d = (function () { + var d = /** @class */ (function () { function d() { } return d; @@ -163,7 +163,7 @@ var m2; (function (m2) { var m3; (function (m3) { - var c = (function (_super) { + var c = /** @class */ (function (_super) { __extends(c, _super); function c() { return _super !== null && _super.apply(this, arguments) || this; @@ -171,7 +171,7 @@ var m2; return c; }(b)); m3.c = c; - var ib2 = (function () { + var ib2 = /** @class */ (function () { function ib2() { } return ib2; @@ -179,19 +179,19 @@ var m2; m3.ib2 = ib2; })(m3 = m2.m3 || (m2.m3 = {})); })(m2 || (m2 = {})); -var c = (function (_super) { +var c = /** @class */ (function (_super) { __extends(c, _super); function c() { return _super !== null && _super.apply(this, arguments) || this; } return c; }(m1.b)); -var ib2 = (function () { +var ib2 = /** @class */ (function () { function ib2() { } return ib2; }()); -var d = (function () { +var d = /** @class */ (function () { function d() { } d.prototype.foo = function (ns) { @@ -199,7 +199,7 @@ var d = (function () { }; return d; }()); -var e = (function () { +var e = /** @class */ (function () { function e() { } e.prototype.foo = function (ns) { diff --git a/tests/baselines/reference/clinterfaces.js b/tests/baselines/reference/clinterfaces.js index ed3ea1f652354..8e5e28ebcb338 100644 --- a/tests/baselines/reference/clinterfaces.js +++ b/tests/baselines/reference/clinterfaces.js @@ -29,23 +29,23 @@ export = Foo; "use strict"; var M; (function (M) { - var C = (function () { + var C = /** @class */ (function () { function C() { } return C; }()); - var D = (function () { + var D = /** @class */ (function () { function D() { } return D; }()); })(M || (M = {})); -var Foo = (function () { +var Foo = /** @class */ (function () { function Foo() { } return Foo; }()); -var Bar = (function () { +var Bar = /** @class */ (function () { function Bar() { } return Bar; diff --git a/tests/baselines/reference/cloduleAcrossModuleDefinitions.js b/tests/baselines/reference/cloduleAcrossModuleDefinitions.js index ac3ff22852f3f..3e1f5a6adc42a 100644 --- a/tests/baselines/reference/cloduleAcrossModuleDefinitions.js +++ b/tests/baselines/reference/cloduleAcrossModuleDefinitions.js @@ -18,7 +18,7 @@ var b: A.B; // ok //// [cloduleAcrossModuleDefinitions.js] var A; (function (A) { - var B = (function () { + var B = /** @class */ (function () { function B() { } B.prototype.foo = function () { }; diff --git a/tests/baselines/reference/cloduleAndTypeParameters.js b/tests/baselines/reference/cloduleAndTypeParameters.js index c37ec8d584fcf..4c8ca5e11ecbd 100644 --- a/tests/baselines/reference/cloduleAndTypeParameters.js +++ b/tests/baselines/reference/cloduleAndTypeParameters.js @@ -14,13 +14,13 @@ module Foo { } //// [cloduleAndTypeParameters.js] -var Foo = (function () { +var Foo = /** @class */ (function () { function Foo() { } return Foo; }()); (function (Foo) { - var Baz = (function () { + var Baz = /** @class */ (function () { function Baz() { } return Baz; diff --git a/tests/baselines/reference/cloduleSplitAcrossFiles.js b/tests/baselines/reference/cloduleSplitAcrossFiles.js index f509df7e9cea3..b6394b13015af 100644 --- a/tests/baselines/reference/cloduleSplitAcrossFiles.js +++ b/tests/baselines/reference/cloduleSplitAcrossFiles.js @@ -10,7 +10,7 @@ module D { D.y; //// [cloduleSplitAcrossFiles_class.js] -var D = (function () { +var D = /** @class */ (function () { function D() { } return D; diff --git a/tests/baselines/reference/cloduleStaticMembers.js b/tests/baselines/reference/cloduleStaticMembers.js index d17a2b2497d08..8d59de41e68c9 100644 --- a/tests/baselines/reference/cloduleStaticMembers.js +++ b/tests/baselines/reference/cloduleStaticMembers.js @@ -13,7 +13,7 @@ module Clod { //// [cloduleStaticMembers.js] -var Clod = (function () { +var Clod = /** @class */ (function () { function Clod() { } Clod.x = 10; diff --git a/tests/baselines/reference/cloduleWithDuplicateMember1.js b/tests/baselines/reference/cloduleWithDuplicateMember1.js index d364af3a751f3..b8178a3ca51cc 100644 --- a/tests/baselines/reference/cloduleWithDuplicateMember1.js +++ b/tests/baselines/reference/cloduleWithDuplicateMember1.js @@ -16,7 +16,7 @@ module C { } //// [cloduleWithDuplicateMember1.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } Object.defineProperty(C.prototype, "x", { diff --git a/tests/baselines/reference/cloduleWithDuplicateMember2.js b/tests/baselines/reference/cloduleWithDuplicateMember2.js index 927ec4356b5cc..62b2fa3c11d12 100644 --- a/tests/baselines/reference/cloduleWithDuplicateMember2.js +++ b/tests/baselines/reference/cloduleWithDuplicateMember2.js @@ -12,7 +12,7 @@ module C { } //// [cloduleWithDuplicateMember2.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } Object.defineProperty(C.prototype, "x", { diff --git a/tests/baselines/reference/cloduleWithPriorInstantiatedModule.js b/tests/baselines/reference/cloduleWithPriorInstantiatedModule.js index e6bb334a424e9..e976c37904bee 100644 --- a/tests/baselines/reference/cloduleWithPriorInstantiatedModule.js +++ b/tests/baselines/reference/cloduleWithPriorInstantiatedModule.js @@ -22,14 +22,14 @@ var Moclodule; (function (Moclodule) { var x = 10; })(Moclodule || (Moclodule = {})); -var Moclodule = (function () { +var Moclodule = /** @class */ (function () { function Moclodule() { } return Moclodule; }()); // Instantiated module. (function (Moclodule) { - var Manager = (function () { + var Manager = /** @class */ (function () { function Manager() { } return Manager; diff --git a/tests/baselines/reference/cloduleWithPriorUninstantiatedModule.js b/tests/baselines/reference/cloduleWithPriorUninstantiatedModule.js index 552f9a5765640..166df315618dd 100644 --- a/tests/baselines/reference/cloduleWithPriorUninstantiatedModule.js +++ b/tests/baselines/reference/cloduleWithPriorUninstantiatedModule.js @@ -16,14 +16,14 @@ module Moclodule { } //// [cloduleWithPriorUninstantiatedModule.js] -var Moclodule = (function () { +var Moclodule = /** @class */ (function () { function Moclodule() { } return Moclodule; }()); // Instantiated module. (function (Moclodule) { - var Manager = (function () { + var Manager = /** @class */ (function () { function Manager() { } return Manager; diff --git a/tests/baselines/reference/cloduleWithRecursiveReference.js b/tests/baselines/reference/cloduleWithRecursiveReference.js index 6da2de4c07ee6..9b81239a01fee 100644 --- a/tests/baselines/reference/cloduleWithRecursiveReference.js +++ b/tests/baselines/reference/cloduleWithRecursiveReference.js @@ -10,7 +10,7 @@ module M //// [cloduleWithRecursiveReference.js] var M; (function (M) { - var C = (function () { + var C = /** @class */ (function () { function C() { } return C; diff --git a/tests/baselines/reference/clodulesDerivedClasses.js b/tests/baselines/reference/clodulesDerivedClasses.js index e643ed17578de..a5ccb1f84ed49 100644 --- a/tests/baselines/reference/clodulesDerivedClasses.js +++ b/tests/baselines/reference/clodulesDerivedClasses.js @@ -33,7 +33,7 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var Shape = (function () { +var Shape = /** @class */ (function () { function Shape() { } return Shape; @@ -45,7 +45,7 @@ var Shape = (function () { Utils.convert = convert; })(Utils = Shape.Utils || (Shape.Utils = {})); })(Shape || (Shape = {})); -var Path = (function (_super) { +var Path = /** @class */ (function (_super) { __extends(Path, _super); function Path() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/collisionArgumentsClassConstructor.js b/tests/baselines/reference/collisionArgumentsClassConstructor.js index 57ffa88f4e1d6..b9da6ba4fa4b7 100644 --- a/tests/baselines/reference/collisionArgumentsClassConstructor.js +++ b/tests/baselines/reference/collisionArgumentsClassConstructor.js @@ -88,7 +88,7 @@ declare class c6NoError { //// [collisionArgumentsClassConstructor.js] // Constructors -var c1 = (function () { +var c1 = /** @class */ (function () { function c1(i) { var arguments = []; for (var _i = 1; _i < arguments.length; _i++) { @@ -98,7 +98,7 @@ var c1 = (function () { } return c1; }()); -var c12 = (function () { +var c12 = /** @class */ (function () { function c12(arguments) { var rest = []; for (var _i = 1; _i < arguments.length; _i++) { @@ -108,13 +108,13 @@ var c12 = (function () { } return c12; }()); -var c1NoError = (function () { +var c1NoError = /** @class */ (function () { function c1NoError(arguments) { var arguments = 10; // no error } return c1NoError; }()); -var c2 = (function () { +var c2 = /** @class */ (function () { function c2() { var restParameters = []; for (var _i = 0; _i < arguments.length; _i++) { @@ -124,13 +124,13 @@ var c2 = (function () { } return c2; }()); -var c2NoError = (function () { +var c2NoError = /** @class */ (function () { function c2NoError() { var arguments = 10; // no error } return c2NoError; }()); -var c3 = (function () { +var c3 = /** @class */ (function () { function c3(arguments) { var restParameters = []; for (var _i = 1; _i < arguments.length; _i++) { @@ -141,14 +141,14 @@ var c3 = (function () { } return c3; }()); -var c3NoError = (function () { +var c3NoError = /** @class */ (function () { function c3NoError(arguments) { this.arguments = arguments; var arguments = 10; // no error } return c3NoError; }()); -var c5 = (function () { +var c5 = /** @class */ (function () { function c5(i) { var arguments = []; for (var _i = 1; _i < arguments.length; _i++) { @@ -158,7 +158,7 @@ var c5 = (function () { } return c5; }()); -var c52 = (function () { +var c52 = /** @class */ (function () { function c52(arguments) { var rest = []; for (var _i = 1; _i < arguments.length; _i++) { @@ -168,7 +168,7 @@ var c52 = (function () { } return c52; }()); -var c5NoError = (function () { +var c5NoError = /** @class */ (function () { function c5NoError(arguments) { var arguments; // no error } diff --git a/tests/baselines/reference/collisionArgumentsClassMethod.js b/tests/baselines/reference/collisionArgumentsClassMethod.js index 85610926e350c..3c2276f8ce517 100644 --- a/tests/baselines/reference/collisionArgumentsClassMethod.js +++ b/tests/baselines/reference/collisionArgumentsClassMethod.js @@ -49,7 +49,7 @@ class c3 { } //// [collisionArgumentsClassMethod.js] -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } c1.prototype.foo = function (i) { @@ -88,7 +88,7 @@ var c1 = (function () { }; return c1; }()); -var c3 = (function () { +var c3 = /** @class */ (function () { function c3() { } c3.prototype.foo = function () { diff --git a/tests/baselines/reference/collisionCodeGenModuleWithAccessorChildren.js b/tests/baselines/reference/collisionCodeGenModuleWithAccessorChildren.js index 977d0c4bf4959..e43eddd3a46ff 100644 --- a/tests/baselines/reference/collisionCodeGenModuleWithAccessorChildren.js +++ b/tests/baselines/reference/collisionCodeGenModuleWithAccessorChildren.js @@ -49,7 +49,7 @@ module M { // Shouldnt be _M var M; (function (M_1) { M_1.x = 3; - var c = (function () { + var c = /** @class */ (function () { function c() { } Object.defineProperty(c.prototype, "Z", { @@ -63,7 +63,7 @@ var M; }()); })(M || (M = {})); (function (M_2) { - var d = (function () { + var d = /** @class */ (function () { function d() { } Object.defineProperty(d.prototype, "Z", { @@ -78,7 +78,7 @@ var M; }()); })(M || (M = {})); (function (M) { - var e = (function () { + var e = /** @class */ (function () { function e() { } Object.defineProperty(e.prototype, "M", { @@ -92,7 +92,7 @@ var M; }()); })(M || (M = {})); (function (M_3) { - var f = (function () { + var f = /** @class */ (function () { function f() { } Object.defineProperty(f.prototype, "Z", { @@ -107,7 +107,7 @@ var M; }()); })(M || (M = {})); (function (M) { - var e = (function () { + var e = /** @class */ (function () { function e() { } Object.defineProperty(e.prototype, "M", { diff --git a/tests/baselines/reference/collisionCodeGenModuleWithConstructorChildren.js b/tests/baselines/reference/collisionCodeGenModuleWithConstructorChildren.js index 5dd1fb96e1d7d..23afcb0cae5e0 100644 --- a/tests/baselines/reference/collisionCodeGenModuleWithConstructorChildren.js +++ b/tests/baselines/reference/collisionCodeGenModuleWithConstructorChildren.js @@ -27,7 +27,7 @@ module M { var M; (function (M_1) { M_1.x = 3; - var c = (function () { + var c = /** @class */ (function () { function c(M, p) { if (p === void 0) { p = M_1.x; } } @@ -35,7 +35,7 @@ var M; }()); })(M || (M = {})); (function (M_2) { - var d = (function () { + var d = /** @class */ (function () { function d(M, p) { if (p === void 0) { p = M_2.x; } this.M = M; @@ -44,7 +44,7 @@ var M; }()); })(M || (M = {})); (function (M_3) { - var d2 = (function () { + var d2 = /** @class */ (function () { function d2() { var M = 10; var p = M_3.x; diff --git a/tests/baselines/reference/collisionCodeGenModuleWithMemberClassConflict.js b/tests/baselines/reference/collisionCodeGenModuleWithMemberClassConflict.js index cf0fd765e56d0..150feab3236c9 100644 --- a/tests/baselines/reference/collisionCodeGenModuleWithMemberClassConflict.js +++ b/tests/baselines/reference/collisionCodeGenModuleWithMemberClassConflict.js @@ -18,7 +18,7 @@ var foo = new m2._m2(); //// [collisionCodeGenModuleWithMemberClassConflict.js] var m1; (function (m1_1) { - var m1 = (function () { + var m1 = /** @class */ (function () { function m1() { } return m1; @@ -28,13 +28,13 @@ var m1; var foo = new m1.m1(); var m2; (function (m2_1) { - var m2 = (function () { + var m2 = /** @class */ (function () { function m2() { } return m2; }()); m2_1.m2 = m2; - var _m2 = (function () { + var _m2 = /** @class */ (function () { function _m2() { } return _m2; diff --git a/tests/baselines/reference/collisionCodeGenModuleWithMemberInterfaceConflict.js b/tests/baselines/reference/collisionCodeGenModuleWithMemberInterfaceConflict.js index 594a8dc2295cb..ae48d1d36f827 100644 --- a/tests/baselines/reference/collisionCodeGenModuleWithMemberInterfaceConflict.js +++ b/tests/baselines/reference/collisionCodeGenModuleWithMemberInterfaceConflict.js @@ -10,7 +10,7 @@ var foo = new m1.m2(); //// [collisionCodeGenModuleWithMemberInterfaceConflict.js] var m1; (function (m1) { - var m2 = (function () { + var m2 = /** @class */ (function () { function m2() { } return m2; diff --git a/tests/baselines/reference/collisionCodeGenModuleWithMethodChildren.js b/tests/baselines/reference/collisionCodeGenModuleWithMethodChildren.js index 4ff4cb22668ba..e75d84f9df45f 100644 --- a/tests/baselines/reference/collisionCodeGenModuleWithMethodChildren.js +++ b/tests/baselines/reference/collisionCodeGenModuleWithMethodChildren.js @@ -36,7 +36,7 @@ module M { // Shouldnt bn _M var M; (function (M_1) { M_1.x = 3; - var c = (function () { + var c = /** @class */ (function () { function c() { } c.prototype.fn = function (M, p) { @@ -46,7 +46,7 @@ var M; }()); })(M || (M = {})); (function (M_2) { - var d = (function () { + var d = /** @class */ (function () { function d() { } d.prototype.fn2 = function () { @@ -57,7 +57,7 @@ var M; }()); })(M || (M = {})); (function (M_3) { - var e = (function () { + var e = /** @class */ (function () { function e() { } e.prototype.fn3 = function () { @@ -69,7 +69,7 @@ var M; }()); })(M || (M = {})); (function (M) { - var f = (function () { + var f = /** @class */ (function () { function f() { } f.prototype.M = function () { diff --git a/tests/baselines/reference/collisionCodeGenModuleWithModuleChildren.js b/tests/baselines/reference/collisionCodeGenModuleWithModuleChildren.js index a4486c48de3a5..1d2865bbafd9a 100644 --- a/tests/baselines/reference/collisionCodeGenModuleWithModuleChildren.js +++ b/tests/baselines/reference/collisionCodeGenModuleWithModuleChildren.js @@ -55,7 +55,7 @@ var M; (function (M_2) { var m2; (function (m2) { - var M = (function () { + var M = /** @class */ (function () { function M() { } return M; diff --git a/tests/baselines/reference/collisionCodeGenModuleWithModuleReopening.js b/tests/baselines/reference/collisionCodeGenModuleWithModuleReopening.js index def2c8c2bb0f9..db1abb520b07a 100644 --- a/tests/baselines/reference/collisionCodeGenModuleWithModuleReopening.js +++ b/tests/baselines/reference/collisionCodeGenModuleWithModuleReopening.js @@ -32,7 +32,7 @@ var foo2 = new m2.m2(); //// [collisionCodeGenModuleWithModuleReopening.js] var m1; (function (m1_1) { - var m1 = (function () { + var m1 = /** @class */ (function () { function m1() { } return m1; @@ -41,7 +41,7 @@ var m1; })(m1 || (m1 = {})); var foo = new m1.m1(); (function (m1) { - var c1 = (function () { + var c1 = /** @class */ (function () { function c1() { } return c1; @@ -53,7 +53,7 @@ var foo = new m1.m1(); var foo2 = new m1.c1(); var m2; (function (m2) { - var c1 = (function () { + var c1 = /** @class */ (function () { function c1() { } return c1; @@ -64,7 +64,7 @@ var m2; })(m2 || (m2 = {})); var foo3 = new m2.c1(); (function (m2_1) { - var m2 = (function () { + var m2 = /** @class */ (function () { function m2() { } return m2; diff --git a/tests/baselines/reference/collisionCodeGenModuleWithPrivateMember.js b/tests/baselines/reference/collisionCodeGenModuleWithPrivateMember.js index ca9420197fb98..097117222e374 100644 --- a/tests/baselines/reference/collisionCodeGenModuleWithPrivateMember.js +++ b/tests/baselines/reference/collisionCodeGenModuleWithPrivateMember.js @@ -11,13 +11,13 @@ var foo = new m1.c1(); //// [collisionCodeGenModuleWithPrivateMember.js] var m1; (function (m1_1) { - var m1 = (function () { + var m1 = /** @class */ (function () { function m1() { } return m1; }()); var x = new m1(); - var c1 = (function () { + var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/collisionCodeGenModuleWithUnicodeNames.js b/tests/baselines/reference/collisionCodeGenModuleWithUnicodeNames.js index 50eff733912b8..6a5056281a168 100644 --- a/tests/baselines/reference/collisionCodeGenModuleWithUnicodeNames.js +++ b/tests/baselines/reference/collisionCodeGenModuleWithUnicodeNames.js @@ -12,7 +12,7 @@ var x = new 才能ソЫⅨ蒤郳र्क्ड्राüışğİliيونيكو //// [collisionCodeGenModuleWithUnicodeNames.js] var 才能ソЫⅨ蒤郳र्क्ड्राüışğİliيونيكودöÄüß才能ソЫⅨ蒤郳र्क्ड्राüışğİliيونيكودöÄüßAbcd123; (function (才能ソЫⅨ蒤郳र्क्ड्राüışğİliيونيكودöÄüß才能ソЫⅨ蒤郳र्क्ड्राüışğİliيونيكودöÄüßAbcd123_1) { - var 才能ソЫⅨ蒤郳र्क्ड्राüışğİliيونيكودöÄüß才能ソЫⅨ蒤郳र्क्ड्राüışğİliيونيكودöÄüßAbcd123 = (function () { + var 才能ソЫⅨ蒤郳र्क्ड्राüışğİliيونيكودöÄüß才能ソЫⅨ蒤郳र्क्ड्राüışğİliيونيكودöÄüßAbcd123 = /** @class */ (function () { function 才能ソЫⅨ蒤郳र्क्ड्राüışğİliيونيكودöÄüß才能ソЫⅨ蒤郳र्क्ड्राüışğİliيونيكودöÄüßAbcd123() { } return 才能ソЫⅨ蒤郳र्क्ड्राüışğİliيونيكودöÄüß才能ソЫⅨ蒤郳र्क्ड्राüışğİliيونيكودöÄüßAbcd123; diff --git a/tests/baselines/reference/collisionExportsRequireAndClass.js b/tests/baselines/reference/collisionExportsRequireAndClass.js index 0bc56b97cf111..f0d383b06515a 100644 --- a/tests/baselines/reference/collisionExportsRequireAndClass.js +++ b/tests/baselines/reference/collisionExportsRequireAndClass.js @@ -40,13 +40,13 @@ module m4 { define(["require", "exports"], function (require, exports) { "use strict"; exports.__esModule = true; - var require = (function () { + var require = /** @class */ (function () { function require() { } return require; }()); exports.require = require; - var exports = (function () { + var exports = /** @class */ (function () { function exports() { } return exports; @@ -54,12 +54,12 @@ define(["require", "exports"], function (require, exports) { exports.exports = exports; var m1; (function (m1) { - var require = (function () { + var require = /** @class */ (function () { function require() { } return require; }()); - var exports = (function () { + var exports = /** @class */ (function () { function exports() { } return exports; @@ -67,13 +67,13 @@ define(["require", "exports"], function (require, exports) { })(m1 || (m1 = {})); var m2; (function (m2) { - var require = (function () { + var require = /** @class */ (function () { function require() { } return require; }()); m2.require = require; - var exports = (function () { + var exports = /** @class */ (function () { function exports() { } return exports; @@ -82,24 +82,24 @@ define(["require", "exports"], function (require, exports) { })(m2 || (m2 = {})); }); //// [collisionExportsRequireAndClass_globalFile.js] -var require = (function () { +var require = /** @class */ (function () { function require() { } return require; }()); -var exports = (function () { +var exports = /** @class */ (function () { function exports() { } return exports; }()); var m3; (function (m3) { - var require = (function () { + var require = /** @class */ (function () { function require() { } return require; }()); - var exports = (function () { + var exports = /** @class */ (function () { function exports() { } return exports; @@ -107,13 +107,13 @@ var m3; })(m3 || (m3 = {})); var m4; (function (m4) { - var require = (function () { + var require = /** @class */ (function () { function require() { } return require; }()); m4.require = require; - var exports = (function () { + var exports = /** @class */ (function () { function exports() { } return exports; diff --git a/tests/baselines/reference/collisionExportsRequireAndInternalModuleAlias.js b/tests/baselines/reference/collisionExportsRequireAndInternalModuleAlias.js index 9cb3c4e797e0e..ac243d3252681 100644 --- a/tests/baselines/reference/collisionExportsRequireAndInternalModuleAlias.js +++ b/tests/baselines/reference/collisionExportsRequireAndInternalModuleAlias.js @@ -28,7 +28,7 @@ define(["require", "exports"], function (require, exports) { exports.__esModule = true; var m; (function (m) { - var c = (function () { + var c = /** @class */ (function () { function c() { } return c; diff --git a/tests/baselines/reference/collisionExportsRequireAndInternalModuleAliasInGlobalFile.js b/tests/baselines/reference/collisionExportsRequireAndInternalModuleAliasInGlobalFile.js index b90d223660187..547be309a0f74 100644 --- a/tests/baselines/reference/collisionExportsRequireAndInternalModuleAliasInGlobalFile.js +++ b/tests/baselines/reference/collisionExportsRequireAndInternalModuleAliasInGlobalFile.js @@ -25,7 +25,7 @@ module m2 { //// [collisionExportsRequireAndInternalModuleAliasInGlobalFile.js] var mOfGloalFile; (function (mOfGloalFile) { - var c = (function () { + var c = /** @class */ (function () { function c() { } return c; diff --git a/tests/baselines/reference/collisionExportsRequireAndModule.js b/tests/baselines/reference/collisionExportsRequireAndModule.js index 4282095500408..ffbdfc4353673 100644 --- a/tests/baselines/reference/collisionExportsRequireAndModule.js +++ b/tests/baselines/reference/collisionExportsRequireAndModule.js @@ -97,7 +97,7 @@ define(["require", "exports"], function (require, exports) { exports.__esModule = true; var require; (function (require) { - var C = (function () { + var C = /** @class */ (function () { function C() { } return C; @@ -110,7 +110,7 @@ define(["require", "exports"], function (require, exports) { exports.foo = foo; var exports; (function (exports) { - var C = (function () { + var C = /** @class */ (function () { function C() { } return C; @@ -125,7 +125,7 @@ define(["require", "exports"], function (require, exports) { (function (m1) { var require; (function (require) { - var C = (function () { + var C = /** @class */ (function () { function C() { } return C; @@ -134,7 +134,7 @@ define(["require", "exports"], function (require, exports) { })(require || (require = {})); var exports; (function (exports) { - var C = (function () { + var C = /** @class */ (function () { function C() { } return C; @@ -146,7 +146,7 @@ define(["require", "exports"], function (require, exports) { (function (m2) { var require; (function (require) { - var C = (function () { + var C = /** @class */ (function () { function C() { } return C; @@ -155,7 +155,7 @@ define(["require", "exports"], function (require, exports) { })(require = m2.require || (m2.require = {})); var exports; (function (exports) { - var C = (function () { + var C = /** @class */ (function () { function C() { } return C; @@ -167,7 +167,7 @@ define(["require", "exports"], function (require, exports) { //// [collisionExportsRequireAndModule_globalFile.js] var require; (function (require) { - var C = (function () { + var C = /** @class */ (function () { function C() { } return C; @@ -176,7 +176,7 @@ var require; })(require || (require = {})); var exports; (function (exports) { - var C = (function () { + var C = /** @class */ (function () { function C() { } return C; @@ -187,7 +187,7 @@ var m3; (function (m3) { var require; (function (require) { - var C = (function () { + var C = /** @class */ (function () { function C() { } return C; @@ -196,7 +196,7 @@ var m3; })(require || (require = {})); var exports; (function (exports) { - var C = (function () { + var C = /** @class */ (function () { function C() { } return C; @@ -208,7 +208,7 @@ var m4; (function (m4) { var require; (function (require) { - var C = (function () { + var C = /** @class */ (function () { function C() { } return C; @@ -217,7 +217,7 @@ var m4; })(require = m4.require || (m4.require = {})); var exports; (function (exports) { - var C = (function () { + var C = /** @class */ (function () { function C() { } return C; diff --git a/tests/baselines/reference/collisionRestParameterClassConstructor.js b/tests/baselines/reference/collisionRestParameterClassConstructor.js index f97e49531f64f..ee6565cf0a1e6 100644 --- a/tests/baselines/reference/collisionRestParameterClassConstructor.js +++ b/tests/baselines/reference/collisionRestParameterClassConstructor.js @@ -68,7 +68,7 @@ declare class c6NoError { //// [collisionRestParameterClassConstructor.js] // Constructors -var c1 = (function () { +var c1 = /** @class */ (function () { function c1(_i) { var restParameters = []; for (var _a = 1; _a < arguments.length; _a++) { @@ -78,13 +78,13 @@ var c1 = (function () { } return c1; }()); -var c1NoError = (function () { +var c1NoError = /** @class */ (function () { function c1NoError(_i) { var _i = 10; // no error } return c1NoError; }()); -var c2 = (function () { +var c2 = /** @class */ (function () { function c2() { var restParameters = []; for (var _a = 0; _a < arguments.length; _a++) { @@ -94,13 +94,13 @@ var c2 = (function () { } return c2; }()); -var c2NoError = (function () { +var c2NoError = /** @class */ (function () { function c2NoError() { var _i = 10; // no error } return c2NoError; }()); -var c3 = (function () { +var c3 = /** @class */ (function () { function c3(_i) { var restParameters = []; for (var _a = 1; _a < arguments.length; _a++) { @@ -111,14 +111,14 @@ var c3 = (function () { } return c3; }()); -var c3NoError = (function () { +var c3NoError = /** @class */ (function () { function c3NoError(_i) { this._i = _i; var _i = 10; // no error } return c3NoError; }()); -var c5 = (function () { +var c5 = /** @class */ (function () { function c5(_i) { var rest = []; for (var _a = 1; _a < arguments.length; _a++) { @@ -128,7 +128,7 @@ var c5 = (function () { } return c5; }()); -var c5NoError = (function () { +var c5NoError = /** @class */ (function () { function c5NoError(_i) { var _i; // no error } diff --git a/tests/baselines/reference/collisionRestParameterClassMethod.js b/tests/baselines/reference/collisionRestParameterClassMethod.js index cda717c79ab03..6c49ebe135053 100644 --- a/tests/baselines/reference/collisionRestParameterClassMethod.js +++ b/tests/baselines/reference/collisionRestParameterClassMethod.js @@ -39,7 +39,7 @@ class c3 { } //// [collisionRestParameterClassMethod.js] -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } c1.prototype.foo = function (_i) { @@ -64,7 +64,7 @@ var c1 = (function () { }; return c1; }()); -var c3 = (function () { +var c3 = /** @class */ (function () { function c3() { } c3.prototype.foo = function () { diff --git a/tests/baselines/reference/collisionRestParameterUnderscoreIUsage.js b/tests/baselines/reference/collisionRestParameterUnderscoreIUsage.js index 1d7f9f43f7c11..4b09dfe6683d8 100644 --- a/tests/baselines/reference/collisionRestParameterUnderscoreIUsage.js +++ b/tests/baselines/reference/collisionRestParameterUnderscoreIUsage.js @@ -10,7 +10,7 @@ new Foo(); //// [collisionRestParameterUnderscoreIUsage.js] var _i = "This is what I'd expect to see"; -var Foo = (function () { +var Foo = /** @class */ (function () { function Foo() { var args = []; for (var _a = 0; _a < arguments.length; _a++) { diff --git a/tests/baselines/reference/collisionSuperAndLocalFunctionInAccessors.js b/tests/baselines/reference/collisionSuperAndLocalFunctionInAccessors.js index 7d8e23cd5089a..000c3cfe35e8d 100644 --- a/tests/baselines/reference/collisionSuperAndLocalFunctionInAccessors.js +++ b/tests/baselines/reference/collisionSuperAndLocalFunctionInAccessors.js @@ -52,7 +52,7 @@ var __extends = (this && this.__extends) || (function () { })(); function _super() { } -var Foo = (function () { +var Foo = /** @class */ (function () { function Foo() { } Object.defineProperty(Foo.prototype, "prop1", { @@ -70,7 +70,7 @@ var Foo = (function () { }); return Foo; }()); -var b = (function (_super) { +var b = /** @class */ (function (_super) { __extends(b, _super); function b() { return _super !== null && _super.apply(this, arguments) || this; @@ -90,7 +90,7 @@ var b = (function (_super) { }); return b; }(Foo)); -var c = (function (_super) { +var c = /** @class */ (function (_super) { __extends(c, _super); function c() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/collisionSuperAndLocalFunctionInConstructor.js b/tests/baselines/reference/collisionSuperAndLocalFunctionInConstructor.js index d516c06ad1871..4c2d6fce3490f 100644 --- a/tests/baselines/reference/collisionSuperAndLocalFunctionInConstructor.js +++ b/tests/baselines/reference/collisionSuperAndLocalFunctionInConstructor.js @@ -37,14 +37,14 @@ var __extends = (this && this.__extends) || (function () { })(); function _super() { } -var Foo = (function () { +var Foo = /** @class */ (function () { function Foo() { function _super() { } } return Foo; }()); -var b = (function (_super) { +var b = /** @class */ (function (_super) { __extends(b, _super); function b() { var _this = _super.call(this) || this; @@ -54,7 +54,7 @@ var b = (function (_super) { } return b; }(Foo)); -var c = (function (_super) { +var c = /** @class */ (function (_super) { __extends(c, _super); function c() { var _this = _super.call(this) || this; diff --git a/tests/baselines/reference/collisionSuperAndLocalFunctionInMethod.js b/tests/baselines/reference/collisionSuperAndLocalFunctionInMethod.js index b211b3e4eacc7..74ca7f80ce4b9 100644 --- a/tests/baselines/reference/collisionSuperAndLocalFunctionInMethod.js +++ b/tests/baselines/reference/collisionSuperAndLocalFunctionInMethod.js @@ -41,7 +41,7 @@ var __extends = (this && this.__extends) || (function () { })(); function _super() { } -var Foo = (function () { +var Foo = /** @class */ (function () { function Foo() { } Foo.prototype.x = function () { @@ -52,7 +52,7 @@ var Foo = (function () { }; return Foo; }()); -var b = (function (_super) { +var b = /** @class */ (function (_super) { __extends(b, _super); function b() { return _super !== null && _super.apply(this, arguments) || this; @@ -65,7 +65,7 @@ var b = (function (_super) { }; return b; }(Foo)); -var c = (function (_super) { +var c = /** @class */ (function (_super) { __extends(c, _super); function c() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/collisionSuperAndLocalFunctionInProperty.js b/tests/baselines/reference/collisionSuperAndLocalFunctionInProperty.js index 9701e9b4fc46b..586315b160760 100644 --- a/tests/baselines/reference/collisionSuperAndLocalFunctionInProperty.js +++ b/tests/baselines/reference/collisionSuperAndLocalFunctionInProperty.js @@ -31,7 +31,7 @@ var __extends = (this && this.__extends) || (function () { })(); function _super() { } -var Foo = (function () { +var Foo = /** @class */ (function () { function Foo() { this.prop1 = { doStuff: function () { @@ -42,7 +42,7 @@ var Foo = (function () { } return Foo; }()); -var b = (function (_super) { +var b = /** @class */ (function (_super) { __extends(b, _super); function b() { var _this = _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/collisionSuperAndLocalVarInAccessors.js b/tests/baselines/reference/collisionSuperAndLocalVarInAccessors.js index 3a6e8b9e77239..d5541889a81ec 100644 --- a/tests/baselines/reference/collisionSuperAndLocalVarInAccessors.js +++ b/tests/baselines/reference/collisionSuperAndLocalVarInAccessors.js @@ -44,7 +44,7 @@ var __extends = (this && this.__extends) || (function () { }; })(); var _super = 10; // No Error -var Foo = (function () { +var Foo = /** @class */ (function () { function Foo() { } Object.defineProperty(Foo.prototype, "prop1", { @@ -60,7 +60,7 @@ var Foo = (function () { }); return Foo; }()); -var b = (function (_super) { +var b = /** @class */ (function (_super) { __extends(b, _super); function b() { return _super !== null && _super.apply(this, arguments) || this; @@ -78,7 +78,7 @@ var b = (function (_super) { }); return b; }(Foo)); -var c = (function (_super) { +var c = /** @class */ (function (_super) { __extends(c, _super); function c() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/collisionSuperAndLocalVarInConstructor.js b/tests/baselines/reference/collisionSuperAndLocalVarInConstructor.js index dcbf08024a953..e586b4dc55ea6 100644 --- a/tests/baselines/reference/collisionSuperAndLocalVarInConstructor.js +++ b/tests/baselines/reference/collisionSuperAndLocalVarInConstructor.js @@ -32,13 +32,13 @@ var __extends = (this && this.__extends) || (function () { }; })(); var _super = 10; // No Error -var Foo = (function () { +var Foo = /** @class */ (function () { function Foo() { var _super = 10; // No error } return Foo; }()); -var b = (function (_super) { +var b = /** @class */ (function (_super) { __extends(b, _super); function b() { var _this = _super.call(this) || this; @@ -47,7 +47,7 @@ var b = (function (_super) { } return b; }(Foo)); -var c = (function (_super) { +var c = /** @class */ (function (_super) { __extends(c, _super); function c() { var _this = _super.call(this) || this; diff --git a/tests/baselines/reference/collisionSuperAndLocalVarInMethod.js b/tests/baselines/reference/collisionSuperAndLocalVarInMethod.js index c6cce551d9326..54ed127b6c1f7 100644 --- a/tests/baselines/reference/collisionSuperAndLocalVarInMethod.js +++ b/tests/baselines/reference/collisionSuperAndLocalVarInMethod.js @@ -30,7 +30,7 @@ var __extends = (this && this.__extends) || (function () { }; })(); var _super = 10; // No Error -var Foo = (function () { +var Foo = /** @class */ (function () { function Foo() { } Foo.prototype.x = function () { @@ -38,7 +38,7 @@ var Foo = (function () { }; return Foo; }()); -var b = (function (_super) { +var b = /** @class */ (function (_super) { __extends(b, _super); function b() { return _super !== null && _super.apply(this, arguments) || this; @@ -48,7 +48,7 @@ var b = (function (_super) { }; return b; }(Foo)); -var c = (function (_super) { +var c = /** @class */ (function (_super) { __extends(c, _super); function c() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/collisionSuperAndLocalVarInProperty.js b/tests/baselines/reference/collisionSuperAndLocalVarInProperty.js index b88513b53dd7c..b7b9490a115b1 100644 --- a/tests/baselines/reference/collisionSuperAndLocalVarInProperty.js +++ b/tests/baselines/reference/collisionSuperAndLocalVarInProperty.js @@ -29,7 +29,7 @@ var __extends = (this && this.__extends) || (function () { }; })(); var _super = 10; // No Error -var Foo = (function () { +var Foo = /** @class */ (function () { function Foo() { this.prop1 = { doStuff: function () { @@ -40,7 +40,7 @@ var Foo = (function () { } return Foo; }()); -var b = (function (_super) { +var b = /** @class */ (function (_super) { __extends(b, _super); function b() { var _this = _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/collisionSuperAndNameResolution.js b/tests/baselines/reference/collisionSuperAndNameResolution.js index c35c30ec84e7e..c8489e006a800 100644 --- a/tests/baselines/reference/collisionSuperAndNameResolution.js +++ b/tests/baselines/reference/collisionSuperAndNameResolution.js @@ -24,12 +24,12 @@ var __extends = (this && this.__extends) || (function () { })(); var console; var _super = 10; // No error -var base = (function () { +var base = /** @class */ (function () { function base() { } return base; }()); -var Foo = (function (_super) { +var Foo = /** @class */ (function (_super) { __extends(Foo, _super); function Foo() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/collisionSuperAndParameter.js b/tests/baselines/reference/collisionSuperAndParameter.js index e2771fadf1fa6..9ee69713883a8 100644 --- a/tests/baselines/reference/collisionSuperAndParameter.js +++ b/tests/baselines/reference/collisionSuperAndParameter.js @@ -73,7 +73,7 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var Foo = (function () { +var Foo = /** @class */ (function () { function Foo() { } Foo.prototype.a = function () { @@ -96,7 +96,7 @@ var Foo = (function () { }); return Foo; }()); -var Foo2 = (function (_super) { +var Foo2 = /** @class */ (function (_super) { __extends(Foo2, _super); function Foo2(_super) { var _this = _super.call(this) || this; @@ -126,7 +126,7 @@ var Foo2 = (function (_super) { }); return Foo2; }(Foo)); -var Foo4 = (function (_super) { +var Foo4 = /** @class */ (function (_super) { __extends(Foo4, _super); function Foo4(_super) { return _super.call(this) || this; diff --git a/tests/baselines/reference/collisionSuperAndParameter1.js b/tests/baselines/reference/collisionSuperAndParameter1.js index 8bc3fc19b5bb0..f665a5d03df60 100644 --- a/tests/baselines/reference/collisionSuperAndParameter1.js +++ b/tests/baselines/reference/collisionSuperAndParameter1.js @@ -20,12 +20,12 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var Foo = (function () { +var Foo = /** @class */ (function () { function Foo() { } return Foo; }()); -var Foo2 = (function (_super) { +var Foo2 = /** @class */ (function (_super) { __extends(Foo2, _super); function Foo2() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/collisionSuperAndPropertyNameAsConstuctorParameter.js b/tests/baselines/reference/collisionSuperAndPropertyNameAsConstuctorParameter.js index f905e5208662a..a98bb021c5526 100644 --- a/tests/baselines/reference/collisionSuperAndPropertyNameAsConstuctorParameter.js +++ b/tests/baselines/reference/collisionSuperAndPropertyNameAsConstuctorParameter.js @@ -41,19 +41,19 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var a = (function () { +var a = /** @class */ (function () { function a() { } return a; }()); -var b1 = (function (_super) { +var b1 = /** @class */ (function (_super) { __extends(b1, _super); function b1(_super) { return _super.call(this) || this; } return b1; }(a)); -var b2 = (function (_super) { +var b2 = /** @class */ (function (_super) { __extends(b2, _super); function b2(_super) { var _this = _super.call(this) || this; @@ -62,14 +62,14 @@ var b2 = (function (_super) { } return b2; }(a)); -var b3 = (function (_super) { +var b3 = /** @class */ (function (_super) { __extends(b3, _super); function b3(_super) { return _super.call(this) || this; } return b3; }(a)); -var b4 = (function (_super) { +var b4 = /** @class */ (function (_super) { __extends(b4, _super); function b4(_super) { var _this = _super.call(this) || this; diff --git a/tests/baselines/reference/collisionThisExpressionAndClassInGlobal.js b/tests/baselines/reference/collisionThisExpressionAndClassInGlobal.js index 09dcee3caad55..f3158047a5446 100644 --- a/tests/baselines/reference/collisionThisExpressionAndClassInGlobal.js +++ b/tests/baselines/reference/collisionThisExpressionAndClassInGlobal.js @@ -5,7 +5,7 @@ var f = () => this; //// [collisionThisExpressionAndClassInGlobal.js] var _this = this; -var _this = (function () { +var _this = /** @class */ (function () { function _this() { } return _this; diff --git a/tests/baselines/reference/collisionThisExpressionAndLocalVarInAccessors.js b/tests/baselines/reference/collisionThisExpressionAndLocalVarInAccessors.js index e2f22cdf3e637..4a7875bfe4019 100644 --- a/tests/baselines/reference/collisionThisExpressionAndLocalVarInAccessors.js +++ b/tests/baselines/reference/collisionThisExpressionAndLocalVarInAccessors.js @@ -44,7 +44,7 @@ class class2 { } //// [collisionThisExpressionAndLocalVarInAccessors.js] -var class1 = (function () { +var class1 = /** @class */ (function () { function class1() { } Object.defineProperty(class1.prototype, "a", { @@ -72,7 +72,7 @@ var class1 = (function () { }); return class1; }()); -var class2 = (function () { +var class2 = /** @class */ (function () { function class2() { } Object.defineProperty(class2.prototype, "a", { diff --git a/tests/baselines/reference/collisionThisExpressionAndLocalVarInConstructor.js b/tests/baselines/reference/collisionThisExpressionAndLocalVarInConstructor.js index e402749998870..ab60d6244a140 100644 --- a/tests/baselines/reference/collisionThisExpressionAndLocalVarInConstructor.js +++ b/tests/baselines/reference/collisionThisExpressionAndLocalVarInConstructor.js @@ -22,7 +22,7 @@ class class2 { } //// [collisionThisExpressionAndLocalVarInConstructor.js] -var class1 = (function () { +var class1 = /** @class */ (function () { function class1() { var _this = this; var x2 = { @@ -34,7 +34,7 @@ var class1 = (function () { } return class1; }()); -var class2 = (function () { +var class2 = /** @class */ (function () { function class2() { var _this = this; var _this = 2; diff --git a/tests/baselines/reference/collisionThisExpressionAndLocalVarInMethod.js b/tests/baselines/reference/collisionThisExpressionAndLocalVarInMethod.js index 7c71fd79ade1a..2d5de59390918 100644 --- a/tests/baselines/reference/collisionThisExpressionAndLocalVarInMethod.js +++ b/tests/baselines/reference/collisionThisExpressionAndLocalVarInMethod.js @@ -19,7 +19,7 @@ class a { } //// [collisionThisExpressionAndLocalVarInMethod.js] -var a = (function () { +var a = /** @class */ (function () { function a() { } a.prototype.method1 = function () { diff --git a/tests/baselines/reference/collisionThisExpressionAndLocalVarInProperty.js b/tests/baselines/reference/collisionThisExpressionAndLocalVarInProperty.js index 2a54b5fd7e6b3..4ce4f08a77862 100644 --- a/tests/baselines/reference/collisionThisExpressionAndLocalVarInProperty.js +++ b/tests/baselines/reference/collisionThisExpressionAndLocalVarInProperty.js @@ -20,7 +20,7 @@ class class2 { } //// [collisionThisExpressionAndLocalVarInProperty.js] -var class1 = (function () { +var class1 = /** @class */ (function () { function class1() { var _this = this; this.prop1 = { @@ -32,7 +32,7 @@ var class1 = (function () { } return class1; }()); -var class2 = (function () { +var class2 = /** @class */ (function () { function class2() { var _this = this; this.prop1 = { diff --git a/tests/baselines/reference/collisionThisExpressionAndLocalVarWithSuperExperssion.js b/tests/baselines/reference/collisionThisExpressionAndLocalVarWithSuperExperssion.js index d0d5059adec07..a1bc5d369651e 100644 --- a/tests/baselines/reference/collisionThisExpressionAndLocalVarWithSuperExperssion.js +++ b/tests/baselines/reference/collisionThisExpressionAndLocalVarWithSuperExperssion.js @@ -29,14 +29,14 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var a = (function () { +var a = /** @class */ (function () { function a() { } a.prototype.foo = function () { }; return a; }()); -var b = (function (_super) { +var b = /** @class */ (function (_super) { __extends(b, _super); function b() { return _super !== null && _super.apply(this, arguments) || this; @@ -48,7 +48,7 @@ var b = (function (_super) { }; return b; }(a)); -var b2 = (function (_super) { +var b2 = /** @class */ (function (_super) { __extends(b2, _super); function b2() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/collisionThisExpressionAndModuleInGlobal.js b/tests/baselines/reference/collisionThisExpressionAndModuleInGlobal.js index 240817ac0b944..36dca587068ce 100644 --- a/tests/baselines/reference/collisionThisExpressionAndModuleInGlobal.js +++ b/tests/baselines/reference/collisionThisExpressionAndModuleInGlobal.js @@ -9,7 +9,7 @@ var f = () => this; var _this = this; var _this; (function (_this) { - var c = (function () { + var c = /** @class */ (function () { function c() { } return c; diff --git a/tests/baselines/reference/collisionThisExpressionAndNameResolution.js b/tests/baselines/reference/collisionThisExpressionAndNameResolution.js index 130f99bcd9079..2e981ad33d941 100644 --- a/tests/baselines/reference/collisionThisExpressionAndNameResolution.js +++ b/tests/baselines/reference/collisionThisExpressionAndNameResolution.js @@ -14,7 +14,7 @@ class Foo { //// [collisionThisExpressionAndNameResolution.js] var console; -var Foo = (function () { +var Foo = /** @class */ (function () { function Foo() { } Foo.prototype.x = function () { diff --git a/tests/baselines/reference/collisionThisExpressionAndParameter.js b/tests/baselines/reference/collisionThisExpressionAndParameter.js index bc15e4b56b50a..acaceb9170b86 100644 --- a/tests/baselines/reference/collisionThisExpressionAndParameter.js +++ b/tests/baselines/reference/collisionThisExpressionAndParameter.js @@ -94,7 +94,7 @@ declare function f4(_this: number); // no code gen - no error declare function f4(_this: string); // no code gen - no error //// [collisionThisExpressionAndParameter.js] -var Foo = (function () { +var Foo = /** @class */ (function () { function Foo() { } Foo.prototype.x = function () { @@ -131,7 +131,7 @@ var Foo = (function () { }; return Foo; }()); -var Foo1 = (function () { +var Foo1 = /** @class */ (function () { function Foo1(_this) { var _this = this; var x2 = { @@ -146,7 +146,7 @@ function f1(_this) { var _this = this; (function (x) { console.log(_this.x); }); } -var Foo3 = (function () { +var Foo3 = /** @class */ (function () { function Foo3(_this) { var _this = this; var x2 = { diff --git a/tests/baselines/reference/collisionThisExpressionAndPropertyNameAsConstuctorParameter.js b/tests/baselines/reference/collisionThisExpressionAndPropertyNameAsConstuctorParameter.js index b8218cd38ff29..3758cfdecdad6 100644 --- a/tests/baselines/reference/collisionThisExpressionAndPropertyNameAsConstuctorParameter.js +++ b/tests/baselines/reference/collisionThisExpressionAndPropertyNameAsConstuctorParameter.js @@ -36,7 +36,7 @@ class Foo5 { } //// [collisionThisExpressionAndPropertyNameAsConstuctorParameter.js] -var Foo2 = (function () { +var Foo2 = /** @class */ (function () { function Foo2(_this) { var _this = this; var lambda = function () { @@ -45,7 +45,7 @@ var Foo2 = (function () { } return Foo2; }()); -var Foo3 = (function () { +var Foo3 = /** @class */ (function () { function Foo3(_this) { var _this = this; this._this = _this; @@ -55,7 +55,7 @@ var Foo3 = (function () { } return Foo3; }()); -var Foo4 = (function () { +var Foo4 = /** @class */ (function () { function Foo4(_this) { var _this = this; var lambda = function () { @@ -64,7 +64,7 @@ var Foo4 = (function () { } return Foo4; }()); -var Foo5 = (function () { +var Foo5 = /** @class */ (function () { function Foo5(_this) { var _this = this; this._this = _this; diff --git a/tests/baselines/reference/commaOperatorWithSecondOperandObjectType.js b/tests/baselines/reference/commaOperatorWithSecondOperandObjectType.js index ef8148639343c..905eb8b7d6a8d 100644 --- a/tests/baselines/reference/commaOperatorWithSecondOperandObjectType.js +++ b/tests/baselines/reference/commaOperatorWithSecondOperandObjectType.js @@ -45,7 +45,7 @@ var BOOLEAN; var NUMBER; var STRING; var OBJECT; -var CLASS = (function () { +var CLASS = /** @class */ (function () { function CLASS() { } return CLASS; diff --git a/tests/baselines/reference/commentBeforeStaticMethod1.js b/tests/baselines/reference/commentBeforeStaticMethod1.js index 2d5fb6ace2e85..b8b6e7e093d79 100644 --- a/tests/baselines/reference/commentBeforeStaticMethod1.js +++ b/tests/baselines/reference/commentBeforeStaticMethod1.js @@ -9,7 +9,7 @@ class C { } //// [commentBeforeStaticMethod1.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } /** diff --git a/tests/baselines/reference/commentOnClassAccessor1.js b/tests/baselines/reference/commentOnClassAccessor1.js index 0c3e4c1848fd0..3836bd8681866 100644 --- a/tests/baselines/reference/commentOnClassAccessor1.js +++ b/tests/baselines/reference/commentOnClassAccessor1.js @@ -7,7 +7,7 @@ class C { } //// [commentOnClassAccessor1.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } Object.defineProperty(C.prototype, "bar", { diff --git a/tests/baselines/reference/commentOnClassAccessor2.js b/tests/baselines/reference/commentOnClassAccessor2.js index 3b58cc28abd27..5ab91eb6adc86 100644 --- a/tests/baselines/reference/commentOnClassAccessor2.js +++ b/tests/baselines/reference/commentOnClassAccessor2.js @@ -12,7 +12,7 @@ class C { } //// [commentOnClassAccessor2.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } Object.defineProperty(C.prototype, "bar", { diff --git a/tests/baselines/reference/commentOnClassMethod1.js b/tests/baselines/reference/commentOnClassMethod1.js index 4b909da55a44c..502f8308ee8d5 100644 --- a/tests/baselines/reference/commentOnClassMethod1.js +++ b/tests/baselines/reference/commentOnClassMethod1.js @@ -8,7 +8,7 @@ class WebControls { } //// [commentOnClassMethod1.js] -var WebControls = (function () { +var WebControls = /** @class */ (function () { function WebControls() { } /** diff --git a/tests/baselines/reference/commentOnDecoratedClassDeclaration.js b/tests/baselines/reference/commentOnDecoratedClassDeclaration.js index 8e6cd7149cf46..4d8fa428e5070 100644 --- a/tests/baselines/reference/commentOnDecoratedClassDeclaration.js +++ b/tests/baselines/reference/commentOnDecoratedClassDeclaration.js @@ -26,7 +26,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key, /** * Leading trivia */ -var Remote = (function () { +var Remote = /** @class */ (function () { function Remote() { } Remote = __decorate([ @@ -37,7 +37,7 @@ var Remote = (function () { /** * Floating Comment */ -var AnotherRomote = (function () { +var AnotherRomote = /** @class */ (function () { function AnotherRomote() { } AnotherRomote = __decorate([ diff --git a/tests/baselines/reference/commentOnSignature1.js b/tests/baselines/reference/commentOnSignature1.js index 38437d6fd1312..1c438d1e9aca1 100644 --- a/tests/baselines/reference/commentOnSignature1.js +++ b/tests/baselines/reference/commentOnSignature1.js @@ -44,7 +44,7 @@ function foo2(a: any): void { */ function foo(a) { } -var c = (function () { +var c = /** @class */ (function () { function c(a) { } c.prototype.foo = function (a) { diff --git a/tests/baselines/reference/commentOnStaticMember1.js b/tests/baselines/reference/commentOnStaticMember1.js index ba9973693044c..b11b6f1ad88bd 100644 --- a/tests/baselines/reference/commentOnStaticMember1.js +++ b/tests/baselines/reference/commentOnStaticMember1.js @@ -6,7 +6,7 @@ class Greeter { } //// [commentOnStaticMember1.js] -var Greeter = (function () { +var Greeter = /** @class */ (function () { function Greeter() { } //Hello World diff --git a/tests/baselines/reference/commentsClass.js b/tests/baselines/reference/commentsClass.js index 49fda992b0818..4c5ac163ee178 100644 --- a/tests/baselines/reference/commentsClass.js +++ b/tests/baselines/reference/commentsClass.js @@ -74,14 +74,14 @@ class c9 { //// [commentsClass.js] /** This is class c2 without constuctor*/ -var c2 = (function () { +var c2 = /** @class */ (function () { function c2() { } return c2; }()); // trailing comment1 var i2 = new c2(); var i2_c = c2; -var c3 = (function () { +var c3 = /** @class */ (function () { /** Constructor comment*/ function c3() { } // trailing comment of constructor @@ -90,7 +90,7 @@ var c3 = (function () { var i3 = new c3(); var i3_c = c3; /** Class comment*/ -var c4 = (function () { +var c4 = /** @class */ (function () { /** Constructor comment*/ function c4() { } /* trailing comment of constructor 2*/ @@ -99,7 +99,7 @@ var c4 = (function () { var i4 = new c4(); var i4_c = c4; /** Class with statics*/ -var c5 = (function () { +var c5 = /** @class */ (function () { function c5() { } return c5; @@ -107,7 +107,7 @@ var c5 = (function () { var i5 = new c5(); var i5_c = c5; /// class with statics and constructor -var c6 = (function () { +var c6 = /** @class */ (function () { /// constructor comment function c6() { } @@ -116,7 +116,7 @@ var c6 = (function () { var i6 = new c6(); var i6_c = c6; // class with statics and constructor -var c7 = (function () { +var c7 = /** @class */ (function () { // constructor comment function c7() { } @@ -126,7 +126,7 @@ var i7 = new c7(); var i7_c = c7; /** class with statics and constructor */ -var c8 = (function () { +var c8 = /** @class */ (function () { /** constructor comment */ function c8() { @@ -137,7 +137,7 @@ var c8 = (function () { }()); var i8 = new c8(); var i8_c = c8; -var c9 = (function () { +var c9 = /** @class */ (function () { function c9() { /// This is some detached comment // should emit this leading comment of } too diff --git a/tests/baselines/reference/commentsClassMembers.js b/tests/baselines/reference/commentsClassMembers.js index 9953e77ab7ec9..f53c64060a3d0 100644 --- a/tests/baselines/reference/commentsClassMembers.js +++ b/tests/baselines/reference/commentsClassMembers.js @@ -219,7 +219,7 @@ cProperties_i.nc_p2 = cProperties_i.nc_p1; //// [commentsClassMembers.js] /** This is comment for c1*/ -var c1 = (function () { +var c1 = /** @class */ (function () { /** Constructor method*/ function c1() { } @@ -435,7 +435,7 @@ var i1_s_ncr = c1.nc_s2(20); var i1_s_ncprop = c1.nc_s3; c1.nc_s3 = i1_s_ncprop; var i1_c = c1; -var cProperties = (function () { +var cProperties = /** @class */ (function () { function cProperties() { this.x = 10; /*trailing comment for property*/ this.y = 10; // trailing comment of // style diff --git a/tests/baselines/reference/commentsCommentParsing.js b/tests/baselines/reference/commentsCommentParsing.js index db9b5b6632acc..889067a3c051f 100644 --- a/tests/baselines/reference/commentsCommentParsing.js +++ b/tests/baselines/reference/commentsCommentParsing.js @@ -283,7 +283,7 @@ function jsDocParamTest(/** this is inline comment for a */ a, /** this is inlin return a + b + c + d; } /**/ -var NoQuickInfoClass = (function () { +var NoQuickInfoClass = /** @class */ (function () { function NoQuickInfoClass() { } return NoQuickInfoClass; diff --git a/tests/baselines/reference/commentsDottedModuleName.js b/tests/baselines/reference/commentsDottedModuleName.js index 89c959ccdab83..03dc8559d77ee 100644 --- a/tests/baselines/reference/commentsDottedModuleName.js +++ b/tests/baselines/reference/commentsDottedModuleName.js @@ -16,7 +16,7 @@ define(["require", "exports"], function (require, exports) { var InnerModule; (function (InnerModule) { /// class b comment - var b = (function () { + var b = /** @class */ (function () { function b() { } return b; diff --git a/tests/baselines/reference/commentsExternalModules.js b/tests/baselines/reference/commentsExternalModules.js index 7556e8855fbc6..82c6fa53b821f 100644 --- a/tests/baselines/reference/commentsExternalModules.js +++ b/tests/baselines/reference/commentsExternalModules.js @@ -75,7 +75,7 @@ define(["require", "exports"], function (require, exports) { var m2; (function (m2) { /** class comment;*/ - var c = (function () { + var c = /** @class */ (function () { function c() { } return c; @@ -106,7 +106,7 @@ define(["require", "exports"], function (require, exports) { var m2; (function (m2) { /** class comment; */ - var c = (function () { + var c = /** @class */ (function () { function c() { } return c; diff --git a/tests/baselines/reference/commentsExternalModules2.js b/tests/baselines/reference/commentsExternalModules2.js index af1e78b692c7e..bb8eab82c1e06 100644 --- a/tests/baselines/reference/commentsExternalModules2.js +++ b/tests/baselines/reference/commentsExternalModules2.js @@ -75,7 +75,7 @@ define(["require", "exports"], function (require, exports) { var m2; (function (m2) { /** class comment;*/ - var c = (function () { + var c = /** @class */ (function () { function c() { } return c; @@ -106,7 +106,7 @@ define(["require", "exports"], function (require, exports) { var m2; (function (m2) { /** class comment; */ - var c = (function () { + var c = /** @class */ (function () { function c() { } return c; diff --git a/tests/baselines/reference/commentsExternalModules3.js b/tests/baselines/reference/commentsExternalModules3.js index e830f9de7a3ca..10c25efd00801 100644 --- a/tests/baselines/reference/commentsExternalModules3.js +++ b/tests/baselines/reference/commentsExternalModules3.js @@ -74,7 +74,7 @@ var m1; var m2; (function (m2) { /** class comment;*/ - var c = (function () { + var c = /** @class */ (function () { function c() { } return c; @@ -105,7 +105,7 @@ var m4; var m2; (function (m2) { /** class comment; */ - var c = (function () { + var c = /** @class */ (function () { function c() { } return c; diff --git a/tests/baselines/reference/commentsFormatting.js b/tests/baselines/reference/commentsFormatting.js index a754fe9bb85d6..dcccc48f2a02a 100644 --- a/tests/baselines/reference/commentsFormatting.js +++ b/tests/baselines/reference/commentsFormatting.js @@ -102,7 +102,7 @@ var m; * this is 6 spaces right aligned * this is 7 spaces right aligned * this is 8 spaces right aligned */ - var c = (function () { + var c = /** @class */ (function () { function c() { } return c; @@ -126,7 +126,7 @@ var m; * this is 6 spaces right aligned * this is 7 spaces right aligned * this is 8 spaces right aligned */ - var c2 = (function () { + var c2 = /** @class */ (function () { function c2() { } return c2; @@ -158,7 +158,7 @@ this is 4 spaces left aligned but above line is empty above 3 lines are empty*/ - var c3 = (function () { + var c3 = /** @class */ (function () { function c3() { } return c3; @@ -178,7 +178,7 @@ this is 4 spaces left aligned but above line is empty * this is 10 spaces + tab * this is 11 spaces + tab * this is 12 spaces + tab */ - var c4 = (function () { + var c4 = /** @class */ (function () { function c4() { } return c4; diff --git a/tests/baselines/reference/commentsInheritance.js b/tests/baselines/reference/commentsInheritance.js index e33a4244c037d..1c3f86ac5bbe3 100644 --- a/tests/baselines/reference/commentsInheritance.js +++ b/tests/baselines/reference/commentsInheritance.js @@ -161,7 +161,7 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } // i1_f1 @@ -181,7 +181,7 @@ var i1_i; var c1_i = new c1(); // assign to interface i1_i = c1_i; -var c2 = (function () { +var c2 = /** @class */ (function () { /** c2 constructor*/ function c2(a) { this.c2_p1 = a; @@ -228,7 +228,7 @@ var c2 = (function () { }); return c2; }()); -var c3 = (function (_super) { +var c3 = /** @class */ (function (_super) { __extends(c3, _super); function c3() { return _super.call(this, 10) || this; @@ -259,7 +259,7 @@ var c2_i = new c2(10); var c3_i = new c3(); // assign c2_i = c3_i; -var c4 = (function (_super) { +var c4 = /** @class */ (function (_super) { __extends(c4, _super); function c4() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/commentsModules.js b/tests/baselines/reference/commentsModules.js index f2574dcddfb9a..f6907855d3f32 100644 --- a/tests/baselines/reference/commentsModules.js +++ b/tests/baselines/reference/commentsModules.js @@ -109,7 +109,7 @@ var m1; var m2; (function (m2) { /** class comment;*/ - var c = (function () { + var c = /** @class */ (function () { function c() { } return c; @@ -148,7 +148,7 @@ var m2; var m3; (function (m3) { /** Exported class comment*/ - var c = (function () { + var c = /** @class */ (function () { function c() { } return c; @@ -165,7 +165,7 @@ var m3; var m5; (function (m5) { /** Exported class comment*/ - var c = (function () { + var c = /** @class */ (function () { function c() { } return c; @@ -185,7 +185,7 @@ var m4; var m7; (function (m7) { /** Exported class comment*/ - var c = (function () { + var c = /** @class */ (function () { function c() { } return c; @@ -207,7 +207,7 @@ var m5; var m8; (function (m8) { /** Exported class comment*/ - var c = (function () { + var c = /** @class */ (function () { function c() { } return c; @@ -225,7 +225,7 @@ var m6; var m8; (function (m8) { /** Exported class comment*/ - var c = (function () { + var c = /** @class */ (function () { function c() { } return c; @@ -243,20 +243,20 @@ var m7; var m9; (function (m9) { /** Exported class comment*/ - var c = (function () { + var c = /** @class */ (function () { function c() { } return c; }()); m9.c = c; /** class d */ - var d = (function () { + var d = /** @class */ (function () { function d() { } return d; }()); // class e - var e = (function () { + var e = /** @class */ (function () { function e() { } return e; diff --git a/tests/baselines/reference/commentsMultiModuleMultiFile.js b/tests/baselines/reference/commentsMultiModuleMultiFile.js index 6aaace19afc5e..c06a568959442 100644 --- a/tests/baselines/reference/commentsMultiModuleMultiFile.js +++ b/tests/baselines/reference/commentsMultiModuleMultiFile.js @@ -43,7 +43,7 @@ define(["require", "exports"], function (require, exports) { var multiM; (function (multiM) { /// class b comment - var b = (function () { + var b = /** @class */ (function () { function b() { } return b; @@ -53,14 +53,14 @@ define(["require", "exports"], function (require, exports) { /** thi is multi module 2*/ (function (multiM) { /** class c comment*/ - var c = (function () { + var c = /** @class */ (function () { function c() { } return c; }()); multiM.c = c; // class e comment - var e = (function () { + var e = /** @class */ (function () { function e() { } return e; @@ -78,14 +78,14 @@ define(["require", "exports"], function (require, exports) { var multiM; (function (multiM) { /** class d comment*/ - var d = (function () { + var d = /** @class */ (function () { function d() { } return d; }()); multiM.d = d; /// class f comment - var f = (function () { + var f = /** @class */ (function () { function f() { } return f; diff --git a/tests/baselines/reference/commentsMultiModuleSingleFile.js b/tests/baselines/reference/commentsMultiModuleSingleFile.js index 34e693b34db87..cb50f21289346 100644 --- a/tests/baselines/reference/commentsMultiModuleSingleFile.js +++ b/tests/baselines/reference/commentsMultiModuleSingleFile.js @@ -28,14 +28,14 @@ new multiM.c(); var multiM; (function (multiM) { /** class b*/ - var b = (function () { + var b = /** @class */ (function () { function b() { } return b; }()); multiM.b = b; // class d - var d = (function () { + var d = /** @class */ (function () { function d() { } return d; @@ -45,14 +45,14 @@ var multiM; /// this is multi module 2 (function (multiM) { /** class c comment*/ - var c = (function () { + var c = /** @class */ (function () { function c() { } return c; }()); multiM.c = c; /// class e - var e = (function () { + var e = /** @class */ (function () { function e() { } return e; diff --git a/tests/baselines/reference/commentsOnReturnStatement1.js b/tests/baselines/reference/commentsOnReturnStatement1.js index 67c8462bd388a..ac79f18d74e45 100644 --- a/tests/baselines/reference/commentsOnReturnStatement1.js +++ b/tests/baselines/reference/commentsOnReturnStatement1.js @@ -10,7 +10,7 @@ class DebugClass { } //// [commentsOnReturnStatement1.js] -var DebugClass = (function () { +var DebugClass = /** @class */ (function () { function DebugClass() { } DebugClass.debugFunc = function () { diff --git a/tests/baselines/reference/commentsOnStaticMembers.js b/tests/baselines/reference/commentsOnStaticMembers.js index 896aced36e473..98f96e53204b0 100644 --- a/tests/baselines/reference/commentsOnStaticMembers.js +++ b/tests/baselines/reference/commentsOnStaticMembers.js @@ -20,7 +20,7 @@ class test { } //// [commentsOnStaticMembers.js] -var test = (function () { +var test = /** @class */ (function () { function test() { } /** diff --git a/tests/baselines/reference/commentsOverloads.js b/tests/baselines/reference/commentsOverloads.js index e711a9585ce28..eb44d3bc5d84f 100644 --- a/tests/baselines/reference/commentsOverloads.js +++ b/tests/baselines/reference/commentsOverloads.js @@ -199,7 +199,7 @@ f4(10); var i1_i; var i2_i; var i3_i; -var c = (function () { +var c = /** @class */ (function () { function c() { } c.prototype.prop1 = function (aorb) { @@ -220,28 +220,28 @@ var c = (function () { }; return c; }()); -var c1 = (function () { +var c1 = /** @class */ (function () { function c1(aorb) { } return c1; }()); -var c2 = (function () { +var c2 = /** @class */ (function () { function c2(aorb) { } return c2; }()); -var c3 = (function () { +var c3 = /** @class */ (function () { function c3(aorb) { } return c3; }()); -var c4 = (function () { +var c4 = /** @class */ (function () { /** c4 3 */ function c4(aorb) { } return c4; }()); -var c5 = (function () { +var c5 = /** @class */ (function () { /** c5 implementation*/ function c5(aorb) { } diff --git a/tests/baselines/reference/commentsTypeParameters.js b/tests/baselines/reference/commentsTypeParameters.js index 003cafe70adfb..8ac22556f0dc4 100644 --- a/tests/baselines/reference/commentsTypeParameters.js +++ b/tests/baselines/reference/commentsTypeParameters.js @@ -16,7 +16,7 @@ function compare(a: T, b: T) { } //// [commentsTypeParameters.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } C.prototype.method = function (a) { diff --git a/tests/baselines/reference/commentsemitComments.js b/tests/baselines/reference/commentsemitComments.js index 6e0497fcf7fac..afd57477627f8 100644 --- a/tests/baselines/reference/commentsemitComments.js +++ b/tests/baselines/reference/commentsemitComments.js @@ -98,7 +98,7 @@ var fooVar; foo(50); fooVar(); /**class comment*/ -var c = (function () { +var c = /** @class */ (function () { /** constructor comment*/ function c() { /** property comment */ @@ -134,7 +134,7 @@ var i1_i; var m1; (function (m1) { /** class b */ - var b = (function () { + var b = /** @class */ (function () { function b(x) { this.x = x; } diff --git a/tests/baselines/reference/commonJSImportAsPrimaryExpression.js b/tests/baselines/reference/commonJSImportAsPrimaryExpression.js index d25c141089770..2bbf28d4266e9 100644 --- a/tests/baselines/reference/commonJSImportAsPrimaryExpression.js +++ b/tests/baselines/reference/commonJSImportAsPrimaryExpression.js @@ -16,7 +16,7 @@ if(foo.C1.s1){ //// [foo_0.js] "use strict"; exports.__esModule = true; -var C1 = (function () { +var C1 = /** @class */ (function () { function C1() { this.m1 = 42; } diff --git a/tests/baselines/reference/commonJSImportNotAsPrimaryExpression.js b/tests/baselines/reference/commonJSImportNotAsPrimaryExpression.js index 7aee50e1106e4..9a1e89136a6dc 100644 --- a/tests/baselines/reference/commonJSImportNotAsPrimaryExpression.js +++ b/tests/baselines/reference/commonJSImportNotAsPrimaryExpression.js @@ -34,7 +34,7 @@ var e: number = 0; //// [foo_0.js] "use strict"; exports.__esModule = true; -var C1 = (function () { +var C1 = /** @class */ (function () { function C1() { this.m1 = 42; } diff --git a/tests/baselines/reference/comparisonOperatorWithIdenticalObjects.js b/tests/baselines/reference/comparisonOperatorWithIdenticalObjects.js index f017fe974bc89..c6f3b29d9c2ef 100644 --- a/tests/baselines/reference/comparisonOperatorWithIdenticalObjects.js +++ b/tests/baselines/reference/comparisonOperatorWithIdenticalObjects.js @@ -205,7 +205,7 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var A1 = (function () { +var A1 = /** @class */ (function () { function A1() { } A1.prototype.fn = function (a) { @@ -213,7 +213,7 @@ var A1 = (function () { }; return A1; }()); -var B1 = (function () { +var B1 = /** @class */ (function () { function B1() { } B1.prototype.fn = function (b) { @@ -221,7 +221,7 @@ var B1 = (function () { }; return B1; }()); -var Base = (function () { +var Base = /** @class */ (function () { function Base() { } Base.prototype.fn = function (b) { @@ -229,14 +229,14 @@ var Base = (function () { }; return Base; }()); -var A2 = (function (_super) { +var A2 = /** @class */ (function (_super) { __extends(A2, _super); function A2() { return _super !== null && _super.apply(this, arguments) || this; } return A2; }(Base)); -var B2 = (function (_super) { +var B2 = /** @class */ (function (_super) { __extends(B2, _super); function B2() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/comparisonOperatorWithNoRelationshipObjectsOnCallSignature.js b/tests/baselines/reference/comparisonOperatorWithNoRelationshipObjectsOnCallSignature.js index b63b2fa711038..852124deebe54 100644 --- a/tests/baselines/reference/comparisonOperatorWithNoRelationshipObjectsOnCallSignature.js +++ b/tests/baselines/reference/comparisonOperatorWithNoRelationshipObjectsOnCallSignature.js @@ -179,19 +179,19 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var Base = (function () { +var Base = /** @class */ (function () { function Base() { } return Base; }()); -var Derived = (function (_super) { +var Derived = /** @class */ (function (_super) { __extends(Derived, _super); function Derived() { return _super !== null && _super.apply(this, arguments) || this; } return Derived; }(Base)); -var C = (function () { +var C = /** @class */ (function () { function C() { } return C; diff --git a/tests/baselines/reference/comparisonOperatorWithNoRelationshipObjectsOnConstructorSignature.js b/tests/baselines/reference/comparisonOperatorWithNoRelationshipObjectsOnConstructorSignature.js index cecdb97e16468..76f0b9af8765b 100644 --- a/tests/baselines/reference/comparisonOperatorWithNoRelationshipObjectsOnConstructorSignature.js +++ b/tests/baselines/reference/comparisonOperatorWithNoRelationshipObjectsOnConstructorSignature.js @@ -179,19 +179,19 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var Base = (function () { +var Base = /** @class */ (function () { function Base() { } return Base; }()); -var Derived = (function (_super) { +var Derived = /** @class */ (function (_super) { __extends(Derived, _super); function Derived() { return _super !== null && _super.apply(this, arguments) || this; } return Derived; }(Base)); -var C = (function () { +var C = /** @class */ (function () { function C() { } return C; diff --git a/tests/baselines/reference/comparisonOperatorWithNoRelationshipObjectsOnIndexSignature.js b/tests/baselines/reference/comparisonOperatorWithNoRelationshipObjectsOnIndexSignature.js index 6fc8effabd01e..7af3a8de75880 100644 --- a/tests/baselines/reference/comparisonOperatorWithNoRelationshipObjectsOnIndexSignature.js +++ b/tests/baselines/reference/comparisonOperatorWithNoRelationshipObjectsOnIndexSignature.js @@ -122,19 +122,19 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var Base = (function () { +var Base = /** @class */ (function () { function Base() { } return Base; }()); -var Derived = (function (_super) { +var Derived = /** @class */ (function (_super) { __extends(Derived, _super); function Derived() { return _super !== null && _super.apply(this, arguments) || this; } return Derived; }(Base)); -var C = (function () { +var C = /** @class */ (function () { function C() { } return C; diff --git a/tests/baselines/reference/comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.js b/tests/baselines/reference/comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.js index fd9f0ffabe19a..eaed1bbc865ef 100644 --- a/tests/baselines/reference/comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.js +++ b/tests/baselines/reference/comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.js @@ -160,19 +160,19 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var Base = (function () { +var Base = /** @class */ (function () { function Base() { } return Base; }()); -var Derived = (function (_super) { +var Derived = /** @class */ (function (_super) { __extends(Derived, _super); function Derived() { return _super !== null && _super.apply(this, arguments) || this; } return Derived; }(Base)); -var C = (function () { +var C = /** @class */ (function () { function C() { } return C; diff --git a/tests/baselines/reference/comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.js b/tests/baselines/reference/comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.js index 5898bdd6f2b2b..a66b2e4389b1d 100644 --- a/tests/baselines/reference/comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.js +++ b/tests/baselines/reference/comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.js @@ -160,19 +160,19 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var Base = (function () { +var Base = /** @class */ (function () { function Base() { } return Base; }()); -var Derived = (function (_super) { +var Derived = /** @class */ (function (_super) { __extends(Derived, _super); function Derived() { return _super !== null && _super.apply(this, arguments) || this; } return Derived; }(Base)); -var C = (function () { +var C = /** @class */ (function () { function C() { } return C; diff --git a/tests/baselines/reference/comparisonOperatorWithNoRelationshipObjectsOnProperty.js b/tests/baselines/reference/comparisonOperatorWithNoRelationshipObjectsOnProperty.js index 715b347846e09..5644a57257606 100644 --- a/tests/baselines/reference/comparisonOperatorWithNoRelationshipObjectsOnProperty.js +++ b/tests/baselines/reference/comparisonOperatorWithNoRelationshipObjectsOnProperty.js @@ -77,22 +77,22 @@ var r8b1 = b1 !== a1; var r8b2 = b2 !== a2; //// [comparisonOperatorWithNoRelationshipObjectsOnProperty.js] -var A1 = (function () { +var A1 = /** @class */ (function () { function A1() { } return A1; }()); -var B1 = (function () { +var B1 = /** @class */ (function () { function B1() { } return B1; }()); -var A2 = (function () { +var A2 = /** @class */ (function () { function A2() { } return A2; }()); -var B2 = (function () { +var B2 = /** @class */ (function () { function B2() { } return B2; diff --git a/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnCallSignature.js b/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnCallSignature.js index 1a3bdca7d959b..079a1e276fbbf 100644 --- a/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnCallSignature.js +++ b/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnCallSignature.js @@ -270,12 +270,12 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var Base = (function () { +var Base = /** @class */ (function () { function Base() { } return Base; }()); -var Derived = (function (_super) { +var Derived = /** @class */ (function (_super) { __extends(Derived, _super); function Derived() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnConstructorSignature.js b/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnConstructorSignature.js index 8f23651af0573..38097a936e367 100644 --- a/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnConstructorSignature.js +++ b/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnConstructorSignature.js @@ -232,12 +232,12 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var Base = (function () { +var Base = /** @class */ (function () { function Base() { } return Base; }()); -var Derived = (function (_super) { +var Derived = /** @class */ (function (_super) { __extends(Derived, _super); function Derived() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnIndexSignature.js b/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnIndexSignature.js index b77b5dd6e4abd..7dabfb5c80446 100644 --- a/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnIndexSignature.js +++ b/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnIndexSignature.js @@ -118,12 +118,12 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var Base = (function () { +var Base = /** @class */ (function () { function Base() { } return Base; }()); -var Derived = (function (_super) { +var Derived = /** @class */ (function (_super) { __extends(Derived, _super); function Derived() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.js b/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.js index b82063b4aed58..87359ea00744b 100644 --- a/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.js +++ b/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.js @@ -175,12 +175,12 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var Base = (function () { +var Base = /** @class */ (function () { function Base() { } return Base; }()); -var Derived = (function (_super) { +var Derived = /** @class */ (function (_super) { __extends(Derived, _super); function Derived() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.js b/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.js index d83b7b2d5c099..fcfbfa4bfbc23 100644 --- a/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.js +++ b/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.js @@ -175,12 +175,12 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var Base = (function () { +var Base = /** @class */ (function () { function Base() { } return Base; }()); -var Derived = (function (_super) { +var Derived = /** @class */ (function (_super) { __extends(Derived, _super); function Derived() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnProperty.js b/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnProperty.js index e0befa2237e25..6c9ef171293e3 100644 --- a/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnProperty.js +++ b/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnProperty.js @@ -89,34 +89,34 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var Base = (function () { +var Base = /** @class */ (function () { function Base() { } return Base; }()); -var Derived = (function (_super) { +var Derived = /** @class */ (function (_super) { __extends(Derived, _super); function Derived() { return _super !== null && _super.apply(this, arguments) || this; } return Derived; }(Base)); -var A1 = (function () { +var A1 = /** @class */ (function () { function A1() { } return A1; }()); -var B1 = (function () { +var B1 = /** @class */ (function () { function B1() { } return B1; }()); -var A2 = (function () { +var A2 = /** @class */ (function () { function A2() { } return A2; }()); -var B2 = (function (_super) { +var B2 = /** @class */ (function (_super) { __extends(B2, _super); function B2() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/complexClassRelationships.js b/tests/baselines/reference/complexClassRelationships.js index 2bc345bd49980..0b845f63b0be1 100644 --- a/tests/baselines/reference/complexClassRelationships.js +++ b/tests/baselines/reference/complexClassRelationships.js @@ -59,7 +59,7 @@ var __extends = (this && this.__extends) || (function () { }; })(); // There should be no errors in this file -var Derived = (function (_super) { +var Derived = /** @class */ (function (_super) { __extends(Derived, _super); function Derived() { return _super !== null && _super.apply(this, arguments) || this; @@ -70,18 +70,18 @@ var Derived = (function (_super) { }; return Derived; }(Base)); -var BaseCollection = (function () { +var BaseCollection = /** @class */ (function () { function BaseCollection(f) { (function (item) { return [item.Components]; }); } return BaseCollection; }()); -var Base = (function () { +var Base = /** @class */ (function () { function Base() { } return Base; }()); -var Thing = (function () { +var Thing = /** @class */ (function () { function Thing() { } Object.defineProperty(Thing.prototype, "Components", { @@ -91,7 +91,7 @@ var Thing = (function () { }); return Thing; }()); -var ComponentCollection = (function () { +var ComponentCollection = /** @class */ (function () { function ComponentCollection() { } ComponentCollection.sortComponents = function (p) { @@ -99,7 +99,7 @@ var ComponentCollection = (function () { }; return ComponentCollection; }()); -var Foo = (function () { +var Foo = /** @class */ (function () { function Foo() { } Object.defineProperty(Foo.prototype, "prop1", { @@ -121,12 +121,12 @@ var Foo = (function () { }); return Foo; }()); -var GenericType = (function () { +var GenericType = /** @class */ (function () { function GenericType(parent) { } return GenericType; }()); -var FooBase = (function () { +var FooBase = /** @class */ (function () { function FooBase() { } FooBase.prototype.populate = function () { diff --git a/tests/baselines/reference/complexNarrowingWithAny.js b/tests/baselines/reference/complexNarrowingWithAny.js index 4531cde9f3ed3..a8a59b84b8834 100644 --- a/tests/baselines/reference/complexNarrowingWithAny.js +++ b/tests/baselines/reference/complexNarrowingWithAny.js @@ -623,7 +623,7 @@ exports.__esModule = true; //stubbed out imports var import44; (function (import44) { - var FormGroupDirective = (function () { + var FormGroupDirective = /** @class */ (function () { function FormGroupDirective(any) { } return FormGroupDirective; @@ -632,13 +632,13 @@ var import44; })(import44 || (import44 = {})); var import45; (function (import45) { - var NgControlStatus = (function () { + var NgControlStatus = /** @class */ (function () { function NgControlStatus(any) { } return NgControlStatus; }()); import45.NgControlStatus = NgControlStatus; - var NgControlStatusGroup = (function () { + var NgControlStatusGroup = /** @class */ (function () { function NgControlStatusGroup(any) { } return NgControlStatusGroup; @@ -647,7 +647,7 @@ var import45; })(import45 || (import45 = {})); var import46; (function (import46) { - var DefaultValueAccessor = (function () { + var DefaultValueAccessor = /** @class */ (function () { function DefaultValueAccessor(any) { } return DefaultValueAccessor; @@ -656,7 +656,7 @@ var import46; })(import46 || (import46 = {})); var import47; (function (import47) { - var FormControlName = (function () { + var FormControlName = /** @class */ (function () { function FormControlName(any) { } return FormControlName; @@ -665,7 +665,7 @@ var import47; })(import47 || (import47 = {})); var import48; (function (import48) { - var FormControlName = (function () { + var FormControlName = /** @class */ (function () { function FormControlName(any) { } return FormControlName; @@ -689,7 +689,7 @@ var import49; //END DRAGONS var import50; (function (import50) { - var NgControl = (function () { + var NgControl = /** @class */ (function () { function NgControl(any) { } return NgControl; @@ -698,14 +698,14 @@ var import50; })(import50 || (import50 = {})); var import51; (function (import51) { - var ControlContainer = (function () { + var ControlContainer = /** @class */ (function () { function ControlContainer(any) { } return ControlContainer; }()); import51.ControlContainer = ControlContainer; })(import51 || (import51 = {})); -var _View_AppComponent0 = (function () { +var _View_AppComponent0 = /** @class */ (function () { function _View_AppComponent0(viewUtils, parentInjector, declarationEl) { } _View_AppComponent0.prototype.injectorGetInternal = function (token, requestNodeIndex, notFoundResult) { diff --git a/tests/baselines/reference/complicatedGenericRecursiveBaseClassReference.js b/tests/baselines/reference/complicatedGenericRecursiveBaseClassReference.js index bc9bbcdaa161d..f98e77cc77d15 100644 --- a/tests/baselines/reference/complicatedGenericRecursiveBaseClassReference.js +++ b/tests/baselines/reference/complicatedGenericRecursiveBaseClassReference.js @@ -16,7 +16,7 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var S18 = (function (_super) { +var S18 = /** @class */ (function (_super) { __extends(S18, _super); function S18() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/complicatedPrivacy.js b/tests/baselines/reference/complicatedPrivacy.js index ffb328f2e94c3..94c00e32330a8 100644 --- a/tests/baselines/reference/complicatedPrivacy.js +++ b/tests/baselines/reference/complicatedPrivacy.js @@ -115,7 +115,7 @@ var m1; function f2(c2) { } m2.f2 = f2; - var C2 = (function () { + var C2 = /** @class */ (function () { function C2() { } Object.defineProperty(C2.prototype, "p1", { @@ -152,19 +152,19 @@ var m1; function f2(f1) { } })(m3 || (m3 = {})); - var C1 = (function () { + var C1 = /** @class */ (function () { function C1() { } return C1; }()); - var C5 = (function () { + var C5 = /** @class */ (function () { function C5() { } return C5; }()); m1.C5 = C5; })(m1 || (m1 = {})); -var C2 = (function () { +var C2 = /** @class */ (function () { function C2() { } return C2; @@ -173,7 +173,7 @@ var m2; (function (m2) { var m3; (function (m3) { - var c_pr = (function () { + var c_pr = /** @class */ (function () { function c_pr() { } c_pr.prototype.f1 = function () { @@ -184,7 +184,7 @@ var m2; m3.c_pr = c_pr; var m4; (function (m4) { - var C = (function () { + var C = /** @class */ (function () { function C() { } return C; diff --git a/tests/baselines/reference/compoundAssignmentLHSIsValue.js b/tests/baselines/reference/compoundAssignmentLHSIsValue.js index f5a0fc75da5cf..a8a19b92a67ae 100644 --- a/tests/baselines/reference/compoundAssignmentLHSIsValue.js +++ b/tests/baselines/reference/compoundAssignmentLHSIsValue.js @@ -136,7 +136,7 @@ var __extends = (this && this.__extends) || (function () { // expected error for all the LHS of compound assignments (arithmetic and addition) var value; // this -var C = (function () { +var C = /** @class */ (function () { function C() { this *= value; this += value; @@ -198,7 +198,7 @@ value; ['', ''] *= value; ['', ''] += value; // super -var Derived = (function (_super) { +var Derived = /** @class */ (function (_super) { __extends(Derived, _super); function Derived() { var _this = _super.call(this) || this; diff --git a/tests/baselines/reference/compoundExponentiationAssignmentLHSIsValue.js b/tests/baselines/reference/compoundExponentiationAssignmentLHSIsValue.js index bd152ea11ad75..5288737805baa 100644 --- a/tests/baselines/reference/compoundExponentiationAssignmentLHSIsValue.js +++ b/tests/baselines/reference/compoundExponentiationAssignmentLHSIsValue.js @@ -99,7 +99,7 @@ var __extends = (this && this.__extends) || (function () { // expected error for all the LHS of compound assignments (arithmetic and addition) var value; // this -var C = (function () { +var C = /** @class */ (function () { function C() { this = Math.pow(this, value); } @@ -141,7 +141,7 @@ value; // array literals _a = Math.pow(['', ''], value), '' = _a[0], '' = _a[1]; // super -var Derived = (function (_super) { +var Derived = /** @class */ (function (_super) { __extends(Derived, _super); function Derived() { var _this = _super.call(this) || this; diff --git a/tests/baselines/reference/computedPropertyNames12_ES5.js b/tests/baselines/reference/computedPropertyNames12_ES5.js index 2aec8856286cb..b3743a36b2b1c 100644 --- a/tests/baselines/reference/computedPropertyNames12_ES5.js +++ b/tests/baselines/reference/computedPropertyNames12_ES5.js @@ -20,7 +20,7 @@ class C { var s; var n; var a; -var C = (function () { +var C = /** @class */ (function () { function C() { this[n] = n; this[s + n] = 2; diff --git a/tests/baselines/reference/computedPropertyNames13_ES5.js b/tests/baselines/reference/computedPropertyNames13_ES5.js index 0b713c5c8d78c..f22d55506043b 100644 --- a/tests/baselines/reference/computedPropertyNames13_ES5.js +++ b/tests/baselines/reference/computedPropertyNames13_ES5.js @@ -20,7 +20,7 @@ class C { var s; var n; var a; -var C = (function () { +var C = /** @class */ (function () { function C() { } C.prototype[s] = function () { }; diff --git a/tests/baselines/reference/computedPropertyNames14_ES5.js b/tests/baselines/reference/computedPropertyNames14_ES5.js index e08ae0fd640de..92d1fe907ffd3 100644 --- a/tests/baselines/reference/computedPropertyNames14_ES5.js +++ b/tests/baselines/reference/computedPropertyNames14_ES5.js @@ -11,7 +11,7 @@ class C { //// [computedPropertyNames14_ES5.js] var b; -var C = (function () { +var C = /** @class */ (function () { function C() { } C.prototype[b] = function () { }; diff --git a/tests/baselines/reference/computedPropertyNames15_ES5.js b/tests/baselines/reference/computedPropertyNames15_ES5.js index 91ec9332be8cc..312c8c661062e 100644 --- a/tests/baselines/reference/computedPropertyNames15_ES5.js +++ b/tests/baselines/reference/computedPropertyNames15_ES5.js @@ -12,7 +12,7 @@ class C { var p1; var p2; var p3; -var C = (function () { +var C = /** @class */ (function () { function C() { } C.prototype[p1] = function () { }; diff --git a/tests/baselines/reference/computedPropertyNames16_ES5.js b/tests/baselines/reference/computedPropertyNames16_ES5.js index 92b98ecb1baba..6a140aac782d1 100644 --- a/tests/baselines/reference/computedPropertyNames16_ES5.js +++ b/tests/baselines/reference/computedPropertyNames16_ES5.js @@ -20,7 +20,7 @@ class C { var s; var n; var a; -var C = (function () { +var C = /** @class */ (function () { function C() { } Object.defineProperty(C.prototype, s, { diff --git a/tests/baselines/reference/computedPropertyNames17_ES5.js b/tests/baselines/reference/computedPropertyNames17_ES5.js index 30b14ad523ecd..d49f5f78de72b 100644 --- a/tests/baselines/reference/computedPropertyNames17_ES5.js +++ b/tests/baselines/reference/computedPropertyNames17_ES5.js @@ -11,7 +11,7 @@ class C { //// [computedPropertyNames17_ES5.js] var b; -var C = (function () { +var C = /** @class */ (function () { function C() { } Object.defineProperty(C.prototype, b, { diff --git a/tests/baselines/reference/computedPropertyNames21_ES5.js b/tests/baselines/reference/computedPropertyNames21_ES5.js index 655de136c349c..0ca25ff0b9acf 100644 --- a/tests/baselines/reference/computedPropertyNames21_ES5.js +++ b/tests/baselines/reference/computedPropertyNames21_ES5.js @@ -7,7 +7,7 @@ class C { } //// [computedPropertyNames21_ES5.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } C.prototype.bar = function () { diff --git a/tests/baselines/reference/computedPropertyNames22_ES5.js b/tests/baselines/reference/computedPropertyNames22_ES5.js index 721418ee930d4..10d34ef1fe0e9 100644 --- a/tests/baselines/reference/computedPropertyNames22_ES5.js +++ b/tests/baselines/reference/computedPropertyNames22_ES5.js @@ -9,7 +9,7 @@ class C { } //// [computedPropertyNames22_ES5.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } C.prototype.bar = function () { diff --git a/tests/baselines/reference/computedPropertyNames23_ES5.js b/tests/baselines/reference/computedPropertyNames23_ES5.js index 666807f9f8ef6..a98afb7010808 100644 --- a/tests/baselines/reference/computedPropertyNames23_ES5.js +++ b/tests/baselines/reference/computedPropertyNames23_ES5.js @@ -9,7 +9,7 @@ class C { } //// [computedPropertyNames23_ES5.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } C.prototype.bar = function () { diff --git a/tests/baselines/reference/computedPropertyNames24_ES5.js b/tests/baselines/reference/computedPropertyNames24_ES5.js index dd229bdcae2ce..3a1303716e724 100644 --- a/tests/baselines/reference/computedPropertyNames24_ES5.js +++ b/tests/baselines/reference/computedPropertyNames24_ES5.js @@ -19,7 +19,7 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var Base = (function () { +var Base = /** @class */ (function () { function Base() { } Base.prototype.bar = function () { @@ -27,7 +27,7 @@ var Base = (function () { }; return Base; }()); -var C = (function (_super) { +var C = /** @class */ (function (_super) { __extends(C, _super); function C() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/computedPropertyNames25_ES5.js b/tests/baselines/reference/computedPropertyNames25_ES5.js index 18ee07301e717..5dcb4c7b163e7 100644 --- a/tests/baselines/reference/computedPropertyNames25_ES5.js +++ b/tests/baselines/reference/computedPropertyNames25_ES5.js @@ -24,7 +24,7 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var Base = (function () { +var Base = /** @class */ (function () { function Base() { } Base.prototype.bar = function () { @@ -32,7 +32,7 @@ var Base = (function () { }; return Base; }()); -var C = (function (_super) { +var C = /** @class */ (function (_super) { __extends(C, _super); function C() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/computedPropertyNames26_ES5.js b/tests/baselines/reference/computedPropertyNames26_ES5.js index 78a7ef3af776b..4bcb8188d1a4e 100644 --- a/tests/baselines/reference/computedPropertyNames26_ES5.js +++ b/tests/baselines/reference/computedPropertyNames26_ES5.js @@ -21,7 +21,7 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var Base = (function () { +var Base = /** @class */ (function () { function Base() { } Base.prototype.bar = function () { @@ -29,7 +29,7 @@ var Base = (function () { }; return Base; }()); -var C = (function (_super) { +var C = /** @class */ (function (_super) { __extends(C, _super); function C() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/computedPropertyNames27_ES5.js b/tests/baselines/reference/computedPropertyNames27_ES5.js index 9af56a8835b1d..128a0550ec755 100644 --- a/tests/baselines/reference/computedPropertyNames27_ES5.js +++ b/tests/baselines/reference/computedPropertyNames27_ES5.js @@ -16,12 +16,12 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var Base = (function () { +var Base = /** @class */ (function () { function Base() { } return Base; }()); -var C = (function (_super) { +var C = /** @class */ (function (_super) { __extends(C, _super); function C() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/computedPropertyNames28_ES5.js b/tests/baselines/reference/computedPropertyNames28_ES5.js index c6e2c5d77320f..76a50521a7945 100644 --- a/tests/baselines/reference/computedPropertyNames28_ES5.js +++ b/tests/baselines/reference/computedPropertyNames28_ES5.js @@ -21,12 +21,12 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var Base = (function () { +var Base = /** @class */ (function () { function Base() { } return Base; }()); -var C = (function (_super) { +var C = /** @class */ (function (_super) { __extends(C, _super); function C() { var _this = _super.call(this) || this; diff --git a/tests/baselines/reference/computedPropertyNames29_ES5.js b/tests/baselines/reference/computedPropertyNames29_ES5.js index 966081ae03501..403f5aa2cec96 100644 --- a/tests/baselines/reference/computedPropertyNames29_ES5.js +++ b/tests/baselines/reference/computedPropertyNames29_ES5.js @@ -11,7 +11,7 @@ class C { } //// [computedPropertyNames29_ES5.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } C.prototype.bar = function () { diff --git a/tests/baselines/reference/computedPropertyNames2_ES5.js b/tests/baselines/reference/computedPropertyNames2_ES5.js index 9211fccb530fd..dc8fa061f0a59 100644 --- a/tests/baselines/reference/computedPropertyNames2_ES5.js +++ b/tests/baselines/reference/computedPropertyNames2_ES5.js @@ -13,7 +13,7 @@ class C { //// [computedPropertyNames2_ES5.js] var methodName = "method"; var accessorName = "accessor"; -var C = (function () { +var C = /** @class */ (function () { function C() { } C.prototype[methodName] = function () { }; diff --git a/tests/baselines/reference/computedPropertyNames30_ES5.js b/tests/baselines/reference/computedPropertyNames30_ES5.js index f029b9b865132..1c3b4caeb454a 100644 --- a/tests/baselines/reference/computedPropertyNames30_ES5.js +++ b/tests/baselines/reference/computedPropertyNames30_ES5.js @@ -26,12 +26,12 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var Base = (function () { +var Base = /** @class */ (function () { function Base() { } return Base; }()); -var C = (function (_super) { +var C = /** @class */ (function (_super) { __extends(C, _super); function C() { var _this = _super.call(this) || this; diff --git a/tests/baselines/reference/computedPropertyNames31_ES5.js b/tests/baselines/reference/computedPropertyNames31_ES5.js index 95caabc4bda0a..b205c7025ca86 100644 --- a/tests/baselines/reference/computedPropertyNames31_ES5.js +++ b/tests/baselines/reference/computedPropertyNames31_ES5.js @@ -26,7 +26,7 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var Base = (function () { +var Base = /** @class */ (function () { function Base() { } Base.prototype.bar = function () { @@ -34,7 +34,7 @@ var Base = (function () { }; return Base; }()); -var C = (function (_super) { +var C = /** @class */ (function (_super) { __extends(C, _super); function C() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/computedPropertyNames32_ES5.js b/tests/baselines/reference/computedPropertyNames32_ES5.js index 1ae07d37e4237..171bc8bd0add5 100644 --- a/tests/baselines/reference/computedPropertyNames32_ES5.js +++ b/tests/baselines/reference/computedPropertyNames32_ES5.js @@ -9,7 +9,7 @@ class C { //// [computedPropertyNames32_ES5.js] function foo() { return ''; } -var C = (function () { +var C = /** @class */ (function () { function C() { } C.prototype.bar = function () { diff --git a/tests/baselines/reference/computedPropertyNames33_ES5.js b/tests/baselines/reference/computedPropertyNames33_ES5.js index e6d46b03c100e..76f9e4c06d83b 100644 --- a/tests/baselines/reference/computedPropertyNames33_ES5.js +++ b/tests/baselines/reference/computedPropertyNames33_ES5.js @@ -11,7 +11,7 @@ class C { //// [computedPropertyNames33_ES5.js] function foo() { return ''; } -var C = (function () { +var C = /** @class */ (function () { function C() { } C.prototype.bar = function () { diff --git a/tests/baselines/reference/computedPropertyNames34_ES5.js b/tests/baselines/reference/computedPropertyNames34_ES5.js index 3109c400422d0..315e41e403e1d 100644 --- a/tests/baselines/reference/computedPropertyNames34_ES5.js +++ b/tests/baselines/reference/computedPropertyNames34_ES5.js @@ -11,7 +11,7 @@ class C { //// [computedPropertyNames34_ES5.js] function foo() { return ''; } -var C = (function () { +var C = /** @class */ (function () { function C() { } C.bar = function () { diff --git a/tests/baselines/reference/computedPropertyNames36_ES5.js b/tests/baselines/reference/computedPropertyNames36_ES5.js index ec5643db26a7f..e13ef0a9e360d 100644 --- a/tests/baselines/reference/computedPropertyNames36_ES5.js +++ b/tests/baselines/reference/computedPropertyNames36_ES5.js @@ -11,17 +11,17 @@ class C { } //// [computedPropertyNames36_ES5.js] -var Foo = (function () { +var Foo = /** @class */ (function () { function Foo() { } return Foo; }()); -var Foo2 = (function () { +var Foo2 = /** @class */ (function () { function Foo2() { } return Foo2; }()); -var C = (function () { +var C = /** @class */ (function () { function C() { } Object.defineProperty(C.prototype, "get1", { diff --git a/tests/baselines/reference/computedPropertyNames37_ES5.js b/tests/baselines/reference/computedPropertyNames37_ES5.js index 914fd9a898e20..633c4c612087e 100644 --- a/tests/baselines/reference/computedPropertyNames37_ES5.js +++ b/tests/baselines/reference/computedPropertyNames37_ES5.js @@ -11,17 +11,17 @@ class C { } //// [computedPropertyNames37_ES5.js] -var Foo = (function () { +var Foo = /** @class */ (function () { function Foo() { } return Foo; }()); -var Foo2 = (function () { +var Foo2 = /** @class */ (function () { function Foo2() { } return Foo2; }()); -var C = (function () { +var C = /** @class */ (function () { function C() { } Object.defineProperty(C.prototype, "get1", { diff --git a/tests/baselines/reference/computedPropertyNames38_ES5.js b/tests/baselines/reference/computedPropertyNames38_ES5.js index 0bc1a4521e84f..00bbe51917fd3 100644 --- a/tests/baselines/reference/computedPropertyNames38_ES5.js +++ b/tests/baselines/reference/computedPropertyNames38_ES5.js @@ -11,17 +11,17 @@ class C { } //// [computedPropertyNames38_ES5.js] -var Foo = (function () { +var Foo = /** @class */ (function () { function Foo() { } return Foo; }()); -var Foo2 = (function () { +var Foo2 = /** @class */ (function () { function Foo2() { } return Foo2; }()); -var C = (function () { +var C = /** @class */ (function () { function C() { } Object.defineProperty(C.prototype, 1 << 6, { diff --git a/tests/baselines/reference/computedPropertyNames39_ES5.js b/tests/baselines/reference/computedPropertyNames39_ES5.js index 446a9a6fd77b6..e4297f3768f50 100644 --- a/tests/baselines/reference/computedPropertyNames39_ES5.js +++ b/tests/baselines/reference/computedPropertyNames39_ES5.js @@ -11,17 +11,17 @@ class C { } //// [computedPropertyNames39_ES5.js] -var Foo = (function () { +var Foo = /** @class */ (function () { function Foo() { } return Foo; }()); -var Foo2 = (function () { +var Foo2 = /** @class */ (function () { function Foo2() { } return Foo2; }()); -var C = (function () { +var C = /** @class */ (function () { function C() { } Object.defineProperty(C.prototype, 1 << 6, { diff --git a/tests/baselines/reference/computedPropertyNames3_ES5.js b/tests/baselines/reference/computedPropertyNames3_ES5.js index 94821a6597401..a915d2a2542ea 100644 --- a/tests/baselines/reference/computedPropertyNames3_ES5.js +++ b/tests/baselines/reference/computedPropertyNames3_ES5.js @@ -11,7 +11,7 @@ class C { //// [computedPropertyNames3_ES5.js] var id; -var C = (function () { +var C = /** @class */ (function () { function C() { } C.prototype[0 + 1] = function () { }; diff --git a/tests/baselines/reference/computedPropertyNames40_ES5.js b/tests/baselines/reference/computedPropertyNames40_ES5.js index a291349d0cff9..46159fa4e0b6f 100644 --- a/tests/baselines/reference/computedPropertyNames40_ES5.js +++ b/tests/baselines/reference/computedPropertyNames40_ES5.js @@ -11,17 +11,17 @@ class C { } //// [computedPropertyNames40_ES5.js] -var Foo = (function () { +var Foo = /** @class */ (function () { function Foo() { } return Foo; }()); -var Foo2 = (function () { +var Foo2 = /** @class */ (function () { function Foo2() { } return Foo2; }()); -var C = (function () { +var C = /** @class */ (function () { function C() { } // Computed properties diff --git a/tests/baselines/reference/computedPropertyNames41_ES5.js b/tests/baselines/reference/computedPropertyNames41_ES5.js index cad02361496bb..7c02b9c6b4cc5 100644 --- a/tests/baselines/reference/computedPropertyNames41_ES5.js +++ b/tests/baselines/reference/computedPropertyNames41_ES5.js @@ -10,17 +10,17 @@ class C { } //// [computedPropertyNames41_ES5.js] -var Foo = (function () { +var Foo = /** @class */ (function () { function Foo() { } return Foo; }()); -var Foo2 = (function () { +var Foo2 = /** @class */ (function () { function Foo2() { } return Foo2; }()); -var C = (function () { +var C = /** @class */ (function () { function C() { } // Computed properties diff --git a/tests/baselines/reference/computedPropertyNames42_ES5.js b/tests/baselines/reference/computedPropertyNames42_ES5.js index 1e1dfff227ba3..917169a189bdd 100644 --- a/tests/baselines/reference/computedPropertyNames42_ES5.js +++ b/tests/baselines/reference/computedPropertyNames42_ES5.js @@ -10,17 +10,17 @@ class C { } //// [computedPropertyNames42_ES5.js] -var Foo = (function () { +var Foo = /** @class */ (function () { function Foo() { } return Foo; }()); -var Foo2 = (function () { +var Foo2 = /** @class */ (function () { function Foo2() { } return Foo2; }()); -var C = (function () { +var C = /** @class */ (function () { function C() { } return C; diff --git a/tests/baselines/reference/computedPropertyNames43_ES5.js b/tests/baselines/reference/computedPropertyNames43_ES5.js index 100683519ec8c..2a56b933db42b 100644 --- a/tests/baselines/reference/computedPropertyNames43_ES5.js +++ b/tests/baselines/reference/computedPropertyNames43_ES5.js @@ -23,22 +23,22 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var Foo = (function () { +var Foo = /** @class */ (function () { function Foo() { } return Foo; }()); -var Foo2 = (function () { +var Foo2 = /** @class */ (function () { function Foo2() { } return Foo2; }()); -var C = (function () { +var C = /** @class */ (function () { function C() { } return C; }()); -var D = (function (_super) { +var D = /** @class */ (function (_super) { __extends(D, _super); function D() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/computedPropertyNames44_ES5.js b/tests/baselines/reference/computedPropertyNames44_ES5.js index 0291e337591cc..b13fcad45cca5 100644 --- a/tests/baselines/reference/computedPropertyNames44_ES5.js +++ b/tests/baselines/reference/computedPropertyNames44_ES5.js @@ -22,17 +22,17 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var Foo = (function () { +var Foo = /** @class */ (function () { function Foo() { } return Foo; }()); -var Foo2 = (function () { +var Foo2 = /** @class */ (function () { function Foo2() { } return Foo2; }()); -var C = (function () { +var C = /** @class */ (function () { function C() { } Object.defineProperty(C.prototype, "get1", { @@ -42,7 +42,7 @@ var C = (function () { }); return C; }()); -var D = (function (_super) { +var D = /** @class */ (function (_super) { __extends(D, _super); function D() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/computedPropertyNames45_ES5.js b/tests/baselines/reference/computedPropertyNames45_ES5.js index 3bc7e6e350d38..7d9641fcccd7d 100644 --- a/tests/baselines/reference/computedPropertyNames45_ES5.js +++ b/tests/baselines/reference/computedPropertyNames45_ES5.js @@ -23,17 +23,17 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var Foo = (function () { +var Foo = /** @class */ (function () { function Foo() { } return Foo; }()); -var Foo2 = (function () { +var Foo2 = /** @class */ (function () { function Foo2() { } return Foo2; }()); -var C = (function () { +var C = /** @class */ (function () { function C() { } Object.defineProperty(C.prototype, "get1", { @@ -43,7 +43,7 @@ var C = (function () { }); return C; }()); -var D = (function (_super) { +var D = /** @class */ (function (_super) { __extends(D, _super); function D() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/computedPropertyNamesDeclarationEmit1_ES5.js b/tests/baselines/reference/computedPropertyNamesDeclarationEmit1_ES5.js index 7becf285b2a28..30c2ce7cef5d1 100644 --- a/tests/baselines/reference/computedPropertyNamesDeclarationEmit1_ES5.js +++ b/tests/baselines/reference/computedPropertyNamesDeclarationEmit1_ES5.js @@ -6,7 +6,7 @@ class C { } //// [computedPropertyNamesDeclarationEmit1_ES5.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } C.prototype["" + ""] = function () { }; diff --git a/tests/baselines/reference/computedPropertyNamesDeclarationEmit2_ES5.js b/tests/baselines/reference/computedPropertyNamesDeclarationEmit2_ES5.js index 0b665eb1d9aba..91b9d62b9f3dd 100644 --- a/tests/baselines/reference/computedPropertyNamesDeclarationEmit2_ES5.js +++ b/tests/baselines/reference/computedPropertyNamesDeclarationEmit2_ES5.js @@ -6,7 +6,7 @@ class C { } //// [computedPropertyNamesDeclarationEmit2_ES5.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } C["" + ""] = function () { }; diff --git a/tests/baselines/reference/computedPropertyNamesOnOverloads_ES5.js b/tests/baselines/reference/computedPropertyNamesOnOverloads_ES5.js index 5562e1ea73c43..1ea8e2bb1fa54 100644 --- a/tests/baselines/reference/computedPropertyNamesOnOverloads_ES5.js +++ b/tests/baselines/reference/computedPropertyNamesOnOverloads_ES5.js @@ -10,7 +10,7 @@ class C { //// [computedPropertyNamesOnOverloads_ES5.js] var methodName = "method"; var accessorName = "accessor"; -var C = (function () { +var C = /** @class */ (function () { function C() { } C.prototype[methodName] = function (v) { }; diff --git a/tests/baselines/reference/computedPropertyNamesSourceMap1_ES5.js b/tests/baselines/reference/computedPropertyNamesSourceMap1_ES5.js index b03f4d3696eb4..1ee8511171150 100644 --- a/tests/baselines/reference/computedPropertyNamesSourceMap1_ES5.js +++ b/tests/baselines/reference/computedPropertyNamesSourceMap1_ES5.js @@ -9,7 +9,7 @@ class C { } //// [computedPropertyNamesSourceMap1_ES5.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } C.prototype["hello"] = function () { diff --git a/tests/baselines/reference/computedPropertyNamesSourceMap1_ES5.sourcemap.txt b/tests/baselines/reference/computedPropertyNamesSourceMap1_ES5.sourcemap.txt index fc571a3140ebd..506d30c4fbf95 100644 --- a/tests/baselines/reference/computedPropertyNamesSourceMap1_ES5.sourcemap.txt +++ b/tests/baselines/reference/computedPropertyNamesSourceMap1_ES5.sourcemap.txt @@ -8,7 +8,7 @@ sources: computedPropertyNamesSourceMap1_ES5.ts emittedFile:tests/cases/conformance/es6/computedProperties/computedPropertyNamesSourceMap1_ES5.js sourceFile:computedPropertyNamesSourceMap1_ES5.ts ------------------------------------------------------------------- ->>>var C = (function () { +>>>var C = /** @class */ (function () { 1 > 2 >^^^^^^^^^^^^^^^^^^^-> 1 > diff --git a/tests/baselines/reference/concatClassAndString.js b/tests/baselines/reference/concatClassAndString.js index a26a0803f0175..150fd3c162dc6 100644 --- a/tests/baselines/reference/concatClassAndString.js +++ b/tests/baselines/reference/concatClassAndString.js @@ -7,7 +7,7 @@ f += ''; //// [concatClassAndString.js] // Shouldn't compile (the long form f = f + ""; doesn't): -var f = (function () { +var f = /** @class */ (function () { function f() { } return f; diff --git a/tests/baselines/reference/conditionalOperatorConditionIsObjectType.js b/tests/baselines/reference/conditionalOperatorConditionIsObjectType.js index 9d90b568d49d9..827a7e4b3ff6b 100644 --- a/tests/baselines/reference/conditionalOperatorConditionIsObjectType.js +++ b/tests/baselines/reference/conditionalOperatorConditionIsObjectType.js @@ -79,7 +79,7 @@ var exprString2; var exprIsObject2; function foo() { } ; -var C = (function () { +var C = /** @class */ (function () { function C() { } return C; diff --git a/tests/baselines/reference/conditionalOperatorWithIdenticalBCT.js b/tests/baselines/reference/conditionalOperatorWithIdenticalBCT.js index 5d864bce0d6e8..cb7a8e82adbd0 100644 --- a/tests/baselines/reference/conditionalOperatorWithIdenticalBCT.js +++ b/tests/baselines/reference/conditionalOperatorWithIdenticalBCT.js @@ -59,13 +59,13 @@ var __extends = (this && this.__extends) || (function () { }; })(); //Cond ? Expr1 : Expr2, Expr1 and Expr2 have identical best common type -var X = (function () { +var X = /** @class */ (function () { function X() { } return X; }()); ; -var A = (function (_super) { +var A = /** @class */ (function (_super) { __extends(A, _super); function A() { return _super !== null && _super.apply(this, arguments) || this; @@ -73,7 +73,7 @@ var A = (function (_super) { return A; }(X)); ; -var B = (function (_super) { +var B = /** @class */ (function (_super) { __extends(B, _super); function B() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/conditionalOperatorWithoutIdenticalBCT.js b/tests/baselines/reference/conditionalOperatorWithoutIdenticalBCT.js index b5715163ad591..cf804048b88f1 100644 --- a/tests/baselines/reference/conditionalOperatorWithoutIdenticalBCT.js +++ b/tests/baselines/reference/conditionalOperatorWithoutIdenticalBCT.js @@ -35,13 +35,13 @@ var __extends = (this && this.__extends) || (function () { }; })(); //Cond ? Expr1 : Expr2, Expr1 and Expr2 have no identical best common type -var X = (function () { +var X = /** @class */ (function () { function X() { } return X; }()); ; -var A = (function (_super) { +var A = /** @class */ (function (_super) { __extends(A, _super); function A() { return _super !== null && _super.apply(this, arguments) || this; @@ -49,7 +49,7 @@ var A = (function (_super) { return A; }(X)); ; -var B = (function (_super) { +var B = /** @class */ (function (_super) { __extends(B, _super); function B() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/conflictMarkerDiff3Trivia1.js b/tests/baselines/reference/conflictMarkerDiff3Trivia1.js index 86cccd44e189e..98f028c34db5a 100644 --- a/tests/baselines/reference/conflictMarkerDiff3Trivia1.js +++ b/tests/baselines/reference/conflictMarkerDiff3Trivia1.js @@ -10,7 +10,7 @@ class C { } //// [conflictMarkerDiff3Trivia1.js] -var C = (function () { +var C = /** @class */ (function () { function C() { this.v = 1; } diff --git a/tests/baselines/reference/conflictMarkerDiff3Trivia2.js b/tests/baselines/reference/conflictMarkerDiff3Trivia2.js index 61a2273019b8a..8a852400c6c74 100644 --- a/tests/baselines/reference/conflictMarkerDiff3Trivia2.js +++ b/tests/baselines/reference/conflictMarkerDiff3Trivia2.js @@ -17,7 +17,7 @@ class C { //// [conflictMarkerDiff3Trivia2.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } C.prototype.foo = function () { diff --git a/tests/baselines/reference/conflictMarkerTrivia1.js b/tests/baselines/reference/conflictMarkerTrivia1.js index 8d0354f98239d..2bd5d1042fc52 100644 --- a/tests/baselines/reference/conflictMarkerTrivia1.js +++ b/tests/baselines/reference/conflictMarkerTrivia1.js @@ -8,7 +8,7 @@ class C { } //// [conflictMarkerTrivia1.js] -var C = (function () { +var C = /** @class */ (function () { function C() { this.v = 1; } diff --git a/tests/baselines/reference/conflictMarkerTrivia2.js b/tests/baselines/reference/conflictMarkerTrivia2.js index 1e58addf706de..cf6c1afbd8e09 100644 --- a/tests/baselines/reference/conflictMarkerTrivia2.js +++ b/tests/baselines/reference/conflictMarkerTrivia2.js @@ -14,7 +14,7 @@ class C { //// [conflictMarkerTrivia2.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } C.prototype.foo = function () { diff --git a/tests/baselines/reference/constDeclarationShadowedByVarDeclaration3.js b/tests/baselines/reference/constDeclarationShadowedByVarDeclaration3.js index b8d4065abf490..66958b79b1e07 100644 --- a/tests/baselines/reference/constDeclarationShadowedByVarDeclaration3.js +++ b/tests/baselines/reference/constDeclarationShadowedByVarDeclaration3.js @@ -11,7 +11,7 @@ class Rule { //// [constDeclarationShadowedByVarDeclaration3.js] // Ensure only checking for const declarations shadowed by vars -var Rule = (function () { +var Rule = /** @class */ (function () { function Rule(name) { this.regex = new RegExp(''); this.name = ''; diff --git a/tests/baselines/reference/constEnumMergingWithValues2.js b/tests/baselines/reference/constEnumMergingWithValues2.js index bd14cf1eda1fa..02cfcb83c0482 100644 --- a/tests/baselines/reference/constEnumMergingWithValues2.js +++ b/tests/baselines/reference/constEnumMergingWithValues2.js @@ -9,7 +9,7 @@ export = foo //// [m1.js] define(["require", "exports"], function (require, exports) { "use strict"; - var foo = (function () { + var foo = /** @class */ (function () { function foo() { } return foo; diff --git a/tests/baselines/reference/constantOverloadFunction.js b/tests/baselines/reference/constantOverloadFunction.js index f501623bae5e1..87baf162c290f 100644 --- a/tests/baselines/reference/constantOverloadFunction.js +++ b/tests/baselines/reference/constantOverloadFunction.js @@ -24,13 +24,13 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var Base = (function () { +var Base = /** @class */ (function () { function Base() { } Base.prototype.foo = function () { }; return Base; }()); -var Derived1 = (function (_super) { +var Derived1 = /** @class */ (function (_super) { __extends(Derived1, _super); function Derived1() { return _super !== null && _super.apply(this, arguments) || this; @@ -38,7 +38,7 @@ var Derived1 = (function (_super) { Derived1.prototype.bar = function () { }; return Derived1; }(Base)); -var Derived2 = (function (_super) { +var Derived2 = /** @class */ (function (_super) { __extends(Derived2, _super); function Derived2() { return _super !== null && _super.apply(this, arguments) || this; @@ -46,7 +46,7 @@ var Derived2 = (function (_super) { Derived2.prototype.baz = function () { }; return Derived2; }(Base)); -var Derived3 = (function (_super) { +var Derived3 = /** @class */ (function (_super) { __extends(Derived3, _super); function Derived3() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/constantOverloadFunctionNoSubtypeError.js b/tests/baselines/reference/constantOverloadFunctionNoSubtypeError.js index 2a86fb0c9a3f4..aca131176ef92 100644 --- a/tests/baselines/reference/constantOverloadFunctionNoSubtypeError.js +++ b/tests/baselines/reference/constantOverloadFunctionNoSubtypeError.js @@ -25,13 +25,13 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var Base = (function () { +var Base = /** @class */ (function () { function Base() { } Base.prototype.foo = function () { }; return Base; }()); -var Derived1 = (function (_super) { +var Derived1 = /** @class */ (function (_super) { __extends(Derived1, _super); function Derived1() { return _super !== null && _super.apply(this, arguments) || this; @@ -39,7 +39,7 @@ var Derived1 = (function (_super) { Derived1.prototype.bar = function () { }; return Derived1; }(Base)); -var Derived2 = (function (_super) { +var Derived2 = /** @class */ (function (_super) { __extends(Derived2, _super); function Derived2() { return _super !== null && _super.apply(this, arguments) || this; @@ -47,7 +47,7 @@ var Derived2 = (function (_super) { Derived2.prototype.baz = function () { }; return Derived2; }(Base)); -var Derived3 = (function (_super) { +var Derived3 = /** @class */ (function (_super) { __extends(Derived3, _super); function Derived3() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/constraintCheckInGenericBaseTypeReference.js b/tests/baselines/reference/constraintCheckInGenericBaseTypeReference.js index 5b69a2dfae1d5..b38fb738cae49 100644 --- a/tests/baselines/reference/constraintCheckInGenericBaseTypeReference.js +++ b/tests/baselines/reference/constraintCheckInGenericBaseTypeReference.js @@ -31,25 +31,25 @@ var __extends = (this && this.__extends) || (function () { }; })(); // No errors -var Constraint = (function () { +var Constraint = /** @class */ (function () { function Constraint() { } Constraint.prototype.method = function () { }; return Constraint; }()); -var GenericBase = (function () { +var GenericBase = /** @class */ (function () { function GenericBase() { } return GenericBase; }()); -var Derived = (function (_super) { +var Derived = /** @class */ (function (_super) { __extends(Derived, _super); function Derived() { return _super !== null && _super.apply(this, arguments) || this; } return Derived; }(GenericBase)); -var TypeArg = (function () { +var TypeArg = /** @class */ (function () { function TypeArg() { } TypeArg.prototype.method = function () { @@ -57,7 +57,7 @@ var TypeArg = (function () { }; return TypeArg; }()); -var Container = (function () { +var Container = /** @class */ (function () { function Container() { } return Container; diff --git a/tests/baselines/reference/constraintSatisfactionWithAny.js b/tests/baselines/reference/constraintSatisfactionWithAny.js index 6655a10ca45e9..4fbfb77c3c843 100644 --- a/tests/baselines/reference/constraintSatisfactionWithAny.js +++ b/tests/baselines/reference/constraintSatisfactionWithAny.js @@ -71,7 +71,7 @@ foo4(b); //function foo5(x: T, y: U): T { return null; } //foo5(a, a); //foo5(b, b); -var C = (function () { +var C = /** @class */ (function () { function C(x) { this.x = x; } @@ -79,7 +79,7 @@ var C = (function () { }()); var c1 = new C(a); var c2 = new C(b); -var C2 = (function () { +var C2 = /** @class */ (function () { function C2(x) { this.x = x; } @@ -92,7 +92,7 @@ var c4 = new C2(b); //} //var c5 = new C3(a); //var c6 = new C3(b); -var C4 = (function () { +var C4 = /** @class */ (function () { function C4(x) { this.x = x; } diff --git a/tests/baselines/reference/constraintSatisfactionWithEmptyObject.js b/tests/baselines/reference/constraintSatisfactionWithEmptyObject.js index 2886e26dd6637..e122b86e11388 100644 --- a/tests/baselines/reference/constraintSatisfactionWithEmptyObject.js +++ b/tests/baselines/reference/constraintSatisfactionWithEmptyObject.js @@ -44,7 +44,7 @@ function foo(x) { } var r = foo({}); var a = {}; var r = foo({}); -var C = (function () { +var C = /** @class */ (function () { function C(x) { this.x = x; } @@ -57,7 +57,7 @@ function foo2(x) { } var r = foo2({}); var a = {}; var r = foo2({}); -var C2 = (function () { +var C2 = /** @class */ (function () { function C2(x) { this.x = x; } diff --git a/tests/baselines/reference/constraintsThatReferenceOtherContstraints1.js b/tests/baselines/reference/constraintsThatReferenceOtherContstraints1.js index 15afabfe2513a..f95d550a7245d 100644 --- a/tests/baselines/reference/constraintsThatReferenceOtherContstraints1.js +++ b/tests/baselines/reference/constraintsThatReferenceOtherContstraints1.js @@ -10,12 +10,12 @@ var x: Foo< { a: string }, { a: string; b: number }>; // Error 2 Type '{ a: stri //// [constraintsThatReferenceOtherContstraints1.js] -var Foo = (function () { +var Foo = /** @class */ (function () { function Foo() { } return Foo; }()); -var Bar = (function () { +var Bar = /** @class */ (function () { function Bar() { } return Bar; diff --git a/tests/baselines/reference/constraintsUsedInPrototypeProperty.js b/tests/baselines/reference/constraintsUsedInPrototypeProperty.js index 89ba3d0efa97b..0af58ae4b1d07 100644 --- a/tests/baselines/reference/constraintsUsedInPrototypeProperty.js +++ b/tests/baselines/reference/constraintsUsedInPrototypeProperty.js @@ -3,7 +3,7 @@ class Foo { } Foo.prototype; // Foo //// [constraintsUsedInPrototypeProperty.js] -var Foo = (function () { +var Foo = /** @class */ (function () { function Foo() { } return Foo; diff --git a/tests/baselines/reference/constructSignatureAssignabilityInInheritance2.js b/tests/baselines/reference/constructSignatureAssignabilityInInheritance2.js index 742a03577e55b..23b5884f9f76a 100644 --- a/tests/baselines/reference/constructSignatureAssignabilityInInheritance2.js +++ b/tests/baselines/reference/constructSignatureAssignabilityInInheritance2.js @@ -81,26 +81,26 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var Base = (function () { +var Base = /** @class */ (function () { function Base() { } return Base; }()); -var Derived = (function (_super) { +var Derived = /** @class */ (function (_super) { __extends(Derived, _super); function Derived() { return _super !== null && _super.apply(this, arguments) || this; } return Derived; }(Base)); -var Derived2 = (function (_super) { +var Derived2 = /** @class */ (function (_super) { __extends(Derived2, _super); function Derived2() { return _super !== null && _super.apply(this, arguments) || this; } return Derived2; }(Derived)); -var OtherDerived = (function (_super) { +var OtherDerived = /** @class */ (function (_super) { __extends(OtherDerived, _super); function OtherDerived() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/constructSignatureAssignabilityInInheritance3.js b/tests/baselines/reference/constructSignatureAssignabilityInInheritance3.js index fd083159fb19b..1389555f38e2f 100644 --- a/tests/baselines/reference/constructSignatureAssignabilityInInheritance3.js +++ b/tests/baselines/reference/constructSignatureAssignabilityInInheritance3.js @@ -126,26 +126,26 @@ var __extends = (this && this.__extends) || (function () { })(); var Errors; (function (Errors) { - var Base = (function () { + var Base = /** @class */ (function () { function Base() { } return Base; }()); - var Derived = (function (_super) { + var Derived = /** @class */ (function (_super) { __extends(Derived, _super); function Derived() { return _super !== null && _super.apply(this, arguments) || this; } return Derived; }(Base)); - var Derived2 = (function (_super) { + var Derived2 = /** @class */ (function (_super) { __extends(Derived2, _super); function Derived2() { return _super !== null && _super.apply(this, arguments) || this; } return Derived2; }(Derived)); - var OtherDerived = (function (_super) { + var OtherDerived = /** @class */ (function (_super) { __extends(OtherDerived, _super); function OtherDerived() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/constructSignatureAssignabilityInInheritance4.js b/tests/baselines/reference/constructSignatureAssignabilityInInheritance4.js index f1fad68d4ca1d..20bd61e7b3237 100644 --- a/tests/baselines/reference/constructSignatureAssignabilityInInheritance4.js +++ b/tests/baselines/reference/constructSignatureAssignabilityInInheritance4.js @@ -71,26 +71,26 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var Base = (function () { +var Base = /** @class */ (function () { function Base() { } return Base; }()); -var Derived = (function (_super) { +var Derived = /** @class */ (function (_super) { __extends(Derived, _super); function Derived() { return _super !== null && _super.apply(this, arguments) || this; } return Derived; }(Base)); -var Derived2 = (function (_super) { +var Derived2 = /** @class */ (function (_super) { __extends(Derived2, _super); function Derived2() { return _super !== null && _super.apply(this, arguments) || this; } return Derived2; }(Derived)); -var OtherDerived = (function (_super) { +var OtherDerived = /** @class */ (function (_super) { __extends(OtherDerived, _super); function OtherDerived() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/constructSignatureAssignabilityInInheritance5.js b/tests/baselines/reference/constructSignatureAssignabilityInInheritance5.js index dc08f25c912f6..c58cde9aa8c5d 100644 --- a/tests/baselines/reference/constructSignatureAssignabilityInInheritance5.js +++ b/tests/baselines/reference/constructSignatureAssignabilityInInheritance5.js @@ -61,26 +61,26 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var Base = (function () { +var Base = /** @class */ (function () { function Base() { } return Base; }()); -var Derived = (function (_super) { +var Derived = /** @class */ (function (_super) { __extends(Derived, _super); function Derived() { return _super !== null && _super.apply(this, arguments) || this; } return Derived; }(Base)); -var Derived2 = (function (_super) { +var Derived2 = /** @class */ (function (_super) { __extends(Derived2, _super); function Derived2() { return _super !== null && _super.apply(this, arguments) || this; } return Derived2; }(Derived)); -var OtherDerived = (function (_super) { +var OtherDerived = /** @class */ (function (_super) { __extends(OtherDerived, _super); function OtherDerived() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/constructSignatureAssignabilityInInheritance6.js b/tests/baselines/reference/constructSignatureAssignabilityInInheritance6.js index e755e3cacc369..4f76c360a1fcf 100644 --- a/tests/baselines/reference/constructSignatureAssignabilityInInheritance6.js +++ b/tests/baselines/reference/constructSignatureAssignabilityInInheritance6.js @@ -64,26 +64,26 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var Base = (function () { +var Base = /** @class */ (function () { function Base() { } return Base; }()); -var Derived = (function (_super) { +var Derived = /** @class */ (function (_super) { __extends(Derived, _super); function Derived() { return _super !== null && _super.apply(this, arguments) || this; } return Derived; }(Base)); -var Derived2 = (function (_super) { +var Derived2 = /** @class */ (function (_super) { __extends(Derived2, _super); function Derived2() { return _super !== null && _super.apply(this, arguments) || this; } return Derived2; }(Derived)); -var OtherDerived = (function (_super) { +var OtherDerived = /** @class */ (function (_super) { __extends(OtherDerived, _super); function OtherDerived() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/constructSignatureWithAccessibilityModifiersOnParameters.js b/tests/baselines/reference/constructSignatureWithAccessibilityModifiersOnParameters.js index 89de89c4fca74..2a91b3a8d7fd2 100644 --- a/tests/baselines/reference/constructSignatureWithAccessibilityModifiersOnParameters.js +++ b/tests/baselines/reference/constructSignatureWithAccessibilityModifiersOnParameters.js @@ -31,20 +31,20 @@ var b: { //// [constructSignatureWithAccessibilityModifiersOnParameters.js] // Parameter properties are only valid in constructor definitions, not even in other forms of construct signatures -var C = (function () { +var C = /** @class */ (function () { function C(x, y) { this.x = x; this.y = y; } return C; }()); -var C2 = (function () { +var C2 = /** @class */ (function () { function C2(x) { this.x = x; } return C2; }()); -var C3 = (function () { +var C3 = /** @class */ (function () { function C3(x) { this.x = x; } diff --git a/tests/baselines/reference/constructSignatureWithAccessibilityModifiersOnParameters2.js b/tests/baselines/reference/constructSignatureWithAccessibilityModifiersOnParameters2.js index c58b8ed003e3f..a53383644a5ac 100644 --- a/tests/baselines/reference/constructSignatureWithAccessibilityModifiersOnParameters2.js +++ b/tests/baselines/reference/constructSignatureWithAccessibilityModifiersOnParameters2.js @@ -38,20 +38,20 @@ var b: { //// [constructSignatureWithAccessibilityModifiersOnParameters2.js] // Parameter properties are not valid in overloads of constructors -var C = (function () { +var C = /** @class */ (function () { function C(x, y) { this.x = x; this.y = y; } return C; }()); -var C2 = (function () { +var C2 = /** @class */ (function () { function C2(x) { this.x = x; } return C2; }()); -var C3 = (function () { +var C3 = /** @class */ (function () { function C3(y) { this.y = y; } diff --git a/tests/baselines/reference/constructSignaturesWithIdenticalOverloads.js b/tests/baselines/reference/constructSignaturesWithIdenticalOverloads.js index f2dc1d2357e2e..ed2e0b663e9d3 100644 --- a/tests/baselines/reference/constructSignaturesWithIdenticalOverloads.js +++ b/tests/baselines/reference/constructSignaturesWithIdenticalOverloads.js @@ -51,13 +51,13 @@ var r6 = new b(1, ''); //// [constructSignaturesWithIdenticalOverloads.js] // Duplicate overloads of construct signatures should generate errors -var C = (function () { +var C = /** @class */ (function () { function C(x) { } return C; }()); var r1 = new C(1, ''); -var C2 = (function () { +var C2 = /** @class */ (function () { function C2(x) { } return C2; diff --git a/tests/baselines/reference/constructSignaturesWithOverloads.js b/tests/baselines/reference/constructSignaturesWithOverloads.js index 999ea15656814..d0baafd2d0a95 100644 --- a/tests/baselines/reference/constructSignaturesWithOverloads.js +++ b/tests/baselines/reference/constructSignaturesWithOverloads.js @@ -52,13 +52,13 @@ var r6 = new b(1, ''); //// [constructSignaturesWithOverloads.js] // No errors expected for basic overloads of construct signatures -var C = (function () { +var C = /** @class */ (function () { function C(x) { } return C; }()); var r1 = new C(1, ''); -var C2 = (function () { +var C2 = /** @class */ (function () { function C2(x) { } return C2; diff --git a/tests/baselines/reference/constructSignaturesWithOverloads2.js b/tests/baselines/reference/constructSignaturesWithOverloads2.js index b82c6d00a4b1d..e998a3a4d808f 100644 --- a/tests/baselines/reference/constructSignaturesWithOverloads2.js +++ b/tests/baselines/reference/constructSignaturesWithOverloads2.js @@ -42,7 +42,7 @@ var r5 = new i2(1, 1); //// [constructSignaturesWithOverloads2.js] // No errors expected for basic overloads of construct signatures with merged declarations // clodules -var C = (function () { +var C = /** @class */ (function () { function C(x) { } return C; @@ -51,7 +51,7 @@ var C = (function () { C.x = 1; })(C || (C = {})); var r1 = new C(1, ''); -var C2 = (function () { +var C2 = /** @class */ (function () { function C2(x) { } return C2; diff --git a/tests/baselines/reference/constructSignaturesWithOverloadsThatDifferOnlyByReturnType.js b/tests/baselines/reference/constructSignaturesWithOverloadsThatDifferOnlyByReturnType.js index 1593a37876483..2efba27b296fe 100644 --- a/tests/baselines/reference/constructSignaturesWithOverloadsThatDifferOnlyByReturnType.js +++ b/tests/baselines/reference/constructSignaturesWithOverloadsThatDifferOnlyByReturnType.js @@ -34,12 +34,12 @@ var b: { //// [constructSignaturesWithOverloadsThatDifferOnlyByReturnType.js] // Error for construct signature overloads to differ only by return type -var C = (function () { +var C = /** @class */ (function () { function C(x) { } return C; }()); -var C2 = (function () { +var C2 = /** @class */ (function () { function C2(x, y) { } return C2; diff --git a/tests/baselines/reference/constructableDecoratorOnClass01.js b/tests/baselines/reference/constructableDecoratorOnClass01.js index a37f96b59d1c7..af8aee4309cf5 100644 --- a/tests/baselines/reference/constructableDecoratorOnClass01.js +++ b/tests/baselines/reference/constructableDecoratorOnClass01.js @@ -14,12 +14,12 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key, else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; -var CtorDtor = (function () { +var CtorDtor = /** @class */ (function () { function CtorDtor() { } return CtorDtor; }()); -var C = (function () { +var C = /** @class */ (function () { function C() { } C = __decorate([ diff --git a/tests/baselines/reference/constructorArgWithGenericCallSignature.js b/tests/baselines/reference/constructorArgWithGenericCallSignature.js index c299bba6c91e8..0891e10ababba 100644 --- a/tests/baselines/reference/constructorArgWithGenericCallSignature.js +++ b/tests/baselines/reference/constructorArgWithGenericCallSignature.js @@ -17,7 +17,7 @@ var test = new Test.MyClass(func); // Should be OK //// [constructorArgWithGenericCallSignature.js] var Test; (function (Test) { - var MyClass = (function () { + var MyClass = /** @class */ (function () { function MyClass(func) { } return MyClass; diff --git a/tests/baselines/reference/constructorArgs.js b/tests/baselines/reference/constructorArgs.js index 877cef3dd0a9e..eabb50bc11205 100644 --- a/tests/baselines/reference/constructorArgs.js +++ b/tests/baselines/reference/constructorArgs.js @@ -26,12 +26,12 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var Super = (function () { +var Super = /** @class */ (function () { function Super(value) { } return Super; }()); -var Sub = (function (_super) { +var Sub = /** @class */ (function (_super) { __extends(Sub, _super); function Sub(options) { var _this = _super.call(this, options.value) || this; diff --git a/tests/baselines/reference/constructorArgsErrors1.js b/tests/baselines/reference/constructorArgsErrors1.js index bb0725ab8b9b3..7fde068cf7f71 100644 --- a/tests/baselines/reference/constructorArgsErrors1.js +++ b/tests/baselines/reference/constructorArgsErrors1.js @@ -5,7 +5,7 @@ class foo { } //// [constructorArgsErrors1.js] -var foo = (function () { +var foo = /** @class */ (function () { function foo(a) { } return foo; diff --git a/tests/baselines/reference/constructorArgsErrors2.js b/tests/baselines/reference/constructorArgsErrors2.js index 5650c64c96d3f..5847bc10c4ced 100644 --- a/tests/baselines/reference/constructorArgsErrors2.js +++ b/tests/baselines/reference/constructorArgsErrors2.js @@ -6,7 +6,7 @@ class foo { //// [constructorArgsErrors2.js] -var foo = (function () { +var foo = /** @class */ (function () { function foo(a) { this.a = a; } diff --git a/tests/baselines/reference/constructorArgsErrors3.js b/tests/baselines/reference/constructorArgsErrors3.js index 4d7d36a02c519..41d2da51d8a82 100644 --- a/tests/baselines/reference/constructorArgsErrors3.js +++ b/tests/baselines/reference/constructorArgsErrors3.js @@ -6,7 +6,7 @@ class foo { //// [constructorArgsErrors3.js] -var foo = (function () { +var foo = /** @class */ (function () { function foo(a) { this.a = a; } diff --git a/tests/baselines/reference/constructorArgsErrors4.js b/tests/baselines/reference/constructorArgsErrors4.js index 558cb6e68decd..210e71a9842e2 100644 --- a/tests/baselines/reference/constructorArgsErrors4.js +++ b/tests/baselines/reference/constructorArgsErrors4.js @@ -6,7 +6,7 @@ class foo { //// [constructorArgsErrors4.js] -var foo = (function () { +var foo = /** @class */ (function () { function foo(a) { this.a = a; } diff --git a/tests/baselines/reference/constructorArgsErrors5.js b/tests/baselines/reference/constructorArgsErrors5.js index c481d6f323c6c..941b5a8e0922b 100644 --- a/tests/baselines/reference/constructorArgsErrors5.js +++ b/tests/baselines/reference/constructorArgsErrors5.js @@ -6,7 +6,7 @@ class foo { //// [constructorArgsErrors5.js] -var foo = (function () { +var foo = /** @class */ (function () { function foo(a) { } return foo; diff --git a/tests/baselines/reference/constructorDefaultValuesReferencingThis.js b/tests/baselines/reference/constructorDefaultValuesReferencingThis.js index 5bc75012f7d6e..672d17d5fa425 100644 --- a/tests/baselines/reference/constructorDefaultValuesReferencingThis.js +++ b/tests/baselines/reference/constructorDefaultValuesReferencingThis.js @@ -12,19 +12,19 @@ class E { } //// [constructorDefaultValuesReferencingThis.js] -var C = (function () { +var C = /** @class */ (function () { function C(x) { if (x === void 0) { x = this; } } return C; }()); -var D = (function () { +var D = /** @class */ (function () { function D(x) { if (x === void 0) { x = this; } } return D; }()); -var E = (function () { +var E = /** @class */ (function () { function E(x) { if (x === void 0) { x = this; } this.x = x; diff --git a/tests/baselines/reference/constructorFunctionTypeIsAssignableToBaseType.js b/tests/baselines/reference/constructorFunctionTypeIsAssignableToBaseType.js index 323c9a4c6d8bf..3a0cdaa03edce 100644 --- a/tests/baselines/reference/constructorFunctionTypeIsAssignableToBaseType.js +++ b/tests/baselines/reference/constructorFunctionTypeIsAssignableToBaseType.js @@ -30,19 +30,19 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var Base = (function () { +var Base = /** @class */ (function () { function Base() { } return Base; }()); -var Derived = (function (_super) { +var Derived = /** @class */ (function (_super) { __extends(Derived, _super); function Derived() { return _super !== null && _super.apply(this, arguments) || this; } return Derived; }(Base)); -var Derived2 = (function (_super) { +var Derived2 = /** @class */ (function (_super) { __extends(Derived2, _super); function Derived2() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/constructorFunctionTypeIsAssignableToBaseType2.js b/tests/baselines/reference/constructorFunctionTypeIsAssignableToBaseType2.js index 56891defbe031..49032eeb36eab 100644 --- a/tests/baselines/reference/constructorFunctionTypeIsAssignableToBaseType2.js +++ b/tests/baselines/reference/constructorFunctionTypeIsAssignableToBaseType2.js @@ -44,19 +44,19 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var Base = (function () { +var Base = /** @class */ (function () { function Base(x) { } return Base; }()); -var Derived = (function (_super) { +var Derived = /** @class */ (function (_super) { __extends(Derived, _super); function Derived(x) { return _super.call(this, x) || this; } return Derived; }(Base)); -var Derived2 = (function (_super) { +var Derived2 = /** @class */ (function (_super) { __extends(Derived2, _super); // ok, not enforcing assignability relation on this function Derived2(x) { diff --git a/tests/baselines/reference/constructorHasPrototypeProperty.js b/tests/baselines/reference/constructorHasPrototypeProperty.js index 64fa9d9099d45..675e0e02e6a39 100644 --- a/tests/baselines/reference/constructorHasPrototypeProperty.js +++ b/tests/baselines/reference/constructorHasPrototypeProperty.js @@ -44,12 +44,12 @@ var __extends = (this && this.__extends) || (function () { })(); var NonGeneric; (function (NonGeneric) { - var C = (function () { + var C = /** @class */ (function () { function C() { } return C; }()); - var D = (function (_super) { + var D = /** @class */ (function (_super) { __extends(D, _super); function D() { return _super !== null && _super.apply(this, arguments) || this; @@ -63,12 +63,12 @@ var NonGeneric; })(NonGeneric || (NonGeneric = {})); var Generic; (function (Generic) { - var C = (function () { + var C = /** @class */ (function () { function C() { } return C; }()); - var D = (function (_super) { + var D = /** @class */ (function (_super) { __extends(D, _super); function D() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/constructorImplementationWithDefaultValues.js b/tests/baselines/reference/constructorImplementationWithDefaultValues.js index 607ffb1e30bc1..005436f976074 100644 --- a/tests/baselines/reference/constructorImplementationWithDefaultValues.js +++ b/tests/baselines/reference/constructorImplementationWithDefaultValues.js @@ -21,21 +21,21 @@ class E { } //// [constructorImplementationWithDefaultValues.js] -var C = (function () { +var C = /** @class */ (function () { function C(x) { if (x === void 0) { x = 1; } var y = x; } return C; }()); -var D = (function () { +var D = /** @class */ (function () { function D(x) { if (x === void 0) { x = null; } var y = x; } return D; }()); -var E = (function () { +var E = /** @class */ (function () { function E(x) { if (x === void 0) { x = null; } var y = x; diff --git a/tests/baselines/reference/constructorImplementationWithDefaultValues2.js b/tests/baselines/reference/constructorImplementationWithDefaultValues2.js index b0ca55b650442..a6f91acb0302c 100644 --- a/tests/baselines/reference/constructorImplementationWithDefaultValues2.js +++ b/tests/baselines/reference/constructorImplementationWithDefaultValues2.js @@ -21,7 +21,7 @@ class E { } //// [constructorImplementationWithDefaultValues2.js] -var C = (function () { +var C = /** @class */ (function () { function C(x) { if (x === void 0) { x = 1; } this.x = x; @@ -29,7 +29,7 @@ var C = (function () { } return C; }()); -var D = (function () { +var D = /** @class */ (function () { function D(x, y) { if (x === void 0) { x = 1; } if (y === void 0) { y = x; } @@ -38,7 +38,7 @@ var D = (function () { } return D; }()); -var E = (function () { +var E = /** @class */ (function () { function E(x) { if (x === void 0) { x = new Date(); } var y = x; diff --git a/tests/baselines/reference/constructorInvocationWithTooFewTypeArgs.js b/tests/baselines/reference/constructorInvocationWithTooFewTypeArgs.js index 6bc52392e1c37..a5cf2fb44ab04 100644 --- a/tests/baselines/reference/constructorInvocationWithTooFewTypeArgs.js +++ b/tests/baselines/reference/constructorInvocationWithTooFewTypeArgs.js @@ -11,7 +11,7 @@ var d = new D(); //// [constructorInvocationWithTooFewTypeArgs.js] -var D = (function () { +var D = /** @class */ (function () { function D() { } return D; diff --git a/tests/baselines/reference/constructorOverloads1.js b/tests/baselines/reference/constructorOverloads1.js index 47906974f6ea5..17449197801c5 100644 --- a/tests/baselines/reference/constructorOverloads1.js +++ b/tests/baselines/reference/constructorOverloads1.js @@ -22,7 +22,7 @@ f1.bar2(); //// [constructorOverloads1.js] -var Foo = (function () { +var Foo = /** @class */ (function () { function Foo(x) { } Foo.prototype.bar1 = function () { }; diff --git a/tests/baselines/reference/constructorOverloads2.js b/tests/baselines/reference/constructorOverloads2.js index 291ea54573393..0236ca8645a20 100644 --- a/tests/baselines/reference/constructorOverloads2.js +++ b/tests/baselines/reference/constructorOverloads2.js @@ -36,13 +36,13 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var FooBase = (function () { +var FooBase = /** @class */ (function () { function FooBase(x) { } FooBase.prototype.bar1 = function () { }; return FooBase; }()); -var Foo = (function (_super) { +var Foo = /** @class */ (function (_super) { __extends(Foo, _super); function Foo(x, y) { return _super.call(this, x) || this; diff --git a/tests/baselines/reference/constructorOverloads3.js b/tests/baselines/reference/constructorOverloads3.js index 94b29ad89ab01..b29a9ba651a66 100644 --- a/tests/baselines/reference/constructorOverloads3.js +++ b/tests/baselines/reference/constructorOverloads3.js @@ -33,7 +33,7 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var Foo = (function (_super) { +var Foo = /** @class */ (function (_super) { __extends(Foo, _super); function Foo(x, y) { var _this = this; diff --git a/tests/baselines/reference/constructorOverloads8.js b/tests/baselines/reference/constructorOverloads8.js index f1185b6ab76b5..0b6ceefb6cd48 100644 --- a/tests/baselines/reference/constructorOverloads8.js +++ b/tests/baselines/reference/constructorOverloads8.js @@ -16,12 +16,12 @@ interface I { } //// [constructorOverloads8.js] -var C = (function () { +var C = /** @class */ (function () { function C(x) { } return C; }()); -var D = (function () { +var D = /** @class */ (function () { function D(x) { } return D; diff --git a/tests/baselines/reference/constructorOverloadsWithDefaultValues.js b/tests/baselines/reference/constructorOverloadsWithDefaultValues.js index 78a5d33769071..51df39a04c938 100644 --- a/tests/baselines/reference/constructorOverloadsWithDefaultValues.js +++ b/tests/baselines/reference/constructorOverloadsWithDefaultValues.js @@ -14,12 +14,12 @@ class D { } //// [constructorOverloadsWithDefaultValues.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } return C; }()); -var D = (function () { +var D = /** @class */ (function () { function D() { } return D; diff --git a/tests/baselines/reference/constructorOverloadsWithOptionalParameters.js b/tests/baselines/reference/constructorOverloadsWithOptionalParameters.js index b251a5f88ce3b..45ffaa537c599 100644 --- a/tests/baselines/reference/constructorOverloadsWithOptionalParameters.js +++ b/tests/baselines/reference/constructorOverloadsWithOptionalParameters.js @@ -14,12 +14,12 @@ class D { } //// [constructorOverloadsWithOptionalParameters.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } return C; }()); -var D = (function () { +var D = /** @class */ (function () { function D() { } return D; diff --git a/tests/baselines/reference/constructorParameterProperties.js b/tests/baselines/reference/constructorParameterProperties.js index 17c6fdaddcd82..dd959396cd1ec 100644 --- a/tests/baselines/reference/constructorParameterProperties.js +++ b/tests/baselines/reference/constructorParameterProperties.js @@ -22,7 +22,7 @@ var r4 = d.z; // error //// [constructorParameterProperties.js] -var C = (function () { +var C = /** @class */ (function () { function C(x, z) { this.x = x; this.z = z; @@ -33,7 +33,7 @@ var c; var r = c.y; var r2 = c.x; // error var r3 = c.z; // error -var D = (function () { +var D = /** @class */ (function () { function D(a, x, z) { this.x = x; this.z = z; diff --git a/tests/baselines/reference/constructorParameterProperties2.js b/tests/baselines/reference/constructorParameterProperties2.js index c740fc9fd3040..413b6c565958c 100644 --- a/tests/baselines/reference/constructorParameterProperties2.js +++ b/tests/baselines/reference/constructorParameterProperties2.js @@ -33,14 +33,14 @@ var r4 = f.y; // error //// [constructorParameterProperties2.js] -var C = (function () { +var C = /** @class */ (function () { function C(y) { } // ok return C; }()); var c; var r = c.y; -var D = (function () { +var D = /** @class */ (function () { function D(y) { this.y = y; } // error @@ -48,7 +48,7 @@ var D = (function () { }()); var d; var r2 = d.y; -var E = (function () { +var E = /** @class */ (function () { function E(y) { this.y = y; } // error @@ -56,7 +56,7 @@ var E = (function () { }()); var e; var r3 = e.y; // error -var F = (function () { +var F = /** @class */ (function () { function F(y) { this.y = y; } // error diff --git a/tests/baselines/reference/constructorParameterShadowsOuterScopes.js b/tests/baselines/reference/constructorParameterShadowsOuterScopes.js index aa6612828fa2d..2979b9265041c 100644 --- a/tests/baselines/reference/constructorParameterShadowsOuterScopes.js +++ b/tests/baselines/reference/constructorParameterShadowsOuterScopes.js @@ -26,7 +26,7 @@ class D { // This effectively means that entities from outer scopes by the same name as a constructor parameter or // local variable are inaccessible in initializer expressions for instance member variables var x = 1; -var C = (function () { +var C = /** @class */ (function () { function C(x) { this.b = x; // error, evaluated in scope of constructor, cannot reference x x = 2; // error, x is string @@ -34,7 +34,7 @@ var C = (function () { return C; }()); var y = 1; -var D = (function () { +var D = /** @class */ (function () { function D(x) { this.b = y; // error, evaluated in scope of constructor, cannot reference y var y = ""; diff --git a/tests/baselines/reference/constructorParametersInVariableDeclarations.js b/tests/baselines/reference/constructorParametersInVariableDeclarations.js index 659b4ea98fc46..c408dfeb8450d 100644 --- a/tests/baselines/reference/constructorParametersInVariableDeclarations.js +++ b/tests/baselines/reference/constructorParametersInVariableDeclarations.js @@ -17,7 +17,7 @@ class B { } //// [constructorParametersInVariableDeclarations.js] -var A = (function () { +var A = /** @class */ (function () { function A(x) { this.a = x; this.b = { p: x }; @@ -25,7 +25,7 @@ var A = (function () { } return A; }()); -var B = (function () { +var B = /** @class */ (function () { function B() { this.a = x; this.b = { p: x }; diff --git a/tests/baselines/reference/constructorParametersThatShadowExternalNamesInVariableDeclarations.js b/tests/baselines/reference/constructorParametersThatShadowExternalNamesInVariableDeclarations.js index 1bcf24ee4c3a7..538992336b751 100644 --- a/tests/baselines/reference/constructorParametersThatShadowExternalNamesInVariableDeclarations.js +++ b/tests/baselines/reference/constructorParametersThatShadowExternalNamesInVariableDeclarations.js @@ -15,13 +15,13 @@ class B { //// [constructorParametersThatShadowExternalNamesInVariableDeclarations.js] var x = 1; -var A = (function () { +var A = /** @class */ (function () { function A(x) { this.a = x; } return A; }()); -var B = (function () { +var B = /** @class */ (function () { function B() { this.a = x; var x = ""; diff --git a/tests/baselines/reference/constructorReturningAPrimitive.js b/tests/baselines/reference/constructorReturningAPrimitive.js index 297c9954f55ec..7b788641aeeb4 100644 --- a/tests/baselines/reference/constructorReturningAPrimitive.js +++ b/tests/baselines/reference/constructorReturningAPrimitive.js @@ -22,14 +22,14 @@ var b = new B(); //// [constructorReturningAPrimitive.js] // technically not allowed by JavaScript but we don't have a 'not-primitive' constraint // functionally only possible when your class is otherwise devoid of members so of little consequence in practice -var A = (function () { +var A = /** @class */ (function () { function A() { return 1; } return A; }()); var a = new A(); -var B = (function () { +var B = /** @class */ (function () { function B() { var x; return x; diff --git a/tests/baselines/reference/constructorReturnsInvalidType.js b/tests/baselines/reference/constructorReturnsInvalidType.js index 82c5cc4a76095..6f180ff65b868 100644 --- a/tests/baselines/reference/constructorReturnsInvalidType.js +++ b/tests/baselines/reference/constructorReturnsInvalidType.js @@ -10,7 +10,7 @@ var x = new X(); //// [constructorReturnsInvalidType.js] -var X = (function () { +var X = /** @class */ (function () { function X() { return 1; } diff --git a/tests/baselines/reference/constructorStaticParamName.js b/tests/baselines/reference/constructorStaticParamName.js index 9520a7c052cf7..989d41ad649f0 100644 --- a/tests/baselines/reference/constructorStaticParamName.js +++ b/tests/baselines/reference/constructorStaticParamName.js @@ -8,7 +8,7 @@ class test { //// [constructorStaticParamName.js] // static as constructor parameter name should only give error if 'use strict' -var test = (function () { +var test = /** @class */ (function () { function test(static) { } return test; diff --git a/tests/baselines/reference/constructorStaticParamNameErrors.js b/tests/baselines/reference/constructorStaticParamNameErrors.js index 91d405efd2837..0130a504059a1 100644 --- a/tests/baselines/reference/constructorStaticParamNameErrors.js +++ b/tests/baselines/reference/constructorStaticParamNameErrors.js @@ -8,7 +8,7 @@ class test { //// [constructorStaticParamNameErrors.js] 'use strict'; // static as constructor parameter name should give error if 'use strict' -var test = (function () { +var test = /** @class */ (function () { function test(static) { } return test; diff --git a/tests/baselines/reference/constructorWithAssignableReturnExpression.js b/tests/baselines/reference/constructorWithAssignableReturnExpression.js index d691dd2b511e0..8cc76ab778b87 100644 --- a/tests/baselines/reference/constructorWithAssignableReturnExpression.js +++ b/tests/baselines/reference/constructorWithAssignableReturnExpression.js @@ -37,31 +37,31 @@ class G { //// [constructorWithAssignableReturnExpression.js] // a class constructor may return an expression, it must be assignable to the class instance type to be valid -var C = (function () { +var C = /** @class */ (function () { function C() { return 1; } return C; }()); -var D = (function () { +var D = /** @class */ (function () { function D() { return 1; // error } return D; }()); -var E = (function () { +var E = /** @class */ (function () { function E() { return { x: 1 }; } return E; }()); -var F = (function () { +var F = /** @class */ (function () { function F() { return { x: 1 }; // error } return F; }()); -var G = (function () { +var G = /** @class */ (function () { function G() { return { x: null }; } diff --git a/tests/baselines/reference/constructorWithCapturedSuper.js b/tests/baselines/reference/constructorWithCapturedSuper.js index 503742de9fecc..773bddb19328d 100644 --- a/tests/baselines/reference/constructorWithCapturedSuper.js +++ b/tests/baselines/reference/constructorWithCapturedSuper.js @@ -64,13 +64,13 @@ var __extends = (this && this.__extends) || (function () { }; })(); var oneA; -var A = (function () { +var A = /** @class */ (function () { function A() { return oneA; } return A; }()); -var B = (function (_super) { +var B = /** @class */ (function (_super) { __extends(B, _super); function B(x) { var _this = _super.call(this) || this; @@ -93,7 +93,7 @@ var B = (function (_super) { } return B; }(A)); -var C = (function (_super) { +var C = /** @class */ (function (_super) { __extends(C, _super); function C(x) { var _this = _super.call(this) || this; @@ -112,7 +112,7 @@ var C = (function (_super) { } return C; }(A)); -var D = (function (_super) { +var D = /** @class */ (function (_super) { __extends(D, _super); function D(x) { var _this = _super.call(this) || this; diff --git a/tests/baselines/reference/constructorWithExpressionLessReturn.js b/tests/baselines/reference/constructorWithExpressionLessReturn.js index 8bf0e2f8de0ea..a2d274dec6e54 100644 --- a/tests/baselines/reference/constructorWithExpressionLessReturn.js +++ b/tests/baselines/reference/constructorWithExpressionLessReturn.js @@ -25,26 +25,26 @@ class F { } //// [constructorWithExpressionLessReturn.js] -var C = (function () { +var C = /** @class */ (function () { function C() { return; } return C; }()); -var D = (function () { +var D = /** @class */ (function () { function D() { return; } return D; }()); -var E = (function () { +var E = /** @class */ (function () { function E(x) { this.x = x; return; } return E; }()); -var F = (function () { +var F = /** @class */ (function () { function F(x) { this.x = x; return; diff --git a/tests/baselines/reference/constructorWithIncompleteTypeAnnotation.js b/tests/baselines/reference/constructorWithIncompleteTypeAnnotation.js index 8e9dc6da68831..19d0d9c6a0405 100644 --- a/tests/baselines/reference/constructorWithIncompleteTypeAnnotation.js +++ b/tests/baselines/reference/constructorWithIncompleteTypeAnnotation.js @@ -294,7 +294,7 @@ var fs = module; ("fs"); var TypeScriptAllInOne; (function (TypeScriptAllInOne) { - var Program = (function () { + var Program = /** @class */ (function () { function Program() { this["case"] = bfs.STATEMENTS(4); } @@ -344,7 +344,7 @@ var TypeScriptAllInOne; console.log('Done'); return 0; })(TypeScriptAllInOne || (TypeScriptAllInOne = {})); -var BasicFeatures = (function () { +var BasicFeatures = /** @class */ (function () { function BasicFeatures() { } /// @@ -489,7 +489,7 @@ var BasicFeatures = (function () { }; return BasicFeatures; }()); -var CLASS = (function () { +var CLASS = /** @class */ (function () { function CLASS() { this.d = function () { yield 0; }; } @@ -513,7 +513,7 @@ var CLASS = (function () { return CLASS; }()); // todo: use these -var A = (function () { +var A = /** @class */ (function () { function A() { } return A; @@ -526,7 +526,7 @@ method2(); { return 2 * this.method1(2); } -var B = (function (_super) { +var B = /** @class */ (function (_super) { __extends(B, _super); function B() { return _super !== null && _super.apply(this, arguments) || this; @@ -536,7 +536,7 @@ var B = (function (_super) { }; return B; }(A)); -var Overloading = (function () { +var Overloading = /** @class */ (function () { function Overloading() { this.otherValue = 42; } diff --git a/tests/baselines/reference/constructorsWithSpecializedSignatures.js b/tests/baselines/reference/constructorsWithSpecializedSignatures.js index c3a0752ddf8b4..512134c6850fc 100644 --- a/tests/baselines/reference/constructorsWithSpecializedSignatures.js +++ b/tests/baselines/reference/constructorsWithSpecializedSignatures.js @@ -45,13 +45,13 @@ interface I2 { //// [constructorsWithSpecializedSignatures.js] // errors -var D = (function () { +var D = /** @class */ (function () { function D(x) { } return D; }()); // overloads are ok -var D2 = (function () { +var D2 = /** @class */ (function () { function D2(x) { } // error return D2; diff --git a/tests/baselines/reference/contextualTypeAppliedToVarArgs.js b/tests/baselines/reference/contextualTypeAppliedToVarArgs.js index f8b271ba47cf6..380e45742129b 100644 --- a/tests/baselines/reference/contextualTypeAppliedToVarArgs.js +++ b/tests/baselines/reference/contextualTypeAppliedToVarArgs.js @@ -20,7 +20,7 @@ class Foo{ function delegate(instance, method, data) { return function () { }; } -var Foo = (function () { +var Foo = /** @class */ (function () { function Foo() { } Foo.prototype.Bar = function () { diff --git a/tests/baselines/reference/contextualTypeWithTuple.js b/tests/baselines/reference/contextualTypeWithTuple.js index 4fff51de563c6..3703174945e8a 100644 --- a/tests/baselines/reference/contextualTypeWithTuple.js +++ b/tests/baselines/reference/contextualTypeWithTuple.js @@ -32,12 +32,12 @@ var numStrTuple2 = [5, "foo", true]; var numStrBoolTuple = [5, "foo", true]; var objNumTuple = [{ a: "world" }, 5]; var strTupleTuple = ["bar", [5, { x: 1, y: 1 }]]; -var C = (function () { +var C = /** @class */ (function () { function C() { } return C; }()); -var D = (function () { +var D = /** @class */ (function () { function D() { } return D; diff --git a/tests/baselines/reference/contextualTyping.js b/tests/baselines/reference/contextualTyping.js index 227c6bb1f41eb..5a7e2f4445332 100644 --- a/tests/baselines/reference/contextualTyping.js +++ b/tests/baselines/reference/contextualTyping.js @@ -233,7 +233,7 @@ var x: B = { }; //// [contextualTyping.js] // CONTEXT: Class property declaration -var C1T5 = (function () { +var C1T5 = /** @class */ (function () { function C1T5() { this.foo = function (i) { return i; @@ -272,7 +272,7 @@ var c3t14 = ({ a: [] }); // CONTEXT: Class property assignment -var C4T5 = (function () { +var C4T5 = /** @class */ (function () { function C4T5() { this.foo = function (i, s) { return s; @@ -325,7 +325,7 @@ c9t5(function (n) { // CONTEXT: Return statement var c10t5 = function () { return function (n) { return ({}); }; }; // CONTEXT: Newing a class -var C11t5 = (function () { +var C11t5 = /** @class */ (function () { function C11t5(f) { } return C11t5; diff --git a/tests/baselines/reference/contextualTyping.sourcemap.txt b/tests/baselines/reference/contextualTyping.sourcemap.txt index fa7352f47c6a6..9c5d14a6e459e 100644 --- a/tests/baselines/reference/contextualTyping.sourcemap.txt +++ b/tests/baselines/reference/contextualTyping.sourcemap.txt @@ -11,6 +11,7 @@ sourceFile:contextualTyping.ts >>>// CONTEXT: Class property declaration 1 > 2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +3 > ^^-> 1 >// DEFAULT INTERFACES >interface IFoo { > n: number; @@ -28,12 +29,12 @@ sourceFile:contextualTyping.ts 1 >Emitted(1, 1) Source(13, 1) + SourceIndex(0) 2 >Emitted(1, 39) Source(13, 39) + SourceIndex(0) --- ->>>var C1T5 = (function () { -1 > +>>>var C1T5 = /** @class */ (function () { +1-> 2 >^^^^^^^^^^^^^^^^^^^^^^-> -1 > +1-> > -1 >Emitted(2, 1) Source(14, 1) + SourceIndex(0) +1->Emitted(2, 1) Source(14, 1) + SourceIndex(0) --- >>> function C1T5() { 1->^^^^ @@ -936,6 +937,7 @@ sourceFile:contextualTyping.ts >>>// CONTEXT: Class property assignment 1-> 2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +3 > ^^^-> 1-> > > @@ -943,12 +945,12 @@ sourceFile:contextualTyping.ts 1->Emitted(40, 1) Source(55, 1) + SourceIndex(0) 2 >Emitted(40, 38) Source(55, 38) + SourceIndex(0) --- ->>>var C4T5 = (function () { -1 > +>>>var C4T5 = /** @class */ (function () { +1-> 2 >^^^^^^^^^^^^^^^^^^^^^^-> -1 > +1-> > -1 >Emitted(41, 1) Source(56, 1) + SourceIndex(0) +1->Emitted(41, 1) Source(56, 1) + SourceIndex(0) --- >>> function C4T5() { 1->^^^^ @@ -2298,7 +2300,7 @@ sourceFile:contextualTyping.ts >>>// CONTEXT: Newing a class 1 > 2 >^^^^^^^^^^^^^^^^^^^^^^^^^^ -3 > ^-> +3 > ^^^^^^^^^^^^^^^-> 1 > > > @@ -2306,7 +2308,7 @@ sourceFile:contextualTyping.ts 1 >Emitted(93, 1) Source(154, 1) + SourceIndex(0) 2 >Emitted(93, 27) Source(154, 27) + SourceIndex(0) --- ->>>var C11t5 = (function () { +>>>var C11t5 = /** @class */ (function () { 1-> 2 >^^^^^^^^^^^^^^^^^^^^^^^^-> 1-> diff --git a/tests/baselines/reference/contextualTyping10.js b/tests/baselines/reference/contextualTyping10.js index cd324b384fd55..ad3f960774973 100644 --- a/tests/baselines/reference/contextualTyping10.js +++ b/tests/baselines/reference/contextualTyping10.js @@ -2,7 +2,7 @@ class foo { public bar:{id:number;}[] = [{id:1}, {id:2}]; } //// [contextualTyping10.js] -var foo = (function () { +var foo = /** @class */ (function () { function foo() { this.bar = [{ id: 1 }, { id: 2 }]; } diff --git a/tests/baselines/reference/contextualTyping11.js b/tests/baselines/reference/contextualTyping11.js index 9abf332c29edb..b6b8c03b4288e 100644 --- a/tests/baselines/reference/contextualTyping11.js +++ b/tests/baselines/reference/contextualTyping11.js @@ -2,7 +2,7 @@ class foo { public bar:{id:number;}[] = [({})]; } //// [contextualTyping11.js] -var foo = (function () { +var foo = /** @class */ (function () { function foo() { this.bar = [({})]; } diff --git a/tests/baselines/reference/contextualTyping12.js b/tests/baselines/reference/contextualTyping12.js index c9ce3e2f964d7..f1eba009e5e35 100644 --- a/tests/baselines/reference/contextualTyping12.js +++ b/tests/baselines/reference/contextualTyping12.js @@ -2,7 +2,7 @@ class foo { public bar:{id:number;}[] = [{id:1}, {id:2, name:"foo"}]; } //// [contextualTyping12.js] -var foo = (function () { +var foo = /** @class */ (function () { function foo() { this.bar = [{ id: 1 }, { id: 2, name: "foo" }]; } diff --git a/tests/baselines/reference/contextualTyping14.js b/tests/baselines/reference/contextualTyping14.js index f29e077eaa2d3..edbfd756d7835 100644 --- a/tests/baselines/reference/contextualTyping14.js +++ b/tests/baselines/reference/contextualTyping14.js @@ -2,7 +2,7 @@ class foo { public bar:(a:number)=>number = function(a){return a}; } //// [contextualTyping14.js] -var foo = (function () { +var foo = /** @class */ (function () { function foo() { this.bar = function (a) { return a; }; } diff --git a/tests/baselines/reference/contextualTyping15.js b/tests/baselines/reference/contextualTyping15.js index 30df3d3d428ac..d52f1e9a58f16 100644 --- a/tests/baselines/reference/contextualTyping15.js +++ b/tests/baselines/reference/contextualTyping15.js @@ -2,7 +2,7 @@ class foo { public bar: { (): number; (i: number): number; } = function() { return 1 }; } //// [contextualTyping15.js] -var foo = (function () { +var foo = /** @class */ (function () { function foo() { this.bar = function () { return 1; }; } diff --git a/tests/baselines/reference/contextualTyping3.js b/tests/baselines/reference/contextualTyping3.js index 2fc0f330b13a9..3b83057c606ff 100644 --- a/tests/baselines/reference/contextualTyping3.js +++ b/tests/baselines/reference/contextualTyping3.js @@ -2,7 +2,7 @@ class foo { public bar:{id:number;} = {id:5}; } //// [contextualTyping3.js] -var foo = (function () { +var foo = /** @class */ (function () { function foo() { this.bar = { id: 5 }; } diff --git a/tests/baselines/reference/contextualTyping4.js b/tests/baselines/reference/contextualTyping4.js index 36f7c61429f17..e6bf16d6a6199 100644 --- a/tests/baselines/reference/contextualTyping4.js +++ b/tests/baselines/reference/contextualTyping4.js @@ -2,7 +2,7 @@ class foo { public bar:{id:number;} = {id:5, name:"foo"}; } //// [contextualTyping4.js] -var foo = (function () { +var foo = /** @class */ (function () { function foo() { this.bar = { id: 5, name: "foo" }; } diff --git a/tests/baselines/reference/contextualTyping5.js b/tests/baselines/reference/contextualTyping5.js index f5e68e93b2291..5eed0011ea4d5 100644 --- a/tests/baselines/reference/contextualTyping5.js +++ b/tests/baselines/reference/contextualTyping5.js @@ -2,7 +2,7 @@ class foo { public bar:{id:number;} = { }; } //// [contextualTyping5.js] -var foo = (function () { +var foo = /** @class */ (function () { function foo() { this.bar = {}; } diff --git a/tests/baselines/reference/contextualTypingArrayOfLambdas.js b/tests/baselines/reference/contextualTypingArrayOfLambdas.js index 5d8b40e39f08c..9f9a612afe4ca 100644 --- a/tests/baselines/reference/contextualTypingArrayOfLambdas.js +++ b/tests/baselines/reference/contextualTypingArrayOfLambdas.js @@ -25,19 +25,19 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var A = (function () { +var A = /** @class */ (function () { function A() { } return A; }()); -var B = (function (_super) { +var B = /** @class */ (function (_super) { __extends(B, _super); function B() { return _super !== null && _super.apply(this, arguments) || this; } return B; }(A)); -var C = (function (_super) { +var C = /** @class */ (function (_super) { __extends(C, _super); function C() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/contextualTypingOfConditionalExpression.js b/tests/baselines/reference/contextualTypingOfConditionalExpression.js index fd5ec50ebb485..af4c6d042ccc6 100644 --- a/tests/baselines/reference/contextualTypingOfConditionalExpression.js +++ b/tests/baselines/reference/contextualTypingOfConditionalExpression.js @@ -26,19 +26,19 @@ var __extends = (this && this.__extends) || (function () { }; })(); var x = true ? function (a) { return a.toExponential(); } : function (b) { return b.toFixed(); }; -var A = (function () { +var A = /** @class */ (function () { function A() { } return A; }()); -var B = (function (_super) { +var B = /** @class */ (function (_super) { __extends(B, _super); function B() { return _super !== null && _super.apply(this, arguments) || this; } return B; }(A)); -var C = (function (_super) { +var C = /** @class */ (function (_super) { __extends(C, _super); function C() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/contextualTypingOfConditionalExpression2.js b/tests/baselines/reference/contextualTypingOfConditionalExpression2.js index f5063fa003a79..114ec2e8a713f 100644 --- a/tests/baselines/reference/contextualTypingOfConditionalExpression2.js +++ b/tests/baselines/reference/contextualTypingOfConditionalExpression2.js @@ -23,19 +23,19 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var A = (function () { +var A = /** @class */ (function () { function A() { } return A; }()); -var B = (function (_super) { +var B = /** @class */ (function (_super) { __extends(B, _super); function B() { return _super !== null && _super.apply(this, arguments) || this; } return B; }(A)); -var C = (function (_super) { +var C = /** @class */ (function (_super) { __extends(C, _super); function C() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/contextuallyTypedClassExpressionMethodDeclaration01.js b/tests/baselines/reference/contextuallyTypedClassExpressionMethodDeclaration01.js index 5b33cc5c7993d..c50c771896bfe 100644 --- a/tests/baselines/reference/contextuallyTypedClassExpressionMethodDeclaration01.js +++ b/tests/baselines/reference/contextuallyTypedClassExpressionMethodDeclaration01.js @@ -47,7 +47,7 @@ function getFoo3(): Foo { //// [contextuallyTypedClassExpressionMethodDeclaration01.js] function getFoo1() { - return (function () { + return /** @class */ (function () { function class_1() { } class_1.method1 = function (arg) { @@ -60,7 +60,7 @@ function getFoo1() { }()); } function getFoo2() { - return _a = (function () { + return _a = /** @class */ (function () { function class_2() { } return class_2; @@ -75,7 +75,7 @@ function getFoo2() { var _a; } function getFoo3() { - return _a = (function () { + return _a = /** @class */ (function () { function class_3() { } return class_3; diff --git a/tests/baselines/reference/contextuallyTypedClassExpressionMethodDeclaration02.js b/tests/baselines/reference/contextuallyTypedClassExpressionMethodDeclaration02.js index 4f1305053826a..40f6c55824ee6 100644 --- a/tests/baselines/reference/contextuallyTypedClassExpressionMethodDeclaration02.js +++ b/tests/baselines/reference/contextuallyTypedClassExpressionMethodDeclaration02.js @@ -51,7 +51,7 @@ function getFoo3(): Foo { //// [contextuallyTypedClassExpressionMethodDeclaration02.js] function getFoo1() { - return (function () { + return /** @class */ (function () { function class_1() { } class_1.prototype.method1 = function (arg) { @@ -64,7 +64,7 @@ function getFoo1() { }()); } function getFoo2() { - return (function () { + return /** @class */ (function () { function class_2() { this.method1 = function (arg) { arg.numProp = 10; @@ -77,7 +77,7 @@ function getFoo2() { }()); } function getFoo3() { - return (function () { + return /** @class */ (function () { function class_3() { this.method1 = function (arg) { arg.numProp = 10; diff --git a/tests/baselines/reference/controlFlowPropertyDeclarations.js b/tests/baselines/reference/controlFlowPropertyDeclarations.js index ab286b27f06ef..d5f91ceb92fa9 100644 --- a/tests/baselines/reference/controlFlowPropertyDeclarations.js +++ b/tests/baselines/reference/controlFlowPropertyDeclarations.js @@ -235,7 +235,7 @@ function isEmpty(string) { function isConvertiblePixelValue(value) { return /^\d+px$/.test(value); } -var HTMLtoJSX = (function () { +var HTMLtoJSX = /** @class */ (function () { function HTMLtoJSX() { var _this = this; /** @@ -276,7 +276,7 @@ exports.HTMLtoJSX = HTMLtoJSX; /** * Handles parsing of inline styles */ -var StyleParser = (function () { +var StyleParser = /** @class */ (function () { function StyleParser() { var _this = this; this.styles = {}; diff --git a/tests/baselines/reference/controlFlowPropertyInitializer.js b/tests/baselines/reference/controlFlowPropertyInitializer.js index dda9a2690bcf6..7eab421c1cb26 100644 --- a/tests/baselines/reference/controlFlowPropertyInitializer.js +++ b/tests/baselines/reference/controlFlowPropertyInitializer.js @@ -10,7 +10,7 @@ class BestLanguage { //// [controlFlowPropertyInitializer.js] // Repro from #8967 var LANG = "Turbo Pascal"; -var BestLanguage = (function () { +var BestLanguage = /** @class */ (function () { function BestLanguage() { this.name = LANG; } diff --git a/tests/baselines/reference/controlFlowSuperPropertyAccess.js b/tests/baselines/reference/controlFlowSuperPropertyAccess.js index c2f947d56878e..34af1d21ad6a5 100644 --- a/tests/baselines/reference/controlFlowSuperPropertyAccess.js +++ b/tests/baselines/reference/controlFlowSuperPropertyAccess.js @@ -20,12 +20,12 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var B = (function () { +var B = /** @class */ (function () { function B() { } return B; }()); -var C = (function (_super) { +var C = /** @class */ (function (_super) { __extends(C, _super); function C() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/convertKeywordsYes.js b/tests/baselines/reference/convertKeywordsYes.js index b7bd60e4a9535..4605db05c6cfe 100644 --- a/tests/baselines/reference/convertKeywordsYes.js +++ b/tests/baselines/reference/convertKeywordsYes.js @@ -382,7 +382,7 @@ var bigObject = { "while": 0, "with": 0 }; -var bigClass = (function () { +var bigClass = /** @class */ (function () { function bigClass() { this["constructor"] = 0; this.any = 0; @@ -500,72 +500,72 @@ var bigEnum; })(bigEnum || (bigEnum = {})); var bigModule; (function (bigModule) { - var constructor = (function () { + var constructor = /** @class */ (function () { function constructor() { } return constructor; }()); - var implements = (function () { + var implements = /** @class */ (function () { function implements() { } return implements; }()); - var interface = (function () { + var interface = /** @class */ (function () { function interface() { } return interface; }()); - var let = (function () { + var let = /** @class */ (function () { function let() { } return let; }()); - var module = (function () { + var module = /** @class */ (function () { function module() { } return module; }()); - var package = (function () { + var package = /** @class */ (function () { function package() { } return package; }()); - var private = (function () { + var private = /** @class */ (function () { function private() { } return private; }()); - var protected = (function () { + var protected = /** @class */ (function () { function protected() { } return protected; }()); - var public = (function () { + var public = /** @class */ (function () { function public() { } return public; }()); - var set = (function () { + var set = /** @class */ (function () { function set() { } return set; }()); - var static = (function () { + var static = /** @class */ (function () { function static() { } return static; }()); - var get = (function () { + var get = /** @class */ (function () { function get() { } return get; }()); - var yield = (function () { + var yield = /** @class */ (function () { function yield() { } return yield; }()); - var declare = (function () { + var declare = /** @class */ (function () { function declare() { } return declare; diff --git a/tests/baselines/reference/covariance1.js b/tests/baselines/reference/covariance1.js index eadcd9485b672..9e9c4615c2b13 100644 --- a/tests/baselines/reference/covariance1.js +++ b/tests/baselines/reference/covariance1.js @@ -20,7 +20,7 @@ module M { //// [covariance1.js] var M; (function (M) { - var XX = (function () { + var XX = /** @class */ (function () { function XX(m1) { this.m1 = m1; } diff --git a/tests/baselines/reference/crashInresolveReturnStatement.js b/tests/baselines/reference/crashInresolveReturnStatement.js index be2e38ddf49c0..6678378428446 100644 --- a/tests/baselines/reference/crashInresolveReturnStatement.js +++ b/tests/baselines/reference/crashInresolveReturnStatement.js @@ -19,7 +19,7 @@ class WITDialogs { //// [crashInresolveReturnStatement.js] -var WorkItemToolbar = (function () { +var WorkItemToolbar = /** @class */ (function () { function WorkItemToolbar() { } WorkItemToolbar.prototype.onToolbarItemClick = function () { @@ -27,7 +27,7 @@ var WorkItemToolbar = (function () { }; return WorkItemToolbar; }()); -var CreateCopyOfWorkItemDialog = (function () { +var CreateCopyOfWorkItemDialog = /** @class */ (function () { function CreateCopyOfWorkItemDialog() { } CreateCopyOfWorkItemDialog.prototype.getDialogResult = function () { @@ -37,7 +37,7 @@ var CreateCopyOfWorkItemDialog = (function () { }()); function createWorkItemDialog(dialogType) { } -var WITDialogs = (function () { +var WITDialogs = /** @class */ (function () { function WITDialogs() { } WITDialogs.createCopyOfWorkItem = function () { diff --git a/tests/baselines/reference/crashInsourcePropertyIsRelatableToTargetProperty.js b/tests/baselines/reference/crashInsourcePropertyIsRelatableToTargetProperty.js index 725409c2c7f61..31984d90fc632 100644 --- a/tests/baselines/reference/crashInsourcePropertyIsRelatableToTargetProperty.js +++ b/tests/baselines/reference/crashInsourcePropertyIsRelatableToTargetProperty.js @@ -21,13 +21,13 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var C = (function () { +var C = /** @class */ (function () { function C() { this.x = 1; } return C; }()); -var D = (function (_super) { +var D = /** @class */ (function (_super) { __extends(D, _super); function D() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/crashIntypeCheckObjectCreationExpression.js b/tests/baselines/reference/crashIntypeCheckObjectCreationExpression.js index a115e7ab0a3aa..22855b99cdf74 100644 --- a/tests/baselines/reference/crashIntypeCheckObjectCreationExpression.js +++ b/tests/baselines/reference/crashIntypeCheckObjectCreationExpression.js @@ -12,7 +12,7 @@ export class BuildWorkspaceService { define(["require", "exports"], function (require, exports) { "use strict"; exports.__esModule = true; - var BuildWorkspaceService = (function () { + var BuildWorkspaceService = /** @class */ (function () { function BuildWorkspaceService() { } BuildWorkspaceService.prototype.injectRequestService = function (service) { diff --git a/tests/baselines/reference/crashOnMethodSignatures.js b/tests/baselines/reference/crashOnMethodSignatures.js index 8444eb0280b83..ab1c3018d9fd9 100644 --- a/tests/baselines/reference/crashOnMethodSignatures.js +++ b/tests/baselines/reference/crashOnMethodSignatures.js @@ -5,7 +5,7 @@ class A { //// [crashOnMethodSignatures.js] -var A = (function () { +var A = /** @class */ (function () { function A() { } return A; diff --git a/tests/baselines/reference/crashRegressionTest.js b/tests/baselines/reference/crashRegressionTest.js index 22efbf3fba4ab..78e8fcae09992 100644 --- a/tests/baselines/reference/crashRegressionTest.js +++ b/tests/baselines/reference/crashRegressionTest.js @@ -33,7 +33,7 @@ var MsPortal; var TemplateEngine; (function (TemplateEngine) { "use strict"; - var StringTemplate = (function () { + var StringTemplate = /** @class */ (function () { function StringTemplate(templateStorage) { this._templateStorage = templateStorage; } @@ -42,7 +42,7 @@ var MsPortal; }; return StringTemplate; }()); - var TemplateStorage = (function () { + var TemplateStorage = /** @class */ (function () { function TemplateStorage() { this.templateSources = {}; this.templateData = {}; diff --git a/tests/baselines/reference/createArray.js b/tests/baselines/reference/createArray.js index 8314570c089ab..7ef4583fc5c2a 100644 --- a/tests/baselines/reference/createArray.js +++ b/tests/baselines/reference/createArray.js @@ -17,7 +17,7 @@ new C[1]; // not an error //// [createArray.js] var na = new number[]; -var C = (function () { +var C = /** @class */ (function () { function C() { } return C; diff --git a/tests/baselines/reference/customTransforms/after.js b/tests/baselines/reference/customTransforms/after.js index 63c95725f437a..8bda237545f4c 100644 --- a/tests/baselines/reference/customTransforms/after.js +++ b/tests/baselines/reference/customTransforms/after.js @@ -1,7 +1,7 @@ // [source.js] function f1() { } //@after -var c = (function () { +var c = /** @class */ (function () { function c() { } return c; diff --git a/tests/baselines/reference/customTransforms/before.js b/tests/baselines/reference/customTransforms/before.js index 4ee133afdbc78..a2729fc4529f4 100644 --- a/tests/baselines/reference/customTransforms/before.js +++ b/tests/baselines/reference/customTransforms/before.js @@ -1,7 +1,7 @@ // [source.js] /*@before*/ function f1() { } -var c = (function () { +var c = /** @class */ (function () { function c() { } return c; diff --git a/tests/baselines/reference/customTransforms/both.js b/tests/baselines/reference/customTransforms/both.js index 3013e7f8780bd..b759c76ce3816 100644 --- a/tests/baselines/reference/customTransforms/both.js +++ b/tests/baselines/reference/customTransforms/both.js @@ -2,7 +2,7 @@ /*@before*/ function f1() { } //@after -var c = (function () { +var c = /** @class */ (function () { function c() { } return c; diff --git a/tests/baselines/reference/declFileAccessors.js b/tests/baselines/reference/declFileAccessors.js index a6e47b935c3b9..c6175ec7ede0a 100644 --- a/tests/baselines/reference/declFileAccessors.js +++ b/tests/baselines/reference/declFileAccessors.js @@ -104,7 +104,7 @@ class c2 { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); /** This is comment for c1*/ -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } Object.defineProperty(c1.prototype, "p3", { @@ -187,7 +187,7 @@ var c1 = (function () { exports.c1 = c1; //// [declFileAccessors_1.js] /** This is comment for c2 - the global class*/ -var c2 = (function () { +var c2 = /** @class */ (function () { function c2() { } Object.defineProperty(c2.prototype, "p3", { diff --git a/tests/baselines/reference/declFileAliasUseBeforeDeclaration.js b/tests/baselines/reference/declFileAliasUseBeforeDeclaration.js index 2269f85996f92..c2360f3acbc1a 100644 --- a/tests/baselines/reference/declFileAliasUseBeforeDeclaration.js +++ b/tests/baselines/reference/declFileAliasUseBeforeDeclaration.js @@ -10,7 +10,7 @@ import foo = require("./declFileAliasUseBeforeDeclaration_foo"); //// [declFileAliasUseBeforeDeclaration_foo.js] "use strict"; exports.__esModule = true; -var Foo = (function () { +var Foo = /** @class */ (function () { function Foo() { } return Foo; diff --git a/tests/baselines/reference/declFileClassExtendsNull.js b/tests/baselines/reference/declFileClassExtendsNull.js index 5e2da40442b40..996808538412a 100644 --- a/tests/baselines/reference/declFileClassExtendsNull.js +++ b/tests/baselines/reference/declFileClassExtendsNull.js @@ -13,7 +13,7 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var ExtendsNull = (function (_super) { +var ExtendsNull = /** @class */ (function (_super) { __extends(ExtendsNull, _super); function ExtendsNull() { } diff --git a/tests/baselines/reference/declFileClassWithIndexSignature.js b/tests/baselines/reference/declFileClassWithIndexSignature.js index 46969b1875533..30be7262d77fd 100644 --- a/tests/baselines/reference/declFileClassWithIndexSignature.js +++ b/tests/baselines/reference/declFileClassWithIndexSignature.js @@ -4,7 +4,7 @@ class BlockIntrinsics { } //// [declFileClassWithIndexSignature.js] -var BlockIntrinsics = (function () { +var BlockIntrinsics = /** @class */ (function () { function BlockIntrinsics() { } return BlockIntrinsics; diff --git a/tests/baselines/reference/declFileClassWithStaticMethodReturningConstructor.js b/tests/baselines/reference/declFileClassWithStaticMethodReturningConstructor.js index 4ac309c1a6b21..4f790ed010cc9 100644 --- a/tests/baselines/reference/declFileClassWithStaticMethodReturningConstructor.js +++ b/tests/baselines/reference/declFileClassWithStaticMethodReturningConstructor.js @@ -8,7 +8,7 @@ export class Enhancement { //// [declFileClassWithStaticMethodReturningConstructor.js] "use strict"; exports.__esModule = true; -var Enhancement = (function () { +var Enhancement = /** @class */ (function () { function Enhancement() { } Enhancement.getType = function () { diff --git a/tests/baselines/reference/declFileConstructors.js b/tests/baselines/reference/declFileConstructors.js index 95e28cc92d649..9f5fc12e002f1 100644 --- a/tests/baselines/reference/declFileConstructors.js +++ b/tests/baselines/reference/declFileConstructors.js @@ -99,14 +99,14 @@ class GlobalConstructorWithParameterInitializer { //// [declFileConstructors_0.js] "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); -var SimpleConstructor = (function () { +var SimpleConstructor = /** @class */ (function () { /** This comment should appear for foo*/ function SimpleConstructor() { } return SimpleConstructor; }()); exports.SimpleConstructor = SimpleConstructor; -var ConstructorWithParameters = (function () { +var ConstructorWithParameters = /** @class */ (function () { /** This is comment for function signature*/ function ConstructorWithParameters(/** this is comment about a*/ a, /** this is comment for b*/ @@ -116,7 +116,7 @@ var ConstructorWithParameters = (function () { return ConstructorWithParameters; }()); exports.ConstructorWithParameters = ConstructorWithParameters; -var ConstructorWithRestParamters = (function () { +var ConstructorWithRestParamters = /** @class */ (function () { function ConstructorWithRestParamters(a) { var rests = []; for (var _i = 1; _i < arguments.length; _i++) { @@ -127,34 +127,34 @@ var ConstructorWithRestParamters = (function () { return ConstructorWithRestParamters; }()); exports.ConstructorWithRestParamters = ConstructorWithRestParamters; -var ConstructorWithOverloads = (function () { +var ConstructorWithOverloads = /** @class */ (function () { function ConstructorWithOverloads(a) { } return ConstructorWithOverloads; }()); exports.ConstructorWithOverloads = ConstructorWithOverloads; -var ConstructorWithPublicParameterProperty = (function () { +var ConstructorWithPublicParameterProperty = /** @class */ (function () { function ConstructorWithPublicParameterProperty(x) { this.x = x; } return ConstructorWithPublicParameterProperty; }()); exports.ConstructorWithPublicParameterProperty = ConstructorWithPublicParameterProperty; -var ConstructorWithPrivateParameterProperty = (function () { +var ConstructorWithPrivateParameterProperty = /** @class */ (function () { function ConstructorWithPrivateParameterProperty(x) { this.x = x; } return ConstructorWithPrivateParameterProperty; }()); exports.ConstructorWithPrivateParameterProperty = ConstructorWithPrivateParameterProperty; -var ConstructorWithOptionalParameterProperty = (function () { +var ConstructorWithOptionalParameterProperty = /** @class */ (function () { function ConstructorWithOptionalParameterProperty(x) { this.x = x; } return ConstructorWithOptionalParameterProperty; }()); exports.ConstructorWithOptionalParameterProperty = ConstructorWithOptionalParameterProperty; -var ConstructorWithParameterInitializer = (function () { +var ConstructorWithParameterInitializer = /** @class */ (function () { function ConstructorWithParameterInitializer(x) { if (x === void 0) { x = "hello"; } this.x = x; @@ -163,13 +163,13 @@ var ConstructorWithParameterInitializer = (function () { }()); exports.ConstructorWithParameterInitializer = ConstructorWithParameterInitializer; //// [declFileConstructors_1.js] -var GlobalSimpleConstructor = (function () { +var GlobalSimpleConstructor = /** @class */ (function () { /** This comment should appear for foo*/ function GlobalSimpleConstructor() { } return GlobalSimpleConstructor; }()); -var GlobalConstructorWithParameters = (function () { +var GlobalConstructorWithParameters = /** @class */ (function () { /** This is comment for function signature*/ function GlobalConstructorWithParameters(/** this is comment about a*/ a, /** this is comment for b*/ @@ -178,7 +178,7 @@ var GlobalConstructorWithParameters = (function () { } return GlobalConstructorWithParameters; }()); -var GlobalConstructorWithRestParamters = (function () { +var GlobalConstructorWithRestParamters = /** @class */ (function () { function GlobalConstructorWithRestParamters(a) { var rests = []; for (var _i = 1; _i < arguments.length; _i++) { @@ -188,30 +188,30 @@ var GlobalConstructorWithRestParamters = (function () { } return GlobalConstructorWithRestParamters; }()); -var GlobalConstructorWithOverloads = (function () { +var GlobalConstructorWithOverloads = /** @class */ (function () { function GlobalConstructorWithOverloads(a) { } return GlobalConstructorWithOverloads; }()); -var GlobalConstructorWithPublicParameterProperty = (function () { +var GlobalConstructorWithPublicParameterProperty = /** @class */ (function () { function GlobalConstructorWithPublicParameterProperty(x) { this.x = x; } return GlobalConstructorWithPublicParameterProperty; }()); -var GlobalConstructorWithPrivateParameterProperty = (function () { +var GlobalConstructorWithPrivateParameterProperty = /** @class */ (function () { function GlobalConstructorWithPrivateParameterProperty(x) { this.x = x; } return GlobalConstructorWithPrivateParameterProperty; }()); -var GlobalConstructorWithOptionalParameterProperty = (function () { +var GlobalConstructorWithOptionalParameterProperty = /** @class */ (function () { function GlobalConstructorWithOptionalParameterProperty(x) { this.x = x; } return GlobalConstructorWithOptionalParameterProperty; }()); -var GlobalConstructorWithParameterInitializer = (function () { +var GlobalConstructorWithParameterInitializer = /** @class */ (function () { function GlobalConstructorWithParameterInitializer(x) { if (x === void 0) { x = "hello"; } this.x = x; diff --git a/tests/baselines/reference/declFileExportImportChain.js b/tests/baselines/reference/declFileExportImportChain.js index fe1b36d76fa48..8a6b297f81d3f 100644 --- a/tests/baselines/reference/declFileExportImportChain.js +++ b/tests/baselines/reference/declFileExportImportChain.js @@ -30,7 +30,7 @@ define(["require", "exports"], function (require, exports) { (function (m1) { var m2; (function (m2) { - var c1 = (function () { + var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/declFileExportImportChain2.js b/tests/baselines/reference/declFileExportImportChain2.js index ec7629ebed13b..684ac2a1dfbe2 100644 --- a/tests/baselines/reference/declFileExportImportChain2.js +++ b/tests/baselines/reference/declFileExportImportChain2.js @@ -27,7 +27,7 @@ define(["require", "exports"], function (require, exports) { (function (m1) { var m2; (function (m2) { - var c1 = (function () { + var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/declFileForClassWithMultipleBaseClasses.js b/tests/baselines/reference/declFileForClassWithMultipleBaseClasses.js index a1d9f87d48358..1b2860bc8275b 100644 --- a/tests/baselines/reference/declFileForClassWithMultipleBaseClasses.js +++ b/tests/baselines/reference/declFileForClassWithMultipleBaseClasses.js @@ -27,19 +27,19 @@ interface I extends A, B { } //// [declFileForClassWithMultipleBaseClasses.js] -var A = (function () { +var A = /** @class */ (function () { function A() { } A.prototype.foo = function () { }; return A; }()); -var B = (function () { +var B = /** @class */ (function () { function B() { } B.prototype.bar = function () { }; return B; }()); -var D = (function () { +var D = /** @class */ (function () { function D() { } D.prototype.baz = function () { }; diff --git a/tests/baselines/reference/declFileForClassWithPrivateOverloadedFunction.js b/tests/baselines/reference/declFileForClassWithPrivateOverloadedFunction.js index cff015a8b29d0..d7e0579a4911e 100644 --- a/tests/baselines/reference/declFileForClassWithPrivateOverloadedFunction.js +++ b/tests/baselines/reference/declFileForClassWithPrivateOverloadedFunction.js @@ -6,7 +6,7 @@ class C { } //// [declFileForClassWithPrivateOverloadedFunction.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } C.prototype.foo = function (x) { }; diff --git a/tests/baselines/reference/declFileForFunctionTypeAsTypeParameter.js b/tests/baselines/reference/declFileForFunctionTypeAsTypeParameter.js index e97ee76d51059..6a1fb5dd393f8 100644 --- a/tests/baselines/reference/declFileForFunctionTypeAsTypeParameter.js +++ b/tests/baselines/reference/declFileForFunctionTypeAsTypeParameter.js @@ -19,12 +19,12 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var X = (function () { +var X = /** @class */ (function () { function X() { } return X; }()); -var C = (function (_super) { +var C = /** @class */ (function (_super) { __extends(C, _super); function C() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/declFileForTypeParameters.js b/tests/baselines/reference/declFileForTypeParameters.js index 4000e6301eb68..16712aee84a45 100644 --- a/tests/baselines/reference/declFileForTypeParameters.js +++ b/tests/baselines/reference/declFileForTypeParameters.js @@ -7,7 +7,7 @@ class C { } //// [declFileForTypeParameters.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } C.prototype.foo = function (a) { diff --git a/tests/baselines/reference/declFileGenericClassWithGenericExtendedClass.js b/tests/baselines/reference/declFileGenericClassWithGenericExtendedClass.js index 58d7bb774f179..513ca7b22bde9 100644 --- a/tests/baselines/reference/declFileGenericClassWithGenericExtendedClass.js +++ b/tests/baselines/reference/declFileGenericClassWithGenericExtendedClass.js @@ -23,19 +23,19 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var Base = (function () { +var Base = /** @class */ (function () { function Base() { } return Base; }()); -var Derived = (function (_super) { +var Derived = /** @class */ (function (_super) { __extends(Derived, _super); function Derived() { return _super !== null && _super.apply(this, arguments) || this; } return Derived; }(Base)); -var Baz = (function () { +var Baz = /** @class */ (function () { function Baz() { } return Baz; diff --git a/tests/baselines/reference/declFileGenericType.js b/tests/baselines/reference/declFileGenericType.js index f56abaf6b97d7..c3293852fe184 100644 --- a/tests/baselines/reference/declFileGenericType.js +++ b/tests/baselines/reference/declFileGenericType.js @@ -54,13 +54,13 @@ var __extends = (this && this.__extends) || (function () { exports.__esModule = true; var C; (function (C) { - var A = (function () { + var A = /** @class */ (function () { function A() { } return A; }()); C.A = A; - var B = (function () { + var B = /** @class */ (function () { function B() { } return B; @@ -78,7 +78,7 @@ var C; C.F5 = F5; function F6(x) { return null; } C.F6 = F6; - var D = (function () { + var D = /** @class */ (function () { function D(val) { this.val = val; } @@ -94,7 +94,7 @@ exports.x = (new C.D(new C.A())).val; function f() { } exports.f = f; exports.g = C.F5(); -var h = (function (_super) { +var h = /** @class */ (function (_super) { __extends(h, _super); function h() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/declFileGenericType2.js b/tests/baselines/reference/declFileGenericType2.js index 5abf1a74a023a..05424d0d024c5 100644 --- a/tests/baselines/reference/declFileGenericType2.js +++ b/tests/baselines/reference/declFileGenericType2.js @@ -59,7 +59,7 @@ var templa; (function (dom) { var mvc; (function (mvc) { - var AbstractElementController = (function (_super) { + var AbstractElementController = /** @class */ (function (_super) { __extends(AbstractElementController, _super); function AbstractElementController() { return _super.call(this) || this; @@ -78,7 +78,7 @@ var templa; (function (mvc) { var composite; (function (composite) { - var AbstractCompositeElementController = (function (_super) { + var AbstractCompositeElementController = /** @class */ (function (_super) { __extends(AbstractCompositeElementController, _super); function AbstractCompositeElementController() { var _this = _super.call(this) || this; diff --git a/tests/baselines/reference/declFileImportChainInExportAssignment.js b/tests/baselines/reference/declFileImportChainInExportAssignment.js index a45ae847ebe19..18bc4739f0c6a 100644 --- a/tests/baselines/reference/declFileImportChainInExportAssignment.js +++ b/tests/baselines/reference/declFileImportChainInExportAssignment.js @@ -15,7 +15,7 @@ var m; (function (m) { var c; (function (c_1) { - var c = (function () { + var c = /** @class */ (function () { function c() { } return c; diff --git a/tests/baselines/reference/declFileImportedTypeUseInTypeArgPosition.js b/tests/baselines/reference/declFileImportedTypeUseInTypeArgPosition.js index 951291115fed7..5219fcc4d282c 100644 --- a/tests/baselines/reference/declFileImportedTypeUseInTypeArgPosition.js +++ b/tests/baselines/reference/declFileImportedTypeUseInTypeArgPosition.js @@ -14,7 +14,7 @@ declare module 'moo' { //// [declFileImportedTypeUseInTypeArgPosition.js] -var List = (function () { +var List = /** @class */ (function () { function List() { } return List; diff --git a/tests/baselines/reference/declFileInternalAliases.js b/tests/baselines/reference/declFileInternalAliases.js index a21cb18ad1d9e..7e6366b99bd16 100644 --- a/tests/baselines/reference/declFileInternalAliases.js +++ b/tests/baselines/reference/declFileInternalAliases.js @@ -15,7 +15,7 @@ module m2 { //// [declFileInternalAliases.js] var m; (function (m) { - var c = (function () { + var c = /** @class */ (function () { function c() { } return c; diff --git a/tests/baselines/reference/declFileMethods.js b/tests/baselines/reference/declFileMethods.js index cc6d796e5cfc8..78af9adcd987c 100644 --- a/tests/baselines/reference/declFileMethods.js +++ b/tests/baselines/reference/declFileMethods.js @@ -192,7 +192,7 @@ interface I2 { //// [declFileMethods_0.js] "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } /** This comment should appear for foo*/ @@ -275,7 +275,7 @@ var c1 = (function () { }()); exports.c1 = c1; //// [declFileMethods_1.js] -var c2 = (function () { +var c2 = /** @class */ (function () { function c2() { } /** This comment should appear for foo*/ diff --git a/tests/baselines/reference/declFileModuleAssignmentInObjectLiteralProperty.js b/tests/baselines/reference/declFileModuleAssignmentInObjectLiteralProperty.js index 37c8f6a9999b4..7ef3f3b2b0e9a 100644 --- a/tests/baselines/reference/declFileModuleAssignmentInObjectLiteralProperty.js +++ b/tests/baselines/reference/declFileModuleAssignmentInObjectLiteralProperty.js @@ -11,7 +11,7 @@ var d = { //// [declFileModuleAssignmentInObjectLiteralProperty.js] var m1; (function (m1) { - var c = (function () { + var c = /** @class */ (function () { function c() { } return c; diff --git a/tests/baselines/reference/declFileModuleContinuation.js b/tests/baselines/reference/declFileModuleContinuation.js index 98235e830b5f0..08032aa114dd4 100644 --- a/tests/baselines/reference/declFileModuleContinuation.js +++ b/tests/baselines/reference/declFileModuleContinuation.js @@ -16,7 +16,7 @@ var A; (function (B) { var C; (function (C) { - var W = (function () { + var W = /** @class */ (function () { function W() { } return W; diff --git a/tests/baselines/reference/declFileModuleWithPropertyOfTypeModule.js b/tests/baselines/reference/declFileModuleWithPropertyOfTypeModule.js index 1f1f2c78ff3bd..eb007161c6fb4 100644 --- a/tests/baselines/reference/declFileModuleWithPropertyOfTypeModule.js +++ b/tests/baselines/reference/declFileModuleWithPropertyOfTypeModule.js @@ -9,7 +9,7 @@ module m { //// [declFileModuleWithPropertyOfTypeModule.js] var m; (function (m) { - var c = (function () { + var c = /** @class */ (function () { function c() { } return c; diff --git a/tests/baselines/reference/declFilePrivateMethodOverloads.js b/tests/baselines/reference/declFilePrivateMethodOverloads.js index f2203d8d770f4..1a8215dced71e 100644 --- a/tests/baselines/reference/declFilePrivateMethodOverloads.js +++ b/tests/baselines/reference/declFilePrivateMethodOverloads.js @@ -23,7 +23,7 @@ declare class c2 { } //// [declFilePrivateMethodOverloads.js] -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } c1.prototype._forEachBindingContext = function (context, fn) { diff --git a/tests/baselines/reference/declFilePrivateStatic.js b/tests/baselines/reference/declFilePrivateStatic.js index 409e2f21b42ba..78be32e356e47 100644 --- a/tests/baselines/reference/declFilePrivateStatic.js +++ b/tests/baselines/reference/declFilePrivateStatic.js @@ -14,7 +14,7 @@ class C { } //// [declFilePrivateStatic.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } C.a = function () { }; diff --git a/tests/baselines/reference/declFileTypeAnnotationArrayType.js b/tests/baselines/reference/declFileTypeAnnotationArrayType.js index 53a5ac59a4787..5f97bc8ce54c7 100644 --- a/tests/baselines/reference/declFileTypeAnnotationArrayType.js +++ b/tests/baselines/reference/declFileTypeAnnotationArrayType.js @@ -51,27 +51,27 @@ function foo10() { } //// [declFileTypeAnnotationArrayType.js] -var c = (function () { +var c = /** @class */ (function () { function c() { } return c; }()); var m; (function (m) { - var c = (function () { + var c = /** @class */ (function () { function c() { } return c; }()); m.c = c; - var g = (function () { + var g = /** @class */ (function () { function g() { } return g; }()); m.g = g; })(m || (m = {})); -var g = (function () { +var g = /** @class */ (function () { function g() { } return g; diff --git a/tests/baselines/reference/declFileTypeAnnotationParenType.js b/tests/baselines/reference/declFileTypeAnnotationParenType.js index e867f2069c4e4..0a0a6c1b25709 100644 --- a/tests/baselines/reference/declFileTypeAnnotationParenType.js +++ b/tests/baselines/reference/declFileTypeAnnotationParenType.js @@ -10,7 +10,7 @@ var k: (() => c) | string = (() => new c()) || ""; var l = (() => new c()) || ""; //// [declFileTypeAnnotationParenType.js] -var c = (function () { +var c = /** @class */ (function () { function c() { } return c; diff --git a/tests/baselines/reference/declFileTypeAnnotationTupleType.js b/tests/baselines/reference/declFileTypeAnnotationTupleType.js index f4f1a32c8c095..dd37502ac0078 100644 --- a/tests/baselines/reference/declFileTypeAnnotationTupleType.js +++ b/tests/baselines/reference/declFileTypeAnnotationTupleType.js @@ -18,27 +18,27 @@ var x: [g, m.g, () => c] = [new g(), new m.g(), var y = x; //// [declFileTypeAnnotationTupleType.js] -var c = (function () { +var c = /** @class */ (function () { function c() { } return c; }()); var m; (function (m) { - var c = (function () { + var c = /** @class */ (function () { function c() { } return c; }()); m.c = c; - var g = (function () { + var g = /** @class */ (function () { function g() { } return g; }()); m.g = g; })(m || (m = {})); -var g = (function () { +var g = /** @class */ (function () { function g() { } return g; diff --git a/tests/baselines/reference/declFileTypeAnnotationTypeAlias.js b/tests/baselines/reference/declFileTypeAnnotationTypeAlias.js index 1ca73a7889117..3c85b86f6e81e 100644 --- a/tests/baselines/reference/declFileTypeAnnotationTypeAlias.js +++ b/tests/baselines/reference/declFileTypeAnnotationTypeAlias.js @@ -33,7 +33,7 @@ module M { //// [declFileTypeAnnotationTypeAlias.js] var M; (function (M) { - var c = (function () { + var c = /** @class */ (function () { function c() { } return c; @@ -41,7 +41,7 @@ var M; M.c = c; var m; (function (m) { - var c = (function () { + var c = /** @class */ (function () { function c() { } return c; @@ -52,7 +52,7 @@ var M; (function (M) { var N; (function (N) { - var Window = (function () { + var Window = /** @class */ (function () { function Window() { } return Window; diff --git a/tests/baselines/reference/declFileTypeAnnotationTypeLiteral.js b/tests/baselines/reference/declFileTypeAnnotationTypeLiteral.js index f2247e8daa982..e41ef4be9812a 100644 --- a/tests/baselines/reference/declFileTypeAnnotationTypeLiteral.js +++ b/tests/baselines/reference/declFileTypeAnnotationTypeLiteral.js @@ -39,19 +39,19 @@ var y: (a: string) => string; var z: new (a: string) => m.c; //// [declFileTypeAnnotationTypeLiteral.js] -var c = (function () { +var c = /** @class */ (function () { function c() { } return c; }()); -var g = (function () { +var g = /** @class */ (function () { function g() { } return g; }()); var m; (function (m) { - var c = (function () { + var c = /** @class */ (function () { function c() { } return c; diff --git a/tests/baselines/reference/declFileTypeAnnotationTypeQuery.js b/tests/baselines/reference/declFileTypeAnnotationTypeQuery.js index e2d6fee1f4ff9..ec34fbc0c965d 100644 --- a/tests/baselines/reference/declFileTypeAnnotationTypeQuery.js +++ b/tests/baselines/reference/declFileTypeAnnotationTypeQuery.js @@ -43,27 +43,27 @@ function foo8() { } //// [declFileTypeAnnotationTypeQuery.js] -var c = (function () { +var c = /** @class */ (function () { function c() { } return c; }()); var m; (function (m) { - var c = (function () { + var c = /** @class */ (function () { function c() { } return c; }()); m.c = c; - var g = (function () { + var g = /** @class */ (function () { function g() { } return g; }()); m.g = g; })(m || (m = {})); -var g = (function () { +var g = /** @class */ (function () { function g() { } return g; diff --git a/tests/baselines/reference/declFileTypeAnnotationTypeReference.js b/tests/baselines/reference/declFileTypeAnnotationTypeReference.js index 7eebd30e54bf7..abec702b33bfc 100644 --- a/tests/baselines/reference/declFileTypeAnnotationTypeReference.js +++ b/tests/baselines/reference/declFileTypeAnnotationTypeReference.js @@ -43,27 +43,27 @@ function foo8() { } //// [declFileTypeAnnotationTypeReference.js] -var c = (function () { +var c = /** @class */ (function () { function c() { } return c; }()); var m; (function (m) { - var c = (function () { + var c = /** @class */ (function () { function c() { } return c; }()); m.c = c; - var g = (function () { + var g = /** @class */ (function () { function g() { } return g; }()); m.g = g; })(m || (m = {})); -var g = (function () { +var g = /** @class */ (function () { function g() { } return g; diff --git a/tests/baselines/reference/declFileTypeAnnotationUnionType.js b/tests/baselines/reference/declFileTypeAnnotationUnionType.js index b821d15269cc6..85735ff96cf2e 100644 --- a/tests/baselines/reference/declFileTypeAnnotationUnionType.js +++ b/tests/baselines/reference/declFileTypeAnnotationUnionType.js @@ -22,27 +22,27 @@ var x: g | m.g | (() => c) = new g() || new m.g() || new m.g() || (() => new c()); //// [declFileTypeAnnotationUnionType.js] -var c = (function () { +var c = /** @class */ (function () { function c() { } return c; }()); var m; (function (m) { - var c = (function () { + var c = /** @class */ (function () { function c() { } return c; }()); m.c = c; - var g = (function () { + var g = /** @class */ (function () { function g() { } return g; }()); m.g = g; })(m || (m = {})); -var g = (function () { +var g = /** @class */ (function () { function g() { } return g; diff --git a/tests/baselines/reference/declFileTypeAnnotationVisibilityErrorAccessors.js b/tests/baselines/reference/declFileTypeAnnotationVisibilityErrorAccessors.js index be777c3e8ba1e..2d4d948668a0b 100644 --- a/tests/baselines/reference/declFileTypeAnnotationVisibilityErrorAccessors.js +++ b/tests/baselines/reference/declFileTypeAnnotationVisibilityErrorAccessors.js @@ -102,12 +102,12 @@ module m { //// [declFileTypeAnnotationVisibilityErrorAccessors.js] var m; (function (m) { - var private1 = (function () { + var private1 = /** @class */ (function () { function private1() { } return private1; }()); - var public1 = (function () { + var public1 = /** @class */ (function () { function public1() { } return public1; @@ -115,14 +115,14 @@ var m; m.public1 = public1; var m2; (function (m2) { - var public2 = (function () { + var public2 = /** @class */ (function () { function public2() { } return public2; }()); m2.public2 = public2; })(m2 || (m2 = {})); - var c = (function () { + var c = /** @class */ (function () { function c() { } Object.defineProperty(c.prototype, "foo1", { diff --git a/tests/baselines/reference/declFileTypeAnnotationVisibilityErrorParameterOfFunction.js b/tests/baselines/reference/declFileTypeAnnotationVisibilityErrorParameterOfFunction.js index 25b59845c14d6..1c4a27cee6142 100644 --- a/tests/baselines/reference/declFileTypeAnnotationVisibilityErrorParameterOfFunction.js +++ b/tests/baselines/reference/declFileTypeAnnotationVisibilityErrorParameterOfFunction.js @@ -47,12 +47,12 @@ module m { //// [declFileTypeAnnotationVisibilityErrorParameterOfFunction.js] var m; (function (m) { - var private1 = (function () { + var private1 = /** @class */ (function () { function private1() { } return private1; }()); - var public1 = (function () { + var public1 = /** @class */ (function () { function public1() { } return public1; @@ -85,7 +85,7 @@ var m; m.foo14 = foo14; var m2; (function (m2) { - var public2 = (function () { + var public2 = /** @class */ (function () { function public2() { } return public2; diff --git a/tests/baselines/reference/declFileTypeAnnotationVisibilityErrorReturnTypeOfFunction.js b/tests/baselines/reference/declFileTypeAnnotationVisibilityErrorReturnTypeOfFunction.js index 6cc74c0188ad3..a0e43b6521dcd 100644 --- a/tests/baselines/reference/declFileTypeAnnotationVisibilityErrorReturnTypeOfFunction.js +++ b/tests/baselines/reference/declFileTypeAnnotationVisibilityErrorReturnTypeOfFunction.js @@ -59,12 +59,12 @@ module m { //// [declFileTypeAnnotationVisibilityErrorReturnTypeOfFunction.js] var m; (function (m) { - var private1 = (function () { + var private1 = /** @class */ (function () { function private1() { } return private1; }()); - var public1 = (function () { + var public1 = /** @class */ (function () { function public1() { } return public1; @@ -101,7 +101,7 @@ var m; m.foo14 = foo14; var m2; (function (m2) { - var public2 = (function () { + var public2 = /** @class */ (function () { function public2() { } return public2; diff --git a/tests/baselines/reference/declFileTypeAnnotationVisibilityErrorTypeAlias.js b/tests/baselines/reference/declFileTypeAnnotationVisibilityErrorTypeAlias.js index 811ee0575fe0f..2d1e3d1880eac 100644 --- a/tests/baselines/reference/declFileTypeAnnotationVisibilityErrorTypeAlias.js +++ b/tests/baselines/reference/declFileTypeAnnotationVisibilityErrorTypeAlias.js @@ -45,7 +45,7 @@ var M; (function (M) { var N; (function (N) { - var Window = (function () { + var Window = /** @class */ (function () { function Window() { } return Window; @@ -57,7 +57,7 @@ var M1; (function (M1) { var N; (function (N) { - var Window = (function () { + var Window = /** @class */ (function () { function Window() { } return Window; @@ -67,19 +67,19 @@ var M1; })(M1 || (M1 = {})); var M2; (function (M2) { - var private1 = (function () { + var private1 = /** @class */ (function () { function private1() { } return private1; }()); - var public1 = (function () { + var public1 = /** @class */ (function () { function public1() { } return public1; }()); var m3; (function (m3) { - var public1 = (function () { + var public1 = /** @class */ (function () { function public1() { } return public1; diff --git a/tests/baselines/reference/declFileTypeAnnotationVisibilityErrorTypeLiteral.js b/tests/baselines/reference/declFileTypeAnnotationVisibilityErrorTypeLiteral.js index 41f1a094eae10..687ab02fdb6ac 100644 --- a/tests/baselines/reference/declFileTypeAnnotationVisibilityErrorTypeLiteral.js +++ b/tests/baselines/reference/declFileTypeAnnotationVisibilityErrorTypeLiteral.js @@ -36,14 +36,14 @@ module m { //// [declFileTypeAnnotationVisibilityErrorTypeLiteral.js] var m; (function (m) { - var private1 = (function () { + var private1 = /** @class */ (function () { function private1() { } return private1; }()); var m2; (function (m2) { - var public1 = (function () { + var public1 = /** @class */ (function () { function public1() { } return public1; diff --git a/tests/baselines/reference/declFileTypeAnnotationVisibilityErrorVariableDeclaration.js b/tests/baselines/reference/declFileTypeAnnotationVisibilityErrorVariableDeclaration.js index 414a949ce9359..56f959a135616 100644 --- a/tests/baselines/reference/declFileTypeAnnotationVisibilityErrorVariableDeclaration.js +++ b/tests/baselines/reference/declFileTypeAnnotationVisibilityErrorVariableDeclaration.js @@ -35,12 +35,12 @@ module m { //// [declFileTypeAnnotationVisibilityErrorVariableDeclaration.js] var m; (function (m) { - var private1 = (function () { + var private1 = /** @class */ (function () { function private1() { } return private1; }()); - var public1 = (function () { + var public1 = /** @class */ (function () { function public1() { } return public1; @@ -55,7 +55,7 @@ var m; m.l2 = new public1(); var m2; (function (m2) { - var public2 = (function () { + var public2 = /** @class */ (function () { function public2() { } return public2; diff --git a/tests/baselines/reference/declFileTypeofClass.js b/tests/baselines/reference/declFileTypeofClass.js index 03ed0febe733b..4339e07cfea95 100644 --- a/tests/baselines/reference/declFileTypeofClass.js +++ b/tests/baselines/reference/declFileTypeofClass.js @@ -16,7 +16,7 @@ var genericX = genericC; //// [declFileTypeofClass.js] -var c = (function () { +var c = /** @class */ (function () { function c() { } return c; @@ -24,7 +24,7 @@ var c = (function () { var x; var y = c; var z; -var genericC = (function () { +var genericC = /** @class */ (function () { function genericC() { } return genericC; diff --git a/tests/baselines/reference/declFileTypeofInAnonymousType.js b/tests/baselines/reference/declFileTypeofInAnonymousType.js index 059812e9f49de..214717c248681 100644 --- a/tests/baselines/reference/declFileTypeofInAnonymousType.js +++ b/tests/baselines/reference/declFileTypeofInAnonymousType.js @@ -24,7 +24,7 @@ var d = { //// [declFileTypeofInAnonymousType.js] var m1; (function (m1) { - var c = (function () { + var c = /** @class */ (function () { function c() { } return c; diff --git a/tests/baselines/reference/declFileWithClassNameConflictingWithClassReferredByExtendsClause.js b/tests/baselines/reference/declFileWithClassNameConflictingWithClassReferredByExtendsClause.js index ae82eec471484..b7500afdd2682 100644 --- a/tests/baselines/reference/declFileWithClassNameConflictingWithClassReferredByExtendsClause.js +++ b/tests/baselines/reference/declFileWithClassNameConflictingWithClassReferredByExtendsClause.js @@ -36,7 +36,7 @@ var X; (function (Y) { var base; (function (base) { - var W = (function (_super) { + var W = /** @class */ (function (_super) { __extends(W, _super); function W() { return _super !== null && _super.apply(this, arguments) || this; @@ -54,7 +54,7 @@ var X; (function (base) { var Z; (function (Z) { - var W = (function (_super) { + var W = /** @class */ (function (_super) { __extends(W, _super); function W() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/declFileWithExtendsClauseThatHasItsContainerNameConflict.js b/tests/baselines/reference/declFileWithExtendsClauseThatHasItsContainerNameConflict.js index 95ec6eeab32eb..15394b25105d6 100644 --- a/tests/baselines/reference/declFileWithExtendsClauseThatHasItsContainerNameConflict.js +++ b/tests/baselines/reference/declFileWithExtendsClauseThatHasItsContainerNameConflict.js @@ -32,7 +32,7 @@ var A; (function (A) { var B; (function (B) { - var EventManager = (function () { + var EventManager = /** @class */ (function () { function EventManager() { } return EventManager; @@ -45,7 +45,7 @@ var A; (function (B) { var C; (function (C) { - var ContextMenu = (function (_super) { + var ContextMenu = /** @class */ (function (_super) { __extends(ContextMenu, _super); function ContextMenu() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/declFileWithInternalModuleNameConflictsInExtendsClause1.js b/tests/baselines/reference/declFileWithInternalModuleNameConflictsInExtendsClause1.js index 7b1690273207a..f6f849a6a24cb 100644 --- a/tests/baselines/reference/declFileWithInternalModuleNameConflictsInExtendsClause1.js +++ b/tests/baselines/reference/declFileWithInternalModuleNameConflictsInExtendsClause1.js @@ -19,7 +19,7 @@ var X; (function (B) { var C; (function (C) { - var W = (function () { + var W = /** @class */ (function () { function W() { } return W; diff --git a/tests/baselines/reference/declFileWithInternalModuleNameConflictsInExtendsClause2.js b/tests/baselines/reference/declFileWithInternalModuleNameConflictsInExtendsClause2.js index b2dce928df77e..3e363990b6d61 100644 --- a/tests/baselines/reference/declFileWithInternalModuleNameConflictsInExtendsClause2.js +++ b/tests/baselines/reference/declFileWithInternalModuleNameConflictsInExtendsClause2.js @@ -22,7 +22,7 @@ var X; (function (B) { var C; (function (C) { - var W = (function () { + var W = /** @class */ (function () { function W() { } return W; diff --git a/tests/baselines/reference/declFileWithInternalModuleNameConflictsInExtendsClause3.js b/tests/baselines/reference/declFileWithInternalModuleNameConflictsInExtendsClause3.js index debc55565a139..73c1a0b322789 100644 --- a/tests/baselines/reference/declFileWithInternalModuleNameConflictsInExtendsClause3.js +++ b/tests/baselines/reference/declFileWithInternalModuleNameConflictsInExtendsClause3.js @@ -22,7 +22,7 @@ var X; (function (B) { var C; (function (C) { - var W = (function () { + var W = /** @class */ (function () { function W() { } return W; diff --git a/tests/baselines/reference/declInput-2.js b/tests/baselines/reference/declInput-2.js index eece6082356b2..02dc3cd281959 100644 --- a/tests/baselines/reference/declInput-2.js +++ b/tests/baselines/reference/declInput-2.js @@ -24,18 +24,18 @@ module M { //// [declInput-2.js] var M; (function (M) { - var C = (function () { + var C = /** @class */ (function () { function C() { } return C; }()); - var E = (function () { + var E = /** @class */ (function () { function E() { } return E; }()); M.E = E; - var D = (function () { + var D = /** @class */ (function () { function D() { } D.prototype.m232 = function () { return null; }; diff --git a/tests/baselines/reference/declInput.js b/tests/baselines/reference/declInput.js index 1f29093d0a848..1b73e581dc007 100644 --- a/tests/baselines/reference/declInput.js +++ b/tests/baselines/reference/declInput.js @@ -11,7 +11,7 @@ class bar { //// [declInput.js] -var bar = (function () { +var bar = /** @class */ (function () { function bar() { } bar.prototype.f = function () { return ''; }; diff --git a/tests/baselines/reference/declInput3.js b/tests/baselines/reference/declInput3.js index 292023270aec6..c8606d6a3ac99 100644 --- a/tests/baselines/reference/declInput3.js +++ b/tests/baselines/reference/declInput3.js @@ -11,7 +11,7 @@ class bar { //// [declInput3.js] -var bar = (function () { +var bar = /** @class */ (function () { function bar() { } bar.prototype.f = function () { return ''; }; diff --git a/tests/baselines/reference/declInput4.js b/tests/baselines/reference/declInput4.js index ec57bfaf3e840..c27c39cb4a3d8 100644 --- a/tests/baselines/reference/declInput4.js +++ b/tests/baselines/reference/declInput4.js @@ -18,18 +18,18 @@ module M { //// [declInput4.js] var M; (function (M) { - var C = (function () { + var C = /** @class */ (function () { function C() { } return C; }()); - var E = (function () { + var E = /** @class */ (function () { function E() { } return E; }()); M.E = E; - var D = (function () { + var D = /** @class */ (function () { function D() { } D.prototype.m232 = function () { return null; }; diff --git a/tests/baselines/reference/declarationEmitClassMemberNameConflict.js b/tests/baselines/reference/declarationEmitClassMemberNameConflict.js index 200ca70d79f47..77732ea94f889 100644 --- a/tests/baselines/reference/declarationEmitClassMemberNameConflict.js +++ b/tests/baselines/reference/declarationEmitClassMemberNameConflict.js @@ -38,7 +38,7 @@ export class C4 { //// [declarationEmitClassMemberNameConflict.js] "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); -var C1 = (function () { +var C1 = /** @class */ (function () { function C1() { } C1.prototype.C1 = function () { }; // has to be the same as the class name @@ -49,7 +49,7 @@ var C1 = (function () { return C1; }()); exports.C1 = C1; -var C2 = (function () { +var C2 = /** @class */ (function () { function C2() { } C2.prototype.bar = function () { @@ -59,7 +59,7 @@ var C2 = (function () { return C2; }()); exports.C2 = C2; -var C3 = (function () { +var C3 = /** @class */ (function () { function C3() { } Object.defineProperty(C3.prototype, "C3", { @@ -75,7 +75,7 @@ var C3 = (function () { return C3; }()); exports.C3 = C3; -var C4 = (function () { +var C4 = /** @class */ (function () { function C4() { } Object.defineProperty(C4.prototype, "C4", { diff --git a/tests/baselines/reference/declarationEmitClassMemberNameConflict2.js b/tests/baselines/reference/declarationEmitClassMemberNameConflict2.js index 34ed145b6f3eb..42945116527ea 100644 --- a/tests/baselines/reference/declarationEmitClassMemberNameConflict2.js +++ b/tests/baselines/reference/declarationEmitClassMemberNameConflict2.js @@ -30,7 +30,7 @@ var Hello1; (function (Hello1) { Hello1[Hello1["World1"] = 0] = "World1"; })(Hello1 || (Hello1 = {})); -var Foo = (function () { +var Foo = /** @class */ (function () { function Foo() { // Same names + string => OK this.Bar = Bar; diff --git a/tests/baselines/reference/declarationEmitClassPrivateConstructor.js b/tests/baselines/reference/declarationEmitClassPrivateConstructor.js index 6cc6596498759..a1c42947a9653 100644 --- a/tests/baselines/reference/declarationEmitClassPrivateConstructor.js +++ b/tests/baselines/reference/declarationEmitClassPrivateConstructor.js @@ -21,20 +21,20 @@ export class ExportedClass4 { //// [declarationEmitClassPrivateConstructor.js] "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); -var ExportedClass1 = (function () { +var ExportedClass1 = /** @class */ (function () { function ExportedClass1(data) { } return ExportedClass1; }()); exports.ExportedClass1 = ExportedClass1; -var ExportedClass2 = (function () { +var ExportedClass2 = /** @class */ (function () { function ExportedClass2(data) { this.data = data; } return ExportedClass2; }()); exports.ExportedClass2 = ExportedClass2; -var ExportedClass3 = (function () { +var ExportedClass3 = /** @class */ (function () { function ExportedClass3(data, n) { this.data = data; this.n = n; @@ -42,7 +42,7 @@ var ExportedClass3 = (function () { return ExportedClass3; }()); exports.ExportedClass3 = ExportedClass3; -var ExportedClass4 = (function () { +var ExportedClass4 = /** @class */ (function () { function ExportedClass4(data, n) { this.data = data; this.n = n; diff --git a/tests/baselines/reference/declarationEmitClassPrivateConstructor2.js b/tests/baselines/reference/declarationEmitClassPrivateConstructor2.js index 8b7ad25a6bfa0..863b295751f0b 100644 --- a/tests/baselines/reference/declarationEmitClassPrivateConstructor2.js +++ b/tests/baselines/reference/declarationEmitClassPrivateConstructor2.js @@ -14,14 +14,14 @@ export class ExportedClass2 { //// [declarationEmitClassPrivateConstructor2.js] "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); -var ExportedClass1 = (function () { +var ExportedClass1 = /** @class */ (function () { function ExportedClass1(data) { this.data = data; } return ExportedClass1; }()); exports.ExportedClass1 = ExportedClass1; -var ExportedClass2 = (function () { +var ExportedClass2 = /** @class */ (function () { function ExportedClass2(data) { } return ExportedClass2; diff --git a/tests/baselines/reference/declarationEmitDestructuringParameterProperties.js b/tests/baselines/reference/declarationEmitDestructuringParameterProperties.js index 22868b0ae000e..032722208cf3e 100644 --- a/tests/baselines/reference/declarationEmitDestructuringParameterProperties.js +++ b/tests/baselines/reference/declarationEmitDestructuringParameterProperties.js @@ -17,19 +17,19 @@ class C3 { } //// [declarationEmitDestructuringParameterProperties.js] -var C1 = (function () { +var C1 = /** @class */ (function () { function C1(_a) { var x = _a[0], y = _a[1], z = _a[2]; } return C1; }()); -var C2 = (function () { +var C2 = /** @class */ (function () { function C2(_a) { var x = _a[0], y = _a[1], z = _a[2]; } return C2; }()); -var C3 = (function () { +var C3 = /** @class */ (function () { function C3(_a) { var x = _a.x, y = _a.y, z = _a.z; } diff --git a/tests/baselines/reference/declarationEmitDestructuringPrivacyError.js b/tests/baselines/reference/declarationEmitDestructuringPrivacyError.js index 7f62541ae995e..23b93d14e15bc 100644 --- a/tests/baselines/reference/declarationEmitDestructuringPrivacyError.js +++ b/tests/baselines/reference/declarationEmitDestructuringPrivacyError.js @@ -8,7 +8,7 @@ module m { //// [declarationEmitDestructuringPrivacyError.js] var m; (function (m) { - var c = (function () { + var c = /** @class */ (function () { function c() { } return c; diff --git a/tests/baselines/reference/declarationEmitDetachedComment1.js b/tests/baselines/reference/declarationEmitDetachedComment1.js index 7f3bcea93c86f..6bc4f50a4a47a 100644 --- a/tests/baselines/reference/declarationEmitDetachedComment1.js +++ b/tests/baselines/reference/declarationEmitDetachedComment1.js @@ -36,7 +36,7 @@ class Hola { /** * Hello class */ -var Hello = (function () { +var Hello = /** @class */ (function () { function Hello() { } return Hello; @@ -46,7 +46,7 @@ var Hello = (function () { /** * Hi class */ -var Hi = (function () { +var Hi = /** @class */ (function () { function Hi() { } return Hi; @@ -56,7 +56,7 @@ var Hi = (function () { /** * Hola class */ -var Hola = (function () { +var Hola = /** @class */ (function () { function Hola() { } return Hola; diff --git a/tests/baselines/reference/declarationEmitExpressionInExtends.js b/tests/baselines/reference/declarationEmitExpressionInExtends.js index 2c659ce901866..d31e0aa90d6ec 100644 --- a/tests/baselines/reference/declarationEmitExpressionInExtends.js +++ b/tests/baselines/reference/declarationEmitExpressionInExtends.js @@ -25,12 +25,12 @@ var __extends = (this && this.__extends) || (function () { }; })(); var x; -var Q = (function () { +var Q = /** @class */ (function () { function Q() { } return Q; }()); -var B = (function (_super) { +var B = /** @class */ (function (_super) { __extends(B, _super); function B() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/declarationEmitExpressionInExtends2.js b/tests/baselines/reference/declarationEmitExpressionInExtends2.js index a49175a3dc47b..1d72ac9a3fb95 100644 --- a/tests/baselines/reference/declarationEmitExpressionInExtends2.js +++ b/tests/baselines/reference/declarationEmitExpressionInExtends2.js @@ -22,7 +22,7 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var C = (function () { +var C = /** @class */ (function () { function C() { } return C; @@ -30,7 +30,7 @@ var C = (function () { function getClass(c) { return C; } -var MyClass = (function (_super) { +var MyClass = /** @class */ (function (_super) { __extends(MyClass, _super); function MyClass() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/declarationEmitExpressionInExtends3.js b/tests/baselines/reference/declarationEmitExpressionInExtends3.js index 7cc58772ec23f..c97587620fd7e 100644 --- a/tests/baselines/reference/declarationEmitExpressionInExtends3.js +++ b/tests/baselines/reference/declarationEmitExpressionInExtends3.js @@ -55,13 +55,13 @@ var __extends = (this && this.__extends) || (function () { }; })(); exports.__esModule = true; -var ExportedClass = (function () { +var ExportedClass = /** @class */ (function () { function ExportedClass() { } return ExportedClass; }()); exports.ExportedClass = ExportedClass; -var LocalClass = (function () { +var LocalClass = /** @class */ (function () { function LocalClass() { } return LocalClass; @@ -72,7 +72,7 @@ function getLocalClass(c) { function getExportedClass(c) { return ExportedClass; } -var MyClass = (function (_super) { +var MyClass = /** @class */ (function (_super) { __extends(MyClass, _super); function MyClass() { return _super !== null && _super.apply(this, arguments) || this; @@ -80,7 +80,7 @@ var MyClass = (function (_super) { return MyClass; }(getLocalClass(undefined))); exports.MyClass = MyClass; -var MyClass2 = (function (_super) { +var MyClass2 = /** @class */ (function (_super) { __extends(MyClass2, _super); function MyClass2() { return _super !== null && _super.apply(this, arguments) || this; @@ -88,7 +88,7 @@ var MyClass2 = (function (_super) { return MyClass2; }(getExportedClass(undefined))); exports.MyClass2 = MyClass2; -var MyClass3 = (function (_super) { +var MyClass3 = /** @class */ (function (_super) { __extends(MyClass3, _super); function MyClass3() { return _super !== null && _super.apply(this, arguments) || this; @@ -96,7 +96,7 @@ var MyClass3 = (function (_super) { return MyClass3; }(getExportedClass(undefined))); exports.MyClass3 = MyClass3; -var MyClass4 = (function (_super) { +var MyClass4 = /** @class */ (function (_super) { __extends(MyClass4, _super); function MyClass4() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/declarationEmitExpressionInExtends4.js b/tests/baselines/reference/declarationEmitExpressionInExtends4.js index 4acfff77831b5..3b1309dc0d09f 100644 --- a/tests/baselines/reference/declarationEmitExpressionInExtends4.js +++ b/tests/baselines/reference/declarationEmitExpressionInExtends4.js @@ -28,27 +28,27 @@ var __extends = (this && this.__extends) || (function () { }; })(); function getSomething() { - return (function () { + return /** @class */ (function () { function D() { } return D; }()); } -var C = (function (_super) { +var C = /** @class */ (function (_super) { __extends(C, _super); function C() { return _super !== null && _super.apply(this, arguments) || this; } return C; }(getSomething())); -var C2 = (function (_super) { +var C2 = /** @class */ (function (_super) { __extends(C2, _super); function C2() { return _super !== null && _super.apply(this, arguments) || this; } return C2; }(SomeUndefinedFunction())); -var C3 = (function (_super) { +var C3 = /** @class */ (function (_super) { __extends(C3, _super); function C3() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/declarationEmitExpressionInExtends5.js b/tests/baselines/reference/declarationEmitExpressionInExtends5.js index 77f8fc0e12c00..6e2ecb805cd5f 100644 --- a/tests/baselines/reference/declarationEmitExpressionInExtends5.js +++ b/tests/baselines/reference/declarationEmitExpressionInExtends5.js @@ -33,13 +33,13 @@ var __extends = (this && this.__extends) || (function () { })(); var Test; (function (Test) { - var SomeClass = (function () { + var SomeClass = /** @class */ (function () { function SomeClass() { } return SomeClass; }()); Test.SomeClass = SomeClass; - var Derived = (function (_super) { + var Derived = /** @class */ (function (_super) { __extends(Derived, _super); function Derived() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/declarationEmitImportInExportAssignmentModule.js b/tests/baselines/reference/declarationEmitImportInExportAssignmentModule.js index f9137f4f02b49..0e28eee781d9c 100644 --- a/tests/baselines/reference/declarationEmitImportInExportAssignmentModule.js +++ b/tests/baselines/reference/declarationEmitImportInExportAssignmentModule.js @@ -15,7 +15,7 @@ var m; (function (m) { var c; (function (c_1) { - var c = (function () { + var c = /** @class */ (function () { function c() { } return c; diff --git a/tests/baselines/reference/declarationEmitInterfaceWithNonEntityNameExpressionHeritage.js b/tests/baselines/reference/declarationEmitInterfaceWithNonEntityNameExpressionHeritage.js index fc50955c4e5cf..2d92eb3cb5ecf 100644 --- a/tests/baselines/reference/declarationEmitInterfaceWithNonEntityNameExpressionHeritage.js +++ b/tests/baselines/reference/declarationEmitInterfaceWithNonEntityNameExpressionHeritage.js @@ -3,7 +3,7 @@ class A { } interface Class extends (typeof A) { } //// [declarationEmitInterfaceWithNonEntityNameExpressionHeritage.js] -var A = (function () { +var A = /** @class */ (function () { function A() { } return A; diff --git a/tests/baselines/reference/declarationEmitNameConflicts.js b/tests/baselines/reference/declarationEmitNameConflicts.js index 5440f3d358400..57b11a88afbdd 100644 --- a/tests/baselines/reference/declarationEmitNameConflicts.js +++ b/tests/baselines/reference/declarationEmitNameConflicts.js @@ -53,7 +53,7 @@ export module M.Q { "use strict"; var f; (function (f) { - var c = (function () { + var c = /** @class */ (function () { function c() { } return c; @@ -69,7 +69,7 @@ var M; (function (M) { function f() { } M.f = f; - var C = (function () { + var C = /** @class */ (function () { function C() { } return C; @@ -91,7 +91,7 @@ var M; (function (P) { function f() { } P.f = f; - var C = (function () { + var C = /** @class */ (function () { function C() { } return C; @@ -116,7 +116,7 @@ var M; (function (Q) { function f() { } Q.f = f; - var C = (function () { + var C = /** @class */ (function () { function C() { } return C; diff --git a/tests/baselines/reference/declarationEmitNameConflicts2.js b/tests/baselines/reference/declarationEmitNameConflicts2.js index 05529fbf5befe..d0c111c56b785 100644 --- a/tests/baselines/reference/declarationEmitNameConflicts2.js +++ b/tests/baselines/reference/declarationEmitNameConflicts2.js @@ -24,7 +24,7 @@ var X; (function (base) { function f() { } base.f = f; - var C = (function () { + var C = /** @class */ (function () { function C() { } return C; diff --git a/tests/baselines/reference/declarationEmitNameConflicts3.js b/tests/baselines/reference/declarationEmitNameConflicts3.js index f093ff5b3b24f..f9c1d6266b03e 100644 --- a/tests/baselines/reference/declarationEmitNameConflicts3.js +++ b/tests/baselines/reference/declarationEmitNameConflicts3.js @@ -58,14 +58,14 @@ var M; (function (M) { var P; (function (P) { - var C = (function () { + var C = /** @class */ (function () { function C() { } C.f = function () { }; return C; }()); P.C = C; - var E = (function (_super) { + var E = /** @class */ (function (_super) { __extends(E, _super); function E() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/declarationEmitParameterProperty.js b/tests/baselines/reference/declarationEmitParameterProperty.js index 262222e3c6805..b6e79eeee8586 100644 --- a/tests/baselines/reference/declarationEmitParameterProperty.js +++ b/tests/baselines/reference/declarationEmitParameterProperty.js @@ -8,7 +8,7 @@ export class Foo { //// [declarationEmitParameterProperty.js] "use strict"; exports.__esModule = true; -var Foo = (function () { +var Foo = /** @class */ (function () { function Foo(bar) { this.bar = bar; } diff --git a/tests/baselines/reference/declarationEmitProtectedMembers.js b/tests/baselines/reference/declarationEmitProtectedMembers.js index a31d74fbbb1a5..3a4fb796c7cec 100644 --- a/tests/baselines/reference/declarationEmitProtectedMembers.js +++ b/tests/baselines/reference/declarationEmitProtectedMembers.js @@ -61,7 +61,7 @@ var __extends = (this && this.__extends) || (function () { }; })(); // Class with protected members -var C1 = (function () { +var C1 = /** @class */ (function () { function C1() { } C1.prototype.f = function () { @@ -89,7 +89,7 @@ var C1 = (function () { return C1; }()); // Derived class overriding protected members -var C2 = (function (_super) { +var C2 = /** @class */ (function (_super) { __extends(C2, _super); function C2() { return _super !== null && _super.apply(this, arguments) || this; @@ -103,7 +103,7 @@ var C2 = (function (_super) { return C2; }(C1)); // Derived class making protected members public -var C3 = (function (_super) { +var C3 = /** @class */ (function (_super) { __extends(C3, _super); function C3() { return _super !== null && _super.apply(this, arguments) || this; @@ -122,7 +122,7 @@ var C3 = (function (_super) { return C3; }(C2)); // Protected properties in constructors -var C4 = (function () { +var C4 = /** @class */ (function () { function C4(a, b) { this.a = a; this.b = b; diff --git a/tests/baselines/reference/declarationEmitReadonly.js b/tests/baselines/reference/declarationEmitReadonly.js index 4a3a80523ba22..3c8968ac3ad40 100644 --- a/tests/baselines/reference/declarationEmitReadonly.js +++ b/tests/baselines/reference/declarationEmitReadonly.js @@ -4,7 +4,7 @@ class C { } //// [declarationEmitReadonly.js] -var C = (function () { +var C = /** @class */ (function () { function C(x) { this.x = x; } diff --git a/tests/baselines/reference/declarationEmitThisPredicates01.js b/tests/baselines/reference/declarationEmitThisPredicates01.js index 70ed3147a9e06..6688f3b85c2b2 100644 --- a/tests/baselines/reference/declarationEmitThisPredicates01.js +++ b/tests/baselines/reference/declarationEmitThisPredicates01.js @@ -21,7 +21,7 @@ var __extends = (this && this.__extends) || (function () { }; })(); exports.__esModule = true; -var C = (function () { +var C = /** @class */ (function () { function C() { } C.prototype.m = function () { @@ -30,7 +30,7 @@ var C = (function () { return C; }()); exports.C = C; -var D = (function (_super) { +var D = /** @class */ (function (_super) { __extends(D, _super); function D() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/declarationEmitThisPredicatesWithPrivateName01.js b/tests/baselines/reference/declarationEmitThisPredicatesWithPrivateName01.js index e7c4c9998b914..5bb662b5907c3 100644 --- a/tests/baselines/reference/declarationEmitThisPredicatesWithPrivateName01.js +++ b/tests/baselines/reference/declarationEmitThisPredicatesWithPrivateName01.js @@ -21,7 +21,7 @@ var __extends = (this && this.__extends) || (function () { }; })(); exports.__esModule = true; -var C = (function () { +var C = /** @class */ (function () { function C() { } C.prototype.m = function () { @@ -30,7 +30,7 @@ var C = (function () { return C; }()); exports.C = C; -var D = (function (_super) { +var D = /** @class */ (function (_super) { __extends(D, _super); function D() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/declarationFileOverwriteError.js b/tests/baselines/reference/declarationFileOverwriteError.js index 533cca55b2262..6a4103f132ca5 100644 --- a/tests/baselines/reference/declarationFileOverwriteError.js +++ b/tests/baselines/reference/declarationFileOverwriteError.js @@ -9,7 +9,7 @@ class d { } //// [a.js] -var d = (function () { +var d = /** @class */ (function () { function d() { } return d; diff --git a/tests/baselines/reference/declarationFileOverwriteErrorWithOut.js b/tests/baselines/reference/declarationFileOverwriteErrorWithOut.js index 72a5239b9a70c..fda8b290e8268 100644 --- a/tests/baselines/reference/declarationFileOverwriteErrorWithOut.js +++ b/tests/baselines/reference/declarationFileOverwriteErrorWithOut.js @@ -9,7 +9,7 @@ class d { } //// [out.js] -var d = (function () { +var d = /** @class */ (function () { function d() { } return d; diff --git a/tests/baselines/reference/declarationFiles.js b/tests/baselines/reference/declarationFiles.js index 7ee2f344ea1bc..9b3c91274ee0a 100644 --- a/tests/baselines/reference/declarationFiles.js +++ b/tests/baselines/reference/declarationFiles.js @@ -48,23 +48,23 @@ class C4 { //// [declarationFiles.js] -var C1 = (function () { +var C1 = /** @class */ (function () { function C1(x) { } C1.prototype.f = function (x) { return undefined; }; return C1; }()); -var C2 = (function () { +var C2 = /** @class */ (function () { function C2() { } return C2; }()); -var C3 = (function () { +var C3 = /** @class */ (function () { function C3() { } return C3; }()); -var C4 = (function () { +var C4 = /** @class */ (function () { function C4() { var _this = this; this.x1 = { a: this }; diff --git a/tests/baselines/reference/declarationMerging1.js b/tests/baselines/reference/declarationMerging1.js index 6b863def1c7c5..36f503005e43d 100644 --- a/tests/baselines/reference/declarationMerging1.js +++ b/tests/baselines/reference/declarationMerging1.js @@ -12,7 +12,7 @@ interface A { } //// [file1.js] -var A = (function () { +var A = /** @class */ (function () { function A() { } A.prototype.getF = function () { return this._f; }; diff --git a/tests/baselines/reference/declarationMerging2.js b/tests/baselines/reference/declarationMerging2.js index b360d9af3f770..744da649e147b 100644 --- a/tests/baselines/reference/declarationMerging2.js +++ b/tests/baselines/reference/declarationMerging2.js @@ -18,7 +18,7 @@ declare module "./a" { define(["require", "exports"], function (require, exports) { "use strict"; exports.__esModule = true; - var A = (function () { + var A = /** @class */ (function () { function A() { } A.prototype.getF = function () { return this._f; }; diff --git a/tests/baselines/reference/declareDottedExtend.js b/tests/baselines/reference/declareDottedExtend.js index 1256602ee1e9f..072ecad834a96 100644 --- a/tests/baselines/reference/declareDottedExtend.js +++ b/tests/baselines/reference/declareDottedExtend.js @@ -23,14 +23,14 @@ var __extends = (this && this.__extends) || (function () { }; })(); var ab = A.B; -var D = (function (_super) { +var D = /** @class */ (function (_super) { __extends(D, _super); function D() { return _super !== null && _super.apply(this, arguments) || this; } return D; }(ab.C)); -var E = (function (_super) { +var E = /** @class */ (function (_super) { __extends(E, _super); function E() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/declareIdentifierAsBeginningOfStatementExpression01.js b/tests/baselines/reference/declareIdentifierAsBeginningOfStatementExpression01.js index 32bbdcff6a9ed..8ad8c3b195e15 100644 --- a/tests/baselines/reference/declareIdentifierAsBeginningOfStatementExpression01.js +++ b/tests/baselines/reference/declareIdentifierAsBeginningOfStatementExpression01.js @@ -7,7 +7,7 @@ var declare: any; declare instanceof C; //// [declareIdentifierAsBeginningOfStatementExpression01.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } return C; diff --git a/tests/baselines/reference/decoratorCallGeneric.js b/tests/baselines/reference/decoratorCallGeneric.js index acc9c48297dfe..cb0703aff5020 100644 --- a/tests/baselines/reference/decoratorCallGeneric.js +++ b/tests/baselines/reference/decoratorCallGeneric.js @@ -20,7 +20,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key, return c > 3 && r && Object.defineProperty(target, key, r), r; }; function dec(c) { } -var C = (function () { +var C = /** @class */ (function () { function C() { } C.m = function () { }; diff --git a/tests/baselines/reference/decoratorChecksFunctionBodies.js b/tests/baselines/reference/decoratorChecksFunctionBodies.js index 562169078af86..38f0784939f1e 100644 --- a/tests/baselines/reference/decoratorChecksFunctionBodies.js +++ b/tests/baselines/reference/decoratorChecksFunctionBodies.js @@ -24,7 +24,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key, // from #2971 function func(s) { } -var A = (function () { +var A = /** @class */ (function () { function A() { } A.prototype.m = function () { diff --git a/tests/baselines/reference/decoratorInstantiateModulesInFunctionBodies.js b/tests/baselines/reference/decoratorInstantiateModulesInFunctionBodies.js index fccd0ec95d320..b15bee6f96e21 100644 --- a/tests/baselines/reference/decoratorInstantiateModulesInFunctionBodies.js +++ b/tests/baselines/reference/decoratorInstantiateModulesInFunctionBodies.js @@ -40,7 +40,7 @@ function filter(handler) { // ... }; } -var Wat = (function () { +var Wat = /** @class */ (function () { function Wat() { } Wat.whatever = function () { diff --git a/tests/baselines/reference/decoratorMetadata.js b/tests/baselines/reference/decoratorMetadata.js index 93453ac4cf3c8..4e411154ec1fc 100644 --- a/tests/baselines/reference/decoratorMetadata.js +++ b/tests/baselines/reference/decoratorMetadata.js @@ -21,7 +21,7 @@ class MyComponent { //// [service.js] "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); -var Service = (function () { +var Service = /** @class */ (function () { function Service() { } return Service; @@ -40,7 +40,7 @@ var __metadata = (this && this.__metadata) || function (k, v) { }; Object.defineProperty(exports, "__esModule", { value: true }); var service_1 = require("./service"); -var MyComponent = (function () { +var MyComponent = /** @class */ (function () { function MyComponent(Service) { this.Service = Service; } diff --git a/tests/baselines/reference/decoratorMetadataForMethodWithNoReturnTypeAnnotation01.js b/tests/baselines/reference/decoratorMetadataForMethodWithNoReturnTypeAnnotation01.js index 9e8b4d5278ee7..da3185f7e47da 100644 --- a/tests/baselines/reference/decoratorMetadataForMethodWithNoReturnTypeAnnotation01.js +++ b/tests/baselines/reference/decoratorMetadataForMethodWithNoReturnTypeAnnotation01.js @@ -14,7 +14,7 @@ class MyClass { //// [decoratorMetadataForMethodWithNoReturnTypeAnnotation01.js] -var MyClass = (function () { +var MyClass = /** @class */ (function () { function MyClass(test, test2) { } MyClass.prototype.doSomething = function () { diff --git a/tests/baselines/reference/decoratorMetadataOnInferredType.js b/tests/baselines/reference/decoratorMetadataOnInferredType.js index 4c532327d25a5..2fbf0060f4ffb 100644 --- a/tests/baselines/reference/decoratorMetadataOnInferredType.js +++ b/tests/baselines/reference/decoratorMetadataOnInferredType.js @@ -19,7 +19,7 @@ export class B { //// [decoratorMetadataOnInferredType.js] "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); -var A = (function () { +var A = /** @class */ (function () { function A() { console.log('new A'); } @@ -27,7 +27,7 @@ var A = (function () { }()); function decorator(target, propertyKey) { } -var B = (function () { +var B = /** @class */ (function () { function B() { this.x = new A(); } diff --git a/tests/baselines/reference/decoratorMetadataRestParameterWithImportedType.js b/tests/baselines/reference/decoratorMetadataRestParameterWithImportedType.js index f85bb4767210e..676b91ff2dc69 100644 --- a/tests/baselines/reference/decoratorMetadataRestParameterWithImportedType.js +++ b/tests/baselines/reference/decoratorMetadataRestParameterWithImportedType.js @@ -42,7 +42,7 @@ export class ClassA { //// [aux.js] "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); -var SomeClass = (function () { +var SomeClass = /** @class */ (function () { function SomeClass() { } return SomeClass; @@ -51,7 +51,7 @@ exports.SomeClass = SomeClass; //// [aux1.js] "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); -var SomeClass1 = (function () { +var SomeClass1 = /** @class */ (function () { function SomeClass1() { } return SomeClass1; @@ -60,7 +60,7 @@ exports.SomeClass1 = SomeClass1; //// [aux2.js] "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); -var SomeClass2 = (function () { +var SomeClass2 = /** @class */ (function () { function SomeClass2() { } return SomeClass2; @@ -86,7 +86,7 @@ function annotation() { function annotation1() { return function (target) { }; } -var ClassA = (function () { +var ClassA = /** @class */ (function () { function ClassA() { var init = []; for (var _i = 0; _i < arguments.length; _i++) { diff --git a/tests/baselines/reference/decoratorMetadataWithConstructorType.js b/tests/baselines/reference/decoratorMetadataWithConstructorType.js index 6eff4fdc282af..120e854a1b0b9 100644 --- a/tests/baselines/reference/decoratorMetadataWithConstructorType.js +++ b/tests/baselines/reference/decoratorMetadataWithConstructorType.js @@ -19,7 +19,7 @@ export class B { //// [decoratorMetadataWithConstructorType.js] "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); -var A = (function () { +var A = /** @class */ (function () { function A() { console.log('new A'); } @@ -27,7 +27,7 @@ var A = (function () { }()); function decorator(target, propertyKey) { } -var B = (function () { +var B = /** @class */ (function () { function B() { this.x = new A(); } diff --git a/tests/baselines/reference/decoratorMetadataWithImportDeclarationNameCollision.js b/tests/baselines/reference/decoratorMetadataWithImportDeclarationNameCollision.js index f59e7f9ec13d2..657f5cd2d6519 100644 --- a/tests/baselines/reference/decoratorMetadataWithImportDeclarationNameCollision.js +++ b/tests/baselines/reference/decoratorMetadataWithImportDeclarationNameCollision.js @@ -26,7 +26,7 @@ export {MyClass}; //// [db.js] "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); -var db = (function () { +var db = /** @class */ (function () { function db() { } db.prototype.doSomething = function () { @@ -41,7 +41,7 @@ var db_1 = require("./db"); function someDecorator(target) { return target; } -var MyClass = (function () { +var MyClass = /** @class */ (function () { function MyClass(db) { this.db = db; this.db.doSomething(); diff --git a/tests/baselines/reference/decoratorMetadataWithImportDeclarationNameCollision2.js b/tests/baselines/reference/decoratorMetadataWithImportDeclarationNameCollision2.js index b3a5cded57190..3f2ae9911f0d2 100644 --- a/tests/baselines/reference/decoratorMetadataWithImportDeclarationNameCollision2.js +++ b/tests/baselines/reference/decoratorMetadataWithImportDeclarationNameCollision2.js @@ -26,7 +26,7 @@ export {MyClass}; //// [db.js] "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); -var db = (function () { +var db = /** @class */ (function () { function db() { } db.prototype.doSomething = function () { @@ -41,7 +41,7 @@ var db_1 = require("./db"); function someDecorator(target) { return target; } -var MyClass = (function () { +var MyClass = /** @class */ (function () { function MyClass(db) { this.db = db; this.db.doSomething(); diff --git a/tests/baselines/reference/decoratorMetadataWithImportDeclarationNameCollision3.js b/tests/baselines/reference/decoratorMetadataWithImportDeclarationNameCollision3.js index a3c170b24e678..9b3bb644c2c40 100644 --- a/tests/baselines/reference/decoratorMetadataWithImportDeclarationNameCollision3.js +++ b/tests/baselines/reference/decoratorMetadataWithImportDeclarationNameCollision3.js @@ -26,7 +26,7 @@ export {MyClass}; //// [db.js] "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); -var db = (function () { +var db = /** @class */ (function () { function db() { } db.prototype.doSomething = function () { @@ -41,7 +41,7 @@ var db = require("./db"); function someDecorator(target) { return target; } -var MyClass = (function () { +var MyClass = /** @class */ (function () { function MyClass(db) { this.db = db; this.db.doSomething(); diff --git a/tests/baselines/reference/decoratorMetadataWithImportDeclarationNameCollision4.js b/tests/baselines/reference/decoratorMetadataWithImportDeclarationNameCollision4.js index d6ed8bde3eca1..bec7400996e00 100644 --- a/tests/baselines/reference/decoratorMetadataWithImportDeclarationNameCollision4.js +++ b/tests/baselines/reference/decoratorMetadataWithImportDeclarationNameCollision4.js @@ -26,7 +26,7 @@ export {MyClass}; //// [db.js] "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); -var db = (function () { +var db = /** @class */ (function () { function db() { } db.prototype.doSomething = function () { @@ -41,7 +41,7 @@ var db_1 = require("./db"); // error no default export function someDecorator(target) { return target; } -var MyClass = (function () { +var MyClass = /** @class */ (function () { function MyClass(db) { this.db = db; this.db.doSomething(); diff --git a/tests/baselines/reference/decoratorMetadataWithImportDeclarationNameCollision5.js b/tests/baselines/reference/decoratorMetadataWithImportDeclarationNameCollision5.js index a1cc10b7d3d0d..1985fe396df19 100644 --- a/tests/baselines/reference/decoratorMetadataWithImportDeclarationNameCollision5.js +++ b/tests/baselines/reference/decoratorMetadataWithImportDeclarationNameCollision5.js @@ -26,7 +26,7 @@ export {MyClass}; //// [db.js] "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); -var db = (function () { +var db = /** @class */ (function () { function db() { } db.prototype.doSomething = function () { @@ -41,7 +41,7 @@ var db_1 = require("./db"); function someDecorator(target) { return target; } -var MyClass = (function () { +var MyClass = /** @class */ (function () { function MyClass(db) { this.db = db; this.db.doSomething(); diff --git a/tests/baselines/reference/decoratorMetadataWithImportDeclarationNameCollision6.js b/tests/baselines/reference/decoratorMetadataWithImportDeclarationNameCollision6.js index 572787b6f20d6..c7f9529973fe6 100644 --- a/tests/baselines/reference/decoratorMetadataWithImportDeclarationNameCollision6.js +++ b/tests/baselines/reference/decoratorMetadataWithImportDeclarationNameCollision6.js @@ -26,7 +26,7 @@ export {MyClass}; //// [db.js] "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); -var db = (function () { +var db = /** @class */ (function () { function db() { } db.prototype.doSomething = function () { @@ -41,7 +41,7 @@ var db_1 = require("./db"); function someDecorator(target) { return target; } -var MyClass = (function () { +var MyClass = /** @class */ (function () { function MyClass(db) { this.db = db; this.db.doSomething(); diff --git a/tests/baselines/reference/decoratorMetadataWithImportDeclarationNameCollision7.js b/tests/baselines/reference/decoratorMetadataWithImportDeclarationNameCollision7.js index 6a45f5230bd00..fa96fb3229ebd 100644 --- a/tests/baselines/reference/decoratorMetadataWithImportDeclarationNameCollision7.js +++ b/tests/baselines/reference/decoratorMetadataWithImportDeclarationNameCollision7.js @@ -26,7 +26,7 @@ export {MyClass}; //// [db.js] "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); -var db = (function () { +var db = /** @class */ (function () { function db() { } db.prototype.doSomething = function () { @@ -41,7 +41,7 @@ var db_1 = require("./db"); function someDecorator(target) { return target; } -var MyClass = (function () { +var MyClass = /** @class */ (function () { function MyClass(db) { this.db = db; this.db.doSomething(); diff --git a/tests/baselines/reference/decoratorMetadataWithImportDeclarationNameCollision8.js b/tests/baselines/reference/decoratorMetadataWithImportDeclarationNameCollision8.js index 6efdc7f26dbf9..aee3103b5fbf1 100644 --- a/tests/baselines/reference/decoratorMetadataWithImportDeclarationNameCollision8.js +++ b/tests/baselines/reference/decoratorMetadataWithImportDeclarationNameCollision8.js @@ -26,7 +26,7 @@ export {MyClass}; //// [db.js] "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); -var db = (function () { +var db = /** @class */ (function () { function db() { } db.prototype.doSomething = function () { @@ -41,7 +41,7 @@ var database = require("./db"); function someDecorator(target) { return target; } -var MyClass = (function () { +var MyClass = /** @class */ (function () { function MyClass(db) { this.db = db; this.db.doSomething(); diff --git a/tests/baselines/reference/decoratorOnClass1.js b/tests/baselines/reference/decoratorOnClass1.js index 7ea46b4698fc8..c1f1f342e7555 100644 --- a/tests/baselines/reference/decoratorOnClass1.js +++ b/tests/baselines/reference/decoratorOnClass1.js @@ -12,7 +12,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key, else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; -var C = (function () { +var C = /** @class */ (function () { function C() { } C = __decorate([ diff --git a/tests/baselines/reference/decoratorOnClass2.js b/tests/baselines/reference/decoratorOnClass2.js index 84098a1787020..42c27ed8cc9e6 100644 --- a/tests/baselines/reference/decoratorOnClass2.js +++ b/tests/baselines/reference/decoratorOnClass2.js @@ -14,7 +14,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key, return c > 3 && r && Object.defineProperty(target, key, r), r; }; Object.defineProperty(exports, "__esModule", { value: true }); -var C = (function () { +var C = /** @class */ (function () { function C() { } C = __decorate([ diff --git a/tests/baselines/reference/decoratorOnClass3.js b/tests/baselines/reference/decoratorOnClass3.js index 5a3601fc1f3e8..fc3255359c4ab 100644 --- a/tests/baselines/reference/decoratorOnClass3.js +++ b/tests/baselines/reference/decoratorOnClass3.js @@ -13,7 +13,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key, else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; -var C = (function () { +var C = /** @class */ (function () { function C() { } C = __decorate([ diff --git a/tests/baselines/reference/decoratorOnClass4.js b/tests/baselines/reference/decoratorOnClass4.js index adbe30db662a6..fb3fa85150596 100644 --- a/tests/baselines/reference/decoratorOnClass4.js +++ b/tests/baselines/reference/decoratorOnClass4.js @@ -12,7 +12,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key, else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; -var C = (function () { +var C = /** @class */ (function () { function C() { } C = __decorate([ diff --git a/tests/baselines/reference/decoratorOnClass5.js b/tests/baselines/reference/decoratorOnClass5.js index 6741b26373bb9..f2c7bc8d64938 100644 --- a/tests/baselines/reference/decoratorOnClass5.js +++ b/tests/baselines/reference/decoratorOnClass5.js @@ -12,7 +12,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key, else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; -var C = (function () { +var C = /** @class */ (function () { function C() { } C = __decorate([ diff --git a/tests/baselines/reference/decoratorOnClass8.js b/tests/baselines/reference/decoratorOnClass8.js index e5cd8812ea780..3aa87ed240e33 100644 --- a/tests/baselines/reference/decoratorOnClass8.js +++ b/tests/baselines/reference/decoratorOnClass8.js @@ -12,7 +12,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key, else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; -var C = (function () { +var C = /** @class */ (function () { function C() { } C = __decorate([ diff --git a/tests/baselines/reference/decoratorOnClass9.js b/tests/baselines/reference/decoratorOnClass9.js index eac4dcf690af4..84ce76dba2958 100644 --- a/tests/baselines/reference/decoratorOnClass9.js +++ b/tests/baselines/reference/decoratorOnClass9.js @@ -30,13 +30,13 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key, else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; -var A = (function () { +var A = /** @class */ (function () { function A() { } return A; }()); // https://github.com/Microsoft/TypeScript/issues/16417 -var B = (function (_super) { +var B = /** @class */ (function (_super) { __extends(B, _super); function B() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/decoratorOnClassAccessor1.js b/tests/baselines/reference/decoratorOnClassAccessor1.js index cf989705b79b4..5efcfb15678cd 100644 --- a/tests/baselines/reference/decoratorOnClassAccessor1.js +++ b/tests/baselines/reference/decoratorOnClassAccessor1.js @@ -12,7 +12,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key, else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; -var C = (function () { +var C = /** @class */ (function () { function C() { } Object.defineProperty(C.prototype, "accessor", { diff --git a/tests/baselines/reference/decoratorOnClassAccessor2.js b/tests/baselines/reference/decoratorOnClassAccessor2.js index 9e9455b438051..4ad30d0c7f42a 100644 --- a/tests/baselines/reference/decoratorOnClassAccessor2.js +++ b/tests/baselines/reference/decoratorOnClassAccessor2.js @@ -12,7 +12,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key, else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; -var C = (function () { +var C = /** @class */ (function () { function C() { } Object.defineProperty(C.prototype, "accessor", { diff --git a/tests/baselines/reference/decoratorOnClassAccessor3.js b/tests/baselines/reference/decoratorOnClassAccessor3.js index 8a27914e0c898..207d51295a3f6 100644 --- a/tests/baselines/reference/decoratorOnClassAccessor3.js +++ b/tests/baselines/reference/decoratorOnClassAccessor3.js @@ -12,7 +12,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key, else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; -var C = (function () { +var C = /** @class */ (function () { function C() { } Object.defineProperty(C.prototype, "accessor", { diff --git a/tests/baselines/reference/decoratorOnClassAccessor4.js b/tests/baselines/reference/decoratorOnClassAccessor4.js index 85b35e95cef54..15d521d373ba6 100644 --- a/tests/baselines/reference/decoratorOnClassAccessor4.js +++ b/tests/baselines/reference/decoratorOnClassAccessor4.js @@ -12,7 +12,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key, else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; -var C = (function () { +var C = /** @class */ (function () { function C() { } Object.defineProperty(C.prototype, "accessor", { diff --git a/tests/baselines/reference/decoratorOnClassAccessor5.js b/tests/baselines/reference/decoratorOnClassAccessor5.js index 12ec7a08adcb9..37d8d28c262b8 100644 --- a/tests/baselines/reference/decoratorOnClassAccessor5.js +++ b/tests/baselines/reference/decoratorOnClassAccessor5.js @@ -12,7 +12,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key, else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; -var C = (function () { +var C = /** @class */ (function () { function C() { } Object.defineProperty(C.prototype, "accessor", { diff --git a/tests/baselines/reference/decoratorOnClassAccessor6.js b/tests/baselines/reference/decoratorOnClassAccessor6.js index d5477deb5af10..0a0109ecd7f19 100644 --- a/tests/baselines/reference/decoratorOnClassAccessor6.js +++ b/tests/baselines/reference/decoratorOnClassAccessor6.js @@ -12,7 +12,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key, else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; -var C = (function () { +var C = /** @class */ (function () { function C() { } Object.defineProperty(C.prototype, "accessor", { diff --git a/tests/baselines/reference/decoratorOnClassAccessor7.js b/tests/baselines/reference/decoratorOnClassAccessor7.js index 26f0ce5c215d1..d32e0eb4911af 100644 --- a/tests/baselines/reference/decoratorOnClassAccessor7.js +++ b/tests/baselines/reference/decoratorOnClassAccessor7.js @@ -39,7 +39,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key, else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; -var A = (function () { +var A = /** @class */ (function () { function A() { } Object.defineProperty(A.prototype, "x", { @@ -53,7 +53,7 @@ var A = (function () { ], A.prototype, "x", null); return A; }()); -var B = (function () { +var B = /** @class */ (function () { function B() { } Object.defineProperty(B.prototype, "x", { @@ -67,7 +67,7 @@ var B = (function () { ], B.prototype, "x", null); return B; }()); -var C = (function () { +var C = /** @class */ (function () { function C() { } Object.defineProperty(C.prototype, "x", { @@ -81,7 +81,7 @@ var C = (function () { ], C.prototype, "x", null); return C; }()); -var D = (function () { +var D = /** @class */ (function () { function D() { } Object.defineProperty(D.prototype, "x", { @@ -95,7 +95,7 @@ var D = (function () { ], D.prototype, "x", null); return D; }()); -var E = (function () { +var E = /** @class */ (function () { function E() { } Object.defineProperty(E.prototype, "x", { @@ -109,7 +109,7 @@ var E = (function () { ], E.prototype, "x", null); return E; }()); -var F = (function () { +var F = /** @class */ (function () { function F() { } Object.defineProperty(F.prototype, "x", { diff --git a/tests/baselines/reference/decoratorOnClassAccessor8.js b/tests/baselines/reference/decoratorOnClassAccessor8.js index f121d1486237c..f0917130521aa 100644 --- a/tests/baselines/reference/decoratorOnClassAccessor8.js +++ b/tests/baselines/reference/decoratorOnClassAccessor8.js @@ -39,7 +39,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key, var __metadata = (this && this.__metadata) || function (k, v) { if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); }; -var A = (function () { +var A = /** @class */ (function () { function A() { } Object.defineProperty(A.prototype, "x", { @@ -55,7 +55,7 @@ var A = (function () { ], A.prototype, "x", null); return A; }()); -var B = (function () { +var B = /** @class */ (function () { function B() { } Object.defineProperty(B.prototype, "x", { @@ -71,7 +71,7 @@ var B = (function () { ], B.prototype, "x", null); return B; }()); -var C = (function () { +var C = /** @class */ (function () { function C() { } Object.defineProperty(C.prototype, "x", { @@ -87,7 +87,7 @@ var C = (function () { ], C.prototype, "x", null); return C; }()); -var D = (function () { +var D = /** @class */ (function () { function D() { } Object.defineProperty(D.prototype, "x", { @@ -103,7 +103,7 @@ var D = (function () { ], D.prototype, "x", null); return D; }()); -var E = (function () { +var E = /** @class */ (function () { function E() { } Object.defineProperty(E.prototype, "x", { @@ -118,7 +118,7 @@ var E = (function () { ], E.prototype, "x", null); return E; }()); -var F = (function () { +var F = /** @class */ (function () { function F() { } Object.defineProperty(F.prototype, "x", { diff --git a/tests/baselines/reference/decoratorOnClassConstructor1.js b/tests/baselines/reference/decoratorOnClassConstructor1.js index 3d58c627602a0..f3278b1bc75d1 100644 --- a/tests/baselines/reference/decoratorOnClassConstructor1.js +++ b/tests/baselines/reference/decoratorOnClassConstructor1.js @@ -6,7 +6,7 @@ class C { } //// [decoratorOnClassConstructor1.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } return C; diff --git a/tests/baselines/reference/decoratorOnClassConstructor2.js b/tests/baselines/reference/decoratorOnClassConstructor2.js index 2e444b62e80ca..ddb038ef48f12 100644 --- a/tests/baselines/reference/decoratorOnClassConstructor2.js +++ b/tests/baselines/reference/decoratorOnClassConstructor2.js @@ -16,7 +16,7 @@ export class C extends base{ //// [0.js] "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); -var base = (function () { +var base = /** @class */ (function () { function base() { } return base; @@ -48,7 +48,7 @@ var __param = (this && this.__param) || function (paramIndex, decorator) { Object.defineProperty(exports, "__esModule", { value: true }); var _0_ts_1 = require("./0.ts"); var _0_ts_2 = require("./0.ts"); -var C = (function (_super) { +var C = /** @class */ (function (_super) { __extends(C, _super); function C(prop) { return _super.call(this) || this; diff --git a/tests/baselines/reference/decoratorOnClassConstructor3.js b/tests/baselines/reference/decoratorOnClassConstructor3.js index 7d9573217c411..a570df0ff33d0 100644 --- a/tests/baselines/reference/decoratorOnClassConstructor3.js +++ b/tests/baselines/reference/decoratorOnClassConstructor3.js @@ -18,7 +18,7 @@ export class C extends base{ //// [0.js] "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); -var base = (function () { +var base = /** @class */ (function () { function base() { } return base; @@ -51,7 +51,7 @@ Object.defineProperty(exports, "__esModule", { value: true }); var _0_1 = require("./0"); var _0_2 = require("./0"); /* Comment on the Class Declaration */ -var C = (function (_super) { +var C = /** @class */ (function (_super) { __extends(C, _super); function C(prop) { return _super.call(this) || this; diff --git a/tests/baselines/reference/decoratorOnClassConstructor4.js b/tests/baselines/reference/decoratorOnClassConstructor4.js index 62fc93cbaa083..cf111fd955f18 100644 --- a/tests/baselines/reference/decoratorOnClassConstructor4.js +++ b/tests/baselines/reference/decoratorOnClassConstructor4.js @@ -34,7 +34,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key, var __metadata = (this && this.__metadata) || function (k, v) { if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); }; -var A = (function () { +var A = /** @class */ (function () { function A() { } A = __decorate([ @@ -42,7 +42,7 @@ var A = (function () { ], A); return A; }()); -var B = (function () { +var B = /** @class */ (function () { function B(x) { } B = __decorate([ @@ -51,7 +51,7 @@ var B = (function () { ], B); return B; }()); -var C = (function (_super) { +var C = /** @class */ (function (_super) { __extends(C, _super); function C() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/decoratorOnClassConstructorParameter1.js b/tests/baselines/reference/decoratorOnClassConstructorParameter1.js index fe04f569e30a7..cdc6dc94744dd 100644 --- a/tests/baselines/reference/decoratorOnClassConstructorParameter1.js +++ b/tests/baselines/reference/decoratorOnClassConstructorParameter1.js @@ -15,7 +15,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key, var __param = (this && this.__param) || function (paramIndex, decorator) { return function (target, key) { decorator(target, key, paramIndex); } }; -var C = (function () { +var C = /** @class */ (function () { function C(p) { } C = __decorate([ diff --git a/tests/baselines/reference/decoratorOnClassConstructorParameter4.js b/tests/baselines/reference/decoratorOnClassConstructorParameter4.js index 8d02bd467d6dc..248957771a3cb 100644 --- a/tests/baselines/reference/decoratorOnClassConstructorParameter4.js +++ b/tests/baselines/reference/decoratorOnClassConstructorParameter4.js @@ -15,7 +15,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key, var __param = (this && this.__param) || function (paramIndex, decorator) { return function (target, key) { decorator(target, key, paramIndex); } }; -var C = (function () { +var C = /** @class */ (function () { function C(public, p) { } C = __decorate([ diff --git a/tests/baselines/reference/decoratorOnClassMethod1.js b/tests/baselines/reference/decoratorOnClassMethod1.js index ef029b845431b..c5d778a831316 100644 --- a/tests/baselines/reference/decoratorOnClassMethod1.js +++ b/tests/baselines/reference/decoratorOnClassMethod1.js @@ -12,7 +12,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key, else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; -var C = (function () { +var C = /** @class */ (function () { function C() { } C.prototype.method = function () { }; diff --git a/tests/baselines/reference/decoratorOnClassMethod10.js b/tests/baselines/reference/decoratorOnClassMethod10.js index f90251d619694..6f54f442f7a11 100644 --- a/tests/baselines/reference/decoratorOnClassMethod10.js +++ b/tests/baselines/reference/decoratorOnClassMethod10.js @@ -12,7 +12,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key, else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; -var C = (function () { +var C = /** @class */ (function () { function C() { } C.prototype.method = function () { }; diff --git a/tests/baselines/reference/decoratorOnClassMethod11.js b/tests/baselines/reference/decoratorOnClassMethod11.js index f1589a39286fa..2600681c64746 100644 --- a/tests/baselines/reference/decoratorOnClassMethod11.js +++ b/tests/baselines/reference/decoratorOnClassMethod11.js @@ -17,7 +17,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key, }; var M; (function (M) { - var C = (function () { + var C = /** @class */ (function () { function C() { } C.prototype.decorator = function (target, key) { }; diff --git a/tests/baselines/reference/decoratorOnClassMethod12.js b/tests/baselines/reference/decoratorOnClassMethod12.js index 089f5961d9ca5..494cb083a20f3 100644 --- a/tests/baselines/reference/decoratorOnClassMethod12.js +++ b/tests/baselines/reference/decoratorOnClassMethod12.js @@ -28,13 +28,13 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key, }; var M; (function (M) { - var S = (function () { + var S = /** @class */ (function () { function S() { } S.prototype.decorator = function (target, key) { }; return S; }()); - var C = (function (_super) { + var C = /** @class */ (function (_super) { __extends(C, _super); function C() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/decoratorOnClassMethod2.js b/tests/baselines/reference/decoratorOnClassMethod2.js index 5db2922ed7187..62e0b12515cd1 100644 --- a/tests/baselines/reference/decoratorOnClassMethod2.js +++ b/tests/baselines/reference/decoratorOnClassMethod2.js @@ -12,7 +12,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key, else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; -var C = (function () { +var C = /** @class */ (function () { function C() { } C.prototype.method = function () { }; diff --git a/tests/baselines/reference/decoratorOnClassMethod3.js b/tests/baselines/reference/decoratorOnClassMethod3.js index 30f527368f28b..fbb753e929e2d 100644 --- a/tests/baselines/reference/decoratorOnClassMethod3.js +++ b/tests/baselines/reference/decoratorOnClassMethod3.js @@ -12,7 +12,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key, else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; -var C = (function () { +var C = /** @class */ (function () { function C() { } C.prototype.method = function () { }; diff --git a/tests/baselines/reference/decoratorOnClassMethod8.js b/tests/baselines/reference/decoratorOnClassMethod8.js index bf8c06d9b90f6..15dba00c56476 100644 --- a/tests/baselines/reference/decoratorOnClassMethod8.js +++ b/tests/baselines/reference/decoratorOnClassMethod8.js @@ -12,7 +12,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key, else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; -var C = (function () { +var C = /** @class */ (function () { function C() { } C.prototype.method = function () { }; diff --git a/tests/baselines/reference/decoratorOnClassMethodOverload1.js b/tests/baselines/reference/decoratorOnClassMethodOverload1.js index cb2e29b3d0003..65016c2517717 100644 --- a/tests/baselines/reference/decoratorOnClassMethodOverload1.js +++ b/tests/baselines/reference/decoratorOnClassMethodOverload1.js @@ -8,7 +8,7 @@ class C { } //// [decoratorOnClassMethodOverload1.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } C.prototype.method = function () { }; diff --git a/tests/baselines/reference/decoratorOnClassMethodOverload2.js b/tests/baselines/reference/decoratorOnClassMethodOverload2.js index eafa5da711097..1a37ddb7003f6 100644 --- a/tests/baselines/reference/decoratorOnClassMethodOverload2.js +++ b/tests/baselines/reference/decoratorOnClassMethodOverload2.js @@ -14,7 +14,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key, else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; -var C = (function () { +var C = /** @class */ (function () { function C() { } C.prototype.method = function () { }; diff --git a/tests/baselines/reference/decoratorOnClassMethodParameter1.js b/tests/baselines/reference/decoratorOnClassMethodParameter1.js index efb1e4abff2cb..00f6e8ed23b34 100644 --- a/tests/baselines/reference/decoratorOnClassMethodParameter1.js +++ b/tests/baselines/reference/decoratorOnClassMethodParameter1.js @@ -15,7 +15,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key, var __param = (this && this.__param) || function (paramIndex, decorator) { return function (target, key) { decorator(target, key, paramIndex); } }; -var C = (function () { +var C = /** @class */ (function () { function C() { } C.prototype.method = function (p) { }; diff --git a/tests/baselines/reference/decoratorOnClassProperty1.js b/tests/baselines/reference/decoratorOnClassProperty1.js index 65a399332f161..dc7f39e6624c6 100644 --- a/tests/baselines/reference/decoratorOnClassProperty1.js +++ b/tests/baselines/reference/decoratorOnClassProperty1.js @@ -12,7 +12,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key, else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; -var C = (function () { +var C = /** @class */ (function () { function C() { } __decorate([ diff --git a/tests/baselines/reference/decoratorOnClassProperty10.js b/tests/baselines/reference/decoratorOnClassProperty10.js index 9df40eaf83a38..a9556de825270 100644 --- a/tests/baselines/reference/decoratorOnClassProperty10.js +++ b/tests/baselines/reference/decoratorOnClassProperty10.js @@ -12,7 +12,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key, else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; -var C = (function () { +var C = /** @class */ (function () { function C() { } __decorate([ diff --git a/tests/baselines/reference/decoratorOnClassProperty11.js b/tests/baselines/reference/decoratorOnClassProperty11.js index 8b771caf8b515..f6f4e4fc95981 100644 --- a/tests/baselines/reference/decoratorOnClassProperty11.js +++ b/tests/baselines/reference/decoratorOnClassProperty11.js @@ -12,7 +12,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key, else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; -var C = (function () { +var C = /** @class */ (function () { function C() { } __decorate([ diff --git a/tests/baselines/reference/decoratorOnClassProperty2.js b/tests/baselines/reference/decoratorOnClassProperty2.js index 3ab2b515e3c02..6e8869bc27269 100644 --- a/tests/baselines/reference/decoratorOnClassProperty2.js +++ b/tests/baselines/reference/decoratorOnClassProperty2.js @@ -12,7 +12,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key, else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; -var C = (function () { +var C = /** @class */ (function () { function C() { } __decorate([ diff --git a/tests/baselines/reference/decoratorOnClassProperty3.js b/tests/baselines/reference/decoratorOnClassProperty3.js index 9c0d3f90e42f2..ed519fa8af7a6 100644 --- a/tests/baselines/reference/decoratorOnClassProperty3.js +++ b/tests/baselines/reference/decoratorOnClassProperty3.js @@ -12,7 +12,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key, else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; -var C = (function () { +var C = /** @class */ (function () { function C() { } __decorate([ diff --git a/tests/baselines/reference/decoratorOnClassProperty6.js b/tests/baselines/reference/decoratorOnClassProperty6.js index 823a652af2404..095e64e7190ba 100644 --- a/tests/baselines/reference/decoratorOnClassProperty6.js +++ b/tests/baselines/reference/decoratorOnClassProperty6.js @@ -12,7 +12,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key, else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; -var C = (function () { +var C = /** @class */ (function () { function C() { } __decorate([ diff --git a/tests/baselines/reference/decoratorOnClassProperty7.js b/tests/baselines/reference/decoratorOnClassProperty7.js index 134f35022e04a..5c8d4aedc6a09 100644 --- a/tests/baselines/reference/decoratorOnClassProperty7.js +++ b/tests/baselines/reference/decoratorOnClassProperty7.js @@ -12,7 +12,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key, else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; -var C = (function () { +var C = /** @class */ (function () { function C() { } __decorate([ diff --git a/tests/baselines/reference/decoratorWithUnderscoreMethod.js b/tests/baselines/reference/decoratorWithUnderscoreMethod.js index ace73ccf5953e..8dc8750975bea 100644 --- a/tests/baselines/reference/decoratorWithUnderscoreMethod.js +++ b/tests/baselines/reference/decoratorWithUnderscoreMethod.js @@ -23,7 +23,7 @@ function dec() { //propKey has three underscores as prefix, but the method has only two underscores }; } -var A = (function () { +var A = /** @class */ (function () { function A() { } A.prototype.__foo = function (bar) { diff --git a/tests/baselines/reference/decrementOperatorWithAnyOtherType.js b/tests/baselines/reference/decrementOperatorWithAnyOtherType.js index f3ff58b80ca8a..ce6a085ebf868 100644 --- a/tests/baselines/reference/decrementOperatorWithAnyOtherType.js +++ b/tests/baselines/reference/decrementOperatorWithAnyOtherType.js @@ -54,7 +54,7 @@ var ANY; var ANY1; var ANY2 = ["", ""]; var obj = { x: 1, y: null }; -var A = (function () { +var A = /** @class */ (function () { function A() { } return A; diff --git a/tests/baselines/reference/decrementOperatorWithAnyOtherTypeInvalidOperations.js b/tests/baselines/reference/decrementOperatorWithAnyOtherTypeInvalidOperations.js index 88d045ab378d2..b7fb464782b4e 100644 --- a/tests/baselines/reference/decrementOperatorWithAnyOtherTypeInvalidOperations.js +++ b/tests/baselines/reference/decrementOperatorWithAnyOtherTypeInvalidOperations.js @@ -82,7 +82,7 @@ function foo() { var a; return a; } -var A = (function () { +var A = /** @class */ (function () { function A() { } A.foo = function () { diff --git a/tests/baselines/reference/decrementOperatorWithNumberType.js b/tests/baselines/reference/decrementOperatorWithNumberType.js index b737c91597a64..426df8ab525c6 100644 --- a/tests/baselines/reference/decrementOperatorWithNumberType.js +++ b/tests/baselines/reference/decrementOperatorWithNumberType.js @@ -43,7 +43,7 @@ objA.a--, M.n--; // -- operator on number type var NUMBER; var NUMBER1 = [1, 2]; -var A = (function () { +var A = /** @class */ (function () { function A() { } return A; diff --git a/tests/baselines/reference/decrementOperatorWithNumberTypeInvalidOperations.js b/tests/baselines/reference/decrementOperatorWithNumberTypeInvalidOperations.js index b49f94081b98e..ac0f66f7ec502 100644 --- a/tests/baselines/reference/decrementOperatorWithNumberTypeInvalidOperations.js +++ b/tests/baselines/reference/decrementOperatorWithNumberTypeInvalidOperations.js @@ -51,7 +51,7 @@ foo()--; var NUMBER; var NUMBER1 = [1, 2]; function foo() { return 1; } -var A = (function () { +var A = /** @class */ (function () { function A() { } A.foo = function () { return 1; }; diff --git a/tests/baselines/reference/decrementOperatorWithUnsupportedBooleanType.js b/tests/baselines/reference/decrementOperatorWithUnsupportedBooleanType.js index 71e52cfd197a3..047d4f7acb395 100644 --- a/tests/baselines/reference/decrementOperatorWithUnsupportedBooleanType.js +++ b/tests/baselines/reference/decrementOperatorWithUnsupportedBooleanType.js @@ -58,7 +58,7 @@ objA.a--, M.n--; // -- operator on boolean type var BOOLEAN; function foo() { return true; } -var A = (function () { +var A = /** @class */ (function () { function A() { } A.foo = function () { return true; }; diff --git a/tests/baselines/reference/decrementOperatorWithUnsupportedStringType.js b/tests/baselines/reference/decrementOperatorWithUnsupportedStringType.js index 1502e93e75620..3012ac31e1fa8 100644 --- a/tests/baselines/reference/decrementOperatorWithUnsupportedStringType.js +++ b/tests/baselines/reference/decrementOperatorWithUnsupportedStringType.js @@ -70,7 +70,7 @@ objA.a--, M.n--; var STRING; var STRING1 = ["", ""]; function foo() { return ""; } -var A = (function () { +var A = /** @class */ (function () { function A() { } A.foo = function () { return ""; }; diff --git a/tests/baselines/reference/defaultArgsInOverloads.js b/tests/baselines/reference/defaultArgsInOverloads.js index 1b4c65db6533b..97a99547d02b5 100644 --- a/tests/baselines/reference/defaultArgsInOverloads.js +++ b/tests/baselines/reference/defaultArgsInOverloads.js @@ -23,7 +23,7 @@ var f: (a = 3) => number; function fun(a) { if (a === void 0) { a = null; } } -var C = (function () { +var C = /** @class */ (function () { function C() { } C.prototype.fun = function (a) { diff --git a/tests/baselines/reference/defaultExportsCannotMerge02.js b/tests/baselines/reference/defaultExportsCannotMerge02.js index 19a2de450770e..98bbe7b0d08e4 100644 --- a/tests/baselines/reference/defaultExportsCannotMerge02.js +++ b/tests/baselines/reference/defaultExportsCannotMerge02.js @@ -27,7 +27,7 @@ var sum = z.p1 + z.p2 //// [m1.js] "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); -var Decl = (function () { +var Decl = /** @class */ (function () { function Decl() { } return Decl; diff --git a/tests/baselines/reference/defaultExportsCannotMerge03.js b/tests/baselines/reference/defaultExportsCannotMerge03.js index 1f8ac49f3c40e..8aa10e6eab1f5 100644 --- a/tests/baselines/reference/defaultExportsCannotMerge03.js +++ b/tests/baselines/reference/defaultExportsCannotMerge03.js @@ -27,7 +27,7 @@ var sum = z.p1 + z.p2 //// [m1.js] "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); -var Decl = (function () { +var Decl = /** @class */ (function () { function Decl() { } return Decl; diff --git a/tests/baselines/reference/defaultIndexProps1.js b/tests/baselines/reference/defaultIndexProps1.js index 58591e237cabb..b634cd1bc4c3c 100644 --- a/tests/baselines/reference/defaultIndexProps1.js +++ b/tests/baselines/reference/defaultIndexProps1.js @@ -13,7 +13,7 @@ var q2 = o["v"]; //// [defaultIndexProps1.js] -var Foo = (function () { +var Foo = /** @class */ (function () { function Foo() { this.v = "Yo"; } diff --git a/tests/baselines/reference/defaultIndexProps2.js b/tests/baselines/reference/defaultIndexProps2.js index 60478ea8a3769..9db434361c5ab 100644 --- a/tests/baselines/reference/defaultIndexProps2.js +++ b/tests/baselines/reference/defaultIndexProps2.js @@ -16,7 +16,7 @@ var q = "s"[0]; //// [defaultIndexProps2.js] -var Foo = (function () { +var Foo = /** @class */ (function () { function Foo() { this.v = "Yo"; } diff --git a/tests/baselines/reference/defaultValueInConstructorOverload1.js b/tests/baselines/reference/defaultValueInConstructorOverload1.js index a8ac6e0449134..7b4409942d5fa 100644 --- a/tests/baselines/reference/defaultValueInConstructorOverload1.js +++ b/tests/baselines/reference/defaultValueInConstructorOverload1.js @@ -6,7 +6,7 @@ class C { } //// [defaultValueInConstructorOverload1.js] -var C = (function () { +var C = /** @class */ (function () { function C(x) { if (x === void 0) { x = ''; } } diff --git a/tests/baselines/reference/deleteOperatorInvalidOperations.js b/tests/baselines/reference/deleteOperatorInvalidOperations.js index 484b60b4cb4c4..c2dc237a1ee05 100644 --- a/tests/baselines/reference/deleteOperatorInvalidOperations.js +++ b/tests/baselines/reference/deleteOperatorInvalidOperations.js @@ -24,7 +24,7 @@ delete ; //expect error // miss an operand var BOOLEAN2 = delete ; // delete global variable s -var testADelx = (function () { +var testADelx = /** @class */ (function () { function testADelx(s) { this.s = s; delete s; //expect error diff --git a/tests/baselines/reference/deleteOperatorWithAnyOtherType.js b/tests/baselines/reference/deleteOperatorWithAnyOtherType.js index a9c437b0e7bdd..52a8676c5f898 100644 --- a/tests/baselines/reference/deleteOperatorWithAnyOtherType.js +++ b/tests/baselines/reference/deleteOperatorWithAnyOtherType.js @@ -72,7 +72,7 @@ function foo() { var a; return a; } -var A = (function () { +var A = /** @class */ (function () { function A() { } A.foo = function () { diff --git a/tests/baselines/reference/deleteOperatorWithBooleanType.js b/tests/baselines/reference/deleteOperatorWithBooleanType.js index 0b45c7907b0bc..14dd859352c6f 100644 --- a/tests/baselines/reference/deleteOperatorWithBooleanType.js +++ b/tests/baselines/reference/deleteOperatorWithBooleanType.js @@ -42,7 +42,7 @@ delete M.n; // delete operator on boolean type var BOOLEAN; function foo() { return true; } -var A = (function () { +var A = /** @class */ (function () { function A() { } A.foo = function () { return false; }; diff --git a/tests/baselines/reference/deleteOperatorWithNumberType.js b/tests/baselines/reference/deleteOperatorWithNumberType.js index 769dc81c63fd7..bb58eef6fec7e 100644 --- a/tests/baselines/reference/deleteOperatorWithNumberType.js +++ b/tests/baselines/reference/deleteOperatorWithNumberType.js @@ -50,7 +50,7 @@ delete objA.a, M.n; var NUMBER; var NUMBER1 = [1, 2]; function foo() { return 1; } -var A = (function () { +var A = /** @class */ (function () { function A() { } A.foo = function () { return 1; }; diff --git a/tests/baselines/reference/deleteOperatorWithStringType.js b/tests/baselines/reference/deleteOperatorWithStringType.js index 0d084d096bab4..07e17948a4b5e 100644 --- a/tests/baselines/reference/deleteOperatorWithStringType.js +++ b/tests/baselines/reference/deleteOperatorWithStringType.js @@ -49,7 +49,7 @@ delete objA.a,M.n; var STRING; var STRING1 = ["", "abc"]; function foo() { return "abc"; } -var A = (function () { +var A = /** @class */ (function () { function A() { } A.foo = function () { return ""; }; diff --git a/tests/baselines/reference/dependencyViaImportAlias.js b/tests/baselines/reference/dependencyViaImportAlias.js index 285cfbcda16e6..5e868973c8e67 100644 --- a/tests/baselines/reference/dependencyViaImportAlias.js +++ b/tests/baselines/reference/dependencyViaImportAlias.js @@ -14,7 +14,7 @@ export = A; define(["require", "exports"], function (require, exports) { "use strict"; exports.__esModule = true; - var A = (function () { + var A = /** @class */ (function () { function A() { } return A; diff --git a/tests/baselines/reference/derivedClassConstructorWithExplicitReturns01.js b/tests/baselines/reference/derivedClassConstructorWithExplicitReturns01.js index d41542e90c0f4..4fd7f4ab35b1d 100644 --- a/tests/baselines/reference/derivedClassConstructorWithExplicitReturns01.js +++ b/tests/baselines/reference/derivedClassConstructorWithExplicitReturns01.js @@ -44,7 +44,7 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var C = (function () { +var C = /** @class */ (function () { function C(value) { this.cProp = 10; return { @@ -57,7 +57,7 @@ var C = (function () { C.prototype.foo = function () { return "this never gets used."; }; return C; }()); -var D = (function (_super) { +var D = /** @class */ (function (_super) { __extends(D, _super); function D(a) { if (a === void 0) { a = 100; } diff --git a/tests/baselines/reference/derivedClassConstructorWithExplicitReturns01.sourcemap.txt b/tests/baselines/reference/derivedClassConstructorWithExplicitReturns01.sourcemap.txt index 76da9ac8a5a99..0035175c62ff0 100644 --- a/tests/baselines/reference/derivedClassConstructorWithExplicitReturns01.sourcemap.txt +++ b/tests/baselines/reference/derivedClassConstructorWithExplicitReturns01.sourcemap.txt @@ -18,7 +18,7 @@ sourceFile:derivedClassConstructorWithExplicitReturns01.ts >>> d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); >>> }; >>>})(); ->>>var C = (function () { +>>>var C = /** @class */ (function () { 1 > 2 >^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > @@ -202,7 +202,7 @@ sourceFile:derivedClassConstructorWithExplicitReturns01.ts 2 >^ 3 > 4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^-> +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > 2 >} 3 > @@ -225,7 +225,7 @@ sourceFile:derivedClassConstructorWithExplicitReturns01.ts 3 >Emitted(23, 2) Source(1, 1) + SourceIndex(0) 4 >Emitted(23, 6) Source(14, 2) + SourceIndex(0) --- ->>>var D = (function (_super) { +>>>var D = /** @class */ (function (_super) { 1-> 2 >^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1-> diff --git a/tests/baselines/reference/derivedClassConstructorWithoutSuperCall.js b/tests/baselines/reference/derivedClassConstructorWithoutSuperCall.js index 960fea90a0c74..1410617325f7a 100644 --- a/tests/baselines/reference/derivedClassConstructorWithoutSuperCall.js +++ b/tests/baselines/reference/derivedClassConstructorWithoutSuperCall.js @@ -44,12 +44,12 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var Base = (function () { +var Base = /** @class */ (function () { function Base() { } return Base; }()); -var Derived = (function (_super) { +var Derived = /** @class */ (function (_super) { __extends(Derived, _super); function Derived() { var _this = this; @@ -57,12 +57,12 @@ var Derived = (function (_super) { } return Derived; }(Base)); -var Base2 = (function () { +var Base2 = /** @class */ (function () { function Base2() { } return Base2; }()); -var Derived2 = (function (_super) { +var Derived2 = /** @class */ (function (_super) { __extends(Derived2, _super); function Derived2() { var _this = this; @@ -71,7 +71,7 @@ var Derived2 = (function (_super) { } return Derived2; }(Base2)); -var Derived3 = (function (_super) { +var Derived3 = /** @class */ (function (_super) { __extends(Derived3, _super); function Derived3() { var _this = this; @@ -80,7 +80,7 @@ var Derived3 = (function (_super) { } return Derived3; }(Base2)); -var Derived4 = (function (_super) { +var Derived4 = /** @class */ (function (_super) { __extends(Derived4, _super); function Derived4() { var _this = this; diff --git a/tests/baselines/reference/derivedClassFunctionOverridesBaseClassAccessor.js b/tests/baselines/reference/derivedClassFunctionOverridesBaseClassAccessor.js index 23a4233d1241c..277dd40c54c70 100644 --- a/tests/baselines/reference/derivedClassFunctionOverridesBaseClassAccessor.js +++ b/tests/baselines/reference/derivedClassFunctionOverridesBaseClassAccessor.js @@ -25,7 +25,7 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var Base = (function () { +var Base = /** @class */ (function () { function Base() { } Object.defineProperty(Base.prototype, "x", { @@ -40,7 +40,7 @@ var Base = (function () { return Base; }()); // error -var Derived = (function (_super) { +var Derived = /** @class */ (function (_super) { __extends(Derived, _super); function Derived() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/derivedClassIncludesInheritedMembers.js b/tests/baselines/reference/derivedClassIncludesInheritedMembers.js index 8d2010b3346d9..15fed1ebff3ec 100644 --- a/tests/baselines/reference/derivedClassIncludesInheritedMembers.js +++ b/tests/baselines/reference/derivedClassIncludesInheritedMembers.js @@ -51,7 +51,7 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var Base = (function () { +var Base = /** @class */ (function () { function Base(x) { } Base.prototype.b = function () { }; @@ -70,7 +70,7 @@ var Base = (function () { }); return Base; }()); -var Derived = (function (_super) { +var Derived = /** @class */ (function (_super) { __extends(Derived, _super); function Derived() { return _super !== null && _super.apply(this, arguments) || this; @@ -86,12 +86,12 @@ var r4 = Derived.r; var r5 = Derived.s(); var r6 = Derived.t; Derived.t = ''; -var Base2 = (function () { +var Base2 = /** @class */ (function () { function Base2() { } return Base2; }()); -var Derived2 = (function (_super) { +var Derived2 = /** @class */ (function (_super) { __extends(Derived2, _super); function Derived2() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/derivedClassOverridesIndexersWithAssignmentCompatibility.js b/tests/baselines/reference/derivedClassOverridesIndexersWithAssignmentCompatibility.js index fceefd905cc81..2f1b3113425c1 100644 --- a/tests/baselines/reference/derivedClassOverridesIndexersWithAssignmentCompatibility.js +++ b/tests/baselines/reference/derivedClassOverridesIndexersWithAssignmentCompatibility.js @@ -28,26 +28,26 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var Base = (function () { +var Base = /** @class */ (function () { function Base() { } return Base; }()); // ok, use assignment compatibility -var Derived = (function (_super) { +var Derived = /** @class */ (function (_super) { __extends(Derived, _super); function Derived() { return _super !== null && _super.apply(this, arguments) || this; } return Derived; }(Base)); -var Base2 = (function () { +var Base2 = /** @class */ (function () { function Base2() { } return Base2; }()); // ok, use assignment compatibility -var Derived2 = (function (_super) { +var Derived2 = /** @class */ (function (_super) { __extends(Derived2, _super); function Derived2() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/derivedClassOverridesPrivateFunction1.js b/tests/baselines/reference/derivedClassOverridesPrivateFunction1.js index a7c35a96ac385..bb4054e60244c 100644 --- a/tests/baselines/reference/derivedClassOverridesPrivateFunction1.js +++ b/tests/baselines/reference/derivedClassOverridesPrivateFunction1.js @@ -26,7 +26,7 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var BaseClass = (function () { +var BaseClass = /** @class */ (function () { function BaseClass() { this._init(); } @@ -34,7 +34,7 @@ var BaseClass = (function () { }; return BaseClass; }()); -var DerivedClass = (function (_super) { +var DerivedClass = /** @class */ (function (_super) { __extends(DerivedClass, _super); function DerivedClass() { return _super.call(this) || this; diff --git a/tests/baselines/reference/derivedClassOverridesPrivates.js b/tests/baselines/reference/derivedClassOverridesPrivates.js index 642453857c514..ce5163b22573b 100644 --- a/tests/baselines/reference/derivedClassOverridesPrivates.js +++ b/tests/baselines/reference/derivedClassOverridesPrivates.js @@ -26,24 +26,24 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var Base = (function () { +var Base = /** @class */ (function () { function Base() { } return Base; }()); -var Derived = (function (_super) { +var Derived = /** @class */ (function (_super) { __extends(Derived, _super); function Derived() { return _super !== null && _super.apply(this, arguments) || this; } return Derived; }(Base)); -var Base2 = (function () { +var Base2 = /** @class */ (function () { function Base2() { } return Base2; }()); -var Derived2 = (function (_super) { +var Derived2 = /** @class */ (function (_super) { __extends(Derived2, _super); function Derived2() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/derivedClassOverridesProtectedMembers.js b/tests/baselines/reference/derivedClassOverridesProtectedMembers.js index 7369354ffd96d..6b6001f961957 100644 --- a/tests/baselines/reference/derivedClassOverridesProtectedMembers.js +++ b/tests/baselines/reference/derivedClassOverridesProtectedMembers.js @@ -48,7 +48,7 @@ var __extends = (this && this.__extends) || (function () { })(); var x; var y; -var Base = (function () { +var Base = /** @class */ (function () { function Base(a) { } Base.prototype.b = function (a) { }; @@ -67,7 +67,7 @@ var Base = (function () { }); return Base; }()); -var Derived = (function (_super) { +var Derived = /** @class */ (function (_super) { __extends(Derived, _super); function Derived(a) { return _super.call(this, x) || this; diff --git a/tests/baselines/reference/derivedClassOverridesProtectedMembers2.js b/tests/baselines/reference/derivedClassOverridesProtectedMembers2.js index 6eef011e0f430..fc0d0ecf32e5f 100644 --- a/tests/baselines/reference/derivedClassOverridesProtectedMembers2.js +++ b/tests/baselines/reference/derivedClassOverridesProtectedMembers2.js @@ -76,7 +76,7 @@ var __extends = (this && this.__extends) || (function () { })(); var x; var y; -var Base = (function () { +var Base = /** @class */ (function () { function Base(a) { } Base.prototype.b = function (a) { }; @@ -96,7 +96,7 @@ var Base = (function () { return Base; }()); // Increase visibility of all protected members to public -var Derived = (function (_super) { +var Derived = /** @class */ (function (_super) { __extends(Derived, _super); function Derived(a) { return _super.call(this, a) || this; @@ -128,12 +128,12 @@ var r5 = Derived.s(y); var r6 = Derived.t; var r6a = Derived.u; Derived.t = y; -var Base2 = (function () { +var Base2 = /** @class */ (function () { function Base2() { } return Base2; }()); -var Derived2 = (function (_super) { +var Derived2 = /** @class */ (function (_super) { __extends(Derived2, _super); function Derived2() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/derivedClassOverridesProtectedMembers3.js b/tests/baselines/reference/derivedClassOverridesProtectedMembers3.js index c1fcf54d66358..9c1671aa66b22 100644 --- a/tests/baselines/reference/derivedClassOverridesProtectedMembers3.js +++ b/tests/baselines/reference/derivedClassOverridesProtectedMembers3.js @@ -83,7 +83,7 @@ var __extends = (this && this.__extends) || (function () { })(); var x; var y; -var Base = (function () { +var Base = /** @class */ (function () { function Base(a) { } Base.prototype.b = function (a) { }; @@ -104,14 +104,14 @@ var Base = (function () { }()); // Errors // decrease visibility of all public members to protected -var Derived1 = (function (_super) { +var Derived1 = /** @class */ (function (_super) { __extends(Derived1, _super); function Derived1(a) { return _super.call(this, a) || this; } return Derived1; }(Base)); -var Derived2 = (function (_super) { +var Derived2 = /** @class */ (function (_super) { __extends(Derived2, _super); function Derived2(a) { return _super.call(this, a) || this; @@ -119,7 +119,7 @@ var Derived2 = (function (_super) { Derived2.prototype.b = function (a) { }; return Derived2; }(Base)); -var Derived3 = (function (_super) { +var Derived3 = /** @class */ (function (_super) { __extends(Derived3, _super); function Derived3(a) { return _super.call(this, a) || this; @@ -131,7 +131,7 @@ var Derived3 = (function (_super) { }); return Derived3; }(Base)); -var Derived4 = (function (_super) { +var Derived4 = /** @class */ (function (_super) { __extends(Derived4, _super); function Derived4(a) { return _super.call(this, a) || this; @@ -143,21 +143,21 @@ var Derived4 = (function (_super) { }); return Derived4; }(Base)); -var Derived5 = (function (_super) { +var Derived5 = /** @class */ (function (_super) { __extends(Derived5, _super); function Derived5(a) { return _super.call(this, a) || this; } return Derived5; }(Base)); -var Derived6 = (function (_super) { +var Derived6 = /** @class */ (function (_super) { __extends(Derived6, _super); function Derived6(a) { return _super.call(this, a) || this; } return Derived6; }(Base)); -var Derived7 = (function (_super) { +var Derived7 = /** @class */ (function (_super) { __extends(Derived7, _super); function Derived7(a) { return _super.call(this, a) || this; @@ -165,7 +165,7 @@ var Derived7 = (function (_super) { Derived7.s = function (a) { }; return Derived7; }(Base)); -var Derived8 = (function (_super) { +var Derived8 = /** @class */ (function (_super) { __extends(Derived8, _super); function Derived8(a) { return _super.call(this, a) || this; @@ -177,7 +177,7 @@ var Derived8 = (function (_super) { }); return Derived8; }(Base)); -var Derived9 = (function (_super) { +var Derived9 = /** @class */ (function (_super) { __extends(Derived9, _super); function Derived9(a) { return _super.call(this, a) || this; @@ -189,7 +189,7 @@ var Derived9 = (function (_super) { }); return Derived9; }(Base)); -var Derived10 = (function (_super) { +var Derived10 = /** @class */ (function (_super) { __extends(Derived10, _super); function Derived10(a) { return _super.call(this, a) || this; diff --git a/tests/baselines/reference/derivedClassOverridesProtectedMembers4.js b/tests/baselines/reference/derivedClassOverridesProtectedMembers4.js index 594e8166e5e33..351bf055dbb84 100644 --- a/tests/baselines/reference/derivedClassOverridesProtectedMembers4.js +++ b/tests/baselines/reference/derivedClassOverridesProtectedMembers4.js @@ -27,19 +27,19 @@ var __extends = (this && this.__extends) || (function () { })(); var x; var y; -var Base = (function () { +var Base = /** @class */ (function () { function Base() { } return Base; }()); -var Derived1 = (function (_super) { +var Derived1 = /** @class */ (function (_super) { __extends(Derived1, _super); function Derived1() { return _super !== null && _super.apply(this, arguments) || this; } return Derived1; }(Base)); -var Derived2 = (function (_super) { +var Derived2 = /** @class */ (function (_super) { __extends(Derived2, _super); function Derived2() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/derivedClassOverridesPublicMembers.js b/tests/baselines/reference/derivedClassOverridesPublicMembers.js index af9a013a3d829..38ff01d648754 100644 --- a/tests/baselines/reference/derivedClassOverridesPublicMembers.js +++ b/tests/baselines/reference/derivedClassOverridesPublicMembers.js @@ -75,7 +75,7 @@ var __extends = (this && this.__extends) || (function () { })(); var x; var y; -var Base = (function () { +var Base = /** @class */ (function () { function Base(a) { } Base.prototype.b = function (a) { }; @@ -94,7 +94,7 @@ var Base = (function () { }); return Base; }()); -var Derived = (function (_super) { +var Derived = /** @class */ (function (_super) { __extends(Derived, _super); function Derived(a) { return _super.call(this, x) || this; @@ -126,12 +126,12 @@ var r5 = Derived.s(y); var r6 = Derived.t; var r6a = Derived.u; Derived.t = y; -var Base2 = (function () { +var Base2 = /** @class */ (function () { function Base2() { } return Base2; }()); -var Derived2 = (function (_super) { +var Derived2 = /** @class */ (function (_super) { __extends(Derived2, _super); function Derived2() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/derivedClassOverridesWithoutSubtype.js b/tests/baselines/reference/derivedClassOverridesWithoutSubtype.js index fa7eb924653ee..c9c7be990c7df 100644 --- a/tests/baselines/reference/derivedClassOverridesWithoutSubtype.js +++ b/tests/baselines/reference/derivedClassOverridesWithoutSubtype.js @@ -34,24 +34,24 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var Base = (function () { +var Base = /** @class */ (function () { function Base() { } return Base; }()); -var Derived = (function (_super) { +var Derived = /** @class */ (function (_super) { __extends(Derived, _super); function Derived() { return _super !== null && _super.apply(this, arguments) || this; } return Derived; }(Base)); -var Base2 = (function () { +var Base2 = /** @class */ (function () { function Base2() { } return Base2; }()); -var Derived2 = (function (_super) { +var Derived2 = /** @class */ (function (_super) { __extends(Derived2, _super); function Derived2() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/derivedClassParameterProperties.js b/tests/baselines/reference/derivedClassParameterProperties.js index d8d93e350789f..74f3057b24bb8 100644 --- a/tests/baselines/reference/derivedClassParameterProperties.js +++ b/tests/baselines/reference/derivedClassParameterProperties.js @@ -106,12 +106,12 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var Base = (function () { +var Base = /** @class */ (function () { function Base() { } return Base; }()); -var Derived = (function (_super) { +var Derived = /** @class */ (function (_super) { __extends(Derived, _super); function Derived(y) { var _this = this; @@ -121,7 +121,7 @@ var Derived = (function (_super) { } return Derived; }(Base)); -var Derived2 = (function (_super) { +var Derived2 = /** @class */ (function (_super) { __extends(Derived2, _super); function Derived2(y) { var _this = this; @@ -132,7 +132,7 @@ var Derived2 = (function (_super) { } return Derived2; }(Base)); -var Derived3 = (function (_super) { +var Derived3 = /** @class */ (function (_super) { __extends(Derived3, _super); function Derived3(y) { var _this = _super.call(this) || this; @@ -142,7 +142,7 @@ var Derived3 = (function (_super) { } return Derived3; }(Base)); -var Derived4 = (function (_super) { +var Derived4 = /** @class */ (function (_super) { __extends(Derived4, _super); function Derived4(y) { var _this = this; @@ -153,7 +153,7 @@ var Derived4 = (function (_super) { } return Derived4; }(Base)); -var Derived5 = (function (_super) { +var Derived5 = /** @class */ (function (_super) { __extends(Derived5, _super); function Derived5(y) { var _this = _super.call(this) || this; @@ -163,7 +163,7 @@ var Derived5 = (function (_super) { } return Derived5; }(Base)); -var Derived6 = (function (_super) { +var Derived6 = /** @class */ (function (_super) { __extends(Derived6, _super); function Derived6(y) { var _this = this; @@ -174,7 +174,7 @@ var Derived6 = (function (_super) { } return Derived6; }(Base)); -var Derived7 = (function (_super) { +var Derived7 = /** @class */ (function (_super) { __extends(Derived7, _super); function Derived7(y) { var _this = this; @@ -186,7 +186,7 @@ var Derived7 = (function (_super) { } return Derived7; }(Base)); -var Derived8 = (function (_super) { +var Derived8 = /** @class */ (function (_super) { __extends(Derived8, _super); function Derived8(y) { var _this = _super.call(this) || this; @@ -198,12 +198,12 @@ var Derived8 = (function (_super) { return Derived8; }(Base)); // generic cases of Derived7 and Derived8 -var Base2 = (function () { +var Base2 = /** @class */ (function () { function Base2() { } return Base2; }()); -var Derived9 = (function (_super) { +var Derived9 = /** @class */ (function (_super) { __extends(Derived9, _super); function Derived9(y) { var _this = this; @@ -215,7 +215,7 @@ var Derived9 = (function (_super) { } return Derived9; }(Base2)); -var Derived10 = (function (_super) { +var Derived10 = /** @class */ (function (_super) { __extends(Derived10, _super); function Derived10(y) { var _this = _super.call(this) || this; diff --git a/tests/baselines/reference/derivedClassSuperCallsInNonConstructorMembers.js b/tests/baselines/reference/derivedClassSuperCallsInNonConstructorMembers.js index 3ca0d13e6713e..0205636e1f755 100644 --- a/tests/baselines/reference/derivedClassSuperCallsInNonConstructorMembers.js +++ b/tests/baselines/reference/derivedClassSuperCallsInNonConstructorMembers.js @@ -43,12 +43,12 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var Base = (function () { +var Base = /** @class */ (function () { function Base() { } return Base; }()); -var Derived = (function (_super) { +var Derived = /** @class */ (function (_super) { __extends(Derived, _super); function Derived() { var _this = _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/derivedClassSuperCallsWithThisArg.js b/tests/baselines/reference/derivedClassSuperCallsWithThisArg.js index f63a8076a0bab..df516fe53ccaa 100644 --- a/tests/baselines/reference/derivedClassSuperCallsWithThisArg.js +++ b/tests/baselines/reference/derivedClassSuperCallsWithThisArg.js @@ -39,12 +39,12 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var Base = (function () { +var Base = /** @class */ (function () { function Base(a) { } return Base; }()); -var Derived = (function (_super) { +var Derived = /** @class */ (function (_super) { __extends(Derived, _super); function Derived() { var _this = _super.call(this, _this) || this; @@ -52,7 +52,7 @@ var Derived = (function (_super) { } return Derived; }(Base)); -var Derived2 = (function (_super) { +var Derived2 = /** @class */ (function (_super) { __extends(Derived2, _super); function Derived2(a) { var _this = _super.call(this, _this) || this; @@ -61,7 +61,7 @@ var Derived2 = (function (_super) { } return Derived2; }(Base)); -var Derived3 = (function (_super) { +var Derived3 = /** @class */ (function (_super) { __extends(Derived3, _super); function Derived3(a) { var _this = _super.call(this, function () { return _this; }) || this; @@ -70,7 +70,7 @@ var Derived3 = (function (_super) { } return Derived3; }(Base)); -var Derived4 = (function (_super) { +var Derived4 = /** @class */ (function (_super) { __extends(Derived4, _super); function Derived4(a) { var _this = _super.call(this, function () { return this; }) || this; diff --git a/tests/baselines/reference/derivedClassTransitivity.js b/tests/baselines/reference/derivedClassTransitivity.js index 83a750c707d12..9afb21043894e 100644 --- a/tests/baselines/reference/derivedClassTransitivity.js +++ b/tests/baselines/reference/derivedClassTransitivity.js @@ -32,13 +32,13 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var C = (function () { +var C = /** @class */ (function () { function C() { } C.prototype.foo = function (x) { }; return C; }()); -var D = (function (_super) { +var D = /** @class */ (function (_super) { __extends(D, _super); function D() { return _super !== null && _super.apply(this, arguments) || this; @@ -46,7 +46,7 @@ var D = (function (_super) { D.prototype.foo = function () { }; // ok to drop parameters return D; }(C)); -var E = (function (_super) { +var E = /** @class */ (function (_super) { __extends(E, _super); function E() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/derivedClassTransitivity2.js b/tests/baselines/reference/derivedClassTransitivity2.js index 7cd7d73d60418..45147bb8af0dc 100644 --- a/tests/baselines/reference/derivedClassTransitivity2.js +++ b/tests/baselines/reference/derivedClassTransitivity2.js @@ -32,13 +32,13 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var C = (function () { +var C = /** @class */ (function () { function C() { } C.prototype.foo = function (x, y) { }; return C; }()); -var D = (function (_super) { +var D = /** @class */ (function (_super) { __extends(D, _super); function D() { return _super !== null && _super.apply(this, arguments) || this; @@ -46,7 +46,7 @@ var D = (function (_super) { D.prototype.foo = function (x) { }; // ok to drop parameters return D; }(C)); -var E = (function (_super) { +var E = /** @class */ (function (_super) { __extends(E, _super); function E() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/derivedClassTransitivity3.js b/tests/baselines/reference/derivedClassTransitivity3.js index 35a080f180044..0dbeb262ea113 100644 --- a/tests/baselines/reference/derivedClassTransitivity3.js +++ b/tests/baselines/reference/derivedClassTransitivity3.js @@ -32,13 +32,13 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var C = (function () { +var C = /** @class */ (function () { function C() { } C.prototype.foo = function (x, y) { }; return C; }()); -var D = (function (_super) { +var D = /** @class */ (function (_super) { __extends(D, _super); function D() { return _super !== null && _super.apply(this, arguments) || this; @@ -46,7 +46,7 @@ var D = (function (_super) { D.prototype.foo = function (x) { }; // ok to drop parameters return D; }(C)); -var E = (function (_super) { +var E = /** @class */ (function (_super) { __extends(E, _super); function E() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/derivedClassTransitivity4.js b/tests/baselines/reference/derivedClassTransitivity4.js index e0f82d55a7c79..a734569726c0a 100644 --- a/tests/baselines/reference/derivedClassTransitivity4.js +++ b/tests/baselines/reference/derivedClassTransitivity4.js @@ -32,13 +32,13 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var C = (function () { +var C = /** @class */ (function () { function C() { } C.prototype.foo = function (x) { }; return C; }()); -var D = (function (_super) { +var D = /** @class */ (function (_super) { __extends(D, _super); function D() { return _super !== null && _super.apply(this, arguments) || this; @@ -46,7 +46,7 @@ var D = (function (_super) { D.prototype.foo = function () { }; // ok to drop parameters return D; }(C)); -var E = (function (_super) { +var E = /** @class */ (function (_super) { __extends(E, _super); function E() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/derivedClassWithAny.js b/tests/baselines/reference/derivedClassWithAny.js index c8ed8ce5cad26..35961d59884dc 100644 --- a/tests/baselines/reference/derivedClassWithAny.js +++ b/tests/baselines/reference/derivedClassWithAny.js @@ -70,7 +70,7 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var C = (function () { +var C = /** @class */ (function () { function C() { } Object.defineProperty(C.prototype, "X", { @@ -93,7 +93,7 @@ var C = (function () { }; return C; }()); -var D = (function (_super) { +var D = /** @class */ (function (_super) { __extends(D, _super); function D() { return _super !== null && _super.apply(this, arguments) || this; @@ -121,7 +121,7 @@ var D = (function (_super) { return D; }(C)); // if D is a valid class definition than E is now not safe tranisitively through C -var E = (function (_super) { +var E = /** @class */ (function (_super) { __extends(E, _super); function E() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/derivedClassWithPrivateInstanceShadowingProtectedInstance.js b/tests/baselines/reference/derivedClassWithPrivateInstanceShadowingProtectedInstance.js index c92a192a86416..0ea4cde4ca9d5 100644 --- a/tests/baselines/reference/derivedClassWithPrivateInstanceShadowingProtectedInstance.js +++ b/tests/baselines/reference/derivedClassWithPrivateInstanceShadowingProtectedInstance.js @@ -32,7 +32,7 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var Base = (function () { +var Base = /** @class */ (function () { function Base() { } Base.prototype.fn = function () { @@ -47,7 +47,7 @@ var Base = (function () { return Base; }()); // error, not a subtype -var Derived = (function (_super) { +var Derived = /** @class */ (function (_super) { __extends(Derived, _super); function Derived() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/derivedClassWithPrivateInstanceShadowingPublicInstance.js b/tests/baselines/reference/derivedClassWithPrivateInstanceShadowingPublicInstance.js index 36c6cb56563b4..d771d3fcc544d 100644 --- a/tests/baselines/reference/derivedClassWithPrivateInstanceShadowingPublicInstance.js +++ b/tests/baselines/reference/derivedClassWithPrivateInstanceShadowingPublicInstance.js @@ -43,7 +43,7 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var Base = (function () { +var Base = /** @class */ (function () { function Base() { } Base.prototype.fn = function () { @@ -58,7 +58,7 @@ var Base = (function () { return Base; }()); // error, not a subtype -var Derived = (function (_super) { +var Derived = /** @class */ (function (_super) { __extends(Derived, _super); function Derived() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/derivedClassWithPrivateStaticShadowingProtectedStatic.js b/tests/baselines/reference/derivedClassWithPrivateStaticShadowingProtectedStatic.js index e5310f6d837f4..58c63e2bd1189 100644 --- a/tests/baselines/reference/derivedClassWithPrivateStaticShadowingProtectedStatic.js +++ b/tests/baselines/reference/derivedClassWithPrivateStaticShadowingProtectedStatic.js @@ -31,7 +31,7 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var Base = (function () { +var Base = /** @class */ (function () { function Base() { } Base.fn = function () { @@ -46,7 +46,7 @@ var Base = (function () { return Base; }()); // should be error -var Derived = (function (_super) { +var Derived = /** @class */ (function (_super) { __extends(Derived, _super); function Derived() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/derivedClassWithPrivateStaticShadowingPublicStatic.js b/tests/baselines/reference/derivedClassWithPrivateStaticShadowingPublicStatic.js index 6e39028ce3414..04abeecd286ce 100644 --- a/tests/baselines/reference/derivedClassWithPrivateStaticShadowingPublicStatic.js +++ b/tests/baselines/reference/derivedClassWithPrivateStaticShadowingPublicStatic.js @@ -44,7 +44,7 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var Base = (function () { +var Base = /** @class */ (function () { function Base() { } Base.fn = function () { @@ -60,7 +60,7 @@ var Base = (function () { }()); // BUG 847404 // should be error -var Derived = (function (_super) { +var Derived = /** @class */ (function (_super) { __extends(Derived, _super); function Derived() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/derivedClassWithoutExplicitConstructor.js b/tests/baselines/reference/derivedClassWithoutExplicitConstructor.js index 1fd02f5ba627e..115661cf860ef 100644 --- a/tests/baselines/reference/derivedClassWithoutExplicitConstructor.js +++ b/tests/baselines/reference/derivedClassWithoutExplicitConstructor.js @@ -36,14 +36,14 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var Base = (function () { +var Base = /** @class */ (function () { function Base(x) { this.a = 1; this.a = x; } return Base; }()); -var Derived = (function (_super) { +var Derived = /** @class */ (function (_super) { __extends(Derived, _super); function Derived() { var _this = _super !== null && _super.apply(this, arguments) || this; @@ -55,13 +55,13 @@ var Derived = (function (_super) { }(Base)); var r = new Derived(); // error var r2 = new Derived(1); -var Base2 = (function () { +var Base2 = /** @class */ (function () { function Base2(x) { this.a = x; } return Base2; }()); -var D = (function (_super) { +var D = /** @class */ (function (_super) { __extends(D, _super); function D() { var _this = _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/derivedClassWithoutExplicitConstructor2.js b/tests/baselines/reference/derivedClassWithoutExplicitConstructor2.js index 178ca2be16de6..316cfc8d86781 100644 --- a/tests/baselines/reference/derivedClassWithoutExplicitConstructor2.js +++ b/tests/baselines/reference/derivedClassWithoutExplicitConstructor2.js @@ -44,14 +44,14 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var Base = (function () { +var Base = /** @class */ (function () { function Base(x) { this.a = 1; this.a = x; } return Base; }()); -var Derived = (function (_super) { +var Derived = /** @class */ (function (_super) { __extends(Derived, _super); function Derived() { var _this = _super !== null && _super.apply(this, arguments) || this; @@ -65,13 +65,13 @@ var r = new Derived(); // error var r2 = new Derived(1); var r3 = new Derived(1, 2); var r4 = new Derived(1, 2, 3); -var Base2 = (function () { +var Base2 = /** @class */ (function () { function Base2(x) { this.a = x; } return Base2; }()); -var D = (function (_super) { +var D = /** @class */ (function (_super) { __extends(D, _super); function D() { var _this = _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/derivedClassWithoutExplicitConstructor3.js b/tests/baselines/reference/derivedClassWithoutExplicitConstructor3.js index 86f6943350423..34dc411daa956 100644 --- a/tests/baselines/reference/derivedClassWithoutExplicitConstructor3.js +++ b/tests/baselines/reference/derivedClassWithoutExplicitConstructor3.js @@ -58,14 +58,14 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var Base = (function () { +var Base = /** @class */ (function () { function Base(x) { this.a = 1; this.a = x; } return Base; }()); -var Derived = (function (_super) { +var Derived = /** @class */ (function (_super) { __extends(Derived, _super); function Derived(y, z) { var _this = _super.call(this, 2) || this; @@ -75,7 +75,7 @@ var Derived = (function (_super) { } return Derived; }(Base)); -var Derived2 = (function (_super) { +var Derived2 = /** @class */ (function (_super) { __extends(Derived2, _super); function Derived2() { var _this = _super !== null && _super.apply(this, arguments) || this; @@ -88,13 +88,13 @@ var Derived2 = (function (_super) { var r = new Derived(); // error var r2 = new Derived2(1); // error var r3 = new Derived('', ''); -var Base2 = (function () { +var Base2 = /** @class */ (function () { function Base2(x) { this.a = x; } return Base2; }()); -var D = (function (_super) { +var D = /** @class */ (function (_super) { __extends(D, _super); function D(y, z) { var _this = _super.call(this, 2) || this; @@ -104,7 +104,7 @@ var D = (function (_super) { } return D; }(Base)); -var D2 = (function (_super) { +var D2 = /** @class */ (function (_super) { __extends(D2, _super); function D2() { var _this = _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/derivedClasses.js b/tests/baselines/reference/derivedClasses.js index b23161d00d2c5..57ed73d61234b 100644 --- a/tests/baselines/reference/derivedClasses.js +++ b/tests/baselines/reference/derivedClasses.js @@ -41,7 +41,7 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var Red = (function (_super) { +var Red = /** @class */ (function (_super) { __extends(Red, _super); function Red() { return _super !== null && _super.apply(this, arguments) || this; @@ -53,14 +53,14 @@ var Red = (function (_super) { }; return Red; }(Color)); -var Color = (function () { +var Color = /** @class */ (function () { function Color() { } Color.prototype.shade = function () { return "some shade"; }; Color.prototype.hue = function () { return "some hue"; }; return Color; }()); -var Blue = (function (_super) { +var Blue = /** @class */ (function (_super) { __extends(Blue, _super); function Blue() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/derivedGenericClassWithAny.js b/tests/baselines/reference/derivedGenericClassWithAny.js index 0cf4c316a44bd..6b1698e602b4e 100644 --- a/tests/baselines/reference/derivedGenericClassWithAny.js +++ b/tests/baselines/reference/derivedGenericClassWithAny.js @@ -53,7 +53,7 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var C = (function () { +var C = /** @class */ (function () { function C() { } Object.defineProperty(C.prototype, "X", { @@ -66,7 +66,7 @@ var C = (function () { }; return C; }()); -var D = (function (_super) { +var D = /** @class */ (function (_super) { __extends(D, _super); function D() { return _super !== null && _super.apply(this, arguments) || this; @@ -94,7 +94,7 @@ var D = (function (_super) { return D; }(C)); // if D is a valid class definition than E is now not safe tranisitively through C -var E = (function (_super) { +var E = /** @class */ (function (_super) { __extends(E, _super); function E() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/derivedTypeAccessesHiddenBaseCallViaSuperPropertyAccess.js b/tests/baselines/reference/derivedTypeAccessesHiddenBaseCallViaSuperPropertyAccess.js index a190b26901c9e..7ef071cd3c74e 100644 --- a/tests/baselines/reference/derivedTypeAccessesHiddenBaseCallViaSuperPropertyAccess.js +++ b/tests/baselines/reference/derivedTypeAccessesHiddenBaseCallViaSuperPropertyAccess.js @@ -28,7 +28,7 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var Base = (function () { +var Base = /** @class */ (function () { function Base() { } Base.prototype.foo = function (x) { @@ -36,7 +36,7 @@ var Base = (function () { }; return Base; }()); -var Derived = (function (_super) { +var Derived = /** @class */ (function (_super) { __extends(Derived, _super); function Derived() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/derivedTypeCallingBaseImplWithOptionalParams.js b/tests/baselines/reference/derivedTypeCallingBaseImplWithOptionalParams.js index f9982a7bfe9ca..7e67056c6780f 100644 --- a/tests/baselines/reference/derivedTypeCallingBaseImplWithOptionalParams.js +++ b/tests/baselines/reference/derivedTypeCallingBaseImplWithOptionalParams.js @@ -14,7 +14,7 @@ var y: MyClass = new MyClass(); y.myMethod(); // error //// [derivedTypeCallingBaseImplWithOptionalParams.js] -var MyClass = (function () { +var MyClass = /** @class */ (function () { function MyClass() { } MyClass.prototype.myMethod = function (myList) { diff --git a/tests/baselines/reference/derivedTypeDoesNotRequireExtendsClause.js b/tests/baselines/reference/derivedTypeDoesNotRequireExtendsClause.js index 26f4408e41e97..70a085a342df4 100644 --- a/tests/baselines/reference/derivedTypeDoesNotRequireExtendsClause.js +++ b/tests/baselines/reference/derivedTypeDoesNotRequireExtendsClause.js @@ -31,17 +31,17 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var Base = (function () { +var Base = /** @class */ (function () { function Base() { } return Base; }()); -var Derived = (function () { +var Derived = /** @class */ (function () { function Derived() { } return Derived; }()); -var Derived2 = (function (_super) { +var Derived2 = /** @class */ (function (_super) { __extends(Derived2, _super); function Derived2() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/destructuringParameterDeclaration1ES5.js b/tests/baselines/reference/destructuringParameterDeclaration1ES5.js index 28e6429fb7fa0..233894553100f 100644 --- a/tests/baselines/reference/destructuringParameterDeclaration1ES5.js +++ b/tests/baselines/reference/destructuringParameterDeclaration1ES5.js @@ -178,7 +178,7 @@ function d0(x) { } function d0(x) { if (x === void 0) { x = 10; } } -var C2 = (function () { +var C2 = /** @class */ (function () { function C2() { } C2.prototype.d3 = function () { }; @@ -188,7 +188,7 @@ var C2 = (function () { }; return C2; }()); -var C3 = (function () { +var C3 = /** @class */ (function () { function C3() { } C3.prototype.d3 = function (_a) { diff --git a/tests/baselines/reference/destructuringParameterDeclaration1ES5iterable.js b/tests/baselines/reference/destructuringParameterDeclaration1ES5iterable.js index d903618603586..5e14800bb5646 100644 --- a/tests/baselines/reference/destructuringParameterDeclaration1ES5iterable.js +++ b/tests/baselines/reference/destructuringParameterDeclaration1ES5iterable.js @@ -194,7 +194,7 @@ function d0(x) { } function d0(x) { if (x === void 0) { x = 10; } } -var C2 = (function () { +var C2 = /** @class */ (function () { function C2() { } C2.prototype.d3 = function () { }; @@ -204,7 +204,7 @@ var C2 = (function () { }; return C2; }()); -var C3 = (function () { +var C3 = /** @class */ (function () { function C3() { } C3.prototype.d3 = function (_a) { diff --git a/tests/baselines/reference/destructuringParameterDeclaration2.js b/tests/baselines/reference/destructuringParameterDeclaration2.js index 7cc2cb52318c8..94435f967c571 100644 --- a/tests/baselines/reference/destructuringParameterDeclaration2.js +++ b/tests/baselines/reference/destructuringParameterDeclaration2.js @@ -127,7 +127,7 @@ function d1(_a) { function d2(_a) { var x = _a.x, y = _a.y, z = _a.z; } // Error, binding pattern can't be optional in implementation signature -var C4 = (function () { +var C4 = /** @class */ (function () { function C4() { } C4.prototype.d3 = function (_a) { diff --git a/tests/baselines/reference/destructuringParameterDeclaration4.js b/tests/baselines/reference/destructuringParameterDeclaration4.js index 52007df17c94b..724c7330b27c3 100644 --- a/tests/baselines/reference/destructuringParameterDeclaration4.js +++ b/tests/baselines/reference/destructuringParameterDeclaration4.js @@ -82,7 +82,7 @@ a5([1, 2, "string", false, true]); // Error, parameter type is [any, any, [[any] a5([1, 2]); // Error, parameter type is [any, any, [[any]]] a6([1, 2, "string"]); // Error, parameter type is number[] var temp = [1, 2, 3]; -var C = (function () { +var C = /** @class */ (function () { function C() { var temp = []; for (var _i = 0; _i < arguments.length; _i++) { diff --git a/tests/baselines/reference/destructuringParameterDeclaration5.js b/tests/baselines/reference/destructuringParameterDeclaration5.js index d249952873591..ba889925c2317 100644 --- a/tests/baselines/reference/destructuringParameterDeclaration5.js +++ b/tests/baselines/reference/destructuringParameterDeclaration5.js @@ -62,24 +62,24 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var Class = (function () { +var Class = /** @class */ (function () { function Class() { } return Class; }()); -var SubClass = (function (_super) { +var SubClass = /** @class */ (function (_super) { __extends(SubClass, _super); function SubClass() { return _super.call(this) || this; } return SubClass; }(Class)); -var D = (function () { +var D = /** @class */ (function () { function D() { } return D; }()); -var SubD = (function (_super) { +var SubD = /** @class */ (function (_super) { __extends(SubD, _super); function SubD() { return _super.call(this) || this; diff --git a/tests/baselines/reference/destructuringParameterProperties1.js b/tests/baselines/reference/destructuringParameterProperties1.js index cfe16d642d3e2..2485db1f74122 100644 --- a/tests/baselines/reference/destructuringParameterProperties1.js +++ b/tests/baselines/reference/destructuringParameterProperties1.js @@ -30,19 +30,19 @@ c3 = new C3({x: 0, "y": "y", z: true}); var [c3_x, c3_y, c3_z] = [c3.x, c3.y, c3.z]; //// [destructuringParameterProperties1.js] -var C1 = (function () { +var C1 = /** @class */ (function () { function C1(_a) { var x = _a[0], y = _a[1], z = _a[2]; } return C1; }()); -var C2 = (function () { +var C2 = /** @class */ (function () { function C2(_a) { var x = _a[0], y = _a[1], z = _a[2]; } return C2; }()); -var C3 = (function () { +var C3 = /** @class */ (function () { function C3(_a) { var x = _a.x, y = _a.y, z = _a.z; } diff --git a/tests/baselines/reference/destructuringParameterProperties2.js b/tests/baselines/reference/destructuringParameterProperties2.js index 4dd12bdc317a4..21959a6be87e2 100644 --- a/tests/baselines/reference/destructuringParameterProperties2.js +++ b/tests/baselines/reference/destructuringParameterProperties2.js @@ -30,7 +30,7 @@ var [z_a, z_b, z_c] = [z.getA(), z.getB(), z.getC()]; //// [destructuringParameterProperties2.js] -var C1 = (function () { +var C1 = /** @class */ (function () { function C1(k, _a) { var a = _a[0], b = _a[1], c = _a[2]; this.k = k; diff --git a/tests/baselines/reference/destructuringParameterProperties3.js b/tests/baselines/reference/destructuringParameterProperties3.js index d9b0c5aebf6f1..4c148256f39cd 100644 --- a/tests/baselines/reference/destructuringParameterProperties3.js +++ b/tests/baselines/reference/destructuringParameterProperties3.js @@ -33,7 +33,7 @@ var [z_a, z_b, z_c] = [z.getA(), z.getB(), z.getC()]; //// [destructuringParameterProperties3.js] -var C1 = (function () { +var C1 = /** @class */ (function () { function C1(k, _a) { var a = _a[0], b = _a[1], c = _a[2]; this.k = k; diff --git a/tests/baselines/reference/destructuringParameterProperties5.js b/tests/baselines/reference/destructuringParameterProperties5.js index f07f6e9f5a531..5915b62a140a8 100644 --- a/tests/baselines/reference/destructuringParameterProperties5.js +++ b/tests/baselines/reference/destructuringParameterProperties5.js @@ -13,7 +13,7 @@ var a = new C1([{ x1: 10, x2: "", x3: true }, "", false]); var [a_x1, a_x2, a_x3, a_y, a_z] = [a.x1, a.x2, a.x3, a.y, a.z]; //// [destructuringParameterProperties5.js] -var C1 = (function () { +var C1 = /** @class */ (function () { function C1(_a) { var _b = _a[0], x1 = _b.x1, x2 = _b.x2, x3 = _b.x3, y = _a[1], z = _a[2]; var foo = x1 || x2 || x3 || y || z; diff --git a/tests/baselines/reference/destructuringWithGenericParameter.js b/tests/baselines/reference/destructuringWithGenericParameter.js index 40c78df673f93..a589379835173 100644 --- a/tests/baselines/reference/destructuringWithGenericParameter.js +++ b/tests/baselines/reference/destructuringWithGenericParameter.js @@ -15,7 +15,7 @@ genericFunction(genericObject, ({greeting}) => { //// [destructuringWithGenericParameter.js] -var GenericClass = (function () { +var GenericClass = /** @class */ (function () { function GenericClass() { } return GenericClass; diff --git a/tests/baselines/reference/destructuringWithNewExpression.js b/tests/baselines/reference/destructuringWithNewExpression.js index 3f30d285b709f..9397d9430c9dc 100644 --- a/tests/baselines/reference/destructuringWithNewExpression.js +++ b/tests/baselines/reference/destructuringWithNewExpression.js @@ -6,7 +6,7 @@ class C { var { x } = new C; //// [destructuringWithNewExpression.js] -var C = (function () { +var C = /** @class */ (function () { function C() { this.x = 0; } diff --git a/tests/baselines/reference/detachedCommentAtStartOfConstructor1.js b/tests/baselines/reference/detachedCommentAtStartOfConstructor1.js index a0ae2ef15e954..7ec0921a394e5 100644 --- a/tests/baselines/reference/detachedCommentAtStartOfConstructor1.js +++ b/tests/baselines/reference/detachedCommentAtStartOfConstructor1.js @@ -11,7 +11,7 @@ class TestFile { } //// [detachedCommentAtStartOfConstructor1.js] -var TestFile = (function () { +var TestFile = /** @class */ (function () { function TestFile(message) { var _this = this; /// Test summary diff --git a/tests/baselines/reference/detachedCommentAtStartOfConstructor2.js b/tests/baselines/reference/detachedCommentAtStartOfConstructor2.js index 284c9372dab8e..674710fa442d5 100644 --- a/tests/baselines/reference/detachedCommentAtStartOfConstructor2.js +++ b/tests/baselines/reference/detachedCommentAtStartOfConstructor2.js @@ -12,7 +12,7 @@ class TestFile { } //// [detachedCommentAtStartOfConstructor2.js] -var TestFile = (function () { +var TestFile = /** @class */ (function () { function TestFile(message) { /// Test summary /// diff --git a/tests/baselines/reference/detachedCommentAtStartOfFunctionBody1.js b/tests/baselines/reference/detachedCommentAtStartOfFunctionBody1.js index 1b459bbe06203..e4afa1e619743 100644 --- a/tests/baselines/reference/detachedCommentAtStartOfFunctionBody1.js +++ b/tests/baselines/reference/detachedCommentAtStartOfFunctionBody1.js @@ -9,7 +9,7 @@ class TestFile { } //// [detachedCommentAtStartOfFunctionBody1.js] -var TestFile = (function () { +var TestFile = /** @class */ (function () { function TestFile() { } TestFile.prototype.foo = function (message) { diff --git a/tests/baselines/reference/detachedCommentAtStartOfFunctionBody2.js b/tests/baselines/reference/detachedCommentAtStartOfFunctionBody2.js index 8b33b737bebb2..0b16435009f12 100644 --- a/tests/baselines/reference/detachedCommentAtStartOfFunctionBody2.js +++ b/tests/baselines/reference/detachedCommentAtStartOfFunctionBody2.js @@ -10,7 +10,7 @@ class TestFile { } //// [detachedCommentAtStartOfFunctionBody2.js] -var TestFile = (function () { +var TestFile = /** @class */ (function () { function TestFile() { } TestFile.prototype.foo = function (message) { diff --git a/tests/baselines/reference/detachedCommentAtStartOfLambdaFunction1.js b/tests/baselines/reference/detachedCommentAtStartOfLambdaFunction1.js index 495ac29f26980..9d5f809eceb3c 100644 --- a/tests/baselines/reference/detachedCommentAtStartOfLambdaFunction1.js +++ b/tests/baselines/reference/detachedCommentAtStartOfLambdaFunction1.js @@ -11,7 +11,7 @@ class TestFile { } //// [detachedCommentAtStartOfLambdaFunction1.js] -var TestFile = (function () { +var TestFile = /** @class */ (function () { function TestFile() { } TestFile.prototype.foo = function (message) { diff --git a/tests/baselines/reference/detachedCommentAtStartOfLambdaFunction2.js b/tests/baselines/reference/detachedCommentAtStartOfLambdaFunction2.js index e6ced9a8a420c..150341d2f6509 100644 --- a/tests/baselines/reference/detachedCommentAtStartOfLambdaFunction2.js +++ b/tests/baselines/reference/detachedCommentAtStartOfLambdaFunction2.js @@ -12,7 +12,7 @@ class TestFile { } //// [detachedCommentAtStartOfLambdaFunction2.js] -var TestFile = (function () { +var TestFile = /** @class */ (function () { function TestFile() { } TestFile.prototype.foo = function (message) { diff --git a/tests/baselines/reference/differentTypesWithSameName.js b/tests/baselines/reference/differentTypesWithSameName.js index a7278cebdbc21..1ea9fe2e4fa98 100644 --- a/tests/baselines/reference/differentTypesWithSameName.js +++ b/tests/baselines/reference/differentTypesWithSameName.js @@ -19,7 +19,7 @@ m.doSomething(v); //// [differentTypesWithSameName.js] var m; (function (m) { - var variable = (function () { + var variable = /** @class */ (function () { function variable() { } return variable; @@ -29,7 +29,7 @@ var m; } m.doSomething = doSomething; })(m || (m = {})); -var variable = (function () { +var variable = /** @class */ (function () { function variable() { } return variable; diff --git a/tests/baselines/reference/directDependenceBetweenTypeAliases.js b/tests/baselines/reference/directDependenceBetweenTypeAliases.js index eaee45703f7cd..f87c2506d5419 100644 --- a/tests/baselines/reference/directDependenceBetweenTypeAliases.js +++ b/tests/baselines/reference/directDependenceBetweenTypeAliases.js @@ -44,14 +44,14 @@ var zz: { x: T11 } //// [directDependenceBetweenTypeAliases.js] // It is an error for the type specified in a type alias to depend on that type alias -var C = (function () { +var C = /** @class */ (function () { function C() { } return C; }()); // A type query directly depends on the type of the referenced entity. var x = []; -var C1 = (function () { +var C1 = /** @class */ (function () { function C1() { } return C1; diff --git a/tests/baselines/reference/disallowLineTerminatorBeforeArrow.js b/tests/baselines/reference/disallowLineTerminatorBeforeArrow.js index 9f0d04d301ce7..751d93ddc63bd 100644 --- a/tests/baselines/reference/disallowLineTerminatorBeforeArrow.js +++ b/tests/baselines/reference/disallowLineTerminatorBeforeArrow.js @@ -131,7 +131,7 @@ foo(function () { return true; }); foo(function () { return false; }); var m; (function (m) { - var City = (function () { + var City = /** @class */ (function () { function City(x, thing) { if (thing === void 0) { thing = function () { return 100; }; } this.m = function () { return 2 * 2 * 2; }; diff --git a/tests/baselines/reference/dottedSymbolResolution1.js b/tests/baselines/reference/dottedSymbolResolution1.js index 956968761aec0..280e382666edf 100644 --- a/tests/baselines/reference/dottedSymbolResolution1.js +++ b/tests/baselines/reference/dottedSymbolResolution1.js @@ -26,7 +26,7 @@ function _setBarAndText(): void { } //// [dottedSymbolResolution1.js] -var Base = (function () { +var Base = /** @class */ (function () { function Base() { } Base.prototype.foo = function () { }; diff --git a/tests/baselines/reference/downlevelLetConst16.js b/tests/baselines/reference/downlevelLetConst16.js index 944bb192e906c..338489b20c379 100644 --- a/tests/baselines/reference/downlevelLetConst16.js +++ b/tests/baselines/reference/downlevelLetConst16.js @@ -254,7 +254,7 @@ function foo2() { } use(x); } -var A = (function () { +var A = /** @class */ (function () { function A() { } A.prototype.m1 = function () { @@ -278,7 +278,7 @@ var A = (function () { }; return A; }()); -var B = (function () { +var B = /** @class */ (function () { function B() { } B.prototype.m1 = function () { diff --git a/tests/baselines/reference/duplicateAnonymousInners1.js b/tests/baselines/reference/duplicateAnonymousInners1.js index 8cf1dc89a45b4..6442bdb05ad54 100644 --- a/tests/baselines/reference/duplicateAnonymousInners1.js +++ b/tests/baselines/reference/duplicateAnonymousInners1.js @@ -28,12 +28,12 @@ module Foo { //// [duplicateAnonymousInners1.js] var Foo; (function (Foo) { - var Helper = (function () { + var Helper = /** @class */ (function () { function Helper() { } return Helper; }()); - var Inner = (function () { + var Inner = /** @class */ (function () { function Inner() { } return Inner; @@ -43,7 +43,7 @@ var Foo; })(Foo || (Foo = {})); (function (Foo) { // Should not be an error - var Helper = (function () { + var Helper = /** @class */ (function () { function Helper() { } return Helper; diff --git a/tests/baselines/reference/duplicateAnonymousModuleClasses.js b/tests/baselines/reference/duplicateAnonymousModuleClasses.js index e27d6987e80a7..f786c106cb358 100644 --- a/tests/baselines/reference/duplicateAnonymousModuleClasses.js +++ b/tests/baselines/reference/duplicateAnonymousModuleClasses.js @@ -59,7 +59,7 @@ module Gar { //// [duplicateAnonymousModuleClasses.js] var F; (function (F) { - var Helper = (function () { + var Helper = /** @class */ (function () { function Helper() { } return Helper; @@ -67,7 +67,7 @@ var F; })(F || (F = {})); (function (F) { // Should not be an error - var Helper = (function () { + var Helper = /** @class */ (function () { function Helper() { } return Helper; @@ -75,7 +75,7 @@ var F; })(F || (F = {})); var Foo; (function (Foo) { - var Helper = (function () { + var Helper = /** @class */ (function () { function Helper() { } return Helper; @@ -83,7 +83,7 @@ var Foo; })(Foo || (Foo = {})); (function (Foo) { // Should not be an error - var Helper = (function () { + var Helper = /** @class */ (function () { function Helper() { } return Helper; @@ -93,7 +93,7 @@ var Gar; (function (Gar) { var Foo; (function (Foo) { - var Helper = (function () { + var Helper = /** @class */ (function () { function Helper() { } return Helper; @@ -101,7 +101,7 @@ var Gar; })(Foo || (Foo = {})); (function (Foo) { // Should not be an error - var Helper = (function () { + var Helper = /** @class */ (function () { function Helper() { } return Helper; diff --git a/tests/baselines/reference/duplicateClassElements.js b/tests/baselines/reference/duplicateClassElements.js index ed47c532a76a0..1a37490c2fbd6 100644 --- a/tests/baselines/reference/duplicateClassElements.js +++ b/tests/baselines/reference/duplicateClassElements.js @@ -45,7 +45,7 @@ class a { } //// [duplicateClassElements.js] -var a = (function () { +var a = /** @class */ (function () { function a() { } a.prototype.b = function () { diff --git a/tests/baselines/reference/duplicateConstructorOverloadSignature.js b/tests/baselines/reference/duplicateConstructorOverloadSignature.js index 8d7980ea0f708..7618222bdd747 100644 --- a/tests/baselines/reference/duplicateConstructorOverloadSignature.js +++ b/tests/baselines/reference/duplicateConstructorOverloadSignature.js @@ -6,7 +6,7 @@ class C { } //// [duplicateConstructorOverloadSignature.js] -var C = (function () { +var C = /** @class */ (function () { function C(x) { } return C; diff --git a/tests/baselines/reference/duplicateConstructorOverloadSignature2.js b/tests/baselines/reference/duplicateConstructorOverloadSignature2.js index a9d2a49fb250e..9628ec6a226a3 100644 --- a/tests/baselines/reference/duplicateConstructorOverloadSignature2.js +++ b/tests/baselines/reference/duplicateConstructorOverloadSignature2.js @@ -6,7 +6,7 @@ class C { } //// [duplicateConstructorOverloadSignature2.js] -var C = (function () { +var C = /** @class */ (function () { function C(x) { } return C; diff --git a/tests/baselines/reference/duplicateExportAssignments.js b/tests/baselines/reference/duplicateExportAssignments.js index 9d75121f23224..e33e86e59bc96 100644 --- a/tests/baselines/reference/duplicateExportAssignments.js +++ b/tests/baselines/reference/duplicateExportAssignments.js @@ -49,7 +49,7 @@ module.exports = x; //// [foo2.js] "use strict"; var x = 10; -var y = (function () { +var y = /** @class */ (function () { function y() { } return y; @@ -62,7 +62,7 @@ var x; (function (x_1) { x_1.x = 10; })(x || (x = {})); -var y = (function () { +var y = /** @class */ (function () { function y() { } return y; diff --git a/tests/baselines/reference/duplicateIdentifierComputedName.js b/tests/baselines/reference/duplicateIdentifierComputedName.js index df488d8072406..0798d918472ec 100644 --- a/tests/baselines/reference/duplicateIdentifierComputedName.js +++ b/tests/baselines/reference/duplicateIdentifierComputedName.js @@ -6,7 +6,7 @@ class C { //// [duplicateIdentifierComputedName.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } return C; diff --git a/tests/baselines/reference/duplicateIdentifierDifferentModifiers.js b/tests/baselines/reference/duplicateIdentifierDifferentModifiers.js index 6500380f35883..b5b3130e96c84 100644 --- a/tests/baselines/reference/duplicateIdentifierDifferentModifiers.js +++ b/tests/baselines/reference/duplicateIdentifierDifferentModifiers.js @@ -24,13 +24,13 @@ interface C { //// [duplicateIdentifierDifferentModifiers.js] // OK -var A = (function () { +var A = /** @class */ (function () { function A() { } return A; }()); // Not OK -var C = (function () { +var C = /** @class */ (function () { function C() { } return C; diff --git a/tests/baselines/reference/duplicateIdentifierDifferentSpelling.js b/tests/baselines/reference/duplicateIdentifierDifferentSpelling.js index 0bd30fe2fcaa8..9f139ff857233 100644 --- a/tests/baselines/reference/duplicateIdentifierDifferentSpelling.js +++ b/tests/baselines/reference/duplicateIdentifierDifferentSpelling.js @@ -8,7 +8,7 @@ var X = { 0b11: '', 3: '' }; //// [duplicateIdentifierDifferentSpelling.js] -var A = (function () { +var A = /** @class */ (function () { function A() { this[0b11] = ''; this[3] = ''; diff --git a/tests/baselines/reference/duplicateIdentifiersAcrossContainerBoundaries.js b/tests/baselines/reference/duplicateIdentifiersAcrossContainerBoundaries.js index 37fb4fcb633cd..97c169c9d085d 100644 --- a/tests/baselines/reference/duplicateIdentifiersAcrossContainerBoundaries.js +++ b/tests/baselines/reference/duplicateIdentifiersAcrossContainerBoundaries.js @@ -55,7 +55,7 @@ declare module N { //// [duplicateIdentifiersAcrossContainerBoundaries.js] var M; (function (M) { - var I = (function () { + var I = /** @class */ (function () { function I() { } return I; @@ -67,7 +67,7 @@ var M; M.f = f; })(M || (M = {})); (function (M) { - var f = (function () { + var f = /** @class */ (function () { function f() { } return f; @@ -78,7 +78,7 @@ var M; function g() { } })(M || (M = {})); (function (M) { - var g = (function () { + var g = /** @class */ (function () { function g() { } return g; @@ -86,7 +86,7 @@ var M; M.g = g; })(M || (M = {})); (function (M) { - var C = (function () { + var C = /** @class */ (function () { function C() { } return C; @@ -102,7 +102,7 @@ var M; (function (M) { M.v = 3; // error for redeclaring var in a different parent })(M || (M = {})); -var Foo = (function () { +var Foo = /** @class */ (function () { function Foo() { } return Foo; diff --git a/tests/baselines/reference/duplicateIdentifiersAcrossFileBoundaries.js b/tests/baselines/reference/duplicateIdentifiersAcrossFileBoundaries.js index eb1eeb9b30236..465b2f7b8e916 100644 --- a/tests/baselines/reference/duplicateIdentifiersAcrossFileBoundaries.js +++ b/tests/baselines/reference/duplicateIdentifiersAcrossFileBoundaries.js @@ -34,19 +34,19 @@ declare module N { //// [file1.js] -var C1 = (function () { +var C1 = /** @class */ (function () { function C1() { } return C1; }()); -var C2 = (function () { +var C2 = /** @class */ (function () { function C2() { } return C2; }()); function f() { } var v = 3; -var Foo = (function () { +var Foo = /** @class */ (function () { function Foo() { } return Foo; @@ -59,13 +59,13 @@ var N; })(F = N.F || (N.F = {})); })(N || (N = {})); //// [file2.js] -var I = (function () { +var I = /** @class */ (function () { function I() { } return I; }()); // error -- cannot merge interface with non-ambient class function C2() { } // error -- cannot merge function with non-ambient class -var f = (function () { +var f = /** @class */ (function () { function f() { } return f; diff --git a/tests/baselines/reference/duplicateLocalVariable1.js b/tests/baselines/reference/duplicateLocalVariable1.js index 61e8dcd02f872..d0d17ff0b4cdc 100644 --- a/tests/baselines/reference/duplicateLocalVariable1.js +++ b/tests/baselines/reference/duplicateLocalVariable1.js @@ -350,7 +350,7 @@ exports.__esModule = true; / /; commonjs; var TestFileDir = ".\\TempTestFiles"; -var TestCase = (function () { +var TestCase = /** @class */ (function () { function TestCase(name, test, errorMessageRegEx) { this.name = name; this.test = test; @@ -359,7 +359,7 @@ var TestCase = (function () { return TestCase; }()); exports.TestCase = TestCase; -var TestRunner = (function () { +var TestRunner = /** @class */ (function () { function TestRunner() { this.tests = []; } diff --git a/tests/baselines/reference/duplicateLocalVariable2.js b/tests/baselines/reference/duplicateLocalVariable2.js index 2962e544b9b94..10cec55ecf936 100644 --- a/tests/baselines/reference/duplicateLocalVariable2.js +++ b/tests/baselines/reference/duplicateLocalVariable2.js @@ -39,7 +39,7 @@ export var tests: TestRunner = (function () { define(["require", "exports"], function (require, exports) { "use strict"; exports.__esModule = true; - var TestCase = (function () { + var TestCase = /** @class */ (function () { function TestCase(name, test, errorMessageRegEx) { this.name = name; this.test = test; @@ -48,7 +48,7 @@ define(["require", "exports"], function (require, exports) { return TestCase; }()); exports.TestCase = TestCase; - var TestRunner = (function () { + var TestRunner = /** @class */ (function () { function TestRunner() { } TestRunner.arrayCompare = function (arg1, arg2) { diff --git a/tests/baselines/reference/duplicateNumericIndexers.js b/tests/baselines/reference/duplicateNumericIndexers.js index 87299585bb654..f35261b07a37b 100644 --- a/tests/baselines/reference/duplicateNumericIndexers.js +++ b/tests/baselines/reference/duplicateNumericIndexers.js @@ -35,7 +35,7 @@ var a: { //// [duplicateNumericIndexers.js] // it is an error to have duplicate index signatures of the same kind in a type -var C = (function () { +var C = /** @class */ (function () { function C() { } return C; diff --git a/tests/baselines/reference/duplicatePropertyNames.js b/tests/baselines/reference/duplicatePropertyNames.js index d4dfe612fc54a..95e491b71f53b 100644 --- a/tests/baselines/reference/duplicatePropertyNames.js +++ b/tests/baselines/reference/duplicatePropertyNames.js @@ -50,7 +50,7 @@ var b = { //// [duplicatePropertyNames.js] // duplicate property names are an error in all types -var C = (function () { +var C = /** @class */ (function () { function C() { this.baz = function () { }; this.baz = function () { }; diff --git a/tests/baselines/reference/duplicateStringIndexers.js b/tests/baselines/reference/duplicateStringIndexers.js index 3708d6a4989fc..9e9b3686fd8c4 100644 --- a/tests/baselines/reference/duplicateStringIndexers.js +++ b/tests/baselines/reference/duplicateStringIndexers.js @@ -38,7 +38,7 @@ module test { // it is an error to have duplicate index signatures of the same kind in a type var test; (function (test) { - var C = (function () { + var C = /** @class */ (function () { function C() { } return C; diff --git a/tests/baselines/reference/duplicateSymbolsExportMatching.js b/tests/baselines/reference/duplicateSymbolsExportMatching.js index 5f5590e2b417e..b98137283b383 100644 --- a/tests/baselines/reference/duplicateSymbolsExportMatching.js +++ b/tests/baselines/reference/duplicateSymbolsExportMatching.js @@ -95,7 +95,7 @@ define(["require", "exports"], function (require, exports) { M.F = F; })(M || (M = {})); (function (M) { - var C = (function () { + var C = /** @class */ (function () { function C() { } return C; diff --git a/tests/baselines/reference/duplicateTypeParameters2.js b/tests/baselines/reference/duplicateTypeParameters2.js index 63910fa175830..5fe96d204fa12 100644 --- a/tests/baselines/reference/duplicateTypeParameters2.js +++ b/tests/baselines/reference/duplicateTypeParameters2.js @@ -5,13 +5,13 @@ class B { public bar() { } } interface I {} //// [duplicateTypeParameters2.js] -var A = (function () { +var A = /** @class */ (function () { function A() { } A.prototype.foo = function () { }; return A; }()); -var B = (function () { +var B = /** @class */ (function () { function B() { } B.prototype.bar = function () { }; diff --git a/tests/baselines/reference/duplicateVariablesByScope.js b/tests/baselines/reference/duplicateVariablesByScope.js index ed6b7834a1d25..1bd0b69f0203c 100644 --- a/tests/baselines/reference/duplicateVariablesByScope.js +++ b/tests/baselines/reference/duplicateVariablesByScope.js @@ -50,7 +50,7 @@ function foo() { var result = 2; } } -var C = (function () { +var C = /** @class */ (function () { function C() { } C.prototype.foo = function () { diff --git a/tests/baselines/reference/elaboratedErrors.js b/tests/baselines/reference/elaboratedErrors.js index cb8d1bd1ea456..7b82805b31496 100644 --- a/tests/baselines/reference/elaboratedErrors.js +++ b/tests/baselines/reference/elaboratedErrors.js @@ -29,7 +29,7 @@ y = x; //// [elaboratedErrors.js] function fn(s) { } // This should issue a large error, not a small one -var WorkerFS = (function () { +var WorkerFS = /** @class */ (function () { function WorkerFS() { } return WorkerFS; diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments12.js b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments12.js index 5ee0724634785..01e05f7b81c31 100644 --- a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments12.js +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments12.js @@ -6,7 +6,7 @@ class C { } //// [emitArrowFunctionWhenUsingArguments12.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } C.prototype.f = function (arguments) { diff --git a/tests/baselines/reference/emitBundleWithPrologueDirectives1.js b/tests/baselines/reference/emitBundleWithPrologueDirectives1.js index 07214800aa8fc..06e6343f232d2 100644 --- a/tests/baselines/reference/emitBundleWithPrologueDirectives1.js +++ b/tests/baselines/reference/emitBundleWithPrologueDirectives1.js @@ -21,13 +21,13 @@ define("test", ["require", "exports"], function (require, exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); // Class Doo Comment - var Doo = (function () { + var Doo = /** @class */ (function () { function Doo() { } return Doo; }()); exports.Doo = Doo; - var Scooby = (function (_super) { + var Scooby = /** @class */ (function (_super) { __extends(Scooby, _super); function Scooby() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/emitBundleWithShebang1.js b/tests/baselines/reference/emitBundleWithShebang1.js index 1c7b2140eb5c0..72eeb07c6dd9d 100644 --- a/tests/baselines/reference/emitBundleWithShebang1.js +++ b/tests/baselines/reference/emitBundleWithShebang1.js @@ -15,12 +15,12 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var Doo = (function () { +var Doo = /** @class */ (function () { function Doo() { } return Doo; }()); -var Scooby = (function (_super) { +var Scooby = /** @class */ (function (_super) { __extends(Scooby, _super); function Scooby() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/emitBundleWithShebang2.js b/tests/baselines/reference/emitBundleWithShebang2.js index b5d3d34641aca..c3f36a41a8e67 100644 --- a/tests/baselines/reference/emitBundleWithShebang2.js +++ b/tests/baselines/reference/emitBundleWithShebang2.js @@ -22,24 +22,24 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var Doo = (function () { +var Doo = /** @class */ (function () { function Doo() { } return Doo; }()); -var Scooby = (function (_super) { +var Scooby = /** @class */ (function (_super) { __extends(Scooby, _super); function Scooby() { return _super !== null && _super.apply(this, arguments) || this; } return Scooby; }(Doo)); -var Dood = (function () { +var Dood = /** @class */ (function () { function Dood() { } return Dood; }()); -var Scoobyd = (function (_super) { +var Scoobyd = /** @class */ (function (_super) { __extends(Scoobyd, _super); function Scoobyd() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/emitBundleWithShebangAndPrologueDirectives1.js b/tests/baselines/reference/emitBundleWithShebangAndPrologueDirectives1.js index 03b6c4a79f91f..7a484a809de57 100644 --- a/tests/baselines/reference/emitBundleWithShebangAndPrologueDirectives1.js +++ b/tests/baselines/reference/emitBundleWithShebangAndPrologueDirectives1.js @@ -17,12 +17,12 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var Doo = (function () { +var Doo = /** @class */ (function () { function Doo() { } return Doo; }()); -var Scooby = (function (_super) { +var Scooby = /** @class */ (function (_super) { __extends(Scooby, _super); function Scooby() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/emitBundleWithShebangAndPrologueDirectives2.js b/tests/baselines/reference/emitBundleWithShebangAndPrologueDirectives2.js index e469c526779d3..42631394e976a 100644 --- a/tests/baselines/reference/emitBundleWithShebangAndPrologueDirectives2.js +++ b/tests/baselines/reference/emitBundleWithShebangAndPrologueDirectives2.js @@ -27,24 +27,24 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var Doo = (function () { +var Doo = /** @class */ (function () { function Doo() { } return Doo; }()); -var Scooby = (function (_super) { +var Scooby = /** @class */ (function (_super) { __extends(Scooby, _super); function Scooby() { return _super !== null && _super.apply(this, arguments) || this; } return Scooby; }(Doo)); -var Dood = (function () { +var Dood = /** @class */ (function () { function Dood() { } return Dood; }()); -var Scoobyd = (function (_super) { +var Scoobyd = /** @class */ (function (_super) { __extends(Scoobyd, _super); function Scoobyd() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/emitCapturingThisInTupleDestructuring2.js b/tests/baselines/reference/emitCapturingThisInTupleDestructuring2.js index 890b9d4c9b843..0041bde3fadb9 100644 --- a/tests/baselines/reference/emitCapturingThisInTupleDestructuring2.js +++ b/tests/baselines/reference/emitCapturingThisInTupleDestructuring2.js @@ -12,7 +12,7 @@ class B { //// [emitCapturingThisInTupleDestructuring2.js] var array1 = [1, 2]; -var B = (function () { +var B = /** @class */ (function () { function B() { } B.prototype.method = function () { diff --git a/tests/baselines/reference/emitClassDeclarationWithPropertyAccessInHeritageClause1.js b/tests/baselines/reference/emitClassDeclarationWithPropertyAccessInHeritageClause1.js index 817a03f974aa7..fcc0e03868813 100644 --- a/tests/baselines/reference/emitClassDeclarationWithPropertyAccessInHeritageClause1.js +++ b/tests/baselines/reference/emitClassDeclarationWithPropertyAccessInHeritageClause1.js @@ -16,7 +16,7 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var B = (function () { +var B = /** @class */ (function () { function B() { } return B; @@ -24,7 +24,7 @@ var B = (function () { function foo() { return { B: B }; } -var C = (function (_super) { +var C = /** @class */ (function (_super) { __extends(C, _super); function C() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/emitClassExpressionInDeclarationFile.js b/tests/baselines/reference/emitClassExpressionInDeclarationFile.js index ab64fe003be76..53fead2d9879e 100644 --- a/tests/baselines/reference/emitClassExpressionInDeclarationFile.js +++ b/tests/baselines/reference/emitClassExpressionInDeclarationFile.js @@ -43,14 +43,14 @@ var __extends = (this && this.__extends) || (function () { }; })(); exports.__esModule = true; -exports.simpleExample = (function () { +exports.simpleExample = /** @class */ (function () { function class_1() { } class_1.getTags = function () { }; class_1.prototype.tags = function () { }; return class_1; }()); -exports.circularReference = (function () { +exports.circularReference = /** @class */ (function () { function C() { } C.getTags = function (c) { return c; }; @@ -58,7 +58,7 @@ exports.circularReference = (function () { return C; }()); // repro from #15066 -var FooItem = (function () { +var FooItem = /** @class */ (function () { function FooItem() { } FooItem.prototype.foo = function () { }; @@ -66,7 +66,7 @@ var FooItem = (function () { }()); exports.FooItem = FooItem; function WithTags(Base) { - return (function (_super) { + return /** @class */ (function (_super) { __extends(class_2, _super); function class_2() { return _super !== null && _super.apply(this, arguments) || this; @@ -77,7 +77,7 @@ function WithTags(Base) { }(Base)); } exports.WithTags = WithTags; -var Test = (function (_super) { +var Test = /** @class */ (function (_super) { __extends(Test, _super); function Test() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/emitClassExpressionInDeclarationFile2.js b/tests/baselines/reference/emitClassExpressionInDeclarationFile2.js index e3a0aa4cb9949..3f7c5c6eb7576 100644 --- a/tests/baselines/reference/emitClassExpressionInDeclarationFile2.js +++ b/tests/baselines/reference/emitClassExpressionInDeclarationFile2.js @@ -42,7 +42,7 @@ var __extends = (this && this.__extends) || (function () { }; })(); exports.__esModule = true; -exports.noPrivates = (_a = (function () { +exports.noPrivates = (_a = /** @class */ (function () { function class_1() { this.p = 12; } @@ -53,7 +53,7 @@ exports.noPrivates = (_a = (function () { _a.ps = -1, _a); // altered repro from #15066 to add private property -var FooItem = (function () { +var FooItem = /** @class */ (function () { function FooItem() { this.property = "capitalism"; } @@ -62,7 +62,7 @@ var FooItem = (function () { }()); exports.FooItem = FooItem; function WithTags(Base) { - return (function (_super) { + return /** @class */ (function (_super) { __extends(class_2, _super); function class_2() { return _super !== null && _super.apply(this, arguments) || this; @@ -73,7 +73,7 @@ function WithTags(Base) { }(Base)); } exports.WithTags = WithTags; -var Test = (function (_super) { +var Test = /** @class */ (function (_super) { __extends(Test, _super); function Test() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/emitDecoratorMetadata_object.js b/tests/baselines/reference/emitDecoratorMetadata_object.js index ff4a65710a792..2c39be4af9e1a 100644 --- a/tests/baselines/reference/emitDecoratorMetadata_object.js +++ b/tests/baselines/reference/emitDecoratorMetadata_object.js @@ -20,7 +20,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key, var __metadata = (this && this.__metadata) || function (k, v) { if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); }; -var A = (function () { +var A = /** @class */ (function () { function A(hi) { } A.prototype.method = function (there) { }; diff --git a/tests/baselines/reference/emitDecoratorMetadata_restArgs.js b/tests/baselines/reference/emitDecoratorMetadata_restArgs.js index 3f1ffd54bce75..c05caf64dd3eb 100644 --- a/tests/baselines/reference/emitDecoratorMetadata_restArgs.js +++ b/tests/baselines/reference/emitDecoratorMetadata_restArgs.js @@ -27,7 +27,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key, var __metadata = (this && this.__metadata) || function (k, v) { if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); }; -var A = (function () { +var A = /** @class */ (function () { function A() { var args = []; for (var _i = 0; _i < arguments.length; _i++) { @@ -52,7 +52,7 @@ var A = (function () { ], A); return A; }()); -var B = (function () { +var B = /** @class */ (function () { function B() { var args = []; for (var _i = 0; _i < arguments.length; _i++) { diff --git a/tests/baselines/reference/emitDefaultParametersMethod.js b/tests/baselines/reference/emitDefaultParametersMethod.js index 1048926a187b0..0f935fae0aaeb 100644 --- a/tests/baselines/reference/emitDefaultParametersMethod.js +++ b/tests/baselines/reference/emitDefaultParametersMethod.js @@ -18,7 +18,7 @@ class E { //// [emitDefaultParametersMethod.js] -var C = (function () { +var C = /** @class */ (function () { function C(t, z, x, y) { if (y === void 0) { y = "hello"; } } @@ -44,13 +44,13 @@ var C = (function () { }; return C; }()); -var D = (function () { +var D = /** @class */ (function () { function D(y) { if (y === void 0) { y = "hello"; } } return D; }()); -var E = (function () { +var E = /** @class */ (function () { function E(y) { if (y === void 0) { y = "hello"; } var rest = []; diff --git a/tests/baselines/reference/emitMemberAccessExpression.js b/tests/baselines/reference/emitMemberAccessExpression.js index f242f0903c419..bdda7b833d2ff 100644 --- a/tests/baselines/reference/emitMemberAccessExpression.js +++ b/tests/baselines/reference/emitMemberAccessExpression.js @@ -33,7 +33,7 @@ var Microsoft; (function (PeopleAtWork) { var Model; (function (Model) { - var _Person = (function () { + var _Person = /** @class */ (function () { function _Person() { } _Person.prototype.populate = function (raw) { @@ -57,7 +57,7 @@ var Microsoft; (function (PeopleAtWork) { var Model; (function (Model) { - var KnockoutExtentions = (function () { + var KnockoutExtentions = /** @class */ (function () { function KnockoutExtentions() { } return KnockoutExtentions; diff --git a/tests/baselines/reference/emitRestParametersMethod.js b/tests/baselines/reference/emitRestParametersMethod.js index fed2138f36be1..370266a5f698d 100644 --- a/tests/baselines/reference/emitRestParametersMethod.js +++ b/tests/baselines/reference/emitRestParametersMethod.js @@ -14,7 +14,7 @@ class D { } //// [emitRestParametersMethod.js] -var C = (function () { +var C = /** @class */ (function () { function C(name) { var rest = []; for (var _i = 1; _i < arguments.length; _i++) { @@ -35,7 +35,7 @@ var C = (function () { }; return C; }()); -var D = (function () { +var D = /** @class */ (function () { function D() { var rest = []; for (var _i = 0; _i < arguments.length; _i++) { diff --git a/tests/baselines/reference/emitSuperCallBeforeEmitParameterPropertyDeclaration1.js b/tests/baselines/reference/emitSuperCallBeforeEmitParameterPropertyDeclaration1.js index 3a8bbdb0c739e..ec834550250ec 100644 --- a/tests/baselines/reference/emitSuperCallBeforeEmitParameterPropertyDeclaration1.js +++ b/tests/baselines/reference/emitSuperCallBeforeEmitParameterPropertyDeclaration1.js @@ -24,13 +24,13 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var A = (function () { +var A = /** @class */ (function () { function A() { this.blub = 6; } return A; }()); -var B = (function (_super) { +var B = /** @class */ (function (_super) { __extends(B, _super); function B(x) { "use strict"; diff --git a/tests/baselines/reference/emitSuperCallBeforeEmitPropertyDeclaration1.js b/tests/baselines/reference/emitSuperCallBeforeEmitPropertyDeclaration1.js index d8145f6dc27f7..76d534e438823 100644 --- a/tests/baselines/reference/emitSuperCallBeforeEmitPropertyDeclaration1.js +++ b/tests/baselines/reference/emitSuperCallBeforeEmitPropertyDeclaration1.js @@ -26,13 +26,13 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var A = (function () { +var A = /** @class */ (function () { function A() { this.blub = 6; } return A; }()); -var B = (function (_super) { +var B = /** @class */ (function (_super) { __extends(B, _super); function B() { "use strict"; diff --git a/tests/baselines/reference/emitSuperCallBeforeEmitPropertyDeclarationAndParameterPropertyDeclaration1.js b/tests/baselines/reference/emitSuperCallBeforeEmitPropertyDeclarationAndParameterPropertyDeclaration1.js index 75c618d84dbb0..2c9eef7a6d570 100644 --- a/tests/baselines/reference/emitSuperCallBeforeEmitPropertyDeclarationAndParameterPropertyDeclaration1.js +++ b/tests/baselines/reference/emitSuperCallBeforeEmitPropertyDeclarationAndParameterPropertyDeclaration1.js @@ -24,13 +24,13 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var A = (function () { +var A = /** @class */ (function () { function A() { this.blub = 6; } return A; }()); -var B = (function (_super) { +var B = /** @class */ (function (_super) { __extends(B, _super); function B(x) { "use strict"; diff --git a/tests/baselines/reference/emitThisInSuperMethodCall.js b/tests/baselines/reference/emitThisInSuperMethodCall.js index 2d800d562c292..f5937643ff3d6 100644 --- a/tests/baselines/reference/emitThisInSuperMethodCall.js +++ b/tests/baselines/reference/emitThisInSuperMethodCall.js @@ -38,14 +38,14 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var User = (function () { +var User = /** @class */ (function () { function User() { } User.prototype.sayHello = function () { }; return User; }()); -var RegisteredUser = (function (_super) { +var RegisteredUser = /** @class */ (function (_super) { __extends(RegisteredUser, _super); function RegisteredUser() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/emitter.asyncGenerators.classMethods.es5.js b/tests/baselines/reference/emitter.asyncGenerators.classMethods.es5.js index cfd7c9725e4e8..1119d6b06e376 100644 --- a/tests/baselines/reference/emitter.asyncGenerators.classMethods.es5.js +++ b/tests/baselines/reference/emitter.asyncGenerators.classMethods.es5.js @@ -100,7 +100,7 @@ var __asyncGenerator = (this && this.__asyncGenerator) || function (thisArg, _ar function reject(value) { resume("throw", value); } function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); } }; -var C1 = (function () { +var C1 = /** @class */ (function () { function C1() { } C1.prototype.f = function () { @@ -152,7 +152,7 @@ var __asyncGenerator = (this && this.__asyncGenerator) || function (thisArg, _ar function reject(value) { resume("throw", value); } function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); } }; -var C2 = (function () { +var C2 = /** @class */ (function () { function C2() { } C2.prototype.f = function () { @@ -210,7 +210,7 @@ var __asyncGenerator = (this && this.__asyncGenerator) || function (thisArg, _ar function reject(value) { resume("throw", value); } function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); } }; -var C3 = (function () { +var C3 = /** @class */ (function () { function C3() { } C3.prototype.f = function () { @@ -288,7 +288,7 @@ var __values = (this && this.__values) || function (o) { } }; }; -var C4 = (function () { +var C4 = /** @class */ (function () { function C4() { } C4.prototype.f = function () { @@ -367,7 +367,7 @@ var __values = (this && this.__values) || function (o) { } }; }; -var C5 = (function () { +var C5 = /** @class */ (function () { function C5() { } C5.prototype.f = function () { @@ -433,7 +433,7 @@ var __asyncGenerator = (this && this.__asyncGenerator) || function (thisArg, _ar function reject(value) { resume("throw", value); } function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); } }; -var C6 = (function () { +var C6 = /** @class */ (function () { function C6() { } C6.prototype.f = function () { @@ -491,7 +491,7 @@ var __asyncGenerator = (this && this.__asyncGenerator) || function (thisArg, _ar function reject(value) { resume("throw", value); } function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); } }; -var C7 = (function () { +var C7 = /** @class */ (function () { function C7() { } C7.prototype.f = function () { @@ -543,7 +543,7 @@ var __asyncGenerator = (this && this.__asyncGenerator) || function (thisArg, _ar function reject(value) { resume("throw", value); } function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); } }; -var C8 = (function () { +var C8 = /** @class */ (function () { function C8() { } C8.prototype.g = function () { @@ -608,13 +608,13 @@ var __asyncGenerator = (this && this.__asyncGenerator) || function (thisArg, _ar function reject(value) { resume("throw", value); } function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); } }; -var B9 = (function () { +var B9 = /** @class */ (function () { function B9() { } B9.prototype.g = function () { }; return B9; }()); -var C9 = (function (_super) { +var C9 = /** @class */ (function (_super) { __extends(C9, _super); function C9() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/emptyGenericParamList.js b/tests/baselines/reference/emptyGenericParamList.js index 173a9401d878b..2a45f16083122 100644 --- a/tests/baselines/reference/emptyGenericParamList.js +++ b/tests/baselines/reference/emptyGenericParamList.js @@ -3,7 +3,7 @@ class I {} var x: I<>; //// [emptyGenericParamList.js] -var I = (function () { +var I = /** @class */ (function () { function I() { } return I; diff --git a/tests/baselines/reference/emptyModuleName.js b/tests/baselines/reference/emptyModuleName.js index d98359d94bbab..121ae413662b7 100644 --- a/tests/baselines/reference/emptyModuleName.js +++ b/tests/baselines/reference/emptyModuleName.js @@ -17,7 +17,7 @@ var __extends = (this && this.__extends) || (function () { })(); exports.__esModule = true; var A = require(""); -var B = (function (_super) { +var B = /** @class */ (function (_super) { __extends(B, _super); function B() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/emptyTypeArgumentListWithNew.js b/tests/baselines/reference/emptyTypeArgumentListWithNew.js index 6fe2aeb509064..c30fa31609ab2 100644 --- a/tests/baselines/reference/emptyTypeArgumentListWithNew.js +++ b/tests/baselines/reference/emptyTypeArgumentListWithNew.js @@ -3,7 +3,7 @@ class foo { } new foo<>(); //// [emptyTypeArgumentListWithNew.js] -var foo = (function () { +var foo = /** @class */ (function () { function foo() { } return foo; diff --git a/tests/baselines/reference/enumAssignability.js b/tests/baselines/reference/enumAssignability.js index 79e4b461563e8..ecb289a947c47 100644 --- a/tests/baselines/reference/enumAssignability.js +++ b/tests/baselines/reference/enumAssignability.js @@ -75,7 +75,7 @@ x = f; // ok var Others; (function (Others) { var a = e; // ok - var C = (function () { + var C = /** @class */ (function () { function C() { } return C; diff --git a/tests/baselines/reference/enumAssignabilityInInheritance.js b/tests/baselines/reference/enumAssignabilityInInheritance.js index c5ff19cf23905..a2d38cf2e14d0 100644 --- a/tests/baselines/reference/enumAssignabilityInInheritance.js +++ b/tests/baselines/reference/enumAssignabilityInInheritance.js @@ -125,13 +125,13 @@ var r4 = foo5(E.A); var r4 = foo6(E.A); var r4 = foo7(E.A); var r4 = foo8(E.A); -var A = (function () { +var A = /** @class */ (function () { function A() { } return A; }()); var r4 = foo9(E.A); -var A2 = (function () { +var A2 = /** @class */ (function () { function A2() { } return A2; @@ -149,7 +149,7 @@ function f() { } f.bar = 1; })(f || (f = {})); var r4 = foo14(E.A); -var CC = (function () { +var CC = /** @class */ (function () { function CC() { } return CC; diff --git a/tests/baselines/reference/enumAssignmentCompat.js b/tests/baselines/reference/enumAssignmentCompat.js index 9cdac291b997e..f68ffdaa8a42c 100644 --- a/tests/baselines/reference/enumAssignmentCompat.js +++ b/tests/baselines/reference/enumAssignmentCompat.js @@ -41,7 +41,7 @@ var p: W.D; //// [enumAssignmentCompat.js] var W; (function (W) { - var D = (function () { + var D = /** @class */ (function () { function D() { } return D; diff --git a/tests/baselines/reference/enumAssignmentCompat2.js b/tests/baselines/reference/enumAssignmentCompat2.js index 5675bc86fe030..b27187c1253d8 100644 --- a/tests/baselines/reference/enumAssignmentCompat2.js +++ b/tests/baselines/reference/enumAssignmentCompat2.js @@ -45,7 +45,7 @@ var W; W[W["c"] = 2] = "c"; })(W || (W = {})); (function (W) { - var D = (function () { + var D = /** @class */ (function () { function D() { } return D; diff --git a/tests/baselines/reference/enumGenericTypeClash.js b/tests/baselines/reference/enumGenericTypeClash.js index 31c41be85c2b9..91fba388638f2 100644 --- a/tests/baselines/reference/enumGenericTypeClash.js +++ b/tests/baselines/reference/enumGenericTypeClash.js @@ -4,7 +4,7 @@ enum X { MyVal } //// [enumGenericTypeClash.js] -var X = (function () { +var X = /** @class */ (function () { function X() { } return X; diff --git a/tests/baselines/reference/enumIsNotASubtypeOfAnythingButNumber.js b/tests/baselines/reference/enumIsNotASubtypeOfAnythingButNumber.js index 9cb6169b2af36..9401ad34d42c5 100644 --- a/tests/baselines/reference/enumIsNotASubtypeOfAnythingButNumber.js +++ b/tests/baselines/reference/enumIsNotASubtypeOfAnythingButNumber.js @@ -136,12 +136,12 @@ var E; (function (E) { E[E["A"] = 0] = "A"; })(E || (E = {})); -var A = (function () { +var A = /** @class */ (function () { function A() { } return A; }()); -var A2 = (function () { +var A2 = /** @class */ (function () { function A2() { } return A2; @@ -154,7 +154,7 @@ function f() { } (function (f) { f.bar = 1; })(f || (f = {})); -var c = (function () { +var c = /** @class */ (function () { function c() { } return c; diff --git a/tests/baselines/reference/errorForwardReferenceForwadingConstructor.js b/tests/baselines/reference/errorForwardReferenceForwadingConstructor.js index 27f05f3f8ea42..42d209ccbdab8 100644 --- a/tests/baselines/reference/errorForwardReferenceForwadingConstructor.js +++ b/tests/baselines/reference/errorForwardReferenceForwadingConstructor.js @@ -26,13 +26,13 @@ function f() { var d1 = new derived(); var d2 = new derived(4); } -var base = (function () { +var base = /** @class */ (function () { function base(n) { this.n = n; } return base; }()); -var derived = (function (_super) { +var derived = /** @class */ (function (_super) { __extends(derived, _super); function derived() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/errorRecoveryInClassDeclaration.js b/tests/baselines/reference/errorRecoveryInClassDeclaration.js index cfe274c34bf30..d25f8c072dd46 100644 --- a/tests/baselines/reference/errorRecoveryInClassDeclaration.js +++ b/tests/baselines/reference/errorRecoveryInClassDeclaration.js @@ -8,7 +8,7 @@ class C { } //// [errorRecoveryInClassDeclaration.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } C.prototype.bar = function () { diff --git a/tests/baselines/reference/errorSuperCalls.js b/tests/baselines/reference/errorSuperCalls.js index db4f0ac1798ff..35c68e0ece357 100644 --- a/tests/baselines/reference/errorSuperCalls.js +++ b/tests/baselines/reference/errorSuperCalls.js @@ -86,7 +86,7 @@ var __extends = (this && this.__extends) || (function () { }; })(); //super call in class constructor with no base type -var NoBase = (function () { +var NoBase = /** @class */ (function () { function NoBase() { _this = _super.call(this) || this; //super call in class member initializer with no base type @@ -128,12 +128,12 @@ var NoBase = (function () { NoBase.k = _this = _super.call(this) || this; return NoBase; }()); -var Base = (function () { +var Base = /** @class */ (function () { function Base() { } return Base; }()); -var Derived = (function (_super) { +var Derived = /** @class */ (function (_super) { __extends(Derived, _super); //super call with type arguments function Derived() { @@ -144,12 +144,12 @@ var Derived = (function (_super) { } return Derived; }(Base)); -var OtherBase = (function () { +var OtherBase = /** @class */ (function () { function OtherBase() { } return OtherBase; }()); -var OtherDerived = (function (_super) { +var OtherDerived = /** @class */ (function (_super) { __extends(OtherDerived, _super); function OtherDerived() { var _this = _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/errorSuperPropertyAccess.js b/tests/baselines/reference/errorSuperPropertyAccess.js index 3163007e742bd..97bc6f79f90d5 100644 --- a/tests/baselines/reference/errorSuperPropertyAccess.js +++ b/tests/baselines/reference/errorSuperPropertyAccess.js @@ -142,7 +142,7 @@ var __extends = (this && this.__extends) || (function () { //super property access in constructor of class with no base type //super property access in instance member function of class with no base type //super property access in instance member accessor(get and set) of class with no base type -var NoBase = (function () { +var NoBase = /** @class */ (function () { function NoBase() { this.m = _super.prototype.prototype; this.n = _super.prototype.hasOwnProperty.call(this, ''); @@ -171,7 +171,7 @@ var NoBase = (function () { }); return NoBase; }()); -var SomeBase = (function () { +var SomeBase = /** @class */ (function () { function SomeBase() { this.privateMember = 0; this.publicMember = 0; @@ -188,7 +188,7 @@ var SomeBase = (function () { //super.publicInstanceMemberNotFunction in instance member function of derived class //super.publicInstanceMemberNotFunction in instance member accessor(get and set) of derived class //super property access only available with typed this -var SomeDerived1 = (function (_super) { +var SomeDerived1 = /** @class */ (function (_super) { __extends(SomeDerived1, _super); function SomeDerived1() { var _this = _super.call(this) || this; @@ -222,7 +222,7 @@ var SomeDerived1 = (function (_super) { //super.privateProperty in constructor of derived class //super.privateProperty in instance member function of derived class //super.privateProperty in instance member accessor(get and set) of derived class -var SomeDerived2 = (function (_super) { +var SomeDerived2 = /** @class */ (function (_super) { __extends(SomeDerived2, _super); function SomeDerived2() { var _this = _super.call(this) || this; @@ -249,7 +249,7 @@ var SomeDerived2 = (function (_super) { //super.publicStaticMemberNotFunction in static member accessor(get and set) of derived class //super.privateStaticProperty in static member function of derived class //super.privateStaticProperty in static member accessor(get and set) of derived class -var SomeDerived3 = (function (_super) { +var SomeDerived3 = /** @class */ (function (_super) { __extends(SomeDerived3, _super); function SomeDerived3() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/errorSupression1.js b/tests/baselines/reference/errorSupression1.js index e43e47adeda7a..2f467871434eb 100644 --- a/tests/baselines/reference/errorSupression1.js +++ b/tests/baselines/reference/errorSupression1.js @@ -8,7 +8,7 @@ baz.concat("y"); // So we don't want an error on 'concat'. //// [errorSupression1.js] -var Foo = (function () { +var Foo = /** @class */ (function () { function Foo() { } Foo.bar = function () { return "x"; }; diff --git a/tests/baselines/reference/errorsInGenericTypeReference.js b/tests/baselines/reference/errorsInGenericTypeReference.js index ad999dcb913e4..b2023978d51cb 100644 --- a/tests/baselines/reference/errorsInGenericTypeReference.js +++ b/tests/baselines/reference/errorsInGenericTypeReference.js @@ -82,13 +82,13 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var Foo = (function () { +var Foo = /** @class */ (function () { function Foo() { } return Foo; }()); // in call type arguments -var testClass1 = (function () { +var testClass1 = /** @class */ (function () { function testClass1() { } testClass1.prototype.method = function () { }; @@ -97,14 +97,14 @@ var testClass1 = (function () { var tc1 = new testClass1(); tc1.method(); // error: could not find symbol V // in constructor type arguments -var testClass2 = (function () { +var testClass2 = /** @class */ (function () { function testClass2() { } return testClass2; }()); var tc2 = new testClass2(); // error: could not find symbol V // in method return type annotation -var testClass3 = (function () { +var testClass3 = /** @class */ (function () { function testClass3() { } testClass3.prototype.testMethod1 = function () { return null; }; // error: could not find symbol V @@ -124,19 +124,19 @@ function testFunction2(p) { } // error: could not find symbol V // in var type annotation var f; // error: could not find symbol V // in constraints -var testClass4 = (function () { +var testClass4 = /** @class */ (function () { function testClass4() { } return testClass4; }()); // error: could not find symbol V -var testClass6 = (function () { +var testClass6 = /** @class */ (function () { function testClass6() { } testClass6.prototype.method = function () { }; // error: could not find symbol V return testClass6; }()); // in extends clause -var testClass7 = (function (_super) { +var testClass7 = /** @class */ (function (_super) { __extends(testClass7, _super); function testClass7() { return _super !== null && _super.apply(this, arguments) || this; @@ -144,7 +144,7 @@ var testClass7 = (function (_super) { return testClass7; }(Foo)); // error: could not find symbol V // in implements clause -var testClass8 = (function () { +var testClass8 = /** @class */ (function () { function testClass8() { } return testClass8; diff --git a/tests/baselines/reference/es3-amd.js b/tests/baselines/reference/es3-amd.js index caa9552c3f0ad..4f57f1ef0738e 100644 --- a/tests/baselines/reference/es3-amd.js +++ b/tests/baselines/reference/es3-amd.js @@ -13,7 +13,7 @@ class A } //// [es3-amd.js] -var A = (function () { +var A = /** @class */ (function () { function A() { } A.prototype.B = function () { diff --git a/tests/baselines/reference/es3-declaration-amd.js b/tests/baselines/reference/es3-declaration-amd.js index 0c447ff25b7d3..d063808aab27c 100644 --- a/tests/baselines/reference/es3-declaration-amd.js +++ b/tests/baselines/reference/es3-declaration-amd.js @@ -13,7 +13,7 @@ class A } //// [es3-declaration-amd.js] -var A = (function () { +var A = /** @class */ (function () { function A() { } A.prototype.B = function () { diff --git a/tests/baselines/reference/es3-sourcemap-amd.js b/tests/baselines/reference/es3-sourcemap-amd.js index d135a0cad7fff..894136b6427b4 100644 --- a/tests/baselines/reference/es3-sourcemap-amd.js +++ b/tests/baselines/reference/es3-sourcemap-amd.js @@ -13,7 +13,7 @@ class A } //// [es3-sourcemap-amd.js] -var A = (function () { +var A = /** @class */ (function () { function A() { } A.prototype.B = function () { diff --git a/tests/baselines/reference/es3-sourcemap-amd.sourcemap.txt b/tests/baselines/reference/es3-sourcemap-amd.sourcemap.txt index d3b9d665ade40..2c2bf5e3102e5 100644 --- a/tests/baselines/reference/es3-sourcemap-amd.sourcemap.txt +++ b/tests/baselines/reference/es3-sourcemap-amd.sourcemap.txt @@ -8,7 +8,7 @@ sources: es3-sourcemap-amd.ts emittedFile:tests/cases/compiler/es3-sourcemap-amd.js sourceFile:es3-sourcemap-amd.ts ------------------------------------------------------------------- ->>>var A = (function () { +>>>var A = /** @class */ (function () { 1 > 2 >^^^^^^^^^^^^^^^^^^^-> 1 > diff --git a/tests/baselines/reference/es3defaultAliasIsQuoted.js b/tests/baselines/reference/es3defaultAliasIsQuoted.js index ccc2085f97af9..bce340383ad77 100644 --- a/tests/baselines/reference/es3defaultAliasIsQuoted.js +++ b/tests/baselines/reference/es3defaultAliasIsQuoted.js @@ -16,7 +16,7 @@ assert(Foo.CONSTANT === "Foo"); //// [es3defaultAliasQuoted_file0.js] "use strict"; exports.__esModule = true; -var Foo = (function () { +var Foo = /** @class */ (function () { function Foo() { } Foo.CONSTANT = "Foo"; diff --git a/tests/baselines/reference/es5-amd.js b/tests/baselines/reference/es5-amd.js index 23314c78e1fed..c4f46f952c528 100644 --- a/tests/baselines/reference/es5-amd.js +++ b/tests/baselines/reference/es5-amd.js @@ -13,7 +13,7 @@ class A } //// [es5-amd.js] -var A = (function () { +var A = /** @class */ (function () { function A() { } A.prototype.B = function () { diff --git a/tests/baselines/reference/es5-commonjs.js b/tests/baselines/reference/es5-commonjs.js index e0f56796ef1da..231a47582b882 100644 --- a/tests/baselines/reference/es5-commonjs.js +++ b/tests/baselines/reference/es5-commonjs.js @@ -16,7 +16,7 @@ export default class A //// [es5-commonjs.js] "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); -var A = (function () { +var A = /** @class */ (function () { function A() { } A.prototype.B = function () { diff --git a/tests/baselines/reference/es5-commonjs4.js b/tests/baselines/reference/es5-commonjs4.js index 23ca56e442dc9..590f539a5c748 100644 --- a/tests/baselines/reference/es5-commonjs4.js +++ b/tests/baselines/reference/es5-commonjs4.js @@ -17,7 +17,7 @@ export var __esModule = 1; //// [es5-commonjs4.js] "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); -var A = (function () { +var A = /** @class */ (function () { function A() { } A.prototype.B = function () { diff --git a/tests/baselines/reference/es5-declaration-amd.js b/tests/baselines/reference/es5-declaration-amd.js index 618553ec0cf8d..428c97d63a583 100644 --- a/tests/baselines/reference/es5-declaration-amd.js +++ b/tests/baselines/reference/es5-declaration-amd.js @@ -13,7 +13,7 @@ class A } //// [es5-declaration-amd.js] -var A = (function () { +var A = /** @class */ (function () { function A() { } A.prototype.B = function () { diff --git a/tests/baselines/reference/es5-souremap-amd.js b/tests/baselines/reference/es5-souremap-amd.js index a4ac83a37af57..64c3c77047752 100644 --- a/tests/baselines/reference/es5-souremap-amd.js +++ b/tests/baselines/reference/es5-souremap-amd.js @@ -13,7 +13,7 @@ class A } //// [es5-souremap-amd.js] -var A = (function () { +var A = /** @class */ (function () { function A() { } A.prototype.B = function () { diff --git a/tests/baselines/reference/es5-souremap-amd.sourcemap.txt b/tests/baselines/reference/es5-souremap-amd.sourcemap.txt index b57cfc577154b..3494eaf937e35 100644 --- a/tests/baselines/reference/es5-souremap-amd.sourcemap.txt +++ b/tests/baselines/reference/es5-souremap-amd.sourcemap.txt @@ -8,7 +8,7 @@ sources: es5-souremap-amd.ts emittedFile:tests/cases/compiler/es5-souremap-amd.js sourceFile:es5-souremap-amd.ts ------------------------------------------------------------------- ->>>var A = (function () { +>>>var A = /** @class */ (function () { 1 > 2 >^^^^^^^^^^^^^^^^^^^-> 1 > diff --git a/tests/baselines/reference/es5-system.js b/tests/baselines/reference/es5-system.js index 4a62c429840d4..a46fc19455a31 100644 --- a/tests/baselines/reference/es5-system.js +++ b/tests/baselines/reference/es5-system.js @@ -21,7 +21,7 @@ System.register([], function (exports_1, context_1) { return { setters: [], execute: function () { - A = (function () { + A = /** @class */ (function () { function A() { } A.prototype.B = function () { diff --git a/tests/baselines/reference/es5-umd.js b/tests/baselines/reference/es5-umd.js index 9ade8c259c02d..f54d6087b762a 100644 --- a/tests/baselines/reference/es5-umd.js +++ b/tests/baselines/reference/es5-umd.js @@ -14,7 +14,7 @@ class A //// [es5-umd.js] -var A = (function () { +var A = /** @class */ (function () { function A() { } A.prototype.B = function () { diff --git a/tests/baselines/reference/es5-umd2.js b/tests/baselines/reference/es5-umd2.js index 335c0efa925ee..7da22e3ac73ef 100644 --- a/tests/baselines/reference/es5-umd2.js +++ b/tests/baselines/reference/es5-umd2.js @@ -25,7 +25,7 @@ export class A })(function (require, exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); - var A = (function () { + var A = /** @class */ (function () { function A() { } A.prototype.B = function () { diff --git a/tests/baselines/reference/es5-umd3.js b/tests/baselines/reference/es5-umd3.js index 48f9971bdd13f..3cec479008268 100644 --- a/tests/baselines/reference/es5-umd3.js +++ b/tests/baselines/reference/es5-umd3.js @@ -25,7 +25,7 @@ export default class A })(function (require, exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); - var A = (function () { + var A = /** @class */ (function () { function A() { } A.prototype.B = function () { diff --git a/tests/baselines/reference/es5-umd4.js b/tests/baselines/reference/es5-umd4.js index 71fdcc6f9b9b6..964028b2f7597 100644 --- a/tests/baselines/reference/es5-umd4.js +++ b/tests/baselines/reference/es5-umd4.js @@ -26,7 +26,7 @@ export = A; } })(function (require, exports) { "use strict"; - var A = (function () { + var A = /** @class */ (function () { function A() { } A.prototype.B = function () { diff --git a/tests/baselines/reference/es5ExportDefaultClassDeclaration.js b/tests/baselines/reference/es5ExportDefaultClassDeclaration.js index 39fc9336e911a..522ce2fec137a 100644 --- a/tests/baselines/reference/es5ExportDefaultClassDeclaration.js +++ b/tests/baselines/reference/es5ExportDefaultClassDeclaration.js @@ -7,7 +7,7 @@ export default class C { //// [es5ExportDefaultClassDeclaration.js] "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); -var C = (function () { +var C = /** @class */ (function () { function C() { } C.prototype.method = function () { }; diff --git a/tests/baselines/reference/es5ExportDefaultClassDeclaration2.js b/tests/baselines/reference/es5ExportDefaultClassDeclaration2.js index fae48029e6b53..979a9531590c7 100644 --- a/tests/baselines/reference/es5ExportDefaultClassDeclaration2.js +++ b/tests/baselines/reference/es5ExportDefaultClassDeclaration2.js @@ -7,7 +7,7 @@ export default class { //// [es5ExportDefaultClassDeclaration2.js] "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); -var default_1 = (function () { +var default_1 = /** @class */ (function () { function default_1() { } default_1.prototype.method = function () { }; diff --git a/tests/baselines/reference/es5ExportDefaultClassDeclaration3.js b/tests/baselines/reference/es5ExportDefaultClassDeclaration3.js index 5c256022032fe..97a8e7359292f 100644 --- a/tests/baselines/reference/es5ExportDefaultClassDeclaration3.js +++ b/tests/baselines/reference/es5ExportDefaultClassDeclaration3.js @@ -17,7 +17,7 @@ var t: typeof C = C; "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var before = new C(); -var C = (function () { +var C = /** @class */ (function () { function C() { } C.prototype.method = function () { diff --git a/tests/baselines/reference/es5ExportEqualsDts.js b/tests/baselines/reference/es5ExportEqualsDts.js index b8d79efef94ef..f8962777585ba 100644 --- a/tests/baselines/reference/es5ExportEqualsDts.js +++ b/tests/baselines/reference/es5ExportEqualsDts.js @@ -14,7 +14,7 @@ export = A //// [es5ExportEqualsDts.js] "use strict"; -var A = (function () { +var A = /** @class */ (function () { function A() { } A.prototype.foo = function () { diff --git a/tests/baselines/reference/es5ModuleInternalNamedImports.js b/tests/baselines/reference/es5ModuleInternalNamedImports.js index 74063c4348f7a..88b9c1b22ca89 100644 --- a/tests/baselines/reference/es5ModuleInternalNamedImports.js +++ b/tests/baselines/reference/es5ModuleInternalNamedImports.js @@ -44,7 +44,7 @@ define(["require", "exports"], function (require, exports) { // variable M.M_V = 0; //calss - var M_C = (function () { + var M_C = /** @class */ (function () { function M_C() { } return M_C; diff --git a/tests/baselines/reference/es5ModuleWithModuleGenAmd.js b/tests/baselines/reference/es5ModuleWithModuleGenAmd.js index dc55545617d1f..229f6dee5d2ff 100644 --- a/tests/baselines/reference/es5ModuleWithModuleGenAmd.js +++ b/tests/baselines/reference/es5ModuleWithModuleGenAmd.js @@ -15,7 +15,7 @@ export class A define(["require", "exports"], function (require, exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); - var A = (function () { + var A = /** @class */ (function () { function A() { } A.prototype.B = function () { diff --git a/tests/baselines/reference/es5ModuleWithModuleGenCommonjs.js b/tests/baselines/reference/es5ModuleWithModuleGenCommonjs.js index 93056203f9b4e..60da6e13cd7d2 100644 --- a/tests/baselines/reference/es5ModuleWithModuleGenCommonjs.js +++ b/tests/baselines/reference/es5ModuleWithModuleGenCommonjs.js @@ -14,7 +14,7 @@ export class A //// [es5ModuleWithModuleGenCommonjs.js] "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); -var A = (function () { +var A = /** @class */ (function () { function A() { } A.prototype.B = function () { diff --git a/tests/baselines/reference/es5ModuleWithoutModuleGenTarget.js b/tests/baselines/reference/es5ModuleWithoutModuleGenTarget.js index 89d11045ddac2..6bbb81e3a6f04 100644 --- a/tests/baselines/reference/es5ModuleWithoutModuleGenTarget.js +++ b/tests/baselines/reference/es5ModuleWithoutModuleGenTarget.js @@ -14,7 +14,7 @@ export class A //// [es5ModuleWithoutModuleGenTarget.js] "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); -var A = (function () { +var A = /** @class */ (function () { function A() { } A.prototype.B = function () { diff --git a/tests/baselines/reference/es5andes6module.js b/tests/baselines/reference/es5andes6module.js index bfa260eaa3ca4..da12c60a4532c 100644 --- a/tests/baselines/reference/es5andes6module.js +++ b/tests/baselines/reference/es5andes6module.js @@ -14,7 +14,7 @@ export default class A //// [es5andes6module.js] -var A = (function () { +var A = /** @class */ (function () { function A() { } A.prototype.B = function () { diff --git a/tests/baselines/reference/es6ClassSuperCodegenBug.js b/tests/baselines/reference/es6ClassSuperCodegenBug.js index 95b4adb25ee51..90b89d004eabb 100644 --- a/tests/baselines/reference/es6ClassSuperCodegenBug.js +++ b/tests/baselines/reference/es6ClassSuperCodegenBug.js @@ -24,12 +24,12 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var A = (function () { +var A = /** @class */ (function () { function A(str1, str2) { } return A; }()); -var B = (function (_super) { +var B = /** @class */ (function (_super) { __extends(B, _super); function B() { var _this = this; diff --git a/tests/baselines/reference/es6ClassTest.js b/tests/baselines/reference/es6ClassTest.js index d727ab49a341a..5311a027efa77 100644 --- a/tests/baselines/reference/es6ClassTest.js +++ b/tests/baselines/reference/es6ClassTest.js @@ -95,7 +95,7 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var Bar = (function () { +var Bar = /** @class */ (function () { function Bar(n) { } Bar.prototype.prop1 = function (x) { @@ -104,7 +104,7 @@ var Bar = (function () { return Bar; }()); // new-style class -var Foo = (function (_super) { +var Foo = /** @class */ (function (_super) { __extends(Foo, _super); function Foo(x, y, z) { if (z === void 0) { z = 0; } diff --git a/tests/baselines/reference/es6ClassTest2.js b/tests/baselines/reference/es6ClassTest2.js index 216a05ac2eb0b..90e460f6fe39d 100644 --- a/tests/baselines/reference/es6ClassTest2.js +++ b/tests/baselines/reference/es6ClassTest2.js @@ -169,7 +169,7 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var BasicMonster = (function () { +var BasicMonster = /** @class */ (function () { function BasicMonster(name, health) { this.name = name; this.health = health; @@ -185,7 +185,7 @@ var m2 = new BasicMonster("2", 100); m1.attack(m2); m1.health = 0; console.log(m5.isAlive.toString()); -var GetSetMonster = (function () { +var GetSetMonster = /** @class */ (function () { function GetSetMonster(name, _health) { this.name = name; this._health = _health; @@ -221,7 +221,7 @@ var m4 = new BasicMonster("2", 100); m3.attack(m4); m3.health = 0; var x = m5.isAlive.toString(); -var OverloadedMonster = (function () { +var OverloadedMonster = /** @class */ (function () { function OverloadedMonster(name, health) { this.name = name; this.health = health; @@ -237,7 +237,7 @@ var m6 = new OverloadedMonster("2"); m5.attack(m6); m5.health = 0; var y = m5.isAlive.toString(); -var SplatMonster = (function () { +var SplatMonster = /** @class */ (function () { function SplatMonster() { var args = []; for (var _i = 0; _i < arguments.length; _i++) { @@ -253,14 +253,14 @@ var SplatMonster = (function () { return SplatMonster; }()); function foo() { return true; } -var PrototypeMonster = (function () { +var PrototypeMonster = /** @class */ (function () { function PrototypeMonster() { this.age = 1; this.b = foo(); } return PrototypeMonster; }()); -var SuperParent = (function () { +var SuperParent = /** @class */ (function () { function SuperParent(a) { } SuperParent.prototype.b = function (b) { @@ -269,7 +269,7 @@ var SuperParent = (function () { }; return SuperParent; }()); -var SuperChild = (function (_super) { +var SuperChild = /** @class */ (function (_super) { __extends(SuperChild, _super); function SuperChild() { return _super.call(this, 1) || this; @@ -282,7 +282,7 @@ var SuperChild = (function (_super) { }; return SuperChild; }(SuperParent)); -var Statics = (function () { +var Statics = /** @class */ (function () { function Statics() { } Statics.baz = function () { @@ -292,14 +292,14 @@ var Statics = (function () { return Statics; }()); var stat = new Statics(); -var ImplementsInterface = (function () { +var ImplementsInterface = /** @class */ (function () { function ImplementsInterface() { this.x = 1; this.z = "foo"; } return ImplementsInterface; }()); -var Visibility = (function () { +var Visibility = /** @class */ (function () { function Visibility() { this.x = 1; this.y = 2; @@ -308,7 +308,7 @@ var Visibility = (function () { Visibility.prototype.bar = function () { }; return Visibility; }()); -var BaseClassWithConstructor = (function () { +var BaseClassWithConstructor = /** @class */ (function () { function BaseClassWithConstructor(x, s) { this.x = x; this.s = s; @@ -316,7 +316,7 @@ var BaseClassWithConstructor = (function () { return BaseClassWithConstructor; }()); // used to test codegen -var ChildClassWithoutConstructor = (function (_super) { +var ChildClassWithoutConstructor = /** @class */ (function (_super) { __extends(ChildClassWithoutConstructor, _super); function ChildClassWithoutConstructor() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/es6ClassTest3.js b/tests/baselines/reference/es6ClassTest3.js index daf6f63a2c18f..833aca18fdc8e 100644 --- a/tests/baselines/reference/es6ClassTest3.js +++ b/tests/baselines/reference/es6ClassTest3.js @@ -17,7 +17,7 @@ module M { //// [es6ClassTest3.js] var M; (function (M) { - var Visibility = (function () { + var Visibility = /** @class */ (function () { function Visibility() { this.x = 1; this.y = 2; diff --git a/tests/baselines/reference/es6ClassTest5.js b/tests/baselines/reference/es6ClassTest5.js index 7d4238fda65b1..192c47625414e 100644 --- a/tests/baselines/reference/es6ClassTest5.js +++ b/tests/baselines/reference/es6ClassTest5.js @@ -13,7 +13,7 @@ class bigClass { //// [es6ClassTest5.js] -var C1T5 = (function () { +var C1T5 = /** @class */ (function () { function C1T5() { this.foo = function (i) { return i; @@ -21,7 +21,7 @@ var C1T5 = (function () { } return C1T5; }()); -var bigClass = (function () { +var bigClass = /** @class */ (function () { function bigClass() { this["break"] = 1; } diff --git a/tests/baselines/reference/es6ClassTest7.js b/tests/baselines/reference/es6ClassTest7.js index 8251d5ec476f1..adfea13d7e063 100644 --- a/tests/baselines/reference/es6ClassTest7.js +++ b/tests/baselines/reference/es6ClassTest7.js @@ -19,7 +19,7 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var Bar = (function (_super) { +var Bar = /** @class */ (function (_super) { __extends(Bar, _super); function Bar() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/es6ClassTest8.js b/tests/baselines/reference/es6ClassTest8.js index afac7054ee384..73d8cf0f281aa 100644 --- a/tests/baselines/reference/es6ClassTest8.js +++ b/tests/baselines/reference/es6ClassTest8.js @@ -42,7 +42,7 @@ class Camera { //// [es6ClassTest8.js] function f1(x) { return x; } -var C = (function () { +var C = /** @class */ (function () { function C() { var bar = (function () { return bar; // 'bar' should be resolvable @@ -51,7 +51,7 @@ var C = (function () { } return C; }()); -var Vector = (function () { +var Vector = /** @class */ (function () { function Vector(x, y, z) { this.x = x; this.y = y; @@ -64,7 +64,7 @@ var Vector = (function () { Vector.dot = function (v1, v2) { return null; }; return Vector; }()); -var Camera = (function () { +var Camera = /** @class */ (function () { function Camera(pos, lookAt) { this.pos = pos; var down = new Vector(0.0, -1.0, 0.0); diff --git a/tests/baselines/reference/es6DeclOrdering.js b/tests/baselines/reference/es6DeclOrdering.js index b5dc55ebc9c72..cd785e7d9cf22 100644 --- a/tests/baselines/reference/es6DeclOrdering.js +++ b/tests/baselines/reference/es6DeclOrdering.js @@ -17,7 +17,7 @@ class Bar { //// [es6DeclOrdering.js] -var Bar = (function () { +var Bar = /** @class */ (function () { function Bar(store) { this._store = store; // this is an error for some reason? Unresolved symbol store } diff --git a/tests/baselines/reference/es6ExportAllInEs5.js b/tests/baselines/reference/es6ExportAllInEs5.js index 6b1b1c82354d3..ee949682f625d 100644 --- a/tests/baselines/reference/es6ExportAllInEs5.js +++ b/tests/baselines/reference/es6ExportAllInEs5.js @@ -18,7 +18,7 @@ export * from "./server"; //// [server.js] "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); -var c = (function () { +var c = /** @class */ (function () { function c() { } return c; diff --git a/tests/baselines/reference/es6ExportClauseInEs5.js b/tests/baselines/reference/es6ExportClauseInEs5.js index d6d44fe8b2b55..447bb8c5f14cb 100644 --- a/tests/baselines/reference/es6ExportClauseInEs5.js +++ b/tests/baselines/reference/es6ExportClauseInEs5.js @@ -18,7 +18,7 @@ export { x }; //// [server.js] "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); -var c = (function () { +var c = /** @class */ (function () { function c() { } return c; diff --git a/tests/baselines/reference/es6ExportClauseWithoutModuleSpecifierInEs5.js b/tests/baselines/reference/es6ExportClauseWithoutModuleSpecifierInEs5.js index d9b31f4edbbf5..00e5f73f0fdde 100644 --- a/tests/baselines/reference/es6ExportClauseWithoutModuleSpecifierInEs5.js +++ b/tests/baselines/reference/es6ExportClauseWithoutModuleSpecifierInEs5.js @@ -22,7 +22,7 @@ export { x } from "./server"; //// [server.js] "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); -var c = (function () { +var c = /** @class */ (function () { function c() { } return c; diff --git a/tests/baselines/reference/es6ImportDefaultBindingDts.js b/tests/baselines/reference/es6ImportDefaultBindingDts.js index 55df3a8e98ed7..5011e3144fd16 100644 --- a/tests/baselines/reference/es6ImportDefaultBindingDts.js +++ b/tests/baselines/reference/es6ImportDefaultBindingDts.js @@ -13,7 +13,7 @@ import defaultBinding2 from "./server"; // elide this import since defaultBindin //// [server.js] "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); -var c = (function () { +var c = /** @class */ (function () { function c() { } return c; diff --git a/tests/baselines/reference/es6ImportDefaultBindingFollowedWithNamedImportDts.js b/tests/baselines/reference/es6ImportDefaultBindingFollowedWithNamedImportDts.js index 0809a5278f0c6..05774d9961c4a 100644 --- a/tests/baselines/reference/es6ImportDefaultBindingFollowedWithNamedImportDts.js +++ b/tests/baselines/reference/es6ImportDefaultBindingFollowedWithNamedImportDts.js @@ -26,37 +26,37 @@ export var x6 = new m(); //// [server.js] "use strict"; exports.__esModule = true; -var a = (function () { +var a = /** @class */ (function () { function a() { } return a; }()); exports.a = a; -var x = (function () { +var x = /** @class */ (function () { function x() { } return x; }()); exports.x = x; -var m = (function () { +var m = /** @class */ (function () { function m() { } return m; }()); exports.m = m; -var a11 = (function () { +var a11 = /** @class */ (function () { function a11() { } return a11; }()); exports.a11 = a11; -var a12 = (function () { +var a12 = /** @class */ (function () { function a12() { } return a12; }()); exports.a12 = a12; -var x11 = (function () { +var x11 = /** @class */ (function () { function x11() { } return x11; diff --git a/tests/baselines/reference/es6ImportDefaultBindingFollowedWithNamedImportDts1.js b/tests/baselines/reference/es6ImportDefaultBindingFollowedWithNamedImportDts1.js index cf0219ce1c749..3c8b211981950 100644 --- a/tests/baselines/reference/es6ImportDefaultBindingFollowedWithNamedImportDts1.js +++ b/tests/baselines/reference/es6ImportDefaultBindingFollowedWithNamedImportDts1.js @@ -21,7 +21,7 @@ export var x6 = new defaultBinding6(); //// [server.js] "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); -var a = (function () { +var a = /** @class */ (function () { function a() { } return a; diff --git a/tests/baselines/reference/es6ImportDefaultBindingFollowedWithNamespaceBindingDts.js b/tests/baselines/reference/es6ImportDefaultBindingFollowedWithNamespaceBindingDts.js index b153fb042eb6c..47b02ccd40a37 100644 --- a/tests/baselines/reference/es6ImportDefaultBindingFollowedWithNamespaceBindingDts.js +++ b/tests/baselines/reference/es6ImportDefaultBindingFollowedWithNamespaceBindingDts.js @@ -10,7 +10,7 @@ export var x = new nameSpaceBinding.a(); //// [server.js] "use strict"; exports.__esModule = true; -var a = (function () { +var a = /** @class */ (function () { function a() { } return a; diff --git a/tests/baselines/reference/es6ImportDefaultBindingFollowedWithNamespaceBindingDts1.js b/tests/baselines/reference/es6ImportDefaultBindingFollowedWithNamespaceBindingDts1.js index 41140c71646d2..240e9a483cba4 100644 --- a/tests/baselines/reference/es6ImportDefaultBindingFollowedWithNamespaceBindingDts1.js +++ b/tests/baselines/reference/es6ImportDefaultBindingFollowedWithNamespaceBindingDts1.js @@ -12,7 +12,7 @@ export var x = new defaultBinding(); define(["require", "exports"], function (require, exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); - var a = (function () { + var a = /** @class */ (function () { function a() { } return a; diff --git a/tests/baselines/reference/es6ImportNameSpaceImportDts.js b/tests/baselines/reference/es6ImportNameSpaceImportDts.js index d57f881de91ad..e39402c36332c 100644 --- a/tests/baselines/reference/es6ImportNameSpaceImportDts.js +++ b/tests/baselines/reference/es6ImportNameSpaceImportDts.js @@ -11,7 +11,7 @@ import * as nameSpaceBinding2 from "./server"; // unreferenced //// [server.js] "use strict"; exports.__esModule = true; -var c = (function () { +var c = /** @class */ (function () { function c() { } return c; diff --git a/tests/baselines/reference/es6ImportNamedImportDts.js b/tests/baselines/reference/es6ImportNamedImportDts.js index 0ce09d4b180bf..ea001629665db 100644 --- a/tests/baselines/reference/es6ImportNamedImportDts.js +++ b/tests/baselines/reference/es6ImportNamedImportDts.js @@ -48,85 +48,85 @@ import { aaaa1 as bbbb } from "./server"; //// [server.js] "use strict"; exports.__esModule = true; -var a = (function () { +var a = /** @class */ (function () { function a() { } return a; }()); exports.a = a; -var a11 = (function () { +var a11 = /** @class */ (function () { function a11() { } return a11; }()); exports.a11 = a11; -var a12 = (function () { +var a12 = /** @class */ (function () { function a12() { } return a12; }()); exports.a12 = a12; -var x = (function () { +var x = /** @class */ (function () { function x() { } return x; }()); exports.x = x; -var x11 = (function () { +var x11 = /** @class */ (function () { function x11() { } return x11; }()); exports.x11 = x11; -var m = (function () { +var m = /** @class */ (function () { function m() { } return m; }()); exports.m = m; -var a1 = (function () { +var a1 = /** @class */ (function () { function a1() { } return a1; }()); exports.a1 = a1; -var x1 = (function () { +var x1 = /** @class */ (function () { function x1() { } return x1; }()); exports.x1 = x1; -var a111 = (function () { +var a111 = /** @class */ (function () { function a111() { } return a111; }()); exports.a111 = a111; -var x111 = (function () { +var x111 = /** @class */ (function () { function x111() { } return x111; }()); exports.x111 = x111; -var z1 = (function () { +var z1 = /** @class */ (function () { function z1() { } return z1; }()); exports.z1 = z1; -var z2 = (function () { +var z2 = /** @class */ (function () { function z2() { } return z2; }()); exports.z2 = z2; -var aaaa = (function () { +var aaaa = /** @class */ (function () { function aaaa() { } return aaaa; }()); exports.aaaa = aaaa; -var aaaa1 = (function () { +var aaaa1 = /** @class */ (function () { function aaaa1() { } return aaaa1; diff --git a/tests/baselines/reference/es6ImportNamedImportInIndirectExportAssignment.js b/tests/baselines/reference/es6ImportNamedImportInIndirectExportAssignment.js index 3acd2f9c4a075..8f6448ff59977 100644 --- a/tests/baselines/reference/es6ImportNamedImportInIndirectExportAssignment.js +++ b/tests/baselines/reference/es6ImportNamedImportInIndirectExportAssignment.js @@ -16,7 +16,7 @@ export = x; exports.__esModule = true; var a; (function (a) { - var c = (function () { + var c = /** @class */ (function () { function c() { } return c; diff --git a/tests/baselines/reference/es6ImportNamedImportWithTypesAndValues.js b/tests/baselines/reference/es6ImportNamedImportWithTypesAndValues.js index 2a00feccd3b59..571f9c94ed97d 100644 --- a/tests/baselines/reference/es6ImportNamedImportWithTypesAndValues.js +++ b/tests/baselines/reference/es6ImportNamedImportWithTypesAndValues.js @@ -22,14 +22,14 @@ export var cVal = new C(); //// [server.js] "use strict"; exports.__esModule = true; -var C = (function () { +var C = /** @class */ (function () { function C() { this.prop = "hello"; } return C; }()); exports.C = C; -var C2 = (function () { +var C2 = /** @class */ (function () { function C2() { this.prop2 = "world"; } diff --git a/tests/baselines/reference/es6MemberScoping.js b/tests/baselines/reference/es6MemberScoping.js index de442616dc3ae..2d7ff453933c5 100644 --- a/tests/baselines/reference/es6MemberScoping.js +++ b/tests/baselines/reference/es6MemberScoping.js @@ -16,7 +16,7 @@ class Foo2 { //// [es6MemberScoping.js] -var Foo = (function () { +var Foo = /** @class */ (function () { function Foo(store) { this._store = store; // should be an error. } @@ -25,7 +25,7 @@ var Foo = (function () { }; return Foo; }()); -var Foo2 = (function () { +var Foo2 = /** @class */ (function () { function Foo2() { } Foo2.Foo2 = function () { return 0; }; // should not be an error diff --git a/tests/baselines/reference/es6modulekindWithES5Target.js b/tests/baselines/reference/es6modulekindWithES5Target.js index b813bc01992b6..3689bb9027f75 100644 --- a/tests/baselines/reference/es6modulekindWithES5Target.js +++ b/tests/baselines/reference/es6modulekindWithES5Target.js @@ -26,7 +26,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key, else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; -var C = (function () { +var C = /** @class */ (function () { function C() { this.p = 1; } @@ -36,7 +36,7 @@ var C = (function () { }()); export { C }; export { C as C2 }; -var D = (function () { +var D = /** @class */ (function () { function D() { this.p = 1; } @@ -49,7 +49,7 @@ var D = (function () { }()); export { D }; export { D as D2 }; -var E = (function () { +var E = /** @class */ (function () { function E() { } return E; diff --git a/tests/baselines/reference/es6modulekindWithES5Target11.js b/tests/baselines/reference/es6modulekindWithES5Target11.js index a89da173951f6..67cee76f74192 100644 --- a/tests/baselines/reference/es6modulekindWithES5Target11.js +++ b/tests/baselines/reference/es6modulekindWithES5Target11.js @@ -15,7 +15,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key, else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; -var C = (function () { +var C = /** @class */ (function () { function C() { this.p = 1; } diff --git a/tests/baselines/reference/es6modulekindWithES5Target12.js b/tests/baselines/reference/es6modulekindWithES5Target12.js index f0ccbf0701eca..a0aafcae25e0a 100644 --- a/tests/baselines/reference/es6modulekindWithES5Target12.js +++ b/tests/baselines/reference/es6modulekindWithES5Target12.js @@ -37,7 +37,7 @@ export namespace F { } //// [es6modulekindWithES5Target12.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } return C; diff --git a/tests/baselines/reference/es6modulekindWithES5Target2.js b/tests/baselines/reference/es6modulekindWithES5Target2.js index a67bba11e2359..f3921d3f2bf8d 100644 --- a/tests/baselines/reference/es6modulekindWithES5Target2.js +++ b/tests/baselines/reference/es6modulekindWithES5Target2.js @@ -7,7 +7,7 @@ export default class C { //// [es6modulekindWithES5Target2.js] -var C = (function () { +var C = /** @class */ (function () { function C() { this.p = 1; } diff --git a/tests/baselines/reference/es6modulekindWithES5Target3.js b/tests/baselines/reference/es6modulekindWithES5Target3.js index 2a9778691a691..1c3f03cc57103 100644 --- a/tests/baselines/reference/es6modulekindWithES5Target3.js +++ b/tests/baselines/reference/es6modulekindWithES5Target3.js @@ -14,7 +14,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key, else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; -var D = (function () { +var D = /** @class */ (function () { function D() { this.p = 1; } diff --git a/tests/baselines/reference/es6modulekindWithES5Target4.js b/tests/baselines/reference/es6modulekindWithES5Target4.js index 15b534fe1080e..4ef008026a8e0 100644 --- a/tests/baselines/reference/es6modulekindWithES5Target4.js +++ b/tests/baselines/reference/es6modulekindWithES5Target4.js @@ -3,7 +3,7 @@ class E { } export default E; //// [es6modulekindWithES5Target4.js] -var E = (function () { +var E = /** @class */ (function () { function E() { } return E; diff --git a/tests/baselines/reference/escapedIdentifiers.js b/tests/baselines/reference/escapedIdentifiers.js index 37dcb2f7798c6..501ecccaa5efc 100644 --- a/tests/baselines/reference/escapedIdentifiers.js +++ b/tests/baselines/reference/escapedIdentifiers.js @@ -149,12 +149,12 @@ moduleType\u0031.baz1 = 3; moduleType2.baz2 = 3; moduleType\u0032.baz2 = 3; // classes -var classType1 = (function () { +var classType1 = /** @class */ (function () { function classType1() { } return classType1; }()); -var classType\u0032 = (function () { +var classType\u0032 = /** @class */ (function () { function classType\u0032() { } return classType\u0032; @@ -176,7 +176,7 @@ interfaceType2Object1.bar2 = 2; var interfaceType2Object2 = { bar2: 0 }; interfaceType2Object2.bar2 = 2; // arguments -var testClass = (function () { +var testClass = /** @class */ (function () { function testClass() { } testClass.prototype.func = function (arg1, arg\u0032, arg\u0033, arg4) { @@ -188,7 +188,7 @@ var testClass = (function () { return testClass; }()); // constructors -var constructorTestClass = (function () { +var constructorTestClass = /** @class */ (function () { function constructorTestClass(arg1, arg\u0032, arg\u0033, arg4) { this.arg1 = arg1; this.arg\u0032 = arg\u0032; diff --git a/tests/baselines/reference/everyTypeAssignableToAny.js b/tests/baselines/reference/everyTypeAssignableToAny.js index 0b72b9156186c..7f02badca009e 100644 --- a/tests/baselines/reference/everyTypeAssignableToAny.js +++ b/tests/baselines/reference/everyTypeAssignableToAny.js @@ -62,7 +62,7 @@ function foo(x: T, y: U, z: V) { //// [everyTypeAssignableToAny.js] var a; -var C = (function () { +var C = /** @class */ (function () { function C() { } return C; diff --git a/tests/baselines/reference/everyTypeWithAnnotationAndInitializer.js b/tests/baselines/reference/everyTypeWithAnnotationAndInitializer.js index 50068024b830b..43cd673ab655c 100644 --- a/tests/baselines/reference/everyTypeWithAnnotationAndInitializer.js +++ b/tests/baselines/reference/everyTypeWithAnnotationAndInitializer.js @@ -49,12 +49,12 @@ var aFunctionInModule: typeof M.F2 = (x) => 'this is a string'; //// [everyTypeWithAnnotationAndInitializer.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } return C; }()); -var D = (function () { +var D = /** @class */ (function () { function D() { } return D; @@ -62,7 +62,7 @@ var D = (function () { function F(x) { return 42; } var M; (function (M) { - var A = (function () { + var A = /** @class */ (function () { function A() { } return A; diff --git a/tests/baselines/reference/everyTypeWithAnnotationAndInvalidInitializer.js b/tests/baselines/reference/everyTypeWithAnnotationAndInvalidInitializer.js index 8ae23514920eb..c9f90f14195d0 100644 --- a/tests/baselines/reference/everyTypeWithAnnotationAndInvalidInitializer.js +++ b/tests/baselines/reference/everyTypeWithAnnotationAndInvalidInitializer.js @@ -55,12 +55,12 @@ var aFunctionInModule: typeof M.F2 = F2; //// [everyTypeWithAnnotationAndInvalidInitializer.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } return C; }()); -var D = (function () { +var D = /** @class */ (function () { function D() { } return D; @@ -69,7 +69,7 @@ function F(x) { return 42; } function F2(x) { return x < 42; } var M; (function (M) { - var A = (function () { + var A = /** @class */ (function () { function A() { } return A; @@ -80,7 +80,7 @@ var M; })(M || (M = {})); var N; (function (N) { - var A = (function () { + var A = /** @class */ (function () { function A() { } return A; diff --git a/tests/baselines/reference/everyTypeWithInitializer.js b/tests/baselines/reference/everyTypeWithInitializer.js index b6af5725c9235..7e7bd6adc6e3f 100644 --- a/tests/baselines/reference/everyTypeWithInitializer.js +++ b/tests/baselines/reference/everyTypeWithInitializer.js @@ -50,12 +50,12 @@ var x; //// [everyTypeWithInitializer.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } return C; }()); -var D = (function () { +var D = /** @class */ (function () { function D() { } return D; @@ -63,7 +63,7 @@ var D = (function () { function F(x) { return 42; } var M; (function (M) { - var A = (function () { + var A = /** @class */ (function () { function A() { } return A; diff --git a/tests/baselines/reference/exhaustiveSwitchWithWideningLiteralTypes.js b/tests/baselines/reference/exhaustiveSwitchWithWideningLiteralTypes.js index 317629c4cb88c..1612933d62d6d 100644 --- a/tests/baselines/reference/exhaustiveSwitchWithWideningLiteralTypes.js +++ b/tests/baselines/reference/exhaustiveSwitchWithWideningLiteralTypes.js @@ -18,13 +18,13 @@ function f(value: A | B): number { //// [exhaustiveSwitchWithWideningLiteralTypes.js] // Repro from #12529 -var A = (function () { +var A = /** @class */ (function () { function A() { this.kind = "A"; // (property) A.kind: "A" } return A; }()); -var B = (function () { +var B = /** @class */ (function () { function B() { this.kind = "B"; // (property) B.kind: "B" } diff --git a/tests/baselines/reference/exportAlreadySeen.js b/tests/baselines/reference/exportAlreadySeen.js index 749b08b18cd49..9f48b7ef9bb47 100644 --- a/tests/baselines/reference/exportAlreadySeen.js +++ b/tests/baselines/reference/exportAlreadySeen.js @@ -27,7 +27,7 @@ var M; M.f = f; var N; (function (N) { - var C = (function () { + var C = /** @class */ (function () { function C() { } return C; diff --git a/tests/baselines/reference/exportAssignClassAndModule.js b/tests/baselines/reference/exportAssignClassAndModule.js index 9f3eaf78480ba..ba3d04c8f53f1 100644 --- a/tests/baselines/reference/exportAssignClassAndModule.js +++ b/tests/baselines/reference/exportAssignClassAndModule.js @@ -20,7 +20,7 @@ zz.x; //// [exportAssignClassAndModule_0.js] "use strict"; -var Foo = (function () { +var Foo = /** @class */ (function () { function Foo() { } return Foo; diff --git a/tests/baselines/reference/exportAssignNonIdentifier.js b/tests/baselines/reference/exportAssignNonIdentifier.js index 6209ade63cde2..6f90d4d97910a 100644 --- a/tests/baselines/reference/exportAssignNonIdentifier.js +++ b/tests/baselines/reference/exportAssignNonIdentifier.js @@ -36,7 +36,7 @@ module.exports = typeof x; module.exports = "sausages"; //// [foo3.js] "use strict"; -module.exports = (function () { +module.exports = /** @class */ (function () { function Foo3() { } return Foo3; diff --git a/tests/baselines/reference/exportAssignmentAndDeclaration.js b/tests/baselines/reference/exportAssignmentAndDeclaration.js index df1f2ef0d0add..41b6e87ae0a5d 100644 --- a/tests/baselines/reference/exportAssignmentAndDeclaration.js +++ b/tests/baselines/reference/exportAssignmentAndDeclaration.js @@ -19,7 +19,7 @@ define(["require", "exports"], function (require, exports) { E1[E1["B"] = 1] = "B"; E1[E1["C"] = 2] = "C"; })(E1 = exports.E1 || (exports.E1 = {})); - var C1 = (function () { + var C1 = /** @class */ (function () { function C1() { } return C1; diff --git a/tests/baselines/reference/exportAssignmentClass.js b/tests/baselines/reference/exportAssignmentClass.js index 549ad5bbd4dcb..4499caaf4f0c9 100644 --- a/tests/baselines/reference/exportAssignmentClass.js +++ b/tests/baselines/reference/exportAssignmentClass.js @@ -14,7 +14,7 @@ var x = d.p; //// [exportAssignmentClass_A.js] define(["require", "exports"], function (require, exports) { "use strict"; - var C = (function () { + var C = /** @class */ (function () { function C() { this.p = 0; } diff --git a/tests/baselines/reference/exportAssignmentConstrainedGenericType.js b/tests/baselines/reference/exportAssignmentConstrainedGenericType.js index eddbddf8d6d87..df24a0bad887f 100644 --- a/tests/baselines/reference/exportAssignmentConstrainedGenericType.js +++ b/tests/baselines/reference/exportAssignmentConstrainedGenericType.js @@ -16,7 +16,7 @@ var z: number = y.test.b; //// [foo_0.js] "use strict"; -var Foo = (function () { +var Foo = /** @class */ (function () { function Foo(x) { } return Foo; diff --git a/tests/baselines/reference/exportAssignmentGenericType.js b/tests/baselines/reference/exportAssignmentGenericType.js index 95563aa36a9dd..4cccd68a4da0b 100644 --- a/tests/baselines/reference/exportAssignmentGenericType.js +++ b/tests/baselines/reference/exportAssignmentGenericType.js @@ -14,7 +14,7 @@ var y:number = x.test; //// [foo_0.js] "use strict"; -var Foo = (function () { +var Foo = /** @class */ (function () { function Foo() { } return Foo; diff --git a/tests/baselines/reference/exportAssignmentOfGenericType1.js b/tests/baselines/reference/exportAssignmentOfGenericType1.js index 9cd15ec01a4c4..369a50b8677f0 100644 --- a/tests/baselines/reference/exportAssignmentOfGenericType1.js +++ b/tests/baselines/reference/exportAssignmentOfGenericType1.js @@ -16,7 +16,7 @@ var r: string = m.foo; //// [exportAssignmentOfGenericType1_0.js] define(["require", "exports"], function (require, exports) { "use strict"; - var T = (function () { + var T = /** @class */ (function () { function T() { } return T; @@ -37,7 +37,7 @@ var __extends = (this && this.__extends) || (function () { define(["require", "exports", "exportAssignmentOfGenericType1_0"], function (require, exports, q) { "use strict"; exports.__esModule = true; - var M = (function (_super) { + var M = /** @class */ (function (_super) { __extends(M, _super); function M() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/exportAssignmentTopLevelClodule.js b/tests/baselines/reference/exportAssignmentTopLevelClodule.js index f4001e5ab1572..857488248bbee 100644 --- a/tests/baselines/reference/exportAssignmentTopLevelClodule.js +++ b/tests/baselines/reference/exportAssignmentTopLevelClodule.js @@ -19,7 +19,7 @@ if(foo.answer === 42){ //// [foo_0.js] define(["require", "exports"], function (require, exports) { "use strict"; - var Foo = (function () { + var Foo = /** @class */ (function () { function Foo() { this.test = "test"; } diff --git a/tests/baselines/reference/exportAssignmentWithExports.js b/tests/baselines/reference/exportAssignmentWithExports.js index 8441b7b4320d9..7aee824be14c9 100644 --- a/tests/baselines/reference/exportAssignmentWithExports.js +++ b/tests/baselines/reference/exportAssignmentWithExports.js @@ -5,12 +5,12 @@ export = D; //// [exportAssignmentWithExports.js] "use strict"; -var C = (function () { +var C = /** @class */ (function () { function C() { } return C; }()); -var D = (function () { +var D = /** @class */ (function () { function D() { } return D; diff --git a/tests/baselines/reference/exportBinding.js b/tests/baselines/reference/exportBinding.js index 3e0f23ad31d30..6328c181bebef 100644 --- a/tests/baselines/reference/exportBinding.js +++ b/tests/baselines/reference/exportBinding.js @@ -24,7 +24,7 @@ exports["default"] = x; var x = 'x'; exports.x = x; exports.xx = x; -var Y = (function () { +var Y = /** @class */ (function () { function Y() { } return Y; diff --git a/tests/baselines/reference/exportClassExtendingIntersection.js b/tests/baselines/reference/exportClassExtendingIntersection.js index 919f1695093a8..a6e1f52804c67 100644 --- a/tests/baselines/reference/exportClassExtendingIntersection.js +++ b/tests/baselines/reference/exportClassExtendingIntersection.js @@ -38,7 +38,7 @@ const AnotherMixedClass = MyMixin(MyExtendedClass); //// [BaseClass.js] "use strict"; exports.__esModule = true; -var MyBaseClass = (function () { +var MyBaseClass = /** @class */ (function () { function MyBaseClass(value) { } return MyBaseClass; @@ -58,7 +58,7 @@ var __extends = (this && this.__extends) || (function () { })(); exports.__esModule = true; function MyMixin(base) { - return (function (_super) { + return /** @class */ (function (_super) { __extends(class_1, _super); function class_1() { return _super !== null && _super.apply(this, arguments) || this; @@ -82,7 +82,7 @@ var __extends = (this && this.__extends) || (function () { exports.__esModule = true; var BaseClass_1 = require("./BaseClass"); var MixinClass_1 = require("./MixinClass"); -var MyExtendedClass = (function (_super) { +var MyExtendedClass = /** @class */ (function (_super) { __extends(MyExtendedClass, _super); function MyExtendedClass() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/exportCodeGen.js b/tests/baselines/reference/exportCodeGen.js index 9adde81e0feb0..fd0dff8f0826e 100644 --- a/tests/baselines/reference/exportCodeGen.js +++ b/tests/baselines/reference/exportCodeGen.js @@ -95,7 +95,7 @@ var E; })(Color = E.Color || (E.Color = {})); function fn() { } E.fn = fn; - var C = (function () { + var C = /** @class */ (function () { function C() { } return C; @@ -115,7 +115,7 @@ var F; Color[Color["Red"] = 0] = "Red"; })(Color || (Color = {})); function fn() { } - var C = (function () { + var C = /** @class */ (function () { function C() { } return C; diff --git a/tests/baselines/reference/exportDeclarationInInternalModule.js b/tests/baselines/reference/exportDeclarationInInternalModule.js index 7c3345739c302..64acd90548d80 100644 --- a/tests/baselines/reference/exportDeclarationInInternalModule.js +++ b/tests/baselines/reference/exportDeclarationInInternalModule.js @@ -28,12 +28,12 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var Bbb = (function () { +var Bbb = /** @class */ (function () { function Bbb() { } return Bbb; }()); -var Aaa = (function (_super) { +var Aaa = /** @class */ (function (_super) { __extends(Aaa, _super); function Aaa() { return _super !== null && _super.apply(this, arguments) || this; @@ -41,7 +41,7 @@ var Aaa = (function (_super) { return Aaa; }(Bbb)); (function (Aaa) { - var SomeType = (function () { + var SomeType = /** @class */ (function () { function SomeType() { } return SomeType; @@ -49,7 +49,7 @@ var Aaa = (function (_super) { Aaa.SomeType = SomeType; })(Aaa || (Aaa = {})); (function (Bbb) { - var SomeType = (function () { + var SomeType = /** @class */ (function () { function SomeType() { } return SomeType; diff --git a/tests/baselines/reference/exportDefaultAbstractClass.js b/tests/baselines/reference/exportDefaultAbstractClass.js index 38976311d63be..821a68f4699bc 100644 --- a/tests/baselines/reference/exportDefaultAbstractClass.js +++ b/tests/baselines/reference/exportDefaultAbstractClass.js @@ -25,13 +25,13 @@ var __extends = (this && this.__extends) || (function () { }; })(); exports.__esModule = true; -var A = (function () { +var A = /** @class */ (function () { function A() { } return A; }()); exports["default"] = A; -var B = (function (_super) { +var B = /** @class */ (function (_super) { __extends(B, _super); function B() { return _super !== null && _super.apply(this, arguments) || this; @@ -53,7 +53,7 @@ var __extends = (this && this.__extends) || (function () { })(); exports.__esModule = true; var a_1 = require("./a"); -var C = (function (_super) { +var C = /** @class */ (function (_super) { __extends(C, _super); function C() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/exportDefaultProperty.js b/tests/baselines/reference/exportDefaultProperty.js index dddea6a6b7342..c8950a20e13dd 100644 --- a/tests/baselines/reference/exportDefaultProperty.js +++ b/tests/baselines/reference/exportDefaultProperty.js @@ -46,7 +46,7 @@ fooLength + 1; exports.__esModule = true; var A; (function (A) { - var B = (function () { + var B = /** @class */ (function () { function B(b) { } return B; diff --git a/tests/baselines/reference/exportDefaultProperty2.js b/tests/baselines/reference/exportDefaultProperty2.js index 5cc9dc47092be..2721220c07644 100644 --- a/tests/baselines/reference/exportDefaultProperty2.js +++ b/tests/baselines/reference/exportDefaultProperty2.js @@ -21,7 +21,7 @@ const x: B = { c: B }; "use strict"; // This test is just like exportEqualsProperty2, but with `export default`. exports.__esModule = true; -var C = (function () { +var C = /** @class */ (function () { function C() { } return C; diff --git a/tests/baselines/reference/exportEqualsProperty.js b/tests/baselines/reference/exportEqualsProperty.js index e6bd09d536743..524675c6e3ee4 100644 --- a/tests/baselines/reference/exportEqualsProperty.js +++ b/tests/baselines/reference/exportEqualsProperty.js @@ -44,7 +44,7 @@ fooLength + 1; "use strict"; var A; (function (A) { - var B = (function () { + var B = /** @class */ (function () { function B(b) { } return B; diff --git a/tests/baselines/reference/exportEqualsProperty2.js b/tests/baselines/reference/exportEqualsProperty2.js index 5cfcab3e774bb..b23b04f6ca0c6 100644 --- a/tests/baselines/reference/exportEqualsProperty2.js +++ b/tests/baselines/reference/exportEqualsProperty2.js @@ -20,7 +20,7 @@ const x: B = { c: B }; //// [a.js] "use strict"; // This test is just like exportDefaultProperty2, but with `export =`. -var C = (function () { +var C = /** @class */ (function () { function C() { } return C; diff --git a/tests/baselines/reference/exportImport.js b/tests/baselines/reference/exportImport.js index 031dc8974ed46..f7ab98b534e96 100644 --- a/tests/baselines/reference/exportImport.js +++ b/tests/baselines/reference/exportImport.js @@ -17,7 +17,7 @@ export function w(): e.w { // Should be OK //// [w1.js] define(["require", "exports"], function (require, exports) { "use strict"; - var Widget1 = (function () { + var Widget1 = /** @class */ (function () { function Widget1() { this.name = 'one'; } diff --git a/tests/baselines/reference/exportImportAlias.js b/tests/baselines/reference/exportImportAlias.js index 3f9bc18f45bc5..9b414bdb51412 100644 --- a/tests/baselines/reference/exportImportAlias.js +++ b/tests/baselines/reference/exportImportAlias.js @@ -73,7 +73,7 @@ var p: M.D.Point; var A; (function (A) { A.x = 'hello world'; - var Point = (function () { + var Point = /** @class */ (function () { function Point(x, y) { this.x = x; this.y = y; @@ -97,7 +97,7 @@ var X; } X.Y = Y; (function (Y) { - var Point = (function () { + var Point = /** @class */ (function () { function Point(x, y) { this.x = x; this.y = y; @@ -116,7 +116,7 @@ var m = Z.y(); var n = new Z.y.Point(0, 0); var K; (function (K) { - var L = (function () { + var L = /** @class */ (function () { function L(name) { this.name = name; } diff --git a/tests/baselines/reference/exportImportAndClodule.js b/tests/baselines/reference/exportImportAndClodule.js index 842b97c0871e3..25942ae9dd480 100644 --- a/tests/baselines/reference/exportImportAndClodule.js +++ b/tests/baselines/reference/exportImportAndClodule.js @@ -22,7 +22,7 @@ var p: M.D.Point; //// [exportImportAndClodule.js] var K; (function (K) { - var L = (function () { + var L = /** @class */ (function () { function L(name) { this.name = name; } diff --git a/tests/baselines/reference/exportNonInitializedVariablesAMD.js b/tests/baselines/reference/exportNonInitializedVariablesAMD.js index 62b0e45e3a9c4..24ecd232495c9 100644 --- a/tests/baselines/reference/exportNonInitializedVariablesAMD.js +++ b/tests/baselines/reference/exportNonInitializedVariablesAMD.js @@ -40,7 +40,7 @@ define(["require", "exports"], function (require, exports) { var ; let; var ; - var A = (function () { + var A = /** @class */ (function () { function A() { } return A; @@ -58,7 +58,7 @@ define(["require", "exports"], function (require, exports) { exports.b1 = 1; exports.c1 = 'a'; exports.d1 = 1; - var D = (function () { + var D = /** @class */ (function () { function D() { } return D; diff --git a/tests/baselines/reference/exportNonInitializedVariablesCommonJS.js b/tests/baselines/reference/exportNonInitializedVariablesCommonJS.js index 362798c15160c..8b4475e4bf9fa 100644 --- a/tests/baselines/reference/exportNonInitializedVariablesCommonJS.js +++ b/tests/baselines/reference/exportNonInitializedVariablesCommonJS.js @@ -39,7 +39,7 @@ exports.__esModule = true; var ; let; var ; -var A = (function () { +var A = /** @class */ (function () { function A() { } return A; @@ -57,7 +57,7 @@ exports.a1 = 1; exports.b1 = 1; exports.c1 = 'a'; exports.d1 = 1; -var D = (function () { +var D = /** @class */ (function () { function D() { } return D; diff --git a/tests/baselines/reference/exportNonInitializedVariablesSystem.js b/tests/baselines/reference/exportNonInitializedVariablesSystem.js index e54719558cd8a..7755cb4fc36bc 100644 --- a/tests/baselines/reference/exportNonInitializedVariablesSystem.js +++ b/tests/baselines/reference/exportNonInitializedVariablesSystem.js @@ -42,7 +42,7 @@ System.register([], function (exports_1, context_1) { setters: [], execute: function () { let; - A = (function () { + A = /** @class */ (function () { function A() { } return A; @@ -58,7 +58,7 @@ System.register([], function (exports_1, context_1) { exports_1("b1", b1 = 1); exports_1("c1", c1 = 'a'); exports_1("d1", d1 = 1); - D = (function () { + D = /** @class */ (function () { function D() { } return D; diff --git a/tests/baselines/reference/exportNonInitializedVariablesUMD.js b/tests/baselines/reference/exportNonInitializedVariablesUMD.js index cd6ef353fe3d0..bbea71b763dca 100644 --- a/tests/baselines/reference/exportNonInitializedVariablesUMD.js +++ b/tests/baselines/reference/exportNonInitializedVariablesUMD.js @@ -48,7 +48,7 @@ export let h1: D = new D; var ; let; var ; - var A = (function () { + var A = /** @class */ (function () { function A() { } return A; @@ -66,7 +66,7 @@ export let h1: D = new D; exports.b1 = 1; exports.c1 = 'a'; exports.d1 = 1; - var D = (function () { + var D = /** @class */ (function () { function D() { } return D; diff --git a/tests/baselines/reference/exportNonVisibleType.js b/tests/baselines/reference/exportNonVisibleType.js index 6208c164be8cf..724c7cc39288f 100644 --- a/tests/baselines/reference/exportNonVisibleType.js +++ b/tests/baselines/reference/exportNonVisibleType.js @@ -41,7 +41,7 @@ var x = { a: "test", b: 42 }; module.exports = x; //// [foo2.js] "use strict"; -var C1 = (function () { +var C1 = /** @class */ (function () { function C1() { } return C1; @@ -49,7 +49,7 @@ var C1 = (function () { module.exports = C1; //// [foo3.js] "use strict"; -var C1 = (function () { +var C1 = /** @class */ (function () { function C1() { } return C1; diff --git a/tests/baselines/reference/exportPrivateType.js b/tests/baselines/reference/exportPrivateType.js index efdd7cb8e6ee8..3cf892571ec41 100644 --- a/tests/baselines/reference/exportPrivateType.js +++ b/tests/baselines/reference/exportPrivateType.js @@ -33,12 +33,12 @@ var y = foo.g; // Exported variable 'y' has or is using private type 'foo.C2'. //// [exportPrivateType.js] var foo; (function (foo) { - var C1 = (function () { + var C1 = /** @class */ (function () { function C1() { } return C1; }()); - var C2 = (function () { + var C2 = /** @class */ (function () { function C2() { } C2.prototype.test = function () { return true; }; diff --git a/tests/baselines/reference/exportStarFromEmptyModule.js b/tests/baselines/reference/exportStarFromEmptyModule.js index ce282722a298b..2730778930d62 100644 --- a/tests/baselines/reference/exportStarFromEmptyModule.js +++ b/tests/baselines/reference/exportStarFromEmptyModule.js @@ -25,7 +25,7 @@ X.A.r; // Error //// [exportStarFromEmptyModule_module1.js] "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); -var A = (function () { +var A = /** @class */ (function () { function A() { } return A; @@ -41,7 +41,7 @@ function __export(m) { Object.defineProperty(exports, "__esModule", { value: true }); __export(require("./exportStarFromEmptyModule_module2")); __export(require("./exportStarFromEmptyModule_module1")); -var A = (function () { +var A = /** @class */ (function () { function A() { } return A; diff --git a/tests/baselines/reference/exportVisibility.js b/tests/baselines/reference/exportVisibility.js index fbb2555d54b75..5f3839c816a78 100644 --- a/tests/baselines/reference/exportVisibility.js +++ b/tests/baselines/reference/exportVisibility.js @@ -12,7 +12,7 @@ export function test(foo: Foo) { //// [exportVisibility.js] "use strict"; exports.__esModule = true; -var Foo = (function () { +var Foo = /** @class */ (function () { function Foo() { } return Foo; diff --git a/tests/baselines/reference/exportingContainingVisibleType.js b/tests/baselines/reference/exportingContainingVisibleType.js index d50a2a35f0618..b7c3be9487601 100644 --- a/tests/baselines/reference/exportingContainingVisibleType.js +++ b/tests/baselines/reference/exportingContainingVisibleType.js @@ -14,7 +14,7 @@ export var x = 5; define(["require", "exports"], function (require, exports) { "use strict"; exports.__esModule = true; - var Foo = (function () { + var Foo = /** @class */ (function () { function Foo() { } Object.defineProperty(Foo.prototype, "foo", { diff --git a/tests/baselines/reference/exportsAndImports1-amd.js b/tests/baselines/reference/exportsAndImports1-amd.js index 16c4a86a7c16d..f93abb906d2a7 100644 --- a/tests/baselines/reference/exportsAndImports1-amd.js +++ b/tests/baselines/reference/exportsAndImports1-amd.js @@ -41,7 +41,7 @@ define(["require", "exports"], function (require, exports) { exports.v = v; function f() { } exports.f = f; - var C = (function () { + var C = /** @class */ (function () { function C() { } return C; diff --git a/tests/baselines/reference/exportsAndImports1.js b/tests/baselines/reference/exportsAndImports1.js index 30fef6e7ccfdf..156a7bd1152a2 100644 --- a/tests/baselines/reference/exportsAndImports1.js +++ b/tests/baselines/reference/exportsAndImports1.js @@ -40,7 +40,7 @@ var v = 1; exports.v = v; function f() { } exports.f = f; -var C = (function () { +var C = /** @class */ (function () { function C() { } return C; diff --git a/tests/baselines/reference/exportsAndImports3-amd.js b/tests/baselines/reference/exportsAndImports3-amd.js index 87dc8d03ab818..6ee327f979d8a 100644 --- a/tests/baselines/reference/exportsAndImports3-amd.js +++ b/tests/baselines/reference/exportsAndImports3-amd.js @@ -42,7 +42,7 @@ define(["require", "exports"], function (require, exports) { function f() { } exports.f = f; exports.f1 = f; - var C = (function () { + var C = /** @class */ (function () { function C() { } return C; diff --git a/tests/baselines/reference/exportsAndImports3.js b/tests/baselines/reference/exportsAndImports3.js index 77ac28f4800e6..e5a0b47639107 100644 --- a/tests/baselines/reference/exportsAndImports3.js +++ b/tests/baselines/reference/exportsAndImports3.js @@ -41,7 +41,7 @@ exports.v1 = exports.v; function f() { } exports.f = f; exports.f1 = f; -var C = (function () { +var C = /** @class */ (function () { function C() { } return C; diff --git a/tests/baselines/reference/extBaseClass1.js b/tests/baselines/reference/extBaseClass1.js index 6cf7b42962ef8..e98c685d1b88e 100644 --- a/tests/baselines/reference/extBaseClass1.js +++ b/tests/baselines/reference/extBaseClass1.js @@ -32,14 +32,14 @@ var __extends = (this && this.__extends) || (function () { })(); var M; (function (M) { - var B = (function () { + var B = /** @class */ (function () { function B() { this.x = 10; } return B; }()); M.B = B; - var C = (function (_super) { + var C = /** @class */ (function (_super) { __extends(C, _super); function C() { return _super !== null && _super.apply(this, arguments) || this; @@ -49,7 +49,7 @@ var M; M.C = C; })(M || (M = {})); (function (M) { - var C2 = (function (_super) { + var C2 = /** @class */ (function (_super) { __extends(C2, _super); function C2() { return _super !== null && _super.apply(this, arguments) || this; @@ -60,7 +60,7 @@ var M; })(M || (M = {})); var N; (function (N) { - var C3 = (function (_super) { + var C3 = /** @class */ (function (_super) { __extends(C3, _super); function C3() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/extBaseClass2.js b/tests/baselines/reference/extBaseClass2.js index 7ef8adec3df9e..1156b2a451f66 100644 --- a/tests/baselines/reference/extBaseClass2.js +++ b/tests/baselines/reference/extBaseClass2.js @@ -23,7 +23,7 @@ var __extends = (this && this.__extends) || (function () { })(); var N; (function (N) { - var C4 = (function (_super) { + var C4 = /** @class */ (function (_super) { __extends(C4, _super); function C4() { return _super !== null && _super.apply(this, arguments) || this; @@ -34,7 +34,7 @@ var N; })(N || (N = {})); var M; (function (M) { - var C5 = (function (_super) { + var C5 = /** @class */ (function (_super) { __extends(C5, _super); function C5() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/extendAndImplementTheSameBaseType.js b/tests/baselines/reference/extendAndImplementTheSameBaseType.js index d2942220bf122..dbdc543ccf951 100644 --- a/tests/baselines/reference/extendAndImplementTheSameBaseType.js +++ b/tests/baselines/reference/extendAndImplementTheSameBaseType.js @@ -24,13 +24,13 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var C = (function () { +var C = /** @class */ (function () { function C() { } C.prototype.bar = function () { }; return C; }()); -var D = (function (_super) { +var D = /** @class */ (function (_super) { __extends(D, _super); function D() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/extendAndImplementTheSameBaseType2.js b/tests/baselines/reference/extendAndImplementTheSameBaseType2.js index 40b3425966e89..9d005d74905f5 100644 --- a/tests/baselines/reference/extendAndImplementTheSameBaseType2.js +++ b/tests/baselines/reference/extendAndImplementTheSameBaseType2.js @@ -27,7 +27,7 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var C = (function () { +var C = /** @class */ (function () { function C() { } C.prototype.bar = function () { @@ -35,7 +35,7 @@ var C = (function () { }; return C; }()); -var D = (function (_super) { +var D = /** @class */ (function (_super) { __extends(D, _super); function D() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/extendBaseClassBeforeItsDeclared.js b/tests/baselines/reference/extendBaseClassBeforeItsDeclared.js index 28c9ef2f22e90..acbd52279adf5 100644 --- a/tests/baselines/reference/extendBaseClassBeforeItsDeclared.js +++ b/tests/baselines/reference/extendBaseClassBeforeItsDeclared.js @@ -14,14 +14,14 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var derived = (function (_super) { +var derived = /** @class */ (function (_super) { __extends(derived, _super); function derived() { return _super !== null && _super.apply(this, arguments) || this; } return derived; }(base)); -var base = (function () { +var base = /** @class */ (function () { function base(n) { this.n = n; } diff --git a/tests/baselines/reference/extendClassExpressionFromModule.js b/tests/baselines/reference/extendClassExpressionFromModule.js index 28c9488f7fa35..94843ece80309 100644 --- a/tests/baselines/reference/extendClassExpressionFromModule.js +++ b/tests/baselines/reference/extendClassExpressionFromModule.js @@ -13,7 +13,7 @@ class y extends x {} //// [foo1.js] "use strict"; -var x = (function () { +var x = /** @class */ (function () { function x() { } return x; @@ -34,7 +34,7 @@ var __extends = (this && this.__extends) || (function () { exports.__esModule = true; var foo1 = require("./foo1"); var x = foo1; -var y = (function (_super) { +var y = /** @class */ (function (_super) { __extends(y, _super); function y() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/extendConstructSignatureInInterface.js b/tests/baselines/reference/extendConstructSignatureInInterface.js index 3067fdc706edb..5648aa5ad24d2 100644 --- a/tests/baselines/reference/extendConstructSignatureInInterface.js +++ b/tests/baselines/reference/extendConstructSignatureInInterface.js @@ -22,7 +22,7 @@ var __extends = (this && this.__extends) || (function () { }; })(); var CStatic; -var E = (function (_super) { +var E = /** @class */ (function (_super) { __extends(E, _super); function E() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/extendFromAny.js b/tests/baselines/reference/extendFromAny.js index 33610fd8b1f30..cff93bb9641b9 100644 --- a/tests/baselines/reference/extendFromAny.js +++ b/tests/baselines/reference/extendFromAny.js @@ -23,7 +23,7 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var C = (function (_super) { +var C = /** @class */ (function (_super) { __extends(C, _super); function C() { var _this = _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/extendNonClassSymbol1.js b/tests/baselines/reference/extendNonClassSymbol1.js index b4e59aa97115e..eaf4397c7d98a 100644 --- a/tests/baselines/reference/extendNonClassSymbol1.js +++ b/tests/baselines/reference/extendNonClassSymbol1.js @@ -14,14 +14,14 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var A = (function () { +var A = /** @class */ (function () { function A() { } A.prototype.foo = function () { }; return A; }()); var x = A; -var C = (function (_super) { +var C = /** @class */ (function (_super) { __extends(C, _super); function C() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/extendNonClassSymbol2.js b/tests/baselines/reference/extendNonClassSymbol2.js index f029193175f49..015ec7b6decdf 100644 --- a/tests/baselines/reference/extendNonClassSymbol2.js +++ b/tests/baselines/reference/extendNonClassSymbol2.js @@ -20,7 +20,7 @@ function Foo() { this.x = 1; } var x = new Foo(); // legal, considered a constructor function -var C = (function (_super) { +var C = /** @class */ (function (_super) { __extends(C, _super); function C() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/extendPrivateConstructorClass.js b/tests/baselines/reference/extendPrivateConstructorClass.js index 12540d9cd38b3..574660e7cd709 100644 --- a/tests/baselines/reference/extendPrivateConstructorClass.js +++ b/tests/baselines/reference/extendPrivateConstructorClass.js @@ -20,7 +20,7 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var C = (function (_super) { +var C = /** @class */ (function (_super) { __extends(C, _super); function C() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/extendingClassFromAliasAndUsageInIndexer.js b/tests/baselines/reference/extendingClassFromAliasAndUsageInIndexer.js index c8f7719faf026..59cfcd482fb8b 100644 --- a/tests/baselines/reference/extendingClassFromAliasAndUsageInIndexer.js +++ b/tests/baselines/reference/extendingClassFromAliasAndUsageInIndexer.js @@ -35,7 +35,7 @@ var visModel = new moduleMap[moduleName].VisualizationModel(); //// [extendingClassFromAliasAndUsageInIndexer_backbone.js] "use strict"; exports.__esModule = true; -var Model = (function () { +var Model = /** @class */ (function () { function Model() { } return Model; @@ -55,7 +55,7 @@ var __extends = (this && this.__extends) || (function () { })(); exports.__esModule = true; var Backbone = require("./extendingClassFromAliasAndUsageInIndexer_backbone"); -var VisualizationModel = (function (_super) { +var VisualizationModel = /** @class */ (function (_super) { __extends(VisualizationModel, _super); function VisualizationModel() { return _super !== null && _super.apply(this, arguments) || this; @@ -77,7 +77,7 @@ var __extends = (this && this.__extends) || (function () { })(); exports.__esModule = true; var Backbone = require("./extendingClassFromAliasAndUsageInIndexer_backbone"); -var VisualizationModel = (function (_super) { +var VisualizationModel = /** @class */ (function (_super) { __extends(VisualizationModel, _super); function VisualizationModel() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/extendsClauseAlreadySeen.js b/tests/baselines/reference/extendsClauseAlreadySeen.js index f6e43d5ddc66a..26d3c378f41d6 100644 --- a/tests/baselines/reference/extendsClauseAlreadySeen.js +++ b/tests/baselines/reference/extendsClauseAlreadySeen.js @@ -17,12 +17,12 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var C = (function () { +var C = /** @class */ (function () { function C() { } return C; }()); -var D = (function (_super) { +var D = /** @class */ (function (_super) { __extends(D, _super); function D() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/extendsClauseAlreadySeen2.js b/tests/baselines/reference/extendsClauseAlreadySeen2.js index 99bccf4447981..ccb6840e4e2e3 100644 --- a/tests/baselines/reference/extendsClauseAlreadySeen2.js +++ b/tests/baselines/reference/extendsClauseAlreadySeen2.js @@ -17,12 +17,12 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var C = (function () { +var C = /** @class */ (function () { function C() { } return C; }()); -var D = (function (_super) { +var D = /** @class */ (function (_super) { __extends(D, _super); function D() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/extendsUntypedModule.js b/tests/baselines/reference/extendsUntypedModule.js index 5ccd7babe9890..f56c2add0fd93 100644 --- a/tests/baselines/reference/extendsUntypedModule.js +++ b/tests/baselines/reference/extendsUntypedModule.js @@ -28,7 +28,7 @@ var __extends = (this && this.__extends) || (function () { })(); exports.__esModule = true; var foo_1 = require("foo"); -var A = (function (_super) { +var A = /** @class */ (function (_super) { __extends(A, _super); function A() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/externModule.js b/tests/baselines/reference/externModule.js index f7edc1283df8f..f0dc73f46d8f2 100644 --- a/tests/baselines/reference/externModule.js +++ b/tests/baselines/reference/externModule.js @@ -43,7 +43,7 @@ n=XDate.UTC(1964,2,1); declare; module; { - var XDate = (function () { + var XDate = /** @class */ (function () { function XDate() { } return XDate; diff --git a/tests/baselines/reference/externalModuleAssignToVar.js b/tests/baselines/reference/externalModuleAssignToVar.js index 70ce2281ad3d6..4877fd0c01566 100644 --- a/tests/baselines/reference/externalModuleAssignToVar.js +++ b/tests/baselines/reference/externalModuleAssignToVar.js @@ -30,7 +30,7 @@ y3 = ext3; // ok define(["require", "exports"], function (require, exports) { "use strict"; exports.__esModule = true; - var C = (function () { + var C = /** @class */ (function () { function C() { } return C; @@ -40,7 +40,7 @@ define(["require", "exports"], function (require, exports) { //// [externalModuleAssignToVar_core_require2.js] define(["require", "exports"], function (require, exports) { "use strict"; - var C = (function () { + var C = /** @class */ (function () { function C() { } return C; @@ -50,7 +50,7 @@ define(["require", "exports"], function (require, exports) { //// [externalModuleAssignToVar_ext.js] define(["require", "exports"], function (require, exports) { "use strict"; - var D = (function () { + var D = /** @class */ (function () { function D() { } return D; diff --git a/tests/baselines/reference/externalModuleExportingGenericClass.js b/tests/baselines/reference/externalModuleExportingGenericClass.js index 339eaec2cbfa7..ebe4980c699e6 100644 --- a/tests/baselines/reference/externalModuleExportingGenericClass.js +++ b/tests/baselines/reference/externalModuleExportingGenericClass.js @@ -16,7 +16,7 @@ var v3: number = (new a()).foo; //// [externalModuleExportingGenericClass_file0.js] "use strict"; -var C = (function () { +var C = /** @class */ (function () { function C() { } return C; diff --git a/tests/baselines/reference/externalModuleQualification.js b/tests/baselines/reference/externalModuleQualification.js index 0402847a13a93..c6f09076e8c94 100644 --- a/tests/baselines/reference/externalModuleQualification.js +++ b/tests/baselines/reference/externalModuleQualification.js @@ -15,14 +15,14 @@ class NavigateAction { "use strict"; exports.__esModule = true; exports.ID = "test"; -var DiffEditor = (function () { +var DiffEditor = /** @class */ (function () { function DiffEditor(id) { if (id === void 0) { id = exports.ID; } } return DiffEditor; }()); exports.DiffEditor = DiffEditor; -var NavigateAction = (function () { +var NavigateAction = /** @class */ (function () { function NavigateAction() { } NavigateAction.prototype.f = function (editor) { diff --git a/tests/baselines/reference/fatArrowSelf.js b/tests/baselines/reference/fatArrowSelf.js index db9aaa347dc39..4b12f5690f50e 100644 --- a/tests/baselines/reference/fatArrowSelf.js +++ b/tests/baselines/reference/fatArrowSelf.js @@ -27,7 +27,7 @@ module Consumer { //// [fatArrowSelf.js] var Events; (function (Events) { - var EventEmitter = (function () { + var EventEmitter = /** @class */ (function () { function EventEmitter() { } EventEmitter.prototype.addListener = function (type, listener) { @@ -38,7 +38,7 @@ var Events; })(Events || (Events = {})); var Consumer; (function (Consumer) { - var EventEmitterConsummer = (function () { + var EventEmitterConsummer = /** @class */ (function () { function EventEmitterConsummer(emitter) { this.emitter = emitter; } diff --git a/tests/baselines/reference/fieldAndGetterWithSameName.js b/tests/baselines/reference/fieldAndGetterWithSameName.js index 673a0372f054d..d753aa707563d 100644 --- a/tests/baselines/reference/fieldAndGetterWithSameName.js +++ b/tests/baselines/reference/fieldAndGetterWithSameName.js @@ -8,7 +8,7 @@ export class C { define(["require", "exports"], function (require, exports) { "use strict"; exports.__esModule = true; - var C = (function () { + var C = /** @class */ (function () { function C() { } Object.defineProperty(C.prototype, "x", { diff --git a/tests/baselines/reference/filesEmittingIntoSameOutputWithOutOption.js b/tests/baselines/reference/filesEmittingIntoSameOutputWithOutOption.js index 9b48439ad5608..35754fa7690b1 100644 --- a/tests/baselines/reference/filesEmittingIntoSameOutputWithOutOption.js +++ b/tests/baselines/reference/filesEmittingIntoSameOutputWithOutOption.js @@ -13,7 +13,7 @@ function foo() { define("a", ["require", "exports"], function (require, exports) { "use strict"; exports.__esModule = true; - var c = (function () { + var c = /** @class */ (function () { function c() { } return c; diff --git a/tests/baselines/reference/fillInMissingTypeArgsOnConstructCalls.js b/tests/baselines/reference/fillInMissingTypeArgsOnConstructCalls.js index af0a1e7a63b24..bbc4ad6f02908 100644 --- a/tests/baselines/reference/fillInMissingTypeArgsOnConstructCalls.js +++ b/tests/baselines/reference/fillInMissingTypeArgsOnConstructCalls.js @@ -6,7 +6,7 @@ var a = new A(); //// [fillInMissingTypeArgsOnConstructCalls.js] -var A = (function () { +var A = /** @class */ (function () { function A() { } return A; diff --git a/tests/baselines/reference/flowInFinally1.js b/tests/baselines/reference/flowInFinally1.js index 76769342c0191..3d5349b8153ae 100644 --- a/tests/baselines/reference/flowInFinally1.js +++ b/tests/baselines/reference/flowInFinally1.js @@ -15,7 +15,7 @@ try { } //// [flowInFinally1.js] -var A = (function () { +var A = /** @class */ (function () { function A() { } A.prototype.method = function () { }; diff --git a/tests/baselines/reference/fluentClasses.js b/tests/baselines/reference/fluentClasses.js index f9c8181aa494a..01468afde33d2 100644 --- a/tests/baselines/reference/fluentClasses.js +++ b/tests/baselines/reference/fluentClasses.js @@ -29,7 +29,7 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var A = (function () { +var A = /** @class */ (function () { function A() { } A.prototype.foo = function () { @@ -37,7 +37,7 @@ var A = (function () { }; return A; }()); -var B = (function (_super) { +var B = /** @class */ (function (_super) { __extends(B, _super); function B() { return _super !== null && _super.apply(this, arguments) || this; @@ -47,7 +47,7 @@ var B = (function (_super) { }; return B; }(A)); -var C = (function (_super) { +var C = /** @class */ (function (_super) { __extends(C, _super); function C() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/for-inStatements.js b/tests/baselines/reference/for-inStatements.js index 18ccb37b4169c..11437c691acd9 100644 --- a/tests/baselines/reference/for-inStatements.js +++ b/tests/baselines/reference/for-inStatements.js @@ -111,7 +111,7 @@ for (var x in 42 ? d[x] : c[x]) { } for (var x in c[d]) { } for (var x in (function (x) { return x; })) { } for (var x in function (x, y) { return x + y; }) { } -var A = (function () { +var A = /** @class */ (function () { function A() { } A.prototype.biz = function () { @@ -128,7 +128,7 @@ var A = (function () { }; return A; }()); -var B = (function (_super) { +var B = /** @class */ (function (_super) { __extends(B, _super); function B() { return _super !== null && _super.apply(this, arguments) || this; @@ -147,7 +147,7 @@ var i; for (var x in i[42]) { } var M; (function (M) { - var X = (function () { + var X = /** @class */ (function () { function X() { } return X; diff --git a/tests/baselines/reference/for-inStatementsInvalid.js b/tests/baselines/reference/for-inStatementsInvalid.js index d70da450f08cf..1cefe94495581 100644 --- a/tests/baselines/reference/for-inStatementsInvalid.js +++ b/tests/baselines/reference/for-inStatementsInvalid.js @@ -92,7 +92,7 @@ for (var x in 42 ? d[x] : c[x]) { } for (var x in c[23]) { } for (var x in (function (x) { return x; })) { } for (var x in function (x, y) { return x + y; }) { } -var A = (function () { +var A = /** @class */ (function () { function A() { } A.prototype.biz = function () { @@ -109,7 +109,7 @@ var A = (function () { }; return A; }()); -var B = (function (_super) { +var B = /** @class */ (function (_super) { __extends(B, _super); function B() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/forStatements.js b/tests/baselines/reference/forStatements.js index f10a105ecd5d8..a8713cfb37c20 100644 --- a/tests/baselines/reference/forStatements.js +++ b/tests/baselines/reference/forStatements.js @@ -47,12 +47,12 @@ for(var aClassInModule: M.A = new M.A();;){} for(var aFunctionInModule: typeof M.F2 = (x) => 'this is a string';;){} //// [forStatements.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } return C; }()); -var D = (function () { +var D = /** @class */ (function () { function D() { } return D; @@ -60,7 +60,7 @@ var D = (function () { function F(x) { return 42; } var M; (function (M) { - var A = (function () { + var A = /** @class */ (function () { function A() { } return A; diff --git a/tests/baselines/reference/forStatementsMultipleInvalidDecl.js b/tests/baselines/reference/forStatementsMultipleInvalidDecl.js index e6404a73c602f..4b1aa9a8a3b03 100644 --- a/tests/baselines/reference/forStatementsMultipleInvalidDecl.js +++ b/tests/baselines/reference/forStatementsMultipleInvalidDecl.js @@ -64,19 +64,19 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var C = (function () { +var C = /** @class */ (function () { function C() { } return C; }()); -var C2 = (function (_super) { +var C2 = /** @class */ (function (_super) { __extends(C2, _super); function C2() { return _super !== null && _super.apply(this, arguments) || this; } return C2; }(C)); -var D = (function () { +var D = /** @class */ (function () { function D() { } return D; @@ -84,7 +84,7 @@ var D = (function () { function F(x) { return 42; } var M; (function (M) { - var A = (function () { + var A = /** @class */ (function () { function A() { } return A; diff --git a/tests/baselines/reference/forgottenNew.js b/tests/baselines/reference/forgottenNew.js index 927f21a04df48..25b60e9af152b 100644 --- a/tests/baselines/reference/forgottenNew.js +++ b/tests/baselines/reference/forgottenNew.js @@ -8,7 +8,7 @@ var logger = Tools.NullLogger(); //// [forgottenNew.js] var Tools; (function (Tools) { - var NullLogger = (function () { + var NullLogger = /** @class */ (function () { function NullLogger() { } return NullLogger; diff --git a/tests/baselines/reference/forwardRefInClassProperties.js b/tests/baselines/reference/forwardRefInClassProperties.js index 424d950055d2d..48cbd4af6f771 100644 --- a/tests/baselines/reference/forwardRefInClassProperties.js +++ b/tests/baselines/reference/forwardRefInClassProperties.js @@ -16,7 +16,7 @@ class Test //// [forwardRefInClassProperties.js] -var Test = (function () { +var Test = /** @class */ (function () { function Test() { this._b = this._a; // undefined, no error/warning this._a = 3; diff --git a/tests/baselines/reference/funClodule.js b/tests/baselines/reference/funClodule.js index b2c18bf3786c2..77117bcd6399a 100644 --- a/tests/baselines/reference/funClodule.js +++ b/tests/baselines/reference/funClodule.js @@ -25,7 +25,7 @@ function foo3() { } function x() { } foo3.x = x; })(foo3 || (foo3 = {})); -var foo3 = (function () { +var foo3 = /** @class */ (function () { function foo3() { } return foo3; diff --git a/tests/baselines/reference/functionAndPropertyNameConflict.js b/tests/baselines/reference/functionAndPropertyNameConflict.js index bd3b5b7243d8e..b2e77a8b5bedf 100644 --- a/tests/baselines/reference/functionAndPropertyNameConflict.js +++ b/tests/baselines/reference/functionAndPropertyNameConflict.js @@ -7,7 +7,7 @@ class C65 { } //// [functionAndPropertyNameConflict.js] -var C65 = (function () { +var C65 = /** @class */ (function () { function C65() { } C65.prototype.aaaaa = function () { }; diff --git a/tests/baselines/reference/functionArgShadowing.js b/tests/baselines/reference/functionArgShadowing.js index bae1365a789d9..bae255bee832d 100644 --- a/tests/baselines/reference/functionArgShadowing.js +++ b/tests/baselines/reference/functionArgShadowing.js @@ -15,13 +15,13 @@ class C { } //// [functionArgShadowing.js] -var A = (function () { +var A = /** @class */ (function () { function A() { } A.prototype.foo = function () { }; return A; }()); -var B = (function () { +var B = /** @class */ (function () { function B() { } B.prototype.bar = function () { }; @@ -31,7 +31,7 @@ function foo(x) { var x = new B(); x.bar(); // the property bar does not exist on a value of type A } -var C = (function () { +var C = /** @class */ (function () { function C(p) { this.p = p; var p; diff --git a/tests/baselines/reference/functionCall5.js b/tests/baselines/reference/functionCall5.js index 4eccd50ed3c37..705dc68b077e2 100644 --- a/tests/baselines/reference/functionCall5.js +++ b/tests/baselines/reference/functionCall5.js @@ -6,7 +6,7 @@ var x = foo(); //// [functionCall5.js] var m1; (function (m1) { - var c1 = (function () { + var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/functionCall7.js b/tests/baselines/reference/functionCall7.js index 68e9e4af77a18..cc2d9298afcdf 100644 --- a/tests/baselines/reference/functionCall7.js +++ b/tests/baselines/reference/functionCall7.js @@ -11,7 +11,7 @@ foo(); //// [functionCall7.js] var m1; (function (m1) { - var c1 = (function () { + var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/functionConstraintSatisfaction.js b/tests/baselines/reference/functionConstraintSatisfaction.js index eb654b1a2a29c..fc8a2be88a722 100644 --- a/tests/baselines/reference/functionConstraintSatisfaction.js +++ b/tests/baselines/reference/functionConstraintSatisfaction.js @@ -65,7 +65,7 @@ function foo2(x: T, y: U) { // satisfaction of a constraint to Function, no errors expected function foo(x) { return x; } var i; -var C = (function () { +var C = /** @class */ (function () { function C() { } return C; @@ -83,7 +83,7 @@ var r6 = foo(C); var r7 = foo(b); var r8 = foo(c); var i2; -var C2 = (function () { +var C2 = /** @class */ (function () { function C2() { } return C2; diff --git a/tests/baselines/reference/functionConstraintSatisfaction2.js b/tests/baselines/reference/functionConstraintSatisfaction2.js index ccbfbc70aba7d..f1030f6b8ec0e 100644 --- a/tests/baselines/reference/functionConstraintSatisfaction2.js +++ b/tests/baselines/reference/functionConstraintSatisfaction2.js @@ -47,13 +47,13 @@ foo(1); foo(function () { }, 1); foo(1, function () { }); function foo2(x) { return x; } -var C = (function () { +var C = /** @class */ (function () { function C() { } return C; }()); var b; -var C2 = (function () { +var C2 = /** @class */ (function () { function C2() { } return C2; diff --git a/tests/baselines/reference/functionConstraintSatisfaction3.js b/tests/baselines/reference/functionConstraintSatisfaction3.js index fee12434eeed2..c2cbd915338fd 100644 --- a/tests/baselines/reference/functionConstraintSatisfaction3.js +++ b/tests/baselines/reference/functionConstraintSatisfaction3.js @@ -45,7 +45,7 @@ var r15 = foo(c2); // satisfaction of a constraint to Function, no errors expected function foo(x) { return x; } var i; -var C = (function () { +var C = /** @class */ (function () { function C() { } return C; @@ -60,7 +60,7 @@ var r4 = foo(function (x) { return x; }); var r5 = foo(i); var r8 = foo(c); var i2; -var C2 = (function () { +var C2 = /** @class */ (function () { function C2() { } return C2; diff --git a/tests/baselines/reference/functionExpressionAndLambdaMatchesFunction.js b/tests/baselines/reference/functionExpressionAndLambdaMatchesFunction.js index be2aa29460a03..03772c229d78f 100644 --- a/tests/baselines/reference/functionExpressionAndLambdaMatchesFunction.js +++ b/tests/baselines/reference/functionExpressionAndLambdaMatchesFunction.js @@ -10,7 +10,7 @@ class CDoc { //// [functionExpressionAndLambdaMatchesFunction.js] -var CDoc = (function () { +var CDoc = /** @class */ (function () { function CDoc() { function doSomething(a) { } diff --git a/tests/baselines/reference/functionExpressionContextualTyping1.js b/tests/baselines/reference/functionExpressionContextualTyping1.js index 9592af7138c43..97cab6dd7e9f9 100644 --- a/tests/baselines/reference/functionExpressionContextualTyping1.js +++ b/tests/baselines/reference/functionExpressionContextualTyping1.js @@ -70,7 +70,7 @@ var a0 = function (num, str) { num.toExponential(); return 0; }; -var Class = (function () { +var Class = /** @class */ (function () { function Class() { } Class.prototype.foo = function () { }; @@ -110,7 +110,7 @@ b6 = function (i) { return i; }; // Per spec, no contextual signature can be extracted in this case. (Otherwise clause) b7 = function (j, m) { }; // Per spec, no contextual signature can be extracted in this case. (Otherwise clause) -var C = (function () { +var C = /** @class */ (function () { function C() { var k = function (j, k) { return [j, k]; diff --git a/tests/baselines/reference/functionImplementationErrors.js b/tests/baselines/reference/functionImplementationErrors.js index 533aa9e9d27a0..ea77e6b5ce7a5 100644 --- a/tests/baselines/reference/functionImplementationErrors.js +++ b/tests/baselines/reference/functionImplementationErrors.js @@ -125,24 +125,24 @@ undefined === function () { throw undefined; var x = 4; }; -var Base = (function () { +var Base = /** @class */ (function () { function Base() { } return Base; }()); -var AnotherClass = (function () { +var AnotherClass = /** @class */ (function () { function AnotherClass() { } return AnotherClass; }()); -var Derived1 = (function (_super) { +var Derived1 = /** @class */ (function (_super) { __extends(Derived1, _super); function Derived1() { return _super !== null && _super.apply(this, arguments) || this; } return Derived1; }(Base)); -var Derived2 = (function (_super) { +var Derived2 = /** @class */ (function (_super) { __extends(Derived2, _super); function Derived2() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/functionImplementations.js b/tests/baselines/reference/functionImplementations.js index bc1a83aa16a61..de2e5c23aaf78 100644 --- a/tests/baselines/reference/functionImplementations.js +++ b/tests/baselines/reference/functionImplementations.js @@ -232,12 +232,12 @@ var n = function () { // ignoring return statements with no expressions. // A compile - time error occurs if no return statement expression has a type that is a supertype of each of the others. // FunctionExpression with no return type annotation with multiple return statements with subtype relation between returns -var Base = (function () { +var Base = /** @class */ (function () { function Base() { } return Base; }()); -var Derived = (function (_super) { +var Derived = /** @class */ (function (_super) { __extends(Derived, _super); function Derived() { return _super !== null && _super.apply(this, arguments) || this; @@ -288,14 +288,14 @@ function opt3(n, m) { function f6() { return; } -var Derived2 = (function (_super) { +var Derived2 = /** @class */ (function (_super) { __extends(Derived2, _super); function Derived2() { return _super !== null && _super.apply(this, arguments) || this; } return Derived2; }(Base)); -var AnotherClass = (function () { +var AnotherClass = /** @class */ (function () { function AnotherClass() { } return AnotherClass; diff --git a/tests/baselines/reference/functionLikeInParameterInitializer.js b/tests/baselines/reference/functionLikeInParameterInitializer.js index 9bf71aff1eab7..e843c659bf4d3 100644 --- a/tests/baselines/reference/functionLikeInParameterInitializer.js +++ b/tests/baselines/reference/functionLikeInParameterInitializer.js @@ -42,7 +42,7 @@ function baz2(func) { exports.baz2 = baz2; // error function baz3(func) { - if (func === void 0) { func = (function () { + if (func === void 0) { func = /** @class */ (function () { function class_1() { this.x = foo; } diff --git a/tests/baselines/reference/functionLiteralForOverloads2.js b/tests/baselines/reference/functionLiteralForOverloads2.js index ed6bdcf784197..615c207deda50 100644 --- a/tests/baselines/reference/functionLiteralForOverloads2.js +++ b/tests/baselines/reference/functionLiteralForOverloads2.js @@ -30,12 +30,12 @@ var f3: { //// [functionLiteralForOverloads2.js] // basic uses of function literals with constructor overloads -var C = (function () { +var C = /** @class */ (function () { function C(x) { } return C; }()); -var D = (function () { +var D = /** @class */ (function () { function D(x) { } return D; diff --git a/tests/baselines/reference/functionOverloadErrors.js b/tests/baselines/reference/functionOverloadErrors.js index a07f04ae9a8be..1a15009de37fc 100644 --- a/tests/baselines/reference/functionOverloadErrors.js +++ b/tests/baselines/reference/functionOverloadErrors.js @@ -135,7 +135,7 @@ function fn10() { } function fn11() { } function fn12() { } //Function overloads that differ by accessibility -var cls = (function () { +var cls = /** @class */ (function () { function cls() { } cls.prototype.f = function () { }; diff --git a/tests/baselines/reference/functionOverloads5.js b/tests/baselines/reference/functionOverloads5.js index f23c66f3bebef..34f3e5beacd88 100644 --- a/tests/baselines/reference/functionOverloads5.js +++ b/tests/baselines/reference/functionOverloads5.js @@ -6,7 +6,7 @@ class baz { //// [functionOverloads5.js] -var baz = (function () { +var baz = /** @class */ (function () { function baz() { } baz.prototype.foo = function (bar) { }; diff --git a/tests/baselines/reference/functionOverloads6.js b/tests/baselines/reference/functionOverloads6.js index 442708ca71824..3ffde491ca91d 100644 --- a/tests/baselines/reference/functionOverloads6.js +++ b/tests/baselines/reference/functionOverloads6.js @@ -7,7 +7,7 @@ class foo { //// [functionOverloads6.js] -var foo = (function () { +var foo = /** @class */ (function () { function foo() { } foo.fnOverload = function (foo) { }; diff --git a/tests/baselines/reference/functionOverloads7.js b/tests/baselines/reference/functionOverloads7.js index 4d807d57548ce..263b93b8926d4 100644 --- a/tests/baselines/reference/functionOverloads7.js +++ b/tests/baselines/reference/functionOverloads7.js @@ -11,7 +11,7 @@ class foo { //// [functionOverloads7.js] -var foo = (function () { +var foo = /** @class */ (function () { function foo() { } foo.prototype.bar = function (foo) { return "foo"; }; diff --git a/tests/baselines/reference/functionOverloadsOutOfOrder.js b/tests/baselines/reference/functionOverloadsOutOfOrder.js index f675646fed76f..0ae8e28a358e4 100644 --- a/tests/baselines/reference/functionOverloadsOutOfOrder.js +++ b/tests/baselines/reference/functionOverloadsOutOfOrder.js @@ -16,7 +16,7 @@ class e { } //// [functionOverloadsOutOfOrder.js] -var d = (function () { +var d = /** @class */ (function () { function d() { } d.prototype.foo = function (ns) { @@ -24,7 +24,7 @@ var d = (function () { }; return d; }()); -var e = (function () { +var e = /** @class */ (function () { function e() { } e.prototype.foo = function (ns) { diff --git a/tests/baselines/reference/functionOverloadsRecursiveGenericReturnType.js b/tests/baselines/reference/functionOverloadsRecursiveGenericReturnType.js index b616d18c974eb..978fbc941c870 100644 --- a/tests/baselines/reference/functionOverloadsRecursiveGenericReturnType.js +++ b/tests/baselines/reference/functionOverloadsRecursiveGenericReturnType.js @@ -15,12 +15,12 @@ function Choice(...v_args: any[]): A{ //// [functionOverloadsRecursiveGenericReturnType.js] -var B = (function () { +var B = /** @class */ (function () { function B() { } return B; }()); -var A = (function () { +var A = /** @class */ (function () { function A() { } return A; diff --git a/tests/baselines/reference/functionSubtypingOfVarArgs.js b/tests/baselines/reference/functionSubtypingOfVarArgs.js index a4b43c3a1a1b9..cee34d4042fed 100644 --- a/tests/baselines/reference/functionSubtypingOfVarArgs.js +++ b/tests/baselines/reference/functionSubtypingOfVarArgs.js @@ -25,7 +25,7 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var EventBase = (function () { +var EventBase = /** @class */ (function () { function EventBase() { this._listeners = []; } @@ -34,7 +34,7 @@ var EventBase = (function () { }; return EventBase; }()); -var StringEvent = (function (_super) { +var StringEvent = /** @class */ (function (_super) { __extends(StringEvent, _super); function StringEvent() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/functionSubtypingOfVarArgs2.js b/tests/baselines/reference/functionSubtypingOfVarArgs2.js index 829440c12d43d..7514d34704adb 100644 --- a/tests/baselines/reference/functionSubtypingOfVarArgs2.js +++ b/tests/baselines/reference/functionSubtypingOfVarArgs2.js @@ -25,7 +25,7 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var EventBase = (function () { +var EventBase = /** @class */ (function () { function EventBase() { this._listeners = []; } @@ -34,7 +34,7 @@ var EventBase = (function () { }; return EventBase; }()); -var StringEvent = (function (_super) { +var StringEvent = /** @class */ (function (_super) { __extends(StringEvent, _super); function StringEvent() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/functionWithSameNameAsField.js b/tests/baselines/reference/functionWithSameNameAsField.js index f4b328e4c5b5f..cefeecc97d322 100644 --- a/tests/baselines/reference/functionWithSameNameAsField.js +++ b/tests/baselines/reference/functionWithSameNameAsField.js @@ -9,7 +9,7 @@ class TestProgressBar { //// [functionWithSameNameAsField.js] -var TestProgressBar = (function () { +var TestProgressBar = /** @class */ (function () { function TestProgressBar() { } TestProgressBar.prototype.total = function (total) { diff --git a/tests/baselines/reference/functionsInClassExpressions.js b/tests/baselines/reference/functionsInClassExpressions.js index 616e6a3251ca2..b8a9b6702b569 100644 --- a/tests/baselines/reference/functionsInClassExpressions.js +++ b/tests/baselines/reference/functionsInClassExpressions.js @@ -11,7 +11,7 @@ let Foo = class { } //// [functionsInClassExpressions.js] -var Foo = (function () { +var Foo = /** @class */ (function () { function class_1() { var _this = this; this.bar = 0; diff --git a/tests/baselines/reference/functionsMissingReturnStatementsAndExpressions.js b/tests/baselines/reference/functionsMissingReturnStatementsAndExpressions.js index 3c10c77bef4da..7e6bbb43f8a7f 100644 --- a/tests/baselines/reference/functionsMissingReturnStatementsAndExpressions.js +++ b/tests/baselines/reference/functionsMissingReturnStatementsAndExpressions.js @@ -209,7 +209,7 @@ function f20() { function f21() { // Not okay; union does not contain void or any } -var C = (function () { +var C = /** @class */ (function () { function C() { } Object.defineProperty(C.prototype, "m1", { diff --git a/tests/baselines/reference/fuzzy.js b/tests/baselines/reference/fuzzy.js index af2bda7433902..e5dd9a76fe7ed 100644 --- a/tests/baselines/reference/fuzzy.js +++ b/tests/baselines/reference/fuzzy.js @@ -33,7 +33,7 @@ module M { //// [fuzzy.js] var M; (function (M) { - var C = (function () { + var C = /** @class */ (function () { function C(x) { this.x = x; } diff --git a/tests/baselines/reference/generatedContextualTyping.js b/tests/baselines/reference/generatedContextualTyping.js index a5d5a4183270c..748c80cf71c04 100644 --- a/tests/baselines/reference/generatedContextualTyping.js +++ b/tests/baselines/reference/generatedContextualTyping.js @@ -365,19 +365,19 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var Base = (function () { +var Base = /** @class */ (function () { function Base() { } return Base; }()); -var Derived1 = (function (_super) { +var Derived1 = /** @class */ (function (_super) { __extends(Derived1, _super); function Derived1() { return _super !== null && _super.apply(this, arguments) || this; } return Derived1; }(Base)); -var Derived2 = (function (_super) { +var Derived2 = /** @class */ (function (_super) { __extends(Derived2, _super); function Derived2() { return _super !== null && _super.apply(this, arguments) || this; @@ -397,672 +397,672 @@ var x9 = [d1, d2]; var x10 = { n: [d1, d2] }; var x11 = function (n) { var n; return null; }; var x12 = { func: function (n) { return [d1, d2]; } }; -var x13 = (function () { +var x13 = /** @class */ (function () { function x13() { this.member = function () { return [d1, d2]; }; } return x13; }()); -var x14 = (function () { +var x14 = /** @class */ (function () { function x14() { this.member = function () { return [d1, d2]; }; } return x14; }()); -var x15 = (function () { +var x15 = /** @class */ (function () { function x15() { this.member = function named() { return [d1, d2]; }; } return x15; }()); -var x16 = (function () { +var x16 = /** @class */ (function () { function x16() { this.member = function () { return [d1, d2]; }; } return x16; }()); -var x17 = (function () { +var x17 = /** @class */ (function () { function x17() { this.member = function () { return [d1, d2]; }; } return x17; }()); -var x18 = (function () { +var x18 = /** @class */ (function () { function x18() { this.member = function named() { return [d1, d2]; }; } return x18; }()); -var x19 = (function () { +var x19 = /** @class */ (function () { function x19() { this.member = [d1, d2]; } return x19; }()); -var x20 = (function () { +var x20 = /** @class */ (function () { function x20() { this.member = [d1, d2]; } return x20; }()); -var x21 = (function () { +var x21 = /** @class */ (function () { function x21() { this.member = [d1, d2]; } return x21; }()); -var x22 = (function () { +var x22 = /** @class */ (function () { function x22() { this.member = { n: [d1, d2] }; } return x22; }()); -var x23 = (function () { +var x23 = /** @class */ (function () { function x23() { this.member = function (n) { var n; return null; }; } return x23; }()); -var x24 = (function () { +var x24 = /** @class */ (function () { function x24() { this.member = { func: function (n) { return [d1, d2]; } }; } return x24; }()); -var x25 = (function () { +var x25 = /** @class */ (function () { function x25() { this.member = function () { return [d1, d2]; }; } return x25; }()); -var x26 = (function () { +var x26 = /** @class */ (function () { function x26() { this.member = function () { return [d1, d2]; }; } return x26; }()); -var x27 = (function () { +var x27 = /** @class */ (function () { function x27() { this.member = function named() { return [d1, d2]; }; } return x27; }()); -var x28 = (function () { +var x28 = /** @class */ (function () { function x28() { this.member = function () { return [d1, d2]; }; } return x28; }()); -var x29 = (function () { +var x29 = /** @class */ (function () { function x29() { this.member = function () { return [d1, d2]; }; } return x29; }()); -var x30 = (function () { +var x30 = /** @class */ (function () { function x30() { this.member = function named() { return [d1, d2]; }; } return x30; }()); -var x31 = (function () { +var x31 = /** @class */ (function () { function x31() { this.member = [d1, d2]; } return x31; }()); -var x32 = (function () { +var x32 = /** @class */ (function () { function x32() { this.member = [d1, d2]; } return x32; }()); -var x33 = (function () { +var x33 = /** @class */ (function () { function x33() { this.member = [d1, d2]; } return x33; }()); -var x34 = (function () { +var x34 = /** @class */ (function () { function x34() { this.member = { n: [d1, d2] }; } return x34; }()); -var x35 = (function () { +var x35 = /** @class */ (function () { function x35() { this.member = function (n) { var n; return null; }; } return x35; }()); -var x36 = (function () { +var x36 = /** @class */ (function () { function x36() { this.member = { func: function (n) { return [d1, d2]; } }; } return x36; }()); -var x37 = (function () { +var x37 = /** @class */ (function () { function x37() { this.member = function () { return [d1, d2]; }; } return x37; }()); -var x38 = (function () { +var x38 = /** @class */ (function () { function x38() { this.member = function () { return [d1, d2]; }; } return x38; }()); -var x39 = (function () { +var x39 = /** @class */ (function () { function x39() { this.member = function named() { return [d1, d2]; }; } return x39; }()); -var x40 = (function () { +var x40 = /** @class */ (function () { function x40() { this.member = function () { return [d1, d2]; }; } return x40; }()); -var x41 = (function () { +var x41 = /** @class */ (function () { function x41() { this.member = function () { return [d1, d2]; }; } return x41; }()); -var x42 = (function () { +var x42 = /** @class */ (function () { function x42() { this.member = function named() { return [d1, d2]; }; } return x42; }()); -var x43 = (function () { +var x43 = /** @class */ (function () { function x43() { this.member = [d1, d2]; } return x43; }()); -var x44 = (function () { +var x44 = /** @class */ (function () { function x44() { this.member = [d1, d2]; } return x44; }()); -var x45 = (function () { +var x45 = /** @class */ (function () { function x45() { this.member = [d1, d2]; } return x45; }()); -var x46 = (function () { +var x46 = /** @class */ (function () { function x46() { this.member = { n: [d1, d2] }; } return x46; }()); -var x47 = (function () { +var x47 = /** @class */ (function () { function x47() { this.member = function (n) { var n; return null; }; } return x47; }()); -var x48 = (function () { +var x48 = /** @class */ (function () { function x48() { this.member = { func: function (n) { return [d1, d2]; } }; } return x48; }()); -var x49 = (function () { +var x49 = /** @class */ (function () { function x49() { } x49.member = function () { return [d1, d2]; }; return x49; }()); -var x50 = (function () { +var x50 = /** @class */ (function () { function x50() { } x50.member = function () { return [d1, d2]; }; return x50; }()); -var x51 = (function () { +var x51 = /** @class */ (function () { function x51() { } x51.member = function named() { return [d1, d2]; }; return x51; }()); -var x52 = (function () { +var x52 = /** @class */ (function () { function x52() { } x52.member = function () { return [d1, d2]; }; return x52; }()); -var x53 = (function () { +var x53 = /** @class */ (function () { function x53() { } x53.member = function () { return [d1, d2]; }; return x53; }()); -var x54 = (function () { +var x54 = /** @class */ (function () { function x54() { } x54.member = function named() { return [d1, d2]; }; return x54; }()); -var x55 = (function () { +var x55 = /** @class */ (function () { function x55() { } x55.member = [d1, d2]; return x55; }()); -var x56 = (function () { +var x56 = /** @class */ (function () { function x56() { } x56.member = [d1, d2]; return x56; }()); -var x57 = (function () { +var x57 = /** @class */ (function () { function x57() { } x57.member = [d1, d2]; return x57; }()); -var x58 = (function () { +var x58 = /** @class */ (function () { function x58() { } x58.member = { n: [d1, d2] }; return x58; }()); -var x59 = (function () { +var x59 = /** @class */ (function () { function x59() { } x59.member = function (n) { var n; return null; }; return x59; }()); -var x60 = (function () { +var x60 = /** @class */ (function () { function x60() { } x60.member = { func: function (n) { return [d1, d2]; } }; return x60; }()); -var x61 = (function () { +var x61 = /** @class */ (function () { function x61() { } x61.member = function () { return [d1, d2]; }; return x61; }()); -var x62 = (function () { +var x62 = /** @class */ (function () { function x62() { } x62.member = function () { return [d1, d2]; }; return x62; }()); -var x63 = (function () { +var x63 = /** @class */ (function () { function x63() { } x63.member = function named() { return [d1, d2]; }; return x63; }()); -var x64 = (function () { +var x64 = /** @class */ (function () { function x64() { } x64.member = function () { return [d1, d2]; }; return x64; }()); -var x65 = (function () { +var x65 = /** @class */ (function () { function x65() { } x65.member = function () { return [d1, d2]; }; return x65; }()); -var x66 = (function () { +var x66 = /** @class */ (function () { function x66() { } x66.member = function named() { return [d1, d2]; }; return x66; }()); -var x67 = (function () { +var x67 = /** @class */ (function () { function x67() { } x67.member = [d1, d2]; return x67; }()); -var x68 = (function () { +var x68 = /** @class */ (function () { function x68() { } x68.member = [d1, d2]; return x68; }()); -var x69 = (function () { +var x69 = /** @class */ (function () { function x69() { } x69.member = [d1, d2]; return x69; }()); -var x70 = (function () { +var x70 = /** @class */ (function () { function x70() { } x70.member = { n: [d1, d2] }; return x70; }()); -var x71 = (function () { +var x71 = /** @class */ (function () { function x71() { } x71.member = function (n) { var n; return null; }; return x71; }()); -var x72 = (function () { +var x72 = /** @class */ (function () { function x72() { } x72.member = { func: function (n) { return [d1, d2]; } }; return x72; }()); -var x73 = (function () { +var x73 = /** @class */ (function () { function x73() { } x73.member = function () { return [d1, d2]; }; return x73; }()); -var x74 = (function () { +var x74 = /** @class */ (function () { function x74() { } x74.member = function () { return [d1, d2]; }; return x74; }()); -var x75 = (function () { +var x75 = /** @class */ (function () { function x75() { } x75.member = function named() { return [d1, d2]; }; return x75; }()); -var x76 = (function () { +var x76 = /** @class */ (function () { function x76() { } x76.member = function () { return [d1, d2]; }; return x76; }()); -var x77 = (function () { +var x77 = /** @class */ (function () { function x77() { } x77.member = function () { return [d1, d2]; }; return x77; }()); -var x78 = (function () { +var x78 = /** @class */ (function () { function x78() { } x78.member = function named() { return [d1, d2]; }; return x78; }()); -var x79 = (function () { +var x79 = /** @class */ (function () { function x79() { } x79.member = [d1, d2]; return x79; }()); -var x80 = (function () { +var x80 = /** @class */ (function () { function x80() { } x80.member = [d1, d2]; return x80; }()); -var x81 = (function () { +var x81 = /** @class */ (function () { function x81() { } x81.member = [d1, d2]; return x81; }()); -var x82 = (function () { +var x82 = /** @class */ (function () { function x82() { } x82.member = { n: [d1, d2] }; return x82; }()); -var x83 = (function () { +var x83 = /** @class */ (function () { function x83() { } x83.member = function (n) { var n; return null; }; return x83; }()); -var x84 = (function () { +var x84 = /** @class */ (function () { function x84() { } x84.member = { func: function (n) { return [d1, d2]; } }; return x84; }()); -var x85 = (function () { +var x85 = /** @class */ (function () { function x85(parm) { if (parm === void 0) { parm = function () { return [d1, d2]; }; } } return x85; }()); -var x86 = (function () { +var x86 = /** @class */ (function () { function x86(parm) { if (parm === void 0) { parm = function () { return [d1, d2]; }; } } return x86; }()); -var x87 = (function () { +var x87 = /** @class */ (function () { function x87(parm) { if (parm === void 0) { parm = function named() { return [d1, d2]; }; } } return x87; }()); -var x88 = (function () { +var x88 = /** @class */ (function () { function x88(parm) { if (parm === void 0) { parm = function () { return [d1, d2]; }; } } return x88; }()); -var x89 = (function () { +var x89 = /** @class */ (function () { function x89(parm) { if (parm === void 0) { parm = function () { return [d1, d2]; }; } } return x89; }()); -var x90 = (function () { +var x90 = /** @class */ (function () { function x90(parm) { if (parm === void 0) { parm = function named() { return [d1, d2]; }; } } return x90; }()); -var x91 = (function () { +var x91 = /** @class */ (function () { function x91(parm) { if (parm === void 0) { parm = [d1, d2]; } } return x91; }()); -var x92 = (function () { +var x92 = /** @class */ (function () { function x92(parm) { if (parm === void 0) { parm = [d1, d2]; } } return x92; }()); -var x93 = (function () { +var x93 = /** @class */ (function () { function x93(parm) { if (parm === void 0) { parm = [d1, d2]; } } return x93; }()); -var x94 = (function () { +var x94 = /** @class */ (function () { function x94(parm) { if (parm === void 0) { parm = { n: [d1, d2] }; } } return x94; }()); -var x95 = (function () { +var x95 = /** @class */ (function () { function x95(parm) { if (parm === void 0) { parm = function (n) { var n; return null; }; } } return x95; }()); -var x96 = (function () { +var x96 = /** @class */ (function () { function x96(parm) { if (parm === void 0) { parm = { func: function (n) { return [d1, d2]; } }; } } return x96; }()); -var x97 = (function () { +var x97 = /** @class */ (function () { function x97(parm) { if (parm === void 0) { parm = function () { return [d1, d2]; }; } this.parm = parm; } return x97; }()); -var x98 = (function () { +var x98 = /** @class */ (function () { function x98(parm) { if (parm === void 0) { parm = function () { return [d1, d2]; }; } this.parm = parm; } return x98; }()); -var x99 = (function () { +var x99 = /** @class */ (function () { function x99(parm) { if (parm === void 0) { parm = function named() { return [d1, d2]; }; } this.parm = parm; } return x99; }()); -var x100 = (function () { +var x100 = /** @class */ (function () { function x100(parm) { if (parm === void 0) { parm = function () { return [d1, d2]; }; } this.parm = parm; } return x100; }()); -var x101 = (function () { +var x101 = /** @class */ (function () { function x101(parm) { if (parm === void 0) { parm = function () { return [d1, d2]; }; } this.parm = parm; } return x101; }()); -var x102 = (function () { +var x102 = /** @class */ (function () { function x102(parm) { if (parm === void 0) { parm = function named() { return [d1, d2]; }; } this.parm = parm; } return x102; }()); -var x103 = (function () { +var x103 = /** @class */ (function () { function x103(parm) { if (parm === void 0) { parm = [d1, d2]; } this.parm = parm; } return x103; }()); -var x104 = (function () { +var x104 = /** @class */ (function () { function x104(parm) { if (parm === void 0) { parm = [d1, d2]; } this.parm = parm; } return x104; }()); -var x105 = (function () { +var x105 = /** @class */ (function () { function x105(parm) { if (parm === void 0) { parm = [d1, d2]; } this.parm = parm; } return x105; }()); -var x106 = (function () { +var x106 = /** @class */ (function () { function x106(parm) { if (parm === void 0) { parm = { n: [d1, d2] }; } this.parm = parm; } return x106; }()); -var x107 = (function () { +var x107 = /** @class */ (function () { function x107(parm) { if (parm === void 0) { parm = function (n) { var n; return null; }; } this.parm = parm; } return x107; }()); -var x108 = (function () { +var x108 = /** @class */ (function () { function x108(parm) { if (parm === void 0) { parm = { func: function (n) { return [d1, d2]; } }; } this.parm = parm; } return x108; }()); -var x109 = (function () { +var x109 = /** @class */ (function () { function x109(parm) { if (parm === void 0) { parm = function () { return [d1, d2]; }; } this.parm = parm; } return x109; }()); -var x110 = (function () { +var x110 = /** @class */ (function () { function x110(parm) { if (parm === void 0) { parm = function () { return [d1, d2]; }; } this.parm = parm; } return x110; }()); -var x111 = (function () { +var x111 = /** @class */ (function () { function x111(parm) { if (parm === void 0) { parm = function named() { return [d1, d2]; }; } this.parm = parm; } return x111; }()); -var x112 = (function () { +var x112 = /** @class */ (function () { function x112(parm) { if (parm === void 0) { parm = function () { return [d1, d2]; }; } this.parm = parm; } return x112; }()); -var x113 = (function () { +var x113 = /** @class */ (function () { function x113(parm) { if (parm === void 0) { parm = function () { return [d1, d2]; }; } this.parm = parm; } return x113; }()); -var x114 = (function () { +var x114 = /** @class */ (function () { function x114(parm) { if (parm === void 0) { parm = function named() { return [d1, d2]; }; } this.parm = parm; } return x114; }()); -var x115 = (function () { +var x115 = /** @class */ (function () { function x115(parm) { if (parm === void 0) { parm = [d1, d2]; } this.parm = parm; } return x115; }()); -var x116 = (function () { +var x116 = /** @class */ (function () { function x116(parm) { if (parm === void 0) { parm = [d1, d2]; } this.parm = parm; } return x116; }()); -var x117 = (function () { +var x117 = /** @class */ (function () { function x117(parm) { if (parm === void 0) { parm = [d1, d2]; } this.parm = parm; } return x117; }()); -var x118 = (function () { +var x118 = /** @class */ (function () { function x118(parm) { if (parm === void 0) { parm = { n: [d1, d2] }; } this.parm = parm; } return x118; }()); -var x119 = (function () { +var x119 = /** @class */ (function () { function x119(parm) { if (parm === void 0) { parm = function (n) { var n; return null; }; } this.parm = parm; } return x119; }()); -var x120 = (function () { +var x120 = /** @class */ (function () { function x120(parm) { if (parm === void 0) { parm = { func: function (n) { return [d1, d2]; } }; } this.parm = parm; diff --git a/tests/baselines/reference/generativeRecursionWithTypeOf.js b/tests/baselines/reference/generativeRecursionWithTypeOf.js index 5a2ee9a0f1a39..19403d0450f83 100644 --- a/tests/baselines/reference/generativeRecursionWithTypeOf.js +++ b/tests/baselines/reference/generativeRecursionWithTypeOf.js @@ -11,7 +11,7 @@ module M { } //// [generativeRecursionWithTypeOf.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } C.foo = function (x) { }; diff --git a/tests/baselines/reference/genericArrayWithoutTypeAnnotation.js b/tests/baselines/reference/genericArrayWithoutTypeAnnotation.js index 2a5177ca25566..fc21390c56864 100644 --- a/tests/baselines/reference/genericArrayWithoutTypeAnnotation.js +++ b/tests/baselines/reference/genericArrayWithoutTypeAnnotation.js @@ -8,7 +8,7 @@ class Bar { //// [genericArrayWithoutTypeAnnotation.js] -var Bar = (function () { +var Bar = /** @class */ (function () { function Bar() { } Bar.prototype.getBar = function (foo) { diff --git a/tests/baselines/reference/genericAssignmentCompatWithInterfaces1.js b/tests/baselines/reference/genericAssignmentCompatWithInterfaces1.js index 81d65dbbbb419..a2ea6a5a15965 100644 --- a/tests/baselines/reference/genericAssignmentCompatWithInterfaces1.js +++ b/tests/baselines/reference/genericAssignmentCompatWithInterfaces1.js @@ -20,7 +20,7 @@ var a4: I = >z; //// [genericAssignmentCompatWithInterfaces1.js] -var A = (function () { +var A = /** @class */ (function () { function A() { } A.prototype.compareTo = function (other) { return 1; }; diff --git a/tests/baselines/reference/genericBaseClassLiteralProperty.js b/tests/baselines/reference/genericBaseClassLiteralProperty.js index 0c3a5ee612988..0b417b5594439 100644 --- a/tests/baselines/reference/genericBaseClassLiteralProperty.js +++ b/tests/baselines/reference/genericBaseClassLiteralProperty.js @@ -23,12 +23,12 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var BaseClass = (function () { +var BaseClass = /** @class */ (function () { function BaseClass() { } return BaseClass; }()); -var SubClass = (function (_super) { +var SubClass = /** @class */ (function (_super) { __extends(SubClass, _super); function SubClass() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/genericBaseClassLiteralProperty2.js b/tests/baselines/reference/genericBaseClassLiteralProperty2.js index e2ef30f9ce834..543a30d104fd8 100644 --- a/tests/baselines/reference/genericBaseClassLiteralProperty2.js +++ b/tests/baselines/reference/genericBaseClassLiteralProperty2.js @@ -26,18 +26,18 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var CollectionItem2 = (function () { +var CollectionItem2 = /** @class */ (function () { function CollectionItem2() { } return CollectionItem2; }()); -var BaseCollection2 = (function () { +var BaseCollection2 = /** @class */ (function () { function BaseCollection2() { this._itemsByKey = {}; } return BaseCollection2; }()); -var DataView2 = (function (_super) { +var DataView2 = /** @class */ (function (_super) { __extends(DataView2, _super); function DataView2() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/genericCallTypeArgumentInference.js b/tests/baselines/reference/genericCallTypeArgumentInference.js index 994b4a52e6096..77f5c05c46380 100644 --- a/tests/baselines/reference/genericCallTypeArgumentInference.js +++ b/tests/baselines/reference/genericCallTypeArgumentInference.js @@ -106,7 +106,7 @@ function foo2b(u) { } var r2 = foo2('', 1); // number var r3 = foo2b(1); // {} -var C = (function () { +var C = /** @class */ (function () { function C(t, u) { this.t = t; this.u = u; diff --git a/tests/baselines/reference/genericCallWithConstraintsTypeArgumentInference.js b/tests/baselines/reference/genericCallWithConstraintsTypeArgumentInference.js index 3ccdb5b6b558b..c8b253e91693b 100644 --- a/tests/baselines/reference/genericCallWithConstraintsTypeArgumentInference.js +++ b/tests/baselines/reference/genericCallWithConstraintsTypeArgumentInference.js @@ -119,19 +119,19 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var Base = (function () { +var Base = /** @class */ (function () { function Base() { } return Base; }()); -var Derived = (function (_super) { +var Derived = /** @class */ (function (_super) { __extends(Derived, _super); function Derived() { return _super !== null && _super.apply(this, arguments) || this; } return Derived; }(Base)); -var Derived2 = (function (_super) { +var Derived2 = /** @class */ (function (_super) { __extends(Derived2, _super); function Derived2() { return _super !== null && _super.apply(this, arguments) || this; @@ -159,7 +159,7 @@ function foo2c() { } var r3 = foo2b(d1); // Base var r3b = foo2c(); // Base -var C = (function () { +var C = /** @class */ (function () { function C(t, u) { this.t = t; this.u = u; diff --git a/tests/baselines/reference/genericCallWithFixedArguments.js b/tests/baselines/reference/genericCallWithFixedArguments.js index a207d5c6d1716..4e54fb380d019 100644 --- a/tests/baselines/reference/genericCallWithFixedArguments.js +++ b/tests/baselines/reference/genericCallWithFixedArguments.js @@ -8,13 +8,13 @@ g(7) // the parameter list is fixed, so this should not error //// [genericCallWithFixedArguments.js] -var A = (function () { +var A = /** @class */ (function () { function A() { } A.prototype.foo = function () { }; return A; }()); -var B = (function () { +var B = /** @class */ (function () { function B() { } B.prototype.bar = function () { }; diff --git a/tests/baselines/reference/genericCallWithFunctionTypedArguments4.js b/tests/baselines/reference/genericCallWithFunctionTypedArguments4.js index c4290b73828f4..bc07ed803c4a3 100644 --- a/tests/baselines/reference/genericCallWithFunctionTypedArguments4.js +++ b/tests/baselines/reference/genericCallWithFunctionTypedArguments4.js @@ -24,12 +24,12 @@ var r2 = foo4(b); // T is {} (candidates boolean and {}), U is any (candidates a //// [genericCallWithFunctionTypedArguments4.js] // No inference is made from function typed arguments which have multiple call signatures -var C = (function () { +var C = /** @class */ (function () { function C() { } return C; }()); -var D = (function () { +var D = /** @class */ (function () { function D() { } return D; diff --git a/tests/baselines/reference/genericCallWithObjectTypeArgs.js b/tests/baselines/reference/genericCallWithObjectTypeArgs.js index 3496c28ecc3c1..51b9bc27f9f17 100644 --- a/tests/baselines/reference/genericCallWithObjectTypeArgs.js +++ b/tests/baselines/reference/genericCallWithObjectTypeArgs.js @@ -22,17 +22,17 @@ var r = foo(c1, d1); // error var r2 = foo(c1, c1); // ok //// [genericCallWithObjectTypeArgs.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } return C; }()); -var D = (function () { +var D = /** @class */ (function () { function D() { } return D; }()); -var X = (function () { +var X = /** @class */ (function () { function X() { } return X; diff --git a/tests/baselines/reference/genericCallWithObjectTypeArgs2.js b/tests/baselines/reference/genericCallWithObjectTypeArgs2.js index c5de24019b225..e9fa6cde00ed1 100644 --- a/tests/baselines/reference/genericCallWithObjectTypeArgs2.js +++ b/tests/baselines/reference/genericCallWithObjectTypeArgs2.js @@ -43,19 +43,19 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var Base = (function () { +var Base = /** @class */ (function () { function Base() { } return Base; }()); -var Derived = (function (_super) { +var Derived = /** @class */ (function (_super) { __extends(Derived, _super); function Derived() { return _super !== null && _super.apply(this, arguments) || this; } return Derived; }(Base)); -var Derived2 = (function (_super) { +var Derived2 = /** @class */ (function (_super) { __extends(Derived2, _super); function Derived2() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/genericCallWithObjectTypeArgsAndConstraints.js b/tests/baselines/reference/genericCallWithObjectTypeArgsAndConstraints.js index 308051b720e04..f95e5704c4848 100644 --- a/tests/baselines/reference/genericCallWithObjectTypeArgsAndConstraints.js +++ b/tests/baselines/reference/genericCallWithObjectTypeArgsAndConstraints.js @@ -36,17 +36,17 @@ var r2 = foo2(c1, c1); //// [genericCallWithObjectTypeArgsAndConstraints.js] // Generic call with constraints infering type parameter from object member properties // No errors expected -var C = (function () { +var C = /** @class */ (function () { function C() { } return C; }()); -var D = (function () { +var D = /** @class */ (function () { function D() { } return D; }()); -var X = (function () { +var X = /** @class */ (function () { function X() { } return X; diff --git a/tests/baselines/reference/genericCallWithObjectTypeArgsAndConstraints2.js b/tests/baselines/reference/genericCallWithObjectTypeArgsAndConstraints2.js index a4f8172a312cd..d45ac2737a1ff 100644 --- a/tests/baselines/reference/genericCallWithObjectTypeArgsAndConstraints2.js +++ b/tests/baselines/reference/genericCallWithObjectTypeArgsAndConstraints2.js @@ -51,12 +51,12 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var Base = (function () { +var Base = /** @class */ (function () { function Base() { } return Base; }()); -var Derived = (function (_super) { +var Derived = /** @class */ (function (_super) { __extends(Derived, _super); function Derived() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/genericCallWithObjectTypeArgsAndConstraints3.js b/tests/baselines/reference/genericCallWithObjectTypeArgsAndConstraints3.js index 074b25fdeeaae..35ae4216a1871 100644 --- a/tests/baselines/reference/genericCallWithObjectTypeArgsAndConstraints3.js +++ b/tests/baselines/reference/genericCallWithObjectTypeArgsAndConstraints3.js @@ -49,19 +49,19 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var Base = (function () { +var Base = /** @class */ (function () { function Base() { } return Base; }()); -var Derived = (function (_super) { +var Derived = /** @class */ (function (_super) { __extends(Derived, _super); function Derived() { return _super !== null && _super.apply(this, arguments) || this; } return Derived; }(Base)); -var Derived2 = (function (_super) { +var Derived2 = /** @class */ (function (_super) { __extends(Derived2, _super); function Derived2() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/genericCallWithObjectTypeArgsAndConstraints4.js b/tests/baselines/reference/genericCallWithObjectTypeArgsAndConstraints4.js index 2025c3eb6c06c..2f9eedad0796d 100644 --- a/tests/baselines/reference/genericCallWithObjectTypeArgsAndConstraints4.js +++ b/tests/baselines/reference/genericCallWithObjectTypeArgsAndConstraints4.js @@ -35,12 +35,12 @@ function other() { //// [genericCallWithObjectTypeArgsAndConstraints4.js] // Generic call with constraints infering type parameter from object member properties -var C = (function () { +var C = /** @class */ (function () { function C() { } return C; }()); -var D = (function () { +var D = /** @class */ (function () { function D() { } return D; diff --git a/tests/baselines/reference/genericCallWithObjectTypeArgsAndConstraints5.js b/tests/baselines/reference/genericCallWithObjectTypeArgsAndConstraints5.js index 355f639748bf8..5c72d952364ec 100644 --- a/tests/baselines/reference/genericCallWithObjectTypeArgsAndConstraints5.js +++ b/tests/baselines/reference/genericCallWithObjectTypeArgsAndConstraints5.js @@ -26,12 +26,12 @@ function other() { //// [genericCallWithObjectTypeArgsAndConstraints5.js] // Generic call with constraints infering type parameter from object member properties -var C = (function () { +var C = /** @class */ (function () { function C() { } return C; }()); -var D = (function () { +var D = /** @class */ (function () { function D() { } return D; diff --git a/tests/baselines/reference/genericCallbacksAndClassHierarchy.js b/tests/baselines/reference/genericCallbacksAndClassHierarchy.js index b7b9e35a5436f..a308493498afa 100644 --- a/tests/baselines/reference/genericCallbacksAndClassHierarchy.js +++ b/tests/baselines/reference/genericCallbacksAndClassHierarchy.js @@ -36,19 +36,19 @@ var __extends = (this && this.__extends) || (function () { })(); var M; (function (M) { - var C1 = (function () { + var C1 = /** @class */ (function () { function C1() { } return C1; }()); M.C1 = C1; - var A = (function () { + var A = /** @class */ (function () { function A() { } return A; }()); M.A = A; - var B = (function (_super) { + var B = /** @class */ (function (_super) { __extends(B, _super); function B() { return _super !== null && _super.apply(this, arguments) || this; @@ -56,7 +56,7 @@ var M; return B; }(C1)); M.B = B; - var D = (function () { + var D = /** @class */ (function () { function D() { } D.prototype._subscribe = function (viewModel) { diff --git a/tests/baselines/reference/genericCallsWithoutParens.js b/tests/baselines/reference/genericCallsWithoutParens.js index b920016b58d1c..f94001be166c1 100644 --- a/tests/baselines/reference/genericCallsWithoutParens.js +++ b/tests/baselines/reference/genericCallsWithoutParens.js @@ -12,7 +12,7 @@ var c = new C; // parse error //// [genericCallsWithoutParens.js] function f() { } var r = f(); // parse error -var C = (function () { +var C = /** @class */ (function () { function C() { } return C; diff --git a/tests/baselines/reference/genericClassExpressionInFunction.js b/tests/baselines/reference/genericClassExpressionInFunction.js index e1a47ffaac7f2..aa3606ddf1714 100644 --- a/tests/baselines/reference/genericClassExpressionInFunction.js +++ b/tests/baselines/reference/genericClassExpressionInFunction.js @@ -42,14 +42,14 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var A = (function () { +var A = /** @class */ (function () { function A() { } return A; }()); function B1() { // class expression can use T - return (function (_super) { + return /** @class */ (function (_super) { __extends(class_1, _super); function class_1() { return _super !== null && _super.apply(this, arguments) || this; @@ -57,9 +57,9 @@ function B1() { return class_1; }(A)); } -var B2 = (function () { +var B2 = /** @class */ (function () { function B2() { - this.anon = (function (_super) { + this.anon = /** @class */ (function (_super) { __extends(class_2, _super); function class_2() { return _super !== null && _super.apply(this, arguments) || this; @@ -70,7 +70,7 @@ var B2 = (function () { return B2; }()); function B3() { - return (function (_super) { + return /** @class */ (function (_super) { __extends(Inner, _super); function Inner() { return _super !== null && _super.apply(this, arguments) || this; @@ -79,14 +79,14 @@ function B3() { }(A)); } // extends can call B -var K = (function (_super) { +var K = /** @class */ (function (_super) { __extends(K, _super); function K() { return _super !== null && _super.apply(this, arguments) || this; } return K; }(B1())); -var C = (function (_super) { +var C = /** @class */ (function (_super) { __extends(C, _super); function C() { return _super !== null && _super.apply(this, arguments) || this; @@ -94,7 +94,7 @@ var C = (function (_super) { return C; }((new B2().anon))); var b3Number = B3(); -var S = (function (_super) { +var S = /** @class */ (function (_super) { __extends(S, _super); function S() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/genericClassImplementingGenericInterfaceFromAnotherModule.js b/tests/baselines/reference/genericClassImplementingGenericInterfaceFromAnotherModule.js index 588cf93fe4b49..4cad4e20e7d69 100644 --- a/tests/baselines/reference/genericClassImplementingGenericInterfaceFromAnotherModule.js +++ b/tests/baselines/reference/genericClassImplementingGenericInterfaceFromAnotherModule.js @@ -10,7 +10,7 @@ module bar { //// [genericClassImplementingGenericInterfaceFromAnotherModule.js] var bar; (function (bar) { - var Foo = (function () { + var Foo = /** @class */ (function () { function Foo() { } return Foo; diff --git a/tests/baselines/reference/genericClassInheritsConstructorFromNonGenericClass.js b/tests/baselines/reference/genericClassInheritsConstructorFromNonGenericClass.js index c8a5b3ac0c4cb..e3a55b753369b 100644 --- a/tests/baselines/reference/genericClassInheritsConstructorFromNonGenericClass.js +++ b/tests/baselines/reference/genericClassInheritsConstructorFromNonGenericClass.js @@ -16,21 +16,21 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var A = (function (_super) { +var A = /** @class */ (function (_super) { __extends(A, _super); function A() { return _super !== null && _super.apply(this, arguments) || this; } return A; }(B)); -var B = (function (_super) { +var B = /** @class */ (function (_super) { __extends(B, _super); function B() { return _super !== null && _super.apply(this, arguments) || this; } return B; }(C)); -var C = (function () { +var C = /** @class */ (function () { function C(p) { } return C; diff --git a/tests/baselines/reference/genericClassPropertyInheritanceSpecialization.js b/tests/baselines/reference/genericClassPropertyInheritanceSpecialization.js index b5c8f47bfd4b2..00ca2640099b8 100644 --- a/tests/baselines/reference/genericClassPropertyInheritanceSpecialization.js +++ b/tests/baselines/reference/genericClassPropertyInheritanceSpecialization.js @@ -92,7 +92,7 @@ var Portal; (function (Controls) { var Validators; (function (Validators) { - var Validator = (function () { + var Validator = /** @class */ (function () { function Validator(message) { } Validator.prototype.destroy = function () { }; @@ -111,7 +111,7 @@ var PortalFx; (function (Controls) { var Validators; (function (Validators) { - var Validator = (function (_super) { + var Validator = /** @class */ (function (_super) { __extends(Validator, _super); function Validator(message) { return _super.call(this, message) || this; @@ -123,7 +123,7 @@ var PortalFx; })(Controls = ViewModels.Controls || (ViewModels.Controls = {})); })(ViewModels = PortalFx.ViewModels || (PortalFx.ViewModels = {})); })(PortalFx || (PortalFx = {})); -var ViewModel = (function () { +var ViewModel = /** @class */ (function () { function ViewModel() { this.validators = ko.observableArray(); } diff --git a/tests/baselines/reference/genericClassStaticMethod.js b/tests/baselines/reference/genericClassStaticMethod.js index 803950f58dfe2..0a7a8bcb4ce3d 100644 --- a/tests/baselines/reference/genericClassStaticMethod.js +++ b/tests/baselines/reference/genericClassStaticMethod.js @@ -21,14 +21,14 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var Foo = (function () { +var Foo = /** @class */ (function () { function Foo() { } Foo.getFoo = function () { }; return Foo; }()); -var Bar = (function (_super) { +var Bar = /** @class */ (function (_super) { __extends(Bar, _super); function Bar() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/genericClassWithFunctionTypedMemberArguments.js b/tests/baselines/reference/genericClassWithFunctionTypedMemberArguments.js index 50510d88c248d..30b98f7de2b80 100644 --- a/tests/baselines/reference/genericClassWithFunctionTypedMemberArguments.js +++ b/tests/baselines/reference/genericClassWithFunctionTypedMemberArguments.js @@ -69,7 +69,7 @@ module WithCandidates { // Using function arguments, no errors expected var ImmediatelyFix; (function (ImmediatelyFix) { - var C = (function () { + var C = /** @class */ (function () { function C() { } C.prototype.foo = function (x) { @@ -81,7 +81,7 @@ var ImmediatelyFix; var r = c.foo(function (x) { return ''; }); // {} var r2 = c.foo(function (x) { return ''; }); // string var r3 = c.foo(function (x) { return ''; }); // {} - var C2 = (function () { + var C2 = /** @class */ (function () { function C2() { } C2.prototype.foo = function (x) { @@ -95,7 +95,7 @@ var ImmediatelyFix; })(ImmediatelyFix || (ImmediatelyFix = {})); var WithCandidates; (function (WithCandidates) { - var C = (function () { + var C = /** @class */ (function () { function C() { } C.prototype.foo2 = function (x, cb) { @@ -107,7 +107,7 @@ var WithCandidates; var r4 = c.foo2(1, function (a) { return ''; }); // string, contextual signature instantiation is applied to generic functions var r5 = c.foo2(1, function (a) { return ''; }); // string var r6 = c.foo2('', function (a) { return 1; }); // number - var C2 = (function () { + var C2 = /** @class */ (function () { function C2() { } C2.prototype.foo3 = function (x, cb, y) { @@ -118,7 +118,7 @@ var WithCandidates; var c2; var r7 = c2.foo3(1, function (a) { return ''; }, ''); // string var r8 = c2.foo3(1, function (a) { return ''; }, ''); // string - var C3 = (function () { + var C3 = /** @class */ (function () { function C3() { } C3.prototype.foo3 = function (x, cb, y) { diff --git a/tests/baselines/reference/genericClassWithObjectTypeArgsAndConstraints.js b/tests/baselines/reference/genericClassWithObjectTypeArgsAndConstraints.js index 467675c3497f8..2b8199d6898e0 100644 --- a/tests/baselines/reference/genericClassWithObjectTypeArgsAndConstraints.js +++ b/tests/baselines/reference/genericClassWithObjectTypeArgsAndConstraints.js @@ -63,24 +63,24 @@ module Interface { //// [genericClassWithObjectTypeArgsAndConstraints.js] // Generic call with constraints infering type parameter from object member properties // No errors expected -var C = (function () { +var C = /** @class */ (function () { function C() { } return C; }()); -var D = (function () { +var D = /** @class */ (function () { function D() { } return D; }()); -var X = (function () { +var X = /** @class */ (function () { function X() { } return X; }()); var Class; (function (Class) { - var G = (function () { + var G = /** @class */ (function () { function G() { } G.prototype.foo = function (t, t2) { @@ -94,7 +94,7 @@ var Class; var g; var r = g.foo(c1, d1); var r2 = g.foo(c1, c1); - var G2 = (function () { + var G2 = /** @class */ (function () { function G2() { } G2.prototype.foo2 = function (t, t2) { diff --git a/tests/baselines/reference/genericClassWithStaticFactory.js b/tests/baselines/reference/genericClassWithStaticFactory.js index ee65f23c2f1a5..a8ca7b0247437 100644 --- a/tests/baselines/reference/genericClassWithStaticFactory.js +++ b/tests/baselines/reference/genericClassWithStaticFactory.js @@ -144,7 +144,7 @@ module Editor { //// [genericClassWithStaticFactory.js] var Editor; (function (Editor) { - var List = (function () { + var List = /** @class */ (function () { function List(isHead, data) { this.isHead = isHead; this.data = data; @@ -232,7 +232,7 @@ var Editor; return List; }()); Editor.List = List; - var ListFactory = (function () { + var ListFactory = /** @class */ (function () { function ListFactory() { } ListFactory.prototype.MakeHead = function () { diff --git a/tests/baselines/reference/genericClassWithStaticsUsingTypeArguments.js b/tests/baselines/reference/genericClassWithStaticsUsingTypeArguments.js index 2039e459572ac..28b0aab5b0638 100644 --- a/tests/baselines/reference/genericClassWithStaticsUsingTypeArguments.js +++ b/tests/baselines/reference/genericClassWithStaticsUsingTypeArguments.js @@ -19,7 +19,7 @@ class Foo { //// [genericClassWithStaticsUsingTypeArguments.js] // Should be error to use 'T' in all declarations within Foo. -var Foo = (function () { +var Foo = /** @class */ (function () { function Foo() { } Foo.f = function (xs) { diff --git a/tests/baselines/reference/genericClasses0.js b/tests/baselines/reference/genericClasses0.js index df6e691b9da6e..90dff6154f883 100644 --- a/tests/baselines/reference/genericClasses0.js +++ b/tests/baselines/reference/genericClasses0.js @@ -8,7 +8,7 @@ var v1 : C; var y = v1.x; // should be 'string' //// [genericClasses0.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } return C; diff --git a/tests/baselines/reference/genericClasses1.js b/tests/baselines/reference/genericClasses1.js index de4ad6f917b29..1d991f812d539 100644 --- a/tests/baselines/reference/genericClasses1.js +++ b/tests/baselines/reference/genericClasses1.js @@ -8,7 +8,7 @@ var v1 = new C(); var y = v1.x; // should be 'string' //// [genericClasses1.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } return C; diff --git a/tests/baselines/reference/genericClasses2.js b/tests/baselines/reference/genericClasses2.js index dcfed142d02f8..f86936b9b6439 100644 --- a/tests/baselines/reference/genericClasses2.js +++ b/tests/baselines/reference/genericClasses2.js @@ -16,7 +16,7 @@ var w = v1.y.a; // should be 'string' var z = v1.z.a; // should be 'number' //// [genericClasses2.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } return C; diff --git a/tests/baselines/reference/genericClasses3.js b/tests/baselines/reference/genericClasses3.js index 95eb5db106af9..a9373e0ec426e 100644 --- a/tests/baselines/reference/genericClasses3.js +++ b/tests/baselines/reference/genericClasses3.js @@ -28,12 +28,12 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var B = (function () { +var B = /** @class */ (function () { function B() { } return B; }()); -var C = (function (_super) { +var C = /** @class */ (function (_super) { __extends(C, _super); function C() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/genericClasses4.js b/tests/baselines/reference/genericClasses4.js index ab3620d2d79f2..f36c20d49e41f 100644 --- a/tests/baselines/reference/genericClasses4.js +++ b/tests/baselines/reference/genericClasses4.js @@ -19,7 +19,7 @@ class Vec2_T //// [genericClasses4.js] // once caused stack overflow -var Vec2_T = (function () { +var Vec2_T = /** @class */ (function () { function Vec2_T(x, y) { this.x = x; this.y = y; diff --git a/tests/baselines/reference/genericClassesInModule.js b/tests/baselines/reference/genericClassesInModule.js index 6ca65804d8907..ba081f814dc81 100644 --- a/tests/baselines/reference/genericClassesInModule.js +++ b/tests/baselines/reference/genericClassesInModule.js @@ -11,13 +11,13 @@ var a = new Foo.B(); //// [genericClassesInModule.js] var Foo; (function (Foo) { - var B = (function () { + var B = /** @class */ (function () { function B() { } return B; }()); Foo.B = B; - var A = (function () { + var A = /** @class */ (function () { function A() { } return A; diff --git a/tests/baselines/reference/genericClassesInModule2.js b/tests/baselines/reference/genericClassesInModule2.js index 738fa996cf785..606d791ed840b 100644 --- a/tests/baselines/reference/genericClassesInModule2.js +++ b/tests/baselines/reference/genericClassesInModule2.js @@ -24,7 +24,7 @@ export class B { define(["require", "exports"], function (require, exports) { "use strict"; exports.__esModule = true; - var A = (function () { + var A = /** @class */ (function () { function A(callback) { this.callback = callback; var child = new B(this); @@ -35,7 +35,7 @@ define(["require", "exports"], function (require, exports) { return A; }()); exports.A = A; - var B = (function () { + var B = /** @class */ (function () { function B(parent) { this.parent = parent; } diff --git a/tests/baselines/reference/genericCloduleInModule.js b/tests/baselines/reference/genericCloduleInModule.js index 6164bfc0904c0..97fb6378df0da 100644 --- a/tests/baselines/reference/genericCloduleInModule.js +++ b/tests/baselines/reference/genericCloduleInModule.js @@ -15,7 +15,7 @@ b.foo(); //// [genericCloduleInModule.js] var A; (function (A) { - var B = (function () { + var B = /** @class */ (function () { function B() { } B.prototype.foo = function () { }; diff --git a/tests/baselines/reference/genericCloduleInModule2.js b/tests/baselines/reference/genericCloduleInModule2.js index 55a5507eed2c0..8f610bed876d7 100644 --- a/tests/baselines/reference/genericCloduleInModule2.js +++ b/tests/baselines/reference/genericCloduleInModule2.js @@ -18,7 +18,7 @@ b.foo(); //// [genericCloduleInModule2.js] var A; (function (A) { - var B = (function () { + var B = /** @class */ (function () { function B() { } B.prototype.foo = function () { }; diff --git a/tests/baselines/reference/genericCloneReturnTypes.js b/tests/baselines/reference/genericCloneReturnTypes.js index 6d301c008e6f9..b7fe271b44a7c 100644 --- a/tests/baselines/reference/genericCloneReturnTypes.js +++ b/tests/baselines/reference/genericCloneReturnTypes.js @@ -26,7 +26,7 @@ b = b2; b = b3; //// [genericCloneReturnTypes.js] -var Bar = (function () { +var Bar = /** @class */ (function () { function Bar(x) { this.size = x; } diff --git a/tests/baselines/reference/genericCloneReturnTypes2.js b/tests/baselines/reference/genericCloneReturnTypes2.js index 1e908c4c865fd..9f03398999383 100644 --- a/tests/baselines/reference/genericCloneReturnTypes2.js +++ b/tests/baselines/reference/genericCloneReturnTypes2.js @@ -16,7 +16,7 @@ var c: MyList = a.clone(); // bug was there was an error on this line var d: MyList = a.clone(); // error //// [genericCloneReturnTypes2.js] -var MyList = (function () { +var MyList = /** @class */ (function () { function MyList(n) { this.size = n; this.data = new Array(this.size); diff --git a/tests/baselines/reference/genericConstraint1.js b/tests/baselines/reference/genericConstraint1.js index 52ce01433575c..f916ef6985147 100644 --- a/tests/baselines/reference/genericConstraint1.js +++ b/tests/baselines/reference/genericConstraint1.js @@ -9,7 +9,7 @@ var x = new C(); x.bar2(2, ""); //// [genericConstraint1.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } C.prototype.bar2 = function (x, y) { diff --git a/tests/baselines/reference/genericConstraint2.js b/tests/baselines/reference/genericConstraint2.js index 9056ec847d70f..7c3343a8b383d 100644 --- a/tests/baselines/reference/genericConstraint2.js +++ b/tests/baselines/reference/genericConstraint2.js @@ -29,7 +29,7 @@ function compare(x, y) { return 1; return x.comparer(y); } -var ComparableString = (function () { +var ComparableString = /** @class */ (function () { function ComparableString(currentValue) { this.currentValue = currentValue; } diff --git a/tests/baselines/reference/genericConstraintDeclaration.js b/tests/baselines/reference/genericConstraintDeclaration.js index eafda32f122e7..0adc854df53c1 100644 --- a/tests/baselines/reference/genericConstraintDeclaration.js +++ b/tests/baselines/reference/genericConstraintDeclaration.js @@ -9,7 +9,7 @@ class List{ //// [genericConstraintDeclaration.js] -var List = (function () { +var List = /** @class */ (function () { function List() { } List.empty = function () { return null; }; diff --git a/tests/baselines/reference/genericConstraintOnExtendedBuiltinTypes.js b/tests/baselines/reference/genericConstraintOnExtendedBuiltinTypes.js index c66279ec8734e..31e93431bbca4 100644 --- a/tests/baselines/reference/genericConstraintOnExtendedBuiltinTypes.js +++ b/tests/baselines/reference/genericConstraintOnExtendedBuiltinTypes.js @@ -41,7 +41,7 @@ var EndGate; (function (EndGate) { var Tweening; (function (Tweening) { - var Tween = (function () { + var Tween = /** @class */ (function () { function Tween(from) { this._from = from.Clone(); } @@ -53,7 +53,7 @@ var EndGate; (function (EndGate) { var Tweening; (function (Tweening) { - var NumberTween = (function (_super) { + var NumberTween = /** @class */ (function (_super) { __extends(NumberTween, _super); function NumberTween(from) { return _super.call(this, from) || this; diff --git a/tests/baselines/reference/genericConstraintOnExtendedBuiltinTypes2.js b/tests/baselines/reference/genericConstraintOnExtendedBuiltinTypes2.js index af5f46c3c57cc..2e24b03d82f61 100644 --- a/tests/baselines/reference/genericConstraintOnExtendedBuiltinTypes2.js +++ b/tests/baselines/reference/genericConstraintOnExtendedBuiltinTypes2.js @@ -40,7 +40,7 @@ var EndGate; (function (EndGate) { var Tweening; (function (Tweening) { - var Tween = (function () { + var Tween = /** @class */ (function () { function Tween(from) { this._from = from.Clone(); } @@ -52,7 +52,7 @@ var EndGate; (function (EndGate) { var Tweening; (function (Tweening) { - var NumberTween = (function (_super) { + var NumberTween = /** @class */ (function (_super) { __extends(NumberTween, _super); function NumberTween(from) { return _super.call(this, from) || this; diff --git a/tests/baselines/reference/genericConstructExpressionWithoutArgs.js b/tests/baselines/reference/genericConstructExpressionWithoutArgs.js index 5eb21728eb163..f0cc7f7d163f1 100644 --- a/tests/baselines/reference/genericConstructExpressionWithoutArgs.js +++ b/tests/baselines/reference/genericConstructExpressionWithoutArgs.js @@ -11,13 +11,13 @@ var c2 = new C // error, type params are actually part of the arg list s //// [genericConstructExpressionWithoutArgs.js] -var B = (function () { +var B = /** @class */ (function () { function B() { } return B; }()); var b = new B; // no error -var C = (function () { +var C = /** @class */ (function () { function C() { } return C; diff --git a/tests/baselines/reference/genericDerivedTypeWithSpecializedBase.js b/tests/baselines/reference/genericDerivedTypeWithSpecializedBase.js index cd028bb28b21d..ee9742c51e345 100644 --- a/tests/baselines/reference/genericDerivedTypeWithSpecializedBase.js +++ b/tests/baselines/reference/genericDerivedTypeWithSpecializedBase.js @@ -23,12 +23,12 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var A = (function () { +var A = /** @class */ (function () { function A() { } return A; }()); -var B = (function (_super) { +var B = /** @class */ (function (_super) { __extends(B, _super); function B() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/genericDerivedTypeWithSpecializedBase2.js b/tests/baselines/reference/genericDerivedTypeWithSpecializedBase2.js index 694bc87c45396..a4ec1f00f2204 100644 --- a/tests/baselines/reference/genericDerivedTypeWithSpecializedBase2.js +++ b/tests/baselines/reference/genericDerivedTypeWithSpecializedBase2.js @@ -23,12 +23,12 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var A = (function () { +var A = /** @class */ (function () { function A() { } return A; }()); -var B = (function (_super) { +var B = /** @class */ (function (_super) { __extends(B, _super); function B() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/genericFunctionsWithOptionalParameters3.js b/tests/baselines/reference/genericFunctionsWithOptionalParameters3.js index 7caa65b971b8b..dc3b205d17688 100644 --- a/tests/baselines/reference/genericFunctionsWithOptionalParameters3.js +++ b/tests/baselines/reference/genericFunctionsWithOptionalParameters3.js @@ -16,7 +16,7 @@ var r5 = utils.mapReduce(c, f1, f2); //// [genericFunctionsWithOptionalParameters3.js] -var Collection = (function () { +var Collection = /** @class */ (function () { function Collection() { } Collection.prototype.add = function (x) { }; diff --git a/tests/baselines/reference/genericGetter.js b/tests/baselines/reference/genericGetter.js index 81e2531f1b9df..6c0e511f01d0a 100644 --- a/tests/baselines/reference/genericGetter.js +++ b/tests/baselines/reference/genericGetter.js @@ -10,7 +10,7 @@ var c = new C(); var r: string = c.x; //// [genericGetter.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } Object.defineProperty(C.prototype, "x", { diff --git a/tests/baselines/reference/genericGetter2.js b/tests/baselines/reference/genericGetter2.js index 022233b78e04d..e1211adf1c589 100644 --- a/tests/baselines/reference/genericGetter2.js +++ b/tests/baselines/reference/genericGetter2.js @@ -9,12 +9,12 @@ class C { } //// [genericGetter2.js] -var A = (function () { +var A = /** @class */ (function () { function A() { } return A; }()); -var C = (function () { +var C = /** @class */ (function () { function C() { } Object.defineProperty(C.prototype, "x", { diff --git a/tests/baselines/reference/genericGetter3.js b/tests/baselines/reference/genericGetter3.js index 93465009378fd..6252d6f3c010c 100644 --- a/tests/baselines/reference/genericGetter3.js +++ b/tests/baselines/reference/genericGetter3.js @@ -12,12 +12,12 @@ var c = new C(); var r: string = c.x; //// [genericGetter3.js] -var A = (function () { +var A = /** @class */ (function () { function A() { } return A; }()); -var C = (function () { +var C = /** @class */ (function () { function C() { } Object.defineProperty(C.prototype, "x", { diff --git a/tests/baselines/reference/genericImplements.js b/tests/baselines/reference/genericImplements.js index 1a67fb29ad817..f38c6b115ede5 100644 --- a/tests/baselines/reference/genericImplements.js +++ b/tests/baselines/reference/genericImplements.js @@ -21,34 +21,34 @@ class Z implements I { } // { f: () => T } //// [genericImplements.js] -var A = (function () { +var A = /** @class */ (function () { function A() { } return A; }()); ; -var B = (function () { +var B = /** @class */ (function () { function B() { } return B; }()); ; // OK -var X = (function () { +var X = /** @class */ (function () { function X() { } X.prototype.f = function () { return undefined; }; return X; }()); // { f: () => { b; } } // OK -var Y = (function () { +var Y = /** @class */ (function () { function Y() { } Y.prototype.f = function () { return undefined; }; return Y; }()); // { f: () => { a; } } // OK -var Z = (function () { +var Z = /** @class */ (function () { function Z() { } Z.prototype.f = function () { return undefined; }; diff --git a/tests/baselines/reference/genericInheritedDefaultConstructors.js b/tests/baselines/reference/genericInheritedDefaultConstructors.js index 15848c1087410..1679322210d86 100644 --- a/tests/baselines/reference/genericInheritedDefaultConstructors.js +++ b/tests/baselines/reference/genericInheritedDefaultConstructors.js @@ -21,12 +21,12 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var A = (function () { +var A = /** @class */ (function () { function A() { } return A; }()); -var B = (function (_super) { +var B = /** @class */ (function (_super) { __extends(B, _super); function B() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/genericInstanceOf.js b/tests/baselines/reference/genericInstanceOf.js index 6d060a75fe196..d93125ae8066b 100644 --- a/tests/baselines/reference/genericInstanceOf.js +++ b/tests/baselines/reference/genericInstanceOf.js @@ -12,7 +12,7 @@ class C { } //// [genericInstanceOf.js] -var C = (function () { +var C = /** @class */ (function () { function C(a, b) { this.a = a; this.b = b; diff --git a/tests/baselines/reference/genericInterfaceImplementation.js b/tests/baselines/reference/genericInterfaceImplementation.js index c68c3e0d22234..7e6cb6c2d0dcc 100644 --- a/tests/baselines/reference/genericInterfaceImplementation.js +++ b/tests/baselines/reference/genericInterfaceImplementation.js @@ -17,7 +17,7 @@ class None implements IOption{ //// [genericInterfaceImplementation.js] -var None = (function () { +var None = /** @class */ (function () { function None() { } None.prototype.get = function () { diff --git a/tests/baselines/reference/genericInterfacesWithoutTypeArguments.js b/tests/baselines/reference/genericInterfacesWithoutTypeArguments.js index e6a2fd65a66e5..e0d33bc972066 100644 --- a/tests/baselines/reference/genericInterfacesWithoutTypeArguments.js +++ b/tests/baselines/reference/genericInterfacesWithoutTypeArguments.js @@ -6,7 +6,7 @@ var c: C; //// [genericInterfacesWithoutTypeArguments.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } return C; diff --git a/tests/baselines/reference/genericMemberFunction.js b/tests/baselines/reference/genericMemberFunction.js index 61a9298eb7f85..5aa7ef5f696dd 100644 --- a/tests/baselines/reference/genericMemberFunction.js +++ b/tests/baselines/reference/genericMemberFunction.js @@ -26,7 +26,7 @@ export class BuildResult{ define(["require", "exports"], function (require, exports) { "use strict"; exports.__esModule = true; - var BuildError = (function () { + var BuildError = /** @class */ (function () { function BuildError() { } BuildError.prototype.parent = function () { @@ -35,7 +35,7 @@ define(["require", "exports"], function (require, exports) { return BuildError; }()); exports.BuildError = BuildError; - var FileWithErrors = (function () { + var FileWithErrors = /** @class */ (function () { function FileWithErrors() { } FileWithErrors.prototype.errors = function () { @@ -47,7 +47,7 @@ define(["require", "exports"], function (require, exports) { return FileWithErrors; }()); exports.FileWithErrors = FileWithErrors; - var BuildResult = (function () { + var BuildResult = /** @class */ (function () { function BuildResult() { } BuildResult.prototype.merge = function (other) { diff --git a/tests/baselines/reference/genericMergedDeclarationUsingTypeParameter2.js b/tests/baselines/reference/genericMergedDeclarationUsingTypeParameter2.js index 11a9c0891ae5a..36637719e19f6 100644 --- a/tests/baselines/reference/genericMergedDeclarationUsingTypeParameter2.js +++ b/tests/baselines/reference/genericMergedDeclarationUsingTypeParameter2.js @@ -7,7 +7,7 @@ module foo { //// [genericMergedDeclarationUsingTypeParameter2.js] -var foo = (function () { +var foo = /** @class */ (function () { function foo(x) { } return foo; diff --git a/tests/baselines/reference/genericObjectCreationWithoutTypeArgs.js b/tests/baselines/reference/genericObjectCreationWithoutTypeArgs.js index bbd621ca09fbf..044591250225f 100644 --- a/tests/baselines/reference/genericObjectCreationWithoutTypeArgs.js +++ b/tests/baselines/reference/genericObjectCreationWithoutTypeArgs.js @@ -10,7 +10,7 @@ var x4 = new SS; // Should be allowed, but currently give error ('supp //// [genericObjectCreationWithoutTypeArgs.js] -var SS = (function () { +var SS = /** @class */ (function () { function SS() { } return SS; diff --git a/tests/baselines/reference/genericObjectLitReturnType.js b/tests/baselines/reference/genericObjectLitReturnType.js index e9b1ba2f60dae..a1d7c778cbddb 100644 --- a/tests/baselines/reference/genericObjectLitReturnType.js +++ b/tests/baselines/reference/genericObjectLitReturnType.js @@ -12,7 +12,7 @@ t1.a = 5; // Should not error: t1 should have type {a: number}, instead has type //// [genericObjectLitReturnType.js] -var X = (function () { +var X = /** @class */ (function () { function X() { } X.prototype.f = function (t) { return { a: t }; }; diff --git a/tests/baselines/reference/genericOfACloduleType1.js b/tests/baselines/reference/genericOfACloduleType1.js index 1c9657ec8f166..84f1a31d83ed1 100644 --- a/tests/baselines/reference/genericOfACloduleType1.js +++ b/tests/baselines/reference/genericOfACloduleType1.js @@ -13,7 +13,7 @@ module M { var g2 = new G() // was: error Type reference cannot refer to container 'M.C'. //// [genericOfACloduleType1.js] -var G = (function () { +var G = /** @class */ (function () { function G() { } G.prototype.bar = function (x) { return x; }; @@ -21,7 +21,7 @@ var G = (function () { }()); var M; (function (M) { - var C = (function () { + var C = /** @class */ (function () { function C() { } C.prototype.foo = function () { }; @@ -29,7 +29,7 @@ var M; }()); M.C = C; (function (C) { - var X = (function () { + var X = /** @class */ (function () { function X() { } return X; diff --git a/tests/baselines/reference/genericOfACloduleType2.js b/tests/baselines/reference/genericOfACloduleType2.js index c96e3f4fa6db4..51607688724fe 100644 --- a/tests/baselines/reference/genericOfACloduleType2.js +++ b/tests/baselines/reference/genericOfACloduleType2.js @@ -16,7 +16,7 @@ module N { } //// [genericOfACloduleType2.js] -var G = (function () { +var G = /** @class */ (function () { function G() { } G.prototype.bar = function (x) { return x; }; @@ -24,7 +24,7 @@ var G = (function () { }()); var M; (function (M) { - var C = (function () { + var C = /** @class */ (function () { function C() { } C.prototype.foo = function () { }; @@ -32,7 +32,7 @@ var M; }()); M.C = C; (function (C) { - var X = (function () { + var X = /** @class */ (function () { function X() { } return X; diff --git a/tests/baselines/reference/genericOverloadSignatures.js b/tests/baselines/reference/genericOverloadSignatures.js index 829ee557e4e29..9a568b7387790 100644 --- a/tests/baselines/reference/genericOverloadSignatures.js +++ b/tests/baselines/reference/genericOverloadSignatures.js @@ -32,7 +32,7 @@ interface D { //// [genericOverloadSignatures.js] function f(a) { } -var C2 = (function () { +var C2 = /** @class */ (function () { function C2() { } return C2; diff --git a/tests/baselines/reference/genericPrototypeProperty.js b/tests/baselines/reference/genericPrototypeProperty.js index 77102b280a19a..963932a0231cb 100644 --- a/tests/baselines/reference/genericPrototypeProperty.js +++ b/tests/baselines/reference/genericPrototypeProperty.js @@ -10,7 +10,7 @@ var r2 = r.x var r3 = r.foo(null); //// [genericPrototypeProperty.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } C.prototype.foo = function (x) { return null; }; diff --git a/tests/baselines/reference/genericPrototypeProperty2.js b/tests/baselines/reference/genericPrototypeProperty2.js index 66f058090dc74..4a01e2ac828a2 100644 --- a/tests/baselines/reference/genericPrototypeProperty2.js +++ b/tests/baselines/reference/genericPrototypeProperty2.js @@ -26,24 +26,24 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var BaseEvent = (function () { +var BaseEvent = /** @class */ (function () { function BaseEvent() { } return BaseEvent; }()); -var MyEvent = (function (_super) { +var MyEvent = /** @class */ (function (_super) { __extends(MyEvent, _super); function MyEvent() { return _super !== null && _super.apply(this, arguments) || this; } return MyEvent; }(BaseEvent)); -var BaseEventWrapper = (function () { +var BaseEventWrapper = /** @class */ (function () { function BaseEventWrapper() { } return BaseEventWrapper; }()); -var MyEventWrapper = (function (_super) { +var MyEventWrapper = /** @class */ (function (_super) { __extends(MyEventWrapper, _super); function MyEventWrapper() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/genericPrototypeProperty3.js b/tests/baselines/reference/genericPrototypeProperty3.js index 1fef7a9b40792..26fa7aa87ae41 100644 --- a/tests/baselines/reference/genericPrototypeProperty3.js +++ b/tests/baselines/reference/genericPrototypeProperty3.js @@ -25,24 +25,24 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var BaseEvent = (function () { +var BaseEvent = /** @class */ (function () { function BaseEvent() { } return BaseEvent; }()); -var MyEvent = (function (_super) { +var MyEvent = /** @class */ (function (_super) { __extends(MyEvent, _super); function MyEvent() { return _super !== null && _super.apply(this, arguments) || this; } return MyEvent; }(BaseEvent)); -var BaseEventWrapper = (function () { +var BaseEventWrapper = /** @class */ (function () { function BaseEventWrapper() { } return BaseEventWrapper; }()); -var MyEventWrapper = (function (_super) { +var MyEventWrapper = /** @class */ (function (_super) { __extends(MyEventWrapper, _super); function MyEventWrapper() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/genericRecursiveImplicitConstructorErrors2.js b/tests/baselines/reference/genericRecursiveImplicitConstructorErrors2.js index 22886334aad31..9838cee07bca9 100644 --- a/tests/baselines/reference/genericRecursiveImplicitConstructorErrors2.js +++ b/tests/baselines/reference/genericRecursiveImplicitConstructorErrors2.js @@ -47,7 +47,7 @@ var TypeScript2; PullSymbolVisibility[PullSymbolVisibility["Private"] = 0] = "Private"; PullSymbolVisibility[PullSymbolVisibility["Public"] = 1] = "Public"; })(PullSymbolVisibility = TypeScript2.PullSymbolVisibility || (TypeScript2.PullSymbolVisibility = {})); - var PullSymbol = (function () { + var PullSymbol = /** @class */ (function () { function PullSymbol(name, declKind) { } // link methods @@ -59,7 +59,7 @@ var TypeScript2; return PullSymbol; }()); TypeScript2.PullSymbol = PullSymbol; - var PullTypeSymbol = (function (_super) { + var PullTypeSymbol = /** @class */ (function (_super) { __extends(PullTypeSymbol, _super); function PullTypeSymbol() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/genericRecursiveImplicitConstructorErrors3.js b/tests/baselines/reference/genericRecursiveImplicitConstructorErrors3.js index d0bf08113d2e3..210a118fd6b59 100644 --- a/tests/baselines/reference/genericRecursiveImplicitConstructorErrors3.js +++ b/tests/baselines/reference/genericRecursiveImplicitConstructorErrors3.js @@ -43,7 +43,7 @@ var __extends = (this && this.__extends) || (function () { })(); var TypeScript; (function (TypeScript) { - var MemberName = (function () { + var MemberName = /** @class */ (function () { function MemberName() { } MemberName.create = function (arg1, arg2, arg3) { @@ -53,14 +53,14 @@ var TypeScript; TypeScript.MemberName = MemberName; })(TypeScript || (TypeScript = {})); (function (TypeScript) { - var PullSymbol = (function () { + var PullSymbol = /** @class */ (function () { function PullSymbol() { this.type = null; } return PullSymbol; }()); TypeScript.PullSymbol = PullSymbol; - var PullTypeSymbol = (function (_super) { + var PullTypeSymbol = /** @class */ (function (_super) { __extends(PullTypeSymbol, _super); function PullTypeSymbol() { var _this = _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/genericReturnTypeFromGetter1.js b/tests/baselines/reference/genericReturnTypeFromGetter1.js index 728d81dd147bc..f193c6ca05f98 100644 --- a/tests/baselines/reference/genericReturnTypeFromGetter1.js +++ b/tests/baselines/reference/genericReturnTypeFromGetter1.js @@ -12,7 +12,7 @@ export class DbSet { define(["require", "exports"], function (require, exports) { "use strict"; exports.__esModule = true; - var DbSet = (function () { + var DbSet = /** @class */ (function () { function DbSet() { } Object.defineProperty(DbSet.prototype, "entityType", { diff --git a/tests/baselines/reference/genericReversingTypeParameters.js b/tests/baselines/reference/genericReversingTypeParameters.js index 33f598a1642db..42bd7b69d17b9 100644 --- a/tests/baselines/reference/genericReversingTypeParameters.js +++ b/tests/baselines/reference/genericReversingTypeParameters.js @@ -11,7 +11,7 @@ var i = b.inverse(); // used to get the type wrong here. var r2b = i.get(1); //// [genericReversingTypeParameters.js] -var BiMap = (function () { +var BiMap = /** @class */ (function () { function BiMap() { } BiMap.prototype.get = function (key) { return null; }; diff --git a/tests/baselines/reference/genericReversingTypeParameters2.js b/tests/baselines/reference/genericReversingTypeParameters2.js index 40102d790d91b..5890a75ada8ce 100644 --- a/tests/baselines/reference/genericReversingTypeParameters2.js +++ b/tests/baselines/reference/genericReversingTypeParameters2.js @@ -10,7 +10,7 @@ var i = b.inverse(); // used to get the type wrong here. var r2b = i.get(1); //// [genericReversingTypeParameters2.js] -var BiMap = (function () { +var BiMap = /** @class */ (function () { function BiMap() { } BiMap.prototype.get = function (key) { return null; }; diff --git a/tests/baselines/reference/genericSpecializations1.js b/tests/baselines/reference/genericSpecializations1.js index 2aabf708a6f19..a5891ea03236e 100644 --- a/tests/baselines/reference/genericSpecializations1.js +++ b/tests/baselines/reference/genericSpecializations1.js @@ -16,19 +16,19 @@ class StringFoo3 implements IFoo { } //// [genericSpecializations1.js] -var IntFooBad = (function () { +var IntFooBad = /** @class */ (function () { function IntFooBad() { } IntFooBad.prototype.foo = function (x) { return null; }; return IntFooBad; }()); -var StringFoo2 = (function () { +var StringFoo2 = /** @class */ (function () { function StringFoo2() { } StringFoo2.prototype.foo = function (x) { return null; }; return StringFoo2; }()); -var StringFoo3 = (function () { +var StringFoo3 = /** @class */ (function () { function StringFoo3() { } StringFoo3.prototype.foo = function (x) { return null; }; diff --git a/tests/baselines/reference/genericSpecializations2.js b/tests/baselines/reference/genericSpecializations2.js index 6975575ec5ecc..e7e787c6b0ff5 100644 --- a/tests/baselines/reference/genericSpecializations2.js +++ b/tests/baselines/reference/genericSpecializations2.js @@ -20,7 +20,7 @@ class StringFoo3 implements IFoo { //// [genericSpecializations2.js] -var IFoo = (function () { +var IFoo = /** @class */ (function () { function IFoo() { } IFoo.prototype.foo = function (x) { @@ -28,19 +28,19 @@ var IFoo = (function () { }; return IFoo; }()); -var IntFooBad = (function () { +var IntFooBad = /** @class */ (function () { function IntFooBad() { } IntFooBad.prototype.foo = function (x) { return null; }; return IntFooBad; }()); -var StringFoo2 = (function () { +var StringFoo2 = /** @class */ (function () { function StringFoo2() { } StringFoo2.prototype.foo = function (x) { return null; }; return StringFoo2; }()); -var StringFoo3 = (function () { +var StringFoo3 = /** @class */ (function () { function StringFoo3() { } StringFoo3.prototype.foo = function (x) { return null; }; diff --git a/tests/baselines/reference/genericSpecializations3.js b/tests/baselines/reference/genericSpecializations3.js index 03d07b6dff990..4913484cb9e06 100644 --- a/tests/baselines/reference/genericSpecializations3.js +++ b/tests/baselines/reference/genericSpecializations3.js @@ -38,21 +38,21 @@ var stringFoo3: StringFoo3; //// [genericSpecializations3.js] var iFoo; iFoo.foo(1); -var IntFooBad = (function () { +var IntFooBad = /** @class */ (function () { function IntFooBad() { } IntFooBad.prototype.foo = function (x) { return null; }; return IntFooBad; }()); var intFooBad; -var IntFoo = (function () { +var IntFoo = /** @class */ (function () { function IntFoo() { } IntFoo.prototype.foo = function (x) { return null; }; return IntFoo; }()); var intFoo; -var StringFoo2 = (function () { +var StringFoo2 = /** @class */ (function () { function StringFoo2() { } StringFoo2.prototype.foo = function (x) { return null; }; @@ -62,7 +62,7 @@ var stringFoo2; stringFoo2.foo("hm"); intFoo = stringFoo2; // error stringFoo2 = intFoo; // error -var StringFoo3 = (function () { +var StringFoo3 = /** @class */ (function () { function StringFoo3() { } StringFoo3.prototype.foo = function (x) { return null; }; diff --git a/tests/baselines/reference/genericStaticAnyTypeFunction.js b/tests/baselines/reference/genericStaticAnyTypeFunction.js index 7ed9494d3cf4c..fc368fc433124 100644 --- a/tests/baselines/reference/genericStaticAnyTypeFunction.js +++ b/tests/baselines/reference/genericStaticAnyTypeFunction.js @@ -19,7 +19,7 @@ class A { //// [genericStaticAnyTypeFunction.js] -var A = (function () { +var A = /** @class */ (function () { function A() { } A.one = function (source, value) { diff --git a/tests/baselines/reference/genericTypeAssertions1.js b/tests/baselines/reference/genericTypeAssertions1.js index 904e696af489e..ac80c0c795e9c 100644 --- a/tests/baselines/reference/genericTypeAssertions1.js +++ b/tests/baselines/reference/genericTypeAssertions1.js @@ -5,7 +5,7 @@ var r: A = >new A(); // error var r2: A = >>foo; // error //// [genericTypeAssertions1.js] -var A = (function () { +var A = /** @class */ (function () { function A() { } A.prototype.foo = function (x) { }; diff --git a/tests/baselines/reference/genericTypeAssertions2.js b/tests/baselines/reference/genericTypeAssertions2.js index 160967e83deb7..6e12260fd2e33 100644 --- a/tests/baselines/reference/genericTypeAssertions2.js +++ b/tests/baselines/reference/genericTypeAssertions2.js @@ -24,13 +24,13 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var A = (function () { +var A = /** @class */ (function () { function A() { } A.prototype.foo = function (x) { }; return A; }()); -var B = (function (_super) { +var B = /** @class */ (function (_super) { __extends(B, _super); function B() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/genericTypeAssertions4.js b/tests/baselines/reference/genericTypeAssertions4.js index 991db3822acc1..5f7950d0944d2 100644 --- a/tests/baselines/reference/genericTypeAssertions4.js +++ b/tests/baselines/reference/genericTypeAssertions4.js @@ -36,13 +36,13 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var A = (function () { +var A = /** @class */ (function () { function A() { } A.prototype.foo = function () { return ""; }; return A; }()); -var B = (function (_super) { +var B = /** @class */ (function (_super) { __extends(B, _super); function B() { return _super !== null && _super.apply(this, arguments) || this; @@ -50,7 +50,7 @@ var B = (function (_super) { B.prototype.bar = function () { return 1; }; return B; }(A)); -var C = (function (_super) { +var C = /** @class */ (function (_super) { __extends(C, _super); function C() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/genericTypeAssertions6.js b/tests/baselines/reference/genericTypeAssertions6.js index 069e567ab1083..f6db5148ea1be 100644 --- a/tests/baselines/reference/genericTypeAssertions6.js +++ b/tests/baselines/reference/genericTypeAssertions6.js @@ -35,7 +35,7 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var A = (function () { +var A = /** @class */ (function () { function A(x) { var y = x; var z = x; @@ -46,7 +46,7 @@ var A = (function () { }; return A; }()); -var B = (function (_super) { +var B = /** @class */ (function (_super) { __extends(B, _super); function B() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/genericTypeConstraints.js b/tests/baselines/reference/genericTypeConstraints.js index cbb03b683a82a..e5abc9736ec17 100644 --- a/tests/baselines/reference/genericTypeConstraints.js +++ b/tests/baselines/reference/genericTypeConstraints.js @@ -24,23 +24,23 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var Foo = (function () { +var Foo = /** @class */ (function () { function Foo() { } Foo.prototype.fooMethod = function () { }; return Foo; }()); -var FooExtended = (function () { +var FooExtended = /** @class */ (function () { function FooExtended() { } return FooExtended; }()); -var Bar = (function () { +var Bar = /** @class */ (function () { function Bar() { } return Bar; }()); -var BarExtended = (function (_super) { +var BarExtended = /** @class */ (function (_super) { __extends(BarExtended, _super); function BarExtended() { return _super.call(this) || this; diff --git a/tests/baselines/reference/genericTypeReferenceWithoutTypeArgument.js b/tests/baselines/reference/genericTypeReferenceWithoutTypeArgument.js index 8fc00dcc08f78..28c676ba754d4 100644 --- a/tests/baselines/reference/genericTypeReferenceWithoutTypeArgument.js +++ b/tests/baselines/reference/genericTypeReferenceWithoutTypeArgument.js @@ -50,7 +50,7 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var C = (function () { +var C = /** @class */ (function () { function C() { } return C; @@ -62,7 +62,7 @@ var d; var e = function (x) { var y; return y; }; function f(x) { var y; return y; } var g = function f(x) { var y; return y; }; -var D = (function (_super) { +var D = /** @class */ (function (_super) { __extends(D, _super); function D() { return _super !== null && _super.apply(this, arguments) || this; @@ -71,21 +71,21 @@ var D = (function (_super) { }(C)); var M; (function (M) { - var E = (function () { + var E = /** @class */ (function () { function E() { } return E; }()); M.E = E; })(M || (M = {})); -var D2 = (function (_super) { +var D2 = /** @class */ (function (_super) { __extends(D2, _super); function D2() { return _super !== null && _super.apply(this, arguments) || this; } return D2; }(M.E)); -var D3 = (function () { +var D3 = /** @class */ (function () { function D3() { } return D3; diff --git a/tests/baselines/reference/genericTypeReferenceWithoutTypeArgument2.js b/tests/baselines/reference/genericTypeReferenceWithoutTypeArgument2.js index 9730afdee04d8..05f73caa41437 100644 --- a/tests/baselines/reference/genericTypeReferenceWithoutTypeArgument2.js +++ b/tests/baselines/reference/genericTypeReferenceWithoutTypeArgument2.js @@ -57,14 +57,14 @@ var d; var e = function (x) { var y; return y; }; function f(x) { var y; return y; } var g = function f(x) { var y; return y; }; -var D = (function (_super) { +var D = /** @class */ (function (_super) { __extends(D, _super); function D() { return _super !== null && _super.apply(this, arguments) || this; } return D; }(I)); -var D2 = (function (_super) { +var D2 = /** @class */ (function (_super) { __extends(D2, _super); function D2() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/genericTypeReferencesRequireTypeArgs.js b/tests/baselines/reference/genericTypeReferencesRequireTypeArgs.js index 8e8060194b028..30497a8737f9c 100644 --- a/tests/baselines/reference/genericTypeReferencesRequireTypeArgs.js +++ b/tests/baselines/reference/genericTypeReferencesRequireTypeArgs.js @@ -12,7 +12,7 @@ var i2: I; // should be an error //// [genericTypeReferencesRequireTypeArgs.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } C.prototype.foo = function () { return null; }; diff --git a/tests/baselines/reference/genericTypeUsedWithoutTypeArguments1.js b/tests/baselines/reference/genericTypeUsedWithoutTypeArguments1.js index 765d9733727b7..c6914bedd01af 100644 --- a/tests/baselines/reference/genericTypeUsedWithoutTypeArguments1.js +++ b/tests/baselines/reference/genericTypeUsedWithoutTypeArguments1.js @@ -4,7 +4,7 @@ class Bar implements Foo { } //// [genericTypeUsedWithoutTypeArguments1.js] -var Bar = (function () { +var Bar = /** @class */ (function () { function Bar() { } return Bar; diff --git a/tests/baselines/reference/genericTypeWithCallableMembers.js b/tests/baselines/reference/genericTypeWithCallableMembers.js index c1a28b384bb9e..a2ae2c46fb4a2 100644 --- a/tests/baselines/reference/genericTypeWithCallableMembers.js +++ b/tests/baselines/reference/genericTypeWithCallableMembers.js @@ -13,7 +13,7 @@ class C { //// [genericTypeWithCallableMembers.js] -var C = (function () { +var C = /** @class */ (function () { function C(data, data2) { this.data = data; this.data2 = data2; diff --git a/tests/baselines/reference/genericTypeWithNonGenericBaseMisMatch.js b/tests/baselines/reference/genericTypeWithNonGenericBaseMisMatch.js index 3c3577b853ea9..00bca80ae104c 100644 --- a/tests/baselines/reference/genericTypeWithNonGenericBaseMisMatch.js +++ b/tests/baselines/reference/genericTypeWithNonGenericBaseMisMatch.js @@ -10,7 +10,7 @@ var i: I = x; // Should not be allowed -- type of 'f' is incompatible with 'I' //// [genericTypeWithNonGenericBaseMisMatch.js] -var X = (function () { +var X = /** @class */ (function () { function X() { } X.prototype.f = function (a) { }; diff --git a/tests/baselines/reference/genericWithCallSignatures1.js b/tests/baselines/reference/genericWithCallSignatures1.js index 95145470ac3a1..cd44e9444a412 100644 --- a/tests/baselines/reference/genericWithCallSignatures1.js +++ b/tests/baselines/reference/genericWithCallSignatures1.js @@ -21,7 +21,7 @@ class MyClass { //// [genericWithCallSignatures_0.js] //// [genericWithCallSignatures_1.js] /// -var MyClass = (function () { +var MyClass = /** @class */ (function () { function MyClass() { } MyClass.prototype.myMethod = function () { diff --git a/tests/baselines/reference/genericWithIndexerOfTypeParameterType1.js b/tests/baselines/reference/genericWithIndexerOfTypeParameterType1.js index b7c0ca2a0db60..1921f1333222d 100644 --- a/tests/baselines/reference/genericWithIndexerOfTypeParameterType1.js +++ b/tests/baselines/reference/genericWithIndexerOfTypeParameterType1.js @@ -9,7 +9,7 @@ var lazyArray = new LazyArray(); var value: string = lazyArray.array()["test"]; // used to be an error //// [genericWithIndexerOfTypeParameterType1.js] -var LazyArray = (function () { +var LazyArray = /** @class */ (function () { function LazyArray() { this.objects = {}; } diff --git a/tests/baselines/reference/genericWithIndexerOfTypeParameterType2.js b/tests/baselines/reference/genericWithIndexerOfTypeParameterType2.js index 3f5e3dcfe8e6e..aeb3634e34a33 100644 --- a/tests/baselines/reference/genericWithIndexerOfTypeParameterType2.js +++ b/tests/baselines/reference/genericWithIndexerOfTypeParameterType2.js @@ -28,13 +28,13 @@ var __extends = (this && this.__extends) || (function () { define(["require", "exports"], function (require, exports) { "use strict"; exports.__esModule = true; - var Collection = (function () { + var Collection = /** @class */ (function () { function Collection() { } return Collection; }()); exports.Collection = Collection; - var List = (function (_super) { + var List = /** @class */ (function (_super) { __extends(List, _super); function List() { return _super !== null && _super.apply(this, arguments) || this; @@ -43,13 +43,13 @@ define(["require", "exports"], function (require, exports) { return List; }(Collection)); exports.List = List; - var CollectionItem = (function () { + var CollectionItem = /** @class */ (function () { function CollectionItem() { } return CollectionItem; }()); exports.CollectionItem = CollectionItem; - var ListItem = (function (_super) { + var ListItem = /** @class */ (function (_super) { __extends(ListItem, _super); function ListItem() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/genericWithOpenTypeParameters1.js b/tests/baselines/reference/genericWithOpenTypeParameters1.js index 90ea23e43ef2e..fad1609d4d862 100644 --- a/tests/baselines/reference/genericWithOpenTypeParameters1.js +++ b/tests/baselines/reference/genericWithOpenTypeParameters1.js @@ -12,7 +12,7 @@ var f4 = (x: B) => { return x.foo(1); } // no error //// [genericWithOpenTypeParameters1.js] -var B = (function () { +var B = /** @class */ (function () { function B() { } B.prototype.foo = function (x) { return null; }; diff --git a/tests/baselines/reference/generics3.js b/tests/baselines/reference/generics3.js index 8c68384dd68a5..873ede480d513 100644 --- a/tests/baselines/reference/generics3.js +++ b/tests/baselines/reference/generics3.js @@ -8,7 +8,7 @@ var b: C; a = b; // Ok - should be identical //// [generics3.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } return C; diff --git a/tests/baselines/reference/generics4.js b/tests/baselines/reference/generics4.js index 42b64224eb2e8..118b88d58deb0 100644 --- a/tests/baselines/reference/generics4.js +++ b/tests/baselines/reference/generics4.js @@ -8,7 +8,7 @@ var b: C; a = b; // Not ok - return types of "f" are different //// [generics4.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } return C; diff --git a/tests/baselines/reference/generics4NoError.js b/tests/baselines/reference/generics4NoError.js index b247a24b633dd..b46b89e518719 100644 --- a/tests/baselines/reference/generics4NoError.js +++ b/tests/baselines/reference/generics4NoError.js @@ -7,7 +7,7 @@ var b: C; //// [generics4NoError.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } return C; diff --git a/tests/baselines/reference/genericsWithDuplicateTypeParameters1.js b/tests/baselines/reference/genericsWithDuplicateTypeParameters1.js index 43e933cd0fc72..cbe7e7de20762 100644 --- a/tests/baselines/reference/genericsWithDuplicateTypeParameters1.js +++ b/tests/baselines/reference/genericsWithDuplicateTypeParameters1.js @@ -19,7 +19,7 @@ var m = { //// [genericsWithDuplicateTypeParameters1.js] function f() { } function f2(a, b) { return null; } -var C = (function () { +var C = /** @class */ (function () { function C() { } C.prototype.f = function () { }; diff --git a/tests/baselines/reference/genericsWithoutTypeParameters1.js b/tests/baselines/reference/genericsWithoutTypeParameters1.js index 443dd72da2334..8ef64808d6540 100644 --- a/tests/baselines/reference/genericsWithoutTypeParameters1.js +++ b/tests/baselines/reference/genericsWithoutTypeParameters1.js @@ -34,7 +34,7 @@ function f(x: T): A { } //// [genericsWithoutTypeParameters1.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } C.prototype.foo = function () { return null; }; @@ -48,12 +48,12 @@ function foo(x, y) { } function foo2(x, y) { } var x = { a: new C() }; var x2 = { a: { bar: function () { return 1; } } }; -var D = (function () { +var D = /** @class */ (function () { function D() { } return D; }()); -var A = (function () { +var A = /** @class */ (function () { function A() { } return A; diff --git a/tests/baselines/reference/getAccessorWithImpliedReturnTypeAndFunctionClassMerge.js b/tests/baselines/reference/getAccessorWithImpliedReturnTypeAndFunctionClassMerge.js index 8b41cafa5b17a..bc4a40dfecdff 100644 --- a/tests/baselines/reference/getAccessorWithImpliedReturnTypeAndFunctionClassMerge.js +++ b/tests/baselines/reference/getAccessorWithImpliedReturnTypeAndFunctionClassMerge.js @@ -30,7 +30,7 @@ module MyModule { //// [getAccessorWithImpliedReturnTypeAndFunctionClassMerge.js] var MyModule; (function (MyModule) { - var MyClass = (function () { + var MyClass = /** @class */ (function () { function MyClass() { } Object.defineProperty(MyClass.prototype, "myGetter", { diff --git a/tests/baselines/reference/getAndSetAsMemberNames.js b/tests/baselines/reference/getAndSetAsMemberNames.js index 0b0d8ff7e0131..1433e3cd3a8b0 100644 --- a/tests/baselines/reference/getAndSetAsMemberNames.js +++ b/tests/baselines/reference/getAndSetAsMemberNames.js @@ -22,18 +22,18 @@ class C5 { //// [getAndSetAsMemberNames.js] -var C1 = (function () { +var C1 = /** @class */ (function () { function C1() { this.get = 1; } return C1; }()); -var C2 = (function () { +var C2 = /** @class */ (function () { function C2() { } return C2; }()); -var C3 = (function () { +var C3 = /** @class */ (function () { function C3() { } C3.prototype.set = function (x) { @@ -41,13 +41,13 @@ var C3 = (function () { }; return C3; }()); -var C4 = (function () { +var C4 = /** @class */ (function () { function C4() { this.get = true; } return C4; }()); -var C5 = (function () { +var C5 = /** @class */ (function () { function C5() { this.set = function () { return true; }; } diff --git a/tests/baselines/reference/getAndSetNotIdenticalType.js b/tests/baselines/reference/getAndSetNotIdenticalType.js index cf2cd75828b06..edebef235b8fd 100644 --- a/tests/baselines/reference/getAndSetNotIdenticalType.js +++ b/tests/baselines/reference/getAndSetNotIdenticalType.js @@ -7,7 +7,7 @@ class C { } //// [getAndSetNotIdenticalType.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } Object.defineProperty(C.prototype, "x", { diff --git a/tests/baselines/reference/getAndSetNotIdenticalType2.js b/tests/baselines/reference/getAndSetNotIdenticalType2.js index 82f4c55332960..af729eb7d7aee 100644 --- a/tests/baselines/reference/getAndSetNotIdenticalType2.js +++ b/tests/baselines/reference/getAndSetNotIdenticalType2.js @@ -16,12 +16,12 @@ var r = x.x; x.x = r; //// [getAndSetNotIdenticalType2.js] -var A = (function () { +var A = /** @class */ (function () { function A() { } return A; }()); -var C = (function () { +var C = /** @class */ (function () { function C() { } Object.defineProperty(C.prototype, "x", { diff --git a/tests/baselines/reference/getAndSetNotIdenticalType3.js b/tests/baselines/reference/getAndSetNotIdenticalType3.js index 2841c4d6d8a00..ff2d04ef1509f 100644 --- a/tests/baselines/reference/getAndSetNotIdenticalType3.js +++ b/tests/baselines/reference/getAndSetNotIdenticalType3.js @@ -16,12 +16,12 @@ var r = x.x; x.x = r; //// [getAndSetNotIdenticalType3.js] -var A = (function () { +var A = /** @class */ (function () { function A() { } return A; }()); -var C = (function () { +var C = /** @class */ (function () { function C() { } Object.defineProperty(C.prototype, "x", { diff --git a/tests/baselines/reference/getEmitOutput-pp.baseline b/tests/baselines/reference/getEmitOutput-pp.baseline index 683b454a2752d..82243870b2940 100644 --- a/tests/baselines/reference/getEmitOutput-pp.baseline +++ b/tests/baselines/reference/getEmitOutput-pp.baseline @@ -1,7 +1,7 @@ EmitSkipped: false FileName : /tests/cases/fourslash/shims-pp/inputFile1.js var x = 5; -var Bar = (function () { +var Bar = /** @class */ (function () { function Bar() { } return Bar; @@ -16,7 +16,7 @@ declare class Bar { EmitSkipped: false FileName : /tests/cases/fourslash/shims-pp/inputFile2.js var x1 = "hello world"; -var Foo = (function () { +var Foo = /** @class */ (function () { function Foo() { } return Foo; diff --git a/tests/baselines/reference/getEmitOutput.baseline b/tests/baselines/reference/getEmitOutput.baseline index 8251850e1bb09..9fa32d4dfe89a 100644 --- a/tests/baselines/reference/getEmitOutput.baseline +++ b/tests/baselines/reference/getEmitOutput.baseline @@ -1,7 +1,7 @@ EmitSkipped: false FileName : /tests/cases/fourslash/shims/inputFile1.js var x = 5; -var Bar = (function () { +var Bar = /** @class */ (function () { function Bar() { } return Bar; @@ -16,7 +16,7 @@ declare class Bar { EmitSkipped: false FileName : /tests/cases/fourslash/shims/inputFile2.js var x1 = "hello world"; -var Foo = (function () { +var Foo = /** @class */ (function () { function Foo() { } return Foo; diff --git a/tests/baselines/reference/getEmitOutputDeclarationMultiFiles.baseline b/tests/baselines/reference/getEmitOutputDeclarationMultiFiles.baseline index 56eb932fb5da7..ac2d4850bb426 100644 --- a/tests/baselines/reference/getEmitOutputDeclarationMultiFiles.baseline +++ b/tests/baselines/reference/getEmitOutputDeclarationMultiFiles.baseline @@ -1,7 +1,7 @@ EmitSkipped: false FileName : /tests/cases/fourslash/inputFile1.js var x = 5; -var Bar = (function () { +var Bar = /** @class */ (function () { function Bar() { } return Bar; @@ -16,7 +16,7 @@ declare class Bar { EmitSkipped: false FileName : /tests/cases/fourslash/inputFile2.js var x1 = "hello world"; -var Foo = (function () { +var Foo = /** @class */ (function () { function Foo() { } return Foo; diff --git a/tests/baselines/reference/getEmitOutputDeclarationSingleFile.baseline b/tests/baselines/reference/getEmitOutputDeclarationSingleFile.baseline index a756897fffb5e..18e8920ba72ee 100644 --- a/tests/baselines/reference/getEmitOutputDeclarationSingleFile.baseline +++ b/tests/baselines/reference/getEmitOutputDeclarationSingleFile.baseline @@ -1,13 +1,13 @@ EmitSkipped: false FileName : declSingleFile.js var x = 5; -var Bar = (function () { +var Bar = /** @class */ (function () { function Bar() { } return Bar; }()); var x1 = "hello world"; -var Foo = (function () { +var Foo = /** @class */ (function () { function Foo() { } return Foo; diff --git a/tests/baselines/reference/getEmitOutputExternalModule.baseline b/tests/baselines/reference/getEmitOutputExternalModule.baseline index 1b18ace6ab61d..bd4162854f870 100644 --- a/tests/baselines/reference/getEmitOutputExternalModule.baseline +++ b/tests/baselines/reference/getEmitOutputExternalModule.baseline @@ -1,7 +1,7 @@ EmitSkipped: false FileName : declSingleFile.js var x = 5; -var Bar = (function () { +var Bar = /** @class */ (function () { function Bar() { } return Bar; diff --git a/tests/baselines/reference/getEmitOutputExternalModule2.baseline b/tests/baselines/reference/getEmitOutputExternalModule2.baseline index 0b6c4a9b1ff30..3aff8629acf4e 100644 --- a/tests/baselines/reference/getEmitOutputExternalModule2.baseline +++ b/tests/baselines/reference/getEmitOutputExternalModule2.baseline @@ -1,13 +1,13 @@ EmitSkipped: false FileName : declSingleFile.js var x = 5; -var Bar = (function () { +var Bar = /** @class */ (function () { function Bar() { } return Bar; }()); var x = "world"; -var Bar2 = (function () { +var Bar2 = /** @class */ (function () { function Bar2() { } return Bar2; diff --git a/tests/baselines/reference/getEmitOutputMapRoots.baseline b/tests/baselines/reference/getEmitOutputMapRoots.baseline index 3b8792e3777aa..4b4a9b0395bd7 100644 --- a/tests/baselines/reference/getEmitOutputMapRoots.baseline +++ b/tests/baselines/reference/getEmitOutputMapRoots.baseline @@ -3,7 +3,7 @@ FileName : declSingleFile.js.map {"version":3,"file":"declSingleFile.js","sourceRoot":"","sources":["../inputFile.ts"],"names":[],"mappings":"AAAA,IAAI,CAAC,GAAG,GAAG,CAAC;AACZ,IAAI,GAAG,GAAG,aAAa,CAAC;AACxB;IAAA;IAGA,CAAC;IAAD,QAAC;AAAD,CAAC,AAHD,IAGC"}FileName : declSingleFile.js var x = 109; var foo = "hello world"; -var M = (function () { +var M = /** @class */ (function () { function M() { } return M; diff --git a/tests/baselines/reference/getEmitOutputNoErrors.baseline b/tests/baselines/reference/getEmitOutputNoErrors.baseline index 6469ab3d1a756..8cf9b0f143d93 100644 --- a/tests/baselines/reference/getEmitOutputNoErrors.baseline +++ b/tests/baselines/reference/getEmitOutputNoErrors.baseline @@ -1,7 +1,7 @@ EmitSkipped: false FileName : /tests/cases/fourslash/inputFile.js var x; -var M = (function () { +var M = /** @class */ (function () { function M() { } return M; diff --git a/tests/baselines/reference/getEmitOutputOnlyOneFile.baseline b/tests/baselines/reference/getEmitOutputOnlyOneFile.baseline index dbcfe28afaa03..b913e00e7984d 100644 --- a/tests/baselines/reference/getEmitOutputOnlyOneFile.baseline +++ b/tests/baselines/reference/getEmitOutputOnlyOneFile.baseline @@ -1,7 +1,7 @@ EmitSkipped: false FileName : /tests/cases/fourslash/inputFile2.js var x; -var Foo = (function () { +var Foo = /** @class */ (function () { function Foo() { } return Foo; diff --git a/tests/baselines/reference/getEmitOutputOutFile.baseline b/tests/baselines/reference/getEmitOutputOutFile.baseline index 0b5e93271e4d8..c683d963f0e4d 100644 --- a/tests/baselines/reference/getEmitOutputOutFile.baseline +++ b/tests/baselines/reference/getEmitOutputOutFile.baseline @@ -1,13 +1,13 @@ EmitSkipped: false FileName : outFile.js var x = 5; -var Bar = (function () { +var Bar = /** @class */ (function () { function Bar() { } return Bar; }()); var x1 = "hello world"; -var Foo = (function () { +var Foo = /** @class */ (function () { function Foo() { } return Foo; diff --git a/tests/baselines/reference/getEmitOutputSingleFile.baseline b/tests/baselines/reference/getEmitOutputSingleFile.baseline index 922f3ab879024..fd370667bc529 100644 --- a/tests/baselines/reference/getEmitOutputSingleFile.baseline +++ b/tests/baselines/reference/getEmitOutputSingleFile.baseline @@ -1,13 +1,13 @@ EmitSkipped: false FileName : outputDir/singleFile.js var x; -var Bar = (function () { +var Bar = /** @class */ (function () { function Bar() { } return Bar; }()); var x; -var Foo = (function () { +var Foo = /** @class */ (function () { function Foo() { } return Foo; diff --git a/tests/baselines/reference/getEmitOutputSingleFile2.baseline b/tests/baselines/reference/getEmitOutputSingleFile2.baseline index a756897fffb5e..18e8920ba72ee 100644 --- a/tests/baselines/reference/getEmitOutputSingleFile2.baseline +++ b/tests/baselines/reference/getEmitOutputSingleFile2.baseline @@ -1,13 +1,13 @@ EmitSkipped: false FileName : declSingleFile.js var x = 5; -var Bar = (function () { +var Bar = /** @class */ (function () { function Bar() { } return Bar; }()); var x1 = "hello world"; -var Foo = (function () { +var Foo = /** @class */ (function () { function Foo() { } return Foo; diff --git a/tests/baselines/reference/getEmitOutputSourceMap.baseline b/tests/baselines/reference/getEmitOutputSourceMap.baseline index 25667b8b70169..e1e65087e6d49 100644 --- a/tests/baselines/reference/getEmitOutputSourceMap.baseline +++ b/tests/baselines/reference/getEmitOutputSourceMap.baseline @@ -3,7 +3,7 @@ FileName : /tests/cases/fourslash/inputFile.js.map {"version":3,"file":"inputFile.js","sourceRoot":"","sources":["inputFile.ts"],"names":[],"mappings":"AAAA,IAAI,CAAC,GAAG,GAAG,CAAC;AACZ,IAAI,GAAG,GAAG,aAAa,CAAC;AACxB;IAAA;IAGA,CAAC;IAAD,QAAC;AAAD,CAAC,AAHD,IAGC"}FileName : /tests/cases/fourslash/inputFile.js var x = 109; var foo = "hello world"; -var M = (function () { +var M = /** @class */ (function () { function M() { } return M; diff --git a/tests/baselines/reference/getEmitOutputSourceMap2.baseline b/tests/baselines/reference/getEmitOutputSourceMap2.baseline index 33c23a7ee48ce..35fdb2b83294e 100644 --- a/tests/baselines/reference/getEmitOutputSourceMap2.baseline +++ b/tests/baselines/reference/getEmitOutputSourceMap2.baseline @@ -3,7 +3,7 @@ FileName : sample/outDir/inputFile1.js.map {"version":3,"file":"inputFile1.js","sourceRoot":"","sources":["../../tests/cases/fourslash/inputFile1.ts"],"names":[],"mappings":"AAAA,IAAI,CAAC,GAAG,GAAG,CAAC;AACZ,IAAI,GAAG,GAAG,aAAa,CAAC;AACxB;IAAA;IAGA,CAAC;IAAD,QAAC;AAAD,CAAC,AAHD,IAGC"}FileName : sample/outDir/inputFile1.js var x = 109; var foo = "hello world"; -var M = (function () { +var M = /** @class */ (function () { function M() { } return M; diff --git a/tests/baselines/reference/getEmitOutputSourceRoot.baseline b/tests/baselines/reference/getEmitOutputSourceRoot.baseline index 5881a61f22af7..ddd6568b70439 100644 --- a/tests/baselines/reference/getEmitOutputSourceRoot.baseline +++ b/tests/baselines/reference/getEmitOutputSourceRoot.baseline @@ -3,7 +3,7 @@ FileName : /tests/cases/fourslash/inputFile.js.map {"version":3,"file":"inputFile.js","sourceRoot":"sourceRootDir/","sources":["inputFile.ts"],"names":[],"mappings":"AAAA,IAAI,CAAC,GAAG,GAAG,CAAC;AACZ,IAAI,GAAG,GAAG,aAAa,CAAC;AACxB;IAAA;IAGA,CAAC;IAAD,QAAC;AAAD,CAAC,AAHD,IAGC"}FileName : /tests/cases/fourslash/inputFile.js var x = 109; var foo = "hello world"; -var M = (function () { +var M = /** @class */ (function () { function M() { } return M; diff --git a/tests/baselines/reference/getEmitOutputSourceRootMultiFiles.baseline b/tests/baselines/reference/getEmitOutputSourceRootMultiFiles.baseline index 62e3f2eb7e5e9..f6d9cb184e64a 100644 --- a/tests/baselines/reference/getEmitOutputSourceRootMultiFiles.baseline +++ b/tests/baselines/reference/getEmitOutputSourceRootMultiFiles.baseline @@ -3,7 +3,7 @@ FileName : /tests/cases/fourslash/inputFile1.js.map {"version":3,"file":"inputFile1.js","sourceRoot":"sourceRootDir/","sources":["inputFile1.ts"],"names":[],"mappings":"AAAA,IAAI,CAAC,GAAG,GAAG,CAAC;AACZ,IAAI,GAAG,GAAG,aAAa,CAAC;AACxB;IAAA;IAGA,CAAC;IAAD,QAAC;AAAD,CAAC,AAHD,IAGC"}FileName : /tests/cases/fourslash/inputFile1.js var x = 109; var foo = "hello world"; -var M = (function () { +var M = /** @class */ (function () { function M() { } return M; @@ -13,7 +13,7 @@ EmitSkipped: false FileName : /tests/cases/fourslash/inputFile2.js.map {"version":3,"file":"inputFile2.js","sourceRoot":"sourceRootDir/","sources":["inputFile2.ts"],"names":[],"mappings":"AAAA,IAAI,GAAG,GAAG,wBAAwB,CAAC;AACnC;IAAA;IAGA,CAAC;IAAD,QAAC;AAAD,CAAC,AAHD,IAGC"}FileName : /tests/cases/fourslash/inputFile2.js var bar = "hello world Typescript"; -var C = (function () { +var C = /** @class */ (function () { function C() { } return C; diff --git a/tests/baselines/reference/getEmitOutputTsxFile_Preserve.baseline b/tests/baselines/reference/getEmitOutputTsxFile_Preserve.baseline index 015ddba07d9d6..5a04550370805 100644 --- a/tests/baselines/reference/getEmitOutputTsxFile_Preserve.baseline +++ b/tests/baselines/reference/getEmitOutputTsxFile_Preserve.baseline @@ -3,7 +3,7 @@ FileName : /tests/cases/fourslash/inputFile1.js.map {"version":3,"file":"inputFile1.js","sourceRoot":"","sources":["inputFile1.ts"],"names":[],"mappings":"AAAA,kBAAkB;AACjB,IAAI,CAAC,GAAW,CAAC,CAAC;AAClB;IAAA;IAGA,CAAC;IAAD,UAAC;AAAD,CAAC,AAHD,IAGC"}FileName : /tests/cases/fourslash/inputFile1.js // regular ts file var t = 5; -var Bar = (function () { +var Bar = /** @class */ (function () { function Bar() { } return Bar; diff --git a/tests/baselines/reference/getEmitOutputTsxFile_React.baseline b/tests/baselines/reference/getEmitOutputTsxFile_React.baseline index b139e9c1ca0d0..4f5b8f65d2257 100644 --- a/tests/baselines/reference/getEmitOutputTsxFile_React.baseline +++ b/tests/baselines/reference/getEmitOutputTsxFile_React.baseline @@ -3,7 +3,7 @@ FileName : /tests/cases/fourslash/inputFile1.js.map {"version":3,"file":"inputFile1.js","sourceRoot":"","sources":["inputFile1.ts"],"names":[],"mappings":"AAAA,kBAAkB;AACjB,IAAI,CAAC,GAAW,CAAC,CAAC;AAClB;IAAA;IAGA,CAAC;IAAD,UAAC;AAAD,CAAC,AAHD,IAGC"}FileName : /tests/cases/fourslash/inputFile1.js // regular ts file var t = 5; -var Bar = (function () { +var Bar = /** @class */ (function () { function Bar() { } return Bar; diff --git a/tests/baselines/reference/getEmitOutputWithDeclarationFile.baseline b/tests/baselines/reference/getEmitOutputWithDeclarationFile.baseline index a10ef5967b040..fa07a2af00ec0 100644 --- a/tests/baselines/reference/getEmitOutputWithDeclarationFile.baseline +++ b/tests/baselines/reference/getEmitOutputWithDeclarationFile.baseline @@ -3,7 +3,7 @@ EmitSkipped: false EmitSkipped: false FileName : /tests/cases/fourslash/inputFile2.js var x1 = "hello world"; -var Foo = (function () { +var Foo = /** @class */ (function () { function Foo() { } return Foo; diff --git a/tests/baselines/reference/getEmitOutputWithDeclarationFile2.baseline b/tests/baselines/reference/getEmitOutputWithDeclarationFile2.baseline index 5739596a8f0e9..b22067dc31809 100644 --- a/tests/baselines/reference/getEmitOutputWithDeclarationFile2.baseline +++ b/tests/baselines/reference/getEmitOutputWithDeclarationFile2.baseline @@ -4,7 +4,7 @@ EmitSkipped: false FileName : /tests/cases/fourslash/inputFile2.js "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); -var Foo = (function () { +var Foo = /** @class */ (function () { function Foo() { } return Foo; diff --git a/tests/baselines/reference/getEmitOutputWithEmitterErrors.baseline b/tests/baselines/reference/getEmitOutputWithEmitterErrors.baseline index 326d547ae1b84..e21f677a7eab6 100644 --- a/tests/baselines/reference/getEmitOutputWithEmitterErrors.baseline +++ b/tests/baselines/reference/getEmitOutputWithEmitterErrors.baseline @@ -4,7 +4,7 @@ Diagnostics: FileName : /tests/cases/fourslash/inputFile.js var M; (function (M) { - var C = (function () { + var C = /** @class */ (function () { function C() { } return C; diff --git a/tests/baselines/reference/getEmitOutputWithEmitterErrors2.baseline b/tests/baselines/reference/getEmitOutputWithEmitterErrors2.baseline index 50e80f9483142..5cc4df243d07f 100644 --- a/tests/baselines/reference/getEmitOutputWithEmitterErrors2.baseline +++ b/tests/baselines/reference/getEmitOutputWithEmitterErrors2.baseline @@ -5,7 +5,7 @@ FileName : /tests/cases/fourslash/inputFile.js define(["require", "exports"], function (require, exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); - var C = (function () { + var C = /** @class */ (function () { function C() { } return C; diff --git a/tests/baselines/reference/getSetAccessorContextualTyping.js b/tests/baselines/reference/getSetAccessorContextualTyping.js index c717fb7d5e337..383e7894aef91 100644 --- a/tests/baselines/reference/getSetAccessorContextualTyping.js +++ b/tests/baselines/reference/getSetAccessorContextualTyping.js @@ -29,7 +29,7 @@ class C { // In the body of a get accessor with no return type annotation, // if a matching set accessor exists and that set accessor has a parameter type annotation, // return expressions are contextually typed by the type given in the set accessor's parameter type annotation. -var C = (function () { +var C = /** @class */ (function () { function C() { } Object.defineProperty(C.prototype, "X", { diff --git a/tests/baselines/reference/getterControlFlowStrictNull.js b/tests/baselines/reference/getterControlFlowStrictNull.js index c3f7e410d0a7c..b55aea4bd6138 100644 --- a/tests/baselines/reference/getterControlFlowStrictNull.js +++ b/tests/baselines/reference/getterControlFlowStrictNull.js @@ -19,7 +19,7 @@ class B { } //// [getterControlFlowStrictNull.js] -var A = (function () { +var A = /** @class */ (function () { function A() { } A.prototype.a = function () { @@ -30,7 +30,7 @@ var A = (function () { }; return A; }()); -var B = (function () { +var B = /** @class */ (function () { function B() { } Object.defineProperty(B.prototype, "a", { diff --git a/tests/baselines/reference/getterMissingReturnError.js b/tests/baselines/reference/getterMissingReturnError.js index 63fd3f57db119..b24458c189b44 100644 --- a/tests/baselines/reference/getterMissingReturnError.js +++ b/tests/baselines/reference/getterMissingReturnError.js @@ -7,7 +7,7 @@ class test { //// [getterMissingReturnError.js] -var test = (function () { +var test = /** @class */ (function () { function test() { } Object.defineProperty(test.prototype, "p2", { diff --git a/tests/baselines/reference/getterThatThrowsShouldNotNeedReturn.js b/tests/baselines/reference/getterThatThrowsShouldNotNeedReturn.js index e38058fbebf5c..e9ed7bdd28a10 100644 --- a/tests/baselines/reference/getterThatThrowsShouldNotNeedReturn.js +++ b/tests/baselines/reference/getterThatThrowsShouldNotNeedReturn.js @@ -10,7 +10,7 @@ class Greeter { //// [getterThatThrowsShouldNotNeedReturn.js] -var Greeter = (function () { +var Greeter = /** @class */ (function () { function Greeter() { } Object.defineProperty(Greeter.prototype, "greet", { diff --git a/tests/baselines/reference/gettersAndSetters.js b/tests/baselines/reference/gettersAndSetters.js index 16d66c7dc71f6..b69a468ce9cb1 100644 --- a/tests/baselines/reference/gettersAndSetters.js +++ b/tests/baselines/reference/gettersAndSetters.js @@ -42,7 +42,7 @@ var i:I1 = function (n) {return n;} //// [gettersAndSetters.js] // classes -var C = (function () { +var C = /** @class */ (function () { function C() { this.fooBack = ""; this.bazBack = ""; diff --git a/tests/baselines/reference/gettersAndSettersAccessibility.js b/tests/baselines/reference/gettersAndSettersAccessibility.js index b3b8d008d1e8a..77747909f4865 100644 --- a/tests/baselines/reference/gettersAndSettersAccessibility.js +++ b/tests/baselines/reference/gettersAndSettersAccessibility.js @@ -6,7 +6,7 @@ class C99 { //// [gettersAndSettersAccessibility.js] -var C99 = (function () { +var C99 = /** @class */ (function () { function C99() { } Object.defineProperty(C99.prototype, "Baz", { diff --git a/tests/baselines/reference/gettersAndSettersErrors.js b/tests/baselines/reference/gettersAndSettersErrors.js index 5c9c56b67cffb..2cd6bbd296a18 100644 --- a/tests/baselines/reference/gettersAndSettersErrors.js +++ b/tests/baselines/reference/gettersAndSettersErrors.js @@ -17,7 +17,7 @@ class E { //// [gettersAndSettersErrors.js] -var C = (function () { +var C = /** @class */ (function () { function C() { this.Foo = 0; // error - duplicate identifier Foo - confirmed } @@ -39,7 +39,7 @@ var C = (function () { }); return C; }()); -var E = (function () { +var E = /** @class */ (function () { function E() { } Object.defineProperty(E.prototype, "Baz", { diff --git a/tests/baselines/reference/gettersAndSettersTypesAgree.js b/tests/baselines/reference/gettersAndSettersTypesAgree.js index 86802a30431d7..d2c50e1fd4f69 100644 --- a/tests/baselines/reference/gettersAndSettersTypesAgree.js +++ b/tests/baselines/reference/gettersAndSettersTypesAgree.js @@ -11,7 +11,7 @@ var o1 = {get Foo(){return 0;}, set Foo(val){}}; // ok - types agree (inference) var o2 = {get Foo(){return 0;}, set Foo(val:number){}}; // ok - types agree //// [gettersAndSettersTypesAgree.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } Object.defineProperty(C.prototype, "Foo", { diff --git a/tests/baselines/reference/giant.js b/tests/baselines/reference/giant.js index 71f78eeac53d8..a3d325f5884ce 100644 --- a/tests/baselines/reference/giant.js +++ b/tests/baselines/reference/giant.js @@ -700,7 +700,7 @@ define(["require", "exports"], function (require, exports) { var V; function F() { } ; - var C = (function () { + var C = /** @class */ (function () { function C() { } C.prototype.pF = function () { }; @@ -749,7 +749,7 @@ define(["require", "exports"], function (require, exports) { var V; function F() { } ; - var C = (function () { + var C = /** @class */ (function () { function C() { } C.prototype.pF = function () { }; @@ -798,7 +798,7 @@ define(["require", "exports"], function (require, exports) { var V; function F() { } ; - var C = (function () { + var C = /** @class */ (function () { function C() { } return C; @@ -809,7 +809,7 @@ define(["require", "exports"], function (require, exports) { function eF() { } M.eF = eF; ; - var eC = (function () { + var eC = /** @class */ (function () { function eC() { } return eC; @@ -825,7 +825,7 @@ define(["require", "exports"], function (require, exports) { function eF() { } M_1.eF = eF; ; - var eC = (function () { + var eC = /** @class */ (function () { function eC() { } eC.prototype.pF = function () { }; @@ -875,7 +875,7 @@ define(["require", "exports"], function (require, exports) { var V; function F() { } ; - var C = (function () { + var C = /** @class */ (function () { function C() { } return C; @@ -886,7 +886,7 @@ define(["require", "exports"], function (require, exports) { function eF() { } eM.eF = eF; ; - var eC = (function () { + var eC = /** @class */ (function () { function eC() { } return eC; @@ -904,7 +904,7 @@ define(["require", "exports"], function (require, exports) { function eF() { } exports.eF = eF; ; - var eC = (function () { + var eC = /** @class */ (function () { function eC() { } eC.prototype.pF = function () { }; @@ -954,7 +954,7 @@ define(["require", "exports"], function (require, exports) { var V; function F() { } ; - var C = (function () { + var C = /** @class */ (function () { function C() { } C.prototype.pF = function () { }; @@ -1003,7 +1003,7 @@ define(["require", "exports"], function (require, exports) { var V; function F() { } ; - var C = (function () { + var C = /** @class */ (function () { function C() { } return C; @@ -1014,7 +1014,7 @@ define(["require", "exports"], function (require, exports) { function eF() { } M.eF = eF; ; - var eC = (function () { + var eC = /** @class */ (function () { function eC() { } return eC; @@ -1030,7 +1030,7 @@ define(["require", "exports"], function (require, exports) { function eF() { } eM_1.eF = eF; ; - var eC = (function () { + var eC = /** @class */ (function () { function eC() { } eC.prototype.pF = function () { }; @@ -1080,7 +1080,7 @@ define(["require", "exports"], function (require, exports) { var V; function F() { } ; - var C = (function () { + var C = /** @class */ (function () { function C() { } return C; @@ -1091,7 +1091,7 @@ define(["require", "exports"], function (require, exports) { function eF() { } eM.eF = eF; ; - var eC = (function () { + var eC = /** @class */ (function () { function eC() { } return eC; diff --git a/tests/baselines/reference/globalIsContextualKeyword.js b/tests/baselines/reference/globalIsContextualKeyword.js index b6fa566c91a33..2ec876186edfb 100644 --- a/tests/baselines/reference/globalIsContextualKeyword.js +++ b/tests/baselines/reference/globalIsContextualKeyword.js @@ -21,7 +21,7 @@ function a() { var global = 1; } function b() { - var global = (function () { + var global = /** @class */ (function () { function global() { } return global; diff --git a/tests/baselines/reference/grammarAmbiguities1.js b/tests/baselines/reference/grammarAmbiguities1.js index f650030fd44f2..ff911010840bd 100644 --- a/tests/baselines/reference/grammarAmbiguities1.js +++ b/tests/baselines/reference/grammarAmbiguities1.js @@ -11,13 +11,13 @@ f(g < A, B > +(7)); //// [grammarAmbiguities1.js] -var A = (function () { +var A = /** @class */ (function () { function A() { } A.prototype.foo = function () { }; return A; }()); -var B = (function () { +var B = /** @class */ (function () { function B() { } B.prototype.bar = function () { }; diff --git a/tests/baselines/reference/heterogeneousArrayAndOverloads.js b/tests/baselines/reference/heterogeneousArrayAndOverloads.js index b9ef4bc4b6e6a..cb0fb3d58e4df 100644 --- a/tests/baselines/reference/heterogeneousArrayAndOverloads.js +++ b/tests/baselines/reference/heterogeneousArrayAndOverloads.js @@ -12,7 +12,7 @@ class arrTest { } //// [heterogeneousArrayAndOverloads.js] -var arrTest = (function () { +var arrTest = /** @class */ (function () { function arrTest() { } arrTest.prototype.test = function (arg1) { }; diff --git a/tests/baselines/reference/heterogeneousArrayLiterals.js b/tests/baselines/reference/heterogeneousArrayLiterals.js index f65fac6fb5d1f..499aa7e781857 100644 --- a/tests/baselines/reference/heterogeneousArrayLiterals.js +++ b/tests/baselines/reference/heterogeneousArrayLiterals.js @@ -157,19 +157,19 @@ var k = [function () { return 1; }, function () { return 1; }]; // { (): number var l = [function () { return 1; }, function () { return null; }]; // { (): any }[] var m = [function () { return 1; }, function () { return ''; }, function () { return null; }]; // { (): any }[] var n = [[function () { return 1; }], [function () { return ''; }]]; // {}[] -var Base = (function () { +var Base = /** @class */ (function () { function Base() { } return Base; }()); -var Derived = (function (_super) { +var Derived = /** @class */ (function (_super) { __extends(Derived, _super); function Derived() { return _super !== null && _super.apply(this, arguments) || this; } return Derived; }(Base)); -var Derived2 = (function (_super) { +var Derived2 = /** @class */ (function (_super) { __extends(Derived2, _super); function Derived2() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/ifDoWhileStatements.js b/tests/baselines/reference/ifDoWhileStatements.js index 711ce1315dc80..042fd8023152e 100644 --- a/tests/baselines/reference/ifDoWhileStatements.js +++ b/tests/baselines/reference/ifDoWhileStatements.js @@ -173,19 +173,19 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var C = (function () { +var C = /** @class */ (function () { function C() { } return C; }()); -var C2 = (function (_super) { +var C2 = /** @class */ (function (_super) { __extends(C2, _super); function C2() { return _super !== null && _super.apply(this, arguments) || this; } return C2; }(C)); -var D = (function () { +var D = /** @class */ (function () { function D() { } return D; @@ -194,7 +194,7 @@ function F(x) { return 42; } function F2(x) { return x < 42; } var M; (function (M) { - var A = (function () { + var A = /** @class */ (function () { function A() { } return A; @@ -205,7 +205,7 @@ var M; })(M || (M = {})); var N; (function (N) { - var A = (function () { + var A = /** @class */ (function () { function A() { } return A; diff --git a/tests/baselines/reference/illegalModifiersOnClassElements.js b/tests/baselines/reference/illegalModifiersOnClassElements.js index dc1b368260393..b87c822738b88 100644 --- a/tests/baselines/reference/illegalModifiersOnClassElements.js +++ b/tests/baselines/reference/illegalModifiersOnClassElements.js @@ -5,7 +5,7 @@ class C { } //// [illegalModifiersOnClassElements.js] -var C = (function () { +var C = /** @class */ (function () { function C() { this.foo = 1; this.bar = 1; diff --git a/tests/baselines/reference/illegalSuperCallsInConstructor.js b/tests/baselines/reference/illegalSuperCallsInConstructor.js index bb29e857e9bb5..1f13cbff967d7 100644 --- a/tests/baselines/reference/illegalSuperCallsInConstructor.js +++ b/tests/baselines/reference/illegalSuperCallsInConstructor.js @@ -31,12 +31,12 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var Base = (function () { +var Base = /** @class */ (function () { function Base() { } return Base; }()); -var Derived = (function (_super) { +var Derived = /** @class */ (function (_super) { __extends(Derived, _super); function Derived() { var _this = this; diff --git a/tests/baselines/reference/implementClausePrecedingExtends.js b/tests/baselines/reference/implementClausePrecedingExtends.js index 8c6c591138e8d..058e1342dc5a8 100644 --- a/tests/baselines/reference/implementClausePrecedingExtends.js +++ b/tests/baselines/reference/implementClausePrecedingExtends.js @@ -13,12 +13,12 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var C = (function () { +var C = /** @class */ (function () { function C() { } return C; }()); -var D = (function (_super) { +var D = /** @class */ (function (_super) { __extends(D, _super); function D() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/implementGenericWithMismatchedTypes.js b/tests/baselines/reference/implementGenericWithMismatchedTypes.js index e9c3a0e0ffd43..de5b1c0bfbd76 100644 --- a/tests/baselines/reference/implementGenericWithMismatchedTypes.js +++ b/tests/baselines/reference/implementGenericWithMismatchedTypes.js @@ -23,7 +23,7 @@ class C2 implements IFoo2 { // error //// [implementGenericWithMismatchedTypes.js] // no errors because in the derived types the best common type for T's value is Object // and that matches the original signature for assignability since we treat its T's as Object -var C = (function () { +var C = /** @class */ (function () { function C() { } C.prototype.foo = function (x) { @@ -31,7 +31,7 @@ var C = (function () { }; return C; }()); -var C2 = (function () { +var C2 = /** @class */ (function () { function C2() { } C2.prototype.foo = function (x) { diff --git a/tests/baselines/reference/implementInterfaceAnyMemberWithVoid.js b/tests/baselines/reference/implementInterfaceAnyMemberWithVoid.js index ec2406f65fd9e..200347ced73df 100644 --- a/tests/baselines/reference/implementInterfaceAnyMemberWithVoid.js +++ b/tests/baselines/reference/implementInterfaceAnyMemberWithVoid.js @@ -10,7 +10,7 @@ class Bug implements I { //// [implementInterfaceAnyMemberWithVoid.js] -var Bug = (function () { +var Bug = /** @class */ (function () { function Bug() { } Bug.prototype.foo = function (value) { diff --git a/tests/baselines/reference/implementPublicPropertyAsPrivate.js b/tests/baselines/reference/implementPublicPropertyAsPrivate.js index 8980fba52f37e..f9c13d21973b4 100644 --- a/tests/baselines/reference/implementPublicPropertyAsPrivate.js +++ b/tests/baselines/reference/implementPublicPropertyAsPrivate.js @@ -7,7 +7,7 @@ class C implements I { } //// [implementPublicPropertyAsPrivate.js] -var C = (function () { +var C = /** @class */ (function () { function C() { this.x = 0; // should raise error at class decl } diff --git a/tests/baselines/reference/implementingAnInterfaceExtendingClassWithPrivates.js b/tests/baselines/reference/implementingAnInterfaceExtendingClassWithPrivates.js index 835f37a2eed13..746b588b0ea0a 100644 --- a/tests/baselines/reference/implementingAnInterfaceExtendingClassWithPrivates.js +++ b/tests/baselines/reference/implementingAnInterfaceExtendingClassWithPrivates.js @@ -25,27 +25,27 @@ class Bar4 implements I { // error } //// [implementingAnInterfaceExtendingClassWithPrivates.js] -var Foo = (function () { +var Foo = /** @class */ (function () { function Foo() { } return Foo; }()); -var Bar = (function () { +var Bar = /** @class */ (function () { function Bar() { } return Bar; }()); -var Bar2 = (function () { +var Bar2 = /** @class */ (function () { function Bar2() { } return Bar2; }()); -var Bar3 = (function () { +var Bar3 = /** @class */ (function () { function Bar3() { } return Bar3; }()); -var Bar4 = (function () { +var Bar4 = /** @class */ (function () { function Bar4() { } return Bar4; diff --git a/tests/baselines/reference/implementingAnInterfaceExtendingClassWithPrivates2.js b/tests/baselines/reference/implementingAnInterfaceExtendingClassWithPrivates2.js index d492e7fa7e20a..b53d5b97b18b1 100644 --- a/tests/baselines/reference/implementingAnInterfaceExtendingClassWithPrivates2.js +++ b/tests/baselines/reference/implementingAnInterfaceExtendingClassWithPrivates2.js @@ -96,26 +96,26 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var Foo = (function () { +var Foo = /** @class */ (function () { function Foo() { } return Foo; }()); -var Bar = (function (_super) { +var Bar = /** @class */ (function (_super) { __extends(Bar, _super); function Bar() { return _super !== null && _super.apply(this, arguments) || this; } return Bar; }(Foo)); -var Bar2 = (function (_super) { +var Bar2 = /** @class */ (function (_super) { __extends(Bar2, _super); function Bar2() { return _super !== null && _super.apply(this, arguments) || this; } return Bar2; }(Foo)); -var Bar3 = (function (_super) { +var Bar3 = /** @class */ (function (_super) { __extends(Bar3, _super); function Bar3() { return _super !== null && _super.apply(this, arguments) || this; @@ -125,33 +125,33 @@ var Bar3 = (function (_super) { // another level of indirection var M; (function (M) { - var Foo = (function () { + var Foo = /** @class */ (function () { function Foo() { } return Foo; }()); - var Baz = (function (_super) { + var Baz = /** @class */ (function (_super) { __extends(Baz, _super); function Baz() { return _super !== null && _super.apply(this, arguments) || this; } return Baz; }(Foo)); - var Bar = (function (_super) { + var Bar = /** @class */ (function (_super) { __extends(Bar, _super); function Bar() { return _super !== null && _super.apply(this, arguments) || this; } return Bar; }(Foo)); - var Bar2 = (function (_super) { + var Bar2 = /** @class */ (function (_super) { __extends(Bar2, _super); function Bar2() { return _super !== null && _super.apply(this, arguments) || this; } return Bar2; }(Foo)); - var Bar3 = (function (_super) { + var Bar3 = /** @class */ (function (_super) { __extends(Bar3, _super); function Bar3() { return _super !== null && _super.apply(this, arguments) || this; @@ -162,19 +162,19 @@ var M; // two levels of privates var M2; (function (M2) { - var Foo = (function () { + var Foo = /** @class */ (function () { function Foo() { } return Foo; }()); - var Baz = (function (_super) { + var Baz = /** @class */ (function (_super) { __extends(Baz, _super); function Baz() { return _super !== null && _super.apply(this, arguments) || this; } return Baz; }(Foo)); - var Bar = (function (_super) { + var Bar = /** @class */ (function (_super) { __extends(Bar, _super); function Bar() { return _super !== null && _super.apply(this, arguments) || this; @@ -185,14 +185,14 @@ var M2; var r1 = b.z; var r2 = b.x; // error var r3 = b.y; // error - var Bar2 = (function (_super) { + var Bar2 = /** @class */ (function (_super) { __extends(Bar2, _super); function Bar2() { return _super !== null && _super.apply(this, arguments) || this; } return Bar2; }(Foo)); - var Bar3 = (function (_super) { + var Bar3 = /** @class */ (function (_super) { __extends(Bar3, _super); function Bar3() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/implementingAnInterfaceExtendingClassWithProtecteds.js b/tests/baselines/reference/implementingAnInterfaceExtendingClassWithProtecteds.js index 6bffdf9d4e775..9e8eba7d1e8a2 100644 --- a/tests/baselines/reference/implementingAnInterfaceExtendingClassWithProtecteds.js +++ b/tests/baselines/reference/implementingAnInterfaceExtendingClassWithProtecteds.js @@ -52,53 +52,53 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var Foo = (function () { +var Foo = /** @class */ (function () { function Foo() { } return Foo; }()); -var Bar = (function () { +var Bar = /** @class */ (function () { function Bar() { } return Bar; }()); -var Bar2 = (function () { +var Bar2 = /** @class */ (function () { function Bar2() { } return Bar2; }()); -var Bar3 = (function () { +var Bar3 = /** @class */ (function () { function Bar3() { } return Bar3; }()); -var Bar4 = (function () { +var Bar4 = /** @class */ (function () { function Bar4() { } return Bar4; }()); -var Bar5 = (function (_super) { +var Bar5 = /** @class */ (function (_super) { __extends(Bar5, _super); function Bar5() { return _super !== null && _super.apply(this, arguments) || this; } return Bar5; }(Foo)); -var Bar6 = (function (_super) { +var Bar6 = /** @class */ (function (_super) { __extends(Bar6, _super); function Bar6() { return _super !== null && _super.apply(this, arguments) || this; } return Bar6; }(Foo)); -var Bar7 = (function (_super) { +var Bar7 = /** @class */ (function (_super) { __extends(Bar7, _super); function Bar7() { return _super !== null && _super.apply(this, arguments) || this; } return Bar7; }(Foo)); -var Bar8 = (function (_super) { +var Bar8 = /** @class */ (function (_super) { __extends(Bar8, _super); function Bar8() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/implementsClauseAlreadySeen.js b/tests/baselines/reference/implementsClauseAlreadySeen.js index 0aa3afe4b3e4f..5aa46b6d18629 100644 --- a/tests/baselines/reference/implementsClauseAlreadySeen.js +++ b/tests/baselines/reference/implementsClauseAlreadySeen.js @@ -7,12 +7,12 @@ class D implements C implements C { } //// [implementsClauseAlreadySeen.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } return C; }()); -var D = (function () { +var D = /** @class */ (function () { function D() { } D.prototype.baz = function () { }; diff --git a/tests/baselines/reference/implementsInClassExpression.js b/tests/baselines/reference/implementsInClassExpression.js index eefd058ec2e2c..13dee950017f0 100644 --- a/tests/baselines/reference/implementsInClassExpression.js +++ b/tests/baselines/reference/implementsInClassExpression.js @@ -8,7 +8,7 @@ let cls = class implements Foo { } //// [implementsInClassExpression.js] -var cls = (function () { +var cls = /** @class */ (function () { function class_1() { } class_1.prototype.doThing = function () { }; diff --git a/tests/baselines/reference/implicitAnyAnyReturningFunction.js b/tests/baselines/reference/implicitAnyAnyReturningFunction.js index 13fe799a852df..319e2653daabb 100644 --- a/tests/baselines/reference/implicitAnyAnyReturningFunction.js +++ b/tests/baselines/reference/implicitAnyAnyReturningFunction.js @@ -28,7 +28,7 @@ function B() { var someLocal = {}; return someLocal; } -var C = (function () { +var C = /** @class */ (function () { function C() { } C.prototype.A = function () { diff --git a/tests/baselines/reference/implicitAnyCastedValue.js b/tests/baselines/reference/implicitAnyCastedValue.js index 372f14647a179..51993d692e013 100644 --- a/tests/baselines/reference/implicitAnyCastedValue.js +++ b/tests/baselines/reference/implicitAnyCastedValue.js @@ -85,7 +85,7 @@ var x = function () { function foo() { return "hello world"; // this should not be an error } -var C = (function () { +var C = /** @class */ (function () { function C() { this.bar = null; // this should be an error this.foo = undefined; // this should be an error @@ -105,7 +105,7 @@ var C = (function () { }; return C; }()); -var C1 = (function () { +var C1 = /** @class */ (function () { function C1() { this.getValue = null; // this should be an error } diff --git a/tests/baselines/reference/implicitAnyDeclareMemberWithoutType2.js b/tests/baselines/reference/implicitAnyDeclareMemberWithoutType2.js index a3a2e3d4b3115..daee8c6e07024 100644 --- a/tests/baselines/reference/implicitAnyDeclareMemberWithoutType2.js +++ b/tests/baselines/reference/implicitAnyDeclareMemberWithoutType2.js @@ -11,7 +11,7 @@ class C { //// [implicitAnyDeclareMemberWithoutType2.js] // this should be an error -var C = (function () { +var C = /** @class */ (function () { function C(c1, c2, c3) { this.x = null; // error at "x" } // error at "c1, c2" diff --git a/tests/baselines/reference/implicitAnyDeclareTypePropertyWithoutType.js b/tests/baselines/reference/implicitAnyDeclareTypePropertyWithoutType.js index 70c90f4c484f0..e4ff4dd9479d0 100644 --- a/tests/baselines/reference/implicitAnyDeclareTypePropertyWithoutType.js +++ b/tests/baselines/reference/implicitAnyDeclareTypePropertyWithoutType.js @@ -18,7 +18,7 @@ var x5: () => any; //// [implicitAnyDeclareTypePropertyWithoutType.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } return C; diff --git a/tests/baselines/reference/implicitAnyFromCircularInference.js b/tests/baselines/reference/implicitAnyFromCircularInference.js index b55db223c7570..1f522a601f2f3 100644 --- a/tests/baselines/reference/implicitAnyFromCircularInference.js +++ b/tests/baselines/reference/implicitAnyFromCircularInference.js @@ -74,14 +74,14 @@ function h() { } } function foo(x) { return "abc"; } -var C = (function () { +var C = /** @class */ (function () { function C() { // Error expected this.s = foo(this); } return C; }()); -var D = (function () { +var D = /** @class */ (function () { function D() { } Object.defineProperty(D.prototype, "x", { diff --git a/tests/baselines/reference/implicitAnyFunctionInvocationWithAnyArguements.js b/tests/baselines/reference/implicitAnyFunctionInvocationWithAnyArguements.js index ce25562841c8e..369109f0cb228 100644 --- a/tests/baselines/reference/implicitAnyFunctionInvocationWithAnyArguements.js +++ b/tests/baselines/reference/implicitAnyFunctionInvocationWithAnyArguements.js @@ -61,7 +61,7 @@ noError(null, []); noError(undefined, []); noError(null, [null, undefined]); noError(undefined, anyArray); -var C = (function () { +var C = /** @class */ (function () { function C(emtpyArray, variable) { } return C; diff --git a/tests/baselines/reference/implicitAnyFunctionReturnNullOrUndefined.js b/tests/baselines/reference/implicitAnyFunctionReturnNullOrUndefined.js index 69740a0ad31ef..4ae7de5864d25 100644 --- a/tests/baselines/reference/implicitAnyFunctionReturnNullOrUndefined.js +++ b/tests/baselines/reference/implicitAnyFunctionReturnNullOrUndefined.js @@ -28,7 +28,7 @@ undefinedWidenFunction(); // this should be an error function nullWidenFunction() { return null; } // error at "nullWidenFunction" function undefinedWidenFunction() { return undefined; } // error at "undefinedWidenFunction" -var C = (function () { +var C = /** @class */ (function () { function C() { } C.prototype.nullWidenFuncOfC = function () { diff --git a/tests/baselines/reference/implicitAnyGenerics.js b/tests/baselines/reference/implicitAnyGenerics.js index 172d6c4da3ada..2cd3cf30324b7 100644 --- a/tests/baselines/reference/implicitAnyGenerics.js +++ b/tests/baselines/reference/implicitAnyGenerics.js @@ -26,7 +26,7 @@ foo(); //// [implicitAnyGenerics.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } return C; @@ -35,7 +35,7 @@ var c = new C(); var c2 = new C(); var c3 = new C(); var c4 = new C(); -var D = (function () { +var D = /** @class */ (function () { function D(x) { } return D; diff --git a/tests/baselines/reference/implicitAnyGetAndSetAccessorWithAnyReturnType.js b/tests/baselines/reference/implicitAnyGetAndSetAccessorWithAnyReturnType.js index 3997a56db0d37..48793de094d08 100644 --- a/tests/baselines/reference/implicitAnyGetAndSetAccessorWithAnyReturnType.js +++ b/tests/baselines/reference/implicitAnyGetAndSetAccessorWithAnyReturnType.js @@ -25,7 +25,7 @@ class GetterOnly { //// [implicitAnyGetAndSetAccessorWithAnyReturnType.js] // these should be errors -var GetAndSet = (function () { +var GetAndSet = /** @class */ (function () { function GetAndSet() { this.getAndSet = null; // error at "getAndSet" } @@ -42,7 +42,7 @@ var GetAndSet = (function () { }); return GetAndSet; }()); -var SetterOnly = (function () { +var SetterOnly = /** @class */ (function () { function SetterOnly() { } Object.defineProperty(SetterOnly.prototype, "haveOnlySet", { @@ -53,7 +53,7 @@ var SetterOnly = (function () { }); return SetterOnly; }()); -var GetterOnly = (function () { +var GetterOnly = /** @class */ (function () { function GetterOnly() { } Object.defineProperty(GetterOnly.prototype, "haveOnlyGet", { diff --git a/tests/baselines/reference/implicitAnyInCatch.js b/tests/baselines/reference/implicitAnyInCatch.js index f833135f00d30..d6fe77f836949 100644 --- a/tests/baselines/reference/implicitAnyInCatch.js +++ b/tests/baselines/reference/implicitAnyInCatch.js @@ -21,7 +21,7 @@ catch (error) { if (error.number === -2147024809) { } } for (var key in this) { } -var C = (function () { +var C = /** @class */ (function () { function C() { } C.prototype.temp = function () { diff --git a/tests/baselines/reference/implicitAnyWidenToAny.js b/tests/baselines/reference/implicitAnyWidenToAny.js index 0d1c42ad9d049..7158a69080a01 100644 --- a/tests/baselines/reference/implicitAnyWidenToAny.js +++ b/tests/baselines/reference/implicitAnyWidenToAny.js @@ -34,7 +34,7 @@ var x1 = undefined; // error at "x1" var widenArray = [null, undefined]; // error at "widenArray" var emptyArray = []; // these should not be error -var AnimalObj = (function () { +var AnimalObj = /** @class */ (function () { function AnimalObj() { } return AnimalObj; diff --git a/tests/baselines/reference/importAliasIdentifiers.js b/tests/baselines/reference/importAliasIdentifiers.js index 278c5a2e8a0eb..94c8c8079ade3 100644 --- a/tests/baselines/reference/importAliasIdentifiers.js +++ b/tests/baselines/reference/importAliasIdentifiers.js @@ -49,7 +49,7 @@ var p: { x: number; y: number; }; //// [importAliasIdentifiers.js] var moduleA; (function (moduleA) { - var Point = (function () { + var Point = /** @class */ (function () { function Point(x, y) { this.x = x; this.y = y; @@ -62,7 +62,7 @@ var alias = moduleA; var p; var p; var p; -var clodule = (function () { +var clodule = /** @class */ (function () { function clodule() { } return clodule; diff --git a/tests/baselines/reference/importAndVariableDeclarationConflict2.js b/tests/baselines/reference/importAndVariableDeclarationConflict2.js index 221fd20e7ecea..03c8b8d9232b6 100644 --- a/tests/baselines/reference/importAndVariableDeclarationConflict2.js +++ b/tests/baselines/reference/importAndVariableDeclarationConflict2.js @@ -17,7 +17,7 @@ var m; m_1.m = ''; })(m || (m = {})); var x = m.m; -var C = (function () { +var C = /** @class */ (function () { function C() { } C.prototype.foo = function () { diff --git a/tests/baselines/reference/importAsBaseClass.js b/tests/baselines/reference/importAsBaseClass.js index 725390825c605..aa18733adb09c 100644 --- a/tests/baselines/reference/importAsBaseClass.js +++ b/tests/baselines/reference/importAsBaseClass.js @@ -13,7 +13,7 @@ class Hello extends Greeter { } //// [importAsBaseClass_0.js] "use strict"; exports.__esModule = true; -var Greeter = (function () { +var Greeter = /** @class */ (function () { function Greeter() { } Greeter.prototype.greet = function () { return 'greet'; }; @@ -34,7 +34,7 @@ var __extends = (this && this.__extends) || (function () { })(); exports.__esModule = true; var Greeter = require("./importAsBaseClass_0"); -var Hello = (function (_super) { +var Hello = /** @class */ (function (_super) { __extends(Hello, _super); function Hello() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/importCallExpressionNoModuleKindSpecified.js b/tests/baselines/reference/importCallExpressionNoModuleKindSpecified.js index 487d4e03a6c01..3b70a69d9da75 100644 --- a/tests/baselines/reference/importCallExpressionNoModuleKindSpecified.js +++ b/tests/baselines/reference/importCallExpressionNoModuleKindSpecified.js @@ -28,7 +28,7 @@ class C { //// [0.js] "use strict"; exports.__esModule = true; -var B = (function () { +var B = /** @class */ (function () { function B() { } B.prototype.print = function () { return "I am B"; }; @@ -78,7 +78,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) { if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; } }; -var C = (function () { +var C = /** @class */ (function () { function C() { this.myModule = Promise.resolve().then(function () { return require("./0"); }); } diff --git a/tests/baselines/reference/importDecl.js b/tests/baselines/reference/importDecl.js index 1e5e5d0ec719e..2eb9208910a07 100644 --- a/tests/baselines/reference/importDecl.js +++ b/tests/baselines/reference/importDecl.js @@ -84,7 +84,7 @@ export var useMultiImport_m4_f4 = multiImport_m4.foo(); //// [importDecl_require.js] "use strict"; exports.__esModule = true; -var d = (function () { +var d = /** @class */ (function () { function d() { } return d; @@ -95,7 +95,7 @@ exports.foo = foo; //// [importDecl_require1.js] "use strict"; exports.__esModule = true; -var d = (function () { +var d = /** @class */ (function () { function d() { } return d; @@ -107,7 +107,7 @@ exports.foo = foo; //// [importDecl_require2.js] "use strict"; exports.__esModule = true; -var d = (function () { +var d = /** @class */ (function () { function d() { } return d; @@ -118,7 +118,7 @@ exports.foo = foo; //// [importDecl_require3.js] "use strict"; exports.__esModule = true; -var d = (function () { +var d = /** @class */ (function () { function d() { } return d; diff --git a/tests/baselines/reference/importDeclarationUsedAsTypeQuery.js b/tests/baselines/reference/importDeclarationUsedAsTypeQuery.js index cce30fd8b85e6..a6431f6a2c3f0 100644 --- a/tests/baselines/reference/importDeclarationUsedAsTypeQuery.js +++ b/tests/baselines/reference/importDeclarationUsedAsTypeQuery.js @@ -14,7 +14,7 @@ export var x: typeof a; //// [importDeclarationUsedAsTypeQuery_require.js] "use strict"; exports.__esModule = true; -var B = (function () { +var B = /** @class */ (function () { function B() { } return B; diff --git a/tests/baselines/reference/importHelpers.js b/tests/baselines/reference/importHelpers.js index 4fc7b99a813d3..fdf9b12ed521d 100644 --- a/tests/baselines/reference/importHelpers.js +++ b/tests/baselines/reference/importHelpers.js @@ -37,13 +37,13 @@ export declare function __awaiter(thisArg: any, _arguments: any, P: Function, ge "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var tslib_1 = require("tslib"); -var A = (function () { +var A = /** @class */ (function () { function A() { } return A; }()); exports.A = A; -var B = (function (_super) { +var B = /** @class */ (function (_super) { tslib_1.__extends(B, _super); function B() { return _super !== null && _super.apply(this, arguments) || this; @@ -51,7 +51,7 @@ var B = (function (_super) { return B; }(A)); exports.B = B; -var C = (function () { +var C = /** @class */ (function () { function C() { } C.prototype.method = function (x) { @@ -90,19 +90,19 @@ var __metadata = (this && this.__metadata) || function (k, v) { var __param = (this && this.__param) || function (paramIndex, decorator) { return function (target, key) { decorator(target, key, paramIndex); } }; -var A = (function () { +var A = /** @class */ (function () { function A() { } return A; }()); -var B = (function (_super) { +var B = /** @class */ (function (_super) { __extends(B, _super); function B() { return _super !== null && _super.apply(this, arguments) || this; } return B; }(A)); -var C = (function () { +var C = /** @class */ (function () { function C() { } C.prototype.method = function (x) { diff --git a/tests/baselines/reference/importHelpersAmd.js b/tests/baselines/reference/importHelpersAmd.js index 3d74b2277fb77..963569af53084 100644 --- a/tests/baselines/reference/importHelpersAmd.js +++ b/tests/baselines/reference/importHelpersAmd.js @@ -23,7 +23,7 @@ export declare function __exportStar(m: any, exports: any): void; define(["require", "exports"], function (require, exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); - var A = (function () { + var A = /** @class */ (function () { function A() { } return A; @@ -35,7 +35,7 @@ define(["require", "exports", "tslib", "./a", "./a"], function (require, exports "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); tslib_1.__exportStar(a_2, exports); - var B = (function (_super) { + var B = /** @class */ (function (_super) { tslib_1.__extends(B, _super); function B() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/importHelpersInIsolatedModules.js b/tests/baselines/reference/importHelpersInIsolatedModules.js index 561bfebb351ca..38e7bcca948e7 100644 --- a/tests/baselines/reference/importHelpersInIsolatedModules.js +++ b/tests/baselines/reference/importHelpersInIsolatedModules.js @@ -37,13 +37,13 @@ export declare function __awaiter(thisArg: any, _arguments: any, P: Function, ge "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var tslib_1 = require("tslib"); -var A = (function () { +var A = /** @class */ (function () { function A() { } return A; }()); exports.A = A; -var B = (function (_super) { +var B = /** @class */ (function (_super) { tslib_1.__extends(B, _super); function B() { return _super !== null && _super.apply(this, arguments) || this; @@ -51,7 +51,7 @@ var B = (function (_super) { return B; }(A)); exports.B = B; -var C = (function () { +var C = /** @class */ (function () { function C() { } C.prototype.method = function (x) { @@ -69,19 +69,19 @@ var C = (function () { }()); //// [script.js] var tslib_1 = require("tslib"); -var A = (function () { +var A = /** @class */ (function () { function A() { } return A; }()); -var B = (function (_super) { +var B = /** @class */ (function (_super) { tslib_1.__extends(B, _super); function B() { return _super !== null && _super.apply(this, arguments) || this; } return B; }(A)); -var C = (function () { +var C = /** @class */ (function () { function C() { } C.prototype.method = function (x) { diff --git a/tests/baselines/reference/importHelpersNoHelpers.js b/tests/baselines/reference/importHelpersNoHelpers.js index ec1b21d797c53..b4acad9aa1c8d 100644 --- a/tests/baselines/reference/importHelpersNoHelpers.js +++ b/tests/baselines/reference/importHelpersNoHelpers.js @@ -45,13 +45,13 @@ exports.x = 1; Object.defineProperty(exports, "__esModule", { value: true }); var tslib_1 = require("tslib"); tslib_1.__exportStar(require("./other"), exports); -var A = (function () { +var A = /** @class */ (function () { function A() { } return A; }()); exports.A = A; -var B = (function (_super) { +var B = /** @class */ (function (_super) { tslib_1.__extends(B, _super); function B() { return _super !== null && _super.apply(this, arguments) || this; @@ -59,7 +59,7 @@ var B = (function (_super) { return B; }(A)); exports.B = B; -var C = (function () { +var C = /** @class */ (function () { function C() { } C.prototype.method = function (x) { @@ -101,19 +101,19 @@ var __metadata = (this && this.__metadata) || function (k, v) { var __param = (this && this.__param) || function (paramIndex, decorator) { return function (target, key) { decorator(target, key, paramIndex); } }; -var A = (function () { +var A = /** @class */ (function () { function A() { } return A; }()); -var B = (function (_super) { +var B = /** @class */ (function (_super) { __extends(B, _super); function B() { return _super !== null && _super.apply(this, arguments) || this; } return B; }(A)); -var C = (function () { +var C = /** @class */ (function () { function C() { } C.prototype.method = function (x) { diff --git a/tests/baselines/reference/importHelpersNoModule.js b/tests/baselines/reference/importHelpersNoModule.js index 988bec04a427d..bd87b58e62bce 100644 --- a/tests/baselines/reference/importHelpersNoModule.js +++ b/tests/baselines/reference/importHelpersNoModule.js @@ -29,13 +29,13 @@ class C { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var tslib_1 = require("tslib"); -var A = (function () { +var A = /** @class */ (function () { function A() { } return A; }()); exports.A = A; -var B = (function (_super) { +var B = /** @class */ (function (_super) { tslib_1.__extends(B, _super); function B() { return _super !== null && _super.apply(this, arguments) || this; @@ -43,7 +43,7 @@ var B = (function (_super) { return B; }(A)); exports.B = B; -var C = (function () { +var C = /** @class */ (function () { function C() { } C.prototype.method = function (x) { @@ -82,19 +82,19 @@ var __metadata = (this && this.__metadata) || function (k, v) { var __param = (this && this.__param) || function (paramIndex, decorator) { return function (target, key) { decorator(target, key, paramIndex); } }; -var A = (function () { +var A = /** @class */ (function () { function A() { } return A; }()); -var B = (function (_super) { +var B = /** @class */ (function (_super) { __extends(B, _super); function B() { return _super !== null && _super.apply(this, arguments) || this; } return B; }(A)); -var C = (function () { +var C = /** @class */ (function () { function C() { } C.prototype.method = function (x) { diff --git a/tests/baselines/reference/importHelpersOutFile.js b/tests/baselines/reference/importHelpersOutFile.js index 55bf2ea9d4655..ec59f08f41aa3 100644 --- a/tests/baselines/reference/importHelpersOutFile.js +++ b/tests/baselines/reference/importHelpersOutFile.js @@ -24,7 +24,7 @@ export declare function __awaiter(thisArg: any, _arguments: any, P: Function, ge define("a", ["require", "exports"], function (require, exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); - var A = (function () { + var A = /** @class */ (function () { function A() { } return A; @@ -34,7 +34,7 @@ define("a", ["require", "exports"], function (require, exports) { define("b", ["require", "exports", "tslib", "a"], function (require, exports, tslib_1, a_1) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); - var B = (function (_super) { + var B = /** @class */ (function (_super) { tslib_1.__extends(B, _super); function B() { return _super !== null && _super.apply(this, arguments) || this; @@ -46,7 +46,7 @@ define("b", ["require", "exports", "tslib", "a"], function (require, exports, ts define("c", ["require", "exports", "tslib", "a"], function (require, exports, tslib_2, a_2) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); - var C = (function (_super) { + var C = /** @class */ (function (_super) { tslib_2.__extends(C, _super); function C() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/importHelpersSystem.js b/tests/baselines/reference/importHelpersSystem.js index fbd0f5e589f2c..9392833f6f446 100644 --- a/tests/baselines/reference/importHelpersSystem.js +++ b/tests/baselines/reference/importHelpersSystem.js @@ -25,7 +25,7 @@ System.register([], function (exports_1, context_1) { return { setters: [], execute: function () { - A = (function () { + A = /** @class */ (function () { function A() { } return A; @@ -60,7 +60,7 @@ System.register(["tslib", "./a"], function (exports_1, context_1) { } ], execute: function () { - B = (function (_super) { + B = /** @class */ (function (_super) { tslib_1.__extends(B, _super); function B() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/importImportOnlyModule.js b/tests/baselines/reference/importImportOnlyModule.js index fa01655c47b29..2bba9ec447842 100644 --- a/tests/baselines/reference/importImportOnlyModule.js +++ b/tests/baselines/reference/importImportOnlyModule.js @@ -19,7 +19,7 @@ var x = foo; // Cause a runtime dependency define(["require", "exports"], function (require, exports) { "use strict"; exports.__esModule = true; - var C1 = (function () { + var C1 = /** @class */ (function () { function C1() { this.m1 = 42; } diff --git a/tests/baselines/reference/importInTypePosition.js b/tests/baselines/reference/importInTypePosition.js index 542c6f34a4894..23ed08db28524 100644 --- a/tests/baselines/reference/importInTypePosition.js +++ b/tests/baselines/reference/importInTypePosition.js @@ -24,7 +24,7 @@ module C { //// [importInTypePosition.js] var A; (function (A) { - var Point = (function () { + var Point = /** @class */ (function () { function Point(x, y) { this.x = x; this.y = y; diff --git a/tests/baselines/reference/importShadowsGlobalName.js b/tests/baselines/reference/importShadowsGlobalName.js index 64631ce54278e..1da6a98ad155e 100644 --- a/tests/baselines/reference/importShadowsGlobalName.js +++ b/tests/baselines/reference/importShadowsGlobalName.js @@ -12,7 +12,7 @@ export = Bar; //// [Foo.js] define(["require", "exports"], function (require, exports) { "use strict"; - var Foo = (function () { + var Foo = /** @class */ (function () { function Foo() { } return Foo; @@ -32,7 +32,7 @@ var __extends = (this && this.__extends) || (function () { })(); define(["require", "exports", "Foo"], function (require, exports, Error) { "use strict"; - var Bar = (function (_super) { + var Bar = /** @class */ (function (_super) { __extends(Bar, _super); function Bar() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/importStatements.js b/tests/baselines/reference/importStatements.js index a91b54f3a6d27..9592f5a35d7bc 100644 --- a/tests/baselines/reference/importStatements.js +++ b/tests/baselines/reference/importStatements.js @@ -37,7 +37,7 @@ module E { //// [importStatements.js] var A; (function (A) { - var Point = (function () { + var Point = /** @class */ (function () { function Point(x, y) { this.x = x; this.y = y; diff --git a/tests/baselines/reference/importUsedInExtendsList1.js b/tests/baselines/reference/importUsedInExtendsList1.js index 15bf907ddd5b1..c122d5aef15ae 100644 --- a/tests/baselines/reference/importUsedInExtendsList1.js +++ b/tests/baselines/reference/importUsedInExtendsList1.js @@ -14,7 +14,7 @@ var r: string = s.foo; //// [importUsedInExtendsList1_require.js] "use strict"; exports.__esModule = true; -var Super = (function () { +var Super = /** @class */ (function () { function Super() { } return Super; @@ -35,7 +35,7 @@ var __extends = (this && this.__extends) || (function () { exports.__esModule = true; /// var foo = require("./importUsedInExtendsList1_require"); -var Sub = (function (_super) { +var Sub = /** @class */ (function (_super) { __extends(Sub, _super); function Sub() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/import_reference-exported-alias.js b/tests/baselines/reference/import_reference-exported-alias.js index b3d607a6943a6..263ab20108711 100644 --- a/tests/baselines/reference/import_reference-exported-alias.js +++ b/tests/baselines/reference/import_reference-exported-alias.js @@ -28,7 +28,7 @@ define(["require", "exports"], function (require, exports) { (function (App) { var Services; (function (Services) { - var UserServices = (function () { + var UserServices = /** @class */ (function () { function UserServices() { } UserServices.prototype.getUserName = function () { diff --git a/tests/baselines/reference/import_reference-to-type-alias.js b/tests/baselines/reference/import_reference-to-type-alias.js index c6771d47bae30..624c5192b5036 100644 --- a/tests/baselines/reference/import_reference-to-type-alias.js +++ b/tests/baselines/reference/import_reference-to-type-alias.js @@ -25,7 +25,7 @@ define(["require", "exports"], function (require, exports) { (function (App) { var Services; (function (Services) { - var UserServices = (function () { + var UserServices = /** @class */ (function () { function UserServices() { } UserServices.prototype.getUserName = function () { diff --git a/tests/baselines/reference/import_var-referencing-an-imported-module-alias.js b/tests/baselines/reference/import_var-referencing-an-imported-module-alias.js index 9e99e9c75ebf0..84fd29a5aac9d 100644 --- a/tests/baselines/reference/import_var-referencing-an-imported-module-alias.js +++ b/tests/baselines/reference/import_var-referencing-an-imported-module-alias.js @@ -13,7 +13,7 @@ var v = new hostVar.Host(); define(["require", "exports"], function (require, exports) { "use strict"; exports.__esModule = true; - var Host = (function () { + var Host = /** @class */ (function () { function Host() { } return Host; diff --git a/tests/baselines/reference/importedAliasesInTypePositions.js b/tests/baselines/reference/importedAliasesInTypePositions.js index b82ac22f4ede4..aad4739b7766d 100644 --- a/tests/baselines/reference/importedAliasesInTypePositions.js +++ b/tests/baselines/reference/importedAliasesInTypePositions.js @@ -30,7 +30,7 @@ define(["require", "exports"], function (require, exports) { (function (mod) { var name; (function (name) { - var ReferredTo = (function () { + var ReferredTo = /** @class */ (function () { function ReferredTo() { } ReferredTo.prototype.doSomething = function () { @@ -49,7 +49,7 @@ define(["require", "exports"], function (require, exports) { exports.__esModule = true; var ImportingModule; (function (ImportingModule) { - var UsesReferredType = (function () { + var UsesReferredType = /** @class */ (function () { function UsesReferredType(referred) { this.referred = referred; } diff --git a/tests/baselines/reference/importedModuleAddToGlobal.js b/tests/baselines/reference/importedModuleAddToGlobal.js index b74b96f2eb623..a8c0fc8cdbe78 100644 --- a/tests/baselines/reference/importedModuleAddToGlobal.js +++ b/tests/baselines/reference/importedModuleAddToGlobal.js @@ -19,7 +19,7 @@ module C { //// [importedModuleAddToGlobal.js] var B; (function (B_1) { - var B = (function () { + var B = /** @class */ (function () { function B() { } return B; diff --git a/tests/baselines/reference/importedModuleClassNameClash.js b/tests/baselines/reference/importedModuleClassNameClash.js index 5f4f9677dcd6c..9d2dd6eb4f9ac 100644 --- a/tests/baselines/reference/importedModuleClassNameClash.js +++ b/tests/baselines/reference/importedModuleClassNameClash.js @@ -10,7 +10,7 @@ class foo { } define(["require", "exports"], function (require, exports) { "use strict"; exports.__esModule = true; - var foo = (function () { + var foo = /** @class */ (function () { function foo() { } return foo; diff --git a/tests/baselines/reference/inOperatorWithGeneric.js b/tests/baselines/reference/inOperatorWithGeneric.js index eb2df95bbde5b..81b1b7c3839d6 100644 --- a/tests/baselines/reference/inOperatorWithGeneric.js +++ b/tests/baselines/reference/inOperatorWithGeneric.js @@ -7,7 +7,7 @@ class C { } //// [inOperatorWithGeneric.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } C.prototype.foo = function (x) { diff --git a/tests/baselines/reference/incompatibleAssignmentOfIdenticallyNamedTypes.js b/tests/baselines/reference/incompatibleAssignmentOfIdenticallyNamedTypes.js index 677d177a4d01a..fddcd3aa91585 100644 --- a/tests/baselines/reference/incompatibleAssignmentOfIdenticallyNamedTypes.js +++ b/tests/baselines/reference/incompatibleAssignmentOfIdenticallyNamedTypes.js @@ -10,7 +10,7 @@ class Foo { //// [incompatibleAssignmentOfIdenticallyNamedTypes.js] -var Foo = (function () { +var Foo = /** @class */ (function () { function Foo() { } Foo.prototype.fn = function () { diff --git a/tests/baselines/reference/incompatibleTypes.js b/tests/baselines/reference/incompatibleTypes.js index 6f786aee354e2..a5642370d1945 100644 --- a/tests/baselines/reference/incompatibleTypes.js +++ b/tests/baselines/reference/incompatibleTypes.js @@ -76,7 +76,7 @@ var fp1: () =>any = a => 0; //// [incompatibleTypes.js] -var C1 = (function () { +var C1 = /** @class */ (function () { function C1() { } C1.prototype.p1 = function () { @@ -84,7 +84,7 @@ var C1 = (function () { }; return C1; }()); -var C2 = (function () { +var C2 = /** @class */ (function () { function C2() { } C2.prototype.p1 = function (n) { @@ -92,12 +92,12 @@ var C2 = (function () { }; return C2; }()); -var C3 = (function () { +var C3 = /** @class */ (function () { function C3() { } return C3; }()); -var C4 = (function () { +var C4 = /** @class */ (function () { function C4() { } return C4; diff --git a/tests/baselines/reference/incorrectClassOverloadChain.js b/tests/baselines/reference/incorrectClassOverloadChain.js index 8ebbc11d90e02..7184b51e91a48 100644 --- a/tests/baselines/reference/incorrectClassOverloadChain.js +++ b/tests/baselines/reference/incorrectClassOverloadChain.js @@ -6,7 +6,7 @@ class C { } //// [incorrectClassOverloadChain.js] -var C = (function () { +var C = /** @class */ (function () { function C() { this.x = 1; } diff --git a/tests/baselines/reference/incrementOnTypeParameter.js b/tests/baselines/reference/incrementOnTypeParameter.js index 2f3de20c4193b..d47177e00c27a 100644 --- a/tests/baselines/reference/incrementOnTypeParameter.js +++ b/tests/baselines/reference/incrementOnTypeParameter.js @@ -10,7 +10,7 @@ class C { //// [incrementOnTypeParameter.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } C.prototype.foo = function () { diff --git a/tests/baselines/reference/incrementOperatorWithAnyOtherType.js b/tests/baselines/reference/incrementOperatorWithAnyOtherType.js index 989d4d900d3b0..a2a579f32f967 100644 --- a/tests/baselines/reference/incrementOperatorWithAnyOtherType.js +++ b/tests/baselines/reference/incrementOperatorWithAnyOtherType.js @@ -54,7 +54,7 @@ var ANY; var ANY1; var ANY2 = ["", ""]; var obj = { x: 1, y: null }; -var A = (function () { +var A = /** @class */ (function () { function A() { } return A; diff --git a/tests/baselines/reference/incrementOperatorWithAnyOtherTypeInvalidOperations.js b/tests/baselines/reference/incrementOperatorWithAnyOtherTypeInvalidOperations.js index be2726f083b5d..c02e6e39a9892 100644 --- a/tests/baselines/reference/incrementOperatorWithAnyOtherTypeInvalidOperations.js +++ b/tests/baselines/reference/incrementOperatorWithAnyOtherTypeInvalidOperations.js @@ -79,7 +79,7 @@ function foo() { var a; return a; } -var A = (function () { +var A = /** @class */ (function () { function A() { } A.foo = function () { diff --git a/tests/baselines/reference/incrementOperatorWithNumberType.js b/tests/baselines/reference/incrementOperatorWithNumberType.js index 16a56b45a2025..d4c857148e8ff 100644 --- a/tests/baselines/reference/incrementOperatorWithNumberType.js +++ b/tests/baselines/reference/incrementOperatorWithNumberType.js @@ -43,7 +43,7 @@ objA.a++, M.n++; // ++ operator on number type var NUMBER; var NUMBER1 = [1, 2]; -var A = (function () { +var A = /** @class */ (function () { function A() { } return A; diff --git a/tests/baselines/reference/incrementOperatorWithNumberTypeInvalidOperations.js b/tests/baselines/reference/incrementOperatorWithNumberTypeInvalidOperations.js index 0bdb75eb0fa97..efa8ceee45a16 100644 --- a/tests/baselines/reference/incrementOperatorWithNumberTypeInvalidOperations.js +++ b/tests/baselines/reference/incrementOperatorWithNumberTypeInvalidOperations.js @@ -51,7 +51,7 @@ foo()++; var NUMBER; var NUMBER1 = [1, 2]; function foo() { return 1; } -var A = (function () { +var A = /** @class */ (function () { function A() { } A.foo = function () { return 1; }; diff --git a/tests/baselines/reference/incrementOperatorWithUnsupportedBooleanType.js b/tests/baselines/reference/incrementOperatorWithUnsupportedBooleanType.js index 4e936e335142d..1cf837603aa95 100644 --- a/tests/baselines/reference/incrementOperatorWithUnsupportedBooleanType.js +++ b/tests/baselines/reference/incrementOperatorWithUnsupportedBooleanType.js @@ -58,7 +58,7 @@ objA.a++, M.n++; // ++ operator on boolean type var BOOLEAN; function foo() { return true; } -var A = (function () { +var A = /** @class */ (function () { function A() { } A.foo = function () { return true; }; diff --git a/tests/baselines/reference/incrementOperatorWithUnsupportedStringType.js b/tests/baselines/reference/incrementOperatorWithUnsupportedStringType.js index 781251d56b9d5..b8d12af683448 100644 --- a/tests/baselines/reference/incrementOperatorWithUnsupportedStringType.js +++ b/tests/baselines/reference/incrementOperatorWithUnsupportedStringType.js @@ -70,7 +70,7 @@ objA.a++, M.n++; var STRING; var STRING1 = ["", ""]; function foo() { return ""; } -var A = (function () { +var A = /** @class */ (function () { function A() { } A.foo = function () { return ""; }; diff --git a/tests/baselines/reference/indexClassByNumber.js b/tests/baselines/reference/indexClassByNumber.js index 8d5ecda30f5c5..216aa6a459cc2 100644 --- a/tests/baselines/reference/indexClassByNumber.js +++ b/tests/baselines/reference/indexClassByNumber.js @@ -9,7 +9,7 @@ f[0] = 4; // Shouldn't be allowed //// [indexClassByNumber.js] // Shouldn't be able to index a class instance by a number (unless it has declared a number index signature) -var foo = (function () { +var foo = /** @class */ (function () { function foo() { } return foo; diff --git a/tests/baselines/reference/indexSignatureMustHaveTypeAnnotation.js b/tests/baselines/reference/indexSignatureMustHaveTypeAnnotation.js index 2aec01d1ff7d9..60cd04f49e29d 100644 --- a/tests/baselines/reference/indexSignatureMustHaveTypeAnnotation.js +++ b/tests/baselines/reference/indexSignatureMustHaveTypeAnnotation.js @@ -16,12 +16,12 @@ class C2 { } //// [indexSignatureMustHaveTypeAnnotation.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } return C; }()); -var C2 = (function () { +var C2 = /** @class */ (function () { function C2() { } return C2; diff --git a/tests/baselines/reference/indexSignatureTypeCheck2.js b/tests/baselines/reference/indexSignatureTypeCheck2.js index edc608d77e012..6d518d59f79d7 100644 --- a/tests/baselines/reference/indexSignatureTypeCheck2.js +++ b/tests/baselines/reference/indexSignatureTypeCheck2.js @@ -15,7 +15,7 @@ interface indexErrors { } //// [indexSignatureTypeCheck2.js] -var IPropertySet = (function () { +var IPropertySet = /** @class */ (function () { function IPropertySet() { } return IPropertySet; diff --git a/tests/baselines/reference/indexSignatureWithAccessibilityModifier.js b/tests/baselines/reference/indexSignatureWithAccessibilityModifier.js index 6055849062cd9..92e98ba67ae99 100644 --- a/tests/baselines/reference/indexSignatureWithAccessibilityModifier.js +++ b/tests/baselines/reference/indexSignatureWithAccessibilityModifier.js @@ -8,7 +8,7 @@ class C { } //// [indexSignatureWithAccessibilityModifier.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } return C; diff --git a/tests/baselines/reference/indexSignatureWithInitializer.js b/tests/baselines/reference/indexSignatureWithInitializer.js index 48b91c01d0377..9848555b650e2 100644 --- a/tests/baselines/reference/indexSignatureWithInitializer.js +++ b/tests/baselines/reference/indexSignatureWithInitializer.js @@ -9,7 +9,7 @@ class C { } //// [indexSignatureWithInitializer.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } return C; diff --git a/tests/baselines/reference/indexSignatureWithInitializer1.js b/tests/baselines/reference/indexSignatureWithInitializer1.js index 78a94d931abb0..dba425f6c6694 100644 --- a/tests/baselines/reference/indexSignatureWithInitializer1.js +++ b/tests/baselines/reference/indexSignatureWithInitializer1.js @@ -4,7 +4,7 @@ class C { } //// [indexSignatureWithInitializer1.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } return C; diff --git a/tests/baselines/reference/indexSignatureWithoutTypeAnnotation1.js b/tests/baselines/reference/indexSignatureWithoutTypeAnnotation1.js index 8871299c102cb..170be03c6278d 100644 --- a/tests/baselines/reference/indexSignatureWithoutTypeAnnotation1.js +++ b/tests/baselines/reference/indexSignatureWithoutTypeAnnotation1.js @@ -4,7 +4,7 @@ class C { } //// [indexSignatureWithoutTypeAnnotation1.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } return C; diff --git a/tests/baselines/reference/indexTypeCheck.js b/tests/baselines/reference/indexTypeCheck.js index bed15a58ae2d9..4e28f28bb5a0a 100644 --- a/tests/baselines/reference/indexTypeCheck.js +++ b/tests/baselines/reference/indexTypeCheck.js @@ -76,7 +76,7 @@ s[{}]; // ok yellow[blue]; // error var x; x[0]; -var Benchmark = (function () { +var Benchmark = /** @class */ (function () { function Benchmark() { this.results = {}; } diff --git a/tests/baselines/reference/indexWithoutParamType2.js b/tests/baselines/reference/indexWithoutParamType2.js index c84a5a8855ba4..a7f5675178bac 100644 --- a/tests/baselines/reference/indexWithoutParamType2.js +++ b/tests/baselines/reference/indexWithoutParamType2.js @@ -5,7 +5,7 @@ class C { } //// [indexWithoutParamType2.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } return C; diff --git a/tests/baselines/reference/indexedAccessRelation.js b/tests/baselines/reference/indexedAccessRelation.js index 10384c9eacd28..318fe295984e4 100644 --- a/tests/baselines/reference/indexedAccessRelation.js +++ b/tests/baselines/reference/indexedAccessRelation.js @@ -33,18 +33,18 @@ var __extends = (this && this.__extends) || (function () { }; })(); exports.__esModule = true; -var Component = (function () { +var Component = /** @class */ (function () { function Component() { } Component.prototype.setState = function (state) { }; return Component; }()); -var Foo = (function () { +var Foo = /** @class */ (function () { function Foo() { } return Foo; }()); -var Comp = (function (_super) { +var Comp = /** @class */ (function (_super) { __extends(Comp, _super); function Comp() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/indexedAccessTypeConstraints.js b/tests/baselines/reference/indexedAccessTypeConstraints.js index 075e93dfa2353..236f2f33ff703 100644 --- a/tests/baselines/reference/indexedAccessTypeConstraints.js +++ b/tests/baselines/reference/indexedAccessTypeConstraints.js @@ -49,7 +49,7 @@ var __extends = (this && this.__extends) || (function () { }; })(); exports.__esModule = true; -var Parent = (function () { +var Parent = /** @class */ (function () { function Parent() { } Parent.prototype.getData = function () { @@ -57,7 +57,7 @@ var Parent = (function () { }; return Parent; }()); -var Foo = (function (_super) { +var Foo = /** @class */ (function (_super) { __extends(Foo, _super); function Foo() { return _super !== null && _super.apply(this, arguments) || this; @@ -68,7 +68,7 @@ var Foo = (function (_super) { return Foo; }(Parent)); exports.Foo = Foo; -var Bar = (function (_super) { +var Bar = /** @class */ (function (_super) { __extends(Bar, _super); function Bar() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/indexer2A.js b/tests/baselines/reference/indexer2A.js index 5d5ef6e0aeabc..02d51b6682ebd 100644 --- a/tests/baselines/reference/indexer2A.js +++ b/tests/baselines/reference/indexer2A.js @@ -8,12 +8,12 @@ class IDirectChildrenMap { var directChildrenMap = {}; //// [indexer2A.js] -var IHeapObjectProperty = (function () { +var IHeapObjectProperty = /** @class */ (function () { function IHeapObjectProperty() { } return IHeapObjectProperty; }()); -var IDirectChildrenMap = (function () { +var IDirectChildrenMap = /** @class */ (function () { function IDirectChildrenMap() { } return IDirectChildrenMap; diff --git a/tests/baselines/reference/indexerA.js b/tests/baselines/reference/indexerA.js index dc8e92f22cf91..5350337f8115c 100644 --- a/tests/baselines/reference/indexerA.js +++ b/tests/baselines/reference/indexerA.js @@ -11,12 +11,12 @@ var jq:JQuery={ 0: { id : "a" }, 1: { id : "b" } }; jq[0].id; //// [indexerA.js] -var JQueryElement = (function () { +var JQueryElement = /** @class */ (function () { function JQueryElement() { } return JQueryElement; }()); -var JQuery = (function () { +var JQuery = /** @class */ (function () { function JQuery() { } return JQuery; diff --git a/tests/baselines/reference/indexerAsOptional.js b/tests/baselines/reference/indexerAsOptional.js index afe713a11022f..ae18707727ac3 100644 --- a/tests/baselines/reference/indexerAsOptional.js +++ b/tests/baselines/reference/indexerAsOptional.js @@ -10,7 +10,7 @@ class indexSig2 { } //// [indexerAsOptional.js] -var indexSig2 = (function () { +var indexSig2 = /** @class */ (function () { function indexSig2() { } return indexSig2; diff --git a/tests/baselines/reference/indexerConstraints2.js b/tests/baselines/reference/indexerConstraints2.js index 4336fd2ff32b0..f5bfc3c64d87a 100644 --- a/tests/baselines/reference/indexerConstraints2.js +++ b/tests/baselines/reference/indexerConstraints2.js @@ -39,12 +39,12 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var A = (function () { +var A = /** @class */ (function () { function A() { } return A; }()); -var B = (function (_super) { +var B = /** @class */ (function (_super) { __extends(B, _super); function B() { return _super !== null && _super.apply(this, arguments) || this; @@ -52,12 +52,12 @@ var B = (function (_super) { return B; }(A)); // Inheritance -var F = (function () { +var F = /** @class */ (function () { function F() { } return F; }()); -var G = (function (_super) { +var G = /** @class */ (function (_super) { __extends(G, _super); function G() { return _super !== null && _super.apply(this, arguments) || this; @@ -65,12 +65,12 @@ var G = (function (_super) { return G; }(F)); // Other way -var H = (function () { +var H = /** @class */ (function () { function H() { } return H; }()); -var I = (function (_super) { +var I = /** @class */ (function (_super) { __extends(I, _super); function I() { return _super !== null && _super.apply(this, arguments) || this; @@ -78,12 +78,12 @@ var I = (function (_super) { return I; }(H)); // With hidden indexer -var J = (function () { +var J = /** @class */ (function () { function J() { } return J; }()); -var K = (function (_super) { +var K = /** @class */ (function (_super) { __extends(K, _super); function K() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/indexerReturningTypeParameter1.js b/tests/baselines/reference/indexerReturningTypeParameter1.js index cdc1bdf19d1e5..7ab10ab43afed 100644 --- a/tests/baselines/reference/indexerReturningTypeParameter1.js +++ b/tests/baselines/reference/indexerReturningTypeParameter1.js @@ -16,7 +16,7 @@ var r2 = a2.groupBy(); //// [indexerReturningTypeParameter1.js] var a; var r = a.groupBy(); -var c = (function () { +var c = /** @class */ (function () { function c() { } c.prototype.groupBy = function () { diff --git a/tests/baselines/reference/indexerSignatureWithRestParam.js b/tests/baselines/reference/indexerSignatureWithRestParam.js index 3f6f149bd7f19..e80f401af1590 100644 --- a/tests/baselines/reference/indexerSignatureWithRestParam.js +++ b/tests/baselines/reference/indexerSignatureWithRestParam.js @@ -8,7 +8,7 @@ class C { } //// [indexerSignatureWithRestParam.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } return C; diff --git a/tests/baselines/reference/indexersInClassType.js b/tests/baselines/reference/indexersInClassType.js index 9b085aa8fe279..67123f2178e16 100644 --- a/tests/baselines/reference/indexersInClassType.js +++ b/tests/baselines/reference/indexersInClassType.js @@ -18,7 +18,7 @@ var r3 = r.a //// [indexersInClassType.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } C.prototype.fn = function () { diff --git a/tests/baselines/reference/indirectSelfReference.js b/tests/baselines/reference/indirectSelfReference.js index 6410e463dbb03..4720e94d3090c 100644 --- a/tests/baselines/reference/indirectSelfReference.js +++ b/tests/baselines/reference/indirectSelfReference.js @@ -13,14 +13,14 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var a = (function (_super) { +var a = /** @class */ (function (_super) { __extends(a, _super); function a() { return _super !== null && _super.apply(this, arguments) || this; } return a; }(b)); -var b = (function (_super) { +var b = /** @class */ (function (_super) { __extends(b, _super); function b() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/indirectSelfReferenceGeneric.js b/tests/baselines/reference/indirectSelfReferenceGeneric.js index 695970159d9fe..c253eeeabcba4 100644 --- a/tests/baselines/reference/indirectSelfReferenceGeneric.js +++ b/tests/baselines/reference/indirectSelfReferenceGeneric.js @@ -13,14 +13,14 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var a = (function (_super) { +var a = /** @class */ (function (_super) { __extends(a, _super); function a() { return _super !== null && _super.apply(this, arguments) || this; } return a; }(b)); -var b = (function (_super) { +var b = /** @class */ (function (_super) { __extends(b, _super); function b() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/inferFromGenericFunctionReturnTypes1.js b/tests/baselines/reference/inferFromGenericFunctionReturnTypes1.js index 0c3cf4b0cbeb6..36a12ceadda5b 100644 --- a/tests/baselines/reference/inferFromGenericFunctionReturnTypes1.js +++ b/tests/baselines/reference/inferFromGenericFunctionReturnTypes1.js @@ -74,7 +74,7 @@ testSet.transform( //// [inferFromGenericFunctionReturnTypes1.js] // Repro from #15680 // This is a contrived class. We could do the same thing with Observables, etc. -var SetOf = (function () { +var SetOf = /** @class */ (function () { function SetOf() { } SetOf.prototype.add = function (a) { diff --git a/tests/baselines/reference/inferFromGenericFunctionReturnTypes2.js b/tests/baselines/reference/inferFromGenericFunctionReturnTypes2.js index 3f95b10d08a08..332de9e7409af 100644 --- a/tests/baselines/reference/inferFromGenericFunctionReturnTypes2.js +++ b/tests/baselines/reference/inferFromGenericFunctionReturnTypes2.js @@ -108,7 +108,7 @@ var a4 = ["a", "b"].map(combine(wrap(function (s) { return s.length; }), wrap(fu var a5 = ["a", "b"].map(combine(identity, wrap(function (s) { return s.length; }))); var a6 = ["a", "b"].map(combine(wrap(function (s) { return s.length; }), identity)); // This is a contrived class. We could do the same thing with Observables, etc. -var SetOf = (function () { +var SetOf = /** @class */ (function () { function SetOf() { } SetOf.prototype.add = function (a) { diff --git a/tests/baselines/reference/inferParameterWithMethodCallInitializer.js b/tests/baselines/reference/inferParameterWithMethodCallInitializer.js index 5b33f78f766b8..cdd0a19030068 100644 --- a/tests/baselines/reference/inferParameterWithMethodCallInitializer.js +++ b/tests/baselines/reference/inferParameterWithMethodCallInitializer.js @@ -24,7 +24,7 @@ class Weird { function getNumber() { return 1; } -var Example = (function () { +var Example = /** @class */ (function () { function Example() { } Example.prototype.getNumber = function () { @@ -40,7 +40,7 @@ function weird(a) { if (a === void 0) { a = this.getNumber(); } return a; } -var Weird = (function () { +var Weird = /** @class */ (function () { function Weird() { } Weird.prototype.doSomething = function (a) { diff --git a/tests/baselines/reference/inferSetterParamType.js b/tests/baselines/reference/inferSetterParamType.js index 33f785aab620f..7c1c2a44ecb3a 100644 --- a/tests/baselines/reference/inferSetterParamType.js +++ b/tests/baselines/reference/inferSetterParamType.js @@ -19,7 +19,7 @@ class Foo2 { //// [inferSetterParamType.js] -var Foo = (function () { +var Foo = /** @class */ (function () { function Foo() { } Object.defineProperty(Foo.prototype, "bar", { @@ -33,7 +33,7 @@ var Foo = (function () { }); return Foo; }()); -var Foo2 = (function () { +var Foo2 = /** @class */ (function () { function Foo2() { } Object.defineProperty(Foo2.prototype, "bar", { diff --git a/tests/baselines/reference/inferentialTypingUsingApparentType3.js b/tests/baselines/reference/inferentialTypingUsingApparentType3.js index f637537536699..7d6ffc5353b1a 100644 --- a/tests/baselines/reference/inferentialTypingUsingApparentType3.js +++ b/tests/baselines/reference/inferentialTypingUsingApparentType3.js @@ -27,7 +27,7 @@ var person = new ObjectField({ person.fields.id; //// [inferentialTypingUsingApparentType3.js] -var CharField = (function () { +var CharField = /** @class */ (function () { function CharField() { } CharField.prototype.clean = function (input) { @@ -35,7 +35,7 @@ var CharField = (function () { }; return CharField; }()); -var NumberField = (function () { +var NumberField = /** @class */ (function () { function NumberField() { } NumberField.prototype.clean = function (input) { @@ -43,7 +43,7 @@ var NumberField = (function () { }; return NumberField; }()); -var ObjectField = (function () { +var ObjectField = /** @class */ (function () { function ObjectField(fields) { this.fields = fields; } diff --git a/tests/baselines/reference/inferringClassMembersFromAssignments.js b/tests/baselines/reference/inferringClassMembersFromAssignments.js index c6a6d0c4e27d0..3fa72bce2cf5b 100644 --- a/tests/baselines/reference/inferringClassMembersFromAssignments.js +++ b/tests/baselines/reference/inferringClassMembersFromAssignments.js @@ -124,7 +124,7 @@ var stringOrNumberOrUndefined = C.inStaticNestedArrowFunction; //// [output.js] -var C = (function () { +var C = /** @class */ (function () { function C() { var _this = this; this.prop = function () { diff --git a/tests/baselines/reference/infinitelyExpandingOverloads.js b/tests/baselines/reference/infinitelyExpandingOverloads.js index a16baaa6d6c27..fcf21983b7a4c 100644 --- a/tests/baselines/reference/infinitelyExpandingOverloads.js +++ b/tests/baselines/reference/infinitelyExpandingOverloads.js @@ -27,18 +27,18 @@ class Widget { } //// [infinitelyExpandingOverloads.js] -var Validator2 = (function () { +var Validator2 = /** @class */ (function () { function Validator2() { } return Validator2; }()); -var ViewModel = (function () { +var ViewModel = /** @class */ (function () { function ViewModel() { this.validationPlacements = new Array(); } return ViewModel; }()); -var Widget = (function () { +var Widget = /** @class */ (function () { function Widget(viewModelType) { } Object.defineProperty(Widget.prototype, "options", { diff --git a/tests/baselines/reference/infinitelyExpandingTypesNonGenericBase.js b/tests/baselines/reference/infinitelyExpandingTypesNonGenericBase.js index fd9bbac16235d..d38a2a2a22c29 100644 --- a/tests/baselines/reference/infinitelyExpandingTypesNonGenericBase.js +++ b/tests/baselines/reference/infinitelyExpandingTypesNonGenericBase.js @@ -35,17 +35,17 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var Functionality = (function () { +var Functionality = /** @class */ (function () { function Functionality() { } return Functionality; }()); -var Base = (function () { +var Base = /** @class */ (function () { function Base() { } return Base; }()); -var A = (function (_super) { +var A = /** @class */ (function (_super) { __extends(A, _super); function A() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/inheritFromGenericTypeParameter.js b/tests/baselines/reference/inheritFromGenericTypeParameter.js index f8145ec2c011d..ee782758f6e14 100644 --- a/tests/baselines/reference/inheritFromGenericTypeParameter.js +++ b/tests/baselines/reference/inheritFromGenericTypeParameter.js @@ -13,7 +13,7 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var C = (function (_super) { +var C = /** @class */ (function (_super) { __extends(C, _super); function C() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/inheritSameNamePrivatePropertiesFromDifferentOrigins.js b/tests/baselines/reference/inheritSameNamePrivatePropertiesFromDifferentOrigins.js index dec161d95ac25..dd3b489c59aad 100644 --- a/tests/baselines/reference/inheritSameNamePrivatePropertiesFromDifferentOrigins.js +++ b/tests/baselines/reference/inheritSameNamePrivatePropertiesFromDifferentOrigins.js @@ -12,12 +12,12 @@ interface A extends C, C2 { // error } //// [inheritSameNamePrivatePropertiesFromDifferentOrigins.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } return C; }()); -var C2 = (function () { +var C2 = /** @class */ (function () { function C2() { } return C2; diff --git a/tests/baselines/reference/inheritSameNamePrivatePropertiesFromSameOrigin.js b/tests/baselines/reference/inheritSameNamePrivatePropertiesFromSameOrigin.js index 138e3aa5694a3..07cf281fcfd67 100644 --- a/tests/baselines/reference/inheritSameNamePrivatePropertiesFromSameOrigin.js +++ b/tests/baselines/reference/inheritSameNamePrivatePropertiesFromSameOrigin.js @@ -21,19 +21,19 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var B = (function () { +var B = /** @class */ (function () { function B() { } return B; }()); -var C = (function (_super) { +var C = /** @class */ (function (_super) { __extends(C, _super); function C() { return _super !== null && _super.apply(this, arguments) || this; } return C; }(B)); -var C2 = (function (_super) { +var C2 = /** @class */ (function (_super) { __extends(C2, _super); function C2() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/inheritSameNamePropertiesWithDifferentVisibility.js b/tests/baselines/reference/inheritSameNamePropertiesWithDifferentVisibility.js index fff751e4cd75c..8152e5f217326 100644 --- a/tests/baselines/reference/inheritSameNamePropertiesWithDifferentVisibility.js +++ b/tests/baselines/reference/inheritSameNamePropertiesWithDifferentVisibility.js @@ -12,12 +12,12 @@ interface A extends C, C2 { // error } //// [inheritSameNamePropertiesWithDifferentVisibility.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } return C; }()); -var C2 = (function () { +var C2 = /** @class */ (function () { function C2() { } return C2; diff --git a/tests/baselines/reference/inheritance.js b/tests/baselines/reference/inheritance.js index 48d96b10f9c50..049f43dde0fed 100644 --- a/tests/baselines/reference/inheritance.js +++ b/tests/baselines/reference/inheritance.js @@ -45,50 +45,50 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var B1 = (function () { +var B1 = /** @class */ (function () { function B1() { } return B1; }()); -var B2 = (function () { +var B2 = /** @class */ (function () { function B2() { } return B2; }()); -var D1 = (function (_super) { +var D1 = /** @class */ (function (_super) { __extends(D1, _super); function D1() { return _super !== null && _super.apply(this, arguments) || this; } return D1; }(B1)); -var D2 = (function (_super) { +var D2 = /** @class */ (function (_super) { __extends(D2, _super); function D2() { return _super !== null && _super.apply(this, arguments) || this; } return D2; }(B2)); -var N = (function () { +var N = /** @class */ (function () { function N() { } return N; }()); -var ND = (function (_super) { +var ND = /** @class */ (function (_super) { __extends(ND, _super); function ND() { return _super !== null && _super.apply(this, arguments) || this; } return ND; }(N)); -var Good = (function () { +var Good = /** @class */ (function () { function Good() { this.f = function () { return 0; }; } Good.prototype.g = function () { return 0; }; return Good; }()); -var Baad = (function (_super) { +var Baad = /** @class */ (function (_super) { __extends(Baad, _super); function Baad() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/inheritance1.js b/tests/baselines/reference/inheritance1.js index a00330e855688..833cde761a870 100644 --- a/tests/baselines/reference/inheritance1.js +++ b/tests/baselines/reference/inheritance1.js @@ -72,12 +72,12 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var Control = (function () { +var Control = /** @class */ (function () { function Control() { } return Control; }()); -var Button = (function (_super) { +var Button = /** @class */ (function (_super) { __extends(Button, _super); function Button() { return _super !== null && _super.apply(this, arguments) || this; @@ -85,7 +85,7 @@ var Button = (function (_super) { Button.prototype.select = function () { }; return Button; }(Control)); -var TextBox = (function (_super) { +var TextBox = /** @class */ (function (_super) { __extends(TextBox, _super); function TextBox() { return _super !== null && _super.apply(this, arguments) || this; @@ -93,27 +93,27 @@ var TextBox = (function (_super) { TextBox.prototype.select = function () { }; return TextBox; }(Control)); -var ImageBase = (function (_super) { +var ImageBase = /** @class */ (function (_super) { __extends(ImageBase, _super); function ImageBase() { return _super !== null && _super.apply(this, arguments) || this; } return ImageBase; }(Control)); -var Image1 = (function (_super) { +var Image1 = /** @class */ (function (_super) { __extends(Image1, _super); function Image1() { return _super !== null && _super.apply(this, arguments) || this; } return Image1; }(Control)); -var Locations = (function () { +var Locations = /** @class */ (function () { function Locations() { } Locations.prototype.select = function () { }; return Locations; }()); -var Locations1 = (function () { +var Locations1 = /** @class */ (function () { function Locations1() { } Locations1.prototype.select = function () { }; diff --git a/tests/baselines/reference/inheritanceGrandParentPrivateMemberCollision.js b/tests/baselines/reference/inheritanceGrandParentPrivateMemberCollision.js index 52ab48573fd38..7cc9e923fbce4 100644 --- a/tests/baselines/reference/inheritanceGrandParentPrivateMemberCollision.js +++ b/tests/baselines/reference/inheritanceGrandParentPrivateMemberCollision.js @@ -21,20 +21,20 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var A = (function () { +var A = /** @class */ (function () { function A() { } A.prototype.myMethod = function () { }; return A; }()); -var B = (function (_super) { +var B = /** @class */ (function (_super) { __extends(B, _super); function B() { return _super !== null && _super.apply(this, arguments) || this; } return B; }(A)); -var C = (function (_super) { +var C = /** @class */ (function (_super) { __extends(C, _super); function C() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/inheritanceGrandParentPrivateMemberCollisionWithPublicMember.js b/tests/baselines/reference/inheritanceGrandParentPrivateMemberCollisionWithPublicMember.js index c64a0e4259c6c..7ccb84e27c737 100644 --- a/tests/baselines/reference/inheritanceGrandParentPrivateMemberCollisionWithPublicMember.js +++ b/tests/baselines/reference/inheritanceGrandParentPrivateMemberCollisionWithPublicMember.js @@ -21,20 +21,20 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var A = (function () { +var A = /** @class */ (function () { function A() { } A.prototype.myMethod = function () { }; return A; }()); -var B = (function (_super) { +var B = /** @class */ (function (_super) { __extends(B, _super); function B() { return _super !== null && _super.apply(this, arguments) || this; } return B; }(A)); -var C = (function (_super) { +var C = /** @class */ (function (_super) { __extends(C, _super); function C() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/inheritanceGrandParentPublicMemberCollisionWithPrivateMember.js b/tests/baselines/reference/inheritanceGrandParentPublicMemberCollisionWithPrivateMember.js index 9ac0fe1859250..bb08eb451dd2e 100644 --- a/tests/baselines/reference/inheritanceGrandParentPublicMemberCollisionWithPrivateMember.js +++ b/tests/baselines/reference/inheritanceGrandParentPublicMemberCollisionWithPrivateMember.js @@ -21,20 +21,20 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var A = (function () { +var A = /** @class */ (function () { function A() { } A.prototype.myMethod = function () { }; return A; }()); -var B = (function (_super) { +var B = /** @class */ (function (_super) { __extends(B, _super); function B() { return _super !== null && _super.apply(this, arguments) || this; } return B; }(A)); -var C = (function (_super) { +var C = /** @class */ (function (_super) { __extends(C, _super); function C() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/inheritanceMemberAccessorOverridingAccessor.js b/tests/baselines/reference/inheritanceMemberAccessorOverridingAccessor.js index fae79488dce9a..3e0fca2d4fafb 100644 --- a/tests/baselines/reference/inheritanceMemberAccessorOverridingAccessor.js +++ b/tests/baselines/reference/inheritanceMemberAccessorOverridingAccessor.js @@ -28,7 +28,7 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var a = (function () { +var a = /** @class */ (function () { function a() { } Object.defineProperty(a.prototype, "x", { @@ -42,7 +42,7 @@ var a = (function () { }); return a; }()); -var b = (function (_super) { +var b = /** @class */ (function (_super) { __extends(b, _super); function b() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/inheritanceMemberAccessorOverridingMethod.js b/tests/baselines/reference/inheritanceMemberAccessorOverridingMethod.js index 3fc6417afafe4..bf309a975733d 100644 --- a/tests/baselines/reference/inheritanceMemberAccessorOverridingMethod.js +++ b/tests/baselines/reference/inheritanceMemberAccessorOverridingMethod.js @@ -25,7 +25,7 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var a = (function () { +var a = /** @class */ (function () { function a() { } a.prototype.x = function () { @@ -33,7 +33,7 @@ var a = (function () { }; return a; }()); -var b = (function (_super) { +var b = /** @class */ (function (_super) { __extends(b, _super); function b() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/inheritanceMemberAccessorOverridingProperty.js b/tests/baselines/reference/inheritanceMemberAccessorOverridingProperty.js index 1d0a8f09a4024..0d87721ab7dfb 100644 --- a/tests/baselines/reference/inheritanceMemberAccessorOverridingProperty.js +++ b/tests/baselines/reference/inheritanceMemberAccessorOverridingProperty.js @@ -23,12 +23,12 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var a = (function () { +var a = /** @class */ (function () { function a() { } return a; }()); -var b = (function (_super) { +var b = /** @class */ (function (_super) { __extends(b, _super); function b() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/inheritanceMemberFuncOverridingAccessor.js b/tests/baselines/reference/inheritanceMemberFuncOverridingAccessor.js index 93b72b73c8b0b..6e61ea69c78d6 100644 --- a/tests/baselines/reference/inheritanceMemberFuncOverridingAccessor.js +++ b/tests/baselines/reference/inheritanceMemberFuncOverridingAccessor.js @@ -25,7 +25,7 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var a = (function () { +var a = /** @class */ (function () { function a() { } Object.defineProperty(a.prototype, "x", { @@ -39,7 +39,7 @@ var a = (function () { }); return a; }()); -var b = (function (_super) { +var b = /** @class */ (function (_super) { __extends(b, _super); function b() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/inheritanceMemberFuncOverridingMethod.js b/tests/baselines/reference/inheritanceMemberFuncOverridingMethod.js index 0f189aa50cc97..c326e74f2240e 100644 --- a/tests/baselines/reference/inheritanceMemberFuncOverridingMethod.js +++ b/tests/baselines/reference/inheritanceMemberFuncOverridingMethod.js @@ -22,7 +22,7 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var a = (function () { +var a = /** @class */ (function () { function a() { } a.prototype.x = function () { @@ -30,7 +30,7 @@ var a = (function () { }; return a; }()); -var b = (function (_super) { +var b = /** @class */ (function (_super) { __extends(b, _super); function b() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/inheritanceMemberFuncOverridingProperty.js b/tests/baselines/reference/inheritanceMemberFuncOverridingProperty.js index 996138a53d922..a74d560188d66 100644 --- a/tests/baselines/reference/inheritanceMemberFuncOverridingProperty.js +++ b/tests/baselines/reference/inheritanceMemberFuncOverridingProperty.js @@ -20,12 +20,12 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var a = (function () { +var a = /** @class */ (function () { function a() { } return a; }()); -var b = (function (_super) { +var b = /** @class */ (function (_super) { __extends(b, _super); function b() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/inheritanceMemberPropertyOverridingAccessor.js b/tests/baselines/reference/inheritanceMemberPropertyOverridingAccessor.js index 97b856980eacd..27ad7fcf08b85 100644 --- a/tests/baselines/reference/inheritanceMemberPropertyOverridingAccessor.js +++ b/tests/baselines/reference/inheritanceMemberPropertyOverridingAccessor.js @@ -24,7 +24,7 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var a = (function () { +var a = /** @class */ (function () { function a() { } Object.defineProperty(a.prototype, "x", { @@ -39,7 +39,7 @@ var a = (function () { }); return a; }()); -var b = (function (_super) { +var b = /** @class */ (function (_super) { __extends(b, _super); function b() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/inheritanceMemberPropertyOverridingMethod.js b/tests/baselines/reference/inheritanceMemberPropertyOverridingMethod.js index c7c6c84f9d024..9ffb3b3948332 100644 --- a/tests/baselines/reference/inheritanceMemberPropertyOverridingMethod.js +++ b/tests/baselines/reference/inheritanceMemberPropertyOverridingMethod.js @@ -20,7 +20,7 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var a = (function () { +var a = /** @class */ (function () { function a() { } a.prototype.x = function () { @@ -28,7 +28,7 @@ var a = (function () { }; return a; }()); -var b = (function (_super) { +var b = /** @class */ (function (_super) { __extends(b, _super); function b() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/inheritanceMemberPropertyOverridingProperty.js b/tests/baselines/reference/inheritanceMemberPropertyOverridingProperty.js index c8e9c5ef9d42c..31627899e11ae 100644 --- a/tests/baselines/reference/inheritanceMemberPropertyOverridingProperty.js +++ b/tests/baselines/reference/inheritanceMemberPropertyOverridingProperty.js @@ -18,12 +18,12 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var a = (function () { +var a = /** @class */ (function () { function a() { } return a; }()); -var b = (function (_super) { +var b = /** @class */ (function (_super) { __extends(b, _super); function b() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/inheritanceOfGenericConstructorMethod1.js b/tests/baselines/reference/inheritanceOfGenericConstructorMethod1.js index 62355930d9217..9c0f4f0dfe913 100644 --- a/tests/baselines/reference/inheritanceOfGenericConstructorMethod1.js +++ b/tests/baselines/reference/inheritanceOfGenericConstructorMethod1.js @@ -18,12 +18,12 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var A = (function () { +var A = /** @class */ (function () { function A() { } return A; }()); -var B = (function (_super) { +var B = /** @class */ (function (_super) { __extends(B, _super); function B() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/inheritanceOfGenericConstructorMethod2.js b/tests/baselines/reference/inheritanceOfGenericConstructorMethod2.js index 12c5eac07e91e..68480c97cc9d7 100644 --- a/tests/baselines/reference/inheritanceOfGenericConstructorMethod2.js +++ b/tests/baselines/reference/inheritanceOfGenericConstructorMethod2.js @@ -27,13 +27,13 @@ var __extends = (this && this.__extends) || (function () { })(); var M; (function (M) { - var C1 = (function () { + var C1 = /** @class */ (function () { function C1() { } return C1; }()); M.C1 = C1; - var C2 = (function () { + var C2 = /** @class */ (function () { function C2() { } return C2; @@ -42,7 +42,7 @@ var M; })(M || (M = {})); var N; (function (N) { - var D1 = (function (_super) { + var D1 = /** @class */ (function (_super) { __extends(D1, _super); function D1() { return _super !== null && _super.apply(this, arguments) || this; @@ -50,7 +50,7 @@ var N; return D1; }(M.C1)); N.D1 = D1; - var D2 = (function (_super) { + var D2 = /** @class */ (function (_super) { __extends(D2, _super); function D2() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/inheritanceStaticAccessorOverridingAccessor.js b/tests/baselines/reference/inheritanceStaticAccessorOverridingAccessor.js index 4af25e03d13a2..109e0429ec021 100644 --- a/tests/baselines/reference/inheritanceStaticAccessorOverridingAccessor.js +++ b/tests/baselines/reference/inheritanceStaticAccessorOverridingAccessor.js @@ -28,7 +28,7 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var a = (function () { +var a = /** @class */ (function () { function a() { } Object.defineProperty(a, "x", { @@ -42,7 +42,7 @@ var a = (function () { }); return a; }()); -var b = (function (_super) { +var b = /** @class */ (function (_super) { __extends(b, _super); function b() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/inheritanceStaticAccessorOverridingMethod.js b/tests/baselines/reference/inheritanceStaticAccessorOverridingMethod.js index 904868fecd971..405627bc4b60e 100644 --- a/tests/baselines/reference/inheritanceStaticAccessorOverridingMethod.js +++ b/tests/baselines/reference/inheritanceStaticAccessorOverridingMethod.js @@ -25,7 +25,7 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var a = (function () { +var a = /** @class */ (function () { function a() { } a.x = function () { @@ -33,7 +33,7 @@ var a = (function () { }; return a; }()); -var b = (function (_super) { +var b = /** @class */ (function (_super) { __extends(b, _super); function b() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/inheritanceStaticAccessorOverridingProperty.js b/tests/baselines/reference/inheritanceStaticAccessorOverridingProperty.js index cf6e23685f112..85e6863a1ab78 100644 --- a/tests/baselines/reference/inheritanceStaticAccessorOverridingProperty.js +++ b/tests/baselines/reference/inheritanceStaticAccessorOverridingProperty.js @@ -23,12 +23,12 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var a = (function () { +var a = /** @class */ (function () { function a() { } return a; }()); -var b = (function (_super) { +var b = /** @class */ (function (_super) { __extends(b, _super); function b() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/inheritanceStaticFuncOverridingAccessor.js b/tests/baselines/reference/inheritanceStaticFuncOverridingAccessor.js index 91946af74789b..ce72c5314e591 100644 --- a/tests/baselines/reference/inheritanceStaticFuncOverridingAccessor.js +++ b/tests/baselines/reference/inheritanceStaticFuncOverridingAccessor.js @@ -25,7 +25,7 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var a = (function () { +var a = /** @class */ (function () { function a() { } Object.defineProperty(a, "x", { @@ -39,7 +39,7 @@ var a = (function () { }); return a; }()); -var b = (function (_super) { +var b = /** @class */ (function (_super) { __extends(b, _super); function b() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/inheritanceStaticFuncOverridingAccessorOfFuncType.js b/tests/baselines/reference/inheritanceStaticFuncOverridingAccessorOfFuncType.js index 9b7e0dd925cc0..4d6a3b20f0763 100644 --- a/tests/baselines/reference/inheritanceStaticFuncOverridingAccessorOfFuncType.js +++ b/tests/baselines/reference/inheritanceStaticFuncOverridingAccessorOfFuncType.js @@ -22,7 +22,7 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var a = (function () { +var a = /** @class */ (function () { function a() { } Object.defineProperty(a, "x", { @@ -34,7 +34,7 @@ var a = (function () { }); return a; }()); -var b = (function (_super) { +var b = /** @class */ (function (_super) { __extends(b, _super); function b() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/inheritanceStaticFuncOverridingMethod.js b/tests/baselines/reference/inheritanceStaticFuncOverridingMethod.js index 7e50c2c03183f..641957535bb01 100644 --- a/tests/baselines/reference/inheritanceStaticFuncOverridingMethod.js +++ b/tests/baselines/reference/inheritanceStaticFuncOverridingMethod.js @@ -22,7 +22,7 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var a = (function () { +var a = /** @class */ (function () { function a() { } a.x = function () { @@ -30,7 +30,7 @@ var a = (function () { }; return a; }()); -var b = (function (_super) { +var b = /** @class */ (function (_super) { __extends(b, _super); function b() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/inheritanceStaticFuncOverridingProperty.js b/tests/baselines/reference/inheritanceStaticFuncOverridingProperty.js index fab0f4fb579de..11401e2f9018a 100644 --- a/tests/baselines/reference/inheritanceStaticFuncOverridingProperty.js +++ b/tests/baselines/reference/inheritanceStaticFuncOverridingProperty.js @@ -20,12 +20,12 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var a = (function () { +var a = /** @class */ (function () { function a() { } return a; }()); -var b = (function (_super) { +var b = /** @class */ (function (_super) { __extends(b, _super); function b() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/inheritanceStaticFuncOverridingPropertyOfFuncType.js b/tests/baselines/reference/inheritanceStaticFuncOverridingPropertyOfFuncType.js index b973095e5b812..a15f56da7affc 100644 --- a/tests/baselines/reference/inheritanceStaticFuncOverridingPropertyOfFuncType.js +++ b/tests/baselines/reference/inheritanceStaticFuncOverridingPropertyOfFuncType.js @@ -20,12 +20,12 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var a = (function () { +var a = /** @class */ (function () { function a() { } return a; }()); -var b = (function (_super) { +var b = /** @class */ (function (_super) { __extends(b, _super); function b() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/inheritanceStaticFunctionOverridingInstanceProperty.js b/tests/baselines/reference/inheritanceStaticFunctionOverridingInstanceProperty.js index 017adeea3c7d2..a231a9ea92a1f 100644 --- a/tests/baselines/reference/inheritanceStaticFunctionOverridingInstanceProperty.js +++ b/tests/baselines/reference/inheritanceStaticFunctionOverridingInstanceProperty.js @@ -20,12 +20,12 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var a = (function () { +var a = /** @class */ (function () { function a() { } return a; }()); -var b = (function (_super) { +var b = /** @class */ (function (_super) { __extends(b, _super); function b() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/inheritanceStaticMembersCompatible.js b/tests/baselines/reference/inheritanceStaticMembersCompatible.js index 96416e977fa9f..45684a4c81575 100644 --- a/tests/baselines/reference/inheritanceStaticMembersCompatible.js +++ b/tests/baselines/reference/inheritanceStaticMembersCompatible.js @@ -18,12 +18,12 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var a = (function () { +var a = /** @class */ (function () { function a() { } return a; }()); -var b = (function (_super) { +var b = /** @class */ (function (_super) { __extends(b, _super); function b() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/inheritanceStaticMembersIncompatible.js b/tests/baselines/reference/inheritanceStaticMembersIncompatible.js index 15f3298f2cc11..0683471e58513 100644 --- a/tests/baselines/reference/inheritanceStaticMembersIncompatible.js +++ b/tests/baselines/reference/inheritanceStaticMembersIncompatible.js @@ -18,12 +18,12 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var a = (function () { +var a = /** @class */ (function () { function a() { } return a; }()); -var b = (function (_super) { +var b = /** @class */ (function (_super) { __extends(b, _super); function b() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/inheritanceStaticPropertyOverridingAccessor.js b/tests/baselines/reference/inheritanceStaticPropertyOverridingAccessor.js index 3c19e3c5f67e1..87df64db68d0f 100644 --- a/tests/baselines/reference/inheritanceStaticPropertyOverridingAccessor.js +++ b/tests/baselines/reference/inheritanceStaticPropertyOverridingAccessor.js @@ -22,7 +22,7 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var a = (function () { +var a = /** @class */ (function () { function a() { } Object.defineProperty(a, "x", { @@ -37,7 +37,7 @@ var a = (function () { }); return a; }()); -var b = (function (_super) { +var b = /** @class */ (function (_super) { __extends(b, _super); function b() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/inheritanceStaticPropertyOverridingMethod.js b/tests/baselines/reference/inheritanceStaticPropertyOverridingMethod.js index 1ec8e5f5f65ab..a14f9f7106c43 100644 --- a/tests/baselines/reference/inheritanceStaticPropertyOverridingMethod.js +++ b/tests/baselines/reference/inheritanceStaticPropertyOverridingMethod.js @@ -20,7 +20,7 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var a = (function () { +var a = /** @class */ (function () { function a() { } a.x = function () { @@ -28,7 +28,7 @@ var a = (function () { }; return a; }()); -var b = (function (_super) { +var b = /** @class */ (function (_super) { __extends(b, _super); function b() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/inheritanceStaticPropertyOverridingProperty.js b/tests/baselines/reference/inheritanceStaticPropertyOverridingProperty.js index 6c83789d51d07..a19c863848aae 100644 --- a/tests/baselines/reference/inheritanceStaticPropertyOverridingProperty.js +++ b/tests/baselines/reference/inheritanceStaticPropertyOverridingProperty.js @@ -18,12 +18,12 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var a = (function () { +var a = /** @class */ (function () { function a() { } return a; }()); -var b = (function (_super) { +var b = /** @class */ (function (_super) { __extends(b, _super); function b() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/inheritedConstructorWithRestParams.js b/tests/baselines/reference/inheritedConstructorWithRestParams.js index 5e7e37368854d..0e1291a2ee0d3 100644 --- a/tests/baselines/reference/inheritedConstructorWithRestParams.js +++ b/tests/baselines/reference/inheritedConstructorWithRestParams.js @@ -25,7 +25,7 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var Base = (function () { +var Base = /** @class */ (function () { function Base() { var a = []; for (var _i = 0; _i < arguments.length; _i++) { @@ -34,7 +34,7 @@ var Base = (function () { } return Base; }()); -var Derived = (function (_super) { +var Derived = /** @class */ (function (_super) { __extends(Derived, _super); function Derived() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/inheritedConstructorWithRestParams2.js b/tests/baselines/reference/inheritedConstructorWithRestParams2.js index c27b723b56286..ec53f94918008 100644 --- a/tests/baselines/reference/inheritedConstructorWithRestParams2.js +++ b/tests/baselines/reference/inheritedConstructorWithRestParams2.js @@ -45,24 +45,24 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var IBaseBase = (function () { +var IBaseBase = /** @class */ (function () { function IBaseBase(x) { } return IBaseBase; }()); -var BaseBase2 = (function () { +var BaseBase2 = /** @class */ (function () { function BaseBase2(x) { } return BaseBase2; }()); -var Base = (function (_super) { +var Base = /** @class */ (function (_super) { __extends(Base, _super); function Base() { return _super !== null && _super.apply(this, arguments) || this; } return Base; }(BaseBase)); -var Derived = (function (_super) { +var Derived = /** @class */ (function (_super) { __extends(Derived, _super); function Derived() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/inheritedModuleMembersForClodule.js b/tests/baselines/reference/inheritedModuleMembersForClodule.js index be7aec77731ac..894f50148c8a9 100644 --- a/tests/baselines/reference/inheritedModuleMembersForClodule.js +++ b/tests/baselines/reference/inheritedModuleMembersForClodule.js @@ -32,7 +32,7 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var C = (function () { +var C = /** @class */ (function () { function C() { } C.foo = function () { @@ -40,7 +40,7 @@ var C = (function () { }; return C; }()); -var D = (function (_super) { +var D = /** @class */ (function (_super) { __extends(D, _super); function D() { return _super !== null && _super.apply(this, arguments) || this; @@ -54,7 +54,7 @@ var D = (function (_super) { D.foo = foo; ; })(D || (D = {})); -var E = (function (_super) { +var E = /** @class */ (function (_super) { __extends(E, _super); function E() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/initializerReferencingConstructorLocals.js b/tests/baselines/reference/initializerReferencingConstructorLocals.js index a4922e954d7a6..b192d7b9dc3d2 100644 --- a/tests/baselines/reference/initializerReferencingConstructorLocals.js +++ b/tests/baselines/reference/initializerReferencingConstructorLocals.js @@ -23,7 +23,7 @@ class D { //// [initializerReferencingConstructorLocals.js] // Initializer expressions for instance member variables are evaluated in the scope of the class constructor body but are not permitted to reference parameters or local variables of the constructor. -var C = (function () { +var C = /** @class */ (function () { function C(x) { this.a = z; // error this.c = this.z; // error @@ -32,7 +32,7 @@ var C = (function () { } return C; }()); -var D = (function () { +var D = /** @class */ (function () { function D(x) { this.a = z; // error this.c = this.z; // error diff --git a/tests/baselines/reference/initializerReferencingConstructorParameters.js b/tests/baselines/reference/initializerReferencingConstructorParameters.js index 881913d5b5f8d..21de1f3c20363 100644 --- a/tests/baselines/reference/initializerReferencingConstructorParameters.js +++ b/tests/baselines/reference/initializerReferencingConstructorParameters.js @@ -27,20 +27,20 @@ class F { //// [initializerReferencingConstructorParameters.js] // Initializer expressions for instance member variables are evaluated in the scope of the class constructor body but are not permitted to reference parameters or local variables of the constructor. -var C = (function () { +var C = /** @class */ (function () { function C(x) { this.a = x; // error } return C; }()); -var D = (function () { +var D = /** @class */ (function () { function D(x) { this.x = x; this.a = x; // error } return D; }()); -var E = (function () { +var E = /** @class */ (function () { function E(x) { this.x = x; this.a = this.x; // ok @@ -48,7 +48,7 @@ var E = (function () { } return E; }()); -var F = (function () { +var F = /** @class */ (function () { function F(x) { this.x = x; this.a = this.x; // ok diff --git a/tests/baselines/reference/innerAliases.js b/tests/baselines/reference/innerAliases.js index cda2be1c5a913..93ccbd88edcc3 100644 --- a/tests/baselines/reference/innerAliases.js +++ b/tests/baselines/reference/innerAliases.js @@ -30,7 +30,7 @@ var A; (function (B) { var C; (function (C) { - var Class1 = (function () { + var Class1 = /** @class */ (function () { function Class1() { } return Class1; @@ -45,7 +45,7 @@ var D; var c1 = new inner.Class1(); var E; (function (E) { - var Class2 = (function () { + var Class2 = /** @class */ (function () { function Class2() { } return Class2; diff --git a/tests/baselines/reference/innerAliases2.js b/tests/baselines/reference/innerAliases2.js index 6ac0a57a484ca..872a74e726182 100644 --- a/tests/baselines/reference/innerAliases2.js +++ b/tests/baselines/reference/innerAliases2.js @@ -22,7 +22,7 @@ module consumer { //// [innerAliases2.js] var _provider; (function (_provider) { - var UsefulClass = (function () { + var UsefulClass = /** @class */ (function () { function UsefulClass() { } UsefulClass.prototype.foo = function () { diff --git a/tests/baselines/reference/innerBoundLambdaEmit.js b/tests/baselines/reference/innerBoundLambdaEmit.js index fe3981cd335d1..9a1928436d0cb 100644 --- a/tests/baselines/reference/innerBoundLambdaEmit.js +++ b/tests/baselines/reference/innerBoundLambdaEmit.js @@ -12,7 +12,7 @@ interface Array { //// [innerBoundLambdaEmit.js] var M; (function (M) { - var Foo = (function () { + var Foo = /** @class */ (function () { function Foo() { } return Foo; diff --git a/tests/baselines/reference/innerExtern.js b/tests/baselines/reference/innerExtern.js index 11f526c8310f5..db149c66cfc2f 100644 --- a/tests/baselines/reference/innerExtern.js +++ b/tests/baselines/reference/innerExtern.js @@ -18,7 +18,7 @@ var A; (function (A) { var B; (function (B) { - var C = (function () { + var C = /** @class */ (function () { function C() { this.x = BB.Elephant.X; } diff --git a/tests/baselines/reference/innerTypeParameterShadowingOuterOne2.js b/tests/baselines/reference/innerTypeParameterShadowingOuterOne2.js index 02b0ccfb382a4..984584389f66f 100644 --- a/tests/baselines/reference/innerTypeParameterShadowingOuterOne2.js +++ b/tests/baselines/reference/innerTypeParameterShadowingOuterOne2.js @@ -40,7 +40,7 @@ class C2 { //// [innerTypeParameterShadowingOuterOne2.js] // inner type parameters shadow outer ones of the same name // no errors expected -var C = (function () { +var C = /** @class */ (function () { function C() { } C.prototype.g = function () { @@ -53,7 +53,7 @@ var C = (function () { }; return C; }()); -var C2 = (function () { +var C2 = /** @class */ (function () { function C2() { } C2.prototype.g = function () { diff --git a/tests/baselines/reference/instanceAndStaticDeclarations1.js b/tests/baselines/reference/instanceAndStaticDeclarations1.js index 093e9c15cc8ea..57c9bba7dbf99 100644 --- a/tests/baselines/reference/instanceAndStaticDeclarations1.js +++ b/tests/baselines/reference/instanceAndStaticDeclarations1.js @@ -14,7 +14,7 @@ class Point { //// [instanceAndStaticDeclarations1.js] // from spec -var Point = (function () { +var Point = /** @class */ (function () { function Point(x, y) { this.x = x; this.y = y; diff --git a/tests/baselines/reference/instanceMemberAssignsToClassPrototype.js b/tests/baselines/reference/instanceMemberAssignsToClassPrototype.js index d6dc08f38507a..48c032b0d5360 100644 --- a/tests/baselines/reference/instanceMemberAssignsToClassPrototype.js +++ b/tests/baselines/reference/instanceMemberAssignsToClassPrototype.js @@ -13,7 +13,7 @@ class C { } //// [instanceMemberAssignsToClassPrototype.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } C.prototype.foo = function () { diff --git a/tests/baselines/reference/instanceMemberInitialization.js b/tests/baselines/reference/instanceMemberInitialization.js index dd9a0fc3b6f8f..f153090d719f7 100644 --- a/tests/baselines/reference/instanceMemberInitialization.js +++ b/tests/baselines/reference/instanceMemberInitialization.js @@ -9,7 +9,7 @@ var c2 = new C(); var r = c.x === c2.x; //// [instanceMemberInitialization.js] -var C = (function () { +var C = /** @class */ (function () { function C() { this.x = 1; } diff --git a/tests/baselines/reference/instanceOfAssignability.js b/tests/baselines/reference/instanceOfAssignability.js index db5554596afe0..ec66250dfdae9 100644 --- a/tests/baselines/reference/instanceOfAssignability.js +++ b/tests/baselines/reference/instanceOfAssignability.js @@ -101,30 +101,30 @@ var __extends = (this && this.__extends) || (function () { }; })(); // Derived1 is assignable to, but not a subtype of, Base -var Derived1 = (function () { +var Derived1 = /** @class */ (function () { function Derived1() { } return Derived1; }()); // Derived2 is a subtype of Base that is not assignable to Derived1 -var Derived2 = (function () { +var Derived2 = /** @class */ (function () { function Derived2() { } return Derived2; }()); -var Animal = (function () { +var Animal = /** @class */ (function () { function Animal() { } return Animal; }()); -var Mammal = (function (_super) { +var Mammal = /** @class */ (function (_super) { __extends(Mammal, _super); function Mammal() { return _super !== null && _super.apply(this, arguments) || this; } return Mammal; }(Animal)); -var Giraffe = (function (_super) { +var Giraffe = /** @class */ (function (_super) { __extends(Giraffe, _super); function Giraffe() { return _super !== null && _super.apply(this, arguments) || this; @@ -180,7 +180,7 @@ function fn7(x) { var y = x; } } -var ABC = (function () { +var ABC = /** @class */ (function () { function ABC() { } return ABC; diff --git a/tests/baselines/reference/instanceOfInExternalModules.js b/tests/baselines/reference/instanceOfInExternalModules.js index 293be662a4d74..9e3949a528516 100644 --- a/tests/baselines/reference/instanceOfInExternalModules.js +++ b/tests/baselines/reference/instanceOfInExternalModules.js @@ -15,7 +15,7 @@ function IsFoo(value: any): boolean { define(["require", "exports"], function (require, exports) { "use strict"; exports.__esModule = true; - var Foo = (function () { + var Foo = /** @class */ (function () { function Foo() { } return Foo; diff --git a/tests/baselines/reference/instancePropertiesInheritedIntoClassType.js b/tests/baselines/reference/instancePropertiesInheritedIntoClassType.js index 44c781c8c9824..4cade935e4150 100644 --- a/tests/baselines/reference/instancePropertiesInheritedIntoClassType.js +++ b/tests/baselines/reference/instancePropertiesInheritedIntoClassType.js @@ -55,7 +55,7 @@ var __extends = (this && this.__extends) || (function () { })(); var NonGeneric; (function (NonGeneric) { - var C = (function () { + var C = /** @class */ (function () { function C(a, b) { this.a = a; this.b = b; @@ -71,7 +71,7 @@ var NonGeneric; C.prototype.fn = function () { return this; }; return C; }()); - var D = (function (_super) { + var D = /** @class */ (function (_super) { __extends(D, _super); function D() { return _super !== null && _super.apply(this, arguments) || this; @@ -87,7 +87,7 @@ var NonGeneric; })(NonGeneric || (NonGeneric = {})); var Generic; (function (Generic) { - var C = (function () { + var C = /** @class */ (function () { function C(a, b) { this.a = a; this.b = b; @@ -103,7 +103,7 @@ var Generic; C.prototype.fn = function () { return this; }; return C; }()); - var D = (function (_super) { + var D = /** @class */ (function (_super) { __extends(D, _super); function D() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/instancePropertyInClassType.js b/tests/baselines/reference/instancePropertyInClassType.js index ee447aa52332a..32bd215f66aac 100644 --- a/tests/baselines/reference/instancePropertyInClassType.js +++ b/tests/baselines/reference/instancePropertyInClassType.js @@ -41,7 +41,7 @@ module Generic { //// [instancePropertyInClassType.js] var NonGeneric; (function (NonGeneric) { - var C = (function () { + var C = /** @class */ (function () { function C(a, b) { this.a = a; this.b = b; @@ -66,7 +66,7 @@ var NonGeneric; })(NonGeneric || (NonGeneric = {})); var Generic; (function (Generic) { - var C = (function () { + var C = /** @class */ (function () { function C(a, b) { this.a = a; this.b = b; diff --git a/tests/baselines/reference/instanceSubtypeCheck2.js b/tests/baselines/reference/instanceSubtypeCheck2.js index 0a02162d707da..70f07618dd698 100644 --- a/tests/baselines/reference/instanceSubtypeCheck2.js +++ b/tests/baselines/reference/instanceSubtypeCheck2.js @@ -18,12 +18,12 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var C1 = (function () { +var C1 = /** @class */ (function () { function C1() { } return C1; }()); -var C2 = (function (_super) { +var C2 = /** @class */ (function (_super) { __extends(C2, _super); function C2() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/instanceofOperator.js b/tests/baselines/reference/instanceofOperator.js index 55e3d448b3bfd..b5df46f0e60bb 100644 --- a/tests/baselines/reference/instanceofOperator.js +++ b/tests/baselines/reference/instanceofOperator.js @@ -31,7 +31,7 @@ module test { // Boolean primitive type. var test; (function (test) { - var Object = (function () { + var Object = /** @class */ (function () { function Object() { } return Object; diff --git a/tests/baselines/reference/instanceofOperatorWithInvalidOperands.js b/tests/baselines/reference/instanceofOperatorWithInvalidOperands.js index 90badcf8e9215..70e7761875fe9 100644 --- a/tests/baselines/reference/instanceofOperatorWithInvalidOperands.js +++ b/tests/baselines/reference/instanceofOperatorWithInvalidOperands.js @@ -47,7 +47,7 @@ var rb10 = x instanceof o3; var rc1 = '' instanceof {}; //// [instanceofOperatorWithInvalidOperands.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } C.prototype.foo = function () { }; diff --git a/tests/baselines/reference/instanceofOperatorWithLHSIsObject.js b/tests/baselines/reference/instanceofOperatorWithLHSIsObject.js index e7f35c8da4c23..163f2a2d08ccf 100644 --- a/tests/baselines/reference/instanceofOperatorWithLHSIsObject.js +++ b/tests/baselines/reference/instanceofOperatorWithLHSIsObject.js @@ -16,7 +16,7 @@ var r4 = d instanceof x1; //// [instanceofOperatorWithLHSIsObject.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } return C; diff --git a/tests/baselines/reference/instanceofWithStructurallyIdenticalTypes.js b/tests/baselines/reference/instanceofWithStructurallyIdenticalTypes.js index b7d2ec4691484..e8cbb46e1131e 100644 --- a/tests/baselines/reference/instanceofWithStructurallyIdenticalTypes.js +++ b/tests/baselines/reference/instanceofWithStructurallyIdenticalTypes.js @@ -82,17 +82,17 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var C1 = (function () { +var C1 = /** @class */ (function () { function C1() { } return C1; }()); -var C2 = (function () { +var C2 = /** @class */ (function () { function C2() { } return C2; }()); -var C3 = (function () { +var C3 = /** @class */ (function () { function C3() { } return C3; @@ -125,24 +125,24 @@ function foo2(x) { return "error"; } // More tests -var A = (function () { +var A = /** @class */ (function () { function A() { } return A; }()); -var A1 = (function (_super) { +var A1 = /** @class */ (function (_super) { __extends(A1, _super); function A1() { return _super !== null && _super.apply(this, arguments) || this; } return A1; }(A)); -var A2 = (function () { +var A2 = /** @class */ (function () { function A2() { } return A2; }()); -var B = (function (_super) { +var B = /** @class */ (function (_super) { __extends(B, _super); function B() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/instantiateGenericClassWithWrongNumberOfTypeArguments.js b/tests/baselines/reference/instantiateGenericClassWithWrongNumberOfTypeArguments.js index f8b4f680f0f25..74812fd71d67c 100644 --- a/tests/baselines/reference/instantiateGenericClassWithWrongNumberOfTypeArguments.js +++ b/tests/baselines/reference/instantiateGenericClassWithWrongNumberOfTypeArguments.js @@ -19,13 +19,13 @@ var d = new D(); //// [instantiateGenericClassWithWrongNumberOfTypeArguments.js] // it is always an error to provide a type argument list whose count does not match the type parameter list // both of these attempts to construct a type is an error -var C = (function () { +var C = /** @class */ (function () { function C() { } return C; }()); var c = new C(); -var D = (function () { +var D = /** @class */ (function () { function D() { } return D; diff --git a/tests/baselines/reference/instantiateGenericClassWithZeroTypeArguments.js b/tests/baselines/reference/instantiateGenericClassWithZeroTypeArguments.js index 2e7e3f87d1b83..d99365bc3320c 100644 --- a/tests/baselines/reference/instantiateGenericClassWithZeroTypeArguments.js +++ b/tests/baselines/reference/instantiateGenericClassWithZeroTypeArguments.js @@ -17,13 +17,13 @@ var d = new D(); //// [instantiateGenericClassWithZeroTypeArguments.js] // no errors expected when instantiating a generic type with no type arguments provided -var C = (function () { +var C = /** @class */ (function () { function C() { } return C; }()); var c = new C(); -var D = (function () { +var D = /** @class */ (function () { function D() { } return D; diff --git a/tests/baselines/reference/instantiateNonGenericTypeWithTypeArguments.js b/tests/baselines/reference/instantiateNonGenericTypeWithTypeArguments.js index 4c750024e43bb..c43acc26cfc97 100644 --- a/tests/baselines/reference/instantiateNonGenericTypeWithTypeArguments.js +++ b/tests/baselines/reference/instantiateNonGenericTypeWithTypeArguments.js @@ -21,7 +21,7 @@ var r2 = new a(); //// [instantiateNonGenericTypeWithTypeArguments.js] // it is an error to provide type arguments to a non-generic call // all of these are errors -var C = (function () { +var C = /** @class */ (function () { function C() { } return C; diff --git a/tests/baselines/reference/instantiatedBaseTypeConstraints.js b/tests/baselines/reference/instantiatedBaseTypeConstraints.js index c333ed36e1fdf..a059a33b1eda4 100644 --- a/tests/baselines/reference/instantiatedBaseTypeConstraints.js +++ b/tests/baselines/reference/instantiatedBaseTypeConstraints.js @@ -12,7 +12,7 @@ class Bar implements Foo { //// [instantiatedBaseTypeConstraints.js] -var Bar = (function () { +var Bar = /** @class */ (function () { function Bar() { } Bar.prototype.foo = function (bar) { diff --git a/tests/baselines/reference/instantiatedModule.js b/tests/baselines/reference/instantiatedModule.js index 8e7027d5fd7a9..3e5b1b68a1a60 100644 --- a/tests/baselines/reference/instantiatedModule.js +++ b/tests/baselines/reference/instantiatedModule.js @@ -78,7 +78,7 @@ var p1; // makes this an instantiated mmodule var M2; (function (M2) { - var Point = (function () { + var Point = /** @class */ (function () { function Point() { } Point.Origin = function () { diff --git a/tests/baselines/reference/instantiatedReturnTypeContravariance.js b/tests/baselines/reference/instantiatedReturnTypeContravariance.js index 52f96561f2018..35aa24748e3c5 100644 --- a/tests/baselines/reference/instantiatedReturnTypeContravariance.js +++ b/tests/baselines/reference/instantiatedReturnTypeContravariance.js @@ -41,7 +41,7 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var c = (function () { +var c = /** @class */ (function () { function c() { } c.prototype.foo = function () { @@ -49,7 +49,7 @@ var c = (function () { }; return c; }()); -var d = (function (_super) { +var d = /** @class */ (function (_super) { __extends(d, _super); function d() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/intTypeCheck.js b/tests/baselines/reference/intTypeCheck.js index 84eb19ac27d88..f62d853a6c5ee 100644 --- a/tests/baselines/reference/intTypeCheck.js +++ b/tests/baselines/reference/intTypeCheck.js @@ -206,7 +206,7 @@ var obj86: i8 = new anyVar; var obj87: i8 = new {}; //// [intTypeCheck.js] -var Base = (function () { +var Base = /** @class */ (function () { function Base() { } Base.prototype.foo = function () { }; diff --git a/tests/baselines/reference/interfaceClassMerging.js b/tests/baselines/reference/interfaceClassMerging.js index e2167776f22f7..638d6baabaf88 100644 --- a/tests/baselines/reference/interfaceClassMerging.js +++ b/tests/baselines/reference/interfaceClassMerging.js @@ -51,7 +51,7 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var Foo = (function () { +var Foo = /** @class */ (function () { function Foo() { } Foo.prototype.additionalMethod = function (a) { @@ -59,7 +59,7 @@ var Foo = (function () { }; return Foo; }()); -var Bar = (function (_super) { +var Bar = /** @class */ (function (_super) { __extends(Bar, _super); function Bar() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/interfaceClassMerging2.js b/tests/baselines/reference/interfaceClassMerging2.js index 4c879ba4cabc7..dd057b6a0ccae 100644 --- a/tests/baselines/reference/interfaceClassMerging2.js +++ b/tests/baselines/reference/interfaceClassMerging2.js @@ -47,7 +47,7 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var Foo = (function () { +var Foo = /** @class */ (function () { function Foo() { } Foo.prototype.classFooMethod = function () { @@ -55,7 +55,7 @@ var Foo = (function () { }; return Foo; }()); -var Bar = (function (_super) { +var Bar = /** @class */ (function (_super) { __extends(Bar, _super); function Bar() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/interfaceContextualType.js b/tests/baselines/reference/interfaceContextualType.js index ec50272592509..8f2950749d9e3 100644 --- a/tests/baselines/reference/interfaceContextualType.js +++ b/tests/baselines/reference/interfaceContextualType.js @@ -24,7 +24,7 @@ class Bug { //// [interfaceContextualType.js] "use strict"; exports.__esModule = true; -var Bug = (function () { +var Bug = /** @class */ (function () { function Bug() { } Bug.prototype.ok = function () { diff --git a/tests/baselines/reference/interfaceDeclaration1.js b/tests/baselines/reference/interfaceDeclaration1.js index 91c84fbbc81b0..7adc55414c6cd 100644 --- a/tests/baselines/reference/interfaceDeclaration1.js +++ b/tests/baselines/reference/interfaceDeclaration1.js @@ -56,7 +56,7 @@ interface i12 extends i10, i11 { } //// [interfaceDeclaration1.js] var v1; v1(); -var C1 = (function () { +var C1 = /** @class */ (function () { function C1() { var prototype = 3; } diff --git a/tests/baselines/reference/interfaceDeclaration2.js b/tests/baselines/reference/interfaceDeclaration2.js index bdd061448be82..8bcb088e55f0d 100644 --- a/tests/baselines/reference/interfaceDeclaration2.js +++ b/tests/baselines/reference/interfaceDeclaration2.js @@ -14,7 +14,7 @@ var I4:number; //// [interfaceDeclaration2.js] -var I2 = (function () { +var I2 = /** @class */ (function () { function I2() { } return I2; diff --git a/tests/baselines/reference/interfaceDeclaration3.js b/tests/baselines/reference/interfaceDeclaration3.js index 41f12dbac05b1..3ff20d41fb268 100644 --- a/tests/baselines/reference/interfaceDeclaration3.js +++ b/tests/baselines/reference/interfaceDeclaration3.js @@ -61,27 +61,27 @@ define(["require", "exports"], function (require, exports) { exports.__esModule = true; var M1; (function (M1) { - var C1 = (function () { + var C1 = /** @class */ (function () { function C1() { } return C1; }()); - var C2 = (function () { + var C2 = /** @class */ (function () { function C2() { } return C2; }()); - var C3 = (function () { + var C3 = /** @class */ (function () { function C3() { } return C3; }()); - var C4 = (function () { + var C4 = /** @class */ (function () { function C4() { } return C4; }()); - var C5 = (function () { + var C5 = /** @class */ (function () { function C5() { } return C5; @@ -89,33 +89,33 @@ define(["require", "exports"], function (require, exports) { })(M1 || (M1 = {})); var M2; (function (M2) { - var C1 = (function () { + var C1 = /** @class */ (function () { function C1() { } return C1; }()); - var C2 = (function () { + var C2 = /** @class */ (function () { function C2() { } return C2; }()); - var C3 = (function () { + var C3 = /** @class */ (function () { function C3() { } return C3; }()); })(M2 = exports.M2 || (exports.M2 = {})); - var C1 = (function () { + var C1 = /** @class */ (function () { function C1() { } return C1; }()); - var C2 = (function () { + var C2 = /** @class */ (function () { function C2() { } return C2; }()); - var C3 = (function () { + var C3 = /** @class */ (function () { function C3() { } return C3; diff --git a/tests/baselines/reference/interfaceDeclaration4.js b/tests/baselines/reference/interfaceDeclaration4.js index cf97cf66972e5..a85471dacbcd4 100644 --- a/tests/baselines/reference/interfaceDeclaration4.js +++ b/tests/baselines/reference/interfaceDeclaration4.js @@ -45,25 +45,25 @@ interface Foo.I1 { } // import Foo = require("interfaceDeclaration5") var Foo; (function (Foo) { - var C1 = (function () { + var C1 = /** @class */ (function () { function C1() { } return C1; }()); Foo.C1 = C1; })(Foo || (Foo = {})); -var C1 = (function () { +var C1 = /** @class */ (function () { function C1() { } return C1; }()); // Err - not implemented item -var C2 = (function () { +var C2 = /** @class */ (function () { function C2() { } return C2; }()); -var C3 = (function () { +var C3 = /** @class */ (function () { function C3() { } return C3; diff --git a/tests/baselines/reference/interfaceDeclaration5.js b/tests/baselines/reference/interfaceDeclaration5.js index 318e8903c36f0..d4d977116565a 100644 --- a/tests/baselines/reference/interfaceDeclaration5.js +++ b/tests/baselines/reference/interfaceDeclaration5.js @@ -7,7 +7,7 @@ export class C1 { } define(["require", "exports"], function (require, exports) { "use strict"; exports.__esModule = true; - var C1 = (function () { + var C1 = /** @class */ (function () { function C1() { } return C1; diff --git a/tests/baselines/reference/interfaceExtendingClass.js b/tests/baselines/reference/interfaceExtendingClass.js index e2ca3f89791c2..388d4232e82a8 100644 --- a/tests/baselines/reference/interfaceExtendingClass.js +++ b/tests/baselines/reference/interfaceExtendingClass.js @@ -20,7 +20,7 @@ var f: Foo = i; i = f; //// [interfaceExtendingClass.js] -var Foo = (function () { +var Foo = /** @class */ (function () { function Foo() { } Foo.prototype.y = function () { }; diff --git a/tests/baselines/reference/interfaceExtendingClass2.js b/tests/baselines/reference/interfaceExtendingClass2.js index e3ede26b48ed5..9c4f56151e0ab 100644 --- a/tests/baselines/reference/interfaceExtendingClass2.js +++ b/tests/baselines/reference/interfaceExtendingClass2.js @@ -16,7 +16,7 @@ interface I2 extends Foo { // error } //// [interfaceExtendingClass2.js] -var Foo = (function () { +var Foo = /** @class */ (function () { function Foo() { } Foo.prototype.y = function () { }; diff --git a/tests/baselines/reference/interfaceExtendingClassWithPrivates.js b/tests/baselines/reference/interfaceExtendingClassWithPrivates.js index 576f1a101280b..5c24b536e4b85 100644 --- a/tests/baselines/reference/interfaceExtendingClassWithPrivates.js +++ b/tests/baselines/reference/interfaceExtendingClassWithPrivates.js @@ -16,7 +16,7 @@ var r = i.y; var r2 = i.x; // error //// [interfaceExtendingClassWithPrivates.js] -var Foo = (function () { +var Foo = /** @class */ (function () { function Foo() { } return Foo; diff --git a/tests/baselines/reference/interfaceExtendingClassWithPrivates2.js b/tests/baselines/reference/interfaceExtendingClassWithPrivates2.js index a6f966a8fac51..62ea69fc7ce1a 100644 --- a/tests/baselines/reference/interfaceExtendingClassWithPrivates2.js +++ b/tests/baselines/reference/interfaceExtendingClassWithPrivates2.js @@ -28,17 +28,17 @@ var r2 = i.x; // error var r3 = i.y; // error //// [interfaceExtendingClassWithPrivates2.js] -var Foo = (function () { +var Foo = /** @class */ (function () { function Foo() { } return Foo; }()); -var Bar = (function () { +var Bar = /** @class */ (function () { function Bar() { } return Bar; }()); -var Baz = (function () { +var Baz = /** @class */ (function () { function Baz() { } return Baz; diff --git a/tests/baselines/reference/interfaceExtendingClassWithProtecteds.js b/tests/baselines/reference/interfaceExtendingClassWithProtecteds.js index 18c145ab72ec6..67e431641ed8f 100644 --- a/tests/baselines/reference/interfaceExtendingClassWithProtecteds.js +++ b/tests/baselines/reference/interfaceExtendingClassWithProtecteds.js @@ -16,7 +16,7 @@ var r = i.y; var r2 = i.x; // error //// [interfaceExtendingClassWithProtecteds.js] -var Foo = (function () { +var Foo = /** @class */ (function () { function Foo() { } return Foo; diff --git a/tests/baselines/reference/interfaceExtendingClassWithProtecteds2.js b/tests/baselines/reference/interfaceExtendingClassWithProtecteds2.js index 6bf6b22120bf2..5d3e920f533d0 100644 --- a/tests/baselines/reference/interfaceExtendingClassWithProtecteds2.js +++ b/tests/baselines/reference/interfaceExtendingClassWithProtecteds2.js @@ -28,17 +28,17 @@ var r2 = i.x; // error var r3 = i.y; // error //// [interfaceExtendingClassWithProtecteds2.js] -var Foo = (function () { +var Foo = /** @class */ (function () { function Foo() { } return Foo; }()); -var Bar = (function () { +var Bar = /** @class */ (function () { function Bar() { } return Bar; }()); -var Baz = (function () { +var Baz = /** @class */ (function () { function Baz() { } return Baz; diff --git a/tests/baselines/reference/interfaceExtendsClass1.js b/tests/baselines/reference/interfaceExtendsClass1.js index 69560e825577a..00408a75f4c64 100644 --- a/tests/baselines/reference/interfaceExtendsClass1.js +++ b/tests/baselines/reference/interfaceExtendsClass1.js @@ -29,12 +29,12 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var Control = (function () { +var Control = /** @class */ (function () { function Control() { } return Control; }()); -var Button = (function (_super) { +var Button = /** @class */ (function (_super) { __extends(Button, _super); function Button() { return _super !== null && _super.apply(this, arguments) || this; @@ -42,7 +42,7 @@ var Button = (function (_super) { Button.prototype.select = function () { }; return Button; }(Control)); -var TextBox = (function (_super) { +var TextBox = /** @class */ (function (_super) { __extends(TextBox, _super); function TextBox() { return _super !== null && _super.apply(this, arguments) || this; @@ -50,14 +50,14 @@ var TextBox = (function (_super) { TextBox.prototype.select = function () { }; return TextBox; }(Control)); -var Image = (function (_super) { +var Image = /** @class */ (function (_super) { __extends(Image, _super); function Image() { return _super !== null && _super.apply(this, arguments) || this; } return Image; }(Control)); -var Location = (function () { +var Location = /** @class */ (function () { function Location() { } Location.prototype.select = function () { }; diff --git a/tests/baselines/reference/interfaceExtendsClassWithPrivate1.js b/tests/baselines/reference/interfaceExtendsClassWithPrivate1.js index 12d1539bb3d06..8fe4fc675c087 100644 --- a/tests/baselines/reference/interfaceExtendsClassWithPrivate1.js +++ b/tests/baselines/reference/interfaceExtendsClassWithPrivate1.js @@ -38,14 +38,14 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var C = (function () { +var C = /** @class */ (function () { function C() { this.x = 1; } C.prototype.foo = function (x) { return x; }; return C; }()); -var D = (function (_super) { +var D = /** @class */ (function (_super) { __extends(D, _super); function D() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/interfaceExtendsClassWithPrivate2.js b/tests/baselines/reference/interfaceExtendsClassWithPrivate2.js index cec3eed84977c..86e2d43055203 100644 --- a/tests/baselines/reference/interfaceExtendsClassWithPrivate2.js +++ b/tests/baselines/reference/interfaceExtendsClassWithPrivate2.js @@ -34,14 +34,14 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var C = (function () { +var C = /** @class */ (function () { function C() { this.x = 1; } C.prototype.foo = function (x) { return x; }; return C; }()); -var D = (function (_super) { +var D = /** @class */ (function (_super) { __extends(D, _super); function D() { var _this = _super !== null && _super.apply(this, arguments) || this; @@ -54,7 +54,7 @@ var D = (function (_super) { D.prototype.bar = function () { }; return D; }(C)); -var D2 = (function (_super) { +var D2 = /** @class */ (function (_super) { __extends(D2, _super); function D2() { var _this = _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/interfaceExtendsObjectIntersection.js b/tests/baselines/reference/interfaceExtendsObjectIntersection.js index 678829edeb84f..add381d3b2689 100644 --- a/tests/baselines/reference/interfaceExtendsObjectIntersection.js +++ b/tests/baselines/reference/interfaceExtendsObjectIntersection.js @@ -65,77 +65,77 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var C1 = (function (_super) { +var C1 = /** @class */ (function (_super) { __extends(C1, _super); function C1() { return _super !== null && _super.apply(this, arguments) || this; } return C1; }(Constructor())); -var C2 = (function (_super) { +var C2 = /** @class */ (function (_super) { __extends(C2, _super); function C2() { return _super !== null && _super.apply(this, arguments) || this; } return C2; }(Constructor())); -var C3 = (function (_super) { +var C3 = /** @class */ (function (_super) { __extends(C3, _super); function C3() { return _super !== null && _super.apply(this, arguments) || this; } return C3; }(Constructor())); -var C4 = (function (_super) { +var C4 = /** @class */ (function (_super) { __extends(C4, _super); function C4() { return _super !== null && _super.apply(this, arguments) || this; } return C4; }(Constructor())); -var C5 = (function (_super) { +var C5 = /** @class */ (function (_super) { __extends(C5, _super); function C5() { return _super !== null && _super.apply(this, arguments) || this; } return C5; }(Constructor())); -var C6 = (function (_super) { +var C6 = /** @class */ (function (_super) { __extends(C6, _super); function C6() { return _super !== null && _super.apply(this, arguments) || this; } return C6; }(Constructor())); -var C7 = (function (_super) { +var C7 = /** @class */ (function (_super) { __extends(C7, _super); function C7() { return _super !== null && _super.apply(this, arguments) || this; } return C7; }(Constructor())); -var C20 = (function (_super) { +var C20 = /** @class */ (function (_super) { __extends(C20, _super); function C20() { return _super !== null && _super.apply(this, arguments) || this; } return C20; }(Constructor())); -var C21 = (function (_super) { +var C21 = /** @class */ (function (_super) { __extends(C21, _super); function C21() { return _super !== null && _super.apply(this, arguments) || this; } return C21; }(Constructor())); -var C22 = (function (_super) { +var C22 = /** @class */ (function (_super) { __extends(C22, _super); function C22() { return _super !== null && _super.apply(this, arguments) || this; } return C22; }(Constructor())); -var C23 = (function (_super) { +var C23 = /** @class */ (function (_super) { __extends(C23, _super); function C23() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/interfaceExtendsObjectIntersectionErrors.js b/tests/baselines/reference/interfaceExtendsObjectIntersectionErrors.js index 7ae09d693ffb2..97ea1c19e1cb8 100644 --- a/tests/baselines/reference/interfaceExtendsObjectIntersectionErrors.js +++ b/tests/baselines/reference/interfaceExtendsObjectIntersectionErrors.js @@ -59,35 +59,35 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var C1 = (function (_super) { +var C1 = /** @class */ (function (_super) { __extends(C1, _super); function C1() { return _super !== null && _super.apply(this, arguments) || this; } return C1; }(Constructor())); -var C2 = (function (_super) { +var C2 = /** @class */ (function (_super) { __extends(C2, _super); function C2() { return _super !== null && _super.apply(this, arguments) || this; } return C2; }(Constructor())); -var C3 = (function (_super) { +var C3 = /** @class */ (function (_super) { __extends(C3, _super); function C3() { return _super !== null && _super.apply(this, arguments) || this; } return C3; }(Constructor())); -var C4 = (function (_super) { +var C4 = /** @class */ (function (_super) { __extends(C4, _super); function C4() { return _super !== null && _super.apply(this, arguments) || this; } return C4; }(Constructor())); -var C5 = (function (_super) { +var C5 = /** @class */ (function (_super) { __extends(C5, _super); function C5() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/interfaceImplementation1.js b/tests/baselines/reference/interfaceImplementation1.js index 6a8d1b2d782cd..37cedb9aafaab 100644 --- a/tests/baselines/reference/interfaceImplementation1.js +++ b/tests/baselines/reference/interfaceImplementation1.js @@ -47,13 +47,13 @@ c["foo"]; //// [interfaceImplementation1.js] -var C1 = (function () { +var C1 = /** @class */ (function () { function C1() { } C1.prototype.iFn = function (n, s) { }; return C1; }()); -var C2 = (function () { +var C2 = /** @class */ (function () { function C2() { this.x = 1; } diff --git a/tests/baselines/reference/interfaceImplementation2.js b/tests/baselines/reference/interfaceImplementation2.js index 747fb0a6da3bc..bd897c71441ac 100644 --- a/tests/baselines/reference/interfaceImplementation2.js +++ b/tests/baselines/reference/interfaceImplementation2.js @@ -14,7 +14,7 @@ class C3 implements I1 { //// [interfaceImplementation2.js] -var C3 = (function () { +var C3 = /** @class */ (function () { function C3() { } return C3; diff --git a/tests/baselines/reference/interfaceImplementation3.js b/tests/baselines/reference/interfaceImplementation3.js index ef713d517b7d3..6d90e01397da5 100644 --- a/tests/baselines/reference/interfaceImplementation3.js +++ b/tests/baselines/reference/interfaceImplementation3.js @@ -16,7 +16,7 @@ class C4 implements I1 { //// [interfaceImplementation3.js] -var C4 = (function () { +var C4 = /** @class */ (function () { function C4() { } C4.prototype.iFn = function () { }; diff --git a/tests/baselines/reference/interfaceImplementation4.js b/tests/baselines/reference/interfaceImplementation4.js index 07d2f85e311cb..454af776ede4f 100644 --- a/tests/baselines/reference/interfaceImplementation4.js +++ b/tests/baselines/reference/interfaceImplementation4.js @@ -14,7 +14,7 @@ class C5 implements I1 { //// [interfaceImplementation4.js] -var C5 = (function () { +var C5 = /** @class */ (function () { function C5() { } C5.prototype.iFn = function () { }; diff --git a/tests/baselines/reference/interfaceImplementation5.js b/tests/baselines/reference/interfaceImplementation5.js index e2b1ad345a983..9b2ffd88e4059 100644 --- a/tests/baselines/reference/interfaceImplementation5.js +++ b/tests/baselines/reference/interfaceImplementation5.js @@ -32,7 +32,7 @@ class C6 implements I1 { //// [interfaceImplementation5.js] -var C1 = (function () { +var C1 = /** @class */ (function () { function C1() { } Object.defineProperty(C1.prototype, "getset1", { @@ -42,7 +42,7 @@ var C1 = (function () { }); return C1; }()); -var C2 = (function () { +var C2 = /** @class */ (function () { function C2() { } Object.defineProperty(C2.prototype, "getset1", { @@ -52,7 +52,7 @@ var C2 = (function () { }); return C2; }()); -var C3 = (function () { +var C3 = /** @class */ (function () { function C3() { } Object.defineProperty(C3.prototype, "getset1", { @@ -63,7 +63,7 @@ var C3 = (function () { }); return C3; }()); -var C4 = (function () { +var C4 = /** @class */ (function () { function C4() { } Object.defineProperty(C4.prototype, "getset1", { @@ -73,7 +73,7 @@ var C4 = (function () { }); return C4; }()); -var C5 = (function () { +var C5 = /** @class */ (function () { function C5() { } Object.defineProperty(C5.prototype, "getset1", { @@ -83,7 +83,7 @@ var C5 = (function () { }); return C5; }()); -var C6 = (function () { +var C6 = /** @class */ (function () { function C6() { } Object.defineProperty(C6.prototype, "getset1", { diff --git a/tests/baselines/reference/interfaceImplementation6.js b/tests/baselines/reference/interfaceImplementation6.js index 0bc759f6cda86..76c387558e909 100644 --- a/tests/baselines/reference/interfaceImplementation6.js +++ b/tests/baselines/reference/interfaceImplementation6.js @@ -28,23 +28,23 @@ export class Test { define(["require", "exports"], function (require, exports) { "use strict"; exports.__esModule = true; - var C1 = (function () { + var C1 = /** @class */ (function () { function C1() { } return C1; }()); - var C2 = (function () { + var C2 = /** @class */ (function () { function C2() { } return C2; }()); - var C3 = (function () { + var C3 = /** @class */ (function () { function C3() { var item; } return C3; }()); - var Test = (function () { + var Test = /** @class */ (function () { function Test() { this.pt = { item: 1 }; } diff --git a/tests/baselines/reference/interfaceImplementation7.js b/tests/baselines/reference/interfaceImplementation7.js index 7a1a29c65bfb2..a348ae30b42d8 100644 --- a/tests/baselines/reference/interfaceImplementation7.js +++ b/tests/baselines/reference/interfaceImplementation7.js @@ -11,7 +11,7 @@ class C1 implements i4 { //// [interfaceImplementation7.js] -var C1 = (function () { +var C1 = /** @class */ (function () { function C1() { } C1.prototype.name = function () { return ""; }; diff --git a/tests/baselines/reference/interfaceImplementation8.js b/tests/baselines/reference/interfaceImplementation8.js index c966cdc2c14e2..5e8abb77d1c60 100644 --- a/tests/baselines/reference/interfaceImplementation8.js +++ b/tests/baselines/reference/interfaceImplementation8.js @@ -51,48 +51,48 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var C1 = (function () { +var C1 = /** @class */ (function () { function C1() { } return C1; }()); -var C2 = (function () { +var C2 = /** @class */ (function () { function C2() { } return C2; }()); -var C3 = (function () { +var C3 = /** @class */ (function () { function C3() { } return C3; }()); -var C4 = (function (_super) { +var C4 = /** @class */ (function (_super) { __extends(C4, _super); function C4() { return _super !== null && _super.apply(this, arguments) || this; } return C4; }(C1)); -var C5 = (function (_super) { +var C5 = /** @class */ (function (_super) { __extends(C5, _super); function C5() { return _super !== null && _super.apply(this, arguments) || this; } return C5; }(C2)); -var C6 = (function (_super) { +var C6 = /** @class */ (function (_super) { __extends(C6, _super); function C6() { return _super !== null && _super.apply(this, arguments) || this; } return C6; }(C3)); -var C7 = (function () { +var C7 = /** @class */ (function () { function C7() { } return C7; }()); -var C8 = (function (_super) { +var C8 = /** @class */ (function (_super) { __extends(C8, _super); function C8() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/interfaceInReopenedModule.js b/tests/baselines/reference/interfaceInReopenedModule.js index 1196cd4df29a0..001cb022762e9 100644 --- a/tests/baselines/reference/interfaceInReopenedModule.js +++ b/tests/baselines/reference/interfaceInReopenedModule.js @@ -15,7 +15,7 @@ module m { // In second instance of same module, exported interface is not visible var m; (function (m) { - var n = (function () { + var n = /** @class */ (function () { function n() { } return n; diff --git a/tests/baselines/reference/interfaceInheritance.js b/tests/baselines/reference/interfaceInheritance.js index 85ae7287f4a12..f916f93ed3038 100644 --- a/tests/baselines/reference/interfaceInheritance.js +++ b/tests/baselines/reference/interfaceInheritance.js @@ -41,7 +41,7 @@ i5 = i4; // should be an error //// [interfaceInheritance.js] -var C1 = (function () { +var C1 = /** @class */ (function () { function C1() { } return C1; diff --git a/tests/baselines/reference/interfacePropertiesWithSameName3.js b/tests/baselines/reference/interfacePropertiesWithSameName3.js index bf4b9edefc1ae..4aba8983e15b9 100644 --- a/tests/baselines/reference/interfacePropertiesWithSameName3.js +++ b/tests/baselines/reference/interfacePropertiesWithSameName3.js @@ -9,12 +9,12 @@ interface F2 extends E2, D2 { } // error //// [interfacePropertiesWithSameName3.js] -var D2 = (function () { +var D2 = /** @class */ (function () { function D2() { } return D2; }()); -var E2 = (function () { +var E2 = /** @class */ (function () { function E2() { } return E2; diff --git a/tests/baselines/reference/interfaceSubtyping.js b/tests/baselines/reference/interfaceSubtyping.js index e0552a964e984..ab46cbf13b09e 100644 --- a/tests/baselines/reference/interfaceSubtyping.js +++ b/tests/baselines/reference/interfaceSubtyping.js @@ -10,7 +10,7 @@ class Camera implements iface{ //// [interfaceSubtyping.js] -var Camera = (function () { +var Camera = /** @class */ (function () { function Camera(str) { this.str = str; } diff --git a/tests/baselines/reference/interfaceWithMultipleDeclarations.js b/tests/baselines/reference/interfaceWithMultipleDeclarations.js index e2ba78877e655..de903acdfa668 100644 --- a/tests/baselines/reference/interfaceWithMultipleDeclarations.js +++ b/tests/baselines/reference/interfaceWithMultipleDeclarations.js @@ -38,7 +38,7 @@ interface I4> { // Should not be error } //// [interfaceWithMultipleDeclarations.js] -var Foo = (function () { +var Foo = /** @class */ (function () { function Foo() { } return Foo; diff --git a/tests/baselines/reference/interfaceWithPropertyOfEveryType.js b/tests/baselines/reference/interfaceWithPropertyOfEveryType.js index fef3d2457d83e..3f2dd8903647d 100644 --- a/tests/baselines/reference/interfaceWithPropertyOfEveryType.js +++ b/tests/baselines/reference/interfaceWithPropertyOfEveryType.js @@ -43,7 +43,7 @@ var a: Foo = { } //// [interfaceWithPropertyOfEveryType.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } return C; diff --git a/tests/baselines/reference/interfaceWithPropertyThatIsPrivateInBaseType.js b/tests/baselines/reference/interfaceWithPropertyThatIsPrivateInBaseType.js index fb5c0bd147af9..86b1bcf8fd6c7 100644 --- a/tests/baselines/reference/interfaceWithPropertyThatIsPrivateInBaseType.js +++ b/tests/baselines/reference/interfaceWithPropertyThatIsPrivateInBaseType.js @@ -16,12 +16,12 @@ interface Foo2 extends Base2 { // error } //// [interfaceWithPropertyThatIsPrivateInBaseType.js] -var Base = (function () { +var Base = /** @class */ (function () { function Base() { } return Base; }()); -var Base2 = (function () { +var Base2 = /** @class */ (function () { function Base2() { } return Base2; diff --git a/tests/baselines/reference/interfaceWithPropertyThatIsPrivateInBaseType2.js b/tests/baselines/reference/interfaceWithPropertyThatIsPrivateInBaseType2.js index 783a1fe4c8ba6..092941e320763 100644 --- a/tests/baselines/reference/interfaceWithPropertyThatIsPrivateInBaseType2.js +++ b/tests/baselines/reference/interfaceWithPropertyThatIsPrivateInBaseType2.js @@ -16,13 +16,13 @@ interface Foo2 extends Base2 { // error } //// [interfaceWithPropertyThatIsPrivateInBaseType2.js] -var Base = (function () { +var Base = /** @class */ (function () { function Base() { } Base.prototype.x = function () { }; return Base; }()); -var Base2 = (function () { +var Base2 = /** @class */ (function () { function Base2() { } Base2.prototype.x = function () { }; diff --git a/tests/baselines/reference/interfacedecl.js b/tests/baselines/reference/interfacedecl.js index 24d9df256caa2..c42bd0ef38f48 100644 --- a/tests/baselines/reference/interfacedecl.js +++ b/tests/baselines/reference/interfacedecl.js @@ -47,7 +47,7 @@ class c1 implements a { var instance2 = new c1(); //// [interfacedecl.js] -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/interfacedeclWithIndexerErrors.js b/tests/baselines/reference/interfacedeclWithIndexerErrors.js index 0e979a09d6358..776d43b940df3 100644 --- a/tests/baselines/reference/interfacedeclWithIndexerErrors.js +++ b/tests/baselines/reference/interfacedeclWithIndexerErrors.js @@ -47,7 +47,7 @@ class c1 implements a { var instance2 = new c1(); //// [interfacedeclWithIndexerErrors.js] -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/internalAliasClass.js b/tests/baselines/reference/internalAliasClass.js index 7f3c7b695810c..f3632a20fff08 100644 --- a/tests/baselines/reference/internalAliasClass.js +++ b/tests/baselines/reference/internalAliasClass.js @@ -12,7 +12,7 @@ module c { //// [internalAliasClass.js] var a; (function (a) { - var c = (function () { + var c = /** @class */ (function () { function c() { } return c; diff --git a/tests/baselines/reference/internalAliasClassInsideLocalModuleWithExport.js b/tests/baselines/reference/internalAliasClassInsideLocalModuleWithExport.js index 0b333ac1830a1..b8090f80ae15b 100644 --- a/tests/baselines/reference/internalAliasClassInsideLocalModuleWithExport.js +++ b/tests/baselines/reference/internalAliasClassInsideLocalModuleWithExport.js @@ -22,7 +22,7 @@ export var d = new m2.m3.c(); exports.__esModule = true; var x; (function (x) { - var c = (function () { + var c = /** @class */ (function () { function c() { } c.prototype.foo = function (a) { diff --git a/tests/baselines/reference/internalAliasClassInsideLocalModuleWithoutExport.js b/tests/baselines/reference/internalAliasClassInsideLocalModuleWithoutExport.js index cf2eb41662b56..0f15cec0e9cc9 100644 --- a/tests/baselines/reference/internalAliasClassInsideLocalModuleWithoutExport.js +++ b/tests/baselines/reference/internalAliasClassInsideLocalModuleWithoutExport.js @@ -20,7 +20,7 @@ export module m2 { exports.__esModule = true; var x; (function (x) { - var c = (function () { + var c = /** @class */ (function () { function c() { } c.prototype.foo = function (a) { diff --git a/tests/baselines/reference/internalAliasClassInsideLocalModuleWithoutExportAccessError.js b/tests/baselines/reference/internalAliasClassInsideLocalModuleWithoutExportAccessError.js index 1de7fe25407fb..f5186e0e78dd5 100644 --- a/tests/baselines/reference/internalAliasClassInsideLocalModuleWithoutExportAccessError.js +++ b/tests/baselines/reference/internalAliasClassInsideLocalModuleWithoutExportAccessError.js @@ -22,7 +22,7 @@ export var d = new m2.m3.c(); exports.__esModule = true; var x; (function (x) { - var c = (function () { + var c = /** @class */ (function () { function c() { } c.prototype.foo = function (a) { diff --git a/tests/baselines/reference/internalAliasClassInsideTopLevelModuleWithExport.js b/tests/baselines/reference/internalAliasClassInsideTopLevelModuleWithExport.js index e224b40c9f320..0af0418c72c27 100644 --- a/tests/baselines/reference/internalAliasClassInsideTopLevelModuleWithExport.js +++ b/tests/baselines/reference/internalAliasClassInsideTopLevelModuleWithExport.js @@ -16,7 +16,7 @@ var cReturnVal = cProp.foo(10); exports.__esModule = true; var x; (function (x) { - var c = (function () { + var c = /** @class */ (function () { function c() { } c.prototype.foo = function (a) { diff --git a/tests/baselines/reference/internalAliasClassInsideTopLevelModuleWithoutExport.js b/tests/baselines/reference/internalAliasClassInsideTopLevelModuleWithoutExport.js index 16f53fe3e8b0e..08ef9ae1359c7 100644 --- a/tests/baselines/reference/internalAliasClassInsideTopLevelModuleWithoutExport.js +++ b/tests/baselines/reference/internalAliasClassInsideTopLevelModuleWithoutExport.js @@ -16,7 +16,7 @@ var cReturnVal = cProp.foo(10); exports.__esModule = true; var x; (function (x) { - var c = (function () { + var c = /** @class */ (function () { function c() { } c.prototype.foo = function (a) { diff --git a/tests/baselines/reference/internalAliasInitializedModule.js b/tests/baselines/reference/internalAliasInitializedModule.js index 1d5e773994e2f..9d0b68096c814 100644 --- a/tests/baselines/reference/internalAliasInitializedModule.js +++ b/tests/baselines/reference/internalAliasInitializedModule.js @@ -16,7 +16,7 @@ var a; (function (a) { var b; (function (b) { - var c = (function () { + var c = /** @class */ (function () { function c() { } return c; diff --git a/tests/baselines/reference/internalAliasInitializedModuleInsideLocalModuleWithExport.js b/tests/baselines/reference/internalAliasInitializedModuleInsideLocalModuleWithExport.js index 85335a0fb7f65..9f00c4291b716 100644 --- a/tests/baselines/reference/internalAliasInitializedModuleInsideLocalModuleWithExport.js +++ b/tests/baselines/reference/internalAliasInitializedModuleInsideLocalModuleWithExport.js @@ -19,7 +19,7 @@ define(["require", "exports"], function (require, exports) { (function (a) { var b; (function (b) { - var c = (function () { + var c = /** @class */ (function () { function c() { } return c; diff --git a/tests/baselines/reference/internalAliasInitializedModuleInsideLocalModuleWithoutExport.js b/tests/baselines/reference/internalAliasInitializedModuleInsideLocalModuleWithoutExport.js index c39e6cfd16848..62fa55f2af40f 100644 --- a/tests/baselines/reference/internalAliasInitializedModuleInsideLocalModuleWithoutExport.js +++ b/tests/baselines/reference/internalAliasInitializedModuleInsideLocalModuleWithoutExport.js @@ -18,7 +18,7 @@ var a; (function (a) { var b; (function (b) { - var c = (function () { + var c = /** @class */ (function () { function c() { } return c; diff --git a/tests/baselines/reference/internalAliasInitializedModuleInsideLocalModuleWithoutExportAccessError.js b/tests/baselines/reference/internalAliasInitializedModuleInsideLocalModuleWithoutExportAccessError.js index 6e66118f5b934..e098a74b1916c 100644 --- a/tests/baselines/reference/internalAliasInitializedModuleInsideLocalModuleWithoutExportAccessError.js +++ b/tests/baselines/reference/internalAliasInitializedModuleInsideLocalModuleWithoutExportAccessError.js @@ -20,7 +20,7 @@ var a; (function (a) { var b; (function (b) { - var c = (function () { + var c = /** @class */ (function () { function c() { } return c; diff --git a/tests/baselines/reference/internalAliasInitializedModuleInsideTopLevelModuleWithExport.js b/tests/baselines/reference/internalAliasInitializedModuleInsideTopLevelModuleWithExport.js index 86d9f88cee372..021d8db3ab677 100644 --- a/tests/baselines/reference/internalAliasInitializedModuleInsideTopLevelModuleWithExport.js +++ b/tests/baselines/reference/internalAliasInitializedModuleInsideTopLevelModuleWithExport.js @@ -16,7 +16,7 @@ var a; (function (a) { var b; (function (b) { - var c = (function () { + var c = /** @class */ (function () { function c() { } return c; diff --git a/tests/baselines/reference/internalAliasInitializedModuleInsideTopLevelModuleWithoutExport.js b/tests/baselines/reference/internalAliasInitializedModuleInsideTopLevelModuleWithoutExport.js index 79185fed2284a..8c971f149344a 100644 --- a/tests/baselines/reference/internalAliasInitializedModuleInsideTopLevelModuleWithoutExport.js +++ b/tests/baselines/reference/internalAliasInitializedModuleInsideTopLevelModuleWithoutExport.js @@ -17,7 +17,7 @@ define(["require", "exports"], function (require, exports) { (function (a) { var b; (function (b) { - var c = (function () { + var c = /** @class */ (function () { function c() { } return c; diff --git a/tests/baselines/reference/internalImportInstantiatedModuleMergedWithClassNotReferencingInstance.js b/tests/baselines/reference/internalImportInstantiatedModuleMergedWithClassNotReferencingInstance.js index a0c0e0b34fed8..8fef7e8d2e133 100644 --- a/tests/baselines/reference/internalImportInstantiatedModuleMergedWithClassNotReferencingInstance.js +++ b/tests/baselines/reference/internalImportInstantiatedModuleMergedWithClassNotReferencingInstance.js @@ -14,7 +14,7 @@ module B { //// [internalImportInstantiatedModuleMergedWithClassNotReferencingInstance.js] -var A = (function () { +var A = /** @class */ (function () { function A() { } return A; diff --git a/tests/baselines/reference/internalImportInstantiatedModuleMergedWithClassNotReferencingInstanceNoConflict.js b/tests/baselines/reference/internalImportInstantiatedModuleMergedWithClassNotReferencingInstanceNoConflict.js index 5fc852cca4000..f8523446d74a8 100644 --- a/tests/baselines/reference/internalImportInstantiatedModuleMergedWithClassNotReferencingInstanceNoConflict.js +++ b/tests/baselines/reference/internalImportInstantiatedModuleMergedWithClassNotReferencingInstanceNoConflict.js @@ -13,7 +13,7 @@ module B { //// [internalImportInstantiatedModuleMergedWithClassNotReferencingInstanceNoConflict.js] -var A = (function () { +var A = /** @class */ (function () { function A() { } return A; diff --git a/tests/baselines/reference/internalImportUnInstantiatedModuleMergedWithClassNotReferencingInstance.js b/tests/baselines/reference/internalImportUnInstantiatedModuleMergedWithClassNotReferencingInstance.js index 1df5c768f97d2..eb3e4ceed73fc 100644 --- a/tests/baselines/reference/internalImportUnInstantiatedModuleMergedWithClassNotReferencingInstance.js +++ b/tests/baselines/reference/internalImportUnInstantiatedModuleMergedWithClassNotReferencingInstance.js @@ -13,7 +13,7 @@ module B { //// [internalImportUnInstantiatedModuleMergedWithClassNotReferencingInstance.js] -var A = (function () { +var A = /** @class */ (function () { function A() { } return A; diff --git a/tests/baselines/reference/internalImportUnInstantiatedModuleMergedWithClassNotReferencingInstanceNoConflict.js b/tests/baselines/reference/internalImportUnInstantiatedModuleMergedWithClassNotReferencingInstanceNoConflict.js index 4706390148f6c..c803d0b7787e7 100644 --- a/tests/baselines/reference/internalImportUnInstantiatedModuleMergedWithClassNotReferencingInstanceNoConflict.js +++ b/tests/baselines/reference/internalImportUnInstantiatedModuleMergedWithClassNotReferencingInstanceNoConflict.js @@ -12,7 +12,7 @@ module B { //// [internalImportUnInstantiatedModuleMergedWithClassNotReferencingInstanceNoConflict.js] -var A = (function () { +var A = /** @class */ (function () { function A() { } return A; diff --git a/tests/baselines/reference/intrinsics.js b/tests/baselines/reference/intrinsics.js index 82f6ceda758b1..e7c1dd5435437 100644 --- a/tests/baselines/reference/intrinsics.js +++ b/tests/baselines/reference/intrinsics.js @@ -18,7 +18,7 @@ var foo: (__proto__: number) => void; var hasOwnProperty; // Error var m1; (function (m1) { - var C = (function () { + var C = /** @class */ (function () { function C() { } return C; @@ -26,7 +26,7 @@ var m1; })(m1 || (m1 = {})); __proto__ = 0; // Error, __proto__ not defined m1.__proto__ = 0; -var Foo = (function () { +var Foo = /** @class */ (function () { function Foo() { } return Foo; diff --git a/tests/baselines/reference/invalidAssignmentsToVoid.js b/tests/baselines/reference/invalidAssignmentsToVoid.js index 5f3a8ddabfc59..8cb68baad21f8 100644 --- a/tests/baselines/reference/invalidAssignmentsToVoid.js +++ b/tests/baselines/reference/invalidAssignmentsToVoid.js @@ -28,7 +28,7 @@ x = 1; x = true; x = ''; x = {}; -var C = (function () { +var C = /** @class */ (function () { function C() { } return C; diff --git a/tests/baselines/reference/invalidBooleanAssignments.js b/tests/baselines/reference/invalidBooleanAssignments.js index 48951c77fb14c..b8daf44b91782 100644 --- a/tests/baselines/reference/invalidBooleanAssignments.js +++ b/tests/baselines/reference/invalidBooleanAssignments.js @@ -37,7 +37,7 @@ var E; E[E["A"] = 0] = "A"; })(E || (E = {})); var e = x; -var C = (function () { +var C = /** @class */ (function () { function C() { } return C; diff --git a/tests/baselines/reference/invalidImportAliasIdentifiers.js b/tests/baselines/reference/invalidImportAliasIdentifiers.js index b7b931fa49426..f22e704323ff0 100644 --- a/tests/baselines/reference/invalidImportAliasIdentifiers.js +++ b/tests/baselines/reference/invalidImportAliasIdentifiers.js @@ -28,7 +28,7 @@ import i = I; // none of these should work, since non are actually modules var V = 12; var v = V; -var C = (function () { +var C = /** @class */ (function () { function C() { } return C; diff --git a/tests/baselines/reference/invalidInstantiatedModule.js b/tests/baselines/reference/invalidInstantiatedModule.js index 65328dc15b50f..9cc6057bdcb31 100644 --- a/tests/baselines/reference/invalidInstantiatedModule.js +++ b/tests/baselines/reference/invalidInstantiatedModule.js @@ -18,7 +18,7 @@ var p: m.Point; // Error //// [invalidInstantiatedModule.js] var M; (function (M) { - var Point = (function () { + var Point = /** @class */ (function () { function Point() { } return Point; diff --git a/tests/baselines/reference/invalidModuleWithStatementsOfEveryKind.js b/tests/baselines/reference/invalidModuleWithStatementsOfEveryKind.js index 2ca72edf3c16b..5dd9f0289a928 100644 --- a/tests/baselines/reference/invalidModuleWithStatementsOfEveryKind.js +++ b/tests/baselines/reference/invalidModuleWithStatementsOfEveryKind.js @@ -92,12 +92,12 @@ var __extends = (this && this.__extends) || (function () { })(); var Y; (function (Y) { - var A = (function () { + var A = /** @class */ (function () { function A() { } return A; }()); - var BB = (function (_super) { + var BB = /** @class */ (function (_super) { __extends(BB, _super); function BB() { return _super !== null && _super.apply(this, arguments) || this; @@ -107,12 +107,12 @@ var Y; })(Y || (Y = {})); var Y2; (function (Y2) { - var AA = (function () { + var AA = /** @class */ (function () { function AA() { } return AA; }()); - var B = (function (_super) { + var B = /** @class */ (function (_super) { __extends(B, _super); function B() { return _super !== null && _super.apply(this, arguments) || this; @@ -124,7 +124,7 @@ var Y3; (function (Y3) { var Module; (function (Module) { - var A = (function () { + var A = /** @class */ (function () { function A() { } return A; @@ -141,12 +141,12 @@ var Y4; })(Y4 || (Y4 = {})); var YY; (function (YY) { - var A = (function () { + var A = /** @class */ (function () { function A() { } return A; }()); - var BB = (function (_super) { + var BB = /** @class */ (function (_super) { __extends(BB, _super); function BB() { return _super !== null && _super.apply(this, arguments) || this; @@ -156,12 +156,12 @@ var YY; })(YY || (YY = {})); var YY2; (function (YY2) { - var AA = (function () { + var AA = /** @class */ (function () { function AA() { } return AA; }()); - var B = (function (_super) { + var B = /** @class */ (function (_super) { __extends(B, _super); function B() { return _super !== null && _super.apply(this, arguments) || this; @@ -173,7 +173,7 @@ var YY3; (function (YY3) { var Module; (function (Module) { - var A = (function () { + var A = /** @class */ (function () { function A() { } return A; @@ -190,12 +190,12 @@ var YY4; })(YY4 || (YY4 = {})); var YYY; (function (YYY) { - var A = (function () { + var A = /** @class */ (function () { function A() { } return A; }()); - var BB = (function (_super) { + var BB = /** @class */ (function (_super) { __extends(BB, _super); function BB() { return _super !== null && _super.apply(this, arguments) || this; @@ -205,12 +205,12 @@ var YYY; })(YYY || (YYY = {})); var YYY2; (function (YYY2) { - var AA = (function () { + var AA = /** @class */ (function () { function AA() { } return AA; }()); - var B = (function (_super) { + var B = /** @class */ (function (_super) { __extends(B, _super); function B() { return _super !== null && _super.apply(this, arguments) || this; @@ -222,7 +222,7 @@ var YYY3; (function (YYY3) { var Module; (function (Module) { - var A = (function () { + var A = /** @class */ (function () { function A() { } return A; diff --git a/tests/baselines/reference/invalidMultipleVariableDeclarations.js b/tests/baselines/reference/invalidMultipleVariableDeclarations.js index 7e1616cfca4a2..0b13b68a8085d 100644 --- a/tests/baselines/reference/invalidMultipleVariableDeclarations.js +++ b/tests/baselines/reference/invalidMultipleVariableDeclarations.js @@ -64,19 +64,19 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var C = (function () { +var C = /** @class */ (function () { function C() { } return C; }()); -var C2 = (function (_super) { +var C2 = /** @class */ (function (_super) { __extends(C2, _super); function C2() { return _super !== null && _super.apply(this, arguments) || this; } return C2; }(C)); -var D = (function () { +var D = /** @class */ (function () { function D() { } return D; @@ -84,7 +84,7 @@ var D = (function () { function F(x) { return 42; } var M; (function (M) { - var A = (function () { + var A = /** @class */ (function () { function A() { } return A; diff --git a/tests/baselines/reference/invalidNestedModules.js b/tests/baselines/reference/invalidNestedModules.js index 676817139f945..1ac56e8c688b0 100644 --- a/tests/baselines/reference/invalidNestedModules.js +++ b/tests/baselines/reference/invalidNestedModules.js @@ -36,7 +36,7 @@ var A; (function (B) { var C; (function (C) { - var Point = (function () { + var Point = /** @class */ (function () { function Point() { } return Point; @@ -48,7 +48,7 @@ var A; (function (A) { var B; (function (B) { - var C = (function () { + var C = /** @class */ (function () { function C() { } return C; @@ -60,7 +60,7 @@ var M2; (function (M2) { var X; (function (X) { - var Point = (function () { + var Point = /** @class */ (function () { function Point() { } return Point; diff --git a/tests/baselines/reference/invalidNewTarget.es5.js b/tests/baselines/reference/invalidNewTarget.es5.js index 1c2da520fcb2d..54bc5ea2d64b3 100644 --- a/tests/baselines/reference/invalidNewTarget.es5.js +++ b/tests/baselines/reference/invalidNewTarget.es5.js @@ -27,7 +27,7 @@ const O = { //// [invalidNewTarget.es5.js] var a = _newTarget; var b = function () { return _newTarget; }; -var C = (function () { +var C = /** @class */ (function () { function C() { var _newTarget = this.constructor; this.f = function () { return _newTarget; }; diff --git a/tests/baselines/reference/invalidNumberAssignments.js b/tests/baselines/reference/invalidNumberAssignments.js index 674421b3791c8..6b96686238f54 100644 --- a/tests/baselines/reference/invalidNumberAssignments.js +++ b/tests/baselines/reference/invalidNumberAssignments.js @@ -29,7 +29,7 @@ var a = x; var b = x; var c = x; var d = x; -var C = (function () { +var C = /** @class */ (function () { function C() { } return C; diff --git a/tests/baselines/reference/invalidReferenceSyntax1.js b/tests/baselines/reference/invalidReferenceSyntax1.js index e220c41dd6f1f..8a1a460a22712 100644 --- a/tests/baselines/reference/invalidReferenceSyntax1.js +++ b/tests/baselines/reference/invalidReferenceSyntax1.js @@ -6,7 +6,7 @@ class C { //// [invalidReferenceSyntax1.js] /// >>var c = (function () { +>>>var c = /** @class */ (function () { 1 > 2 >^^^^^^^^^^^^^^^^^^^-> 1 > diff --git a/tests/baselines/reference/jsFileCompilationWithMapFileAsJsWithInlineSourceMap.js b/tests/baselines/reference/jsFileCompilationWithMapFileAsJsWithInlineSourceMap.js index e95bfbffaec68..e996e59576308 100644 --- a/tests/baselines/reference/jsFileCompilationWithMapFileAsJsWithInlineSourceMap.js +++ b/tests/baselines/reference/jsFileCompilationWithMapFileAsJsWithInlineSourceMap.js @@ -13,7 +13,7 @@ function bar() { } //// [a.js] -var c = (function () { +var c = /** @class */ (function () { function c() { } return c; diff --git a/tests/baselines/reference/jsFileCompilationWithMapFileAsJsWithInlineSourceMap.sourcemap.txt b/tests/baselines/reference/jsFileCompilationWithMapFileAsJsWithInlineSourceMap.sourcemap.txt index 6a0ac0aac3a52..28133b73dd2c2 100644 --- a/tests/baselines/reference/jsFileCompilationWithMapFileAsJsWithInlineSourceMap.sourcemap.txt +++ b/tests/baselines/reference/jsFileCompilationWithMapFileAsJsWithInlineSourceMap.sourcemap.txt @@ -8,7 +8,7 @@ sources: a.ts emittedFile:tests/cases/compiler/a.js sourceFile:a.ts ------------------------------------------------------------------- ->>>var c = (function () { +>>>var c = /** @class */ (function () { 1 > 2 >^^^^^^^^^^^^^^^^^^^-> 1 > diff --git a/tests/baselines/reference/jsFileCompilationWithMapFileAsJsWithOutDir.js b/tests/baselines/reference/jsFileCompilationWithMapFileAsJsWithOutDir.js index e098aaaa1c913..9fc16e26cd5de 100644 --- a/tests/baselines/reference/jsFileCompilationWithMapFileAsJsWithOutDir.js +++ b/tests/baselines/reference/jsFileCompilationWithMapFileAsJsWithOutDir.js @@ -13,7 +13,7 @@ function bar() { } //// [a.js] -var c = (function () { +var c = /** @class */ (function () { function c() { } return c; diff --git a/tests/baselines/reference/jsFileCompilationWithMapFileAsJsWithOutDir.sourcemap.txt b/tests/baselines/reference/jsFileCompilationWithMapFileAsJsWithOutDir.sourcemap.txt index cee611eb9e818..fcc7e0b1fda34 100644 --- a/tests/baselines/reference/jsFileCompilationWithMapFileAsJsWithOutDir.sourcemap.txt +++ b/tests/baselines/reference/jsFileCompilationWithMapFileAsJsWithOutDir.sourcemap.txt @@ -8,7 +8,7 @@ sources: ../tests/cases/compiler/a.ts emittedFile:out/a.js sourceFile:../tests/cases/compiler/a.ts ------------------------------------------------------------------- ->>>var c = (function () { +>>>var c = /** @class */ (function () { 1 > 2 >^^^^^^^^^^^^^^^^^^^-> 1 > diff --git a/tests/baselines/reference/jsFileCompilationWithOut.js b/tests/baselines/reference/jsFileCompilationWithOut.js index 0ee9f08ebd4b9..6c9e486cacc3b 100644 --- a/tests/baselines/reference/jsFileCompilationWithOut.js +++ b/tests/baselines/reference/jsFileCompilationWithOut.js @@ -10,7 +10,7 @@ function foo() { //// [out.js] -var c = (function () { +var c = /** @class */ (function () { function c() { } return c; diff --git a/tests/baselines/reference/jsFileCompilationWithOutDeclarationFileNameSameAsInputJsFile.js b/tests/baselines/reference/jsFileCompilationWithOutDeclarationFileNameSameAsInputJsFile.js index f87ce797d6640..94da177e8e123 100644 --- a/tests/baselines/reference/jsFileCompilationWithOutDeclarationFileNameSameAsInputJsFile.js +++ b/tests/baselines/reference/jsFileCompilationWithOutDeclarationFileNameSameAsInputJsFile.js @@ -8,7 +8,7 @@ class c { declare function foo(): boolean; //// [b.js] -var c = (function () { +var c = /** @class */ (function () { function c() { } return c; diff --git a/tests/baselines/reference/jsFileCompilationWithoutOut.js b/tests/baselines/reference/jsFileCompilationWithoutOut.js index 5bed8b3a8bbcf..98a533a932516 100644 --- a/tests/baselines/reference/jsFileCompilationWithoutOut.js +++ b/tests/baselines/reference/jsFileCompilationWithoutOut.js @@ -10,7 +10,7 @@ function foo() { //// [a.js] -var c = (function () { +var c = /** @class */ (function () { function c() { } return c; diff --git a/tests/baselines/reference/jsObjectsMarkedAsOpenEnded.js b/tests/baselines/reference/jsObjectsMarkedAsOpenEnded.js index 186918fc15b5c..b5c6ebd5eb2ea 100644 --- a/tests/baselines/reference/jsObjectsMarkedAsOpenEnded.js +++ b/tests/baselines/reference/jsObjectsMarkedAsOpenEnded.js @@ -38,7 +38,7 @@ getObj().a = 1; //// [output.js] var variable = {}; variable.a = 0; -var C = (function () { +var C = /** @class */ (function () { function C() { this.initializedMember = {}; this.member = {}; diff --git a/tests/baselines/reference/jsdocInTypeScript.js b/tests/baselines/reference/jsdocInTypeScript.js index 1583561c7be7e..e79f400d039a4 100644 --- a/tests/baselines/reference/jsdocInTypeScript.js +++ b/tests/baselines/reference/jsdocInTypeScript.js @@ -50,7 +50,7 @@ const obj = { foo: (a, b) => a + b }; //// [jsdocInTypeScript.js] -var T = (function () { +var T = /** @class */ (function () { function T() { } return T; diff --git a/tests/baselines/reference/jsxAndTypeAssertion.js b/tests/baselines/reference/jsxAndTypeAssertion.js index e36d1841b51b1..cf4033f4c577b 100644 --- a/tests/baselines/reference/jsxAndTypeAssertion.js +++ b/tests/baselines/reference/jsxAndTypeAssertion.js @@ -22,7 +22,7 @@ x = x, x = ; //// [jsxAndTypeAssertion.jsx] -var foo = (function () { +var foo = /** @class */ (function () { function foo() { } return foo; diff --git a/tests/baselines/reference/jsxFactoryQualifiedNameWithEs5.js b/tests/baselines/reference/jsxFactoryQualifiedNameWithEs5.js index b549fb58a0a69..1039735cc052c 100644 --- a/tests/baselines/reference/jsxFactoryQualifiedNameWithEs5.js +++ b/tests/baselines/reference/jsxFactoryQualifiedNameWithEs5.js @@ -16,7 +16,7 @@ Object.defineProperty(exports, "__esModule", { value: true }); require("./jsx"); var skate; var React = { createElement: skate.h }; -var Component = (function () { +var Component = /** @class */ (function () { function Component() { } Component.prototype.renderCallback = function () { diff --git a/tests/baselines/reference/jsxInExtendsClause.js b/tests/baselines/reference/jsxInExtendsClause.js index 779b2d4cf8a5f..92398cf692ff1 100644 --- a/tests/baselines/reference/jsxInExtendsClause.js +++ b/tests/baselines/reference/jsxInExtendsClause.js @@ -22,13 +22,13 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var Foo = (function (_super) { +var Foo = /** @class */ (function (_super) { __extends(Foo, _super); function Foo() { return _super !== null && _super.apply(this, arguments) || this; } return Foo; -}(createComponentClass(function () { return (function (_super) { +}(createComponentClass(function () { return /** @class */ (function (_super) { __extends(class_1, _super); function class_1() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/jsxViaImport.2.js b/tests/baselines/reference/jsxViaImport.2.js index 813df2de93812..ba6bde70086b1 100644 --- a/tests/baselines/reference/jsxViaImport.2.js +++ b/tests/baselines/reference/jsxViaImport.2.js @@ -37,7 +37,7 @@ var __extends = (this && this.__extends) || (function () { exports.__esModule = true; /// var BaseComponent_1 = require("BaseComponent"); -var TestComponent = (function (_super) { +var TestComponent = /** @class */ (function (_super) { __extends(TestComponent, _super); function TestComponent() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/jsxViaImport.js b/tests/baselines/reference/jsxViaImport.js index cfbbb9eb456ce..28d760f531f28 100644 --- a/tests/baselines/reference/jsxViaImport.js +++ b/tests/baselines/reference/jsxViaImport.js @@ -37,7 +37,7 @@ var __extends = (this && this.__extends) || (function () { exports.__esModule = true; /// var BaseComponent = require("BaseComponent"); -var TestComponent = (function (_super) { +var TestComponent = /** @class */ (function (_super) { __extends(TestComponent, _super); function TestComponent() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/keyofAndIndexedAccess.js b/tests/baselines/reference/keyofAndIndexedAccess.js index cbd9549b1637b..1a68d9d484d0e 100644 --- a/tests/baselines/reference/keyofAndIndexedAccess.js +++ b/tests/baselines/reference/keyofAndIndexedAccess.js @@ -565,24 +565,24 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var Shape = (function () { +var Shape = /** @class */ (function () { function Shape() { } return Shape; }()); -var TaggedShape = (function (_super) { +var TaggedShape = /** @class */ (function (_super) { __extends(TaggedShape, _super); function TaggedShape() { return _super !== null && _super.apply(this, arguments) || this; } return TaggedShape; }(Shape)); -var Item = (function () { +var Item = /** @class */ (function () { function Item() { } return Item; }()); -var Options = (function () { +var Options = /** @class */ (function () { function Options() { } return Options; @@ -615,7 +615,7 @@ function f13(foo, bar) { var y = getProperty(foo, "100"); // any var z = getProperty(foo, bar); // any } -var Component = (function () { +var Component = /** @class */ (function () { function Component() { } Component.prototype.getProperty = function (key) { @@ -659,7 +659,7 @@ function f34(ts) { var tag1 = f33(ts, "tag"); var tag2 = getProperty(ts, "tag"); } -var C = (function () { +var C = /** @class */ (function () { function C() { } return C; @@ -751,7 +751,7 @@ function f84() { var x1 = f83({ foo: { x: "hello" } }, "foo"); // string var x2 = f83({ bar: { x: 42 } }, "bar"); // number } -var C1 = (function () { +var C1 = /** @class */ (function () { function C1() { } C1.prototype.get = function (key) { @@ -791,7 +791,7 @@ function f90(x1, x2, x3, x4) { x4.length; } // Repros from #12011 -var Base = (function () { +var Base = /** @class */ (function () { function Base() { } Base.prototype.get = function (prop) { @@ -802,7 +802,7 @@ var Base = (function () { }; return Base; }()); -var Person = (function (_super) { +var Person = /** @class */ (function (_super) { __extends(Person, _super); function Person(parts) { var _this = _super.call(this) || this; @@ -814,7 +814,7 @@ var Person = (function (_super) { }; return Person; }(Base)); -var OtherPerson = (function () { +var OtherPerson = /** @class */ (function () { function OtherPerson(parts) { setProperty(this, "parts", parts); } @@ -883,12 +883,12 @@ function updateIds2(obj, key, stringMap) { stringMap[x]; // Should be OK. } // Repro from #13604 -var A = (function () { +var A = /** @class */ (function () { function A() { } return A; }()); -var B = (function (_super) { +var B = /** @class */ (function (_super) { __extends(B, _super); function B() { return _super !== null && _super.apply(this, arguments) || this; @@ -899,7 +899,7 @@ var B = (function (_super) { return B; }(A)); // Repro from #13749 -var Form = (function () { +var Form = /** @class */ (function () { function Form() { } Form.prototype.set = function (prop, value) { @@ -908,13 +908,13 @@ var Form = (function () { return Form; }()); // Repro from #13787 -var SampleClass = (function () { +var SampleClass = /** @class */ (function () { function SampleClass(props) { this.props = Object.freeze(props); } return SampleClass; }()); -var AnotherSampleClass = (function (_super) { +var AnotherSampleClass = /** @class */ (function (_super) { __extends(AnotherSampleClass, _super); function AnotherSampleClass(props) { var _this = this; diff --git a/tests/baselines/reference/keyofAndIndexedAccessErrors.js b/tests/baselines/reference/keyofAndIndexedAccessErrors.js index 556aca129711b..838a3a6a86b80 100644 --- a/tests/baselines/reference/keyofAndIndexedAccessErrors.js +++ b/tests/baselines/reference/keyofAndIndexedAccessErrors.js @@ -80,7 +80,7 @@ function f20(k1: keyof (T | U), k2: keyof (T & U), o1: T | U, o2: T & U) { } //// [keyofAndIndexedAccessErrors.js] -var Shape = (function () { +var Shape = /** @class */ (function () { function Shape() { } return Shape; diff --git a/tests/baselines/reference/lambdaArgCrash.js b/tests/baselines/reference/lambdaArgCrash.js index 9a903b513d9f2..86e75c19fc16e 100644 --- a/tests/baselines/reference/lambdaArgCrash.js +++ b/tests/baselines/reference/lambdaArgCrash.js @@ -45,7 +45,7 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var Event = (function () { +var Event = /** @class */ (function () { function Event() { // TODO: remove this._listeners = []; @@ -58,7 +58,7 @@ var Event = (function () { }; return Event; }()); -var ItemSetEvent = (function (_super) { +var ItemSetEvent = /** @class */ (function (_super) { __extends(ItemSetEvent, _super); function ItemSetEvent() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/lambdaPropSelf.js b/tests/baselines/reference/lambdaPropSelf.js index 5e19726f79492..7e42e4a44c2ad 100644 --- a/tests/baselines/reference/lambdaPropSelf.js +++ b/tests/baselines/reference/lambdaPropSelf.js @@ -24,7 +24,7 @@ module M { //// [lambdaPropSelf.js] -var Person = (function () { +var Person = /** @class */ (function () { function Person(name, children) { var _this = this; this.name = name; @@ -33,7 +33,7 @@ var Person = (function () { } return Person; }()); -var T = (function () { +var T = /** @class */ (function () { function T() { } T.prototype.fo = function () { diff --git a/tests/baselines/reference/libMembers.js b/tests/baselines/reference/libMembers.js index 46ef17bb6519f..84e76851e99b4 100644 --- a/tests/baselines/reference/libMembers.js +++ b/tests/baselines/reference/libMembers.js @@ -23,7 +23,7 @@ s.subby(12); // error unresolved String.fromCharCode(12); var M; (function (M) { - var C = (function () { + var C = /** @class */ (function () { function C() { } return C; diff --git a/tests/baselines/reference/lift.js b/tests/baselines/reference/lift.js index 80eebe9cb00bc..ddcd44afd1e43 100644 --- a/tests/baselines/reference/lift.js +++ b/tests/baselines/reference/lift.js @@ -28,13 +28,13 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var B = (function () { +var B = /** @class */ (function () { function B(y) { this.y = y; } return B; }()); -var C = (function (_super) { +var C = /** @class */ (function (_super) { __extends(C, _super); function C(y, z, w) { var _this = _super.call(this, y) || this; diff --git a/tests/baselines/reference/listFailure.js b/tests/baselines/reference/listFailure.js index ab0e9ca5bff0b..82063e04b0499 100644 --- a/tests/baselines/reference/listFailure.js +++ b/tests/baselines/reference/listFailure.js @@ -44,7 +44,7 @@ module Editor { //// [listFailure.js] var Editor; (function (Editor) { - var Buffer = (function () { + var Buffer = /** @class */ (function () { function Buffer() { this.lines = ListMakeHead(); } @@ -68,7 +68,7 @@ var Editor; return null; } Editor.ListMakeEntry = ListMakeEntry; - var List = (function () { + var List = /** @class */ (function () { function List() { } List.prototype.add = function (data) { @@ -80,7 +80,7 @@ var Editor; }; return List; }()); - var Line = (function () { + var Line = /** @class */ (function () { function Line() { } return Line; diff --git a/tests/baselines/reference/literalTypes2.js b/tests/baselines/reference/literalTypes2.js index 415129b2d9bea..a5e0f6dcb84de 100644 --- a/tests/baselines/reference/literalTypes2.js +++ b/tests/baselines/reference/literalTypes2.js @@ -251,7 +251,7 @@ function f3() { var x7 = c7; var x8 = c8; } -var C1 = (function () { +var C1 = /** @class */ (function () { function C1() { this.x1 = 1; this.x2 = -123; @@ -304,7 +304,7 @@ function f12() { return "two"; } } -var C2 = (function () { +var C2 = /** @class */ (function () { function C2() { } C2.prototype.foo = function () { diff --git a/tests/baselines/reference/literalTypesWidenInParameterPosition.js b/tests/baselines/reference/literalTypesWidenInParameterPosition.js index 2c1d165b6ec43..28d578e9aa1e0 100644 --- a/tests/baselines/reference/literalTypesWidenInParameterPosition.js +++ b/tests/baselines/reference/literalTypesWidenInParameterPosition.js @@ -10,7 +10,7 @@ new D(7); // ok //// [literalTypesWidenInParameterPosition.js] -var D = (function () { +var D = /** @class */ (function () { function D(widen) { if (widen === void 0) { widen = 2; } this.widen = widen; diff --git a/tests/baselines/reference/literalsInComputedProperties1.js b/tests/baselines/reference/literalsInComputedProperties1.js index dd94709d2cf72..c5b0060f6263f 100644 --- a/tests/baselines/reference/literalsInComputedProperties1.js +++ b/tests/baselines/reference/literalsInComputedProperties1.js @@ -67,7 +67,7 @@ y[1].toExponential(); y[2].toExponential(); y[3].toExponential(); y[4].toExponential(); -var C = (function () { +var C = /** @class */ (function () { function C() { } return C; diff --git a/tests/baselines/reference/localClassesInLoop.js b/tests/baselines/reference/localClassesInLoop.js index d01d86da8d1f0..155a87c961b35 100644 --- a/tests/baselines/reference/localClassesInLoop.js +++ b/tests/baselines/reference/localClassesInLoop.js @@ -14,7 +14,7 @@ use(data[0]() === data[1]()); "use strict"; var data = []; var _loop_1 = function (x) { - var C = (function () { + var C = /** @class */ (function () { function C() { } return C; diff --git a/tests/baselines/reference/localTypes1.js b/tests/baselines/reference/localTypes1.js index 4eddc5c838cfb..09cc78fc58e77 100644 --- a/tests/baselines/reference/localTypes1.js +++ b/tests/baselines/reference/localTypes1.js @@ -158,7 +158,7 @@ function f1() { E[E["B"] = 1] = "B"; E[E["C"] = 2] = "C"; })(E || (E = {})); - var C = (function () { + var C = /** @class */ (function () { function C() { } return C; @@ -175,7 +175,7 @@ function f2() { E[E["B"] = 1] = "B"; E[E["C"] = 2] = "C"; })(E || (E = {})); - var C = (function () { + var C = /** @class */ (function () { function C() { } return C; @@ -195,7 +195,7 @@ function f3(b) { E[E["C"] = 2] = "C"; })(E || (E = {})); if (b) { - var C = (function () { + var C = /** @class */ (function () { function C() { } return C; @@ -205,7 +205,7 @@ function f3(b) { return a; } else { - var A_1 = (function () { + var A_1 = /** @class */ (function () { function A() { } return A; @@ -224,7 +224,7 @@ function f5() { E[E["B"] = 1] = "B"; E[E["C"] = 2] = "C"; })(E || (E = {})); - var C = (function () { + var C = /** @class */ (function () { function C() { } return C; @@ -238,7 +238,7 @@ function f5() { E[E["B"] = 1] = "B"; E[E["C"] = 2] = "C"; })(E || (E = {})); - var C = (function () { + var C = /** @class */ (function () { function C() { } return C; @@ -246,7 +246,7 @@ function f5() { return new C(); }; } -var A = (function () { +var A = /** @class */ (function () { function A() { var E; (function (E) { @@ -254,7 +254,7 @@ var A = (function () { E[E["B"] = 1] = "B"; E[E["C"] = 2] = "C"; })(E || (E = {})); - var C = (function () { + var C = /** @class */ (function () { function C() { } return C; @@ -267,7 +267,7 @@ var A = (function () { E[E["B"] = 1] = "B"; E[E["C"] = 2] = "C"; })(E || (E = {})); - var C = (function () { + var C = /** @class */ (function () { function C() { } return C; @@ -282,7 +282,7 @@ var A = (function () { E[E["B"] = 1] = "B"; E[E["C"] = 2] = "C"; })(E || (E = {})); - var C = (function () { + var C = /** @class */ (function () { function C() { } return C; @@ -295,13 +295,13 @@ var A = (function () { return A; }()); function f6() { - var A = (function () { + var A = /** @class */ (function () { function A() { } return A; }()); function g() { - var B = (function (_super) { + var B = /** @class */ (function (_super) { __extends(B, _super); function B() { return _super !== null && _super.apply(this, arguments) || this; @@ -309,7 +309,7 @@ function f6() { return B; }(A)); function h() { - var C = (function (_super) { + var C = /** @class */ (function (_super) { __extends(C, _super); function C() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/localTypes2.js b/tests/baselines/reference/localTypes2.js index e8713f75241f6..ec76bb4792fd2 100644 --- a/tests/baselines/reference/localTypes2.js +++ b/tests/baselines/reference/localTypes2.js @@ -44,7 +44,7 @@ function f3() { //// [localTypes2.js] function f1() { function f() { - var C = (function () { + var C = /** @class */ (function () { function C(x, y) { this.x = x; this.y = y; @@ -60,7 +60,7 @@ function f1() { } function f2() { function f(x) { - var C = (function () { + var C = /** @class */ (function () { function C(y) { this.y = y; this.x = x; @@ -76,7 +76,7 @@ function f2() { } function f3() { function f(x, y) { - var C = (function () { + var C = /** @class */ (function () { function C() { this.x = x; this.y = y; diff --git a/tests/baselines/reference/localTypes3.js b/tests/baselines/reference/localTypes3.js index 462959e68d1a7..831efc3f3a1ab 100644 --- a/tests/baselines/reference/localTypes3.js +++ b/tests/baselines/reference/localTypes3.js @@ -44,7 +44,7 @@ function f3() { //// [localTypes3.js] function f1() { function f() { - var C = (function () { + var C = /** @class */ (function () { function C(x, y) { this.x = x; this.y = y; @@ -60,7 +60,7 @@ function f1() { } function f2() { function f(x) { - var C = (function () { + var C = /** @class */ (function () { function C(y) { this.y = y; this.x = x; @@ -76,7 +76,7 @@ function f2() { } function f3() { function f(x, y) { - var C = (function () { + var C = /** @class */ (function () { function C() { this.x = x; this.y = y; diff --git a/tests/baselines/reference/localTypes5.js b/tests/baselines/reference/localTypes5.js index c7f0f722741e8..d5afefd79d18a 100644 --- a/tests/baselines/reference/localTypes5.js +++ b/tests/baselines/reference/localTypes5.js @@ -17,12 +17,12 @@ var x = foo(); //// [localTypes5.js] function foo() { - var X = (function () { + var X = /** @class */ (function () { function X() { } X.prototype.m = function () { return (function () { - var Y = (function () { + var Y = /** @class */ (function () { function Y() { } return Y; diff --git a/tests/baselines/reference/logicalNotOperatorWithAnyOtherType.js b/tests/baselines/reference/logicalNotOperatorWithAnyOtherType.js index 6f51a3cdda02d..971f9fafd1d28 100644 --- a/tests/baselines/reference/logicalNotOperatorWithAnyOtherType.js +++ b/tests/baselines/reference/logicalNotOperatorWithAnyOtherType.js @@ -70,7 +70,7 @@ function foo() { var a; return a; } -var A = (function () { +var A = /** @class */ (function () { function A() { } A.foo = function () { diff --git a/tests/baselines/reference/logicalNotOperatorWithBooleanType.js b/tests/baselines/reference/logicalNotOperatorWithBooleanType.js index bd273fffc3677..84289a8b24d66 100644 --- a/tests/baselines/reference/logicalNotOperatorWithBooleanType.js +++ b/tests/baselines/reference/logicalNotOperatorWithBooleanType.js @@ -42,7 +42,7 @@ var ResultIsBoolean = !!BOOLEAN; // ! operator on boolean type var BOOLEAN; function foo() { return true; } -var A = (function () { +var A = /** @class */ (function () { function A() { } A.foo = function () { return false; }; diff --git a/tests/baselines/reference/logicalNotOperatorWithNumberType.js b/tests/baselines/reference/logicalNotOperatorWithNumberType.js index f643b5452bb78..f8d1b9233f655 100644 --- a/tests/baselines/reference/logicalNotOperatorWithNumberType.js +++ b/tests/baselines/reference/logicalNotOperatorWithNumberType.js @@ -50,7 +50,7 @@ var ResultIsBoolean13 = !!!(NUMBER + NUMBER); var NUMBER; var NUMBER1 = [1, 2]; function foo() { return 1; } -var A = (function () { +var A = /** @class */ (function () { function A() { } A.foo = function () { return 1; }; diff --git a/tests/baselines/reference/logicalNotOperatorWithStringType.js b/tests/baselines/reference/logicalNotOperatorWithStringType.js index 8a80ed8761aee..2fc9455222996 100644 --- a/tests/baselines/reference/logicalNotOperatorWithStringType.js +++ b/tests/baselines/reference/logicalNotOperatorWithStringType.js @@ -49,7 +49,7 @@ var ResultIsBoolean14 = !!!(STRING + STRING); var STRING; var STRING1 = ["", "abc"]; function foo() { return "abc"; } -var A = (function () { +var A = /** @class */ (function () { function A() { } A.foo = function () { return ""; }; diff --git a/tests/baselines/reference/looseThisTypeInFunctions.js b/tests/baselines/reference/looseThisTypeInFunctions.js index cb1fbcc8b9572..fcf39472c568c 100644 --- a/tests/baselines/reference/looseThisTypeInFunctions.js +++ b/tests/baselines/reference/looseThisTypeInFunctions.js @@ -49,7 +49,7 @@ i.explicitThis = function(m) { //// [looseThisTypeInFunctions.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } C.prototype.explicitThis = function (m) { diff --git a/tests/baselines/reference/m7Bugs.js b/tests/baselines/reference/m7Bugs.js index d5fd319b9936b..46dee928dd18f 100644 --- a/tests/baselines/reference/m7Bugs.js +++ b/tests/baselines/reference/m7Bugs.js @@ -39,12 +39,12 @@ var __extends = (this && this.__extends) || (function () { })(); var s = ({}); var x = {}; -var C1 = (function () { +var C1 = /** @class */ (function () { function C1() { } return C1; }()); -var C2 = (function (_super) { +var C2 = /** @class */ (function (_super) { __extends(C2, _super); function C2() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/mappedTypeErrors.js b/tests/baselines/reference/mappedTypeErrors.js index dcaa737edd85c..bc73780a4787d 100644 --- a/tests/baselines/reference/mappedTypeErrors.js +++ b/tests/baselines/reference/mappedTypeErrors.js @@ -196,7 +196,7 @@ setState(foo, {}); setState(foo, foo); setState(foo, { a: undefined }); // Error setState(foo, { c: true }); // Error -var C = (function () { +var C = /** @class */ (function () { function C() { } C.prototype.setState = function (props) { diff --git a/tests/baselines/reference/mappedTypes3.js b/tests/baselines/reference/mappedTypes3.js index b839e02d3a361..cac0e915b1bb5 100644 --- a/tests/baselines/reference/mappedTypes3.js +++ b/tests/baselines/reference/mappedTypes3.js @@ -39,7 +39,7 @@ function f3(bb: BoxifiedBacon) { } //// [mappedTypes3.js] -var Box = (function () { +var Box = /** @class */ (function () { function Box() { } return Box; diff --git a/tests/baselines/reference/mappedTypesAndObjects.js b/tests/baselines/reference/mappedTypesAndObjects.js index 664f3b9572dc7..cad6a7d99ee46 100644 --- a/tests/baselines/reference/mappedTypesAndObjects.js +++ b/tests/baselines/reference/mappedTypesAndObjects.js @@ -59,7 +59,7 @@ function f3(x) { } ; // Repro from #13747 -var Form = (function () { +var Form = /** @class */ (function () { function Form() { this.values = {}; } diff --git a/tests/baselines/reference/matchReturnTypeInAllBranches.js b/tests/baselines/reference/matchReturnTypeInAllBranches.js index 4ac2c63eb4f4d..b774a99880149 100644 --- a/tests/baselines/reference/matchReturnTypeInAllBranches.js +++ b/tests/baselines/reference/matchReturnTypeInAllBranches.js @@ -37,7 +37,7 @@ cookieMonster = new IceCreamMonster("Chocolate Chip", false, "COOOOOKIE", "Cooki //// [matchReturnTypeInAllBranches.js] // Represents a monster who enjoys ice cream -var IceCreamMonster = (function () { +var IceCreamMonster = /** @class */ (function () { function IceCreamMonster(iceCreamFlavor, wantsSprinkles, soundsWhenEating, name) { this.iceCreamFlavor = iceCreamFlavor; this.iceCreamRemaining = 100; diff --git a/tests/baselines/reference/memberAccessMustUseModuleInstances.js b/tests/baselines/reference/memberAccessMustUseModuleInstances.js index 2ba05b016bee2..1612a0632f0ff 100644 --- a/tests/baselines/reference/memberAccessMustUseModuleInstances.js +++ b/tests/baselines/reference/memberAccessMustUseModuleInstances.js @@ -18,7 +18,7 @@ WinJS.Promise.timeout(10); define(["require", "exports"], function (require, exports) { "use strict"; exports.__esModule = true; - var Promise = (function () { + var Promise = /** @class */ (function () { function Promise() { } Promise.timeout = function (delay) { diff --git a/tests/baselines/reference/memberFunctionOverloadMixingStaticAndInstance.js b/tests/baselines/reference/memberFunctionOverloadMixingStaticAndInstance.js index 6555151ccd74b..db3b283819576 100644 --- a/tests/baselines/reference/memberFunctionOverloadMixingStaticAndInstance.js +++ b/tests/baselines/reference/memberFunctionOverloadMixingStaticAndInstance.js @@ -20,22 +20,22 @@ class F { } //// [memberFunctionOverloadMixingStaticAndInstance.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } return C; }()); -var D = (function () { +var D = /** @class */ (function () { function D() { } return D; }()); -var E = (function () { +var E = /** @class */ (function () { function E() { } return E; }()); -var F = (function () { +var F = /** @class */ (function () { function F() { } return F; diff --git a/tests/baselines/reference/memberFunctionsWithPrivateOverloads.js b/tests/baselines/reference/memberFunctionsWithPrivateOverloads.js index ecf9a14033ba0..a1d8b3f7f2b15 100644 --- a/tests/baselines/reference/memberFunctionsWithPrivateOverloads.js +++ b/tests/baselines/reference/memberFunctionsWithPrivateOverloads.js @@ -50,7 +50,7 @@ var r3 = C.foo(1); // error var r4 = D.bar(''); // error //// [memberFunctionsWithPrivateOverloads.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } C.prototype.foo = function (x, y) { }; @@ -59,7 +59,7 @@ var C = (function () { C.bar = function (x, y) { }; return C; }()); -var D = (function () { +var D = /** @class */ (function () { function D() { } D.prototype.foo = function (x, y) { }; diff --git a/tests/baselines/reference/memberFunctionsWithPublicOverloads.js b/tests/baselines/reference/memberFunctionsWithPublicOverloads.js index 91b9e82967303..1e476fddfd955 100644 --- a/tests/baselines/reference/memberFunctionsWithPublicOverloads.js +++ b/tests/baselines/reference/memberFunctionsWithPublicOverloads.js @@ -41,7 +41,7 @@ class D { } //// [memberFunctionsWithPublicOverloads.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } C.prototype.foo = function (x, y) { }; @@ -50,7 +50,7 @@ var C = (function () { C.bar = function (x, y) { }; return C; }()); -var D = (function () { +var D = /** @class */ (function () { function D() { } D.prototype.foo = function (x, y) { }; diff --git a/tests/baselines/reference/memberFunctionsWithPublicPrivateOverloads.js b/tests/baselines/reference/memberFunctionsWithPublicPrivateOverloads.js index 1d8d40533c644..f227ad7a88583 100644 --- a/tests/baselines/reference/memberFunctionsWithPublicPrivateOverloads.js +++ b/tests/baselines/reference/memberFunctionsWithPublicPrivateOverloads.js @@ -63,7 +63,7 @@ var d: D; var r2 = d.foo(2); // error //// [memberFunctionsWithPublicPrivateOverloads.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } C.prototype.foo = function (x, y) { }; @@ -74,7 +74,7 @@ var C = (function () { C.baz = function (x, y) { }; return C; }()); -var D = (function () { +var D = /** @class */ (function () { function D() { } D.prototype.foo = function (x, y) { }; diff --git a/tests/baselines/reference/memberScope.js b/tests/baselines/reference/memberScope.js index f8600053b1e79..3d15adface9fa 100644 --- a/tests/baselines/reference/memberScope.js +++ b/tests/baselines/reference/memberScope.js @@ -10,7 +10,7 @@ module Salt { //// [memberScope.js] var Salt; (function (Salt) { - var Pepper = (function () { + var Pepper = /** @class */ (function () { function Pepper() { } return Pepper; diff --git a/tests/baselines/reference/memberVariableDeclarations1.js b/tests/baselines/reference/memberVariableDeclarations1.js index f72633a7c83e2..a1caf2b3ca7d9 100644 --- a/tests/baselines/reference/memberVariableDeclarations1.js +++ b/tests/baselines/reference/memberVariableDeclarations1.js @@ -29,7 +29,7 @@ e2 = e1; //// [memberVariableDeclarations1.js] // from spec -var Employee = (function () { +var Employee = /** @class */ (function () { function Employee() { this.retired = false; this.manager = null; @@ -37,7 +37,7 @@ var Employee = (function () { } return Employee; }()); -var Employee2 = (function () { +var Employee2 = /** @class */ (function () { function Employee2() { this.retired = false; this.manager = null; diff --git a/tests/baselines/reference/mergedClassInterface.js b/tests/baselines/reference/mergedClassInterface.js index 54f806f20177e..cc26d614e1295 100644 --- a/tests/baselines/reference/mergedClassInterface.js +++ b/tests/baselines/reference/mergedClassInterface.js @@ -51,12 +51,12 @@ interface C6 { } declare class C7 { } //// [file1.js] -var C3 = (function () { +var C3 = /** @class */ (function () { function C3() { } return C3; }()); -var C4 = (function () { +var C4 = /** @class */ (function () { function C4() { } return C4; diff --git a/tests/baselines/reference/mergedDeclarations5.js b/tests/baselines/reference/mergedDeclarations5.js index a1e144fc2230e..1b886c860354b 100644 --- a/tests/baselines/reference/mergedDeclarations5.js +++ b/tests/baselines/reference/mergedDeclarations5.js @@ -12,7 +12,7 @@ class B extends A { } //// [a.js] -var A = (function () { +var A = /** @class */ (function () { function A() { } A.prototype.foo = function () { }; @@ -29,7 +29,7 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var B = (function (_super) { +var B = /** @class */ (function (_super) { __extends(B, _super); function B() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/mergedDeclarations6.js b/tests/baselines/reference/mergedDeclarations6.js index 2b492b569c250..e36d283223758 100644 --- a/tests/baselines/reference/mergedDeclarations6.js +++ b/tests/baselines/reference/mergedDeclarations6.js @@ -26,7 +26,7 @@ export class B extends A { define(["require", "exports"], function (require, exports) { "use strict"; exports.__esModule = true; - var A = (function () { + var A = /** @class */ (function () { function A() { } A.prototype.setProtected = function (val) { @@ -50,7 +50,7 @@ var __extends = (this && this.__extends) || (function () { define(["require", "exports", "./a"], function (require, exports, a_1) { "use strict"; exports.__esModule = true; - var B = (function (_super) { + var B = /** @class */ (function (_super) { __extends(B, _super); function B() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/mergedInheritedClassInterface.js b/tests/baselines/reference/mergedInheritedClassInterface.js index 25ad2b8be759f..b4075b0b47b6a 100644 --- a/tests/baselines/reference/mergedInheritedClassInterface.js +++ b/tests/baselines/reference/mergedInheritedClassInterface.js @@ -57,13 +57,13 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var BaseClass = (function () { +var BaseClass = /** @class */ (function () { function BaseClass() { } BaseClass.prototype.baseMethod = function () { }; return BaseClass; }()); -var Child = (function (_super) { +var Child = /** @class */ (function (_super) { __extends(Child, _super); function Child() { return _super !== null && _super.apply(this, arguments) || this; @@ -71,13 +71,13 @@ var Child = (function (_super) { Child.prototype.method = function () { }; return Child; }(BaseClass)); -var ChildNoBaseClass = (function () { +var ChildNoBaseClass = /** @class */ (function () { function ChildNoBaseClass() { } ChildNoBaseClass.prototype.method2 = function () { }; return ChildNoBaseClass; }()); -var Grandchild = (function (_super) { +var Grandchild = /** @class */ (function (_super) { __extends(Grandchild, _super); function Grandchild() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/mergedInterfacesWithInheritedPrivates.js b/tests/baselines/reference/mergedInterfacesWithInheritedPrivates.js index 2c9e7fc2da420..918ec5776f775 100644 --- a/tests/baselines/reference/mergedInterfacesWithInheritedPrivates.js +++ b/tests/baselines/reference/mergedInterfacesWithInheritedPrivates.js @@ -27,17 +27,17 @@ var a: A; var r = a.x; // error //// [mergedInterfacesWithInheritedPrivates.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } return C; }()); -var D = (function () { +var D = /** @class */ (function () { function D() { } return D; }()); -var E = (function () { +var E = /** @class */ (function () { function E() { } return E; diff --git a/tests/baselines/reference/mergedInterfacesWithInheritedPrivates2.js b/tests/baselines/reference/mergedInterfacesWithInheritedPrivates2.js index 4390bc251cd7d..ea80b6ac5cedc 100644 --- a/tests/baselines/reference/mergedInterfacesWithInheritedPrivates2.js +++ b/tests/baselines/reference/mergedInterfacesWithInheritedPrivates2.js @@ -42,24 +42,24 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var C = (function () { +var C = /** @class */ (function () { function C() { } return C; }()); -var C2 = (function () { +var C2 = /** @class */ (function () { function C2() { } return C2; }()); -var D = (function (_super) { +var D = /** @class */ (function (_super) { __extends(D, _super); function D() { return _super !== null && _super.apply(this, arguments) || this; } return D; }(C)); -var E = (function (_super) { +var E = /** @class */ (function (_super) { __extends(E, _super); function E() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/mergedInterfacesWithInheritedPrivates3.js b/tests/baselines/reference/mergedInterfacesWithInheritedPrivates3.js index 8ad8a27dc8f25..e2ad04d296b66 100644 --- a/tests/baselines/reference/mergedInterfacesWithInheritedPrivates3.js +++ b/tests/baselines/reference/mergedInterfacesWithInheritedPrivates3.js @@ -49,17 +49,17 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var C = (function () { +var C = /** @class */ (function () { function C() { } return C; }()); -var C2 = (function () { +var C2 = /** @class */ (function () { function C2() { } return C2; }()); -var D = (function (_super) { +var D = /** @class */ (function (_super) { __extends(D, _super); function D() { return _super !== null && _super.apply(this, arguments) || this; @@ -68,12 +68,12 @@ var D = (function (_super) { }(C)); var M; (function (M) { - var C = (function () { + var C = /** @class */ (function () { function C() { } return C; }()); - var C2 = (function () { + var C2 = /** @class */ (function () { function C2() { } return C2; diff --git a/tests/baselines/reference/mergedInterfacesWithMultipleBases.js b/tests/baselines/reference/mergedInterfacesWithMultipleBases.js index 2bc5d1e0e3688..62df614348201 100644 --- a/tests/baselines/reference/mergedInterfacesWithMultipleBases.js +++ b/tests/baselines/reference/mergedInterfacesWithMultipleBases.js @@ -57,17 +57,17 @@ module M { //// [mergedInterfacesWithMultipleBases.js] // merged interfaces behave as if all extends clauses from each declaration are merged together // no errors expected -var C = (function () { +var C = /** @class */ (function () { function C() { } return C; }()); -var C2 = (function () { +var C2 = /** @class */ (function () { function C2() { } return C2; }()); -var D = (function () { +var D = /** @class */ (function () { function D() { } return D; @@ -77,17 +77,17 @@ var r = a.a; // generic interfaces in a module var M; (function (M) { - var C = (function () { + var C = /** @class */ (function () { function C() { } return C; }()); - var C2 = (function () { + var C2 = /** @class */ (function () { function C2() { } return C2; }()); - var D = (function () { + var D = /** @class */ (function () { function D() { } return D; diff --git a/tests/baselines/reference/mergedInterfacesWithMultipleBases2.js b/tests/baselines/reference/mergedInterfacesWithMultipleBases2.js index 3253a8fc077f3..7de5b7e056ebc 100644 --- a/tests/baselines/reference/mergedInterfacesWithMultipleBases2.js +++ b/tests/baselines/reference/mergedInterfacesWithMultipleBases2.js @@ -78,27 +78,27 @@ module M { //// [mergedInterfacesWithMultipleBases2.js] // merged interfaces behave as if all extends clauses from each declaration are merged together // no errors expected -var C = (function () { +var C = /** @class */ (function () { function C() { } return C; }()); -var C2 = (function () { +var C2 = /** @class */ (function () { function C2() { } return C2; }()); -var C3 = (function () { +var C3 = /** @class */ (function () { function C3() { } return C3; }()); -var C4 = (function () { +var C4 = /** @class */ (function () { function C4() { } return C4; }()); -var D = (function () { +var D = /** @class */ (function () { function D() { } return D; @@ -108,27 +108,27 @@ var r = a.a; // generic interfaces in a module var M; (function (M) { - var C = (function () { + var C = /** @class */ (function () { function C() { } return C; }()); - var C2 = (function () { + var C2 = /** @class */ (function () { function C2() { } return C2; }()); - var C3 = (function () { + var C3 = /** @class */ (function () { function C3() { } return C3; }()); - var C4 = (function () { + var C4 = /** @class */ (function () { function C4() { } return C4; }()); - var D = (function () { + var D = /** @class */ (function () { function D() { } return D; diff --git a/tests/baselines/reference/mergedInterfacesWithMultipleBases3.js b/tests/baselines/reference/mergedInterfacesWithMultipleBases3.js index 1fb5455f82a5c..030d5c8f346e9 100644 --- a/tests/baselines/reference/mergedInterfacesWithMultipleBases3.js +++ b/tests/baselines/reference/mergedInterfacesWithMultipleBases3.js @@ -38,27 +38,27 @@ class D implements A { //// [mergedInterfacesWithMultipleBases3.js] // merged interfaces behave as if all extends clauses from each declaration are merged together // no errors expected -var C = (function () { +var C = /** @class */ (function () { function C() { } return C; }()); -var C2 = (function () { +var C2 = /** @class */ (function () { function C2() { } return C2; }()); -var C3 = (function () { +var C3 = /** @class */ (function () { function C3() { } return C3; }()); -var C4 = (function () { +var C4 = /** @class */ (function () { function C4() { } return C4; }()); -var D = (function () { +var D = /** @class */ (function () { function D() { } return D; diff --git a/tests/baselines/reference/mergedInterfacesWithMultipleBases4.js b/tests/baselines/reference/mergedInterfacesWithMultipleBases4.js index 40292d1a72f70..d32a250f5366d 100644 --- a/tests/baselines/reference/mergedInterfacesWithMultipleBases4.js +++ b/tests/baselines/reference/mergedInterfacesWithMultipleBases4.js @@ -36,27 +36,27 @@ class D implements A { //// [mergedInterfacesWithMultipleBases4.js] // merged interfaces behave as if all extends clauses from each declaration are merged together -var C = (function () { +var C = /** @class */ (function () { function C() { } return C; }()); -var C2 = (function () { +var C2 = /** @class */ (function () { function C2() { } return C2; }()); -var C3 = (function () { +var C3 = /** @class */ (function () { function C3() { } return C3; }()); -var C4 = (function () { +var C4 = /** @class */ (function () { function C4() { } return C4; }()); -var D = (function () { +var D = /** @class */ (function () { function D() { } return D; diff --git a/tests/baselines/reference/mergedModuleDeclarationCodeGen.js b/tests/baselines/reference/mergedModuleDeclarationCodeGen.js index 8d5f55b68017f..cc5e0a8eb85cf 100644 --- a/tests/baselines/reference/mergedModuleDeclarationCodeGen.js +++ b/tests/baselines/reference/mergedModuleDeclarationCodeGen.js @@ -22,7 +22,7 @@ var X; (function (X) { var Y; (function (Y_1) { - var A = (function () { + var A = /** @class */ (function () { function A(Y) { new Y_1.B(); } @@ -33,7 +33,7 @@ var X; (function (X) { var Y; (function (Y) { - var B = (function () { + var B = /** @class */ (function () { function B() { } return B; diff --git a/tests/baselines/reference/mergedModuleDeclarationCodeGen5.js b/tests/baselines/reference/mergedModuleDeclarationCodeGen5.js index 8891dbf61e22c..e67b189ba7882 100644 --- a/tests/baselines/reference/mergedModuleDeclarationCodeGen5.js +++ b/tests/baselines/reference/mergedModuleDeclarationCodeGen5.js @@ -39,7 +39,7 @@ var M; (function (plop_1) { function gunk() { } function buz() { } - var fudge = (function () { + var fudge = /** @class */ (function () { function fudge() { } return fudge; diff --git a/tests/baselines/reference/metadataOfClassFromAlias.js b/tests/baselines/reference/metadataOfClassFromAlias.js index 75fdd90652f4f..307702cd7bfb2 100644 --- a/tests/baselines/reference/metadataOfClassFromAlias.js +++ b/tests/baselines/reference/metadataOfClassFromAlias.js @@ -17,7 +17,7 @@ export class ClassA { //// [auxiliry.js] "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); -var SomeClass = (function () { +var SomeClass = /** @class */ (function () { function SomeClass() { } return SomeClass; @@ -38,7 +38,7 @@ Object.defineProperty(exports, "__esModule", { value: true }); function annotation() { return function (target) { }; } -var ClassA = (function () { +var ClassA = /** @class */ (function () { function ClassA() { } __decorate([ diff --git a/tests/baselines/reference/metadataOfClassFromAlias2.js b/tests/baselines/reference/metadataOfClassFromAlias2.js index ca56802863824..c106f12edd3f7 100644 --- a/tests/baselines/reference/metadataOfClassFromAlias2.js +++ b/tests/baselines/reference/metadataOfClassFromAlias2.js @@ -17,7 +17,7 @@ export class ClassA { //// [auxiliry.js] "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); -var SomeClass = (function () { +var SomeClass = /** @class */ (function () { function SomeClass() { } return SomeClass; @@ -38,7 +38,7 @@ Object.defineProperty(exports, "__esModule", { value: true }); function annotation() { return function (target) { }; } -var ClassA = (function () { +var ClassA = /** @class */ (function () { function ClassA() { } __decorate([ diff --git a/tests/baselines/reference/metadataOfClassFromModule.js b/tests/baselines/reference/metadataOfClassFromModule.js index ca8c56e3c5e1e..127e5878843eb 100644 --- a/tests/baselines/reference/metadataOfClassFromModule.js +++ b/tests/baselines/reference/metadataOfClassFromModule.js @@ -25,13 +25,13 @@ var MyModule; (function (MyModule) { function inject(target, key) { } MyModule.inject = inject; - var Leg = (function () { + var Leg = /** @class */ (function () { function Leg() { } return Leg; }()); MyModule.Leg = Leg; - var Person = (function () { + var Person = /** @class */ (function () { function Person() { } __decorate([ diff --git a/tests/baselines/reference/metadataOfEventAlias.js b/tests/baselines/reference/metadataOfEventAlias.js index cf04258624266..fdb66aa1c7c02 100644 --- a/tests/baselines/reference/metadataOfEventAlias.js +++ b/tests/baselines/reference/metadataOfEventAlias.js @@ -27,7 +27,7 @@ var __metadata = (this && this.__metadata) || function (k, v) { }; Object.defineProperty(exports, "__esModule", { value: true }); function Input(target, key) { } -var SomeClass = (function () { +var SomeClass = /** @class */ (function () { function SomeClass() { } __decorate([ diff --git a/tests/baselines/reference/metadataOfStringLiteral.js b/tests/baselines/reference/metadataOfStringLiteral.js index 3053627020712..d7a714d6a66ce 100644 --- a/tests/baselines/reference/metadataOfStringLiteral.js +++ b/tests/baselines/reference/metadataOfStringLiteral.js @@ -17,7 +17,7 @@ var __metadata = (this && this.__metadata) || function (k, v) { if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); }; function PropDeco(target, propKey) { } -var Foo = (function () { +var Foo = /** @class */ (function () { function Foo() { } __decorate([ diff --git a/tests/baselines/reference/metadataOfUnion.js b/tests/baselines/reference/metadataOfUnion.js index 7a063b0e93c13..71820c60e005f 100644 --- a/tests/baselines/reference/metadataOfUnion.js +++ b/tests/baselines/reference/metadataOfUnion.js @@ -47,12 +47,12 @@ var __metadata = (this && this.__metadata) || function (k, v) { if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); }; function PropDeco(target, propKey) { } -var A = (function () { +var A = /** @class */ (function () { function A() { } return A; }()); -var B = (function () { +var B = /** @class */ (function () { function B() { } __decorate([ @@ -76,7 +76,7 @@ var E; E[E["C"] = 2] = "C"; E[E["D"] = 3] = "D"; })(E || (E = {})); -var D = (function () { +var D = /** @class */ (function () { function D() { } __decorate([ diff --git a/tests/baselines/reference/metadataOfUnionWithNull.js b/tests/baselines/reference/metadataOfUnionWithNull.js index e53ca85476e63..80d24709b73ae 100644 --- a/tests/baselines/reference/metadataOfUnionWithNull.js +++ b/tests/baselines/reference/metadataOfUnionWithNull.js @@ -53,12 +53,12 @@ var __metadata = (this && this.__metadata) || function (k, v) { if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); }; function PropDeco(target, propKey) { } -var A = (function () { +var A = /** @class */ (function () { function A() { } return A; }()); -var B = (function () { +var B = /** @class */ (function () { function B() { } __decorate([ diff --git a/tests/baselines/reference/methodContainingLocalFunction.js b/tests/baselines/reference/methodContainingLocalFunction.js index d051d46bb1ca9..266178b35f865 100644 --- a/tests/baselines/reference/methodContainingLocalFunction.js +++ b/tests/baselines/reference/methodContainingLocalFunction.js @@ -52,7 +52,7 @@ enum E { //// [methodContainingLocalFunction.js] // The first case here (BugExhibition) caused a crash. Try with different permutations of features. -var BugExhibition = (function () { +var BugExhibition = /** @class */ (function () { function BugExhibition() { } BugExhibition.prototype.exhibitBug = function () { @@ -62,7 +62,7 @@ var BugExhibition = (function () { }; return BugExhibition; }()); -var BugExhibition2 = (function () { +var BugExhibition2 = /** @class */ (function () { function BugExhibition2() { } Object.defineProperty(BugExhibition2, "exhibitBug", { @@ -77,7 +77,7 @@ var BugExhibition2 = (function () { }); return BugExhibition2; }()); -var BugExhibition3 = (function () { +var BugExhibition3 = /** @class */ (function () { function BugExhibition3() { } BugExhibition3.prototype.exhibitBug = function () { @@ -87,7 +87,7 @@ var BugExhibition3 = (function () { }; return BugExhibition3; }()); -var C = (function () { +var C = /** @class */ (function () { function C() { } C.prototype.exhibit = function () { diff --git a/tests/baselines/reference/methodSignatureDeclarationEmit1.js b/tests/baselines/reference/methodSignatureDeclarationEmit1.js index d8697481c68df..4ed55507d93f3 100644 --- a/tests/baselines/reference/methodSignatureDeclarationEmit1.js +++ b/tests/baselines/reference/methodSignatureDeclarationEmit1.js @@ -7,7 +7,7 @@ class C { } //// [methodSignatureDeclarationEmit1.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } C.prototype.foo = function (a) { diff --git a/tests/baselines/reference/mismatchedClassConstructorVariable.js b/tests/baselines/reference/mismatchedClassConstructorVariable.js index e0b4767f54794..d1e6fc94f97e1 100644 --- a/tests/baselines/reference/mismatchedClassConstructorVariable.js +++ b/tests/baselines/reference/mismatchedClassConstructorVariable.js @@ -5,12 +5,12 @@ class foo { } //// [mismatchedClassConstructorVariable.js] var baz; -var baz = (function () { +var baz = /** @class */ (function () { function baz() { } return baz; }()); -var foo = (function () { +var foo = /** @class */ (function () { function foo() { } return foo; diff --git a/tests/baselines/reference/mismatchedGenericArguments1.js b/tests/baselines/reference/mismatchedGenericArguments1.js index 8a1f67db190cc..9195d2874d350 100644 --- a/tests/baselines/reference/mismatchedGenericArguments1.js +++ b/tests/baselines/reference/mismatchedGenericArguments1.js @@ -16,7 +16,7 @@ class C2 implements IFoo { //// [mismatchedGenericArguments1.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } C.prototype.foo = function (x) { @@ -24,7 +24,7 @@ var C = (function () { }; return C; }()); -var C2 = (function () { +var C2 = /** @class */ (function () { function C2() { } C2.prototype.foo = function (x) { diff --git a/tests/baselines/reference/missingDecoratorType.js b/tests/baselines/reference/missingDecoratorType.js index eca16c710e37e..cfcc301d8a67f 100644 --- a/tests/baselines/reference/missingDecoratorType.js +++ b/tests/baselines/reference/missingDecoratorType.js @@ -28,7 +28,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key, else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; -var C = (function () { +var C = /** @class */ (function () { function C() { } C.prototype.method = function () { }; diff --git a/tests/baselines/reference/missingFunctionImplementation.js b/tests/baselines/reference/missingFunctionImplementation.js index 5ca505dff85ba..87bb005deaa02 100644 --- a/tests/baselines/reference/missingFunctionImplementation.js +++ b/tests/baselines/reference/missingFunctionImplementation.js @@ -82,51 +82,51 @@ namespace N12 { //// [missingFunctionImplementation.js] "use strict"; exports.__esModule = true; -var C1 = (function () { +var C1 = /** @class */ (function () { function C1() { } return C1; }()); exports.C1 = C1; // merged with a namespace -var C2 = (function () { +var C2 = /** @class */ (function () { function C2() { } return C2; }()); exports.C2 = C2; // merged with a namespace, multiple overloads -var C3 = (function () { +var C3 = /** @class */ (function () { function C3() { } return C3; }()); // static methods, multiple overloads -var C4 = (function () { +var C4 = /** @class */ (function () { function C4() { } return C4; }()); // static methods, multiple overloads -var C5 = (function () { +var C5 = /** @class */ (function () { function C5() { } return C5; }()); // merged with namespace, static methods -var C6 = (function () { +var C6 = /** @class */ (function () { function C6() { } return C6; }()); // merged with namespace, static methods, multiple overloads -var C7 = (function () { +var C7 = /** @class */ (function () { function C7() { } return C7; }()); // merged with namespace, static methods, duplicate declarations -var C8 = (function () { +var C8 = /** @class */ (function () { function C8() { } return C8; @@ -136,7 +136,7 @@ var C8 = (function () { C8.m = m; })(C8 || (C8 = {})); // merged with namespace, static methods, duplicate declarations -var C9 = (function () { +var C9 = /** @class */ (function () { function C9() { } C9.m = function (a) { }; diff --git a/tests/baselines/reference/missingImportAfterModuleImport.js b/tests/baselines/reference/missingImportAfterModuleImport.js index 7d63c07b8223f..a66e96932a3fc 100644 --- a/tests/baselines/reference/missingImportAfterModuleImport.js +++ b/tests/baselines/reference/missingImportAfterModuleImport.js @@ -25,7 +25,7 @@ export = MainModule; //// [missingImportAfterModuleImport_0.js] //// [missingImportAfterModuleImport_1.js] "use strict"; -var MainModule = (function () { +var MainModule = /** @class */ (function () { function MainModule() { } return MainModule; diff --git a/tests/baselines/reference/missingPropertiesOfClassExpression.js b/tests/baselines/reference/missingPropertiesOfClassExpression.js index 7f468d14def32..4a77c813735a8 100644 --- a/tests/baselines/reference/missingPropertiesOfClassExpression.js +++ b/tests/baselines/reference/missingPropertiesOfClassExpression.js @@ -17,13 +17,13 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var George = (function (_super) { +var George = /** @class */ (function (_super) { __extends(George, _super); function George() { return _super.call(this) || this; } return George; -}((function () { +}(/** @class */ (function () { function class_1() { } class_1.prototype.reset = function () { return this.y; }; diff --git a/tests/baselines/reference/missingReturnStatement.js b/tests/baselines/reference/missingReturnStatement.js index f09ccb4e26e27..64392ceaf6ef3 100644 --- a/tests/baselines/reference/missingReturnStatement.js +++ b/tests/baselines/reference/missingReturnStatement.js @@ -10,7 +10,7 @@ module Test { //// [missingReturnStatement.js] var Test; (function (Test) { - var Bug = (function () { + var Bug = /** @class */ (function () { function Bug() { } Bug.prototype.foo = function () { diff --git a/tests/baselines/reference/missingReturnStatement1.js b/tests/baselines/reference/missingReturnStatement1.js index 9e24623fa6c2e..4ec75583d37c7 100644 --- a/tests/baselines/reference/missingReturnStatement1.js +++ b/tests/baselines/reference/missingReturnStatement1.js @@ -7,7 +7,7 @@ class Foo { //// [missingReturnStatement1.js] -var Foo = (function () { +var Foo = /** @class */ (function () { function Foo() { } Foo.prototype.foo = function () { diff --git a/tests/baselines/reference/missingSelf.js b/tests/baselines/reference/missingSelf.js index e1020ea635b34..d84c9ce6a315a 100644 --- a/tests/baselines/reference/missingSelf.js +++ b/tests/baselines/reference/missingSelf.js @@ -19,14 +19,14 @@ c2.b(); //// [missingSelf.js] -var CalcButton = (function () { +var CalcButton = /** @class */ (function () { function CalcButton() { } CalcButton.prototype.a = function () { this.onClick(); }; CalcButton.prototype.onClick = function () { }; return CalcButton; }()); -var CalcButton2 = (function () { +var CalcButton2 = /** @class */ (function () { function CalcButton2() { } CalcButton2.prototype.b = function () { diff --git a/tests/baselines/reference/missingTypeArguments1.js b/tests/baselines/reference/missingTypeArguments1.js index 3e22e6ce16b4d..9e8ce96fdef58 100644 --- a/tests/baselines/reference/missingTypeArguments1.js +++ b/tests/baselines/reference/missingTypeArguments1.js @@ -55,66 +55,66 @@ var a10: X10; //// [missingTypeArguments1.js] -var Y = (function () { +var Y = /** @class */ (function () { function Y() { } return Y; }()); -var X = (function () { +var X = /** @class */ (function () { function X() { } return X; }()); var a; -var X2 = (function () { +var X2 = /** @class */ (function () { function X2() { } return X2; }()); var a2; -var X3 = (function () { +var X3 = /** @class */ (function () { function X3() { } return X3; }()); var a3; -var X4 = (function () { +var X4 = /** @class */ (function () { function X4() { } return X4; }()); var a4; -var X5 = (function () { +var X5 = /** @class */ (function () { function X5() { } return X5; }()); var a5; -var X6 = (function () { +var X6 = /** @class */ (function () { function X6() { } return X6; }()); var a6; -var X7 = (function () { +var X7 = /** @class */ (function () { function X7() { } return X7; }()); var a7; -var X8 = (function () { +var X8 = /** @class */ (function () { function X8() { } return X8; }()); var a8; -var X9 = (function () { +var X9 = /** @class */ (function () { function X9() { } return X9; }()); var a9; -var X10 = (function () { +var X10 = /** @class */ (function () { function X10() { } return X10; diff --git a/tests/baselines/reference/missingTypeArguments2.js b/tests/baselines/reference/missingTypeArguments2.js index 6ede66f5598e8..f42c393c072da 100644 --- a/tests/baselines/reference/missingTypeArguments2.js +++ b/tests/baselines/reference/missingTypeArguments2.js @@ -7,7 +7,7 @@ var y: A; (): A => null; //// [missingTypeArguments2.js] -var A = (function () { +var A = /** @class */ (function () { function A() { } return A; diff --git a/tests/baselines/reference/mixedStaticAndInstanceClassMembers.js b/tests/baselines/reference/mixedStaticAndInstanceClassMembers.js index eac3729abcdfa..2468000d542a0 100644 --- a/tests/baselines/reference/mixedStaticAndInstanceClassMembers.js +++ b/tests/baselines/reference/mixedStaticAndInstanceClassMembers.js @@ -16,7 +16,7 @@ class B { } //// [mixedStaticAndInstanceClassMembers.js] -var A = (function () { +var A = /** @class */ (function () { function A() { } A.prototype.f = function () { }; @@ -24,7 +24,7 @@ var A = (function () { }; return A; }()); -var B = (function () { +var B = /** @class */ (function () { function B() { } B.prototype.f = function () { }; diff --git a/tests/baselines/reference/mixinAccessModifiers.js b/tests/baselines/reference/mixinAccessModifiers.js index 736808455bbcb..a04551dbd3c7a 100644 --- a/tests/baselines/reference/mixinAccessModifiers.js +++ b/tests/baselines/reference/mixinAccessModifiers.js @@ -118,7 +118,7 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var Private = (function () { +var Private = /** @class */ (function () { function Private() { var args = []; for (var _i = 0; _i < arguments.length; _i++) { @@ -127,7 +127,7 @@ var Private = (function () { } return Private; }()); -var Private2 = (function () { +var Private2 = /** @class */ (function () { function Private2() { var args = []; for (var _i = 0; _i < arguments.length; _i++) { @@ -136,7 +136,7 @@ var Private2 = (function () { } return Private2; }()); -var Protected = (function () { +var Protected = /** @class */ (function () { function Protected() { var args = []; for (var _i = 0; _i < arguments.length; _i++) { @@ -145,7 +145,7 @@ var Protected = (function () { } return Protected; }()); -var Protected2 = (function () { +var Protected2 = /** @class */ (function () { function Protected2() { var args = []; for (var _i = 0; _i < arguments.length; _i++) { @@ -154,7 +154,7 @@ var Protected2 = (function () { } return Protected2; }()); -var Public = (function () { +var Public = /** @class */ (function () { function Public() { var args = []; for (var _i = 0; _i < arguments.length; _i++) { @@ -163,7 +163,7 @@ var Public = (function () { } return Public; }()); -var Public2 = (function () { +var Public2 = /** @class */ (function () { function Public2() { var args = []; for (var _i = 0; _i < arguments.length; _i++) { @@ -191,28 +191,28 @@ function f6(x) { x.p; // Ok, public if any constituent is public } // Can't derive from type with inaccessible properties -var C1 = (function (_super) { +var C1 = /** @class */ (function (_super) { __extends(C1, _super); function C1() { return _super !== null && _super.apply(this, arguments) || this; } return C1; }(Mix(Private, Private2))); -var C2 = (function (_super) { +var C2 = /** @class */ (function (_super) { __extends(C2, _super); function C2() { return _super !== null && _super.apply(this, arguments) || this; } return C2; }(Mix(Private, Protected))); -var C3 = (function (_super) { +var C3 = /** @class */ (function (_super) { __extends(C3, _super); function C3() { return _super !== null && _super.apply(this, arguments) || this; } return C3; }(Mix(Private, Public))); -var C4 = (function (_super) { +var C4 = /** @class */ (function (_super) { __extends(C4, _super); function C4() { return _super !== null && _super.apply(this, arguments) || this; @@ -229,7 +229,7 @@ var C4 = (function (_super) { }; return C4; }(Mix(Protected, Protected2))); -var C5 = (function (_super) { +var C5 = /** @class */ (function (_super) { __extends(C5, _super); function C5() { return _super !== null && _super.apply(this, arguments) || this; @@ -246,7 +246,7 @@ var C5 = (function (_super) { }; return C5; }(Mix(Protected, Public))); -var C6 = (function (_super) { +var C6 = /** @class */ (function (_super) { __extends(C6, _super); function C6() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/mixinClassesAnnotated.js b/tests/baselines/reference/mixinClassesAnnotated.js index 15282a11dd8fc..db489cf7f262c 100644 --- a/tests/baselines/reference/mixinClassesAnnotated.js +++ b/tests/baselines/reference/mixinClassesAnnotated.js @@ -77,14 +77,14 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var Base = (function () { +var Base = /** @class */ (function () { function Base(x, y) { this.x = x; this.y = y; } return Base; }()); -var Derived = (function (_super) { +var Derived = /** @class */ (function (_super) { __extends(Derived, _super); function Derived(x, y, z) { var _this = _super.call(this, x, y) || this; @@ -93,7 +93,7 @@ var Derived = (function (_super) { } return Derived; }(Base)); -var Printable = function (superClass) { return _a = (function (_super) { +var Printable = function (superClass) { return _a = /** @class */ (function (_super) { __extends(class_1, _super); function class_1() { return _super !== null && _super.apply(this, arguments) || this; @@ -106,7 +106,7 @@ var Printable = function (superClass) { return _a = (function (_super) { _a.message = "hello", _a; var _a; }; function Tagged(superClass) { - var C = (function (_super) { + var C = /** @class */ (function (_super) { __extends(C, _super); function C() { var args = []; @@ -135,7 +135,7 @@ function f2() { thing._tag; thing.print(); } -var Thing3 = (function (_super) { +var Thing3 = /** @class */ (function (_super) { __extends(Thing3, _super); function Thing3(tag) { var _this = _super.call(this, 10, 20, 30) || this; diff --git a/tests/baselines/reference/mixinClassesAnonymous.js b/tests/baselines/reference/mixinClassesAnonymous.js index aa148c25acf0d..cdb821a9dd856 100644 --- a/tests/baselines/reference/mixinClassesAnonymous.js +++ b/tests/baselines/reference/mixinClassesAnonymous.js @@ -76,14 +76,14 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var Base = (function () { +var Base = /** @class */ (function () { function Base(x, y) { this.x = x; this.y = y; } return Base; }()); -var Derived = (function (_super) { +var Derived = /** @class */ (function (_super) { __extends(Derived, _super); function Derived(x, y, z) { var _this = _super.call(this, x, y) || this; @@ -92,7 +92,7 @@ var Derived = (function (_super) { } return Derived; }(Base)); -var Printable = function (superClass) { return _a = (function (_super) { +var Printable = function (superClass) { return _a = /** @class */ (function (_super) { __extends(class_1, _super); function class_1() { return _super !== null && _super.apply(this, arguments) || this; @@ -105,7 +105,7 @@ var Printable = function (superClass) { return _a = (function (_super) { _a.message = "hello", _a; var _a; }; function Tagged(superClass) { - var C = (function (_super) { + var C = /** @class */ (function (_super) { __extends(C, _super); function C() { var args = []; @@ -134,7 +134,7 @@ function f2() { thing._tag; thing.print(); } -var Thing3 = (function (_super) { +var Thing3 = /** @class */ (function (_super) { __extends(Thing3, _super); function Thing3(tag) { var _this = _super.call(this, 10, 20, 30) || this; @@ -148,7 +148,7 @@ var Thing3 = (function (_super) { }(Thing2)); // Repro from #13805 var Timestamped = function (Base) { - return (function (_super) { + return /** @class */ (function (_super) { __extends(class_2, _super); function class_2() { var _this = _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/mixinClassesMembers.js b/tests/baselines/reference/mixinClassesMembers.js index 4771cec384d61..ffc3d7af1eabb 100644 --- a/tests/baselines/reference/mixinClassesMembers.js +++ b/tests/baselines/reference/mixinClassesMembers.js @@ -155,7 +155,7 @@ function f6() { Mixed5.p; Mixed5.f(); } -var C2 = (function (_super) { +var C2 = /** @class */ (function (_super) { __extends(C2, _super); function C2() { var _this = _super.call(this, "hello") || this; @@ -166,7 +166,7 @@ var C2 = (function (_super) { } return C2; }(Mixed1)); -var C3 = (function (_super) { +var C3 = /** @class */ (function (_super) { __extends(C3, _super); function C3() { var _this = _super.call(this, 42) || this; diff --git a/tests/baselines/reference/mixinPrivateAndProtected.js b/tests/baselines/reference/mixinPrivateAndProtected.js index 9b8f3ee0c128a..e56dc572df058 100644 --- a/tests/baselines/reference/mixinPrivateAndProtected.js +++ b/tests/baselines/reference/mixinPrivateAndProtected.js @@ -101,7 +101,7 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var A = (function () { +var A = /** @class */ (function () { function A() { this.pb = 2; this.ptd = 1; @@ -110,7 +110,7 @@ var A = (function () { return A; }()); function mixB(Cls) { - return (function (_super) { + return /** @class */ (function (_super) { __extends(class_1, _super); function class_1() { var _this = _super !== null && _super.apply(this, arguments) || this; @@ -122,7 +122,7 @@ function mixB(Cls) { }(Cls)); } function mixB2(Cls) { - return (function (_super) { + return /** @class */ (function (_super) { __extends(class_2, _super); function class_2() { var _this = _super !== null && _super.apply(this, arguments) || this; @@ -134,7 +134,7 @@ function mixB2(Cls) { } var AB = mixB(A), AB2 = mixB2(A); function mixC(Cls) { - return (function (_super) { + return /** @class */ (function (_super) { __extends(class_3, _super); function class_3() { var _this = _super !== null && _super.apply(this, arguments) || this; @@ -160,7 +160,7 @@ ab2c.pb.toFixed(); ab2c.ptd.toFixed(); // Error ab2c.pvt.toFixed(); // Error // Repro from #13924 -var Person = (function () { +var Person = /** @class */ (function () { function Person(name) { this.name = name; } @@ -170,7 +170,7 @@ var Person = (function () { return Person; }()); function PersonMixin(Base) { - return (function (_super) { + return /** @class */ (function (_super) { __extends(class_4, _super); function class_4() { var args = []; @@ -186,7 +186,7 @@ function PersonMixin(Base) { return class_4; }(Base)); } -var Customer = (function (_super) { +var Customer = /** @class */ (function (_super) { __extends(Customer, _super); function Customer() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/mixingStaticAndInstanceOverloads.js b/tests/baselines/reference/mixingStaticAndInstanceOverloads.js index ee405be1f431a..99e092bb358c3 100644 --- a/tests/baselines/reference/mixingStaticAndInstanceOverloads.js +++ b/tests/baselines/reference/mixingStaticAndInstanceOverloads.js @@ -36,31 +36,31 @@ class C5 { } //// [mixingStaticAndInstanceOverloads.js] -var C1 = (function () { +var C1 = /** @class */ (function () { function C1() { } C1.foo1 = function (a) { }; return C1; }()); -var C2 = (function () { +var C2 = /** @class */ (function () { function C2() { } C2.prototype.foo2 = function (a) { }; return C2; }()); -var C3 = (function () { +var C3 = /** @class */ (function () { function C3() { } C3.prototype.foo3 = function (a) { }; return C3; }()); -var C4 = (function () { +var C4 = /** @class */ (function () { function C4() { } C4.foo4 = function (a) { }; return C4; }()); -var C5 = (function () { +var C5 = /** @class */ (function () { function C5() { } C5.prototype.foo5 = function (a) { }; diff --git a/tests/baselines/reference/modifierOnClassDeclarationMemberInFunction.js b/tests/baselines/reference/modifierOnClassDeclarationMemberInFunction.js index 464e0c6f37be0..8857309c7499e 100644 --- a/tests/baselines/reference/modifierOnClassDeclarationMemberInFunction.js +++ b/tests/baselines/reference/modifierOnClassDeclarationMemberInFunction.js @@ -9,7 +9,7 @@ function f() { //// [modifierOnClassDeclarationMemberInFunction.js] function f() { - var C = (function () { + var C = /** @class */ (function () { function C() { this.baz = 1; } diff --git a/tests/baselines/reference/modifierOnClassExpressionMemberInFunction.js b/tests/baselines/reference/modifierOnClassExpressionMemberInFunction.js index 3403a376d42dd..72a2bb044e0ba 100644 --- a/tests/baselines/reference/modifierOnClassExpressionMemberInFunction.js +++ b/tests/baselines/reference/modifierOnClassExpressionMemberInFunction.js @@ -9,7 +9,7 @@ function g() { //// [modifierOnClassExpressionMemberInFunction.js] function g() { - var x = (_a = (function () { + var x = (_a = /** @class */ (function () { function C() { this.prop1 = 1; } diff --git a/tests/baselines/reference/modifierOnParameter1.js b/tests/baselines/reference/modifierOnParameter1.js index dd800aeb886bf..e029242e46b14 100644 --- a/tests/baselines/reference/modifierOnParameter1.js +++ b/tests/baselines/reference/modifierOnParameter1.js @@ -4,7 +4,7 @@ class C { } //// [modifierOnParameter1.js] -var C = (function () { +var C = /** @class */ (function () { function C(p) { } return C; diff --git a/tests/baselines/reference/moduleAliasInterface.js b/tests/baselines/reference/moduleAliasInterface.js index 2dee62dcca0f8..a7475964d7355 100644 --- a/tests/baselines/reference/moduleAliasInterface.js +++ b/tests/baselines/reference/moduleAliasInterface.js @@ -58,7 +58,7 @@ module B1 { //// [moduleAliasInterface.js] var _modes; (function (_modes) { - var Mode = (function () { + var Mode = /** @class */ (function () { function Mode() { } return Mode; @@ -70,7 +70,7 @@ var editor; (function (editor) { var i; // If you just use p1:modes, the compiler accepts it - should be an error - var Bug = (function () { + var Bug = /** @class */ (function () { function Bug(p1, p2) { } // should be an error on p2 - it's not exported Bug.prototype.foo = function (p1) { @@ -82,21 +82,21 @@ var modesOuter = _modes; var editor2; (function (editor2) { var i; - var Bug = (function () { + var Bug = /** @class */ (function () { function Bug(p1, p2) { } // no error here, since modesOuter is declared externally return Bug; }()); var Foo; (function (Foo) { - var Bar = (function () { + var Bar = /** @class */ (function () { function Bar() { } return Bar; }()); Foo.Bar = Bar; })(Foo || (Foo = {})); - var Bug2 = (function () { + var Bug2 = /** @class */ (function () { function Bug2(p1, p2) { } return Bug2; @@ -104,7 +104,7 @@ var editor2; })(editor2 || (editor2 = {})); var A1; (function (A1) { - var A1C1 = (function () { + var A1C1 = /** @class */ (function () { function A1C1() { } return A1C1; diff --git a/tests/baselines/reference/moduleAsBaseType.js b/tests/baselines/reference/moduleAsBaseType.js index 2a3ee8f45858e..3f18aabb35aa7 100644 --- a/tests/baselines/reference/moduleAsBaseType.js +++ b/tests/baselines/reference/moduleAsBaseType.js @@ -15,14 +15,14 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var C = (function (_super) { +var C = /** @class */ (function (_super) { __extends(C, _super); function C() { return _super !== null && _super.apply(this, arguments) || this; } return C; }(M)); -var C2 = (function () { +var C2 = /** @class */ (function () { function C2() { } return C2; diff --git a/tests/baselines/reference/moduleAssignmentCompat1.js b/tests/baselines/reference/moduleAssignmentCompat1.js index ba545e96b3334..7066283b39951 100644 --- a/tests/baselines/reference/moduleAssignmentCompat1.js +++ b/tests/baselines/reference/moduleAssignmentCompat1.js @@ -19,7 +19,7 @@ b = a; //// [moduleAssignmentCompat1.js] var A; (function (A) { - var C = (function () { + var C = /** @class */ (function () { function C() { } return C; @@ -28,13 +28,13 @@ var A; })(A || (A = {})); var B; (function (B) { - var C = (function () { + var C = /** @class */ (function () { function C() { } return C; }()); B.C = C; - var D = (function () { + var D = /** @class */ (function () { function D() { } return D; diff --git a/tests/baselines/reference/moduleAssignmentCompat2.js b/tests/baselines/reference/moduleAssignmentCompat2.js index cce4f6addf1ef..c88d5707c99d2 100644 --- a/tests/baselines/reference/moduleAssignmentCompat2.js +++ b/tests/baselines/reference/moduleAssignmentCompat2.js @@ -16,7 +16,7 @@ b = a; // error //// [moduleAssignmentCompat2.js] var A; (function (A) { - var C = (function () { + var C = /** @class */ (function () { function C() { } return C; @@ -25,13 +25,13 @@ var A; })(A || (A = {})); var B; (function (B) { - var C = (function () { + var C = /** @class */ (function () { function C() { } return C; }()); B.C = C; - var D = (function () { + var D = /** @class */ (function () { function D() { } return D; diff --git a/tests/baselines/reference/moduleAssignmentCompat4.js b/tests/baselines/reference/moduleAssignmentCompat4.js index 20f7979e43e08..da7167bb9f28c 100644 --- a/tests/baselines/reference/moduleAssignmentCompat4.js +++ b/tests/baselines/reference/moduleAssignmentCompat4.js @@ -21,7 +21,7 @@ var A; (function (A) { var M; (function (M) { - var C = (function () { + var C = /** @class */ (function () { function C() { } return C; @@ -32,7 +32,7 @@ var B; (function (B) { var M; (function (M) { - var D = (function () { + var D = /** @class */ (function () { function D() { } return D; diff --git a/tests/baselines/reference/moduleAugmentationGlobal1.js b/tests/baselines/reference/moduleAugmentationGlobal1.js index ae4042768e800..80ad240fa8c2b 100644 --- a/tests/baselines/reference/moduleAugmentationGlobal1.js +++ b/tests/baselines/reference/moduleAugmentationGlobal1.js @@ -20,7 +20,7 @@ let y = x.getA().x; //// [f1.js] "use strict"; exports.__esModule = true; -var A = (function () { +var A = /** @class */ (function () { function A() { } return A; diff --git a/tests/baselines/reference/moduleAugmentationGlobal2.js b/tests/baselines/reference/moduleAugmentationGlobal2.js index 28f6d3babf048..2d5be71bcd705 100644 --- a/tests/baselines/reference/moduleAugmentationGlobal2.js +++ b/tests/baselines/reference/moduleAugmentationGlobal2.js @@ -19,7 +19,7 @@ let y = x.getCountAsString().toLowerCase(); //// [f1.js] "use strict"; exports.__esModule = true; -var A = (function () { +var A = /** @class */ (function () { function A() { } return A; diff --git a/tests/baselines/reference/moduleAugmentationGlobal3.js b/tests/baselines/reference/moduleAugmentationGlobal3.js index d744d3017b905..4fa5f5bbd93c6 100644 --- a/tests/baselines/reference/moduleAugmentationGlobal3.js +++ b/tests/baselines/reference/moduleAugmentationGlobal3.js @@ -22,7 +22,7 @@ let y = x.getCountAsString().toLowerCase(); //// [f1.js] "use strict"; exports.__esModule = true; -var A = (function () { +var A = /** @class */ (function () { function A() { } return A; diff --git a/tests/baselines/reference/moduleAugmentationImportsAndExports1.js b/tests/baselines/reference/moduleAugmentationImportsAndExports1.js index 27d69dd181c7d..63e5d11072328 100644 --- a/tests/baselines/reference/moduleAugmentationImportsAndExports1.js +++ b/tests/baselines/reference/moduleAugmentationImportsAndExports1.js @@ -29,7 +29,7 @@ let b = a.foo().n; //// [f1.js] "use strict"; exports.__esModule = true; -var A = (function () { +var A = /** @class */ (function () { function A() { } return A; @@ -38,7 +38,7 @@ exports.A = A; //// [f2.js] "use strict"; exports.__esModule = true; -var B = (function () { +var B = /** @class */ (function () { function B() { } return B; diff --git a/tests/baselines/reference/moduleAugmentationImportsAndExports2.js b/tests/baselines/reference/moduleAugmentationImportsAndExports2.js index 32d7950574df1..fa5e1a2f1d7c0 100644 --- a/tests/baselines/reference/moduleAugmentationImportsAndExports2.js +++ b/tests/baselines/reference/moduleAugmentationImportsAndExports2.js @@ -41,7 +41,7 @@ let b = a.foo().n; //// [f1.js] "use strict"; exports.__esModule = true; -var A = (function () { +var A = /** @class */ (function () { function A() { } return A; @@ -50,7 +50,7 @@ exports.A = A; //// [f2.js] "use strict"; exports.__esModule = true; -var B = (function () { +var B = /** @class */ (function () { function B() { } return B; diff --git a/tests/baselines/reference/moduleAugmentationImportsAndExports3.js b/tests/baselines/reference/moduleAugmentationImportsAndExports3.js index 12bcffd00f698..a55d0e6facb14 100644 --- a/tests/baselines/reference/moduleAugmentationImportsAndExports3.js +++ b/tests/baselines/reference/moduleAugmentationImportsAndExports3.js @@ -39,7 +39,7 @@ let b = a.foo().n; //// [f1.js] "use strict"; exports.__esModule = true; -var A = (function () { +var A = /** @class */ (function () { function A() { } return A; @@ -48,7 +48,7 @@ exports.A = A; //// [f2.js] "use strict"; exports.__esModule = true; -var B = (function () { +var B = /** @class */ (function () { function B() { } return B; diff --git a/tests/baselines/reference/moduleAugmentationImportsAndExports4.js b/tests/baselines/reference/moduleAugmentationImportsAndExports4.js index 041c2c71d093a..0bc6aea7d425a 100644 --- a/tests/baselines/reference/moduleAugmentationImportsAndExports4.js +++ b/tests/baselines/reference/moduleAugmentationImportsAndExports4.js @@ -41,7 +41,7 @@ let d = a.baz().b; //// [f1.js] "use strict"; exports.__esModule = true; -var A = (function () { +var A = /** @class */ (function () { function A() { } return A; @@ -50,7 +50,7 @@ exports.A = A; //// [f2.js] "use strict"; exports.__esModule = true; -var B = (function () { +var B = /** @class */ (function () { function B() { } return B; diff --git a/tests/baselines/reference/moduleAugmentationImportsAndExports5.js b/tests/baselines/reference/moduleAugmentationImportsAndExports5.js index 25a3702db6414..56f73234af222 100644 --- a/tests/baselines/reference/moduleAugmentationImportsAndExports5.js +++ b/tests/baselines/reference/moduleAugmentationImportsAndExports5.js @@ -41,7 +41,7 @@ let d = a.baz().b; //// [f1.js] "use strict"; exports.__esModule = true; -var A = (function () { +var A = /** @class */ (function () { function A() { } return A; @@ -50,7 +50,7 @@ exports.A = A; //// [f2.js] "use strict"; exports.__esModule = true; -var B = (function () { +var B = /** @class */ (function () { function B() { } return B; diff --git a/tests/baselines/reference/moduleAugmentationImportsAndExports6.js b/tests/baselines/reference/moduleAugmentationImportsAndExports6.js index 3796d70f2d325..fc4a9a4438096 100644 --- a/tests/baselines/reference/moduleAugmentationImportsAndExports6.js +++ b/tests/baselines/reference/moduleAugmentationImportsAndExports6.js @@ -41,7 +41,7 @@ let d = a.baz().b; //// [f1.js] "use strict"; exports.__esModule = true; -var A = (function () { +var A = /** @class */ (function () { function A() { } return A; @@ -50,7 +50,7 @@ exports.A = A; //// [f2.js] "use strict"; exports.__esModule = true; -var B = (function () { +var B = /** @class */ (function () { function B() { } return B; diff --git a/tests/baselines/reference/moduleAugmentationsBundledOutput1.js b/tests/baselines/reference/moduleAugmentationsBundledOutput1.js index 6a37e44264b32..4646709b25d9a 100644 --- a/tests/baselines/reference/moduleAugmentationsBundledOutput1.js +++ b/tests/baselines/reference/moduleAugmentationsBundledOutput1.js @@ -58,7 +58,7 @@ c.baz2().x.toLowerCase(); define("m1", ["require", "exports"], function (require, exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); - var Cls = (function () { + var Cls = /** @class */ (function () { function Cls() { } return Cls; @@ -74,13 +74,13 @@ define("m2", ["require", "exports", "m1"], function (require, exports, m1_1) { define("m3", ["require", "exports"], function (require, exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); - var C1 = (function () { + var C1 = /** @class */ (function () { function C1() { } return C1; }()); exports.C1 = C1; - var C2 = (function () { + var C2 = /** @class */ (function () { function C2() { } return C2; diff --git a/tests/baselines/reference/moduleAugmentationsImports1.js b/tests/baselines/reference/moduleAugmentationsImports1.js index 9e40067c2fe36..a27810927974f 100644 --- a/tests/baselines/reference/moduleAugmentationsImports1.js +++ b/tests/baselines/reference/moduleAugmentationsImports1.js @@ -45,7 +45,7 @@ let c = a.getCls().y.toLowerCase(); define("a", ["require", "exports"], function (require, exports) { "use strict"; exports.__esModule = true; - var A = (function () { + var A = /** @class */ (function () { function A() { } return A; @@ -55,7 +55,7 @@ define("a", ["require", "exports"], function (require, exports) { define("b", ["require", "exports"], function (require, exports) { "use strict"; exports.__esModule = true; - var B = (function () { + var B = /** @class */ (function () { function B() { } return B; diff --git a/tests/baselines/reference/moduleAugmentationsImports2.js b/tests/baselines/reference/moduleAugmentationsImports2.js index 5955cd10e59ed..4274300a63945 100644 --- a/tests/baselines/reference/moduleAugmentationsImports2.js +++ b/tests/baselines/reference/moduleAugmentationsImports2.js @@ -50,7 +50,7 @@ let c = a.getCls().y.toLowerCase(); define("a", ["require", "exports"], function (require, exports) { "use strict"; exports.__esModule = true; - var A = (function () { + var A = /** @class */ (function () { function A() { } return A; @@ -60,7 +60,7 @@ define("a", ["require", "exports"], function (require, exports) { define("b", ["require", "exports"], function (require, exports) { "use strict"; exports.__esModule = true; - var B = (function () { + var B = /** @class */ (function () { function B() { } return B; diff --git a/tests/baselines/reference/moduleAugmentationsImports3.js b/tests/baselines/reference/moduleAugmentationsImports3.js index 20ff1b25271aa..921e65b2e0fe0 100644 --- a/tests/baselines/reference/moduleAugmentationsImports3.js +++ b/tests/baselines/reference/moduleAugmentationsImports3.js @@ -49,7 +49,7 @@ let c = a.getCls().y.toLowerCase(); define("a", ["require", "exports"], function (require, exports) { "use strict"; exports.__esModule = true; - var A = (function () { + var A = /** @class */ (function () { function A() { } return A; @@ -59,7 +59,7 @@ define("a", ["require", "exports"], function (require, exports) { define("b", ["require", "exports"], function (require, exports) { "use strict"; exports.__esModule = true; - var B = (function () { + var B = /** @class */ (function () { function B() { } return B; diff --git a/tests/baselines/reference/moduleAugmentationsImports4.js b/tests/baselines/reference/moduleAugmentationsImports4.js index ee66546983d9b..3eea145e5f499 100644 --- a/tests/baselines/reference/moduleAugmentationsImports4.js +++ b/tests/baselines/reference/moduleAugmentationsImports4.js @@ -50,7 +50,7 @@ let c = a.getCls().y.toLowerCase(); define("a", ["require", "exports"], function (require, exports) { "use strict"; exports.__esModule = true; - var A = (function () { + var A = /** @class */ (function () { function A() { } return A; @@ -60,7 +60,7 @@ define("a", ["require", "exports"], function (require, exports) { define("b", ["require", "exports"], function (require, exports) { "use strict"; exports.__esModule = true; - var B = (function () { + var B = /** @class */ (function () { function B() { } return B; diff --git a/tests/baselines/reference/moduleClassArrayCodeGenTest.js b/tests/baselines/reference/moduleClassArrayCodeGenTest.js index 79945f681aaf1..463706ed51fc2 100644 --- a/tests/baselines/reference/moduleClassArrayCodeGenTest.js +++ b/tests/baselines/reference/moduleClassArrayCodeGenTest.js @@ -14,13 +14,13 @@ var t2: M.B[] = []; // Invalid code gen for Array of Module class var M; (function (M) { - var A = (function () { + var A = /** @class */ (function () { function A() { } return A; }()); M.A = A; - var B = (function () { + var B = /** @class */ (function () { function B() { } return B; diff --git a/tests/baselines/reference/moduleCodeGenTest5.js b/tests/baselines/reference/moduleCodeGenTest5.js index ee6fd2ab3176b..525973402895a 100644 --- a/tests/baselines/reference/moduleCodeGenTest5.js +++ b/tests/baselines/reference/moduleCodeGenTest5.js @@ -29,7 +29,7 @@ var y = 0; function f1() { } exports.f1 = f1; function f2() { } -var C1 = (function () { +var C1 = /** @class */ (function () { function C1() { this.p1 = 0; } @@ -37,7 +37,7 @@ var C1 = (function () { return C1; }()); exports.C1 = C1; -var C2 = (function () { +var C2 = /** @class */ (function () { function C2() { this.p1 = 0; } diff --git a/tests/baselines/reference/moduleCrashBug1.js b/tests/baselines/reference/moduleCrashBug1.js index 2a01fa94b4861..5354935829c29 100644 --- a/tests/baselines/reference/moduleCrashBug1.js +++ b/tests/baselines/reference/moduleCrashBug1.js @@ -24,7 +24,7 @@ var m : _modes; //// [moduleCrashBug1.js] var _modes; (function (_modes) { - var Mode = (function () { + var Mode = /** @class */ (function () { function Mode() { } return Mode; diff --git a/tests/baselines/reference/moduleDuplicateIdentifiers.js b/tests/baselines/reference/moduleDuplicateIdentifiers.js index a2a099fca1d56..4db7e7ca153d2 100644 --- a/tests/baselines/reference/moduleDuplicateIdentifiers.js +++ b/tests/baselines/reference/moduleDuplicateIdentifiers.js @@ -52,14 +52,14 @@ var FooBar; (function (FooBar) { FooBar.member2 = 42; })(FooBar = exports.FooBar || (exports.FooBar = {})); -var Kettle = (function () { +var Kettle = /** @class */ (function () { function Kettle() { this.member1 = 2; } return Kettle; }()); exports.Kettle = Kettle; -var Kettle = (function () { +var Kettle = /** @class */ (function () { function Kettle() { this.member2 = 42; } diff --git a/tests/baselines/reference/moduleElementsInWrongContext.js b/tests/baselines/reference/moduleElementsInWrongContext.js index b8c7ae25730ad..7c5057e3865fe 100644 --- a/tests/baselines/reference/moduleElementsInWrongContext.js +++ b/tests/baselines/reference/moduleElementsInWrongContext.js @@ -39,7 +39,7 @@ export { foo }; export { baz as b } from "ambient"; export default v; - var C = (function () { + var C = /** @class */ (function () { function C() { } return C; diff --git a/tests/baselines/reference/moduleElementsInWrongContext2.js b/tests/baselines/reference/moduleElementsInWrongContext2.js index 8582213a6ae2f..52cf61933ce4a 100644 --- a/tests/baselines/reference/moduleElementsInWrongContext2.js +++ b/tests/baselines/reference/moduleElementsInWrongContext2.js @@ -39,7 +39,7 @@ function blah() { export { foo }; export { baz as b } from "ambient"; export default v; - var C = (function () { + var C = /** @class */ (function () { function C() { } return C; diff --git a/tests/baselines/reference/moduleElementsInWrongContext3.js b/tests/baselines/reference/moduleElementsInWrongContext3.js index 851ad654494b4..d7be29877b753 100644 --- a/tests/baselines/reference/moduleElementsInWrongContext3.js +++ b/tests/baselines/reference/moduleElementsInWrongContext3.js @@ -42,7 +42,7 @@ var P; export { foo }; export { baz as b } from "ambient"; export default v; - var C = (function () { + var C = /** @class */ (function () { function C() { } return C; diff --git a/tests/baselines/reference/moduleExports1.js b/tests/baselines/reference/moduleExports1.js index 66c746c5f5189..60a6385b22576 100644 --- a/tests/baselines/reference/moduleExports1.js +++ b/tests/baselines/reference/moduleExports1.js @@ -23,7 +23,7 @@ define(["require", "exports"], function (require, exports) { (function (Strasse) { var Street; (function (Street) { - var Rue = (function () { + var Rue = /** @class */ (function () { function Rue() { } return Rue; diff --git a/tests/baselines/reference/moduleImportedForTypeArgumentPosition.js b/tests/baselines/reference/moduleImportedForTypeArgumentPosition.js index 2ed22cfa4f0e3..23b70e4718626 100644 --- a/tests/baselines/reference/moduleImportedForTypeArgumentPosition.js +++ b/tests/baselines/reference/moduleImportedForTypeArgumentPosition.js @@ -30,12 +30,12 @@ var __extends = (this && this.__extends) || (function () { define(["require", "exports"], function (require, exports) { "use strict"; exports.__esModule = true; - var C1 = (function () { + var C1 = /** @class */ (function () { function C1() { } return C1; }()); - var Test1 = (function (_super) { + var Test1 = /** @class */ (function (_super) { __extends(Test1, _super); function Test1() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/moduleInTypePosition1.js b/tests/baselines/reference/moduleInTypePosition1.js index 7408db5c29111..3781b4ae5b7df 100644 --- a/tests/baselines/reference/moduleInTypePosition1.js +++ b/tests/baselines/reference/moduleInTypePosition1.js @@ -14,7 +14,7 @@ var x = (w1: WinJS) => { }; //// [moduleInTypePosition1_0.js] "use strict"; exports.__esModule = true; -var Promise = (function () { +var Promise = /** @class */ (function () { function Promise() { } return Promise; diff --git a/tests/baselines/reference/moduleMemberWithoutTypeAnnotation1.js b/tests/baselines/reference/moduleMemberWithoutTypeAnnotation1.js index e0e95b3c72b65..211e4efeb46cb 100644 --- a/tests/baselines/reference/moduleMemberWithoutTypeAnnotation1.js +++ b/tests/baselines/reference/moduleMemberWithoutTypeAnnotation1.js @@ -51,7 +51,7 @@ var TypeScript; (function (TypeScript) { var Parser; (function (Parser) { - var SyntaxCursor = (function () { + var SyntaxCursor = /** @class */ (function () { function SyntaxCursor() { } SyntaxCursor.prototype.currentNode = function () { @@ -64,7 +64,7 @@ var TypeScript; (function (TypeScript) { ; ; - var PositionedElement = (function () { + var PositionedElement = /** @class */ (function () { function PositionedElement() { } PositionedElement.prototype.childIndex = function (child) { @@ -73,7 +73,7 @@ var TypeScript; return PositionedElement; }()); TypeScript.PositionedElement = PositionedElement; - var PositionedToken = (function () { + var PositionedToken = /** @class */ (function () { function PositionedToken(parent, token, fullStart) { } return PositionedToken; @@ -81,7 +81,7 @@ var TypeScript; TypeScript.PositionedToken = PositionedToken; })(TypeScript || (TypeScript = {})); (function (TypeScript) { - var SyntaxNode = (function () { + var SyntaxNode = /** @class */ (function () { function SyntaxNode() { } SyntaxNode.prototype.findToken = function (position, includeSkippedTokens) { @@ -101,7 +101,7 @@ var TypeScript; (function (Syntax) { function childIndex() { } Syntax.childIndex = childIndex; - var VariableWidthTokenWithTrailingTrivia = (function () { + var VariableWidthTokenWithTrailingTrivia = /** @class */ (function () { function VariableWidthTokenWithTrailingTrivia() { } VariableWidthTokenWithTrailingTrivia.prototype.findTokenInternal = function (parent, position, fullStart) { diff --git a/tests/baselines/reference/moduleMerge.js b/tests/baselines/reference/moduleMerge.js index 4e5aac120fc96..4671597429721 100644 --- a/tests/baselines/reference/moduleMerge.js +++ b/tests/baselines/reference/moduleMerge.js @@ -27,7 +27,7 @@ module A // This should not compile both B classes are in the same module this should be a collission var A; (function (A) { - var B = (function () { + var B = /** @class */ (function () { function B() { } B.prototype.Hello = function () { @@ -37,7 +37,7 @@ var A; }()); })(A || (A = {})); (function (A) { - var B = (function () { + var B = /** @class */ (function () { function B() { } B.prototype.Hello = function () { diff --git a/tests/baselines/reference/moduleMergeConstructor.js b/tests/baselines/reference/moduleMergeConstructor.js index 5ecaf8365d880..1b02e37549cbc 100644 --- a/tests/baselines/reference/moduleMergeConstructor.js +++ b/tests/baselines/reference/moduleMergeConstructor.js @@ -30,7 +30,7 @@ class Test { define(["require", "exports", "foo"], function (require, exports, foo) { "use strict"; exports.__esModule = true; - var Test = (function () { + var Test = /** @class */ (function () { function Test() { this.bar = new foo.Foo(); } diff --git a/tests/baselines/reference/moduleNewExportBug.js b/tests/baselines/reference/moduleNewExportBug.js index b48f6dd73b07c..4f472a28620d6 100644 --- a/tests/baselines/reference/moduleNewExportBug.js +++ b/tests/baselines/reference/moduleNewExportBug.js @@ -16,7 +16,7 @@ var c : mod1.C; // ERROR: C should not be visible //// [moduleNewExportBug.js] var mod1; (function (mod1) { - var C = (function () { + var C = /** @class */ (function () { function C() { } C.prototype.moo = function () { }; diff --git a/tests/baselines/reference/moduleNoneErrors.js b/tests/baselines/reference/moduleNoneErrors.js index 7be89f236be00..db7efe6d2884f 100644 --- a/tests/baselines/reference/moduleNoneErrors.js +++ b/tests/baselines/reference/moduleNoneErrors.js @@ -7,7 +7,7 @@ export class Foo { //// [a.js] "use strict"; exports.__esModule = true; -var Foo = (function () { +var Foo = /** @class */ (function () { function Foo() { } return Foo; diff --git a/tests/baselines/reference/modulePrologueAMD.js b/tests/baselines/reference/modulePrologueAMD.js index b38e5d95f2c53..4a9c475bb601a 100644 --- a/tests/baselines/reference/modulePrologueAMD.js +++ b/tests/baselines/reference/modulePrologueAMD.js @@ -7,7 +7,7 @@ export class Foo {} define(["require", "exports"], function (require, exports) { "use strict"; exports.__esModule = true; - var Foo = (function () { + var Foo = /** @class */ (function () { function Foo() { } return Foo; diff --git a/tests/baselines/reference/modulePrologueCommonjs.js b/tests/baselines/reference/modulePrologueCommonjs.js index 4f465a2ae2f19..88a75f1e0f2ed 100644 --- a/tests/baselines/reference/modulePrologueCommonjs.js +++ b/tests/baselines/reference/modulePrologueCommonjs.js @@ -6,7 +6,7 @@ export class Foo {} //// [modulePrologueCommonjs.js] "use strict"; exports.__esModule = true; -var Foo = (function () { +var Foo = /** @class */ (function () { function Foo() { } return Foo; diff --git a/tests/baselines/reference/modulePrologueSystem.js b/tests/baselines/reference/modulePrologueSystem.js index c3919669a8d18..afa319820eb75 100644 --- a/tests/baselines/reference/modulePrologueSystem.js +++ b/tests/baselines/reference/modulePrologueSystem.js @@ -11,7 +11,7 @@ System.register([], function (exports_1, context_1) { return { setters: [], execute: function () { - Foo = (function () { + Foo = /** @class */ (function () { function Foo() { } return Foo; diff --git a/tests/baselines/reference/modulePrologueUmd.js b/tests/baselines/reference/modulePrologueUmd.js index c9b8c331bcf14..ac01fb4815851 100644 --- a/tests/baselines/reference/modulePrologueUmd.js +++ b/tests/baselines/reference/modulePrologueUmd.js @@ -15,7 +15,7 @@ export class Foo {} })(function (require, exports) { "use strict"; exports.__esModule = true; - var Foo = (function () { + var Foo = /** @class */ (function () { function Foo() { } return Foo; diff --git a/tests/baselines/reference/moduleRedifinitionErrors.js b/tests/baselines/reference/moduleRedifinitionErrors.js index 830ea03e1d381..35586275b6a89 100644 --- a/tests/baselines/reference/moduleRedifinitionErrors.js +++ b/tests/baselines/reference/moduleRedifinitionErrors.js @@ -6,7 +6,7 @@ module A { //// [moduleRedifinitionErrors.js] -var A = (function () { +var A = /** @class */ (function () { function A() { } return A; diff --git a/tests/baselines/reference/moduleReopenedTypeOtherBlock.js b/tests/baselines/reference/moduleReopenedTypeOtherBlock.js index 007090a0c1178..3d48286968345 100644 --- a/tests/baselines/reference/moduleReopenedTypeOtherBlock.js +++ b/tests/baselines/reference/moduleReopenedTypeOtherBlock.js @@ -11,7 +11,7 @@ module M { //// [moduleReopenedTypeOtherBlock.js] var M; (function (M) { - var C1 = (function () { + var C1 = /** @class */ (function () { function C1() { } return C1; @@ -19,7 +19,7 @@ var M; M.C1 = C1; })(M || (M = {})); (function (M) { - var C2 = (function () { + var C2 = /** @class */ (function () { function C2() { } C2.prototype.f = function () { return null; }; diff --git a/tests/baselines/reference/moduleReopenedTypeSameBlock.js b/tests/baselines/reference/moduleReopenedTypeSameBlock.js index 07b5e8e657eb3..3b6c43afbd974 100644 --- a/tests/baselines/reference/moduleReopenedTypeSameBlock.js +++ b/tests/baselines/reference/moduleReopenedTypeSameBlock.js @@ -9,7 +9,7 @@ module M { //// [moduleReopenedTypeSameBlock.js] var M; (function (M) { - var C1 = (function () { + var C1 = /** @class */ (function () { function C1() { } return C1; @@ -17,7 +17,7 @@ var M; M.C1 = C1; })(M || (M = {})); (function (M) { - var C2 = (function () { + var C2 = /** @class */ (function () { function C2() { } C2.prototype.f = function () { return null; }; diff --git a/tests/baselines/reference/moduleResolutionWithSymlinks.js b/tests/baselines/reference/moduleResolutionWithSymlinks.js index b483f356252be..de15c90fdf1cf 100644 --- a/tests/baselines/reference/moduleResolutionWithSymlinks.js +++ b/tests/baselines/reference/moduleResolutionWithSymlinks.js @@ -44,7 +44,7 @@ tsc app.ts # Should write to library-a/index.js, library-b/index.js, and app.js // When symlinked files are in node_modules, they are resolved with realpath; // so a linked file does not create a duplicate SourceFile of the real one. exports.__esModule = true; -var MyClass = (function () { +var MyClass = /** @class */ (function () { function MyClass() { } return MyClass; diff --git a/tests/baselines/reference/moduleResolutionWithSymlinks_withOutDir.js b/tests/baselines/reference/moduleResolutionWithSymlinks_withOutDir.js index 0049ad48f91eb..0b7fa8fb41656 100644 --- a/tests/baselines/reference/moduleResolutionWithSymlinks_withOutDir.js +++ b/tests/baselines/reference/moduleResolutionWithSymlinks_withOutDir.js @@ -23,7 +23,7 @@ y = x; "use strict"; // Same as moduleResolutionWithSymlinks.ts, but with outDir exports.__esModule = true; -var MyClass = (function () { +var MyClass = /** @class */ (function () { function MyClass() { } return MyClass; diff --git a/tests/baselines/reference/moduleScopingBug.js b/tests/baselines/reference/moduleScopingBug.js index 5d18b2de676cc..a8d22b3492bc4 100644 --- a/tests/baselines/reference/moduleScopingBug.js +++ b/tests/baselines/reference/moduleScopingBug.js @@ -36,7 +36,7 @@ var M; function f() { var inner = outer; // Ok } - var C = (function () { + var C = /** @class */ (function () { function C() { var inner = outer; // Ok } diff --git a/tests/baselines/reference/moduleVisibilityTest1.js b/tests/baselines/reference/moduleVisibilityTest1.js index 1bae7ecfd1fc2..99ff355df7209 100644 --- a/tests/baselines/reference/moduleVisibilityTest1.js +++ b/tests/baselines/reference/moduleVisibilityTest1.js @@ -92,13 +92,13 @@ var M; })(E = M.E || (M.E = {})); M.x = 5; var y = M.x + M.x; - var B = (function () { + var B = /** @class */ (function () { function B() { this.b = 0; } return B; }()); - var C = (function () { + var C = /** @class */ (function () { function C() { this.someProp = 1; function someInnerFunc() { return 2; } diff --git a/tests/baselines/reference/moduleVisibilityTest2.js b/tests/baselines/reference/moduleVisibilityTest2.js index b40d1721b6531..0030c9ec3541e 100644 --- a/tests/baselines/reference/moduleVisibilityTest2.js +++ b/tests/baselines/reference/moduleVisibilityTest2.js @@ -93,13 +93,13 @@ var M; })(E || (E = {})); var x = 5; var y = x + x; - var B = (function () { + var B = /** @class */ (function () { function B() { this.b = 0; } return B; }()); - var C = (function () { + var C = /** @class */ (function () { function C() { this.someProp = 1; function someInnerFunc() { return 2; } diff --git a/tests/baselines/reference/moduleVisibilityTest3.js b/tests/baselines/reference/moduleVisibilityTest3.js index deeec304d988d..b746f4ecc2736 100644 --- a/tests/baselines/reference/moduleVisibilityTest3.js +++ b/tests/baselines/reference/moduleVisibilityTest3.js @@ -29,7 +29,7 @@ module editor { //// [moduleVisibilityTest3.js] var _modes; (function (_modes) { - var Mode = (function () { + var Mode = /** @class */ (function () { function Mode() { } return Mode; @@ -40,7 +40,7 @@ var editor; (function (editor) { var i; // If you just use p1:modes, the compiler accepts it - should be an error - var Bug = (function () { + var Bug = /** @class */ (function () { function Bug(p1, p2) { var x; } diff --git a/tests/baselines/reference/moduleWithStatementsOfEveryKind.js b/tests/baselines/reference/moduleWithStatementsOfEveryKind.js index 00838f25bebdc..6c948072137f2 100644 --- a/tests/baselines/reference/moduleWithStatementsOfEveryKind.js +++ b/tests/baselines/reference/moduleWithStatementsOfEveryKind.js @@ -71,24 +71,24 @@ var __extends = (this && this.__extends) || (function () { })(); var A; (function (A_1) { - var A = (function () { + var A = /** @class */ (function () { function A() { } return A; }()); - var AA = (function () { + var AA = /** @class */ (function () { function AA() { } return AA; }()); - var B = (function (_super) { + var B = /** @class */ (function (_super) { __extends(B, _super); function B() { return _super !== null && _super.apply(this, arguments) || this; } return B; }(AA)); - var BB = (function (_super) { + var BB = /** @class */ (function (_super) { __extends(BB, _super); function BB() { return _super !== null && _super.apply(this, arguments) || this; @@ -97,7 +97,7 @@ var A; }(A)); var Module; (function (Module) { - var A = (function () { + var A = /** @class */ (function () { function A() { } return A; @@ -120,19 +120,19 @@ var A; })(A || (A = {})); var Y; (function (Y) { - var A = (function () { + var A = /** @class */ (function () { function A() { } return A; }()); Y.A = A; - var AA = (function () { + var AA = /** @class */ (function () { function AA() { } return AA; }()); Y.AA = AA; - var B = (function (_super) { + var B = /** @class */ (function (_super) { __extends(B, _super); function B() { return _super !== null && _super.apply(this, arguments) || this; @@ -140,7 +140,7 @@ var Y; return B; }(AA)); Y.B = B; - var BB = (function (_super) { + var BB = /** @class */ (function (_super) { __extends(BB, _super); function BB() { return _super !== null && _super.apply(this, arguments) || this; @@ -150,7 +150,7 @@ var Y; Y.BB = BB; var Module; (function (Module) { - var A = (function () { + var A = /** @class */ (function () { function A() { } return A; diff --git a/tests/baselines/reference/moduledecl.js b/tests/baselines/reference/moduledecl.js index b2dd3caaf3512..cfb0bf7c2482a 100644 --- a/tests/baselines/reference/moduledecl.js +++ b/tests/baselines/reference/moduledecl.js @@ -239,7 +239,7 @@ var m0; } function f2(ns) { } - var c1 = (function () { + var c1 = /** @class */ (function () { function c1() { } return c1; @@ -253,7 +253,7 @@ var m1; function f2(ns) { } m1.f2 = f2; - var c1 = (function () { + var c1 = /** @class */ (function () { function c1(n, n2, n3, n4) { this.n = n; this.n2 = n2; @@ -303,7 +303,7 @@ var m13; })(m13 || (m13 = {})); var exportTests; (function (exportTests) { - var C1_public = (function () { + var C1_public = /** @class */ (function () { function C1_public() { } C1_public.prototype.f2 = function () { @@ -315,7 +315,7 @@ var exportTests; return C1_public; }()); exportTests.C1_public = C1_public; - var C2_private = (function () { + var C2_private = /** @class */ (function () { function C2_private() { } C2_private.prototype.f2 = function () { @@ -326,7 +326,7 @@ var exportTests; }; return C2_private; }()); - var C3_public = (function () { + var C3_public = /** @class */ (function () { function C3_public() { } C3_public.prototype.getC2_private = function () { diff --git a/tests/baselines/reference/multiImportExport.js b/tests/baselines/reference/multiImportExport.js index 07e353cb301b2..01dc798bf1d1a 100644 --- a/tests/baselines/reference/multiImportExport.js +++ b/tests/baselines/reference/multiImportExport.js @@ -27,7 +27,7 @@ export = Adder; //// [Adder.js] "use strict"; -var Adder = (function () { +var Adder = /** @class */ (function () { function Adder() { } Adder.prototype.add = function (a, b) { diff --git a/tests/baselines/reference/multiModuleClodule1.js b/tests/baselines/reference/multiModuleClodule1.js index eac6bfa8d51a0..18ab88c42d2c4 100644 --- a/tests/baselines/reference/multiModuleClodule1.js +++ b/tests/baselines/reference/multiModuleClodule1.js @@ -19,7 +19,7 @@ var c = new C(C.x); c.foo = C.foo; //// [multiModuleClodule1.js] -var C = (function () { +var C = /** @class */ (function () { function C(x) { } C.prototype.foo = function () { }; diff --git a/tests/baselines/reference/multipleClassPropertyModifiers.js b/tests/baselines/reference/multipleClassPropertyModifiers.js index 294e303e25444..65bdc9202c671 100644 --- a/tests/baselines/reference/multipleClassPropertyModifiers.js +++ b/tests/baselines/reference/multipleClassPropertyModifiers.js @@ -7,7 +7,7 @@ class C { } //// [multipleClassPropertyModifiers.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } return C; diff --git a/tests/baselines/reference/multipleClassPropertyModifiersErrors.js b/tests/baselines/reference/multipleClassPropertyModifiersErrors.js index 5bfa6979ef2dd..d847acbff0ffb 100644 --- a/tests/baselines/reference/multipleClassPropertyModifiersErrors.js +++ b/tests/baselines/reference/multipleClassPropertyModifiersErrors.js @@ -10,7 +10,7 @@ class C { } //// [multipleClassPropertyModifiersErrors.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } return C; diff --git a/tests/baselines/reference/multipleDeclarations.js b/tests/baselines/reference/multipleDeclarations.js index 7fb7e0bca026f..14bf360da14d5 100644 --- a/tests/baselines/reference/multipleDeclarations.js +++ b/tests/baselines/reference/multipleDeclarations.js @@ -42,7 +42,7 @@ function C() { C.prototype.m = function () { this.nothing(); }; -var X = (function () { +var X = /** @class */ (function () { function X() { this.m = this.m.bind(this); this.mistake = 'frankly, complete nonsense'; @@ -57,7 +57,7 @@ var x = new X(); X.prototype.mistake = false; x.m(); x.mistake; -var Y = (function () { +var Y = /** @class */ (function () { function Y() { this.m = this.m.bind(this); this.mistake = 'even more nonsense'; diff --git a/tests/baselines/reference/multipleDefaultExports01.js b/tests/baselines/reference/multipleDefaultExports01.js index 06e53505451c7..0156ff8c309c9 100644 --- a/tests/baselines/reference/multipleDefaultExports01.js +++ b/tests/baselines/reference/multipleDefaultExports01.js @@ -20,7 +20,7 @@ Entity(); //// [m1.js] "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); -var foo = (function () { +var foo = /** @class */ (function () { function foo() { } return foo; diff --git a/tests/baselines/reference/multipleDefaultExports03.js b/tests/baselines/reference/multipleDefaultExports03.js index 3b02dd523d7c0..c8088cf16a0cb 100644 --- a/tests/baselines/reference/multipleDefaultExports03.js +++ b/tests/baselines/reference/multipleDefaultExports03.js @@ -8,13 +8,13 @@ export default class C { //// [multipleDefaultExports03.js] "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); -var C = (function () { +var C = /** @class */ (function () { function C() { } return C; }()); exports.default = C; -var C = (function () { +var C = /** @class */ (function () { function C() { } return C; diff --git a/tests/baselines/reference/multipleExportDefault3.js b/tests/baselines/reference/multipleExportDefault3.js index 1091af16301ec..ac22954a8f98e 100644 --- a/tests/baselines/reference/multipleExportDefault3.js +++ b/tests/baselines/reference/multipleExportDefault3.js @@ -13,7 +13,7 @@ exports.__esModule = true; exports["default"] = { uhoh: "another default" }; -var C = (function () { +var C = /** @class */ (function () { function C() { } return C; diff --git a/tests/baselines/reference/multipleExportDefault4.js b/tests/baselines/reference/multipleExportDefault4.js index b3e0ef3e87069..9412991b7cabe 100644 --- a/tests/baselines/reference/multipleExportDefault4.js +++ b/tests/baselines/reference/multipleExportDefault4.js @@ -8,7 +8,7 @@ export default { //// [multipleExportDefault4.js] "use strict"; exports.__esModule = true; -var C = (function () { +var C = /** @class */ (function () { function C() { } return C; diff --git a/tests/baselines/reference/multipleExportDefault5.js b/tests/baselines/reference/multipleExportDefault5.js index a5032e45244c8..daad580b1a982 100644 --- a/tests/baselines/reference/multipleExportDefault5.js +++ b/tests/baselines/reference/multipleExportDefault5.js @@ -7,7 +7,7 @@ export default class C {} exports.__esModule = true; function bar() { } exports["default"] = bar; -var C = (function () { +var C = /** @class */ (function () { function C() { } return C; diff --git a/tests/baselines/reference/multipleInheritance.js b/tests/baselines/reference/multipleInheritance.js index 59abc8cd469e7..da45b3450b650 100644 --- a/tests/baselines/reference/multipleInheritance.js +++ b/tests/baselines/reference/multipleInheritance.js @@ -49,64 +49,64 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var B1 = (function () { +var B1 = /** @class */ (function () { function B1() { } return B1; }()); -var B2 = (function () { +var B2 = /** @class */ (function () { function B2() { } return B2; }()); -var C = (function (_super) { +var C = /** @class */ (function (_super) { __extends(C, _super); function C() { return _super !== null && _super.apply(this, arguments) || this; } return C; }(B1)); -var D1 = (function (_super) { +var D1 = /** @class */ (function (_super) { __extends(D1, _super); function D1() { return _super !== null && _super.apply(this, arguments) || this; } return D1; }(B1)); -var D2 = (function (_super) { +var D2 = /** @class */ (function (_super) { __extends(D2, _super); function D2() { return _super !== null && _super.apply(this, arguments) || this; } return D2; }(B2)); -var E = (function (_super) { +var E = /** @class */ (function (_super) { __extends(E, _super); function E() { return _super !== null && _super.apply(this, arguments) || this; } return E; }(D1)); -var N = (function () { +var N = /** @class */ (function () { function N() { } return N; }()); -var ND = (function (_super) { +var ND = /** @class */ (function (_super) { __extends(ND, _super); function ND() { return _super !== null && _super.apply(this, arguments) || this; } return ND; }(N)); -var Good = (function () { +var Good = /** @class */ (function () { function Good() { this.f = function () { return 0; }; } Good.prototype.g = function () { return 0; }; return Good; }()); -var Baad = (function (_super) { +var Baad = /** @class */ (function (_super) { __extends(Baad, _super); function Baad() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/multipleNumericIndexers.js b/tests/baselines/reference/multipleNumericIndexers.js index 7b5207d230330..0830da1742124 100644 --- a/tests/baselines/reference/multipleNumericIndexers.js +++ b/tests/baselines/reference/multipleNumericIndexers.js @@ -34,14 +34,14 @@ interface I { //// [multipleNumericIndexers.js] // Multiple indexers of the same type are an error -var C = (function () { +var C = /** @class */ (function () { function C() { } return C; }()); var a; var b = { 1: '', "2": '' }; -var C2 = (function () { +var C2 = /** @class */ (function () { function C2() { } return C2; diff --git a/tests/baselines/reference/multipleStringIndexers.js b/tests/baselines/reference/multipleStringIndexers.js index 98db93c70550e..0180b6cb162ea 100644 --- a/tests/baselines/reference/multipleStringIndexers.js +++ b/tests/baselines/reference/multipleStringIndexers.js @@ -33,14 +33,14 @@ interface I2 { //// [multipleStringIndexers.js] // Multiple indexers of the same type are an error -var C = (function () { +var C = /** @class */ (function () { function C() { } return C; }()); var a; var b = { y: '' }; -var C2 = (function () { +var C2 = /** @class */ (function () { function C2() { } return C2; diff --git a/tests/baselines/reference/multivar.js b/tests/baselines/reference/multivar.js index f24728fef9262..0147f5e763ca6 100644 --- a/tests/baselines/reference/multivar.js +++ b/tests/baselines/reference/multivar.js @@ -55,13 +55,13 @@ var m2; var m1; var a2, b22 = 10, b222; var m3; - var C = (function () { + var C = /** @class */ (function () { function C(b) { this.b = b; } return C; }()); - var C2 = (function () { + var C2 = /** @class */ (function () { function C2(b) { this.b = b; } diff --git a/tests/baselines/reference/mutuallyRecursiveGenericBaseTypes2.js b/tests/baselines/reference/mutuallyRecursiveGenericBaseTypes2.js index 7977134b2ed94..0e3746e1b4f00 100644 --- a/tests/baselines/reference/mutuallyRecursiveGenericBaseTypes2.js +++ b/tests/baselines/reference/mutuallyRecursiveGenericBaseTypes2.js @@ -21,13 +21,13 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var foo = (function () { +var foo = /** @class */ (function () { function foo() { } foo.prototype.bar = function () { return null; }; return foo; }()); -var foo2 = (function (_super) { +var foo2 = /** @class */ (function (_super) { __extends(foo2, _super); function foo2() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/nameCollision.js b/tests/baselines/reference/nameCollision.js index bb4f4a092f9d7..c7c2f97156f6c 100644 --- a/tests/baselines/reference/nameCollision.js +++ b/tests/baselines/reference/nameCollision.js @@ -61,7 +61,7 @@ var B; (function (B_1) { // re-opened module with colliding name // this should add an underscore. - var B = (function () { + var B = /** @class */ (function () { function B() { } return B; diff --git a/tests/baselines/reference/nameCollisions.js b/tests/baselines/reference/nameCollisions.js index a36f66e8dc9b4..b8d44897cdacc 100644 --- a/tests/baselines/reference/nameCollisions.js +++ b/tests/baselines/reference/nameCollisions.js @@ -53,7 +53,7 @@ var T; var x = 2; var x; (function (x) { - var Bar = (function () { + var Bar = /** @class */ (function () { function Bar() { } return Bar; @@ -69,7 +69,7 @@ var T; (function (y) { var b; })(y || (y = {})); - var y = (function () { + var y = /** @class */ (function () { function y() { } return y; @@ -80,25 +80,25 @@ var T; function f2() { } var f2; // error var i; - var C = (function () { + var C = /** @class */ (function () { function C() { } return C; }()); function C() { } // error function C2() { } - var C2 = (function () { + var C2 = /** @class */ (function () { function C2() { } return C2; }()); // error function fi() { } - var cli = (function () { + var cli = /** @class */ (function () { function cli() { } return cli; }()); - var cli2 = (function () { + var cli2 = /** @class */ (function () { function cli2() { } return cli2; diff --git a/tests/baselines/reference/namedFunctionExpressionAssignedToClassProperty.js b/tests/baselines/reference/namedFunctionExpressionAssignedToClassProperty.js index a0aaa82e895ee..d95be11db15da 100644 --- a/tests/baselines/reference/namedFunctionExpressionAssignedToClassProperty.js +++ b/tests/baselines/reference/namedFunctionExpressionAssignedToClassProperty.js @@ -15,7 +15,7 @@ class Foo{ //// [namedFunctionExpressionAssignedToClassProperty.js] -var Foo = (function () { +var Foo = /** @class */ (function () { function Foo() { this.a = function bar() { }; // this shouldn't crash the compiler... diff --git a/tests/baselines/reference/namespaces2.js b/tests/baselines/reference/namespaces2.js index b7b1c38f08d06..fc347f9be14b5 100644 --- a/tests/baselines/reference/namespaces2.js +++ b/tests/baselines/reference/namespaces2.js @@ -12,7 +12,7 @@ var A; (function (A) { var B; (function (B) { - var C = (function () { + var C = /** @class */ (function () { function C() { } return C; diff --git a/tests/baselines/reference/narrowTypeByInstanceof.js b/tests/baselines/reference/narrowTypeByInstanceof.js index 0415c72b9fd76..1ea6f833b7c43 100644 --- a/tests/baselines/reference/narrowTypeByInstanceof.js +++ b/tests/baselines/reference/narrowTypeByInstanceof.js @@ -26,7 +26,7 @@ if (elementA instanceof FileMatch && elementB instanceof FileMatch) { //// [narrowTypeByInstanceof.js] -var Match = (function () { +var Match = /** @class */ (function () { function Match() { } Match.prototype.range = function () { @@ -34,7 +34,7 @@ var Match = (function () { }; return Match; }()); -var FileMatch = (function () { +var FileMatch = /** @class */ (function () { function FileMatch() { } FileMatch.prototype.resource = function () { diff --git a/tests/baselines/reference/narrowedConstInMethod.js b/tests/baselines/reference/narrowedConstInMethod.js index e86b6df6a460b..91708221402e4 100644 --- a/tests/baselines/reference/narrowedConstInMethod.js +++ b/tests/baselines/reference/narrowedConstInMethod.js @@ -32,7 +32,7 @@ function f() { function f2() { var x = {}; if (x !== null) { - return (function () { + return /** @class */ (function () { function class_1() { } class_1.prototype.bar = function () { return x.length; }; // ok diff --git a/tests/baselines/reference/narrowingGenericTypeFromInstanceof01.js b/tests/baselines/reference/narrowingGenericTypeFromInstanceof01.js index 96fa20359cafe..901d3f80d1dd3 100644 --- a/tests/baselines/reference/narrowingGenericTypeFromInstanceof01.js +++ b/tests/baselines/reference/narrowingGenericTypeFromInstanceof01.js @@ -28,13 +28,13 @@ function test(x: A | B) { } //// [narrowingGenericTypeFromInstanceof01.js] -var A = (function () { +var A = /** @class */ (function () { function A(a) { this.a = a; } return A; }()); -var B = (function () { +var B = /** @class */ (function () { function B() { } return B; diff --git a/tests/baselines/reference/narrowingOfDottedNames.js b/tests/baselines/reference/narrowingOfDottedNames.js index 14cdcd5563190..292678ce57b2d 100644 --- a/tests/baselines/reference/narrowingOfDottedNames.js +++ b/tests/baselines/reference/narrowingOfDottedNames.js @@ -42,12 +42,12 @@ function f2(x: A | B) { //// [narrowingOfDottedNames.js] // Repro from #8383 -var A = (function () { +var A = /** @class */ (function () { function A() { } return A; }()); -var B = (function () { +var B = /** @class */ (function () { function B() { } return B; diff --git a/tests/baselines/reference/negateOperatorWithAnyOtherType.js b/tests/baselines/reference/negateOperatorWithAnyOtherType.js index eb5f70d8c9c83..f69ab91321534 100644 --- a/tests/baselines/reference/negateOperatorWithAnyOtherType.js +++ b/tests/baselines/reference/negateOperatorWithAnyOtherType.js @@ -64,7 +64,7 @@ function foo() { var a; return a; } -var A = (function () { +var A = /** @class */ (function () { function A() { } A.foo = function () { diff --git a/tests/baselines/reference/negateOperatorWithBooleanType.js b/tests/baselines/reference/negateOperatorWithBooleanType.js index 07d404b0c6c9f..13347a2af68d5 100644 --- a/tests/baselines/reference/negateOperatorWithBooleanType.js +++ b/tests/baselines/reference/negateOperatorWithBooleanType.js @@ -39,7 +39,7 @@ var ResultIsNumber7 = -A.foo(); // - operator on boolean type var BOOLEAN; function foo() { return true; } -var A = (function () { +var A = /** @class */ (function () { function A() { } A.foo = function () { return false; }; diff --git a/tests/baselines/reference/negateOperatorWithNumberType.js b/tests/baselines/reference/negateOperatorWithNumberType.js index 42b78dc0a2b16..7605aa1e0ae40 100644 --- a/tests/baselines/reference/negateOperatorWithNumberType.js +++ b/tests/baselines/reference/negateOperatorWithNumberType.js @@ -46,7 +46,7 @@ var ResultIsNumber11 = -(NUMBER - NUMBER); var NUMBER; var NUMBER1 = [1, 2]; function foo() { return 1; } -var A = (function () { +var A = /** @class */ (function () { function A() { } A.foo = function () { return 1; }; diff --git a/tests/baselines/reference/negateOperatorWithStringType.js b/tests/baselines/reference/negateOperatorWithStringType.js index 8a70f5e280550..cb3b6c092b4fb 100644 --- a/tests/baselines/reference/negateOperatorWithStringType.js +++ b/tests/baselines/reference/negateOperatorWithStringType.js @@ -45,7 +45,7 @@ var ResultIsNumber12 = -STRING.charAt(0); var STRING; var STRING1 = ["", "abc"]; function foo() { return "abc"; } -var A = (function () { +var A = /** @class */ (function () { function A() { } A.foo = function () { return ""; }; diff --git a/tests/baselines/reference/nestedClassDeclaration.js b/tests/baselines/reference/nestedClassDeclaration.js index cc300ec75a31c..136980383d695 100644 --- a/tests/baselines/reference/nestedClassDeclaration.js +++ b/tests/baselines/reference/nestedClassDeclaration.js @@ -20,18 +20,18 @@ var x = { //// [nestedClassDeclaration.js] // nested classes are not allowed -var C = (function () { +var C = /** @class */ (function () { function C() { } return C; }()); -var C2 = (function () { +var C2 = /** @class */ (function () { function C2() { } return C2; }()); function foo() { - var C3 = (function () { + var C3 = /** @class */ (function () { function C3() { } return C3; diff --git a/tests/baselines/reference/nestedLoops.js b/tests/baselines/reference/nestedLoops.js index 6b01eae55cd9e..91217074d948a 100644 --- a/tests/baselines/reference/nestedLoops.js +++ b/tests/baselines/reference/nestedLoops.js @@ -20,7 +20,7 @@ export class Test { //// [nestedLoops.js] "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); -var Test = (function () { +var Test = /** @class */ (function () { function Test() { var outerArray = [1, 2, 3]; var innerArray = [1, 2, 3]; diff --git a/tests/baselines/reference/nestedSelf.js b/tests/baselines/reference/nestedSelf.js index ea6abc8e1e8fc..cbc6c5ae55c3b 100644 --- a/tests/baselines/reference/nestedSelf.js +++ b/tests/baselines/reference/nestedSelf.js @@ -11,7 +11,7 @@ module M { //// [nestedSelf.js] var M; (function (M) { - var C = (function () { + var C = /** @class */ (function () { function C() { this.n = 42; } diff --git a/tests/baselines/reference/neverType.js b/tests/baselines/reference/neverType.js index e21a2fedf8ecc..eb7ee33148013 100644 --- a/tests/baselines/reference/neverType.js +++ b/tests/baselines/reference/neverType.js @@ -131,7 +131,7 @@ function move2(direction) { function check(x) { return x || error("Undefined value"); } -var C = (function () { +var C = /** @class */ (function () { function C() { } C.prototype.void1 = function () { diff --git a/tests/baselines/reference/newArrays.js b/tests/baselines/reference/newArrays.js index d156ee24f1c13..56c8f7d3a0bae 100644 --- a/tests/baselines/reference/newArrays.js +++ b/tests/baselines/reference/newArrays.js @@ -15,12 +15,12 @@ module M { //// [newArrays.js] var M; (function (M) { - var Foo = (function () { + var Foo = /** @class */ (function () { function Foo() { } return Foo; }()); - var Gar = (function () { + var Gar = /** @class */ (function () { function Gar() { this.x = 10; this.y = 10; diff --git a/tests/baselines/reference/newOnInstanceSymbol.js b/tests/baselines/reference/newOnInstanceSymbol.js index 755cc35e19ef0..0865db6968f73 100644 --- a/tests/baselines/reference/newOnInstanceSymbol.js +++ b/tests/baselines/reference/newOnInstanceSymbol.js @@ -4,7 +4,7 @@ var x = new C(); // should be ok new x(); // should error //// [newOnInstanceSymbol.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } return C; diff --git a/tests/baselines/reference/newOperator.js b/tests/baselines/reference/newOperator.js index 75ad42de8c3e0..160d385c0634b 100644 --- a/tests/baselines/reference/newOperator.js +++ b/tests/baselines/reference/newOperator.js @@ -71,14 +71,14 @@ var t5 = new new Date; new String; var M; (function (M) { - var T = (function () { + var T = /** @class */ (function () { function T() { } return T; }()); M.T = T; })(M || (M = {})); -var S = (function () { +var S = /** @class */ (function () { function S() { } Object.defineProperty(S.prototype, "xs", { diff --git a/tests/baselines/reference/newOperatorConformance.js b/tests/baselines/reference/newOperatorConformance.js index 46a1f3c7caced..e217aeb3ecba7 100644 --- a/tests/baselines/reference/newOperatorConformance.js +++ b/tests/baselines/reference/newOperatorConformance.js @@ -63,17 +63,17 @@ var n = new nested(); //// [newOperatorConformance.js] -var C0 = (function () { +var C0 = /** @class */ (function () { function C0() { } return C0; }()); -var C1 = (function () { +var C1 = /** @class */ (function () { function C1(n, s) { } return C1; }()); -var T = (function () { +var T = /** @class */ (function () { function T(n) { } return T; diff --git a/tests/baselines/reference/newOperatorErrorCases.js b/tests/baselines/reference/newOperatorErrorCases.js index 5f179fece7777..f5735abdd06c2 100644 --- a/tests/baselines/reference/newOperatorErrorCases.js +++ b/tests/baselines/reference/newOperatorErrorCases.js @@ -38,17 +38,17 @@ var s = new fnNumber(); // Error //// [newOperatorErrorCases.js] -var C0 = (function () { +var C0 = /** @class */ (function () { function C0() { } return C0; }()); -var C1 = (function () { +var C1 = /** @class */ (function () { function C1(n, s) { } return C1; }()); -var T = (function () { +var T = /** @class */ (function () { function T(n) { } return T; diff --git a/tests/baselines/reference/newTarget.es5.js b/tests/baselines/reference/newTarget.es5.js index 38718a771ad83..61b3f73a9b408 100644 --- a/tests/baselines/reference/newTarget.es5.js +++ b/tests/baselines/reference/newTarget.es5.js @@ -43,7 +43,7 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var A = (function () { +var A = /** @class */ (function () { function A() { var _newTarget = this.constructor; this.d = function _a() { var _newTarget = this && this instanceof _a ? this.constructor : void 0; return _newTarget; }; @@ -53,7 +53,7 @@ var A = (function () { A.c = function _a() { var _newTarget = this && this instanceof _a ? this.constructor : void 0; return _newTarget; }; return A; }()); -var B = (function (_super) { +var B = /** @class */ (function (_super) { __extends(B, _super); function B() { var _newTarget = this.constructor; diff --git a/tests/baselines/reference/newWithSpread.js b/tests/baselines/reference/newWithSpread.js index f08902b14be97..e950234b4cc4a 100644 --- a/tests/baselines/reference/newWithSpread.js +++ b/tests/baselines/reference/newWithSpread.js @@ -109,7 +109,7 @@ function f2() { x[_i] = arguments[_i]; } } -var B = (function () { +var B = /** @class */ (function () { function B(x, y) { var z = []; for (var _i = 2; _i < arguments.length; _i++) { diff --git a/tests/baselines/reference/newWithSpreadES5.js b/tests/baselines/reference/newWithSpreadES5.js index a74a5a729a65e..51de124ceee55 100644 --- a/tests/baselines/reference/newWithSpreadES5.js +++ b/tests/baselines/reference/newWithSpreadES5.js @@ -108,7 +108,7 @@ function f2() { x[_i] = arguments[_i]; } } -var B = (function () { +var B = /** @class */ (function () { function B(x, y) { var z = []; for (var _i = 2; _i < arguments.length; _i++) { diff --git a/tests/baselines/reference/noCollisionThisExpressionAndClassInGlobal.js b/tests/baselines/reference/noCollisionThisExpressionAndClassInGlobal.js index b31eccee9b5ec..0ff332350eb05 100644 --- a/tests/baselines/reference/noCollisionThisExpressionAndClassInGlobal.js +++ b/tests/baselines/reference/noCollisionThisExpressionAndClassInGlobal.js @@ -4,7 +4,7 @@ class _this { var f = () => _this; //// [noCollisionThisExpressionAndClassInGlobal.js] -var _this = (function () { +var _this = /** @class */ (function () { function _this() { } return _this; diff --git a/tests/baselines/reference/noCollisionThisExpressionAndLocalVarInAccessors.js b/tests/baselines/reference/noCollisionThisExpressionAndLocalVarInAccessors.js index 43218ef9697c1..6df80b5b30fc6 100644 --- a/tests/baselines/reference/noCollisionThisExpressionAndLocalVarInAccessors.js +++ b/tests/baselines/reference/noCollisionThisExpressionAndLocalVarInAccessors.js @@ -44,7 +44,7 @@ class class2 { } //// [noCollisionThisExpressionAndLocalVarInAccessors.js] -var class1 = (function () { +var class1 = /** @class */ (function () { function class1() { } Object.defineProperty(class1.prototype, "a", { @@ -70,7 +70,7 @@ var class1 = (function () { }); return class1; }()); -var class2 = (function () { +var class2 = /** @class */ (function () { function class2() { } Object.defineProperty(class2.prototype, "a", { diff --git a/tests/baselines/reference/noCollisionThisExpressionAndLocalVarInConstructor.js b/tests/baselines/reference/noCollisionThisExpressionAndLocalVarInConstructor.js index 79d0fd5549cdc..d640fc72ebe93 100644 --- a/tests/baselines/reference/noCollisionThisExpressionAndLocalVarInConstructor.js +++ b/tests/baselines/reference/noCollisionThisExpressionAndLocalVarInConstructor.js @@ -22,7 +22,7 @@ class class2 { } //// [noCollisionThisExpressionAndLocalVarInConstructor.js] -var class1 = (function () { +var class1 = /** @class */ (function () { function class1() { var x2 = { doStuff: function (callback) { return function () { @@ -33,7 +33,7 @@ var class1 = (function () { } return class1; }()); -var class2 = (function () { +var class2 = /** @class */ (function () { function class2() { var _this = 2; var x2 = { diff --git a/tests/baselines/reference/noCollisionThisExpressionAndLocalVarInMethod.js b/tests/baselines/reference/noCollisionThisExpressionAndLocalVarInMethod.js index b7fdfc5a49d5d..e4254225783dc 100644 --- a/tests/baselines/reference/noCollisionThisExpressionAndLocalVarInMethod.js +++ b/tests/baselines/reference/noCollisionThisExpressionAndLocalVarInMethod.js @@ -21,7 +21,7 @@ class a { //// [noCollisionThisExpressionAndLocalVarInMethod.js] var _this = 2; -var a = (function () { +var a = /** @class */ (function () { function a() { } a.prototype.method1 = function () { diff --git a/tests/baselines/reference/noCollisionThisExpressionAndLocalVarInProperty.js b/tests/baselines/reference/noCollisionThisExpressionAndLocalVarInProperty.js index 3265da26d147f..2fd2649856179 100644 --- a/tests/baselines/reference/noCollisionThisExpressionAndLocalVarInProperty.js +++ b/tests/baselines/reference/noCollisionThisExpressionAndLocalVarInProperty.js @@ -20,7 +20,7 @@ class class2 { } //// [noCollisionThisExpressionAndLocalVarInProperty.js] -var class1 = (function () { +var class1 = /** @class */ (function () { function class1() { this.prop1 = { doStuff: function (callback) { return function () { @@ -31,7 +31,7 @@ var class1 = (function () { } return class1; }()); -var class2 = (function () { +var class2 = /** @class */ (function () { function class2() { this.prop1 = { doStuff: function (callback) { return function () { diff --git a/tests/baselines/reference/noConstraintInReturnType1.js b/tests/baselines/reference/noConstraintInReturnType1.js index 03ce629c4460d..8d6902790d007 100644 --- a/tests/baselines/reference/noConstraintInReturnType1.js +++ b/tests/baselines/reference/noConstraintInReturnType1.js @@ -5,7 +5,7 @@ class List { //// [noConstraintInReturnType1.js] -var List = (function () { +var List = /** @class */ (function () { function List() { } List.empty = function () { return null; }; diff --git a/tests/baselines/reference/noEmitHelpers.js b/tests/baselines/reference/noEmitHelpers.js index b8dfcf7377e8f..961a037dbdde6 100644 --- a/tests/baselines/reference/noEmitHelpers.js +++ b/tests/baselines/reference/noEmitHelpers.js @@ -4,12 +4,12 @@ class B extends A { } //// [noEmitHelpers.js] -var A = (function () { +var A = /** @class */ (function () { function A() { } return A; }()); -var B = (function (_super) { +var B = /** @class */ (function (_super) { __extends(B, _super); function B() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/noEmitHelpers2.js b/tests/baselines/reference/noEmitHelpers2.js index 027f07cc0e89f..05756a86370ef 100644 --- a/tests/baselines/reference/noEmitHelpers2.js +++ b/tests/baselines/reference/noEmitHelpers2.js @@ -8,7 +8,7 @@ class A { } //// [noEmitHelpers2.js] -var A = (function () { +var A = /** @class */ (function () { function A(a, b) { } A = __decorate([ diff --git a/tests/baselines/reference/noErrorsInCallback.js b/tests/baselines/reference/noErrorsInCallback.js index 6a08cee12cfdf..a5eccbba2a80c 100644 --- a/tests/baselines/reference/noErrorsInCallback.js +++ b/tests/baselines/reference/noErrorsInCallback.js @@ -9,7 +9,7 @@ var one = new Bar({}); // Error //// [noErrorsInCallback.js] -var Bar = (function () { +var Bar = /** @class */ (function () { function Bar(foo) { this.foo = foo; } diff --git a/tests/baselines/reference/noImplicitAnyDestructuringInPrivateMethod.js b/tests/baselines/reference/noImplicitAnyDestructuringInPrivateMethod.js index 63788fd860ffe..9cb8d0d921520 100644 --- a/tests/baselines/reference/noImplicitAnyDestructuringInPrivateMethod.js +++ b/tests/baselines/reference/noImplicitAnyDestructuringInPrivateMethod.js @@ -14,7 +14,7 @@ export declare class Bar2 { //// [noImplicitAnyDestructuringInPrivateMethod.js] "use strict"; exports.__esModule = true; -var Bar = (function () { +var Bar = /** @class */ (function () { function Bar() { } Bar.prototype.bar = function (_a) { diff --git a/tests/baselines/reference/noImplicitAnyForMethodParameters.js b/tests/baselines/reference/noImplicitAnyForMethodParameters.js index ea868ee7503a2..63edff800dacb 100644 --- a/tests/baselines/reference/noImplicitAnyForMethodParameters.js +++ b/tests/baselines/reference/noImplicitAnyForMethodParameters.js @@ -15,13 +15,13 @@ class D { } //// [noImplicitAnyForMethodParameters.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } C.prototype.foo = function (a) { }; // OK - non-ambient class and private method - error return C; }()); -var D = (function () { +var D = /** @class */ (function () { function D() { } D.prototype.foo = function (a) { }; // OK - non-ambient class and public method - error diff --git a/tests/baselines/reference/noImplicitAnyMissingGetAccessor.js b/tests/baselines/reference/noImplicitAnyMissingGetAccessor.js index 12b6501e26acc..3aee7cfb11c06 100644 --- a/tests/baselines/reference/noImplicitAnyMissingGetAccessor.js +++ b/tests/baselines/reference/noImplicitAnyMissingGetAccessor.js @@ -22,12 +22,12 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var Parent = (function () { +var Parent = /** @class */ (function () { function Parent() { } return Parent; }()); -var Child = (function (_super) { +var Child = /** @class */ (function (_super) { __extends(Child, _super); function Child() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/noImplicitAnyMissingSetAccessor.js b/tests/baselines/reference/noImplicitAnyMissingSetAccessor.js index a5ef6bfc1f40a..b2a92d9bb57e2 100644 --- a/tests/baselines/reference/noImplicitAnyMissingSetAccessor.js +++ b/tests/baselines/reference/noImplicitAnyMissingSetAccessor.js @@ -21,12 +21,12 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var Parent = (function () { +var Parent = /** @class */ (function () { function Parent() { } return Parent; }()); -var Child = (function (_super) { +var Child = /** @class */ (function (_super) { __extends(Child, _super); function Child() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/noImplicitAnyParametersInClass.js b/tests/baselines/reference/noImplicitAnyParametersInClass.js index 648f93dccdc28..1cfccb39778ce 100644 --- a/tests/baselines/reference/noImplicitAnyParametersInClass.js +++ b/tests/baselines/reference/noImplicitAnyParametersInClass.js @@ -92,7 +92,7 @@ class C { } //// [noImplicitAnyParametersInClass.js] -var C = (function () { +var C = /** @class */ (function () { function C() { // No implicit-'any' errors. this.pub_f9 = function () { return ""; }; diff --git a/tests/baselines/reference/noImplicitReturnInConstructors.js b/tests/baselines/reference/noImplicitReturnInConstructors.js index f1c4c8caa608c..a91a647e65a52 100644 --- a/tests/baselines/reference/noImplicitReturnInConstructors.js +++ b/tests/baselines/reference/noImplicitReturnInConstructors.js @@ -6,7 +6,7 @@ class C { } //// [noImplicitReturnInConstructors.js] -var C = (function () { +var C = /** @class */ (function () { function C() { return; } diff --git a/tests/baselines/reference/noTypeArgumentOnReturnType1.js b/tests/baselines/reference/noTypeArgumentOnReturnType1.js index 7ede1e57c3e56..6149b1a58571b 100644 --- a/tests/baselines/reference/noTypeArgumentOnReturnType1.js +++ b/tests/baselines/reference/noTypeArgumentOnReturnType1.js @@ -7,7 +7,7 @@ class A{ } //// [noTypeArgumentOnReturnType1.js] -var A = (function () { +var A = /** @class */ (function () { function A() { } A.prototype.foo = function () { diff --git a/tests/baselines/reference/nonGenericClassExtendingGenericClassWithAny.js b/tests/baselines/reference/nonGenericClassExtendingGenericClassWithAny.js index c088787717c2d..aad9b19fa7350 100644 --- a/tests/baselines/reference/nonGenericClassExtendingGenericClassWithAny.js +++ b/tests/baselines/reference/nonGenericClassExtendingGenericClassWithAny.js @@ -16,12 +16,12 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var Foo = (function () { +var Foo = /** @class */ (function () { function Foo() { } return Foo; }()); -var Bar = (function (_super) { +var Bar = /** @class */ (function (_super) { __extends(Bar, _super); function Bar() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/nonGenericTypeReferenceWithTypeArguments.js b/tests/baselines/reference/nonGenericTypeReferenceWithTypeArguments.js index a1fa710d8932c..836f8866a4101 100644 --- a/tests/baselines/reference/nonGenericTypeReferenceWithTypeArguments.js +++ b/tests/baselines/reference/nonGenericTypeReferenceWithTypeArguments.js @@ -25,7 +25,7 @@ function f() { //// [nonGenericTypeReferenceWithTypeArguments.js] // Check that errors are reported for non-generic types with type arguments -var C = (function () { +var C = /** @class */ (function () { function C() { } return C; @@ -38,7 +38,7 @@ var v2; var v3; var v4; function f() { - var C = (function () { + var C = /** @class */ (function () { function C() { } return C; diff --git a/tests/baselines/reference/nonIdenticalTypeConstraints.js b/tests/baselines/reference/nonIdenticalTypeConstraints.js index 73748f63885fd..cc13064f16029 100644 --- a/tests/baselines/reference/nonIdenticalTypeConstraints.js +++ b/tests/baselines/reference/nonIdenticalTypeConstraints.js @@ -39,32 +39,32 @@ interface Quux { } //// [nonIdenticalTypeConstraints.js] -var Different = (function () { +var Different = /** @class */ (function () { function Different() { } return Different; }()); -var Foo = (function () { +var Foo = /** @class */ (function () { function Foo() { } return Foo; }()); -var Qux = (function () { +var Qux = /** @class */ (function () { function Qux() { } return Qux; }()); -var Bar = (function () { +var Bar = /** @class */ (function () { function Bar() { } return Bar; }()); -var Baz = (function () { +var Baz = /** @class */ (function () { function Baz() { } return Baz; }()); -var Quux = (function () { +var Quux = /** @class */ (function () { function Quux() { } return Quux; diff --git a/tests/baselines/reference/nonInstantiatedModule.js b/tests/baselines/reference/nonInstantiatedModule.js index f8063dd7b1414..8807c756a92f6 100644 --- a/tests/baselines/reference/nonInstantiatedModule.js +++ b/tests/baselines/reference/nonInstantiatedModule.js @@ -73,7 +73,7 @@ var p2; var p2; var M3; (function (M3) { - var Utils = (function () { + var Utils = /** @class */ (function () { function Utils() { } return Utils; diff --git a/tests/baselines/reference/nonMergedDeclarationsAndOverloads.js b/tests/baselines/reference/nonMergedDeclarationsAndOverloads.js index d4ac9685f6171..880b772ffe0dc 100644 --- a/tests/baselines/reference/nonMergedDeclarationsAndOverloads.js +++ b/tests/baselines/reference/nonMergedDeclarationsAndOverloads.js @@ -9,7 +9,7 @@ class A { } //// [nonMergedDeclarationsAndOverloads.js] -var A = (function () { +var A = /** @class */ (function () { function A() { } A.prototype.f = function () { }; diff --git a/tests/baselines/reference/nonPrimitiveNarrow.js b/tests/baselines/reference/nonPrimitiveNarrow.js index 607206eecfc5a..1f025ecf5a13b 100644 --- a/tests/baselines/reference/nonPrimitiveNarrow.js +++ b/tests/baselines/reference/nonPrimitiveNarrow.js @@ -24,7 +24,7 @@ if (typeof b === 'object') { //// [nonPrimitiveNarrow.js] -var Narrow = (function () { +var Narrow = /** @class */ (function () { function Narrow() { } return Narrow; diff --git a/tests/baselines/reference/null.js b/tests/baselines/reference/null.js index 2eb14e240bcf1..4de4e8a2b50c6 100644 --- a/tests/baselines/reference/null.js +++ b/tests/baselines/reference/null.js @@ -25,7 +25,7 @@ var w:I={x:null,y:3}; var x = null; var y = 3 + x; var z = 3 + null; -var C = (function () { +var C = /** @class */ (function () { function C() { } return C; diff --git a/tests/baselines/reference/nullAssignableToEveryType.js b/tests/baselines/reference/nullAssignableToEveryType.js index 7d8ddd7fd74a2..f04ae865692df 100644 --- a/tests/baselines/reference/nullAssignableToEveryType.js +++ b/tests/baselines/reference/nullAssignableToEveryType.js @@ -44,7 +44,7 @@ function foo(x: T, y: U, z: V) { //} //// [nullAssignableToEveryType.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } return C; diff --git a/tests/baselines/reference/nullIsSubtypeOfEverythingButUndefined.js b/tests/baselines/reference/nullIsSubtypeOfEverythingButUndefined.js index 905ea763d56bc..700d56f0fbe29 100644 --- a/tests/baselines/reference/nullIsSubtypeOfEverythingButUndefined.js +++ b/tests/baselines/reference/nullIsSubtypeOfEverythingButUndefined.js @@ -117,7 +117,7 @@ var r8b = true ? null : function (x) { return x; }; // type parameters not ident var i1; var r9 = true ? i1 : null; var r9 = true ? null : i1; -var C1 = (function () { +var C1 = /** @class */ (function () { function C1() { } return C1; @@ -125,7 +125,7 @@ var C1 = (function () { var c1; var r10 = true ? c1 : null; var r10 = true ? null : c1; -var C2 = (function () { +var C2 = /** @class */ (function () { function C2() { } return C2; @@ -148,7 +148,7 @@ function f() { } var af; var r15 = true ? af : null; var r15 = true ? null : af; -var c = (function () { +var c = /** @class */ (function () { function c() { } return c; diff --git a/tests/baselines/reference/numericClassMembers1.js b/tests/baselines/reference/numericClassMembers1.js index 244343071257d..58579b14cd30b 100644 --- a/tests/baselines/reference/numericClassMembers1.js +++ b/tests/baselines/reference/numericClassMembers1.js @@ -16,21 +16,21 @@ class C236 { //// [numericClassMembers1.js] -var C234 = (function () { +var C234 = /** @class */ (function () { function C234() { this[0] = 1; this[0.0] = 2; } return C234; }()); -var C235 = (function () { +var C235 = /** @class */ (function () { function C235() { this[0.0] = 1; this['0'] = 2; } return C235; }()); -var C236 = (function () { +var C236 = /** @class */ (function () { function C236() { this['0.0'] = 1; this['0'] = 2; diff --git a/tests/baselines/reference/numericIndexerConstrainsPropertyDeclarations.js b/tests/baselines/reference/numericIndexerConstrainsPropertyDeclarations.js index 33a03705965c5..28aada43f8e8c 100644 --- a/tests/baselines/reference/numericIndexerConstrainsPropertyDeclarations.js +++ b/tests/baselines/reference/numericIndexerConstrainsPropertyDeclarations.js @@ -99,7 +99,7 @@ var b: { [x: number]: string; } = { //// [numericIndexerConstrainsPropertyDeclarations.js] // String indexer types constrain the types of named properties in their containing type -var C = (function () { +var C = /** @class */ (function () { function C() { } // ok Object.defineProperty(C.prototype, "X", { diff --git a/tests/baselines/reference/numericIndexerConstrainsPropertyDeclarations2.js b/tests/baselines/reference/numericIndexerConstrainsPropertyDeclarations2.js index 9e501b5d92c3e..aa94b279c3314 100644 --- a/tests/baselines/reference/numericIndexerConstrainsPropertyDeclarations2.js +++ b/tests/baselines/reference/numericIndexerConstrainsPropertyDeclarations2.js @@ -57,13 +57,13 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var A = (function () { +var A = /** @class */ (function () { function A() { } A.prototype.foo = function () { return ''; }; return A; }()); -var B = (function (_super) { +var B = /** @class */ (function (_super) { __extends(B, _super); function B() { return _super !== null && _super.apply(this, arguments) || this; @@ -71,7 +71,7 @@ var B = (function (_super) { B.prototype.bar = function () { return ''; }; return B; }(A)); -var Foo = (function () { +var Foo = /** @class */ (function () { function Foo() { } return Foo; diff --git a/tests/baselines/reference/numericIndexerConstraint.js b/tests/baselines/reference/numericIndexerConstraint.js index 1b1851428e053..fc41c686ef8a4 100644 --- a/tests/baselines/reference/numericIndexerConstraint.js +++ b/tests/baselines/reference/numericIndexerConstraint.js @@ -5,7 +5,7 @@ class C { } //// [numericIndexerConstraint.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } return C; diff --git a/tests/baselines/reference/numericIndexerConstraint1.js b/tests/baselines/reference/numericIndexerConstraint1.js index 1065f7d9dc885..990540fdb361c 100644 --- a/tests/baselines/reference/numericIndexerConstraint1.js +++ b/tests/baselines/reference/numericIndexerConstraint1.js @@ -5,7 +5,7 @@ var result: Foo = x["one"]; // error //// [numericIndexerConstraint1.js] -var Foo = (function () { +var Foo = /** @class */ (function () { function Foo() { } Foo.prototype.foo = function () { }; diff --git a/tests/baselines/reference/numericIndexerConstraint2.js b/tests/baselines/reference/numericIndexerConstraint2.js index a8063a2548d60..2cdaabccd9b1c 100644 --- a/tests/baselines/reference/numericIndexerConstraint2.js +++ b/tests/baselines/reference/numericIndexerConstraint2.js @@ -5,7 +5,7 @@ var a: { one: number; }; x = a; //// [numericIndexerConstraint2.js] -var Foo = (function () { +var Foo = /** @class */ (function () { function Foo() { } Foo.prototype.foo = function () { }; diff --git a/tests/baselines/reference/numericIndexerConstraint3.js b/tests/baselines/reference/numericIndexerConstraint3.js index 9e733e593fd53..1b2e6b08c4765 100644 --- a/tests/baselines/reference/numericIndexerConstraint3.js +++ b/tests/baselines/reference/numericIndexerConstraint3.js @@ -23,19 +23,19 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var A = (function () { +var A = /** @class */ (function () { function A() { } return A; }()); -var B = (function (_super) { +var B = /** @class */ (function (_super) { __extends(B, _super); function B() { return _super !== null && _super.apply(this, arguments) || this; } return B; }(A)); -var C = (function () { +var C = /** @class */ (function () { function C() { } return C; diff --git a/tests/baselines/reference/numericIndexerConstraint4.js b/tests/baselines/reference/numericIndexerConstraint4.js index 4546db0b8a437..9e9a922e584f2 100644 --- a/tests/baselines/reference/numericIndexerConstraint4.js +++ b/tests/baselines/reference/numericIndexerConstraint4.js @@ -23,12 +23,12 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var A = (function () { +var A = /** @class */ (function () { function A() { } return A; }()); -var B = (function (_super) { +var B = /** @class */ (function (_super) { __extends(B, _super); function B() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/numericIndexerTyping2.js b/tests/baselines/reference/numericIndexerTyping2.js index 8bcc5ac61c447..3f21994bb6314 100644 --- a/tests/baselines/reference/numericIndexerTyping2.js +++ b/tests/baselines/reference/numericIndexerTyping2.js @@ -23,12 +23,12 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var I = (function () { +var I = /** @class */ (function () { function I() { } return I; }()); -var I2 = (function (_super) { +var I2 = /** @class */ (function (_super) { __extends(I2, _super); function I2() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/numericIndexingResults.js b/tests/baselines/reference/numericIndexingResults.js index 780bba3d498cb..0b133ed503920 100644 --- a/tests/baselines/reference/numericIndexingResults.js +++ b/tests/baselines/reference/numericIndexingResults.js @@ -57,7 +57,7 @@ var r5 = b2[2]; var r6 = b2[3]; //// [numericIndexingResults.js] -var C = (function () { +var C = /** @class */ (function () { function C() { this[1] = ''; this["2"] = ''; diff --git a/tests/baselines/reference/numericMethodName1.js b/tests/baselines/reference/numericMethodName1.js index 8f68d10cd376a..120f30597d31e 100644 --- a/tests/baselines/reference/numericMethodName1.js +++ b/tests/baselines/reference/numericMethodName1.js @@ -5,7 +5,7 @@ class C { //// [numericMethodName1.js] -var C = (function () { +var C = /** @class */ (function () { function C() { this[1] = 2; } diff --git a/tests/baselines/reference/numericNamedPropertyDuplicates.js b/tests/baselines/reference/numericNamedPropertyDuplicates.js index 6c8af32931851..e0b7ee348b53a 100644 --- a/tests/baselines/reference/numericNamedPropertyDuplicates.js +++ b/tests/baselines/reference/numericNamedPropertyDuplicates.js @@ -22,7 +22,7 @@ var b = { } //// [numericNamedPropertyDuplicates.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } return C; diff --git a/tests/baselines/reference/numericStringNamedPropertyEquivalence.js b/tests/baselines/reference/numericStringNamedPropertyEquivalence.js index a0f2268b98b81..0afe2dbdf5c70 100644 --- a/tests/baselines/reference/numericStringNamedPropertyEquivalence.js +++ b/tests/baselines/reference/numericStringNamedPropertyEquivalence.js @@ -26,7 +26,7 @@ var b = { //// [numericStringNamedPropertyEquivalence.js] // Each of these types has an error in it. // String named and numeric named properties conflict if they would be equivalent after ToNumber on the property name. -var C = (function () { +var C = /** @class */ (function () { function C() { } return C; diff --git a/tests/baselines/reference/objectCreationExpressionInFunctionParameter.js b/tests/baselines/reference/objectCreationExpressionInFunctionParameter.js index 76e36420acafe..5262a23504fe3 100644 --- a/tests/baselines/reference/objectCreationExpressionInFunctionParameter.js +++ b/tests/baselines/reference/objectCreationExpressionInFunctionParameter.js @@ -7,7 +7,7 @@ function foo(x = new A(123)) { //should error, 123 is not string }} //// [objectCreationExpressionInFunctionParameter.js] -var A = (function () { +var A = /** @class */ (function () { function A(a1) { this.a1 = a1; } diff --git a/tests/baselines/reference/objectCreationOfElementAccessExpression.js b/tests/baselines/reference/objectCreationOfElementAccessExpression.js index 72645662e01da..6af29d1c72c66 100644 --- a/tests/baselines/reference/objectCreationOfElementAccessExpression.js +++ b/tests/baselines/reference/objectCreationOfElementAccessExpression.js @@ -66,7 +66,7 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var Food = (function () { +var Food = /** @class */ (function () { function Food(name) { this.name = name; this.amount = 100; @@ -83,7 +83,7 @@ var Food = (function () { }; return Food; }()); -var MonsterFood = (function (_super) { +var MonsterFood = /** @class */ (function (_super) { __extends(MonsterFood, _super); function MonsterFood(name, flavor) { var _this = _super.call(this, name) || this; @@ -92,7 +92,7 @@ var MonsterFood = (function (_super) { } return MonsterFood; }(Food)); -var IceCream = (function (_super) { +var IceCream = /** @class */ (function (_super) { __extends(IceCream, _super); function IceCream(flavor) { var _this = _super.call(this, "Ice Cream", flavor) || this; @@ -101,7 +101,7 @@ var IceCream = (function (_super) { } return IceCream; }(MonsterFood)); -var Cookie = (function (_super) { +var Cookie = /** @class */ (function (_super) { __extends(Cookie, _super); function Cookie(flavor, isGlutenFree) { var _this = _super.call(this, "Cookie", flavor) || this; @@ -111,7 +111,7 @@ var Cookie = (function (_super) { } return Cookie; }(MonsterFood)); -var PetFood = (function (_super) { +var PetFood = /** @class */ (function (_super) { __extends(PetFood, _super); function PetFood(name, whereToBuy) { var _this = _super.call(this, name) || this; @@ -120,7 +120,7 @@ var PetFood = (function (_super) { } return PetFood; }(Food)); -var ExpensiveOrganicDogFood = (function (_super) { +var ExpensiveOrganicDogFood = /** @class */ (function (_super) { __extends(ExpensiveOrganicDogFood, _super); function ExpensiveOrganicDogFood(whereToBuy) { var _this = _super.call(this, "Origen", whereToBuy) || this; @@ -129,7 +129,7 @@ var ExpensiveOrganicDogFood = (function (_super) { } return ExpensiveOrganicDogFood; }(PetFood)); -var ExpensiveOrganicCatFood = (function (_super) { +var ExpensiveOrganicCatFood = /** @class */ (function (_super) { __extends(ExpensiveOrganicCatFood, _super); function ExpensiveOrganicCatFood(whereToBuy, containsFish) { var _this = _super.call(this, "Nature's Logic", whereToBuy) || this; @@ -139,7 +139,7 @@ var ExpensiveOrganicCatFood = (function (_super) { } return ExpensiveOrganicCatFood; }(PetFood)); -var Slug = (function () { +var Slug = /** @class */ (function () { function Slug() { } return Slug; diff --git a/tests/baselines/reference/objectFreeze.js b/tests/baselines/reference/objectFreeze.js index 4c37631bb1057..f75bcf67db781 100644 --- a/tests/baselines/reference/objectFreeze.js +++ b/tests/baselines/reference/objectFreeze.js @@ -16,7 +16,7 @@ o.b = o.a.toString(); //// [objectFreeze.js] var f = Object.freeze(function foo(a, b) { return false; }); f(1, "") === false; -var C = (function () { +var C = /** @class */ (function () { function C(a) { } return C; diff --git a/tests/baselines/reference/objectIndexer.js b/tests/baselines/reference/objectIndexer.js index c93172951e929..07c603e02b255 100644 --- a/tests/baselines/reference/objectIndexer.js +++ b/tests/baselines/reference/objectIndexer.js @@ -19,7 +19,7 @@ class Emitter { define(["require", "exports"], function (require, exports) { "use strict"; exports.__esModule = true; - var Emitter = (function () { + var Emitter = /** @class */ (function () { function Emitter() { this.listeners = {}; } diff --git a/tests/baselines/reference/objectLitArrayDeclNoNew.js b/tests/baselines/reference/objectLitArrayDeclNoNew.js index f4642a1d2f688..c724482d36426 100644 --- a/tests/baselines/reference/objectLitArrayDeclNoNew.js +++ b/tests/baselines/reference/objectLitArrayDeclNoNew.js @@ -31,7 +31,7 @@ module Test { "use strict"; var Test; (function (Test) { - var Gar = (function () { + var Gar = /** @class */ (function () { function Gar() { this.moo = 0; } diff --git a/tests/baselines/reference/objectLiteralDeclarationGeneration1.js b/tests/baselines/reference/objectLiteralDeclarationGeneration1.js index eacf9463abc9f..2cb6d48a5e6e4 100644 --- a/tests/baselines/reference/objectLiteralDeclarationGeneration1.js +++ b/tests/baselines/reference/objectLiteralDeclarationGeneration1.js @@ -2,7 +2,7 @@ class y{ } //// [objectLiteralDeclarationGeneration1.js] -var y = (function () { +var y = /** @class */ (function () { function y() { } return y; diff --git a/tests/baselines/reference/objectMembersOnTypes.js b/tests/baselines/reference/objectMembersOnTypes.js index 88a97feb0f720..2e717a3e2adc9 100644 --- a/tests/baselines/reference/objectMembersOnTypes.js +++ b/tests/baselines/reference/objectMembersOnTypes.js @@ -10,7 +10,7 @@ c.toString(); // used to be an error //// [objectMembersOnTypes.js] -var AAA = (function () { +var AAA = /** @class */ (function () { function AAA() { } return AAA; diff --git a/tests/baselines/reference/objectRestParameterES5.js b/tests/baselines/reference/objectRestParameterES5.js index d16a0c68df0de..7f81d6d736c1d 100644 --- a/tests/baselines/reference/objectRestParameterES5.js +++ b/tests/baselines/reference/objectRestParameterES5.js @@ -43,7 +43,7 @@ suddenly(function (_a) { var _b = _a.x, _c = _b.z, z = _c === void 0 ? 12 : _c, nested = __rest(_b, ["z"]), rest = __rest(_a, ["x"]); return rest.y + nested.ka; }); -var C = (function () { +var C = /** @class */ (function () { function C() { } C.prototype.m = function (_a) { diff --git a/tests/baselines/reference/objectSpread.js b/tests/baselines/reference/objectSpread.js index 2bc3b9e11bd8f..e05837c32d5b4 100644 --- a/tests/baselines/reference/objectSpread.js +++ b/tests/baselines/reference/objectSpread.js @@ -118,7 +118,7 @@ var spreadFunc = __assign({}, (function () { })); var anything; var spreadAny = __assign({}, anything); // methods are not enumerable -var C = (function () { +var C = /** @class */ (function () { function C() { this.p = 1; } diff --git a/tests/baselines/reference/objectSpreadNegative.js b/tests/baselines/reference/objectSpreadNegative.js index 0cc93692b595d..aab8ffc4e9105 100644 --- a/tests/baselines/reference/objectSpreadNegative.js +++ b/tests/baselines/reference/objectSpreadNegative.js @@ -95,12 +95,12 @@ var __assign = (this && this.__assign) || Object.assign || function(t) { }; var o = { a: 1, b: 'no' }; /// private propagates -var PrivateOptionalX = (function () { +var PrivateOptionalX = /** @class */ (function () { function PrivateOptionalX() { } return PrivateOptionalX; }()); -var PublicX = (function () { +var PublicX = /** @class */ (function () { function PublicX() { } return PublicX; @@ -137,7 +137,7 @@ spreadFunc(); // error, no call signature var setterOnly = __assign({ set b(bad) { } }); setterOnly.b = 12; // error, 'b' does not exist // methods are skipped because they aren't enumerable -var C = (function () { +var C = /** @class */ (function () { function C() { this.p = 1; } diff --git a/tests/baselines/reference/objectTypeHidingMembersOfExtendedObject.js b/tests/baselines/reference/objectTypeHidingMembersOfExtendedObject.js index 22a852e156c57..89bbe36a89741 100644 --- a/tests/baselines/reference/objectTypeHidingMembersOfExtendedObject.js +++ b/tests/baselines/reference/objectTypeHidingMembersOfExtendedObject.js @@ -65,19 +65,19 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var A = (function () { +var A = /** @class */ (function () { function A() { } return A; }()); -var B = (function (_super) { +var B = /** @class */ (function (_super) { __extends(B, _super); function B() { return _super !== null && _super.apply(this, arguments) || this; } return B; }(A)); -var C = (function () { +var C = /** @class */ (function () { function C() { } C.prototype.valueOf = function () { }; diff --git a/tests/baselines/reference/objectTypeHidingMembersOfObject.js b/tests/baselines/reference/objectTypeHidingMembersOfObject.js index bae6b56ff38b3..4523ae1c0b352 100644 --- a/tests/baselines/reference/objectTypeHidingMembersOfObject.js +++ b/tests/baselines/reference/objectTypeHidingMembersOfObject.js @@ -29,7 +29,7 @@ var r4: void = b.valueOf(); //// [objectTypeHidingMembersOfObject.js] // all of these valueOf calls should return the type shown in the overriding signatures here -var C = (function () { +var C = /** @class */ (function () { function C() { } C.prototype.valueOf = function () { }; diff --git a/tests/baselines/reference/objectTypeHidingMembersOfObjectAssignmentCompat.js b/tests/baselines/reference/objectTypeHidingMembersOfObjectAssignmentCompat.js index 65fc548ed6e6d..4c133db5a1856 100644 --- a/tests/baselines/reference/objectTypeHidingMembersOfObjectAssignmentCompat.js +++ b/tests/baselines/reference/objectTypeHidingMembersOfObjectAssignmentCompat.js @@ -26,7 +26,7 @@ var i; var o; o = i; // error i = o; // ok -var C = (function () { +var C = /** @class */ (function () { function C() { } C.prototype.toString = function () { }; diff --git a/tests/baselines/reference/objectTypeHidingMembersOfObjectAssignmentCompat2.js b/tests/baselines/reference/objectTypeHidingMembersOfObjectAssignmentCompat2.js index 6898e69cedc03..2fd42a20dc616 100644 --- a/tests/baselines/reference/objectTypeHidingMembersOfObjectAssignmentCompat2.js +++ b/tests/baselines/reference/objectTypeHidingMembersOfObjectAssignmentCompat2.js @@ -26,7 +26,7 @@ var i; var o; o = i; // error i = o; // error -var C = (function () { +var C = /** @class */ (function () { function C() { } C.prototype.toString = function () { return 1; }; diff --git a/tests/baselines/reference/objectTypePropertyAccess.js b/tests/baselines/reference/objectTypePropertyAccess.js index d7856f2a9783c..3693697dea2ea 100644 --- a/tests/baselines/reference/objectTypePropertyAccess.js +++ b/tests/baselines/reference/objectTypePropertyAccess.js @@ -31,7 +31,7 @@ var r11 = a['foo']; //// [objectTypePropertyAccess.js] // Index notation should resolve to the type of a declared property with that same name -var C = (function () { +var C = /** @class */ (function () { function C() { } return C; diff --git a/tests/baselines/reference/objectTypeWithDuplicateNumericProperty.js b/tests/baselines/reference/objectTypeWithDuplicateNumericProperty.js index f3bc471f973b1..b530110e16099 100644 --- a/tests/baselines/reference/objectTypeWithDuplicateNumericProperty.js +++ b/tests/baselines/reference/objectTypeWithDuplicateNumericProperty.js @@ -35,7 +35,7 @@ var b = { //// [objectTypeWithDuplicateNumericProperty.js] // numeric properties must be distinct after a ToNumber operation // so the below are all errors -var C = (function () { +var C = /** @class */ (function () { function C() { } return C; diff --git a/tests/baselines/reference/objectTypeWithNumericProperty.js b/tests/baselines/reference/objectTypeWithNumericProperty.js index 0001bc40f2f33..873365ab33bf9 100644 --- a/tests/baselines/reference/objectTypeWithNumericProperty.js +++ b/tests/baselines/reference/objectTypeWithNumericProperty.js @@ -45,7 +45,7 @@ var r4 = b['1.1']; //// [objectTypeWithNumericProperty.js] // no errors here -var C = (function () { +var C = /** @class */ (function () { function C() { } return C; diff --git a/tests/baselines/reference/objectTypeWithRecursiveWrappedProperty.js b/tests/baselines/reference/objectTypeWithRecursiveWrappedProperty.js index 09dbc24b5b57f..63f1a2c69e299 100644 --- a/tests/baselines/reference/objectTypeWithRecursiveWrappedProperty.js +++ b/tests/baselines/reference/objectTypeWithRecursiveWrappedProperty.js @@ -15,7 +15,7 @@ list1 = list3; // error //// [objectTypeWithRecursiveWrappedProperty.js] // Basic recursive type -var List = (function () { +var List = /** @class */ (function () { function List() { } return List; diff --git a/tests/baselines/reference/objectTypeWithRecursiveWrappedProperty2.js b/tests/baselines/reference/objectTypeWithRecursiveWrappedProperty2.js index 0f4451f28cf94..4a5f4a54ac80f 100644 --- a/tests/baselines/reference/objectTypeWithRecursiveWrappedProperty2.js +++ b/tests/baselines/reference/objectTypeWithRecursiveWrappedProperty2.js @@ -15,7 +15,7 @@ list1 = list3; // error //// [objectTypeWithRecursiveWrappedProperty2.js] // Basic recursive type -var List = (function () { +var List = /** @class */ (function () { function List() { } return List; diff --git a/tests/baselines/reference/objectTypeWithRecursiveWrappedPropertyCheckedNominally.js b/tests/baselines/reference/objectTypeWithRecursiveWrappedPropertyCheckedNominally.js index 5aec3feb442e0..f6a4b1a5ac633 100644 --- a/tests/baselines/reference/objectTypeWithRecursiveWrappedPropertyCheckedNominally.js +++ b/tests/baselines/reference/objectTypeWithRecursiveWrappedPropertyCheckedNominally.js @@ -54,12 +54,12 @@ function foo2>(t: T, u: U) { //// [objectTypeWithRecursiveWrappedPropertyCheckedNominally.js] // Types with infinitely expanding recursive types are type checked nominally -var List = (function () { +var List = /** @class */ (function () { function List() { } return List; }()); -var MyList = (function () { +var MyList = /** @class */ (function () { function MyList() { } return MyList; diff --git a/tests/baselines/reference/objectTypeWithStringIndexerHidingObjectIndexer.js b/tests/baselines/reference/objectTypeWithStringIndexerHidingObjectIndexer.js index 7aa60382c6e19..d2f84c483afd6 100644 --- a/tests/baselines/reference/objectTypeWithStringIndexerHidingObjectIndexer.js +++ b/tests/baselines/reference/objectTypeWithStringIndexerHidingObjectIndexer.js @@ -36,7 +36,7 @@ var r4: string = o2['']; // no errors expected below var o = {}; var r = o['']; // should be Object -var C = (function () { +var C = /** @class */ (function () { function C() { } return C; diff --git a/tests/baselines/reference/objectTypeWithStringNamedNumericProperty.js b/tests/baselines/reference/objectTypeWithStringNamedNumericProperty.js index ac227a091c775..f5ac9f9821a4b 100644 --- a/tests/baselines/reference/objectTypeWithStringNamedNumericProperty.js +++ b/tests/baselines/reference/objectTypeWithStringNamedNumericProperty.js @@ -130,7 +130,7 @@ var r13 = i[-01] // string named numeric properties are legal and distinct when indexed by string values // indexed numerically the value is converted to a number // no errors expected below -var C = (function () { +var C = /** @class */ (function () { function C() { } return C; diff --git a/tests/baselines/reference/objectTypeWithStringNamedPropertyOfIllegalCharacters.js b/tests/baselines/reference/objectTypeWithStringNamedPropertyOfIllegalCharacters.js index 7188c12a9eea7..ef875e32b555a 100644 --- a/tests/baselines/reference/objectTypeWithStringNamedPropertyOfIllegalCharacters.js +++ b/tests/baselines/reference/objectTypeWithStringNamedPropertyOfIllegalCharacters.js @@ -54,7 +54,7 @@ var r4 = b["~!@#$%^&*()_+{}|:'<>?\/.,`"]; //// [objectTypeWithStringNamedPropertyOfIllegalCharacters.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } return C; diff --git a/tests/baselines/reference/objectTypesIdentity.js b/tests/baselines/reference/objectTypesIdentity.js index c357986fd8944..fe2e4568bd9c0 100644 --- a/tests/baselines/reference/objectTypesIdentity.js +++ b/tests/baselines/reference/objectTypesIdentity.js @@ -90,17 +90,17 @@ function foo14(x: any) { } //// [objectTypesIdentity.js] // object types are identical structurally -var A = (function () { +var A = /** @class */ (function () { function A() { } return A; }()); -var B = (function () { +var B = /** @class */ (function () { function B() { } return B; }()); -var C = (function () { +var C = /** @class */ (function () { function C() { } return C; diff --git a/tests/baselines/reference/objectTypesIdentity2.js b/tests/baselines/reference/objectTypesIdentity2.js index b33485564eef5..125b8a4641fd7 100644 --- a/tests/baselines/reference/objectTypesIdentity2.js +++ b/tests/baselines/reference/objectTypesIdentity2.js @@ -67,17 +67,17 @@ function foo14(x: any) { } //// [objectTypesIdentity2.js] // object types are identical structurally -var A = (function () { +var A = /** @class */ (function () { function A() { } return A; }()); -var B = (function () { +var B = /** @class */ (function () { function B() { } return B; }()); -var C = (function () { +var C = /** @class */ (function () { function C() { } return C; diff --git a/tests/baselines/reference/objectTypesIdentityWithCallSignatures.js b/tests/baselines/reference/objectTypesIdentityWithCallSignatures.js index a3e1e4fa4444c..fa37ad6f18807 100644 --- a/tests/baselines/reference/objectTypesIdentityWithCallSignatures.js +++ b/tests/baselines/reference/objectTypesIdentityWithCallSignatures.js @@ -102,19 +102,19 @@ function foo15(x: any) { } //// [objectTypesIdentityWithCallSignatures.js] // object types are identical structurally -var A = (function () { +var A = /** @class */ (function () { function A() { } A.prototype.foo = function (x) { return null; }; return A; }()); -var B = (function () { +var B = /** @class */ (function () { function B() { } B.prototype.foo = function (x) { return null; }; return B; }()); -var C = (function () { +var C = /** @class */ (function () { function C() { } C.prototype.foo = function (x) { return null; }; diff --git a/tests/baselines/reference/objectTypesIdentityWithCallSignatures2.js b/tests/baselines/reference/objectTypesIdentityWithCallSignatures2.js index 3b6956435f9b4..735b5356bdaa4 100644 --- a/tests/baselines/reference/objectTypesIdentityWithCallSignatures2.js +++ b/tests/baselines/reference/objectTypesIdentityWithCallSignatures2.js @@ -102,19 +102,19 @@ function foo15(x: any) { } //// [objectTypesIdentityWithCallSignatures2.js] // object types are identical structurally -var A = (function () { +var A = /** @class */ (function () { function A() { } A.prototype.foo = function (x) { return null; }; return A; }()); -var B = (function () { +var B = /** @class */ (function () { function B() { } B.prototype.foo = function (x) { return null; }; return B; }()); -var C = (function () { +var C = /** @class */ (function () { function C() { } C.prototype.foo = function (x) { return null; }; diff --git a/tests/baselines/reference/objectTypesIdentityWithCallSignaturesDifferingParamCounts.js b/tests/baselines/reference/objectTypesIdentityWithCallSignaturesDifferingParamCounts.js index a9909c7283ff8..92007e2d5a7b5 100644 --- a/tests/baselines/reference/objectTypesIdentityWithCallSignaturesDifferingParamCounts.js +++ b/tests/baselines/reference/objectTypesIdentityWithCallSignaturesDifferingParamCounts.js @@ -102,19 +102,19 @@ function foo15(x: any) { } //// [objectTypesIdentityWithCallSignaturesDifferingParamCounts.js] // object types are identical structurally -var A = (function () { +var A = /** @class */ (function () { function A() { } A.prototype.foo = function (x) { return null; }; return A; }()); -var B = (function () { +var B = /** @class */ (function () { function B() { } B.prototype.foo = function (x, y) { return null; }; return B; }()); -var C = (function () { +var C = /** @class */ (function () { function C() { } C.prototype.foo = function (x, y) { return null; }; diff --git a/tests/baselines/reference/objectTypesIdentityWithCallSignaturesWithOverloads.js b/tests/baselines/reference/objectTypesIdentityWithCallSignaturesWithOverloads.js index 3f72347a00f47..3f133f66f9098 100644 --- a/tests/baselines/reference/objectTypesIdentityWithCallSignaturesWithOverloads.js +++ b/tests/baselines/reference/objectTypesIdentityWithCallSignaturesWithOverloads.js @@ -118,19 +118,19 @@ function foo15(x: any) { } //// [objectTypesIdentityWithCallSignaturesWithOverloads.js] // object types are identical structurally -var A = (function () { +var A = /** @class */ (function () { function A() { } A.prototype.foo = function (x) { return null; }; return A; }()); -var B = (function () { +var B = /** @class */ (function () { function B() { } B.prototype.foo = function (x) { return null; }; return B; }()); -var C = (function () { +var C = /** @class */ (function () { function C() { } C.prototype.foo = function (x) { return null; }; diff --git a/tests/baselines/reference/objectTypesIdentityWithConstructSignatures.js b/tests/baselines/reference/objectTypesIdentityWithConstructSignatures.js index 9acf62da71cc9..e48bf65f38b43 100644 --- a/tests/baselines/reference/objectTypesIdentityWithConstructSignatures.js +++ b/tests/baselines/reference/objectTypesIdentityWithConstructSignatures.js @@ -89,17 +89,17 @@ function foo15(x: any) { } //// [objectTypesIdentityWithConstructSignatures.js] // object types are identical structurally -var A = (function () { +var A = /** @class */ (function () { function A(x) { } return A; }()); -var B = (function () { +var B = /** @class */ (function () { function B(x) { } return B; }()); -var C = (function () { +var C = /** @class */ (function () { function C(x) { } return C; diff --git a/tests/baselines/reference/objectTypesIdentityWithConstructSignatures2.js b/tests/baselines/reference/objectTypesIdentityWithConstructSignatures2.js index 0a422dbda6f0f..c92f362d2a7d4 100644 --- a/tests/baselines/reference/objectTypesIdentityWithConstructSignatures2.js +++ b/tests/baselines/reference/objectTypesIdentityWithConstructSignatures2.js @@ -78,13 +78,13 @@ function foo15(x: any) { } //// [objectTypesIdentityWithConstructSignatures2.js] // object types are identical structurally -var B = (function () { +var B = /** @class */ (function () { function B(x) { return null; } return B; }()); -var C = (function () { +var C = /** @class */ (function () { function C(x) { return null; } diff --git a/tests/baselines/reference/objectTypesIdentityWithConstructSignaturesDifferingParamCounts.js b/tests/baselines/reference/objectTypesIdentityWithConstructSignaturesDifferingParamCounts.js index 5fa148b541d45..e2a52a94ba7ca 100644 --- a/tests/baselines/reference/objectTypesIdentityWithConstructSignaturesDifferingParamCounts.js +++ b/tests/baselines/reference/objectTypesIdentityWithConstructSignaturesDifferingParamCounts.js @@ -78,13 +78,13 @@ function foo15(x: any) { } //// [objectTypesIdentityWithConstructSignaturesDifferingParamCounts.js] // object types are identical structurally -var B = (function () { +var B = /** @class */ (function () { function B(x, y) { return null; } return B; }()); -var C = (function () { +var C = /** @class */ (function () { function C(x, y) { return null; } diff --git a/tests/baselines/reference/objectTypesIdentityWithGenericCallSignatures.js b/tests/baselines/reference/objectTypesIdentityWithGenericCallSignatures.js index 2289665621c92..4d4b3029265d5 100644 --- a/tests/baselines/reference/objectTypesIdentityWithGenericCallSignatures.js +++ b/tests/baselines/reference/objectTypesIdentityWithGenericCallSignatures.js @@ -102,19 +102,19 @@ function foo15(x: any) { } //// [objectTypesIdentityWithGenericCallSignatures.js] // object types are identical structurally -var A = (function () { +var A = /** @class */ (function () { function A() { } A.prototype.foo = function (x) { return null; }; return A; }()); -var B = (function () { +var B = /** @class */ (function () { function B() { } B.prototype.foo = function (x) { return null; }; return B; }()); -var C = (function () { +var C = /** @class */ (function () { function C() { } C.prototype.foo = function (x) { return null; }; diff --git a/tests/baselines/reference/objectTypesIdentityWithGenericCallSignatures2.js b/tests/baselines/reference/objectTypesIdentityWithGenericCallSignatures2.js index d6a61b8d304a8..9af9db52f7c30 100644 --- a/tests/baselines/reference/objectTypesIdentityWithGenericCallSignatures2.js +++ b/tests/baselines/reference/objectTypesIdentityWithGenericCallSignatures2.js @@ -102,19 +102,19 @@ function foo15(x: any) { } //// [objectTypesIdentityWithGenericCallSignatures2.js] // object types are identical structurally -var A = (function () { +var A = /** @class */ (function () { function A() { } A.prototype.foo = function (x, y) { return null; }; return A; }()); -var B = (function () { +var B = /** @class */ (function () { function B() { } B.prototype.foo = function (x, y) { return null; }; return B; }()); -var C = (function () { +var C = /** @class */ (function () { function C() { } C.prototype.foo = function (x, y) { return null; }; diff --git a/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.js b/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.js index a1b383a70e309..0abb156665331 100644 --- a/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.js +++ b/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.js @@ -106,19 +106,19 @@ function foo15(x: any) { } // Two call or construct signatures are considered identical when they have the same number of type parameters and, considering those // parameters pairwise identical, have identical type parameter constraints, identical number of parameters with identical kind(required, // optional or rest) and types, and identical return types. -var A = (function () { +var A = /** @class */ (function () { function A() { } A.prototype.foo = function (x) { return null; }; return A; }()); -var B = (function () { +var B = /** @class */ (function () { function B() { } B.prototype.foo = function (x) { return null; }; return B; }()); -var C = (function () { +var C = /** @class */ (function () { function C() { } C.prototype.foo = function (x) { return null; }; diff --git a/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.js b/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.js index fbcba9d121e12..cf6e355daaa92 100644 --- a/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.js +++ b/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.js @@ -118,25 +118,25 @@ function foo15(x: any) { } // Two call or construct signatures are considered identical when they have the same number of type parameters and, considering those // parameters pairwise identical, have identical type parameter constraints, identical number of parameters with identical kind(required, // optional or rest) and types, and identical return types. -var A = (function () { +var A = /** @class */ (function () { function A() { } A.prototype.foo = function (x, y) { return null; }; return A; }()); -var B = (function () { +var B = /** @class */ (function () { function B() { } B.prototype.foo = function (x, y) { return null; }; return B; }()); -var C = (function () { +var C = /** @class */ (function () { function C() { } C.prototype.foo = function (x, y) { return null; }; return C; }()); -var D = (function () { +var D = /** @class */ (function () { function D() { } D.prototype.foo = function (x, y) { return null; }; diff --git a/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.js b/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.js index 48131af3212f3..3b6d3831e44d5 100644 --- a/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.js +++ b/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.js @@ -127,35 +127,35 @@ function foo15(x: any) { } // Two call or construct signatures are considered identical when they have the same number of type parameters and, considering those // parameters pairwise identical, have identical type parameter constraints, identical number of parameters with identical kind(required, // optional or rest) and types, and identical return types. -var One = (function () { +var One = /** @class */ (function () { function One() { } return One; }()); -var Two = (function () { +var Two = /** @class */ (function () { function Two() { } return Two; }()); -var A = (function () { +var A = /** @class */ (function () { function A() { } A.prototype.foo = function (x, y) { return null; }; return A; }()); -var B = (function () { +var B = /** @class */ (function () { function B() { } B.prototype.foo = function (x, y) { return null; }; return B; }()); -var C = (function () { +var C = /** @class */ (function () { function C() { } C.prototype.foo = function (x, y) { return null; }; return C; }()); -var D = (function () { +var D = /** @class */ (function () { function D() { } D.prototype.foo = function (x, y) { return null; }; diff --git a/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.js b/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.js index 43147c28f55a6..3461c8fa6ecb3 100644 --- a/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.js +++ b/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.js @@ -106,19 +106,19 @@ function foo15(x: any) { } // Two call or construct signatures are considered identical when they have the same number of type parameters and, considering those // parameters pairwise identical, have identical type parameter constraints, identical number of parameters with identical kind(required, // optional or rest) and types, and identical return types. -var A = (function () { +var A = /** @class */ (function () { function A() { } A.prototype.foo = function (x) { return null; }; return A; }()); -var B = (function () { +var B = /** @class */ (function () { function B() { } B.prototype.foo = function (x) { return null; }; return B; }()); -var C = (function () { +var C = /** @class */ (function () { function C() { } C.prototype.foo = function (x) { return null; }; diff --git a/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.js b/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.js index c3758bc6c08e5..c4ad3485e9ccb 100644 --- a/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.js +++ b/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.js @@ -106,19 +106,19 @@ function foo15(x: any) { } // Two call or construct signatures are considered identical when they have the same number of type parameters and, considering those // parameters pairwise identical, have identical type parameter constraints, identical number of parameters with identical kind(required, // optional or rest) and types, and identical return types. -var A = (function () { +var A = /** @class */ (function () { function A() { } A.prototype.foo = function (x) { return null; }; return A; }()); -var B = (function () { +var B = /** @class */ (function () { function B() { } B.prototype.foo = function (x) { return null; }; return B; }()); -var C = (function () { +var C = /** @class */ (function () { function C() { } C.prototype.foo = function (x) { return null; }; diff --git a/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.js b/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.js index de6a4724cd707..bf75c89649508 100644 --- a/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.js +++ b/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.js @@ -102,19 +102,19 @@ function foo15(x: any) { } //// [objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.js] // object types are identical structurally -var A = (function () { +var A = /** @class */ (function () { function A() { } A.prototype.foo = function (x) { return null; }; return A; }()); -var B = (function () { +var B = /** @class */ (function () { function B() { } B.prototype.foo = function (x) { return null; }; return B; }()); -var C = (function () { +var C = /** @class */ (function () { function C() { } C.prototype.foo = function (x) { return null; }; diff --git a/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.js b/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.js index c27f7095d16d2..6562667d03e0f 100644 --- a/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.js +++ b/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.js @@ -102,19 +102,19 @@ function foo15(x: any) { } //// [objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.js] // object types are identical structurally -var A = (function () { +var A = /** @class */ (function () { function A() { } A.prototype.foo = function (x) { return null; }; return A; }()); -var B = (function () { +var B = /** @class */ (function () { function B() { } B.prototype.foo = function (x) { return null; }; return B; }()); -var C = (function () { +var C = /** @class */ (function () { function C() { } C.prototype.foo = function (x) { return null; }; diff --git a/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesOptionalParams.js b/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesOptionalParams.js index 327cc15eddbd7..f14f84cba2887 100644 --- a/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesOptionalParams.js +++ b/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesOptionalParams.js @@ -106,19 +106,19 @@ function foo15(x: any) { } // Two call or construct signatures are considered identical when they have the same number of type parameters and, considering those // parameters pairwise identical, have identical type parameter constraints, identical number of parameters with identical kind(required, // optional or rest) and types, and identical return types. -var A = (function () { +var A = /** @class */ (function () { function A() { } A.prototype.foo = function (x, y) { return null; }; return A; }()); -var B = (function () { +var B = /** @class */ (function () { function B() { } B.prototype.foo = function (x, y) { return null; }; return B; }()); -var C = (function () { +var C = /** @class */ (function () { function C() { } C.prototype.foo = function (x, y) { return null; }; diff --git a/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesOptionalParams2.js b/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesOptionalParams2.js index 753548bc360e7..9c15376e8bba9 100644 --- a/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesOptionalParams2.js +++ b/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesOptionalParams2.js @@ -106,19 +106,19 @@ function foo15(x: any) { } // Two call or construct signatures are considered identical when they have the same number of type parameters and, considering those // parameters pairwise identical, have identical type parameter constraints, identical number of parameters with identical kind(required, // optional or rest) and types, and identical return types. -var A = (function () { +var A = /** @class */ (function () { function A() { } A.prototype.foo = function (x, y) { return null; }; return A; }()); -var B = (function () { +var B = /** @class */ (function () { function B() { } B.prototype.foo = function (x, y) { return null; }; return B; }()); -var C = (function () { +var C = /** @class */ (function () { function C() { } C.prototype.foo = function (x, y) { return null; }; diff --git a/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesOptionalParams3.js b/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesOptionalParams3.js index da4bb20591bf9..73ce774acece3 100644 --- a/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesOptionalParams3.js +++ b/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesOptionalParams3.js @@ -106,19 +106,19 @@ function foo15(x: any) { } // Two call or construct signatures are considered identical when they have the same number of type parameters and, considering those // parameters pairwise identical, have identical type parameter constraints, identical number of parameters with identical kind(required, // optional or rest) and types, and identical return types. -var A = (function () { +var A = /** @class */ (function () { function A() { } A.prototype.foo = function (x, y) { return null; }; return A; }()); -var B = (function () { +var B = /** @class */ (function () { function B() { } B.prototype.foo = function (x, y) { return null; }; return B; }()); -var C = (function () { +var C = /** @class */ (function () { function C() { } C.prototype.foo = function (x, y) { return null; }; diff --git a/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.js b/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.js index 6a66e8bbda3b9..508176cff649f 100644 --- a/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.js +++ b/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.js @@ -79,13 +79,13 @@ function foo14(x: any) { } // Two call or construct signatures are considered identical when they have the same number of type parameters and, considering those // parameters pairwise identical, have identical type parameter constraints, identical number of parameters with identical kind(required, // optional or rest) and types, and identical return types. -var B = (function () { +var B = /** @class */ (function () { function B(x) { return null; } return B; }()); -var C = (function () { +var C = /** @class */ (function () { function C(x) { return null; } diff --git a/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.js b/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.js index e19837a9f7f2c..f8bd1c88a6fdc 100644 --- a/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.js +++ b/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.js @@ -90,19 +90,19 @@ function foo14(x: any) { } // Two call or construct signatures are considered identical when they have the same number of type parameters and, considering those // parameters pairwise identical, have identical type parameter constraints, identical number of parameters with identical kind(required, // optional or rest) and types, and identical return types. -var B = (function () { +var B = /** @class */ (function () { function B(x, y) { return null; } return B; }()); -var C = (function () { +var C = /** @class */ (function () { function C(x, y) { return null; } return C; }()); -var D = (function () { +var D = /** @class */ (function () { function D(x, y) { return null; } diff --git a/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.js b/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.js index 735c5bdc2d69c..511e85056ec1f 100644 --- a/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.js +++ b/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.js @@ -99,29 +99,29 @@ function foo14(x: any) { } // Two call or construct signatures are considered identical when they have the same number of type parameters and, considering those // parameters pairwise identical, have identical type parameter constraints, identical number of parameters with identical kind(required, // optional or rest) and types, and identical return types. -var One = (function () { +var One = /** @class */ (function () { function One() { } return One; }()); -var Two = (function () { +var Two = /** @class */ (function () { function Two() { } return Two; }()); -var B = (function () { +var B = /** @class */ (function () { function B(x, y) { return null; } return B; }()); -var C = (function () { +var C = /** @class */ (function () { function C(x, y) { return null; } return C; }()); -var D = (function () { +var D = /** @class */ (function () { function D(x, y) { return null; } diff --git a/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.js b/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.js index 6eab84a49ddb4..f077afc2c588e 100644 --- a/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.js +++ b/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.js @@ -86,13 +86,13 @@ function foo15(x: any) { } // Two call or construct signatures are considered identical when they have the same number of type parameters and, considering those // parameters pairwise identical, have identical type parameter constraints, identical number of parameters with identical kind(required, // optional or rest) and types, and identical return types. -var B = (function () { +var B = /** @class */ (function () { function B(x) { return null; } return B; }()); -var C = (function () { +var C = /** @class */ (function () { function C(x) { return null; } diff --git a/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.js b/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.js index d927a8e082a22..062c487959fec 100644 --- a/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.js +++ b/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.js @@ -82,13 +82,13 @@ function foo15(x: any) { } // Two call or construct signatures are considered identical when they have the same number of type parameters and, considering those // parameters pairwise identical, have identical type parameter constraints, identical number of parameters with identical kind(required, // optional or rest) and types, and identical return types. -var B = (function () { +var B = /** @class */ (function () { function B(x) { return null; } return B; }()); -var C = (function () { +var C = /** @class */ (function () { function C(x) { return null; } diff --git a/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.js b/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.js index 512bebb3b0e8d..8f3f218a87d92 100644 --- a/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.js +++ b/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.js @@ -74,13 +74,13 @@ function foo14(x: any) { } //// [objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.js] // object types are identical structurally -var B = (function () { +var B = /** @class */ (function () { function B(x) { return null; } return B; }()); -var C = (function () { +var C = /** @class */ (function () { function C(x) { return null; } diff --git a/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.js b/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.js index 80cfcd23ec9c3..28ea1623e260e 100644 --- a/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.js +++ b/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.js @@ -74,13 +74,13 @@ function foo14(x: any) { } //// [objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.js] // object types are identical structurally -var B = (function () { +var B = /** @class */ (function () { function B(x) { return null; } return B; }()); -var C = (function () { +var C = /** @class */ (function () { function C(x) { return null; } diff --git a/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesOptionalParams.js b/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesOptionalParams.js index 87cb0b33531e5..532f16e92a66f 100644 --- a/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesOptionalParams.js +++ b/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesOptionalParams.js @@ -78,13 +78,13 @@ function foo14(x: any) { } // Two call or construct signatures are considered identical when they have the same number of type parameters and, considering those // parameters pairwise identical, have identical type parameter constraints, identical number of parameters with identical kind(required, // optional or rest) and types, and identical return types. -var B = (function () { +var B = /** @class */ (function () { function B(x, y) { return null; } return B; }()); -var C = (function () { +var C = /** @class */ (function () { function C(x, y) { return null; } diff --git a/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.js b/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.js index 6b0e91f817ff9..f13c92fb10a23 100644 --- a/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.js +++ b/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.js @@ -78,13 +78,13 @@ function foo14(x: any) { } // Two call or construct signatures are considered identical when they have the same number of type parameters and, considering those // parameters pairwise identical, have identical type parameter constraints, identical number of parameters with identical kind(required, // optional or rest) and types, and identical return types. -var B = (function () { +var B = /** @class */ (function () { function B(x, y) { return null; } return B; }()); -var C = (function () { +var C = /** @class */ (function () { function C(x, y) { return null; } diff --git a/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.js b/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.js index 55f2a0217e934..fa53cbf878a9e 100644 --- a/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.js +++ b/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.js @@ -78,13 +78,13 @@ function foo14(x: any) { } // Two call or construct signatures are considered identical when they have the same number of type parameters and, considering those // parameters pairwise identical, have identical type parameter constraints, identical number of parameters with identical kind(required, // optional or rest) and types, and identical return types. -var B = (function () { +var B = /** @class */ (function () { function B(x, y) { return null; } return B; }()); -var C = (function () { +var C = /** @class */ (function () { function C(x, y) { return null; } diff --git a/tests/baselines/reference/objectTypesIdentityWithNumericIndexers1.js b/tests/baselines/reference/objectTypesIdentityWithNumericIndexers1.js index d7db8d271bd6d..d3f6a46cb037f 100644 --- a/tests/baselines/reference/objectTypesIdentityWithNumericIndexers1.js +++ b/tests/baselines/reference/objectTypesIdentityWithNumericIndexers1.js @@ -134,29 +134,29 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var A = (function () { +var A = /** @class */ (function () { function A() { } return A; }()); -var B = (function () { +var B = /** @class */ (function () { function B() { } return B; }()); -var C = (function () { +var C = /** @class */ (function () { function C() { } return C; }()); -var PA = (function (_super) { +var PA = /** @class */ (function (_super) { __extends(PA, _super); function PA() { return _super !== null && _super.apply(this, arguments) || this; } return PA; }(A)); -var PB = (function (_super) { +var PB = /** @class */ (function (_super) { __extends(PB, _super); function PB() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/objectTypesIdentityWithNumericIndexers2.js b/tests/baselines/reference/objectTypesIdentityWithNumericIndexers2.js index 6af5cb75146c5..4860afdecd355 100644 --- a/tests/baselines/reference/objectTypesIdentityWithNumericIndexers2.js +++ b/tests/baselines/reference/objectTypesIdentityWithNumericIndexers2.js @@ -137,41 +137,41 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var Base = (function () { +var Base = /** @class */ (function () { function Base() { } return Base; }()); -var Derived = (function (_super) { +var Derived = /** @class */ (function (_super) { __extends(Derived, _super); function Derived() { return _super !== null && _super.apply(this, arguments) || this; } return Derived; }(Base)); -var A = (function () { +var A = /** @class */ (function () { function A() { } return A; }()); -var B = (function () { +var B = /** @class */ (function () { function B() { } return B; }()); -var C = (function () { +var C = /** @class */ (function () { function C() { } return C; }()); -var PA = (function (_super) { +var PA = /** @class */ (function (_super) { __extends(PA, _super); function PA() { return _super !== null && _super.apply(this, arguments) || this; } return PA; }(A)); -var PB = (function (_super) { +var PB = /** @class */ (function (_super) { __extends(PB, _super); function PB() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/objectTypesIdentityWithNumericIndexers3.js b/tests/baselines/reference/objectTypesIdentityWithNumericIndexers3.js index 0441cc85dcf6d..689595fa1fff8 100644 --- a/tests/baselines/reference/objectTypesIdentityWithNumericIndexers3.js +++ b/tests/baselines/reference/objectTypesIdentityWithNumericIndexers3.js @@ -134,29 +134,29 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var A = (function () { +var A = /** @class */ (function () { function A() { } return A; }()); -var B = (function () { +var B = /** @class */ (function () { function B() { } return B; }()); -var C = (function () { +var C = /** @class */ (function () { function C() { } return C; }()); -var PA = (function (_super) { +var PA = /** @class */ (function (_super) { __extends(PA, _super); function PA() { return _super !== null && _super.apply(this, arguments) || this; } return PA; }(A)); -var PB = (function (_super) { +var PB = /** @class */ (function (_super) { __extends(PB, _super); function PB() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/objectTypesIdentityWithOptionality.js b/tests/baselines/reference/objectTypesIdentityWithOptionality.js index a45d474614a86..b13332bee3a2c 100644 --- a/tests/baselines/reference/objectTypesIdentityWithOptionality.js +++ b/tests/baselines/reference/objectTypesIdentityWithOptionality.js @@ -58,17 +58,17 @@ function foo14(x: any) { } //// [objectTypesIdentityWithOptionality.js] // object types are identical structurally -var A = (function () { +var A = /** @class */ (function () { function A() { } return A; }()); -var B = (function () { +var B = /** @class */ (function () { function B() { } return B; }()); -var C = (function () { +var C = /** @class */ (function () { function C() { } return C; diff --git a/tests/baselines/reference/objectTypesIdentityWithPrivates.js b/tests/baselines/reference/objectTypesIdentityWithPrivates.js index 294d879ce248f..c9b9af15c0d5f 100644 --- a/tests/baselines/reference/objectTypesIdentityWithPrivates.js +++ b/tests/baselines/reference/objectTypesIdentityWithPrivates.js @@ -132,29 +132,29 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var A = (function () { +var A = /** @class */ (function () { function A() { } return A; }()); -var B = (function () { +var B = /** @class */ (function () { function B() { } return B; }()); -var C = (function () { +var C = /** @class */ (function () { function C() { } return C; }()); -var PA = (function (_super) { +var PA = /** @class */ (function (_super) { __extends(PA, _super); function PA() { return _super !== null && _super.apply(this, arguments) || this; } return PA; }(A)); -var PB = (function (_super) { +var PB = /** @class */ (function (_super) { __extends(PB, _super); function PB() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/objectTypesIdentityWithPrivates2.js b/tests/baselines/reference/objectTypesIdentityWithPrivates2.js index d151af230f605..f2d6a7d6680b5 100644 --- a/tests/baselines/reference/objectTypesIdentityWithPrivates2.js +++ b/tests/baselines/reference/objectTypesIdentityWithPrivates2.js @@ -50,12 +50,12 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var C = (function () { +var C = /** @class */ (function () { function C() { } return C; }()); -var D = (function (_super) { +var D = /** @class */ (function (_super) { __extends(D, _super); function D() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/objectTypesIdentityWithPrivates3.js b/tests/baselines/reference/objectTypesIdentityWithPrivates3.js index 7fc23f7255c56..11037793d1a9e 100644 --- a/tests/baselines/reference/objectTypesIdentityWithPrivates3.js +++ b/tests/baselines/reference/objectTypesIdentityWithPrivates3.js @@ -36,12 +36,12 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var C1 = (function () { +var C1 = /** @class */ (function () { function C1() { } return C1; }()); -var C2 = (function (_super) { +var C2 = /** @class */ (function (_super) { __extends(C2, _super); function C2() { return _super !== null && _super.apply(this, arguments) || this; @@ -50,12 +50,12 @@ var C2 = (function (_super) { }(C1)); var c1; c1; // Should succeed (private x originates in the same declaration) -var C3 = (function () { +var C3 = /** @class */ (function () { function C3() { } return C3; }()); -var C4 = (function (_super) { +var C4 = /** @class */ (function (_super) { __extends(C4, _super); function C4() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/objectTypesIdentityWithPublics.js b/tests/baselines/reference/objectTypesIdentityWithPublics.js index 0abc8a9b5cc62..3cc5b6ef26ae2 100644 --- a/tests/baselines/reference/objectTypesIdentityWithPublics.js +++ b/tests/baselines/reference/objectTypesIdentityWithPublics.js @@ -90,17 +90,17 @@ function foo14(x: any) { } //// [objectTypesIdentityWithPublics.js] // object types are identical structurally -var A = (function () { +var A = /** @class */ (function () { function A() { } return A; }()); -var B = (function () { +var B = /** @class */ (function () { function B() { } return B; }()); -var C = (function () { +var C = /** @class */ (function () { function C() { } return C; diff --git a/tests/baselines/reference/objectTypesIdentityWithStringIndexers.js b/tests/baselines/reference/objectTypesIdentityWithStringIndexers.js index 9bf7aca342b85..a487224cf577c 100644 --- a/tests/baselines/reference/objectTypesIdentityWithStringIndexers.js +++ b/tests/baselines/reference/objectTypesIdentityWithStringIndexers.js @@ -134,29 +134,29 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var A = (function () { +var A = /** @class */ (function () { function A() { } return A; }()); -var B = (function () { +var B = /** @class */ (function () { function B() { } return B; }()); -var C = (function () { +var C = /** @class */ (function () { function C() { } return C; }()); -var PA = (function (_super) { +var PA = /** @class */ (function (_super) { __extends(PA, _super); function PA() { return _super !== null && _super.apply(this, arguments) || this; } return PA; }(A)); -var PB = (function (_super) { +var PB = /** @class */ (function (_super) { __extends(PB, _super); function PB() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/objectTypesIdentityWithStringIndexers2.js b/tests/baselines/reference/objectTypesIdentityWithStringIndexers2.js index f8aa1127e4edb..47ae2c5d6e429 100644 --- a/tests/baselines/reference/objectTypesIdentityWithStringIndexers2.js +++ b/tests/baselines/reference/objectTypesIdentityWithStringIndexers2.js @@ -137,41 +137,41 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var Base = (function () { +var Base = /** @class */ (function () { function Base() { } return Base; }()); -var Derived = (function (_super) { +var Derived = /** @class */ (function (_super) { __extends(Derived, _super); function Derived() { return _super !== null && _super.apply(this, arguments) || this; } return Derived; }(Base)); -var A = (function () { +var A = /** @class */ (function () { function A() { } return A; }()); -var B = (function () { +var B = /** @class */ (function () { function B() { } return B; }()); -var C = (function () { +var C = /** @class */ (function () { function C() { } return C; }()); -var PA = (function (_super) { +var PA = /** @class */ (function (_super) { __extends(PA, _super); function PA() { return _super !== null && _super.apply(this, arguments) || this; } return PA; }(A)); -var PB = (function (_super) { +var PB = /** @class */ (function (_super) { __extends(PB, _super); function PB() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/objectTypesWithOptionalProperties.js b/tests/baselines/reference/objectTypesWithOptionalProperties.js index 9b2ada010d920..700b41ad91b97 100644 --- a/tests/baselines/reference/objectTypesWithOptionalProperties.js +++ b/tests/baselines/reference/objectTypesWithOptionalProperties.js @@ -28,12 +28,12 @@ var b = { //// [objectTypesWithOptionalProperties.js] // Basic uses of optional properties var a; -var C = (function () { +var C = /** @class */ (function () { function C() { } return C; }()); -var C2 = (function () { +var C2 = /** @class */ (function () { function C2() { } return C2; diff --git a/tests/baselines/reference/objectTypesWithOptionalProperties2.js b/tests/baselines/reference/objectTypesWithOptionalProperties2.js index 1612e6785c70e..03d2b162847ea 100644 --- a/tests/baselines/reference/objectTypesWithOptionalProperties2.js +++ b/tests/baselines/reference/objectTypesWithOptionalProperties2.js @@ -29,13 +29,13 @@ var b = { //// [objectTypesWithOptionalProperties2.js] // Illegal attempts to define optional methods var a; -var C = (function () { +var C = /** @class */ (function () { function C() { } C.prototype.x = function () { }; return C; }()); -var C2 = (function () { +var C2 = /** @class */ (function () { function C2() { } C2.prototype.x = function () { }; diff --git a/tests/baselines/reference/objectTypesWithPredefinedTypesAsName.js b/tests/baselines/reference/objectTypesWithPredefinedTypesAsName.js index 6c3637e2d0e58..d7eb9787b2bcf 100644 --- a/tests/baselines/reference/objectTypesWithPredefinedTypesAsName.js +++ b/tests/baselines/reference/objectTypesWithPredefinedTypesAsName.js @@ -15,27 +15,27 @@ class string { } //// [objectTypesWithPredefinedTypesAsName.js] // it is an error to use a predefined type as a type name -var any = (function () { +var any = /** @class */ (function () { function any() { } return any; }()); -var number = (function () { +var number = /** @class */ (function () { function number() { } return number; }()); -var boolean = (function () { +var boolean = /** @class */ (function () { function boolean() { } return boolean; }()); -var bool = (function () { +var bool = /** @class */ (function () { function bool() { } return bool; }()); // not a predefined type anymore -var string = (function () { +var string = /** @class */ (function () { function string() { } return string; diff --git a/tests/baselines/reference/objectTypesWithPredefinedTypesAsName2.js b/tests/baselines/reference/objectTypesWithPredefinedTypesAsName2.js index 571769008868b..c06300c8ed47a 100644 --- a/tests/baselines/reference/objectTypesWithPredefinedTypesAsName2.js +++ b/tests/baselines/reference/objectTypesWithPredefinedTypesAsName2.js @@ -5,7 +5,7 @@ class void {} // parse error unlike the others //// [objectTypesWithPredefinedTypesAsName2.js] // it is an error to use a predefined type as a type name -var default_1 = (function () { +var default_1 = /** @class */ (function () { function default_1() { } return default_1; diff --git a/tests/baselines/reference/optionalArgsWithDefaultValues.js b/tests/baselines/reference/optionalArgsWithDefaultValues.js index b2bdc7a9a658c..19086e7b9471a 100644 --- a/tests/baselines/reference/optionalArgsWithDefaultValues.js +++ b/tests/baselines/reference/optionalArgsWithDefaultValues.js @@ -14,7 +14,7 @@ function foo(x, y, z) { if (y === void 0) { y = false; } if (z === void 0) { z = 0; } } -var CCC = (function () { +var CCC = /** @class */ (function () { function CCC() { } CCC.prototype.foo = function (x, y, z) { diff --git a/tests/baselines/reference/optionalConstructorArgInSuper.js b/tests/baselines/reference/optionalConstructorArgInSuper.js index 2412ce67ffe9c..86787e045cece 100644 --- a/tests/baselines/reference/optionalConstructorArgInSuper.js +++ b/tests/baselines/reference/optionalConstructorArgInSuper.js @@ -21,13 +21,13 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var Base = (function () { +var Base = /** @class */ (function () { function Base(opt) { } Base.prototype.foo = function (other) { }; return Base; }()); -var Derived = (function (_super) { +var Derived = /** @class */ (function (_super) { __extends(Derived, _super); function Derived() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/optionalMethods.js b/tests/baselines/reference/optionalMethods.js index 2abcd20927703..242af9bcfbab1 100644 --- a/tests/baselines/reference/optionalMethods.js +++ b/tests/baselines/reference/optionalMethods.js @@ -76,7 +76,7 @@ function test1(x) { var g1 = x.g && x.g(); var g2 = x.g ? x.g() : 0; } -var Bar = (function () { +var Bar = /** @class */ (function () { function Bar(d, e) { if (e === void 0) { e = 10; } this.d = d; @@ -105,12 +105,12 @@ function test2(x) { var h1 = x.h && x.h(); var h2 = x.h ? x.h() : 0; } -var Base = (function () { +var Base = /** @class */ (function () { function Base() { } return Base; }()); -var Derived = (function (_super) { +var Derived = /** @class */ (function (_super) { __extends(Derived, _super); function Derived() { var _this = _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/optionalParamArgsTest.js b/tests/baselines/reference/optionalParamArgsTest.js index 5c8503a9bef77..2827e4918b981 100644 --- a/tests/baselines/reference/optionalParamArgsTest.js +++ b/tests/baselines/reference/optionalParamArgsTest.js @@ -136,7 +136,7 @@ var __extends = (this && this.__extends) || (function () { }; })(); // test basic configurations -var C1 = (function () { +var C1 = /** @class */ (function () { function C1(v, p) { if (v === void 0) { v = 1; } if (p === void 0) { p = 0; } @@ -163,7 +163,7 @@ var C1 = (function () { }; return C1; }()); -var C2 = (function (_super) { +var C2 = /** @class */ (function (_super) { __extends(C2, _super); function C2(v2) { if (v2 === void 0) { v2 = 6; } diff --git a/tests/baselines/reference/optionalParamInOverride.js b/tests/baselines/reference/optionalParamInOverride.js index 601cb4d6f1e16..bafc048a30118 100644 --- a/tests/baselines/reference/optionalParamInOverride.js +++ b/tests/baselines/reference/optionalParamInOverride.js @@ -18,13 +18,13 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var Z = (function () { +var Z = /** @class */ (function () { function Z() { } Z.prototype.func = function () { }; return Z; }()); -var Y = (function (_super) { +var Y = /** @class */ (function (_super) { __extends(Y, _super); function Y() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/optionalParameterProperty.js b/tests/baselines/reference/optionalParameterProperty.js index da0d2286714d4..14930d6f12077 100644 --- a/tests/baselines/reference/optionalParameterProperty.js +++ b/tests/baselines/reference/optionalParameterProperty.js @@ -21,12 +21,12 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var C = (function () { +var C = /** @class */ (function () { function C() { } return C; }()); -var D = (function (_super) { +var D = /** @class */ (function (_super) { __extends(D, _super); function D(p) { var _this = _super.call(this) || this; diff --git a/tests/baselines/reference/optionalParamterAndVariableDeclaration.js b/tests/baselines/reference/optionalParamterAndVariableDeclaration.js index ae672b15d54dd..d5bfb857d40a9 100644 --- a/tests/baselines/reference/optionalParamterAndVariableDeclaration.js +++ b/tests/baselines/reference/optionalParamterAndVariableDeclaration.js @@ -7,7 +7,7 @@ class C { //// [optionalParamterAndVariableDeclaration.js] -var C = (function () { +var C = /** @class */ (function () { function C(options) { var options = (options || 0); } diff --git a/tests/baselines/reference/optionalParamterAndVariableDeclaration2.js b/tests/baselines/reference/optionalParamterAndVariableDeclaration2.js index 0de4ac00a660e..f9fde8fc4e34c 100644 --- a/tests/baselines/reference/optionalParamterAndVariableDeclaration2.js +++ b/tests/baselines/reference/optionalParamterAndVariableDeclaration2.js @@ -7,7 +7,7 @@ class C { //// [optionalParamterAndVariableDeclaration2.js] -var C = (function () { +var C = /** @class */ (function () { function C(options) { var options = (options || 0); } diff --git a/tests/baselines/reference/optionalPropertiesInClasses.js b/tests/baselines/reference/optionalPropertiesInClasses.js index 0adbec827cf65..bc34f04ee1611 100644 --- a/tests/baselines/reference/optionalPropertiesInClasses.js +++ b/tests/baselines/reference/optionalPropertiesInClasses.js @@ -18,17 +18,17 @@ class C3 implements ifoo { } //// [optionalPropertiesInClasses.js] -var C1 = (function () { +var C1 = /** @class */ (function () { function C1() { } return C1; }()); -var C2 = (function () { +var C2 = /** @class */ (function () { function C2() { } return C2; }()); -var C3 = (function () { +var C3 = /** @class */ (function () { function C3() { } return C3; diff --git a/tests/baselines/reference/optionalSetterParam.js b/tests/baselines/reference/optionalSetterParam.js index 22cc2cdc06707..8162c7be151b6 100644 --- a/tests/baselines/reference/optionalSetterParam.js +++ b/tests/baselines/reference/optionalSetterParam.js @@ -6,7 +6,7 @@ class foo { //// [optionalSetterParam.js] -var foo = (function () { +var foo = /** @class */ (function () { function foo() { } Object.defineProperty(foo.prototype, "bar", { diff --git a/tests/baselines/reference/out-flag.js b/tests/baselines/reference/out-flag.js index a8c689f9736d9..b35a9f1d8c0e5 100644 --- a/tests/baselines/reference/out-flag.js +++ b/tests/baselines/reference/out-flag.js @@ -19,7 +19,7 @@ class MyClass //// [out-flag.js] //// @out: bin\ // my class comments -var MyClass = (function () { +var MyClass = /** @class */ (function () { function MyClass() { } // my function comments diff --git a/tests/baselines/reference/out-flag.sourcemap.txt b/tests/baselines/reference/out-flag.sourcemap.txt index 6bc04d8c453b2..509e6271437f7 100644 --- a/tests/baselines/reference/out-flag.sourcemap.txt +++ b/tests/baselines/reference/out-flag.sourcemap.txt @@ -20,7 +20,7 @@ sourceFile:out-flag.ts >>>// my class comments 1-> 2 >^^^^^^^^^^^^^^^^^^^^ -3 > ^^^^^^^^^-> +3 > ^^^^^^^^^^^^^^^^^^^^^^^-> 1-> > > @@ -28,7 +28,7 @@ sourceFile:out-flag.ts 1->Emitted(2, 1) Source(3, 1) + SourceIndex(0) 2 >Emitted(2, 21) Source(3, 21) + SourceIndex(0) --- ->>>var MyClass = (function () { +>>>var MyClass = /** @class */ (function () { 1-> 2 >^^^^^^^^^^^^^^^^^^^^^^^^^-> 1-> diff --git a/tests/baselines/reference/out-flag2.js b/tests/baselines/reference/out-flag2.js index 72d5b18eb54dd..aa2f7e772a44b 100644 --- a/tests/baselines/reference/out-flag2.js +++ b/tests/baselines/reference/out-flag2.js @@ -7,12 +7,12 @@ class A { } class B { } //// [c.js] -var A = (function () { +var A = /** @class */ (function () { function A() { } return A; }()); -var B = (function () { +var B = /** @class */ (function () { function B() { } return B; diff --git a/tests/baselines/reference/out-flag2.sourcemap.txt b/tests/baselines/reference/out-flag2.sourcemap.txt index 2867541c6ef34..47a05ee397687 100644 --- a/tests/baselines/reference/out-flag2.sourcemap.txt +++ b/tests/baselines/reference/out-flag2.sourcemap.txt @@ -8,7 +8,7 @@ sources: tests/cases/compiler/a.ts,tests/cases/compiler/b.ts emittedFile:c.js sourceFile:tests/cases/compiler/a.ts ------------------------------------------------------------------- ->>>var A = (function () { +>>>var A = /** @class */ (function () { 1 > 2 >^^^^^^^^^^^^^^^^^^^-> 1 > @@ -42,7 +42,7 @@ sourceFile:tests/cases/compiler/a.ts 2 >^ 3 > 4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^-> +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > 2 >} 3 > @@ -56,7 +56,7 @@ sourceFile:tests/cases/compiler/a.ts emittedFile:c.js sourceFile:tests/cases/compiler/b.ts ------------------------------------------------------------------- ->>>var B = (function () { +>>>var B = /** @class */ (function () { 1-> 2 >^^^^^^^^^^^^^^^^^^^-> 1-> diff --git a/tests/baselines/reference/out-flag3.js b/tests/baselines/reference/out-flag3.js index a2ad3272c0819..d00e4f7de530b 100644 --- a/tests/baselines/reference/out-flag3.js +++ b/tests/baselines/reference/out-flag3.js @@ -10,12 +10,12 @@ class B { } //// [c.js] // --out and --outFile error -var A = (function () { +var A = /** @class */ (function () { function A() { } return A; }()); -var B = (function () { +var B = /** @class */ (function () { function B() { } return B; diff --git a/tests/baselines/reference/out-flag3.sourcemap.txt b/tests/baselines/reference/out-flag3.sourcemap.txt index c3787bbf59333..c6530af257350 100644 --- a/tests/baselines/reference/out-flag3.sourcemap.txt +++ b/tests/baselines/reference/out-flag3.sourcemap.txt @@ -11,18 +11,19 @@ sourceFile:tests/cases/compiler/a.ts >>>// --out and --outFile error 1 > 2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +3 > ^^^^^^^^^-> 1 > 2 >// --out and --outFile error 1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) 2 >Emitted(1, 29) Source(1, 29) + SourceIndex(0) --- ->>>var A = (function () { -1 > +>>>var A = /** @class */ (function () { +1-> 2 >^^^^^^^^^^^^^^^^^^^-> -1 > +1-> > > -1 >Emitted(2, 1) Source(3, 1) + SourceIndex(0) +1->Emitted(2, 1) Source(3, 1) + SourceIndex(0) --- >>> function A() { 1->^^^^ @@ -52,7 +53,7 @@ sourceFile:tests/cases/compiler/a.ts 2 >^ 3 > 4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^-> +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > 2 >} 3 > @@ -66,7 +67,7 @@ sourceFile:tests/cases/compiler/a.ts emittedFile:c.js sourceFile:tests/cases/compiler/b.ts ------------------------------------------------------------------- ->>>var B = (function () { +>>>var B = /** @class */ (function () { 1-> 2 >^^^^^^^^^^^^^^^^^^^-> 1-> diff --git a/tests/baselines/reference/outModuleConcatAmd.js b/tests/baselines/reference/outModuleConcatAmd.js index 12e5745a558a4..e3d1f506e41dc 100644 --- a/tests/baselines/reference/outModuleConcatAmd.js +++ b/tests/baselines/reference/outModuleConcatAmd.js @@ -21,7 +21,7 @@ var __extends = (this && this.__extends) || (function () { define("ref/a", ["require", "exports"], function (require, exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); - var A = (function () { + var A = /** @class */ (function () { function A() { } return A; @@ -31,7 +31,7 @@ define("ref/a", ["require", "exports"], function (require, exports) { define("b", ["require", "exports", "ref/a"], function (require, exports, a_1) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); - var B = (function (_super) { + var B = /** @class */ (function (_super) { __extends(B, _super); function B() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/outModuleConcatAmd.sourcemap.txt b/tests/baselines/reference/outModuleConcatAmd.sourcemap.txt index c1c1f5b5420c5..ea31292e052d3 100644 --- a/tests/baselines/reference/outModuleConcatAmd.sourcemap.txt +++ b/tests/baselines/reference/outModuleConcatAmd.sourcemap.txt @@ -21,7 +21,7 @@ sourceFile:tests/cases/compiler/ref/a.ts >>>define("ref/a", ["require", "exports"], function (require, exports) { >>> "use strict"; >>> Object.defineProperty(exports, "__esModule", { value: true }); ->>> var A = (function () { +>>> var A = /** @class */ (function () { 1 >^^^^ 2 > ^^^^^^^^^^^^^^^^^^^-> 1 > @@ -81,7 +81,7 @@ sourceFile:tests/cases/compiler/b.ts >>>define("b", ["require", "exports", "ref/a"], function (require, exports, a_1) { >>> "use strict"; >>> Object.defineProperty(exports, "__esModule", { value: true }); ->>> var B = (function (_super) { +>>> var B = /** @class */ (function (_super) { 1 >^^^^ 2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 >import {A} from "./ref/a"; diff --git a/tests/baselines/reference/outModuleConcatSystem.js b/tests/baselines/reference/outModuleConcatSystem.js index 9d2a406d118ce..576f029592b24 100644 --- a/tests/baselines/reference/outModuleConcatSystem.js +++ b/tests/baselines/reference/outModuleConcatSystem.js @@ -25,7 +25,7 @@ System.register("ref/a", [], function (exports_1, context_1) { return { setters: [], execute: function () { - A = (function () { + A = /** @class */ (function () { function A() { } return A; @@ -45,7 +45,7 @@ System.register("b", ["ref/a"], function (exports_2, context_2) { } ], execute: function () { - B = (function (_super) { + B = /** @class */ (function (_super) { __extends(B, _super); function B() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/outModuleConcatSystem.sourcemap.txt b/tests/baselines/reference/outModuleConcatSystem.sourcemap.txt index 205f2cd7194bc..31c64d3cd52e9 100644 --- a/tests/baselines/reference/outModuleConcatSystem.sourcemap.txt +++ b/tests/baselines/reference/outModuleConcatSystem.sourcemap.txt @@ -25,7 +25,7 @@ sourceFile:tests/cases/compiler/ref/a.ts >>> return { >>> setters: [], >>> execute: function () { ->>> A = (function () { +>>> A = /** @class */ (function () { 1 >^^^^^^^^^^^^ 2 > ^^^^^^^^^^^^^^^^^^^-> 1 > @@ -96,7 +96,7 @@ sourceFile:tests/cases/compiler/b.ts >>> } >>> ], >>> execute: function () { ->>> B = (function (_super) { +>>> B = /** @class */ (function (_super) { 1 >^^^^^^^^^^^^ 2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 >import {A} from "./ref/a"; diff --git a/tests/baselines/reference/outModuleTripleSlashRefs.js b/tests/baselines/reference/outModuleTripleSlashRefs.js index 897b698e9e7f2..bbf2e8caa74c0 100644 --- a/tests/baselines/reference/outModuleTripleSlashRefs.js +++ b/tests/baselines/reference/outModuleTripleSlashRefs.js @@ -41,7 +41,7 @@ var __extends = (this && this.__extends) || (function () { }; })(); /// -var Foo = (function () { +var Foo = /** @class */ (function () { function Foo() { } return Foo; @@ -50,7 +50,7 @@ define("ref/a", ["require", "exports"], function (require, exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); /// - var A = (function () { + var A = /** @class */ (function () { function A() { } return A; @@ -60,7 +60,7 @@ define("ref/a", ["require", "exports"], function (require, exports) { define("b", ["require", "exports", "ref/a"], function (require, exports, a_1) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); - var B = (function (_super) { + var B = /** @class */ (function (_super) { __extends(B, _super); function B() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/outModuleTripleSlashRefs.sourcemap.txt b/tests/baselines/reference/outModuleTripleSlashRefs.sourcemap.txt index 74c2a0cf79835..5508670e636c2 100644 --- a/tests/baselines/reference/outModuleTripleSlashRefs.sourcemap.txt +++ b/tests/baselines/reference/outModuleTripleSlashRefs.sourcemap.txt @@ -21,17 +21,18 @@ sourceFile:tests/cases/compiler/ref/b.ts >>>/// 1 > 2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +3 > ^^^^^^-> 1 > 2 >/// 1 >Emitted(11, 1) Source(1, 1) + SourceIndex(0) 2 >Emitted(11, 34) Source(1, 34) + SourceIndex(0) --- ->>>var Foo = (function () { -1 > +>>>var Foo = /** @class */ (function () { +1-> 2 >^^^^^^^^^^^^^^^^^^^^^-> -1 > +1-> > -1 >Emitted(12, 1) Source(2, 1) + SourceIndex(0) +1->Emitted(12, 1) Source(2, 1) + SourceIndex(0) --- >>> function Foo() { 1->^^^^ @@ -85,17 +86,18 @@ sourceFile:tests/cases/compiler/ref/a.ts >>> /// 1->^^^^ 2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +3 > ^^^^^^-> 1-> 2 > /// 1->Emitted(20, 5) Source(1, 1) + SourceIndex(1) 2 >Emitted(20, 36) Source(1, 32) + SourceIndex(1) --- ->>> var A = (function () { -1 >^^^^ +>>> var A = /** @class */ (function () { +1->^^^^ 2 > ^^^^^^^^^^^^^^^^^^^-> -1 > +1-> > -1 >Emitted(21, 5) Source(2, 1) + SourceIndex(1) +1->Emitted(21, 5) Source(2, 1) + SourceIndex(1) --- >>> function A() { 1->^^^^^^^^ @@ -155,7 +157,7 @@ sourceFile:tests/cases/compiler/b.ts >>>define("b", ["require", "exports", "ref/a"], function (require, exports, a_1) { >>> "use strict"; >>> Object.defineProperty(exports, "__esModule", { value: true }); ->>> var B = (function (_super) { +>>> var B = /** @class */ (function (_super) { 1 >^^^^ 2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 >import {A} from "./ref/a"; diff --git a/tests/baselines/reference/overload1.js b/tests/baselines/reference/overload1.js index fc898b4e870cc..4808239634866 100644 --- a/tests/baselines/reference/overload1.js +++ b/tests/baselines/reference/overload1.js @@ -52,13 +52,13 @@ var __extends = (this && this.__extends) || (function () { })(); var O; (function (O) { - var A = (function () { + var A = /** @class */ (function () { function A() { } return A; }()); O.A = A; - var B = (function (_super) { + var B = /** @class */ (function (_super) { __extends(B, _super); function B() { return _super !== null && _super.apply(this, arguments) || this; @@ -66,7 +66,7 @@ var O; return B; }(A)); O.B = B; - var C = (function (_super) { + var C = /** @class */ (function (_super) { __extends(C, _super); function C() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/overload2.js b/tests/baselines/reference/overload2.js index 667d0fb1db406..72d9eb0322ff3 100644 --- a/tests/baselines/reference/overload2.js +++ b/tests/baselines/reference/overload2.js @@ -26,7 +26,7 @@ var B; // should be ok function foo(x) { } -var C = (function () { +var C = /** @class */ (function () { function C() { } return C; diff --git a/tests/baselines/reference/overloadAssignmentCompat.js b/tests/baselines/reference/overloadAssignmentCompat.js index bee754df3476a..398581100445b 100644 --- a/tests/baselines/reference/overloadAssignmentCompat.js +++ b/tests/baselines/reference/overloadAssignmentCompat.js @@ -39,7 +39,7 @@ function foo():string { return "a" }; //// [overloadAssignmentCompat.js] // ok - overload signatures are assignment compatible with their implementation -var Accessor = (function () { +var Accessor = /** @class */ (function () { function Accessor() { } return Accessor; diff --git a/tests/baselines/reference/overloadCallTest.js b/tests/baselines/reference/overloadCallTest.js index 369c68923dfb1..c47618e618537 100644 --- a/tests/baselines/reference/overloadCallTest.js +++ b/tests/baselines/reference/overloadCallTest.js @@ -16,7 +16,7 @@ class foo { //// [overloadCallTest.js] -var foo = (function () { +var foo = /** @class */ (function () { function foo() { function bar(foo) { return "foo"; } ; diff --git a/tests/baselines/reference/overloadConsecutiveness.js b/tests/baselines/reference/overloadConsecutiveness.js index 6a245ea18fa7f..6b02c01088db2 100644 --- a/tests/baselines/reference/overloadConsecutiveness.js +++ b/tests/baselines/reference/overloadConsecutiveness.js @@ -18,7 +18,7 @@ function f1() { } function f2() { } function f2() { } function f3() { } -var C = (function () { +var C = /** @class */ (function () { function C() { } C.prototype.m1 = function () { }; diff --git a/tests/baselines/reference/overloadEquivalenceWithStatics.js b/tests/baselines/reference/overloadEquivalenceWithStatics.js index 4c296410aa6d4..6b3dd1dd72575 100644 --- a/tests/baselines/reference/overloadEquivalenceWithStatics.js +++ b/tests/baselines/reference/overloadEquivalenceWithStatics.js @@ -9,7 +9,7 @@ return null; //// [overloadEquivalenceWithStatics.js] -var A1 = (function () { +var A1 = /** @class */ (function () { function A1() { } A1.B = function (v) { diff --git a/tests/baselines/reference/overloadGenericFunctionWithRestArgs.js b/tests/baselines/reference/overloadGenericFunctionWithRestArgs.js index e83f33f3ad024..bb425c39a6f2c 100644 --- a/tests/baselines/reference/overloadGenericFunctionWithRestArgs.js +++ b/tests/baselines/reference/overloadGenericFunctionWithRestArgs.js @@ -11,12 +11,12 @@ function Choice(...v_args: T[]): A { } //// [overloadGenericFunctionWithRestArgs.js] -var B = (function () { +var B = /** @class */ (function () { function B() { } return B; }()); -var A = (function () { +var A = /** @class */ (function () { function A() { } return A; diff --git a/tests/baselines/reference/overloadModifiersMustAgree.js b/tests/baselines/reference/overloadModifiersMustAgree.js index 783bf854a8424..af21460d25ba6 100644 --- a/tests/baselines/reference/overloadModifiersMustAgree.js +++ b/tests/baselines/reference/overloadModifiersMustAgree.js @@ -18,7 +18,7 @@ interface I { //// [overloadModifiersMustAgree.js] "use strict"; exports.__esModule = true; -var baz = (function () { +var baz = /** @class */ (function () { function baz() { } baz.prototype.foo = function (bar) { }; // error - access modifiers do not agree diff --git a/tests/baselines/reference/overloadOnConstConstraintChecks1.js b/tests/baselines/reference/overloadOnConstConstraintChecks1.js index 6a4cc01bf8563..74ecdff30eb7c 100644 --- a/tests/baselines/reference/overloadOnConstConstraintChecks1.js +++ b/tests/baselines/reference/overloadOnConstConstraintChecks1.js @@ -33,13 +33,13 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var Base = (function () { +var Base = /** @class */ (function () { function Base() { } Base.prototype.foo = function () { }; return Base; }()); -var Derived1 = (function (_super) { +var Derived1 = /** @class */ (function (_super) { __extends(Derived1, _super); function Derived1() { return _super !== null && _super.apply(this, arguments) || this; @@ -47,7 +47,7 @@ var Derived1 = (function (_super) { Derived1.prototype.bar = function () { }; return Derived1; }(Base)); -var Derived2 = (function (_super) { +var Derived2 = /** @class */ (function (_super) { __extends(Derived2, _super); function Derived2() { return _super !== null && _super.apply(this, arguments) || this; @@ -55,7 +55,7 @@ var Derived2 = (function (_super) { Derived2.prototype.baz = function () { }; return Derived2; }(Base)); -var Derived3 = (function (_super) { +var Derived3 = /** @class */ (function (_super) { __extends(Derived3, _super); function Derived3() { return _super !== null && _super.apply(this, arguments) || this; @@ -63,7 +63,7 @@ var Derived3 = (function (_super) { Derived3.prototype.biz = function () { }; return Derived3; }(Base)); -var D = (function () { +var D = /** @class */ (function () { function D() { } D.prototype.createElement = function (tagName) { diff --git a/tests/baselines/reference/overloadOnConstConstraintChecks2.js b/tests/baselines/reference/overloadOnConstConstraintChecks2.js index 379de55da885e..2c8802a6972b0 100644 --- a/tests/baselines/reference/overloadOnConstConstraintChecks2.js +++ b/tests/baselines/reference/overloadOnConstConstraintChecks2.js @@ -22,19 +22,19 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var A = (function () { +var A = /** @class */ (function () { function A() { } return A; }()); -var B = (function (_super) { +var B = /** @class */ (function (_super) { __extends(B, _super); function B() { return _super !== null && _super.apply(this, arguments) || this; } return B; }(A)); -var C = (function (_super) { +var C = /** @class */ (function (_super) { __extends(C, _super); function C() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/overloadOnConstConstraintChecks3.js b/tests/baselines/reference/overloadOnConstConstraintChecks3.js index de843b9f44cab..a0155e2ad5d80 100644 --- a/tests/baselines/reference/overloadOnConstConstraintChecks3.js +++ b/tests/baselines/reference/overloadOnConstConstraintChecks3.js @@ -23,20 +23,20 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var A = (function () { +var A = /** @class */ (function () { function A() { this.x = 1; } return A; }()); -var B = (function (_super) { +var B = /** @class */ (function (_super) { __extends(B, _super); function B() { return _super !== null && _super.apply(this, arguments) || this; } return B; }(A)); -var C = (function (_super) { +var C = /** @class */ (function (_super) { __extends(C, _super); function C() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/overloadOnConstConstraintChecks4.js b/tests/baselines/reference/overloadOnConstConstraintChecks4.js index 3f7664ff6c8d5..33a2754b083b6 100644 --- a/tests/baselines/reference/overloadOnConstConstraintChecks4.js +++ b/tests/baselines/reference/overloadOnConstConstraintChecks4.js @@ -24,12 +24,12 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var Z = (function () { +var Z = /** @class */ (function () { function Z() { } return Z; }()); -var A = (function (_super) { +var A = /** @class */ (function (_super) { __extends(A, _super); function A() { var _this = _super !== null && _super.apply(this, arguments) || this; @@ -38,14 +38,14 @@ var A = (function (_super) { } return A; }(Z)); -var B = (function (_super) { +var B = /** @class */ (function (_super) { __extends(B, _super); function B() { return _super !== null && _super.apply(this, arguments) || this; } return B; }(A)); -var C = (function (_super) { +var C = /** @class */ (function (_super) { __extends(C, _super); function C() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/overloadOnConstInBaseWithBadImplementationInDerived.js b/tests/baselines/reference/overloadOnConstInBaseWithBadImplementationInDerived.js index 188e4d0214023..b890ed9b764ac 100644 --- a/tests/baselines/reference/overloadOnConstInBaseWithBadImplementationInDerived.js +++ b/tests/baselines/reference/overloadOnConstInBaseWithBadImplementationInDerived.js @@ -9,7 +9,7 @@ class C implements I { } //// [overloadOnConstInBaseWithBadImplementationInDerived.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } C.prototype.x1 = function (a, callback) { diff --git a/tests/baselines/reference/overloadOnConstInCallback1.js b/tests/baselines/reference/overloadOnConstInCallback1.js index d00779081774d..32b53eb9cb0c3 100644 --- a/tests/baselines/reference/overloadOnConstInCallback1.js +++ b/tests/baselines/reference/overloadOnConstInCallback1.js @@ -10,7 +10,7 @@ class C { } //// [overloadOnConstInCallback1.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } C.prototype.x1 = function (a, callback) { diff --git a/tests/baselines/reference/overloadOnConstInheritance4.js b/tests/baselines/reference/overloadOnConstInheritance4.js index f493d9ef2de0f..20ea637d728d1 100644 --- a/tests/baselines/reference/overloadOnConstInheritance4.js +++ b/tests/baselines/reference/overloadOnConstInheritance4.js @@ -10,7 +10,7 @@ class C implements I { //// [overloadOnConstInheritance4.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } C.prototype.x1 = function (a, callback) { diff --git a/tests/baselines/reference/overloadOnConstNoAnyImplementation2.js b/tests/baselines/reference/overloadOnConstNoAnyImplementation2.js index 5e3110abd3dd3..619a03f25aed4 100644 --- a/tests/baselines/reference/overloadOnConstNoAnyImplementation2.js +++ b/tests/baselines/reference/overloadOnConstNoAnyImplementation2.js @@ -22,7 +22,7 @@ c.x1(1, (x) => { return 1; } ); c.x1(1, (x: number) => { return 1; } ); //// [overloadOnConstNoAnyImplementation2.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } C.prototype.x1 = function (a, callback) { diff --git a/tests/baselines/reference/overloadOnConstNoNonSpecializedSignature.js b/tests/baselines/reference/overloadOnConstNoNonSpecializedSignature.js index 8a610f30922aa..bf6922a366764 100644 --- a/tests/baselines/reference/overloadOnConstNoNonSpecializedSignature.js +++ b/tests/baselines/reference/overloadOnConstNoNonSpecializedSignature.js @@ -6,7 +6,7 @@ class C { //// [overloadOnConstNoNonSpecializedSignature.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } C.prototype.x1 = function (a) { }; diff --git a/tests/baselines/reference/overloadOnConstNoStringImplementation2.js b/tests/baselines/reference/overloadOnConstNoStringImplementation2.js index 98ee0f45c152d..cf44378d8dbec 100644 --- a/tests/baselines/reference/overloadOnConstNoStringImplementation2.js +++ b/tests/baselines/reference/overloadOnConstNoStringImplementation2.js @@ -21,7 +21,7 @@ c.x1(1, (x: string) => { return 1; } ); c.x1(1, (x: number) => { return 1; } ); //// [overloadOnConstNoStringImplementation2.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } C.prototype.x1 = function (a, callback) { diff --git a/tests/baselines/reference/overloadOnConstantsInvalidOverload1.js b/tests/baselines/reference/overloadOnConstantsInvalidOverload1.js index 5488ea03ee8b6..b062d589d34b1 100644 --- a/tests/baselines/reference/overloadOnConstantsInvalidOverload1.js +++ b/tests/baselines/reference/overloadOnConstantsInvalidOverload1.js @@ -22,13 +22,13 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var Base = (function () { +var Base = /** @class */ (function () { function Base() { } Base.prototype.foo = function () { }; return Base; }()); -var Derived1 = (function (_super) { +var Derived1 = /** @class */ (function (_super) { __extends(Derived1, _super); function Derived1() { return _super !== null && _super.apply(this, arguments) || this; @@ -36,7 +36,7 @@ var Derived1 = (function (_super) { Derived1.prototype.bar = function () { }; return Derived1; }(Base)); -var Derived2 = (function (_super) { +var Derived2 = /** @class */ (function (_super) { __extends(Derived2, _super); function Derived2() { return _super !== null && _super.apply(this, arguments) || this; @@ -44,7 +44,7 @@ var Derived2 = (function (_super) { Derived2.prototype.baz = function () { }; return Derived2; }(Base)); -var Derived3 = (function (_super) { +var Derived3 = /** @class */ (function (_super) { __extends(Derived3, _super); function Derived3() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/overloadOnGenericClassAndNonGenericClass.js b/tests/baselines/reference/overloadOnGenericClassAndNonGenericClass.js index d7f992564db44..edfa4c7d29e6c 100644 --- a/tests/baselines/reference/overloadOnGenericClassAndNonGenericClass.js +++ b/tests/baselines/reference/overloadOnGenericClassAndNonGenericClass.js @@ -17,32 +17,32 @@ var t3: A; // should not error //// [overloadOnGenericClassAndNonGenericClass.js] -var A = (function () { +var A = /** @class */ (function () { function A() { } return A; }()); -var B = (function () { +var B = /** @class */ (function () { function B() { } return B; }()); -var C = (function () { +var C = /** @class */ (function () { function C() { } return C; }()); -var X = (function () { +var X = /** @class */ (function () { function X() { } return X; }()); -var X1 = (function () { +var X1 = /** @class */ (function () { function X1() { } return X1; }()); -var X2 = (function () { +var X2 = /** @class */ (function () { function X2() { } return X2; diff --git a/tests/baselines/reference/overloadResolution.js b/tests/baselines/reference/overloadResolution.js index 32040c082eeb2..a26e813e2745b 100644 --- a/tests/baselines/reference/overloadResolution.js +++ b/tests/baselines/reference/overloadResolution.js @@ -105,26 +105,26 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var SomeBase = (function () { +var SomeBase = /** @class */ (function () { function SomeBase() { } return SomeBase; }()); -var SomeDerived1 = (function (_super) { +var SomeDerived1 = /** @class */ (function (_super) { __extends(SomeDerived1, _super); function SomeDerived1() { return _super !== null && _super.apply(this, arguments) || this; } return SomeDerived1; }(SomeBase)); -var SomeDerived2 = (function (_super) { +var SomeDerived2 = /** @class */ (function (_super) { __extends(SomeDerived2, _super); function SomeDerived2() { return _super !== null && _super.apply(this, arguments) || this; } return SomeDerived2; }(SomeBase)); -var SomeDerived3 = (function (_super) { +var SomeDerived3 = /** @class */ (function (_super) { __extends(SomeDerived3, _super); function SomeDerived3() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/overloadResolutionClassConstructors.js b/tests/baselines/reference/overloadResolutionClassConstructors.js index 5a8c7c0838b78..c7a04fdd61127 100644 --- a/tests/baselines/reference/overloadResolutionClassConstructors.js +++ b/tests/baselines/reference/overloadResolutionClassConstructors.js @@ -112,26 +112,26 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var SomeBase = (function () { +var SomeBase = /** @class */ (function () { function SomeBase() { } return SomeBase; }()); -var SomeDerived1 = (function (_super) { +var SomeDerived1 = /** @class */ (function (_super) { __extends(SomeDerived1, _super); function SomeDerived1() { return _super !== null && _super.apply(this, arguments) || this; } return SomeDerived1; }(SomeBase)); -var SomeDerived2 = (function (_super) { +var SomeDerived2 = /** @class */ (function (_super) { __extends(SomeDerived2, _super); function SomeDerived2() { return _super !== null && _super.apply(this, arguments) || this; } return SomeDerived2; }(SomeBase)); -var SomeDerived3 = (function (_super) { +var SomeDerived3 = /** @class */ (function (_super) { __extends(SomeDerived3, _super); function SomeDerived3() { return _super !== null && _super.apply(this, arguments) || this; @@ -139,7 +139,7 @@ var SomeDerived3 = (function (_super) { return SomeDerived3; }(SomeBase)); // Ambiguous call picks the first overload in declaration order -var fn1 = (function () { +var fn1 = /** @class */ (function () { function fn1() { } return fn1; @@ -148,7 +148,7 @@ new fn1(undefined); // No candidate overloads found new fn1({}); // Error // Generic and non - generic overload where generic overload is the only candidate when called with type arguments -var fn2 = (function () { +var fn2 = /** @class */ (function () { function fn2() { } return fn2; @@ -161,7 +161,7 @@ new fn2('', 0); // OK // Generic and non - generic overload where non - generic overload is the only candidate when called without type arguments new fn2('', 0); // OK // Generic overloads with differing arity called without type arguments -var fn3 = (function () { +var fn3 = /** @class */ (function () { function fn3() { } return fn3; @@ -176,7 +176,7 @@ new fn3('', '', 3); // Generic overloads with differing arity called with type argument count that doesn't match any overload new fn3(); // Error // Generic overloads with constraints called with type arguments that satisfy the constraints -var fn4 = (function () { +var fn4 = /** @class */ (function () { function fn4() { } return fn4; @@ -196,7 +196,7 @@ new fn4(null, null); // Error new fn4(true, null); // Error new fn4(null, true); // Error // Non - generic overloads where contextual typing of function arguments has errors -var fn5 = (function () { +var fn5 = /** @class */ (function () { function fn5() { return undefined; } diff --git a/tests/baselines/reference/overloadResolutionConstructors.js b/tests/baselines/reference/overloadResolutionConstructors.js index 32f350bdc2eab..926cdde4aecb2 100644 --- a/tests/baselines/reference/overloadResolutionConstructors.js +++ b/tests/baselines/reference/overloadResolutionConstructors.js @@ -113,26 +113,26 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var SomeBase = (function () { +var SomeBase = /** @class */ (function () { function SomeBase() { } return SomeBase; }()); -var SomeDerived1 = (function (_super) { +var SomeDerived1 = /** @class */ (function (_super) { __extends(SomeDerived1, _super); function SomeDerived1() { return _super !== null && _super.apply(this, arguments) || this; } return SomeDerived1; }(SomeBase)); -var SomeDerived2 = (function (_super) { +var SomeDerived2 = /** @class */ (function (_super) { __extends(SomeDerived2, _super); function SomeDerived2() { return _super !== null && _super.apply(this, arguments) || this; } return SomeDerived2; }(SomeBase)); -var SomeDerived3 = (function (_super) { +var SomeDerived3 = /** @class */ (function (_super) { __extends(SomeDerived3, _super); function SomeDerived3() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/overloadResolutionOnDefaultConstructor1.js b/tests/baselines/reference/overloadResolutionOnDefaultConstructor1.js index 49ac12e615223..fb823b3609d6e 100644 --- a/tests/baselines/reference/overloadResolutionOnDefaultConstructor1.js +++ b/tests/baselines/reference/overloadResolutionOnDefaultConstructor1.js @@ -6,7 +6,7 @@ class Bar { } //// [overloadResolutionOnDefaultConstructor1.js] -var Bar = (function () { +var Bar = /** @class */ (function () { function Bar() { } Bar.prototype.clone = function () { diff --git a/tests/baselines/reference/overloadResolutionOverNonCTLambdas.js b/tests/baselines/reference/overloadResolutionOverNonCTLambdas.js index 210e45c27d679..4a85517555553 100644 --- a/tests/baselines/reference/overloadResolutionOverNonCTLambdas.js +++ b/tests/baselines/reference/overloadResolutionOverNonCTLambdas.js @@ -26,7 +26,7 @@ bug3(function(x:string):string { return x; }); //// [overloadResolutionOverNonCTLambdas.js] var Bugs; (function (Bugs) { - var A = (function () { + var A = /** @class */ (function () { function A() { } return A; diff --git a/tests/baselines/reference/overloadReturnTypes.js b/tests/baselines/reference/overloadReturnTypes.js index 9a49a550f40e9..1744473463b0c 100644 --- a/tests/baselines/reference/overloadReturnTypes.js +++ b/tests/baselines/reference/overloadReturnTypes.js @@ -24,7 +24,7 @@ interface IFace { //// [overloadReturnTypes.js] -var Accessor = (function () { +var Accessor = /** @class */ (function () { function Accessor() { } return Accessor; diff --git a/tests/baselines/reference/overloadedStaticMethodSpecialization.js b/tests/baselines/reference/overloadedStaticMethodSpecialization.js index d63b185419a00..7d67c117d4798 100644 --- a/tests/baselines/reference/overloadedStaticMethodSpecialization.js +++ b/tests/baselines/reference/overloadedStaticMethodSpecialization.js @@ -9,7 +9,7 @@ class A { //// [overloadedStaticMethodSpecialization.js] -var A = (function () { +var A = /** @class */ (function () { function A() { } A.B = function (v) { diff --git a/tests/baselines/reference/overloadingOnConstants1.js b/tests/baselines/reference/overloadingOnConstants1.js index c741abade66dc..83f715550d1c4 100644 --- a/tests/baselines/reference/overloadingOnConstants1.js +++ b/tests/baselines/reference/overloadingOnConstants1.js @@ -36,13 +36,13 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var Base = (function () { +var Base = /** @class */ (function () { function Base() { } Base.prototype.foo = function () { }; return Base; }()); -var Derived1 = (function (_super) { +var Derived1 = /** @class */ (function (_super) { __extends(Derived1, _super); function Derived1() { return _super !== null && _super.apply(this, arguments) || this; @@ -50,7 +50,7 @@ var Derived1 = (function (_super) { Derived1.prototype.bar = function () { }; return Derived1; }(Base)); -var Derived2 = (function (_super) { +var Derived2 = /** @class */ (function (_super) { __extends(Derived2, _super); function Derived2() { return _super !== null && _super.apply(this, arguments) || this; @@ -58,7 +58,7 @@ var Derived2 = (function (_super) { Derived2.prototype.baz = function () { }; return Derived2; }(Base)); -var Derived3 = (function (_super) { +var Derived3 = /** @class */ (function (_super) { __extends(Derived3, _super); function Derived3() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/overloadingOnConstants2.js b/tests/baselines/reference/overloadingOnConstants2.js index f415df84a4708..0f1eaf315edac 100644 --- a/tests/baselines/reference/overloadingOnConstants2.js +++ b/tests/baselines/reference/overloadingOnConstants2.js @@ -38,20 +38,20 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var C = (function () { +var C = /** @class */ (function () { function C() { this.x = 1; } return C; }()); -var D = (function (_super) { +var D = /** @class */ (function (_super) { __extends(D, _super); function D() { return _super !== null && _super.apply(this, arguments) || this; } return D; }(C)); -var E = (function () { +var E = /** @class */ (function () { function E() { this.y = 1; } diff --git a/tests/baselines/reference/overloadresolutionWithConstraintCheckingDeferred.js b/tests/baselines/reference/overloadresolutionWithConstraintCheckingDeferred.js index b5ddd0adebc97..81ab4d8e481d2 100644 --- a/tests/baselines/reference/overloadresolutionWithConstraintCheckingDeferred.js +++ b/tests/baselines/reference/overloadresolutionWithConstraintCheckingDeferred.js @@ -23,7 +23,7 @@ var result3: string = foo(x => { // x has type D //// [overloadresolutionWithConstraintCheckingDeferred.js] -var G = (function () { +var G = /** @class */ (function () { function G(x) { } return G; diff --git a/tests/baselines/reference/overloadsWithinClasses.js b/tests/baselines/reference/overloadsWithinClasses.js index 0cd191c8f4437..d5fee2fdc2ffd 100644 --- a/tests/baselines/reference/overloadsWithinClasses.js +++ b/tests/baselines/reference/overloadsWithinClasses.js @@ -24,20 +24,20 @@ class X { //// [overloadsWithinClasses.js] -var foo = (function () { +var foo = /** @class */ (function () { function foo() { } foo.fnOverload = function () { }; foo.fnOverload = function (foo) { }; // error return foo; }()); -var bar = (function () { +var bar = /** @class */ (function () { function bar() { } bar.fnOverload = function (foo) { }; // no error return bar; }()); -var X = (function () { +var X = /** @class */ (function () { function X() { } X.prototype.attr = function (first, second) { diff --git a/tests/baselines/reference/overrideBaseIntersectionMethod.js b/tests/baselines/reference/overrideBaseIntersectionMethod.js index ed17ef4e18948..6fe1e5c774ff9 100644 --- a/tests/baselines/reference/overrideBaseIntersectionMethod.js +++ b/tests/baselines/reference/overrideBaseIntersectionMethod.js @@ -43,7 +43,7 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var WithLocation = function (Base) { return (function (_super) { +var WithLocation = function (Base) { return /** @class */ (function (_super) { __extends(class_1, _super); function class_1() { return _super !== null && _super.apply(this, arguments) || this; @@ -54,7 +54,7 @@ var WithLocation = function (Base) { return (function (_super) { }; return class_1; }(Base)); }; -var Point = (function () { +var Point = /** @class */ (function () { function Point(x, y) { this.x = x; this.y = y; @@ -64,7 +64,7 @@ var Point = (function () { }; return Point; }()); -var Foo = (function (_super) { +var Foo = /** @class */ (function (_super) { __extends(Foo, _super); function Foo() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/overridingPrivateStaticMembers.js b/tests/baselines/reference/overridingPrivateStaticMembers.js index 0b4e5672b5e34..99df58ceda5f7 100644 --- a/tests/baselines/reference/overridingPrivateStaticMembers.js +++ b/tests/baselines/reference/overridingPrivateStaticMembers.js @@ -18,12 +18,12 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var Base2 = (function () { +var Base2 = /** @class */ (function () { function Base2() { } return Base2; }()); -var Derived2 = (function (_super) { +var Derived2 = /** @class */ (function (_super) { __extends(Derived2, _super); function Derived2() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/paramPropertiesInSignatures.js b/tests/baselines/reference/paramPropertiesInSignatures.js index 690052e589b2c..c1587828b08f8 100644 --- a/tests/baselines/reference/paramPropertiesInSignatures.js +++ b/tests/baselines/reference/paramPropertiesInSignatures.js @@ -12,7 +12,7 @@ declare class C2 { } //// [paramPropertiesInSignatures.js] -var C1 = (function () { +var C1 = /** @class */ (function () { function C1(p3) { this.p3 = p3; } // OK diff --git a/tests/baselines/reference/parameterInitializerBeforeDestructuringEmit.js b/tests/baselines/reference/parameterInitializerBeforeDestructuringEmit.js index e7d4a4472e8aa..91a5484b6ee3f 100644 --- a/tests/baselines/reference/parameterInitializerBeforeDestructuringEmit.js +++ b/tests/baselines/reference/parameterInitializerBeforeDestructuringEmit.js @@ -37,7 +37,7 @@ function foobar(_a) { var _b = _a.bar, bar = _b === void 0 ? {} : _b, opts = __rest(_a, ["bar"]); opts.baz(bar); } -var C = (function () { +var C = /** @class */ (function () { function C(_a) { "use strict"; "Some other prologue"; diff --git a/tests/baselines/reference/parameterInitializersForwardReferencing.js b/tests/baselines/reference/parameterInitializersForwardReferencing.js index e43ba42fbb8c8..36b5fe31fce0b 100644 --- a/tests/baselines/reference/parameterInitializersForwardReferencing.js +++ b/tests/baselines/reference/parameterInitializersForwardReferencing.js @@ -81,7 +81,7 @@ function defaultArgArrow(a, b) { if (a === void 0) { a = function () { return function () { return b; }; }; } if (b === void 0) { b = 3; } } -var C = (function () { +var C = /** @class */ (function () { function C(a, b) { if (a === void 0) { a = b; } if (b === void 0) { b = 1; } diff --git a/tests/baselines/reference/parameterNamesInTypeParameterList.js b/tests/baselines/reference/parameterNamesInTypeParameterList.js index f4d74b89782f1..2cab9f35a5f3e 100644 --- a/tests/baselines/reference/parameterNamesInTypeParameterList.js +++ b/tests/baselines/reference/parameterNamesInTypeParameterList.js @@ -35,7 +35,7 @@ function f2(_a) { var a = _a[0]; a.b; } -var A = (function () { +var A = /** @class */ (function () { function A() { } A.prototype.m0 = function (a) { diff --git a/tests/baselines/reference/parameterPropertyInConstructor2.js b/tests/baselines/reference/parameterPropertyInConstructor2.js index 23e891ce384a6..80c2a74101921 100644 --- a/tests/baselines/reference/parameterPropertyInConstructor2.js +++ b/tests/baselines/reference/parameterPropertyInConstructor2.js @@ -11,7 +11,7 @@ module mod { //// [parameterPropertyInConstructor2.js] var mod; (function (mod) { - var Customers = (function () { + var Customers = /** @class */ (function () { function Customers(names, ages) { this.names = names; this.ages = ages; diff --git a/tests/baselines/reference/parameterPropertyInitializerInInitializers.js b/tests/baselines/reference/parameterPropertyInitializerInInitializers.js index a689ab2df79d7..2fa6d05048372 100644 --- a/tests/baselines/reference/parameterPropertyInitializerInInitializers.js +++ b/tests/baselines/reference/parameterPropertyInitializerInInitializers.js @@ -4,7 +4,7 @@ class Foo { } //// [parameterPropertyInitializerInInitializers.js] -var Foo = (function () { +var Foo = /** @class */ (function () { function Foo(x, y) { if (y === void 0) { y = x; } this.x = x; diff --git a/tests/baselines/reference/parameterPropertyOutsideConstructor.js b/tests/baselines/reference/parameterPropertyOutsideConstructor.js index 151b766cf5dc1..b542cb969f717 100644 --- a/tests/baselines/reference/parameterPropertyOutsideConstructor.js +++ b/tests/baselines/reference/parameterPropertyOutsideConstructor.js @@ -5,7 +5,7 @@ class C { } //// [parameterPropertyOutsideConstructor.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } C.prototype.foo = function (x) { diff --git a/tests/baselines/reference/parameterPropertyReferencingOtherParameter.js b/tests/baselines/reference/parameterPropertyReferencingOtherParameter.js index 35715e5feab50..3925af98ff51e 100644 --- a/tests/baselines/reference/parameterPropertyReferencingOtherParameter.js +++ b/tests/baselines/reference/parameterPropertyReferencingOtherParameter.js @@ -5,7 +5,7 @@ class Foo { //// [parameterPropertyReferencingOtherParameter.js] -var Foo = (function () { +var Foo = /** @class */ (function () { function Foo(x, y) { if (y === void 0) { y = x; } this.x = x; diff --git a/tests/baselines/reference/parameterReferenceInInitializer1.js b/tests/baselines/reference/parameterReferenceInInitializer1.js index c1ebb1722d6ba..08f1ae1cebc1e 100644 --- a/tests/baselines/reference/parameterReferenceInInitializer1.js +++ b/tests/baselines/reference/parameterReferenceInInitializer1.js @@ -16,7 +16,7 @@ class C { function fn(y, set) { return undefined; } -var C = (function () { +var C = /** @class */ (function () { function C(y, x // expected to work, but actually doesn't ) { if (x === void 0) { x = fn(y, function (y, x) { return y.x = x; }); } // expected to work, but actually doesn't diff --git a/tests/baselines/reference/parameterReferencesOtherParameter1.js b/tests/baselines/reference/parameterReferencesOtherParameter1.js index 97058974f4f19..259cde420a945 100644 --- a/tests/baselines/reference/parameterReferencesOtherParameter1.js +++ b/tests/baselines/reference/parameterReferencesOtherParameter1.js @@ -10,12 +10,12 @@ class UI { } //// [parameterReferencesOtherParameter1.js] -var Model = (function () { +var Model = /** @class */ (function () { function Model() { } return Model; }()); -var UI = (function () { +var UI = /** @class */ (function () { function UI(model, foo) { if (foo === void 0) { foo = model.name; } } diff --git a/tests/baselines/reference/parameterReferencesOtherParameter2.js b/tests/baselines/reference/parameterReferencesOtherParameter2.js index fd84f833e97fe..4b928928732f7 100644 --- a/tests/baselines/reference/parameterReferencesOtherParameter2.js +++ b/tests/baselines/reference/parameterReferencesOtherParameter2.js @@ -10,12 +10,12 @@ class UI { } //// [parameterReferencesOtherParameter2.js] -var Model = (function () { +var Model = /** @class */ (function () { function Model() { } return Model; }()); -var UI = (function () { +var UI = /** @class */ (function () { function UI(model, foo) { if (foo === void 0) { foo = model.name; } } diff --git a/tests/baselines/reference/parametersWithNoAnnotationAreAny.js b/tests/baselines/reference/parametersWithNoAnnotationAreAny.js index 54d9d1b6e037c..dcace7aed7fab 100644 --- a/tests/baselines/reference/parametersWithNoAnnotationAreAny.js +++ b/tests/baselines/reference/parametersWithNoAnnotationAreAny.js @@ -34,7 +34,7 @@ function foo(x) { return x; } var f = function foo(x) { return x; }; var f2 = function (x) { return x; }; var f3 = function (x) { return x; }; -var C = (function () { +var C = /** @class */ (function () { function C() { } C.prototype.foo = function (x) { diff --git a/tests/baselines/reference/parseErrorInHeritageClause1.js b/tests/baselines/reference/parseErrorInHeritageClause1.js index 735c756fd1f1e..90049002653f7 100644 --- a/tests/baselines/reference/parseErrorInHeritageClause1.js +++ b/tests/baselines/reference/parseErrorInHeritageClause1.js @@ -13,7 +13,7 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var C = (function (_super) { +var C = /** @class */ (function (_super) { __extends(C, _super); function C() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/parser0_004152.js b/tests/baselines/reference/parser0_004152.js index b4443e0413632..ca7f015e60e5e 100644 --- a/tests/baselines/reference/parser0_004152.js +++ b/tests/baselines/reference/parser0_004152.js @@ -7,7 +7,7 @@ export class Game { //// [parser0_004152.js] "use strict"; exports.__esModule = true; -var Game = (function () { +var Game = /** @class */ (function () { function Game() { this.position = new DisplayPosition([]); } diff --git a/tests/baselines/reference/parser509546.js b/tests/baselines/reference/parser509546.js index e99d1d1764d67..077802d0cd934 100644 --- a/tests/baselines/reference/parser509546.js +++ b/tests/baselines/reference/parser509546.js @@ -7,7 +7,7 @@ export class Logger { //// [parser509546.js] "use strict"; exports.__esModule = true; -var Logger = (function () { +var Logger = /** @class */ (function () { function Logger() { } return Logger; diff --git a/tests/baselines/reference/parser509546_1.js b/tests/baselines/reference/parser509546_1.js index 3fc82755fbf91..afbb848755296 100644 --- a/tests/baselines/reference/parser509546_1.js +++ b/tests/baselines/reference/parser509546_1.js @@ -7,7 +7,7 @@ export class Logger { //// [parser509546_1.js] "use strict"; exports.__esModule = true; -var Logger = (function () { +var Logger = /** @class */ (function () { function Logger() { } return Logger; diff --git a/tests/baselines/reference/parser509546_2.js b/tests/baselines/reference/parser509546_2.js index c16f041b2db71..112a8d3179f5d 100644 --- a/tests/baselines/reference/parser509546_2.js +++ b/tests/baselines/reference/parser509546_2.js @@ -9,7 +9,7 @@ export class Logger { //// [parser509546_2.js] "use strict"; exports.__esModule = true; -var Logger = (function () { +var Logger = /** @class */ (function () { function Logger() { } return Logger; diff --git a/tests/baselines/reference/parser509630.js b/tests/baselines/reference/parser509630.js index 8b963bf06747b..8718a3550a3db 100644 --- a/tests/baselines/reference/parser509630.js +++ b/tests/baselines/reference/parser509630.js @@ -17,13 +17,13 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var Type = (function () { +var Type = /** @class */ (function () { function Type() { this.examples = []; // typing here } return Type; }()); -var Any = (function (_super) { +var Any = /** @class */ (function (_super) { __extends(Any, _super); function Any() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/parser509667.js b/tests/baselines/reference/parser509667.js index 0b68d0e0f59bd..48dbb8115677b 100644 --- a/tests/baselines/reference/parser509667.js +++ b/tests/baselines/reference/parser509667.js @@ -12,7 +12,7 @@ class Foo { } //// [parser509667.js] -var Foo = (function () { +var Foo = /** @class */ (function () { function Foo() { } Foo.prototype.f1 = function () { diff --git a/tests/baselines/reference/parser509668.js b/tests/baselines/reference/parser509668.js index 5dfdc7d1e3137..6864244e2761d 100644 --- a/tests/baselines/reference/parser509668.js +++ b/tests/baselines/reference/parser509668.js @@ -5,7 +5,7 @@ class Foo3 { } //// [parser509668.js] -var Foo3 = (function () { +var Foo3 = /** @class */ (function () { // Doesn't work, but should function Foo3() { var args = []; diff --git a/tests/baselines/reference/parser512084.js b/tests/baselines/reference/parser512084.js index b109a3643b2b4..674d769d943a3 100644 --- a/tests/baselines/reference/parser512084.js +++ b/tests/baselines/reference/parser512084.js @@ -3,7 +3,7 @@ class foo { //// [parser512084.js] -var foo = (function () { +var foo = /** @class */ (function () { function foo() { } return foo; diff --git a/tests/baselines/reference/parser553699.js b/tests/baselines/reference/parser553699.js index a8a39c9bea6d6..23d377b2121f9 100644 --- a/tests/baselines/reference/parser553699.js +++ b/tests/baselines/reference/parser553699.js @@ -9,13 +9,13 @@ class Bar { } //// [parser553699.js] -var Foo = (function () { +var Foo = /** @class */ (function () { function Foo() { } Foo.prototype.banana = function (x) { }; return Foo; }()); -var Bar = (function () { +var Bar = /** @class */ (function () { function Bar(c) { } return Bar; diff --git a/tests/baselines/reference/parser585151.js b/tests/baselines/reference/parser585151.js index 977d90ad53834..739c0e0ff68f1 100644 --- a/tests/baselines/reference/parser585151.js +++ b/tests/baselines/reference/parser585151.js @@ -5,7 +5,7 @@ class Foo2 { //// [parser585151.js] -var Foo2 = (function () { +var Foo2 = /** @class */ (function () { function Foo2() { } return Foo2; diff --git a/tests/baselines/reference/parser618973.js b/tests/baselines/reference/parser618973.js index bfef06b061f70..560756dee1a00 100644 --- a/tests/baselines/reference/parser618973.js +++ b/tests/baselines/reference/parser618973.js @@ -7,7 +7,7 @@ export export class Foo { //// [parser618973.js] "use strict"; exports.__esModule = true; -var Foo = (function () { +var Foo = /** @class */ (function () { function Foo() { } Foo.prototype.Bar = function () { diff --git a/tests/baselines/reference/parser642331.js b/tests/baselines/reference/parser642331.js index 7d267973f47a5..eabcd8ad3582d 100644 --- a/tests/baselines/reference/parser642331.js +++ b/tests/baselines/reference/parser642331.js @@ -5,7 +5,7 @@ class test { //// [parser642331.js] -var test = (function () { +var test = /** @class */ (function () { function test(static) { } return test; diff --git a/tests/baselines/reference/parser642331_1.js b/tests/baselines/reference/parser642331_1.js index 65c7fac6c232d..0bb5be61ee580 100644 --- a/tests/baselines/reference/parser642331_1.js +++ b/tests/baselines/reference/parser642331_1.js @@ -8,7 +8,7 @@ class test { //// [parser642331_1.js] "use strict"; -var test = (function () { +var test = /** @class */ (function () { function test(static) { } return test; diff --git a/tests/baselines/reference/parserAccessibilityAfterStatic1.js b/tests/baselines/reference/parserAccessibilityAfterStatic1.js index 9e35ee6f25ed6..6f3639c5efbb5 100644 --- a/tests/baselines/reference/parserAccessibilityAfterStatic1.js +++ b/tests/baselines/reference/parserAccessibilityAfterStatic1.js @@ -6,7 +6,7 @@ static public intI: number; //// [parserAccessibilityAfterStatic1.js] -var Outer = (function () { +var Outer = /** @class */ (function () { function Outer() { } return Outer; diff --git a/tests/baselines/reference/parserAccessibilityAfterStatic10.js b/tests/baselines/reference/parserAccessibilityAfterStatic10.js index 0fe0da80156f5..d2017398bdc4d 100644 --- a/tests/baselines/reference/parserAccessibilityAfterStatic10.js +++ b/tests/baselines/reference/parserAccessibilityAfterStatic10.js @@ -6,7 +6,7 @@ static public intI() {} //// [parserAccessibilityAfterStatic10.js] -var Outer = (function () { +var Outer = /** @class */ (function () { function Outer() { } Outer.intI = function () { }; diff --git a/tests/baselines/reference/parserAccessibilityAfterStatic11.js b/tests/baselines/reference/parserAccessibilityAfterStatic11.js index 65d618934a1db..39ed9d4468a86 100644 --- a/tests/baselines/reference/parserAccessibilityAfterStatic11.js +++ b/tests/baselines/reference/parserAccessibilityAfterStatic11.js @@ -6,7 +6,7 @@ static public() {} //// [parserAccessibilityAfterStatic11.js] -var Outer = (function () { +var Outer = /** @class */ (function () { function Outer() { } Outer.public = function () { }; diff --git a/tests/baselines/reference/parserAccessibilityAfterStatic14.js b/tests/baselines/reference/parserAccessibilityAfterStatic14.js index ebb3ad88a008f..de240051dacd6 100644 --- a/tests/baselines/reference/parserAccessibilityAfterStatic14.js +++ b/tests/baselines/reference/parserAccessibilityAfterStatic14.js @@ -6,7 +6,7 @@ static public() {} //// [parserAccessibilityAfterStatic14.js] -var Outer = (function () { +var Outer = /** @class */ (function () { function Outer() { } Outer.public = function () { }; diff --git a/tests/baselines/reference/parserAccessibilityAfterStatic2.js b/tests/baselines/reference/parserAccessibilityAfterStatic2.js index b677e4c96fb9c..6eaebc8be151f 100644 --- a/tests/baselines/reference/parserAccessibilityAfterStatic2.js +++ b/tests/baselines/reference/parserAccessibilityAfterStatic2.js @@ -6,7 +6,7 @@ static public; //// [parserAccessibilityAfterStatic2.js] -var Outer = (function () { +var Outer = /** @class */ (function () { function Outer() { } return Outer; diff --git a/tests/baselines/reference/parserAccessibilityAfterStatic3.js b/tests/baselines/reference/parserAccessibilityAfterStatic3.js index 7a9ae06e43929..685822e7cd3d8 100644 --- a/tests/baselines/reference/parserAccessibilityAfterStatic3.js +++ b/tests/baselines/reference/parserAccessibilityAfterStatic3.js @@ -6,7 +6,7 @@ static public = 1; //// [parserAccessibilityAfterStatic3.js] -var Outer = (function () { +var Outer = /** @class */ (function () { function Outer() { } Outer.public = 1; diff --git a/tests/baselines/reference/parserAccessibilityAfterStatic4.js b/tests/baselines/reference/parserAccessibilityAfterStatic4.js index 9db3e36248719..c06f31e170352 100644 --- a/tests/baselines/reference/parserAccessibilityAfterStatic4.js +++ b/tests/baselines/reference/parserAccessibilityAfterStatic4.js @@ -6,7 +6,7 @@ static public: number; //// [parserAccessibilityAfterStatic4.js] -var Outer = (function () { +var Outer = /** @class */ (function () { function Outer() { } return Outer; diff --git a/tests/baselines/reference/parserAccessibilityAfterStatic5.js b/tests/baselines/reference/parserAccessibilityAfterStatic5.js index 10be7761a877c..796e32fe56686 100644 --- a/tests/baselines/reference/parserAccessibilityAfterStatic5.js +++ b/tests/baselines/reference/parserAccessibilityAfterStatic5.js @@ -6,7 +6,7 @@ static public //// [parserAccessibilityAfterStatic5.js] -var Outer = (function () { +var Outer = /** @class */ (function () { function Outer() { } return Outer; diff --git a/tests/baselines/reference/parserAccessibilityAfterStatic6.js b/tests/baselines/reference/parserAccessibilityAfterStatic6.js index 7b6e8eed7fd1a..8e8f7312194b2 100644 --- a/tests/baselines/reference/parserAccessibilityAfterStatic6.js +++ b/tests/baselines/reference/parserAccessibilityAfterStatic6.js @@ -4,7 +4,7 @@ class Outer static public //// [parserAccessibilityAfterStatic6.js] -var Outer = (function () { +var Outer = /** @class */ (function () { function Outer() { } return Outer; diff --git a/tests/baselines/reference/parserAccessibilityAfterStatic7.js b/tests/baselines/reference/parserAccessibilityAfterStatic7.js index 3bee7db9ddfc8..60fd407309694 100644 --- a/tests/baselines/reference/parserAccessibilityAfterStatic7.js +++ b/tests/baselines/reference/parserAccessibilityAfterStatic7.js @@ -6,7 +6,7 @@ static public intI() {} //// [parserAccessibilityAfterStatic7.js] -var Outer = (function () { +var Outer = /** @class */ (function () { function Outer() { } Outer.intI = function () { }; diff --git a/tests/baselines/reference/parserAccessors1.js b/tests/baselines/reference/parserAccessors1.js index fcf8a6e14ff55..b0e0981bd6ab8 100644 --- a/tests/baselines/reference/parserAccessors1.js +++ b/tests/baselines/reference/parserAccessors1.js @@ -4,7 +4,7 @@ class C { } //// [parserAccessors1.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } Object.defineProperty(C.prototype, "Foo", { diff --git a/tests/baselines/reference/parserAccessors2.js b/tests/baselines/reference/parserAccessors2.js index 6a76cf0671a19..9dced88ea816b 100644 --- a/tests/baselines/reference/parserAccessors2.js +++ b/tests/baselines/reference/parserAccessors2.js @@ -4,7 +4,7 @@ class C { } //// [parserAccessors2.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } Object.defineProperty(C.prototype, "Foo", { diff --git a/tests/baselines/reference/parserAstSpans1.js b/tests/baselines/reference/parserAstSpans1.js index ed4943046fa88..b7678d57c070d 100644 --- a/tests/baselines/reference/parserAstSpans1.js +++ b/tests/baselines/reference/parserAstSpans1.js @@ -230,7 +230,7 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } c1.prototype.i1_f1 = function () { @@ -273,7 +273,7 @@ i1_i.i1_l1(); i1_i.i1_nc_l1(); i1_i.l1(); i1_i.nc_l1(); -var c2 = (function () { +var c2 = /** @class */ (function () { /** c2 constructor*/ function c2(a) { this.c2_p1 = a; @@ -320,7 +320,7 @@ var c2 = (function () { }); return c2; }()); -var c3 = (function (_super) { +var c3 = /** @class */ (function (_super) { __extends(c3, _super); function c3() { var _this = _super.call(this, 10) || this; @@ -365,7 +365,7 @@ c2_i.c2_f1(); c2_i.c2_nc_f1(); c2_i.f1(); c2_i.nc_f1(); -var c4 = (function (_super) { +var c4 = /** @class */ (function (_super) { __extends(c4, _super); function c4() { return _super !== null && _super.apply(this, arguments) || this; @@ -402,12 +402,12 @@ i2_i.i2_nc_l1(); i2_i.l1(); i2_i.nc_l1(); /**c5 class*/ -var c5 = (function () { +var c5 = /** @class */ (function () { function c5() { } return c5; }()); -var c6 = (function (_super) { +var c6 = /** @class */ (function (_super) { __extends(c6, _super); function c6() { var _this = _super.call(this) || this; diff --git a/tests/baselines/reference/parserClass1.js b/tests/baselines/reference/parserClass1.js index 7fcbf29f242be..fe7a84992c156 100644 --- a/tests/baselines/reference/parserClass1.js +++ b/tests/baselines/reference/parserClass1.js @@ -12,7 +12,7 @@ //// [parserClass1.js] "use strict"; exports.__esModule = true; -var NullLogger = (function () { +var NullLogger = /** @class */ (function () { function NullLogger() { } NullLogger.prototype.information = function () { return false; }; diff --git a/tests/baselines/reference/parserClass2.js b/tests/baselines/reference/parserClass2.js index 80c1fd8ff6ae8..7554121c54ac0 100644 --- a/tests/baselines/reference/parserClass2.js +++ b/tests/baselines/reference/parserClass2.js @@ -8,7 +8,7 @@ //// [parserClass2.js] "use strict"; exports.__esModule = true; -var LoggerAdapter = (function () { +var LoggerAdapter = /** @class */ (function () { function LoggerAdapter(logger) { this.logger = logger; this._information = this.logger.information(); diff --git a/tests/baselines/reference/parserClassDeclaration1.js b/tests/baselines/reference/parserClassDeclaration1.js index 85fe94e04cc1a..f06438cd00055 100644 --- a/tests/baselines/reference/parserClassDeclaration1.js +++ b/tests/baselines/reference/parserClassDeclaration1.js @@ -13,7 +13,7 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var C = (function (_super) { +var C = /** @class */ (function (_super) { __extends(C, _super); function C() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/parserClassDeclaration10.js b/tests/baselines/reference/parserClassDeclaration10.js index 9af82a82f5246..f135be18d7d4f 100644 --- a/tests/baselines/reference/parserClassDeclaration10.js +++ b/tests/baselines/reference/parserClassDeclaration10.js @@ -5,7 +5,7 @@ class C { } //// [parserClassDeclaration10.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } return C; diff --git a/tests/baselines/reference/parserClassDeclaration11.js b/tests/baselines/reference/parserClassDeclaration11.js index 5749fa24f855b..254c4062d2e32 100644 --- a/tests/baselines/reference/parserClassDeclaration11.js +++ b/tests/baselines/reference/parserClassDeclaration11.js @@ -5,7 +5,7 @@ class C { } //// [parserClassDeclaration11.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } C.prototype.foo = function () { }; diff --git a/tests/baselines/reference/parserClassDeclaration12.js b/tests/baselines/reference/parserClassDeclaration12.js index e4458c09ef687..c3f1217de408d 100644 --- a/tests/baselines/reference/parserClassDeclaration12.js +++ b/tests/baselines/reference/parserClassDeclaration12.js @@ -5,7 +5,7 @@ class C { } //// [parserClassDeclaration12.js] -var C = (function () { +var C = /** @class */ (function () { function C(a) { } return C; diff --git a/tests/baselines/reference/parserClassDeclaration13.js b/tests/baselines/reference/parserClassDeclaration13.js index ad0ca6d502f2d..f4e4cc0ec97bc 100644 --- a/tests/baselines/reference/parserClassDeclaration13.js +++ b/tests/baselines/reference/parserClassDeclaration13.js @@ -5,7 +5,7 @@ class C { } //// [parserClassDeclaration13.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } C.prototype.bar = function () { }; diff --git a/tests/baselines/reference/parserClassDeclaration14.js b/tests/baselines/reference/parserClassDeclaration14.js index 724337abf0016..c5d42a93d9bff 100644 --- a/tests/baselines/reference/parserClassDeclaration14.js +++ b/tests/baselines/reference/parserClassDeclaration14.js @@ -5,7 +5,7 @@ class C { } //// [parserClassDeclaration14.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } return C; diff --git a/tests/baselines/reference/parserClassDeclaration15.js b/tests/baselines/reference/parserClassDeclaration15.js index 5d96374d18d4b..17ddd49173d90 100644 --- a/tests/baselines/reference/parserClassDeclaration15.js +++ b/tests/baselines/reference/parserClassDeclaration15.js @@ -5,7 +5,7 @@ class C { } //// [parserClassDeclaration15.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } return C; diff --git a/tests/baselines/reference/parserClassDeclaration16.js b/tests/baselines/reference/parserClassDeclaration16.js index 94ce889b9ba58..7664f4005b698 100644 --- a/tests/baselines/reference/parserClassDeclaration16.js +++ b/tests/baselines/reference/parserClassDeclaration16.js @@ -5,7 +5,7 @@ class C { } //// [parserClassDeclaration16.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } C.prototype.foo = function () { }; diff --git a/tests/baselines/reference/parserClassDeclaration19.js b/tests/baselines/reference/parserClassDeclaration19.js index 9be5032e6986d..68a61d5b20f8c 100644 --- a/tests/baselines/reference/parserClassDeclaration19.js +++ b/tests/baselines/reference/parserClassDeclaration19.js @@ -5,7 +5,7 @@ class C { } //// [parserClassDeclaration19.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } C.prototype["foo"] = function () { }; diff --git a/tests/baselines/reference/parserClassDeclaration2.js b/tests/baselines/reference/parserClassDeclaration2.js index b462ee6e31e95..8fac1ea440a00 100644 --- a/tests/baselines/reference/parserClassDeclaration2.js +++ b/tests/baselines/reference/parserClassDeclaration2.js @@ -3,7 +3,7 @@ class C implements A implements B { } //// [parserClassDeclaration2.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } return C; diff --git a/tests/baselines/reference/parserClassDeclaration20.js b/tests/baselines/reference/parserClassDeclaration20.js index 56dc7c2ce9df9..c625f2b216e60 100644 --- a/tests/baselines/reference/parserClassDeclaration20.js +++ b/tests/baselines/reference/parserClassDeclaration20.js @@ -5,7 +5,7 @@ class C { } //// [parserClassDeclaration20.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } C.prototype["0"] = function () { }; diff --git a/tests/baselines/reference/parserClassDeclaration21.js b/tests/baselines/reference/parserClassDeclaration21.js index c28d25963c282..0d079eb4548c6 100644 --- a/tests/baselines/reference/parserClassDeclaration21.js +++ b/tests/baselines/reference/parserClassDeclaration21.js @@ -5,7 +5,7 @@ class C { } //// [parserClassDeclaration21.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } C.prototype[1] = function () { }; diff --git a/tests/baselines/reference/parserClassDeclaration22.js b/tests/baselines/reference/parserClassDeclaration22.js index 2b979579ddac0..8f10d46f988fd 100644 --- a/tests/baselines/reference/parserClassDeclaration22.js +++ b/tests/baselines/reference/parserClassDeclaration22.js @@ -5,7 +5,7 @@ class C { } //// [parserClassDeclaration22.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } C.prototype["bar"] = function () { }; diff --git a/tests/baselines/reference/parserClassDeclaration23.js b/tests/baselines/reference/parserClassDeclaration23.js index f9d8d0f8f5aea..729e2b011ae01 100644 --- a/tests/baselines/reference/parserClassDeclaration23.js +++ b/tests/baselines/reference/parserClassDeclaration23.js @@ -3,7 +3,7 @@ class C\u0032 { } //// [parserClassDeclaration23.js] -var C\u0032 = (function () { +var C\u0032 = /** @class */ (function () { function C\u0032() { } return C\u0032; diff --git a/tests/baselines/reference/parserClassDeclaration24.js b/tests/baselines/reference/parserClassDeclaration24.js index b4b086253dc67..481a800d01249 100644 --- a/tests/baselines/reference/parserClassDeclaration24.js +++ b/tests/baselines/reference/parserClassDeclaration24.js @@ -3,7 +3,7 @@ class any { } //// [parserClassDeclaration24.js] -var any = (function () { +var any = /** @class */ (function () { function any() { } return any; diff --git a/tests/baselines/reference/parserClassDeclaration25.js b/tests/baselines/reference/parserClassDeclaration25.js index f8ab42f19bd1d..e149d406a7edf 100644 --- a/tests/baselines/reference/parserClassDeclaration25.js +++ b/tests/baselines/reference/parserClassDeclaration25.js @@ -10,7 +10,7 @@ class List implements IList { //// [parserClassDeclaration25.js] -var List = (function () { +var List = /** @class */ (function () { function List() { } return List; diff --git a/tests/baselines/reference/parserClassDeclaration26.js b/tests/baselines/reference/parserClassDeclaration26.js index 3b5751b07cbb8..ba669063c057c 100644 --- a/tests/baselines/reference/parserClassDeclaration26.js +++ b/tests/baselines/reference/parserClassDeclaration26.js @@ -5,7 +5,7 @@ class C { } //// [parserClassDeclaration26.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } return C; diff --git a/tests/baselines/reference/parserClassDeclaration3.js b/tests/baselines/reference/parserClassDeclaration3.js index d627784985dc6..d6a141129972b 100644 --- a/tests/baselines/reference/parserClassDeclaration3.js +++ b/tests/baselines/reference/parserClassDeclaration3.js @@ -13,7 +13,7 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var C = (function (_super) { +var C = /** @class */ (function (_super) { __extends(C, _super); function C() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/parserClassDeclaration4.js b/tests/baselines/reference/parserClassDeclaration4.js index 318833c5e9136..c41549cc34eec 100644 --- a/tests/baselines/reference/parserClassDeclaration4.js +++ b/tests/baselines/reference/parserClassDeclaration4.js @@ -13,7 +13,7 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var C = (function (_super) { +var C = /** @class */ (function (_super) { __extends(C, _super); function C() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/parserClassDeclaration5.js b/tests/baselines/reference/parserClassDeclaration5.js index e5b2c33721497..3eb9fd49a82ca 100644 --- a/tests/baselines/reference/parserClassDeclaration5.js +++ b/tests/baselines/reference/parserClassDeclaration5.js @@ -13,7 +13,7 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var C = (function (_super) { +var C = /** @class */ (function (_super) { __extends(C, _super); function C() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/parserClassDeclaration6.js b/tests/baselines/reference/parserClassDeclaration6.js index 0d6049c9ba9c3..589b832414daa 100644 --- a/tests/baselines/reference/parserClassDeclaration6.js +++ b/tests/baselines/reference/parserClassDeclaration6.js @@ -13,7 +13,7 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var C = (function (_super) { +var C = /** @class */ (function (_super) { __extends(C, _super); function C() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/parserClassDeclaration8.js b/tests/baselines/reference/parserClassDeclaration8.js index 1698fa169dda7..332949ec557a6 100644 --- a/tests/baselines/reference/parserClassDeclaration8.js +++ b/tests/baselines/reference/parserClassDeclaration8.js @@ -4,7 +4,7 @@ class C { } //// [parserClassDeclaration8.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } return C; diff --git a/tests/baselines/reference/parserClassDeclaration9.js b/tests/baselines/reference/parserClassDeclaration9.js index b45962eacf770..13e7952daf7e0 100644 --- a/tests/baselines/reference/parserClassDeclaration9.js +++ b/tests/baselines/reference/parserClassDeclaration9.js @@ -4,7 +4,7 @@ class C { } //// [parserClassDeclaration9.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } return C; diff --git a/tests/baselines/reference/parserClassDeclarationIndexSignature1.js b/tests/baselines/reference/parserClassDeclarationIndexSignature1.js index 430ee220db8f5..424c9b35ceb01 100644 --- a/tests/baselines/reference/parserClassDeclarationIndexSignature1.js +++ b/tests/baselines/reference/parserClassDeclarationIndexSignature1.js @@ -4,7 +4,7 @@ class C { } //// [parserClassDeclarationIndexSignature1.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } return C; diff --git a/tests/baselines/reference/parserConstructorDeclaration1.js b/tests/baselines/reference/parserConstructorDeclaration1.js index bd29f61c884a9..9884a32d0fadf 100644 --- a/tests/baselines/reference/parserConstructorDeclaration1.js +++ b/tests/baselines/reference/parserConstructorDeclaration1.js @@ -4,7 +4,7 @@ class C { } //// [parserConstructorDeclaration1.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } return C; diff --git a/tests/baselines/reference/parserConstructorDeclaration10.js b/tests/baselines/reference/parserConstructorDeclaration10.js index 96470c8062430..918617f91dd1e 100644 --- a/tests/baselines/reference/parserConstructorDeclaration10.js +++ b/tests/baselines/reference/parserConstructorDeclaration10.js @@ -4,7 +4,7 @@ class C { } //// [parserConstructorDeclaration10.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } return C; diff --git a/tests/baselines/reference/parserConstructorDeclaration11.js b/tests/baselines/reference/parserConstructorDeclaration11.js index 60e012ded4baf..e8b6977cb3e00 100644 --- a/tests/baselines/reference/parserConstructorDeclaration11.js +++ b/tests/baselines/reference/parserConstructorDeclaration11.js @@ -4,7 +4,7 @@ class C { } //// [parserConstructorDeclaration11.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } return C; diff --git a/tests/baselines/reference/parserConstructorDeclaration12.js b/tests/baselines/reference/parserConstructorDeclaration12.js index 025b994ff0421..f9150aeb5a94a 100644 --- a/tests/baselines/reference/parserConstructorDeclaration12.js +++ b/tests/baselines/reference/parserConstructorDeclaration12.js @@ -11,7 +11,7 @@ class C { } //// [parserConstructorDeclaration12.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } return C; diff --git a/tests/baselines/reference/parserConstructorDeclaration2.js b/tests/baselines/reference/parserConstructorDeclaration2.js index 929b4dd295da3..839431a1af14b 100644 --- a/tests/baselines/reference/parserConstructorDeclaration2.js +++ b/tests/baselines/reference/parserConstructorDeclaration2.js @@ -4,7 +4,7 @@ class C { } //// [parserConstructorDeclaration2.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } return C; diff --git a/tests/baselines/reference/parserConstructorDeclaration3.js b/tests/baselines/reference/parserConstructorDeclaration3.js index f45e854d87801..cafbba5e7073a 100644 --- a/tests/baselines/reference/parserConstructorDeclaration3.js +++ b/tests/baselines/reference/parserConstructorDeclaration3.js @@ -4,7 +4,7 @@ class C { } //// [parserConstructorDeclaration3.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } return C; diff --git a/tests/baselines/reference/parserConstructorDeclaration4.js b/tests/baselines/reference/parserConstructorDeclaration4.js index 46e1602a21f4e..d50c0658d81e1 100644 --- a/tests/baselines/reference/parserConstructorDeclaration4.js +++ b/tests/baselines/reference/parserConstructorDeclaration4.js @@ -4,7 +4,7 @@ class C { } //// [parserConstructorDeclaration4.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } return C; diff --git a/tests/baselines/reference/parserConstructorDeclaration5.js b/tests/baselines/reference/parserConstructorDeclaration5.js index a18d5351c77ba..ebfd1800ea524 100644 --- a/tests/baselines/reference/parserConstructorDeclaration5.js +++ b/tests/baselines/reference/parserConstructorDeclaration5.js @@ -4,7 +4,7 @@ class C { } //// [parserConstructorDeclaration5.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } return C; diff --git a/tests/baselines/reference/parserConstructorDeclaration6.js b/tests/baselines/reference/parserConstructorDeclaration6.js index eca0638116d7a..61b92ae0ab452 100644 --- a/tests/baselines/reference/parserConstructorDeclaration6.js +++ b/tests/baselines/reference/parserConstructorDeclaration6.js @@ -4,7 +4,7 @@ class C { } //// [parserConstructorDeclaration6.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } return C; diff --git a/tests/baselines/reference/parserConstructorDeclaration7.js b/tests/baselines/reference/parserConstructorDeclaration7.js index 2b19cfab11141..96c97ac3f088f 100644 --- a/tests/baselines/reference/parserConstructorDeclaration7.js +++ b/tests/baselines/reference/parserConstructorDeclaration7.js @@ -4,7 +4,7 @@ class C { } //// [parserConstructorDeclaration7.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } return C; diff --git a/tests/baselines/reference/parserConstructorDeclaration8.js b/tests/baselines/reference/parserConstructorDeclaration8.js index 4ad3f93a1d837..4bf06b9aa39db 100644 --- a/tests/baselines/reference/parserConstructorDeclaration8.js +++ b/tests/baselines/reference/parserConstructorDeclaration8.js @@ -5,7 +5,7 @@ class C { } //// [parserConstructorDeclaration8.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } return C; diff --git a/tests/baselines/reference/parserConstructorDeclaration9.js b/tests/baselines/reference/parserConstructorDeclaration9.js index d30ed12f31361..7bf95cd3296a2 100644 --- a/tests/baselines/reference/parserConstructorDeclaration9.js +++ b/tests/baselines/reference/parserConstructorDeclaration9.js @@ -4,7 +4,7 @@ class C { } //// [parserConstructorDeclaration9.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } return C; diff --git a/tests/baselines/reference/parserES3Accessors1.js b/tests/baselines/reference/parserES3Accessors1.js index df1d416ced0e9..e27d2bfd8ac9d 100644 --- a/tests/baselines/reference/parserES3Accessors1.js +++ b/tests/baselines/reference/parserES3Accessors1.js @@ -4,7 +4,7 @@ class C { } //// [parserES3Accessors1.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } Object.defineProperty(C.prototype, "Foo", { diff --git a/tests/baselines/reference/parserES3Accessors2.js b/tests/baselines/reference/parserES3Accessors2.js index 68f4ac6737735..2c6d06aeef6b2 100644 --- a/tests/baselines/reference/parserES3Accessors2.js +++ b/tests/baselines/reference/parserES3Accessors2.js @@ -4,7 +4,7 @@ class C { } //// [parserES3Accessors2.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } Object.defineProperty(C.prototype, "Foo", { diff --git a/tests/baselines/reference/parserES5ComputedPropertyName10.js b/tests/baselines/reference/parserES5ComputedPropertyName10.js index d648ce29e9a24..78f819af37523 100644 --- a/tests/baselines/reference/parserES5ComputedPropertyName10.js +++ b/tests/baselines/reference/parserES5ComputedPropertyName10.js @@ -4,7 +4,7 @@ class C { } //// [parserES5ComputedPropertyName10.js] -var C = (function () { +var C = /** @class */ (function () { function C() { this[e] = 1; } diff --git a/tests/baselines/reference/parserES5ComputedPropertyName11.js b/tests/baselines/reference/parserES5ComputedPropertyName11.js index dd777f5308060..63c3a8a81d57f 100644 --- a/tests/baselines/reference/parserES5ComputedPropertyName11.js +++ b/tests/baselines/reference/parserES5ComputedPropertyName11.js @@ -4,7 +4,7 @@ class C { } //// [parserES5ComputedPropertyName11.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } return C; diff --git a/tests/baselines/reference/parserES5ComputedPropertyName7.js b/tests/baselines/reference/parserES5ComputedPropertyName7.js index b707d7ea74729..93fbd5a46bbc0 100644 --- a/tests/baselines/reference/parserES5ComputedPropertyName7.js +++ b/tests/baselines/reference/parserES5ComputedPropertyName7.js @@ -4,7 +4,7 @@ class C { } //// [parserES5ComputedPropertyName7.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } return C; diff --git a/tests/baselines/reference/parserES5ComputedPropertyName9.js b/tests/baselines/reference/parserES5ComputedPropertyName9.js index 904bd3b0e3279..0d15e7adcedbb 100644 --- a/tests/baselines/reference/parserES5ComputedPropertyName9.js +++ b/tests/baselines/reference/parserES5ComputedPropertyName9.js @@ -4,7 +4,7 @@ class C { } //// [parserES5ComputedPropertyName9.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } return C; diff --git a/tests/baselines/reference/parserES5SymbolIndexer2.js b/tests/baselines/reference/parserES5SymbolIndexer2.js index fbd0ff168fac0..0ae24443cff26 100644 --- a/tests/baselines/reference/parserES5SymbolIndexer2.js +++ b/tests/baselines/reference/parserES5SymbolIndexer2.js @@ -4,7 +4,7 @@ class C { } //// [parserES5SymbolIndexer2.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } return C; diff --git a/tests/baselines/reference/parserES5SymbolProperty5.js b/tests/baselines/reference/parserES5SymbolProperty5.js index e50c6ad93adb6..9042b73bbd98e 100644 --- a/tests/baselines/reference/parserES5SymbolProperty5.js +++ b/tests/baselines/reference/parserES5SymbolProperty5.js @@ -4,7 +4,7 @@ class C { } //// [parserES5SymbolProperty5.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } return C; diff --git a/tests/baselines/reference/parserES5SymbolProperty6.js b/tests/baselines/reference/parserES5SymbolProperty6.js index 67e77d29dfb36..da7c05716219e 100644 --- a/tests/baselines/reference/parserES5SymbolProperty6.js +++ b/tests/baselines/reference/parserES5SymbolProperty6.js @@ -4,7 +4,7 @@ class C { } //// [parserES5SymbolProperty6.js] -var C = (function () { +var C = /** @class */ (function () { function C() { this[Symbol.toStringTag] = ""; } diff --git a/tests/baselines/reference/parserES5SymbolProperty7.js b/tests/baselines/reference/parserES5SymbolProperty7.js index 4965f7867c310..ee8aa4227c624 100644 --- a/tests/baselines/reference/parserES5SymbolProperty7.js +++ b/tests/baselines/reference/parserES5SymbolProperty7.js @@ -4,7 +4,7 @@ class C { } //// [parserES5SymbolProperty7.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } C.prototype[Symbol.toStringTag] = function () { }; diff --git a/tests/baselines/reference/parserErrantSemicolonInClass1.js b/tests/baselines/reference/parserErrantSemicolonInClass1.js index 7dbe9f579d289..d2c223d53bebd 100644 --- a/tests/baselines/reference/parserErrantSemicolonInClass1.js +++ b/tests/baselines/reference/parserErrantSemicolonInClass1.js @@ -36,7 +36,7 @@ class a { //// [parserErrantSemicolonInClass1.js] -var a = (function () { +var a = /** @class */ (function () { function a(ns) { } a.prototype.pgF = function () { }; diff --git a/tests/baselines/reference/parserErrorRecoveryIfStatement1.js b/tests/baselines/reference/parserErrorRecoveryIfStatement1.js index 03e3de32cc175..9358acc10917a 100644 --- a/tests/baselines/reference/parserErrorRecoveryIfStatement1.js +++ b/tests/baselines/reference/parserErrorRecoveryIfStatement1.js @@ -10,7 +10,7 @@ class Foo { } //// [parserErrorRecoveryIfStatement1.js] -var Foo = (function () { +var Foo = /** @class */ (function () { function Foo() { } Foo.prototype.f1 = function () { diff --git a/tests/baselines/reference/parserErrorRecoveryIfStatement2.js b/tests/baselines/reference/parserErrorRecoveryIfStatement2.js index 84daa435711b0..c898d888f9899 100644 --- a/tests/baselines/reference/parserErrorRecoveryIfStatement2.js +++ b/tests/baselines/reference/parserErrorRecoveryIfStatement2.js @@ -10,7 +10,7 @@ class Foo { } //// [parserErrorRecoveryIfStatement2.js] -var Foo = (function () { +var Foo = /** @class */ (function () { function Foo() { } Foo.prototype.f1 = function () { diff --git a/tests/baselines/reference/parserErrorRecoveryIfStatement3.js b/tests/baselines/reference/parserErrorRecoveryIfStatement3.js index b58c0ccd524ef..670f0035340f5 100644 --- a/tests/baselines/reference/parserErrorRecoveryIfStatement3.js +++ b/tests/baselines/reference/parserErrorRecoveryIfStatement3.js @@ -10,7 +10,7 @@ class Foo { } //// [parserErrorRecoveryIfStatement3.js] -var Foo = (function () { +var Foo = /** @class */ (function () { function Foo() { } Foo.prototype.f1 = function () { diff --git a/tests/baselines/reference/parserErrorRecoveryIfStatement4.js b/tests/baselines/reference/parserErrorRecoveryIfStatement4.js index 3d5e6af1fe6aa..ead8c1c6e9c35 100644 --- a/tests/baselines/reference/parserErrorRecoveryIfStatement4.js +++ b/tests/baselines/reference/parserErrorRecoveryIfStatement4.js @@ -10,7 +10,7 @@ class Foo { } //// [parserErrorRecoveryIfStatement4.js] -var Foo = (function () { +var Foo = /** @class */ (function () { function Foo() { } Foo.prototype.f1 = function () { diff --git a/tests/baselines/reference/parserErrorRecoveryIfStatement5.js b/tests/baselines/reference/parserErrorRecoveryIfStatement5.js index b3a4f897aa7ff..54cbbcffd5ca5 100644 --- a/tests/baselines/reference/parserErrorRecoveryIfStatement5.js +++ b/tests/baselines/reference/parserErrorRecoveryIfStatement5.js @@ -10,7 +10,7 @@ class Foo { } //// [parserErrorRecoveryIfStatement5.js] -var Foo = (function () { +var Foo = /** @class */ (function () { function Foo() { } Foo.prototype.f1 = function () { diff --git a/tests/baselines/reference/parserErrorRecoveryIfStatement6.js b/tests/baselines/reference/parserErrorRecoveryIfStatement6.js index 86454bed4f2f2..39fa8e3ecf768 100644 --- a/tests/baselines/reference/parserErrorRecoveryIfStatement6.js +++ b/tests/baselines/reference/parserErrorRecoveryIfStatement6.js @@ -11,7 +11,7 @@ class Foo { //// [parserErrorRecoveryIfStatement6.js] -var Foo = (function () { +var Foo = /** @class */ (function () { function Foo() { } Foo.prototype.f1 = function () { diff --git a/tests/baselines/reference/parserErrorRecovery_Block3.js b/tests/baselines/reference/parserErrorRecovery_Block3.js index 842533c680143..8bb89b92628a6 100644 --- a/tests/baselines/reference/parserErrorRecovery_Block3.js +++ b/tests/baselines/reference/parserErrorRecovery_Block3.js @@ -7,7 +7,7 @@ class C { } //// [parserErrorRecovery_Block3.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } C.prototype.a = function () { diff --git a/tests/baselines/reference/parserErrorRecovery_ClassElement1.js b/tests/baselines/reference/parserErrorRecovery_ClassElement1.js index 16f796a0fac40..9740e70d401cb 100644 --- a/tests/baselines/reference/parserErrorRecovery_ClassElement1.js +++ b/tests/baselines/reference/parserErrorRecovery_ClassElement1.js @@ -7,14 +7,14 @@ class D { } //// [parserErrorRecovery_ClassElement1.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } return C; }()); // Classes can't be nested. So we should bail out of parsing here and recover // this as a source unit element. -var D = (function () { +var D = /** @class */ (function () { function D() { } return D; diff --git a/tests/baselines/reference/parserErrorRecovery_ClassElement2.js b/tests/baselines/reference/parserErrorRecovery_ClassElement2.js index bab50d52751b5..583b059fe94c7 100644 --- a/tests/baselines/reference/parserErrorRecovery_ClassElement2.js +++ b/tests/baselines/reference/parserErrorRecovery_ClassElement2.js @@ -9,7 +9,7 @@ module M { //// [parserErrorRecovery_ClassElement2.js] var M; (function (M) { - var C = (function () { + var C = /** @class */ (function () { function C() { } return C; diff --git a/tests/baselines/reference/parserErrorRecovery_ClassElement3.js b/tests/baselines/reference/parserErrorRecovery_ClassElement3.js index b5021218ada74..36d98fa54003e 100644 --- a/tests/baselines/reference/parserErrorRecovery_ClassElement3.js +++ b/tests/baselines/reference/parserErrorRecovery_ClassElement3.js @@ -10,7 +10,7 @@ module M { //// [parserErrorRecovery_ClassElement3.js] var M; (function (M) { - var C = (function () { + var C = /** @class */ (function () { function C() { } return C; diff --git a/tests/baselines/reference/parserErrorRecovery_ExtendsOrImplementsClause1.js b/tests/baselines/reference/parserErrorRecovery_ExtendsOrImplementsClause1.js index 1215631857e1d..65dce714ac9be 100644 --- a/tests/baselines/reference/parserErrorRecovery_ExtendsOrImplementsClause1.js +++ b/tests/baselines/reference/parserErrorRecovery_ExtendsOrImplementsClause1.js @@ -3,7 +3,7 @@ class C extends { } //// [parserErrorRecovery_ExtendsOrImplementsClause1.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } return C; diff --git a/tests/baselines/reference/parserErrorRecovery_ExtendsOrImplementsClause2.js b/tests/baselines/reference/parserErrorRecovery_ExtendsOrImplementsClause2.js index 30f2e7f5698fb..a2809edd3dc89 100644 --- a/tests/baselines/reference/parserErrorRecovery_ExtendsOrImplementsClause2.js +++ b/tests/baselines/reference/parserErrorRecovery_ExtendsOrImplementsClause2.js @@ -13,7 +13,7 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var C = (function (_super) { +var C = /** @class */ (function (_super) { __extends(C, _super); function C() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/parserErrorRecovery_ExtendsOrImplementsClause3.js b/tests/baselines/reference/parserErrorRecovery_ExtendsOrImplementsClause3.js index 33bba3cf860dd..e9146005fabfc 100644 --- a/tests/baselines/reference/parserErrorRecovery_ExtendsOrImplementsClause3.js +++ b/tests/baselines/reference/parserErrorRecovery_ExtendsOrImplementsClause3.js @@ -3,7 +3,7 @@ class C extends implements A { } //// [parserErrorRecovery_ExtendsOrImplementsClause3.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } return C; diff --git a/tests/baselines/reference/parserErrorRecovery_ExtendsOrImplementsClause4.js b/tests/baselines/reference/parserErrorRecovery_ExtendsOrImplementsClause4.js index 42947c5fcb8f6..3e7c9abea9531 100644 --- a/tests/baselines/reference/parserErrorRecovery_ExtendsOrImplementsClause4.js +++ b/tests/baselines/reference/parserErrorRecovery_ExtendsOrImplementsClause4.js @@ -13,7 +13,7 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var C = (function (_super) { +var C = /** @class */ (function (_super) { __extends(C, _super); function C() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/parserErrorRecovery_ExtendsOrImplementsClause5.js b/tests/baselines/reference/parserErrorRecovery_ExtendsOrImplementsClause5.js index 1e62709949d0c..addb0cd362388 100644 --- a/tests/baselines/reference/parserErrorRecovery_ExtendsOrImplementsClause5.js +++ b/tests/baselines/reference/parserErrorRecovery_ExtendsOrImplementsClause5.js @@ -13,7 +13,7 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var C = (function (_super) { +var C = /** @class */ (function (_super) { __extends(C, _super); function C() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/parserErrorRecovery_IncompleteMemberVariable1.js b/tests/baselines/reference/parserErrorRecovery_IncompleteMemberVariable1.js index 9bb4395e55655..117b7f7d9a2fe 100644 --- a/tests/baselines/reference/parserErrorRecovery_IncompleteMemberVariable1.js +++ b/tests/baselines/reference/parserErrorRecovery_IncompleteMemberVariable1.js @@ -33,7 +33,7 @@ var dist = p.getDist(); var Shapes; (function (Shapes) { // Class - var Point = (function () { + var Point = /** @class */ (function () { // Constructor function Point(x, y) { this.x = x; diff --git a/tests/baselines/reference/parserErrorRecovery_IncompleteMemberVariable2.js b/tests/baselines/reference/parserErrorRecovery_IncompleteMemberVariable2.js index 0ee73b8b1e5bf..757ec40cffbc6 100644 --- a/tests/baselines/reference/parserErrorRecovery_IncompleteMemberVariable2.js +++ b/tests/baselines/reference/parserErrorRecovery_IncompleteMemberVariable2.js @@ -33,7 +33,7 @@ var dist = p.getDist(); var Shapes; (function (Shapes) { // Class - var Point = (function () { + var Point = /** @class */ (function () { // Constructor function Point(x, y) { this.x = x; diff --git a/tests/baselines/reference/parserErrorRecovery_ParameterList6.js b/tests/baselines/reference/parserErrorRecovery_ParameterList6.js index 7c221aaa20ac3..c5d8463f3693e 100644 --- a/tests/baselines/reference/parserErrorRecovery_ParameterList6.js +++ b/tests/baselines/reference/parserErrorRecovery_ParameterList6.js @@ -4,7 +4,7 @@ class Foo { } //// [parserErrorRecovery_ParameterList6.js] -var Foo = (function () { +var Foo = /** @class */ (function () { function Foo() { } return Foo; diff --git a/tests/baselines/reference/parserErrorRecovery_SourceUnit1.js b/tests/baselines/reference/parserErrorRecovery_SourceUnit1.js index a763012e0e631..8e2c566bb3a4e 100644 --- a/tests/baselines/reference/parserErrorRecovery_SourceUnit1.js +++ b/tests/baselines/reference/parserErrorRecovery_SourceUnit1.js @@ -6,12 +6,12 @@ class D { } //// [parserErrorRecovery_SourceUnit1.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } return C; }()); -var D = (function () { +var D = /** @class */ (function () { function D() { } return D; diff --git a/tests/baselines/reference/parserErrorRecovery_SwitchStatement2.js b/tests/baselines/reference/parserErrorRecovery_SwitchStatement2.js index 093b8ae7231c9..d85cb61ea1569 100644 --- a/tests/baselines/reference/parserErrorRecovery_SwitchStatement2.js +++ b/tests/baselines/reference/parserErrorRecovery_SwitchStatement2.js @@ -7,11 +7,11 @@ class D { } //// [parserErrorRecovery_SwitchStatement2.js] -var C = (function () { +var C = /** @class */ (function () { function C() { switch (e) { } - var D = (function () { + var D = /** @class */ (function () { function D() { } return D; diff --git a/tests/baselines/reference/parserExportAssignment7.js b/tests/baselines/reference/parserExportAssignment7.js index dd6750bec323c..0801bda080c1e 100644 --- a/tests/baselines/reference/parserExportAssignment7.js +++ b/tests/baselines/reference/parserExportAssignment7.js @@ -6,7 +6,7 @@ export = B; //// [parserExportAssignment7.js] "use strict"; -var C = (function () { +var C = /** @class */ (function () { function C() { } return C; diff --git a/tests/baselines/reference/parserExportAssignment8.js b/tests/baselines/reference/parserExportAssignment8.js index 07ff257fb6193..db0c621c88095 100644 --- a/tests/baselines/reference/parserExportAssignment8.js +++ b/tests/baselines/reference/parserExportAssignment8.js @@ -6,7 +6,7 @@ export class C { //// [parserExportAssignment8.js] "use strict"; -var C = (function () { +var C = /** @class */ (function () { function C() { } return C; diff --git a/tests/baselines/reference/parserGenericClass1.js b/tests/baselines/reference/parserGenericClass1.js index 1ba9b0f49c515..282f97ddf2bbc 100644 --- a/tests/baselines/reference/parserGenericClass1.js +++ b/tests/baselines/reference/parserGenericClass1.js @@ -3,7 +3,7 @@ class C { } //// [parserGenericClass1.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } return C; diff --git a/tests/baselines/reference/parserGenericClass2.js b/tests/baselines/reference/parserGenericClass2.js index ef40783ab7979..e5f5951d1c4ae 100644 --- a/tests/baselines/reference/parserGenericClass2.js +++ b/tests/baselines/reference/parserGenericClass2.js @@ -3,7 +3,7 @@ class C { } //// [parserGenericClass2.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } return C; diff --git a/tests/baselines/reference/parserGenericConstraint1.js b/tests/baselines/reference/parserGenericConstraint1.js index 395a65a52fb56..6a72f19b30283 100644 --- a/tests/baselines/reference/parserGenericConstraint1.js +++ b/tests/baselines/reference/parserGenericConstraint1.js @@ -3,7 +3,7 @@ class C { } //// [parserGenericConstraint1.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } return C; diff --git a/tests/baselines/reference/parserGenericConstraint2.js b/tests/baselines/reference/parserGenericConstraint2.js index 18218ecd992d1..33fb2b93bc04c 100644 --- a/tests/baselines/reference/parserGenericConstraint2.js +++ b/tests/baselines/reference/parserGenericConstraint2.js @@ -3,7 +3,7 @@ class C > { } //// [parserGenericConstraint2.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } return C; diff --git a/tests/baselines/reference/parserGenericConstraint3.js b/tests/baselines/reference/parserGenericConstraint3.js index a8a6669186c79..4dafbfa863b96 100644 --- a/tests/baselines/reference/parserGenericConstraint3.js +++ b/tests/baselines/reference/parserGenericConstraint3.js @@ -3,7 +3,7 @@ class C> { } //// [parserGenericConstraint3.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } return C; diff --git a/tests/baselines/reference/parserGenericConstraint4.js b/tests/baselines/reference/parserGenericConstraint4.js index 69e26feba8fc3..2f1cc68a00045 100644 --- a/tests/baselines/reference/parserGenericConstraint4.js +++ b/tests/baselines/reference/parserGenericConstraint4.js @@ -3,7 +3,7 @@ class C > > { } //// [parserGenericConstraint4.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } return C; diff --git a/tests/baselines/reference/parserGenericConstraint5.js b/tests/baselines/reference/parserGenericConstraint5.js index 46b1959493706..5229c4f7c762c 100644 --- a/tests/baselines/reference/parserGenericConstraint5.js +++ b/tests/baselines/reference/parserGenericConstraint5.js @@ -3,7 +3,7 @@ class C> > { } //// [parserGenericConstraint5.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } return C; diff --git a/tests/baselines/reference/parserGenericConstraint6.js b/tests/baselines/reference/parserGenericConstraint6.js index 1dd809e41188a..f19a8a95a7047 100644 --- a/tests/baselines/reference/parserGenericConstraint6.js +++ b/tests/baselines/reference/parserGenericConstraint6.js @@ -3,7 +3,7 @@ class C >> { } //// [parserGenericConstraint6.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } return C; diff --git a/tests/baselines/reference/parserGenericConstraint7.js b/tests/baselines/reference/parserGenericConstraint7.js index 6d3107a1c4fe4..ff94d41b33765 100644 --- a/tests/baselines/reference/parserGenericConstraint7.js +++ b/tests/baselines/reference/parserGenericConstraint7.js @@ -3,7 +3,7 @@ class C>> { } //// [parserGenericConstraint7.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } return C; diff --git a/tests/baselines/reference/parserGenericsInTypeContexts1.js b/tests/baselines/reference/parserGenericsInTypeContexts1.js index ef5452a1638a9..05af4a00d20e7 100644 --- a/tests/baselines/reference/parserGenericsInTypeContexts1.js +++ b/tests/baselines/reference/parserGenericsInTypeContexts1.js @@ -28,7 +28,7 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var C = (function (_super) { +var C = /** @class */ (function (_super) { __extends(C, _super); function C() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/parserGenericsInTypeContexts2.js b/tests/baselines/reference/parserGenericsInTypeContexts2.js index 9302db655bfdc..7d31dad0911d5 100644 --- a/tests/baselines/reference/parserGenericsInTypeContexts2.js +++ b/tests/baselines/reference/parserGenericsInTypeContexts2.js @@ -28,7 +28,7 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var C = (function (_super) { +var C = /** @class */ (function (_super) { __extends(C, _super); function C() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/parserGetAccessorWithTypeParameters1.js b/tests/baselines/reference/parserGetAccessorWithTypeParameters1.js index 467eb93d0da84..b5525fb4ca98e 100644 --- a/tests/baselines/reference/parserGetAccessorWithTypeParameters1.js +++ b/tests/baselines/reference/parserGetAccessorWithTypeParameters1.js @@ -4,7 +4,7 @@ class C { } //// [parserGetAccessorWithTypeParameters1.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } Object.defineProperty(C.prototype, "foo", { diff --git a/tests/baselines/reference/parserIndexMemberDeclaration1.js b/tests/baselines/reference/parserIndexMemberDeclaration1.js index 5db1aebd6835d..178a390e21a3b 100644 --- a/tests/baselines/reference/parserIndexMemberDeclaration1.js +++ b/tests/baselines/reference/parserIndexMemberDeclaration1.js @@ -4,7 +4,7 @@ class C { } //// [parserIndexMemberDeclaration1.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } return C; diff --git a/tests/baselines/reference/parserIndexMemberDeclaration10.js b/tests/baselines/reference/parserIndexMemberDeclaration10.js index 99d41e5410be2..26293e48d59c5 100644 --- a/tests/baselines/reference/parserIndexMemberDeclaration10.js +++ b/tests/baselines/reference/parserIndexMemberDeclaration10.js @@ -4,7 +4,7 @@ class C { } //// [parserIndexMemberDeclaration10.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } return C; diff --git a/tests/baselines/reference/parserIndexMemberDeclaration2.js b/tests/baselines/reference/parserIndexMemberDeclaration2.js index afd60f7e2b109..ce3de5e6a05df 100644 --- a/tests/baselines/reference/parserIndexMemberDeclaration2.js +++ b/tests/baselines/reference/parserIndexMemberDeclaration2.js @@ -5,7 +5,7 @@ class C { } //// [parserIndexMemberDeclaration2.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } return C; diff --git a/tests/baselines/reference/parserIndexMemberDeclaration3.js b/tests/baselines/reference/parserIndexMemberDeclaration3.js index 1f06401dc0c7e..85c032fa65a83 100644 --- a/tests/baselines/reference/parserIndexMemberDeclaration3.js +++ b/tests/baselines/reference/parserIndexMemberDeclaration3.js @@ -5,7 +5,7 @@ class C { } //// [parserIndexMemberDeclaration3.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } return C; diff --git a/tests/baselines/reference/parserIndexMemberDeclaration4.js b/tests/baselines/reference/parserIndexMemberDeclaration4.js index 9b054efcec3e7..983b8d46baf88 100644 --- a/tests/baselines/reference/parserIndexMemberDeclaration4.js +++ b/tests/baselines/reference/parserIndexMemberDeclaration4.js @@ -4,7 +4,7 @@ class C { } //// [parserIndexMemberDeclaration4.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } return C; diff --git a/tests/baselines/reference/parserIndexMemberDeclaration5.js b/tests/baselines/reference/parserIndexMemberDeclaration5.js index df681657a1569..cab165237e5ce 100644 --- a/tests/baselines/reference/parserIndexMemberDeclaration5.js +++ b/tests/baselines/reference/parserIndexMemberDeclaration5.js @@ -4,7 +4,7 @@ class C { } //// [parserIndexMemberDeclaration5.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } return C; diff --git a/tests/baselines/reference/parserIndexMemberDeclaration6.js b/tests/baselines/reference/parserIndexMemberDeclaration6.js index c5356f58a6576..7f4481f1d142b 100644 --- a/tests/baselines/reference/parserIndexMemberDeclaration6.js +++ b/tests/baselines/reference/parserIndexMemberDeclaration6.js @@ -4,7 +4,7 @@ class C { } //// [parserIndexMemberDeclaration6.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } return C; diff --git a/tests/baselines/reference/parserIndexMemberDeclaration7.js b/tests/baselines/reference/parserIndexMemberDeclaration7.js index 214f0d244afd1..a73ed0c2a8b65 100644 --- a/tests/baselines/reference/parserIndexMemberDeclaration7.js +++ b/tests/baselines/reference/parserIndexMemberDeclaration7.js @@ -4,7 +4,7 @@ class C { } //// [parserIndexMemberDeclaration7.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } return C; diff --git a/tests/baselines/reference/parserIndexMemberDeclaration8.js b/tests/baselines/reference/parserIndexMemberDeclaration8.js index c97df0c29483c..26c9af51776e4 100644 --- a/tests/baselines/reference/parserIndexMemberDeclaration8.js +++ b/tests/baselines/reference/parserIndexMemberDeclaration8.js @@ -4,7 +4,7 @@ class C { } //// [parserIndexMemberDeclaration8.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } return C; diff --git a/tests/baselines/reference/parserIndexMemberDeclaration9.js b/tests/baselines/reference/parserIndexMemberDeclaration9.js index 3289715b3a3a5..c27fb882543dc 100644 --- a/tests/baselines/reference/parserIndexMemberDeclaration9.js +++ b/tests/baselines/reference/parserIndexMemberDeclaration9.js @@ -4,7 +4,7 @@ class C { } //// [parserIndexMemberDeclaration9.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } return C; diff --git a/tests/baselines/reference/parserInvalidIdentifiersInVariableStatements1.js b/tests/baselines/reference/parserInvalidIdentifiersInVariableStatements1.js index 039d9d8926fcf..9810b933aad24 100644 --- a/tests/baselines/reference/parserInvalidIdentifiersInVariableStatements1.js +++ b/tests/baselines/reference/parserInvalidIdentifiersInVariableStatements1.js @@ -9,7 +9,7 @@ var bar; var ; var foo; var ; -var default_1 = (function () { +var default_1 = /** @class */ (function () { function default_1() { } return default_1; diff --git a/tests/baselines/reference/parserMemberAccessor1.js b/tests/baselines/reference/parserMemberAccessor1.js index ffbc62c830053..b7caa9737e034 100644 --- a/tests/baselines/reference/parserMemberAccessor1.js +++ b/tests/baselines/reference/parserMemberAccessor1.js @@ -5,7 +5,7 @@ class C { } //// [parserMemberAccessor1.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } Object.defineProperty(C.prototype, "foo", { diff --git a/tests/baselines/reference/parserMemberAccessorDeclaration1.js b/tests/baselines/reference/parserMemberAccessorDeclaration1.js index eec8364cacb08..4b5110cbc7d04 100644 --- a/tests/baselines/reference/parserMemberAccessorDeclaration1.js +++ b/tests/baselines/reference/parserMemberAccessorDeclaration1.js @@ -4,7 +4,7 @@ class C { } //// [parserMemberAccessorDeclaration1.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } Object.defineProperty(C.prototype, "a", { diff --git a/tests/baselines/reference/parserMemberAccessorDeclaration10.js b/tests/baselines/reference/parserMemberAccessorDeclaration10.js index 6dd5e1901983e..927767ba844d9 100644 --- a/tests/baselines/reference/parserMemberAccessorDeclaration10.js +++ b/tests/baselines/reference/parserMemberAccessorDeclaration10.js @@ -4,7 +4,7 @@ class C { } //// [parserMemberAccessorDeclaration10.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } Object.defineProperty(C.prototype, "Foo", { diff --git a/tests/baselines/reference/parserMemberAccessorDeclaration11.js b/tests/baselines/reference/parserMemberAccessorDeclaration11.js index d2ed28ec1b435..eaeb8b576ab34 100644 --- a/tests/baselines/reference/parserMemberAccessorDeclaration11.js +++ b/tests/baselines/reference/parserMemberAccessorDeclaration11.js @@ -4,7 +4,7 @@ class C { } //// [parserMemberAccessorDeclaration11.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } Object.defineProperty(C.prototype, "Foo", { diff --git a/tests/baselines/reference/parserMemberAccessorDeclaration12.js b/tests/baselines/reference/parserMemberAccessorDeclaration12.js index 85ad8ec231d56..a0c402703b420 100644 --- a/tests/baselines/reference/parserMemberAccessorDeclaration12.js +++ b/tests/baselines/reference/parserMemberAccessorDeclaration12.js @@ -4,7 +4,7 @@ class C { } //// [parserMemberAccessorDeclaration12.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } Object.defineProperty(C.prototype, "Foo", { diff --git a/tests/baselines/reference/parserMemberAccessorDeclaration13.js b/tests/baselines/reference/parserMemberAccessorDeclaration13.js index 0882cb84bd489..c057d77476ffc 100644 --- a/tests/baselines/reference/parserMemberAccessorDeclaration13.js +++ b/tests/baselines/reference/parserMemberAccessorDeclaration13.js @@ -4,7 +4,7 @@ class C { } //// [parserMemberAccessorDeclaration13.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } Object.defineProperty(C.prototype, "Foo", { diff --git a/tests/baselines/reference/parserMemberAccessorDeclaration14.js b/tests/baselines/reference/parserMemberAccessorDeclaration14.js index a40b5eafa5def..7e88d64d85af2 100644 --- a/tests/baselines/reference/parserMemberAccessorDeclaration14.js +++ b/tests/baselines/reference/parserMemberAccessorDeclaration14.js @@ -4,7 +4,7 @@ class C { } //// [parserMemberAccessorDeclaration14.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } Object.defineProperty(C.prototype, "Foo", { diff --git a/tests/baselines/reference/parserMemberAccessorDeclaration15.js b/tests/baselines/reference/parserMemberAccessorDeclaration15.js index 333ae53847323..48815f0fa6626 100644 --- a/tests/baselines/reference/parserMemberAccessorDeclaration15.js +++ b/tests/baselines/reference/parserMemberAccessorDeclaration15.js @@ -4,7 +4,7 @@ class C { } //// [parserMemberAccessorDeclaration15.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } Object.defineProperty(C.prototype, "Foo", { diff --git a/tests/baselines/reference/parserMemberAccessorDeclaration16.js b/tests/baselines/reference/parserMemberAccessorDeclaration16.js index aa70918914bfb..7967a2accacb3 100644 --- a/tests/baselines/reference/parserMemberAccessorDeclaration16.js +++ b/tests/baselines/reference/parserMemberAccessorDeclaration16.js @@ -4,7 +4,7 @@ class C { } //// [parserMemberAccessorDeclaration16.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } Object.defineProperty(C.prototype, "Foo", { diff --git a/tests/baselines/reference/parserMemberAccessorDeclaration17.js b/tests/baselines/reference/parserMemberAccessorDeclaration17.js index 10334e7881c5d..820570460652a 100644 --- a/tests/baselines/reference/parserMemberAccessorDeclaration17.js +++ b/tests/baselines/reference/parserMemberAccessorDeclaration17.js @@ -4,7 +4,7 @@ class C { } //// [parserMemberAccessorDeclaration17.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } Object.defineProperty(C.prototype, "Foo", { diff --git a/tests/baselines/reference/parserMemberAccessorDeclaration18.js b/tests/baselines/reference/parserMemberAccessorDeclaration18.js index c6c902d49157c..84f24ac79be12 100644 --- a/tests/baselines/reference/parserMemberAccessorDeclaration18.js +++ b/tests/baselines/reference/parserMemberAccessorDeclaration18.js @@ -4,7 +4,7 @@ class C { } //// [parserMemberAccessorDeclaration18.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } Object.defineProperty(C.prototype, "Foo", { diff --git a/tests/baselines/reference/parserMemberAccessorDeclaration2.js b/tests/baselines/reference/parserMemberAccessorDeclaration2.js index 01d98d67694bf..83be7996a0654 100644 --- a/tests/baselines/reference/parserMemberAccessorDeclaration2.js +++ b/tests/baselines/reference/parserMemberAccessorDeclaration2.js @@ -4,7 +4,7 @@ class C { } //// [parserMemberAccessorDeclaration2.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } Object.defineProperty(C.prototype, "b", { diff --git a/tests/baselines/reference/parserMemberAccessorDeclaration3.js b/tests/baselines/reference/parserMemberAccessorDeclaration3.js index c8c87111d92b1..edd6d9d7bab1a 100644 --- a/tests/baselines/reference/parserMemberAccessorDeclaration3.js +++ b/tests/baselines/reference/parserMemberAccessorDeclaration3.js @@ -4,7 +4,7 @@ class C { } //// [parserMemberAccessorDeclaration3.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } Object.defineProperty(C.prototype, 0, { diff --git a/tests/baselines/reference/parserMemberAccessorDeclaration4.js b/tests/baselines/reference/parserMemberAccessorDeclaration4.js index f0cea8d239a17..ec12dde504200 100644 --- a/tests/baselines/reference/parserMemberAccessorDeclaration4.js +++ b/tests/baselines/reference/parserMemberAccessorDeclaration4.js @@ -4,7 +4,7 @@ class C { } //// [parserMemberAccessorDeclaration4.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } Object.defineProperty(C.prototype, "a", { diff --git a/tests/baselines/reference/parserMemberAccessorDeclaration5.js b/tests/baselines/reference/parserMemberAccessorDeclaration5.js index 6c990debd85c8..3b63703ef97d0 100644 --- a/tests/baselines/reference/parserMemberAccessorDeclaration5.js +++ b/tests/baselines/reference/parserMemberAccessorDeclaration5.js @@ -4,7 +4,7 @@ class C { } //// [parserMemberAccessorDeclaration5.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } Object.defineProperty(C.prototype, "a", { diff --git a/tests/baselines/reference/parserMemberAccessorDeclaration6.js b/tests/baselines/reference/parserMemberAccessorDeclaration6.js index 52977e1b7dcc8..dd7a05fa8c0b8 100644 --- a/tests/baselines/reference/parserMemberAccessorDeclaration6.js +++ b/tests/baselines/reference/parserMemberAccessorDeclaration6.js @@ -4,7 +4,7 @@ class C { } //// [parserMemberAccessorDeclaration6.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } Object.defineProperty(C.prototype, 0, { diff --git a/tests/baselines/reference/parserMemberAccessorDeclaration7.js b/tests/baselines/reference/parserMemberAccessorDeclaration7.js index fd4ed1b492305..9344cf07ee6aa 100644 --- a/tests/baselines/reference/parserMemberAccessorDeclaration7.js +++ b/tests/baselines/reference/parserMemberAccessorDeclaration7.js @@ -4,7 +4,7 @@ class C { } //// [parserMemberAccessorDeclaration7.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } Object.defineProperty(C.prototype, "Foo", { diff --git a/tests/baselines/reference/parserMemberAccessorDeclaration8.js b/tests/baselines/reference/parserMemberAccessorDeclaration8.js index edcca9cabc2b4..0fe2d749ab04a 100644 --- a/tests/baselines/reference/parserMemberAccessorDeclaration8.js +++ b/tests/baselines/reference/parserMemberAccessorDeclaration8.js @@ -4,7 +4,7 @@ class C { } //// [parserMemberAccessorDeclaration8.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } Object.defineProperty(C, "Foo", { diff --git a/tests/baselines/reference/parserMemberAccessorDeclaration9.js b/tests/baselines/reference/parserMemberAccessorDeclaration9.js index 5872d37203bb4..22c4cb0100636 100644 --- a/tests/baselines/reference/parserMemberAccessorDeclaration9.js +++ b/tests/baselines/reference/parserMemberAccessorDeclaration9.js @@ -4,7 +4,7 @@ class C { } //// [parserMemberAccessorDeclaration9.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } Object.defineProperty(C, "Foo", { diff --git a/tests/baselines/reference/parserMemberFunctionDeclaration1.js b/tests/baselines/reference/parserMemberFunctionDeclaration1.js index 21a4793b19084..0a02d5450886a 100644 --- a/tests/baselines/reference/parserMemberFunctionDeclaration1.js +++ b/tests/baselines/reference/parserMemberFunctionDeclaration1.js @@ -4,7 +4,7 @@ class C { } //// [parserMemberFunctionDeclaration1.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } C.prototype.Foo = function () { }; diff --git a/tests/baselines/reference/parserMemberFunctionDeclaration2.js b/tests/baselines/reference/parserMemberFunctionDeclaration2.js index 2b94b05aea2a9..9c1b4f17ce755 100644 --- a/tests/baselines/reference/parserMemberFunctionDeclaration2.js +++ b/tests/baselines/reference/parserMemberFunctionDeclaration2.js @@ -4,7 +4,7 @@ class C { } //// [parserMemberFunctionDeclaration2.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } C.Foo = function () { }; diff --git a/tests/baselines/reference/parserMemberFunctionDeclaration3.js b/tests/baselines/reference/parserMemberFunctionDeclaration3.js index 9754db2c1a83b..475f6ccdb2705 100644 --- a/tests/baselines/reference/parserMemberFunctionDeclaration3.js +++ b/tests/baselines/reference/parserMemberFunctionDeclaration3.js @@ -4,7 +4,7 @@ class C { } //// [parserMemberFunctionDeclaration3.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } C.Foo = function () { }; diff --git a/tests/baselines/reference/parserMemberFunctionDeclaration4.js b/tests/baselines/reference/parserMemberFunctionDeclaration4.js index 8911fe60c1ffb..b2283f1f5f88b 100644 --- a/tests/baselines/reference/parserMemberFunctionDeclaration4.js +++ b/tests/baselines/reference/parserMemberFunctionDeclaration4.js @@ -4,7 +4,7 @@ class C { } //// [parserMemberFunctionDeclaration4.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } C.prototype.Foo = function () { }; diff --git a/tests/baselines/reference/parserMemberFunctionDeclaration5.js b/tests/baselines/reference/parserMemberFunctionDeclaration5.js index 8d060cb7cc9c5..467793189ba3c 100644 --- a/tests/baselines/reference/parserMemberFunctionDeclaration5.js +++ b/tests/baselines/reference/parserMemberFunctionDeclaration5.js @@ -4,7 +4,7 @@ class C { } //// [parserMemberFunctionDeclaration5.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } C.prototype.Foo = function () { }; diff --git a/tests/baselines/reference/parserMemberFunctionDeclarationAmbiguities1.js b/tests/baselines/reference/parserMemberFunctionDeclarationAmbiguities1.js index f84123762107f..9d80f0953cd72 100644 --- a/tests/baselines/reference/parserMemberFunctionDeclarationAmbiguities1.js +++ b/tests/baselines/reference/parserMemberFunctionDeclarationAmbiguities1.js @@ -14,7 +14,7 @@ class C { } //// [parserMemberFunctionDeclarationAmbiguities1.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } C.prototype.public = function () { }; diff --git a/tests/baselines/reference/parserMemberVariableDeclaration1.js b/tests/baselines/reference/parserMemberVariableDeclaration1.js index aac616cc10ee5..2af1898100d09 100644 --- a/tests/baselines/reference/parserMemberVariableDeclaration1.js +++ b/tests/baselines/reference/parserMemberVariableDeclaration1.js @@ -4,7 +4,7 @@ class C { } //// [parserMemberVariableDeclaration1.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } return C; diff --git a/tests/baselines/reference/parserMemberVariableDeclaration2.js b/tests/baselines/reference/parserMemberVariableDeclaration2.js index 9d9032f7fb0a7..3e491501af1d5 100644 --- a/tests/baselines/reference/parserMemberVariableDeclaration2.js +++ b/tests/baselines/reference/parserMemberVariableDeclaration2.js @@ -4,7 +4,7 @@ class C { } //// [parserMemberVariableDeclaration2.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } return C; diff --git a/tests/baselines/reference/parserMemberVariableDeclaration3.js b/tests/baselines/reference/parserMemberVariableDeclaration3.js index 3518443cf6eeb..c4278ad0031ec 100644 --- a/tests/baselines/reference/parserMemberVariableDeclaration3.js +++ b/tests/baselines/reference/parserMemberVariableDeclaration3.js @@ -4,7 +4,7 @@ class C { } //// [parserMemberVariableDeclaration3.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } return C; diff --git a/tests/baselines/reference/parserMemberVariableDeclaration4.js b/tests/baselines/reference/parserMemberVariableDeclaration4.js index 6e0c89038995c..787698a2f8c76 100644 --- a/tests/baselines/reference/parserMemberVariableDeclaration4.js +++ b/tests/baselines/reference/parserMemberVariableDeclaration4.js @@ -4,7 +4,7 @@ class C { } //// [parserMemberVariableDeclaration4.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } return C; diff --git a/tests/baselines/reference/parserMemberVariableDeclaration5.js b/tests/baselines/reference/parserMemberVariableDeclaration5.js index 47b563e8a7813..9e65fda5284d4 100644 --- a/tests/baselines/reference/parserMemberVariableDeclaration5.js +++ b/tests/baselines/reference/parserMemberVariableDeclaration5.js @@ -4,7 +4,7 @@ class C { } //// [parserMemberVariableDeclaration5.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } return C; diff --git a/tests/baselines/reference/parserMissingLambdaOpenBrace1.js b/tests/baselines/reference/parserMissingLambdaOpenBrace1.js index 36b3d92fcd787..e33068e6478cb 100644 --- a/tests/baselines/reference/parserMissingLambdaOpenBrace1.js +++ b/tests/baselines/reference/parserMissingLambdaOpenBrace1.js @@ -9,7 +9,7 @@ class C { } //// [parserMissingLambdaOpenBrace1.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } C.prototype.where = function (filter) { diff --git a/tests/baselines/reference/parserParameterList1.js b/tests/baselines/reference/parserParameterList1.js index 01ef6a149dcd6..e2c06e2ae3db0 100644 --- a/tests/baselines/reference/parserParameterList1.js +++ b/tests/baselines/reference/parserParameterList1.js @@ -4,7 +4,7 @@ class C { } //// [parserParameterList1.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } C.prototype.F = function (B) { }; diff --git a/tests/baselines/reference/parserParameterList10.js b/tests/baselines/reference/parserParameterList10.js index f899901728c20..906e44154ee30 100644 --- a/tests/baselines/reference/parserParameterList10.js +++ b/tests/baselines/reference/parserParameterList10.js @@ -4,7 +4,7 @@ class C { } //// [parserParameterList10.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } C.prototype.foo = function () { diff --git a/tests/baselines/reference/parserParameterList16.js b/tests/baselines/reference/parserParameterList16.js index 9565cba53c1ca..0fcbc7d491fb4 100644 --- a/tests/baselines/reference/parserParameterList16.js +++ b/tests/baselines/reference/parserParameterList16.js @@ -5,7 +5,7 @@ class C { } //// [parserParameterList16.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } C.prototype.foo = function (a, b) { }; diff --git a/tests/baselines/reference/parserParameterList17.js b/tests/baselines/reference/parserParameterList17.js index f38c9d062c950..f7698b34b0909 100644 --- a/tests/baselines/reference/parserParameterList17.js +++ b/tests/baselines/reference/parserParameterList17.js @@ -5,7 +5,7 @@ class C { } //// [parserParameterList17.js] -var C = (function () { +var C = /** @class */ (function () { function C(a, b) { } return C; diff --git a/tests/baselines/reference/parserParameterList2.js b/tests/baselines/reference/parserParameterList2.js index 8fcddb532dca8..a7edee6a65e3f 100644 --- a/tests/baselines/reference/parserParameterList2.js +++ b/tests/baselines/reference/parserParameterList2.js @@ -4,7 +4,7 @@ class C { } //// [parserParameterList2.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } C.prototype.F = function (A) { diff --git a/tests/baselines/reference/parserParameterList3.js b/tests/baselines/reference/parserParameterList3.js index d2cf7c5c9f519..60331df814ae7 100644 --- a/tests/baselines/reference/parserParameterList3.js +++ b/tests/baselines/reference/parserParameterList3.js @@ -4,7 +4,7 @@ class C { } //// [parserParameterList3.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } C.prototype.F = function (A, B) { }; diff --git a/tests/baselines/reference/parserParameterList6.js b/tests/baselines/reference/parserParameterList6.js index 4713cf9197848..0a5d839b9f94e 100644 --- a/tests/baselines/reference/parserParameterList6.js +++ b/tests/baselines/reference/parserParameterList6.js @@ -5,7 +5,7 @@ class C { } //// [parserParameterList6.js] -var C = (function () { +var C = /** @class */ (function () { function C(C) { } return C; diff --git a/tests/baselines/reference/parserParameterList7.js b/tests/baselines/reference/parserParameterList7.js index 391d3158127e0..3b24c6125e27c 100644 --- a/tests/baselines/reference/parserParameterList7.js +++ b/tests/baselines/reference/parserParameterList7.js @@ -6,7 +6,7 @@ class C1 { } //// [parserParameterList7.js] -var C1 = (function () { +var C1 = /** @class */ (function () { function C1(p3) { this.p3 = p3; } // OK diff --git a/tests/baselines/reference/parserParameterList9.js b/tests/baselines/reference/parserParameterList9.js index 3ccc1d0202569..e81a1f2d03d42 100644 --- a/tests/baselines/reference/parserParameterList9.js +++ b/tests/baselines/reference/parserParameterList9.js @@ -4,7 +4,7 @@ class C { } //// [parserParameterList9.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } C.prototype.foo = function () { diff --git a/tests/baselines/reference/parserRealSource1.js b/tests/baselines/reference/parserRealSource1.js index e41cb2a4b3f17..73da63032cb62 100644 --- a/tests/baselines/reference/parserRealSource1.js +++ b/tests/baselines/reference/parserRealSource1.js @@ -186,7 +186,7 @@ var TypeScript; } CompilerDiagnostics.assert = assert; })(CompilerDiagnostics = TypeScript.CompilerDiagnostics || (TypeScript.CompilerDiagnostics = {})); - var NullLogger = (function () { + var NullLogger = /** @class */ (function () { function NullLogger() { } NullLogger.prototype.information = function () { return false; }; @@ -199,7 +199,7 @@ var TypeScript; return NullLogger; }()); TypeScript.NullLogger = NullLogger; - var LoggerAdapter = (function () { + var LoggerAdapter = /** @class */ (function () { function LoggerAdapter(logger) { this.logger = logger; this._information = this.logger.information(); @@ -219,7 +219,7 @@ var TypeScript; return LoggerAdapter; }()); TypeScript.LoggerAdapter = LoggerAdapter; - var BufferedLogger = (function () { + var BufferedLogger = /** @class */ (function () { function BufferedLogger() { this.logContents = []; } diff --git a/tests/baselines/reference/parserRealSource10.js b/tests/baselines/reference/parserRealSource10.js index 0d42dc5f47b72..699566f28d112 100644 --- a/tests/baselines/reference/parserRealSource10.js +++ b/tests/baselines/reference/parserRealSource10.js @@ -637,7 +637,7 @@ var TypeScript; Reservation[Reservation["TypeScriptAndJSFuture"] = 6] = "TypeScriptAndJSFuture"; Reservation[Reservation["TypeScriptAndJSFutureStrict"] = 12] = "TypeScriptAndJSFutureStrict"; })(Reservation = TypeScript.Reservation || (TypeScript.Reservation = {})); - var TokenInfo = (function () { + var TokenInfo = /** @class */ (function () { function TokenInfo(tokenId, reservation, binopPrecedence, binopNodeType, unopPrecedence, unopNodeType, text, ers) { this.tokenId = tokenId; this.reservation = reservation; @@ -788,7 +788,7 @@ var TypeScript; TokenClass[TokenClass["Identifier"] = 5] = "Identifier"; TokenClass[TokenClass["Literal"] = 6] = "Literal"; })(TokenClass = TypeScript.TokenClass || (TypeScript.TokenClass = {})); - var SavedToken = (function () { + var SavedToken = /** @class */ (function () { function SavedToken(tok, minChar, limChar) { this.tok = tok; this.minChar = minChar; @@ -797,7 +797,7 @@ var TypeScript; return SavedToken; }()); TypeScript.SavedToken = SavedToken; - var Token = (function () { + var Token = /** @class */ (function () { function Token(tokenId) { this.tokenId = tokenId; } @@ -828,7 +828,7 @@ var TypeScript; return Token; }()); TypeScript.Token = Token; - var NumberLiteralToken = (function (_super) { + var NumberLiteralToken = /** @class */ (function (_super) { __extends(NumberLiteralToken, _super); function NumberLiteralToken(value, hasEmptyFraction) { var _this = _super.call(this, TokenID.NumberLiteral) || this; @@ -845,7 +845,7 @@ var TypeScript; return NumberLiteralToken; }(Token)); TypeScript.NumberLiteralToken = NumberLiteralToken; - var StringLiteralToken = (function (_super) { + var StringLiteralToken = /** @class */ (function (_super) { __extends(StringLiteralToken, _super); function StringLiteralToken(value) { var _this = _super.call(this, TokenID.StringLiteral) || this; @@ -861,7 +861,7 @@ var TypeScript; return StringLiteralToken; }(Token)); TypeScript.StringLiteralToken = StringLiteralToken; - var IdentifierToken = (function (_super) { + var IdentifierToken = /** @class */ (function (_super) { __extends(IdentifierToken, _super); function IdentifierToken(value, hasEscapeSequence) { var _this = _super.call(this, TokenID.Identifier) || this; @@ -878,7 +878,7 @@ var TypeScript; return IdentifierToken; }(Token)); TypeScript.IdentifierToken = IdentifierToken; - var WhitespaceToken = (function (_super) { + var WhitespaceToken = /** @class */ (function (_super) { __extends(WhitespaceToken, _super); function WhitespaceToken(tokenId, value) { var _this = _super.call(this, tokenId) || this; @@ -894,7 +894,7 @@ var TypeScript; return WhitespaceToken; }(Token)); TypeScript.WhitespaceToken = WhitespaceToken; - var CommentToken = (function (_super) { + var CommentToken = /** @class */ (function (_super) { __extends(CommentToken, _super); function CommentToken(tokenID, value, isBlock, startPos, line, endsLine) { var _this = _super.call(this, tokenID) || this; @@ -914,7 +914,7 @@ var TypeScript; return CommentToken; }(Token)); TypeScript.CommentToken = CommentToken; - var RegularExpressionLiteralToken = (function (_super) { + var RegularExpressionLiteralToken = /** @class */ (function (_super) { __extends(RegularExpressionLiteralToken, _super); function RegularExpressionLiteralToken(regex) { var _this = _super.call(this, TokenID.RegularExpressionLiteral) || this; diff --git a/tests/baselines/reference/parserRealSource11.js b/tests/baselines/reference/parserRealSource11.js index 0d942cb1c68d4..361865816d76a 100644 --- a/tests/baselines/reference/parserRealSource11.js +++ b/tests/baselines/reference/parserRealSource11.js @@ -2380,7 +2380,7 @@ var __extends = (this && this.__extends) || (function () { /// var TypeScript; (function (TypeScript) { - var ASTSpan = (function () { + var ASTSpan = /** @class */ (function () { function ASTSpan() { this.minChar = -1; // -1 = "undefined" or "compiler generated" this.limChar = -1; // -1 = "undefined" or "compiler generated" @@ -2388,7 +2388,7 @@ var TypeScript; return ASTSpan; }()); TypeScript.ASTSpan = ASTSpan; - var AST = (function (_super) { + var AST = /** @class */ (function (_super) { __extends(AST, _super); function AST(nodeType) { var _this = _super.call(this) || this; @@ -2545,7 +2545,7 @@ var TypeScript; return AST; }(ASTSpan)); TypeScript.AST = AST; - var IncompleteAST = (function (_super) { + var IncompleteAST = /** @class */ (function (_super) { __extends(IncompleteAST, _super); function IncompleteAST(min, lim) { var _this = _super.call(this, NodeType.Error) || this; @@ -2556,7 +2556,7 @@ var TypeScript; return IncompleteAST; }(AST)); TypeScript.IncompleteAST = IncompleteAST; - var ASTList = (function (_super) { + var ASTList = /** @class */ (function (_super) { __extends(ASTList, _super); function ASTList() { var _this = _super.call(this, NodeType.List) || this; @@ -2612,7 +2612,7 @@ var TypeScript; return ASTList; }(AST)); TypeScript.ASTList = ASTList; - var Identifier = (function (_super) { + var Identifier = /** @class */ (function (_super) { __extends(Identifier, _super); // 'actualText' is the text that the user has entered for the identifier. the text might // include any Unicode escape sequences (e.g.: \u0041 for 'A'). 'text', however, contains @@ -2669,7 +2669,7 @@ var TypeScript; return Identifier; }(AST)); TypeScript.Identifier = Identifier; - var MissingIdentifier = (function (_super) { + var MissingIdentifier = /** @class */ (function (_super) { __extends(MissingIdentifier, _super); function MissingIdentifier() { return _super.call(this, "__missing") || this; @@ -2683,7 +2683,7 @@ var TypeScript; return MissingIdentifier; }(Identifier)); TypeScript.MissingIdentifier = MissingIdentifier; - var Label = (function (_super) { + var Label = /** @class */ (function (_super) { __extends(Label, _super); function Label(id) { var _this = _super.call(this, NodeType.Label) || this; @@ -2708,7 +2708,7 @@ var TypeScript; return Label; }(AST)); TypeScript.Label = Label; - var Expression = (function (_super) { + var Expression = /** @class */ (function (_super) { __extends(Expression, _super); function Expression(nodeType) { return _super.call(this, nodeType) || this; @@ -2718,7 +2718,7 @@ var TypeScript; return Expression; }(AST)); TypeScript.Expression = Expression; - var UnaryExpression = (function (_super) { + var UnaryExpression = /** @class */ (function (_super) { __extends(UnaryExpression, _super); function UnaryExpression(nodeType, operand) { var _this = _super.call(this, nodeType) || this; @@ -2863,7 +2863,7 @@ var TypeScript; return UnaryExpression; }(Expression)); TypeScript.UnaryExpression = UnaryExpression; - var CallExpression = (function (_super) { + var CallExpression = /** @class */ (function (_super) { __extends(CallExpression, _super); function CallExpression(nodeType, target, arguments) { var _this = _super.call(this, nodeType) || this; @@ -2896,7 +2896,7 @@ var TypeScript; return CallExpression; }(Expression)); TypeScript.CallExpression = CallExpression; - var BinaryExpression = (function (_super) { + var BinaryExpression = /** @class */ (function (_super) { __extends(BinaryExpression, _super); function BinaryExpression(nodeType, operand1, operand2) { var _this = _super.call(this, nodeType) || this; @@ -3049,7 +3049,7 @@ var TypeScript; return BinaryExpression; }(Expression)); TypeScript.BinaryExpression = BinaryExpression; - var ConditionalExpression = (function (_super) { + var ConditionalExpression = /** @class */ (function (_super) { __extends(ConditionalExpression, _super); function ConditionalExpression(operand1, operand2, operand3) { var _this = _super.call(this, NodeType.ConditionalExpression) || this; @@ -3075,7 +3075,7 @@ var TypeScript; return ConditionalExpression; }(Expression)); TypeScript.ConditionalExpression = ConditionalExpression; - var NumberLiteral = (function (_super) { + var NumberLiteral = /** @class */ (function (_super) { __extends(NumberLiteral, _super); function NumberLiteral(value, hasEmptyFraction) { var _this = _super.call(this, NodeType.NumberLit) || this; @@ -3117,7 +3117,7 @@ var TypeScript; return NumberLiteral; }(Expression)); TypeScript.NumberLiteral = NumberLiteral; - var RegexLiteral = (function (_super) { + var RegexLiteral = /** @class */ (function (_super) { __extends(RegexLiteral, _super); function RegexLiteral(regex) { var _this = _super.call(this, NodeType.Regex) || this; @@ -3138,7 +3138,7 @@ var TypeScript; return RegexLiteral; }(Expression)); TypeScript.RegexLiteral = RegexLiteral; - var StringLiteral = (function (_super) { + var StringLiteral = /** @class */ (function (_super) { __extends(StringLiteral, _super); function StringLiteral(text) { var _this = _super.call(this, NodeType.QString) || this; @@ -3165,7 +3165,7 @@ var TypeScript; return StringLiteral; }(Expression)); TypeScript.StringLiteral = StringLiteral; - var ModuleElement = (function (_super) { + var ModuleElement = /** @class */ (function (_super) { __extends(ModuleElement, _super); function ModuleElement(nodeType) { return _super.call(this, nodeType) || this; @@ -3173,7 +3173,7 @@ var TypeScript; return ModuleElement; }(AST)); TypeScript.ModuleElement = ModuleElement; - var ImportDeclaration = (function (_super) { + var ImportDeclaration = /** @class */ (function (_super) { __extends(ImportDeclaration, _super); function ImportDeclaration(id, alias) { var _this = _super.call(this, NodeType.ImportDeclaration) || this; @@ -3233,7 +3233,7 @@ var TypeScript; return ImportDeclaration; }(ModuleElement)); TypeScript.ImportDeclaration = ImportDeclaration; - var BoundDecl = (function (_super) { + var BoundDecl = /** @class */ (function (_super) { __extends(BoundDecl, _super); function BoundDecl(id, nodeType, nestingLevel) { var _this = _super.call(this, nodeType) || this; @@ -3258,7 +3258,7 @@ var TypeScript; return BoundDecl; }(AST)); TypeScript.BoundDecl = BoundDecl; - var VarDecl = (function (_super) { + var VarDecl = /** @class */ (function (_super) { __extends(VarDecl, _super); function VarDecl(id, nest) { return _super.call(this, id, NodeType.VarDecl, nest) || this; @@ -3275,7 +3275,7 @@ var TypeScript; return VarDecl; }(BoundDecl)); TypeScript.VarDecl = VarDecl; - var ArgDecl = (function (_super) { + var ArgDecl = /** @class */ (function (_super) { __extends(ArgDecl, _super); function ArgDecl(id) { var _this = _super.call(this, id, NodeType.ArgDecl, 0) || this; @@ -3298,7 +3298,7 @@ var TypeScript; }(BoundDecl)); TypeScript.ArgDecl = ArgDecl; var internalId = 0; - var FuncDecl = (function (_super) { + var FuncDecl = /** @class */ (function (_super) { __extends(FuncDecl, _super); function FuncDecl(name, bod, isConstructor, arguments, vars, scopes, statics, nodeType) { var _this = _super.call(this, nodeType) || this; @@ -3429,7 +3429,7 @@ var TypeScript; return FuncDecl; }(AST)); TypeScript.FuncDecl = FuncDecl; - var LocationInfo = (function () { + var LocationInfo = /** @class */ (function () { function LocationInfo(filename, lineMap, unitIndex) { this.filename = filename; this.lineMap = lineMap; @@ -3439,7 +3439,7 @@ var TypeScript; }()); TypeScript.LocationInfo = LocationInfo; TypeScript.unknownLocationInfo = new LocationInfo("unknown", null, -1); - var Script = (function (_super) { + var Script = /** @class */ (function (_super) { __extends(Script, _super); function Script(vars, scopes) { var _this = _super.call(this, new Identifier("script"), null, false, null, vars, scopes, null, NodeType.Script) || this; @@ -3509,7 +3509,7 @@ var TypeScript; return Script; }(FuncDecl)); TypeScript.Script = Script; - var NamedDeclaration = (function (_super) { + var NamedDeclaration = /** @class */ (function (_super) { __extends(NamedDeclaration, _super); function NamedDeclaration(nodeType, name, members) { var _this = _super.call(this, nodeType) || this; @@ -3522,7 +3522,7 @@ var TypeScript; return NamedDeclaration; }(ModuleElement)); TypeScript.NamedDeclaration = NamedDeclaration; - var ModuleDeclaration = (function (_super) { + var ModuleDeclaration = /** @class */ (function (_super) { __extends(ModuleDeclaration, _super); function ModuleDeclaration(name, members, vars, scopes, endingToken) { var _this = _super.call(this, NodeType.ModuleDeclaration, name, members) || this; @@ -3558,7 +3558,7 @@ var TypeScript; return ModuleDeclaration; }(NamedDeclaration)); TypeScript.ModuleDeclaration = ModuleDeclaration; - var TypeDeclaration = (function (_super) { + var TypeDeclaration = /** @class */ (function (_super) { __extends(TypeDeclaration, _super); function TypeDeclaration(nodeType, name, extendsList, implementsList, members) { var _this = _super.call(this, nodeType, name, members) || this; @@ -3576,7 +3576,7 @@ var TypeScript; return TypeDeclaration; }(NamedDeclaration)); TypeScript.TypeDeclaration = TypeDeclaration; - var ClassDeclaration = (function (_super) { + var ClassDeclaration = /** @class */ (function (_super) { __extends(ClassDeclaration, _super); function ClassDeclaration(name, members, extendsList, implementsList) { var _this = _super.call(this, NodeType.ClassDeclaration, name, extendsList, implementsList, members) || this; @@ -3595,7 +3595,7 @@ var TypeScript; return ClassDeclaration; }(TypeDeclaration)); TypeScript.ClassDeclaration = ClassDeclaration; - var InterfaceDeclaration = (function (_super) { + var InterfaceDeclaration = /** @class */ (function (_super) { __extends(InterfaceDeclaration, _super); function InterfaceDeclaration(name, members, extendsList, implementsList) { return _super.call(this, NodeType.InterfaceDeclaration, name, extendsList, implementsList, members) || this; @@ -3608,7 +3608,7 @@ var TypeScript; return InterfaceDeclaration; }(TypeDeclaration)); TypeScript.InterfaceDeclaration = InterfaceDeclaration; - var Statement = (function (_super) { + var Statement = /** @class */ (function (_super) { __extends(Statement, _super); function Statement(nodeType) { var _this = _super.call(this, nodeType) || this; @@ -3625,7 +3625,7 @@ var TypeScript; return Statement; }(ModuleElement)); TypeScript.Statement = Statement; - var LabeledStatement = (function (_super) { + var LabeledStatement = /** @class */ (function (_super) { __extends(LabeledStatement, _super); function LabeledStatement(labels, stmt) { var _this = _super.call(this, NodeType.LabeledStatement) || this; @@ -3660,7 +3660,7 @@ var TypeScript; return LabeledStatement; }(Statement)); TypeScript.LabeledStatement = LabeledStatement; - var Block = (function (_super) { + var Block = /** @class */ (function (_super) { __extends(Block, _super); function Block(statements, isStatementBlock) { var _this = _super.call(this, NodeType.Block) || this; @@ -3716,7 +3716,7 @@ var TypeScript; return Block; }(Statement)); TypeScript.Block = Block; - var Jump = (function (_super) { + var Jump = /** @class */ (function (_super) { __extends(Jump, _super); function Jump(nodeType) { var _this = _super.call(this, nodeType) || this; @@ -3768,7 +3768,7 @@ var TypeScript; return Jump; }(Statement)); TypeScript.Jump = Jump; - var WhileStatement = (function (_super) { + var WhileStatement = /** @class */ (function (_super) { __extends(WhileStatement, _super); function WhileStatement(cond) { var _this = _super.call(this, NodeType.While) || this; @@ -3821,7 +3821,7 @@ var TypeScript; return WhileStatement; }(Statement)); TypeScript.WhileStatement = WhileStatement; - var DoWhileStatement = (function (_super) { + var DoWhileStatement = /** @class */ (function (_super) { __extends(DoWhileStatement, _super); function DoWhileStatement() { var _this = _super.call(this, NodeType.DoWhile) || this; @@ -3878,7 +3878,7 @@ var TypeScript; return DoWhileStatement; }(Statement)); TypeScript.DoWhileStatement = DoWhileStatement; - var IfStatement = (function (_super) { + var IfStatement = /** @class */ (function (_super) { __extends(IfStatement, _super); function IfStatement(cond) { var _this = _super.call(this, NodeType.If) || this; @@ -3957,7 +3957,7 @@ var TypeScript; return IfStatement; }(Statement)); TypeScript.IfStatement = IfStatement; - var ReturnStatement = (function (_super) { + var ReturnStatement = /** @class */ (function (_super) { __extends(ReturnStatement, _super); function ReturnStatement() { var _this = _super.call(this, NodeType.Return) || this; @@ -3989,7 +3989,7 @@ var TypeScript; return ReturnStatement; }(Statement)); TypeScript.ReturnStatement = ReturnStatement; - var EndCode = (function (_super) { + var EndCode = /** @class */ (function (_super) { __extends(EndCode, _super); function EndCode() { return _super.call(this, NodeType.EndCode) || this; @@ -3997,7 +3997,7 @@ var TypeScript; return EndCode; }(AST)); TypeScript.EndCode = EndCode; - var ForInStatement = (function (_super) { + var ForInStatement = /** @class */ (function (_super) { __extends(ForInStatement, _super); function ForInStatement(lval, obj) { var _this = _super.call(this, NodeType.ForIn) || this; @@ -4113,7 +4113,7 @@ var TypeScript; return ForInStatement; }(Statement)); TypeScript.ForInStatement = ForInStatement; - var ForStatement = (function (_super) { + var ForStatement = /** @class */ (function (_super) { __extends(ForStatement, _super); function ForStatement(init) { var _this = _super.call(this, NodeType.For) || this; @@ -4205,7 +4205,7 @@ var TypeScript; return ForStatement; }(Statement)); TypeScript.ForStatement = ForStatement; - var WithStatement = (function (_super) { + var WithStatement = /** @class */ (function (_super) { __extends(WithStatement, _super); function WithStatement(expr) { var _this = _super.call(this, NodeType.With) || this; @@ -4232,7 +4232,7 @@ var TypeScript; return WithStatement; }(Statement)); TypeScript.WithStatement = WithStatement; - var SwitchStatement = (function (_super) { + var SwitchStatement = /** @class */ (function (_super) { __extends(SwitchStatement, _super); function SwitchStatement(val) { var _this = _super.call(this, NodeType.Switch) || this; @@ -4305,7 +4305,7 @@ var TypeScript; return SwitchStatement; }(Statement)); TypeScript.SwitchStatement = SwitchStatement; - var CaseStatement = (function (_super) { + var CaseStatement = /** @class */ (function (_super) { __extends(CaseStatement, _super); function CaseStatement() { var _this = _super.call(this, NodeType.Case) || this; @@ -4359,7 +4359,7 @@ var TypeScript; return CaseStatement; }(Statement)); TypeScript.CaseStatement = CaseStatement; - var TypeReference = (function (_super) { + var TypeReference = /** @class */ (function (_super) { __extends(TypeReference, _super); function TypeReference(term, arrayCount) { var _this = _super.call(this, NodeType.TypeRef) || this; @@ -4390,7 +4390,7 @@ var TypeScript; return TypeReference; }(AST)); TypeScript.TypeReference = TypeReference; - var TryFinally = (function (_super) { + var TryFinally = /** @class */ (function (_super) { __extends(TryFinally, _super); function TryFinally(tryNode, finallyNode) { var _this = _super.call(this, NodeType.TryFinally) || this; @@ -4436,7 +4436,7 @@ var TypeScript; return TryFinally; }(Statement)); TypeScript.TryFinally = TryFinally; - var TryCatch = (function (_super) { + var TryCatch = /** @class */ (function (_super) { __extends(TryCatch, _super); function TryCatch(tryNode, catchNode) { var _this = _super.call(this, NodeType.TryCatch) || this; @@ -4487,7 +4487,7 @@ var TypeScript; return TryCatch; }(Statement)); TypeScript.TryCatch = TryCatch; - var Try = (function (_super) { + var Try = /** @class */ (function (_super) { __extends(Try, _super); function Try(body) { var _this = _super.call(this, NodeType.Try) || this; @@ -4516,7 +4516,7 @@ var TypeScript; return Try; }(Statement)); TypeScript.Try = Try; - var Catch = (function (_super) { + var Catch = /** @class */ (function (_super) { __extends(Catch, _super); function Catch(param, body) { var _this = _super.call(this, NodeType.Catch) || this; @@ -4590,7 +4590,7 @@ var TypeScript; return Catch; }(Statement)); TypeScript.Catch = Catch; - var Finally = (function (_super) { + var Finally = /** @class */ (function (_super) { __extends(Finally, _super); function Finally(body) { var _this = _super.call(this, NodeType.Finally) || this; @@ -4619,7 +4619,7 @@ var TypeScript; return Finally; }(Statement)); TypeScript.Finally = Finally; - var Comment = (function (_super) { + var Comment = /** @class */ (function (_super) { __extends(Comment, _super); function Comment(content, isBlockComment, endsLine) { var _this = _super.call(this, NodeType.Comment) || this; @@ -4646,7 +4646,7 @@ var TypeScript; return Comment; }(AST)); TypeScript.Comment = Comment; - var DebuggerStatement = (function (_super) { + var DebuggerStatement = /** @class */ (function (_super) { __extends(DebuggerStatement, _super); function DebuggerStatement() { return _super.call(this, NodeType.Debugger) || this; diff --git a/tests/baselines/reference/parserRealSource12.js b/tests/baselines/reference/parserRealSource12.js index fccb1fa45e087..18cb042f36d3b 100644 --- a/tests/baselines/reference/parserRealSource12.js +++ b/tests/baselines/reference/parserRealSource12.js @@ -536,7 +536,7 @@ module TypeScript { /// var TypeScript; (function (TypeScript) { - var AstWalkOptions = (function () { + var AstWalkOptions = /** @class */ (function () { function AstWalkOptions() { this.goChildren = true; this.goNextSibling = true; @@ -550,7 +550,7 @@ var TypeScript; return AstWalkOptions; }()); TypeScript.AstWalkOptions = AstWalkOptions; - var AstWalker = (function () { + var AstWalker = /** @class */ (function () { function AstWalker(childrenWalkers, pre, post, options, state) { this.childrenWalkers = childrenWalkers; this.pre = pre; @@ -587,7 +587,7 @@ var TypeScript; }; return AstWalker; }()); - var AstWalkerFactory = (function () { + var AstWalkerFactory = /** @class */ (function () { function AstWalkerFactory() { this.childrenWalkers = []; this.initChildrenWalkers(); diff --git a/tests/baselines/reference/parserRealSource14.js b/tests/baselines/reference/parserRealSource14.js index 635d122db04eb..e72435c775b59 100644 --- a/tests/baselines/reference/parserRealSource14.js +++ b/tests/baselines/reference/parserRealSource14.js @@ -597,7 +597,7 @@ var TypeScript; // Helper class representing a path from a root ast node to a (grand)child ast node. // This is helpful as our tree don't have parents. // - var AstPath = (function () { + var AstPath = /** @class */ (function () { function AstPath() { this.asts = []; this.top = -1; @@ -950,7 +950,7 @@ var TypeScript; return true; } TypeScript.isValidAstNode = isValidAstNode; - var AstPathContext = (function () { + var AstPathContext = /** @class */ (function () { function AstPathContext() { this.path = new TypeScript.AstPath(); } diff --git a/tests/baselines/reference/parserRealSource4.js b/tests/baselines/reference/parserRealSource4.js index 39d17fb6ef4f3..0851b867c276c 100644 --- a/tests/baselines/reference/parserRealSource4.js +++ b/tests/baselines/reference/parserRealSource4.js @@ -301,7 +301,7 @@ module TypeScript { /// var TypeScript; (function (TypeScript) { - var BlockIntrinsics = (function () { + var BlockIntrinsics = /** @class */ (function () { function BlockIntrinsics() { this.prototype = undefined; this.toString = undefined; @@ -316,7 +316,7 @@ var TypeScript; return BlockIntrinsics; }()); TypeScript.BlockIntrinsics = BlockIntrinsics; - var StringHashTable = (function () { + var StringHashTable = /** @class */ (function () { function StringHashTable() { this.itemCount = 0; this.table = new BlockIntrinsics(); @@ -393,7 +393,7 @@ var TypeScript; // The resident table is expected to reference the same table object, whereas the // transientTable may reference different objects over time // REVIEW: WARNING: For performance reasons, neither the primary nor secondary table may be null - var DualStringHashTable = (function () { + var DualStringHashTable = /** @class */ (function () { function DualStringHashTable(primaryTable, secondaryTable) { this.primaryTable = primaryTable; this.secondaryTable = secondaryTable; @@ -457,7 +457,7 @@ var TypeScript; return key2 ^ ((key1 >> 5) + key1); } TypeScript.combineHashes = combineHashes; - var HashEntry = (function () { + var HashEntry = /** @class */ (function () { function HashEntry(key, data) { this.key = key; this.data = data; @@ -465,7 +465,7 @@ var TypeScript; return HashEntry; }()); TypeScript.HashEntry = HashEntry; - var HashTable = (function () { + var HashTable = /** @class */ (function () { function HashTable(size, hashFn, equalsFn) { this.size = size; this.hashFn = hashFn; @@ -529,7 +529,7 @@ var TypeScript; }()); TypeScript.HashTable = HashTable; // Simple Hash table with list of keys and values matching each other at the given index - var SimpleHashTable = (function () { + var SimpleHashTable = /** @class */ (function () { function SimpleHashTable() { this.keys = []; this.values = []; diff --git a/tests/baselines/reference/parserRealSource5.js b/tests/baselines/reference/parserRealSource5.js index 4f4db59746e34..834371a0dc8a0 100644 --- a/tests/baselines/reference/parserRealSource5.js +++ b/tests/baselines/reference/parserRealSource5.js @@ -73,7 +73,7 @@ module TypeScript { var TypeScript; (function (TypeScript) { // TODO: refactor indent logic for use in emit - var PrintContext = (function () { + var PrintContext = /** @class */ (function () { function PrintContext(outfile, parser) { this.outfile = outfile; this.parser = parser; diff --git a/tests/baselines/reference/parserRealSource6.js b/tests/baselines/reference/parserRealSource6.js index c7dcc5e497bfa..50b643a55f9a0 100644 --- a/tests/baselines/reference/parserRealSource6.js +++ b/tests/baselines/reference/parserRealSource6.js @@ -227,7 +227,7 @@ module TypeScript { /// var TypeScript; (function (TypeScript) { - var TypeCollectionContext = (function () { + var TypeCollectionContext = /** @class */ (function () { function TypeCollectionContext(scopeChain, checker) { this.scopeChain = scopeChain; this.checker = checker; @@ -236,7 +236,7 @@ var TypeScript; return TypeCollectionContext; }()); TypeScript.TypeCollectionContext = TypeCollectionContext; - var MemberScopeContext = (function () { + var MemberScopeContext = /** @class */ (function () { function MemberScopeContext(flow, pos, matchFlag) { this.flow = flow; this.pos = pos; @@ -248,7 +248,7 @@ var TypeScript; return MemberScopeContext; }()); TypeScript.MemberScopeContext = MemberScopeContext; - var EnclosingScopeContext = (function () { + var EnclosingScopeContext = /** @class */ (function () { function EnclosingScopeContext(logger, script, text, pos, isMemberCompletion) { this.logger = logger; this.script = script; diff --git a/tests/baselines/reference/parserRealSource7.js b/tests/baselines/reference/parserRealSource7.js index edc290c35d82a..c3938341017b8 100644 --- a/tests/baselines/reference/parserRealSource7.js +++ b/tests/baselines/reference/parserRealSource7.js @@ -839,7 +839,7 @@ module TypeScript { /// var TypeScript; (function (TypeScript) { - var Continuation = (function () { + var Continuation = /** @class */ (function () { function Continuation(normalBlock) { this.normalBlock = normalBlock; this.exceptionBlock = -1; diff --git a/tests/baselines/reference/parserRealSource8.js b/tests/baselines/reference/parserRealSource8.js index d23297954bec9..95e8a421fc83c 100644 --- a/tests/baselines/reference/parserRealSource8.js +++ b/tests/baselines/reference/parserRealSource8.js @@ -472,7 +472,7 @@ module TypeScript { /// var TypeScript; (function (TypeScript) { - var AssignScopeContext = (function () { + var AssignScopeContext = /** @class */ (function () { function AssignScopeContext(scopeChain, typeFlow, modDeclChain) { this.scopeChain = scopeChain; this.typeFlow = typeFlow; @@ -506,7 +506,7 @@ var TypeScript; return s.isInstanceProperty(); } TypeScript.instanceFilterStop = instanceFilterStop; - var ScopeSearchFilter = (function () { + var ScopeSearchFilter = /** @class */ (function () { function ScopeSearchFilter(select, stop) { this.select = select; this.stop = stop; diff --git a/tests/baselines/reference/parserRealSource9.js b/tests/baselines/reference/parserRealSource9.js index e278f88c8e9fe..0a64f8153b928 100644 --- a/tests/baselines/reference/parserRealSource9.js +++ b/tests/baselines/reference/parserRealSource9.js @@ -215,7 +215,7 @@ module TypeScript { /// var TypeScript; (function (TypeScript) { - var Binder = (function () { + var Binder = /** @class */ (function () { function Binder(checker) { this.checker = checker; } diff --git a/tests/baselines/reference/parserSetAccessorWithTypeAnnotation1.js b/tests/baselines/reference/parserSetAccessorWithTypeAnnotation1.js index 065605fe9d4c4..76af2100e3f54 100644 --- a/tests/baselines/reference/parserSetAccessorWithTypeAnnotation1.js +++ b/tests/baselines/reference/parserSetAccessorWithTypeAnnotation1.js @@ -5,7 +5,7 @@ class C { } //// [parserSetAccessorWithTypeAnnotation1.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } Object.defineProperty(C.prototype, "foo", { diff --git a/tests/baselines/reference/parserSetAccessorWithTypeParameters1.js b/tests/baselines/reference/parserSetAccessorWithTypeParameters1.js index ca07292ee540a..2b6716fba2aaf 100644 --- a/tests/baselines/reference/parserSetAccessorWithTypeParameters1.js +++ b/tests/baselines/reference/parserSetAccessorWithTypeParameters1.js @@ -4,7 +4,7 @@ class C { } //// [parserSetAccessorWithTypeParameters1.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } Object.defineProperty(C.prototype, "foo", { diff --git a/tests/baselines/reference/parserSuperExpression1.js b/tests/baselines/reference/parserSuperExpression1.js index 02bd49653fe6e..e955125969907 100644 --- a/tests/baselines/reference/parserSuperExpression1.js +++ b/tests/baselines/reference/parserSuperExpression1.js @@ -14,7 +14,7 @@ module M1.M2 { } //// [parserSuperExpression1.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } C.prototype.foo = function () { @@ -26,7 +26,7 @@ var M1; (function (M1) { var M2; (function (M2) { - var C = (function () { + var C = /** @class */ (function () { function C() { } C.prototype.foo = function () { diff --git a/tests/baselines/reference/parserSuperExpression2.js b/tests/baselines/reference/parserSuperExpression2.js index ebd43ad318033..2a1a8e3a13c80 100644 --- a/tests/baselines/reference/parserSuperExpression2.js +++ b/tests/baselines/reference/parserSuperExpression2.js @@ -6,7 +6,7 @@ class C { } //// [parserSuperExpression2.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } C.prototype.M = function () { diff --git a/tests/baselines/reference/parserSuperExpression3.js b/tests/baselines/reference/parserSuperExpression3.js index 064353669c80c..c79df7e1d3a99 100644 --- a/tests/baselines/reference/parserSuperExpression3.js +++ b/tests/baselines/reference/parserSuperExpression3.js @@ -6,7 +6,7 @@ class C { } //// [parserSuperExpression3.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } C.prototype.M = function () { diff --git a/tests/baselines/reference/parserSuperExpression4.js b/tests/baselines/reference/parserSuperExpression4.js index 97f6ad26c4b63..71837fc935e12 100644 --- a/tests/baselines/reference/parserSuperExpression4.js +++ b/tests/baselines/reference/parserSuperExpression4.js @@ -14,7 +14,7 @@ module M1.M2 { } //// [parserSuperExpression4.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } C.prototype.foo = function () { @@ -26,7 +26,7 @@ var M1; (function (M1) { var M2; (function (M2) { - var C = (function () { + var C = /** @class */ (function () { function C() { } C.prototype.foo = function () { diff --git a/tests/baselines/reference/parserUnicode3.js b/tests/baselines/reference/parserUnicode3.js index 30652e90cfaa1..17e28e688cfa7 100644 --- a/tests/baselines/reference/parserUnicode3.js +++ b/tests/baselines/reference/parserUnicode3.js @@ -3,7 +3,7 @@ class 剩下 { } //// [parserUnicode3.js] -var 剩下 = (function () { +var 剩下 = /** @class */ (function () { function 剩下() { } return 剩下; diff --git a/tests/baselines/reference/parserharness.js b/tests/baselines/reference/parserharness.js index 2275a1f682e1b..6be17492731c8 100644 --- a/tests/baselines/reference/parserharness.js +++ b/tests/baselines/reference/parserharness.js @@ -2272,7 +2272,7 @@ var Harness; return content; } Harness.readFile = readFile; - var Logger = (function () { + var Logger = /** @class */ (function () { function Logger() { } Logger.prototype.start = function (fileName, priority) { }; @@ -2307,7 +2307,7 @@ var Harness; } } Harness.emitLog = emitLog; - var Runnable = (function () { + var Runnable = /** @class */ (function () { function Runnable(description, block) { this.description = description; this.block = block; @@ -2382,7 +2382,7 @@ var Harness; return Runnable; }()); Harness.Runnable = Runnable; - var TestCase = (function (_super) { + var TestCase = /** @class */ (function (_super) { __extends(TestCase, _super); function TestCase(description, block) { var _this = _super.call(this, description, block) || this; @@ -2417,7 +2417,7 @@ var Harness; return TestCase; }(Runnable)); Harness.TestCase = TestCase; - var Scenario = (function (_super) { + var Scenario = /** @class */ (function (_super) { __extends(Scenario, _super); function Scenario(description, block) { var _this = _super.call(this, description, block) || this; @@ -2473,7 +2473,7 @@ var Harness; return Scenario; }(Runnable)); Harness.Scenario = Scenario; - var Run = (function (_super) { + var Run = /** @class */ (function (_super) { __extends(Run, _super); function Run() { return _super.call(this, 'Test Run', null) || this; @@ -2524,7 +2524,7 @@ var Harness; Clock.resolution = 1000; } })(Clock = Perf.Clock || (Perf.Clock = {})); - var Timer = (function () { + var Timer = /** @class */ (function () { function Timer() { this.time = 0; } @@ -2539,7 +2539,7 @@ var Harness; return Timer; }()); Perf.Timer = Timer; - var Dataset = (function () { + var Dataset = /** @class */ (function () { function Dataset() { this.data = []; } @@ -2583,7 +2583,7 @@ var Harness; }()); Perf.Dataset = Dataset; // Base benchmark class with some defaults. - var Benchmark = (function () { + var Benchmark = /** @class */ (function () { function Benchmark() { this.iterations = 10; this.description = ""; @@ -2657,7 +2657,7 @@ var Harness; /** Aggregate various writes into a single array of lines. Useful for passing to the * TypeScript compiler to fill with source code or errors. */ - var WriterAggregator = (function () { + var WriterAggregator = /** @class */ (function () { function WriterAggregator() { this.lines = []; this.currentLine = ""; @@ -2683,7 +2683,7 @@ var Harness; }()); Compiler.WriterAggregator = WriterAggregator; /** Mimics having multiple files, later concatenated to a single file. */ - var EmitterIOHost = (function () { + var EmitterIOHost = /** @class */ (function () { function EmitterIOHost() { this.fileCollection = {}; } @@ -2764,7 +2764,7 @@ var Harness; } Compiler.compile = compile; // Types - var Type = (function () { + var Type = /** @class */ (function () { function Type(type, code, identifier) { this.type = type; this.code = code; @@ -2882,7 +2882,7 @@ var Harness; return Type; }()); Compiler.Type = Type; - var TypeFactory = (function () { + var TypeFactory = /** @class */ (function () { function TypeFactory() { this.any = this.get('var x : any', 'x'); this.number = this.get('var x : number', 'x'); @@ -3084,7 +3084,7 @@ var Harness; } Compiler.generateDeclFile = generateDeclFile; /** Contains the code and errors of a compilation and some helper methods to check its status. */ - var CompilerResult = (function () { + var CompilerResult = /** @class */ (function () { /** @param fileResults an array of strings for the filename and an ITextWriter with its code */ function CompilerResult(fileResults, errorLines, scripts) { this.fileResults = fileResults; @@ -3120,7 +3120,7 @@ var Harness; }()); Compiler.CompilerResult = CompilerResult; // Compiler Error. - var CompilerError = (function () { + var CompilerError = /** @class */ (function () { function CompilerError(file, line, column, message) { this.file = file; this.line = line; @@ -3410,7 +3410,7 @@ var Harness; } TestCaseParser.makeUnitsFromTest = makeUnitsFromTest; })(TestCaseParser = Harness.TestCaseParser || (Harness.TestCaseParser = {})); - var ScriptInfo = (function () { + var ScriptInfo = /** @class */ (function () { function ScriptInfo(name, content, isResident, maxScriptVersions) { this.name = name; this.content = content; @@ -3461,7 +3461,7 @@ var Harness; return ScriptInfo; }()); Harness.ScriptInfo = ScriptInfo; - var TypeScriptLS = (function () { + var TypeScriptLS = /** @class */ (function () { function TypeScriptLS() { this.ls = null; this.scripts = []; diff --git a/tests/baselines/reference/parserindenter.js b/tests/baselines/reference/parserindenter.js index 17f713189405a..27b73e5020284 100644 --- a/tests/baselines/reference/parserindenter.js +++ b/tests/baselines/reference/parserindenter.js @@ -759,7 +759,7 @@ module Formatting { /// var Formatting; (function (Formatting) { - var Indenter = (function () { + var Indenter = /** @class */ (function () { function Indenter(logger, tree, snapshot, languageHostIndentation, editorOptions, firstToken, smartIndent) { this.logger = logger; this.tree = tree; diff --git a/tests/baselines/reference/parsingClassRecoversWhenHittingUnexpectedSemicolon.js b/tests/baselines/reference/parsingClassRecoversWhenHittingUnexpectedSemicolon.js index de5777feca800..f3351eba4853a 100644 --- a/tests/baselines/reference/parsingClassRecoversWhenHittingUnexpectedSemicolon.js +++ b/tests/baselines/reference/parsingClassRecoversWhenHittingUnexpectedSemicolon.js @@ -6,7 +6,7 @@ class C { //// [parsingClassRecoversWhenHittingUnexpectedSemicolon.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } C.prototype.f = function () { }; diff --git a/tests/baselines/reference/partiallyAmbientClodule.js b/tests/baselines/reference/partiallyAmbientClodule.js index f721d032f343d..86936749ef6ce 100644 --- a/tests/baselines/reference/partiallyAmbientClodule.js +++ b/tests/baselines/reference/partiallyAmbientClodule.js @@ -5,7 +5,7 @@ declare module foo { class foo { } // Legal, because module is ambient //// [partiallyAmbientClodule.js] -var foo = (function () { +var foo = /** @class */ (function () { function foo() { } return foo; diff --git a/tests/baselines/reference/partiallyAnnotatedFunctionInferenceError.js b/tests/baselines/reference/partiallyAnnotatedFunctionInferenceError.js index 88439493a5028..b16f86580e6cd 100644 --- a/tests/baselines/reference/partiallyAnnotatedFunctionInferenceError.js +++ b/tests/baselines/reference/partiallyAnnotatedFunctionInferenceError.js @@ -26,12 +26,12 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var C = (function () { +var C = /** @class */ (function () { function C() { } return C; }()); -var D = (function (_super) { +var D = /** @class */ (function (_super) { __extends(D, _super); function D() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/partiallyAnnotatedFunctionInferenceWithTypeParameter.js b/tests/baselines/reference/partiallyAnnotatedFunctionInferenceWithTypeParameter.js index 6a46935b22481..4f62b376e0379 100644 --- a/tests/baselines/reference/partiallyAnnotatedFunctionInferenceWithTypeParameter.js +++ b/tests/baselines/reference/partiallyAnnotatedFunctionInferenceWithTypeParameter.js @@ -45,12 +45,12 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var C = (function () { +var C = /** @class */ (function () { function C() { } return C; }()); -var D = (function (_super) { +var D = /** @class */ (function (_super) { __extends(D, _super); function D() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/partiallyDiscriminantedUnions.js b/tests/baselines/reference/partiallyDiscriminantedUnions.js index 4c1a0a77f5362..8cbf44c5b2cac 100644 --- a/tests/baselines/reference/partiallyDiscriminantedUnions.js +++ b/tests/baselines/reference/partiallyDiscriminantedUnions.js @@ -55,12 +55,12 @@ if (ab.type === 'a') { } } // Repro from #11185 -var Square = (function () { +var Square = /** @class */ (function () { function Square() { } return Square; }()); -var Circle = (function () { +var Circle = /** @class */ (function () { function Circle() { } return Circle; diff --git a/tests/baselines/reference/plusOperatorWithAnyOtherType.js b/tests/baselines/reference/plusOperatorWithAnyOtherType.js index 6c24aa68806ca..e7780740645a6 100644 --- a/tests/baselines/reference/plusOperatorWithAnyOtherType.js +++ b/tests/baselines/reference/plusOperatorWithAnyOtherType.js @@ -67,7 +67,7 @@ function foo() { var a; return a; } -var A = (function () { +var A = /** @class */ (function () { function A() { } A.foo = function () { diff --git a/tests/baselines/reference/plusOperatorWithBooleanType.js b/tests/baselines/reference/plusOperatorWithBooleanType.js index 1bd72bb6ea77a..f0c6540db0ba8 100644 --- a/tests/baselines/reference/plusOperatorWithBooleanType.js +++ b/tests/baselines/reference/plusOperatorWithBooleanType.js @@ -39,7 +39,7 @@ var ResultIsNumber7 = +A.foo(); // + operator on boolean type var BOOLEAN; function foo() { return true; } -var A = (function () { +var A = /** @class */ (function () { function A() { } A.foo = function () { return false; }; diff --git a/tests/baselines/reference/plusOperatorWithNumberType.js b/tests/baselines/reference/plusOperatorWithNumberType.js index 377577194bbd4..aba1ad745285b 100644 --- a/tests/baselines/reference/plusOperatorWithNumberType.js +++ b/tests/baselines/reference/plusOperatorWithNumberType.js @@ -46,7 +46,7 @@ var ResultIsNumber11 = +(NUMBER + NUMBER); var NUMBER; var NUMBER1 = [1, 2]; function foo() { return 1; } -var A = (function () { +var A = /** @class */ (function () { function A() { } A.foo = function () { return 1; }; diff --git a/tests/baselines/reference/plusOperatorWithStringType.js b/tests/baselines/reference/plusOperatorWithStringType.js index 19d143eeb8e57..3893bc1cb8c13 100644 --- a/tests/baselines/reference/plusOperatorWithStringType.js +++ b/tests/baselines/reference/plusOperatorWithStringType.js @@ -45,7 +45,7 @@ var ResultIsNumber12 = +STRING.charAt(0); var STRING; var STRING1 = ["", "abc"]; function foo() { return "abc"; } -var A = (function () { +var A = /** @class */ (function () { function A() { } A.foo = function () { return ""; }; diff --git a/tests/baselines/reference/prespecializedGenericMembers1.js b/tests/baselines/reference/prespecializedGenericMembers1.js index f7e41263237d6..2a89c2d6e184e 100644 --- a/tests/baselines/reference/prespecializedGenericMembers1.js +++ b/tests/baselines/reference/prespecializedGenericMembers1.js @@ -23,13 +23,13 @@ var catBag = new CatBag(catThing); //// [prespecializedGenericMembers1.js] "use strict"; exports.__esModule = true; -var Cat = (function () { +var Cat = /** @class */ (function () { function Cat() { } return Cat; }()); exports.Cat = Cat; -var CatBag = (function () { +var CatBag = /** @class */ (function () { function CatBag(cats) { } return CatBag; diff --git a/tests/baselines/reference/primitiveConstraints2.js b/tests/baselines/reference/primitiveConstraints2.js index c8c49b2a16487..b7563407cc238 100644 --- a/tests/baselines/reference/primitiveConstraints2.js +++ b/tests/baselines/reference/primitiveConstraints2.js @@ -10,7 +10,7 @@ x.bar2(2, ""); // should error x.bar2(2, ""); // should error //// [primitiveConstraints2.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } C.prototype.bar2 = function (x, y) { diff --git a/tests/baselines/reference/primitiveMembers.js b/tests/baselines/reference/primitiveMembers.js index 163c5c8873d83..a1db8c9eb9f82 100644 --- a/tests/baselines/reference/primitiveMembers.js +++ b/tests/baselines/reference/primitiveMembers.js @@ -58,14 +58,14 @@ var n2 = 34; var s = "yo"; var b = true; var n3 = 5 || {}; -var baz = (function () { +var baz = /** @class */ (function () { function baz() { } baz.prototype.bar = function () { }; ; return baz; }()); -var foo = (function (_super) { +var foo = /** @class */ (function (_super) { __extends(foo, _super); function foo() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/primitiveTypeAsClassName.js b/tests/baselines/reference/primitiveTypeAsClassName.js index f68d64f9444b1..12414395792d0 100644 --- a/tests/baselines/reference/primitiveTypeAsClassName.js +++ b/tests/baselines/reference/primitiveTypeAsClassName.js @@ -2,7 +2,7 @@ class any {} //// [primitiveTypeAsClassName.js] -var any = (function () { +var any = /** @class */ (function () { function any() { } return any; diff --git a/tests/baselines/reference/privacyAccessorDeclFile.js b/tests/baselines/reference/privacyAccessorDeclFile.js index 9d92ba0d6846b..57dbd8b494732 100644 --- a/tests/baselines/reference/privacyAccessorDeclFile.js +++ b/tests/baselines/reference/privacyAccessorDeclFile.js @@ -1061,18 +1061,18 @@ module publicModuleInGlobal { //// [privacyAccessorDeclFile_externalModule.js] "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); -var privateClass = (function () { +var privateClass = /** @class */ (function () { function privateClass() { } return privateClass; }()); -var publicClass = (function () { +var publicClass = /** @class */ (function () { function publicClass() { } return publicClass; }()); exports.publicClass = publicClass; -var publicClassWithWithPrivateGetAccessorTypes = (function () { +var publicClassWithWithPrivateGetAccessorTypes = /** @class */ (function () { function publicClassWithWithPrivateGetAccessorTypes() { } Object.defineProperty(publicClassWithWithPrivateGetAccessorTypes, "myPublicStaticMethod", { @@ -1134,7 +1134,7 @@ var publicClassWithWithPrivateGetAccessorTypes = (function () { return publicClassWithWithPrivateGetAccessorTypes; }()); exports.publicClassWithWithPrivateGetAccessorTypes = publicClassWithWithPrivateGetAccessorTypes; -var publicClassWithWithPublicGetAccessorTypes = (function () { +var publicClassWithWithPublicGetAccessorTypes = /** @class */ (function () { function publicClassWithWithPublicGetAccessorTypes() { } Object.defineProperty(publicClassWithWithPublicGetAccessorTypes, "myPublicStaticMethod", { @@ -1196,7 +1196,7 @@ var publicClassWithWithPublicGetAccessorTypes = (function () { return publicClassWithWithPublicGetAccessorTypes; }()); exports.publicClassWithWithPublicGetAccessorTypes = publicClassWithWithPublicGetAccessorTypes; -var privateClassWithWithPrivateGetAccessorTypes = (function () { +var privateClassWithWithPrivateGetAccessorTypes = /** @class */ (function () { function privateClassWithWithPrivateGetAccessorTypes() { } Object.defineProperty(privateClassWithWithPrivateGetAccessorTypes, "myPublicStaticMethod", { @@ -1257,7 +1257,7 @@ var privateClassWithWithPrivateGetAccessorTypes = (function () { }); return privateClassWithWithPrivateGetAccessorTypes; }()); -var privateClassWithWithPublicGetAccessorTypes = (function () { +var privateClassWithWithPublicGetAccessorTypes = /** @class */ (function () { function privateClassWithWithPublicGetAccessorTypes() { } Object.defineProperty(privateClassWithWithPublicGetAccessorTypes, "myPublicStaticMethod", { @@ -1318,7 +1318,7 @@ var privateClassWithWithPublicGetAccessorTypes = (function () { }); return privateClassWithWithPublicGetAccessorTypes; }()); -var publicClassWithWithPrivateSetAccessorTypes = (function () { +var publicClassWithWithPrivateSetAccessorTypes = /** @class */ (function () { function publicClassWithWithPrivateSetAccessorTypes() { } Object.defineProperty(publicClassWithWithPrivateSetAccessorTypes, "myPublicStaticMethod", { @@ -1348,7 +1348,7 @@ var publicClassWithWithPrivateSetAccessorTypes = (function () { return publicClassWithWithPrivateSetAccessorTypes; }()); exports.publicClassWithWithPrivateSetAccessorTypes = publicClassWithWithPrivateSetAccessorTypes; -var publicClassWithWithPublicSetAccessorTypes = (function () { +var publicClassWithWithPublicSetAccessorTypes = /** @class */ (function () { function publicClassWithWithPublicSetAccessorTypes() { } Object.defineProperty(publicClassWithWithPublicSetAccessorTypes, "myPublicStaticMethod", { @@ -1378,7 +1378,7 @@ var publicClassWithWithPublicSetAccessorTypes = (function () { return publicClassWithWithPublicSetAccessorTypes; }()); exports.publicClassWithWithPublicSetAccessorTypes = publicClassWithWithPublicSetAccessorTypes; -var privateClassWithWithPrivateSetAccessorTypes = (function () { +var privateClassWithWithPrivateSetAccessorTypes = /** @class */ (function () { function privateClassWithWithPrivateSetAccessorTypes() { } Object.defineProperty(privateClassWithWithPrivateSetAccessorTypes, "myPublicStaticMethod", { @@ -1407,7 +1407,7 @@ var privateClassWithWithPrivateSetAccessorTypes = (function () { }); return privateClassWithWithPrivateSetAccessorTypes; }()); -var privateClassWithWithPublicSetAccessorTypes = (function () { +var privateClassWithWithPublicSetAccessorTypes = /** @class */ (function () { function privateClassWithWithPublicSetAccessorTypes() { } Object.defineProperty(privateClassWithWithPublicSetAccessorTypes, "myPublicStaticMethod", { @@ -1436,7 +1436,7 @@ var privateClassWithWithPublicSetAccessorTypes = (function () { }); return privateClassWithWithPublicSetAccessorTypes; }()); -var publicClassWithPrivateModuleGetAccessorTypes = (function () { +var publicClassWithPrivateModuleGetAccessorTypes = /** @class */ (function () { function publicClassWithPrivateModuleGetAccessorTypes() { } Object.defineProperty(publicClassWithPrivateModuleGetAccessorTypes, "myPublicStaticMethod", { @@ -1470,7 +1470,7 @@ var publicClassWithPrivateModuleGetAccessorTypes = (function () { return publicClassWithPrivateModuleGetAccessorTypes; }()); exports.publicClassWithPrivateModuleGetAccessorTypes = publicClassWithPrivateModuleGetAccessorTypes; -var publicClassWithPrivateModuleSetAccessorTypes = (function () { +var publicClassWithPrivateModuleSetAccessorTypes = /** @class */ (function () { function publicClassWithPrivateModuleSetAccessorTypes() { } Object.defineProperty(publicClassWithPrivateModuleSetAccessorTypes, "myPublicStaticMethod", { @@ -1488,7 +1488,7 @@ var publicClassWithPrivateModuleSetAccessorTypes = (function () { return publicClassWithPrivateModuleSetAccessorTypes; }()); exports.publicClassWithPrivateModuleSetAccessorTypes = publicClassWithPrivateModuleSetAccessorTypes; -var privateClassWithPrivateModuleGetAccessorTypes = (function () { +var privateClassWithPrivateModuleGetAccessorTypes = /** @class */ (function () { function privateClassWithPrivateModuleGetAccessorTypes() { } Object.defineProperty(privateClassWithPrivateModuleGetAccessorTypes, "myPublicStaticMethod", { @@ -1521,7 +1521,7 @@ var privateClassWithPrivateModuleGetAccessorTypes = (function () { }); return privateClassWithPrivateModuleGetAccessorTypes; }()); -var privateClassWithPrivateModuleSetAccessorTypes = (function () { +var privateClassWithPrivateModuleSetAccessorTypes = /** @class */ (function () { function privateClassWithPrivateModuleSetAccessorTypes() { } Object.defineProperty(privateClassWithPrivateModuleSetAccessorTypes, "myPublicStaticMethod", { @@ -1540,18 +1540,18 @@ var privateClassWithPrivateModuleSetAccessorTypes = (function () { }()); var publicModule; (function (publicModule) { - var privateClass = (function () { + var privateClass = /** @class */ (function () { function privateClass() { } return privateClass; }()); - var publicClass = (function () { + var publicClass = /** @class */ (function () { function publicClass() { } return publicClass; }()); publicModule.publicClass = publicClass; - var publicClassWithWithPrivateGetAccessorTypes = (function () { + var publicClassWithWithPrivateGetAccessorTypes = /** @class */ (function () { function publicClassWithWithPrivateGetAccessorTypes() { } Object.defineProperty(publicClassWithWithPrivateGetAccessorTypes, "myPublicStaticMethod", { @@ -1613,7 +1613,7 @@ var publicModule; return publicClassWithWithPrivateGetAccessorTypes; }()); publicModule.publicClassWithWithPrivateGetAccessorTypes = publicClassWithWithPrivateGetAccessorTypes; - var publicClassWithWithPublicGetAccessorTypes = (function () { + var publicClassWithWithPublicGetAccessorTypes = /** @class */ (function () { function publicClassWithWithPublicGetAccessorTypes() { } Object.defineProperty(publicClassWithWithPublicGetAccessorTypes, "myPublicStaticMethod", { @@ -1675,7 +1675,7 @@ var publicModule; return publicClassWithWithPublicGetAccessorTypes; }()); publicModule.publicClassWithWithPublicGetAccessorTypes = publicClassWithWithPublicGetAccessorTypes; - var privateClassWithWithPrivateGetAccessorTypes = (function () { + var privateClassWithWithPrivateGetAccessorTypes = /** @class */ (function () { function privateClassWithWithPrivateGetAccessorTypes() { } Object.defineProperty(privateClassWithWithPrivateGetAccessorTypes, "myPublicStaticMethod", { @@ -1736,7 +1736,7 @@ var publicModule; }); return privateClassWithWithPrivateGetAccessorTypes; }()); - var privateClassWithWithPublicGetAccessorTypes = (function () { + var privateClassWithWithPublicGetAccessorTypes = /** @class */ (function () { function privateClassWithWithPublicGetAccessorTypes() { } Object.defineProperty(privateClassWithWithPublicGetAccessorTypes, "myPublicStaticMethod", { @@ -1797,7 +1797,7 @@ var publicModule; }); return privateClassWithWithPublicGetAccessorTypes; }()); - var publicClassWithWithPrivateSetAccessorTypes = (function () { + var publicClassWithWithPrivateSetAccessorTypes = /** @class */ (function () { function publicClassWithWithPrivateSetAccessorTypes() { } Object.defineProperty(publicClassWithWithPrivateSetAccessorTypes, "myPublicStaticMethod", { @@ -1827,7 +1827,7 @@ var publicModule; return publicClassWithWithPrivateSetAccessorTypes; }()); publicModule.publicClassWithWithPrivateSetAccessorTypes = publicClassWithWithPrivateSetAccessorTypes; - var publicClassWithWithPublicSetAccessorTypes = (function () { + var publicClassWithWithPublicSetAccessorTypes = /** @class */ (function () { function publicClassWithWithPublicSetAccessorTypes() { } Object.defineProperty(publicClassWithWithPublicSetAccessorTypes, "myPublicStaticMethod", { @@ -1857,7 +1857,7 @@ var publicModule; return publicClassWithWithPublicSetAccessorTypes; }()); publicModule.publicClassWithWithPublicSetAccessorTypes = publicClassWithWithPublicSetAccessorTypes; - var privateClassWithWithPrivateSetAccessorTypes = (function () { + var privateClassWithWithPrivateSetAccessorTypes = /** @class */ (function () { function privateClassWithWithPrivateSetAccessorTypes() { } Object.defineProperty(privateClassWithWithPrivateSetAccessorTypes, "myPublicStaticMethod", { @@ -1886,7 +1886,7 @@ var publicModule; }); return privateClassWithWithPrivateSetAccessorTypes; }()); - var privateClassWithWithPublicSetAccessorTypes = (function () { + var privateClassWithWithPublicSetAccessorTypes = /** @class */ (function () { function privateClassWithWithPublicSetAccessorTypes() { } Object.defineProperty(privateClassWithWithPublicSetAccessorTypes, "myPublicStaticMethod", { @@ -1915,7 +1915,7 @@ var publicModule; }); return privateClassWithWithPublicSetAccessorTypes; }()); - var publicClassWithPrivateModuleGetAccessorTypes = (function () { + var publicClassWithPrivateModuleGetAccessorTypes = /** @class */ (function () { function publicClassWithPrivateModuleGetAccessorTypes() { } Object.defineProperty(publicClassWithPrivateModuleGetAccessorTypes, "myPublicStaticMethod", { @@ -1949,7 +1949,7 @@ var publicModule; return publicClassWithPrivateModuleGetAccessorTypes; }()); publicModule.publicClassWithPrivateModuleGetAccessorTypes = publicClassWithPrivateModuleGetAccessorTypes; - var publicClassWithPrivateModuleSetAccessorTypes = (function () { + var publicClassWithPrivateModuleSetAccessorTypes = /** @class */ (function () { function publicClassWithPrivateModuleSetAccessorTypes() { } Object.defineProperty(publicClassWithPrivateModuleSetAccessorTypes, "myPublicStaticMethod", { @@ -1967,7 +1967,7 @@ var publicModule; return publicClassWithPrivateModuleSetAccessorTypes; }()); publicModule.publicClassWithPrivateModuleSetAccessorTypes = publicClassWithPrivateModuleSetAccessorTypes; - var privateClassWithPrivateModuleGetAccessorTypes = (function () { + var privateClassWithPrivateModuleGetAccessorTypes = /** @class */ (function () { function privateClassWithPrivateModuleGetAccessorTypes() { } Object.defineProperty(privateClassWithPrivateModuleGetAccessorTypes, "myPublicStaticMethod", { @@ -2000,7 +2000,7 @@ var publicModule; }); return privateClassWithPrivateModuleGetAccessorTypes; }()); - var privateClassWithPrivateModuleSetAccessorTypes = (function () { + var privateClassWithPrivateModuleSetAccessorTypes = /** @class */ (function () { function privateClassWithPrivateModuleSetAccessorTypes() { } Object.defineProperty(privateClassWithPrivateModuleSetAccessorTypes, "myPublicStaticMethod", { @@ -2020,18 +2020,18 @@ var publicModule; })(publicModule = exports.publicModule || (exports.publicModule = {})); var privateModule; (function (privateModule) { - var privateClass = (function () { + var privateClass = /** @class */ (function () { function privateClass() { } return privateClass; }()); - var publicClass = (function () { + var publicClass = /** @class */ (function () { function publicClass() { } return publicClass; }()); privateModule.publicClass = publicClass; - var publicClassWithWithPrivateGetAccessorTypes = (function () { + var publicClassWithWithPrivateGetAccessorTypes = /** @class */ (function () { function publicClassWithWithPrivateGetAccessorTypes() { } Object.defineProperty(publicClassWithWithPrivateGetAccessorTypes, "myPublicStaticMethod", { @@ -2093,7 +2093,7 @@ var privateModule; return publicClassWithWithPrivateGetAccessorTypes; }()); privateModule.publicClassWithWithPrivateGetAccessorTypes = publicClassWithWithPrivateGetAccessorTypes; - var publicClassWithWithPublicGetAccessorTypes = (function () { + var publicClassWithWithPublicGetAccessorTypes = /** @class */ (function () { function publicClassWithWithPublicGetAccessorTypes() { } Object.defineProperty(publicClassWithWithPublicGetAccessorTypes, "myPublicStaticMethod", { @@ -2155,7 +2155,7 @@ var privateModule; return publicClassWithWithPublicGetAccessorTypes; }()); privateModule.publicClassWithWithPublicGetAccessorTypes = publicClassWithWithPublicGetAccessorTypes; - var privateClassWithWithPrivateGetAccessorTypes = (function () { + var privateClassWithWithPrivateGetAccessorTypes = /** @class */ (function () { function privateClassWithWithPrivateGetAccessorTypes() { } Object.defineProperty(privateClassWithWithPrivateGetAccessorTypes, "myPublicStaticMethod", { @@ -2216,7 +2216,7 @@ var privateModule; }); return privateClassWithWithPrivateGetAccessorTypes; }()); - var privateClassWithWithPublicGetAccessorTypes = (function () { + var privateClassWithWithPublicGetAccessorTypes = /** @class */ (function () { function privateClassWithWithPublicGetAccessorTypes() { } Object.defineProperty(privateClassWithWithPublicGetAccessorTypes, "myPublicStaticMethod", { @@ -2277,7 +2277,7 @@ var privateModule; }); return privateClassWithWithPublicGetAccessorTypes; }()); - var publicClassWithWithPrivateSetAccessorTypes = (function () { + var publicClassWithWithPrivateSetAccessorTypes = /** @class */ (function () { function publicClassWithWithPrivateSetAccessorTypes() { } Object.defineProperty(publicClassWithWithPrivateSetAccessorTypes, "myPublicStaticMethod", { @@ -2307,7 +2307,7 @@ var privateModule; return publicClassWithWithPrivateSetAccessorTypes; }()); privateModule.publicClassWithWithPrivateSetAccessorTypes = publicClassWithWithPrivateSetAccessorTypes; - var publicClassWithWithPublicSetAccessorTypes = (function () { + var publicClassWithWithPublicSetAccessorTypes = /** @class */ (function () { function publicClassWithWithPublicSetAccessorTypes() { } Object.defineProperty(publicClassWithWithPublicSetAccessorTypes, "myPublicStaticMethod", { @@ -2337,7 +2337,7 @@ var privateModule; return publicClassWithWithPublicSetAccessorTypes; }()); privateModule.publicClassWithWithPublicSetAccessorTypes = publicClassWithWithPublicSetAccessorTypes; - var privateClassWithWithPrivateSetAccessorTypes = (function () { + var privateClassWithWithPrivateSetAccessorTypes = /** @class */ (function () { function privateClassWithWithPrivateSetAccessorTypes() { } Object.defineProperty(privateClassWithWithPrivateSetAccessorTypes, "myPublicStaticMethod", { @@ -2366,7 +2366,7 @@ var privateModule; }); return privateClassWithWithPrivateSetAccessorTypes; }()); - var privateClassWithWithPublicSetAccessorTypes = (function () { + var privateClassWithWithPublicSetAccessorTypes = /** @class */ (function () { function privateClassWithWithPublicSetAccessorTypes() { } Object.defineProperty(privateClassWithWithPublicSetAccessorTypes, "myPublicStaticMethod", { @@ -2395,7 +2395,7 @@ var privateModule; }); return privateClassWithWithPublicSetAccessorTypes; }()); - var publicClassWithPrivateModuleGetAccessorTypes = (function () { + var publicClassWithPrivateModuleGetAccessorTypes = /** @class */ (function () { function publicClassWithPrivateModuleGetAccessorTypes() { } Object.defineProperty(publicClassWithPrivateModuleGetAccessorTypes, "myPublicStaticMethod", { @@ -2429,7 +2429,7 @@ var privateModule; return publicClassWithPrivateModuleGetAccessorTypes; }()); privateModule.publicClassWithPrivateModuleGetAccessorTypes = publicClassWithPrivateModuleGetAccessorTypes; - var publicClassWithPrivateModuleSetAccessorTypes = (function () { + var publicClassWithPrivateModuleSetAccessorTypes = /** @class */ (function () { function publicClassWithPrivateModuleSetAccessorTypes() { } Object.defineProperty(publicClassWithPrivateModuleSetAccessorTypes, "myPublicStaticMethod", { @@ -2447,7 +2447,7 @@ var privateModule; return publicClassWithPrivateModuleSetAccessorTypes; }()); privateModule.publicClassWithPrivateModuleSetAccessorTypes = publicClassWithPrivateModuleSetAccessorTypes; - var privateClassWithPrivateModuleGetAccessorTypes = (function () { + var privateClassWithPrivateModuleGetAccessorTypes = /** @class */ (function () { function privateClassWithPrivateModuleGetAccessorTypes() { } Object.defineProperty(privateClassWithPrivateModuleGetAccessorTypes, "myPublicStaticMethod", { @@ -2480,7 +2480,7 @@ var privateModule; }); return privateClassWithPrivateModuleGetAccessorTypes; }()); - var privateClassWithPrivateModuleSetAccessorTypes = (function () { + var privateClassWithPrivateModuleSetAccessorTypes = /** @class */ (function () { function privateClassWithPrivateModuleSetAccessorTypes() { } Object.defineProperty(privateClassWithPrivateModuleSetAccessorTypes, "myPublicStaticMethod", { @@ -2499,12 +2499,12 @@ var privateModule; }()); })(privateModule || (privateModule = {})); //// [privacyAccessorDeclFile_GlobalFile.js] -var publicClassInGlobal = (function () { +var publicClassInGlobal = /** @class */ (function () { function publicClassInGlobal() { } return publicClassInGlobal; }()); -var publicClassInGlobalWithPublicGetAccessorTypes = (function () { +var publicClassInGlobalWithPublicGetAccessorTypes = /** @class */ (function () { function publicClassInGlobalWithPublicGetAccessorTypes() { } Object.defineProperty(publicClassInGlobalWithPublicGetAccessorTypes, "myPublicStaticMethod", { @@ -2565,7 +2565,7 @@ var publicClassInGlobalWithPublicGetAccessorTypes = (function () { }); return publicClassInGlobalWithPublicGetAccessorTypes; }()); -var publicClassInGlobalWithWithPublicSetAccessorTypes = (function () { +var publicClassInGlobalWithWithPublicSetAccessorTypes = /** @class */ (function () { function publicClassInGlobalWithWithPublicSetAccessorTypes() { } Object.defineProperty(publicClassInGlobalWithWithPublicSetAccessorTypes, "myPublicStaticMethod", { @@ -2596,12 +2596,12 @@ var publicClassInGlobalWithWithPublicSetAccessorTypes = (function () { }()); var publicModuleInGlobal; (function (publicModuleInGlobal) { - var privateClass = (function () { + var privateClass = /** @class */ (function () { function privateClass() { } return privateClass; }()); - var publicClass = (function () { + var publicClass = /** @class */ (function () { function publicClass() { } return publicClass; @@ -2609,18 +2609,18 @@ var publicModuleInGlobal; publicModuleInGlobal.publicClass = publicClass; var privateModule; (function (privateModule) { - var privateClass = (function () { + var privateClass = /** @class */ (function () { function privateClass() { } return privateClass; }()); - var publicClass = (function () { + var publicClass = /** @class */ (function () { function publicClass() { } return publicClass; }()); privateModule.publicClass = publicClass; - var publicClassWithWithPrivateGetAccessorTypes = (function () { + var publicClassWithWithPrivateGetAccessorTypes = /** @class */ (function () { function publicClassWithWithPrivateGetAccessorTypes() { } Object.defineProperty(publicClassWithWithPrivateGetAccessorTypes, "myPublicStaticMethod", { @@ -2682,7 +2682,7 @@ var publicModuleInGlobal; return publicClassWithWithPrivateGetAccessorTypes; }()); privateModule.publicClassWithWithPrivateGetAccessorTypes = publicClassWithWithPrivateGetAccessorTypes; - var publicClassWithWithPublicGetAccessorTypes = (function () { + var publicClassWithWithPublicGetAccessorTypes = /** @class */ (function () { function publicClassWithWithPublicGetAccessorTypes() { } Object.defineProperty(publicClassWithWithPublicGetAccessorTypes, "myPublicStaticMethod", { @@ -2744,7 +2744,7 @@ var publicModuleInGlobal; return publicClassWithWithPublicGetAccessorTypes; }()); privateModule.publicClassWithWithPublicGetAccessorTypes = publicClassWithWithPublicGetAccessorTypes; - var privateClassWithWithPrivateGetAccessorTypes = (function () { + var privateClassWithWithPrivateGetAccessorTypes = /** @class */ (function () { function privateClassWithWithPrivateGetAccessorTypes() { } Object.defineProperty(privateClassWithWithPrivateGetAccessorTypes, "myPublicStaticMethod", { @@ -2805,7 +2805,7 @@ var publicModuleInGlobal; }); return privateClassWithWithPrivateGetAccessorTypes; }()); - var privateClassWithWithPublicGetAccessorTypes = (function () { + var privateClassWithWithPublicGetAccessorTypes = /** @class */ (function () { function privateClassWithWithPublicGetAccessorTypes() { } Object.defineProperty(privateClassWithWithPublicGetAccessorTypes, "myPublicStaticMethod", { @@ -2866,7 +2866,7 @@ var publicModuleInGlobal; }); return privateClassWithWithPublicGetAccessorTypes; }()); - var publicClassWithWithPrivateSetAccessorTypes = (function () { + var publicClassWithWithPrivateSetAccessorTypes = /** @class */ (function () { function publicClassWithWithPrivateSetAccessorTypes() { } Object.defineProperty(publicClassWithWithPrivateSetAccessorTypes, "myPublicStaticMethod", { @@ -2896,7 +2896,7 @@ var publicModuleInGlobal; return publicClassWithWithPrivateSetAccessorTypes; }()); privateModule.publicClassWithWithPrivateSetAccessorTypes = publicClassWithWithPrivateSetAccessorTypes; - var publicClassWithWithPublicSetAccessorTypes = (function () { + var publicClassWithWithPublicSetAccessorTypes = /** @class */ (function () { function publicClassWithWithPublicSetAccessorTypes() { } Object.defineProperty(publicClassWithWithPublicSetAccessorTypes, "myPublicStaticMethod", { @@ -2926,7 +2926,7 @@ var publicModuleInGlobal; return publicClassWithWithPublicSetAccessorTypes; }()); privateModule.publicClassWithWithPublicSetAccessorTypes = publicClassWithWithPublicSetAccessorTypes; - var privateClassWithWithPrivateSetAccessorTypes = (function () { + var privateClassWithWithPrivateSetAccessorTypes = /** @class */ (function () { function privateClassWithWithPrivateSetAccessorTypes() { } Object.defineProperty(privateClassWithWithPrivateSetAccessorTypes, "myPublicStaticMethod", { @@ -2955,7 +2955,7 @@ var publicModuleInGlobal; }); return privateClassWithWithPrivateSetAccessorTypes; }()); - var privateClassWithWithPublicSetAccessorTypes = (function () { + var privateClassWithWithPublicSetAccessorTypes = /** @class */ (function () { function privateClassWithWithPublicSetAccessorTypes() { } Object.defineProperty(privateClassWithWithPublicSetAccessorTypes, "myPublicStaticMethod", { @@ -2984,7 +2984,7 @@ var publicModuleInGlobal; }); return privateClassWithWithPublicSetAccessorTypes; }()); - var publicClassWithPrivateModuleGetAccessorTypes = (function () { + var publicClassWithPrivateModuleGetAccessorTypes = /** @class */ (function () { function publicClassWithPrivateModuleGetAccessorTypes() { } Object.defineProperty(publicClassWithPrivateModuleGetAccessorTypes, "myPublicStaticMethod", { @@ -3018,7 +3018,7 @@ var publicModuleInGlobal; return publicClassWithPrivateModuleGetAccessorTypes; }()); privateModule.publicClassWithPrivateModuleGetAccessorTypes = publicClassWithPrivateModuleGetAccessorTypes; - var publicClassWithPrivateModuleSetAccessorTypes = (function () { + var publicClassWithPrivateModuleSetAccessorTypes = /** @class */ (function () { function publicClassWithPrivateModuleSetAccessorTypes() { } Object.defineProperty(publicClassWithPrivateModuleSetAccessorTypes, "myPublicStaticMethod", { @@ -3036,7 +3036,7 @@ var publicModuleInGlobal; return publicClassWithPrivateModuleSetAccessorTypes; }()); privateModule.publicClassWithPrivateModuleSetAccessorTypes = publicClassWithPrivateModuleSetAccessorTypes; - var privateClassWithPrivateModuleGetAccessorTypes = (function () { + var privateClassWithPrivateModuleGetAccessorTypes = /** @class */ (function () { function privateClassWithPrivateModuleGetAccessorTypes() { } Object.defineProperty(privateClassWithPrivateModuleGetAccessorTypes, "myPublicStaticMethod", { @@ -3069,7 +3069,7 @@ var publicModuleInGlobal; }); return privateClassWithPrivateModuleGetAccessorTypes; }()); - var privateClassWithPrivateModuleSetAccessorTypes = (function () { + var privateClassWithPrivateModuleSetAccessorTypes = /** @class */ (function () { function privateClassWithPrivateModuleSetAccessorTypes() { } Object.defineProperty(privateClassWithPrivateModuleSetAccessorTypes, "myPublicStaticMethod", { @@ -3087,7 +3087,7 @@ var publicModuleInGlobal; return privateClassWithPrivateModuleSetAccessorTypes; }()); })(privateModule || (privateModule = {})); - var publicClassWithWithPrivateGetAccessorTypes = (function () { + var publicClassWithWithPrivateGetAccessorTypes = /** @class */ (function () { function publicClassWithWithPrivateGetAccessorTypes() { } Object.defineProperty(publicClassWithWithPrivateGetAccessorTypes, "myPublicStaticMethod", { @@ -3149,7 +3149,7 @@ var publicModuleInGlobal; return publicClassWithWithPrivateGetAccessorTypes; }()); publicModuleInGlobal.publicClassWithWithPrivateGetAccessorTypes = publicClassWithWithPrivateGetAccessorTypes; - var publicClassWithWithPublicGetAccessorTypes = (function () { + var publicClassWithWithPublicGetAccessorTypes = /** @class */ (function () { function publicClassWithWithPublicGetAccessorTypes() { } Object.defineProperty(publicClassWithWithPublicGetAccessorTypes, "myPublicStaticMethod", { @@ -3211,7 +3211,7 @@ var publicModuleInGlobal; return publicClassWithWithPublicGetAccessorTypes; }()); publicModuleInGlobal.publicClassWithWithPublicGetAccessorTypes = publicClassWithWithPublicGetAccessorTypes; - var privateClassWithWithPrivateGetAccessorTypes = (function () { + var privateClassWithWithPrivateGetAccessorTypes = /** @class */ (function () { function privateClassWithWithPrivateGetAccessorTypes() { } Object.defineProperty(privateClassWithWithPrivateGetAccessorTypes, "myPublicStaticMethod", { @@ -3272,7 +3272,7 @@ var publicModuleInGlobal; }); return privateClassWithWithPrivateGetAccessorTypes; }()); - var privateClassWithWithPublicGetAccessorTypes = (function () { + var privateClassWithWithPublicGetAccessorTypes = /** @class */ (function () { function privateClassWithWithPublicGetAccessorTypes() { } Object.defineProperty(privateClassWithWithPublicGetAccessorTypes, "myPublicStaticMethod", { @@ -3333,7 +3333,7 @@ var publicModuleInGlobal; }); return privateClassWithWithPublicGetAccessorTypes; }()); - var publicClassWithWithPrivateSetAccessorTypes = (function () { + var publicClassWithWithPrivateSetAccessorTypes = /** @class */ (function () { function publicClassWithWithPrivateSetAccessorTypes() { } Object.defineProperty(publicClassWithWithPrivateSetAccessorTypes, "myPublicStaticMethod", { @@ -3363,7 +3363,7 @@ var publicModuleInGlobal; return publicClassWithWithPrivateSetAccessorTypes; }()); publicModuleInGlobal.publicClassWithWithPrivateSetAccessorTypes = publicClassWithWithPrivateSetAccessorTypes; - var publicClassWithWithPublicSetAccessorTypes = (function () { + var publicClassWithWithPublicSetAccessorTypes = /** @class */ (function () { function publicClassWithWithPublicSetAccessorTypes() { } Object.defineProperty(publicClassWithWithPublicSetAccessorTypes, "myPublicStaticMethod", { @@ -3393,7 +3393,7 @@ var publicModuleInGlobal; return publicClassWithWithPublicSetAccessorTypes; }()); publicModuleInGlobal.publicClassWithWithPublicSetAccessorTypes = publicClassWithWithPublicSetAccessorTypes; - var privateClassWithWithPrivateSetAccessorTypes = (function () { + var privateClassWithWithPrivateSetAccessorTypes = /** @class */ (function () { function privateClassWithWithPrivateSetAccessorTypes() { } Object.defineProperty(privateClassWithWithPrivateSetAccessorTypes, "myPublicStaticMethod", { @@ -3422,7 +3422,7 @@ var publicModuleInGlobal; }); return privateClassWithWithPrivateSetAccessorTypes; }()); - var privateClassWithWithPublicSetAccessorTypes = (function () { + var privateClassWithWithPublicSetAccessorTypes = /** @class */ (function () { function privateClassWithWithPublicSetAccessorTypes() { } Object.defineProperty(privateClassWithWithPublicSetAccessorTypes, "myPublicStaticMethod", { @@ -3451,7 +3451,7 @@ var publicModuleInGlobal; }); return privateClassWithWithPublicSetAccessorTypes; }()); - var publicClassWithPrivateModuleGetAccessorTypes = (function () { + var publicClassWithPrivateModuleGetAccessorTypes = /** @class */ (function () { function publicClassWithPrivateModuleGetAccessorTypes() { } Object.defineProperty(publicClassWithPrivateModuleGetAccessorTypes, "myPublicStaticMethod", { @@ -3485,7 +3485,7 @@ var publicModuleInGlobal; return publicClassWithPrivateModuleGetAccessorTypes; }()); publicModuleInGlobal.publicClassWithPrivateModuleGetAccessorTypes = publicClassWithPrivateModuleGetAccessorTypes; - var publicClassWithPrivateModuleSetAccessorTypes = (function () { + var publicClassWithPrivateModuleSetAccessorTypes = /** @class */ (function () { function publicClassWithPrivateModuleSetAccessorTypes() { } Object.defineProperty(publicClassWithPrivateModuleSetAccessorTypes, "myPublicStaticMethod", { @@ -3503,7 +3503,7 @@ var publicModuleInGlobal; return publicClassWithPrivateModuleSetAccessorTypes; }()); publicModuleInGlobal.publicClassWithPrivateModuleSetAccessorTypes = publicClassWithPrivateModuleSetAccessorTypes; - var privateClassWithPrivateModuleGetAccessorTypes = (function () { + var privateClassWithPrivateModuleGetAccessorTypes = /** @class */ (function () { function privateClassWithPrivateModuleGetAccessorTypes() { } Object.defineProperty(privateClassWithPrivateModuleGetAccessorTypes, "myPublicStaticMethod", { @@ -3536,7 +3536,7 @@ var publicModuleInGlobal; }); return privateClassWithPrivateModuleGetAccessorTypes; }()); - var privateClassWithPrivateModuleSetAccessorTypes = (function () { + var privateClassWithPrivateModuleSetAccessorTypes = /** @class */ (function () { function privateClassWithPrivateModuleSetAccessorTypes() { } Object.defineProperty(privateClassWithPrivateModuleSetAccessorTypes, "myPublicStaticMethod", { diff --git a/tests/baselines/reference/privacyCannotNameAccessorDeclFile.js b/tests/baselines/reference/privacyCannotNameAccessorDeclFile.js index c2a781f9b6970..16cc0f6924f86 100644 --- a/tests/baselines/reference/privacyCannotNameAccessorDeclFile.js +++ b/tests/baselines/reference/privacyCannotNameAccessorDeclFile.js @@ -139,7 +139,7 @@ class privateClassWithPrivateModuleGetAccessorTypes { //// [privacyCannotNameAccessorDeclFile_Widgets.js] "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); -var Widget1 = (function () { +var Widget1 = /** @class */ (function () { function Widget1() { this.name = 'one'; } @@ -152,7 +152,7 @@ function createWidget1() { exports.createWidget1 = createWidget1; var SpecializedWidget; (function (SpecializedWidget) { - var Widget2 = (function () { + var Widget2 = /** @class */ (function () { function Widget2() { this.name = 'one'; } @@ -190,7 +190,7 @@ exports.createExportedWidget4 = createExportedWidget4; "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var exporter = require("./privacyCannotNameAccessorDeclFile_exporter"); -var publicClassWithWithPrivateGetAccessorTypes = (function () { +var publicClassWithWithPrivateGetAccessorTypes = /** @class */ (function () { function publicClassWithWithPrivateGetAccessorTypes() { } Object.defineProperty(publicClassWithWithPrivateGetAccessorTypes, "myPublicStaticMethod", { @@ -252,7 +252,7 @@ var publicClassWithWithPrivateGetAccessorTypes = (function () { return publicClassWithWithPrivateGetAccessorTypes; }()); exports.publicClassWithWithPrivateGetAccessorTypes = publicClassWithWithPrivateGetAccessorTypes; -var privateClassWithWithPrivateGetAccessorTypes = (function () { +var privateClassWithWithPrivateGetAccessorTypes = /** @class */ (function () { function privateClassWithWithPrivateGetAccessorTypes() { } Object.defineProperty(privateClassWithWithPrivateGetAccessorTypes, "myPublicStaticMethod", { @@ -313,7 +313,7 @@ var privateClassWithWithPrivateGetAccessorTypes = (function () { }); return privateClassWithWithPrivateGetAccessorTypes; }()); -var publicClassWithPrivateModuleGetAccessorTypes = (function () { +var publicClassWithPrivateModuleGetAccessorTypes = /** @class */ (function () { function publicClassWithPrivateModuleGetAccessorTypes() { } Object.defineProperty(publicClassWithPrivateModuleGetAccessorTypes, "myPublicStaticMethod", { @@ -347,7 +347,7 @@ var publicClassWithPrivateModuleGetAccessorTypes = (function () { return publicClassWithPrivateModuleGetAccessorTypes; }()); exports.publicClassWithPrivateModuleGetAccessorTypes = publicClassWithPrivateModuleGetAccessorTypes; -var privateClassWithPrivateModuleGetAccessorTypes = (function () { +var privateClassWithPrivateModuleGetAccessorTypes = /** @class */ (function () { function privateClassWithPrivateModuleGetAccessorTypes() { } Object.defineProperty(privateClassWithPrivateModuleGetAccessorTypes, "myPublicStaticMethod", { diff --git a/tests/baselines/reference/privacyCannotNameVarTypeDeclFile.js b/tests/baselines/reference/privacyCannotNameVarTypeDeclFile.js index da23223510c7d..ba519bb081a59 100644 --- a/tests/baselines/reference/privacyCannotNameVarTypeDeclFile.js +++ b/tests/baselines/reference/privacyCannotNameVarTypeDeclFile.js @@ -102,7 +102,7 @@ var privateVarWithPrivateModulePropertyTypes1 = exporter.createExportedWidget4() //// [privacyCannotNameVarTypeDeclFile_Widgets.js] "use strict"; exports.__esModule = true; -var Widget1 = (function () { +var Widget1 = /** @class */ (function () { function Widget1() { this.name = 'one'; } @@ -115,7 +115,7 @@ function createWidget1() { exports.createWidget1 = createWidget1; var SpecializedWidget; (function (SpecializedWidget) { - var Widget2 = (function () { + var Widget2 = /** @class */ (function () { function Widget2() { this.name = 'one'; } @@ -153,7 +153,7 @@ exports.createExportedWidget4 = createExportedWidget4; "use strict"; exports.__esModule = true; var exporter = require("./privacyCannotNameVarTypeDeclFile_exporter"); -var publicClassWithWithPrivatePropertyTypes = (function () { +var publicClassWithWithPrivatePropertyTypes = /** @class */ (function () { function publicClassWithWithPrivatePropertyTypes() { this.myPublicProperty = exporter.createExportedWidget1(); // Error this.myPrivateProperty = exporter.createExportedWidget1(); @@ -167,7 +167,7 @@ var publicClassWithWithPrivatePropertyTypes = (function () { return publicClassWithWithPrivatePropertyTypes; }()); exports.publicClassWithWithPrivatePropertyTypes = publicClassWithWithPrivatePropertyTypes; -var privateClassWithWithPrivatePropertyTypes = (function () { +var privateClassWithWithPrivatePropertyTypes = /** @class */ (function () { function privateClassWithWithPrivatePropertyTypes() { this.myPublicProperty = exporter.createExportedWidget1(); this.myPrivateProperty = exporter.createExportedWidget1(); @@ -184,7 +184,7 @@ exports.publicVarWithPrivatePropertyTypes = exporter.createExportedWidget1(); // var privateVarWithPrivatePropertyTypes = exporter.createExportedWidget1(); exports.publicVarWithPrivatePropertyTypes1 = exporter.createExportedWidget3(); // Error var privateVarWithPrivatePropertyTypes1 = exporter.createExportedWidget3(); -var publicClassWithPrivateModulePropertyTypes = (function () { +var publicClassWithPrivateModulePropertyTypes = /** @class */ (function () { function publicClassWithPrivateModulePropertyTypes() { this.myPublicProperty = exporter.createExportedWidget2(); // Error this.myPublicProperty1 = exporter.createExportedWidget4(); // Error @@ -196,7 +196,7 @@ var publicClassWithPrivateModulePropertyTypes = (function () { exports.publicClassWithPrivateModulePropertyTypes = publicClassWithPrivateModulePropertyTypes; exports.publicVarWithPrivateModulePropertyTypes = exporter.createExportedWidget2(); // Error exports.publicVarWithPrivateModulePropertyTypes1 = exporter.createExportedWidget4(); // Error -var privateClassWithPrivateModulePropertyTypes = (function () { +var privateClassWithPrivateModulePropertyTypes = /** @class */ (function () { function privateClassWithPrivateModulePropertyTypes() { this.myPublicProperty = exporter.createExportedWidget2(); this.myPublicProperty1 = exporter.createExportedWidget4(); diff --git a/tests/baselines/reference/privacyCheckExternalModuleExportAssignmentOfGenericClass.js b/tests/baselines/reference/privacyCheckExternalModuleExportAssignmentOfGenericClass.js index b8e8139675bcd..5896705071b1d 100644 --- a/tests/baselines/reference/privacyCheckExternalModuleExportAssignmentOfGenericClass.js +++ b/tests/baselines/reference/privacyCheckExternalModuleExportAssignmentOfGenericClass.js @@ -15,7 +15,7 @@ interface Bar { //// [privacyCheckExternalModuleExportAssignmentOfGenericClass_0.js] "use strict"; -var Foo = (function () { +var Foo = /** @class */ (function () { function Foo(a) { this.a = a; } diff --git a/tests/baselines/reference/privacyCheckOnTypeParameterReferenceInConstructorParameter.js b/tests/baselines/reference/privacyCheckOnTypeParameterReferenceInConstructorParameter.js index dc868d86bff76..f6ee2db2d159b 100644 --- a/tests/baselines/reference/privacyCheckOnTypeParameterReferenceInConstructorParameter.js +++ b/tests/baselines/reference/privacyCheckOnTypeParameterReferenceInConstructorParameter.js @@ -14,14 +14,14 @@ export class B { define(["require", "exports"], function (require, exports) { "use strict"; exports.__esModule = true; - var A = (function () { + var A = /** @class */ (function () { function A(callback) { var child = new B(this); } return A; }()); exports.A = A; - var B = (function () { + var B = /** @class */ (function () { function B(parent) { } return B; diff --git a/tests/baselines/reference/privacyClass.js b/tests/baselines/reference/privacyClass.js index 95b12f4e2fa4f..8ba1d03846b39 100644 --- a/tests/baselines/reference/privacyClass.js +++ b/tests/baselines/reference/privacyClass.js @@ -142,7 +142,7 @@ var __extends = (this && this.__extends) || (function () { exports.__esModule = true; var m1; (function (m1) { - var m1_c_public = (function () { + var m1_c_public = /** @class */ (function () { function m1_c_public() { } m1_c_public.prototype.f1 = function () { @@ -150,26 +150,26 @@ var m1; return m1_c_public; }()); m1.m1_c_public = m1_c_public; - var m1_c_private = (function () { + var m1_c_private = /** @class */ (function () { function m1_c_private() { } return m1_c_private; }()); - var m1_C1_private = (function (_super) { + var m1_C1_private = /** @class */ (function (_super) { __extends(m1_C1_private, _super); function m1_C1_private() { return _super !== null && _super.apply(this, arguments) || this; } return m1_C1_private; }(m1_c_public)); - var m1_C2_private = (function (_super) { + var m1_C2_private = /** @class */ (function (_super) { __extends(m1_C2_private, _super); function m1_C2_private() { return _super !== null && _super.apply(this, arguments) || this; } return m1_C2_private; }(m1_c_private)); - var m1_C3_public = (function (_super) { + var m1_C3_public = /** @class */ (function (_super) { __extends(m1_C3_public, _super); function m1_C3_public() { return _super !== null && _super.apply(this, arguments) || this; @@ -177,7 +177,7 @@ var m1; return m1_C3_public; }(m1_c_public)); m1.m1_C3_public = m1_C3_public; - var m1_C4_public = (function (_super) { + var m1_C4_public = /** @class */ (function (_super) { __extends(m1_C4_public, _super); function m1_C4_public() { return _super !== null && _super.apply(this, arguments) || this; @@ -185,43 +185,43 @@ var m1; return m1_C4_public; }(m1_c_private)); m1.m1_C4_public = m1_C4_public; - var m1_C5_private = (function () { + var m1_C5_private = /** @class */ (function () { function m1_C5_private() { } return m1_C5_private; }()); - var m1_C6_private = (function () { + var m1_C6_private = /** @class */ (function () { function m1_C6_private() { } return m1_C6_private; }()); - var m1_C7_public = (function () { + var m1_C7_public = /** @class */ (function () { function m1_C7_public() { } return m1_C7_public; }()); m1.m1_C7_public = m1_C7_public; - var m1_C8_public = (function () { + var m1_C8_public = /** @class */ (function () { function m1_C8_public() { } return m1_C8_public; }()); m1.m1_C8_public = m1_C8_public; - var m1_C9_private = (function (_super) { + var m1_C9_private = /** @class */ (function (_super) { __extends(m1_C9_private, _super); function m1_C9_private() { return _super !== null && _super.apply(this, arguments) || this; } return m1_C9_private; }(m1_c_public)); - var m1_C10_private = (function (_super) { + var m1_C10_private = /** @class */ (function (_super) { __extends(m1_C10_private, _super); function m1_C10_private() { return _super !== null && _super.apply(this, arguments) || this; } return m1_C10_private; }(m1_c_private)); - var m1_C11_public = (function (_super) { + var m1_C11_public = /** @class */ (function (_super) { __extends(m1_C11_public, _super); function m1_C11_public() { return _super !== null && _super.apply(this, arguments) || this; @@ -229,7 +229,7 @@ var m1; return m1_C11_public; }(m1_c_public)); m1.m1_C11_public = m1_C11_public; - var m1_C12_public = (function (_super) { + var m1_C12_public = /** @class */ (function (_super) { __extends(m1_C12_public, _super); function m1_C12_public() { return _super !== null && _super.apply(this, arguments) || this; @@ -240,7 +240,7 @@ var m1; })(m1 = exports.m1 || (exports.m1 = {})); var m2; (function (m2) { - var m2_c_public = (function () { + var m2_c_public = /** @class */ (function () { function m2_c_public() { } m2_c_public.prototype.f1 = function () { @@ -248,26 +248,26 @@ var m2; return m2_c_public; }()); m2.m2_c_public = m2_c_public; - var m2_c_private = (function () { + var m2_c_private = /** @class */ (function () { function m2_c_private() { } return m2_c_private; }()); - var m2_C1_private = (function (_super) { + var m2_C1_private = /** @class */ (function (_super) { __extends(m2_C1_private, _super); function m2_C1_private() { return _super !== null && _super.apply(this, arguments) || this; } return m2_C1_private; }(m2_c_public)); - var m2_C2_private = (function (_super) { + var m2_C2_private = /** @class */ (function (_super) { __extends(m2_C2_private, _super); function m2_C2_private() { return _super !== null && _super.apply(this, arguments) || this; } return m2_C2_private; }(m2_c_private)); - var m2_C3_public = (function (_super) { + var m2_C3_public = /** @class */ (function (_super) { __extends(m2_C3_public, _super); function m2_C3_public() { return _super !== null && _super.apply(this, arguments) || this; @@ -275,7 +275,7 @@ var m2; return m2_C3_public; }(m2_c_public)); m2.m2_C3_public = m2_C3_public; - var m2_C4_public = (function (_super) { + var m2_C4_public = /** @class */ (function (_super) { __extends(m2_C4_public, _super); function m2_C4_public() { return _super !== null && _super.apply(this, arguments) || this; @@ -283,43 +283,43 @@ var m2; return m2_C4_public; }(m2_c_private)); m2.m2_C4_public = m2_C4_public; - var m2_C5_private = (function () { + var m2_C5_private = /** @class */ (function () { function m2_C5_private() { } return m2_C5_private; }()); - var m2_C6_private = (function () { + var m2_C6_private = /** @class */ (function () { function m2_C6_private() { } return m2_C6_private; }()); - var m2_C7_public = (function () { + var m2_C7_public = /** @class */ (function () { function m2_C7_public() { } return m2_C7_public; }()); m2.m2_C7_public = m2_C7_public; - var m2_C8_public = (function () { + var m2_C8_public = /** @class */ (function () { function m2_C8_public() { } return m2_C8_public; }()); m2.m2_C8_public = m2_C8_public; - var m2_C9_private = (function (_super) { + var m2_C9_private = /** @class */ (function (_super) { __extends(m2_C9_private, _super); function m2_C9_private() { return _super !== null && _super.apply(this, arguments) || this; } return m2_C9_private; }(m2_c_public)); - var m2_C10_private = (function (_super) { + var m2_C10_private = /** @class */ (function (_super) { __extends(m2_C10_private, _super); function m2_C10_private() { return _super !== null && _super.apply(this, arguments) || this; } return m2_C10_private; }(m2_c_private)); - var m2_C11_public = (function (_super) { + var m2_C11_public = /** @class */ (function (_super) { __extends(m2_C11_public, _super); function m2_C11_public() { return _super !== null && _super.apply(this, arguments) || this; @@ -327,7 +327,7 @@ var m2; return m2_C11_public; }(m2_c_public)); m2.m2_C11_public = m2_C11_public; - var m2_C12_public = (function (_super) { + var m2_C12_public = /** @class */ (function (_super) { __extends(m2_C12_public, _super); function m2_C12_public() { return _super !== null && _super.apply(this, arguments) || this; @@ -336,7 +336,7 @@ var m2; }(m2_c_private)); m2.m2_C12_public = m2_C12_public; })(m2 || (m2 = {})); -var glo_c_public = (function () { +var glo_c_public = /** @class */ (function () { function glo_c_public() { } glo_c_public.prototype.f1 = function () { @@ -344,26 +344,26 @@ var glo_c_public = (function () { return glo_c_public; }()); exports.glo_c_public = glo_c_public; -var glo_c_private = (function () { +var glo_c_private = /** @class */ (function () { function glo_c_private() { } return glo_c_private; }()); -var glo_C1_private = (function (_super) { +var glo_C1_private = /** @class */ (function (_super) { __extends(glo_C1_private, _super); function glo_C1_private() { return _super !== null && _super.apply(this, arguments) || this; } return glo_C1_private; }(glo_c_public)); -var glo_C2_private = (function (_super) { +var glo_C2_private = /** @class */ (function (_super) { __extends(glo_C2_private, _super); function glo_C2_private() { return _super !== null && _super.apply(this, arguments) || this; } return glo_C2_private; }(glo_c_private)); -var glo_C3_public = (function (_super) { +var glo_C3_public = /** @class */ (function (_super) { __extends(glo_C3_public, _super); function glo_C3_public() { return _super !== null && _super.apply(this, arguments) || this; @@ -371,7 +371,7 @@ var glo_C3_public = (function (_super) { return glo_C3_public; }(glo_c_public)); exports.glo_C3_public = glo_C3_public; -var glo_C4_public = (function (_super) { +var glo_C4_public = /** @class */ (function (_super) { __extends(glo_C4_public, _super); function glo_C4_public() { return _super !== null && _super.apply(this, arguments) || this; @@ -379,43 +379,43 @@ var glo_C4_public = (function (_super) { return glo_C4_public; }(glo_c_private)); exports.glo_C4_public = glo_C4_public; -var glo_C5_private = (function () { +var glo_C5_private = /** @class */ (function () { function glo_C5_private() { } return glo_C5_private; }()); -var glo_C6_private = (function () { +var glo_C6_private = /** @class */ (function () { function glo_C6_private() { } return glo_C6_private; }()); -var glo_C7_public = (function () { +var glo_C7_public = /** @class */ (function () { function glo_C7_public() { } return glo_C7_public; }()); exports.glo_C7_public = glo_C7_public; -var glo_C8_public = (function () { +var glo_C8_public = /** @class */ (function () { function glo_C8_public() { } return glo_C8_public; }()); exports.glo_C8_public = glo_C8_public; -var glo_C9_private = (function (_super) { +var glo_C9_private = /** @class */ (function (_super) { __extends(glo_C9_private, _super); function glo_C9_private() { return _super !== null && _super.apply(this, arguments) || this; } return glo_C9_private; }(glo_c_public)); -var glo_C10_private = (function (_super) { +var glo_C10_private = /** @class */ (function (_super) { __extends(glo_C10_private, _super); function glo_C10_private() { return _super !== null && _super.apply(this, arguments) || this; } return glo_C10_private; }(glo_c_private)); -var glo_C11_public = (function (_super) { +var glo_C11_public = /** @class */ (function (_super) { __extends(glo_C11_public, _super); function glo_C11_public() { return _super !== null && _super.apply(this, arguments) || this; @@ -423,7 +423,7 @@ var glo_C11_public = (function (_super) { return glo_C11_public; }(glo_c_public)); exports.glo_C11_public = glo_C11_public; -var glo_C12_public = (function (_super) { +var glo_C12_public = /** @class */ (function (_super) { __extends(glo_C12_public, _super); function glo_C12_public() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/privacyClassExtendsClauseDeclFile.js b/tests/baselines/reference/privacyClassExtendsClauseDeclFile.js index 857d52e99bf17..d98f39479f154 100644 --- a/tests/baselines/reference/privacyClassExtendsClauseDeclFile.js +++ b/tests/baselines/reference/privacyClassExtendsClauseDeclFile.js @@ -111,7 +111,7 @@ var __extends = (this && this.__extends) || (function () { exports.__esModule = true; var publicModule; (function (publicModule) { - var publicClassInPublicModule = (function () { + var publicClassInPublicModule = /** @class */ (function () { function publicClassInPublicModule() { } publicClassInPublicModule.prototype.f1 = function () { @@ -119,26 +119,26 @@ var publicModule; return publicClassInPublicModule; }()); publicModule.publicClassInPublicModule = publicClassInPublicModule; - var privateClassInPublicModule = (function () { + var privateClassInPublicModule = /** @class */ (function () { function privateClassInPublicModule() { } return privateClassInPublicModule; }()); - var privateClassExtendingPublicClassInModule = (function (_super) { + var privateClassExtendingPublicClassInModule = /** @class */ (function (_super) { __extends(privateClassExtendingPublicClassInModule, _super); function privateClassExtendingPublicClassInModule() { return _super !== null && _super.apply(this, arguments) || this; } return privateClassExtendingPublicClassInModule; }(publicClassInPublicModule)); - var privateClassExtendingPrivateClassInModule = (function (_super) { + var privateClassExtendingPrivateClassInModule = /** @class */ (function (_super) { __extends(privateClassExtendingPrivateClassInModule, _super); function privateClassExtendingPrivateClassInModule() { return _super !== null && _super.apply(this, arguments) || this; } return privateClassExtendingPrivateClassInModule; }(privateClassInPublicModule)); - var publicClassExtendingPublicClassInModule = (function (_super) { + var publicClassExtendingPublicClassInModule = /** @class */ (function (_super) { __extends(publicClassExtendingPublicClassInModule, _super); function publicClassExtendingPublicClassInModule() { return _super !== null && _super.apply(this, arguments) || this; @@ -146,7 +146,7 @@ var publicModule; return publicClassExtendingPublicClassInModule; }(publicClassInPublicModule)); publicModule.publicClassExtendingPublicClassInModule = publicClassExtendingPublicClassInModule; - var publicClassExtendingPrivateClassInModule = (function (_super) { + var publicClassExtendingPrivateClassInModule = /** @class */ (function (_super) { __extends(publicClassExtendingPrivateClassInModule, _super); function publicClassExtendingPrivateClassInModule() { return _super !== null && _super.apply(this, arguments) || this; @@ -154,14 +154,14 @@ var publicModule; return publicClassExtendingPrivateClassInModule; }(privateClassInPublicModule)); publicModule.publicClassExtendingPrivateClassInModule = publicClassExtendingPrivateClassInModule; - var privateClassExtendingFromPrivateModuleClass = (function (_super) { + var privateClassExtendingFromPrivateModuleClass = /** @class */ (function (_super) { __extends(privateClassExtendingFromPrivateModuleClass, _super); function privateClassExtendingFromPrivateModuleClass() { return _super !== null && _super.apply(this, arguments) || this; } return privateClassExtendingFromPrivateModuleClass; }(privateModule.publicClassInPrivateModule)); - var publicClassExtendingFromPrivateModuleClass = (function (_super) { + var publicClassExtendingFromPrivateModuleClass = /** @class */ (function (_super) { __extends(publicClassExtendingFromPrivateModuleClass, _super); function publicClassExtendingFromPrivateModuleClass() { return _super !== null && _super.apply(this, arguments) || this; @@ -172,7 +172,7 @@ var publicModule; })(publicModule = exports.publicModule || (exports.publicModule = {})); var privateModule; (function (privateModule) { - var publicClassInPrivateModule = (function () { + var publicClassInPrivateModule = /** @class */ (function () { function publicClassInPrivateModule() { } publicClassInPrivateModule.prototype.f1 = function () { @@ -180,26 +180,26 @@ var privateModule; return publicClassInPrivateModule; }()); privateModule.publicClassInPrivateModule = publicClassInPrivateModule; - var privateClassInPrivateModule = (function () { + var privateClassInPrivateModule = /** @class */ (function () { function privateClassInPrivateModule() { } return privateClassInPrivateModule; }()); - var privateClassExtendingPublicClassInModule = (function (_super) { + var privateClassExtendingPublicClassInModule = /** @class */ (function (_super) { __extends(privateClassExtendingPublicClassInModule, _super); function privateClassExtendingPublicClassInModule() { return _super !== null && _super.apply(this, arguments) || this; } return privateClassExtendingPublicClassInModule; }(publicClassInPrivateModule)); - var privateClassExtendingPrivateClassInModule = (function (_super) { + var privateClassExtendingPrivateClassInModule = /** @class */ (function (_super) { __extends(privateClassExtendingPrivateClassInModule, _super); function privateClassExtendingPrivateClassInModule() { return _super !== null && _super.apply(this, arguments) || this; } return privateClassExtendingPrivateClassInModule; }(privateClassInPrivateModule)); - var publicClassExtendingPublicClassInModule = (function (_super) { + var publicClassExtendingPublicClassInModule = /** @class */ (function (_super) { __extends(publicClassExtendingPublicClassInModule, _super); function publicClassExtendingPublicClassInModule() { return _super !== null && _super.apply(this, arguments) || this; @@ -207,7 +207,7 @@ var privateModule; return publicClassExtendingPublicClassInModule; }(publicClassInPrivateModule)); privateModule.publicClassExtendingPublicClassInModule = publicClassExtendingPublicClassInModule; - var publicClassExtendingPrivateClassInModule = (function (_super) { + var publicClassExtendingPrivateClassInModule = /** @class */ (function (_super) { __extends(publicClassExtendingPrivateClassInModule, _super); function publicClassExtendingPrivateClassInModule() { return _super !== null && _super.apply(this, arguments) || this; @@ -215,14 +215,14 @@ var privateModule; return publicClassExtendingPrivateClassInModule; }(privateClassInPrivateModule)); privateModule.publicClassExtendingPrivateClassInModule = publicClassExtendingPrivateClassInModule; - var privateClassExtendingFromPrivateModuleClass = (function (_super) { + var privateClassExtendingFromPrivateModuleClass = /** @class */ (function (_super) { __extends(privateClassExtendingFromPrivateModuleClass, _super); function privateClassExtendingFromPrivateModuleClass() { return _super !== null && _super.apply(this, arguments) || this; } return privateClassExtendingFromPrivateModuleClass; }(privateModule.publicClassInPrivateModule)); - var publicClassExtendingFromPrivateModuleClass = (function (_super) { + var publicClassExtendingFromPrivateModuleClass = /** @class */ (function (_super) { __extends(publicClassExtendingFromPrivateModuleClass, _super); function publicClassExtendingFromPrivateModuleClass() { return _super !== null && _super.apply(this, arguments) || this; @@ -231,7 +231,7 @@ var privateModule; }(privateModule.publicClassInPrivateModule)); privateModule.publicClassExtendingFromPrivateModuleClass = publicClassExtendingFromPrivateModuleClass; })(privateModule || (privateModule = {})); -var publicClass = (function () { +var publicClass = /** @class */ (function () { function publicClass() { } publicClass.prototype.f1 = function () { @@ -239,26 +239,26 @@ var publicClass = (function () { return publicClass; }()); exports.publicClass = publicClass; -var privateClass = (function () { +var privateClass = /** @class */ (function () { function privateClass() { } return privateClass; }()); -var privateClassExtendingPublicClass = (function (_super) { +var privateClassExtendingPublicClass = /** @class */ (function (_super) { __extends(privateClassExtendingPublicClass, _super); function privateClassExtendingPublicClass() { return _super !== null && _super.apply(this, arguments) || this; } return privateClassExtendingPublicClass; }(publicClass)); -var privateClassExtendingPrivateClassInModule = (function (_super) { +var privateClassExtendingPrivateClassInModule = /** @class */ (function (_super) { __extends(privateClassExtendingPrivateClassInModule, _super); function privateClassExtendingPrivateClassInModule() { return _super !== null && _super.apply(this, arguments) || this; } return privateClassExtendingPrivateClassInModule; }(privateClass)); -var publicClassExtendingPublicClass = (function (_super) { +var publicClassExtendingPublicClass = /** @class */ (function (_super) { __extends(publicClassExtendingPublicClass, _super); function publicClassExtendingPublicClass() { return _super !== null && _super.apply(this, arguments) || this; @@ -266,7 +266,7 @@ var publicClassExtendingPublicClass = (function (_super) { return publicClassExtendingPublicClass; }(publicClass)); exports.publicClassExtendingPublicClass = publicClassExtendingPublicClass; -var publicClassExtendingPrivateClass = (function (_super) { +var publicClassExtendingPrivateClass = /** @class */ (function (_super) { __extends(publicClassExtendingPrivateClass, _super); function publicClassExtendingPrivateClass() { return _super !== null && _super.apply(this, arguments) || this; @@ -274,14 +274,14 @@ var publicClassExtendingPrivateClass = (function (_super) { return publicClassExtendingPrivateClass; }(privateClass)); exports.publicClassExtendingPrivateClass = publicClassExtendingPrivateClass; -var privateClassExtendingFromPrivateModuleClass = (function (_super) { +var privateClassExtendingFromPrivateModuleClass = /** @class */ (function (_super) { __extends(privateClassExtendingFromPrivateModuleClass, _super); function privateClassExtendingFromPrivateModuleClass() { return _super !== null && _super.apply(this, arguments) || this; } return privateClassExtendingFromPrivateModuleClass; }(privateModule.publicClassInPrivateModule)); -var publicClassExtendingFromPrivateModuleClass = (function (_super) { +var publicClassExtendingFromPrivateModuleClass = /** @class */ (function (_super) { __extends(publicClassExtendingFromPrivateModuleClass, _super); function publicClassExtendingFromPrivateModuleClass() { return _super !== null && _super.apply(this, arguments) || this; @@ -302,7 +302,7 @@ var __extends = (this && this.__extends) || (function () { })(); var publicModuleInGlobal; (function (publicModuleInGlobal) { - var publicClassInPublicModule = (function () { + var publicClassInPublicModule = /** @class */ (function () { function publicClassInPublicModule() { } publicClassInPublicModule.prototype.f1 = function () { @@ -310,26 +310,26 @@ var publicModuleInGlobal; return publicClassInPublicModule; }()); publicModuleInGlobal.publicClassInPublicModule = publicClassInPublicModule; - var privateClassInPublicModule = (function () { + var privateClassInPublicModule = /** @class */ (function () { function privateClassInPublicModule() { } return privateClassInPublicModule; }()); - var privateClassExtendingPublicClassInModule = (function (_super) { + var privateClassExtendingPublicClassInModule = /** @class */ (function (_super) { __extends(privateClassExtendingPublicClassInModule, _super); function privateClassExtendingPublicClassInModule() { return _super !== null && _super.apply(this, arguments) || this; } return privateClassExtendingPublicClassInModule; }(publicClassInPublicModule)); - var privateClassExtendingPrivateClassInModule = (function (_super) { + var privateClassExtendingPrivateClassInModule = /** @class */ (function (_super) { __extends(privateClassExtendingPrivateClassInModule, _super); function privateClassExtendingPrivateClassInModule() { return _super !== null && _super.apply(this, arguments) || this; } return privateClassExtendingPrivateClassInModule; }(privateClassInPublicModule)); - var publicClassExtendingPublicClassInModule = (function (_super) { + var publicClassExtendingPublicClassInModule = /** @class */ (function (_super) { __extends(publicClassExtendingPublicClassInModule, _super); function publicClassExtendingPublicClassInModule() { return _super !== null && _super.apply(this, arguments) || this; @@ -337,7 +337,7 @@ var publicModuleInGlobal; return publicClassExtendingPublicClassInModule; }(publicClassInPublicModule)); publicModuleInGlobal.publicClassExtendingPublicClassInModule = publicClassExtendingPublicClassInModule; - var publicClassExtendingPrivateClassInModule = (function (_super) { + var publicClassExtendingPrivateClassInModule = /** @class */ (function (_super) { __extends(publicClassExtendingPrivateClassInModule, _super); function publicClassExtendingPrivateClassInModule() { return _super !== null && _super.apply(this, arguments) || this; @@ -346,12 +346,12 @@ var publicModuleInGlobal; }(privateClassInPublicModule)); publicModuleInGlobal.publicClassExtendingPrivateClassInModule = publicClassExtendingPrivateClassInModule; })(publicModuleInGlobal || (publicModuleInGlobal = {})); -var publicClassInGlobal = (function () { +var publicClassInGlobal = /** @class */ (function () { function publicClassInGlobal() { } return publicClassInGlobal; }()); -var publicClassExtendingPublicClassInGlobal = (function (_super) { +var publicClassExtendingPublicClassInGlobal = /** @class */ (function (_super) { __extends(publicClassExtendingPublicClassInGlobal, _super); function publicClassExtendingPublicClassInGlobal() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/privacyClassImplementsClauseDeclFile.js b/tests/baselines/reference/privacyClassImplementsClauseDeclFile.js index f4d48aae39d63..9dc455bdc10f9 100644 --- a/tests/baselines/reference/privacyClassImplementsClauseDeclFile.js +++ b/tests/baselines/reference/privacyClassImplementsClauseDeclFile.js @@ -98,40 +98,40 @@ class publicClassImplementingPublicInterfaceInGlobal implements publicInterfaceI exports.__esModule = true; var publicModule; (function (publicModule) { - var privateClassImplementingPublicInterfaceInModule = (function () { + var privateClassImplementingPublicInterfaceInModule = /** @class */ (function () { function privateClassImplementingPublicInterfaceInModule() { } return privateClassImplementingPublicInterfaceInModule; }()); - var privateClassImplementingPrivateInterfaceInModule = (function () { + var privateClassImplementingPrivateInterfaceInModule = /** @class */ (function () { function privateClassImplementingPrivateInterfaceInModule() { } return privateClassImplementingPrivateInterfaceInModule; }()); - var publicClassImplementingPublicInterfaceInModule = (function () { + var publicClassImplementingPublicInterfaceInModule = /** @class */ (function () { function publicClassImplementingPublicInterfaceInModule() { } return publicClassImplementingPublicInterfaceInModule; }()); publicModule.publicClassImplementingPublicInterfaceInModule = publicClassImplementingPublicInterfaceInModule; - var publicClassImplementingPrivateInterfaceInModule = (function () { + var publicClassImplementingPrivateInterfaceInModule = /** @class */ (function () { function publicClassImplementingPrivateInterfaceInModule() { } return publicClassImplementingPrivateInterfaceInModule; }()); publicModule.publicClassImplementingPrivateInterfaceInModule = publicClassImplementingPrivateInterfaceInModule; - var privateClassImplementingFromPrivateModuleInterface = (function () { + var privateClassImplementingFromPrivateModuleInterface = /** @class */ (function () { function privateClassImplementingFromPrivateModuleInterface() { } return privateClassImplementingFromPrivateModuleInterface; }()); - var publicClassImplementingFromPrivateModuleInterface = (function () { + var publicClassImplementingFromPrivateModuleInterface = /** @class */ (function () { function publicClassImplementingFromPrivateModuleInterface() { } return publicClassImplementingFromPrivateModuleInterface; }()); publicModule.publicClassImplementingFromPrivateModuleInterface = publicClassImplementingFromPrivateModuleInterface; - var publicClassImplementingPrivateAndPublicInterface = (function () { + var publicClassImplementingPrivateAndPublicInterface = /** @class */ (function () { function publicClassImplementingPrivateAndPublicInterface() { } return publicClassImplementingPrivateAndPublicInterface; @@ -140,68 +140,68 @@ var publicModule; })(publicModule = exports.publicModule || (exports.publicModule = {})); var privateModule; (function (privateModule) { - var privateClassImplementingPublicInterfaceInModule = (function () { + var privateClassImplementingPublicInterfaceInModule = /** @class */ (function () { function privateClassImplementingPublicInterfaceInModule() { } return privateClassImplementingPublicInterfaceInModule; }()); - var privateClassImplementingPrivateInterfaceInModule = (function () { + var privateClassImplementingPrivateInterfaceInModule = /** @class */ (function () { function privateClassImplementingPrivateInterfaceInModule() { } return privateClassImplementingPrivateInterfaceInModule; }()); - var publicClassImplementingPublicInterfaceInModule = (function () { + var publicClassImplementingPublicInterfaceInModule = /** @class */ (function () { function publicClassImplementingPublicInterfaceInModule() { } return publicClassImplementingPublicInterfaceInModule; }()); privateModule.publicClassImplementingPublicInterfaceInModule = publicClassImplementingPublicInterfaceInModule; - var publicClassImplementingPrivateInterfaceInModule = (function () { + var publicClassImplementingPrivateInterfaceInModule = /** @class */ (function () { function publicClassImplementingPrivateInterfaceInModule() { } return publicClassImplementingPrivateInterfaceInModule; }()); privateModule.publicClassImplementingPrivateInterfaceInModule = publicClassImplementingPrivateInterfaceInModule; - var privateClassImplementingFromPrivateModuleInterface = (function () { + var privateClassImplementingFromPrivateModuleInterface = /** @class */ (function () { function privateClassImplementingFromPrivateModuleInterface() { } return privateClassImplementingFromPrivateModuleInterface; }()); - var publicClassImplementingFromPrivateModuleInterface = (function () { + var publicClassImplementingFromPrivateModuleInterface = /** @class */ (function () { function publicClassImplementingFromPrivateModuleInterface() { } return publicClassImplementingFromPrivateModuleInterface; }()); privateModule.publicClassImplementingFromPrivateModuleInterface = publicClassImplementingFromPrivateModuleInterface; })(privateModule || (privateModule = {})); -var privateClassImplementingPublicInterface = (function () { +var privateClassImplementingPublicInterface = /** @class */ (function () { function privateClassImplementingPublicInterface() { } return privateClassImplementingPublicInterface; }()); -var privateClassImplementingPrivateInterfaceInModule = (function () { +var privateClassImplementingPrivateInterfaceInModule = /** @class */ (function () { function privateClassImplementingPrivateInterfaceInModule() { } return privateClassImplementingPrivateInterfaceInModule; }()); -var publicClassImplementingPublicInterface = (function () { +var publicClassImplementingPublicInterface = /** @class */ (function () { function publicClassImplementingPublicInterface() { } return publicClassImplementingPublicInterface; }()); exports.publicClassImplementingPublicInterface = publicClassImplementingPublicInterface; -var publicClassImplementingPrivateInterface = (function () { +var publicClassImplementingPrivateInterface = /** @class */ (function () { function publicClassImplementingPrivateInterface() { } return publicClassImplementingPrivateInterface; }()); exports.publicClassImplementingPrivateInterface = publicClassImplementingPrivateInterface; -var privateClassImplementingFromPrivateModuleInterface = (function () { +var privateClassImplementingFromPrivateModuleInterface = /** @class */ (function () { function privateClassImplementingFromPrivateModuleInterface() { } return privateClassImplementingFromPrivateModuleInterface; }()); -var publicClassImplementingFromPrivateModuleInterface = (function () { +var publicClassImplementingFromPrivateModuleInterface = /** @class */ (function () { function publicClassImplementingFromPrivateModuleInterface() { } return publicClassImplementingFromPrivateModuleInterface; @@ -210,30 +210,30 @@ exports.publicClassImplementingFromPrivateModuleInterface = publicClassImplement //// [privacyClassImplementsClauseDeclFile_GlobalFile.js] var publicModuleInGlobal; (function (publicModuleInGlobal) { - var privateClassImplementingPublicInterfaceInModule = (function () { + var privateClassImplementingPublicInterfaceInModule = /** @class */ (function () { function privateClassImplementingPublicInterfaceInModule() { } return privateClassImplementingPublicInterfaceInModule; }()); - var privateClassImplementingPrivateInterfaceInModule = (function () { + var privateClassImplementingPrivateInterfaceInModule = /** @class */ (function () { function privateClassImplementingPrivateInterfaceInModule() { } return privateClassImplementingPrivateInterfaceInModule; }()); - var publicClassImplementingPublicInterfaceInModule = (function () { + var publicClassImplementingPublicInterfaceInModule = /** @class */ (function () { function publicClassImplementingPublicInterfaceInModule() { } return publicClassImplementingPublicInterfaceInModule; }()); publicModuleInGlobal.publicClassImplementingPublicInterfaceInModule = publicClassImplementingPublicInterfaceInModule; - var publicClassImplementingPrivateInterfaceInModule = (function () { + var publicClassImplementingPrivateInterfaceInModule = /** @class */ (function () { function publicClassImplementingPrivateInterfaceInModule() { } return publicClassImplementingPrivateInterfaceInModule; }()); publicModuleInGlobal.publicClassImplementingPrivateInterfaceInModule = publicClassImplementingPrivateInterfaceInModule; })(publicModuleInGlobal || (publicModuleInGlobal = {})); -var publicClassImplementingPublicInterfaceInGlobal = (function () { +var publicClassImplementingPublicInterfaceInGlobal = /** @class */ (function () { function publicClassImplementingPublicInterfaceInGlobal() { } return publicClassImplementingPublicInterfaceInGlobal; diff --git a/tests/baselines/reference/privacyFunc.js b/tests/baselines/reference/privacyFunc.js index b9c0e8e13c97b..cc1173731259a 100644 --- a/tests/baselines/reference/privacyFunc.js +++ b/tests/baselines/reference/privacyFunc.js @@ -231,7 +231,7 @@ function f10_public(): C6_public { //// [privacyFunc.js] var m1; (function (m1) { - var C1_public = (function () { + var C1_public = /** @class */ (function () { function C1_public() { } C1_public.prototype.f1 = function () { @@ -239,12 +239,12 @@ var m1; return C1_public; }()); m1.C1_public = C1_public; - var C2_private = (function () { + var C2_private = /** @class */ (function () { function C2_private() { } return C2_private; }()); - var C3_public = (function () { + var C3_public = /** @class */ (function () { function C3_public(m1_c3_c1_2) { } C3_public.prototype.f1_private = function (m1_c3_f1_arg) { @@ -282,7 +282,7 @@ var m1; return C3_public; }()); m1.C3_public = C3_public; - var C4_private = (function () { + var C4_private = /** @class */ (function () { function C4_private(m1_c4_c1_2) { } C4_private.prototype.f1_private = function (m1_c4_f1_arg) { @@ -319,24 +319,24 @@ var m1; }; return C4_private; }()); - var C5_public = (function () { + var C5_public = /** @class */ (function () { function C5_public(m1_c5_c) { } return C5_public; }()); m1.C5_public = C5_public; - var C6_private = (function () { + var C6_private = /** @class */ (function () { function C6_private(m1_c6_c) { } return C6_private; }()); - var C7_public = (function () { + var C7_public = /** @class */ (function () { function C7_public(m1_c7_c) { } return C7_public; }()); m1.C7_public = C7_public; - var C8_private = (function () { + var C8_private = /** @class */ (function () { function C8_private(m1_c8_c) { } return C8_private; @@ -380,12 +380,12 @@ var m1; } m1.f12_public = f12_public; })(m1 || (m1 = {})); -var C6_public = (function () { +var C6_public = /** @class */ (function () { function C6_public() { } return C6_public; }()); -var C7_public = (function () { +var C7_public = /** @class */ (function () { function C7_public(c7_c1_2) { } C7_public.prototype.f1_private = function (c7_f1_arg) { @@ -406,7 +406,7 @@ var C7_public = (function () { }; return C7_public; }()); -var C9_public = (function () { +var C9_public = /** @class */ (function () { function C9_public(c9_c) { } return C9_public; diff --git a/tests/baselines/reference/privacyFunctionCannotNameParameterTypeDeclFile.js b/tests/baselines/reference/privacyFunctionCannotNameParameterTypeDeclFile.js index 6b0ea3cafd220..3a61785c7f71d 100644 --- a/tests/baselines/reference/privacyFunctionCannotNameParameterTypeDeclFile.js +++ b/tests/baselines/reference/privacyFunctionCannotNameParameterTypeDeclFile.js @@ -158,7 +158,7 @@ function privateFunctionWithPrivateModuleParameterTypes1(param= exporter.createE //// [privacyFunctionCannotNameParameterTypeDeclFile_Widgets.js] "use strict"; exports.__esModule = true; -var Widget1 = (function () { +var Widget1 = /** @class */ (function () { function Widget1() { this.name = 'one'; } @@ -171,7 +171,7 @@ function createWidget1() { exports.createWidget1 = createWidget1; var SpecializedWidget; (function (SpecializedWidget) { - var Widget2 = (function () { + var Widget2 = /** @class */ (function () { function Widget2() { this.name = 'one'; } @@ -209,7 +209,7 @@ exports.createExportedWidget4 = createExportedWidget4; "use strict"; exports.__esModule = true; var exporter = require("./privacyFunctionCannotNameParameterTypeDeclFile_exporter"); -var publicClassWithWithPrivateParmeterTypes = (function () { +var publicClassWithWithPrivateParmeterTypes = /** @class */ (function () { function publicClassWithWithPrivateParmeterTypes(param, param1, param2) { if (param === void 0) { param = exporter.createExportedWidget1(); } if (param1 === void 0) { param1 = exporter.createExportedWidget1(); } @@ -232,7 +232,7 @@ var publicClassWithWithPrivateParmeterTypes = (function () { return publicClassWithWithPrivateParmeterTypes; }()); exports.publicClassWithWithPrivateParmeterTypes = publicClassWithWithPrivateParmeterTypes; -var publicClassWithWithPrivateParmeterTypes1 = (function () { +var publicClassWithWithPrivateParmeterTypes1 = /** @class */ (function () { function publicClassWithWithPrivateParmeterTypes1(param, param1, param2) { if (param === void 0) { param = exporter.createExportedWidget3(); } if (param1 === void 0) { param1 = exporter.createExportedWidget3(); } @@ -255,7 +255,7 @@ var publicClassWithWithPrivateParmeterTypes1 = (function () { return publicClassWithWithPrivateParmeterTypes1; }()); exports.publicClassWithWithPrivateParmeterTypes1 = publicClassWithWithPrivateParmeterTypes1; -var privateClassWithWithPrivateParmeterTypes = (function () { +var privateClassWithWithPrivateParmeterTypes = /** @class */ (function () { function privateClassWithWithPrivateParmeterTypes(param, param1, param2) { if (param === void 0) { param = exporter.createExportedWidget1(); } if (param1 === void 0) { param1 = exporter.createExportedWidget1(); } @@ -277,7 +277,7 @@ var privateClassWithWithPrivateParmeterTypes = (function () { }; return privateClassWithWithPrivateParmeterTypes; }()); -var privateClassWithWithPrivateParmeterTypes2 = (function () { +var privateClassWithWithPrivateParmeterTypes2 = /** @class */ (function () { function privateClassWithWithPrivateParmeterTypes2(param, param1, param2) { if (param === void 0) { param = exporter.createExportedWidget3(); } if (param1 === void 0) { param1 = exporter.createExportedWidget3(); } @@ -313,7 +313,7 @@ exports.publicFunctionWithPrivateParmeterTypes1 = publicFunctionWithPrivateParme function privateFunctionWithPrivateParmeterTypes1(param) { if (param === void 0) { param = exporter.createExportedWidget3(); } } -var publicClassWithPrivateModuleParameterTypes = (function () { +var publicClassWithPrivateModuleParameterTypes = /** @class */ (function () { function publicClassWithPrivateModuleParameterTypes(param, param1, param2) { if (param === void 0) { param = exporter.createExportedWidget2(); } if (param1 === void 0) { param1 = exporter.createExportedWidget2(); } @@ -330,7 +330,7 @@ var publicClassWithPrivateModuleParameterTypes = (function () { return publicClassWithPrivateModuleParameterTypes; }()); exports.publicClassWithPrivateModuleParameterTypes = publicClassWithPrivateModuleParameterTypes; -var publicClassWithPrivateModuleParameterTypes2 = (function () { +var publicClassWithPrivateModuleParameterTypes2 = /** @class */ (function () { function publicClassWithPrivateModuleParameterTypes2(param, param1, param2) { if (param === void 0) { param = exporter.createExportedWidget4(); } if (param1 === void 0) { param1 = exporter.createExportedWidget4(); } @@ -355,7 +355,7 @@ function publicFunctionWithPrivateModuleParameterTypes1(param) { if (param === void 0) { param = exporter.createExportedWidget4(); } } exports.publicFunctionWithPrivateModuleParameterTypes1 = publicFunctionWithPrivateModuleParameterTypes1; -var privateClassWithPrivateModuleParameterTypes = (function () { +var privateClassWithPrivateModuleParameterTypes = /** @class */ (function () { function privateClassWithPrivateModuleParameterTypes(param, param1, param2) { if (param === void 0) { param = exporter.createExportedWidget2(); } if (param1 === void 0) { param1 = exporter.createExportedWidget2(); } @@ -371,7 +371,7 @@ var privateClassWithPrivateModuleParameterTypes = (function () { }; return privateClassWithPrivateModuleParameterTypes; }()); -var privateClassWithPrivateModuleParameterTypes1 = (function () { +var privateClassWithPrivateModuleParameterTypes1 = /** @class */ (function () { function privateClassWithPrivateModuleParameterTypes1(param, param1, param2) { if (param === void 0) { param = exporter.createExportedWidget4(); } if (param1 === void 0) { param1 = exporter.createExportedWidget4(); } diff --git a/tests/baselines/reference/privacyFunctionCannotNameReturnTypeDeclFile.js b/tests/baselines/reference/privacyFunctionCannotNameReturnTypeDeclFile.js index 61c7e0014db74..d6e9f52669737 100644 --- a/tests/baselines/reference/privacyFunctionCannotNameReturnTypeDeclFile.js +++ b/tests/baselines/reference/privacyFunctionCannotNameReturnTypeDeclFile.js @@ -165,7 +165,7 @@ function privateFunctionWithPrivateModuleReturnTypes1() { //// [privacyFunctionReturnTypeDeclFile_Widgets.js] "use strict"; exports.__esModule = true; -var Widget1 = (function () { +var Widget1 = /** @class */ (function () { function Widget1() { this.name = 'one'; } @@ -178,7 +178,7 @@ function createWidget1() { exports.createWidget1 = createWidget1; var SpecializedWidget; (function (SpecializedWidget) { - var Widget2 = (function () { + var Widget2 = /** @class */ (function () { function Widget2() { this.name = 'one'; } @@ -216,7 +216,7 @@ exports.createExportedWidget4 = createExportedWidget4; "use strict"; exports.__esModule = true; var exporter = require("./privacyFunctionReturnTypeDeclFile_exporter"); -var publicClassWithWithPrivateParmeterTypes = (function () { +var publicClassWithWithPrivateParmeterTypes = /** @class */ (function () { function publicClassWithWithPrivateParmeterTypes() { } publicClassWithWithPrivateParmeterTypes.myPublicStaticMethod = function () { @@ -252,7 +252,7 @@ var publicClassWithWithPrivateParmeterTypes = (function () { return publicClassWithWithPrivateParmeterTypes; }()); exports.publicClassWithWithPrivateParmeterTypes = publicClassWithWithPrivateParmeterTypes; -var privateClassWithWithPrivateParmeterTypes = (function () { +var privateClassWithWithPrivateParmeterTypes = /** @class */ (function () { function privateClassWithWithPrivateParmeterTypes() { } privateClassWithWithPrivateParmeterTypes.myPublicStaticMethod = function () { @@ -301,7 +301,7 @@ exports.publicFunctionWithPrivateParmeterTypes1 = publicFunctionWithPrivateParme function privateFunctionWithPrivateParmeterTypes1() { return exporter.createExportedWidget3(); } -var publicClassWithPrivateModuleReturnTypes = (function () { +var publicClassWithPrivateModuleReturnTypes = /** @class */ (function () { function publicClassWithPrivateModuleReturnTypes() { } publicClassWithPrivateModuleReturnTypes.myPublicStaticMethod = function () { @@ -327,7 +327,7 @@ function publicFunctionWithPrivateModuleReturnTypes1() { return exporter.createExportedWidget4(); } exports.publicFunctionWithPrivateModuleReturnTypes1 = publicFunctionWithPrivateModuleReturnTypes1; -var privateClassWithPrivateModuleReturnTypes = (function () { +var privateClassWithPrivateModuleReturnTypes = /** @class */ (function () { function privateClassWithPrivateModuleReturnTypes() { } privateClassWithPrivateModuleReturnTypes.myPublicStaticMethod = function () { diff --git a/tests/baselines/reference/privacyFunctionParameterDeclFile.js b/tests/baselines/reference/privacyFunctionParameterDeclFile.js index db00fb67d8a21..82051ecffe89d 100644 --- a/tests/baselines/reference/privacyFunctionParameterDeclFile.js +++ b/tests/baselines/reference/privacyFunctionParameterDeclFile.js @@ -688,18 +688,18 @@ module publicModuleInGlobal { //// [privacyFunctionParameterDeclFile_externalModule.js] "use strict"; exports.__esModule = true; -var privateClass = (function () { +var privateClass = /** @class */ (function () { function privateClass() { } return privateClass; }()); -var publicClass = (function () { +var publicClass = /** @class */ (function () { function publicClass() { } return publicClass; }()); exports.publicClass = publicClass; -var publicClassWithWithPrivateParmeterTypes = (function () { +var publicClassWithWithPrivateParmeterTypes = /** @class */ (function () { function publicClassWithWithPrivateParmeterTypes(param, param1, param2) { this.param1 = param1; this.param2 = param2; @@ -715,7 +715,7 @@ var publicClassWithWithPrivateParmeterTypes = (function () { return publicClassWithWithPrivateParmeterTypes; }()); exports.publicClassWithWithPrivateParmeterTypes = publicClassWithWithPrivateParmeterTypes; -var publicClassWithWithPublicParmeterTypes = (function () { +var publicClassWithWithPublicParmeterTypes = /** @class */ (function () { function publicClassWithWithPublicParmeterTypes(param, param1, param2) { this.param1 = param1; this.param2 = param2; @@ -731,7 +731,7 @@ var publicClassWithWithPublicParmeterTypes = (function () { return publicClassWithWithPublicParmeterTypes; }()); exports.publicClassWithWithPublicParmeterTypes = publicClassWithWithPublicParmeterTypes; -var privateClassWithWithPrivateParmeterTypes = (function () { +var privateClassWithWithPrivateParmeterTypes = /** @class */ (function () { function privateClassWithWithPrivateParmeterTypes(param, param1, param2) { this.param1 = param1; this.param2 = param2; @@ -746,7 +746,7 @@ var privateClassWithWithPrivateParmeterTypes = (function () { }; return privateClassWithWithPrivateParmeterTypes; }()); -var privateClassWithWithPublicParmeterTypes = (function () { +var privateClassWithWithPublicParmeterTypes = /** @class */ (function () { function privateClassWithWithPublicParmeterTypes(param, param1, param2) { this.param1 = param1; this.param2 = param2; @@ -771,7 +771,7 @@ function privateFunctionWithPrivateParmeterTypes(param) { } function privateFunctionWithPublicParmeterTypes(param) { } -var publicClassWithPrivateModuleParameterTypes = (function () { +var publicClassWithPrivateModuleParameterTypes = /** @class */ (function () { function publicClassWithPrivateModuleParameterTypes(param, param1, param2) { this.param1 = param1; this.param2 = param2; @@ -786,7 +786,7 @@ exports.publicClassWithPrivateModuleParameterTypes = publicClassWithPrivateModul function publicFunctionWithPrivateModuleParameterTypes(param) { } exports.publicFunctionWithPrivateModuleParameterTypes = publicFunctionWithPrivateModuleParameterTypes; -var privateClassWithPrivateModuleParameterTypes = (function () { +var privateClassWithPrivateModuleParameterTypes = /** @class */ (function () { function privateClassWithPrivateModuleParameterTypes(param, param1, param2) { this.param1 = param1; this.param2 = param2; @@ -801,18 +801,18 @@ function privateFunctionWithPrivateModuleParameterTypes(param) { } var publicModule; (function (publicModule) { - var privateClass = (function () { + var privateClass = /** @class */ (function () { function privateClass() { } return privateClass; }()); - var publicClass = (function () { + var publicClass = /** @class */ (function () { function publicClass() { } return publicClass; }()); publicModule.publicClass = publicClass; - var publicClassWithWithPrivateParmeterTypes = (function () { + var publicClassWithWithPrivateParmeterTypes = /** @class */ (function () { function publicClassWithWithPrivateParmeterTypes(param, param1, param2) { this.param1 = param1; this.param2 = param2; @@ -828,7 +828,7 @@ var publicModule; return publicClassWithWithPrivateParmeterTypes; }()); publicModule.publicClassWithWithPrivateParmeterTypes = publicClassWithWithPrivateParmeterTypes; - var publicClassWithWithPublicParmeterTypes = (function () { + var publicClassWithWithPublicParmeterTypes = /** @class */ (function () { function publicClassWithWithPublicParmeterTypes(param, param1, param2) { this.param1 = param1; this.param2 = param2; @@ -844,7 +844,7 @@ var publicModule; return publicClassWithWithPublicParmeterTypes; }()); publicModule.publicClassWithWithPublicParmeterTypes = publicClassWithWithPublicParmeterTypes; - var privateClassWithWithPrivateParmeterTypes = (function () { + var privateClassWithWithPrivateParmeterTypes = /** @class */ (function () { function privateClassWithWithPrivateParmeterTypes(param, param1, param2) { this.param1 = param1; this.param2 = param2; @@ -859,7 +859,7 @@ var publicModule; }; return privateClassWithWithPrivateParmeterTypes; }()); - var privateClassWithWithPublicParmeterTypes = (function () { + var privateClassWithWithPublicParmeterTypes = /** @class */ (function () { function privateClassWithWithPublicParmeterTypes(param, param1, param2) { this.param1 = param1; this.param2 = param2; @@ -884,7 +884,7 @@ var publicModule; } function privateFunctionWithPublicParmeterTypes(param) { } - var publicClassWithPrivateModuleParameterTypes = (function () { + var publicClassWithPrivateModuleParameterTypes = /** @class */ (function () { function publicClassWithPrivateModuleParameterTypes(param, param1, param2) { this.param1 = param1; this.param2 = param2; @@ -899,7 +899,7 @@ var publicModule; function publicFunctionWithPrivateModuleParameterTypes(param) { } publicModule.publicFunctionWithPrivateModuleParameterTypes = publicFunctionWithPrivateModuleParameterTypes; - var privateClassWithPrivateModuleParameterTypes = (function () { + var privateClassWithPrivateModuleParameterTypes = /** @class */ (function () { function privateClassWithPrivateModuleParameterTypes(param, param1, param2) { this.param1 = param1; this.param2 = param2; @@ -915,18 +915,18 @@ var publicModule; })(publicModule = exports.publicModule || (exports.publicModule = {})); var privateModule; (function (privateModule) { - var privateClass = (function () { + var privateClass = /** @class */ (function () { function privateClass() { } return privateClass; }()); - var publicClass = (function () { + var publicClass = /** @class */ (function () { function publicClass() { } return publicClass; }()); privateModule.publicClass = publicClass; - var publicClassWithWithPrivateParmeterTypes = (function () { + var publicClassWithWithPrivateParmeterTypes = /** @class */ (function () { function publicClassWithWithPrivateParmeterTypes(param, param1, param2) { this.param1 = param1; this.param2 = param2; @@ -942,7 +942,7 @@ var privateModule; return publicClassWithWithPrivateParmeterTypes; }()); privateModule.publicClassWithWithPrivateParmeterTypes = publicClassWithWithPrivateParmeterTypes; - var publicClassWithWithPublicParmeterTypes = (function () { + var publicClassWithWithPublicParmeterTypes = /** @class */ (function () { function publicClassWithWithPublicParmeterTypes(param, param1, param2) { this.param1 = param1; this.param2 = param2; @@ -958,7 +958,7 @@ var privateModule; return publicClassWithWithPublicParmeterTypes; }()); privateModule.publicClassWithWithPublicParmeterTypes = publicClassWithWithPublicParmeterTypes; - var privateClassWithWithPrivateParmeterTypes = (function () { + var privateClassWithWithPrivateParmeterTypes = /** @class */ (function () { function privateClassWithWithPrivateParmeterTypes(param, param1, param2) { this.param1 = param1; this.param2 = param2; @@ -973,7 +973,7 @@ var privateModule; }; return privateClassWithWithPrivateParmeterTypes; }()); - var privateClassWithWithPublicParmeterTypes = (function () { + var privateClassWithWithPublicParmeterTypes = /** @class */ (function () { function privateClassWithWithPublicParmeterTypes(param, param1, param2) { this.param1 = param1; this.param2 = param2; @@ -998,7 +998,7 @@ var privateModule; } function privateFunctionWithPublicParmeterTypes(param) { } - var publicClassWithPrivateModuleParameterTypes = (function () { + var publicClassWithPrivateModuleParameterTypes = /** @class */ (function () { function publicClassWithPrivateModuleParameterTypes(param, param1, param2) { this.param1 = param1; this.param2 = param2; @@ -1013,7 +1013,7 @@ var privateModule; function publicFunctionWithPrivateModuleParameterTypes(param) { } privateModule.publicFunctionWithPrivateModuleParameterTypes = publicFunctionWithPrivateModuleParameterTypes; - var privateClassWithPrivateModuleParameterTypes = (function () { + var privateClassWithPrivateModuleParameterTypes = /** @class */ (function () { function privateClassWithPrivateModuleParameterTypes(param, param1, param2) { this.param1 = param1; this.param2 = param2; @@ -1028,12 +1028,12 @@ var privateModule; } })(privateModule || (privateModule = {})); //// [privacyFunctionParameterDeclFile_GlobalFile.js] -var publicClassInGlobal = (function () { +var publicClassInGlobal = /** @class */ (function () { function publicClassInGlobal() { } return publicClassInGlobal; }()); -var publicClassWithWithPublicParmeterTypesInGlobal = (function () { +var publicClassWithWithPublicParmeterTypesInGlobal = /** @class */ (function () { function publicClassWithWithPublicParmeterTypesInGlobal(param, param1, param2) { this.param1 = param1; this.param2 = param2; @@ -1052,12 +1052,12 @@ function publicFunctionWithPublicParmeterTypesInGlobal(param) { } var publicModuleInGlobal; (function (publicModuleInGlobal) { - var privateClass = (function () { + var privateClass = /** @class */ (function () { function privateClass() { } return privateClass; }()); - var publicClass = (function () { + var publicClass = /** @class */ (function () { function publicClass() { } return publicClass; @@ -1065,18 +1065,18 @@ var publicModuleInGlobal; publicModuleInGlobal.publicClass = publicClass; var privateModule; (function (privateModule) { - var privateClass = (function () { + var privateClass = /** @class */ (function () { function privateClass() { } return privateClass; }()); - var publicClass = (function () { + var publicClass = /** @class */ (function () { function publicClass() { } return publicClass; }()); privateModule.publicClass = publicClass; - var publicClassWithWithPrivateParmeterTypes = (function () { + var publicClassWithWithPrivateParmeterTypes = /** @class */ (function () { function publicClassWithWithPrivateParmeterTypes(param, param1, param2) { this.param1 = param1; this.param2 = param2; @@ -1092,7 +1092,7 @@ var publicModuleInGlobal; return publicClassWithWithPrivateParmeterTypes; }()); privateModule.publicClassWithWithPrivateParmeterTypes = publicClassWithWithPrivateParmeterTypes; - var publicClassWithWithPublicParmeterTypes = (function () { + var publicClassWithWithPublicParmeterTypes = /** @class */ (function () { function publicClassWithWithPublicParmeterTypes(param, param1, param2) { this.param1 = param1; this.param2 = param2; @@ -1108,7 +1108,7 @@ var publicModuleInGlobal; return publicClassWithWithPublicParmeterTypes; }()); privateModule.publicClassWithWithPublicParmeterTypes = publicClassWithWithPublicParmeterTypes; - var privateClassWithWithPrivateParmeterTypes = (function () { + var privateClassWithWithPrivateParmeterTypes = /** @class */ (function () { function privateClassWithWithPrivateParmeterTypes(param, param1, param2) { this.param1 = param1; this.param2 = param2; @@ -1123,7 +1123,7 @@ var publicModuleInGlobal; }; return privateClassWithWithPrivateParmeterTypes; }()); - var privateClassWithWithPublicParmeterTypes = (function () { + var privateClassWithWithPublicParmeterTypes = /** @class */ (function () { function privateClassWithWithPublicParmeterTypes(param, param1, param2) { this.param1 = param1; this.param2 = param2; @@ -1148,7 +1148,7 @@ var publicModuleInGlobal; } function privateFunctionWithPublicParmeterTypes(param) { } - var publicClassWithPrivateModuleParameterTypes = (function () { + var publicClassWithPrivateModuleParameterTypes = /** @class */ (function () { function publicClassWithPrivateModuleParameterTypes(param, param1, param2) { this.param1 = param1; this.param2 = param2; @@ -1163,7 +1163,7 @@ var publicModuleInGlobal; function publicFunctionWithPrivateModuleParameterTypes(param) { } privateModule.publicFunctionWithPrivateModuleParameterTypes = publicFunctionWithPrivateModuleParameterTypes; - var privateClassWithPrivateModuleParameterTypes = (function () { + var privateClassWithPrivateModuleParameterTypes = /** @class */ (function () { function privateClassWithPrivateModuleParameterTypes(param, param1, param2) { this.param1 = param1; this.param2 = param2; @@ -1177,7 +1177,7 @@ var publicModuleInGlobal; function privateFunctionWithPrivateModuleParameterTypes(param) { } })(privateModule || (privateModule = {})); - var publicClassWithWithPrivateParmeterTypes = (function () { + var publicClassWithWithPrivateParmeterTypes = /** @class */ (function () { function publicClassWithWithPrivateParmeterTypes(param, param1, param2) { this.param1 = param1; this.param2 = param2; @@ -1193,7 +1193,7 @@ var publicModuleInGlobal; return publicClassWithWithPrivateParmeterTypes; }()); publicModuleInGlobal.publicClassWithWithPrivateParmeterTypes = publicClassWithWithPrivateParmeterTypes; - var publicClassWithWithPublicParmeterTypes = (function () { + var publicClassWithWithPublicParmeterTypes = /** @class */ (function () { function publicClassWithWithPublicParmeterTypes(param, param1, param2) { this.param1 = param1; this.param2 = param2; @@ -1209,7 +1209,7 @@ var publicModuleInGlobal; return publicClassWithWithPublicParmeterTypes; }()); publicModuleInGlobal.publicClassWithWithPublicParmeterTypes = publicClassWithWithPublicParmeterTypes; - var privateClassWithWithPrivateParmeterTypes = (function () { + var privateClassWithWithPrivateParmeterTypes = /** @class */ (function () { function privateClassWithWithPrivateParmeterTypes(param, param1, param2) { this.param1 = param1; this.param2 = param2; @@ -1224,7 +1224,7 @@ var publicModuleInGlobal; }; return privateClassWithWithPrivateParmeterTypes; }()); - var privateClassWithWithPublicParmeterTypes = (function () { + var privateClassWithWithPublicParmeterTypes = /** @class */ (function () { function privateClassWithWithPublicParmeterTypes(param, param1, param2) { this.param1 = param1; this.param2 = param2; @@ -1249,7 +1249,7 @@ var publicModuleInGlobal; } function privateFunctionWithPublicParmeterTypes(param) { } - var publicClassWithPrivateModuleParameterTypes = (function () { + var publicClassWithPrivateModuleParameterTypes = /** @class */ (function () { function publicClassWithPrivateModuleParameterTypes(param, param1, param2) { this.param1 = param1; this.param2 = param2; @@ -1264,7 +1264,7 @@ var publicModuleInGlobal; function publicFunctionWithPrivateModuleParameterTypes(param) { } publicModuleInGlobal.publicFunctionWithPrivateModuleParameterTypes = publicFunctionWithPrivateModuleParameterTypes; - var privateClassWithPrivateModuleParameterTypes = (function () { + var privateClassWithPrivateModuleParameterTypes = /** @class */ (function () { function privateClassWithPrivateModuleParameterTypes(param, param1, param2) { this.param1 = param1; this.param2 = param2; diff --git a/tests/baselines/reference/privacyFunctionReturnTypeDeclFile.js b/tests/baselines/reference/privacyFunctionReturnTypeDeclFile.js index d3136f4310ed3..b0bada4bc3676 100644 --- a/tests/baselines/reference/privacyFunctionReturnTypeDeclFile.js +++ b/tests/baselines/reference/privacyFunctionReturnTypeDeclFile.js @@ -1195,18 +1195,18 @@ module publicModuleInGlobal { //// [privacyFunctionReturnTypeDeclFile_externalModule.js] "use strict"; exports.__esModule = true; -var privateClass = (function () { +var privateClass = /** @class */ (function () { function privateClass() { } return privateClass; }()); -var publicClass = (function () { +var publicClass = /** @class */ (function () { function publicClass() { } return publicClass; }()); exports.publicClass = publicClass; -var publicClassWithWithPrivateParmeterTypes = (function () { +var publicClassWithWithPrivateParmeterTypes = /** @class */ (function () { function publicClassWithWithPrivateParmeterTypes() { } publicClassWithWithPrivateParmeterTypes.myPublicStaticMethod = function () { @@ -1236,7 +1236,7 @@ var publicClassWithWithPrivateParmeterTypes = (function () { return publicClassWithWithPrivateParmeterTypes; }()); exports.publicClassWithWithPrivateParmeterTypes = publicClassWithWithPrivateParmeterTypes; -var publicClassWithWithPublicParmeterTypes = (function () { +var publicClassWithWithPublicParmeterTypes = /** @class */ (function () { function publicClassWithWithPublicParmeterTypes() { } publicClassWithWithPublicParmeterTypes.myPublicStaticMethod = function () { @@ -1266,7 +1266,7 @@ var publicClassWithWithPublicParmeterTypes = (function () { return publicClassWithWithPublicParmeterTypes; }()); exports.publicClassWithWithPublicParmeterTypes = publicClassWithWithPublicParmeterTypes; -var privateClassWithWithPrivateParmeterTypes = (function () { +var privateClassWithWithPrivateParmeterTypes = /** @class */ (function () { function privateClassWithWithPrivateParmeterTypes() { } privateClassWithWithPrivateParmeterTypes.myPublicStaticMethod = function () { @@ -1295,7 +1295,7 @@ var privateClassWithWithPrivateParmeterTypes = (function () { }; return privateClassWithWithPrivateParmeterTypes; }()); -var privateClassWithWithPublicParmeterTypes = (function () { +var privateClassWithWithPublicParmeterTypes = /** @class */ (function () { function privateClassWithWithPublicParmeterTypes() { } privateClassWithWithPublicParmeterTypes.myPublicStaticMethod = function () { @@ -1352,7 +1352,7 @@ function privateFunctionWithPrivateParmeterTypes1() { function privateFunctionWithPublicParmeterTypes1() { return new publicClass(); } -var publicClassWithPrivateModuleParameterTypes = (function () { +var publicClassWithPrivateModuleParameterTypes = /** @class */ (function () { function publicClassWithPrivateModuleParameterTypes() { } publicClassWithPrivateModuleParameterTypes.myPublicStaticMethod = function () { @@ -1378,7 +1378,7 @@ function publicFunctionWithPrivateModuleParameterTypes1() { return new privateModule.publicClass(); } exports.publicFunctionWithPrivateModuleParameterTypes1 = publicFunctionWithPrivateModuleParameterTypes1; -var privateClassWithPrivateModuleParameterTypes = (function () { +var privateClassWithPrivateModuleParameterTypes = /** @class */ (function () { function privateClassWithPrivateModuleParameterTypes() { } privateClassWithPrivateModuleParameterTypes.myPublicStaticMethod = function () { @@ -1403,18 +1403,18 @@ function privateFunctionWithPrivateModuleParameterTypes1() { } var publicModule; (function (publicModule) { - var privateClass = (function () { + var privateClass = /** @class */ (function () { function privateClass() { } return privateClass; }()); - var publicClass = (function () { + var publicClass = /** @class */ (function () { function publicClass() { } return publicClass; }()); publicModule.publicClass = publicClass; - var publicClassWithWithPrivateParmeterTypes = (function () { + var publicClassWithWithPrivateParmeterTypes = /** @class */ (function () { function publicClassWithWithPrivateParmeterTypes() { } publicClassWithWithPrivateParmeterTypes.myPublicStaticMethod = function () { @@ -1444,7 +1444,7 @@ var publicModule; return publicClassWithWithPrivateParmeterTypes; }()); publicModule.publicClassWithWithPrivateParmeterTypes = publicClassWithWithPrivateParmeterTypes; - var publicClassWithWithPublicParmeterTypes = (function () { + var publicClassWithWithPublicParmeterTypes = /** @class */ (function () { function publicClassWithWithPublicParmeterTypes() { } publicClassWithWithPublicParmeterTypes.myPublicStaticMethod = function () { @@ -1474,7 +1474,7 @@ var publicModule; return publicClassWithWithPublicParmeterTypes; }()); publicModule.publicClassWithWithPublicParmeterTypes = publicClassWithWithPublicParmeterTypes; - var privateClassWithWithPrivateParmeterTypes = (function () { + var privateClassWithWithPrivateParmeterTypes = /** @class */ (function () { function privateClassWithWithPrivateParmeterTypes() { } privateClassWithWithPrivateParmeterTypes.myPublicStaticMethod = function () { @@ -1503,7 +1503,7 @@ var publicModule; }; return privateClassWithWithPrivateParmeterTypes; }()); - var privateClassWithWithPublicParmeterTypes = (function () { + var privateClassWithWithPublicParmeterTypes = /** @class */ (function () { function privateClassWithWithPublicParmeterTypes() { } privateClassWithWithPublicParmeterTypes.myPublicStaticMethod = function () { @@ -1560,7 +1560,7 @@ var publicModule; function privateFunctionWithPublicParmeterTypes1() { return new publicClass(); } - var publicClassWithPrivateModuleParameterTypes = (function () { + var publicClassWithPrivateModuleParameterTypes = /** @class */ (function () { function publicClassWithPrivateModuleParameterTypes() { } publicClassWithPrivateModuleParameterTypes.myPublicStaticMethod = function () { @@ -1586,7 +1586,7 @@ var publicModule; return new privateModule.publicClass(); } publicModule.publicFunctionWithPrivateModuleParameterTypes1 = publicFunctionWithPrivateModuleParameterTypes1; - var privateClassWithPrivateModuleParameterTypes = (function () { + var privateClassWithPrivateModuleParameterTypes = /** @class */ (function () { function privateClassWithPrivateModuleParameterTypes() { } privateClassWithPrivateModuleParameterTypes.myPublicStaticMethod = function () { @@ -1612,18 +1612,18 @@ var publicModule; })(publicModule = exports.publicModule || (exports.publicModule = {})); var privateModule; (function (privateModule) { - var privateClass = (function () { + var privateClass = /** @class */ (function () { function privateClass() { } return privateClass; }()); - var publicClass = (function () { + var publicClass = /** @class */ (function () { function publicClass() { } return publicClass; }()); privateModule.publicClass = publicClass; - var publicClassWithWithPrivateParmeterTypes = (function () { + var publicClassWithWithPrivateParmeterTypes = /** @class */ (function () { function publicClassWithWithPrivateParmeterTypes() { } publicClassWithWithPrivateParmeterTypes.myPublicStaticMethod = function () { @@ -1653,7 +1653,7 @@ var privateModule; return publicClassWithWithPrivateParmeterTypes; }()); privateModule.publicClassWithWithPrivateParmeterTypes = publicClassWithWithPrivateParmeterTypes; - var publicClassWithWithPublicParmeterTypes = (function () { + var publicClassWithWithPublicParmeterTypes = /** @class */ (function () { function publicClassWithWithPublicParmeterTypes() { } publicClassWithWithPublicParmeterTypes.myPublicStaticMethod = function () { @@ -1683,7 +1683,7 @@ var privateModule; return publicClassWithWithPublicParmeterTypes; }()); privateModule.publicClassWithWithPublicParmeterTypes = publicClassWithWithPublicParmeterTypes; - var privateClassWithWithPrivateParmeterTypes = (function () { + var privateClassWithWithPrivateParmeterTypes = /** @class */ (function () { function privateClassWithWithPrivateParmeterTypes() { } privateClassWithWithPrivateParmeterTypes.myPublicStaticMethod = function () { @@ -1712,7 +1712,7 @@ var privateModule; }; return privateClassWithWithPrivateParmeterTypes; }()); - var privateClassWithWithPublicParmeterTypes = (function () { + var privateClassWithWithPublicParmeterTypes = /** @class */ (function () { function privateClassWithWithPublicParmeterTypes() { } privateClassWithWithPublicParmeterTypes.myPublicStaticMethod = function () { @@ -1769,7 +1769,7 @@ var privateModule; function privateFunctionWithPublicParmeterTypes1() { return new publicClass(); } - var publicClassWithPrivateModuleParameterTypes = (function () { + var publicClassWithPrivateModuleParameterTypes = /** @class */ (function () { function publicClassWithPrivateModuleParameterTypes() { } publicClassWithPrivateModuleParameterTypes.myPublicStaticMethod = function () { @@ -1795,7 +1795,7 @@ var privateModule; return new privateModule.publicClass(); } privateModule.publicFunctionWithPrivateModuleParameterTypes1 = publicFunctionWithPrivateModuleParameterTypes1; - var privateClassWithPrivateModuleParameterTypes = (function () { + var privateClassWithPrivateModuleParameterTypes = /** @class */ (function () { function privateClassWithPrivateModuleParameterTypes() { } privateClassWithPrivateModuleParameterTypes.myPublicStaticMethod = function () { @@ -1820,12 +1820,12 @@ var privateModule; } })(privateModule || (privateModule = {})); //// [privacyFunctionReturnTypeDeclFile_GlobalFile.js] -var publicClassInGlobal = (function () { +var publicClassInGlobal = /** @class */ (function () { function publicClassInGlobal() { } return publicClassInGlobal; }()); -var publicClassWithWithPublicParmeterTypesInGlobal = (function () { +var publicClassWithWithPublicParmeterTypesInGlobal = /** @class */ (function () { function publicClassWithWithPublicParmeterTypesInGlobal() { } publicClassWithWithPublicParmeterTypesInGlobal.myPublicStaticMethod = function () { @@ -1862,12 +1862,12 @@ function publicFunctionWithPublicParmeterTypesInGlobal1() { } var publicModuleInGlobal; (function (publicModuleInGlobal) { - var privateClass = (function () { + var privateClass = /** @class */ (function () { function privateClass() { } return privateClass; }()); - var publicClass = (function () { + var publicClass = /** @class */ (function () { function publicClass() { } return publicClass; @@ -1875,18 +1875,18 @@ var publicModuleInGlobal; publicModuleInGlobal.publicClass = publicClass; var privateModule; (function (privateModule) { - var privateClass = (function () { + var privateClass = /** @class */ (function () { function privateClass() { } return privateClass; }()); - var publicClass = (function () { + var publicClass = /** @class */ (function () { function publicClass() { } return publicClass; }()); privateModule.publicClass = publicClass; - var publicClassWithWithPrivateParmeterTypes = (function () { + var publicClassWithWithPrivateParmeterTypes = /** @class */ (function () { function publicClassWithWithPrivateParmeterTypes() { } publicClassWithWithPrivateParmeterTypes.myPublicStaticMethod = function () { @@ -1916,7 +1916,7 @@ var publicModuleInGlobal; return publicClassWithWithPrivateParmeterTypes; }()); privateModule.publicClassWithWithPrivateParmeterTypes = publicClassWithWithPrivateParmeterTypes; - var publicClassWithWithPublicParmeterTypes = (function () { + var publicClassWithWithPublicParmeterTypes = /** @class */ (function () { function publicClassWithWithPublicParmeterTypes() { } publicClassWithWithPublicParmeterTypes.myPublicStaticMethod = function () { @@ -1946,7 +1946,7 @@ var publicModuleInGlobal; return publicClassWithWithPublicParmeterTypes; }()); privateModule.publicClassWithWithPublicParmeterTypes = publicClassWithWithPublicParmeterTypes; - var privateClassWithWithPrivateParmeterTypes = (function () { + var privateClassWithWithPrivateParmeterTypes = /** @class */ (function () { function privateClassWithWithPrivateParmeterTypes() { } privateClassWithWithPrivateParmeterTypes.myPublicStaticMethod = function () { @@ -1975,7 +1975,7 @@ var publicModuleInGlobal; }; return privateClassWithWithPrivateParmeterTypes; }()); - var privateClassWithWithPublicParmeterTypes = (function () { + var privateClassWithWithPublicParmeterTypes = /** @class */ (function () { function privateClassWithWithPublicParmeterTypes() { } privateClassWithWithPublicParmeterTypes.myPublicStaticMethod = function () { @@ -2032,7 +2032,7 @@ var publicModuleInGlobal; function privateFunctionWithPublicParmeterTypes1() { return new publicClass(); } - var publicClassWithPrivateModuleParameterTypes = (function () { + var publicClassWithPrivateModuleParameterTypes = /** @class */ (function () { function publicClassWithPrivateModuleParameterTypes() { } publicClassWithPrivateModuleParameterTypes.myPublicStaticMethod = function () { @@ -2058,7 +2058,7 @@ var publicModuleInGlobal; return new privateModule.publicClass(); } privateModule.publicFunctionWithPrivateModuleParameterTypes1 = publicFunctionWithPrivateModuleParameterTypes1; - var privateClassWithPrivateModuleParameterTypes = (function () { + var privateClassWithPrivateModuleParameterTypes = /** @class */ (function () { function privateClassWithPrivateModuleParameterTypes() { } privateClassWithPrivateModuleParameterTypes.myPublicStaticMethod = function () { @@ -2082,7 +2082,7 @@ var publicModuleInGlobal; return new privateModule.publicClass(); } })(privateModule || (privateModule = {})); - var publicClassWithWithPrivateParmeterTypes = (function () { + var publicClassWithWithPrivateParmeterTypes = /** @class */ (function () { function publicClassWithWithPrivateParmeterTypes() { } publicClassWithWithPrivateParmeterTypes.myPublicStaticMethod = function () { @@ -2112,7 +2112,7 @@ var publicModuleInGlobal; return publicClassWithWithPrivateParmeterTypes; }()); publicModuleInGlobal.publicClassWithWithPrivateParmeterTypes = publicClassWithWithPrivateParmeterTypes; - var publicClassWithWithPublicParmeterTypes = (function () { + var publicClassWithWithPublicParmeterTypes = /** @class */ (function () { function publicClassWithWithPublicParmeterTypes() { } publicClassWithWithPublicParmeterTypes.myPublicStaticMethod = function () { @@ -2142,7 +2142,7 @@ var publicModuleInGlobal; return publicClassWithWithPublicParmeterTypes; }()); publicModuleInGlobal.publicClassWithWithPublicParmeterTypes = publicClassWithWithPublicParmeterTypes; - var privateClassWithWithPrivateParmeterTypes = (function () { + var privateClassWithWithPrivateParmeterTypes = /** @class */ (function () { function privateClassWithWithPrivateParmeterTypes() { } privateClassWithWithPrivateParmeterTypes.myPublicStaticMethod = function () { @@ -2171,7 +2171,7 @@ var publicModuleInGlobal; }; return privateClassWithWithPrivateParmeterTypes; }()); - var privateClassWithWithPublicParmeterTypes = (function () { + var privateClassWithWithPublicParmeterTypes = /** @class */ (function () { function privateClassWithWithPublicParmeterTypes() { } privateClassWithWithPublicParmeterTypes.myPublicStaticMethod = function () { @@ -2228,7 +2228,7 @@ var publicModuleInGlobal; function privateFunctionWithPublicParmeterTypes1() { return new publicClass(); } - var publicClassWithPrivateModuleParameterTypes = (function () { + var publicClassWithPrivateModuleParameterTypes = /** @class */ (function () { function publicClassWithPrivateModuleParameterTypes() { } publicClassWithPrivateModuleParameterTypes.myPublicStaticMethod = function () { @@ -2254,7 +2254,7 @@ var publicModuleInGlobal; return new privateModule.publicClass(); } publicModuleInGlobal.publicFunctionWithPrivateModuleParameterTypes1 = publicFunctionWithPrivateModuleParameterTypes1; - var privateClassWithPrivateModuleParameterTypes = (function () { + var privateClassWithPrivateModuleParameterTypes = /** @class */ (function () { function privateClassWithPrivateModuleParameterTypes() { } privateClassWithPrivateModuleParameterTypes.myPublicStaticMethod = function () { diff --git a/tests/baselines/reference/privacyGetter.js b/tests/baselines/reference/privacyGetter.js index 255d21edcdb83..92fd5e82bec8c 100644 --- a/tests/baselines/reference/privacyGetter.js +++ b/tests/baselines/reference/privacyGetter.js @@ -213,7 +213,7 @@ define(["require", "exports"], function (require, exports) { Object.defineProperty(exports, "__esModule", { value: true }); var m1; (function (m1) { - var C1_public = (function () { + var C1_public = /** @class */ (function () { function C1_public() { } C1_public.prototype.f1 = function () { @@ -221,12 +221,12 @@ define(["require", "exports"], function (require, exports) { return C1_public; }()); m1.C1_public = C1_public; - var C2_private = (function () { + var C2_private = /** @class */ (function () { function C2_private() { } return C2_private; }()); - var C3_public = (function () { + var C3_public = /** @class */ (function () { function C3_public() { } Object.defineProperty(C3_public.prototype, "p1_private", { @@ -268,7 +268,7 @@ define(["require", "exports"], function (require, exports) { return C3_public; }()); m1.C3_public = C3_public; - var C4_private = (function () { + var C4_private = /** @class */ (function () { function C4_private() { } Object.defineProperty(C4_private.prototype, "p1_private", { @@ -312,7 +312,7 @@ define(["require", "exports"], function (require, exports) { })(m1 = exports.m1 || (exports.m1 = {})); var m2; (function (m2) { - var m2_C1_public = (function () { + var m2_C1_public = /** @class */ (function () { function m2_C1_public() { } m2_C1_public.prototype.f1 = function () { @@ -320,12 +320,12 @@ define(["require", "exports"], function (require, exports) { return m2_C1_public; }()); m2.m2_C1_public = m2_C1_public; - var m2_C2_private = (function () { + var m2_C2_private = /** @class */ (function () { function m2_C2_private() { } return m2_C2_private; }()); - var m2_C3_public = (function () { + var m2_C3_public = /** @class */ (function () { function m2_C3_public() { } Object.defineProperty(m2_C3_public.prototype, "p1_private", { @@ -367,7 +367,7 @@ define(["require", "exports"], function (require, exports) { return m2_C3_public; }()); m2.m2_C3_public = m2_C3_public; - var m2_C4_private = (function () { + var m2_C4_private = /** @class */ (function () { function m2_C4_private() { } Object.defineProperty(m2_C4_private.prototype, "p1_private", { @@ -409,20 +409,20 @@ define(["require", "exports"], function (require, exports) { return m2_C4_private; }()); })(m2 || (m2 = {})); - var C5_private = (function () { + var C5_private = /** @class */ (function () { function C5_private() { } C5_private.prototype.f = function () { }; return C5_private; }()); - var C6_public = (function () { + var C6_public = /** @class */ (function () { function C6_public() { } return C6_public; }()); exports.C6_public = C6_public; - var C7_public = (function () { + var C7_public = /** @class */ (function () { function C7_public() { } Object.defineProperty(C7_public.prototype, "p1_private", { @@ -464,7 +464,7 @@ define(["require", "exports"], function (require, exports) { return C7_public; }()); exports.C7_public = C7_public; - var C8_private = (function () { + var C8_private = /** @class */ (function () { function C8_private() { } Object.defineProperty(C8_private.prototype, "p1_private", { diff --git a/tests/baselines/reference/privacyGloClass.js b/tests/baselines/reference/privacyGloClass.js index 85acba1148b3a..e8a1a2f931df3 100644 --- a/tests/baselines/reference/privacyGloClass.js +++ b/tests/baselines/reference/privacyGloClass.js @@ -73,7 +73,7 @@ var __extends = (this && this.__extends) || (function () { })(); var m1; (function (m1) { - var m1_c_public = (function () { + var m1_c_public = /** @class */ (function () { function m1_c_public() { } m1_c_public.prototype.f1 = function () { @@ -81,26 +81,26 @@ var m1; return m1_c_public; }()); m1.m1_c_public = m1_c_public; - var m1_c_private = (function () { + var m1_c_private = /** @class */ (function () { function m1_c_private() { } return m1_c_private; }()); - var m1_C1_private = (function (_super) { + var m1_C1_private = /** @class */ (function (_super) { __extends(m1_C1_private, _super); function m1_C1_private() { return _super !== null && _super.apply(this, arguments) || this; } return m1_C1_private; }(m1_c_public)); - var m1_C2_private = (function (_super) { + var m1_C2_private = /** @class */ (function (_super) { __extends(m1_C2_private, _super); function m1_C2_private() { return _super !== null && _super.apply(this, arguments) || this; } return m1_C2_private; }(m1_c_private)); - var m1_C3_public = (function (_super) { + var m1_C3_public = /** @class */ (function (_super) { __extends(m1_C3_public, _super); function m1_C3_public() { return _super !== null && _super.apply(this, arguments) || this; @@ -108,7 +108,7 @@ var m1; return m1_C3_public; }(m1_c_public)); m1.m1_C3_public = m1_C3_public; - var m1_C4_public = (function (_super) { + var m1_C4_public = /** @class */ (function (_super) { __extends(m1_C4_public, _super); function m1_C4_public() { return _super !== null && _super.apply(this, arguments) || this; @@ -116,43 +116,43 @@ var m1; return m1_C4_public; }(m1_c_private)); m1.m1_C4_public = m1_C4_public; - var m1_C5_private = (function () { + var m1_C5_private = /** @class */ (function () { function m1_C5_private() { } return m1_C5_private; }()); - var m1_C6_private = (function () { + var m1_C6_private = /** @class */ (function () { function m1_C6_private() { } return m1_C6_private; }()); - var m1_C7_public = (function () { + var m1_C7_public = /** @class */ (function () { function m1_C7_public() { } return m1_C7_public; }()); m1.m1_C7_public = m1_C7_public; - var m1_C8_public = (function () { + var m1_C8_public = /** @class */ (function () { function m1_C8_public() { } return m1_C8_public; }()); m1.m1_C8_public = m1_C8_public; - var m1_C9_private = (function (_super) { + var m1_C9_private = /** @class */ (function (_super) { __extends(m1_C9_private, _super); function m1_C9_private() { return _super !== null && _super.apply(this, arguments) || this; } return m1_C9_private; }(m1_c_public)); - var m1_C10_private = (function (_super) { + var m1_C10_private = /** @class */ (function (_super) { __extends(m1_C10_private, _super); function m1_C10_private() { return _super !== null && _super.apply(this, arguments) || this; } return m1_C10_private; }(m1_c_private)); - var m1_C11_public = (function (_super) { + var m1_C11_public = /** @class */ (function (_super) { __extends(m1_C11_public, _super); function m1_C11_public() { return _super !== null && _super.apply(this, arguments) || this; @@ -160,7 +160,7 @@ var m1; return m1_C11_public; }(m1_c_public)); m1.m1_C11_public = m1_C11_public; - var m1_C12_public = (function (_super) { + var m1_C12_public = /** @class */ (function (_super) { __extends(m1_C12_public, _super); function m1_C12_public() { return _super !== null && _super.apply(this, arguments) || this; @@ -169,26 +169,26 @@ var m1; }(m1_c_private)); m1.m1_C12_public = m1_C12_public; })(m1 || (m1 = {})); -var glo_c_public = (function () { +var glo_c_public = /** @class */ (function () { function glo_c_public() { } glo_c_public.prototype.f1 = function () { }; return glo_c_public; }()); -var glo_C3_public = (function (_super) { +var glo_C3_public = /** @class */ (function (_super) { __extends(glo_C3_public, _super); function glo_C3_public() { return _super !== null && _super.apply(this, arguments) || this; } return glo_C3_public; }(glo_c_public)); -var glo_C7_public = (function () { +var glo_C7_public = /** @class */ (function () { function glo_C7_public() { } return glo_C7_public; }()); -var glo_C11_public = (function (_super) { +var glo_C11_public = /** @class */ (function (_super) { __extends(glo_C11_public, _super); function glo_C11_public() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/privacyGloFunc.js b/tests/baselines/reference/privacyGloFunc.js index 6bc177946809c..7e08522bfe1fe 100644 --- a/tests/baselines/reference/privacyGloFunc.js +++ b/tests/baselines/reference/privacyGloFunc.js @@ -536,7 +536,7 @@ define(["require", "exports"], function (require, exports) { exports.__esModule = true; var m1; (function (m1) { - var C1_public = (function () { + var C1_public = /** @class */ (function () { function C1_public() { } C1_public.prototype.f1 = function () { @@ -544,12 +544,12 @@ define(["require", "exports"], function (require, exports) { return C1_public; }()); m1.C1_public = C1_public; - var C2_private = (function () { + var C2_private = /** @class */ (function () { function C2_private() { } return C2_private; }()); - var C3_public = (function () { + var C3_public = /** @class */ (function () { function C3_public(m1_c3_c1_2) { } C3_public.prototype.f1_private = function (m1_c3_f1_arg) { @@ -587,7 +587,7 @@ define(["require", "exports"], function (require, exports) { return C3_public; }()); m1.C3_public = C3_public; - var C4_private = (function () { + var C4_private = /** @class */ (function () { function C4_private(m1_c4_c1_2) { } C4_private.prototype.f1_private = function (m1_c4_f1_arg) { @@ -624,24 +624,24 @@ define(["require", "exports"], function (require, exports) { }; return C4_private; }()); - var C5_public = (function () { + var C5_public = /** @class */ (function () { function C5_public(m1_c5_c) { } return C5_public; }()); m1.C5_public = C5_public; - var C6_private = (function () { + var C6_private = /** @class */ (function () { function C6_private(m1_c6_c) { } return C6_private; }()); - var C7_public = (function () { + var C7_public = /** @class */ (function () { function C7_public(m1_c7_c) { } return C7_public; }()); m1.C7_public = C7_public; - var C8_private = (function () { + var C8_private = /** @class */ (function () { function C8_private(m1_c8_c) { } return C8_private; @@ -687,7 +687,7 @@ define(["require", "exports"], function (require, exports) { })(m1 = exports.m1 || (exports.m1 = {})); var m2; (function (m2) { - var m2_C1_public = (function () { + var m2_C1_public = /** @class */ (function () { function m2_C1_public() { } m2_C1_public.prototype.f = function () { @@ -695,12 +695,12 @@ define(["require", "exports"], function (require, exports) { return m2_C1_public; }()); m2.m2_C1_public = m2_C1_public; - var m2_C2_private = (function () { + var m2_C2_private = /** @class */ (function () { function m2_C2_private() { } return m2_C2_private; }()); - var m2_C3_public = (function () { + var m2_C3_public = /** @class */ (function () { function m2_C3_public(m2_c3_c1_2) { } m2_C3_public.prototype.f1_private = function (m2_c3_f1_arg) { @@ -738,7 +738,7 @@ define(["require", "exports"], function (require, exports) { return m2_C3_public; }()); m2.m2_C3_public = m2_C3_public; - var m2_C4_private = (function () { + var m2_C4_private = /** @class */ (function () { function m2_C4_private(m2_c4_c1_2) { } m2_C4_private.prototype.f1_private = function (m2_c4_f1_arg) { @@ -775,24 +775,24 @@ define(["require", "exports"], function (require, exports) { }; return m2_C4_private; }()); - var m2_C5_public = (function () { + var m2_C5_public = /** @class */ (function () { function m2_C5_public(m2_c5_c) { } return m2_C5_public; }()); m2.m2_C5_public = m2_C5_public; - var m2_C6_private = (function () { + var m2_C6_private = /** @class */ (function () { function m2_C6_private(m2_c6_c) { } return m2_C6_private; }()); - var m2_C7_public = (function () { + var m2_C7_public = /** @class */ (function () { function m2_C7_public(m2_c7_c) { } return m2_C7_public; }()); m2.m2_C7_public = m2_C7_public; - var m2_C8_private = (function () { + var m2_C8_private = /** @class */ (function () { function m2_C8_private(m2_c8_c) { } return m2_C8_private; @@ -836,20 +836,20 @@ define(["require", "exports"], function (require, exports) { } m2.f12_public = f12_public; })(m2 || (m2 = {})); - var C5_private = (function () { + var C5_private = /** @class */ (function () { function C5_private() { } C5_private.prototype.f = function () { }; return C5_private; }()); - var C6_public = (function () { + var C6_public = /** @class */ (function () { function C6_public() { } return C6_public; }()); exports.C6_public = C6_public; - var C7_public = (function () { + var C7_public = /** @class */ (function () { function C7_public(c7_c1_2) { } C7_public.prototype.f1_private = function (c7_f1_arg) { @@ -887,7 +887,7 @@ define(["require", "exports"], function (require, exports) { return C7_public; }()); exports.C7_public = C7_public; - var C8_private = (function () { + var C8_private = /** @class */ (function () { function C8_private(c8_c1_2) { } C8_private.prototype.f1_private = function (c8_f1_arg) { @@ -924,24 +924,24 @@ define(["require", "exports"], function (require, exports) { }; return C8_private; }()); - var C9_public = (function () { + var C9_public = /** @class */ (function () { function C9_public(c9_c) { } return C9_public; }()); exports.C9_public = C9_public; - var C10_private = (function () { + var C10_private = /** @class */ (function () { function C10_private(c10_c) { } return C10_private; }()); - var C11_public = (function () { + var C11_public = /** @class */ (function () { function C11_public(c11_c) { } return C11_public; }()); exports.C11_public = C11_public; - var C12_private = (function () { + var C12_private = /** @class */ (function () { function C12_private(c12_c) { } return C12_private; diff --git a/tests/baselines/reference/privacyGloGetter.js b/tests/baselines/reference/privacyGloGetter.js index 2ae94a0d321f9..392272b4d0248 100644 --- a/tests/baselines/reference/privacyGloGetter.js +++ b/tests/baselines/reference/privacyGloGetter.js @@ -91,7 +91,7 @@ class C7_public { //// [privacyGloGetter.js] var m1; (function (m1) { - var C1_public = (function () { + var C1_public = /** @class */ (function () { function C1_public() { } C1_public.prototype.f1 = function () { @@ -99,12 +99,12 @@ var m1; return C1_public; }()); m1.C1_public = C1_public; - var C2_private = (function () { + var C2_private = /** @class */ (function () { function C2_private() { } return C2_private; }()); - var C3_public = (function () { + var C3_public = /** @class */ (function () { function C3_public() { } Object.defineProperty(C3_public.prototype, "p1_private", { @@ -146,7 +146,7 @@ var m1; return C3_public; }()); m1.C3_public = C3_public; - var C4_private = (function () { + var C4_private = /** @class */ (function () { function C4_private() { } Object.defineProperty(C4_private.prototype, "p1_private", { @@ -188,12 +188,12 @@ var m1; return C4_private; }()); })(m1 || (m1 = {})); -var C6_public = (function () { +var C6_public = /** @class */ (function () { function C6_public() { } return C6_public; }()); -var C7_public = (function () { +var C7_public = /** @class */ (function () { function C7_public() { } Object.defineProperty(C7_public.prototype, "p1_private", { diff --git a/tests/baselines/reference/privacyGloImport.js b/tests/baselines/reference/privacyGloImport.js index ecafec9d639da..befc5b953f53f 100644 --- a/tests/baselines/reference/privacyGloImport.js +++ b/tests/baselines/reference/privacyGloImport.js @@ -157,7 +157,7 @@ var m1; (function (m1) { var m1_M1_public; (function (m1_M1_public) { - var c1 = (function () { + var c1 = /** @class */ (function () { function c1() { } return c1; @@ -171,7 +171,7 @@ var m1; })(m1_M1_public = m1.m1_M1_public || (m1.m1_M1_public = {})); var m1_M2_private; (function (m1_M2_private) { - var c1 = (function () { + var c1 = /** @class */ (function () { function c1() { } return c1; @@ -240,7 +240,7 @@ var m1; })(m1 || (m1 = {})); var glo_M1_public; (function (glo_M1_public) { - var c1 = (function () { + var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/privacyGloImportParseErrors.js b/tests/baselines/reference/privacyGloImportParseErrors.js index 21175ff068de0..cf45803b51dde 100644 --- a/tests/baselines/reference/privacyGloImportParseErrors.js +++ b/tests/baselines/reference/privacyGloImportParseErrors.js @@ -157,7 +157,7 @@ var m1; (function (m1) { var m1_M1_public; (function (m1_M1_public) { - var c1 = (function () { + var c1 = /** @class */ (function () { function c1() { } return c1; @@ -171,7 +171,7 @@ var m1; })(m1_M1_public = m1.m1_M1_public || (m1.m1_M1_public = {})); var m1_M2_private; (function (m1_M2_private) { - var c1 = (function () { + var c1 = /** @class */ (function () { function c1() { } return c1; @@ -222,7 +222,7 @@ var m1; })(m1 || (m1 = {})); var glo_M1_public; (function (glo_M1_public) { - var c1 = (function () { + var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/privacyGloInterface.js b/tests/baselines/reference/privacyGloInterface.js index 671977678a39a..a75ad86aa934e 100644 --- a/tests/baselines/reference/privacyGloInterface.js +++ b/tests/baselines/reference/privacyGloInterface.js @@ -122,7 +122,7 @@ interface glo_C3_public extends glo_i_public { //// [privacyGloInterface.js] var m1; (function (m1) { - var C1_public = (function () { + var C1_public = /** @class */ (function () { function C1_public() { } C1_public.prototype.f1 = function () { @@ -130,13 +130,13 @@ var m1; return C1_public; }()); m1.C1_public = C1_public; - var C2_private = (function () { + var C2_private = /** @class */ (function () { function C2_private() { } return C2_private; }()); })(m1 || (m1 = {})); -var C5_public = (function () { +var C5_public = /** @class */ (function () { function C5_public() { } C5_public.prototype.f1 = function () { diff --git a/tests/baselines/reference/privacyGloVar.js b/tests/baselines/reference/privacyGloVar.js index 678d6cfdc99ed..0102efd3e568e 100644 --- a/tests/baselines/reference/privacyGloVar.js +++ b/tests/baselines/reference/privacyGloVar.js @@ -83,7 +83,7 @@ var glo_v22_public: glo_C1_public = new glo_C1_public(); //// [privacyGloVar.js] var m1; (function (m1) { - var C1_public = (function () { + var C1_public = /** @class */ (function () { function C1_public() { } C1_public.prototype.f1 = function () { @@ -91,12 +91,12 @@ var m1; return C1_public; }()); m1.C1_public = C1_public; - var C2_private = (function () { + var C2_private = /** @class */ (function () { function C2_private() { } return C2_private; }()); - var C3_public = (function () { + var C3_public = /** @class */ (function () { function C3_public() { this.C3_v11_private = new C1_public(); this.C3_v12_public = new C1_public(); @@ -110,7 +110,7 @@ var m1; return C3_public; }()); m1.C3_public = C3_public; - var C4_public = (function () { + var C4_public = /** @class */ (function () { function C4_public() { this.C4_v11_private = new C1_public(); this.C4_v12_public = new C1_public(); @@ -134,14 +134,14 @@ var m1; var m1_v23_private = new C2_private(); m1.m1_v24_public = new C2_private(); // error })(m1 || (m1 = {})); -var glo_C1_public = (function () { +var glo_C1_public = /** @class */ (function () { function glo_C1_public() { } glo_C1_public.prototype.f1 = function () { }; return glo_C1_public; }()); -var glo_C3_public = (function () { +var glo_C3_public = /** @class */ (function () { function glo_C3_public() { this.glo_C3_v11_private = new glo_C1_public(); this.glo_C3_v12_public = new glo_C1_public(); diff --git a/tests/baselines/reference/privacyImport.js b/tests/baselines/reference/privacyImport.js index 1a3dc9d9b1891..99175e8d57d85 100644 --- a/tests/baselines/reference/privacyImport.js +++ b/tests/baselines/reference/privacyImport.js @@ -363,7 +363,7 @@ var m1; (function (m1) { var m1_M1_public; (function (m1_M1_public) { - var c1 = (function () { + var c1 = /** @class */ (function () { function c1() { } return c1; @@ -377,7 +377,7 @@ var m1; })(m1_M1_public = m1.m1_M1_public || (m1.m1_M1_public = {})); var m1_M2_private; (function (m1_M2_private) { - var c1 = (function () { + var c1 = /** @class */ (function () { function c1() { } return c1; @@ -448,7 +448,7 @@ var m2; (function (m2) { var m2_M1_public; (function (m2_M1_public) { - var c1 = (function () { + var c1 = /** @class */ (function () { function c1() { } return c1; @@ -462,7 +462,7 @@ var m2; })(m2_M1_public = m2.m2_M1_public || (m2.m2_M1_public = {})); var m2_M2_private; (function (m2_M2_private) { - var c1 = (function () { + var c1 = /** @class */ (function () { function c1() { } return c1; @@ -532,7 +532,7 @@ var m2; })(m2 || (m2 = {})); var glo_M1_public; (function (glo_M1_public) { - var c1 = (function () { + var c1 = /** @class */ (function () { function c1() { } return c1; @@ -553,7 +553,7 @@ var glo_M1_public; //} var glo_M3_private; (function (glo_M3_private) { - var c1 = (function () { + var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/privacyImportParseErrors.js b/tests/baselines/reference/privacyImportParseErrors.js index 5a15a7280ecdf..da869a1122027 100644 --- a/tests/baselines/reference/privacyImportParseErrors.js +++ b/tests/baselines/reference/privacyImportParseErrors.js @@ -363,7 +363,7 @@ var m1; (function (m1) { var m1_M1_public; (function (m1_M1_public) { - var c1 = (function () { + var c1 = /** @class */ (function () { function c1() { } return c1; @@ -377,7 +377,7 @@ var m1; })(m1_M1_public = m1.m1_M1_public || (m1.m1_M1_public = {})); var m1_M2_private; (function (m1_M2_private) { - var c1 = (function () { + var c1 = /** @class */ (function () { function c1() { } return c1; @@ -430,7 +430,7 @@ var m2; (function (m2) { var m2_M1_public; (function (m2_M1_public) { - var c1 = (function () { + var c1 = /** @class */ (function () { function c1() { } return c1; @@ -444,7 +444,7 @@ var m2; })(m2_M1_public = m2.m2_M1_public || (m2.m2_M1_public = {})); var m2_M2_private; (function (m2_M2_private) { - var c1 = (function () { + var c1 = /** @class */ (function () { function c1() { } return c1; @@ -496,7 +496,7 @@ var m2; })(m2 || (m2 = {})); var glo_M1_public; (function (glo_M1_public) { - var c1 = (function () { + var c1 = /** @class */ (function () { function c1() { } return c1; @@ -510,7 +510,7 @@ var glo_M1_public; })(glo_M1_public = exports.glo_M1_public || (exports.glo_M1_public = {})); var glo_M3_private; (function (glo_M3_private) { - var c1 = (function () { + var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/privacyInterface.js b/tests/baselines/reference/privacyInterface.js index 360f1683b6a27..947750dfb2f7d 100644 --- a/tests/baselines/reference/privacyInterface.js +++ b/tests/baselines/reference/privacyInterface.js @@ -269,7 +269,7 @@ export interface glo_C6_public extends glo_i_private, glo_i_public { exports.__esModule = true; var m1; (function (m1) { - var C1_public = (function () { + var C1_public = /** @class */ (function () { function C1_public() { } C1_public.prototype.f1 = function () { @@ -277,7 +277,7 @@ var m1; return C1_public; }()); m1.C1_public = C1_public; - var C2_private = (function () { + var C2_private = /** @class */ (function () { function C2_private() { } return C2_private; @@ -285,7 +285,7 @@ var m1; })(m1 = exports.m1 || (exports.m1 = {})); var m2; (function (m2) { - var C1_public = (function () { + var C1_public = /** @class */ (function () { function C1_public() { } C1_public.prototype.f1 = function () { @@ -293,13 +293,13 @@ var m2; return C1_public; }()); m2.C1_public = C1_public; - var C2_private = (function () { + var C2_private = /** @class */ (function () { function C2_private() { } return C2_private; }()); })(m2 || (m2 = {})); -var C5_public = (function () { +var C5_public = /** @class */ (function () { function C5_public() { } C5_public.prototype.f1 = function () { @@ -307,7 +307,7 @@ var C5_public = (function () { return C5_public; }()); exports.C5_public = C5_public; -var C6_private = (function () { +var C6_private = /** @class */ (function () { function C6_private() { } return C6_private; diff --git a/tests/baselines/reference/privacyLocalInternalReferenceImportWithExport.js b/tests/baselines/reference/privacyLocalInternalReferenceImportWithExport.js index 408abc049405b..d70c34f9814f9 100644 --- a/tests/baselines/reference/privacyLocalInternalReferenceImportWithExport.js +++ b/tests/baselines/reference/privacyLocalInternalReferenceImportWithExport.js @@ -158,7 +158,7 @@ exports.__esModule = true; // private elements var m_private; (function (m_private) { - var c_private = (function () { + var c_private = /** @class */ (function () { function c_private() { } return c_private; @@ -176,7 +176,7 @@ var m_private; m_private.v_private = new c_private(); var mi_private; (function (mi_private) { - var c = (function () { + var c = /** @class */ (function () { function c() { } return c; @@ -187,7 +187,7 @@ var m_private; // Public elements var m_public; (function (m_public) { - var c_public = (function () { + var c_public = /** @class */ (function () { function c_public() { } return c_public; @@ -205,7 +205,7 @@ var m_public; m_public.v_public = 10; var mi_public; (function (mi_public) { - var c = (function () { + var c = /** @class */ (function () { function c() { } return c; diff --git a/tests/baselines/reference/privacyLocalInternalReferenceImportWithoutExport.js b/tests/baselines/reference/privacyLocalInternalReferenceImportWithoutExport.js index 8b158d7cc3d18..ae0079459187c 100644 --- a/tests/baselines/reference/privacyLocalInternalReferenceImportWithoutExport.js +++ b/tests/baselines/reference/privacyLocalInternalReferenceImportWithoutExport.js @@ -159,7 +159,7 @@ define(["require", "exports"], function (require, exports) { // private elements var m_private; (function (m_private) { - var c_private = (function () { + var c_private = /** @class */ (function () { function c_private() { } return c_private; @@ -177,7 +177,7 @@ define(["require", "exports"], function (require, exports) { m_private.v_private = new c_private(); var mi_private; (function (mi_private) { - var c = (function () { + var c = /** @class */ (function () { function c() { } return c; @@ -188,7 +188,7 @@ define(["require", "exports"], function (require, exports) { // Public elements var m_public; (function (m_public) { - var c_public = (function () { + var c_public = /** @class */ (function () { function c_public() { } return c_public; @@ -206,7 +206,7 @@ define(["require", "exports"], function (require, exports) { m_public.v_public = 10; var mi_public; (function (mi_public) { - var c = (function () { + var c = /** @class */ (function () { function c() { } return c; diff --git a/tests/baselines/reference/privacyTopLevelAmbientExternalModuleImportWithExport.js b/tests/baselines/reference/privacyTopLevelAmbientExternalModuleImportWithExport.js index 312d682669c28..93928a4a36771 100644 --- a/tests/baselines/reference/privacyTopLevelAmbientExternalModuleImportWithExport.js +++ b/tests/baselines/reference/privacyTopLevelAmbientExternalModuleImportWithExport.js @@ -54,7 +54,7 @@ export var publicUse_im_public_mi_public = new im_public_mi_public.c_private(); "use strict"; exports.__esModule = true; // Public elements -var c_public = (function () { +var c_public = /** @class */ (function () { function c_public() { } return c_public; @@ -63,7 +63,7 @@ exports.c_public = c_public; //// [privacyTopLevelAmbientExternalModuleImportWithExport_require1.js] "use strict"; exports.__esModule = true; -var c_public = (function () { +var c_public = /** @class */ (function () { function c_public() { } return c_public; diff --git a/tests/baselines/reference/privacyTopLevelAmbientExternalModuleImportWithoutExport.js b/tests/baselines/reference/privacyTopLevelAmbientExternalModuleImportWithoutExport.js index de464ddd11a6a..14b52a1ea3ade 100644 --- a/tests/baselines/reference/privacyTopLevelAmbientExternalModuleImportWithoutExport.js +++ b/tests/baselines/reference/privacyTopLevelAmbientExternalModuleImportWithoutExport.js @@ -54,7 +54,7 @@ define(["require", "exports"], function (require, exports) { "use strict"; exports.__esModule = true; // Public elements - var c_public = (function () { + var c_public = /** @class */ (function () { function c_public() { } return c_public; @@ -65,7 +65,7 @@ define(["require", "exports"], function (require, exports) { define(["require", "exports"], function (require, exports) { "use strict"; exports.__esModule = true; - var c_public = (function () { + var c_public = /** @class */ (function () { function c_public() { } return c_public; diff --git a/tests/baselines/reference/privacyTopLevelInternalReferenceImportWithExport.js b/tests/baselines/reference/privacyTopLevelInternalReferenceImportWithExport.js index a89d49609e9cc..dd95476a3e296 100644 --- a/tests/baselines/reference/privacyTopLevelInternalReferenceImportWithExport.js +++ b/tests/baselines/reference/privacyTopLevelInternalReferenceImportWithExport.js @@ -106,7 +106,7 @@ define(["require", "exports"], function (require, exports) { // private elements var m_private; (function (m_private) { - var c_private = (function () { + var c_private = /** @class */ (function () { function c_private() { } return c_private; @@ -124,7 +124,7 @@ define(["require", "exports"], function (require, exports) { m_private.v_private = new c_private(); var mi_private; (function (mi_private) { - var c = (function () { + var c = /** @class */ (function () { function c() { } return c; @@ -135,7 +135,7 @@ define(["require", "exports"], function (require, exports) { // Public elements var m_public; (function (m_public) { - var c_public = (function () { + var c_public = /** @class */ (function () { function c_public() { } return c_public; @@ -153,7 +153,7 @@ define(["require", "exports"], function (require, exports) { m_public.v_public = 10; var mi_public; (function (mi_public) { - var c = (function () { + var c = /** @class */ (function () { function c() { } return c; diff --git a/tests/baselines/reference/privacyTopLevelInternalReferenceImportWithoutExport.js b/tests/baselines/reference/privacyTopLevelInternalReferenceImportWithoutExport.js index 8646cbe6f7583..d69ab4a8113eb 100644 --- a/tests/baselines/reference/privacyTopLevelInternalReferenceImportWithoutExport.js +++ b/tests/baselines/reference/privacyTopLevelInternalReferenceImportWithoutExport.js @@ -106,7 +106,7 @@ define(["require", "exports"], function (require, exports) { // private elements var m_private; (function (m_private) { - var c_private = (function () { + var c_private = /** @class */ (function () { function c_private() { } return c_private; @@ -124,7 +124,7 @@ define(["require", "exports"], function (require, exports) { m_private.v_private = new c_private(); var mi_private; (function (mi_private) { - var c = (function () { + var c = /** @class */ (function () { function c() { } return c; @@ -135,7 +135,7 @@ define(["require", "exports"], function (require, exports) { // Public elements var m_public; (function (m_public) { - var c_public = (function () { + var c_public = /** @class */ (function () { function c_public() { } return c_public; @@ -153,7 +153,7 @@ define(["require", "exports"], function (require, exports) { m_public.v_public = 10; var mi_public; (function (mi_public) { - var c = (function () { + var c = /** @class */ (function () { function c() { } return c; diff --git a/tests/baselines/reference/privacyTypeParameterOfFunction.js b/tests/baselines/reference/privacyTypeParameterOfFunction.js index 98e0a57d59ea3..7edc37981c0a7 100644 --- a/tests/baselines/reference/privacyTypeParameterOfFunction.js +++ b/tests/baselines/reference/privacyTypeParameterOfFunction.js @@ -135,18 +135,18 @@ function privateFunctionWithPublicTypeParametersWithoutExtends() { //// [privacyTypeParameterOfFunction.js] "use strict"; exports.__esModule = true; -var privateClass = (function () { +var privateClass = /** @class */ (function () { function privateClass() { } return privateClass; }()); -var publicClass = (function () { +var publicClass = /** @class */ (function () { function publicClass() { } return publicClass; }()); exports.publicClass = publicClass; -var publicClassWithWithPrivateTypeParameters = (function () { +var publicClassWithWithPrivateTypeParameters = /** @class */ (function () { function publicClassWithWithPrivateTypeParameters() { } // TypeParameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_type_1 @@ -162,7 +162,7 @@ var publicClassWithWithPrivateTypeParameters = (function () { return publicClassWithWithPrivateTypeParameters; }()); exports.publicClassWithWithPrivateTypeParameters = publicClassWithWithPrivateTypeParameters; -var publicClassWithWithPublicTypeParameters = (function () { +var publicClassWithWithPublicTypeParameters = /** @class */ (function () { function publicClassWithWithPublicTypeParameters() { } publicClassWithWithPublicTypeParameters.myPublicStaticMethod = function () { @@ -176,7 +176,7 @@ var publicClassWithWithPublicTypeParameters = (function () { return publicClassWithWithPublicTypeParameters; }()); exports.publicClassWithWithPublicTypeParameters = publicClassWithWithPublicTypeParameters; -var privateClassWithWithPrivateTypeParameters = (function () { +var privateClassWithWithPrivateTypeParameters = /** @class */ (function () { function privateClassWithWithPrivateTypeParameters() { } privateClassWithWithPrivateTypeParameters.myPublicStaticMethod = function () { @@ -189,7 +189,7 @@ var privateClassWithWithPrivateTypeParameters = (function () { }; return privateClassWithWithPrivateTypeParameters; }()); -var privateClassWithWithPublicTypeParameters = (function () { +var privateClassWithWithPublicTypeParameters = /** @class */ (function () { function privateClassWithWithPublicTypeParameters() { } privateClassWithWithPublicTypeParameters.myPublicStaticMethod = function () { @@ -213,7 +213,7 @@ function privateFunctionWithPrivateTypeParameters() { } function privateFunctionWithPublicTypeParameters() { } -var publicClassWithWithPublicTypeParametersWithoutExtends = (function () { +var publicClassWithWithPublicTypeParametersWithoutExtends = /** @class */ (function () { function publicClassWithWithPublicTypeParametersWithoutExtends() { } publicClassWithWithPublicTypeParametersWithoutExtends.myPublicStaticMethod = function () { @@ -227,7 +227,7 @@ var publicClassWithWithPublicTypeParametersWithoutExtends = (function () { return publicClassWithWithPublicTypeParametersWithoutExtends; }()); exports.publicClassWithWithPublicTypeParametersWithoutExtends = publicClassWithWithPublicTypeParametersWithoutExtends; -var privateClassWithWithPublicTypeParametersWithoutExtends = (function () { +var privateClassWithWithPublicTypeParametersWithoutExtends = /** @class */ (function () { function privateClassWithWithPublicTypeParametersWithoutExtends() { } privateClassWithWithPublicTypeParametersWithoutExtends.myPublicStaticMethod = function () { diff --git a/tests/baselines/reference/privacyTypeParameterOfFunctionDeclFile.js b/tests/baselines/reference/privacyTypeParameterOfFunctionDeclFile.js index f5fdf6dfff868..ce80dcbae1e7a 100644 --- a/tests/baselines/reference/privacyTypeParameterOfFunctionDeclFile.js +++ b/tests/baselines/reference/privacyTypeParameterOfFunctionDeclFile.js @@ -441,18 +441,18 @@ module privateModule { //// [privacyTypeParameterOfFunctionDeclFile.js] "use strict"; exports.__esModule = true; -var privateClass = (function () { +var privateClass = /** @class */ (function () { function privateClass() { } return privateClass; }()); -var publicClass = (function () { +var publicClass = /** @class */ (function () { function publicClass() { } return publicClass; }()); exports.publicClass = publicClass; -var publicClassWithWithPrivateTypeParameters = (function () { +var publicClassWithWithPrivateTypeParameters = /** @class */ (function () { function publicClassWithWithPrivateTypeParameters() { } publicClassWithWithPrivateTypeParameters.myPublicStaticMethod = function () { @@ -466,7 +466,7 @@ var publicClassWithWithPrivateTypeParameters = (function () { return publicClassWithWithPrivateTypeParameters; }()); exports.publicClassWithWithPrivateTypeParameters = publicClassWithWithPrivateTypeParameters; -var publicClassWithWithPublicTypeParameters = (function () { +var publicClassWithWithPublicTypeParameters = /** @class */ (function () { function publicClassWithWithPublicTypeParameters() { } publicClassWithWithPublicTypeParameters.myPublicStaticMethod = function () { @@ -480,7 +480,7 @@ var publicClassWithWithPublicTypeParameters = (function () { return publicClassWithWithPublicTypeParameters; }()); exports.publicClassWithWithPublicTypeParameters = publicClassWithWithPublicTypeParameters; -var privateClassWithWithPrivateTypeParameters = (function () { +var privateClassWithWithPrivateTypeParameters = /** @class */ (function () { function privateClassWithWithPrivateTypeParameters() { } privateClassWithWithPrivateTypeParameters.myPublicStaticMethod = function () { @@ -493,7 +493,7 @@ var privateClassWithWithPrivateTypeParameters = (function () { }; return privateClassWithWithPrivateTypeParameters; }()); -var privateClassWithWithPublicTypeParameters = (function () { +var privateClassWithWithPublicTypeParameters = /** @class */ (function () { function privateClassWithWithPublicTypeParameters() { } privateClassWithWithPublicTypeParameters.myPublicStaticMethod = function () { @@ -516,7 +516,7 @@ function privateFunctionWithPrivateTypeParameters() { } function privateFunctionWithPublicTypeParameters() { } -var publicClassWithWithPublicTypeParametersWithoutExtends = (function () { +var publicClassWithWithPublicTypeParametersWithoutExtends = /** @class */ (function () { function publicClassWithWithPublicTypeParametersWithoutExtends() { } publicClassWithWithPublicTypeParametersWithoutExtends.myPublicStaticMethod = function () { @@ -530,7 +530,7 @@ var publicClassWithWithPublicTypeParametersWithoutExtends = (function () { return publicClassWithWithPublicTypeParametersWithoutExtends; }()); exports.publicClassWithWithPublicTypeParametersWithoutExtends = publicClassWithWithPublicTypeParametersWithoutExtends; -var privateClassWithWithPublicTypeParametersWithoutExtends = (function () { +var privateClassWithWithPublicTypeParametersWithoutExtends = /** @class */ (function () { function privateClassWithWithPublicTypeParametersWithoutExtends() { } privateClassWithWithPublicTypeParametersWithoutExtends.myPublicStaticMethod = function () { @@ -548,7 +548,7 @@ function publicFunctionWithPublicTypeParametersWithoutExtends() { exports.publicFunctionWithPublicTypeParametersWithoutExtends = publicFunctionWithPublicTypeParametersWithoutExtends; function privateFunctionWithPublicTypeParametersWithoutExtends() { } -var publicClassWithWithPrivateModuleTypeParameters = (function () { +var publicClassWithWithPrivateModuleTypeParameters = /** @class */ (function () { function publicClassWithWithPrivateModuleTypeParameters() { } publicClassWithWithPrivateModuleTypeParameters.myPublicStaticMethod = function () { @@ -561,7 +561,7 @@ exports.publicClassWithWithPrivateModuleTypeParameters = publicClassWithWithPriv function publicFunctionWithPrivateMopduleTypeParameters() { } exports.publicFunctionWithPrivateMopduleTypeParameters = publicFunctionWithPrivateMopduleTypeParameters; -var privateClassWithWithPrivateModuleTypeParameters = (function () { +var privateClassWithWithPrivateModuleTypeParameters = /** @class */ (function () { function privateClassWithWithPrivateModuleTypeParameters() { } privateClassWithWithPrivateModuleTypeParameters.myPublicStaticMethod = function () { @@ -574,18 +574,18 @@ function privateFunctionWithPrivateMopduleTypeParameters() { } var publicModule; (function (publicModule) { - var privateClass = (function () { + var privateClass = /** @class */ (function () { function privateClass() { } return privateClass; }()); - var publicClass = (function () { + var publicClass = /** @class */ (function () { function publicClass() { } return publicClass; }()); publicModule.publicClass = publicClass; - var publicClassWithWithPrivateTypeParameters = (function () { + var publicClassWithWithPrivateTypeParameters = /** @class */ (function () { function publicClassWithWithPrivateTypeParameters() { } publicClassWithWithPrivateTypeParameters.myPublicStaticMethod = function () { @@ -599,7 +599,7 @@ var publicModule; return publicClassWithWithPrivateTypeParameters; }()); publicModule.publicClassWithWithPrivateTypeParameters = publicClassWithWithPrivateTypeParameters; - var publicClassWithWithPublicTypeParameters = (function () { + var publicClassWithWithPublicTypeParameters = /** @class */ (function () { function publicClassWithWithPublicTypeParameters() { } publicClassWithWithPublicTypeParameters.myPublicStaticMethod = function () { @@ -613,7 +613,7 @@ var publicModule; return publicClassWithWithPublicTypeParameters; }()); publicModule.publicClassWithWithPublicTypeParameters = publicClassWithWithPublicTypeParameters; - var privateClassWithWithPrivateTypeParameters = (function () { + var privateClassWithWithPrivateTypeParameters = /** @class */ (function () { function privateClassWithWithPrivateTypeParameters() { } privateClassWithWithPrivateTypeParameters.myPublicStaticMethod = function () { @@ -626,7 +626,7 @@ var publicModule; }; return privateClassWithWithPrivateTypeParameters; }()); - var privateClassWithWithPublicTypeParameters = (function () { + var privateClassWithWithPublicTypeParameters = /** @class */ (function () { function privateClassWithWithPublicTypeParameters() { } privateClassWithWithPublicTypeParameters.myPublicStaticMethod = function () { @@ -649,7 +649,7 @@ var publicModule; } function privateFunctionWithPublicTypeParameters() { } - var publicClassWithWithPublicTypeParametersWithoutExtends = (function () { + var publicClassWithWithPublicTypeParametersWithoutExtends = /** @class */ (function () { function publicClassWithWithPublicTypeParametersWithoutExtends() { } publicClassWithWithPublicTypeParametersWithoutExtends.myPublicStaticMethod = function () { @@ -663,7 +663,7 @@ var publicModule; return publicClassWithWithPublicTypeParametersWithoutExtends; }()); publicModule.publicClassWithWithPublicTypeParametersWithoutExtends = publicClassWithWithPublicTypeParametersWithoutExtends; - var privateClassWithWithPublicTypeParametersWithoutExtends = (function () { + var privateClassWithWithPublicTypeParametersWithoutExtends = /** @class */ (function () { function privateClassWithWithPublicTypeParametersWithoutExtends() { } privateClassWithWithPublicTypeParametersWithoutExtends.myPublicStaticMethod = function () { @@ -681,7 +681,7 @@ var publicModule; publicModule.publicFunctionWithPublicTypeParametersWithoutExtends = publicFunctionWithPublicTypeParametersWithoutExtends; function privateFunctionWithPublicTypeParametersWithoutExtends() { } - var publicClassWithWithPrivateModuleTypeParameters = (function () { + var publicClassWithWithPrivateModuleTypeParameters = /** @class */ (function () { function publicClassWithWithPrivateModuleTypeParameters() { } publicClassWithWithPrivateModuleTypeParameters.myPublicStaticMethod = function () { @@ -694,7 +694,7 @@ var publicModule; function publicFunctionWithPrivateMopduleTypeParameters() { } publicModule.publicFunctionWithPrivateMopduleTypeParameters = publicFunctionWithPrivateMopduleTypeParameters; - var privateClassWithWithPrivateModuleTypeParameters = (function () { + var privateClassWithWithPrivateModuleTypeParameters = /** @class */ (function () { function privateClassWithWithPrivateModuleTypeParameters() { } privateClassWithWithPrivateModuleTypeParameters.myPublicStaticMethod = function () { @@ -708,18 +708,18 @@ var publicModule; })(publicModule = exports.publicModule || (exports.publicModule = {})); var privateModule; (function (privateModule) { - var privateClass = (function () { + var privateClass = /** @class */ (function () { function privateClass() { } return privateClass; }()); - var publicClass = (function () { + var publicClass = /** @class */ (function () { function publicClass() { } return publicClass; }()); privateModule.publicClass = publicClass; - var publicClassWithWithPrivateTypeParameters = (function () { + var publicClassWithWithPrivateTypeParameters = /** @class */ (function () { function publicClassWithWithPrivateTypeParameters() { } publicClassWithWithPrivateTypeParameters.myPublicStaticMethod = function () { @@ -733,7 +733,7 @@ var privateModule; return publicClassWithWithPrivateTypeParameters; }()); privateModule.publicClassWithWithPrivateTypeParameters = publicClassWithWithPrivateTypeParameters; - var publicClassWithWithPublicTypeParameters = (function () { + var publicClassWithWithPublicTypeParameters = /** @class */ (function () { function publicClassWithWithPublicTypeParameters() { } publicClassWithWithPublicTypeParameters.myPublicStaticMethod = function () { @@ -747,7 +747,7 @@ var privateModule; return publicClassWithWithPublicTypeParameters; }()); privateModule.publicClassWithWithPublicTypeParameters = publicClassWithWithPublicTypeParameters; - var privateClassWithWithPrivateTypeParameters = (function () { + var privateClassWithWithPrivateTypeParameters = /** @class */ (function () { function privateClassWithWithPrivateTypeParameters() { } privateClassWithWithPrivateTypeParameters.myPublicStaticMethod = function () { @@ -760,7 +760,7 @@ var privateModule; }; return privateClassWithWithPrivateTypeParameters; }()); - var privateClassWithWithPublicTypeParameters = (function () { + var privateClassWithWithPublicTypeParameters = /** @class */ (function () { function privateClassWithWithPublicTypeParameters() { } privateClassWithWithPublicTypeParameters.myPublicStaticMethod = function () { @@ -783,7 +783,7 @@ var privateModule; } function privateFunctionWithPublicTypeParameters() { } - var publicClassWithWithPublicTypeParametersWithoutExtends = (function () { + var publicClassWithWithPublicTypeParametersWithoutExtends = /** @class */ (function () { function publicClassWithWithPublicTypeParametersWithoutExtends() { } publicClassWithWithPublicTypeParametersWithoutExtends.myPublicStaticMethod = function () { @@ -797,7 +797,7 @@ var privateModule; return publicClassWithWithPublicTypeParametersWithoutExtends; }()); privateModule.publicClassWithWithPublicTypeParametersWithoutExtends = publicClassWithWithPublicTypeParametersWithoutExtends; - var privateClassWithWithPublicTypeParametersWithoutExtends = (function () { + var privateClassWithWithPublicTypeParametersWithoutExtends = /** @class */ (function () { function privateClassWithWithPublicTypeParametersWithoutExtends() { } privateClassWithWithPublicTypeParametersWithoutExtends.myPublicStaticMethod = function () { diff --git a/tests/baselines/reference/privacyTypeParametersOfClass.js b/tests/baselines/reference/privacyTypeParametersOfClass.js index ba1a9bd10e07a..879698f203e62 100644 --- a/tests/baselines/reference/privacyTypeParametersOfClass.js +++ b/tests/baselines/reference/privacyTypeParametersOfClass.js @@ -46,19 +46,19 @@ class privateClassWithPublicTypeParametersWithoutExtends { //// [privacyTypeParametersOfClass.js] "use strict"; exports.__esModule = true; -var privateClass = (function () { +var privateClass = /** @class */ (function () { function privateClass() { } return privateClass; }()); -var publicClass = (function () { +var publicClass = /** @class */ (function () { function publicClass() { } return publicClass; }()); exports.publicClass = publicClass; // TypeParameter_0_of_exported_class_1_has_or_is_using_private_type_2 -var publicClassWithPrivateTypeParameters = (function () { +var publicClassWithPrivateTypeParameters = /** @class */ (function () { function publicClassWithPrivateTypeParameters() { } publicClassWithPrivateTypeParameters.prototype.myMethod = function (val) { @@ -67,7 +67,7 @@ var publicClassWithPrivateTypeParameters = (function () { return publicClassWithPrivateTypeParameters; }()); exports.publicClassWithPrivateTypeParameters = publicClassWithPrivateTypeParameters; -var publicClassWithPublicTypeParameters = (function () { +var publicClassWithPublicTypeParameters = /** @class */ (function () { function publicClassWithPublicTypeParameters() { } publicClassWithPublicTypeParameters.prototype.myMethod = function (val) { @@ -76,7 +76,7 @@ var publicClassWithPublicTypeParameters = (function () { return publicClassWithPublicTypeParameters; }()); exports.publicClassWithPublicTypeParameters = publicClassWithPublicTypeParameters; -var privateClassWithPrivateTypeParameters = (function () { +var privateClassWithPrivateTypeParameters = /** @class */ (function () { function privateClassWithPrivateTypeParameters() { } privateClassWithPrivateTypeParameters.prototype.myMethod = function (val) { @@ -84,7 +84,7 @@ var privateClassWithPrivateTypeParameters = (function () { }; return privateClassWithPrivateTypeParameters; }()); -var privateClassWithPublicTypeParameters = (function () { +var privateClassWithPublicTypeParameters = /** @class */ (function () { function privateClassWithPublicTypeParameters() { } privateClassWithPublicTypeParameters.prototype.myMethod = function (val) { @@ -92,7 +92,7 @@ var privateClassWithPublicTypeParameters = (function () { }; return privateClassWithPublicTypeParameters; }()); -var publicClassWithPublicTypeParametersWithoutExtends = (function () { +var publicClassWithPublicTypeParametersWithoutExtends = /** @class */ (function () { function publicClassWithPublicTypeParametersWithoutExtends() { } publicClassWithPublicTypeParametersWithoutExtends.prototype.myMethod = function (val) { @@ -101,7 +101,7 @@ var publicClassWithPublicTypeParametersWithoutExtends = (function () { return publicClassWithPublicTypeParametersWithoutExtends; }()); exports.publicClassWithPublicTypeParametersWithoutExtends = publicClassWithPublicTypeParametersWithoutExtends; -var privateClassWithPublicTypeParametersWithoutExtends = (function () { +var privateClassWithPublicTypeParametersWithoutExtends = /** @class */ (function () { function privateClassWithPublicTypeParametersWithoutExtends() { } privateClassWithPublicTypeParametersWithoutExtends.prototype.myMethod = function (val) { diff --git a/tests/baselines/reference/privacyTypeParametersOfClassDeclFile.js b/tests/baselines/reference/privacyTypeParametersOfClassDeclFile.js index 8e21589de4229..e8ec8606bc57c 100644 --- a/tests/baselines/reference/privacyTypeParametersOfClassDeclFile.js +++ b/tests/baselines/reference/privacyTypeParametersOfClassDeclFile.js @@ -157,18 +157,18 @@ module privateModule { //// [privacyTypeParametersOfClassDeclFile.js] "use strict"; exports.__esModule = true; -var privateClass = (function () { +var privateClass = /** @class */ (function () { function privateClass() { } return privateClass; }()); -var publicClass = (function () { +var publicClass = /** @class */ (function () { function publicClass() { } return publicClass; }()); exports.publicClass = publicClass; -var publicClassWithPrivateTypeParameters = (function () { +var publicClassWithPrivateTypeParameters = /** @class */ (function () { function publicClassWithPrivateTypeParameters() { } publicClassWithPrivateTypeParameters.prototype.myMethod = function (val) { @@ -177,7 +177,7 @@ var publicClassWithPrivateTypeParameters = (function () { return publicClassWithPrivateTypeParameters; }()); exports.publicClassWithPrivateTypeParameters = publicClassWithPrivateTypeParameters; -var publicClassWithPublicTypeParameters = (function () { +var publicClassWithPublicTypeParameters = /** @class */ (function () { function publicClassWithPublicTypeParameters() { } publicClassWithPublicTypeParameters.prototype.myMethod = function (val) { @@ -186,7 +186,7 @@ var publicClassWithPublicTypeParameters = (function () { return publicClassWithPublicTypeParameters; }()); exports.publicClassWithPublicTypeParameters = publicClassWithPublicTypeParameters; -var privateClassWithPrivateTypeParameters = (function () { +var privateClassWithPrivateTypeParameters = /** @class */ (function () { function privateClassWithPrivateTypeParameters() { } privateClassWithPrivateTypeParameters.prototype.myMethod = function (val) { @@ -194,7 +194,7 @@ var privateClassWithPrivateTypeParameters = (function () { }; return privateClassWithPrivateTypeParameters; }()); -var privateClassWithPublicTypeParameters = (function () { +var privateClassWithPublicTypeParameters = /** @class */ (function () { function privateClassWithPublicTypeParameters() { } privateClassWithPublicTypeParameters.prototype.myMethod = function (val) { @@ -202,7 +202,7 @@ var privateClassWithPublicTypeParameters = (function () { }; return privateClassWithPublicTypeParameters; }()); -var publicClassWithPublicTypeParametersWithoutExtends = (function () { +var publicClassWithPublicTypeParametersWithoutExtends = /** @class */ (function () { function publicClassWithPublicTypeParametersWithoutExtends() { } publicClassWithPublicTypeParametersWithoutExtends.prototype.myMethod = function (val) { @@ -211,7 +211,7 @@ var publicClassWithPublicTypeParametersWithoutExtends = (function () { return publicClassWithPublicTypeParametersWithoutExtends; }()); exports.publicClassWithPublicTypeParametersWithoutExtends = publicClassWithPublicTypeParametersWithoutExtends; -var privateClassWithPublicTypeParametersWithoutExtends = (function () { +var privateClassWithPublicTypeParametersWithoutExtends = /** @class */ (function () { function privateClassWithPublicTypeParametersWithoutExtends() { } privateClassWithPublicTypeParametersWithoutExtends.prototype.myMethod = function (val) { @@ -219,7 +219,7 @@ var privateClassWithPublicTypeParametersWithoutExtends = (function () { }; return privateClassWithPublicTypeParametersWithoutExtends; }()); -var publicClassWithTypeParametersFromPrivateModule = (function () { +var publicClassWithTypeParametersFromPrivateModule = /** @class */ (function () { function publicClassWithTypeParametersFromPrivateModule() { } publicClassWithTypeParametersFromPrivateModule.prototype.myMethod = function (val) { @@ -228,7 +228,7 @@ var publicClassWithTypeParametersFromPrivateModule = (function () { return publicClassWithTypeParametersFromPrivateModule; }()); exports.publicClassWithTypeParametersFromPrivateModule = publicClassWithTypeParametersFromPrivateModule; -var privateClassWithTypeParametersFromPrivateModule = (function () { +var privateClassWithTypeParametersFromPrivateModule = /** @class */ (function () { function privateClassWithTypeParametersFromPrivateModule() { } privateClassWithTypeParametersFromPrivateModule.prototype.myMethod = function (val) { @@ -238,18 +238,18 @@ var privateClassWithTypeParametersFromPrivateModule = (function () { }()); var publicModule; (function (publicModule) { - var privateClassInPublicModule = (function () { + var privateClassInPublicModule = /** @class */ (function () { function privateClassInPublicModule() { } return privateClassInPublicModule; }()); - var publicClassInPublicModule = (function () { + var publicClassInPublicModule = /** @class */ (function () { function publicClassInPublicModule() { } return publicClassInPublicModule; }()); publicModule.publicClassInPublicModule = publicClassInPublicModule; - var publicClassWithPrivateTypeParameters = (function () { + var publicClassWithPrivateTypeParameters = /** @class */ (function () { function publicClassWithPrivateTypeParameters() { } publicClassWithPrivateTypeParameters.prototype.myMethod = function (val) { @@ -258,7 +258,7 @@ var publicModule; return publicClassWithPrivateTypeParameters; }()); publicModule.publicClassWithPrivateTypeParameters = publicClassWithPrivateTypeParameters; - var publicClassWithPublicTypeParameters = (function () { + var publicClassWithPublicTypeParameters = /** @class */ (function () { function publicClassWithPublicTypeParameters() { } publicClassWithPublicTypeParameters.prototype.myMethod = function (val) { @@ -267,7 +267,7 @@ var publicModule; return publicClassWithPublicTypeParameters; }()); publicModule.publicClassWithPublicTypeParameters = publicClassWithPublicTypeParameters; - var privateClassWithPrivateTypeParameters = (function () { + var privateClassWithPrivateTypeParameters = /** @class */ (function () { function privateClassWithPrivateTypeParameters() { } privateClassWithPrivateTypeParameters.prototype.myMethod = function (val) { @@ -275,7 +275,7 @@ var publicModule; }; return privateClassWithPrivateTypeParameters; }()); - var privateClassWithPublicTypeParameters = (function () { + var privateClassWithPublicTypeParameters = /** @class */ (function () { function privateClassWithPublicTypeParameters() { } privateClassWithPublicTypeParameters.prototype.myMethod = function (val) { @@ -283,7 +283,7 @@ var publicModule; }; return privateClassWithPublicTypeParameters; }()); - var publicClassWithPublicTypeParametersWithoutExtends = (function () { + var publicClassWithPublicTypeParametersWithoutExtends = /** @class */ (function () { function publicClassWithPublicTypeParametersWithoutExtends() { } publicClassWithPublicTypeParametersWithoutExtends.prototype.myMethod = function (val) { @@ -292,7 +292,7 @@ var publicModule; return publicClassWithPublicTypeParametersWithoutExtends; }()); publicModule.publicClassWithPublicTypeParametersWithoutExtends = publicClassWithPublicTypeParametersWithoutExtends; - var privateClassWithPublicTypeParametersWithoutExtends = (function () { + var privateClassWithPublicTypeParametersWithoutExtends = /** @class */ (function () { function privateClassWithPublicTypeParametersWithoutExtends() { } privateClassWithPublicTypeParametersWithoutExtends.prototype.myMethod = function (val) { @@ -300,7 +300,7 @@ var publicModule; }; return privateClassWithPublicTypeParametersWithoutExtends; }()); - var publicClassWithTypeParametersFromPrivateModule = (function () { + var publicClassWithTypeParametersFromPrivateModule = /** @class */ (function () { function publicClassWithTypeParametersFromPrivateModule() { } publicClassWithTypeParametersFromPrivateModule.prototype.myMethod = function (val) { @@ -309,7 +309,7 @@ var publicModule; return publicClassWithTypeParametersFromPrivateModule; }()); publicModule.publicClassWithTypeParametersFromPrivateModule = publicClassWithTypeParametersFromPrivateModule; - var privateClassWithTypeParametersFromPrivateModule = (function () { + var privateClassWithTypeParametersFromPrivateModule = /** @class */ (function () { function privateClassWithTypeParametersFromPrivateModule() { } privateClassWithTypeParametersFromPrivateModule.prototype.myMethod = function (val) { @@ -320,18 +320,18 @@ var publicModule; })(publicModule = exports.publicModule || (exports.publicModule = {})); var privateModule; (function (privateModule) { - var privateClassInPrivateModule = (function () { + var privateClassInPrivateModule = /** @class */ (function () { function privateClassInPrivateModule() { } return privateClassInPrivateModule; }()); - var publicClassInPrivateModule = (function () { + var publicClassInPrivateModule = /** @class */ (function () { function publicClassInPrivateModule() { } return publicClassInPrivateModule; }()); privateModule.publicClassInPrivateModule = publicClassInPrivateModule; - var publicClassWithPrivateTypeParameters = (function () { + var publicClassWithPrivateTypeParameters = /** @class */ (function () { function publicClassWithPrivateTypeParameters() { } publicClassWithPrivateTypeParameters.prototype.myMethod = function (val) { @@ -340,7 +340,7 @@ var privateModule; return publicClassWithPrivateTypeParameters; }()); privateModule.publicClassWithPrivateTypeParameters = publicClassWithPrivateTypeParameters; - var publicClassWithPublicTypeParameters = (function () { + var publicClassWithPublicTypeParameters = /** @class */ (function () { function publicClassWithPublicTypeParameters() { } publicClassWithPublicTypeParameters.prototype.myMethod = function (val) { @@ -349,7 +349,7 @@ var privateModule; return publicClassWithPublicTypeParameters; }()); privateModule.publicClassWithPublicTypeParameters = publicClassWithPublicTypeParameters; - var privateClassWithPrivateTypeParameters = (function () { + var privateClassWithPrivateTypeParameters = /** @class */ (function () { function privateClassWithPrivateTypeParameters() { } privateClassWithPrivateTypeParameters.prototype.myMethod = function (val) { @@ -357,7 +357,7 @@ var privateModule; }; return privateClassWithPrivateTypeParameters; }()); - var privateClassWithPublicTypeParameters = (function () { + var privateClassWithPublicTypeParameters = /** @class */ (function () { function privateClassWithPublicTypeParameters() { } privateClassWithPublicTypeParameters.prototype.myMethod = function (val) { @@ -365,7 +365,7 @@ var privateModule; }; return privateClassWithPublicTypeParameters; }()); - var publicClassWithPublicTypeParametersWithoutExtends = (function () { + var publicClassWithPublicTypeParametersWithoutExtends = /** @class */ (function () { function publicClassWithPublicTypeParametersWithoutExtends() { } publicClassWithPublicTypeParametersWithoutExtends.prototype.myMethod = function (val) { @@ -374,7 +374,7 @@ var privateModule; return publicClassWithPublicTypeParametersWithoutExtends; }()); privateModule.publicClassWithPublicTypeParametersWithoutExtends = publicClassWithPublicTypeParametersWithoutExtends; - var privateClassWithPublicTypeParametersWithoutExtends = (function () { + var privateClassWithPublicTypeParametersWithoutExtends = /** @class */ (function () { function privateClassWithPublicTypeParametersWithoutExtends() { } privateClassWithPublicTypeParametersWithoutExtends.prototype.myMethod = function (val) { diff --git a/tests/baselines/reference/privacyTypeParametersOfInterface.js b/tests/baselines/reference/privacyTypeParametersOfInterface.js index 0b511a01f06d9..d0bbbc9b3dec2 100644 --- a/tests/baselines/reference/privacyTypeParametersOfInterface.js +++ b/tests/baselines/reference/privacyTypeParametersOfInterface.js @@ -61,23 +61,23 @@ interface privateInterfaceWithPublicTypeParametersWithoutExtends { //// [privacyTypeParametersOfInterface.js] "use strict"; exports.__esModule = true; -var privateClass = (function () { +var privateClass = /** @class */ (function () { function privateClass() { } return privateClass; }()); -var publicClass = (function () { +var publicClass = /** @class */ (function () { function publicClass() { } return publicClass; }()); exports.publicClass = publicClass; -var privateClassT = (function () { +var privateClassT = /** @class */ (function () { function privateClassT() { } return privateClassT; }()); -var publicClassT = (function () { +var publicClassT = /** @class */ (function () { function publicClassT() { } return publicClassT; diff --git a/tests/baselines/reference/privacyTypeParametersOfInterfaceDeclFile.js b/tests/baselines/reference/privacyTypeParametersOfInterfaceDeclFile.js index f7d107b5855fb..bb73f447dd6b5 100644 --- a/tests/baselines/reference/privacyTypeParametersOfInterfaceDeclFile.js +++ b/tests/baselines/reference/privacyTypeParametersOfInterfaceDeclFile.js @@ -193,23 +193,23 @@ module privateModule { //// [privacyTypeParametersOfInterfaceDeclFile.js] "use strict"; exports.__esModule = true; -var privateClass = (function () { +var privateClass = /** @class */ (function () { function privateClass() { } return privateClass; }()); -var publicClass = (function () { +var publicClass = /** @class */ (function () { function publicClass() { } return publicClass; }()); exports.publicClass = publicClass; -var privateClassT = (function () { +var privateClassT = /** @class */ (function () { function privateClassT() { } return privateClassT; }()); -var publicClassT = (function () { +var publicClassT = /** @class */ (function () { function publicClassT() { } return publicClassT; @@ -217,23 +217,23 @@ var publicClassT = (function () { exports.publicClassT = publicClassT; var publicModule; (function (publicModule) { - var privateClassInPublicModule = (function () { + var privateClassInPublicModule = /** @class */ (function () { function privateClassInPublicModule() { } return privateClassInPublicModule; }()); - var publicClassInPublicModule = (function () { + var publicClassInPublicModule = /** @class */ (function () { function publicClassInPublicModule() { } return publicClassInPublicModule; }()); publicModule.publicClassInPublicModule = publicClassInPublicModule; - var privateClassInPublicModuleT = (function () { + var privateClassInPublicModuleT = /** @class */ (function () { function privateClassInPublicModuleT() { } return privateClassInPublicModuleT; }()); - var publicClassInPublicModuleT = (function () { + var publicClassInPublicModuleT = /** @class */ (function () { function publicClassInPublicModuleT() { } return publicClassInPublicModuleT; @@ -242,23 +242,23 @@ var publicModule; })(publicModule = exports.publicModule || (exports.publicModule = {})); var privateModule; (function (privateModule) { - var privateClassInPrivateModule = (function () { + var privateClassInPrivateModule = /** @class */ (function () { function privateClassInPrivateModule() { } return privateClassInPrivateModule; }()); - var publicClassInPrivateModule = (function () { + var publicClassInPrivateModule = /** @class */ (function () { function publicClassInPrivateModule() { } return publicClassInPrivateModule; }()); privateModule.publicClassInPrivateModule = publicClassInPrivateModule; - var privateClassInPrivateModuleT = (function () { + var privateClassInPrivateModuleT = /** @class */ (function () { function privateClassInPrivateModuleT() { } return privateClassInPrivateModuleT; }()); - var publicClassInPrivateModuleT = (function () { + var publicClassInPrivateModuleT = /** @class */ (function () { function publicClassInPrivateModuleT() { } return publicClassInPrivateModuleT; diff --git a/tests/baselines/reference/privacyVar.js b/tests/baselines/reference/privacyVar.js index 4c97d273c3e98..ccaf7e1f1b70b 100644 --- a/tests/baselines/reference/privacyVar.js +++ b/tests/baselines/reference/privacyVar.js @@ -179,7 +179,7 @@ export var glo_v24_public: glo_C2_private = new glo_C2_private(); // error exports.__esModule = true; var m1; (function (m1) { - var C1_public = (function () { + var C1_public = /** @class */ (function () { function C1_public() { } C1_public.prototype.f1 = function () { @@ -187,12 +187,12 @@ var m1; return C1_public; }()); m1.C1_public = C1_public; - var C2_private = (function () { + var C2_private = /** @class */ (function () { function C2_private() { } return C2_private; }()); - var C3_public = (function () { + var C3_public = /** @class */ (function () { function C3_public() { this.C3_v11_private = new C1_public(); this.C3_v12_public = new C1_public(); @@ -206,7 +206,7 @@ var m1; return C3_public; }()); m1.C3_public = C3_public; - var C4_public = (function () { + var C4_public = /** @class */ (function () { function C4_public() { this.C4_v11_private = new C1_public(); this.C4_v12_public = new C1_public(); @@ -232,7 +232,7 @@ var m1; })(m1 = exports.m1 || (exports.m1 = {})); var m2; (function (m2) { - var m2_C1_public = (function () { + var m2_C1_public = /** @class */ (function () { function m2_C1_public() { } m2_C1_public.prototype.f1 = function () { @@ -240,12 +240,12 @@ var m2; return m2_C1_public; }()); m2.m2_C1_public = m2_C1_public; - var m2_C2_private = (function () { + var m2_C2_private = /** @class */ (function () { function m2_C2_private() { } return m2_C2_private; }()); - var m2_C3_public = (function () { + var m2_C3_public = /** @class */ (function () { function m2_C3_public() { this.m2_C3_v11_private = new m2_C1_public(); this.m2_C3_v12_public = new m2_C1_public(); @@ -259,7 +259,7 @@ var m2; return m2_C3_public; }()); m2.m2_C3_public = m2_C3_public; - var m2_C4_public = (function () { + var m2_C4_public = /** @class */ (function () { function m2_C4_public() { this.m2_C4_v11_private = new m2_C1_public(); this.m2_C4_v12_public = new m2_C1_public(); @@ -283,7 +283,7 @@ var m2; var m2_v23_private = new m2_C2_private(); m2.m2_v24_public = new m2_C2_private(); })(m2 || (m2 = {})); -var glo_C1_public = (function () { +var glo_C1_public = /** @class */ (function () { function glo_C1_public() { } glo_C1_public.prototype.f1 = function () { @@ -291,12 +291,12 @@ var glo_C1_public = (function () { return glo_C1_public; }()); exports.glo_C1_public = glo_C1_public; -var glo_C2_private = (function () { +var glo_C2_private = /** @class */ (function () { function glo_C2_private() { } return glo_C2_private; }()); -var glo_C3_public = (function () { +var glo_C3_public = /** @class */ (function () { function glo_C3_public() { this.glo_C3_v11_private = new glo_C1_public(); this.glo_C3_v12_public = new glo_C1_public(); @@ -310,7 +310,7 @@ var glo_C3_public = (function () { return glo_C3_public; }()); exports.glo_C3_public = glo_C3_public; -var glo_C4_public = (function () { +var glo_C4_public = /** @class */ (function () { function glo_C4_public() { this.glo_C4_v11_private = new glo_C1_public(); this.glo_C4_v12_public = new glo_C1_public(); diff --git a/tests/baselines/reference/privacyVarDeclFile.js b/tests/baselines/reference/privacyVarDeclFile.js index b32fac91085d9..82f3529f41bb7 100644 --- a/tests/baselines/reference/privacyVarDeclFile.js +++ b/tests/baselines/reference/privacyVarDeclFile.js @@ -427,48 +427,48 @@ module publicModuleInGlobal { //// [privacyVarDeclFile_externalModule.js] "use strict"; exports.__esModule = true; -var privateClass = (function () { +var privateClass = /** @class */ (function () { function privateClass() { } return privateClass; }()); -var publicClass = (function () { +var publicClass = /** @class */ (function () { function publicClass() { } return publicClass; }()); exports.publicClass = publicClass; -var publicClassWithWithPrivatePropertyTypes = (function () { +var publicClassWithWithPrivatePropertyTypes = /** @class */ (function () { function publicClassWithWithPrivatePropertyTypes() { } return publicClassWithWithPrivatePropertyTypes; }()); exports.publicClassWithWithPrivatePropertyTypes = publicClassWithWithPrivatePropertyTypes; -var publicClassWithWithPublicPropertyTypes = (function () { +var publicClassWithWithPublicPropertyTypes = /** @class */ (function () { function publicClassWithWithPublicPropertyTypes() { } return publicClassWithWithPublicPropertyTypes; }()); exports.publicClassWithWithPublicPropertyTypes = publicClassWithWithPublicPropertyTypes; -var privateClassWithWithPrivatePropertyTypes = (function () { +var privateClassWithWithPrivatePropertyTypes = /** @class */ (function () { function privateClassWithWithPrivatePropertyTypes() { } return privateClassWithWithPrivatePropertyTypes; }()); -var privateClassWithWithPublicPropertyTypes = (function () { +var privateClassWithWithPublicPropertyTypes = /** @class */ (function () { function privateClassWithWithPublicPropertyTypes() { } return privateClassWithWithPublicPropertyTypes; }()); var privateVarWithPrivatePropertyTypes; var privateVarWithPublicPropertyTypes; -var publicClassWithPrivateModulePropertyTypes = (function () { +var publicClassWithPrivateModulePropertyTypes = /** @class */ (function () { function publicClassWithPrivateModulePropertyTypes() { } return publicClassWithPrivateModulePropertyTypes; }()); exports.publicClassWithPrivateModulePropertyTypes = publicClassWithPrivateModulePropertyTypes; -var privateClassWithPrivateModulePropertyTypes = (function () { +var privateClassWithPrivateModulePropertyTypes = /** @class */ (function () { function privateClassWithPrivateModulePropertyTypes() { } return privateClassWithPrivateModulePropertyTypes; @@ -476,48 +476,48 @@ var privateClassWithPrivateModulePropertyTypes = (function () { var privateVarWithPrivateModulePropertyTypes; var publicModule; (function (publicModule) { - var privateClass = (function () { + var privateClass = /** @class */ (function () { function privateClass() { } return privateClass; }()); - var publicClass = (function () { + var publicClass = /** @class */ (function () { function publicClass() { } return publicClass; }()); publicModule.publicClass = publicClass; - var publicClassWithWithPrivatePropertyTypes = (function () { + var publicClassWithWithPrivatePropertyTypes = /** @class */ (function () { function publicClassWithWithPrivatePropertyTypes() { } return publicClassWithWithPrivatePropertyTypes; }()); publicModule.publicClassWithWithPrivatePropertyTypes = publicClassWithWithPrivatePropertyTypes; - var publicClassWithWithPublicPropertyTypes = (function () { + var publicClassWithWithPublicPropertyTypes = /** @class */ (function () { function publicClassWithWithPublicPropertyTypes() { } return publicClassWithWithPublicPropertyTypes; }()); publicModule.publicClassWithWithPublicPropertyTypes = publicClassWithWithPublicPropertyTypes; - var privateClassWithWithPrivatePropertyTypes = (function () { + var privateClassWithWithPrivatePropertyTypes = /** @class */ (function () { function privateClassWithWithPrivatePropertyTypes() { } return privateClassWithWithPrivatePropertyTypes; }()); - var privateClassWithWithPublicPropertyTypes = (function () { + var privateClassWithWithPublicPropertyTypes = /** @class */ (function () { function privateClassWithWithPublicPropertyTypes() { } return privateClassWithWithPublicPropertyTypes; }()); var privateVarWithPrivatePropertyTypes; var privateVarWithPublicPropertyTypes; - var publicClassWithPrivateModulePropertyTypes = (function () { + var publicClassWithPrivateModulePropertyTypes = /** @class */ (function () { function publicClassWithPrivateModulePropertyTypes() { } return publicClassWithPrivateModulePropertyTypes; }()); publicModule.publicClassWithPrivateModulePropertyTypes = publicClassWithPrivateModulePropertyTypes; - var privateClassWithPrivateModulePropertyTypes = (function () { + var privateClassWithPrivateModulePropertyTypes = /** @class */ (function () { function privateClassWithPrivateModulePropertyTypes() { } return privateClassWithPrivateModulePropertyTypes; @@ -526,48 +526,48 @@ var publicModule; })(publicModule = exports.publicModule || (exports.publicModule = {})); var privateModule; (function (privateModule) { - var privateClass = (function () { + var privateClass = /** @class */ (function () { function privateClass() { } return privateClass; }()); - var publicClass = (function () { + var publicClass = /** @class */ (function () { function publicClass() { } return publicClass; }()); privateModule.publicClass = publicClass; - var publicClassWithWithPrivatePropertyTypes = (function () { + var publicClassWithWithPrivatePropertyTypes = /** @class */ (function () { function publicClassWithWithPrivatePropertyTypes() { } return publicClassWithWithPrivatePropertyTypes; }()); privateModule.publicClassWithWithPrivatePropertyTypes = publicClassWithWithPrivatePropertyTypes; - var publicClassWithWithPublicPropertyTypes = (function () { + var publicClassWithWithPublicPropertyTypes = /** @class */ (function () { function publicClassWithWithPublicPropertyTypes() { } return publicClassWithWithPublicPropertyTypes; }()); privateModule.publicClassWithWithPublicPropertyTypes = publicClassWithWithPublicPropertyTypes; - var privateClassWithWithPrivatePropertyTypes = (function () { + var privateClassWithWithPrivatePropertyTypes = /** @class */ (function () { function privateClassWithWithPrivatePropertyTypes() { } return privateClassWithWithPrivatePropertyTypes; }()); - var privateClassWithWithPublicPropertyTypes = (function () { + var privateClassWithWithPublicPropertyTypes = /** @class */ (function () { function privateClassWithWithPublicPropertyTypes() { } return privateClassWithWithPublicPropertyTypes; }()); var privateVarWithPrivatePropertyTypes; var privateVarWithPublicPropertyTypes; - var publicClassWithPrivateModulePropertyTypes = (function () { + var publicClassWithPrivateModulePropertyTypes = /** @class */ (function () { function publicClassWithPrivateModulePropertyTypes() { } return publicClassWithPrivateModulePropertyTypes; }()); privateModule.publicClassWithPrivateModulePropertyTypes = publicClassWithPrivateModulePropertyTypes; - var privateClassWithPrivateModulePropertyTypes = (function () { + var privateClassWithPrivateModulePropertyTypes = /** @class */ (function () { function privateClassWithPrivateModulePropertyTypes() { } return privateClassWithPrivateModulePropertyTypes; @@ -575,12 +575,12 @@ var privateModule; var privateVarWithPrivateModulePropertyTypes; })(privateModule || (privateModule = {})); //// [privacyVarDeclFile_GlobalFile.js] -var publicClassInGlobal = (function () { +var publicClassInGlobal = /** @class */ (function () { function publicClassInGlobal() { } return publicClassInGlobal; }()); -var publicClassWithWithPublicPropertyTypesInGlobal = (function () { +var publicClassWithWithPublicPropertyTypesInGlobal = /** @class */ (function () { function publicClassWithWithPublicPropertyTypesInGlobal() { } return publicClassWithWithPublicPropertyTypesInGlobal; @@ -588,12 +588,12 @@ var publicClassWithWithPublicPropertyTypesInGlobal = (function () { var publicVarWithPublicPropertyTypesInGlobal; var publicModuleInGlobal; (function (publicModuleInGlobal) { - var privateClass = (function () { + var privateClass = /** @class */ (function () { function privateClass() { } return privateClass; }()); - var publicClass = (function () { + var publicClass = /** @class */ (function () { function publicClass() { } return publicClass; @@ -601,85 +601,85 @@ var publicModuleInGlobal; publicModuleInGlobal.publicClass = publicClass; var privateModule; (function (privateModule) { - var privateClass = (function () { + var privateClass = /** @class */ (function () { function privateClass() { } return privateClass; }()); - var publicClass = (function () { + var publicClass = /** @class */ (function () { function publicClass() { } return publicClass; }()); privateModule.publicClass = publicClass; - var publicClassWithWithPrivatePropertyTypes = (function () { + var publicClassWithWithPrivatePropertyTypes = /** @class */ (function () { function publicClassWithWithPrivatePropertyTypes() { } return publicClassWithWithPrivatePropertyTypes; }()); privateModule.publicClassWithWithPrivatePropertyTypes = publicClassWithWithPrivatePropertyTypes; - var publicClassWithWithPublicPropertyTypes = (function () { + var publicClassWithWithPublicPropertyTypes = /** @class */ (function () { function publicClassWithWithPublicPropertyTypes() { } return publicClassWithWithPublicPropertyTypes; }()); privateModule.publicClassWithWithPublicPropertyTypes = publicClassWithWithPublicPropertyTypes; - var privateClassWithWithPrivatePropertyTypes = (function () { + var privateClassWithWithPrivatePropertyTypes = /** @class */ (function () { function privateClassWithWithPrivatePropertyTypes() { } return privateClassWithWithPrivatePropertyTypes; }()); - var privateClassWithWithPublicPropertyTypes = (function () { + var privateClassWithWithPublicPropertyTypes = /** @class */ (function () { function privateClassWithWithPublicPropertyTypes() { } return privateClassWithWithPublicPropertyTypes; }()); var privateVarWithPrivatePropertyTypes; var privateVarWithPublicPropertyTypes; - var publicClassWithPrivateModulePropertyTypes = (function () { + var publicClassWithPrivateModulePropertyTypes = /** @class */ (function () { function publicClassWithPrivateModulePropertyTypes() { } return publicClassWithPrivateModulePropertyTypes; }()); privateModule.publicClassWithPrivateModulePropertyTypes = publicClassWithPrivateModulePropertyTypes; - var privateClassWithPrivateModulePropertyTypes = (function () { + var privateClassWithPrivateModulePropertyTypes = /** @class */ (function () { function privateClassWithPrivateModulePropertyTypes() { } return privateClassWithPrivateModulePropertyTypes; }()); var privateVarWithPrivateModulePropertyTypes; })(privateModule || (privateModule = {})); - var publicClassWithWithPrivatePropertyTypes = (function () { + var publicClassWithWithPrivatePropertyTypes = /** @class */ (function () { function publicClassWithWithPrivatePropertyTypes() { } return publicClassWithWithPrivatePropertyTypes; }()); publicModuleInGlobal.publicClassWithWithPrivatePropertyTypes = publicClassWithWithPrivatePropertyTypes; - var publicClassWithWithPublicPropertyTypes = (function () { + var publicClassWithWithPublicPropertyTypes = /** @class */ (function () { function publicClassWithWithPublicPropertyTypes() { } return publicClassWithWithPublicPropertyTypes; }()); publicModuleInGlobal.publicClassWithWithPublicPropertyTypes = publicClassWithWithPublicPropertyTypes; - var privateClassWithWithPrivatePropertyTypes = (function () { + var privateClassWithWithPrivatePropertyTypes = /** @class */ (function () { function privateClassWithWithPrivatePropertyTypes() { } return privateClassWithWithPrivatePropertyTypes; }()); - var privateClassWithWithPublicPropertyTypes = (function () { + var privateClassWithWithPublicPropertyTypes = /** @class */ (function () { function privateClassWithWithPublicPropertyTypes() { } return privateClassWithWithPublicPropertyTypes; }()); var privateVarWithPrivatePropertyTypes; var privateVarWithPublicPropertyTypes; - var publicClassWithPrivateModulePropertyTypes = (function () { + var publicClassWithPrivateModulePropertyTypes = /** @class */ (function () { function publicClassWithPrivateModulePropertyTypes() { } return publicClassWithPrivateModulePropertyTypes; }()); publicModuleInGlobal.publicClassWithPrivateModulePropertyTypes = publicClassWithPrivateModulePropertyTypes; - var privateClassWithPrivateModulePropertyTypes = (function () { + var privateClassWithPrivateModulePropertyTypes = /** @class */ (function () { function privateClassWithPrivateModulePropertyTypes() { } return privateClassWithPrivateModulePropertyTypes; diff --git a/tests/baselines/reference/privateAccessInSubclass1.js b/tests/baselines/reference/privateAccessInSubclass1.js index bab68b8d67ea3..8d10b16dea33d 100644 --- a/tests/baselines/reference/privateAccessInSubclass1.js +++ b/tests/baselines/reference/privateAccessInSubclass1.js @@ -20,12 +20,12 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var Base = (function () { +var Base = /** @class */ (function () { function Base() { } return Base; }()); -var D = (function (_super) { +var D = /** @class */ (function (_super) { __extends(D, _super); function D() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/privateClassPropertyAccessibleWithinClass.js b/tests/baselines/reference/privateClassPropertyAccessibleWithinClass.js index 1a4ac4b167975..9a1e95c2f52c7 100644 --- a/tests/baselines/reference/privateClassPropertyAccessibleWithinClass.js +++ b/tests/baselines/reference/privateClassPropertyAccessibleWithinClass.js @@ -33,7 +33,7 @@ class C2 { //// [privateClassPropertyAccessibleWithinClass.js] // no errors -var C = (function () { +var C = /** @class */ (function () { function C() { } Object.defineProperty(C.prototype, "y", { @@ -54,7 +54,7 @@ var C = (function () { return C; }()); // added level of function nesting -var C2 = (function () { +var C2 = /** @class */ (function () { function C2() { } Object.defineProperty(C2.prototype, "y", { diff --git a/tests/baselines/reference/privateClassPropertyAccessibleWithinNestedClass.js b/tests/baselines/reference/privateClassPropertyAccessibleWithinNestedClass.js index 3bb0a7da3ea37..b915d541049c9 100644 --- a/tests/baselines/reference/privateClassPropertyAccessibleWithinNestedClass.js +++ b/tests/baselines/reference/privateClassPropertyAccessibleWithinNestedClass.js @@ -39,7 +39,7 @@ class C { //// [privateClassPropertyAccessibleWithinNestedClass.js] // no errors -var C = (function () { +var C = /** @class */ (function () { function C() { } Object.defineProperty(C.prototype, "y", { @@ -58,7 +58,7 @@ var C = (function () { C.foo = function () { return this.foo; }; C.bar = function () { this.foo(); }; C.prototype.bar = function () { - var C2 = (function () { + var C2 = /** @class */ (function () { function C2() { } C2.prototype.foo = function () { diff --git a/tests/baselines/reference/privateIndexer.js b/tests/baselines/reference/privateIndexer.js index 8e6fefdbc0924..90acc51f18cdc 100644 --- a/tests/baselines/reference/privateIndexer.js +++ b/tests/baselines/reference/privateIndexer.js @@ -15,17 +15,17 @@ class E { //// [privateIndexer.js] // private indexers not allowed -var C = (function () { +var C = /** @class */ (function () { function C() { } return C; }()); -var D = (function () { +var D = /** @class */ (function () { function D() { } return D; }()); -var E = (function () { +var E = /** @class */ (function () { function E() { } return E; diff --git a/tests/baselines/reference/privateInstanceMemberAccessibility.js b/tests/baselines/reference/privateInstanceMemberAccessibility.js index 8448f142bbb9c..1b548a98f23a9 100644 --- a/tests/baselines/reference/privateInstanceMemberAccessibility.js +++ b/tests/baselines/reference/privateInstanceMemberAccessibility.js @@ -24,12 +24,12 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var Base = (function () { +var Base = /** @class */ (function () { function Base() { } return Base; }()); -var Derived = (function (_super) { +var Derived = /** @class */ (function (_super) { __extends(Derived, _super); function Derived() { var _this = _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/privateInstanceVisibility.js b/tests/baselines/reference/privateInstanceVisibility.js index 86d9d42623697..51291447d3375 100644 --- a/tests/baselines/reference/privateInstanceVisibility.js +++ b/tests/baselines/reference/privateInstanceVisibility.js @@ -41,7 +41,7 @@ class C { //// [privateInstanceVisibility.js] var Test; (function (Test) { - var Example = (function () { + var Example = /** @class */ (function () { function Example() { } Example.prototype.doSomething = function () { @@ -54,7 +54,7 @@ var Test; }()); Test.Example = Example; })(Test || (Test = {})); -var C = (function () { +var C = /** @class */ (function () { function C() { } C.prototype.getX = function () { return this.x; }; diff --git a/tests/baselines/reference/privateInterfaceProperties.js b/tests/baselines/reference/privateInterfaceProperties.js index 8e1a1ebf5ef74..b6c66582bb021 100644 --- a/tests/baselines/reference/privateInterfaceProperties.js +++ b/tests/baselines/reference/privateInterfaceProperties.js @@ -11,13 +11,13 @@ class c2 implements i1 { public name:string; } //// [privateInterfaceProperties.js] // should be an error -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; }()); // should be ok -var c2 = (function () { +var c2 = /** @class */ (function () { function c2() { } return c2; diff --git a/tests/baselines/reference/privatePropertyUsingObjectType.js b/tests/baselines/reference/privatePropertyUsingObjectType.js index 65e2129a5fc9f..38987fc52c6e6 100644 --- a/tests/baselines/reference/privatePropertyUsingObjectType.js +++ b/tests/baselines/reference/privatePropertyUsingObjectType.js @@ -13,7 +13,7 @@ export interface IFilterProvider { define(["require", "exports"], function (require, exports) { "use strict"; exports.__esModule = true; - var FilterManager = (function () { + var FilterManager = /** @class */ (function () { function FilterManager() { } return FilterManager; diff --git a/tests/baselines/reference/privateProtectedMembersAreNotAccessibleDestructuring.js b/tests/baselines/reference/privateProtectedMembersAreNotAccessibleDestructuring.js index be01293a2cd45..19e0a5499f7be 100644 --- a/tests/baselines/reference/privateProtectedMembersAreNotAccessibleDestructuring.js +++ b/tests/baselines/reference/privateProtectedMembersAreNotAccessibleDestructuring.js @@ -32,7 +32,7 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var K = (function () { +var K = /** @class */ (function () { function K() { } K.prototype.privateMethod = function () { }; @@ -42,7 +42,7 @@ var K = (function () { }; return K; }()); -var C = (function (_super) { +var C = /** @class */ (function (_super) { __extends(C, _super); function C() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/privateStaticMemberAccessibility.js b/tests/baselines/reference/privateStaticMemberAccessibility.js index aca72ba86e5fb..082749da3d061 100644 --- a/tests/baselines/reference/privateStaticMemberAccessibility.js +++ b/tests/baselines/reference/privateStaticMemberAccessibility.js @@ -19,12 +19,12 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var Base = (function () { +var Base = /** @class */ (function () { function Base() { } return Base; }()); -var Derived = (function (_super) { +var Derived = /** @class */ (function (_super) { __extends(Derived, _super); function Derived() { var _this = _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/privateStaticNotAccessibleInClodule.js b/tests/baselines/reference/privateStaticNotAccessibleInClodule.js index 8405eb112e293..dca198de06950 100644 --- a/tests/baselines/reference/privateStaticNotAccessibleInClodule.js +++ b/tests/baselines/reference/privateStaticNotAccessibleInClodule.js @@ -12,7 +12,7 @@ module C { //// [privateStaticNotAccessibleInClodule.js] // Any attempt to access a private property member outside the class body that contains its declaration results in a compile-time error. -var C = (function () { +var C = /** @class */ (function () { function C() { } return C; diff --git a/tests/baselines/reference/privateStaticNotAccessibleInClodule2.js b/tests/baselines/reference/privateStaticNotAccessibleInClodule2.js index c4af30f1456a0..d80f8b2aa2720 100644 --- a/tests/baselines/reference/privateStaticNotAccessibleInClodule2.js +++ b/tests/baselines/reference/privateStaticNotAccessibleInClodule2.js @@ -26,12 +26,12 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var C = (function () { +var C = /** @class */ (function () { function C() { } return C; }()); -var D = (function (_super) { +var D = /** @class */ (function (_super) { __extends(D, _super); function D() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/privateVisibility.js b/tests/baselines/reference/privateVisibility.js index 71227b9e09bb7..76723ef244a71 100644 --- a/tests/baselines/reference/privateVisibility.js +++ b/tests/baselines/reference/privateVisibility.js @@ -27,7 +27,7 @@ c.priv; // should not work //// [privateVisibility.js] -var Foo = (function () { +var Foo = /** @class */ (function () { function Foo() { this.pubProp = 0; this.privProp = 0; @@ -43,7 +43,7 @@ f.pubMeth(); // should work f.pubProp; // should work var M; (function (M) { - var C = (function () { + var C = /** @class */ (function () { function C() { this.pub = 0; this.priv = 1; diff --git a/tests/baselines/reference/privateVisibles.js b/tests/baselines/reference/privateVisibles.js index 4c3736449f10d..fd55cbe361cfb 100644 --- a/tests/baselines/reference/privateVisibles.js +++ b/tests/baselines/reference/privateVisibles.js @@ -10,7 +10,7 @@ class Foo { //// [privateVisibles.js] -var Foo = (function () { +var Foo = /** @class */ (function () { function Foo() { this.pvar = 0; var n = this.pvar; diff --git a/tests/baselines/reference/project/declarationDir/amd/a.js b/tests/baselines/reference/project/declarationDir/amd/a.js index 4db463a796620..7dead9acfe131 100644 --- a/tests/baselines/reference/project/declarationDir/amd/a.js +++ b/tests/baselines/reference/project/declarationDir/amd/a.js @@ -1,7 +1,7 @@ define(["require", "exports"], function (require, exports) { "use strict"; exports.__esModule = true; - var A = (function () { + var A = /** @class */ (function () { function A() { } return A; diff --git a/tests/baselines/reference/project/declarationDir/amd/subfolder/b.js b/tests/baselines/reference/project/declarationDir/amd/subfolder/b.js index bdae3c44b0aa1..96d802aec58d0 100644 --- a/tests/baselines/reference/project/declarationDir/amd/subfolder/b.js +++ b/tests/baselines/reference/project/declarationDir/amd/subfolder/b.js @@ -1,7 +1,7 @@ define(["require", "exports"], function (require, exports) { "use strict"; exports.__esModule = true; - var B = (function () { + var B = /** @class */ (function () { function B() { } return B; diff --git a/tests/baselines/reference/project/declarationDir/amd/subfolder/c.js b/tests/baselines/reference/project/declarationDir/amd/subfolder/c.js index ff657652a4a98..20ccddc05bfc5 100644 --- a/tests/baselines/reference/project/declarationDir/amd/subfolder/c.js +++ b/tests/baselines/reference/project/declarationDir/amd/subfolder/c.js @@ -1,7 +1,7 @@ define(["require", "exports"], function (require, exports) { "use strict"; exports.__esModule = true; - var C = (function () { + var C = /** @class */ (function () { function C() { } return C; diff --git a/tests/baselines/reference/project/declarationDir/node/a.js b/tests/baselines/reference/project/declarationDir/node/a.js index 2139e86c811c4..e1197274fb98a 100644 --- a/tests/baselines/reference/project/declarationDir/node/a.js +++ b/tests/baselines/reference/project/declarationDir/node/a.js @@ -1,6 +1,6 @@ "use strict"; exports.__esModule = true; -var A = (function () { +var A = /** @class */ (function () { function A() { } return A; diff --git a/tests/baselines/reference/project/declarationDir/node/subfolder/b.js b/tests/baselines/reference/project/declarationDir/node/subfolder/b.js index df27fec56d182..4c83e0fd1f544 100644 --- a/tests/baselines/reference/project/declarationDir/node/subfolder/b.js +++ b/tests/baselines/reference/project/declarationDir/node/subfolder/b.js @@ -1,6 +1,6 @@ "use strict"; exports.__esModule = true; -var B = (function () { +var B = /** @class */ (function () { function B() { } return B; diff --git a/tests/baselines/reference/project/declarationDir/node/subfolder/c.js b/tests/baselines/reference/project/declarationDir/node/subfolder/c.js index 385b6df759167..22e264212b799 100644 --- a/tests/baselines/reference/project/declarationDir/node/subfolder/c.js +++ b/tests/baselines/reference/project/declarationDir/node/subfolder/c.js @@ -1,6 +1,6 @@ "use strict"; exports.__esModule = true; -var C = (function () { +var C = /** @class */ (function () { function C() { } return C; diff --git a/tests/baselines/reference/project/declarationDir2/amd/out/a.js b/tests/baselines/reference/project/declarationDir2/amd/out/a.js index 4db463a796620..7dead9acfe131 100644 --- a/tests/baselines/reference/project/declarationDir2/amd/out/a.js +++ b/tests/baselines/reference/project/declarationDir2/amd/out/a.js @@ -1,7 +1,7 @@ define(["require", "exports"], function (require, exports) { "use strict"; exports.__esModule = true; - var A = (function () { + var A = /** @class */ (function () { function A() { } return A; diff --git a/tests/baselines/reference/project/declarationDir2/amd/out/subfolder/b.js b/tests/baselines/reference/project/declarationDir2/amd/out/subfolder/b.js index bdae3c44b0aa1..96d802aec58d0 100644 --- a/tests/baselines/reference/project/declarationDir2/amd/out/subfolder/b.js +++ b/tests/baselines/reference/project/declarationDir2/amd/out/subfolder/b.js @@ -1,7 +1,7 @@ define(["require", "exports"], function (require, exports) { "use strict"; exports.__esModule = true; - var B = (function () { + var B = /** @class */ (function () { function B() { } return B; diff --git a/tests/baselines/reference/project/declarationDir2/amd/out/subfolder/c.js b/tests/baselines/reference/project/declarationDir2/amd/out/subfolder/c.js index ff657652a4a98..20ccddc05bfc5 100644 --- a/tests/baselines/reference/project/declarationDir2/amd/out/subfolder/c.js +++ b/tests/baselines/reference/project/declarationDir2/amd/out/subfolder/c.js @@ -1,7 +1,7 @@ define(["require", "exports"], function (require, exports) { "use strict"; exports.__esModule = true; - var C = (function () { + var C = /** @class */ (function () { function C() { } return C; diff --git a/tests/baselines/reference/project/declarationDir2/node/out/a.js b/tests/baselines/reference/project/declarationDir2/node/out/a.js index 2139e86c811c4..e1197274fb98a 100644 --- a/tests/baselines/reference/project/declarationDir2/node/out/a.js +++ b/tests/baselines/reference/project/declarationDir2/node/out/a.js @@ -1,6 +1,6 @@ "use strict"; exports.__esModule = true; -var A = (function () { +var A = /** @class */ (function () { function A() { } return A; diff --git a/tests/baselines/reference/project/declarationDir2/node/out/subfolder/b.js b/tests/baselines/reference/project/declarationDir2/node/out/subfolder/b.js index df27fec56d182..4c83e0fd1f544 100644 --- a/tests/baselines/reference/project/declarationDir2/node/out/subfolder/b.js +++ b/tests/baselines/reference/project/declarationDir2/node/out/subfolder/b.js @@ -1,6 +1,6 @@ "use strict"; exports.__esModule = true; -var B = (function () { +var B = /** @class */ (function () { function B() { } return B; diff --git a/tests/baselines/reference/project/declarationDir2/node/out/subfolder/c.js b/tests/baselines/reference/project/declarationDir2/node/out/subfolder/c.js index 385b6df759167..22e264212b799 100644 --- a/tests/baselines/reference/project/declarationDir2/node/out/subfolder/c.js +++ b/tests/baselines/reference/project/declarationDir2/node/out/subfolder/c.js @@ -1,6 +1,6 @@ "use strict"; exports.__esModule = true; -var C = (function () { +var C = /** @class */ (function () { function C() { } return C; diff --git a/tests/baselines/reference/project/declarationDir3/amd/out.js b/tests/baselines/reference/project/declarationDir3/amd/out.js index b90d4415806a6..e103f2af4c574 100644 --- a/tests/baselines/reference/project/declarationDir3/amd/out.js +++ b/tests/baselines/reference/project/declarationDir3/amd/out.js @@ -1,7 +1,7 @@ define("subfolder/b", ["require", "exports"], function (require, exports) { "use strict"; exports.__esModule = true; - var B = (function () { + var B = /** @class */ (function () { function B() { } return B; @@ -11,7 +11,7 @@ define("subfolder/b", ["require", "exports"], function (require, exports) { define("a", ["require", "exports"], function (require, exports) { "use strict"; exports.__esModule = true; - var A = (function () { + var A = /** @class */ (function () { function A() { } return A; @@ -21,7 +21,7 @@ define("a", ["require", "exports"], function (require, exports) { define("subfolder/c", ["require", "exports"], function (require, exports) { "use strict"; exports.__esModule = true; - var C = (function () { + var C = /** @class */ (function () { function C() { } return C; diff --git a/tests/baselines/reference/project/declarationsCascadingImports/amd/m4.js b/tests/baselines/reference/project/declarationsCascadingImports/amd/m4.js index d1c2d5f4aca40..24e2e443bfe57 100644 --- a/tests/baselines/reference/project/declarationsCascadingImports/amd/m4.js +++ b/tests/baselines/reference/project/declarationsCascadingImports/amd/m4.js @@ -1,7 +1,7 @@ define(["require", "exports"], function (require, exports) { "use strict"; exports.__esModule = true; - var d = (function () { + var d = /** @class */ (function () { function d() { } return d; diff --git a/tests/baselines/reference/project/declarationsCascadingImports/node/m4.js b/tests/baselines/reference/project/declarationsCascadingImports/node/m4.js index 1c9931a6d1dc8..7a8d072b08d20 100644 --- a/tests/baselines/reference/project/declarationsCascadingImports/node/m4.js +++ b/tests/baselines/reference/project/declarationsCascadingImports/node/m4.js @@ -1,6 +1,6 @@ "use strict"; exports.__esModule = true; -var d = (function () { +var d = /** @class */ (function () { function d() { } return d; diff --git a/tests/baselines/reference/project/declarationsGlobalImport/amd/glo_m4.js b/tests/baselines/reference/project/declarationsGlobalImport/amd/glo_m4.js index d1c2d5f4aca40..24e2e443bfe57 100644 --- a/tests/baselines/reference/project/declarationsGlobalImport/amd/glo_m4.js +++ b/tests/baselines/reference/project/declarationsGlobalImport/amd/glo_m4.js @@ -1,7 +1,7 @@ define(["require", "exports"], function (require, exports) { "use strict"; exports.__esModule = true; - var d = (function () { + var d = /** @class */ (function () { function d() { } return d; diff --git a/tests/baselines/reference/project/declarationsGlobalImport/node/glo_m4.js b/tests/baselines/reference/project/declarationsGlobalImport/node/glo_m4.js index 1c9931a6d1dc8..7a8d072b08d20 100644 --- a/tests/baselines/reference/project/declarationsGlobalImport/node/glo_m4.js +++ b/tests/baselines/reference/project/declarationsGlobalImport/node/glo_m4.js @@ -1,6 +1,6 @@ "use strict"; exports.__esModule = true; -var d = (function () { +var d = /** @class */ (function () { function d() { } return d; diff --git a/tests/baselines/reference/project/declarationsImportedInPrivate/amd/private_m4.js b/tests/baselines/reference/project/declarationsImportedInPrivate/amd/private_m4.js index d1c2d5f4aca40..24e2e443bfe57 100644 --- a/tests/baselines/reference/project/declarationsImportedInPrivate/amd/private_m4.js +++ b/tests/baselines/reference/project/declarationsImportedInPrivate/amd/private_m4.js @@ -1,7 +1,7 @@ define(["require", "exports"], function (require, exports) { "use strict"; exports.__esModule = true; - var d = (function () { + var d = /** @class */ (function () { function d() { } return d; diff --git a/tests/baselines/reference/project/declarationsImportedInPrivate/node/private_m4.js b/tests/baselines/reference/project/declarationsImportedInPrivate/node/private_m4.js index 1c9931a6d1dc8..7a8d072b08d20 100644 --- a/tests/baselines/reference/project/declarationsImportedInPrivate/node/private_m4.js +++ b/tests/baselines/reference/project/declarationsImportedInPrivate/node/private_m4.js @@ -1,6 +1,6 @@ "use strict"; exports.__esModule = true; -var d = (function () { +var d = /** @class */ (function () { function d() { } return d; diff --git a/tests/baselines/reference/project/declarationsImportedUseInFunction/amd/fncOnly_m4.js b/tests/baselines/reference/project/declarationsImportedUseInFunction/amd/fncOnly_m4.js index d1c2d5f4aca40..24e2e443bfe57 100644 --- a/tests/baselines/reference/project/declarationsImportedUseInFunction/amd/fncOnly_m4.js +++ b/tests/baselines/reference/project/declarationsImportedUseInFunction/amd/fncOnly_m4.js @@ -1,7 +1,7 @@ define(["require", "exports"], function (require, exports) { "use strict"; exports.__esModule = true; - var d = (function () { + var d = /** @class */ (function () { function d() { } return d; diff --git a/tests/baselines/reference/project/declarationsImportedUseInFunction/node/fncOnly_m4.js b/tests/baselines/reference/project/declarationsImportedUseInFunction/node/fncOnly_m4.js index 1c9931a6d1dc8..7a8d072b08d20 100644 --- a/tests/baselines/reference/project/declarationsImportedUseInFunction/node/fncOnly_m4.js +++ b/tests/baselines/reference/project/declarationsImportedUseInFunction/node/fncOnly_m4.js @@ -1,6 +1,6 @@ "use strict"; exports.__esModule = true; -var d = (function () { +var d = /** @class */ (function () { function d() { } return d; diff --git a/tests/baselines/reference/project/declarationsIndirectImportShouldResultInError/amd/m4.js b/tests/baselines/reference/project/declarationsIndirectImportShouldResultInError/amd/m4.js index d1c2d5f4aca40..24e2e443bfe57 100644 --- a/tests/baselines/reference/project/declarationsIndirectImportShouldResultInError/amd/m4.js +++ b/tests/baselines/reference/project/declarationsIndirectImportShouldResultInError/amd/m4.js @@ -1,7 +1,7 @@ define(["require", "exports"], function (require, exports) { "use strict"; exports.__esModule = true; - var d = (function () { + var d = /** @class */ (function () { function d() { } return d; diff --git a/tests/baselines/reference/project/declarationsIndirectImportShouldResultInError/node/m4.js b/tests/baselines/reference/project/declarationsIndirectImportShouldResultInError/node/m4.js index 1c9931a6d1dc8..7a8d072b08d20 100644 --- a/tests/baselines/reference/project/declarationsIndirectImportShouldResultInError/node/m4.js +++ b/tests/baselines/reference/project/declarationsIndirectImportShouldResultInError/node/m4.js @@ -1,6 +1,6 @@ "use strict"; exports.__esModule = true; -var d = (function () { +var d = /** @class */ (function () { function d() { } return d; diff --git a/tests/baselines/reference/project/declarationsMultipleTimesImport/amd/m4.js b/tests/baselines/reference/project/declarationsMultipleTimesImport/amd/m4.js index d1c2d5f4aca40..24e2e443bfe57 100644 --- a/tests/baselines/reference/project/declarationsMultipleTimesImport/amd/m4.js +++ b/tests/baselines/reference/project/declarationsMultipleTimesImport/amd/m4.js @@ -1,7 +1,7 @@ define(["require", "exports"], function (require, exports) { "use strict"; exports.__esModule = true; - var d = (function () { + var d = /** @class */ (function () { function d() { } return d; diff --git a/tests/baselines/reference/project/declarationsMultipleTimesImport/node/m4.js b/tests/baselines/reference/project/declarationsMultipleTimesImport/node/m4.js index 1c9931a6d1dc8..7a8d072b08d20 100644 --- a/tests/baselines/reference/project/declarationsMultipleTimesImport/node/m4.js +++ b/tests/baselines/reference/project/declarationsMultipleTimesImport/node/m4.js @@ -1,6 +1,6 @@ "use strict"; exports.__esModule = true; -var d = (function () { +var d = /** @class */ (function () { function d() { } return d; diff --git a/tests/baselines/reference/project/declarationsMultipleTimesMultipleImport/amd/m4.js b/tests/baselines/reference/project/declarationsMultipleTimesMultipleImport/amd/m4.js index d1c2d5f4aca40..24e2e443bfe57 100644 --- a/tests/baselines/reference/project/declarationsMultipleTimesMultipleImport/amd/m4.js +++ b/tests/baselines/reference/project/declarationsMultipleTimesMultipleImport/amd/m4.js @@ -1,7 +1,7 @@ define(["require", "exports"], function (require, exports) { "use strict"; exports.__esModule = true; - var d = (function () { + var d = /** @class */ (function () { function d() { } return d; diff --git a/tests/baselines/reference/project/declarationsMultipleTimesMultipleImport/node/m4.js b/tests/baselines/reference/project/declarationsMultipleTimesMultipleImport/node/m4.js index 1c9931a6d1dc8..7a8d072b08d20 100644 --- a/tests/baselines/reference/project/declarationsMultipleTimesMultipleImport/node/m4.js +++ b/tests/baselines/reference/project/declarationsMultipleTimesMultipleImport/node/m4.js @@ -1,6 +1,6 @@ "use strict"; exports.__esModule = true; -var d = (function () { +var d = /** @class */ (function () { function d() { } return d; diff --git a/tests/baselines/reference/project/declarationsSimpleImport/amd/m4.js b/tests/baselines/reference/project/declarationsSimpleImport/amd/m4.js index d1c2d5f4aca40..24e2e443bfe57 100644 --- a/tests/baselines/reference/project/declarationsSimpleImport/amd/m4.js +++ b/tests/baselines/reference/project/declarationsSimpleImport/amd/m4.js @@ -1,7 +1,7 @@ define(["require", "exports"], function (require, exports) { "use strict"; exports.__esModule = true; - var d = (function () { + var d = /** @class */ (function () { function d() { } return d; diff --git a/tests/baselines/reference/project/declarationsSimpleImport/node/m4.js b/tests/baselines/reference/project/declarationsSimpleImport/node/m4.js index 1c9931a6d1dc8..7a8d072b08d20 100644 --- a/tests/baselines/reference/project/declarationsSimpleImport/node/m4.js +++ b/tests/baselines/reference/project/declarationsSimpleImport/node/m4.js @@ -1,6 +1,6 @@ "use strict"; exports.__esModule = true; -var d = (function () { +var d = /** @class */ (function () { function d() { } return d; diff --git a/tests/baselines/reference/project/emitDecoratorMetadataCommonJSISolatedModules/amd/main.js b/tests/baselines/reference/project/emitDecoratorMetadataCommonJSISolatedModules/amd/main.js index f1d17701cf8a1..c372e3558b1be 100644 --- a/tests/baselines/reference/project/emitDecoratorMetadataCommonJSISolatedModules/amd/main.js +++ b/tests/baselines/reference/project/emitDecoratorMetadataCommonJSISolatedModules/amd/main.js @@ -10,7 +10,7 @@ var __metadata = (this && this.__metadata) || function (k, v) { define(["require", "exports", "angular2/core"], function (require, exports, ng) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); - var MyClass1 = (function () { + var MyClass1 = /** @class */ (function () { function MyClass1(_elementRef) { this._elementRef = _elementRef; } diff --git a/tests/baselines/reference/project/emitDecoratorMetadataCommonJSISolatedModules/node/main.js b/tests/baselines/reference/project/emitDecoratorMetadataCommonJSISolatedModules/node/main.js index c7191f0e4c6d1..24bd0b20bc424 100644 --- a/tests/baselines/reference/project/emitDecoratorMetadataCommonJSISolatedModules/node/main.js +++ b/tests/baselines/reference/project/emitDecoratorMetadataCommonJSISolatedModules/node/main.js @@ -10,7 +10,7 @@ var __metadata = (this && this.__metadata) || function (k, v) { }; Object.defineProperty(exports, "__esModule", { value: true }); var ng = require("angular2/core"); -var MyClass1 = (function () { +var MyClass1 = /** @class */ (function () { function MyClass1(_elementRef) { this._elementRef = _elementRef; } diff --git a/tests/baselines/reference/project/emitDecoratorMetadataCommonJSISolatedModulesNoResolve/amd/main.js b/tests/baselines/reference/project/emitDecoratorMetadataCommonJSISolatedModulesNoResolve/amd/main.js index f1d17701cf8a1..c372e3558b1be 100644 --- a/tests/baselines/reference/project/emitDecoratorMetadataCommonJSISolatedModulesNoResolve/amd/main.js +++ b/tests/baselines/reference/project/emitDecoratorMetadataCommonJSISolatedModulesNoResolve/amd/main.js @@ -10,7 +10,7 @@ var __metadata = (this && this.__metadata) || function (k, v) { define(["require", "exports", "angular2/core"], function (require, exports, ng) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); - var MyClass1 = (function () { + var MyClass1 = /** @class */ (function () { function MyClass1(_elementRef) { this._elementRef = _elementRef; } diff --git a/tests/baselines/reference/project/emitDecoratorMetadataCommonJSISolatedModulesNoResolve/node/main.js b/tests/baselines/reference/project/emitDecoratorMetadataCommonJSISolatedModulesNoResolve/node/main.js index c7191f0e4c6d1..24bd0b20bc424 100644 --- a/tests/baselines/reference/project/emitDecoratorMetadataCommonJSISolatedModulesNoResolve/node/main.js +++ b/tests/baselines/reference/project/emitDecoratorMetadataCommonJSISolatedModulesNoResolve/node/main.js @@ -10,7 +10,7 @@ var __metadata = (this && this.__metadata) || function (k, v) { }; Object.defineProperty(exports, "__esModule", { value: true }); var ng = require("angular2/core"); -var MyClass1 = (function () { +var MyClass1 = /** @class */ (function () { function MyClass1(_elementRef) { this._elementRef = _elementRef; } diff --git a/tests/baselines/reference/project/emitDecoratorMetadataSystemJS/amd/main.js b/tests/baselines/reference/project/emitDecoratorMetadataSystemJS/amd/main.js index f1d17701cf8a1..c372e3558b1be 100644 --- a/tests/baselines/reference/project/emitDecoratorMetadataSystemJS/amd/main.js +++ b/tests/baselines/reference/project/emitDecoratorMetadataSystemJS/amd/main.js @@ -10,7 +10,7 @@ var __metadata = (this && this.__metadata) || function (k, v) { define(["require", "exports", "angular2/core"], function (require, exports, ng) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); - var MyClass1 = (function () { + var MyClass1 = /** @class */ (function () { function MyClass1(_elementRef) { this._elementRef = _elementRef; } diff --git a/tests/baselines/reference/project/emitDecoratorMetadataSystemJS/node/main.js b/tests/baselines/reference/project/emitDecoratorMetadataSystemJS/node/main.js index c7191f0e4c6d1..24bd0b20bc424 100644 --- a/tests/baselines/reference/project/emitDecoratorMetadataSystemJS/node/main.js +++ b/tests/baselines/reference/project/emitDecoratorMetadataSystemJS/node/main.js @@ -10,7 +10,7 @@ var __metadata = (this && this.__metadata) || function (k, v) { }; Object.defineProperty(exports, "__esModule", { value: true }); var ng = require("angular2/core"); -var MyClass1 = (function () { +var MyClass1 = /** @class */ (function () { function MyClass1(_elementRef) { this._elementRef = _elementRef; } diff --git a/tests/baselines/reference/project/emitDecoratorMetadataSystemJSISolatedModules/amd/main.js b/tests/baselines/reference/project/emitDecoratorMetadataSystemJSISolatedModules/amd/main.js index f1d17701cf8a1..c372e3558b1be 100644 --- a/tests/baselines/reference/project/emitDecoratorMetadataSystemJSISolatedModules/amd/main.js +++ b/tests/baselines/reference/project/emitDecoratorMetadataSystemJSISolatedModules/amd/main.js @@ -10,7 +10,7 @@ var __metadata = (this && this.__metadata) || function (k, v) { define(["require", "exports", "angular2/core"], function (require, exports, ng) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); - var MyClass1 = (function () { + var MyClass1 = /** @class */ (function () { function MyClass1(_elementRef) { this._elementRef = _elementRef; } diff --git a/tests/baselines/reference/project/emitDecoratorMetadataSystemJSISolatedModules/node/main.js b/tests/baselines/reference/project/emitDecoratorMetadataSystemJSISolatedModules/node/main.js index c7191f0e4c6d1..24bd0b20bc424 100644 --- a/tests/baselines/reference/project/emitDecoratorMetadataSystemJSISolatedModules/node/main.js +++ b/tests/baselines/reference/project/emitDecoratorMetadataSystemJSISolatedModules/node/main.js @@ -10,7 +10,7 @@ var __metadata = (this && this.__metadata) || function (k, v) { }; Object.defineProperty(exports, "__esModule", { value: true }); var ng = require("angular2/core"); -var MyClass1 = (function () { +var MyClass1 = /** @class */ (function () { function MyClass1(_elementRef) { this._elementRef = _elementRef; } diff --git a/tests/baselines/reference/project/emitDecoratorMetadataSystemJSISolatedModulesNoResolve/amd/main.js b/tests/baselines/reference/project/emitDecoratorMetadataSystemJSISolatedModulesNoResolve/amd/main.js index f1d17701cf8a1..c372e3558b1be 100644 --- a/tests/baselines/reference/project/emitDecoratorMetadataSystemJSISolatedModulesNoResolve/amd/main.js +++ b/tests/baselines/reference/project/emitDecoratorMetadataSystemJSISolatedModulesNoResolve/amd/main.js @@ -10,7 +10,7 @@ var __metadata = (this && this.__metadata) || function (k, v) { define(["require", "exports", "angular2/core"], function (require, exports, ng) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); - var MyClass1 = (function () { + var MyClass1 = /** @class */ (function () { function MyClass1(_elementRef) { this._elementRef = _elementRef; } diff --git a/tests/baselines/reference/project/emitDecoratorMetadataSystemJSISolatedModulesNoResolve/node/main.js b/tests/baselines/reference/project/emitDecoratorMetadataSystemJSISolatedModulesNoResolve/node/main.js index c7191f0e4c6d1..24bd0b20bc424 100644 --- a/tests/baselines/reference/project/emitDecoratorMetadataSystemJSISolatedModulesNoResolve/node/main.js +++ b/tests/baselines/reference/project/emitDecoratorMetadataSystemJSISolatedModulesNoResolve/node/main.js @@ -10,7 +10,7 @@ var __metadata = (this && this.__metadata) || function (k, v) { }; Object.defineProperty(exports, "__esModule", { value: true }); var ng = require("angular2/core"); -var MyClass1 = (function () { +var MyClass1 = /** @class */ (function () { function MyClass1(_elementRef) { this._elementRef = _elementRef; } diff --git a/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderNoOutdir/amd/ref/m1.js b/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderNoOutdir/amd/ref/m1.js index b27cc353db503..6878376147c14 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderNoOutdir/amd/ref/m1.js +++ b/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderNoOutdir/amd/ref/m1.js @@ -1,5 +1,5 @@ var m1_a1 = 10; -var m1_c1 = (function () { +var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; diff --git a/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderNoOutdir/amd/ref/m2.js b/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderNoOutdir/amd/ref/m2.js index 7eeee43049b85..f8aea95ab6c44 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderNoOutdir/amd/ref/m2.js +++ b/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderNoOutdir/amd/ref/m2.js @@ -2,7 +2,7 @@ define(["require", "exports"], function (require, exports) { "use strict"; exports.__esModule = true; exports.m2_a1 = 10; - var m2_c1 = (function () { + var m2_c1 = /** @class */ (function () { function m2_c1() { } return m2_c1; diff --git a/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderNoOutdir/amd/test.js b/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderNoOutdir/amd/test.js index 2e104772c57c6..db37300f93570 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderNoOutdir/amd/test.js +++ b/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderNoOutdir/amd/test.js @@ -1,7 +1,7 @@ /// /// var a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderNoOutdir/node/ref/m1.js b/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderNoOutdir/node/ref/m1.js index b27cc353db503..6878376147c14 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderNoOutdir/node/ref/m1.js +++ b/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderNoOutdir/node/ref/m1.js @@ -1,5 +1,5 @@ var m1_a1 = 10; -var m1_c1 = (function () { +var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; diff --git a/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderNoOutdir/node/ref/m2.js b/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderNoOutdir/node/ref/m2.js index d393dda0c5749..8c88c0b2fa6ab 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderNoOutdir/node/ref/m2.js +++ b/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderNoOutdir/node/ref/m2.js @@ -1,7 +1,7 @@ "use strict"; exports.__esModule = true; exports.m2_a1 = 10; -var m2_c1 = (function () { +var m2_c1 = /** @class */ (function () { function m2_c1() { } return m2_c1; diff --git a/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderNoOutdir/node/test.js b/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderNoOutdir/node/test.js index 2e104772c57c6..db37300f93570 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderNoOutdir/node/test.js +++ b/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderNoOutdir/node/test.js @@ -1,7 +1,7 @@ /// /// var a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js b/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js index b27cc353db503..6878376147c14 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js +++ b/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js @@ -1,5 +1,5 @@ var m1_a1 = 10; -var m1_c1 = (function () { +var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; diff --git a/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m2.js b/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m2.js index 7eeee43049b85..f8aea95ab6c44 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m2.js +++ b/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m2.js @@ -2,7 +2,7 @@ define(["require", "exports"], function (require, exports) { "use strict"; exports.__esModule = true; exports.m2_a1 = 10; - var m2_c1 = (function () { + var m2_c1 = /** @class */ (function () { function m2_c1() { } return m2_c1; diff --git a/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js b/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js index 2e104772c57c6..db37300f93570 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js +++ b/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js @@ -1,7 +1,7 @@ /// /// var a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js b/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js index b27cc353db503..6878376147c14 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js +++ b/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js @@ -1,5 +1,5 @@ var m1_a1 = 10; -var m1_c1 = (function () { +var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; diff --git a/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m2.js b/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m2.js index d393dda0c5749..8c88c0b2fa6ab 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m2.js +++ b/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m2.js @@ -1,7 +1,7 @@ "use strict"; exports.__esModule = true; exports.m2_a1 = 10; -var m2_c1 = (function () { +var m2_c1 = /** @class */ (function () { function m2_c1() { } return m2_c1; diff --git a/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js b/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js index 2e104772c57c6..db37300f93570 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js +++ b/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js @@ -1,7 +1,7 @@ /// /// var a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputFile/amd/bin/test.js b/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputFile/amd/bin/test.js index 1c199b7384adb..b7805419962cc 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputFile/amd/bin/test.js +++ b/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputFile/amd/bin/test.js @@ -1,5 +1,5 @@ var m1_a1 = 10; -var m1_c1 = (function () { +var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; @@ -12,7 +12,7 @@ define("ref/m2", ["require", "exports"], function (require, exports) { "use strict"; exports.__esModule = true; exports.m2_a1 = 10; - var m2_c1 = (function () { + var m2_c1 = /** @class */ (function () { function m2_c1() { } return m2_c1; @@ -27,7 +27,7 @@ define("ref/m2", ["require", "exports"], function (require, exports) { /// /// var a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputFile/node/bin/test.js b/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputFile/node/bin/test.js index a857aef135a55..236378f78f5fe 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputFile/node/bin/test.js +++ b/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputFile/node/bin/test.js @@ -1,5 +1,5 @@ var m1_a1 = 10; -var m1_c1 = (function () { +var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; @@ -11,7 +11,7 @@ function m1_f1() { /// /// var a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/bin/outAndOutDirFile.js b/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/bin/outAndOutDirFile.js index 749fbd732a5b9..9d20ddf52d166 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/bin/outAndOutDirFile.js +++ b/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/bin/outAndOutDirFile.js @@ -1,5 +1,5 @@ var m1_a1 = 10; -var m1_c1 = (function () { +var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; @@ -12,7 +12,7 @@ define("ref/m2", ["require", "exports"], function (require, exports) { "use strict"; exports.__esModule = true; exports.m2_a1 = 10; - var m2_c1 = (function () { + var m2_c1 = /** @class */ (function () { function m2_c1() { } return m2_c1; @@ -27,7 +27,7 @@ define("ref/m2", ["require", "exports"], function (require, exports) { /// /// var a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/bin/outAndOutDirFile.js b/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/bin/outAndOutDirFile.js index feea00eb8c72a..a9609eb4c28b7 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/bin/outAndOutDirFile.js +++ b/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/bin/outAndOutDirFile.js @@ -1,5 +1,5 @@ var m1_a1 = 10; -var m1_c1 = (function () { +var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; @@ -11,7 +11,7 @@ function m1_f1() { /// /// var a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderNoOutdir/amd/diskFile1.js b/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderNoOutdir/amd/diskFile1.js index c67e35d1b89b4..163e95cd6bf50 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderNoOutdir/amd/diskFile1.js +++ b/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderNoOutdir/amd/diskFile1.js @@ -2,7 +2,7 @@ define(["require", "exports"], function (require, exports) { "use strict"; exports.__esModule = true; exports.m2_a1 = 10; - var m2_c1 = (function () { + var m2_c1 = /** @class */ (function () { function m2_c1() { } return m2_c1; diff --git a/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderNoOutdir/amd/ref/m1.js b/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderNoOutdir/amd/ref/m1.js index 1935dadfdb358..6f12c5b350473 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderNoOutdir/amd/ref/m1.js +++ b/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderNoOutdir/amd/ref/m1.js @@ -2,7 +2,7 @@ define(["require", "exports"], function (require, exports) { "use strict"; exports.__esModule = true; exports.m1_a1 = 10; - var m1_c1 = (function () { + var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; diff --git a/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderNoOutdir/amd/test.js b/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderNoOutdir/amd/test.js index fa9c56910474d..67cf6c1b0a35c 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderNoOutdir/amd/test.js +++ b/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderNoOutdir/amd/test.js @@ -2,7 +2,7 @@ define(["require", "exports", "ref/m1", "../outputdir_module_multifolder_ref/m2" "use strict"; exports.__esModule = true; exports.a1 = 10; - var c1 = (function () { + var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderNoOutdir/node/diskFile1.js b/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderNoOutdir/node/diskFile1.js index dabe72d27872a..d4d9c79ff5e6d 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderNoOutdir/node/diskFile1.js +++ b/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderNoOutdir/node/diskFile1.js @@ -1,7 +1,7 @@ "use strict"; exports.__esModule = true; exports.m2_a1 = 10; -var m2_c1 = (function () { +var m2_c1 = /** @class */ (function () { function m2_c1() { } return m2_c1; diff --git a/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderNoOutdir/node/ref/m1.js b/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderNoOutdir/node/ref/m1.js index d28465d805ea8..0543edd48418e 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderNoOutdir/node/ref/m1.js +++ b/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderNoOutdir/node/ref/m1.js @@ -1,7 +1,7 @@ "use strict"; exports.__esModule = true; exports.m1_a1 = 10; -var m1_c1 = (function () { +var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; diff --git a/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderNoOutdir/node/test.js b/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderNoOutdir/node/test.js index 46d82346a3749..54200d1a00d8e 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderNoOutdir/node/test.js +++ b/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderNoOutdir/node/test.js @@ -3,7 +3,7 @@ exports.__esModule = true; var m1 = require("ref/m1"); var m2 = require("../outputdir_module_multifolder_ref/m2"); exports.a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder/ref/m1.js b/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder/ref/m1.js index 1935dadfdb358..6f12c5b350473 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder/ref/m1.js +++ b/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder/ref/m1.js @@ -2,7 +2,7 @@ define(["require", "exports"], function (require, exports) { "use strict"; exports.__esModule = true; exports.m1_a1 = 10; - var m1_c1 = (function () { + var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; diff --git a/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder/test.js b/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder/test.js index fa9c56910474d..67cf6c1b0a35c 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder/test.js +++ b/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder/test.js @@ -2,7 +2,7 @@ define(["require", "exports", "ref/m1", "../outputdir_module_multifolder_ref/m2" "use strict"; exports.__esModule = true; exports.a1 = 10; - var c1 = (function () { + var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder_ref/m2.js b/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder_ref/m2.js index c67e35d1b89b4..163e95cd6bf50 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder_ref/m2.js +++ b/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder_ref/m2.js @@ -2,7 +2,7 @@ define(["require", "exports"], function (require, exports) { "use strict"; exports.__esModule = true; exports.m2_a1 = 10; - var m2_c1 = (function () { + var m2_c1 = /** @class */ (function () { function m2_c1() { } return m2_c1; diff --git a/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder/ref/m1.js b/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder/ref/m1.js index d28465d805ea8..0543edd48418e 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder/ref/m1.js +++ b/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder/ref/m1.js @@ -1,7 +1,7 @@ "use strict"; exports.__esModule = true; exports.m1_a1 = 10; -var m1_c1 = (function () { +var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; diff --git a/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder/test.js b/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder/test.js index 46d82346a3749..54200d1a00d8e 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder/test.js +++ b/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder/test.js @@ -3,7 +3,7 @@ exports.__esModule = true; var m1 = require("ref/m1"); var m2 = require("../outputdir_module_multifolder_ref/m2"); exports.a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder_ref/m2.js b/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder_ref/m2.js index dabe72d27872a..d4d9c79ff5e6d 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder_ref/m2.js +++ b/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder_ref/m2.js @@ -1,7 +1,7 @@ "use strict"; exports.__esModule = true; exports.m2_a1 = 10; -var m2_c1 = (function () { +var m2_c1 = /** @class */ (function () { function m2_c1() { } return m2_c1; diff --git a/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderSpecifyOutputFile/amd/bin/test.js b/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderSpecifyOutputFile/amd/bin/test.js index 371d873f34591..fccb52be6d918 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderSpecifyOutputFile/amd/bin/test.js +++ b/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderSpecifyOutputFile/amd/bin/test.js @@ -2,7 +2,7 @@ define("outputdir_module_multifolder/ref/m1", ["require", "exports"], function ( "use strict"; exports.__esModule = true; exports.m1_a1 = 10; - var m1_c1 = (function () { + var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; @@ -18,7 +18,7 @@ define("outputdir_module_multifolder_ref/m2", ["require", "exports"], function ( "use strict"; exports.__esModule = true; exports.m2_a1 = 10; - var m2_c1 = (function () { + var m2_c1 = /** @class */ (function () { function m2_c1() { } return m2_c1; @@ -34,7 +34,7 @@ define("outputdir_module_multifolder/test", ["require", "exports", "outputdir_mo "use strict"; exports.__esModule = true; exports.a1 = 10; - var c1 = (function () { + var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleNoOutdir/amd/m1.js b/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleNoOutdir/amd/m1.js index 1f3b6d7a6dcf5..85afce81428c5 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleNoOutdir/amd/m1.js +++ b/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleNoOutdir/amd/m1.js @@ -2,7 +2,7 @@ define(["require", "exports"], function (require, exports) { "use strict"; exports.__esModule = true; exports.m1_a1 = 10; - var m1_c1 = (function () { + var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; diff --git a/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleNoOutdir/amd/test.js b/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleNoOutdir/amd/test.js index a112cba6d0e90..c0085e8887572 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleNoOutdir/amd/test.js +++ b/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleNoOutdir/amd/test.js @@ -2,7 +2,7 @@ define(["require", "exports", "m1"], function (require, exports, m1) { "use strict"; exports.__esModule = true; exports.a1 = 10; - var c1 = (function () { + var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleNoOutdir/node/m1.js b/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleNoOutdir/node/m1.js index a6a299a8a7eb0..1ba150e1d0d3d 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleNoOutdir/node/m1.js +++ b/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleNoOutdir/node/m1.js @@ -1,7 +1,7 @@ "use strict"; exports.__esModule = true; exports.m1_a1 = 10; -var m1_c1 = (function () { +var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; diff --git a/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleNoOutdir/node/test.js b/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleNoOutdir/node/test.js index 94e4facb645a8..d5520bf26dba8 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleNoOutdir/node/test.js +++ b/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleNoOutdir/node/test.js @@ -2,7 +2,7 @@ exports.__esModule = true; var m1 = require("m1"); exports.a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleSpecifyOutputDirectory/amd/outdir/simple/m1.js b/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleSpecifyOutputDirectory/amd/outdir/simple/m1.js index 1f3b6d7a6dcf5..85afce81428c5 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleSpecifyOutputDirectory/amd/outdir/simple/m1.js +++ b/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleSpecifyOutputDirectory/amd/outdir/simple/m1.js @@ -2,7 +2,7 @@ define(["require", "exports"], function (require, exports) { "use strict"; exports.__esModule = true; exports.m1_a1 = 10; - var m1_c1 = (function () { + var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; diff --git a/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleSpecifyOutputDirectory/amd/outdir/simple/test.js b/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleSpecifyOutputDirectory/amd/outdir/simple/test.js index a112cba6d0e90..c0085e8887572 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleSpecifyOutputDirectory/amd/outdir/simple/test.js +++ b/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleSpecifyOutputDirectory/amd/outdir/simple/test.js @@ -2,7 +2,7 @@ define(["require", "exports", "m1"], function (require, exports, m1) { "use strict"; exports.__esModule = true; exports.a1 = 10; - var c1 = (function () { + var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleSpecifyOutputDirectory/node/outdir/simple/m1.js b/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleSpecifyOutputDirectory/node/outdir/simple/m1.js index a6a299a8a7eb0..1ba150e1d0d3d 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleSpecifyOutputDirectory/node/outdir/simple/m1.js +++ b/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleSpecifyOutputDirectory/node/outdir/simple/m1.js @@ -1,7 +1,7 @@ "use strict"; exports.__esModule = true; exports.m1_a1 = 10; -var m1_c1 = (function () { +var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; diff --git a/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleSpecifyOutputDirectory/node/outdir/simple/test.js b/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleSpecifyOutputDirectory/node/outdir/simple/test.js index 94e4facb645a8..d5520bf26dba8 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleSpecifyOutputDirectory/node/outdir/simple/test.js +++ b/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleSpecifyOutputDirectory/node/outdir/simple/test.js @@ -2,7 +2,7 @@ exports.__esModule = true; var m1 = require("m1"); exports.a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleSpecifyOutputFile/amd/bin/test.js b/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleSpecifyOutputFile/amd/bin/test.js index c5e2f0c04bf73..5b18c83540a8c 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleSpecifyOutputFile/amd/bin/test.js +++ b/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleSpecifyOutputFile/amd/bin/test.js @@ -2,7 +2,7 @@ define("m1", ["require", "exports"], function (require, exports) { "use strict"; exports.__esModule = true; exports.m1_a1 = 10; - var m1_c1 = (function () { + var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; @@ -18,7 +18,7 @@ define("test", ["require", "exports", "m1"], function (require, exports, m1) { "use strict"; exports.__esModule = true; exports.a1 = 10; - var c1 = (function () { + var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderNoOutdir/amd/ref/m1.js b/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderNoOutdir/amd/ref/m1.js index 8359b4472ee37..609e0c8bfb59e 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderNoOutdir/amd/ref/m1.js +++ b/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderNoOutdir/amd/ref/m1.js @@ -2,7 +2,7 @@ define(["require", "exports"], function (require, exports) { "use strict"; exports.__esModule = true; exports.m1_a1 = 10; - var m1_c1 = (function () { + var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; diff --git a/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderNoOutdir/amd/test.js b/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderNoOutdir/amd/test.js index 32cd3e8915e13..26997a1fdecca 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderNoOutdir/amd/test.js +++ b/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderNoOutdir/amd/test.js @@ -2,7 +2,7 @@ define(["require", "exports", "ref/m1"], function (require, exports, m1) { "use strict"; exports.__esModule = true; exports.a1 = 10; - var c1 = (function () { + var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderNoOutdir/node/ref/m1.js b/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderNoOutdir/node/ref/m1.js index 39f0b1365680c..23cf883c750cd 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderNoOutdir/node/ref/m1.js +++ b/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderNoOutdir/node/ref/m1.js @@ -1,7 +1,7 @@ "use strict"; exports.__esModule = true; exports.m1_a1 = 10; -var m1_c1 = (function () { +var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; diff --git a/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderNoOutdir/node/test.js b/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderNoOutdir/node/test.js index 61925246a0e91..4b29f7cc67d82 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderNoOutdir/node/test.js +++ b/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderNoOutdir/node/test.js @@ -2,7 +2,7 @@ exports.__esModule = true; var m1 = require("ref/m1"); exports.a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js b/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js index 8359b4472ee37..609e0c8bfb59e 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js +++ b/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js @@ -2,7 +2,7 @@ define(["require", "exports"], function (require, exports) { "use strict"; exports.__esModule = true; exports.m1_a1 = 10; - var m1_c1 = (function () { + var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; diff --git a/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js b/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js index 32cd3e8915e13..26997a1fdecca 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js +++ b/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js @@ -2,7 +2,7 @@ define(["require", "exports", "ref/m1"], function (require, exports, m1) { "use strict"; exports.__esModule = true; exports.a1 = 10; - var c1 = (function () { + var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js b/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js index 39f0b1365680c..23cf883c750cd 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js +++ b/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js @@ -1,7 +1,7 @@ "use strict"; exports.__esModule = true; exports.m1_a1 = 10; -var m1_c1 = (function () { +var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; diff --git a/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js b/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js index 61925246a0e91..4b29f7cc67d82 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js +++ b/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js @@ -2,7 +2,7 @@ exports.__esModule = true; var m1 = require("ref/m1"); exports.a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderSpecifyOutputFile/amd/bin/test.js b/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderSpecifyOutputFile/amd/bin/test.js index 11d40e4d23be7..b3d2d96e67db9 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderSpecifyOutputFile/amd/bin/test.js +++ b/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderSpecifyOutputFile/amd/bin/test.js @@ -2,7 +2,7 @@ define("ref/m1", ["require", "exports"], function (require, exports) { "use strict"; exports.__esModule = true; exports.m1_a1 = 10; - var m1_c1 = (function () { + var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; @@ -18,7 +18,7 @@ define("test", ["require", "exports", "ref/m1"], function (require, exports, m1) "use strict"; exports.__esModule = true; exports.a1 = 10; - var c1 = (function () { + var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/mapRootAbsolutePathMultifolderNoOutdir/amd/diskFile1.js b/tests/baselines/reference/project/mapRootAbsolutePathMultifolderNoOutdir/amd/diskFile1.js index 23caea4d958d0..0209a1e52cb3c 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathMultifolderNoOutdir/amd/diskFile1.js +++ b/tests/baselines/reference/project/mapRootAbsolutePathMultifolderNoOutdir/amd/diskFile1.js @@ -1,5 +1,5 @@ var m2_a1 = 10; -var m2_c1 = (function () { +var m2_c1 = /** @class */ (function () { function m2_c1() { } return m2_c1; diff --git a/tests/baselines/reference/project/mapRootAbsolutePathMultifolderNoOutdir/amd/ref/m1.js b/tests/baselines/reference/project/mapRootAbsolutePathMultifolderNoOutdir/amd/ref/m1.js index 6e43f21bdb1aa..59d88164993e7 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathMultifolderNoOutdir/amd/ref/m1.js +++ b/tests/baselines/reference/project/mapRootAbsolutePathMultifolderNoOutdir/amd/ref/m1.js @@ -1,5 +1,5 @@ var m1_a1 = 10; -var m1_c1 = (function () { +var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; diff --git a/tests/baselines/reference/project/mapRootAbsolutePathMultifolderNoOutdir/amd/test.js b/tests/baselines/reference/project/mapRootAbsolutePathMultifolderNoOutdir/amd/test.js index a15b4c334cf5e..8dcdfe90435b6 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathMultifolderNoOutdir/amd/test.js +++ b/tests/baselines/reference/project/mapRootAbsolutePathMultifolderNoOutdir/amd/test.js @@ -1,7 +1,7 @@ /// /// var a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/mapRootAbsolutePathMultifolderNoOutdir/node/diskFile1.js b/tests/baselines/reference/project/mapRootAbsolutePathMultifolderNoOutdir/node/diskFile1.js index 23caea4d958d0..0209a1e52cb3c 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathMultifolderNoOutdir/node/diskFile1.js +++ b/tests/baselines/reference/project/mapRootAbsolutePathMultifolderNoOutdir/node/diskFile1.js @@ -1,5 +1,5 @@ var m2_a1 = 10; -var m2_c1 = (function () { +var m2_c1 = /** @class */ (function () { function m2_c1() { } return m2_c1; diff --git a/tests/baselines/reference/project/mapRootAbsolutePathMultifolderNoOutdir/node/ref/m1.js b/tests/baselines/reference/project/mapRootAbsolutePathMultifolderNoOutdir/node/ref/m1.js index 6e43f21bdb1aa..59d88164993e7 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathMultifolderNoOutdir/node/ref/m1.js +++ b/tests/baselines/reference/project/mapRootAbsolutePathMultifolderNoOutdir/node/ref/m1.js @@ -1,5 +1,5 @@ var m1_a1 = 10; -var m1_c1 = (function () { +var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; diff --git a/tests/baselines/reference/project/mapRootAbsolutePathMultifolderNoOutdir/node/test.js b/tests/baselines/reference/project/mapRootAbsolutePathMultifolderNoOutdir/node/test.js index a15b4c334cf5e..8dcdfe90435b6 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathMultifolderNoOutdir/node/test.js +++ b/tests/baselines/reference/project/mapRootAbsolutePathMultifolderNoOutdir/node/test.js @@ -1,7 +1,7 @@ /// /// var a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/mapRootAbsolutePathMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/ref/m1.js b/tests/baselines/reference/project/mapRootAbsolutePathMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/ref/m1.js index 6e43f21bdb1aa..59d88164993e7 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/ref/m1.js +++ b/tests/baselines/reference/project/mapRootAbsolutePathMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/ref/m1.js @@ -1,5 +1,5 @@ var m1_a1 = 10; -var m1_c1 = (function () { +var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; diff --git a/tests/baselines/reference/project/mapRootAbsolutePathMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/test.js b/tests/baselines/reference/project/mapRootAbsolutePathMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/test.js index a15b4c334cf5e..8dcdfe90435b6 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/test.js +++ b/tests/baselines/reference/project/mapRootAbsolutePathMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/test.js @@ -1,7 +1,7 @@ /// /// var a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/mapRootAbsolutePathMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder_ref/m2.js b/tests/baselines/reference/project/mapRootAbsolutePathMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder_ref/m2.js index 23caea4d958d0..0209a1e52cb3c 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder_ref/m2.js +++ b/tests/baselines/reference/project/mapRootAbsolutePathMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder_ref/m2.js @@ -1,5 +1,5 @@ var m2_a1 = 10; -var m2_c1 = (function () { +var m2_c1 = /** @class */ (function () { function m2_c1() { } return m2_c1; diff --git a/tests/baselines/reference/project/mapRootAbsolutePathMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/ref/m1.js b/tests/baselines/reference/project/mapRootAbsolutePathMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/ref/m1.js index 6e43f21bdb1aa..59d88164993e7 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/ref/m1.js +++ b/tests/baselines/reference/project/mapRootAbsolutePathMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/ref/m1.js @@ -1,5 +1,5 @@ var m1_a1 = 10; -var m1_c1 = (function () { +var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; diff --git a/tests/baselines/reference/project/mapRootAbsolutePathMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/test.js b/tests/baselines/reference/project/mapRootAbsolutePathMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/test.js index a15b4c334cf5e..8dcdfe90435b6 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/test.js +++ b/tests/baselines/reference/project/mapRootAbsolutePathMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/test.js @@ -1,7 +1,7 @@ /// /// var a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/mapRootAbsolutePathMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder_ref/m2.js b/tests/baselines/reference/project/mapRootAbsolutePathMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder_ref/m2.js index 23caea4d958d0..0209a1e52cb3c 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder_ref/m2.js +++ b/tests/baselines/reference/project/mapRootAbsolutePathMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder_ref/m2.js @@ -1,5 +1,5 @@ var m2_a1 = 10; -var m2_c1 = (function () { +var m2_c1 = /** @class */ (function () { function m2_c1() { } return m2_c1; diff --git a/tests/baselines/reference/project/mapRootAbsolutePathMultifolderSpecifyOutputFile/amd/bin/test.js b/tests/baselines/reference/project/mapRootAbsolutePathMultifolderSpecifyOutputFile/amd/bin/test.js index f658a89ca9dc7..33d2121f2dac9 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathMultifolderSpecifyOutputFile/amd/bin/test.js +++ b/tests/baselines/reference/project/mapRootAbsolutePathMultifolderSpecifyOutputFile/amd/bin/test.js @@ -1,5 +1,5 @@ var m1_a1 = 10; -var m1_c1 = (function () { +var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; @@ -9,7 +9,7 @@ function m1_f1() { return m1_instance1; } var m2_a1 = 10; -var m2_c1 = (function () { +var m2_c1 = /** @class */ (function () { function m2_c1() { } return m2_c1; @@ -21,7 +21,7 @@ function m2_f1() { /// /// var a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/mapRootAbsolutePathMultifolderSpecifyOutputFile/node/bin/test.js b/tests/baselines/reference/project/mapRootAbsolutePathMultifolderSpecifyOutputFile/node/bin/test.js index f658a89ca9dc7..33d2121f2dac9 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathMultifolderSpecifyOutputFile/node/bin/test.js +++ b/tests/baselines/reference/project/mapRootAbsolutePathMultifolderSpecifyOutputFile/node/bin/test.js @@ -1,5 +1,5 @@ var m1_a1 = 10; -var m1_c1 = (function () { +var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; @@ -9,7 +9,7 @@ function m1_f1() { return m1_instance1; } var m2_a1 = 10; -var m2_c1 = (function () { +var m2_c1 = /** @class */ (function () { function m2_c1() { } return m2_c1; @@ -21,7 +21,7 @@ function m2_f1() { /// /// var a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/mapRootAbsolutePathSimpleNoOutdir/amd/m1.js b/tests/baselines/reference/project/mapRootAbsolutePathSimpleNoOutdir/amd/m1.js index 959473054178c..9212991194f3a 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathSimpleNoOutdir/amd/m1.js +++ b/tests/baselines/reference/project/mapRootAbsolutePathSimpleNoOutdir/amd/m1.js @@ -1,5 +1,5 @@ var m1_a1 = 10; -var m1_c1 = (function () { +var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; diff --git a/tests/baselines/reference/project/mapRootAbsolutePathSimpleNoOutdir/amd/test.js b/tests/baselines/reference/project/mapRootAbsolutePathSimpleNoOutdir/amd/test.js index 907727092db71..3bfd41bf7a272 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathSimpleNoOutdir/amd/test.js +++ b/tests/baselines/reference/project/mapRootAbsolutePathSimpleNoOutdir/amd/test.js @@ -1,6 +1,6 @@ /// var a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/mapRootAbsolutePathSimpleNoOutdir/node/m1.js b/tests/baselines/reference/project/mapRootAbsolutePathSimpleNoOutdir/node/m1.js index 959473054178c..9212991194f3a 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathSimpleNoOutdir/node/m1.js +++ b/tests/baselines/reference/project/mapRootAbsolutePathSimpleNoOutdir/node/m1.js @@ -1,5 +1,5 @@ var m1_a1 = 10; -var m1_c1 = (function () { +var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; diff --git a/tests/baselines/reference/project/mapRootAbsolutePathSimpleNoOutdir/node/test.js b/tests/baselines/reference/project/mapRootAbsolutePathSimpleNoOutdir/node/test.js index 907727092db71..3bfd41bf7a272 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathSimpleNoOutdir/node/test.js +++ b/tests/baselines/reference/project/mapRootAbsolutePathSimpleNoOutdir/node/test.js @@ -1,6 +1,6 @@ /// var a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/mapRootAbsolutePathSimpleSpecifyOutputDirectory/amd/outdir/simple/m1.js b/tests/baselines/reference/project/mapRootAbsolutePathSimpleSpecifyOutputDirectory/amd/outdir/simple/m1.js index 959473054178c..9212991194f3a 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathSimpleSpecifyOutputDirectory/amd/outdir/simple/m1.js +++ b/tests/baselines/reference/project/mapRootAbsolutePathSimpleSpecifyOutputDirectory/amd/outdir/simple/m1.js @@ -1,5 +1,5 @@ var m1_a1 = 10; -var m1_c1 = (function () { +var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; diff --git a/tests/baselines/reference/project/mapRootAbsolutePathSimpleSpecifyOutputDirectory/amd/outdir/simple/test.js b/tests/baselines/reference/project/mapRootAbsolutePathSimpleSpecifyOutputDirectory/amd/outdir/simple/test.js index 907727092db71..3bfd41bf7a272 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathSimpleSpecifyOutputDirectory/amd/outdir/simple/test.js +++ b/tests/baselines/reference/project/mapRootAbsolutePathSimpleSpecifyOutputDirectory/amd/outdir/simple/test.js @@ -1,6 +1,6 @@ /// var a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/mapRootAbsolutePathSimpleSpecifyOutputDirectory/node/outdir/simple/m1.js b/tests/baselines/reference/project/mapRootAbsolutePathSimpleSpecifyOutputDirectory/node/outdir/simple/m1.js index 959473054178c..9212991194f3a 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathSimpleSpecifyOutputDirectory/node/outdir/simple/m1.js +++ b/tests/baselines/reference/project/mapRootAbsolutePathSimpleSpecifyOutputDirectory/node/outdir/simple/m1.js @@ -1,5 +1,5 @@ var m1_a1 = 10; -var m1_c1 = (function () { +var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; diff --git a/tests/baselines/reference/project/mapRootAbsolutePathSimpleSpecifyOutputDirectory/node/outdir/simple/test.js b/tests/baselines/reference/project/mapRootAbsolutePathSimpleSpecifyOutputDirectory/node/outdir/simple/test.js index 907727092db71..3bfd41bf7a272 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathSimpleSpecifyOutputDirectory/node/outdir/simple/test.js +++ b/tests/baselines/reference/project/mapRootAbsolutePathSimpleSpecifyOutputDirectory/node/outdir/simple/test.js @@ -1,6 +1,6 @@ /// var a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/mapRootAbsolutePathSimpleSpecifyOutputFile/amd/bin/test.js b/tests/baselines/reference/project/mapRootAbsolutePathSimpleSpecifyOutputFile/amd/bin/test.js index 5325afdbd55ec..ad38ecf77a18b 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathSimpleSpecifyOutputFile/amd/bin/test.js +++ b/tests/baselines/reference/project/mapRootAbsolutePathSimpleSpecifyOutputFile/amd/bin/test.js @@ -1,5 +1,5 @@ var m1_a1 = 10; -var m1_c1 = (function () { +var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; @@ -10,7 +10,7 @@ function m1_f1() { } /// var a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/mapRootAbsolutePathSimpleSpecifyOutputFile/node/bin/test.js b/tests/baselines/reference/project/mapRootAbsolutePathSimpleSpecifyOutputFile/node/bin/test.js index 5325afdbd55ec..ad38ecf77a18b 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathSimpleSpecifyOutputFile/node/bin/test.js +++ b/tests/baselines/reference/project/mapRootAbsolutePathSimpleSpecifyOutputFile/node/bin/test.js @@ -1,5 +1,5 @@ var m1_a1 = 10; -var m1_c1 = (function () { +var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; @@ -10,7 +10,7 @@ function m1_f1() { } /// var a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/mapRootAbsolutePathSingleFileNoOutdir/amd/test.js b/tests/baselines/reference/project/mapRootAbsolutePathSingleFileNoOutdir/amd/test.js index f299e0d0080e1..6e93c5d9730df 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathSingleFileNoOutdir/amd/test.js +++ b/tests/baselines/reference/project/mapRootAbsolutePathSingleFileNoOutdir/amd/test.js @@ -1,5 +1,5 @@ var a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/mapRootAbsolutePathSingleFileNoOutdir/node/test.js b/tests/baselines/reference/project/mapRootAbsolutePathSingleFileNoOutdir/node/test.js index f299e0d0080e1..6e93c5d9730df 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathSingleFileNoOutdir/node/test.js +++ b/tests/baselines/reference/project/mapRootAbsolutePathSingleFileNoOutdir/node/test.js @@ -1,5 +1,5 @@ var a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/mapRootAbsolutePathSingleFileSpecifyOutputDirectory/amd/outdir/simple/test.js b/tests/baselines/reference/project/mapRootAbsolutePathSingleFileSpecifyOutputDirectory/amd/outdir/simple/test.js index f299e0d0080e1..6e93c5d9730df 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathSingleFileSpecifyOutputDirectory/amd/outdir/simple/test.js +++ b/tests/baselines/reference/project/mapRootAbsolutePathSingleFileSpecifyOutputDirectory/amd/outdir/simple/test.js @@ -1,5 +1,5 @@ var a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/mapRootAbsolutePathSingleFileSpecifyOutputDirectory/node/outdir/simple/test.js b/tests/baselines/reference/project/mapRootAbsolutePathSingleFileSpecifyOutputDirectory/node/outdir/simple/test.js index f299e0d0080e1..6e93c5d9730df 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathSingleFileSpecifyOutputDirectory/node/outdir/simple/test.js +++ b/tests/baselines/reference/project/mapRootAbsolutePathSingleFileSpecifyOutputDirectory/node/outdir/simple/test.js @@ -1,5 +1,5 @@ var a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/mapRootAbsolutePathSingleFileSpecifyOutputFile/amd/bin/test.js b/tests/baselines/reference/project/mapRootAbsolutePathSingleFileSpecifyOutputFile/amd/bin/test.js index f299e0d0080e1..6e93c5d9730df 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathSingleFileSpecifyOutputFile/amd/bin/test.js +++ b/tests/baselines/reference/project/mapRootAbsolutePathSingleFileSpecifyOutputFile/amd/bin/test.js @@ -1,5 +1,5 @@ var a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/mapRootAbsolutePathSingleFileSpecifyOutputFile/node/bin/test.js b/tests/baselines/reference/project/mapRootAbsolutePathSingleFileSpecifyOutputFile/node/bin/test.js index f299e0d0080e1..6e93c5d9730df 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathSingleFileSpecifyOutputFile/node/bin/test.js +++ b/tests/baselines/reference/project/mapRootAbsolutePathSingleFileSpecifyOutputFile/node/bin/test.js @@ -1,5 +1,5 @@ var a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/mapRootAbsolutePathSubfolderNoOutdir/amd/ref/m1.js b/tests/baselines/reference/project/mapRootAbsolutePathSubfolderNoOutdir/amd/ref/m1.js index 7d09551625eb7..ee0a86fef01ed 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathSubfolderNoOutdir/amd/ref/m1.js +++ b/tests/baselines/reference/project/mapRootAbsolutePathSubfolderNoOutdir/amd/ref/m1.js @@ -1,5 +1,5 @@ var m1_a1 = 10; -var m1_c1 = (function () { +var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; diff --git a/tests/baselines/reference/project/mapRootAbsolutePathSubfolderNoOutdir/amd/test.js b/tests/baselines/reference/project/mapRootAbsolutePathSubfolderNoOutdir/amd/test.js index 2ca0fd71ddebb..a8d5c333e73fa 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathSubfolderNoOutdir/amd/test.js +++ b/tests/baselines/reference/project/mapRootAbsolutePathSubfolderNoOutdir/amd/test.js @@ -1,6 +1,6 @@ /// var a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/mapRootAbsolutePathSubfolderNoOutdir/node/ref/m1.js b/tests/baselines/reference/project/mapRootAbsolutePathSubfolderNoOutdir/node/ref/m1.js index 7d09551625eb7..ee0a86fef01ed 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathSubfolderNoOutdir/node/ref/m1.js +++ b/tests/baselines/reference/project/mapRootAbsolutePathSubfolderNoOutdir/node/ref/m1.js @@ -1,5 +1,5 @@ var m1_a1 = 10; -var m1_c1 = (function () { +var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; diff --git a/tests/baselines/reference/project/mapRootAbsolutePathSubfolderNoOutdir/node/test.js b/tests/baselines/reference/project/mapRootAbsolutePathSubfolderNoOutdir/node/test.js index 2ca0fd71ddebb..a8d5c333e73fa 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathSubfolderNoOutdir/node/test.js +++ b/tests/baselines/reference/project/mapRootAbsolutePathSubfolderNoOutdir/node/test.js @@ -1,6 +1,6 @@ /// var a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/mapRootAbsolutePathSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js b/tests/baselines/reference/project/mapRootAbsolutePathSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js index 7d09551625eb7..ee0a86fef01ed 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js +++ b/tests/baselines/reference/project/mapRootAbsolutePathSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js @@ -1,5 +1,5 @@ var m1_a1 = 10; -var m1_c1 = (function () { +var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; diff --git a/tests/baselines/reference/project/mapRootAbsolutePathSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js b/tests/baselines/reference/project/mapRootAbsolutePathSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js index 2ca0fd71ddebb..a8d5c333e73fa 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js +++ b/tests/baselines/reference/project/mapRootAbsolutePathSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js @@ -1,6 +1,6 @@ /// var a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/mapRootAbsolutePathSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js b/tests/baselines/reference/project/mapRootAbsolutePathSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js index 7d09551625eb7..ee0a86fef01ed 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js +++ b/tests/baselines/reference/project/mapRootAbsolutePathSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js @@ -1,5 +1,5 @@ var m1_a1 = 10; -var m1_c1 = (function () { +var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; diff --git a/tests/baselines/reference/project/mapRootAbsolutePathSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js b/tests/baselines/reference/project/mapRootAbsolutePathSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js index 2ca0fd71ddebb..a8d5c333e73fa 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js +++ b/tests/baselines/reference/project/mapRootAbsolutePathSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js @@ -1,6 +1,6 @@ /// var a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/mapRootAbsolutePathSubfolderSpecifyOutputFile/amd/bin/test.js b/tests/baselines/reference/project/mapRootAbsolutePathSubfolderSpecifyOutputFile/amd/bin/test.js index 275b5e2116b0d..5cb9a2c6f06f3 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathSubfolderSpecifyOutputFile/amd/bin/test.js +++ b/tests/baselines/reference/project/mapRootAbsolutePathSubfolderSpecifyOutputFile/amd/bin/test.js @@ -1,5 +1,5 @@ var m1_a1 = 10; -var m1_c1 = (function () { +var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; @@ -10,7 +10,7 @@ function m1_f1() { } /// var a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/mapRootAbsolutePathSubfolderSpecifyOutputFile/node/bin/test.js b/tests/baselines/reference/project/mapRootAbsolutePathSubfolderSpecifyOutputFile/node/bin/test.js index 275b5e2116b0d..5cb9a2c6f06f3 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathSubfolderSpecifyOutputFile/node/bin/test.js +++ b/tests/baselines/reference/project/mapRootAbsolutePathSubfolderSpecifyOutputFile/node/bin/test.js @@ -1,5 +1,5 @@ var m1_a1 = 10; -var m1_c1 = (function () { +var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; @@ -10,7 +10,7 @@ function m1_f1() { } /// var a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderNoOutdir/amd/ref/m1.js b/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderNoOutdir/amd/ref/m1.js index e0e2af2b8629b..cc0713358fa6d 100644 --- a/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderNoOutdir/amd/ref/m1.js +++ b/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderNoOutdir/amd/ref/m1.js @@ -1,5 +1,5 @@ var m1_a1 = 10; -var m1_c1 = (function () { +var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; diff --git a/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderNoOutdir/amd/ref/m2.js b/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderNoOutdir/amd/ref/m2.js index c467f0b8be0aa..9f517fb38d8dd 100644 --- a/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderNoOutdir/amd/ref/m2.js +++ b/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderNoOutdir/amd/ref/m2.js @@ -2,7 +2,7 @@ define(["require", "exports"], function (require, exports) { "use strict"; exports.__esModule = true; exports.m2_a1 = 10; - var m2_c1 = (function () { + var m2_c1 = /** @class */ (function () { function m2_c1() { } return m2_c1; diff --git a/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderNoOutdir/amd/test.js b/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderNoOutdir/amd/test.js index f6f5af1aced7f..f65122a725c4a 100644 --- a/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderNoOutdir/amd/test.js +++ b/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderNoOutdir/amd/test.js @@ -1,7 +1,7 @@ /// /// var a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderNoOutdir/node/ref/m1.js b/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderNoOutdir/node/ref/m1.js index e0e2af2b8629b..cc0713358fa6d 100644 --- a/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderNoOutdir/node/ref/m1.js +++ b/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderNoOutdir/node/ref/m1.js @@ -1,5 +1,5 @@ var m1_a1 = 10; -var m1_c1 = (function () { +var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; diff --git a/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderNoOutdir/node/ref/m2.js b/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderNoOutdir/node/ref/m2.js index d43267b1c9a13..a987c6067ba9b 100644 --- a/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderNoOutdir/node/ref/m2.js +++ b/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderNoOutdir/node/ref/m2.js @@ -1,7 +1,7 @@ "use strict"; exports.__esModule = true; exports.m2_a1 = 10; -var m2_c1 = (function () { +var m2_c1 = /** @class */ (function () { function m2_c1() { } return m2_c1; diff --git a/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderNoOutdir/node/test.js b/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderNoOutdir/node/test.js index f6f5af1aced7f..f65122a725c4a 100644 --- a/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderNoOutdir/node/test.js +++ b/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderNoOutdir/node/test.js @@ -1,7 +1,7 @@ /// /// var a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js b/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js index e6670e7a300f0..07de769111d7d 100644 --- a/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js +++ b/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js @@ -1,5 +1,5 @@ var m1_a1 = 10; -var m1_c1 = (function () { +var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; diff --git a/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m2.js b/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m2.js index 9a46a37deb80e..3e14c7e546b2e 100644 --- a/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m2.js +++ b/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m2.js @@ -2,7 +2,7 @@ define(["require", "exports"], function (require, exports) { "use strict"; exports.__esModule = true; exports.m2_a1 = 10; - var m2_c1 = (function () { + var m2_c1 = /** @class */ (function () { function m2_c1() { } return m2_c1; diff --git a/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js b/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js index 347c791053ce1..4c8d72f111961 100644 --- a/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js +++ b/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js @@ -1,7 +1,7 @@ /// /// var a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js b/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js index e6670e7a300f0..07de769111d7d 100644 --- a/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js +++ b/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js @@ -1,5 +1,5 @@ var m1_a1 = 10; -var m1_c1 = (function () { +var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; diff --git a/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m2.js b/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m2.js index 727afdc29fd5a..2bf75f6450d15 100644 --- a/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m2.js +++ b/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m2.js @@ -1,7 +1,7 @@ "use strict"; exports.__esModule = true; exports.m2_a1 = 10; -var m2_c1 = (function () { +var m2_c1 = /** @class */ (function () { function m2_c1() { } return m2_c1; diff --git a/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js b/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js index 347c791053ce1..4c8d72f111961 100644 --- a/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js +++ b/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js @@ -1,7 +1,7 @@ /// /// var a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputFile/amd/bin/test.js b/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputFile/amd/bin/test.js index 2a89c0fc929bc..9797608a00e40 100644 --- a/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputFile/amd/bin/test.js +++ b/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputFile/amd/bin/test.js @@ -1,5 +1,5 @@ var m1_a1 = 10; -var m1_c1 = (function () { +var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; @@ -12,7 +12,7 @@ define("ref/m2", ["require", "exports"], function (require, exports) { "use strict"; exports.__esModule = true; exports.m2_a1 = 10; - var m2_c1 = (function () { + var m2_c1 = /** @class */ (function () { function m2_c1() { } return m2_c1; @@ -27,7 +27,7 @@ define("ref/m2", ["require", "exports"], function (require, exports) { /// /// var a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputFile/node/bin/test.js b/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputFile/node/bin/test.js index c93eed3c7d44c..52016b11f6543 100644 --- a/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputFile/node/bin/test.js +++ b/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputFile/node/bin/test.js @@ -1,5 +1,5 @@ var m1_a1 = 10; -var m1_c1 = (function () { +var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; @@ -11,7 +11,7 @@ function m1_f1() { /// /// var a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/bin/outAndOutDirFile.js b/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/bin/outAndOutDirFile.js index 62af54d370044..b797776ca73e4 100644 --- a/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/bin/outAndOutDirFile.js +++ b/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/bin/outAndOutDirFile.js @@ -1,5 +1,5 @@ var m1_a1 = 10; -var m1_c1 = (function () { +var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; @@ -12,7 +12,7 @@ define("ref/m2", ["require", "exports"], function (require, exports) { "use strict"; exports.__esModule = true; exports.m2_a1 = 10; - var m2_c1 = (function () { + var m2_c1 = /** @class */ (function () { function m2_c1() { } return m2_c1; @@ -27,7 +27,7 @@ define("ref/m2", ["require", "exports"], function (require, exports) { /// /// var a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/bin/outAndOutDirFile.js b/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/bin/outAndOutDirFile.js index 7ec08c6c0a9cb..629413012de17 100644 --- a/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/bin/outAndOutDirFile.js +++ b/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/bin/outAndOutDirFile.js @@ -1,5 +1,5 @@ var m1_a1 = 10; -var m1_c1 = (function () { +var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; @@ -11,7 +11,7 @@ function m1_f1() { /// /// var a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderNoOutdir/amd/diskFile1.js b/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderNoOutdir/amd/diskFile1.js index 6cf63b567ba6e..3a9f9707aad33 100644 --- a/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderNoOutdir/amd/diskFile1.js +++ b/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderNoOutdir/amd/diskFile1.js @@ -2,7 +2,7 @@ define(["require", "exports"], function (require, exports) { "use strict"; exports.__esModule = true; exports.m2_a1 = 10; - var m2_c1 = (function () { + var m2_c1 = /** @class */ (function () { function m2_c1() { } return m2_c1; diff --git a/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderNoOutdir/amd/ref/m1.js b/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderNoOutdir/amd/ref/m1.js index 2a191801c438a..3b0adff902b22 100644 --- a/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderNoOutdir/amd/ref/m1.js +++ b/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderNoOutdir/amd/ref/m1.js @@ -2,7 +2,7 @@ define(["require", "exports"], function (require, exports) { "use strict"; exports.__esModule = true; exports.m1_a1 = 10; - var m1_c1 = (function () { + var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; diff --git a/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderNoOutdir/amd/test.js b/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderNoOutdir/amd/test.js index 2dcea15d05055..6d4047a79c7a8 100644 --- a/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderNoOutdir/amd/test.js +++ b/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderNoOutdir/amd/test.js @@ -2,7 +2,7 @@ define(["require", "exports", "ref/m1", "../outputdir_module_multifolder_ref/m2" "use strict"; exports.__esModule = true; exports.a1 = 10; - var c1 = (function () { + var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderNoOutdir/node/diskFile1.js b/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderNoOutdir/node/diskFile1.js index 28edf7546504a..865cbf3cf226a 100644 --- a/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderNoOutdir/node/diskFile1.js +++ b/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderNoOutdir/node/diskFile1.js @@ -1,7 +1,7 @@ "use strict"; exports.__esModule = true; exports.m2_a1 = 10; -var m2_c1 = (function () { +var m2_c1 = /** @class */ (function () { function m2_c1() { } return m2_c1; diff --git a/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderNoOutdir/node/ref/m1.js b/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderNoOutdir/node/ref/m1.js index 9a8f5b774980b..f852aba031d22 100644 --- a/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderNoOutdir/node/ref/m1.js +++ b/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderNoOutdir/node/ref/m1.js @@ -1,7 +1,7 @@ "use strict"; exports.__esModule = true; exports.m1_a1 = 10; -var m1_c1 = (function () { +var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; diff --git a/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderNoOutdir/node/test.js b/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderNoOutdir/node/test.js index 603b29da7fac8..cad4805b78714 100644 --- a/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderNoOutdir/node/test.js +++ b/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderNoOutdir/node/test.js @@ -3,7 +3,7 @@ exports.__esModule = true; var m1 = require("ref/m1"); var m2 = require("../outputdir_module_multifolder_ref/m2"); exports.a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder/ref/m1.js b/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder/ref/m1.js index 4090486a73038..1759771074898 100644 --- a/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder/ref/m1.js +++ b/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder/ref/m1.js @@ -2,7 +2,7 @@ define(["require", "exports"], function (require, exports) { "use strict"; exports.__esModule = true; exports.m1_a1 = 10; - var m1_c1 = (function () { + var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; diff --git a/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder/test.js b/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder/test.js index f637a581e133f..920ec3292f164 100644 --- a/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder/test.js +++ b/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder/test.js @@ -2,7 +2,7 @@ define(["require", "exports", "ref/m1", "../outputdir_module_multifolder_ref/m2" "use strict"; exports.__esModule = true; exports.a1 = 10; - var c1 = (function () { + var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder_ref/m2.js b/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder_ref/m2.js index fa97d15a89a17..838f343ad9c00 100644 --- a/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder_ref/m2.js +++ b/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder_ref/m2.js @@ -2,7 +2,7 @@ define(["require", "exports"], function (require, exports) { "use strict"; exports.__esModule = true; exports.m2_a1 = 10; - var m2_c1 = (function () { + var m2_c1 = /** @class */ (function () { function m2_c1() { } return m2_c1; diff --git a/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder/ref/m1.js b/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder/ref/m1.js index 8de8d6f84b688..e521b41b9d7ee 100644 --- a/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder/ref/m1.js +++ b/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder/ref/m1.js @@ -1,7 +1,7 @@ "use strict"; exports.__esModule = true; exports.m1_a1 = 10; -var m1_c1 = (function () { +var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; diff --git a/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder/test.js b/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder/test.js index ca070c2062fb7..7fcba1eebf4aa 100644 --- a/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder/test.js +++ b/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder/test.js @@ -3,7 +3,7 @@ exports.__esModule = true; var m1 = require("ref/m1"); var m2 = require("../outputdir_module_multifolder_ref/m2"); exports.a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder_ref/m2.js b/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder_ref/m2.js index 6ce6e73202e8e..c1fffc0820a64 100644 --- a/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder_ref/m2.js +++ b/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder_ref/m2.js @@ -1,7 +1,7 @@ "use strict"; exports.__esModule = true; exports.m2_a1 = 10; -var m2_c1 = (function () { +var m2_c1 = /** @class */ (function () { function m2_c1() { } return m2_c1; diff --git a/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderSpecifyOutputFile/amd/bin/test.js b/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderSpecifyOutputFile/amd/bin/test.js index e4a7bb40897a2..9333a340d566c 100644 --- a/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderSpecifyOutputFile/amd/bin/test.js +++ b/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderSpecifyOutputFile/amd/bin/test.js @@ -2,7 +2,7 @@ define("outputdir_module_multifolder/ref/m1", ["require", "exports"], function ( "use strict"; exports.__esModule = true; exports.m1_a1 = 10; - var m1_c1 = (function () { + var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; @@ -18,7 +18,7 @@ define("outputdir_module_multifolder_ref/m2", ["require", "exports"], function ( "use strict"; exports.__esModule = true; exports.m2_a1 = 10; - var m2_c1 = (function () { + var m2_c1 = /** @class */ (function () { function m2_c1() { } return m2_c1; @@ -34,7 +34,7 @@ define("outputdir_module_multifolder/test", ["require", "exports", "outputdir_mo "use strict"; exports.__esModule = true; exports.a1 = 10; - var c1 = (function () { + var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/mapRootRelativePathModuleSimpleNoOutdir/amd/m1.js b/tests/baselines/reference/project/mapRootRelativePathModuleSimpleNoOutdir/amd/m1.js index b890ae8232aa5..655301cbc4af3 100644 --- a/tests/baselines/reference/project/mapRootRelativePathModuleSimpleNoOutdir/amd/m1.js +++ b/tests/baselines/reference/project/mapRootRelativePathModuleSimpleNoOutdir/amd/m1.js @@ -2,7 +2,7 @@ define(["require", "exports"], function (require, exports) { "use strict"; exports.__esModule = true; exports.m1_a1 = 10; - var m1_c1 = (function () { + var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; diff --git a/tests/baselines/reference/project/mapRootRelativePathModuleSimpleNoOutdir/amd/test.js b/tests/baselines/reference/project/mapRootRelativePathModuleSimpleNoOutdir/amd/test.js index 2cbff5fc156d3..e62c2e6e3a06b 100644 --- a/tests/baselines/reference/project/mapRootRelativePathModuleSimpleNoOutdir/amd/test.js +++ b/tests/baselines/reference/project/mapRootRelativePathModuleSimpleNoOutdir/amd/test.js @@ -2,7 +2,7 @@ define(["require", "exports", "m1"], function (require, exports, m1) { "use strict"; exports.__esModule = true; exports.a1 = 10; - var c1 = (function () { + var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/mapRootRelativePathModuleSimpleNoOutdir/node/m1.js b/tests/baselines/reference/project/mapRootRelativePathModuleSimpleNoOutdir/node/m1.js index a0cc81f5af957..c0cb9b87425d3 100644 --- a/tests/baselines/reference/project/mapRootRelativePathModuleSimpleNoOutdir/node/m1.js +++ b/tests/baselines/reference/project/mapRootRelativePathModuleSimpleNoOutdir/node/m1.js @@ -1,7 +1,7 @@ "use strict"; exports.__esModule = true; exports.m1_a1 = 10; -var m1_c1 = (function () { +var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; diff --git a/tests/baselines/reference/project/mapRootRelativePathModuleSimpleNoOutdir/node/test.js b/tests/baselines/reference/project/mapRootRelativePathModuleSimpleNoOutdir/node/test.js index 2cce36f74c262..9f7b42e5dc2b7 100644 --- a/tests/baselines/reference/project/mapRootRelativePathModuleSimpleNoOutdir/node/test.js +++ b/tests/baselines/reference/project/mapRootRelativePathModuleSimpleNoOutdir/node/test.js @@ -2,7 +2,7 @@ exports.__esModule = true; var m1 = require("m1"); exports.a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/mapRootRelativePathModuleSimpleSpecifyOutputDirectory/amd/outdir/simple/m1.js b/tests/baselines/reference/project/mapRootRelativePathModuleSimpleSpecifyOutputDirectory/amd/outdir/simple/m1.js index f5001a6551e1f..4601192230e38 100644 --- a/tests/baselines/reference/project/mapRootRelativePathModuleSimpleSpecifyOutputDirectory/amd/outdir/simple/m1.js +++ b/tests/baselines/reference/project/mapRootRelativePathModuleSimpleSpecifyOutputDirectory/amd/outdir/simple/m1.js @@ -2,7 +2,7 @@ define(["require", "exports"], function (require, exports) { "use strict"; exports.__esModule = true; exports.m1_a1 = 10; - var m1_c1 = (function () { + var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; diff --git a/tests/baselines/reference/project/mapRootRelativePathModuleSimpleSpecifyOutputDirectory/amd/outdir/simple/test.js b/tests/baselines/reference/project/mapRootRelativePathModuleSimpleSpecifyOutputDirectory/amd/outdir/simple/test.js index 2fb4fbfd5c382..d70b86ff11469 100644 --- a/tests/baselines/reference/project/mapRootRelativePathModuleSimpleSpecifyOutputDirectory/amd/outdir/simple/test.js +++ b/tests/baselines/reference/project/mapRootRelativePathModuleSimpleSpecifyOutputDirectory/amd/outdir/simple/test.js @@ -2,7 +2,7 @@ define(["require", "exports", "m1"], function (require, exports, m1) { "use strict"; exports.__esModule = true; exports.a1 = 10; - var c1 = (function () { + var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/mapRootRelativePathModuleSimpleSpecifyOutputDirectory/node/outdir/simple/m1.js b/tests/baselines/reference/project/mapRootRelativePathModuleSimpleSpecifyOutputDirectory/node/outdir/simple/m1.js index 0110f9dce1662..d9d9f8af73b38 100644 --- a/tests/baselines/reference/project/mapRootRelativePathModuleSimpleSpecifyOutputDirectory/node/outdir/simple/m1.js +++ b/tests/baselines/reference/project/mapRootRelativePathModuleSimpleSpecifyOutputDirectory/node/outdir/simple/m1.js @@ -1,7 +1,7 @@ "use strict"; exports.__esModule = true; exports.m1_a1 = 10; -var m1_c1 = (function () { +var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; diff --git a/tests/baselines/reference/project/mapRootRelativePathModuleSimpleSpecifyOutputDirectory/node/outdir/simple/test.js b/tests/baselines/reference/project/mapRootRelativePathModuleSimpleSpecifyOutputDirectory/node/outdir/simple/test.js index 4849c53d0c431..9d29e355e6452 100644 --- a/tests/baselines/reference/project/mapRootRelativePathModuleSimpleSpecifyOutputDirectory/node/outdir/simple/test.js +++ b/tests/baselines/reference/project/mapRootRelativePathModuleSimpleSpecifyOutputDirectory/node/outdir/simple/test.js @@ -2,7 +2,7 @@ exports.__esModule = true; var m1 = require("m1"); exports.a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/mapRootRelativePathModuleSimpleSpecifyOutputFile/amd/bin/test.js b/tests/baselines/reference/project/mapRootRelativePathModuleSimpleSpecifyOutputFile/amd/bin/test.js index 587721fb87ae8..a90af744d126a 100644 --- a/tests/baselines/reference/project/mapRootRelativePathModuleSimpleSpecifyOutputFile/amd/bin/test.js +++ b/tests/baselines/reference/project/mapRootRelativePathModuleSimpleSpecifyOutputFile/amd/bin/test.js @@ -2,7 +2,7 @@ define("m1", ["require", "exports"], function (require, exports) { "use strict"; exports.__esModule = true; exports.m1_a1 = 10; - var m1_c1 = (function () { + var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; @@ -18,7 +18,7 @@ define("test", ["require", "exports", "m1"], function (require, exports, m1) { "use strict"; exports.__esModule = true; exports.a1 = 10; - var c1 = (function () { + var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderNoOutdir/amd/ref/m1.js b/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderNoOutdir/amd/ref/m1.js index b99a41c8c3cc1..250ad9e5e6082 100644 --- a/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderNoOutdir/amd/ref/m1.js +++ b/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderNoOutdir/amd/ref/m1.js @@ -2,7 +2,7 @@ define(["require", "exports"], function (require, exports) { "use strict"; exports.__esModule = true; exports.m1_a1 = 10; - var m1_c1 = (function () { + var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; diff --git a/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderNoOutdir/amd/test.js b/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderNoOutdir/amd/test.js index c4c2a04f642fd..2bd9f2bb895c9 100644 --- a/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderNoOutdir/amd/test.js +++ b/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderNoOutdir/amd/test.js @@ -2,7 +2,7 @@ define(["require", "exports", "ref/m1"], function (require, exports, m1) { "use strict"; exports.__esModule = true; exports.a1 = 10; - var c1 = (function () { + var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderNoOutdir/node/ref/m1.js b/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderNoOutdir/node/ref/m1.js index 9574bd33b835a..ab11814b5187a 100644 --- a/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderNoOutdir/node/ref/m1.js +++ b/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderNoOutdir/node/ref/m1.js @@ -1,7 +1,7 @@ "use strict"; exports.__esModule = true; exports.m1_a1 = 10; -var m1_c1 = (function () { +var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; diff --git a/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderNoOutdir/node/test.js b/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderNoOutdir/node/test.js index 4ac58aea85631..5f4a85f44e40b 100644 --- a/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderNoOutdir/node/test.js +++ b/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderNoOutdir/node/test.js @@ -2,7 +2,7 @@ exports.__esModule = true; var m1 = require("ref/m1"); exports.a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js b/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js index 2885a499091ac..bef8360387e2b 100644 --- a/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js +++ b/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js @@ -2,7 +2,7 @@ define(["require", "exports"], function (require, exports) { "use strict"; exports.__esModule = true; exports.m1_a1 = 10; - var m1_c1 = (function () { + var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; diff --git a/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js b/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js index 0ee63c4207043..fc3ba36be2265 100644 --- a/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js +++ b/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js @@ -2,7 +2,7 @@ define(["require", "exports", "ref/m1"], function (require, exports, m1) { "use strict"; exports.__esModule = true; exports.a1 = 10; - var c1 = (function () { + var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js b/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js index fa9502d4d6475..11bad359431f7 100644 --- a/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js +++ b/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js @@ -1,7 +1,7 @@ "use strict"; exports.__esModule = true; exports.m1_a1 = 10; -var m1_c1 = (function () { +var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; diff --git a/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js b/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js index cabfd9f98d668..07df1ce61ff2c 100644 --- a/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js +++ b/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js @@ -2,7 +2,7 @@ exports.__esModule = true; var m1 = require("ref/m1"); exports.a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderSpecifyOutputFile/amd/bin/test.js b/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderSpecifyOutputFile/amd/bin/test.js index d6d1268972139..123d332da2b1b 100644 --- a/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderSpecifyOutputFile/amd/bin/test.js +++ b/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderSpecifyOutputFile/amd/bin/test.js @@ -2,7 +2,7 @@ define("ref/m1", ["require", "exports"], function (require, exports) { "use strict"; exports.__esModule = true; exports.m1_a1 = 10; - var m1_c1 = (function () { + var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; @@ -18,7 +18,7 @@ define("test", ["require", "exports", "ref/m1"], function (require, exports, m1) "use strict"; exports.__esModule = true; exports.a1 = 10; - var c1 = (function () { + var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/mapRootRelativePathMultifolderNoOutdir/amd/diskFile1.js b/tests/baselines/reference/project/mapRootRelativePathMultifolderNoOutdir/amd/diskFile1.js index 4e041c379d0ab..b43aaf0f3471a 100644 --- a/tests/baselines/reference/project/mapRootRelativePathMultifolderNoOutdir/amd/diskFile1.js +++ b/tests/baselines/reference/project/mapRootRelativePathMultifolderNoOutdir/amd/diskFile1.js @@ -1,5 +1,5 @@ var m2_a1 = 10; -var m2_c1 = (function () { +var m2_c1 = /** @class */ (function () { function m2_c1() { } return m2_c1; diff --git a/tests/baselines/reference/project/mapRootRelativePathMultifolderNoOutdir/amd/ref/m1.js b/tests/baselines/reference/project/mapRootRelativePathMultifolderNoOutdir/amd/ref/m1.js index 48efad1d91c2b..f88e78c731287 100644 --- a/tests/baselines/reference/project/mapRootRelativePathMultifolderNoOutdir/amd/ref/m1.js +++ b/tests/baselines/reference/project/mapRootRelativePathMultifolderNoOutdir/amd/ref/m1.js @@ -1,5 +1,5 @@ var m1_a1 = 10; -var m1_c1 = (function () { +var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; diff --git a/tests/baselines/reference/project/mapRootRelativePathMultifolderNoOutdir/amd/test.js b/tests/baselines/reference/project/mapRootRelativePathMultifolderNoOutdir/amd/test.js index 5359f0203544a..253a5e4816f95 100644 --- a/tests/baselines/reference/project/mapRootRelativePathMultifolderNoOutdir/amd/test.js +++ b/tests/baselines/reference/project/mapRootRelativePathMultifolderNoOutdir/amd/test.js @@ -1,7 +1,7 @@ /// /// var a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/mapRootRelativePathMultifolderNoOutdir/node/diskFile1.js b/tests/baselines/reference/project/mapRootRelativePathMultifolderNoOutdir/node/diskFile1.js index 4e041c379d0ab..b43aaf0f3471a 100644 --- a/tests/baselines/reference/project/mapRootRelativePathMultifolderNoOutdir/node/diskFile1.js +++ b/tests/baselines/reference/project/mapRootRelativePathMultifolderNoOutdir/node/diskFile1.js @@ -1,5 +1,5 @@ var m2_a1 = 10; -var m2_c1 = (function () { +var m2_c1 = /** @class */ (function () { function m2_c1() { } return m2_c1; diff --git a/tests/baselines/reference/project/mapRootRelativePathMultifolderNoOutdir/node/ref/m1.js b/tests/baselines/reference/project/mapRootRelativePathMultifolderNoOutdir/node/ref/m1.js index 48efad1d91c2b..f88e78c731287 100644 --- a/tests/baselines/reference/project/mapRootRelativePathMultifolderNoOutdir/node/ref/m1.js +++ b/tests/baselines/reference/project/mapRootRelativePathMultifolderNoOutdir/node/ref/m1.js @@ -1,5 +1,5 @@ var m1_a1 = 10; -var m1_c1 = (function () { +var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; diff --git a/tests/baselines/reference/project/mapRootRelativePathMultifolderNoOutdir/node/test.js b/tests/baselines/reference/project/mapRootRelativePathMultifolderNoOutdir/node/test.js index 5359f0203544a..253a5e4816f95 100644 --- a/tests/baselines/reference/project/mapRootRelativePathMultifolderNoOutdir/node/test.js +++ b/tests/baselines/reference/project/mapRootRelativePathMultifolderNoOutdir/node/test.js @@ -1,7 +1,7 @@ /// /// var a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/mapRootRelativePathMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/ref/m1.js b/tests/baselines/reference/project/mapRootRelativePathMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/ref/m1.js index 490ac31736bcb..1ca8cf7b35511 100644 --- a/tests/baselines/reference/project/mapRootRelativePathMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/ref/m1.js +++ b/tests/baselines/reference/project/mapRootRelativePathMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/ref/m1.js @@ -1,5 +1,5 @@ var m1_a1 = 10; -var m1_c1 = (function () { +var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; diff --git a/tests/baselines/reference/project/mapRootRelativePathMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/test.js b/tests/baselines/reference/project/mapRootRelativePathMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/test.js index 36efd82054071..7df31b5ec466b 100644 --- a/tests/baselines/reference/project/mapRootRelativePathMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/test.js +++ b/tests/baselines/reference/project/mapRootRelativePathMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/test.js @@ -1,7 +1,7 @@ /// /// var a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/mapRootRelativePathMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder_ref/m2.js b/tests/baselines/reference/project/mapRootRelativePathMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder_ref/m2.js index 5e8ad54c27b41..28ae66d438360 100644 --- a/tests/baselines/reference/project/mapRootRelativePathMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder_ref/m2.js +++ b/tests/baselines/reference/project/mapRootRelativePathMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder_ref/m2.js @@ -1,5 +1,5 @@ var m2_a1 = 10; -var m2_c1 = (function () { +var m2_c1 = /** @class */ (function () { function m2_c1() { } return m2_c1; diff --git a/tests/baselines/reference/project/mapRootRelativePathMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/ref/m1.js b/tests/baselines/reference/project/mapRootRelativePathMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/ref/m1.js index 490ac31736bcb..1ca8cf7b35511 100644 --- a/tests/baselines/reference/project/mapRootRelativePathMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/ref/m1.js +++ b/tests/baselines/reference/project/mapRootRelativePathMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/ref/m1.js @@ -1,5 +1,5 @@ var m1_a1 = 10; -var m1_c1 = (function () { +var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; diff --git a/tests/baselines/reference/project/mapRootRelativePathMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/test.js b/tests/baselines/reference/project/mapRootRelativePathMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/test.js index 36efd82054071..7df31b5ec466b 100644 --- a/tests/baselines/reference/project/mapRootRelativePathMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/test.js +++ b/tests/baselines/reference/project/mapRootRelativePathMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/test.js @@ -1,7 +1,7 @@ /// /// var a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/mapRootRelativePathMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder_ref/m2.js b/tests/baselines/reference/project/mapRootRelativePathMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder_ref/m2.js index 5e8ad54c27b41..28ae66d438360 100644 --- a/tests/baselines/reference/project/mapRootRelativePathMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder_ref/m2.js +++ b/tests/baselines/reference/project/mapRootRelativePathMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder_ref/m2.js @@ -1,5 +1,5 @@ var m2_a1 = 10; -var m2_c1 = (function () { +var m2_c1 = /** @class */ (function () { function m2_c1() { } return m2_c1; diff --git a/tests/baselines/reference/project/mapRootRelativePathMultifolderSpecifyOutputFile/amd/bin/test.js b/tests/baselines/reference/project/mapRootRelativePathMultifolderSpecifyOutputFile/amd/bin/test.js index 52c907e93a878..edd701b1b184a 100644 --- a/tests/baselines/reference/project/mapRootRelativePathMultifolderSpecifyOutputFile/amd/bin/test.js +++ b/tests/baselines/reference/project/mapRootRelativePathMultifolderSpecifyOutputFile/amd/bin/test.js @@ -1,5 +1,5 @@ var m1_a1 = 10; -var m1_c1 = (function () { +var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; @@ -9,7 +9,7 @@ function m1_f1() { return m1_instance1; } var m2_a1 = 10; -var m2_c1 = (function () { +var m2_c1 = /** @class */ (function () { function m2_c1() { } return m2_c1; @@ -21,7 +21,7 @@ function m2_f1() { /// /// var a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/mapRootRelativePathMultifolderSpecifyOutputFile/node/bin/test.js b/tests/baselines/reference/project/mapRootRelativePathMultifolderSpecifyOutputFile/node/bin/test.js index 52c907e93a878..edd701b1b184a 100644 --- a/tests/baselines/reference/project/mapRootRelativePathMultifolderSpecifyOutputFile/node/bin/test.js +++ b/tests/baselines/reference/project/mapRootRelativePathMultifolderSpecifyOutputFile/node/bin/test.js @@ -1,5 +1,5 @@ var m1_a1 = 10; -var m1_c1 = (function () { +var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; @@ -9,7 +9,7 @@ function m1_f1() { return m1_instance1; } var m2_a1 = 10; -var m2_c1 = (function () { +var m2_c1 = /** @class */ (function () { function m2_c1() { } return m2_c1; @@ -21,7 +21,7 @@ function m2_f1() { /// /// var a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/mapRootRelativePathSimpleNoOutdir/amd/m1.js b/tests/baselines/reference/project/mapRootRelativePathSimpleNoOutdir/amd/m1.js index 027237fe764a9..d67d18300f5c8 100644 --- a/tests/baselines/reference/project/mapRootRelativePathSimpleNoOutdir/amd/m1.js +++ b/tests/baselines/reference/project/mapRootRelativePathSimpleNoOutdir/amd/m1.js @@ -1,5 +1,5 @@ var m1_a1 = 10; -var m1_c1 = (function () { +var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; diff --git a/tests/baselines/reference/project/mapRootRelativePathSimpleNoOutdir/amd/test.js b/tests/baselines/reference/project/mapRootRelativePathSimpleNoOutdir/amd/test.js index c3a81b7d67d26..bd29f7956bd1b 100644 --- a/tests/baselines/reference/project/mapRootRelativePathSimpleNoOutdir/amd/test.js +++ b/tests/baselines/reference/project/mapRootRelativePathSimpleNoOutdir/amd/test.js @@ -1,6 +1,6 @@ /// var a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/mapRootRelativePathSimpleNoOutdir/node/m1.js b/tests/baselines/reference/project/mapRootRelativePathSimpleNoOutdir/node/m1.js index 027237fe764a9..d67d18300f5c8 100644 --- a/tests/baselines/reference/project/mapRootRelativePathSimpleNoOutdir/node/m1.js +++ b/tests/baselines/reference/project/mapRootRelativePathSimpleNoOutdir/node/m1.js @@ -1,5 +1,5 @@ var m1_a1 = 10; -var m1_c1 = (function () { +var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; diff --git a/tests/baselines/reference/project/mapRootRelativePathSimpleNoOutdir/node/test.js b/tests/baselines/reference/project/mapRootRelativePathSimpleNoOutdir/node/test.js index c3a81b7d67d26..bd29f7956bd1b 100644 --- a/tests/baselines/reference/project/mapRootRelativePathSimpleNoOutdir/node/test.js +++ b/tests/baselines/reference/project/mapRootRelativePathSimpleNoOutdir/node/test.js @@ -1,6 +1,6 @@ /// var a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/mapRootRelativePathSimpleSpecifyOutputDirectory/amd/outdir/simple/m1.js b/tests/baselines/reference/project/mapRootRelativePathSimpleSpecifyOutputDirectory/amd/outdir/simple/m1.js index 9f57dc40bbbb7..4f89f9d70815f 100644 --- a/tests/baselines/reference/project/mapRootRelativePathSimpleSpecifyOutputDirectory/amd/outdir/simple/m1.js +++ b/tests/baselines/reference/project/mapRootRelativePathSimpleSpecifyOutputDirectory/amd/outdir/simple/m1.js @@ -1,5 +1,5 @@ var m1_a1 = 10; -var m1_c1 = (function () { +var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; diff --git a/tests/baselines/reference/project/mapRootRelativePathSimpleSpecifyOutputDirectory/amd/outdir/simple/test.js b/tests/baselines/reference/project/mapRootRelativePathSimpleSpecifyOutputDirectory/amd/outdir/simple/test.js index 730a04c3d7faf..5fce84ff18c36 100644 --- a/tests/baselines/reference/project/mapRootRelativePathSimpleSpecifyOutputDirectory/amd/outdir/simple/test.js +++ b/tests/baselines/reference/project/mapRootRelativePathSimpleSpecifyOutputDirectory/amd/outdir/simple/test.js @@ -1,6 +1,6 @@ /// var a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/mapRootRelativePathSimpleSpecifyOutputDirectory/node/outdir/simple/m1.js b/tests/baselines/reference/project/mapRootRelativePathSimpleSpecifyOutputDirectory/node/outdir/simple/m1.js index 9f57dc40bbbb7..4f89f9d70815f 100644 --- a/tests/baselines/reference/project/mapRootRelativePathSimpleSpecifyOutputDirectory/node/outdir/simple/m1.js +++ b/tests/baselines/reference/project/mapRootRelativePathSimpleSpecifyOutputDirectory/node/outdir/simple/m1.js @@ -1,5 +1,5 @@ var m1_a1 = 10; -var m1_c1 = (function () { +var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; diff --git a/tests/baselines/reference/project/mapRootRelativePathSimpleSpecifyOutputDirectory/node/outdir/simple/test.js b/tests/baselines/reference/project/mapRootRelativePathSimpleSpecifyOutputDirectory/node/outdir/simple/test.js index 730a04c3d7faf..5fce84ff18c36 100644 --- a/tests/baselines/reference/project/mapRootRelativePathSimpleSpecifyOutputDirectory/node/outdir/simple/test.js +++ b/tests/baselines/reference/project/mapRootRelativePathSimpleSpecifyOutputDirectory/node/outdir/simple/test.js @@ -1,6 +1,6 @@ /// var a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/mapRootRelativePathSimpleSpecifyOutputFile/amd/bin/test.js b/tests/baselines/reference/project/mapRootRelativePathSimpleSpecifyOutputFile/amd/bin/test.js index 9210e2c4fca8c..ded03237e0857 100644 --- a/tests/baselines/reference/project/mapRootRelativePathSimpleSpecifyOutputFile/amd/bin/test.js +++ b/tests/baselines/reference/project/mapRootRelativePathSimpleSpecifyOutputFile/amd/bin/test.js @@ -1,5 +1,5 @@ var m1_a1 = 10; -var m1_c1 = (function () { +var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; @@ -10,7 +10,7 @@ function m1_f1() { } /// var a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/mapRootRelativePathSimpleSpecifyOutputFile/node/bin/test.js b/tests/baselines/reference/project/mapRootRelativePathSimpleSpecifyOutputFile/node/bin/test.js index 9210e2c4fca8c..ded03237e0857 100644 --- a/tests/baselines/reference/project/mapRootRelativePathSimpleSpecifyOutputFile/node/bin/test.js +++ b/tests/baselines/reference/project/mapRootRelativePathSimpleSpecifyOutputFile/node/bin/test.js @@ -1,5 +1,5 @@ var m1_a1 = 10; -var m1_c1 = (function () { +var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; @@ -10,7 +10,7 @@ function m1_f1() { } /// var a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/mapRootRelativePathSingleFileNoOutdir/amd/test.js b/tests/baselines/reference/project/mapRootRelativePathSingleFileNoOutdir/amd/test.js index 6888a1e428fbd..291871e9e51b0 100644 --- a/tests/baselines/reference/project/mapRootRelativePathSingleFileNoOutdir/amd/test.js +++ b/tests/baselines/reference/project/mapRootRelativePathSingleFileNoOutdir/amd/test.js @@ -1,5 +1,5 @@ var a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/mapRootRelativePathSingleFileNoOutdir/node/test.js b/tests/baselines/reference/project/mapRootRelativePathSingleFileNoOutdir/node/test.js index 6888a1e428fbd..291871e9e51b0 100644 --- a/tests/baselines/reference/project/mapRootRelativePathSingleFileNoOutdir/node/test.js +++ b/tests/baselines/reference/project/mapRootRelativePathSingleFileNoOutdir/node/test.js @@ -1,5 +1,5 @@ var a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/mapRootRelativePathSingleFileSpecifyOutputDirectory/amd/outdir/simple/test.js b/tests/baselines/reference/project/mapRootRelativePathSingleFileSpecifyOutputDirectory/amd/outdir/simple/test.js index 2b699a8260f6d..e4746de99231b 100644 --- a/tests/baselines/reference/project/mapRootRelativePathSingleFileSpecifyOutputDirectory/amd/outdir/simple/test.js +++ b/tests/baselines/reference/project/mapRootRelativePathSingleFileSpecifyOutputDirectory/amd/outdir/simple/test.js @@ -1,5 +1,5 @@ var a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/mapRootRelativePathSingleFileSpecifyOutputDirectory/node/outdir/simple/test.js b/tests/baselines/reference/project/mapRootRelativePathSingleFileSpecifyOutputDirectory/node/outdir/simple/test.js index 2b699a8260f6d..e4746de99231b 100644 --- a/tests/baselines/reference/project/mapRootRelativePathSingleFileSpecifyOutputDirectory/node/outdir/simple/test.js +++ b/tests/baselines/reference/project/mapRootRelativePathSingleFileSpecifyOutputDirectory/node/outdir/simple/test.js @@ -1,5 +1,5 @@ var a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/mapRootRelativePathSingleFileSpecifyOutputFile/amd/bin/test.js b/tests/baselines/reference/project/mapRootRelativePathSingleFileSpecifyOutputFile/amd/bin/test.js index 426a747ed22be..9cadbc896e05d 100644 --- a/tests/baselines/reference/project/mapRootRelativePathSingleFileSpecifyOutputFile/amd/bin/test.js +++ b/tests/baselines/reference/project/mapRootRelativePathSingleFileSpecifyOutputFile/amd/bin/test.js @@ -1,5 +1,5 @@ var a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/mapRootRelativePathSingleFileSpecifyOutputFile/node/bin/test.js b/tests/baselines/reference/project/mapRootRelativePathSingleFileSpecifyOutputFile/node/bin/test.js index 426a747ed22be..9cadbc896e05d 100644 --- a/tests/baselines/reference/project/mapRootRelativePathSingleFileSpecifyOutputFile/node/bin/test.js +++ b/tests/baselines/reference/project/mapRootRelativePathSingleFileSpecifyOutputFile/node/bin/test.js @@ -1,5 +1,5 @@ var a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/mapRootRelativePathSubfolderNoOutdir/amd/ref/m1.js b/tests/baselines/reference/project/mapRootRelativePathSubfolderNoOutdir/amd/ref/m1.js index e0e2af2b8629b..cc0713358fa6d 100644 --- a/tests/baselines/reference/project/mapRootRelativePathSubfolderNoOutdir/amd/ref/m1.js +++ b/tests/baselines/reference/project/mapRootRelativePathSubfolderNoOutdir/amd/ref/m1.js @@ -1,5 +1,5 @@ var m1_a1 = 10; -var m1_c1 = (function () { +var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; diff --git a/tests/baselines/reference/project/mapRootRelativePathSubfolderNoOutdir/amd/test.js b/tests/baselines/reference/project/mapRootRelativePathSubfolderNoOutdir/amd/test.js index 6d7f75fbf9abe..69db0240b76ea 100644 --- a/tests/baselines/reference/project/mapRootRelativePathSubfolderNoOutdir/amd/test.js +++ b/tests/baselines/reference/project/mapRootRelativePathSubfolderNoOutdir/amd/test.js @@ -1,6 +1,6 @@ /// var a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/mapRootRelativePathSubfolderNoOutdir/node/ref/m1.js b/tests/baselines/reference/project/mapRootRelativePathSubfolderNoOutdir/node/ref/m1.js index e0e2af2b8629b..cc0713358fa6d 100644 --- a/tests/baselines/reference/project/mapRootRelativePathSubfolderNoOutdir/node/ref/m1.js +++ b/tests/baselines/reference/project/mapRootRelativePathSubfolderNoOutdir/node/ref/m1.js @@ -1,5 +1,5 @@ var m1_a1 = 10; -var m1_c1 = (function () { +var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; diff --git a/tests/baselines/reference/project/mapRootRelativePathSubfolderNoOutdir/node/test.js b/tests/baselines/reference/project/mapRootRelativePathSubfolderNoOutdir/node/test.js index 6d7f75fbf9abe..69db0240b76ea 100644 --- a/tests/baselines/reference/project/mapRootRelativePathSubfolderNoOutdir/node/test.js +++ b/tests/baselines/reference/project/mapRootRelativePathSubfolderNoOutdir/node/test.js @@ -1,6 +1,6 @@ /// var a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/mapRootRelativePathSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js b/tests/baselines/reference/project/mapRootRelativePathSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js index e6670e7a300f0..07de769111d7d 100644 --- a/tests/baselines/reference/project/mapRootRelativePathSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js +++ b/tests/baselines/reference/project/mapRootRelativePathSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js @@ -1,5 +1,5 @@ var m1_a1 = 10; -var m1_c1 = (function () { +var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; diff --git a/tests/baselines/reference/project/mapRootRelativePathSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js b/tests/baselines/reference/project/mapRootRelativePathSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js index d48af1d07cc13..0e1644b962ee2 100644 --- a/tests/baselines/reference/project/mapRootRelativePathSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js +++ b/tests/baselines/reference/project/mapRootRelativePathSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js @@ -1,6 +1,6 @@ /// var a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/mapRootRelativePathSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js b/tests/baselines/reference/project/mapRootRelativePathSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js index e6670e7a300f0..07de769111d7d 100644 --- a/tests/baselines/reference/project/mapRootRelativePathSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js +++ b/tests/baselines/reference/project/mapRootRelativePathSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js @@ -1,5 +1,5 @@ var m1_a1 = 10; -var m1_c1 = (function () { +var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; diff --git a/tests/baselines/reference/project/mapRootRelativePathSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js b/tests/baselines/reference/project/mapRootRelativePathSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js index d48af1d07cc13..0e1644b962ee2 100644 --- a/tests/baselines/reference/project/mapRootRelativePathSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js +++ b/tests/baselines/reference/project/mapRootRelativePathSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js @@ -1,6 +1,6 @@ /// var a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/mapRootRelativePathSubfolderSpecifyOutputFile/amd/bin/test.js b/tests/baselines/reference/project/mapRootRelativePathSubfolderSpecifyOutputFile/amd/bin/test.js index 30156e6cbcb72..4901f9e34030d 100644 --- a/tests/baselines/reference/project/mapRootRelativePathSubfolderSpecifyOutputFile/amd/bin/test.js +++ b/tests/baselines/reference/project/mapRootRelativePathSubfolderSpecifyOutputFile/amd/bin/test.js @@ -1,5 +1,5 @@ var m1_a1 = 10; -var m1_c1 = (function () { +var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; @@ -10,7 +10,7 @@ function m1_f1() { } /// var a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/mapRootRelativePathSubfolderSpecifyOutputFile/node/bin/test.js b/tests/baselines/reference/project/mapRootRelativePathSubfolderSpecifyOutputFile/node/bin/test.js index 30156e6cbcb72..4901f9e34030d 100644 --- a/tests/baselines/reference/project/mapRootRelativePathSubfolderSpecifyOutputFile/node/bin/test.js +++ b/tests/baselines/reference/project/mapRootRelativePathSubfolderSpecifyOutputFile/node/bin/test.js @@ -1,5 +1,5 @@ var m1_a1 = 10; -var m1_c1 = (function () { +var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; @@ -10,7 +10,7 @@ function m1_f1() { } /// var a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/maprootUrlMixedSubfolderNoOutdir/amd/ref/m1.js b/tests/baselines/reference/project/maprootUrlMixedSubfolderNoOutdir/amd/ref/m1.js index ac9c9fc5839b4..639e6c5846246 100644 --- a/tests/baselines/reference/project/maprootUrlMixedSubfolderNoOutdir/amd/ref/m1.js +++ b/tests/baselines/reference/project/maprootUrlMixedSubfolderNoOutdir/amd/ref/m1.js @@ -1,5 +1,5 @@ var m1_a1 = 10; -var m1_c1 = (function () { +var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; diff --git a/tests/baselines/reference/project/maprootUrlMixedSubfolderNoOutdir/amd/ref/m2.js b/tests/baselines/reference/project/maprootUrlMixedSubfolderNoOutdir/amd/ref/m2.js index f373c246d4867..7960a2f77b3fd 100644 --- a/tests/baselines/reference/project/maprootUrlMixedSubfolderNoOutdir/amd/ref/m2.js +++ b/tests/baselines/reference/project/maprootUrlMixedSubfolderNoOutdir/amd/ref/m2.js @@ -2,7 +2,7 @@ define(["require", "exports"], function (require, exports) { "use strict"; exports.__esModule = true; exports.m2_a1 = 10; - var m2_c1 = (function () { + var m2_c1 = /** @class */ (function () { function m2_c1() { } return m2_c1; diff --git a/tests/baselines/reference/project/maprootUrlMixedSubfolderNoOutdir/amd/test.js b/tests/baselines/reference/project/maprootUrlMixedSubfolderNoOutdir/amd/test.js index a7248649dc7db..e36a1dc17c84a 100644 --- a/tests/baselines/reference/project/maprootUrlMixedSubfolderNoOutdir/amd/test.js +++ b/tests/baselines/reference/project/maprootUrlMixedSubfolderNoOutdir/amd/test.js @@ -1,7 +1,7 @@ /// /// var a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/maprootUrlMixedSubfolderNoOutdir/node/ref/m1.js b/tests/baselines/reference/project/maprootUrlMixedSubfolderNoOutdir/node/ref/m1.js index ac9c9fc5839b4..639e6c5846246 100644 --- a/tests/baselines/reference/project/maprootUrlMixedSubfolderNoOutdir/node/ref/m1.js +++ b/tests/baselines/reference/project/maprootUrlMixedSubfolderNoOutdir/node/ref/m1.js @@ -1,5 +1,5 @@ var m1_a1 = 10; -var m1_c1 = (function () { +var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; diff --git a/tests/baselines/reference/project/maprootUrlMixedSubfolderNoOutdir/node/ref/m2.js b/tests/baselines/reference/project/maprootUrlMixedSubfolderNoOutdir/node/ref/m2.js index 9557c3a613c1c..e0a2ec4f5fb0e 100644 --- a/tests/baselines/reference/project/maprootUrlMixedSubfolderNoOutdir/node/ref/m2.js +++ b/tests/baselines/reference/project/maprootUrlMixedSubfolderNoOutdir/node/ref/m2.js @@ -1,7 +1,7 @@ "use strict"; exports.__esModule = true; exports.m2_a1 = 10; -var m2_c1 = (function () { +var m2_c1 = /** @class */ (function () { function m2_c1() { } return m2_c1; diff --git a/tests/baselines/reference/project/maprootUrlMixedSubfolderNoOutdir/node/test.js b/tests/baselines/reference/project/maprootUrlMixedSubfolderNoOutdir/node/test.js index a7248649dc7db..e36a1dc17c84a 100644 --- a/tests/baselines/reference/project/maprootUrlMixedSubfolderNoOutdir/node/test.js +++ b/tests/baselines/reference/project/maprootUrlMixedSubfolderNoOutdir/node/test.js @@ -1,7 +1,7 @@ /// /// var a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js b/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js index ac9c9fc5839b4..639e6c5846246 100644 --- a/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js +++ b/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js @@ -1,5 +1,5 @@ var m1_a1 = 10; -var m1_c1 = (function () { +var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; diff --git a/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m2.js b/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m2.js index f373c246d4867..7960a2f77b3fd 100644 --- a/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m2.js +++ b/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m2.js @@ -2,7 +2,7 @@ define(["require", "exports"], function (require, exports) { "use strict"; exports.__esModule = true; exports.m2_a1 = 10; - var m2_c1 = (function () { + var m2_c1 = /** @class */ (function () { function m2_c1() { } return m2_c1; diff --git a/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js b/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js index a7248649dc7db..e36a1dc17c84a 100644 --- a/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js +++ b/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js @@ -1,7 +1,7 @@ /// /// var a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js b/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js index ac9c9fc5839b4..639e6c5846246 100644 --- a/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js +++ b/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js @@ -1,5 +1,5 @@ var m1_a1 = 10; -var m1_c1 = (function () { +var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; diff --git a/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m2.js b/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m2.js index 9557c3a613c1c..e0a2ec4f5fb0e 100644 --- a/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m2.js +++ b/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m2.js @@ -1,7 +1,7 @@ "use strict"; exports.__esModule = true; exports.m2_a1 = 10; -var m2_c1 = (function () { +var m2_c1 = /** @class */ (function () { function m2_c1() { } return m2_c1; diff --git a/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js b/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js index a7248649dc7db..e36a1dc17c84a 100644 --- a/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js +++ b/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js @@ -1,7 +1,7 @@ /// /// var a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputFile/amd/bin/test.js b/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputFile/amd/bin/test.js index d9f0f5b153109..aa1d244eccead 100644 --- a/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputFile/amd/bin/test.js +++ b/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputFile/amd/bin/test.js @@ -1,5 +1,5 @@ var m1_a1 = 10; -var m1_c1 = (function () { +var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; @@ -12,7 +12,7 @@ define("ref/m2", ["require", "exports"], function (require, exports) { "use strict"; exports.__esModule = true; exports.m2_a1 = 10; - var m2_c1 = (function () { + var m2_c1 = /** @class */ (function () { function m2_c1() { } return m2_c1; @@ -27,7 +27,7 @@ define("ref/m2", ["require", "exports"], function (require, exports) { /// /// var a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputFile/node/bin/test.js b/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputFile/node/bin/test.js index ec3309b3b1868..a9815ec3ad152 100644 --- a/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputFile/node/bin/test.js +++ b/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputFile/node/bin/test.js @@ -1,5 +1,5 @@ var m1_a1 = 10; -var m1_c1 = (function () { +var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; @@ -11,7 +11,7 @@ function m1_f1() { /// /// var a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/bin/outAndOutDirFile.js b/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/bin/outAndOutDirFile.js index cc3f604524fcc..bbffd27dd54cb 100644 --- a/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/bin/outAndOutDirFile.js +++ b/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/bin/outAndOutDirFile.js @@ -1,5 +1,5 @@ var m1_a1 = 10; -var m1_c1 = (function () { +var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; @@ -12,7 +12,7 @@ define("ref/m2", ["require", "exports"], function (require, exports) { "use strict"; exports.__esModule = true; exports.m2_a1 = 10; - var m2_c1 = (function () { + var m2_c1 = /** @class */ (function () { function m2_c1() { } return m2_c1; @@ -27,7 +27,7 @@ define("ref/m2", ["require", "exports"], function (require, exports) { /// /// var a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/bin/outAndOutDirFile.js b/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/bin/outAndOutDirFile.js index 3e51021ce9b48..1186e804d6307 100644 --- a/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/bin/outAndOutDirFile.js +++ b/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/bin/outAndOutDirFile.js @@ -1,5 +1,5 @@ var m1_a1 = 10; -var m1_c1 = (function () { +var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; @@ -11,7 +11,7 @@ function m1_f1() { /// /// var a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/maprootUrlModuleMultifolderNoOutdir/amd/diskFile1.js b/tests/baselines/reference/project/maprootUrlModuleMultifolderNoOutdir/amd/diskFile1.js index f6057bf162a8e..943f909d5f4ed 100644 --- a/tests/baselines/reference/project/maprootUrlModuleMultifolderNoOutdir/amd/diskFile1.js +++ b/tests/baselines/reference/project/maprootUrlModuleMultifolderNoOutdir/amd/diskFile1.js @@ -2,7 +2,7 @@ define(["require", "exports"], function (require, exports) { "use strict"; exports.__esModule = true; exports.m2_a1 = 10; - var m2_c1 = (function () { + var m2_c1 = /** @class */ (function () { function m2_c1() { } return m2_c1; diff --git a/tests/baselines/reference/project/maprootUrlModuleMultifolderNoOutdir/amd/ref/m1.js b/tests/baselines/reference/project/maprootUrlModuleMultifolderNoOutdir/amd/ref/m1.js index 196a531920ba4..a37db1abb9bf6 100644 --- a/tests/baselines/reference/project/maprootUrlModuleMultifolderNoOutdir/amd/ref/m1.js +++ b/tests/baselines/reference/project/maprootUrlModuleMultifolderNoOutdir/amd/ref/m1.js @@ -2,7 +2,7 @@ define(["require", "exports"], function (require, exports) { "use strict"; exports.__esModule = true; exports.m1_a1 = 10; - var m1_c1 = (function () { + var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; diff --git a/tests/baselines/reference/project/maprootUrlModuleMultifolderNoOutdir/amd/test.js b/tests/baselines/reference/project/maprootUrlModuleMultifolderNoOutdir/amd/test.js index b4a0aa2d25d1d..c1587604a9d68 100644 --- a/tests/baselines/reference/project/maprootUrlModuleMultifolderNoOutdir/amd/test.js +++ b/tests/baselines/reference/project/maprootUrlModuleMultifolderNoOutdir/amd/test.js @@ -2,7 +2,7 @@ define(["require", "exports", "ref/m1", "../outputdir_module_multifolder_ref/m2" "use strict"; exports.__esModule = true; exports.a1 = 10; - var c1 = (function () { + var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/maprootUrlModuleMultifolderNoOutdir/node/diskFile1.js b/tests/baselines/reference/project/maprootUrlModuleMultifolderNoOutdir/node/diskFile1.js index 9324632b44acb..f5e0e91d43fb3 100644 --- a/tests/baselines/reference/project/maprootUrlModuleMultifolderNoOutdir/node/diskFile1.js +++ b/tests/baselines/reference/project/maprootUrlModuleMultifolderNoOutdir/node/diskFile1.js @@ -1,7 +1,7 @@ "use strict"; exports.__esModule = true; exports.m2_a1 = 10; -var m2_c1 = (function () { +var m2_c1 = /** @class */ (function () { function m2_c1() { } return m2_c1; diff --git a/tests/baselines/reference/project/maprootUrlModuleMultifolderNoOutdir/node/ref/m1.js b/tests/baselines/reference/project/maprootUrlModuleMultifolderNoOutdir/node/ref/m1.js index f590179583204..dd02d1483b77c 100644 --- a/tests/baselines/reference/project/maprootUrlModuleMultifolderNoOutdir/node/ref/m1.js +++ b/tests/baselines/reference/project/maprootUrlModuleMultifolderNoOutdir/node/ref/m1.js @@ -1,7 +1,7 @@ "use strict"; exports.__esModule = true; exports.m1_a1 = 10; -var m1_c1 = (function () { +var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; diff --git a/tests/baselines/reference/project/maprootUrlModuleMultifolderNoOutdir/node/test.js b/tests/baselines/reference/project/maprootUrlModuleMultifolderNoOutdir/node/test.js index e8734ca6d27b0..59517f026bb4e 100644 --- a/tests/baselines/reference/project/maprootUrlModuleMultifolderNoOutdir/node/test.js +++ b/tests/baselines/reference/project/maprootUrlModuleMultifolderNoOutdir/node/test.js @@ -3,7 +3,7 @@ exports.__esModule = true; var m1 = require("ref/m1"); var m2 = require("../outputdir_module_multifolder_ref/m2"); exports.a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/maprootUrlModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder/ref/m1.js b/tests/baselines/reference/project/maprootUrlModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder/ref/m1.js index 196a531920ba4..a37db1abb9bf6 100644 --- a/tests/baselines/reference/project/maprootUrlModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder/ref/m1.js +++ b/tests/baselines/reference/project/maprootUrlModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder/ref/m1.js @@ -2,7 +2,7 @@ define(["require", "exports"], function (require, exports) { "use strict"; exports.__esModule = true; exports.m1_a1 = 10; - var m1_c1 = (function () { + var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; diff --git a/tests/baselines/reference/project/maprootUrlModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder/test.js b/tests/baselines/reference/project/maprootUrlModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder/test.js index b4a0aa2d25d1d..c1587604a9d68 100644 --- a/tests/baselines/reference/project/maprootUrlModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder/test.js +++ b/tests/baselines/reference/project/maprootUrlModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder/test.js @@ -2,7 +2,7 @@ define(["require", "exports", "ref/m1", "../outputdir_module_multifolder_ref/m2" "use strict"; exports.__esModule = true; exports.a1 = 10; - var c1 = (function () { + var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/maprootUrlModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder_ref/m2.js b/tests/baselines/reference/project/maprootUrlModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder_ref/m2.js index f6057bf162a8e..943f909d5f4ed 100644 --- a/tests/baselines/reference/project/maprootUrlModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder_ref/m2.js +++ b/tests/baselines/reference/project/maprootUrlModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder_ref/m2.js @@ -2,7 +2,7 @@ define(["require", "exports"], function (require, exports) { "use strict"; exports.__esModule = true; exports.m2_a1 = 10; - var m2_c1 = (function () { + var m2_c1 = /** @class */ (function () { function m2_c1() { } return m2_c1; diff --git a/tests/baselines/reference/project/maprootUrlModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder/ref/m1.js b/tests/baselines/reference/project/maprootUrlModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder/ref/m1.js index f590179583204..dd02d1483b77c 100644 --- a/tests/baselines/reference/project/maprootUrlModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder/ref/m1.js +++ b/tests/baselines/reference/project/maprootUrlModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder/ref/m1.js @@ -1,7 +1,7 @@ "use strict"; exports.__esModule = true; exports.m1_a1 = 10; -var m1_c1 = (function () { +var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; diff --git a/tests/baselines/reference/project/maprootUrlModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder/test.js b/tests/baselines/reference/project/maprootUrlModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder/test.js index e8734ca6d27b0..59517f026bb4e 100644 --- a/tests/baselines/reference/project/maprootUrlModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder/test.js +++ b/tests/baselines/reference/project/maprootUrlModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder/test.js @@ -3,7 +3,7 @@ exports.__esModule = true; var m1 = require("ref/m1"); var m2 = require("../outputdir_module_multifolder_ref/m2"); exports.a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/maprootUrlModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder_ref/m2.js b/tests/baselines/reference/project/maprootUrlModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder_ref/m2.js index 9324632b44acb..f5e0e91d43fb3 100644 --- a/tests/baselines/reference/project/maprootUrlModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder_ref/m2.js +++ b/tests/baselines/reference/project/maprootUrlModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder_ref/m2.js @@ -1,7 +1,7 @@ "use strict"; exports.__esModule = true; exports.m2_a1 = 10; -var m2_c1 = (function () { +var m2_c1 = /** @class */ (function () { function m2_c1() { } return m2_c1; diff --git a/tests/baselines/reference/project/maprootUrlModuleMultifolderSpecifyOutputFile/amd/bin/test.js b/tests/baselines/reference/project/maprootUrlModuleMultifolderSpecifyOutputFile/amd/bin/test.js index 1ea95ed9ba028..434d0a8e9e806 100644 --- a/tests/baselines/reference/project/maprootUrlModuleMultifolderSpecifyOutputFile/amd/bin/test.js +++ b/tests/baselines/reference/project/maprootUrlModuleMultifolderSpecifyOutputFile/amd/bin/test.js @@ -2,7 +2,7 @@ define("outputdir_module_multifolder/ref/m1", ["require", "exports"], function ( "use strict"; exports.__esModule = true; exports.m1_a1 = 10; - var m1_c1 = (function () { + var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; @@ -18,7 +18,7 @@ define("outputdir_module_multifolder_ref/m2", ["require", "exports"], function ( "use strict"; exports.__esModule = true; exports.m2_a1 = 10; - var m2_c1 = (function () { + var m2_c1 = /** @class */ (function () { function m2_c1() { } return m2_c1; @@ -34,7 +34,7 @@ define("outputdir_module_multifolder/test", ["require", "exports", "outputdir_mo "use strict"; exports.__esModule = true; exports.a1 = 10; - var c1 = (function () { + var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/maprootUrlModuleSimpleNoOutdir/amd/m1.js b/tests/baselines/reference/project/maprootUrlModuleSimpleNoOutdir/amd/m1.js index fc2d3408b2be8..182a09e5c1ac8 100644 --- a/tests/baselines/reference/project/maprootUrlModuleSimpleNoOutdir/amd/m1.js +++ b/tests/baselines/reference/project/maprootUrlModuleSimpleNoOutdir/amd/m1.js @@ -2,7 +2,7 @@ define(["require", "exports"], function (require, exports) { "use strict"; exports.__esModule = true; exports.m1_a1 = 10; - var m1_c1 = (function () { + var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; diff --git a/tests/baselines/reference/project/maprootUrlModuleSimpleNoOutdir/amd/test.js b/tests/baselines/reference/project/maprootUrlModuleSimpleNoOutdir/amd/test.js index 1e0dea14dc890..a465883de4a9c 100644 --- a/tests/baselines/reference/project/maprootUrlModuleSimpleNoOutdir/amd/test.js +++ b/tests/baselines/reference/project/maprootUrlModuleSimpleNoOutdir/amd/test.js @@ -2,7 +2,7 @@ define(["require", "exports", "m1"], function (require, exports, m1) { "use strict"; exports.__esModule = true; exports.a1 = 10; - var c1 = (function () { + var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/maprootUrlModuleSimpleNoOutdir/node/m1.js b/tests/baselines/reference/project/maprootUrlModuleSimpleNoOutdir/node/m1.js index 8a7e9f1069e62..066640b0ef712 100644 --- a/tests/baselines/reference/project/maprootUrlModuleSimpleNoOutdir/node/m1.js +++ b/tests/baselines/reference/project/maprootUrlModuleSimpleNoOutdir/node/m1.js @@ -1,7 +1,7 @@ "use strict"; exports.__esModule = true; exports.m1_a1 = 10; -var m1_c1 = (function () { +var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; diff --git a/tests/baselines/reference/project/maprootUrlModuleSimpleNoOutdir/node/test.js b/tests/baselines/reference/project/maprootUrlModuleSimpleNoOutdir/node/test.js index d7e6d6733402b..76301cf25fea5 100644 --- a/tests/baselines/reference/project/maprootUrlModuleSimpleNoOutdir/node/test.js +++ b/tests/baselines/reference/project/maprootUrlModuleSimpleNoOutdir/node/test.js @@ -2,7 +2,7 @@ exports.__esModule = true; var m1 = require("m1"); exports.a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/maprootUrlModuleSimpleSpecifyOutputDirectory/amd/outdir/simple/m1.js b/tests/baselines/reference/project/maprootUrlModuleSimpleSpecifyOutputDirectory/amd/outdir/simple/m1.js index fc2d3408b2be8..182a09e5c1ac8 100644 --- a/tests/baselines/reference/project/maprootUrlModuleSimpleSpecifyOutputDirectory/amd/outdir/simple/m1.js +++ b/tests/baselines/reference/project/maprootUrlModuleSimpleSpecifyOutputDirectory/amd/outdir/simple/m1.js @@ -2,7 +2,7 @@ define(["require", "exports"], function (require, exports) { "use strict"; exports.__esModule = true; exports.m1_a1 = 10; - var m1_c1 = (function () { + var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; diff --git a/tests/baselines/reference/project/maprootUrlModuleSimpleSpecifyOutputDirectory/amd/outdir/simple/test.js b/tests/baselines/reference/project/maprootUrlModuleSimpleSpecifyOutputDirectory/amd/outdir/simple/test.js index 1e0dea14dc890..a465883de4a9c 100644 --- a/tests/baselines/reference/project/maprootUrlModuleSimpleSpecifyOutputDirectory/amd/outdir/simple/test.js +++ b/tests/baselines/reference/project/maprootUrlModuleSimpleSpecifyOutputDirectory/amd/outdir/simple/test.js @@ -2,7 +2,7 @@ define(["require", "exports", "m1"], function (require, exports, m1) { "use strict"; exports.__esModule = true; exports.a1 = 10; - var c1 = (function () { + var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/maprootUrlModuleSimpleSpecifyOutputDirectory/node/outdir/simple/m1.js b/tests/baselines/reference/project/maprootUrlModuleSimpleSpecifyOutputDirectory/node/outdir/simple/m1.js index 8a7e9f1069e62..066640b0ef712 100644 --- a/tests/baselines/reference/project/maprootUrlModuleSimpleSpecifyOutputDirectory/node/outdir/simple/m1.js +++ b/tests/baselines/reference/project/maprootUrlModuleSimpleSpecifyOutputDirectory/node/outdir/simple/m1.js @@ -1,7 +1,7 @@ "use strict"; exports.__esModule = true; exports.m1_a1 = 10; -var m1_c1 = (function () { +var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; diff --git a/tests/baselines/reference/project/maprootUrlModuleSimpleSpecifyOutputDirectory/node/outdir/simple/test.js b/tests/baselines/reference/project/maprootUrlModuleSimpleSpecifyOutputDirectory/node/outdir/simple/test.js index d7e6d6733402b..76301cf25fea5 100644 --- a/tests/baselines/reference/project/maprootUrlModuleSimpleSpecifyOutputDirectory/node/outdir/simple/test.js +++ b/tests/baselines/reference/project/maprootUrlModuleSimpleSpecifyOutputDirectory/node/outdir/simple/test.js @@ -2,7 +2,7 @@ exports.__esModule = true; var m1 = require("m1"); exports.a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/maprootUrlModuleSimpleSpecifyOutputFile/amd/bin/test.js b/tests/baselines/reference/project/maprootUrlModuleSimpleSpecifyOutputFile/amd/bin/test.js index d19b91956859e..a047c68088918 100644 --- a/tests/baselines/reference/project/maprootUrlModuleSimpleSpecifyOutputFile/amd/bin/test.js +++ b/tests/baselines/reference/project/maprootUrlModuleSimpleSpecifyOutputFile/amd/bin/test.js @@ -2,7 +2,7 @@ define("m1", ["require", "exports"], function (require, exports) { "use strict"; exports.__esModule = true; exports.m1_a1 = 10; - var m1_c1 = (function () { + var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; @@ -18,7 +18,7 @@ define("test", ["require", "exports", "m1"], function (require, exports, m1) { "use strict"; exports.__esModule = true; exports.a1 = 10; - var c1 = (function () { + var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/maprootUrlModuleSubfolderNoOutdir/amd/ref/m1.js b/tests/baselines/reference/project/maprootUrlModuleSubfolderNoOutdir/amd/ref/m1.js index 5aa59f6dc9259..7bac36fd8b619 100644 --- a/tests/baselines/reference/project/maprootUrlModuleSubfolderNoOutdir/amd/ref/m1.js +++ b/tests/baselines/reference/project/maprootUrlModuleSubfolderNoOutdir/amd/ref/m1.js @@ -2,7 +2,7 @@ define(["require", "exports"], function (require, exports) { "use strict"; exports.__esModule = true; exports.m1_a1 = 10; - var m1_c1 = (function () { + var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; diff --git a/tests/baselines/reference/project/maprootUrlModuleSubfolderNoOutdir/amd/test.js b/tests/baselines/reference/project/maprootUrlModuleSubfolderNoOutdir/amd/test.js index d56cdf72bf299..144b90d0d6528 100644 --- a/tests/baselines/reference/project/maprootUrlModuleSubfolderNoOutdir/amd/test.js +++ b/tests/baselines/reference/project/maprootUrlModuleSubfolderNoOutdir/amd/test.js @@ -2,7 +2,7 @@ define(["require", "exports", "ref/m1"], function (require, exports, m1) { "use strict"; exports.__esModule = true; exports.a1 = 10; - var c1 = (function () { + var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/maprootUrlModuleSubfolderNoOutdir/node/ref/m1.js b/tests/baselines/reference/project/maprootUrlModuleSubfolderNoOutdir/node/ref/m1.js index b4abab78e9aaf..dca31d35b4862 100644 --- a/tests/baselines/reference/project/maprootUrlModuleSubfolderNoOutdir/node/ref/m1.js +++ b/tests/baselines/reference/project/maprootUrlModuleSubfolderNoOutdir/node/ref/m1.js @@ -1,7 +1,7 @@ "use strict"; exports.__esModule = true; exports.m1_a1 = 10; -var m1_c1 = (function () { +var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; diff --git a/tests/baselines/reference/project/maprootUrlModuleSubfolderNoOutdir/node/test.js b/tests/baselines/reference/project/maprootUrlModuleSubfolderNoOutdir/node/test.js index 6bc25238daca8..0f07918016a4d 100644 --- a/tests/baselines/reference/project/maprootUrlModuleSubfolderNoOutdir/node/test.js +++ b/tests/baselines/reference/project/maprootUrlModuleSubfolderNoOutdir/node/test.js @@ -2,7 +2,7 @@ exports.__esModule = true; var m1 = require("ref/m1"); exports.a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/maprootUrlModuleSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js b/tests/baselines/reference/project/maprootUrlModuleSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js index 5aa59f6dc9259..7bac36fd8b619 100644 --- a/tests/baselines/reference/project/maprootUrlModuleSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js +++ b/tests/baselines/reference/project/maprootUrlModuleSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js @@ -2,7 +2,7 @@ define(["require", "exports"], function (require, exports) { "use strict"; exports.__esModule = true; exports.m1_a1 = 10; - var m1_c1 = (function () { + var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; diff --git a/tests/baselines/reference/project/maprootUrlModuleSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js b/tests/baselines/reference/project/maprootUrlModuleSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js index d56cdf72bf299..144b90d0d6528 100644 --- a/tests/baselines/reference/project/maprootUrlModuleSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js +++ b/tests/baselines/reference/project/maprootUrlModuleSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js @@ -2,7 +2,7 @@ define(["require", "exports", "ref/m1"], function (require, exports, m1) { "use strict"; exports.__esModule = true; exports.a1 = 10; - var c1 = (function () { + var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/maprootUrlModuleSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js b/tests/baselines/reference/project/maprootUrlModuleSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js index b4abab78e9aaf..dca31d35b4862 100644 --- a/tests/baselines/reference/project/maprootUrlModuleSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js +++ b/tests/baselines/reference/project/maprootUrlModuleSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js @@ -1,7 +1,7 @@ "use strict"; exports.__esModule = true; exports.m1_a1 = 10; -var m1_c1 = (function () { +var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; diff --git a/tests/baselines/reference/project/maprootUrlModuleSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js b/tests/baselines/reference/project/maprootUrlModuleSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js index 6bc25238daca8..0f07918016a4d 100644 --- a/tests/baselines/reference/project/maprootUrlModuleSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js +++ b/tests/baselines/reference/project/maprootUrlModuleSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js @@ -2,7 +2,7 @@ exports.__esModule = true; var m1 = require("ref/m1"); exports.a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/maprootUrlModuleSubfolderSpecifyOutputFile/amd/bin/test.js b/tests/baselines/reference/project/maprootUrlModuleSubfolderSpecifyOutputFile/amd/bin/test.js index 63e58be27dc68..00358ff2e8252 100644 --- a/tests/baselines/reference/project/maprootUrlModuleSubfolderSpecifyOutputFile/amd/bin/test.js +++ b/tests/baselines/reference/project/maprootUrlModuleSubfolderSpecifyOutputFile/amd/bin/test.js @@ -2,7 +2,7 @@ define("ref/m1", ["require", "exports"], function (require, exports) { "use strict"; exports.__esModule = true; exports.m1_a1 = 10; - var m1_c1 = (function () { + var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; @@ -18,7 +18,7 @@ define("test", ["require", "exports", "ref/m1"], function (require, exports, m1) "use strict"; exports.__esModule = true; exports.a1 = 10; - var c1 = (function () { + var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/maprootUrlMultifolderNoOutdir/amd/diskFile1.js b/tests/baselines/reference/project/maprootUrlMultifolderNoOutdir/amd/diskFile1.js index d8a933fca96a5..250f6e91373e4 100644 --- a/tests/baselines/reference/project/maprootUrlMultifolderNoOutdir/amd/diskFile1.js +++ b/tests/baselines/reference/project/maprootUrlMultifolderNoOutdir/amd/diskFile1.js @@ -1,5 +1,5 @@ var m2_a1 = 10; -var m2_c1 = (function () { +var m2_c1 = /** @class */ (function () { function m2_c1() { } return m2_c1; diff --git a/tests/baselines/reference/project/maprootUrlMultifolderNoOutdir/amd/ref/m1.js b/tests/baselines/reference/project/maprootUrlMultifolderNoOutdir/amd/ref/m1.js index cf8964266818b..b6dc5260a9017 100644 --- a/tests/baselines/reference/project/maprootUrlMultifolderNoOutdir/amd/ref/m1.js +++ b/tests/baselines/reference/project/maprootUrlMultifolderNoOutdir/amd/ref/m1.js @@ -1,5 +1,5 @@ var m1_a1 = 10; -var m1_c1 = (function () { +var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; diff --git a/tests/baselines/reference/project/maprootUrlMultifolderNoOutdir/amd/test.js b/tests/baselines/reference/project/maprootUrlMultifolderNoOutdir/amd/test.js index c41870d0f8fe7..c18264d2df5ee 100644 --- a/tests/baselines/reference/project/maprootUrlMultifolderNoOutdir/amd/test.js +++ b/tests/baselines/reference/project/maprootUrlMultifolderNoOutdir/amd/test.js @@ -1,7 +1,7 @@ /// /// var a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/maprootUrlMultifolderNoOutdir/node/diskFile1.js b/tests/baselines/reference/project/maprootUrlMultifolderNoOutdir/node/diskFile1.js index d8a933fca96a5..250f6e91373e4 100644 --- a/tests/baselines/reference/project/maprootUrlMultifolderNoOutdir/node/diskFile1.js +++ b/tests/baselines/reference/project/maprootUrlMultifolderNoOutdir/node/diskFile1.js @@ -1,5 +1,5 @@ var m2_a1 = 10; -var m2_c1 = (function () { +var m2_c1 = /** @class */ (function () { function m2_c1() { } return m2_c1; diff --git a/tests/baselines/reference/project/maprootUrlMultifolderNoOutdir/node/ref/m1.js b/tests/baselines/reference/project/maprootUrlMultifolderNoOutdir/node/ref/m1.js index cf8964266818b..b6dc5260a9017 100644 --- a/tests/baselines/reference/project/maprootUrlMultifolderNoOutdir/node/ref/m1.js +++ b/tests/baselines/reference/project/maprootUrlMultifolderNoOutdir/node/ref/m1.js @@ -1,5 +1,5 @@ var m1_a1 = 10; -var m1_c1 = (function () { +var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; diff --git a/tests/baselines/reference/project/maprootUrlMultifolderNoOutdir/node/test.js b/tests/baselines/reference/project/maprootUrlMultifolderNoOutdir/node/test.js index c41870d0f8fe7..c18264d2df5ee 100644 --- a/tests/baselines/reference/project/maprootUrlMultifolderNoOutdir/node/test.js +++ b/tests/baselines/reference/project/maprootUrlMultifolderNoOutdir/node/test.js @@ -1,7 +1,7 @@ /// /// var a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/maprootUrlMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/ref/m1.js b/tests/baselines/reference/project/maprootUrlMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/ref/m1.js index cf8964266818b..b6dc5260a9017 100644 --- a/tests/baselines/reference/project/maprootUrlMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/ref/m1.js +++ b/tests/baselines/reference/project/maprootUrlMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/ref/m1.js @@ -1,5 +1,5 @@ var m1_a1 = 10; -var m1_c1 = (function () { +var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; diff --git a/tests/baselines/reference/project/maprootUrlMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/test.js b/tests/baselines/reference/project/maprootUrlMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/test.js index c41870d0f8fe7..c18264d2df5ee 100644 --- a/tests/baselines/reference/project/maprootUrlMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/test.js +++ b/tests/baselines/reference/project/maprootUrlMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/test.js @@ -1,7 +1,7 @@ /// /// var a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/maprootUrlMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder_ref/m2.js b/tests/baselines/reference/project/maprootUrlMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder_ref/m2.js index d8a933fca96a5..250f6e91373e4 100644 --- a/tests/baselines/reference/project/maprootUrlMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder_ref/m2.js +++ b/tests/baselines/reference/project/maprootUrlMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder_ref/m2.js @@ -1,5 +1,5 @@ var m2_a1 = 10; -var m2_c1 = (function () { +var m2_c1 = /** @class */ (function () { function m2_c1() { } return m2_c1; diff --git a/tests/baselines/reference/project/maprootUrlMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/ref/m1.js b/tests/baselines/reference/project/maprootUrlMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/ref/m1.js index cf8964266818b..b6dc5260a9017 100644 --- a/tests/baselines/reference/project/maprootUrlMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/ref/m1.js +++ b/tests/baselines/reference/project/maprootUrlMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/ref/m1.js @@ -1,5 +1,5 @@ var m1_a1 = 10; -var m1_c1 = (function () { +var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; diff --git a/tests/baselines/reference/project/maprootUrlMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/test.js b/tests/baselines/reference/project/maprootUrlMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/test.js index c41870d0f8fe7..c18264d2df5ee 100644 --- a/tests/baselines/reference/project/maprootUrlMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/test.js +++ b/tests/baselines/reference/project/maprootUrlMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/test.js @@ -1,7 +1,7 @@ /// /// var a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/maprootUrlMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder_ref/m2.js b/tests/baselines/reference/project/maprootUrlMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder_ref/m2.js index d8a933fca96a5..250f6e91373e4 100644 --- a/tests/baselines/reference/project/maprootUrlMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder_ref/m2.js +++ b/tests/baselines/reference/project/maprootUrlMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder_ref/m2.js @@ -1,5 +1,5 @@ var m2_a1 = 10; -var m2_c1 = (function () { +var m2_c1 = /** @class */ (function () { function m2_c1() { } return m2_c1; diff --git a/tests/baselines/reference/project/maprootUrlMultifolderSpecifyOutputFile/amd/bin/test.js b/tests/baselines/reference/project/maprootUrlMultifolderSpecifyOutputFile/amd/bin/test.js index 51bd53679fa11..2ab8779418fb3 100644 --- a/tests/baselines/reference/project/maprootUrlMultifolderSpecifyOutputFile/amd/bin/test.js +++ b/tests/baselines/reference/project/maprootUrlMultifolderSpecifyOutputFile/amd/bin/test.js @@ -1,5 +1,5 @@ var m1_a1 = 10; -var m1_c1 = (function () { +var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; @@ -9,7 +9,7 @@ function m1_f1() { return m1_instance1; } var m2_a1 = 10; -var m2_c1 = (function () { +var m2_c1 = /** @class */ (function () { function m2_c1() { } return m2_c1; @@ -21,7 +21,7 @@ function m2_f1() { /// /// var a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/maprootUrlMultifolderSpecifyOutputFile/node/bin/test.js b/tests/baselines/reference/project/maprootUrlMultifolderSpecifyOutputFile/node/bin/test.js index 51bd53679fa11..2ab8779418fb3 100644 --- a/tests/baselines/reference/project/maprootUrlMultifolderSpecifyOutputFile/node/bin/test.js +++ b/tests/baselines/reference/project/maprootUrlMultifolderSpecifyOutputFile/node/bin/test.js @@ -1,5 +1,5 @@ var m1_a1 = 10; -var m1_c1 = (function () { +var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; @@ -9,7 +9,7 @@ function m1_f1() { return m1_instance1; } var m2_a1 = 10; -var m2_c1 = (function () { +var m2_c1 = /** @class */ (function () { function m2_c1() { } return m2_c1; @@ -21,7 +21,7 @@ function m2_f1() { /// /// var a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/maprootUrlSimpleNoOutdir/amd/m1.js b/tests/baselines/reference/project/maprootUrlSimpleNoOutdir/amd/m1.js index 9f5ca0320c929..7c46af25a8498 100644 --- a/tests/baselines/reference/project/maprootUrlSimpleNoOutdir/amd/m1.js +++ b/tests/baselines/reference/project/maprootUrlSimpleNoOutdir/amd/m1.js @@ -1,5 +1,5 @@ var m1_a1 = 10; -var m1_c1 = (function () { +var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; diff --git a/tests/baselines/reference/project/maprootUrlSimpleNoOutdir/amd/test.js b/tests/baselines/reference/project/maprootUrlSimpleNoOutdir/amd/test.js index 300e7663c4710..34acdb6713b0d 100644 --- a/tests/baselines/reference/project/maprootUrlSimpleNoOutdir/amd/test.js +++ b/tests/baselines/reference/project/maprootUrlSimpleNoOutdir/amd/test.js @@ -1,6 +1,6 @@ /// var a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/maprootUrlSimpleNoOutdir/node/m1.js b/tests/baselines/reference/project/maprootUrlSimpleNoOutdir/node/m1.js index 9f5ca0320c929..7c46af25a8498 100644 --- a/tests/baselines/reference/project/maprootUrlSimpleNoOutdir/node/m1.js +++ b/tests/baselines/reference/project/maprootUrlSimpleNoOutdir/node/m1.js @@ -1,5 +1,5 @@ var m1_a1 = 10; -var m1_c1 = (function () { +var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; diff --git a/tests/baselines/reference/project/maprootUrlSimpleNoOutdir/node/test.js b/tests/baselines/reference/project/maprootUrlSimpleNoOutdir/node/test.js index 300e7663c4710..34acdb6713b0d 100644 --- a/tests/baselines/reference/project/maprootUrlSimpleNoOutdir/node/test.js +++ b/tests/baselines/reference/project/maprootUrlSimpleNoOutdir/node/test.js @@ -1,6 +1,6 @@ /// var a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/maprootUrlSimpleSpecifyOutputDirectory/amd/outdir/simple/m1.js b/tests/baselines/reference/project/maprootUrlSimpleSpecifyOutputDirectory/amd/outdir/simple/m1.js index 9f5ca0320c929..7c46af25a8498 100644 --- a/tests/baselines/reference/project/maprootUrlSimpleSpecifyOutputDirectory/amd/outdir/simple/m1.js +++ b/tests/baselines/reference/project/maprootUrlSimpleSpecifyOutputDirectory/amd/outdir/simple/m1.js @@ -1,5 +1,5 @@ var m1_a1 = 10; -var m1_c1 = (function () { +var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; diff --git a/tests/baselines/reference/project/maprootUrlSimpleSpecifyOutputDirectory/amd/outdir/simple/test.js b/tests/baselines/reference/project/maprootUrlSimpleSpecifyOutputDirectory/amd/outdir/simple/test.js index 300e7663c4710..34acdb6713b0d 100644 --- a/tests/baselines/reference/project/maprootUrlSimpleSpecifyOutputDirectory/amd/outdir/simple/test.js +++ b/tests/baselines/reference/project/maprootUrlSimpleSpecifyOutputDirectory/amd/outdir/simple/test.js @@ -1,6 +1,6 @@ /// var a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/maprootUrlSimpleSpecifyOutputDirectory/node/outdir/simple/m1.js b/tests/baselines/reference/project/maprootUrlSimpleSpecifyOutputDirectory/node/outdir/simple/m1.js index 9f5ca0320c929..7c46af25a8498 100644 --- a/tests/baselines/reference/project/maprootUrlSimpleSpecifyOutputDirectory/node/outdir/simple/m1.js +++ b/tests/baselines/reference/project/maprootUrlSimpleSpecifyOutputDirectory/node/outdir/simple/m1.js @@ -1,5 +1,5 @@ var m1_a1 = 10; -var m1_c1 = (function () { +var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; diff --git a/tests/baselines/reference/project/maprootUrlSimpleSpecifyOutputDirectory/node/outdir/simple/test.js b/tests/baselines/reference/project/maprootUrlSimpleSpecifyOutputDirectory/node/outdir/simple/test.js index 300e7663c4710..34acdb6713b0d 100644 --- a/tests/baselines/reference/project/maprootUrlSimpleSpecifyOutputDirectory/node/outdir/simple/test.js +++ b/tests/baselines/reference/project/maprootUrlSimpleSpecifyOutputDirectory/node/outdir/simple/test.js @@ -1,6 +1,6 @@ /// var a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/maprootUrlSimpleSpecifyOutputFile/amd/bin/test.js b/tests/baselines/reference/project/maprootUrlSimpleSpecifyOutputFile/amd/bin/test.js index 2a35fde20dc3e..44dec645a14c9 100644 --- a/tests/baselines/reference/project/maprootUrlSimpleSpecifyOutputFile/amd/bin/test.js +++ b/tests/baselines/reference/project/maprootUrlSimpleSpecifyOutputFile/amd/bin/test.js @@ -1,5 +1,5 @@ var m1_a1 = 10; -var m1_c1 = (function () { +var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; @@ -10,7 +10,7 @@ function m1_f1() { } /// var a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/maprootUrlSimpleSpecifyOutputFile/node/bin/test.js b/tests/baselines/reference/project/maprootUrlSimpleSpecifyOutputFile/node/bin/test.js index 2a35fde20dc3e..44dec645a14c9 100644 --- a/tests/baselines/reference/project/maprootUrlSimpleSpecifyOutputFile/node/bin/test.js +++ b/tests/baselines/reference/project/maprootUrlSimpleSpecifyOutputFile/node/bin/test.js @@ -1,5 +1,5 @@ var m1_a1 = 10; -var m1_c1 = (function () { +var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; @@ -10,7 +10,7 @@ function m1_f1() { } /// var a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/maprootUrlSingleFileNoOutdir/amd/test.js b/tests/baselines/reference/project/maprootUrlSingleFileNoOutdir/amd/test.js index 73eb738e590b7..d5245491d39d8 100644 --- a/tests/baselines/reference/project/maprootUrlSingleFileNoOutdir/amd/test.js +++ b/tests/baselines/reference/project/maprootUrlSingleFileNoOutdir/amd/test.js @@ -1,5 +1,5 @@ var a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/maprootUrlSingleFileNoOutdir/node/test.js b/tests/baselines/reference/project/maprootUrlSingleFileNoOutdir/node/test.js index 73eb738e590b7..d5245491d39d8 100644 --- a/tests/baselines/reference/project/maprootUrlSingleFileNoOutdir/node/test.js +++ b/tests/baselines/reference/project/maprootUrlSingleFileNoOutdir/node/test.js @@ -1,5 +1,5 @@ var a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/maprootUrlSingleFileSpecifyOutputDirectory/amd/outdir/simple/test.js b/tests/baselines/reference/project/maprootUrlSingleFileSpecifyOutputDirectory/amd/outdir/simple/test.js index 73eb738e590b7..d5245491d39d8 100644 --- a/tests/baselines/reference/project/maprootUrlSingleFileSpecifyOutputDirectory/amd/outdir/simple/test.js +++ b/tests/baselines/reference/project/maprootUrlSingleFileSpecifyOutputDirectory/amd/outdir/simple/test.js @@ -1,5 +1,5 @@ var a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/maprootUrlSingleFileSpecifyOutputDirectory/node/outdir/simple/test.js b/tests/baselines/reference/project/maprootUrlSingleFileSpecifyOutputDirectory/node/outdir/simple/test.js index 73eb738e590b7..d5245491d39d8 100644 --- a/tests/baselines/reference/project/maprootUrlSingleFileSpecifyOutputDirectory/node/outdir/simple/test.js +++ b/tests/baselines/reference/project/maprootUrlSingleFileSpecifyOutputDirectory/node/outdir/simple/test.js @@ -1,5 +1,5 @@ var a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/maprootUrlSingleFileSpecifyOutputFile/amd/bin/test.js b/tests/baselines/reference/project/maprootUrlSingleFileSpecifyOutputFile/amd/bin/test.js index 73eb738e590b7..d5245491d39d8 100644 --- a/tests/baselines/reference/project/maprootUrlSingleFileSpecifyOutputFile/amd/bin/test.js +++ b/tests/baselines/reference/project/maprootUrlSingleFileSpecifyOutputFile/amd/bin/test.js @@ -1,5 +1,5 @@ var a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/maprootUrlSingleFileSpecifyOutputFile/node/bin/test.js b/tests/baselines/reference/project/maprootUrlSingleFileSpecifyOutputFile/node/bin/test.js index 73eb738e590b7..d5245491d39d8 100644 --- a/tests/baselines/reference/project/maprootUrlSingleFileSpecifyOutputFile/node/bin/test.js +++ b/tests/baselines/reference/project/maprootUrlSingleFileSpecifyOutputFile/node/bin/test.js @@ -1,5 +1,5 @@ var a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/maprootUrlSubfolderNoOutdir/amd/ref/m1.js b/tests/baselines/reference/project/maprootUrlSubfolderNoOutdir/amd/ref/m1.js index ac9c9fc5839b4..639e6c5846246 100644 --- a/tests/baselines/reference/project/maprootUrlSubfolderNoOutdir/amd/ref/m1.js +++ b/tests/baselines/reference/project/maprootUrlSubfolderNoOutdir/amd/ref/m1.js @@ -1,5 +1,5 @@ var m1_a1 = 10; -var m1_c1 = (function () { +var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; diff --git a/tests/baselines/reference/project/maprootUrlSubfolderNoOutdir/amd/test.js b/tests/baselines/reference/project/maprootUrlSubfolderNoOutdir/amd/test.js index b268cd98e4147..475fba0bd2a9b 100644 --- a/tests/baselines/reference/project/maprootUrlSubfolderNoOutdir/amd/test.js +++ b/tests/baselines/reference/project/maprootUrlSubfolderNoOutdir/amd/test.js @@ -1,6 +1,6 @@ /// var a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/maprootUrlSubfolderNoOutdir/node/ref/m1.js b/tests/baselines/reference/project/maprootUrlSubfolderNoOutdir/node/ref/m1.js index ac9c9fc5839b4..639e6c5846246 100644 --- a/tests/baselines/reference/project/maprootUrlSubfolderNoOutdir/node/ref/m1.js +++ b/tests/baselines/reference/project/maprootUrlSubfolderNoOutdir/node/ref/m1.js @@ -1,5 +1,5 @@ var m1_a1 = 10; -var m1_c1 = (function () { +var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; diff --git a/tests/baselines/reference/project/maprootUrlSubfolderNoOutdir/node/test.js b/tests/baselines/reference/project/maprootUrlSubfolderNoOutdir/node/test.js index b268cd98e4147..475fba0bd2a9b 100644 --- a/tests/baselines/reference/project/maprootUrlSubfolderNoOutdir/node/test.js +++ b/tests/baselines/reference/project/maprootUrlSubfolderNoOutdir/node/test.js @@ -1,6 +1,6 @@ /// var a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/maprootUrlSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js b/tests/baselines/reference/project/maprootUrlSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js index ac9c9fc5839b4..639e6c5846246 100644 --- a/tests/baselines/reference/project/maprootUrlSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js +++ b/tests/baselines/reference/project/maprootUrlSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js @@ -1,5 +1,5 @@ var m1_a1 = 10; -var m1_c1 = (function () { +var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; diff --git a/tests/baselines/reference/project/maprootUrlSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js b/tests/baselines/reference/project/maprootUrlSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js index b268cd98e4147..475fba0bd2a9b 100644 --- a/tests/baselines/reference/project/maprootUrlSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js +++ b/tests/baselines/reference/project/maprootUrlSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js @@ -1,6 +1,6 @@ /// var a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/maprootUrlSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js b/tests/baselines/reference/project/maprootUrlSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js index ac9c9fc5839b4..639e6c5846246 100644 --- a/tests/baselines/reference/project/maprootUrlSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js +++ b/tests/baselines/reference/project/maprootUrlSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js @@ -1,5 +1,5 @@ var m1_a1 = 10; -var m1_c1 = (function () { +var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; diff --git a/tests/baselines/reference/project/maprootUrlSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js b/tests/baselines/reference/project/maprootUrlSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js index b268cd98e4147..475fba0bd2a9b 100644 --- a/tests/baselines/reference/project/maprootUrlSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js +++ b/tests/baselines/reference/project/maprootUrlSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js @@ -1,6 +1,6 @@ /// var a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/maprootUrlSubfolderSpecifyOutputFile/amd/bin/test.js b/tests/baselines/reference/project/maprootUrlSubfolderSpecifyOutputFile/amd/bin/test.js index 4b9e91859bfef..126bb93b34d61 100644 --- a/tests/baselines/reference/project/maprootUrlSubfolderSpecifyOutputFile/amd/bin/test.js +++ b/tests/baselines/reference/project/maprootUrlSubfolderSpecifyOutputFile/amd/bin/test.js @@ -1,5 +1,5 @@ var m1_a1 = 10; -var m1_c1 = (function () { +var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; @@ -10,7 +10,7 @@ function m1_f1() { } /// var a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/maprootUrlSubfolderSpecifyOutputFile/node/bin/test.js b/tests/baselines/reference/project/maprootUrlSubfolderSpecifyOutputFile/node/bin/test.js index 4b9e91859bfef..126bb93b34d61 100644 --- a/tests/baselines/reference/project/maprootUrlSubfolderSpecifyOutputFile/node/bin/test.js +++ b/tests/baselines/reference/project/maprootUrlSubfolderSpecifyOutputFile/node/bin/test.js @@ -1,5 +1,5 @@ var m1_a1 = 10; -var m1_c1 = (function () { +var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; @@ -10,7 +10,7 @@ function m1_f1() { } /// var a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderNoOutdir/amd/ref/m1.js b/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderNoOutdir/amd/ref/m1.js index ac9c9fc5839b4..639e6c5846246 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderNoOutdir/amd/ref/m1.js +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderNoOutdir/amd/ref/m1.js @@ -1,5 +1,5 @@ var m1_a1 = 10; -var m1_c1 = (function () { +var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderNoOutdir/amd/ref/m2.js b/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderNoOutdir/amd/ref/m2.js index f373c246d4867..7960a2f77b3fd 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderNoOutdir/amd/ref/m2.js +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderNoOutdir/amd/ref/m2.js @@ -2,7 +2,7 @@ define(["require", "exports"], function (require, exports) { "use strict"; exports.__esModule = true; exports.m2_a1 = 10; - var m2_c1 = (function () { + var m2_c1 = /** @class */ (function () { function m2_c1() { } return m2_c1; diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderNoOutdir/amd/test.js b/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderNoOutdir/amd/test.js index a7248649dc7db..e36a1dc17c84a 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderNoOutdir/amd/test.js +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderNoOutdir/amd/test.js @@ -1,7 +1,7 @@ /// /// var a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderNoOutdir/node/ref/m1.js b/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderNoOutdir/node/ref/m1.js index ac9c9fc5839b4..639e6c5846246 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderNoOutdir/node/ref/m1.js +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderNoOutdir/node/ref/m1.js @@ -1,5 +1,5 @@ var m1_a1 = 10; -var m1_c1 = (function () { +var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderNoOutdir/node/ref/m2.js b/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderNoOutdir/node/ref/m2.js index 9557c3a613c1c..e0a2ec4f5fb0e 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderNoOutdir/node/ref/m2.js +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderNoOutdir/node/ref/m2.js @@ -1,7 +1,7 @@ "use strict"; exports.__esModule = true; exports.m2_a1 = 10; -var m2_c1 = (function () { +var m2_c1 = /** @class */ (function () { function m2_c1() { } return m2_c1; diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderNoOutdir/node/test.js b/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderNoOutdir/node/test.js index a7248649dc7db..e36a1dc17c84a 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderNoOutdir/node/test.js +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderNoOutdir/node/test.js @@ -1,7 +1,7 @@ /// /// var a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js b/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js index ac9c9fc5839b4..639e6c5846246 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js @@ -1,5 +1,5 @@ var m1_a1 = 10; -var m1_c1 = (function () { +var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m2.js b/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m2.js index f373c246d4867..7960a2f77b3fd 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m2.js +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m2.js @@ -2,7 +2,7 @@ define(["require", "exports"], function (require, exports) { "use strict"; exports.__esModule = true; exports.m2_a1 = 10; - var m2_c1 = (function () { + var m2_c1 = /** @class */ (function () { function m2_c1() { } return m2_c1; diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js b/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js index a7248649dc7db..e36a1dc17c84a 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js @@ -1,7 +1,7 @@ /// /// var a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js b/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js index ac9c9fc5839b4..639e6c5846246 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js @@ -1,5 +1,5 @@ var m1_a1 = 10; -var m1_c1 = (function () { +var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m2.js b/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m2.js index 9557c3a613c1c..e0a2ec4f5fb0e 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m2.js +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m2.js @@ -1,7 +1,7 @@ "use strict"; exports.__esModule = true; exports.m2_a1 = 10; -var m2_c1 = (function () { +var m2_c1 = /** @class */ (function () { function m2_c1() { } return m2_c1; diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js b/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js index a7248649dc7db..e36a1dc17c84a 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js @@ -1,7 +1,7 @@ /// /// var a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFile/amd/bin/test.js b/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFile/amd/bin/test.js index d9f0f5b153109..aa1d244eccead 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFile/amd/bin/test.js +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFile/amd/bin/test.js @@ -1,5 +1,5 @@ var m1_a1 = 10; -var m1_c1 = (function () { +var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; @@ -12,7 +12,7 @@ define("ref/m2", ["require", "exports"], function (require, exports) { "use strict"; exports.__esModule = true; exports.m2_a1 = 10; - var m2_c1 = (function () { + var m2_c1 = /** @class */ (function () { function m2_c1() { } return m2_c1; @@ -27,7 +27,7 @@ define("ref/m2", ["require", "exports"], function (require, exports) { /// /// var a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFile/node/bin/test.js b/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFile/node/bin/test.js index ec3309b3b1868..a9815ec3ad152 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFile/node/bin/test.js +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFile/node/bin/test.js @@ -1,5 +1,5 @@ var m1_a1 = 10; -var m1_c1 = (function () { +var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; @@ -11,7 +11,7 @@ function m1_f1() { /// /// var a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/bin/outAndOutDirFile.js b/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/bin/outAndOutDirFile.js index cc3f604524fcc..bbffd27dd54cb 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/bin/outAndOutDirFile.js +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/bin/outAndOutDirFile.js @@ -1,5 +1,5 @@ var m1_a1 = 10; -var m1_c1 = (function () { +var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; @@ -12,7 +12,7 @@ define("ref/m2", ["require", "exports"], function (require, exports) { "use strict"; exports.__esModule = true; exports.m2_a1 = 10; - var m2_c1 = (function () { + var m2_c1 = /** @class */ (function () { function m2_c1() { } return m2_c1; @@ -27,7 +27,7 @@ define("ref/m2", ["require", "exports"], function (require, exports) { /// /// var a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/bin/outAndOutDirFile.js b/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/bin/outAndOutDirFile.js index 3e51021ce9b48..1186e804d6307 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/bin/outAndOutDirFile.js +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/bin/outAndOutDirFile.js @@ -1,5 +1,5 @@ var m1_a1 = 10; -var m1_c1 = (function () { +var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; @@ -11,7 +11,7 @@ function m1_f1() { /// /// var a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderNoOutdir/amd/diskFile1.js b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderNoOutdir/amd/diskFile1.js index f6057bf162a8e..943f909d5f4ed 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderNoOutdir/amd/diskFile1.js +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderNoOutdir/amd/diskFile1.js @@ -2,7 +2,7 @@ define(["require", "exports"], function (require, exports) { "use strict"; exports.__esModule = true; exports.m2_a1 = 10; - var m2_c1 = (function () { + var m2_c1 = /** @class */ (function () { function m2_c1() { } return m2_c1; diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderNoOutdir/amd/ref/m1.js b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderNoOutdir/amd/ref/m1.js index 196a531920ba4..a37db1abb9bf6 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderNoOutdir/amd/ref/m1.js +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderNoOutdir/amd/ref/m1.js @@ -2,7 +2,7 @@ define(["require", "exports"], function (require, exports) { "use strict"; exports.__esModule = true; exports.m1_a1 = 10; - var m1_c1 = (function () { + var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderNoOutdir/amd/test.js b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderNoOutdir/amd/test.js index b4a0aa2d25d1d..c1587604a9d68 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderNoOutdir/amd/test.js +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderNoOutdir/amd/test.js @@ -2,7 +2,7 @@ define(["require", "exports", "ref/m1", "../outputdir_module_multifolder_ref/m2" "use strict"; exports.__esModule = true; exports.a1 = 10; - var c1 = (function () { + var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderNoOutdir/node/diskFile1.js b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderNoOutdir/node/diskFile1.js index 9324632b44acb..f5e0e91d43fb3 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderNoOutdir/node/diskFile1.js +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderNoOutdir/node/diskFile1.js @@ -1,7 +1,7 @@ "use strict"; exports.__esModule = true; exports.m2_a1 = 10; -var m2_c1 = (function () { +var m2_c1 = /** @class */ (function () { function m2_c1() { } return m2_c1; diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderNoOutdir/node/ref/m1.js b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderNoOutdir/node/ref/m1.js index f590179583204..dd02d1483b77c 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderNoOutdir/node/ref/m1.js +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderNoOutdir/node/ref/m1.js @@ -1,7 +1,7 @@ "use strict"; exports.__esModule = true; exports.m1_a1 = 10; -var m1_c1 = (function () { +var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderNoOutdir/node/test.js b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderNoOutdir/node/test.js index e8734ca6d27b0..59517f026bb4e 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderNoOutdir/node/test.js +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderNoOutdir/node/test.js @@ -3,7 +3,7 @@ exports.__esModule = true; var m1 = require("ref/m1"); var m2 = require("../outputdir_module_multifolder_ref/m2"); exports.a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder/ref/m1.js b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder/ref/m1.js index 196a531920ba4..a37db1abb9bf6 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder/ref/m1.js +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder/ref/m1.js @@ -2,7 +2,7 @@ define(["require", "exports"], function (require, exports) { "use strict"; exports.__esModule = true; exports.m1_a1 = 10; - var m1_c1 = (function () { + var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder/test.js b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder/test.js index b4a0aa2d25d1d..c1587604a9d68 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder/test.js +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder/test.js @@ -2,7 +2,7 @@ define(["require", "exports", "ref/m1", "../outputdir_module_multifolder_ref/m2" "use strict"; exports.__esModule = true; exports.a1 = 10; - var c1 = (function () { + var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder_ref/m2.js b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder_ref/m2.js index f6057bf162a8e..943f909d5f4ed 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder_ref/m2.js +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder_ref/m2.js @@ -2,7 +2,7 @@ define(["require", "exports"], function (require, exports) { "use strict"; exports.__esModule = true; exports.m2_a1 = 10; - var m2_c1 = (function () { + var m2_c1 = /** @class */ (function () { function m2_c1() { } return m2_c1; diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder/ref/m1.js b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder/ref/m1.js index f590179583204..dd02d1483b77c 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder/ref/m1.js +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder/ref/m1.js @@ -1,7 +1,7 @@ "use strict"; exports.__esModule = true; exports.m1_a1 = 10; -var m1_c1 = (function () { +var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder/test.js b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder/test.js index e8734ca6d27b0..59517f026bb4e 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder/test.js +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder/test.js @@ -3,7 +3,7 @@ exports.__esModule = true; var m1 = require("ref/m1"); var m2 = require("../outputdir_module_multifolder_ref/m2"); exports.a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder_ref/m2.js b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder_ref/m2.js index 9324632b44acb..f5e0e91d43fb3 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder_ref/m2.js +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder_ref/m2.js @@ -1,7 +1,7 @@ "use strict"; exports.__esModule = true; exports.m2_a1 = 10; -var m2_c1 = (function () { +var m2_c1 = /** @class */ (function () { function m2_c1() { } return m2_c1; diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputFile/amd/bin/test.js b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputFile/amd/bin/test.js index 1ea95ed9ba028..434d0a8e9e806 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputFile/amd/bin/test.js +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputFile/amd/bin/test.js @@ -2,7 +2,7 @@ define("outputdir_module_multifolder/ref/m1", ["require", "exports"], function ( "use strict"; exports.__esModule = true; exports.m1_a1 = 10; - var m1_c1 = (function () { + var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; @@ -18,7 +18,7 @@ define("outputdir_module_multifolder_ref/m2", ["require", "exports"], function ( "use strict"; exports.__esModule = true; exports.m2_a1 = 10; - var m2_c1 = (function () { + var m2_c1 = /** @class */ (function () { function m2_c1() { } return m2_c1; @@ -34,7 +34,7 @@ define("outputdir_module_multifolder/test", ["require", "exports", "outputdir_mo "use strict"; exports.__esModule = true; exports.a1 = 10; - var c1 = (function () { + var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleNoOutdir/amd/m1.js b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleNoOutdir/amd/m1.js index fc2d3408b2be8..182a09e5c1ac8 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleNoOutdir/amd/m1.js +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleNoOutdir/amd/m1.js @@ -2,7 +2,7 @@ define(["require", "exports"], function (require, exports) { "use strict"; exports.__esModule = true; exports.m1_a1 = 10; - var m1_c1 = (function () { + var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleNoOutdir/amd/test.js b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleNoOutdir/amd/test.js index 1e0dea14dc890..a465883de4a9c 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleNoOutdir/amd/test.js +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleNoOutdir/amd/test.js @@ -2,7 +2,7 @@ define(["require", "exports", "m1"], function (require, exports, m1) { "use strict"; exports.__esModule = true; exports.a1 = 10; - var c1 = (function () { + var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleNoOutdir/node/m1.js b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleNoOutdir/node/m1.js index 8a7e9f1069e62..066640b0ef712 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleNoOutdir/node/m1.js +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleNoOutdir/node/m1.js @@ -1,7 +1,7 @@ "use strict"; exports.__esModule = true; exports.m1_a1 = 10; -var m1_c1 = (function () { +var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleNoOutdir/node/test.js b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleNoOutdir/node/test.js index d7e6d6733402b..76301cf25fea5 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleNoOutdir/node/test.js +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleNoOutdir/node/test.js @@ -2,7 +2,7 @@ exports.__esModule = true; var m1 = require("m1"); exports.a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleSpecifyOutputDirectory/amd/outdir/simple/m1.js b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleSpecifyOutputDirectory/amd/outdir/simple/m1.js index fc2d3408b2be8..182a09e5c1ac8 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleSpecifyOutputDirectory/amd/outdir/simple/m1.js +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleSpecifyOutputDirectory/amd/outdir/simple/m1.js @@ -2,7 +2,7 @@ define(["require", "exports"], function (require, exports) { "use strict"; exports.__esModule = true; exports.m1_a1 = 10; - var m1_c1 = (function () { + var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleSpecifyOutputDirectory/amd/outdir/simple/test.js b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleSpecifyOutputDirectory/amd/outdir/simple/test.js index 1e0dea14dc890..a465883de4a9c 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleSpecifyOutputDirectory/amd/outdir/simple/test.js +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleSpecifyOutputDirectory/amd/outdir/simple/test.js @@ -2,7 +2,7 @@ define(["require", "exports", "m1"], function (require, exports, m1) { "use strict"; exports.__esModule = true; exports.a1 = 10; - var c1 = (function () { + var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleSpecifyOutputDirectory/node/outdir/simple/m1.js b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleSpecifyOutputDirectory/node/outdir/simple/m1.js index 8a7e9f1069e62..066640b0ef712 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleSpecifyOutputDirectory/node/outdir/simple/m1.js +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleSpecifyOutputDirectory/node/outdir/simple/m1.js @@ -1,7 +1,7 @@ "use strict"; exports.__esModule = true; exports.m1_a1 = 10; -var m1_c1 = (function () { +var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleSpecifyOutputDirectory/node/outdir/simple/test.js b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleSpecifyOutputDirectory/node/outdir/simple/test.js index d7e6d6733402b..76301cf25fea5 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleSpecifyOutputDirectory/node/outdir/simple/test.js +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleSpecifyOutputDirectory/node/outdir/simple/test.js @@ -2,7 +2,7 @@ exports.__esModule = true; var m1 = require("m1"); exports.a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleSpecifyOutputFile/amd/bin/test.js b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleSpecifyOutputFile/amd/bin/test.js index d19b91956859e..a047c68088918 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleSpecifyOutputFile/amd/bin/test.js +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleSpecifyOutputFile/amd/bin/test.js @@ -2,7 +2,7 @@ define("m1", ["require", "exports"], function (require, exports) { "use strict"; exports.__esModule = true; exports.m1_a1 = 10; - var m1_c1 = (function () { + var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; @@ -18,7 +18,7 @@ define("test", ["require", "exports", "m1"], function (require, exports, m1) { "use strict"; exports.__esModule = true; exports.a1 = 10; - var c1 = (function () { + var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderNoOutdir/amd/ref/m1.js b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderNoOutdir/amd/ref/m1.js index 5aa59f6dc9259..7bac36fd8b619 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderNoOutdir/amd/ref/m1.js +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderNoOutdir/amd/ref/m1.js @@ -2,7 +2,7 @@ define(["require", "exports"], function (require, exports) { "use strict"; exports.__esModule = true; exports.m1_a1 = 10; - var m1_c1 = (function () { + var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderNoOutdir/amd/test.js b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderNoOutdir/amd/test.js index d56cdf72bf299..144b90d0d6528 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderNoOutdir/amd/test.js +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderNoOutdir/amd/test.js @@ -2,7 +2,7 @@ define(["require", "exports", "ref/m1"], function (require, exports, m1) { "use strict"; exports.__esModule = true; exports.a1 = 10; - var c1 = (function () { + var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderNoOutdir/node/ref/m1.js b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderNoOutdir/node/ref/m1.js index b4abab78e9aaf..dca31d35b4862 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderNoOutdir/node/ref/m1.js +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderNoOutdir/node/ref/m1.js @@ -1,7 +1,7 @@ "use strict"; exports.__esModule = true; exports.m1_a1 = 10; -var m1_c1 = (function () { +var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderNoOutdir/node/test.js b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderNoOutdir/node/test.js index 6bc25238daca8..0f07918016a4d 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderNoOutdir/node/test.js +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderNoOutdir/node/test.js @@ -2,7 +2,7 @@ exports.__esModule = true; var m1 = require("ref/m1"); exports.a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js index 5aa59f6dc9259..7bac36fd8b619 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js @@ -2,7 +2,7 @@ define(["require", "exports"], function (require, exports) { "use strict"; exports.__esModule = true; exports.m1_a1 = 10; - var m1_c1 = (function () { + var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js index d56cdf72bf299..144b90d0d6528 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js @@ -2,7 +2,7 @@ define(["require", "exports", "ref/m1"], function (require, exports, m1) { "use strict"; exports.__esModule = true; exports.a1 = 10; - var c1 = (function () { + var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js index b4abab78e9aaf..dca31d35b4862 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js @@ -1,7 +1,7 @@ "use strict"; exports.__esModule = true; exports.m1_a1 = 10; -var m1_c1 = (function () { +var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js index 6bc25238daca8..0f07918016a4d 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js @@ -2,7 +2,7 @@ exports.__esModule = true; var m1 = require("ref/m1"); exports.a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderSpecifyOutputFile/amd/bin/test.js b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderSpecifyOutputFile/amd/bin/test.js index 63e58be27dc68..00358ff2e8252 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderSpecifyOutputFile/amd/bin/test.js +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderSpecifyOutputFile/amd/bin/test.js @@ -2,7 +2,7 @@ define("ref/m1", ["require", "exports"], function (require, exports) { "use strict"; exports.__esModule = true; exports.m1_a1 = 10; - var m1_c1 = (function () { + var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; @@ -18,7 +18,7 @@ define("test", ["require", "exports", "ref/m1"], function (require, exports, m1) "use strict"; exports.__esModule = true; exports.a1 = 10; - var c1 = (function () { + var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderNoOutdir/amd/diskFile1.js b/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderNoOutdir/amd/diskFile1.js index d8a933fca96a5..250f6e91373e4 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderNoOutdir/amd/diskFile1.js +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderNoOutdir/amd/diskFile1.js @@ -1,5 +1,5 @@ var m2_a1 = 10; -var m2_c1 = (function () { +var m2_c1 = /** @class */ (function () { function m2_c1() { } return m2_c1; diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderNoOutdir/amd/ref/m1.js b/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderNoOutdir/amd/ref/m1.js index cf8964266818b..b6dc5260a9017 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderNoOutdir/amd/ref/m1.js +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderNoOutdir/amd/ref/m1.js @@ -1,5 +1,5 @@ var m1_a1 = 10; -var m1_c1 = (function () { +var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderNoOutdir/amd/test.js b/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderNoOutdir/amd/test.js index c41870d0f8fe7..c18264d2df5ee 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderNoOutdir/amd/test.js +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderNoOutdir/amd/test.js @@ -1,7 +1,7 @@ /// /// var a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderNoOutdir/node/diskFile1.js b/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderNoOutdir/node/diskFile1.js index d8a933fca96a5..250f6e91373e4 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderNoOutdir/node/diskFile1.js +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderNoOutdir/node/diskFile1.js @@ -1,5 +1,5 @@ var m2_a1 = 10; -var m2_c1 = (function () { +var m2_c1 = /** @class */ (function () { function m2_c1() { } return m2_c1; diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderNoOutdir/node/ref/m1.js b/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderNoOutdir/node/ref/m1.js index cf8964266818b..b6dc5260a9017 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderNoOutdir/node/ref/m1.js +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderNoOutdir/node/ref/m1.js @@ -1,5 +1,5 @@ var m1_a1 = 10; -var m1_c1 = (function () { +var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderNoOutdir/node/test.js b/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderNoOutdir/node/test.js index c41870d0f8fe7..c18264d2df5ee 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderNoOutdir/node/test.js +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderNoOutdir/node/test.js @@ -1,7 +1,7 @@ /// /// var a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/ref/m1.js b/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/ref/m1.js index cf8964266818b..b6dc5260a9017 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/ref/m1.js +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/ref/m1.js @@ -1,5 +1,5 @@ var m1_a1 = 10; -var m1_c1 = (function () { +var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/test.js b/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/test.js index c41870d0f8fe7..c18264d2df5ee 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/test.js +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/test.js @@ -1,7 +1,7 @@ /// /// var a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder_ref/m2.js b/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder_ref/m2.js index d8a933fca96a5..250f6e91373e4 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder_ref/m2.js +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder_ref/m2.js @@ -1,5 +1,5 @@ var m2_a1 = 10; -var m2_c1 = (function () { +var m2_c1 = /** @class */ (function () { function m2_c1() { } return m2_c1; diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/ref/m1.js b/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/ref/m1.js index cf8964266818b..b6dc5260a9017 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/ref/m1.js +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/ref/m1.js @@ -1,5 +1,5 @@ var m1_a1 = 10; -var m1_c1 = (function () { +var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/test.js b/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/test.js index c41870d0f8fe7..c18264d2df5ee 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/test.js +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/test.js @@ -1,7 +1,7 @@ /// /// var a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder_ref/m2.js b/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder_ref/m2.js index d8a933fca96a5..250f6e91373e4 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder_ref/m2.js +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder_ref/m2.js @@ -1,5 +1,5 @@ var m2_a1 = 10; -var m2_c1 = (function () { +var m2_c1 = /** @class */ (function () { function m2_c1() { } return m2_c1; diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderSpecifyOutputFile/amd/bin/test.js b/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderSpecifyOutputFile/amd/bin/test.js index 51bd53679fa11..2ab8779418fb3 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderSpecifyOutputFile/amd/bin/test.js +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderSpecifyOutputFile/amd/bin/test.js @@ -1,5 +1,5 @@ var m1_a1 = 10; -var m1_c1 = (function () { +var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; @@ -9,7 +9,7 @@ function m1_f1() { return m1_instance1; } var m2_a1 = 10; -var m2_c1 = (function () { +var m2_c1 = /** @class */ (function () { function m2_c1() { } return m2_c1; @@ -21,7 +21,7 @@ function m2_f1() { /// /// var a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderSpecifyOutputFile/node/bin/test.js b/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderSpecifyOutputFile/node/bin/test.js index 51bd53679fa11..2ab8779418fb3 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderSpecifyOutputFile/node/bin/test.js +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderSpecifyOutputFile/node/bin/test.js @@ -1,5 +1,5 @@ var m1_a1 = 10; -var m1_c1 = (function () { +var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; @@ -9,7 +9,7 @@ function m1_f1() { return m1_instance1; } var m2_a1 = 10; -var m2_c1 = (function () { +var m2_c1 = /** @class */ (function () { function m2_c1() { } return m2_c1; @@ -21,7 +21,7 @@ function m2_f1() { /// /// var a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlSimpleNoOutdir/amd/m1.js b/tests/baselines/reference/project/maprootUrlsourcerootUrlSimpleNoOutdir/amd/m1.js index 9f5ca0320c929..7c46af25a8498 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlSimpleNoOutdir/amd/m1.js +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlSimpleNoOutdir/amd/m1.js @@ -1,5 +1,5 @@ var m1_a1 = 10; -var m1_c1 = (function () { +var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlSimpleNoOutdir/amd/test.js b/tests/baselines/reference/project/maprootUrlsourcerootUrlSimpleNoOutdir/amd/test.js index 300e7663c4710..34acdb6713b0d 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlSimpleNoOutdir/amd/test.js +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlSimpleNoOutdir/amd/test.js @@ -1,6 +1,6 @@ /// var a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlSimpleNoOutdir/node/m1.js b/tests/baselines/reference/project/maprootUrlsourcerootUrlSimpleNoOutdir/node/m1.js index 9f5ca0320c929..7c46af25a8498 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlSimpleNoOutdir/node/m1.js +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlSimpleNoOutdir/node/m1.js @@ -1,5 +1,5 @@ var m1_a1 = 10; -var m1_c1 = (function () { +var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlSimpleNoOutdir/node/test.js b/tests/baselines/reference/project/maprootUrlsourcerootUrlSimpleNoOutdir/node/test.js index 300e7663c4710..34acdb6713b0d 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlSimpleNoOutdir/node/test.js +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlSimpleNoOutdir/node/test.js @@ -1,6 +1,6 @@ /// var a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlSimpleSpecifyOutputDirectory/amd/outdir/simple/m1.js b/tests/baselines/reference/project/maprootUrlsourcerootUrlSimpleSpecifyOutputDirectory/amd/outdir/simple/m1.js index 9f5ca0320c929..7c46af25a8498 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlSimpleSpecifyOutputDirectory/amd/outdir/simple/m1.js +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlSimpleSpecifyOutputDirectory/amd/outdir/simple/m1.js @@ -1,5 +1,5 @@ var m1_a1 = 10; -var m1_c1 = (function () { +var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlSimpleSpecifyOutputDirectory/amd/outdir/simple/test.js b/tests/baselines/reference/project/maprootUrlsourcerootUrlSimpleSpecifyOutputDirectory/amd/outdir/simple/test.js index 300e7663c4710..34acdb6713b0d 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlSimpleSpecifyOutputDirectory/amd/outdir/simple/test.js +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlSimpleSpecifyOutputDirectory/amd/outdir/simple/test.js @@ -1,6 +1,6 @@ /// var a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlSimpleSpecifyOutputDirectory/node/outdir/simple/m1.js b/tests/baselines/reference/project/maprootUrlsourcerootUrlSimpleSpecifyOutputDirectory/node/outdir/simple/m1.js index 9f5ca0320c929..7c46af25a8498 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlSimpleSpecifyOutputDirectory/node/outdir/simple/m1.js +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlSimpleSpecifyOutputDirectory/node/outdir/simple/m1.js @@ -1,5 +1,5 @@ var m1_a1 = 10; -var m1_c1 = (function () { +var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlSimpleSpecifyOutputDirectory/node/outdir/simple/test.js b/tests/baselines/reference/project/maprootUrlsourcerootUrlSimpleSpecifyOutputDirectory/node/outdir/simple/test.js index 300e7663c4710..34acdb6713b0d 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlSimpleSpecifyOutputDirectory/node/outdir/simple/test.js +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlSimpleSpecifyOutputDirectory/node/outdir/simple/test.js @@ -1,6 +1,6 @@ /// var a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlSimpleSpecifyOutputFile/amd/bin/test.js b/tests/baselines/reference/project/maprootUrlsourcerootUrlSimpleSpecifyOutputFile/amd/bin/test.js index 2a35fde20dc3e..44dec645a14c9 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlSimpleSpecifyOutputFile/amd/bin/test.js +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlSimpleSpecifyOutputFile/amd/bin/test.js @@ -1,5 +1,5 @@ var m1_a1 = 10; -var m1_c1 = (function () { +var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; @@ -10,7 +10,7 @@ function m1_f1() { } /// var a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlSimpleSpecifyOutputFile/node/bin/test.js b/tests/baselines/reference/project/maprootUrlsourcerootUrlSimpleSpecifyOutputFile/node/bin/test.js index 2a35fde20dc3e..44dec645a14c9 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlSimpleSpecifyOutputFile/node/bin/test.js +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlSimpleSpecifyOutputFile/node/bin/test.js @@ -1,5 +1,5 @@ var m1_a1 = 10; -var m1_c1 = (function () { +var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; @@ -10,7 +10,7 @@ function m1_f1() { } /// var a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlSingleFileNoOutdir/amd/test.js b/tests/baselines/reference/project/maprootUrlsourcerootUrlSingleFileNoOutdir/amd/test.js index 73eb738e590b7..d5245491d39d8 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlSingleFileNoOutdir/amd/test.js +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlSingleFileNoOutdir/amd/test.js @@ -1,5 +1,5 @@ var a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlSingleFileNoOutdir/node/test.js b/tests/baselines/reference/project/maprootUrlsourcerootUrlSingleFileNoOutdir/node/test.js index 73eb738e590b7..d5245491d39d8 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlSingleFileNoOutdir/node/test.js +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlSingleFileNoOutdir/node/test.js @@ -1,5 +1,5 @@ var a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlSingleFileSpecifyOutputDirectory/amd/outdir/simple/test.js b/tests/baselines/reference/project/maprootUrlsourcerootUrlSingleFileSpecifyOutputDirectory/amd/outdir/simple/test.js index 73eb738e590b7..d5245491d39d8 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlSingleFileSpecifyOutputDirectory/amd/outdir/simple/test.js +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlSingleFileSpecifyOutputDirectory/amd/outdir/simple/test.js @@ -1,5 +1,5 @@ var a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlSingleFileSpecifyOutputDirectory/node/outdir/simple/test.js b/tests/baselines/reference/project/maprootUrlsourcerootUrlSingleFileSpecifyOutputDirectory/node/outdir/simple/test.js index 73eb738e590b7..d5245491d39d8 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlSingleFileSpecifyOutputDirectory/node/outdir/simple/test.js +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlSingleFileSpecifyOutputDirectory/node/outdir/simple/test.js @@ -1,5 +1,5 @@ var a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlSingleFileSpecifyOutputFile/amd/bin/test.js b/tests/baselines/reference/project/maprootUrlsourcerootUrlSingleFileSpecifyOutputFile/amd/bin/test.js index 73eb738e590b7..d5245491d39d8 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlSingleFileSpecifyOutputFile/amd/bin/test.js +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlSingleFileSpecifyOutputFile/amd/bin/test.js @@ -1,5 +1,5 @@ var a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlSingleFileSpecifyOutputFile/node/bin/test.js b/tests/baselines/reference/project/maprootUrlsourcerootUrlSingleFileSpecifyOutputFile/node/bin/test.js index 73eb738e590b7..d5245491d39d8 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlSingleFileSpecifyOutputFile/node/bin/test.js +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlSingleFileSpecifyOutputFile/node/bin/test.js @@ -1,5 +1,5 @@ var a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlSubfolderNoOutdir/amd/ref/m1.js b/tests/baselines/reference/project/maprootUrlsourcerootUrlSubfolderNoOutdir/amd/ref/m1.js index ac9c9fc5839b4..639e6c5846246 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlSubfolderNoOutdir/amd/ref/m1.js +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlSubfolderNoOutdir/amd/ref/m1.js @@ -1,5 +1,5 @@ var m1_a1 = 10; -var m1_c1 = (function () { +var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlSubfolderNoOutdir/amd/test.js b/tests/baselines/reference/project/maprootUrlsourcerootUrlSubfolderNoOutdir/amd/test.js index b268cd98e4147..475fba0bd2a9b 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlSubfolderNoOutdir/amd/test.js +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlSubfolderNoOutdir/amd/test.js @@ -1,6 +1,6 @@ /// var a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlSubfolderNoOutdir/node/ref/m1.js b/tests/baselines/reference/project/maprootUrlsourcerootUrlSubfolderNoOutdir/node/ref/m1.js index ac9c9fc5839b4..639e6c5846246 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlSubfolderNoOutdir/node/ref/m1.js +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlSubfolderNoOutdir/node/ref/m1.js @@ -1,5 +1,5 @@ var m1_a1 = 10; -var m1_c1 = (function () { +var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlSubfolderNoOutdir/node/test.js b/tests/baselines/reference/project/maprootUrlsourcerootUrlSubfolderNoOutdir/node/test.js index b268cd98e4147..475fba0bd2a9b 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlSubfolderNoOutdir/node/test.js +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlSubfolderNoOutdir/node/test.js @@ -1,6 +1,6 @@ /// var a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js b/tests/baselines/reference/project/maprootUrlsourcerootUrlSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js index ac9c9fc5839b4..639e6c5846246 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js @@ -1,5 +1,5 @@ var m1_a1 = 10; -var m1_c1 = (function () { +var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js b/tests/baselines/reference/project/maprootUrlsourcerootUrlSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js index b268cd98e4147..475fba0bd2a9b 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js @@ -1,6 +1,6 @@ /// var a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js b/tests/baselines/reference/project/maprootUrlsourcerootUrlSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js index ac9c9fc5839b4..639e6c5846246 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js @@ -1,5 +1,5 @@ var m1_a1 = 10; -var m1_c1 = (function () { +var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js b/tests/baselines/reference/project/maprootUrlsourcerootUrlSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js index b268cd98e4147..475fba0bd2a9b 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js @@ -1,6 +1,6 @@ /// var a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlSubfolderSpecifyOutputFile/amd/bin/test.js b/tests/baselines/reference/project/maprootUrlsourcerootUrlSubfolderSpecifyOutputFile/amd/bin/test.js index 4b9e91859bfef..126bb93b34d61 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlSubfolderSpecifyOutputFile/amd/bin/test.js +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlSubfolderSpecifyOutputFile/amd/bin/test.js @@ -1,5 +1,5 @@ var m1_a1 = 10; -var m1_c1 = (function () { +var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; @@ -10,7 +10,7 @@ function m1_f1() { } /// var a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlSubfolderSpecifyOutputFile/node/bin/test.js b/tests/baselines/reference/project/maprootUrlsourcerootUrlSubfolderSpecifyOutputFile/node/bin/test.js index 4b9e91859bfef..126bb93b34d61 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlSubfolderSpecifyOutputFile/node/bin/test.js +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlSubfolderSpecifyOutputFile/node/bin/test.js @@ -1,5 +1,5 @@ var m1_a1 = 10; -var m1_c1 = (function () { +var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; @@ -10,7 +10,7 @@ function m1_f1() { } /// var a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/outMixedSubfolderNoOutdir/amd/ref/m1.js b/tests/baselines/reference/project/outMixedSubfolderNoOutdir/amd/ref/m1.js index a9ac9819faabc..1b7fc06763718 100644 --- a/tests/baselines/reference/project/outMixedSubfolderNoOutdir/amd/ref/m1.js +++ b/tests/baselines/reference/project/outMixedSubfolderNoOutdir/amd/ref/m1.js @@ -1,5 +1,5 @@ var m1_a1 = 10; -var m1_c1 = (function () { +var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; diff --git a/tests/baselines/reference/project/outMixedSubfolderNoOutdir/amd/ref/m2.js b/tests/baselines/reference/project/outMixedSubfolderNoOutdir/amd/ref/m2.js index 257b2bbaa8fc8..a40b5341baf63 100644 --- a/tests/baselines/reference/project/outMixedSubfolderNoOutdir/amd/ref/m2.js +++ b/tests/baselines/reference/project/outMixedSubfolderNoOutdir/amd/ref/m2.js @@ -2,7 +2,7 @@ define(["require", "exports"], function (require, exports) { "use strict"; exports.__esModule = true; exports.m2_a1 = 10; - var m2_c1 = (function () { + var m2_c1 = /** @class */ (function () { function m2_c1() { } return m2_c1; diff --git a/tests/baselines/reference/project/outMixedSubfolderNoOutdir/amd/test.js b/tests/baselines/reference/project/outMixedSubfolderNoOutdir/amd/test.js index 82a3d031fcee2..1208cf30a7a35 100644 --- a/tests/baselines/reference/project/outMixedSubfolderNoOutdir/amd/test.js +++ b/tests/baselines/reference/project/outMixedSubfolderNoOutdir/amd/test.js @@ -1,7 +1,7 @@ /// /// var a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/outMixedSubfolderNoOutdir/node/ref/m1.js b/tests/baselines/reference/project/outMixedSubfolderNoOutdir/node/ref/m1.js index a9ac9819faabc..1b7fc06763718 100644 --- a/tests/baselines/reference/project/outMixedSubfolderNoOutdir/node/ref/m1.js +++ b/tests/baselines/reference/project/outMixedSubfolderNoOutdir/node/ref/m1.js @@ -1,5 +1,5 @@ var m1_a1 = 10; -var m1_c1 = (function () { +var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; diff --git a/tests/baselines/reference/project/outMixedSubfolderNoOutdir/node/ref/m2.js b/tests/baselines/reference/project/outMixedSubfolderNoOutdir/node/ref/m2.js index 7a90183baf30b..87e6d90e74dc0 100644 --- a/tests/baselines/reference/project/outMixedSubfolderNoOutdir/node/ref/m2.js +++ b/tests/baselines/reference/project/outMixedSubfolderNoOutdir/node/ref/m2.js @@ -1,7 +1,7 @@ "use strict"; exports.__esModule = true; exports.m2_a1 = 10; -var m2_c1 = (function () { +var m2_c1 = /** @class */ (function () { function m2_c1() { } return m2_c1; diff --git a/tests/baselines/reference/project/outMixedSubfolderNoOutdir/node/test.js b/tests/baselines/reference/project/outMixedSubfolderNoOutdir/node/test.js index 82a3d031fcee2..1208cf30a7a35 100644 --- a/tests/baselines/reference/project/outMixedSubfolderNoOutdir/node/test.js +++ b/tests/baselines/reference/project/outMixedSubfolderNoOutdir/node/test.js @@ -1,7 +1,7 @@ /// /// var a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/outMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js b/tests/baselines/reference/project/outMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js index a9ac9819faabc..1b7fc06763718 100644 --- a/tests/baselines/reference/project/outMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js +++ b/tests/baselines/reference/project/outMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js @@ -1,5 +1,5 @@ var m1_a1 = 10; -var m1_c1 = (function () { +var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; diff --git a/tests/baselines/reference/project/outMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m2.js b/tests/baselines/reference/project/outMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m2.js index 257b2bbaa8fc8..a40b5341baf63 100644 --- a/tests/baselines/reference/project/outMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m2.js +++ b/tests/baselines/reference/project/outMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m2.js @@ -2,7 +2,7 @@ define(["require", "exports"], function (require, exports) { "use strict"; exports.__esModule = true; exports.m2_a1 = 10; - var m2_c1 = (function () { + var m2_c1 = /** @class */ (function () { function m2_c1() { } return m2_c1; diff --git a/tests/baselines/reference/project/outMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js b/tests/baselines/reference/project/outMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js index 82a3d031fcee2..1208cf30a7a35 100644 --- a/tests/baselines/reference/project/outMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js +++ b/tests/baselines/reference/project/outMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js @@ -1,7 +1,7 @@ /// /// var a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/outMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js b/tests/baselines/reference/project/outMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js index a9ac9819faabc..1b7fc06763718 100644 --- a/tests/baselines/reference/project/outMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js +++ b/tests/baselines/reference/project/outMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js @@ -1,5 +1,5 @@ var m1_a1 = 10; -var m1_c1 = (function () { +var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; diff --git a/tests/baselines/reference/project/outMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m2.js b/tests/baselines/reference/project/outMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m2.js index 7a90183baf30b..87e6d90e74dc0 100644 --- a/tests/baselines/reference/project/outMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m2.js +++ b/tests/baselines/reference/project/outMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m2.js @@ -1,7 +1,7 @@ "use strict"; exports.__esModule = true; exports.m2_a1 = 10; -var m2_c1 = (function () { +var m2_c1 = /** @class */ (function () { function m2_c1() { } return m2_c1; diff --git a/tests/baselines/reference/project/outMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js b/tests/baselines/reference/project/outMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js index 82a3d031fcee2..1208cf30a7a35 100644 --- a/tests/baselines/reference/project/outMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js +++ b/tests/baselines/reference/project/outMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js @@ -1,7 +1,7 @@ /// /// var a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/outMixedSubfolderSpecifyOutputFile/amd/bin/test.js b/tests/baselines/reference/project/outMixedSubfolderSpecifyOutputFile/amd/bin/test.js index ef652b9e92970..0f4f56cebd9b0 100644 --- a/tests/baselines/reference/project/outMixedSubfolderSpecifyOutputFile/amd/bin/test.js +++ b/tests/baselines/reference/project/outMixedSubfolderSpecifyOutputFile/amd/bin/test.js @@ -1,5 +1,5 @@ var m1_a1 = 10; -var m1_c1 = (function () { +var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; @@ -12,7 +12,7 @@ define("ref/m2", ["require", "exports"], function (require, exports) { "use strict"; exports.__esModule = true; exports.m2_a1 = 10; - var m2_c1 = (function () { + var m2_c1 = /** @class */ (function () { function m2_c1() { } return m2_c1; @@ -27,7 +27,7 @@ define("ref/m2", ["require", "exports"], function (require, exports) { /// /// var a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/outMixedSubfolderSpecifyOutputFile/node/bin/test.js b/tests/baselines/reference/project/outMixedSubfolderSpecifyOutputFile/node/bin/test.js index d10738c12a690..eca745c76f148 100644 --- a/tests/baselines/reference/project/outMixedSubfolderSpecifyOutputFile/node/bin/test.js +++ b/tests/baselines/reference/project/outMixedSubfolderSpecifyOutputFile/node/bin/test.js @@ -1,5 +1,5 @@ var m1_a1 = 10; -var m1_c1 = (function () { +var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; @@ -11,7 +11,7 @@ function m1_f1() { /// /// var a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/outMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/bin/outAndOutDirFile.js b/tests/baselines/reference/project/outMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/bin/outAndOutDirFile.js index ef652b9e92970..0f4f56cebd9b0 100644 --- a/tests/baselines/reference/project/outMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/bin/outAndOutDirFile.js +++ b/tests/baselines/reference/project/outMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/bin/outAndOutDirFile.js @@ -1,5 +1,5 @@ var m1_a1 = 10; -var m1_c1 = (function () { +var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; @@ -12,7 +12,7 @@ define("ref/m2", ["require", "exports"], function (require, exports) { "use strict"; exports.__esModule = true; exports.m2_a1 = 10; - var m2_c1 = (function () { + var m2_c1 = /** @class */ (function () { function m2_c1() { } return m2_c1; @@ -27,7 +27,7 @@ define("ref/m2", ["require", "exports"], function (require, exports) { /// /// var a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/outMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/bin/outAndOutDirFile.js b/tests/baselines/reference/project/outMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/bin/outAndOutDirFile.js index d10738c12a690..eca745c76f148 100644 --- a/tests/baselines/reference/project/outMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/bin/outAndOutDirFile.js +++ b/tests/baselines/reference/project/outMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/bin/outAndOutDirFile.js @@ -1,5 +1,5 @@ var m1_a1 = 10; -var m1_c1 = (function () { +var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; @@ -11,7 +11,7 @@ function m1_f1() { /// /// var a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/outModuleMultifolderNoOutdir/amd/diskFile0.js b/tests/baselines/reference/project/outModuleMultifolderNoOutdir/amd/diskFile0.js index 257b2bbaa8fc8..a40b5341baf63 100644 --- a/tests/baselines/reference/project/outModuleMultifolderNoOutdir/amd/diskFile0.js +++ b/tests/baselines/reference/project/outModuleMultifolderNoOutdir/amd/diskFile0.js @@ -2,7 +2,7 @@ define(["require", "exports"], function (require, exports) { "use strict"; exports.__esModule = true; exports.m2_a1 = 10; - var m2_c1 = (function () { + var m2_c1 = /** @class */ (function () { function m2_c1() { } return m2_c1; diff --git a/tests/baselines/reference/project/outModuleMultifolderNoOutdir/amd/ref/m1.js b/tests/baselines/reference/project/outModuleMultifolderNoOutdir/amd/ref/m1.js index b5ccdc63b22ee..327d944709203 100644 --- a/tests/baselines/reference/project/outModuleMultifolderNoOutdir/amd/ref/m1.js +++ b/tests/baselines/reference/project/outModuleMultifolderNoOutdir/amd/ref/m1.js @@ -2,7 +2,7 @@ define(["require", "exports"], function (require, exports) { "use strict"; exports.__esModule = true; exports.m1_a1 = 10; - var m1_c1 = (function () { + var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; diff --git a/tests/baselines/reference/project/outModuleMultifolderNoOutdir/amd/test.js b/tests/baselines/reference/project/outModuleMultifolderNoOutdir/amd/test.js index fb9329a59b47e..4563393b9fcbc 100644 --- a/tests/baselines/reference/project/outModuleMultifolderNoOutdir/amd/test.js +++ b/tests/baselines/reference/project/outModuleMultifolderNoOutdir/amd/test.js @@ -2,7 +2,7 @@ define(["require", "exports", "ref/m1", "../outputdir_module_multifolder_ref/m2" "use strict"; exports.__esModule = true; exports.a1 = 10; - var c1 = (function () { + var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/outModuleMultifolderNoOutdir/node/diskFile0.js b/tests/baselines/reference/project/outModuleMultifolderNoOutdir/node/diskFile0.js index 7a90183baf30b..87e6d90e74dc0 100644 --- a/tests/baselines/reference/project/outModuleMultifolderNoOutdir/node/diskFile0.js +++ b/tests/baselines/reference/project/outModuleMultifolderNoOutdir/node/diskFile0.js @@ -1,7 +1,7 @@ "use strict"; exports.__esModule = true; exports.m2_a1 = 10; -var m2_c1 = (function () { +var m2_c1 = /** @class */ (function () { function m2_c1() { } return m2_c1; diff --git a/tests/baselines/reference/project/outModuleMultifolderNoOutdir/node/ref/m1.js b/tests/baselines/reference/project/outModuleMultifolderNoOutdir/node/ref/m1.js index 52ebad557038b..5856eb11fca30 100644 --- a/tests/baselines/reference/project/outModuleMultifolderNoOutdir/node/ref/m1.js +++ b/tests/baselines/reference/project/outModuleMultifolderNoOutdir/node/ref/m1.js @@ -1,7 +1,7 @@ "use strict"; exports.__esModule = true; exports.m1_a1 = 10; -var m1_c1 = (function () { +var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; diff --git a/tests/baselines/reference/project/outModuleMultifolderNoOutdir/node/test.js b/tests/baselines/reference/project/outModuleMultifolderNoOutdir/node/test.js index 18fccdca8bbd2..0536e30f8d15c 100644 --- a/tests/baselines/reference/project/outModuleMultifolderNoOutdir/node/test.js +++ b/tests/baselines/reference/project/outModuleMultifolderNoOutdir/node/test.js @@ -3,7 +3,7 @@ exports.__esModule = true; var m1 = require("ref/m1"); var m2 = require("../outputdir_module_multifolder_ref/m2"); exports.a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/outModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder/ref/m1.js b/tests/baselines/reference/project/outModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder/ref/m1.js index b5ccdc63b22ee..327d944709203 100644 --- a/tests/baselines/reference/project/outModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder/ref/m1.js +++ b/tests/baselines/reference/project/outModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder/ref/m1.js @@ -2,7 +2,7 @@ define(["require", "exports"], function (require, exports) { "use strict"; exports.__esModule = true; exports.m1_a1 = 10; - var m1_c1 = (function () { + var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; diff --git a/tests/baselines/reference/project/outModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder/test.js b/tests/baselines/reference/project/outModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder/test.js index fb9329a59b47e..4563393b9fcbc 100644 --- a/tests/baselines/reference/project/outModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder/test.js +++ b/tests/baselines/reference/project/outModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder/test.js @@ -2,7 +2,7 @@ define(["require", "exports", "ref/m1", "../outputdir_module_multifolder_ref/m2" "use strict"; exports.__esModule = true; exports.a1 = 10; - var c1 = (function () { + var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/outModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder_ref/m2.js b/tests/baselines/reference/project/outModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder_ref/m2.js index 257b2bbaa8fc8..a40b5341baf63 100644 --- a/tests/baselines/reference/project/outModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder_ref/m2.js +++ b/tests/baselines/reference/project/outModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder_ref/m2.js @@ -2,7 +2,7 @@ define(["require", "exports"], function (require, exports) { "use strict"; exports.__esModule = true; exports.m2_a1 = 10; - var m2_c1 = (function () { + var m2_c1 = /** @class */ (function () { function m2_c1() { } return m2_c1; diff --git a/tests/baselines/reference/project/outModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder/ref/m1.js b/tests/baselines/reference/project/outModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder/ref/m1.js index 52ebad557038b..5856eb11fca30 100644 --- a/tests/baselines/reference/project/outModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder/ref/m1.js +++ b/tests/baselines/reference/project/outModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder/ref/m1.js @@ -1,7 +1,7 @@ "use strict"; exports.__esModule = true; exports.m1_a1 = 10; -var m1_c1 = (function () { +var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; diff --git a/tests/baselines/reference/project/outModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder/test.js b/tests/baselines/reference/project/outModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder/test.js index 18fccdca8bbd2..0536e30f8d15c 100644 --- a/tests/baselines/reference/project/outModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder/test.js +++ b/tests/baselines/reference/project/outModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder/test.js @@ -3,7 +3,7 @@ exports.__esModule = true; var m1 = require("ref/m1"); var m2 = require("../outputdir_module_multifolder_ref/m2"); exports.a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/outModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder_ref/m2.js b/tests/baselines/reference/project/outModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder_ref/m2.js index 7a90183baf30b..87e6d90e74dc0 100644 --- a/tests/baselines/reference/project/outModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder_ref/m2.js +++ b/tests/baselines/reference/project/outModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder_ref/m2.js @@ -1,7 +1,7 @@ "use strict"; exports.__esModule = true; exports.m2_a1 = 10; -var m2_c1 = (function () { +var m2_c1 = /** @class */ (function () { function m2_c1() { } return m2_c1; diff --git a/tests/baselines/reference/project/outModuleMultifolderSpecifyOutputFile/amd/bin/test.js b/tests/baselines/reference/project/outModuleMultifolderSpecifyOutputFile/amd/bin/test.js index adb1b5061b50d..aafad537ed21a 100644 --- a/tests/baselines/reference/project/outModuleMultifolderSpecifyOutputFile/amd/bin/test.js +++ b/tests/baselines/reference/project/outModuleMultifolderSpecifyOutputFile/amd/bin/test.js @@ -2,7 +2,7 @@ define("outputdir_module_multifolder/ref/m1", ["require", "exports"], function ( "use strict"; exports.__esModule = true; exports.m1_a1 = 10; - var m1_c1 = (function () { + var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; @@ -18,7 +18,7 @@ define("outputdir_module_multifolder_ref/m2", ["require", "exports"], function ( "use strict"; exports.__esModule = true; exports.m2_a1 = 10; - var m2_c1 = (function () { + var m2_c1 = /** @class */ (function () { function m2_c1() { } return m2_c1; @@ -34,7 +34,7 @@ define("outputdir_module_multifolder/test", ["require", "exports", "outputdir_mo "use strict"; exports.__esModule = true; exports.a1 = 10; - var c1 = (function () { + var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/outModuleSimpleNoOutdir/amd/m1.js b/tests/baselines/reference/project/outModuleSimpleNoOutdir/amd/m1.js index b5ccdc63b22ee..327d944709203 100644 --- a/tests/baselines/reference/project/outModuleSimpleNoOutdir/amd/m1.js +++ b/tests/baselines/reference/project/outModuleSimpleNoOutdir/amd/m1.js @@ -2,7 +2,7 @@ define(["require", "exports"], function (require, exports) { "use strict"; exports.__esModule = true; exports.m1_a1 = 10; - var m1_c1 = (function () { + var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; diff --git a/tests/baselines/reference/project/outModuleSimpleNoOutdir/amd/test.js b/tests/baselines/reference/project/outModuleSimpleNoOutdir/amd/test.js index c062c0ac6d4a8..ed5e603fa26ec 100644 --- a/tests/baselines/reference/project/outModuleSimpleNoOutdir/amd/test.js +++ b/tests/baselines/reference/project/outModuleSimpleNoOutdir/amd/test.js @@ -2,7 +2,7 @@ define(["require", "exports", "m1"], function (require, exports, m1) { "use strict"; exports.__esModule = true; exports.a1 = 10; - var c1 = (function () { + var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/outModuleSimpleNoOutdir/node/m1.js b/tests/baselines/reference/project/outModuleSimpleNoOutdir/node/m1.js index 52ebad557038b..5856eb11fca30 100644 --- a/tests/baselines/reference/project/outModuleSimpleNoOutdir/node/m1.js +++ b/tests/baselines/reference/project/outModuleSimpleNoOutdir/node/m1.js @@ -1,7 +1,7 @@ "use strict"; exports.__esModule = true; exports.m1_a1 = 10; -var m1_c1 = (function () { +var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; diff --git a/tests/baselines/reference/project/outModuleSimpleNoOutdir/node/test.js b/tests/baselines/reference/project/outModuleSimpleNoOutdir/node/test.js index 2e50e0b798937..346ad795e290a 100644 --- a/tests/baselines/reference/project/outModuleSimpleNoOutdir/node/test.js +++ b/tests/baselines/reference/project/outModuleSimpleNoOutdir/node/test.js @@ -2,7 +2,7 @@ exports.__esModule = true; var m1 = require("m1"); exports.a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/outModuleSimpleSpecifyOutputDirectory/amd/outdir/simple/m1.js b/tests/baselines/reference/project/outModuleSimpleSpecifyOutputDirectory/amd/outdir/simple/m1.js index b5ccdc63b22ee..327d944709203 100644 --- a/tests/baselines/reference/project/outModuleSimpleSpecifyOutputDirectory/amd/outdir/simple/m1.js +++ b/tests/baselines/reference/project/outModuleSimpleSpecifyOutputDirectory/amd/outdir/simple/m1.js @@ -2,7 +2,7 @@ define(["require", "exports"], function (require, exports) { "use strict"; exports.__esModule = true; exports.m1_a1 = 10; - var m1_c1 = (function () { + var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; diff --git a/tests/baselines/reference/project/outModuleSimpleSpecifyOutputDirectory/amd/outdir/simple/test.js b/tests/baselines/reference/project/outModuleSimpleSpecifyOutputDirectory/amd/outdir/simple/test.js index c062c0ac6d4a8..ed5e603fa26ec 100644 --- a/tests/baselines/reference/project/outModuleSimpleSpecifyOutputDirectory/amd/outdir/simple/test.js +++ b/tests/baselines/reference/project/outModuleSimpleSpecifyOutputDirectory/amd/outdir/simple/test.js @@ -2,7 +2,7 @@ define(["require", "exports", "m1"], function (require, exports, m1) { "use strict"; exports.__esModule = true; exports.a1 = 10; - var c1 = (function () { + var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/outModuleSimpleSpecifyOutputDirectory/node/outdir/simple/m1.js b/tests/baselines/reference/project/outModuleSimpleSpecifyOutputDirectory/node/outdir/simple/m1.js index 52ebad557038b..5856eb11fca30 100644 --- a/tests/baselines/reference/project/outModuleSimpleSpecifyOutputDirectory/node/outdir/simple/m1.js +++ b/tests/baselines/reference/project/outModuleSimpleSpecifyOutputDirectory/node/outdir/simple/m1.js @@ -1,7 +1,7 @@ "use strict"; exports.__esModule = true; exports.m1_a1 = 10; -var m1_c1 = (function () { +var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; diff --git a/tests/baselines/reference/project/outModuleSimpleSpecifyOutputDirectory/node/outdir/simple/test.js b/tests/baselines/reference/project/outModuleSimpleSpecifyOutputDirectory/node/outdir/simple/test.js index 2e50e0b798937..346ad795e290a 100644 --- a/tests/baselines/reference/project/outModuleSimpleSpecifyOutputDirectory/node/outdir/simple/test.js +++ b/tests/baselines/reference/project/outModuleSimpleSpecifyOutputDirectory/node/outdir/simple/test.js @@ -2,7 +2,7 @@ exports.__esModule = true; var m1 = require("m1"); exports.a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/outModuleSimpleSpecifyOutputFile/amd/bin/test.js b/tests/baselines/reference/project/outModuleSimpleSpecifyOutputFile/amd/bin/test.js index 0a1f6b523c998..515a9c965b1a7 100644 --- a/tests/baselines/reference/project/outModuleSimpleSpecifyOutputFile/amd/bin/test.js +++ b/tests/baselines/reference/project/outModuleSimpleSpecifyOutputFile/amd/bin/test.js @@ -2,7 +2,7 @@ define("m1", ["require", "exports"], function (require, exports) { "use strict"; exports.__esModule = true; exports.m1_a1 = 10; - var m1_c1 = (function () { + var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; @@ -18,7 +18,7 @@ define("test", ["require", "exports", "m1"], function (require, exports, m1) { "use strict"; exports.__esModule = true; exports.a1 = 10; - var c1 = (function () { + var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/outModuleSubfolderNoOutdir/amd/ref/m1.js b/tests/baselines/reference/project/outModuleSubfolderNoOutdir/amd/ref/m1.js index b5ccdc63b22ee..327d944709203 100644 --- a/tests/baselines/reference/project/outModuleSubfolderNoOutdir/amd/ref/m1.js +++ b/tests/baselines/reference/project/outModuleSubfolderNoOutdir/amd/ref/m1.js @@ -2,7 +2,7 @@ define(["require", "exports"], function (require, exports) { "use strict"; exports.__esModule = true; exports.m1_a1 = 10; - var m1_c1 = (function () { + var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; diff --git a/tests/baselines/reference/project/outModuleSubfolderNoOutdir/amd/test.js b/tests/baselines/reference/project/outModuleSubfolderNoOutdir/amd/test.js index 0fdf8d91b324b..36dca07dcadb7 100644 --- a/tests/baselines/reference/project/outModuleSubfolderNoOutdir/amd/test.js +++ b/tests/baselines/reference/project/outModuleSubfolderNoOutdir/amd/test.js @@ -2,7 +2,7 @@ define(["require", "exports", "ref/m1"], function (require, exports, m1) { "use strict"; exports.__esModule = true; exports.a1 = 10; - var c1 = (function () { + var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/outModuleSubfolderNoOutdir/node/ref/m1.js b/tests/baselines/reference/project/outModuleSubfolderNoOutdir/node/ref/m1.js index 52ebad557038b..5856eb11fca30 100644 --- a/tests/baselines/reference/project/outModuleSubfolderNoOutdir/node/ref/m1.js +++ b/tests/baselines/reference/project/outModuleSubfolderNoOutdir/node/ref/m1.js @@ -1,7 +1,7 @@ "use strict"; exports.__esModule = true; exports.m1_a1 = 10; -var m1_c1 = (function () { +var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; diff --git a/tests/baselines/reference/project/outModuleSubfolderNoOutdir/node/test.js b/tests/baselines/reference/project/outModuleSubfolderNoOutdir/node/test.js index 33f201ce9d5e2..218a57ad26435 100644 --- a/tests/baselines/reference/project/outModuleSubfolderNoOutdir/node/test.js +++ b/tests/baselines/reference/project/outModuleSubfolderNoOutdir/node/test.js @@ -2,7 +2,7 @@ exports.__esModule = true; var m1 = require("ref/m1"); exports.a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/outModuleSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js b/tests/baselines/reference/project/outModuleSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js index b5ccdc63b22ee..327d944709203 100644 --- a/tests/baselines/reference/project/outModuleSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js +++ b/tests/baselines/reference/project/outModuleSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js @@ -2,7 +2,7 @@ define(["require", "exports"], function (require, exports) { "use strict"; exports.__esModule = true; exports.m1_a1 = 10; - var m1_c1 = (function () { + var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; diff --git a/tests/baselines/reference/project/outModuleSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js b/tests/baselines/reference/project/outModuleSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js index 0fdf8d91b324b..36dca07dcadb7 100644 --- a/tests/baselines/reference/project/outModuleSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js +++ b/tests/baselines/reference/project/outModuleSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js @@ -2,7 +2,7 @@ define(["require", "exports", "ref/m1"], function (require, exports, m1) { "use strict"; exports.__esModule = true; exports.a1 = 10; - var c1 = (function () { + var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/outModuleSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js b/tests/baselines/reference/project/outModuleSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js index 52ebad557038b..5856eb11fca30 100644 --- a/tests/baselines/reference/project/outModuleSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js +++ b/tests/baselines/reference/project/outModuleSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js @@ -1,7 +1,7 @@ "use strict"; exports.__esModule = true; exports.m1_a1 = 10; -var m1_c1 = (function () { +var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; diff --git a/tests/baselines/reference/project/outModuleSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js b/tests/baselines/reference/project/outModuleSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js index 33f201ce9d5e2..218a57ad26435 100644 --- a/tests/baselines/reference/project/outModuleSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js +++ b/tests/baselines/reference/project/outModuleSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js @@ -2,7 +2,7 @@ exports.__esModule = true; var m1 = require("ref/m1"); exports.a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/outModuleSubfolderSpecifyOutputFile/amd/bin/test.js b/tests/baselines/reference/project/outModuleSubfolderSpecifyOutputFile/amd/bin/test.js index 2ddfb9277a3ad..4d21ad2171951 100644 --- a/tests/baselines/reference/project/outModuleSubfolderSpecifyOutputFile/amd/bin/test.js +++ b/tests/baselines/reference/project/outModuleSubfolderSpecifyOutputFile/amd/bin/test.js @@ -2,7 +2,7 @@ define("ref/m1", ["require", "exports"], function (require, exports) { "use strict"; exports.__esModule = true; exports.m1_a1 = 10; - var m1_c1 = (function () { + var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; @@ -18,7 +18,7 @@ define("test", ["require", "exports", "ref/m1"], function (require, exports, m1) "use strict"; exports.__esModule = true; exports.a1 = 10; - var c1 = (function () { + var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/outMultifolderNoOutdir/amd/diskFile0.js b/tests/baselines/reference/project/outMultifolderNoOutdir/amd/diskFile0.js index f5e38ab560c8d..1937fd25edbba 100644 --- a/tests/baselines/reference/project/outMultifolderNoOutdir/amd/diskFile0.js +++ b/tests/baselines/reference/project/outMultifolderNoOutdir/amd/diskFile0.js @@ -1,5 +1,5 @@ var m2_a1 = 10; -var m2_c1 = (function () { +var m2_c1 = /** @class */ (function () { function m2_c1() { } return m2_c1; diff --git a/tests/baselines/reference/project/outMultifolderNoOutdir/amd/ref/m1.js b/tests/baselines/reference/project/outMultifolderNoOutdir/amd/ref/m1.js index a9ac9819faabc..1b7fc06763718 100644 --- a/tests/baselines/reference/project/outMultifolderNoOutdir/amd/ref/m1.js +++ b/tests/baselines/reference/project/outMultifolderNoOutdir/amd/ref/m1.js @@ -1,5 +1,5 @@ var m1_a1 = 10; -var m1_c1 = (function () { +var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; diff --git a/tests/baselines/reference/project/outMultifolderNoOutdir/amd/test.js b/tests/baselines/reference/project/outMultifolderNoOutdir/amd/test.js index 4a38b6ddd4d6f..a870977dadf19 100644 --- a/tests/baselines/reference/project/outMultifolderNoOutdir/amd/test.js +++ b/tests/baselines/reference/project/outMultifolderNoOutdir/amd/test.js @@ -1,7 +1,7 @@ /// /// var a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/outMultifolderNoOutdir/node/diskFile0.js b/tests/baselines/reference/project/outMultifolderNoOutdir/node/diskFile0.js index f5e38ab560c8d..1937fd25edbba 100644 --- a/tests/baselines/reference/project/outMultifolderNoOutdir/node/diskFile0.js +++ b/tests/baselines/reference/project/outMultifolderNoOutdir/node/diskFile0.js @@ -1,5 +1,5 @@ var m2_a1 = 10; -var m2_c1 = (function () { +var m2_c1 = /** @class */ (function () { function m2_c1() { } return m2_c1; diff --git a/tests/baselines/reference/project/outMultifolderNoOutdir/node/ref/m1.js b/tests/baselines/reference/project/outMultifolderNoOutdir/node/ref/m1.js index a9ac9819faabc..1b7fc06763718 100644 --- a/tests/baselines/reference/project/outMultifolderNoOutdir/node/ref/m1.js +++ b/tests/baselines/reference/project/outMultifolderNoOutdir/node/ref/m1.js @@ -1,5 +1,5 @@ var m1_a1 = 10; -var m1_c1 = (function () { +var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; diff --git a/tests/baselines/reference/project/outMultifolderNoOutdir/node/test.js b/tests/baselines/reference/project/outMultifolderNoOutdir/node/test.js index 4a38b6ddd4d6f..a870977dadf19 100644 --- a/tests/baselines/reference/project/outMultifolderNoOutdir/node/test.js +++ b/tests/baselines/reference/project/outMultifolderNoOutdir/node/test.js @@ -1,7 +1,7 @@ /// /// var a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/outMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/ref/m1.js b/tests/baselines/reference/project/outMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/ref/m1.js index a9ac9819faabc..1b7fc06763718 100644 --- a/tests/baselines/reference/project/outMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/ref/m1.js +++ b/tests/baselines/reference/project/outMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/ref/m1.js @@ -1,5 +1,5 @@ var m1_a1 = 10; -var m1_c1 = (function () { +var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; diff --git a/tests/baselines/reference/project/outMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/test.js b/tests/baselines/reference/project/outMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/test.js index 4a38b6ddd4d6f..a870977dadf19 100644 --- a/tests/baselines/reference/project/outMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/test.js +++ b/tests/baselines/reference/project/outMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/test.js @@ -1,7 +1,7 @@ /// /// var a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/outMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder_ref/m2.js b/tests/baselines/reference/project/outMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder_ref/m2.js index f5e38ab560c8d..1937fd25edbba 100644 --- a/tests/baselines/reference/project/outMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder_ref/m2.js +++ b/tests/baselines/reference/project/outMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder_ref/m2.js @@ -1,5 +1,5 @@ var m2_a1 = 10; -var m2_c1 = (function () { +var m2_c1 = /** @class */ (function () { function m2_c1() { } return m2_c1; diff --git a/tests/baselines/reference/project/outMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/ref/m1.js b/tests/baselines/reference/project/outMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/ref/m1.js index a9ac9819faabc..1b7fc06763718 100644 --- a/tests/baselines/reference/project/outMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/ref/m1.js +++ b/tests/baselines/reference/project/outMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/ref/m1.js @@ -1,5 +1,5 @@ var m1_a1 = 10; -var m1_c1 = (function () { +var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; diff --git a/tests/baselines/reference/project/outMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/test.js b/tests/baselines/reference/project/outMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/test.js index 4a38b6ddd4d6f..a870977dadf19 100644 --- a/tests/baselines/reference/project/outMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/test.js +++ b/tests/baselines/reference/project/outMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/test.js @@ -1,7 +1,7 @@ /// /// var a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/outMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder_ref/m2.js b/tests/baselines/reference/project/outMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder_ref/m2.js index f5e38ab560c8d..1937fd25edbba 100644 --- a/tests/baselines/reference/project/outMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder_ref/m2.js +++ b/tests/baselines/reference/project/outMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder_ref/m2.js @@ -1,5 +1,5 @@ var m2_a1 = 10; -var m2_c1 = (function () { +var m2_c1 = /** @class */ (function () { function m2_c1() { } return m2_c1; diff --git a/tests/baselines/reference/project/outMultifolderSpecifyOutputFile/amd/bin/test.js b/tests/baselines/reference/project/outMultifolderSpecifyOutputFile/amd/bin/test.js index 283a721170cb4..1a787105db3b9 100644 --- a/tests/baselines/reference/project/outMultifolderSpecifyOutputFile/amd/bin/test.js +++ b/tests/baselines/reference/project/outMultifolderSpecifyOutputFile/amd/bin/test.js @@ -1,5 +1,5 @@ var m1_a1 = 10; -var m1_c1 = (function () { +var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; @@ -9,7 +9,7 @@ function m1_f1() { return m1_instance1; } var m2_a1 = 10; -var m2_c1 = (function () { +var m2_c1 = /** @class */ (function () { function m2_c1() { } return m2_c1; @@ -21,7 +21,7 @@ function m2_f1() { /// /// var a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/outMultifolderSpecifyOutputFile/node/bin/test.js b/tests/baselines/reference/project/outMultifolderSpecifyOutputFile/node/bin/test.js index 283a721170cb4..1a787105db3b9 100644 --- a/tests/baselines/reference/project/outMultifolderSpecifyOutputFile/node/bin/test.js +++ b/tests/baselines/reference/project/outMultifolderSpecifyOutputFile/node/bin/test.js @@ -1,5 +1,5 @@ var m1_a1 = 10; -var m1_c1 = (function () { +var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; @@ -9,7 +9,7 @@ function m1_f1() { return m1_instance1; } var m2_a1 = 10; -var m2_c1 = (function () { +var m2_c1 = /** @class */ (function () { function m2_c1() { } return m2_c1; @@ -21,7 +21,7 @@ function m2_f1() { /// /// var a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/outSimpleNoOutdir/amd/m1.js b/tests/baselines/reference/project/outSimpleNoOutdir/amd/m1.js index a9ac9819faabc..1b7fc06763718 100644 --- a/tests/baselines/reference/project/outSimpleNoOutdir/amd/m1.js +++ b/tests/baselines/reference/project/outSimpleNoOutdir/amd/m1.js @@ -1,5 +1,5 @@ var m1_a1 = 10; -var m1_c1 = (function () { +var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; diff --git a/tests/baselines/reference/project/outSimpleNoOutdir/amd/test.js b/tests/baselines/reference/project/outSimpleNoOutdir/amd/test.js index eb02f7a013a6b..42951778f6705 100644 --- a/tests/baselines/reference/project/outSimpleNoOutdir/amd/test.js +++ b/tests/baselines/reference/project/outSimpleNoOutdir/amd/test.js @@ -1,6 +1,6 @@ /// var a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/outSimpleNoOutdir/node/m1.js b/tests/baselines/reference/project/outSimpleNoOutdir/node/m1.js index a9ac9819faabc..1b7fc06763718 100644 --- a/tests/baselines/reference/project/outSimpleNoOutdir/node/m1.js +++ b/tests/baselines/reference/project/outSimpleNoOutdir/node/m1.js @@ -1,5 +1,5 @@ var m1_a1 = 10; -var m1_c1 = (function () { +var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; diff --git a/tests/baselines/reference/project/outSimpleNoOutdir/node/test.js b/tests/baselines/reference/project/outSimpleNoOutdir/node/test.js index eb02f7a013a6b..42951778f6705 100644 --- a/tests/baselines/reference/project/outSimpleNoOutdir/node/test.js +++ b/tests/baselines/reference/project/outSimpleNoOutdir/node/test.js @@ -1,6 +1,6 @@ /// var a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/outSimpleSpecifyOutputDirectory/amd/outdir/simple/m1.js b/tests/baselines/reference/project/outSimpleSpecifyOutputDirectory/amd/outdir/simple/m1.js index a9ac9819faabc..1b7fc06763718 100644 --- a/tests/baselines/reference/project/outSimpleSpecifyOutputDirectory/amd/outdir/simple/m1.js +++ b/tests/baselines/reference/project/outSimpleSpecifyOutputDirectory/amd/outdir/simple/m1.js @@ -1,5 +1,5 @@ var m1_a1 = 10; -var m1_c1 = (function () { +var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; diff --git a/tests/baselines/reference/project/outSimpleSpecifyOutputDirectory/amd/outdir/simple/test.js b/tests/baselines/reference/project/outSimpleSpecifyOutputDirectory/amd/outdir/simple/test.js index eb02f7a013a6b..42951778f6705 100644 --- a/tests/baselines/reference/project/outSimpleSpecifyOutputDirectory/amd/outdir/simple/test.js +++ b/tests/baselines/reference/project/outSimpleSpecifyOutputDirectory/amd/outdir/simple/test.js @@ -1,6 +1,6 @@ /// var a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/outSimpleSpecifyOutputDirectory/node/outdir/simple/m1.js b/tests/baselines/reference/project/outSimpleSpecifyOutputDirectory/node/outdir/simple/m1.js index a9ac9819faabc..1b7fc06763718 100644 --- a/tests/baselines/reference/project/outSimpleSpecifyOutputDirectory/node/outdir/simple/m1.js +++ b/tests/baselines/reference/project/outSimpleSpecifyOutputDirectory/node/outdir/simple/m1.js @@ -1,5 +1,5 @@ var m1_a1 = 10; -var m1_c1 = (function () { +var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; diff --git a/tests/baselines/reference/project/outSimpleSpecifyOutputDirectory/node/outdir/simple/test.js b/tests/baselines/reference/project/outSimpleSpecifyOutputDirectory/node/outdir/simple/test.js index eb02f7a013a6b..42951778f6705 100644 --- a/tests/baselines/reference/project/outSimpleSpecifyOutputDirectory/node/outdir/simple/test.js +++ b/tests/baselines/reference/project/outSimpleSpecifyOutputDirectory/node/outdir/simple/test.js @@ -1,6 +1,6 @@ /// var a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/outSimpleSpecifyOutputFile/amd/bin/test.js b/tests/baselines/reference/project/outSimpleSpecifyOutputFile/amd/bin/test.js index d739de3142b52..335308fdbbad7 100644 --- a/tests/baselines/reference/project/outSimpleSpecifyOutputFile/amd/bin/test.js +++ b/tests/baselines/reference/project/outSimpleSpecifyOutputFile/amd/bin/test.js @@ -1,5 +1,5 @@ var m1_a1 = 10; -var m1_c1 = (function () { +var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; @@ -10,7 +10,7 @@ function m1_f1() { } /// var a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/outSimpleSpecifyOutputFile/node/bin/test.js b/tests/baselines/reference/project/outSimpleSpecifyOutputFile/node/bin/test.js index d739de3142b52..335308fdbbad7 100644 --- a/tests/baselines/reference/project/outSimpleSpecifyOutputFile/node/bin/test.js +++ b/tests/baselines/reference/project/outSimpleSpecifyOutputFile/node/bin/test.js @@ -1,5 +1,5 @@ var m1_a1 = 10; -var m1_c1 = (function () { +var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; @@ -10,7 +10,7 @@ function m1_f1() { } /// var a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/outSingleFileNoOutdir/amd/test.js b/tests/baselines/reference/project/outSingleFileNoOutdir/amd/test.js index c3f455a08ce64..fc842c3ae565b 100644 --- a/tests/baselines/reference/project/outSingleFileNoOutdir/amd/test.js +++ b/tests/baselines/reference/project/outSingleFileNoOutdir/amd/test.js @@ -1,5 +1,5 @@ var a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/outSingleFileNoOutdir/node/test.js b/tests/baselines/reference/project/outSingleFileNoOutdir/node/test.js index c3f455a08ce64..fc842c3ae565b 100644 --- a/tests/baselines/reference/project/outSingleFileNoOutdir/node/test.js +++ b/tests/baselines/reference/project/outSingleFileNoOutdir/node/test.js @@ -1,5 +1,5 @@ var a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/outSingleFileSpecifyOutputDirectory/amd/outdir/simple/test.js b/tests/baselines/reference/project/outSingleFileSpecifyOutputDirectory/amd/outdir/simple/test.js index c3f455a08ce64..fc842c3ae565b 100644 --- a/tests/baselines/reference/project/outSingleFileSpecifyOutputDirectory/amd/outdir/simple/test.js +++ b/tests/baselines/reference/project/outSingleFileSpecifyOutputDirectory/amd/outdir/simple/test.js @@ -1,5 +1,5 @@ var a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/outSingleFileSpecifyOutputDirectory/node/outdir/simple/test.js b/tests/baselines/reference/project/outSingleFileSpecifyOutputDirectory/node/outdir/simple/test.js index c3f455a08ce64..fc842c3ae565b 100644 --- a/tests/baselines/reference/project/outSingleFileSpecifyOutputDirectory/node/outdir/simple/test.js +++ b/tests/baselines/reference/project/outSingleFileSpecifyOutputDirectory/node/outdir/simple/test.js @@ -1,5 +1,5 @@ var a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/outSingleFileSpecifyOutputFile/amd/bin/test.js b/tests/baselines/reference/project/outSingleFileSpecifyOutputFile/amd/bin/test.js index c3f455a08ce64..fc842c3ae565b 100644 --- a/tests/baselines/reference/project/outSingleFileSpecifyOutputFile/amd/bin/test.js +++ b/tests/baselines/reference/project/outSingleFileSpecifyOutputFile/amd/bin/test.js @@ -1,5 +1,5 @@ var a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/outSingleFileSpecifyOutputFile/node/bin/test.js b/tests/baselines/reference/project/outSingleFileSpecifyOutputFile/node/bin/test.js index c3f455a08ce64..fc842c3ae565b 100644 --- a/tests/baselines/reference/project/outSingleFileSpecifyOutputFile/node/bin/test.js +++ b/tests/baselines/reference/project/outSingleFileSpecifyOutputFile/node/bin/test.js @@ -1,5 +1,5 @@ var a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/outSubfolderNoOutdir/amd/ref/m1.js b/tests/baselines/reference/project/outSubfolderNoOutdir/amd/ref/m1.js index a9ac9819faabc..1b7fc06763718 100644 --- a/tests/baselines/reference/project/outSubfolderNoOutdir/amd/ref/m1.js +++ b/tests/baselines/reference/project/outSubfolderNoOutdir/amd/ref/m1.js @@ -1,5 +1,5 @@ var m1_a1 = 10; -var m1_c1 = (function () { +var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; diff --git a/tests/baselines/reference/project/outSubfolderNoOutdir/amd/test.js b/tests/baselines/reference/project/outSubfolderNoOutdir/amd/test.js index d93a6707fdfe4..5a71ed22c8cc3 100644 --- a/tests/baselines/reference/project/outSubfolderNoOutdir/amd/test.js +++ b/tests/baselines/reference/project/outSubfolderNoOutdir/amd/test.js @@ -1,6 +1,6 @@ /// var a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/outSubfolderNoOutdir/node/ref/m1.js b/tests/baselines/reference/project/outSubfolderNoOutdir/node/ref/m1.js index a9ac9819faabc..1b7fc06763718 100644 --- a/tests/baselines/reference/project/outSubfolderNoOutdir/node/ref/m1.js +++ b/tests/baselines/reference/project/outSubfolderNoOutdir/node/ref/m1.js @@ -1,5 +1,5 @@ var m1_a1 = 10; -var m1_c1 = (function () { +var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; diff --git a/tests/baselines/reference/project/outSubfolderNoOutdir/node/test.js b/tests/baselines/reference/project/outSubfolderNoOutdir/node/test.js index d93a6707fdfe4..5a71ed22c8cc3 100644 --- a/tests/baselines/reference/project/outSubfolderNoOutdir/node/test.js +++ b/tests/baselines/reference/project/outSubfolderNoOutdir/node/test.js @@ -1,6 +1,6 @@ /// var a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/outSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js b/tests/baselines/reference/project/outSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js index a9ac9819faabc..1b7fc06763718 100644 --- a/tests/baselines/reference/project/outSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js +++ b/tests/baselines/reference/project/outSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js @@ -1,5 +1,5 @@ var m1_a1 = 10; -var m1_c1 = (function () { +var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; diff --git a/tests/baselines/reference/project/outSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js b/tests/baselines/reference/project/outSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js index d93a6707fdfe4..5a71ed22c8cc3 100644 --- a/tests/baselines/reference/project/outSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js +++ b/tests/baselines/reference/project/outSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js @@ -1,6 +1,6 @@ /// var a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/outSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js b/tests/baselines/reference/project/outSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js index a9ac9819faabc..1b7fc06763718 100644 --- a/tests/baselines/reference/project/outSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js +++ b/tests/baselines/reference/project/outSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js @@ -1,5 +1,5 @@ var m1_a1 = 10; -var m1_c1 = (function () { +var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; diff --git a/tests/baselines/reference/project/outSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js b/tests/baselines/reference/project/outSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js index d93a6707fdfe4..5a71ed22c8cc3 100644 --- a/tests/baselines/reference/project/outSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js +++ b/tests/baselines/reference/project/outSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js @@ -1,6 +1,6 @@ /// var a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/outSubfolderSpecifyOutputFile/amd/bin/test.js b/tests/baselines/reference/project/outSubfolderSpecifyOutputFile/amd/bin/test.js index 0e00e79ca1fd9..dec9e93d53e9a 100644 --- a/tests/baselines/reference/project/outSubfolderSpecifyOutputFile/amd/bin/test.js +++ b/tests/baselines/reference/project/outSubfolderSpecifyOutputFile/amd/bin/test.js @@ -1,5 +1,5 @@ var m1_a1 = 10; -var m1_c1 = (function () { +var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; @@ -10,7 +10,7 @@ function m1_f1() { } /// var a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/outSubfolderSpecifyOutputFile/node/bin/test.js b/tests/baselines/reference/project/outSubfolderSpecifyOutputFile/node/bin/test.js index 0e00e79ca1fd9..dec9e93d53e9a 100644 --- a/tests/baselines/reference/project/outSubfolderSpecifyOutputFile/node/bin/test.js +++ b/tests/baselines/reference/project/outSubfolderSpecifyOutputFile/node/bin/test.js @@ -1,5 +1,5 @@ var m1_a1 = 10; -var m1_c1 = (function () { +var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; @@ -10,7 +10,7 @@ function m1_f1() { } /// var a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/privacyCheckOnImportedModuleDeclarationsInsideModule/amd/testGlo.js b/tests/baselines/reference/project/privacyCheckOnImportedModuleDeclarationsInsideModule/amd/testGlo.js index 1c181a2feaefa..640879e57330e 100644 --- a/tests/baselines/reference/project/privacyCheckOnImportedModuleDeclarationsInsideModule/amd/testGlo.js +++ b/tests/baselines/reference/project/privacyCheckOnImportedModuleDeclarationsInsideModule/amd/testGlo.js @@ -16,7 +16,7 @@ var m2; } m2.f1 = f1; m2.x1 = m2.mExported.me.x; - var class1 = (function (_super) { + var class1 = /** @class */ (function (_super) { __extends(class1, _super); function class1() { return _super !== null && _super.apply(this, arguments) || this; @@ -29,7 +29,7 @@ var m2; return new m2.mExported.me.class1(); } var x2 = m2.mExported.me.x; - var class2 = (function (_super) { + var class2 = /** @class */ (function (_super) { __extends(class2, _super); function class2() { return _super !== null && _super.apply(this, arguments) || this; @@ -42,7 +42,7 @@ var m2; } m2.f3 = f3; m2.x3 = mNonExported.mne.x; - var class3 = (function (_super) { + var class3 = /** @class */ (function (_super) { __extends(class3, _super); function class3() { return _super !== null && _super.apply(this, arguments) || this; @@ -55,7 +55,7 @@ var m2; return new mNonExported.mne.class1(); } var x4 = mNonExported.mne.x; - var class4 = (function (_super) { + var class4 = /** @class */ (function (_super) { __extends(class4, _super); function class4() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/project/privacyCheckOnImportedModuleDeclarationsInsideModule/node/testGlo.js b/tests/baselines/reference/project/privacyCheckOnImportedModuleDeclarationsInsideModule/node/testGlo.js index 1c181a2feaefa..640879e57330e 100644 --- a/tests/baselines/reference/project/privacyCheckOnImportedModuleDeclarationsInsideModule/node/testGlo.js +++ b/tests/baselines/reference/project/privacyCheckOnImportedModuleDeclarationsInsideModule/node/testGlo.js @@ -16,7 +16,7 @@ var m2; } m2.f1 = f1; m2.x1 = m2.mExported.me.x; - var class1 = (function (_super) { + var class1 = /** @class */ (function (_super) { __extends(class1, _super); function class1() { return _super !== null && _super.apply(this, arguments) || this; @@ -29,7 +29,7 @@ var m2; return new m2.mExported.me.class1(); } var x2 = m2.mExported.me.x; - var class2 = (function (_super) { + var class2 = /** @class */ (function (_super) { __extends(class2, _super); function class2() { return _super !== null && _super.apply(this, arguments) || this; @@ -42,7 +42,7 @@ var m2; } m2.f3 = f3; m2.x3 = mNonExported.mne.x; - var class3 = (function (_super) { + var class3 = /** @class */ (function (_super) { __extends(class3, _super); function class3() { return _super !== null && _super.apply(this, arguments) || this; @@ -55,7 +55,7 @@ var m2; return new mNonExported.mne.class1(); } var x4 = mNonExported.mne.x; - var class4 = (function (_super) { + var class4 = /** @class */ (function (_super) { __extends(class4, _super); function class4() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/project/prologueEmit/amd/out.js b/tests/baselines/reference/project/prologueEmit/amd/out.js index 45dfb93c45830..84df2f751400d 100644 --- a/tests/baselines/reference/project/prologueEmit/amd/out.js +++ b/tests/baselines/reference/project/prologueEmit/amd/out.js @@ -14,13 +14,13 @@ var _this = this; // class inheritance to ensure __extends is emitted var m; (function (m) { - var base = (function () { + var base = /** @class */ (function () { function base() { } return base; }()); m.base = base; - var child = (function (_super) { + var child = /** @class */ (function (_super) { __extends(child, _super); function child() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/project/prologueEmit/node/out.js b/tests/baselines/reference/project/prologueEmit/node/out.js index 45dfb93c45830..84df2f751400d 100644 --- a/tests/baselines/reference/project/prologueEmit/node/out.js +++ b/tests/baselines/reference/project/prologueEmit/node/out.js @@ -14,13 +14,13 @@ var _this = this; // class inheritance to ensure __extends is emitted var m; (function (m) { - var base = (function () { + var base = /** @class */ (function () { function base() { } return base; }()); m.base = base; - var child = (function (_super) { + var child = /** @class */ (function (_super) { __extends(child, _super); function child() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/project/quotesInFileAndDirectoryNames/amd/li'b/class'A.js b/tests/baselines/reference/project/quotesInFileAndDirectoryNames/amd/li'b/class'A.js index 5b3941738db13..ed444649d06ca 100644 --- a/tests/baselines/reference/project/quotesInFileAndDirectoryNames/amd/li'b/class'A.js +++ b/tests/baselines/reference/project/quotesInFileAndDirectoryNames/amd/li'b/class'A.js @@ -1,6 +1,6 @@ var test; (function (test) { - var ClassA = (function () { + var ClassA = /** @class */ (function () { function ClassA() { } ClassA.prototype.method = function () { }; diff --git a/tests/baselines/reference/project/quotesInFileAndDirectoryNames/amd/m'ain.js b/tests/baselines/reference/project/quotesInFileAndDirectoryNames/amd/m'ain.js index ce5681ae1c9f3..ad86344f5b060 100644 --- a/tests/baselines/reference/project/quotesInFileAndDirectoryNames/amd/m'ain.js +++ b/tests/baselines/reference/project/quotesInFileAndDirectoryNames/amd/m'ain.js @@ -9,7 +9,7 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var ClassC = (function (_super) { +var ClassC = /** @class */ (function (_super) { __extends(ClassC, _super); function ClassC() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/project/quotesInFileAndDirectoryNames/node/li'b/class'A.js b/tests/baselines/reference/project/quotesInFileAndDirectoryNames/node/li'b/class'A.js index 5b3941738db13..ed444649d06ca 100644 --- a/tests/baselines/reference/project/quotesInFileAndDirectoryNames/node/li'b/class'A.js +++ b/tests/baselines/reference/project/quotesInFileAndDirectoryNames/node/li'b/class'A.js @@ -1,6 +1,6 @@ var test; (function (test) { - var ClassA = (function () { + var ClassA = /** @class */ (function () { function ClassA() { } ClassA.prototype.method = function () { }; diff --git a/tests/baselines/reference/project/quotesInFileAndDirectoryNames/node/m'ain.js b/tests/baselines/reference/project/quotesInFileAndDirectoryNames/node/m'ain.js index ce5681ae1c9f3..ad86344f5b060 100644 --- a/tests/baselines/reference/project/quotesInFileAndDirectoryNames/node/m'ain.js +++ b/tests/baselines/reference/project/quotesInFileAndDirectoryNames/node/m'ain.js @@ -9,7 +9,7 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var ClassC = (function (_super) { +var ClassC = /** @class */ (function (_super) { __extends(ClassC, _super); function ClassC() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/project/referenceResolutionRelativePaths/amd/diskFile0.js b/tests/baselines/reference/project/referenceResolutionRelativePaths/amd/diskFile0.js index 080f95401b3e6..4c8204804afd1 100644 --- a/tests/baselines/reference/project/referenceResolutionRelativePaths/amd/diskFile0.js +++ b/tests/baselines/reference/project/referenceResolutionRelativePaths/amd/diskFile0.js @@ -1,6 +1,6 @@ /// // This is bar.ts -var bar = (function () { +var bar = /** @class */ (function () { function bar() { } return bar; diff --git a/tests/baselines/reference/project/referenceResolutionRelativePaths/amd/foo.js b/tests/baselines/reference/project/referenceResolutionRelativePaths/amd/foo.js index 4a01207bfce77..e8bb44a089b6d 100644 --- a/tests/baselines/reference/project/referenceResolutionRelativePaths/amd/foo.js +++ b/tests/baselines/reference/project/referenceResolutionRelativePaths/amd/foo.js @@ -1,5 +1,5 @@ /// -var foo = (function () { +var foo = /** @class */ (function () { function foo() { } return foo; diff --git a/tests/baselines/reference/project/referenceResolutionRelativePaths/node/diskFile0.js b/tests/baselines/reference/project/referenceResolutionRelativePaths/node/diskFile0.js index 080f95401b3e6..4c8204804afd1 100644 --- a/tests/baselines/reference/project/referenceResolutionRelativePaths/node/diskFile0.js +++ b/tests/baselines/reference/project/referenceResolutionRelativePaths/node/diskFile0.js @@ -1,6 +1,6 @@ /// // This is bar.ts -var bar = (function () { +var bar = /** @class */ (function () { function bar() { } return bar; diff --git a/tests/baselines/reference/project/referenceResolutionRelativePaths/node/foo.js b/tests/baselines/reference/project/referenceResolutionRelativePaths/node/foo.js index 4a01207bfce77..e8bb44a089b6d 100644 --- a/tests/baselines/reference/project/referenceResolutionRelativePaths/node/foo.js +++ b/tests/baselines/reference/project/referenceResolutionRelativePaths/node/foo.js @@ -1,5 +1,5 @@ /// -var foo = (function () { +var foo = /** @class */ (function () { function foo() { } return foo; diff --git a/tests/baselines/reference/project/referenceResolutionRelativePathsFromRootDirectory/amd/bar/bar.js b/tests/baselines/reference/project/referenceResolutionRelativePathsFromRootDirectory/amd/bar/bar.js index 080f95401b3e6..4c8204804afd1 100644 --- a/tests/baselines/reference/project/referenceResolutionRelativePathsFromRootDirectory/amd/bar/bar.js +++ b/tests/baselines/reference/project/referenceResolutionRelativePathsFromRootDirectory/amd/bar/bar.js @@ -1,6 +1,6 @@ /// // This is bar.ts -var bar = (function () { +var bar = /** @class */ (function () { function bar() { } return bar; diff --git a/tests/baselines/reference/project/referenceResolutionRelativePathsFromRootDirectory/amd/src/ts/foo/foo.js b/tests/baselines/reference/project/referenceResolutionRelativePathsFromRootDirectory/amd/src/ts/foo/foo.js index 4a01207bfce77..e8bb44a089b6d 100644 --- a/tests/baselines/reference/project/referenceResolutionRelativePathsFromRootDirectory/amd/src/ts/foo/foo.js +++ b/tests/baselines/reference/project/referenceResolutionRelativePathsFromRootDirectory/amd/src/ts/foo/foo.js @@ -1,5 +1,5 @@ /// -var foo = (function () { +var foo = /** @class */ (function () { function foo() { } return foo; diff --git a/tests/baselines/reference/project/referenceResolutionRelativePathsFromRootDirectory/node/bar/bar.js b/tests/baselines/reference/project/referenceResolutionRelativePathsFromRootDirectory/node/bar/bar.js index 080f95401b3e6..4c8204804afd1 100644 --- a/tests/baselines/reference/project/referenceResolutionRelativePathsFromRootDirectory/node/bar/bar.js +++ b/tests/baselines/reference/project/referenceResolutionRelativePathsFromRootDirectory/node/bar/bar.js @@ -1,6 +1,6 @@ /// // This is bar.ts -var bar = (function () { +var bar = /** @class */ (function () { function bar() { } return bar; diff --git a/tests/baselines/reference/project/referenceResolutionRelativePathsFromRootDirectory/node/src/ts/foo/foo.js b/tests/baselines/reference/project/referenceResolutionRelativePathsFromRootDirectory/node/src/ts/foo/foo.js index 4a01207bfce77..e8bb44a089b6d 100644 --- a/tests/baselines/reference/project/referenceResolutionRelativePathsFromRootDirectory/node/src/ts/foo/foo.js +++ b/tests/baselines/reference/project/referenceResolutionRelativePathsFromRootDirectory/node/src/ts/foo/foo.js @@ -1,5 +1,5 @@ /// -var foo = (function () { +var foo = /** @class */ (function () { function foo() { } return foo; diff --git a/tests/baselines/reference/project/referenceResolutionRelativePathsNoResolve/amd/diskFile0.js b/tests/baselines/reference/project/referenceResolutionRelativePathsNoResolve/amd/diskFile0.js index 080f95401b3e6..4c8204804afd1 100644 --- a/tests/baselines/reference/project/referenceResolutionRelativePathsNoResolve/amd/diskFile0.js +++ b/tests/baselines/reference/project/referenceResolutionRelativePathsNoResolve/amd/diskFile0.js @@ -1,6 +1,6 @@ /// // This is bar.ts -var bar = (function () { +var bar = /** @class */ (function () { function bar() { } return bar; diff --git a/tests/baselines/reference/project/referenceResolutionRelativePathsNoResolve/amd/foo.js b/tests/baselines/reference/project/referenceResolutionRelativePathsNoResolve/amd/foo.js index 4a01207bfce77..e8bb44a089b6d 100644 --- a/tests/baselines/reference/project/referenceResolutionRelativePathsNoResolve/amd/foo.js +++ b/tests/baselines/reference/project/referenceResolutionRelativePathsNoResolve/amd/foo.js @@ -1,5 +1,5 @@ /// -var foo = (function () { +var foo = /** @class */ (function () { function foo() { } return foo; diff --git a/tests/baselines/reference/project/referenceResolutionRelativePathsNoResolve/node/diskFile0.js b/tests/baselines/reference/project/referenceResolutionRelativePathsNoResolve/node/diskFile0.js index 080f95401b3e6..4c8204804afd1 100644 --- a/tests/baselines/reference/project/referenceResolutionRelativePathsNoResolve/node/diskFile0.js +++ b/tests/baselines/reference/project/referenceResolutionRelativePathsNoResolve/node/diskFile0.js @@ -1,6 +1,6 @@ /// // This is bar.ts -var bar = (function () { +var bar = /** @class */ (function () { function bar() { } return bar; diff --git a/tests/baselines/reference/project/referenceResolutionRelativePathsNoResolve/node/foo.js b/tests/baselines/reference/project/referenceResolutionRelativePathsNoResolve/node/foo.js index 4a01207bfce77..e8bb44a089b6d 100644 --- a/tests/baselines/reference/project/referenceResolutionRelativePathsNoResolve/node/foo.js +++ b/tests/baselines/reference/project/referenceResolutionRelativePathsNoResolve/node/foo.js @@ -1,5 +1,5 @@ /// -var foo = (function () { +var foo = /** @class */ (function () { function foo() { } return foo; diff --git a/tests/baselines/reference/project/referenceResolutionRelativePathsRelativeToRootDirectory/amd/diskFile0.js b/tests/baselines/reference/project/referenceResolutionRelativePathsRelativeToRootDirectory/amd/diskFile0.js index 080f95401b3e6..4c8204804afd1 100644 --- a/tests/baselines/reference/project/referenceResolutionRelativePathsRelativeToRootDirectory/amd/diskFile0.js +++ b/tests/baselines/reference/project/referenceResolutionRelativePathsRelativeToRootDirectory/amd/diskFile0.js @@ -1,6 +1,6 @@ /// // This is bar.ts -var bar = (function () { +var bar = /** @class */ (function () { function bar() { } return bar; diff --git a/tests/baselines/reference/project/referenceResolutionRelativePathsRelativeToRootDirectory/amd/foo.js b/tests/baselines/reference/project/referenceResolutionRelativePathsRelativeToRootDirectory/amd/foo.js index 4a01207bfce77..e8bb44a089b6d 100644 --- a/tests/baselines/reference/project/referenceResolutionRelativePathsRelativeToRootDirectory/amd/foo.js +++ b/tests/baselines/reference/project/referenceResolutionRelativePathsRelativeToRootDirectory/amd/foo.js @@ -1,5 +1,5 @@ /// -var foo = (function () { +var foo = /** @class */ (function () { function foo() { } return foo; diff --git a/tests/baselines/reference/project/referenceResolutionRelativePathsRelativeToRootDirectory/node/diskFile0.js b/tests/baselines/reference/project/referenceResolutionRelativePathsRelativeToRootDirectory/node/diskFile0.js index 080f95401b3e6..4c8204804afd1 100644 --- a/tests/baselines/reference/project/referenceResolutionRelativePathsRelativeToRootDirectory/node/diskFile0.js +++ b/tests/baselines/reference/project/referenceResolutionRelativePathsRelativeToRootDirectory/node/diskFile0.js @@ -1,6 +1,6 @@ /// // This is bar.ts -var bar = (function () { +var bar = /** @class */ (function () { function bar() { } return bar; diff --git a/tests/baselines/reference/project/referenceResolutionRelativePathsRelativeToRootDirectory/node/foo.js b/tests/baselines/reference/project/referenceResolutionRelativePathsRelativeToRootDirectory/node/foo.js index 4a01207bfce77..e8bb44a089b6d 100644 --- a/tests/baselines/reference/project/referenceResolutionRelativePathsRelativeToRootDirectory/node/foo.js +++ b/tests/baselines/reference/project/referenceResolutionRelativePathsRelativeToRootDirectory/node/foo.js @@ -1,5 +1,5 @@ /// -var foo = (function () { +var foo = /** @class */ (function () { function foo() { } return foo; diff --git a/tests/baselines/reference/project/referenceResolutionSameFileTwice/amd/test.js b/tests/baselines/reference/project/referenceResolutionSameFileTwice/amd/test.js index 1d436a9e57bcb..1662f0dfb881d 100644 --- a/tests/baselines/reference/project/referenceResolutionSameFileTwice/amd/test.js +++ b/tests/baselines/reference/project/referenceResolutionSameFileTwice/amd/test.js @@ -1,4 +1,4 @@ -var test = (function () { +var test = /** @class */ (function () { function test() { } return test; diff --git a/tests/baselines/reference/project/referenceResolutionSameFileTwice/node/test.js b/tests/baselines/reference/project/referenceResolutionSameFileTwice/node/test.js index 1d436a9e57bcb..1662f0dfb881d 100644 --- a/tests/baselines/reference/project/referenceResolutionSameFileTwice/node/test.js +++ b/tests/baselines/reference/project/referenceResolutionSameFileTwice/node/test.js @@ -1,4 +1,4 @@ -var test = (function () { +var test = /** @class */ (function () { function test() { } return test; diff --git a/tests/baselines/reference/project/referenceResolutionSameFileTwiceNoResolve/amd/test.js b/tests/baselines/reference/project/referenceResolutionSameFileTwiceNoResolve/amd/test.js index 1d436a9e57bcb..1662f0dfb881d 100644 --- a/tests/baselines/reference/project/referenceResolutionSameFileTwiceNoResolve/amd/test.js +++ b/tests/baselines/reference/project/referenceResolutionSameFileTwiceNoResolve/amd/test.js @@ -1,4 +1,4 @@ -var test = (function () { +var test = /** @class */ (function () { function test() { } return test; diff --git a/tests/baselines/reference/project/referenceResolutionSameFileTwiceNoResolve/node/test.js b/tests/baselines/reference/project/referenceResolutionSameFileTwiceNoResolve/node/test.js index 1d436a9e57bcb..1662f0dfb881d 100644 --- a/tests/baselines/reference/project/referenceResolutionSameFileTwiceNoResolve/node/test.js +++ b/tests/baselines/reference/project/referenceResolutionSameFileTwiceNoResolve/node/test.js @@ -1,4 +1,4 @@ -var test = (function () { +var test = /** @class */ (function () { function test() { } return test; diff --git a/tests/baselines/reference/project/rootDirectory/amd/outdir/simple/FolderB/FolderC/fileC.js b/tests/baselines/reference/project/rootDirectory/amd/outdir/simple/FolderB/FolderC/fileC.js index f5e6c21e37c95..ebeb32c5de654 100644 --- a/tests/baselines/reference/project/rootDirectory/amd/outdir/simple/FolderB/FolderC/fileC.js +++ b/tests/baselines/reference/project/rootDirectory/amd/outdir/simple/FolderB/FolderC/fileC.js @@ -1,4 +1,4 @@ -var C = (function () { +var C = /** @class */ (function () { function C() { } return C; diff --git a/tests/baselines/reference/project/rootDirectory/amd/outdir/simple/FolderB/fileB.js b/tests/baselines/reference/project/rootDirectory/amd/outdir/simple/FolderB/fileB.js index aff1446877c83..de69db3ded8eb 100644 --- a/tests/baselines/reference/project/rootDirectory/amd/outdir/simple/FolderB/fileB.js +++ b/tests/baselines/reference/project/rootDirectory/amd/outdir/simple/FolderB/fileB.js @@ -1,5 +1,5 @@ /// -var B = (function () { +var B = /** @class */ (function () { function B() { } return B; diff --git a/tests/baselines/reference/project/rootDirectory/node/outdir/simple/FolderB/FolderC/fileC.js b/tests/baselines/reference/project/rootDirectory/node/outdir/simple/FolderB/FolderC/fileC.js index f5e6c21e37c95..ebeb32c5de654 100644 --- a/tests/baselines/reference/project/rootDirectory/node/outdir/simple/FolderB/FolderC/fileC.js +++ b/tests/baselines/reference/project/rootDirectory/node/outdir/simple/FolderB/FolderC/fileC.js @@ -1,4 +1,4 @@ -var C = (function () { +var C = /** @class */ (function () { function C() { } return C; diff --git a/tests/baselines/reference/project/rootDirectory/node/outdir/simple/FolderB/fileB.js b/tests/baselines/reference/project/rootDirectory/node/outdir/simple/FolderB/fileB.js index aff1446877c83..de69db3ded8eb 100644 --- a/tests/baselines/reference/project/rootDirectory/node/outdir/simple/FolderB/fileB.js +++ b/tests/baselines/reference/project/rootDirectory/node/outdir/simple/FolderB/fileB.js @@ -1,5 +1,5 @@ /// -var B = (function () { +var B = /** @class */ (function () { function B() { } return B; diff --git a/tests/baselines/reference/project/rootDirectoryErrors/amd/outdir/simple/FolderC/fileC.js b/tests/baselines/reference/project/rootDirectoryErrors/amd/outdir/simple/FolderC/fileC.js index 87b76821b97ab..35b4a697f307e 100644 --- a/tests/baselines/reference/project/rootDirectoryErrors/amd/outdir/simple/FolderC/fileC.js +++ b/tests/baselines/reference/project/rootDirectoryErrors/amd/outdir/simple/FolderC/fileC.js @@ -1,4 +1,4 @@ -var C = (function () { +var C = /** @class */ (function () { function C() { } return C; diff --git a/tests/baselines/reference/project/rootDirectoryErrors/amd/outdir/simple/fileB.js b/tests/baselines/reference/project/rootDirectoryErrors/amd/outdir/simple/fileB.js index 486a6bb87a5a2..e3580f23910ef 100644 --- a/tests/baselines/reference/project/rootDirectoryErrors/amd/outdir/simple/fileB.js +++ b/tests/baselines/reference/project/rootDirectoryErrors/amd/outdir/simple/fileB.js @@ -1,5 +1,5 @@ /// -var B = (function () { +var B = /** @class */ (function () { function B() { } return B; diff --git a/tests/baselines/reference/project/rootDirectoryErrors/node/outdir/simple/FolderC/fileC.js b/tests/baselines/reference/project/rootDirectoryErrors/node/outdir/simple/FolderC/fileC.js index 87b76821b97ab..35b4a697f307e 100644 --- a/tests/baselines/reference/project/rootDirectoryErrors/node/outdir/simple/FolderC/fileC.js +++ b/tests/baselines/reference/project/rootDirectoryErrors/node/outdir/simple/FolderC/fileC.js @@ -1,4 +1,4 @@ -var C = (function () { +var C = /** @class */ (function () { function C() { } return C; diff --git a/tests/baselines/reference/project/rootDirectoryErrors/node/outdir/simple/fileB.js b/tests/baselines/reference/project/rootDirectoryErrors/node/outdir/simple/fileB.js index 486a6bb87a5a2..e3580f23910ef 100644 --- a/tests/baselines/reference/project/rootDirectoryErrors/node/outdir/simple/fileB.js +++ b/tests/baselines/reference/project/rootDirectoryErrors/node/outdir/simple/fileB.js @@ -1,5 +1,5 @@ /// -var B = (function () { +var B = /** @class */ (function () { function B() { } return B; diff --git a/tests/baselines/reference/project/rootDirectoryWithSourceRoot/amd/outdir/simple/FolderB/FolderC/fileC.js b/tests/baselines/reference/project/rootDirectoryWithSourceRoot/amd/outdir/simple/FolderB/FolderC/fileC.js index f5e6c21e37c95..ebeb32c5de654 100644 --- a/tests/baselines/reference/project/rootDirectoryWithSourceRoot/amd/outdir/simple/FolderB/FolderC/fileC.js +++ b/tests/baselines/reference/project/rootDirectoryWithSourceRoot/amd/outdir/simple/FolderB/FolderC/fileC.js @@ -1,4 +1,4 @@ -var C = (function () { +var C = /** @class */ (function () { function C() { } return C; diff --git a/tests/baselines/reference/project/rootDirectoryWithSourceRoot/amd/outdir/simple/FolderB/fileB.js b/tests/baselines/reference/project/rootDirectoryWithSourceRoot/amd/outdir/simple/FolderB/fileB.js index aff1446877c83..de69db3ded8eb 100644 --- a/tests/baselines/reference/project/rootDirectoryWithSourceRoot/amd/outdir/simple/FolderB/fileB.js +++ b/tests/baselines/reference/project/rootDirectoryWithSourceRoot/amd/outdir/simple/FolderB/fileB.js @@ -1,5 +1,5 @@ /// -var B = (function () { +var B = /** @class */ (function () { function B() { } return B; diff --git a/tests/baselines/reference/project/rootDirectoryWithSourceRoot/node/outdir/simple/FolderB/FolderC/fileC.js b/tests/baselines/reference/project/rootDirectoryWithSourceRoot/node/outdir/simple/FolderB/FolderC/fileC.js index f5e6c21e37c95..ebeb32c5de654 100644 --- a/tests/baselines/reference/project/rootDirectoryWithSourceRoot/node/outdir/simple/FolderB/FolderC/fileC.js +++ b/tests/baselines/reference/project/rootDirectoryWithSourceRoot/node/outdir/simple/FolderB/FolderC/fileC.js @@ -1,4 +1,4 @@ -var C = (function () { +var C = /** @class */ (function () { function C() { } return C; diff --git a/tests/baselines/reference/project/rootDirectoryWithSourceRoot/node/outdir/simple/FolderB/fileB.js b/tests/baselines/reference/project/rootDirectoryWithSourceRoot/node/outdir/simple/FolderB/fileB.js index aff1446877c83..de69db3ded8eb 100644 --- a/tests/baselines/reference/project/rootDirectoryWithSourceRoot/node/outdir/simple/FolderB/fileB.js +++ b/tests/baselines/reference/project/rootDirectoryWithSourceRoot/node/outdir/simple/FolderB/fileB.js @@ -1,5 +1,5 @@ /// -var B = (function () { +var B = /** @class */ (function () { function B() { } return B; diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderNoOutdir/amd/ref/m1.js b/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderNoOutdir/amd/ref/m1.js index b7283f7fd8830..4293cda52dba5 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderNoOutdir/amd/ref/m1.js +++ b/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderNoOutdir/amd/ref/m1.js @@ -1,5 +1,5 @@ var m1_a1 = 10; -var m1_c1 = (function () { +var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderNoOutdir/amd/ref/m2.js b/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderNoOutdir/amd/ref/m2.js index 08855ec797b4d..20d4b93990f3f 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderNoOutdir/amd/ref/m2.js +++ b/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderNoOutdir/amd/ref/m2.js @@ -2,7 +2,7 @@ define(["require", "exports"], function (require, exports) { "use strict"; exports.__esModule = true; exports.m2_a1 = 10; - var m2_c1 = (function () { + var m2_c1 = /** @class */ (function () { function m2_c1() { } return m2_c1; diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderNoOutdir/amd/test.js b/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderNoOutdir/amd/test.js index 78426750a82a2..020207321b363 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderNoOutdir/amd/test.js +++ b/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderNoOutdir/amd/test.js @@ -1,7 +1,7 @@ /// /// var a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderNoOutdir/node/ref/m1.js b/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderNoOutdir/node/ref/m1.js index b7283f7fd8830..4293cda52dba5 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderNoOutdir/node/ref/m1.js +++ b/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderNoOutdir/node/ref/m1.js @@ -1,5 +1,5 @@ var m1_a1 = 10; -var m1_c1 = (function () { +var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderNoOutdir/node/ref/m2.js b/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderNoOutdir/node/ref/m2.js index 8ad833cd4eba9..fca535956778f 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderNoOutdir/node/ref/m2.js +++ b/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderNoOutdir/node/ref/m2.js @@ -1,7 +1,7 @@ "use strict"; exports.__esModule = true; exports.m2_a1 = 10; -var m2_c1 = (function () { +var m2_c1 = /** @class */ (function () { function m2_c1() { } return m2_c1; diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderNoOutdir/node/test.js b/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderNoOutdir/node/test.js index 78426750a82a2..020207321b363 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderNoOutdir/node/test.js +++ b/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderNoOutdir/node/test.js @@ -1,7 +1,7 @@ /// /// var a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js b/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js index b7283f7fd8830..4293cda52dba5 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js +++ b/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js @@ -1,5 +1,5 @@ var m1_a1 = 10; -var m1_c1 = (function () { +var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m2.js b/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m2.js index 08855ec797b4d..20d4b93990f3f 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m2.js +++ b/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m2.js @@ -2,7 +2,7 @@ define(["require", "exports"], function (require, exports) { "use strict"; exports.__esModule = true; exports.m2_a1 = 10; - var m2_c1 = (function () { + var m2_c1 = /** @class */ (function () { function m2_c1() { } return m2_c1; diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js b/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js index 78426750a82a2..020207321b363 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js +++ b/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js @@ -1,7 +1,7 @@ /// /// var a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js b/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js index b7283f7fd8830..4293cda52dba5 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js +++ b/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js @@ -1,5 +1,5 @@ var m1_a1 = 10; -var m1_c1 = (function () { +var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m2.js b/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m2.js index 8ad833cd4eba9..fca535956778f 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m2.js +++ b/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m2.js @@ -1,7 +1,7 @@ "use strict"; exports.__esModule = true; exports.m2_a1 = 10; -var m2_c1 = (function () { +var m2_c1 = /** @class */ (function () { function m2_c1() { } return m2_c1; diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js b/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js index 78426750a82a2..020207321b363 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js +++ b/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js @@ -1,7 +1,7 @@ /// /// var a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFile/amd/bin/test.js b/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFile/amd/bin/test.js index f070fff6f1cb8..6c4233ece096d 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFile/amd/bin/test.js +++ b/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFile/amd/bin/test.js @@ -1,5 +1,5 @@ var m1_a1 = 10; -var m1_c1 = (function () { +var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; @@ -12,7 +12,7 @@ define("ref/m2", ["require", "exports"], function (require, exports) { "use strict"; exports.__esModule = true; exports.m2_a1 = 10; - var m2_c1 = (function () { + var m2_c1 = /** @class */ (function () { function m2_c1() { } return m2_c1; @@ -27,7 +27,7 @@ define("ref/m2", ["require", "exports"], function (require, exports) { /// /// var a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFile/node/bin/test.js b/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFile/node/bin/test.js index 5d63d624329e6..4aa1cc0efbdbb 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFile/node/bin/test.js +++ b/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFile/node/bin/test.js @@ -1,5 +1,5 @@ var m1_a1 = 10; -var m1_c1 = (function () { +var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; @@ -11,7 +11,7 @@ function m1_f1() { /// /// var a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/bin/outAndOutDirFile.js b/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/bin/outAndOutDirFile.js index 3e02cc09fcb7a..7b02d52b57d72 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/bin/outAndOutDirFile.js +++ b/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/bin/outAndOutDirFile.js @@ -1,5 +1,5 @@ var m1_a1 = 10; -var m1_c1 = (function () { +var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; @@ -12,7 +12,7 @@ define("ref/m2", ["require", "exports"], function (require, exports) { "use strict"; exports.__esModule = true; exports.m2_a1 = 10; - var m2_c1 = (function () { + var m2_c1 = /** @class */ (function () { function m2_c1() { } return m2_c1; @@ -27,7 +27,7 @@ define("ref/m2", ["require", "exports"], function (require, exports) { /// /// var a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/bin/outAndOutDirFile.js b/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/bin/outAndOutDirFile.js index da6a20151434f..86b6ba19ae52a 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/bin/outAndOutDirFile.js +++ b/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/bin/outAndOutDirFile.js @@ -1,5 +1,5 @@ var m1_a1 = 10; -var m1_c1 = (function () { +var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; @@ -11,7 +11,7 @@ function m1_f1() { /// /// var a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderNoOutdir/amd/diskFile1.js b/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderNoOutdir/amd/diskFile1.js index 08855ec797b4d..20d4b93990f3f 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderNoOutdir/amd/diskFile1.js +++ b/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderNoOutdir/amd/diskFile1.js @@ -2,7 +2,7 @@ define(["require", "exports"], function (require, exports) { "use strict"; exports.__esModule = true; exports.m2_a1 = 10; - var m2_c1 = (function () { + var m2_c1 = /** @class */ (function () { function m2_c1() { } return m2_c1; diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderNoOutdir/amd/ref/m1.js b/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderNoOutdir/amd/ref/m1.js index 391c6ef6630d8..3eb8a0f5dea2e 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderNoOutdir/amd/ref/m1.js +++ b/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderNoOutdir/amd/ref/m1.js @@ -2,7 +2,7 @@ define(["require", "exports"], function (require, exports) { "use strict"; exports.__esModule = true; exports.m1_a1 = 10; - var m1_c1 = (function () { + var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderNoOutdir/amd/test.js b/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderNoOutdir/amd/test.js index 90f7f12fcb186..2d7e905faa44d 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderNoOutdir/amd/test.js +++ b/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderNoOutdir/amd/test.js @@ -2,7 +2,7 @@ define(["require", "exports", "ref/m1", "../outputdir_module_multifolder_ref/m2" "use strict"; exports.__esModule = true; exports.a1 = 10; - var c1 = (function () { + var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderNoOutdir/node/diskFile1.js b/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderNoOutdir/node/diskFile1.js index 8ad833cd4eba9..fca535956778f 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderNoOutdir/node/diskFile1.js +++ b/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderNoOutdir/node/diskFile1.js @@ -1,7 +1,7 @@ "use strict"; exports.__esModule = true; exports.m2_a1 = 10; -var m2_c1 = (function () { +var m2_c1 = /** @class */ (function () { function m2_c1() { } return m2_c1; diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderNoOutdir/node/ref/m1.js b/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderNoOutdir/node/ref/m1.js index 02586d67fcc6d..2db985c931fd6 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderNoOutdir/node/ref/m1.js +++ b/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderNoOutdir/node/ref/m1.js @@ -1,7 +1,7 @@ "use strict"; exports.__esModule = true; exports.m1_a1 = 10; -var m1_c1 = (function () { +var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderNoOutdir/node/test.js b/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderNoOutdir/node/test.js index 43d151f3fd963..2fbb4d7fc1ca4 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderNoOutdir/node/test.js +++ b/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderNoOutdir/node/test.js @@ -3,7 +3,7 @@ exports.__esModule = true; var m1 = require("ref/m1"); var m2 = require("../outputdir_module_multifolder_ref/m2"); exports.a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder/ref/m1.js b/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder/ref/m1.js index 391c6ef6630d8..3eb8a0f5dea2e 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder/ref/m1.js +++ b/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder/ref/m1.js @@ -2,7 +2,7 @@ define(["require", "exports"], function (require, exports) { "use strict"; exports.__esModule = true; exports.m1_a1 = 10; - var m1_c1 = (function () { + var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder/test.js b/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder/test.js index 90f7f12fcb186..2d7e905faa44d 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder/test.js +++ b/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder/test.js @@ -2,7 +2,7 @@ define(["require", "exports", "ref/m1", "../outputdir_module_multifolder_ref/m2" "use strict"; exports.__esModule = true; exports.a1 = 10; - var c1 = (function () { + var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder_ref/m2.js b/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder_ref/m2.js index 08855ec797b4d..20d4b93990f3f 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder_ref/m2.js +++ b/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder_ref/m2.js @@ -2,7 +2,7 @@ define(["require", "exports"], function (require, exports) { "use strict"; exports.__esModule = true; exports.m2_a1 = 10; - var m2_c1 = (function () { + var m2_c1 = /** @class */ (function () { function m2_c1() { } return m2_c1; diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder/ref/m1.js b/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder/ref/m1.js index 02586d67fcc6d..2db985c931fd6 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder/ref/m1.js +++ b/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder/ref/m1.js @@ -1,7 +1,7 @@ "use strict"; exports.__esModule = true; exports.m1_a1 = 10; -var m1_c1 = (function () { +var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder/test.js b/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder/test.js index 43d151f3fd963..2fbb4d7fc1ca4 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder/test.js +++ b/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder/test.js @@ -3,7 +3,7 @@ exports.__esModule = true; var m1 = require("ref/m1"); var m2 = require("../outputdir_module_multifolder_ref/m2"); exports.a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder_ref/m2.js b/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder_ref/m2.js index 8ad833cd4eba9..fca535956778f 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder_ref/m2.js +++ b/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder_ref/m2.js @@ -1,7 +1,7 @@ "use strict"; exports.__esModule = true; exports.m2_a1 = 10; -var m2_c1 = (function () { +var m2_c1 = /** @class */ (function () { function m2_c1() { } return m2_c1; diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderSpecifyOutputFile/amd/bin/test.js b/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderSpecifyOutputFile/amd/bin/test.js index b77e0a462a773..6a566140109d1 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderSpecifyOutputFile/amd/bin/test.js +++ b/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderSpecifyOutputFile/amd/bin/test.js @@ -2,7 +2,7 @@ define("outputdir_module_multifolder/ref/m1", ["require", "exports"], function ( "use strict"; exports.__esModule = true; exports.m1_a1 = 10; - var m1_c1 = (function () { + var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; @@ -18,7 +18,7 @@ define("outputdir_module_multifolder_ref/m2", ["require", "exports"], function ( "use strict"; exports.__esModule = true; exports.m2_a1 = 10; - var m2_c1 = (function () { + var m2_c1 = /** @class */ (function () { function m2_c1() { } return m2_c1; @@ -34,7 +34,7 @@ define("outputdir_module_multifolder/test", ["require", "exports", "outputdir_mo "use strict"; exports.__esModule = true; exports.a1 = 10; - var c1 = (function () { + var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleNoOutdir/amd/m1.js b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleNoOutdir/amd/m1.js index 391c6ef6630d8..3eb8a0f5dea2e 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleNoOutdir/amd/m1.js +++ b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleNoOutdir/amd/m1.js @@ -2,7 +2,7 @@ define(["require", "exports"], function (require, exports) { "use strict"; exports.__esModule = true; exports.m1_a1 = 10; - var m1_c1 = (function () { + var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleNoOutdir/amd/test.js b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleNoOutdir/amd/test.js index e5ed53fd0e1a2..d85c5bfa685a7 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleNoOutdir/amd/test.js +++ b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleNoOutdir/amd/test.js @@ -2,7 +2,7 @@ define(["require", "exports", "m1"], function (require, exports, m1) { "use strict"; exports.__esModule = true; exports.a1 = 10; - var c1 = (function () { + var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleNoOutdir/node/m1.js b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleNoOutdir/node/m1.js index 02586d67fcc6d..2db985c931fd6 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleNoOutdir/node/m1.js +++ b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleNoOutdir/node/m1.js @@ -1,7 +1,7 @@ "use strict"; exports.__esModule = true; exports.m1_a1 = 10; -var m1_c1 = (function () { +var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleNoOutdir/node/test.js b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleNoOutdir/node/test.js index 56c8debf9b699..ca22756bd6ee2 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleNoOutdir/node/test.js +++ b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleNoOutdir/node/test.js @@ -2,7 +2,7 @@ exports.__esModule = true; var m1 = require("m1"); exports.a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleSpecifyOutputDirectory/amd/outdir/simple/m1.js b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleSpecifyOutputDirectory/amd/outdir/simple/m1.js index 391c6ef6630d8..3eb8a0f5dea2e 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleSpecifyOutputDirectory/amd/outdir/simple/m1.js +++ b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleSpecifyOutputDirectory/amd/outdir/simple/m1.js @@ -2,7 +2,7 @@ define(["require", "exports"], function (require, exports) { "use strict"; exports.__esModule = true; exports.m1_a1 = 10; - var m1_c1 = (function () { + var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleSpecifyOutputDirectory/amd/outdir/simple/test.js b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleSpecifyOutputDirectory/amd/outdir/simple/test.js index e5ed53fd0e1a2..d85c5bfa685a7 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleSpecifyOutputDirectory/amd/outdir/simple/test.js +++ b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleSpecifyOutputDirectory/amd/outdir/simple/test.js @@ -2,7 +2,7 @@ define(["require", "exports", "m1"], function (require, exports, m1) { "use strict"; exports.__esModule = true; exports.a1 = 10; - var c1 = (function () { + var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleSpecifyOutputDirectory/node/outdir/simple/m1.js b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleSpecifyOutputDirectory/node/outdir/simple/m1.js index 02586d67fcc6d..2db985c931fd6 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleSpecifyOutputDirectory/node/outdir/simple/m1.js +++ b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleSpecifyOutputDirectory/node/outdir/simple/m1.js @@ -1,7 +1,7 @@ "use strict"; exports.__esModule = true; exports.m1_a1 = 10; -var m1_c1 = (function () { +var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleSpecifyOutputDirectory/node/outdir/simple/test.js b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleSpecifyOutputDirectory/node/outdir/simple/test.js index 56c8debf9b699..ca22756bd6ee2 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleSpecifyOutputDirectory/node/outdir/simple/test.js +++ b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleSpecifyOutputDirectory/node/outdir/simple/test.js @@ -2,7 +2,7 @@ exports.__esModule = true; var m1 = require("m1"); exports.a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleSpecifyOutputFile/amd/bin/test.js b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleSpecifyOutputFile/amd/bin/test.js index cbe79e3318b88..59d09316642a9 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleSpecifyOutputFile/amd/bin/test.js +++ b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleSpecifyOutputFile/amd/bin/test.js @@ -2,7 +2,7 @@ define("m1", ["require", "exports"], function (require, exports) { "use strict"; exports.__esModule = true; exports.m1_a1 = 10; - var m1_c1 = (function () { + var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; @@ -18,7 +18,7 @@ define("test", ["require", "exports", "m1"], function (require, exports, m1) { "use strict"; exports.__esModule = true; exports.a1 = 10; - var c1 = (function () { + var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderNoOutdir/amd/ref/m1.js b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderNoOutdir/amd/ref/m1.js index 391c6ef6630d8..3eb8a0f5dea2e 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderNoOutdir/amd/ref/m1.js +++ b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderNoOutdir/amd/ref/m1.js @@ -2,7 +2,7 @@ define(["require", "exports"], function (require, exports) { "use strict"; exports.__esModule = true; exports.m1_a1 = 10; - var m1_c1 = (function () { + var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderNoOutdir/amd/test.js b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderNoOutdir/amd/test.js index c95451ac730f8..efe432ad6fb5b 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderNoOutdir/amd/test.js +++ b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderNoOutdir/amd/test.js @@ -2,7 +2,7 @@ define(["require", "exports", "ref/m1"], function (require, exports, m1) { "use strict"; exports.__esModule = true; exports.a1 = 10; - var c1 = (function () { + var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderNoOutdir/node/ref/m1.js b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderNoOutdir/node/ref/m1.js index 02586d67fcc6d..2db985c931fd6 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderNoOutdir/node/ref/m1.js +++ b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderNoOutdir/node/ref/m1.js @@ -1,7 +1,7 @@ "use strict"; exports.__esModule = true; exports.m1_a1 = 10; -var m1_c1 = (function () { +var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderNoOutdir/node/test.js b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderNoOutdir/node/test.js index 97ca26f319840..d90be1b614115 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderNoOutdir/node/test.js +++ b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderNoOutdir/node/test.js @@ -2,7 +2,7 @@ exports.__esModule = true; var m1 = require("ref/m1"); exports.a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js index 391c6ef6630d8..3eb8a0f5dea2e 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js +++ b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js @@ -2,7 +2,7 @@ define(["require", "exports"], function (require, exports) { "use strict"; exports.__esModule = true; exports.m1_a1 = 10; - var m1_c1 = (function () { + var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js index c95451ac730f8..efe432ad6fb5b 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js +++ b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js @@ -2,7 +2,7 @@ define(["require", "exports", "ref/m1"], function (require, exports, m1) { "use strict"; exports.__esModule = true; exports.a1 = 10; - var c1 = (function () { + var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js index 02586d67fcc6d..2db985c931fd6 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js +++ b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js @@ -1,7 +1,7 @@ "use strict"; exports.__esModule = true; exports.m1_a1 = 10; -var m1_c1 = (function () { +var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js index 97ca26f319840..d90be1b614115 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js +++ b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js @@ -2,7 +2,7 @@ exports.__esModule = true; var m1 = require("ref/m1"); exports.a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderSpecifyOutputFile/amd/bin/test.js b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderSpecifyOutputFile/amd/bin/test.js index 22a9cf7b4d73d..91d7134f7a2c4 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderSpecifyOutputFile/amd/bin/test.js +++ b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderSpecifyOutputFile/amd/bin/test.js @@ -2,7 +2,7 @@ define("ref/m1", ["require", "exports"], function (require, exports) { "use strict"; exports.__esModule = true; exports.m1_a1 = 10; - var m1_c1 = (function () { + var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; @@ -18,7 +18,7 @@ define("test", ["require", "exports", "ref/m1"], function (require, exports, m1) "use strict"; exports.__esModule = true; exports.a1 = 10; - var c1 = (function () { + var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderNoOutdir/amd/diskFile1.js b/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderNoOutdir/amd/diskFile1.js index a1041b6d258ef..4708e36c671ce 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderNoOutdir/amd/diskFile1.js +++ b/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderNoOutdir/amd/diskFile1.js @@ -1,5 +1,5 @@ var m2_a1 = 10; -var m2_c1 = (function () { +var m2_c1 = /** @class */ (function () { function m2_c1() { } return m2_c1; diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderNoOutdir/amd/ref/m1.js b/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderNoOutdir/amd/ref/m1.js index b7283f7fd8830..4293cda52dba5 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderNoOutdir/amd/ref/m1.js +++ b/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderNoOutdir/amd/ref/m1.js @@ -1,5 +1,5 @@ var m1_a1 = 10; -var m1_c1 = (function () { +var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderNoOutdir/amd/test.js b/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderNoOutdir/amd/test.js index 088a77f3f259c..02aa0b24321fd 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderNoOutdir/amd/test.js +++ b/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderNoOutdir/amd/test.js @@ -1,7 +1,7 @@ /// /// var a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderNoOutdir/node/diskFile1.js b/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderNoOutdir/node/diskFile1.js index a1041b6d258ef..4708e36c671ce 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderNoOutdir/node/diskFile1.js +++ b/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderNoOutdir/node/diskFile1.js @@ -1,5 +1,5 @@ var m2_a1 = 10; -var m2_c1 = (function () { +var m2_c1 = /** @class */ (function () { function m2_c1() { } return m2_c1; diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderNoOutdir/node/ref/m1.js b/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderNoOutdir/node/ref/m1.js index b7283f7fd8830..4293cda52dba5 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderNoOutdir/node/ref/m1.js +++ b/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderNoOutdir/node/ref/m1.js @@ -1,5 +1,5 @@ var m1_a1 = 10; -var m1_c1 = (function () { +var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderNoOutdir/node/test.js b/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderNoOutdir/node/test.js index 088a77f3f259c..02aa0b24321fd 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderNoOutdir/node/test.js +++ b/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderNoOutdir/node/test.js @@ -1,7 +1,7 @@ /// /// var a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/ref/m1.js b/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/ref/m1.js index b7283f7fd8830..4293cda52dba5 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/ref/m1.js +++ b/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/ref/m1.js @@ -1,5 +1,5 @@ var m1_a1 = 10; -var m1_c1 = (function () { +var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/test.js b/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/test.js index 088a77f3f259c..02aa0b24321fd 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/test.js +++ b/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/test.js @@ -1,7 +1,7 @@ /// /// var a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder_ref/m2.js b/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder_ref/m2.js index a1041b6d258ef..4708e36c671ce 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder_ref/m2.js +++ b/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder_ref/m2.js @@ -1,5 +1,5 @@ var m2_a1 = 10; -var m2_c1 = (function () { +var m2_c1 = /** @class */ (function () { function m2_c1() { } return m2_c1; diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/ref/m1.js b/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/ref/m1.js index b7283f7fd8830..4293cda52dba5 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/ref/m1.js +++ b/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/ref/m1.js @@ -1,5 +1,5 @@ var m1_a1 = 10; -var m1_c1 = (function () { +var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/test.js b/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/test.js index 088a77f3f259c..02aa0b24321fd 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/test.js +++ b/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/test.js @@ -1,7 +1,7 @@ /// /// var a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder_ref/m2.js b/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder_ref/m2.js index a1041b6d258ef..4708e36c671ce 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder_ref/m2.js +++ b/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder_ref/m2.js @@ -1,5 +1,5 @@ var m2_a1 = 10; -var m2_c1 = (function () { +var m2_c1 = /** @class */ (function () { function m2_c1() { } return m2_c1; diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderSpecifyOutputFile/amd/bin/test.js b/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderSpecifyOutputFile/amd/bin/test.js index ad96cca3d7952..62f18329bd31e 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderSpecifyOutputFile/amd/bin/test.js +++ b/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderSpecifyOutputFile/amd/bin/test.js @@ -1,5 +1,5 @@ var m1_a1 = 10; -var m1_c1 = (function () { +var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; @@ -9,7 +9,7 @@ function m1_f1() { return m1_instance1; } var m2_a1 = 10; -var m2_c1 = (function () { +var m2_c1 = /** @class */ (function () { function m2_c1() { } return m2_c1; @@ -21,7 +21,7 @@ function m2_f1() { /// /// var a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderSpecifyOutputFile/node/bin/test.js b/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderSpecifyOutputFile/node/bin/test.js index ad96cca3d7952..62f18329bd31e 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderSpecifyOutputFile/node/bin/test.js +++ b/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderSpecifyOutputFile/node/bin/test.js @@ -1,5 +1,5 @@ var m1_a1 = 10; -var m1_c1 = (function () { +var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; @@ -9,7 +9,7 @@ function m1_f1() { return m1_instance1; } var m2_a1 = 10; -var m2_c1 = (function () { +var m2_c1 = /** @class */ (function () { function m2_c1() { } return m2_c1; @@ -21,7 +21,7 @@ function m2_f1() { /// /// var a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathSimpleNoOutdir/amd/m1.js b/tests/baselines/reference/project/sourceRootAbsolutePathSimpleNoOutdir/amd/m1.js index b7283f7fd8830..4293cda52dba5 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathSimpleNoOutdir/amd/m1.js +++ b/tests/baselines/reference/project/sourceRootAbsolutePathSimpleNoOutdir/amd/m1.js @@ -1,5 +1,5 @@ var m1_a1 = 10; -var m1_c1 = (function () { +var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathSimpleNoOutdir/amd/test.js b/tests/baselines/reference/project/sourceRootAbsolutePathSimpleNoOutdir/amd/test.js index 679b65b57336e..febaeedb0f144 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathSimpleNoOutdir/amd/test.js +++ b/tests/baselines/reference/project/sourceRootAbsolutePathSimpleNoOutdir/amd/test.js @@ -1,6 +1,6 @@ /// var a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathSimpleNoOutdir/node/m1.js b/tests/baselines/reference/project/sourceRootAbsolutePathSimpleNoOutdir/node/m1.js index b7283f7fd8830..4293cda52dba5 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathSimpleNoOutdir/node/m1.js +++ b/tests/baselines/reference/project/sourceRootAbsolutePathSimpleNoOutdir/node/m1.js @@ -1,5 +1,5 @@ var m1_a1 = 10; -var m1_c1 = (function () { +var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathSimpleNoOutdir/node/test.js b/tests/baselines/reference/project/sourceRootAbsolutePathSimpleNoOutdir/node/test.js index 679b65b57336e..febaeedb0f144 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathSimpleNoOutdir/node/test.js +++ b/tests/baselines/reference/project/sourceRootAbsolutePathSimpleNoOutdir/node/test.js @@ -1,6 +1,6 @@ /// var a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathSimpleSpecifyOutputDirectory/amd/outdir/simple/m1.js b/tests/baselines/reference/project/sourceRootAbsolutePathSimpleSpecifyOutputDirectory/amd/outdir/simple/m1.js index b7283f7fd8830..4293cda52dba5 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathSimpleSpecifyOutputDirectory/amd/outdir/simple/m1.js +++ b/tests/baselines/reference/project/sourceRootAbsolutePathSimpleSpecifyOutputDirectory/amd/outdir/simple/m1.js @@ -1,5 +1,5 @@ var m1_a1 = 10; -var m1_c1 = (function () { +var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathSimpleSpecifyOutputDirectory/amd/outdir/simple/test.js b/tests/baselines/reference/project/sourceRootAbsolutePathSimpleSpecifyOutputDirectory/amd/outdir/simple/test.js index 679b65b57336e..febaeedb0f144 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathSimpleSpecifyOutputDirectory/amd/outdir/simple/test.js +++ b/tests/baselines/reference/project/sourceRootAbsolutePathSimpleSpecifyOutputDirectory/amd/outdir/simple/test.js @@ -1,6 +1,6 @@ /// var a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathSimpleSpecifyOutputDirectory/node/outdir/simple/m1.js b/tests/baselines/reference/project/sourceRootAbsolutePathSimpleSpecifyOutputDirectory/node/outdir/simple/m1.js index b7283f7fd8830..4293cda52dba5 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathSimpleSpecifyOutputDirectory/node/outdir/simple/m1.js +++ b/tests/baselines/reference/project/sourceRootAbsolutePathSimpleSpecifyOutputDirectory/node/outdir/simple/m1.js @@ -1,5 +1,5 @@ var m1_a1 = 10; -var m1_c1 = (function () { +var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathSimpleSpecifyOutputDirectory/node/outdir/simple/test.js b/tests/baselines/reference/project/sourceRootAbsolutePathSimpleSpecifyOutputDirectory/node/outdir/simple/test.js index 679b65b57336e..febaeedb0f144 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathSimpleSpecifyOutputDirectory/node/outdir/simple/test.js +++ b/tests/baselines/reference/project/sourceRootAbsolutePathSimpleSpecifyOutputDirectory/node/outdir/simple/test.js @@ -1,6 +1,6 @@ /// var a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathSimpleSpecifyOutputFile/amd/bin/test.js b/tests/baselines/reference/project/sourceRootAbsolutePathSimpleSpecifyOutputFile/amd/bin/test.js index 481c10d1a06ad..8e0b6a1a8ff13 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathSimpleSpecifyOutputFile/amd/bin/test.js +++ b/tests/baselines/reference/project/sourceRootAbsolutePathSimpleSpecifyOutputFile/amd/bin/test.js @@ -1,5 +1,5 @@ var m1_a1 = 10; -var m1_c1 = (function () { +var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; @@ -10,7 +10,7 @@ function m1_f1() { } /// var a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathSimpleSpecifyOutputFile/node/bin/test.js b/tests/baselines/reference/project/sourceRootAbsolutePathSimpleSpecifyOutputFile/node/bin/test.js index 481c10d1a06ad..8e0b6a1a8ff13 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathSimpleSpecifyOutputFile/node/bin/test.js +++ b/tests/baselines/reference/project/sourceRootAbsolutePathSimpleSpecifyOutputFile/node/bin/test.js @@ -1,5 +1,5 @@ var m1_a1 = 10; -var m1_c1 = (function () { +var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; @@ -10,7 +10,7 @@ function m1_f1() { } /// var a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathSingleFileNoOutdir/amd/test.js b/tests/baselines/reference/project/sourceRootAbsolutePathSingleFileNoOutdir/amd/test.js index e5a1c12a7323d..eea2aa31cd4a1 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathSingleFileNoOutdir/amd/test.js +++ b/tests/baselines/reference/project/sourceRootAbsolutePathSingleFileNoOutdir/amd/test.js @@ -1,5 +1,5 @@ var a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathSingleFileNoOutdir/node/test.js b/tests/baselines/reference/project/sourceRootAbsolutePathSingleFileNoOutdir/node/test.js index e5a1c12a7323d..eea2aa31cd4a1 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathSingleFileNoOutdir/node/test.js +++ b/tests/baselines/reference/project/sourceRootAbsolutePathSingleFileNoOutdir/node/test.js @@ -1,5 +1,5 @@ var a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathSingleFileSpecifyOutputDirectory/amd/outdir/simple/test.js b/tests/baselines/reference/project/sourceRootAbsolutePathSingleFileSpecifyOutputDirectory/amd/outdir/simple/test.js index e5a1c12a7323d..eea2aa31cd4a1 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathSingleFileSpecifyOutputDirectory/amd/outdir/simple/test.js +++ b/tests/baselines/reference/project/sourceRootAbsolutePathSingleFileSpecifyOutputDirectory/amd/outdir/simple/test.js @@ -1,5 +1,5 @@ var a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathSingleFileSpecifyOutputDirectory/node/outdir/simple/test.js b/tests/baselines/reference/project/sourceRootAbsolutePathSingleFileSpecifyOutputDirectory/node/outdir/simple/test.js index e5a1c12a7323d..eea2aa31cd4a1 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathSingleFileSpecifyOutputDirectory/node/outdir/simple/test.js +++ b/tests/baselines/reference/project/sourceRootAbsolutePathSingleFileSpecifyOutputDirectory/node/outdir/simple/test.js @@ -1,5 +1,5 @@ var a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathSingleFileSpecifyOutputFile/amd/bin/test.js b/tests/baselines/reference/project/sourceRootAbsolutePathSingleFileSpecifyOutputFile/amd/bin/test.js index e5a1c12a7323d..eea2aa31cd4a1 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathSingleFileSpecifyOutputFile/amd/bin/test.js +++ b/tests/baselines/reference/project/sourceRootAbsolutePathSingleFileSpecifyOutputFile/amd/bin/test.js @@ -1,5 +1,5 @@ var a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathSingleFileSpecifyOutputFile/node/bin/test.js b/tests/baselines/reference/project/sourceRootAbsolutePathSingleFileSpecifyOutputFile/node/bin/test.js index e5a1c12a7323d..eea2aa31cd4a1 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathSingleFileSpecifyOutputFile/node/bin/test.js +++ b/tests/baselines/reference/project/sourceRootAbsolutePathSingleFileSpecifyOutputFile/node/bin/test.js @@ -1,5 +1,5 @@ var a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathSubfolderNoOutdir/amd/ref/m1.js b/tests/baselines/reference/project/sourceRootAbsolutePathSubfolderNoOutdir/amd/ref/m1.js index b7283f7fd8830..4293cda52dba5 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathSubfolderNoOutdir/amd/ref/m1.js +++ b/tests/baselines/reference/project/sourceRootAbsolutePathSubfolderNoOutdir/amd/ref/m1.js @@ -1,5 +1,5 @@ var m1_a1 = 10; -var m1_c1 = (function () { +var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathSubfolderNoOutdir/amd/test.js b/tests/baselines/reference/project/sourceRootAbsolutePathSubfolderNoOutdir/amd/test.js index 408b7e46f6182..72395b6e4c854 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathSubfolderNoOutdir/amd/test.js +++ b/tests/baselines/reference/project/sourceRootAbsolutePathSubfolderNoOutdir/amd/test.js @@ -1,6 +1,6 @@ /// var a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathSubfolderNoOutdir/node/ref/m1.js b/tests/baselines/reference/project/sourceRootAbsolutePathSubfolderNoOutdir/node/ref/m1.js index b7283f7fd8830..4293cda52dba5 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathSubfolderNoOutdir/node/ref/m1.js +++ b/tests/baselines/reference/project/sourceRootAbsolutePathSubfolderNoOutdir/node/ref/m1.js @@ -1,5 +1,5 @@ var m1_a1 = 10; -var m1_c1 = (function () { +var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathSubfolderNoOutdir/node/test.js b/tests/baselines/reference/project/sourceRootAbsolutePathSubfolderNoOutdir/node/test.js index 408b7e46f6182..72395b6e4c854 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathSubfolderNoOutdir/node/test.js +++ b/tests/baselines/reference/project/sourceRootAbsolutePathSubfolderNoOutdir/node/test.js @@ -1,6 +1,6 @@ /// var a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js b/tests/baselines/reference/project/sourceRootAbsolutePathSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js index b7283f7fd8830..4293cda52dba5 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js +++ b/tests/baselines/reference/project/sourceRootAbsolutePathSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js @@ -1,5 +1,5 @@ var m1_a1 = 10; -var m1_c1 = (function () { +var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js b/tests/baselines/reference/project/sourceRootAbsolutePathSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js index 408b7e46f6182..72395b6e4c854 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js +++ b/tests/baselines/reference/project/sourceRootAbsolutePathSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js @@ -1,6 +1,6 @@ /// var a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js b/tests/baselines/reference/project/sourceRootAbsolutePathSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js index b7283f7fd8830..4293cda52dba5 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js +++ b/tests/baselines/reference/project/sourceRootAbsolutePathSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js @@ -1,5 +1,5 @@ var m1_a1 = 10; -var m1_c1 = (function () { +var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js b/tests/baselines/reference/project/sourceRootAbsolutePathSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js index 408b7e46f6182..72395b6e4c854 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js +++ b/tests/baselines/reference/project/sourceRootAbsolutePathSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js @@ -1,6 +1,6 @@ /// var a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathSubfolderSpecifyOutputFile/amd/bin/test.js b/tests/baselines/reference/project/sourceRootAbsolutePathSubfolderSpecifyOutputFile/amd/bin/test.js index a456603674661..7c6145986c66a 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathSubfolderSpecifyOutputFile/amd/bin/test.js +++ b/tests/baselines/reference/project/sourceRootAbsolutePathSubfolderSpecifyOutputFile/amd/bin/test.js @@ -1,5 +1,5 @@ var m1_a1 = 10; -var m1_c1 = (function () { +var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; @@ -10,7 +10,7 @@ function m1_f1() { } /// var a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathSubfolderSpecifyOutputFile/node/bin/test.js b/tests/baselines/reference/project/sourceRootAbsolutePathSubfolderSpecifyOutputFile/node/bin/test.js index a456603674661..7c6145986c66a 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathSubfolderSpecifyOutputFile/node/bin/test.js +++ b/tests/baselines/reference/project/sourceRootAbsolutePathSubfolderSpecifyOutputFile/node/bin/test.js @@ -1,5 +1,5 @@ var m1_a1 = 10; -var m1_c1 = (function () { +var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; @@ -10,7 +10,7 @@ function m1_f1() { } /// var a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderNoOutdir/amd/ref/m1.js b/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderNoOutdir/amd/ref/m1.js index b7283f7fd8830..4293cda52dba5 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderNoOutdir/amd/ref/m1.js +++ b/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderNoOutdir/amd/ref/m1.js @@ -1,5 +1,5 @@ var m1_a1 = 10; -var m1_c1 = (function () { +var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; diff --git a/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderNoOutdir/amd/ref/m2.js b/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderNoOutdir/amd/ref/m2.js index 08855ec797b4d..20d4b93990f3f 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderNoOutdir/amd/ref/m2.js +++ b/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderNoOutdir/amd/ref/m2.js @@ -2,7 +2,7 @@ define(["require", "exports"], function (require, exports) { "use strict"; exports.__esModule = true; exports.m2_a1 = 10; - var m2_c1 = (function () { + var m2_c1 = /** @class */ (function () { function m2_c1() { } return m2_c1; diff --git a/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderNoOutdir/amd/test.js b/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderNoOutdir/amd/test.js index 78426750a82a2..020207321b363 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderNoOutdir/amd/test.js +++ b/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderNoOutdir/amd/test.js @@ -1,7 +1,7 @@ /// /// var a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderNoOutdir/node/ref/m1.js b/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderNoOutdir/node/ref/m1.js index b7283f7fd8830..4293cda52dba5 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderNoOutdir/node/ref/m1.js +++ b/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderNoOutdir/node/ref/m1.js @@ -1,5 +1,5 @@ var m1_a1 = 10; -var m1_c1 = (function () { +var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; diff --git a/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderNoOutdir/node/ref/m2.js b/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderNoOutdir/node/ref/m2.js index 8ad833cd4eba9..fca535956778f 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderNoOutdir/node/ref/m2.js +++ b/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderNoOutdir/node/ref/m2.js @@ -1,7 +1,7 @@ "use strict"; exports.__esModule = true; exports.m2_a1 = 10; -var m2_c1 = (function () { +var m2_c1 = /** @class */ (function () { function m2_c1() { } return m2_c1; diff --git a/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderNoOutdir/node/test.js b/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderNoOutdir/node/test.js index 78426750a82a2..020207321b363 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderNoOutdir/node/test.js +++ b/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderNoOutdir/node/test.js @@ -1,7 +1,7 @@ /// /// var a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js b/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js index b7283f7fd8830..4293cda52dba5 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js +++ b/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js @@ -1,5 +1,5 @@ var m1_a1 = 10; -var m1_c1 = (function () { +var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; diff --git a/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m2.js b/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m2.js index 08855ec797b4d..20d4b93990f3f 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m2.js +++ b/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m2.js @@ -2,7 +2,7 @@ define(["require", "exports"], function (require, exports) { "use strict"; exports.__esModule = true; exports.m2_a1 = 10; - var m2_c1 = (function () { + var m2_c1 = /** @class */ (function () { function m2_c1() { } return m2_c1; diff --git a/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js b/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js index 78426750a82a2..020207321b363 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js +++ b/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js @@ -1,7 +1,7 @@ /// /// var a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js b/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js index b7283f7fd8830..4293cda52dba5 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js +++ b/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js @@ -1,5 +1,5 @@ var m1_a1 = 10; -var m1_c1 = (function () { +var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; diff --git a/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m2.js b/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m2.js index 8ad833cd4eba9..fca535956778f 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m2.js +++ b/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m2.js @@ -1,7 +1,7 @@ "use strict"; exports.__esModule = true; exports.m2_a1 = 10; -var m2_c1 = (function () { +var m2_c1 = /** @class */ (function () { function m2_c1() { } return m2_c1; diff --git a/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js b/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js index 78426750a82a2..020207321b363 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js +++ b/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js @@ -1,7 +1,7 @@ /// /// var a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputFile/amd/bin/test.js b/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputFile/amd/bin/test.js index f070fff6f1cb8..6c4233ece096d 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputFile/amd/bin/test.js +++ b/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputFile/amd/bin/test.js @@ -1,5 +1,5 @@ var m1_a1 = 10; -var m1_c1 = (function () { +var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; @@ -12,7 +12,7 @@ define("ref/m2", ["require", "exports"], function (require, exports) { "use strict"; exports.__esModule = true; exports.m2_a1 = 10; - var m2_c1 = (function () { + var m2_c1 = /** @class */ (function () { function m2_c1() { } return m2_c1; @@ -27,7 +27,7 @@ define("ref/m2", ["require", "exports"], function (require, exports) { /// /// var a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputFile/node/bin/test.js b/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputFile/node/bin/test.js index 5d63d624329e6..4aa1cc0efbdbb 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputFile/node/bin/test.js +++ b/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputFile/node/bin/test.js @@ -1,5 +1,5 @@ var m1_a1 = 10; -var m1_c1 = (function () { +var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; @@ -11,7 +11,7 @@ function m1_f1() { /// /// var a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/bin/outAndOutDirFile.js b/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/bin/outAndOutDirFile.js index 3e02cc09fcb7a..7b02d52b57d72 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/bin/outAndOutDirFile.js +++ b/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/bin/outAndOutDirFile.js @@ -1,5 +1,5 @@ var m1_a1 = 10; -var m1_c1 = (function () { +var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; @@ -12,7 +12,7 @@ define("ref/m2", ["require", "exports"], function (require, exports) { "use strict"; exports.__esModule = true; exports.m2_a1 = 10; - var m2_c1 = (function () { + var m2_c1 = /** @class */ (function () { function m2_c1() { } return m2_c1; @@ -27,7 +27,7 @@ define("ref/m2", ["require", "exports"], function (require, exports) { /// /// var a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/bin/outAndOutDirFile.js b/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/bin/outAndOutDirFile.js index da6a20151434f..86b6ba19ae52a 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/bin/outAndOutDirFile.js +++ b/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/bin/outAndOutDirFile.js @@ -1,5 +1,5 @@ var m1_a1 = 10; -var m1_c1 = (function () { +var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; @@ -11,7 +11,7 @@ function m1_f1() { /// /// var a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderNoOutdir/amd/diskFile1.js b/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderNoOutdir/amd/diskFile1.js index 08855ec797b4d..20d4b93990f3f 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderNoOutdir/amd/diskFile1.js +++ b/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderNoOutdir/amd/diskFile1.js @@ -2,7 +2,7 @@ define(["require", "exports"], function (require, exports) { "use strict"; exports.__esModule = true; exports.m2_a1 = 10; - var m2_c1 = (function () { + var m2_c1 = /** @class */ (function () { function m2_c1() { } return m2_c1; diff --git a/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderNoOutdir/amd/ref/m1.js b/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderNoOutdir/amd/ref/m1.js index 391c6ef6630d8..3eb8a0f5dea2e 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderNoOutdir/amd/ref/m1.js +++ b/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderNoOutdir/amd/ref/m1.js @@ -2,7 +2,7 @@ define(["require", "exports"], function (require, exports) { "use strict"; exports.__esModule = true; exports.m1_a1 = 10; - var m1_c1 = (function () { + var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; diff --git a/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderNoOutdir/amd/test.js b/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderNoOutdir/amd/test.js index 90f7f12fcb186..2d7e905faa44d 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderNoOutdir/amd/test.js +++ b/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderNoOutdir/amd/test.js @@ -2,7 +2,7 @@ define(["require", "exports", "ref/m1", "../outputdir_module_multifolder_ref/m2" "use strict"; exports.__esModule = true; exports.a1 = 10; - var c1 = (function () { + var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderNoOutdir/node/diskFile1.js b/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderNoOutdir/node/diskFile1.js index 8ad833cd4eba9..fca535956778f 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderNoOutdir/node/diskFile1.js +++ b/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderNoOutdir/node/diskFile1.js @@ -1,7 +1,7 @@ "use strict"; exports.__esModule = true; exports.m2_a1 = 10; -var m2_c1 = (function () { +var m2_c1 = /** @class */ (function () { function m2_c1() { } return m2_c1; diff --git a/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderNoOutdir/node/ref/m1.js b/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderNoOutdir/node/ref/m1.js index 02586d67fcc6d..2db985c931fd6 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderNoOutdir/node/ref/m1.js +++ b/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderNoOutdir/node/ref/m1.js @@ -1,7 +1,7 @@ "use strict"; exports.__esModule = true; exports.m1_a1 = 10; -var m1_c1 = (function () { +var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; diff --git a/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderNoOutdir/node/test.js b/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderNoOutdir/node/test.js index 43d151f3fd963..2fbb4d7fc1ca4 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderNoOutdir/node/test.js +++ b/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderNoOutdir/node/test.js @@ -3,7 +3,7 @@ exports.__esModule = true; var m1 = require("ref/m1"); var m2 = require("../outputdir_module_multifolder_ref/m2"); exports.a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder/ref/m1.js b/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder/ref/m1.js index 391c6ef6630d8..3eb8a0f5dea2e 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder/ref/m1.js +++ b/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder/ref/m1.js @@ -2,7 +2,7 @@ define(["require", "exports"], function (require, exports) { "use strict"; exports.__esModule = true; exports.m1_a1 = 10; - var m1_c1 = (function () { + var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; diff --git a/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder/test.js b/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder/test.js index 90f7f12fcb186..2d7e905faa44d 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder/test.js +++ b/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder/test.js @@ -2,7 +2,7 @@ define(["require", "exports", "ref/m1", "../outputdir_module_multifolder_ref/m2" "use strict"; exports.__esModule = true; exports.a1 = 10; - var c1 = (function () { + var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder_ref/m2.js b/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder_ref/m2.js index 08855ec797b4d..20d4b93990f3f 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder_ref/m2.js +++ b/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder_ref/m2.js @@ -2,7 +2,7 @@ define(["require", "exports"], function (require, exports) { "use strict"; exports.__esModule = true; exports.m2_a1 = 10; - var m2_c1 = (function () { + var m2_c1 = /** @class */ (function () { function m2_c1() { } return m2_c1; diff --git a/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder/ref/m1.js b/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder/ref/m1.js index 02586d67fcc6d..2db985c931fd6 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder/ref/m1.js +++ b/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder/ref/m1.js @@ -1,7 +1,7 @@ "use strict"; exports.__esModule = true; exports.m1_a1 = 10; -var m1_c1 = (function () { +var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; diff --git a/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder/test.js b/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder/test.js index 43d151f3fd963..2fbb4d7fc1ca4 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder/test.js +++ b/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder/test.js @@ -3,7 +3,7 @@ exports.__esModule = true; var m1 = require("ref/m1"); var m2 = require("../outputdir_module_multifolder_ref/m2"); exports.a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder_ref/m2.js b/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder_ref/m2.js index 8ad833cd4eba9..fca535956778f 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder_ref/m2.js +++ b/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder_ref/m2.js @@ -1,7 +1,7 @@ "use strict"; exports.__esModule = true; exports.m2_a1 = 10; -var m2_c1 = (function () { +var m2_c1 = /** @class */ (function () { function m2_c1() { } return m2_c1; diff --git a/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderSpecifyOutputFile/amd/bin/test.js b/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderSpecifyOutputFile/amd/bin/test.js index b77e0a462a773..6a566140109d1 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderSpecifyOutputFile/amd/bin/test.js +++ b/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderSpecifyOutputFile/amd/bin/test.js @@ -2,7 +2,7 @@ define("outputdir_module_multifolder/ref/m1", ["require", "exports"], function ( "use strict"; exports.__esModule = true; exports.m1_a1 = 10; - var m1_c1 = (function () { + var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; @@ -18,7 +18,7 @@ define("outputdir_module_multifolder_ref/m2", ["require", "exports"], function ( "use strict"; exports.__esModule = true; exports.m2_a1 = 10; - var m2_c1 = (function () { + var m2_c1 = /** @class */ (function () { function m2_c1() { } return m2_c1; @@ -34,7 +34,7 @@ define("outputdir_module_multifolder/test", ["require", "exports", "outputdir_mo "use strict"; exports.__esModule = true; exports.a1 = 10; - var c1 = (function () { + var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleNoOutdir/amd/m1.js b/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleNoOutdir/amd/m1.js index 391c6ef6630d8..3eb8a0f5dea2e 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleNoOutdir/amd/m1.js +++ b/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleNoOutdir/amd/m1.js @@ -2,7 +2,7 @@ define(["require", "exports"], function (require, exports) { "use strict"; exports.__esModule = true; exports.m1_a1 = 10; - var m1_c1 = (function () { + var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; diff --git a/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleNoOutdir/amd/test.js b/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleNoOutdir/amd/test.js index e5ed53fd0e1a2..d85c5bfa685a7 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleNoOutdir/amd/test.js +++ b/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleNoOutdir/amd/test.js @@ -2,7 +2,7 @@ define(["require", "exports", "m1"], function (require, exports, m1) { "use strict"; exports.__esModule = true; exports.a1 = 10; - var c1 = (function () { + var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleNoOutdir/node/m1.js b/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleNoOutdir/node/m1.js index 02586d67fcc6d..2db985c931fd6 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleNoOutdir/node/m1.js +++ b/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleNoOutdir/node/m1.js @@ -1,7 +1,7 @@ "use strict"; exports.__esModule = true; exports.m1_a1 = 10; -var m1_c1 = (function () { +var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; diff --git a/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleNoOutdir/node/test.js b/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleNoOutdir/node/test.js index 56c8debf9b699..ca22756bd6ee2 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleNoOutdir/node/test.js +++ b/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleNoOutdir/node/test.js @@ -2,7 +2,7 @@ exports.__esModule = true; var m1 = require("m1"); exports.a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleSpecifyOutputDirectory/amd/outdir/simple/m1.js b/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleSpecifyOutputDirectory/amd/outdir/simple/m1.js index 391c6ef6630d8..3eb8a0f5dea2e 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleSpecifyOutputDirectory/amd/outdir/simple/m1.js +++ b/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleSpecifyOutputDirectory/amd/outdir/simple/m1.js @@ -2,7 +2,7 @@ define(["require", "exports"], function (require, exports) { "use strict"; exports.__esModule = true; exports.m1_a1 = 10; - var m1_c1 = (function () { + var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; diff --git a/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleSpecifyOutputDirectory/amd/outdir/simple/test.js b/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleSpecifyOutputDirectory/amd/outdir/simple/test.js index e5ed53fd0e1a2..d85c5bfa685a7 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleSpecifyOutputDirectory/amd/outdir/simple/test.js +++ b/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleSpecifyOutputDirectory/amd/outdir/simple/test.js @@ -2,7 +2,7 @@ define(["require", "exports", "m1"], function (require, exports, m1) { "use strict"; exports.__esModule = true; exports.a1 = 10; - var c1 = (function () { + var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleSpecifyOutputDirectory/node/outdir/simple/m1.js b/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleSpecifyOutputDirectory/node/outdir/simple/m1.js index 02586d67fcc6d..2db985c931fd6 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleSpecifyOutputDirectory/node/outdir/simple/m1.js +++ b/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleSpecifyOutputDirectory/node/outdir/simple/m1.js @@ -1,7 +1,7 @@ "use strict"; exports.__esModule = true; exports.m1_a1 = 10; -var m1_c1 = (function () { +var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; diff --git a/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleSpecifyOutputDirectory/node/outdir/simple/test.js b/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleSpecifyOutputDirectory/node/outdir/simple/test.js index 56c8debf9b699..ca22756bd6ee2 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleSpecifyOutputDirectory/node/outdir/simple/test.js +++ b/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleSpecifyOutputDirectory/node/outdir/simple/test.js @@ -2,7 +2,7 @@ exports.__esModule = true; var m1 = require("m1"); exports.a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleSpecifyOutputFile/amd/bin/test.js b/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleSpecifyOutputFile/amd/bin/test.js index cbe79e3318b88..59d09316642a9 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleSpecifyOutputFile/amd/bin/test.js +++ b/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleSpecifyOutputFile/amd/bin/test.js @@ -2,7 +2,7 @@ define("m1", ["require", "exports"], function (require, exports) { "use strict"; exports.__esModule = true; exports.m1_a1 = 10; - var m1_c1 = (function () { + var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; @@ -18,7 +18,7 @@ define("test", ["require", "exports", "m1"], function (require, exports, m1) { "use strict"; exports.__esModule = true; exports.a1 = 10; - var c1 = (function () { + var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderNoOutdir/amd/ref/m1.js b/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderNoOutdir/amd/ref/m1.js index 391c6ef6630d8..3eb8a0f5dea2e 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderNoOutdir/amd/ref/m1.js +++ b/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderNoOutdir/amd/ref/m1.js @@ -2,7 +2,7 @@ define(["require", "exports"], function (require, exports) { "use strict"; exports.__esModule = true; exports.m1_a1 = 10; - var m1_c1 = (function () { + var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; diff --git a/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderNoOutdir/amd/test.js b/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderNoOutdir/amd/test.js index c95451ac730f8..efe432ad6fb5b 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderNoOutdir/amd/test.js +++ b/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderNoOutdir/amd/test.js @@ -2,7 +2,7 @@ define(["require", "exports", "ref/m1"], function (require, exports, m1) { "use strict"; exports.__esModule = true; exports.a1 = 10; - var c1 = (function () { + var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderNoOutdir/node/ref/m1.js b/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderNoOutdir/node/ref/m1.js index 02586d67fcc6d..2db985c931fd6 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderNoOutdir/node/ref/m1.js +++ b/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderNoOutdir/node/ref/m1.js @@ -1,7 +1,7 @@ "use strict"; exports.__esModule = true; exports.m1_a1 = 10; -var m1_c1 = (function () { +var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; diff --git a/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderNoOutdir/node/test.js b/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderNoOutdir/node/test.js index 97ca26f319840..d90be1b614115 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderNoOutdir/node/test.js +++ b/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderNoOutdir/node/test.js @@ -2,7 +2,7 @@ exports.__esModule = true; var m1 = require("ref/m1"); exports.a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js b/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js index 391c6ef6630d8..3eb8a0f5dea2e 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js +++ b/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js @@ -2,7 +2,7 @@ define(["require", "exports"], function (require, exports) { "use strict"; exports.__esModule = true; exports.m1_a1 = 10; - var m1_c1 = (function () { + var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; diff --git a/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js b/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js index c95451ac730f8..efe432ad6fb5b 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js +++ b/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js @@ -2,7 +2,7 @@ define(["require", "exports", "ref/m1"], function (require, exports, m1) { "use strict"; exports.__esModule = true; exports.a1 = 10; - var c1 = (function () { + var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js b/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js index 02586d67fcc6d..2db985c931fd6 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js +++ b/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js @@ -1,7 +1,7 @@ "use strict"; exports.__esModule = true; exports.m1_a1 = 10; -var m1_c1 = (function () { +var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; diff --git a/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js b/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js index 97ca26f319840..d90be1b614115 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js +++ b/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js @@ -2,7 +2,7 @@ exports.__esModule = true; var m1 = require("ref/m1"); exports.a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderSpecifyOutputFile/amd/bin/test.js b/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderSpecifyOutputFile/amd/bin/test.js index 22a9cf7b4d73d..91d7134f7a2c4 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderSpecifyOutputFile/amd/bin/test.js +++ b/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderSpecifyOutputFile/amd/bin/test.js @@ -2,7 +2,7 @@ define("ref/m1", ["require", "exports"], function (require, exports) { "use strict"; exports.__esModule = true; exports.m1_a1 = 10; - var m1_c1 = (function () { + var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; @@ -18,7 +18,7 @@ define("test", ["require", "exports", "ref/m1"], function (require, exports, m1) "use strict"; exports.__esModule = true; exports.a1 = 10; - var c1 = (function () { + var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/sourceRootRelativePathMultifolderNoOutdir/amd/diskFile1.js b/tests/baselines/reference/project/sourceRootRelativePathMultifolderNoOutdir/amd/diskFile1.js index a1041b6d258ef..4708e36c671ce 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathMultifolderNoOutdir/amd/diskFile1.js +++ b/tests/baselines/reference/project/sourceRootRelativePathMultifolderNoOutdir/amd/diskFile1.js @@ -1,5 +1,5 @@ var m2_a1 = 10; -var m2_c1 = (function () { +var m2_c1 = /** @class */ (function () { function m2_c1() { } return m2_c1; diff --git a/tests/baselines/reference/project/sourceRootRelativePathMultifolderNoOutdir/amd/ref/m1.js b/tests/baselines/reference/project/sourceRootRelativePathMultifolderNoOutdir/amd/ref/m1.js index b7283f7fd8830..4293cda52dba5 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathMultifolderNoOutdir/amd/ref/m1.js +++ b/tests/baselines/reference/project/sourceRootRelativePathMultifolderNoOutdir/amd/ref/m1.js @@ -1,5 +1,5 @@ var m1_a1 = 10; -var m1_c1 = (function () { +var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; diff --git a/tests/baselines/reference/project/sourceRootRelativePathMultifolderNoOutdir/amd/test.js b/tests/baselines/reference/project/sourceRootRelativePathMultifolderNoOutdir/amd/test.js index 088a77f3f259c..02aa0b24321fd 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathMultifolderNoOutdir/amd/test.js +++ b/tests/baselines/reference/project/sourceRootRelativePathMultifolderNoOutdir/amd/test.js @@ -1,7 +1,7 @@ /// /// var a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/sourceRootRelativePathMultifolderNoOutdir/node/diskFile1.js b/tests/baselines/reference/project/sourceRootRelativePathMultifolderNoOutdir/node/diskFile1.js index a1041b6d258ef..4708e36c671ce 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathMultifolderNoOutdir/node/diskFile1.js +++ b/tests/baselines/reference/project/sourceRootRelativePathMultifolderNoOutdir/node/diskFile1.js @@ -1,5 +1,5 @@ var m2_a1 = 10; -var m2_c1 = (function () { +var m2_c1 = /** @class */ (function () { function m2_c1() { } return m2_c1; diff --git a/tests/baselines/reference/project/sourceRootRelativePathMultifolderNoOutdir/node/ref/m1.js b/tests/baselines/reference/project/sourceRootRelativePathMultifolderNoOutdir/node/ref/m1.js index b7283f7fd8830..4293cda52dba5 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathMultifolderNoOutdir/node/ref/m1.js +++ b/tests/baselines/reference/project/sourceRootRelativePathMultifolderNoOutdir/node/ref/m1.js @@ -1,5 +1,5 @@ var m1_a1 = 10; -var m1_c1 = (function () { +var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; diff --git a/tests/baselines/reference/project/sourceRootRelativePathMultifolderNoOutdir/node/test.js b/tests/baselines/reference/project/sourceRootRelativePathMultifolderNoOutdir/node/test.js index 088a77f3f259c..02aa0b24321fd 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathMultifolderNoOutdir/node/test.js +++ b/tests/baselines/reference/project/sourceRootRelativePathMultifolderNoOutdir/node/test.js @@ -1,7 +1,7 @@ /// /// var a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/sourceRootRelativePathMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/ref/m1.js b/tests/baselines/reference/project/sourceRootRelativePathMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/ref/m1.js index b7283f7fd8830..4293cda52dba5 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/ref/m1.js +++ b/tests/baselines/reference/project/sourceRootRelativePathMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/ref/m1.js @@ -1,5 +1,5 @@ var m1_a1 = 10; -var m1_c1 = (function () { +var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; diff --git a/tests/baselines/reference/project/sourceRootRelativePathMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/test.js b/tests/baselines/reference/project/sourceRootRelativePathMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/test.js index 088a77f3f259c..02aa0b24321fd 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/test.js +++ b/tests/baselines/reference/project/sourceRootRelativePathMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/test.js @@ -1,7 +1,7 @@ /// /// var a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/sourceRootRelativePathMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder_ref/m2.js b/tests/baselines/reference/project/sourceRootRelativePathMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder_ref/m2.js index a1041b6d258ef..4708e36c671ce 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder_ref/m2.js +++ b/tests/baselines/reference/project/sourceRootRelativePathMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder_ref/m2.js @@ -1,5 +1,5 @@ var m2_a1 = 10; -var m2_c1 = (function () { +var m2_c1 = /** @class */ (function () { function m2_c1() { } return m2_c1; diff --git a/tests/baselines/reference/project/sourceRootRelativePathMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/ref/m1.js b/tests/baselines/reference/project/sourceRootRelativePathMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/ref/m1.js index b7283f7fd8830..4293cda52dba5 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/ref/m1.js +++ b/tests/baselines/reference/project/sourceRootRelativePathMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/ref/m1.js @@ -1,5 +1,5 @@ var m1_a1 = 10; -var m1_c1 = (function () { +var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; diff --git a/tests/baselines/reference/project/sourceRootRelativePathMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/test.js b/tests/baselines/reference/project/sourceRootRelativePathMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/test.js index 088a77f3f259c..02aa0b24321fd 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/test.js +++ b/tests/baselines/reference/project/sourceRootRelativePathMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/test.js @@ -1,7 +1,7 @@ /// /// var a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/sourceRootRelativePathMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder_ref/m2.js b/tests/baselines/reference/project/sourceRootRelativePathMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder_ref/m2.js index a1041b6d258ef..4708e36c671ce 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder_ref/m2.js +++ b/tests/baselines/reference/project/sourceRootRelativePathMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder_ref/m2.js @@ -1,5 +1,5 @@ var m2_a1 = 10; -var m2_c1 = (function () { +var m2_c1 = /** @class */ (function () { function m2_c1() { } return m2_c1; diff --git a/tests/baselines/reference/project/sourceRootRelativePathMultifolderSpecifyOutputFile/amd/bin/test.js b/tests/baselines/reference/project/sourceRootRelativePathMultifolderSpecifyOutputFile/amd/bin/test.js index ad96cca3d7952..62f18329bd31e 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathMultifolderSpecifyOutputFile/amd/bin/test.js +++ b/tests/baselines/reference/project/sourceRootRelativePathMultifolderSpecifyOutputFile/amd/bin/test.js @@ -1,5 +1,5 @@ var m1_a1 = 10; -var m1_c1 = (function () { +var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; @@ -9,7 +9,7 @@ function m1_f1() { return m1_instance1; } var m2_a1 = 10; -var m2_c1 = (function () { +var m2_c1 = /** @class */ (function () { function m2_c1() { } return m2_c1; @@ -21,7 +21,7 @@ function m2_f1() { /// /// var a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/sourceRootRelativePathMultifolderSpecifyOutputFile/node/bin/test.js b/tests/baselines/reference/project/sourceRootRelativePathMultifolderSpecifyOutputFile/node/bin/test.js index ad96cca3d7952..62f18329bd31e 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathMultifolderSpecifyOutputFile/node/bin/test.js +++ b/tests/baselines/reference/project/sourceRootRelativePathMultifolderSpecifyOutputFile/node/bin/test.js @@ -1,5 +1,5 @@ var m1_a1 = 10; -var m1_c1 = (function () { +var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; @@ -9,7 +9,7 @@ function m1_f1() { return m1_instance1; } var m2_a1 = 10; -var m2_c1 = (function () { +var m2_c1 = /** @class */ (function () { function m2_c1() { } return m2_c1; @@ -21,7 +21,7 @@ function m2_f1() { /// /// var a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/sourceRootRelativePathSimpleNoOutdir/amd/m1.js b/tests/baselines/reference/project/sourceRootRelativePathSimpleNoOutdir/amd/m1.js index b7283f7fd8830..4293cda52dba5 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathSimpleNoOutdir/amd/m1.js +++ b/tests/baselines/reference/project/sourceRootRelativePathSimpleNoOutdir/amd/m1.js @@ -1,5 +1,5 @@ var m1_a1 = 10; -var m1_c1 = (function () { +var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; diff --git a/tests/baselines/reference/project/sourceRootRelativePathSimpleNoOutdir/amd/test.js b/tests/baselines/reference/project/sourceRootRelativePathSimpleNoOutdir/amd/test.js index 679b65b57336e..febaeedb0f144 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathSimpleNoOutdir/amd/test.js +++ b/tests/baselines/reference/project/sourceRootRelativePathSimpleNoOutdir/amd/test.js @@ -1,6 +1,6 @@ /// var a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/sourceRootRelativePathSimpleNoOutdir/node/m1.js b/tests/baselines/reference/project/sourceRootRelativePathSimpleNoOutdir/node/m1.js index b7283f7fd8830..4293cda52dba5 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathSimpleNoOutdir/node/m1.js +++ b/tests/baselines/reference/project/sourceRootRelativePathSimpleNoOutdir/node/m1.js @@ -1,5 +1,5 @@ var m1_a1 = 10; -var m1_c1 = (function () { +var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; diff --git a/tests/baselines/reference/project/sourceRootRelativePathSimpleNoOutdir/node/test.js b/tests/baselines/reference/project/sourceRootRelativePathSimpleNoOutdir/node/test.js index 679b65b57336e..febaeedb0f144 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathSimpleNoOutdir/node/test.js +++ b/tests/baselines/reference/project/sourceRootRelativePathSimpleNoOutdir/node/test.js @@ -1,6 +1,6 @@ /// var a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/sourceRootRelativePathSimpleSpecifyOutputDirectory/amd/outdir/simple/m1.js b/tests/baselines/reference/project/sourceRootRelativePathSimpleSpecifyOutputDirectory/amd/outdir/simple/m1.js index b7283f7fd8830..4293cda52dba5 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathSimpleSpecifyOutputDirectory/amd/outdir/simple/m1.js +++ b/tests/baselines/reference/project/sourceRootRelativePathSimpleSpecifyOutputDirectory/amd/outdir/simple/m1.js @@ -1,5 +1,5 @@ var m1_a1 = 10; -var m1_c1 = (function () { +var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; diff --git a/tests/baselines/reference/project/sourceRootRelativePathSimpleSpecifyOutputDirectory/amd/outdir/simple/test.js b/tests/baselines/reference/project/sourceRootRelativePathSimpleSpecifyOutputDirectory/amd/outdir/simple/test.js index 679b65b57336e..febaeedb0f144 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathSimpleSpecifyOutputDirectory/amd/outdir/simple/test.js +++ b/tests/baselines/reference/project/sourceRootRelativePathSimpleSpecifyOutputDirectory/amd/outdir/simple/test.js @@ -1,6 +1,6 @@ /// var a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/sourceRootRelativePathSimpleSpecifyOutputDirectory/node/outdir/simple/m1.js b/tests/baselines/reference/project/sourceRootRelativePathSimpleSpecifyOutputDirectory/node/outdir/simple/m1.js index b7283f7fd8830..4293cda52dba5 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathSimpleSpecifyOutputDirectory/node/outdir/simple/m1.js +++ b/tests/baselines/reference/project/sourceRootRelativePathSimpleSpecifyOutputDirectory/node/outdir/simple/m1.js @@ -1,5 +1,5 @@ var m1_a1 = 10; -var m1_c1 = (function () { +var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; diff --git a/tests/baselines/reference/project/sourceRootRelativePathSimpleSpecifyOutputDirectory/node/outdir/simple/test.js b/tests/baselines/reference/project/sourceRootRelativePathSimpleSpecifyOutputDirectory/node/outdir/simple/test.js index 679b65b57336e..febaeedb0f144 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathSimpleSpecifyOutputDirectory/node/outdir/simple/test.js +++ b/tests/baselines/reference/project/sourceRootRelativePathSimpleSpecifyOutputDirectory/node/outdir/simple/test.js @@ -1,6 +1,6 @@ /// var a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/sourceRootRelativePathSimpleSpecifyOutputFile/amd/bin/test.js b/tests/baselines/reference/project/sourceRootRelativePathSimpleSpecifyOutputFile/amd/bin/test.js index 481c10d1a06ad..8e0b6a1a8ff13 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathSimpleSpecifyOutputFile/amd/bin/test.js +++ b/tests/baselines/reference/project/sourceRootRelativePathSimpleSpecifyOutputFile/amd/bin/test.js @@ -1,5 +1,5 @@ var m1_a1 = 10; -var m1_c1 = (function () { +var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; @@ -10,7 +10,7 @@ function m1_f1() { } /// var a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/sourceRootRelativePathSimpleSpecifyOutputFile/node/bin/test.js b/tests/baselines/reference/project/sourceRootRelativePathSimpleSpecifyOutputFile/node/bin/test.js index 481c10d1a06ad..8e0b6a1a8ff13 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathSimpleSpecifyOutputFile/node/bin/test.js +++ b/tests/baselines/reference/project/sourceRootRelativePathSimpleSpecifyOutputFile/node/bin/test.js @@ -1,5 +1,5 @@ var m1_a1 = 10; -var m1_c1 = (function () { +var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; @@ -10,7 +10,7 @@ function m1_f1() { } /// var a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/sourceRootRelativePathSingleFileNoOutdir/amd/test.js b/tests/baselines/reference/project/sourceRootRelativePathSingleFileNoOutdir/amd/test.js index e5a1c12a7323d..eea2aa31cd4a1 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathSingleFileNoOutdir/amd/test.js +++ b/tests/baselines/reference/project/sourceRootRelativePathSingleFileNoOutdir/amd/test.js @@ -1,5 +1,5 @@ var a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/sourceRootRelativePathSingleFileNoOutdir/node/test.js b/tests/baselines/reference/project/sourceRootRelativePathSingleFileNoOutdir/node/test.js index e5a1c12a7323d..eea2aa31cd4a1 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathSingleFileNoOutdir/node/test.js +++ b/tests/baselines/reference/project/sourceRootRelativePathSingleFileNoOutdir/node/test.js @@ -1,5 +1,5 @@ var a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/sourceRootRelativePathSingleFileSpecifyOutputDirectory/amd/outdir/simple/test.js b/tests/baselines/reference/project/sourceRootRelativePathSingleFileSpecifyOutputDirectory/amd/outdir/simple/test.js index e5a1c12a7323d..eea2aa31cd4a1 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathSingleFileSpecifyOutputDirectory/amd/outdir/simple/test.js +++ b/tests/baselines/reference/project/sourceRootRelativePathSingleFileSpecifyOutputDirectory/amd/outdir/simple/test.js @@ -1,5 +1,5 @@ var a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/sourceRootRelativePathSingleFileSpecifyOutputDirectory/node/outdir/simple/test.js b/tests/baselines/reference/project/sourceRootRelativePathSingleFileSpecifyOutputDirectory/node/outdir/simple/test.js index e5a1c12a7323d..eea2aa31cd4a1 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathSingleFileSpecifyOutputDirectory/node/outdir/simple/test.js +++ b/tests/baselines/reference/project/sourceRootRelativePathSingleFileSpecifyOutputDirectory/node/outdir/simple/test.js @@ -1,5 +1,5 @@ var a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/sourceRootRelativePathSingleFileSpecifyOutputFile/amd/bin/test.js b/tests/baselines/reference/project/sourceRootRelativePathSingleFileSpecifyOutputFile/amd/bin/test.js index e5a1c12a7323d..eea2aa31cd4a1 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathSingleFileSpecifyOutputFile/amd/bin/test.js +++ b/tests/baselines/reference/project/sourceRootRelativePathSingleFileSpecifyOutputFile/amd/bin/test.js @@ -1,5 +1,5 @@ var a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/sourceRootRelativePathSingleFileSpecifyOutputFile/node/bin/test.js b/tests/baselines/reference/project/sourceRootRelativePathSingleFileSpecifyOutputFile/node/bin/test.js index e5a1c12a7323d..eea2aa31cd4a1 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathSingleFileSpecifyOutputFile/node/bin/test.js +++ b/tests/baselines/reference/project/sourceRootRelativePathSingleFileSpecifyOutputFile/node/bin/test.js @@ -1,5 +1,5 @@ var a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/sourceRootRelativePathSubfolderNoOutdir/amd/ref/m1.js b/tests/baselines/reference/project/sourceRootRelativePathSubfolderNoOutdir/amd/ref/m1.js index b7283f7fd8830..4293cda52dba5 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathSubfolderNoOutdir/amd/ref/m1.js +++ b/tests/baselines/reference/project/sourceRootRelativePathSubfolderNoOutdir/amd/ref/m1.js @@ -1,5 +1,5 @@ var m1_a1 = 10; -var m1_c1 = (function () { +var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; diff --git a/tests/baselines/reference/project/sourceRootRelativePathSubfolderNoOutdir/amd/test.js b/tests/baselines/reference/project/sourceRootRelativePathSubfolderNoOutdir/amd/test.js index 408b7e46f6182..72395b6e4c854 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathSubfolderNoOutdir/amd/test.js +++ b/tests/baselines/reference/project/sourceRootRelativePathSubfolderNoOutdir/amd/test.js @@ -1,6 +1,6 @@ /// var a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/sourceRootRelativePathSubfolderNoOutdir/node/ref/m1.js b/tests/baselines/reference/project/sourceRootRelativePathSubfolderNoOutdir/node/ref/m1.js index b7283f7fd8830..4293cda52dba5 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathSubfolderNoOutdir/node/ref/m1.js +++ b/tests/baselines/reference/project/sourceRootRelativePathSubfolderNoOutdir/node/ref/m1.js @@ -1,5 +1,5 @@ var m1_a1 = 10; -var m1_c1 = (function () { +var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; diff --git a/tests/baselines/reference/project/sourceRootRelativePathSubfolderNoOutdir/node/test.js b/tests/baselines/reference/project/sourceRootRelativePathSubfolderNoOutdir/node/test.js index 408b7e46f6182..72395b6e4c854 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathSubfolderNoOutdir/node/test.js +++ b/tests/baselines/reference/project/sourceRootRelativePathSubfolderNoOutdir/node/test.js @@ -1,6 +1,6 @@ /// var a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/sourceRootRelativePathSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js b/tests/baselines/reference/project/sourceRootRelativePathSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js index b7283f7fd8830..4293cda52dba5 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js +++ b/tests/baselines/reference/project/sourceRootRelativePathSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js @@ -1,5 +1,5 @@ var m1_a1 = 10; -var m1_c1 = (function () { +var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; diff --git a/tests/baselines/reference/project/sourceRootRelativePathSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js b/tests/baselines/reference/project/sourceRootRelativePathSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js index 408b7e46f6182..72395b6e4c854 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js +++ b/tests/baselines/reference/project/sourceRootRelativePathSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js @@ -1,6 +1,6 @@ /// var a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/sourceRootRelativePathSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js b/tests/baselines/reference/project/sourceRootRelativePathSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js index b7283f7fd8830..4293cda52dba5 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js +++ b/tests/baselines/reference/project/sourceRootRelativePathSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js @@ -1,5 +1,5 @@ var m1_a1 = 10; -var m1_c1 = (function () { +var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; diff --git a/tests/baselines/reference/project/sourceRootRelativePathSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js b/tests/baselines/reference/project/sourceRootRelativePathSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js index 408b7e46f6182..72395b6e4c854 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js +++ b/tests/baselines/reference/project/sourceRootRelativePathSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js @@ -1,6 +1,6 @@ /// var a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/sourceRootRelativePathSubfolderSpecifyOutputFile/amd/bin/test.js b/tests/baselines/reference/project/sourceRootRelativePathSubfolderSpecifyOutputFile/amd/bin/test.js index a456603674661..7c6145986c66a 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathSubfolderSpecifyOutputFile/amd/bin/test.js +++ b/tests/baselines/reference/project/sourceRootRelativePathSubfolderSpecifyOutputFile/amd/bin/test.js @@ -1,5 +1,5 @@ var m1_a1 = 10; -var m1_c1 = (function () { +var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; @@ -10,7 +10,7 @@ function m1_f1() { } /// var a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/sourceRootRelativePathSubfolderSpecifyOutputFile/node/bin/test.js b/tests/baselines/reference/project/sourceRootRelativePathSubfolderSpecifyOutputFile/node/bin/test.js index a456603674661..7c6145986c66a 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathSubfolderSpecifyOutputFile/node/bin/test.js +++ b/tests/baselines/reference/project/sourceRootRelativePathSubfolderSpecifyOutputFile/node/bin/test.js @@ -1,5 +1,5 @@ var m1_a1 = 10; -var m1_c1 = (function () { +var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; @@ -10,7 +10,7 @@ function m1_f1() { } /// var a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/sourcemapMixedSubfolderNoOutdir/amd/ref/m1.js b/tests/baselines/reference/project/sourcemapMixedSubfolderNoOutdir/amd/ref/m1.js index b7283f7fd8830..4293cda52dba5 100644 --- a/tests/baselines/reference/project/sourcemapMixedSubfolderNoOutdir/amd/ref/m1.js +++ b/tests/baselines/reference/project/sourcemapMixedSubfolderNoOutdir/amd/ref/m1.js @@ -1,5 +1,5 @@ var m1_a1 = 10; -var m1_c1 = (function () { +var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; diff --git a/tests/baselines/reference/project/sourcemapMixedSubfolderNoOutdir/amd/ref/m2.js b/tests/baselines/reference/project/sourcemapMixedSubfolderNoOutdir/amd/ref/m2.js index 08855ec797b4d..20d4b93990f3f 100644 --- a/tests/baselines/reference/project/sourcemapMixedSubfolderNoOutdir/amd/ref/m2.js +++ b/tests/baselines/reference/project/sourcemapMixedSubfolderNoOutdir/amd/ref/m2.js @@ -2,7 +2,7 @@ define(["require", "exports"], function (require, exports) { "use strict"; exports.__esModule = true; exports.m2_a1 = 10; - var m2_c1 = (function () { + var m2_c1 = /** @class */ (function () { function m2_c1() { } return m2_c1; diff --git a/tests/baselines/reference/project/sourcemapMixedSubfolderNoOutdir/amd/test.js b/tests/baselines/reference/project/sourcemapMixedSubfolderNoOutdir/amd/test.js index 78426750a82a2..020207321b363 100644 --- a/tests/baselines/reference/project/sourcemapMixedSubfolderNoOutdir/amd/test.js +++ b/tests/baselines/reference/project/sourcemapMixedSubfolderNoOutdir/amd/test.js @@ -1,7 +1,7 @@ /// /// var a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/sourcemapMixedSubfolderNoOutdir/node/ref/m1.js b/tests/baselines/reference/project/sourcemapMixedSubfolderNoOutdir/node/ref/m1.js index b7283f7fd8830..4293cda52dba5 100644 --- a/tests/baselines/reference/project/sourcemapMixedSubfolderNoOutdir/node/ref/m1.js +++ b/tests/baselines/reference/project/sourcemapMixedSubfolderNoOutdir/node/ref/m1.js @@ -1,5 +1,5 @@ var m1_a1 = 10; -var m1_c1 = (function () { +var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; diff --git a/tests/baselines/reference/project/sourcemapMixedSubfolderNoOutdir/node/ref/m2.js b/tests/baselines/reference/project/sourcemapMixedSubfolderNoOutdir/node/ref/m2.js index 8ad833cd4eba9..fca535956778f 100644 --- a/tests/baselines/reference/project/sourcemapMixedSubfolderNoOutdir/node/ref/m2.js +++ b/tests/baselines/reference/project/sourcemapMixedSubfolderNoOutdir/node/ref/m2.js @@ -1,7 +1,7 @@ "use strict"; exports.__esModule = true; exports.m2_a1 = 10; -var m2_c1 = (function () { +var m2_c1 = /** @class */ (function () { function m2_c1() { } return m2_c1; diff --git a/tests/baselines/reference/project/sourcemapMixedSubfolderNoOutdir/node/test.js b/tests/baselines/reference/project/sourcemapMixedSubfolderNoOutdir/node/test.js index 78426750a82a2..020207321b363 100644 --- a/tests/baselines/reference/project/sourcemapMixedSubfolderNoOutdir/node/test.js +++ b/tests/baselines/reference/project/sourcemapMixedSubfolderNoOutdir/node/test.js @@ -1,7 +1,7 @@ /// /// var a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js b/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js index b7283f7fd8830..4293cda52dba5 100644 --- a/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js +++ b/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js @@ -1,5 +1,5 @@ var m1_a1 = 10; -var m1_c1 = (function () { +var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; diff --git a/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m2.js b/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m2.js index 08855ec797b4d..20d4b93990f3f 100644 --- a/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m2.js +++ b/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m2.js @@ -2,7 +2,7 @@ define(["require", "exports"], function (require, exports) { "use strict"; exports.__esModule = true; exports.m2_a1 = 10; - var m2_c1 = (function () { + var m2_c1 = /** @class */ (function () { function m2_c1() { } return m2_c1; diff --git a/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js b/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js index 78426750a82a2..020207321b363 100644 --- a/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js +++ b/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js @@ -1,7 +1,7 @@ /// /// var a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js b/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js index b7283f7fd8830..4293cda52dba5 100644 --- a/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js +++ b/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js @@ -1,5 +1,5 @@ var m1_a1 = 10; -var m1_c1 = (function () { +var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; diff --git a/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m2.js b/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m2.js index 8ad833cd4eba9..fca535956778f 100644 --- a/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m2.js +++ b/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m2.js @@ -1,7 +1,7 @@ "use strict"; exports.__esModule = true; exports.m2_a1 = 10; -var m2_c1 = (function () { +var m2_c1 = /** @class */ (function () { function m2_c1() { } return m2_c1; diff --git a/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js b/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js index 78426750a82a2..020207321b363 100644 --- a/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js +++ b/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js @@ -1,7 +1,7 @@ /// /// var a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputFile/amd/bin/test.js b/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputFile/amd/bin/test.js index f070fff6f1cb8..6c4233ece096d 100644 --- a/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputFile/amd/bin/test.js +++ b/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputFile/amd/bin/test.js @@ -1,5 +1,5 @@ var m1_a1 = 10; -var m1_c1 = (function () { +var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; @@ -12,7 +12,7 @@ define("ref/m2", ["require", "exports"], function (require, exports) { "use strict"; exports.__esModule = true; exports.m2_a1 = 10; - var m2_c1 = (function () { + var m2_c1 = /** @class */ (function () { function m2_c1() { } return m2_c1; @@ -27,7 +27,7 @@ define("ref/m2", ["require", "exports"], function (require, exports) { /// /// var a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputFile/node/bin/test.js b/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputFile/node/bin/test.js index 5d63d624329e6..4aa1cc0efbdbb 100644 --- a/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputFile/node/bin/test.js +++ b/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputFile/node/bin/test.js @@ -1,5 +1,5 @@ var m1_a1 = 10; -var m1_c1 = (function () { +var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; @@ -11,7 +11,7 @@ function m1_f1() { /// /// var a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/bin/outAndOutDirFile.js b/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/bin/outAndOutDirFile.js index 3e02cc09fcb7a..7b02d52b57d72 100644 --- a/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/bin/outAndOutDirFile.js +++ b/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/bin/outAndOutDirFile.js @@ -1,5 +1,5 @@ var m1_a1 = 10; -var m1_c1 = (function () { +var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; @@ -12,7 +12,7 @@ define("ref/m2", ["require", "exports"], function (require, exports) { "use strict"; exports.__esModule = true; exports.m2_a1 = 10; - var m2_c1 = (function () { + var m2_c1 = /** @class */ (function () { function m2_c1() { } return m2_c1; @@ -27,7 +27,7 @@ define("ref/m2", ["require", "exports"], function (require, exports) { /// /// var a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/bin/outAndOutDirFile.js b/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/bin/outAndOutDirFile.js index da6a20151434f..86b6ba19ae52a 100644 --- a/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/bin/outAndOutDirFile.js +++ b/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/bin/outAndOutDirFile.js @@ -1,5 +1,5 @@ var m1_a1 = 10; -var m1_c1 = (function () { +var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; @@ -11,7 +11,7 @@ function m1_f1() { /// /// var a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/sourcemapModuleMultifolderNoOutdir/amd/diskFile1.js b/tests/baselines/reference/project/sourcemapModuleMultifolderNoOutdir/amd/diskFile1.js index 08855ec797b4d..20d4b93990f3f 100644 --- a/tests/baselines/reference/project/sourcemapModuleMultifolderNoOutdir/amd/diskFile1.js +++ b/tests/baselines/reference/project/sourcemapModuleMultifolderNoOutdir/amd/diskFile1.js @@ -2,7 +2,7 @@ define(["require", "exports"], function (require, exports) { "use strict"; exports.__esModule = true; exports.m2_a1 = 10; - var m2_c1 = (function () { + var m2_c1 = /** @class */ (function () { function m2_c1() { } return m2_c1; diff --git a/tests/baselines/reference/project/sourcemapModuleMultifolderNoOutdir/amd/ref/m1.js b/tests/baselines/reference/project/sourcemapModuleMultifolderNoOutdir/amd/ref/m1.js index 391c6ef6630d8..3eb8a0f5dea2e 100644 --- a/tests/baselines/reference/project/sourcemapModuleMultifolderNoOutdir/amd/ref/m1.js +++ b/tests/baselines/reference/project/sourcemapModuleMultifolderNoOutdir/amd/ref/m1.js @@ -2,7 +2,7 @@ define(["require", "exports"], function (require, exports) { "use strict"; exports.__esModule = true; exports.m1_a1 = 10; - var m1_c1 = (function () { + var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; diff --git a/tests/baselines/reference/project/sourcemapModuleMultifolderNoOutdir/amd/test.js b/tests/baselines/reference/project/sourcemapModuleMultifolderNoOutdir/amd/test.js index 90f7f12fcb186..2d7e905faa44d 100644 --- a/tests/baselines/reference/project/sourcemapModuleMultifolderNoOutdir/amd/test.js +++ b/tests/baselines/reference/project/sourcemapModuleMultifolderNoOutdir/amd/test.js @@ -2,7 +2,7 @@ define(["require", "exports", "ref/m1", "../outputdir_module_multifolder_ref/m2" "use strict"; exports.__esModule = true; exports.a1 = 10; - var c1 = (function () { + var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/sourcemapModuleMultifolderNoOutdir/node/diskFile1.js b/tests/baselines/reference/project/sourcemapModuleMultifolderNoOutdir/node/diskFile1.js index 8ad833cd4eba9..fca535956778f 100644 --- a/tests/baselines/reference/project/sourcemapModuleMultifolderNoOutdir/node/diskFile1.js +++ b/tests/baselines/reference/project/sourcemapModuleMultifolderNoOutdir/node/diskFile1.js @@ -1,7 +1,7 @@ "use strict"; exports.__esModule = true; exports.m2_a1 = 10; -var m2_c1 = (function () { +var m2_c1 = /** @class */ (function () { function m2_c1() { } return m2_c1; diff --git a/tests/baselines/reference/project/sourcemapModuleMultifolderNoOutdir/node/ref/m1.js b/tests/baselines/reference/project/sourcemapModuleMultifolderNoOutdir/node/ref/m1.js index 02586d67fcc6d..2db985c931fd6 100644 --- a/tests/baselines/reference/project/sourcemapModuleMultifolderNoOutdir/node/ref/m1.js +++ b/tests/baselines/reference/project/sourcemapModuleMultifolderNoOutdir/node/ref/m1.js @@ -1,7 +1,7 @@ "use strict"; exports.__esModule = true; exports.m1_a1 = 10; -var m1_c1 = (function () { +var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; diff --git a/tests/baselines/reference/project/sourcemapModuleMultifolderNoOutdir/node/test.js b/tests/baselines/reference/project/sourcemapModuleMultifolderNoOutdir/node/test.js index 43d151f3fd963..2fbb4d7fc1ca4 100644 --- a/tests/baselines/reference/project/sourcemapModuleMultifolderNoOutdir/node/test.js +++ b/tests/baselines/reference/project/sourcemapModuleMultifolderNoOutdir/node/test.js @@ -3,7 +3,7 @@ exports.__esModule = true; var m1 = require("ref/m1"); var m2 = require("../outputdir_module_multifolder_ref/m2"); exports.a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/sourcemapModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder/ref/m1.js b/tests/baselines/reference/project/sourcemapModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder/ref/m1.js index 391c6ef6630d8..3eb8a0f5dea2e 100644 --- a/tests/baselines/reference/project/sourcemapModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder/ref/m1.js +++ b/tests/baselines/reference/project/sourcemapModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder/ref/m1.js @@ -2,7 +2,7 @@ define(["require", "exports"], function (require, exports) { "use strict"; exports.__esModule = true; exports.m1_a1 = 10; - var m1_c1 = (function () { + var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; diff --git a/tests/baselines/reference/project/sourcemapModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder/test.js b/tests/baselines/reference/project/sourcemapModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder/test.js index 90f7f12fcb186..2d7e905faa44d 100644 --- a/tests/baselines/reference/project/sourcemapModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder/test.js +++ b/tests/baselines/reference/project/sourcemapModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder/test.js @@ -2,7 +2,7 @@ define(["require", "exports", "ref/m1", "../outputdir_module_multifolder_ref/m2" "use strict"; exports.__esModule = true; exports.a1 = 10; - var c1 = (function () { + var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/sourcemapModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder_ref/m2.js b/tests/baselines/reference/project/sourcemapModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder_ref/m2.js index 08855ec797b4d..20d4b93990f3f 100644 --- a/tests/baselines/reference/project/sourcemapModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder_ref/m2.js +++ b/tests/baselines/reference/project/sourcemapModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder_ref/m2.js @@ -2,7 +2,7 @@ define(["require", "exports"], function (require, exports) { "use strict"; exports.__esModule = true; exports.m2_a1 = 10; - var m2_c1 = (function () { + var m2_c1 = /** @class */ (function () { function m2_c1() { } return m2_c1; diff --git a/tests/baselines/reference/project/sourcemapModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder/ref/m1.js b/tests/baselines/reference/project/sourcemapModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder/ref/m1.js index 02586d67fcc6d..2db985c931fd6 100644 --- a/tests/baselines/reference/project/sourcemapModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder/ref/m1.js +++ b/tests/baselines/reference/project/sourcemapModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder/ref/m1.js @@ -1,7 +1,7 @@ "use strict"; exports.__esModule = true; exports.m1_a1 = 10; -var m1_c1 = (function () { +var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; diff --git a/tests/baselines/reference/project/sourcemapModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder/test.js b/tests/baselines/reference/project/sourcemapModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder/test.js index 43d151f3fd963..2fbb4d7fc1ca4 100644 --- a/tests/baselines/reference/project/sourcemapModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder/test.js +++ b/tests/baselines/reference/project/sourcemapModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder/test.js @@ -3,7 +3,7 @@ exports.__esModule = true; var m1 = require("ref/m1"); var m2 = require("../outputdir_module_multifolder_ref/m2"); exports.a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/sourcemapModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder_ref/m2.js b/tests/baselines/reference/project/sourcemapModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder_ref/m2.js index 8ad833cd4eba9..fca535956778f 100644 --- a/tests/baselines/reference/project/sourcemapModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder_ref/m2.js +++ b/tests/baselines/reference/project/sourcemapModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder_ref/m2.js @@ -1,7 +1,7 @@ "use strict"; exports.__esModule = true; exports.m2_a1 = 10; -var m2_c1 = (function () { +var m2_c1 = /** @class */ (function () { function m2_c1() { } return m2_c1; diff --git a/tests/baselines/reference/project/sourcemapModuleMultifolderSpecifyOutputFile/amd/bin/test.js b/tests/baselines/reference/project/sourcemapModuleMultifolderSpecifyOutputFile/amd/bin/test.js index b77e0a462a773..6a566140109d1 100644 --- a/tests/baselines/reference/project/sourcemapModuleMultifolderSpecifyOutputFile/amd/bin/test.js +++ b/tests/baselines/reference/project/sourcemapModuleMultifolderSpecifyOutputFile/amd/bin/test.js @@ -2,7 +2,7 @@ define("outputdir_module_multifolder/ref/m1", ["require", "exports"], function ( "use strict"; exports.__esModule = true; exports.m1_a1 = 10; - var m1_c1 = (function () { + var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; @@ -18,7 +18,7 @@ define("outputdir_module_multifolder_ref/m2", ["require", "exports"], function ( "use strict"; exports.__esModule = true; exports.m2_a1 = 10; - var m2_c1 = (function () { + var m2_c1 = /** @class */ (function () { function m2_c1() { } return m2_c1; @@ -34,7 +34,7 @@ define("outputdir_module_multifolder/test", ["require", "exports", "outputdir_mo "use strict"; exports.__esModule = true; exports.a1 = 10; - var c1 = (function () { + var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/sourcemapModuleSimpleNoOutdir/amd/m1.js b/tests/baselines/reference/project/sourcemapModuleSimpleNoOutdir/amd/m1.js index 391c6ef6630d8..3eb8a0f5dea2e 100644 --- a/tests/baselines/reference/project/sourcemapModuleSimpleNoOutdir/amd/m1.js +++ b/tests/baselines/reference/project/sourcemapModuleSimpleNoOutdir/amd/m1.js @@ -2,7 +2,7 @@ define(["require", "exports"], function (require, exports) { "use strict"; exports.__esModule = true; exports.m1_a1 = 10; - var m1_c1 = (function () { + var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; diff --git a/tests/baselines/reference/project/sourcemapModuleSimpleNoOutdir/amd/test.js b/tests/baselines/reference/project/sourcemapModuleSimpleNoOutdir/amd/test.js index e5ed53fd0e1a2..d85c5bfa685a7 100644 --- a/tests/baselines/reference/project/sourcemapModuleSimpleNoOutdir/amd/test.js +++ b/tests/baselines/reference/project/sourcemapModuleSimpleNoOutdir/amd/test.js @@ -2,7 +2,7 @@ define(["require", "exports", "m1"], function (require, exports, m1) { "use strict"; exports.__esModule = true; exports.a1 = 10; - var c1 = (function () { + var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/sourcemapModuleSimpleNoOutdir/node/m1.js b/tests/baselines/reference/project/sourcemapModuleSimpleNoOutdir/node/m1.js index 02586d67fcc6d..2db985c931fd6 100644 --- a/tests/baselines/reference/project/sourcemapModuleSimpleNoOutdir/node/m1.js +++ b/tests/baselines/reference/project/sourcemapModuleSimpleNoOutdir/node/m1.js @@ -1,7 +1,7 @@ "use strict"; exports.__esModule = true; exports.m1_a1 = 10; -var m1_c1 = (function () { +var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; diff --git a/tests/baselines/reference/project/sourcemapModuleSimpleNoOutdir/node/test.js b/tests/baselines/reference/project/sourcemapModuleSimpleNoOutdir/node/test.js index 56c8debf9b699..ca22756bd6ee2 100644 --- a/tests/baselines/reference/project/sourcemapModuleSimpleNoOutdir/node/test.js +++ b/tests/baselines/reference/project/sourcemapModuleSimpleNoOutdir/node/test.js @@ -2,7 +2,7 @@ exports.__esModule = true; var m1 = require("m1"); exports.a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/sourcemapModuleSimpleSpecifyOutputDirectory/amd/outdir/simple/m1.js b/tests/baselines/reference/project/sourcemapModuleSimpleSpecifyOutputDirectory/amd/outdir/simple/m1.js index 391c6ef6630d8..3eb8a0f5dea2e 100644 --- a/tests/baselines/reference/project/sourcemapModuleSimpleSpecifyOutputDirectory/amd/outdir/simple/m1.js +++ b/tests/baselines/reference/project/sourcemapModuleSimpleSpecifyOutputDirectory/amd/outdir/simple/m1.js @@ -2,7 +2,7 @@ define(["require", "exports"], function (require, exports) { "use strict"; exports.__esModule = true; exports.m1_a1 = 10; - var m1_c1 = (function () { + var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; diff --git a/tests/baselines/reference/project/sourcemapModuleSimpleSpecifyOutputDirectory/amd/outdir/simple/test.js b/tests/baselines/reference/project/sourcemapModuleSimpleSpecifyOutputDirectory/amd/outdir/simple/test.js index e5ed53fd0e1a2..d85c5bfa685a7 100644 --- a/tests/baselines/reference/project/sourcemapModuleSimpleSpecifyOutputDirectory/amd/outdir/simple/test.js +++ b/tests/baselines/reference/project/sourcemapModuleSimpleSpecifyOutputDirectory/amd/outdir/simple/test.js @@ -2,7 +2,7 @@ define(["require", "exports", "m1"], function (require, exports, m1) { "use strict"; exports.__esModule = true; exports.a1 = 10; - var c1 = (function () { + var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/sourcemapModuleSimpleSpecifyOutputDirectory/node/outdir/simple/m1.js b/tests/baselines/reference/project/sourcemapModuleSimpleSpecifyOutputDirectory/node/outdir/simple/m1.js index 02586d67fcc6d..2db985c931fd6 100644 --- a/tests/baselines/reference/project/sourcemapModuleSimpleSpecifyOutputDirectory/node/outdir/simple/m1.js +++ b/tests/baselines/reference/project/sourcemapModuleSimpleSpecifyOutputDirectory/node/outdir/simple/m1.js @@ -1,7 +1,7 @@ "use strict"; exports.__esModule = true; exports.m1_a1 = 10; -var m1_c1 = (function () { +var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; diff --git a/tests/baselines/reference/project/sourcemapModuleSimpleSpecifyOutputDirectory/node/outdir/simple/test.js b/tests/baselines/reference/project/sourcemapModuleSimpleSpecifyOutputDirectory/node/outdir/simple/test.js index 56c8debf9b699..ca22756bd6ee2 100644 --- a/tests/baselines/reference/project/sourcemapModuleSimpleSpecifyOutputDirectory/node/outdir/simple/test.js +++ b/tests/baselines/reference/project/sourcemapModuleSimpleSpecifyOutputDirectory/node/outdir/simple/test.js @@ -2,7 +2,7 @@ exports.__esModule = true; var m1 = require("m1"); exports.a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/sourcemapModuleSimpleSpecifyOutputFile/amd/bin/test.js b/tests/baselines/reference/project/sourcemapModuleSimpleSpecifyOutputFile/amd/bin/test.js index cbe79e3318b88..59d09316642a9 100644 --- a/tests/baselines/reference/project/sourcemapModuleSimpleSpecifyOutputFile/amd/bin/test.js +++ b/tests/baselines/reference/project/sourcemapModuleSimpleSpecifyOutputFile/amd/bin/test.js @@ -2,7 +2,7 @@ define("m1", ["require", "exports"], function (require, exports) { "use strict"; exports.__esModule = true; exports.m1_a1 = 10; - var m1_c1 = (function () { + var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; @@ -18,7 +18,7 @@ define("test", ["require", "exports", "m1"], function (require, exports, m1) { "use strict"; exports.__esModule = true; exports.a1 = 10; - var c1 = (function () { + var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/sourcemapModuleSubfolderNoOutdir/amd/ref/m1.js b/tests/baselines/reference/project/sourcemapModuleSubfolderNoOutdir/amd/ref/m1.js index 391c6ef6630d8..3eb8a0f5dea2e 100644 --- a/tests/baselines/reference/project/sourcemapModuleSubfolderNoOutdir/amd/ref/m1.js +++ b/tests/baselines/reference/project/sourcemapModuleSubfolderNoOutdir/amd/ref/m1.js @@ -2,7 +2,7 @@ define(["require", "exports"], function (require, exports) { "use strict"; exports.__esModule = true; exports.m1_a1 = 10; - var m1_c1 = (function () { + var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; diff --git a/tests/baselines/reference/project/sourcemapModuleSubfolderNoOutdir/amd/test.js b/tests/baselines/reference/project/sourcemapModuleSubfolderNoOutdir/amd/test.js index c95451ac730f8..efe432ad6fb5b 100644 --- a/tests/baselines/reference/project/sourcemapModuleSubfolderNoOutdir/amd/test.js +++ b/tests/baselines/reference/project/sourcemapModuleSubfolderNoOutdir/amd/test.js @@ -2,7 +2,7 @@ define(["require", "exports", "ref/m1"], function (require, exports, m1) { "use strict"; exports.__esModule = true; exports.a1 = 10; - var c1 = (function () { + var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/sourcemapModuleSubfolderNoOutdir/node/ref/m1.js b/tests/baselines/reference/project/sourcemapModuleSubfolderNoOutdir/node/ref/m1.js index 02586d67fcc6d..2db985c931fd6 100644 --- a/tests/baselines/reference/project/sourcemapModuleSubfolderNoOutdir/node/ref/m1.js +++ b/tests/baselines/reference/project/sourcemapModuleSubfolderNoOutdir/node/ref/m1.js @@ -1,7 +1,7 @@ "use strict"; exports.__esModule = true; exports.m1_a1 = 10; -var m1_c1 = (function () { +var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; diff --git a/tests/baselines/reference/project/sourcemapModuleSubfolderNoOutdir/node/test.js b/tests/baselines/reference/project/sourcemapModuleSubfolderNoOutdir/node/test.js index 97ca26f319840..d90be1b614115 100644 --- a/tests/baselines/reference/project/sourcemapModuleSubfolderNoOutdir/node/test.js +++ b/tests/baselines/reference/project/sourcemapModuleSubfolderNoOutdir/node/test.js @@ -2,7 +2,7 @@ exports.__esModule = true; var m1 = require("ref/m1"); exports.a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/sourcemapModuleSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js b/tests/baselines/reference/project/sourcemapModuleSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js index 391c6ef6630d8..3eb8a0f5dea2e 100644 --- a/tests/baselines/reference/project/sourcemapModuleSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js +++ b/tests/baselines/reference/project/sourcemapModuleSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js @@ -2,7 +2,7 @@ define(["require", "exports"], function (require, exports) { "use strict"; exports.__esModule = true; exports.m1_a1 = 10; - var m1_c1 = (function () { + var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; diff --git a/tests/baselines/reference/project/sourcemapModuleSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js b/tests/baselines/reference/project/sourcemapModuleSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js index c95451ac730f8..efe432ad6fb5b 100644 --- a/tests/baselines/reference/project/sourcemapModuleSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js +++ b/tests/baselines/reference/project/sourcemapModuleSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js @@ -2,7 +2,7 @@ define(["require", "exports", "ref/m1"], function (require, exports, m1) { "use strict"; exports.__esModule = true; exports.a1 = 10; - var c1 = (function () { + var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/sourcemapModuleSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js b/tests/baselines/reference/project/sourcemapModuleSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js index 02586d67fcc6d..2db985c931fd6 100644 --- a/tests/baselines/reference/project/sourcemapModuleSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js +++ b/tests/baselines/reference/project/sourcemapModuleSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js @@ -1,7 +1,7 @@ "use strict"; exports.__esModule = true; exports.m1_a1 = 10; -var m1_c1 = (function () { +var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; diff --git a/tests/baselines/reference/project/sourcemapModuleSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js b/tests/baselines/reference/project/sourcemapModuleSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js index 97ca26f319840..d90be1b614115 100644 --- a/tests/baselines/reference/project/sourcemapModuleSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js +++ b/tests/baselines/reference/project/sourcemapModuleSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js @@ -2,7 +2,7 @@ exports.__esModule = true; var m1 = require("ref/m1"); exports.a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/sourcemapModuleSubfolderSpecifyOutputFile/amd/bin/test.js b/tests/baselines/reference/project/sourcemapModuleSubfolderSpecifyOutputFile/amd/bin/test.js index 22a9cf7b4d73d..91d7134f7a2c4 100644 --- a/tests/baselines/reference/project/sourcemapModuleSubfolderSpecifyOutputFile/amd/bin/test.js +++ b/tests/baselines/reference/project/sourcemapModuleSubfolderSpecifyOutputFile/amd/bin/test.js @@ -2,7 +2,7 @@ define("ref/m1", ["require", "exports"], function (require, exports) { "use strict"; exports.__esModule = true; exports.m1_a1 = 10; - var m1_c1 = (function () { + var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; @@ -18,7 +18,7 @@ define("test", ["require", "exports", "ref/m1"], function (require, exports, m1) "use strict"; exports.__esModule = true; exports.a1 = 10; - var c1 = (function () { + var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/sourcemapMultifolderNoOutdir/amd/diskFile1.js b/tests/baselines/reference/project/sourcemapMultifolderNoOutdir/amd/diskFile1.js index a1041b6d258ef..4708e36c671ce 100644 --- a/tests/baselines/reference/project/sourcemapMultifolderNoOutdir/amd/diskFile1.js +++ b/tests/baselines/reference/project/sourcemapMultifolderNoOutdir/amd/diskFile1.js @@ -1,5 +1,5 @@ var m2_a1 = 10; -var m2_c1 = (function () { +var m2_c1 = /** @class */ (function () { function m2_c1() { } return m2_c1; diff --git a/tests/baselines/reference/project/sourcemapMultifolderNoOutdir/amd/ref/m1.js b/tests/baselines/reference/project/sourcemapMultifolderNoOutdir/amd/ref/m1.js index b7283f7fd8830..4293cda52dba5 100644 --- a/tests/baselines/reference/project/sourcemapMultifolderNoOutdir/amd/ref/m1.js +++ b/tests/baselines/reference/project/sourcemapMultifolderNoOutdir/amd/ref/m1.js @@ -1,5 +1,5 @@ var m1_a1 = 10; -var m1_c1 = (function () { +var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; diff --git a/tests/baselines/reference/project/sourcemapMultifolderNoOutdir/amd/test.js b/tests/baselines/reference/project/sourcemapMultifolderNoOutdir/amd/test.js index 088a77f3f259c..02aa0b24321fd 100644 --- a/tests/baselines/reference/project/sourcemapMultifolderNoOutdir/amd/test.js +++ b/tests/baselines/reference/project/sourcemapMultifolderNoOutdir/amd/test.js @@ -1,7 +1,7 @@ /// /// var a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/sourcemapMultifolderNoOutdir/node/diskFile1.js b/tests/baselines/reference/project/sourcemapMultifolderNoOutdir/node/diskFile1.js index a1041b6d258ef..4708e36c671ce 100644 --- a/tests/baselines/reference/project/sourcemapMultifolderNoOutdir/node/diskFile1.js +++ b/tests/baselines/reference/project/sourcemapMultifolderNoOutdir/node/diskFile1.js @@ -1,5 +1,5 @@ var m2_a1 = 10; -var m2_c1 = (function () { +var m2_c1 = /** @class */ (function () { function m2_c1() { } return m2_c1; diff --git a/tests/baselines/reference/project/sourcemapMultifolderNoOutdir/node/ref/m1.js b/tests/baselines/reference/project/sourcemapMultifolderNoOutdir/node/ref/m1.js index b7283f7fd8830..4293cda52dba5 100644 --- a/tests/baselines/reference/project/sourcemapMultifolderNoOutdir/node/ref/m1.js +++ b/tests/baselines/reference/project/sourcemapMultifolderNoOutdir/node/ref/m1.js @@ -1,5 +1,5 @@ var m1_a1 = 10; -var m1_c1 = (function () { +var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; diff --git a/tests/baselines/reference/project/sourcemapMultifolderNoOutdir/node/test.js b/tests/baselines/reference/project/sourcemapMultifolderNoOutdir/node/test.js index 088a77f3f259c..02aa0b24321fd 100644 --- a/tests/baselines/reference/project/sourcemapMultifolderNoOutdir/node/test.js +++ b/tests/baselines/reference/project/sourcemapMultifolderNoOutdir/node/test.js @@ -1,7 +1,7 @@ /// /// var a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/sourcemapMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/ref/m1.js b/tests/baselines/reference/project/sourcemapMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/ref/m1.js index b7283f7fd8830..4293cda52dba5 100644 --- a/tests/baselines/reference/project/sourcemapMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/ref/m1.js +++ b/tests/baselines/reference/project/sourcemapMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/ref/m1.js @@ -1,5 +1,5 @@ var m1_a1 = 10; -var m1_c1 = (function () { +var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; diff --git a/tests/baselines/reference/project/sourcemapMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/test.js b/tests/baselines/reference/project/sourcemapMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/test.js index 088a77f3f259c..02aa0b24321fd 100644 --- a/tests/baselines/reference/project/sourcemapMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/test.js +++ b/tests/baselines/reference/project/sourcemapMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/test.js @@ -1,7 +1,7 @@ /// /// var a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/sourcemapMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder_ref/m2.js b/tests/baselines/reference/project/sourcemapMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder_ref/m2.js index a1041b6d258ef..4708e36c671ce 100644 --- a/tests/baselines/reference/project/sourcemapMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder_ref/m2.js +++ b/tests/baselines/reference/project/sourcemapMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder_ref/m2.js @@ -1,5 +1,5 @@ var m2_a1 = 10; -var m2_c1 = (function () { +var m2_c1 = /** @class */ (function () { function m2_c1() { } return m2_c1; diff --git a/tests/baselines/reference/project/sourcemapMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/ref/m1.js b/tests/baselines/reference/project/sourcemapMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/ref/m1.js index b7283f7fd8830..4293cda52dba5 100644 --- a/tests/baselines/reference/project/sourcemapMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/ref/m1.js +++ b/tests/baselines/reference/project/sourcemapMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/ref/m1.js @@ -1,5 +1,5 @@ var m1_a1 = 10; -var m1_c1 = (function () { +var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; diff --git a/tests/baselines/reference/project/sourcemapMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/test.js b/tests/baselines/reference/project/sourcemapMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/test.js index 088a77f3f259c..02aa0b24321fd 100644 --- a/tests/baselines/reference/project/sourcemapMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/test.js +++ b/tests/baselines/reference/project/sourcemapMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/test.js @@ -1,7 +1,7 @@ /// /// var a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/sourcemapMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder_ref/m2.js b/tests/baselines/reference/project/sourcemapMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder_ref/m2.js index a1041b6d258ef..4708e36c671ce 100644 --- a/tests/baselines/reference/project/sourcemapMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder_ref/m2.js +++ b/tests/baselines/reference/project/sourcemapMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder_ref/m2.js @@ -1,5 +1,5 @@ var m2_a1 = 10; -var m2_c1 = (function () { +var m2_c1 = /** @class */ (function () { function m2_c1() { } return m2_c1; diff --git a/tests/baselines/reference/project/sourcemapMultifolderSpecifyOutputFile/amd/bin/test.js b/tests/baselines/reference/project/sourcemapMultifolderSpecifyOutputFile/amd/bin/test.js index ad96cca3d7952..62f18329bd31e 100644 --- a/tests/baselines/reference/project/sourcemapMultifolderSpecifyOutputFile/amd/bin/test.js +++ b/tests/baselines/reference/project/sourcemapMultifolderSpecifyOutputFile/amd/bin/test.js @@ -1,5 +1,5 @@ var m1_a1 = 10; -var m1_c1 = (function () { +var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; @@ -9,7 +9,7 @@ function m1_f1() { return m1_instance1; } var m2_a1 = 10; -var m2_c1 = (function () { +var m2_c1 = /** @class */ (function () { function m2_c1() { } return m2_c1; @@ -21,7 +21,7 @@ function m2_f1() { /// /// var a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/sourcemapMultifolderSpecifyOutputFile/node/bin/test.js b/tests/baselines/reference/project/sourcemapMultifolderSpecifyOutputFile/node/bin/test.js index ad96cca3d7952..62f18329bd31e 100644 --- a/tests/baselines/reference/project/sourcemapMultifolderSpecifyOutputFile/node/bin/test.js +++ b/tests/baselines/reference/project/sourcemapMultifolderSpecifyOutputFile/node/bin/test.js @@ -1,5 +1,5 @@ var m1_a1 = 10; -var m1_c1 = (function () { +var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; @@ -9,7 +9,7 @@ function m1_f1() { return m1_instance1; } var m2_a1 = 10; -var m2_c1 = (function () { +var m2_c1 = /** @class */ (function () { function m2_c1() { } return m2_c1; @@ -21,7 +21,7 @@ function m2_f1() { /// /// var a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/sourcemapSimpleNoOutdir/amd/m1.js b/tests/baselines/reference/project/sourcemapSimpleNoOutdir/amd/m1.js index b7283f7fd8830..4293cda52dba5 100644 --- a/tests/baselines/reference/project/sourcemapSimpleNoOutdir/amd/m1.js +++ b/tests/baselines/reference/project/sourcemapSimpleNoOutdir/amd/m1.js @@ -1,5 +1,5 @@ var m1_a1 = 10; -var m1_c1 = (function () { +var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; diff --git a/tests/baselines/reference/project/sourcemapSimpleNoOutdir/amd/test.js b/tests/baselines/reference/project/sourcemapSimpleNoOutdir/amd/test.js index 679b65b57336e..febaeedb0f144 100644 --- a/tests/baselines/reference/project/sourcemapSimpleNoOutdir/amd/test.js +++ b/tests/baselines/reference/project/sourcemapSimpleNoOutdir/amd/test.js @@ -1,6 +1,6 @@ /// var a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/sourcemapSimpleNoOutdir/node/m1.js b/tests/baselines/reference/project/sourcemapSimpleNoOutdir/node/m1.js index b7283f7fd8830..4293cda52dba5 100644 --- a/tests/baselines/reference/project/sourcemapSimpleNoOutdir/node/m1.js +++ b/tests/baselines/reference/project/sourcemapSimpleNoOutdir/node/m1.js @@ -1,5 +1,5 @@ var m1_a1 = 10; -var m1_c1 = (function () { +var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; diff --git a/tests/baselines/reference/project/sourcemapSimpleNoOutdir/node/test.js b/tests/baselines/reference/project/sourcemapSimpleNoOutdir/node/test.js index 679b65b57336e..febaeedb0f144 100644 --- a/tests/baselines/reference/project/sourcemapSimpleNoOutdir/node/test.js +++ b/tests/baselines/reference/project/sourcemapSimpleNoOutdir/node/test.js @@ -1,6 +1,6 @@ /// var a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/sourcemapSimpleSpecifyOutputDirectory/amd/outdir/simple/m1.js b/tests/baselines/reference/project/sourcemapSimpleSpecifyOutputDirectory/amd/outdir/simple/m1.js index b7283f7fd8830..4293cda52dba5 100644 --- a/tests/baselines/reference/project/sourcemapSimpleSpecifyOutputDirectory/amd/outdir/simple/m1.js +++ b/tests/baselines/reference/project/sourcemapSimpleSpecifyOutputDirectory/amd/outdir/simple/m1.js @@ -1,5 +1,5 @@ var m1_a1 = 10; -var m1_c1 = (function () { +var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; diff --git a/tests/baselines/reference/project/sourcemapSimpleSpecifyOutputDirectory/amd/outdir/simple/test.js b/tests/baselines/reference/project/sourcemapSimpleSpecifyOutputDirectory/amd/outdir/simple/test.js index 679b65b57336e..febaeedb0f144 100644 --- a/tests/baselines/reference/project/sourcemapSimpleSpecifyOutputDirectory/amd/outdir/simple/test.js +++ b/tests/baselines/reference/project/sourcemapSimpleSpecifyOutputDirectory/amd/outdir/simple/test.js @@ -1,6 +1,6 @@ /// var a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/sourcemapSimpleSpecifyOutputDirectory/node/outdir/simple/m1.js b/tests/baselines/reference/project/sourcemapSimpleSpecifyOutputDirectory/node/outdir/simple/m1.js index b7283f7fd8830..4293cda52dba5 100644 --- a/tests/baselines/reference/project/sourcemapSimpleSpecifyOutputDirectory/node/outdir/simple/m1.js +++ b/tests/baselines/reference/project/sourcemapSimpleSpecifyOutputDirectory/node/outdir/simple/m1.js @@ -1,5 +1,5 @@ var m1_a1 = 10; -var m1_c1 = (function () { +var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; diff --git a/tests/baselines/reference/project/sourcemapSimpleSpecifyOutputDirectory/node/outdir/simple/test.js b/tests/baselines/reference/project/sourcemapSimpleSpecifyOutputDirectory/node/outdir/simple/test.js index 679b65b57336e..febaeedb0f144 100644 --- a/tests/baselines/reference/project/sourcemapSimpleSpecifyOutputDirectory/node/outdir/simple/test.js +++ b/tests/baselines/reference/project/sourcemapSimpleSpecifyOutputDirectory/node/outdir/simple/test.js @@ -1,6 +1,6 @@ /// var a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/sourcemapSimpleSpecifyOutputFile/amd/bin/test.js b/tests/baselines/reference/project/sourcemapSimpleSpecifyOutputFile/amd/bin/test.js index 481c10d1a06ad..8e0b6a1a8ff13 100644 --- a/tests/baselines/reference/project/sourcemapSimpleSpecifyOutputFile/amd/bin/test.js +++ b/tests/baselines/reference/project/sourcemapSimpleSpecifyOutputFile/amd/bin/test.js @@ -1,5 +1,5 @@ var m1_a1 = 10; -var m1_c1 = (function () { +var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; @@ -10,7 +10,7 @@ function m1_f1() { } /// var a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/sourcemapSimpleSpecifyOutputFile/node/bin/test.js b/tests/baselines/reference/project/sourcemapSimpleSpecifyOutputFile/node/bin/test.js index 481c10d1a06ad..8e0b6a1a8ff13 100644 --- a/tests/baselines/reference/project/sourcemapSimpleSpecifyOutputFile/node/bin/test.js +++ b/tests/baselines/reference/project/sourcemapSimpleSpecifyOutputFile/node/bin/test.js @@ -1,5 +1,5 @@ var m1_a1 = 10; -var m1_c1 = (function () { +var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; @@ -10,7 +10,7 @@ function m1_f1() { } /// var a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/sourcemapSingleFileNoOutdir/amd/test.js b/tests/baselines/reference/project/sourcemapSingleFileNoOutdir/amd/test.js index e5a1c12a7323d..eea2aa31cd4a1 100644 --- a/tests/baselines/reference/project/sourcemapSingleFileNoOutdir/amd/test.js +++ b/tests/baselines/reference/project/sourcemapSingleFileNoOutdir/amd/test.js @@ -1,5 +1,5 @@ var a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/sourcemapSingleFileNoOutdir/node/test.js b/tests/baselines/reference/project/sourcemapSingleFileNoOutdir/node/test.js index e5a1c12a7323d..eea2aa31cd4a1 100644 --- a/tests/baselines/reference/project/sourcemapSingleFileNoOutdir/node/test.js +++ b/tests/baselines/reference/project/sourcemapSingleFileNoOutdir/node/test.js @@ -1,5 +1,5 @@ var a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/sourcemapSingleFileSpecifyOutputDirectory/amd/outdir/simple/test.js b/tests/baselines/reference/project/sourcemapSingleFileSpecifyOutputDirectory/amd/outdir/simple/test.js index e5a1c12a7323d..eea2aa31cd4a1 100644 --- a/tests/baselines/reference/project/sourcemapSingleFileSpecifyOutputDirectory/amd/outdir/simple/test.js +++ b/tests/baselines/reference/project/sourcemapSingleFileSpecifyOutputDirectory/amd/outdir/simple/test.js @@ -1,5 +1,5 @@ var a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/sourcemapSingleFileSpecifyOutputDirectory/node/outdir/simple/test.js b/tests/baselines/reference/project/sourcemapSingleFileSpecifyOutputDirectory/node/outdir/simple/test.js index e5a1c12a7323d..eea2aa31cd4a1 100644 --- a/tests/baselines/reference/project/sourcemapSingleFileSpecifyOutputDirectory/node/outdir/simple/test.js +++ b/tests/baselines/reference/project/sourcemapSingleFileSpecifyOutputDirectory/node/outdir/simple/test.js @@ -1,5 +1,5 @@ var a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/sourcemapSingleFileSpecifyOutputFile/amd/bin/test.js b/tests/baselines/reference/project/sourcemapSingleFileSpecifyOutputFile/amd/bin/test.js index e5a1c12a7323d..eea2aa31cd4a1 100644 --- a/tests/baselines/reference/project/sourcemapSingleFileSpecifyOutputFile/amd/bin/test.js +++ b/tests/baselines/reference/project/sourcemapSingleFileSpecifyOutputFile/amd/bin/test.js @@ -1,5 +1,5 @@ var a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/sourcemapSingleFileSpecifyOutputFile/node/bin/test.js b/tests/baselines/reference/project/sourcemapSingleFileSpecifyOutputFile/node/bin/test.js index e5a1c12a7323d..eea2aa31cd4a1 100644 --- a/tests/baselines/reference/project/sourcemapSingleFileSpecifyOutputFile/node/bin/test.js +++ b/tests/baselines/reference/project/sourcemapSingleFileSpecifyOutputFile/node/bin/test.js @@ -1,5 +1,5 @@ var a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/sourcemapSubfolderNoOutdir/amd/ref/m1.js b/tests/baselines/reference/project/sourcemapSubfolderNoOutdir/amd/ref/m1.js index b7283f7fd8830..4293cda52dba5 100644 --- a/tests/baselines/reference/project/sourcemapSubfolderNoOutdir/amd/ref/m1.js +++ b/tests/baselines/reference/project/sourcemapSubfolderNoOutdir/amd/ref/m1.js @@ -1,5 +1,5 @@ var m1_a1 = 10; -var m1_c1 = (function () { +var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; diff --git a/tests/baselines/reference/project/sourcemapSubfolderNoOutdir/amd/test.js b/tests/baselines/reference/project/sourcemapSubfolderNoOutdir/amd/test.js index 408b7e46f6182..72395b6e4c854 100644 --- a/tests/baselines/reference/project/sourcemapSubfolderNoOutdir/amd/test.js +++ b/tests/baselines/reference/project/sourcemapSubfolderNoOutdir/amd/test.js @@ -1,6 +1,6 @@ /// var a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/sourcemapSubfolderNoOutdir/node/ref/m1.js b/tests/baselines/reference/project/sourcemapSubfolderNoOutdir/node/ref/m1.js index b7283f7fd8830..4293cda52dba5 100644 --- a/tests/baselines/reference/project/sourcemapSubfolderNoOutdir/node/ref/m1.js +++ b/tests/baselines/reference/project/sourcemapSubfolderNoOutdir/node/ref/m1.js @@ -1,5 +1,5 @@ var m1_a1 = 10; -var m1_c1 = (function () { +var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; diff --git a/tests/baselines/reference/project/sourcemapSubfolderNoOutdir/node/test.js b/tests/baselines/reference/project/sourcemapSubfolderNoOutdir/node/test.js index 408b7e46f6182..72395b6e4c854 100644 --- a/tests/baselines/reference/project/sourcemapSubfolderNoOutdir/node/test.js +++ b/tests/baselines/reference/project/sourcemapSubfolderNoOutdir/node/test.js @@ -1,6 +1,6 @@ /// var a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/sourcemapSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js b/tests/baselines/reference/project/sourcemapSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js index b7283f7fd8830..4293cda52dba5 100644 --- a/tests/baselines/reference/project/sourcemapSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js +++ b/tests/baselines/reference/project/sourcemapSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js @@ -1,5 +1,5 @@ var m1_a1 = 10; -var m1_c1 = (function () { +var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; diff --git a/tests/baselines/reference/project/sourcemapSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js b/tests/baselines/reference/project/sourcemapSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js index 408b7e46f6182..72395b6e4c854 100644 --- a/tests/baselines/reference/project/sourcemapSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js +++ b/tests/baselines/reference/project/sourcemapSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js @@ -1,6 +1,6 @@ /// var a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/sourcemapSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js b/tests/baselines/reference/project/sourcemapSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js index b7283f7fd8830..4293cda52dba5 100644 --- a/tests/baselines/reference/project/sourcemapSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js +++ b/tests/baselines/reference/project/sourcemapSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js @@ -1,5 +1,5 @@ var m1_a1 = 10; -var m1_c1 = (function () { +var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; diff --git a/tests/baselines/reference/project/sourcemapSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js b/tests/baselines/reference/project/sourcemapSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js index 408b7e46f6182..72395b6e4c854 100644 --- a/tests/baselines/reference/project/sourcemapSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js +++ b/tests/baselines/reference/project/sourcemapSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js @@ -1,6 +1,6 @@ /// var a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/sourcemapSubfolderSpecifyOutputFile/amd/bin/test.js b/tests/baselines/reference/project/sourcemapSubfolderSpecifyOutputFile/amd/bin/test.js index a456603674661..7c6145986c66a 100644 --- a/tests/baselines/reference/project/sourcemapSubfolderSpecifyOutputFile/amd/bin/test.js +++ b/tests/baselines/reference/project/sourcemapSubfolderSpecifyOutputFile/amd/bin/test.js @@ -1,5 +1,5 @@ var m1_a1 = 10; -var m1_c1 = (function () { +var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; @@ -10,7 +10,7 @@ function m1_f1() { } /// var a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/sourcemapSubfolderSpecifyOutputFile/node/bin/test.js b/tests/baselines/reference/project/sourcemapSubfolderSpecifyOutputFile/node/bin/test.js index a456603674661..7c6145986c66a 100644 --- a/tests/baselines/reference/project/sourcemapSubfolderSpecifyOutputFile/node/bin/test.js +++ b/tests/baselines/reference/project/sourcemapSubfolderSpecifyOutputFile/node/bin/test.js @@ -1,5 +1,5 @@ var m1_a1 = 10; -var m1_c1 = (function () { +var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; @@ -10,7 +10,7 @@ function m1_f1() { } /// var a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/sourcerootUrlMixedSubfolderNoOutdir/amd/ref/m1.js b/tests/baselines/reference/project/sourcerootUrlMixedSubfolderNoOutdir/amd/ref/m1.js index b7283f7fd8830..4293cda52dba5 100644 --- a/tests/baselines/reference/project/sourcerootUrlMixedSubfolderNoOutdir/amd/ref/m1.js +++ b/tests/baselines/reference/project/sourcerootUrlMixedSubfolderNoOutdir/amd/ref/m1.js @@ -1,5 +1,5 @@ var m1_a1 = 10; -var m1_c1 = (function () { +var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; diff --git a/tests/baselines/reference/project/sourcerootUrlMixedSubfolderNoOutdir/amd/ref/m2.js b/tests/baselines/reference/project/sourcerootUrlMixedSubfolderNoOutdir/amd/ref/m2.js index 08855ec797b4d..20d4b93990f3f 100644 --- a/tests/baselines/reference/project/sourcerootUrlMixedSubfolderNoOutdir/amd/ref/m2.js +++ b/tests/baselines/reference/project/sourcerootUrlMixedSubfolderNoOutdir/amd/ref/m2.js @@ -2,7 +2,7 @@ define(["require", "exports"], function (require, exports) { "use strict"; exports.__esModule = true; exports.m2_a1 = 10; - var m2_c1 = (function () { + var m2_c1 = /** @class */ (function () { function m2_c1() { } return m2_c1; diff --git a/tests/baselines/reference/project/sourcerootUrlMixedSubfolderNoOutdir/amd/test.js b/tests/baselines/reference/project/sourcerootUrlMixedSubfolderNoOutdir/amd/test.js index 78426750a82a2..020207321b363 100644 --- a/tests/baselines/reference/project/sourcerootUrlMixedSubfolderNoOutdir/amd/test.js +++ b/tests/baselines/reference/project/sourcerootUrlMixedSubfolderNoOutdir/amd/test.js @@ -1,7 +1,7 @@ /// /// var a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/sourcerootUrlMixedSubfolderNoOutdir/node/ref/m1.js b/tests/baselines/reference/project/sourcerootUrlMixedSubfolderNoOutdir/node/ref/m1.js index b7283f7fd8830..4293cda52dba5 100644 --- a/tests/baselines/reference/project/sourcerootUrlMixedSubfolderNoOutdir/node/ref/m1.js +++ b/tests/baselines/reference/project/sourcerootUrlMixedSubfolderNoOutdir/node/ref/m1.js @@ -1,5 +1,5 @@ var m1_a1 = 10; -var m1_c1 = (function () { +var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; diff --git a/tests/baselines/reference/project/sourcerootUrlMixedSubfolderNoOutdir/node/ref/m2.js b/tests/baselines/reference/project/sourcerootUrlMixedSubfolderNoOutdir/node/ref/m2.js index 8ad833cd4eba9..fca535956778f 100644 --- a/tests/baselines/reference/project/sourcerootUrlMixedSubfolderNoOutdir/node/ref/m2.js +++ b/tests/baselines/reference/project/sourcerootUrlMixedSubfolderNoOutdir/node/ref/m2.js @@ -1,7 +1,7 @@ "use strict"; exports.__esModule = true; exports.m2_a1 = 10; -var m2_c1 = (function () { +var m2_c1 = /** @class */ (function () { function m2_c1() { } return m2_c1; diff --git a/tests/baselines/reference/project/sourcerootUrlMixedSubfolderNoOutdir/node/test.js b/tests/baselines/reference/project/sourcerootUrlMixedSubfolderNoOutdir/node/test.js index 78426750a82a2..020207321b363 100644 --- a/tests/baselines/reference/project/sourcerootUrlMixedSubfolderNoOutdir/node/test.js +++ b/tests/baselines/reference/project/sourcerootUrlMixedSubfolderNoOutdir/node/test.js @@ -1,7 +1,7 @@ /// /// var a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js b/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js index b7283f7fd8830..4293cda52dba5 100644 --- a/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js +++ b/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js @@ -1,5 +1,5 @@ var m1_a1 = 10; -var m1_c1 = (function () { +var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; diff --git a/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m2.js b/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m2.js index 08855ec797b4d..20d4b93990f3f 100644 --- a/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m2.js +++ b/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m2.js @@ -2,7 +2,7 @@ define(["require", "exports"], function (require, exports) { "use strict"; exports.__esModule = true; exports.m2_a1 = 10; - var m2_c1 = (function () { + var m2_c1 = /** @class */ (function () { function m2_c1() { } return m2_c1; diff --git a/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js b/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js index 78426750a82a2..020207321b363 100644 --- a/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js +++ b/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js @@ -1,7 +1,7 @@ /// /// var a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js b/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js index b7283f7fd8830..4293cda52dba5 100644 --- a/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js +++ b/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js @@ -1,5 +1,5 @@ var m1_a1 = 10; -var m1_c1 = (function () { +var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; diff --git a/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m2.js b/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m2.js index 8ad833cd4eba9..fca535956778f 100644 --- a/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m2.js +++ b/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m2.js @@ -1,7 +1,7 @@ "use strict"; exports.__esModule = true; exports.m2_a1 = 10; -var m2_c1 = (function () { +var m2_c1 = /** @class */ (function () { function m2_c1() { } return m2_c1; diff --git a/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js b/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js index 78426750a82a2..020207321b363 100644 --- a/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js +++ b/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js @@ -1,7 +1,7 @@ /// /// var a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputFile/amd/bin/test.js b/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputFile/amd/bin/test.js index f070fff6f1cb8..6c4233ece096d 100644 --- a/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputFile/amd/bin/test.js +++ b/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputFile/amd/bin/test.js @@ -1,5 +1,5 @@ var m1_a1 = 10; -var m1_c1 = (function () { +var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; @@ -12,7 +12,7 @@ define("ref/m2", ["require", "exports"], function (require, exports) { "use strict"; exports.__esModule = true; exports.m2_a1 = 10; - var m2_c1 = (function () { + var m2_c1 = /** @class */ (function () { function m2_c1() { } return m2_c1; @@ -27,7 +27,7 @@ define("ref/m2", ["require", "exports"], function (require, exports) { /// /// var a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputFile/node/bin/test.js b/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputFile/node/bin/test.js index 5d63d624329e6..4aa1cc0efbdbb 100644 --- a/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputFile/node/bin/test.js +++ b/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputFile/node/bin/test.js @@ -1,5 +1,5 @@ var m1_a1 = 10; -var m1_c1 = (function () { +var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; @@ -11,7 +11,7 @@ function m1_f1() { /// /// var a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/bin/outAndOutDirFile.js b/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/bin/outAndOutDirFile.js index 3e02cc09fcb7a..7b02d52b57d72 100644 --- a/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/bin/outAndOutDirFile.js +++ b/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/bin/outAndOutDirFile.js @@ -1,5 +1,5 @@ var m1_a1 = 10; -var m1_c1 = (function () { +var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; @@ -12,7 +12,7 @@ define("ref/m2", ["require", "exports"], function (require, exports) { "use strict"; exports.__esModule = true; exports.m2_a1 = 10; - var m2_c1 = (function () { + var m2_c1 = /** @class */ (function () { function m2_c1() { } return m2_c1; @@ -27,7 +27,7 @@ define("ref/m2", ["require", "exports"], function (require, exports) { /// /// var a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/bin/outAndOutDirFile.js b/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/bin/outAndOutDirFile.js index da6a20151434f..86b6ba19ae52a 100644 --- a/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/bin/outAndOutDirFile.js +++ b/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/bin/outAndOutDirFile.js @@ -1,5 +1,5 @@ var m1_a1 = 10; -var m1_c1 = (function () { +var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; @@ -11,7 +11,7 @@ function m1_f1() { /// /// var a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/sourcerootUrlModuleMultifolderNoOutdir/amd/diskFile1.js b/tests/baselines/reference/project/sourcerootUrlModuleMultifolderNoOutdir/amd/diskFile1.js index 08855ec797b4d..20d4b93990f3f 100644 --- a/tests/baselines/reference/project/sourcerootUrlModuleMultifolderNoOutdir/amd/diskFile1.js +++ b/tests/baselines/reference/project/sourcerootUrlModuleMultifolderNoOutdir/amd/diskFile1.js @@ -2,7 +2,7 @@ define(["require", "exports"], function (require, exports) { "use strict"; exports.__esModule = true; exports.m2_a1 = 10; - var m2_c1 = (function () { + var m2_c1 = /** @class */ (function () { function m2_c1() { } return m2_c1; diff --git a/tests/baselines/reference/project/sourcerootUrlModuleMultifolderNoOutdir/amd/ref/m1.js b/tests/baselines/reference/project/sourcerootUrlModuleMultifolderNoOutdir/amd/ref/m1.js index 391c6ef6630d8..3eb8a0f5dea2e 100644 --- a/tests/baselines/reference/project/sourcerootUrlModuleMultifolderNoOutdir/amd/ref/m1.js +++ b/tests/baselines/reference/project/sourcerootUrlModuleMultifolderNoOutdir/amd/ref/m1.js @@ -2,7 +2,7 @@ define(["require", "exports"], function (require, exports) { "use strict"; exports.__esModule = true; exports.m1_a1 = 10; - var m1_c1 = (function () { + var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; diff --git a/tests/baselines/reference/project/sourcerootUrlModuleMultifolderNoOutdir/amd/test.js b/tests/baselines/reference/project/sourcerootUrlModuleMultifolderNoOutdir/amd/test.js index 90f7f12fcb186..2d7e905faa44d 100644 --- a/tests/baselines/reference/project/sourcerootUrlModuleMultifolderNoOutdir/amd/test.js +++ b/tests/baselines/reference/project/sourcerootUrlModuleMultifolderNoOutdir/amd/test.js @@ -2,7 +2,7 @@ define(["require", "exports", "ref/m1", "../outputdir_module_multifolder_ref/m2" "use strict"; exports.__esModule = true; exports.a1 = 10; - var c1 = (function () { + var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/sourcerootUrlModuleMultifolderNoOutdir/node/diskFile1.js b/tests/baselines/reference/project/sourcerootUrlModuleMultifolderNoOutdir/node/diskFile1.js index 8ad833cd4eba9..fca535956778f 100644 --- a/tests/baselines/reference/project/sourcerootUrlModuleMultifolderNoOutdir/node/diskFile1.js +++ b/tests/baselines/reference/project/sourcerootUrlModuleMultifolderNoOutdir/node/diskFile1.js @@ -1,7 +1,7 @@ "use strict"; exports.__esModule = true; exports.m2_a1 = 10; -var m2_c1 = (function () { +var m2_c1 = /** @class */ (function () { function m2_c1() { } return m2_c1; diff --git a/tests/baselines/reference/project/sourcerootUrlModuleMultifolderNoOutdir/node/ref/m1.js b/tests/baselines/reference/project/sourcerootUrlModuleMultifolderNoOutdir/node/ref/m1.js index 02586d67fcc6d..2db985c931fd6 100644 --- a/tests/baselines/reference/project/sourcerootUrlModuleMultifolderNoOutdir/node/ref/m1.js +++ b/tests/baselines/reference/project/sourcerootUrlModuleMultifolderNoOutdir/node/ref/m1.js @@ -1,7 +1,7 @@ "use strict"; exports.__esModule = true; exports.m1_a1 = 10; -var m1_c1 = (function () { +var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; diff --git a/tests/baselines/reference/project/sourcerootUrlModuleMultifolderNoOutdir/node/test.js b/tests/baselines/reference/project/sourcerootUrlModuleMultifolderNoOutdir/node/test.js index 43d151f3fd963..2fbb4d7fc1ca4 100644 --- a/tests/baselines/reference/project/sourcerootUrlModuleMultifolderNoOutdir/node/test.js +++ b/tests/baselines/reference/project/sourcerootUrlModuleMultifolderNoOutdir/node/test.js @@ -3,7 +3,7 @@ exports.__esModule = true; var m1 = require("ref/m1"); var m2 = require("../outputdir_module_multifolder_ref/m2"); exports.a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/sourcerootUrlModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder/ref/m1.js b/tests/baselines/reference/project/sourcerootUrlModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder/ref/m1.js index 391c6ef6630d8..3eb8a0f5dea2e 100644 --- a/tests/baselines/reference/project/sourcerootUrlModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder/ref/m1.js +++ b/tests/baselines/reference/project/sourcerootUrlModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder/ref/m1.js @@ -2,7 +2,7 @@ define(["require", "exports"], function (require, exports) { "use strict"; exports.__esModule = true; exports.m1_a1 = 10; - var m1_c1 = (function () { + var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; diff --git a/tests/baselines/reference/project/sourcerootUrlModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder/test.js b/tests/baselines/reference/project/sourcerootUrlModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder/test.js index 90f7f12fcb186..2d7e905faa44d 100644 --- a/tests/baselines/reference/project/sourcerootUrlModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder/test.js +++ b/tests/baselines/reference/project/sourcerootUrlModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder/test.js @@ -2,7 +2,7 @@ define(["require", "exports", "ref/m1", "../outputdir_module_multifolder_ref/m2" "use strict"; exports.__esModule = true; exports.a1 = 10; - var c1 = (function () { + var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/sourcerootUrlModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder_ref/m2.js b/tests/baselines/reference/project/sourcerootUrlModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder_ref/m2.js index 08855ec797b4d..20d4b93990f3f 100644 --- a/tests/baselines/reference/project/sourcerootUrlModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder_ref/m2.js +++ b/tests/baselines/reference/project/sourcerootUrlModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder_ref/m2.js @@ -2,7 +2,7 @@ define(["require", "exports"], function (require, exports) { "use strict"; exports.__esModule = true; exports.m2_a1 = 10; - var m2_c1 = (function () { + var m2_c1 = /** @class */ (function () { function m2_c1() { } return m2_c1; diff --git a/tests/baselines/reference/project/sourcerootUrlModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder/ref/m1.js b/tests/baselines/reference/project/sourcerootUrlModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder/ref/m1.js index 02586d67fcc6d..2db985c931fd6 100644 --- a/tests/baselines/reference/project/sourcerootUrlModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder/ref/m1.js +++ b/tests/baselines/reference/project/sourcerootUrlModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder/ref/m1.js @@ -1,7 +1,7 @@ "use strict"; exports.__esModule = true; exports.m1_a1 = 10; -var m1_c1 = (function () { +var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; diff --git a/tests/baselines/reference/project/sourcerootUrlModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder/test.js b/tests/baselines/reference/project/sourcerootUrlModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder/test.js index 43d151f3fd963..2fbb4d7fc1ca4 100644 --- a/tests/baselines/reference/project/sourcerootUrlModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder/test.js +++ b/tests/baselines/reference/project/sourcerootUrlModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder/test.js @@ -3,7 +3,7 @@ exports.__esModule = true; var m1 = require("ref/m1"); var m2 = require("../outputdir_module_multifolder_ref/m2"); exports.a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/sourcerootUrlModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder_ref/m2.js b/tests/baselines/reference/project/sourcerootUrlModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder_ref/m2.js index 8ad833cd4eba9..fca535956778f 100644 --- a/tests/baselines/reference/project/sourcerootUrlModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder_ref/m2.js +++ b/tests/baselines/reference/project/sourcerootUrlModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder_ref/m2.js @@ -1,7 +1,7 @@ "use strict"; exports.__esModule = true; exports.m2_a1 = 10; -var m2_c1 = (function () { +var m2_c1 = /** @class */ (function () { function m2_c1() { } return m2_c1; diff --git a/tests/baselines/reference/project/sourcerootUrlModuleMultifolderSpecifyOutputFile/amd/bin/test.js b/tests/baselines/reference/project/sourcerootUrlModuleMultifolderSpecifyOutputFile/amd/bin/test.js index b77e0a462a773..6a566140109d1 100644 --- a/tests/baselines/reference/project/sourcerootUrlModuleMultifolderSpecifyOutputFile/amd/bin/test.js +++ b/tests/baselines/reference/project/sourcerootUrlModuleMultifolderSpecifyOutputFile/amd/bin/test.js @@ -2,7 +2,7 @@ define("outputdir_module_multifolder/ref/m1", ["require", "exports"], function ( "use strict"; exports.__esModule = true; exports.m1_a1 = 10; - var m1_c1 = (function () { + var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; @@ -18,7 +18,7 @@ define("outputdir_module_multifolder_ref/m2", ["require", "exports"], function ( "use strict"; exports.__esModule = true; exports.m2_a1 = 10; - var m2_c1 = (function () { + var m2_c1 = /** @class */ (function () { function m2_c1() { } return m2_c1; @@ -34,7 +34,7 @@ define("outputdir_module_multifolder/test", ["require", "exports", "outputdir_mo "use strict"; exports.__esModule = true; exports.a1 = 10; - var c1 = (function () { + var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/sourcerootUrlModuleSimpleNoOutdir/amd/m1.js b/tests/baselines/reference/project/sourcerootUrlModuleSimpleNoOutdir/amd/m1.js index 391c6ef6630d8..3eb8a0f5dea2e 100644 --- a/tests/baselines/reference/project/sourcerootUrlModuleSimpleNoOutdir/amd/m1.js +++ b/tests/baselines/reference/project/sourcerootUrlModuleSimpleNoOutdir/amd/m1.js @@ -2,7 +2,7 @@ define(["require", "exports"], function (require, exports) { "use strict"; exports.__esModule = true; exports.m1_a1 = 10; - var m1_c1 = (function () { + var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; diff --git a/tests/baselines/reference/project/sourcerootUrlModuleSimpleNoOutdir/amd/test.js b/tests/baselines/reference/project/sourcerootUrlModuleSimpleNoOutdir/amd/test.js index e5ed53fd0e1a2..d85c5bfa685a7 100644 --- a/tests/baselines/reference/project/sourcerootUrlModuleSimpleNoOutdir/amd/test.js +++ b/tests/baselines/reference/project/sourcerootUrlModuleSimpleNoOutdir/amd/test.js @@ -2,7 +2,7 @@ define(["require", "exports", "m1"], function (require, exports, m1) { "use strict"; exports.__esModule = true; exports.a1 = 10; - var c1 = (function () { + var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/sourcerootUrlModuleSimpleNoOutdir/node/m1.js b/tests/baselines/reference/project/sourcerootUrlModuleSimpleNoOutdir/node/m1.js index 02586d67fcc6d..2db985c931fd6 100644 --- a/tests/baselines/reference/project/sourcerootUrlModuleSimpleNoOutdir/node/m1.js +++ b/tests/baselines/reference/project/sourcerootUrlModuleSimpleNoOutdir/node/m1.js @@ -1,7 +1,7 @@ "use strict"; exports.__esModule = true; exports.m1_a1 = 10; -var m1_c1 = (function () { +var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; diff --git a/tests/baselines/reference/project/sourcerootUrlModuleSimpleNoOutdir/node/test.js b/tests/baselines/reference/project/sourcerootUrlModuleSimpleNoOutdir/node/test.js index 56c8debf9b699..ca22756bd6ee2 100644 --- a/tests/baselines/reference/project/sourcerootUrlModuleSimpleNoOutdir/node/test.js +++ b/tests/baselines/reference/project/sourcerootUrlModuleSimpleNoOutdir/node/test.js @@ -2,7 +2,7 @@ exports.__esModule = true; var m1 = require("m1"); exports.a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/sourcerootUrlModuleSimpleSpecifyOutputDirectory/amd/outdir/simple/m1.js b/tests/baselines/reference/project/sourcerootUrlModuleSimpleSpecifyOutputDirectory/amd/outdir/simple/m1.js index 391c6ef6630d8..3eb8a0f5dea2e 100644 --- a/tests/baselines/reference/project/sourcerootUrlModuleSimpleSpecifyOutputDirectory/amd/outdir/simple/m1.js +++ b/tests/baselines/reference/project/sourcerootUrlModuleSimpleSpecifyOutputDirectory/amd/outdir/simple/m1.js @@ -2,7 +2,7 @@ define(["require", "exports"], function (require, exports) { "use strict"; exports.__esModule = true; exports.m1_a1 = 10; - var m1_c1 = (function () { + var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; diff --git a/tests/baselines/reference/project/sourcerootUrlModuleSimpleSpecifyOutputDirectory/amd/outdir/simple/test.js b/tests/baselines/reference/project/sourcerootUrlModuleSimpleSpecifyOutputDirectory/amd/outdir/simple/test.js index e5ed53fd0e1a2..d85c5bfa685a7 100644 --- a/tests/baselines/reference/project/sourcerootUrlModuleSimpleSpecifyOutputDirectory/amd/outdir/simple/test.js +++ b/tests/baselines/reference/project/sourcerootUrlModuleSimpleSpecifyOutputDirectory/amd/outdir/simple/test.js @@ -2,7 +2,7 @@ define(["require", "exports", "m1"], function (require, exports, m1) { "use strict"; exports.__esModule = true; exports.a1 = 10; - var c1 = (function () { + var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/sourcerootUrlModuleSimpleSpecifyOutputDirectory/node/outdir/simple/m1.js b/tests/baselines/reference/project/sourcerootUrlModuleSimpleSpecifyOutputDirectory/node/outdir/simple/m1.js index 02586d67fcc6d..2db985c931fd6 100644 --- a/tests/baselines/reference/project/sourcerootUrlModuleSimpleSpecifyOutputDirectory/node/outdir/simple/m1.js +++ b/tests/baselines/reference/project/sourcerootUrlModuleSimpleSpecifyOutputDirectory/node/outdir/simple/m1.js @@ -1,7 +1,7 @@ "use strict"; exports.__esModule = true; exports.m1_a1 = 10; -var m1_c1 = (function () { +var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; diff --git a/tests/baselines/reference/project/sourcerootUrlModuleSimpleSpecifyOutputDirectory/node/outdir/simple/test.js b/tests/baselines/reference/project/sourcerootUrlModuleSimpleSpecifyOutputDirectory/node/outdir/simple/test.js index 56c8debf9b699..ca22756bd6ee2 100644 --- a/tests/baselines/reference/project/sourcerootUrlModuleSimpleSpecifyOutputDirectory/node/outdir/simple/test.js +++ b/tests/baselines/reference/project/sourcerootUrlModuleSimpleSpecifyOutputDirectory/node/outdir/simple/test.js @@ -2,7 +2,7 @@ exports.__esModule = true; var m1 = require("m1"); exports.a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/sourcerootUrlModuleSimpleSpecifyOutputFile/amd/bin/test.js b/tests/baselines/reference/project/sourcerootUrlModuleSimpleSpecifyOutputFile/amd/bin/test.js index cbe79e3318b88..59d09316642a9 100644 --- a/tests/baselines/reference/project/sourcerootUrlModuleSimpleSpecifyOutputFile/amd/bin/test.js +++ b/tests/baselines/reference/project/sourcerootUrlModuleSimpleSpecifyOutputFile/amd/bin/test.js @@ -2,7 +2,7 @@ define("m1", ["require", "exports"], function (require, exports) { "use strict"; exports.__esModule = true; exports.m1_a1 = 10; - var m1_c1 = (function () { + var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; @@ -18,7 +18,7 @@ define("test", ["require", "exports", "m1"], function (require, exports, m1) { "use strict"; exports.__esModule = true; exports.a1 = 10; - var c1 = (function () { + var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/sourcerootUrlModuleSubfolderNoOutdir/amd/ref/m1.js b/tests/baselines/reference/project/sourcerootUrlModuleSubfolderNoOutdir/amd/ref/m1.js index 391c6ef6630d8..3eb8a0f5dea2e 100644 --- a/tests/baselines/reference/project/sourcerootUrlModuleSubfolderNoOutdir/amd/ref/m1.js +++ b/tests/baselines/reference/project/sourcerootUrlModuleSubfolderNoOutdir/amd/ref/m1.js @@ -2,7 +2,7 @@ define(["require", "exports"], function (require, exports) { "use strict"; exports.__esModule = true; exports.m1_a1 = 10; - var m1_c1 = (function () { + var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; diff --git a/tests/baselines/reference/project/sourcerootUrlModuleSubfolderNoOutdir/amd/test.js b/tests/baselines/reference/project/sourcerootUrlModuleSubfolderNoOutdir/amd/test.js index c95451ac730f8..efe432ad6fb5b 100644 --- a/tests/baselines/reference/project/sourcerootUrlModuleSubfolderNoOutdir/amd/test.js +++ b/tests/baselines/reference/project/sourcerootUrlModuleSubfolderNoOutdir/amd/test.js @@ -2,7 +2,7 @@ define(["require", "exports", "ref/m1"], function (require, exports, m1) { "use strict"; exports.__esModule = true; exports.a1 = 10; - var c1 = (function () { + var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/sourcerootUrlModuleSubfolderNoOutdir/node/ref/m1.js b/tests/baselines/reference/project/sourcerootUrlModuleSubfolderNoOutdir/node/ref/m1.js index 02586d67fcc6d..2db985c931fd6 100644 --- a/tests/baselines/reference/project/sourcerootUrlModuleSubfolderNoOutdir/node/ref/m1.js +++ b/tests/baselines/reference/project/sourcerootUrlModuleSubfolderNoOutdir/node/ref/m1.js @@ -1,7 +1,7 @@ "use strict"; exports.__esModule = true; exports.m1_a1 = 10; -var m1_c1 = (function () { +var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; diff --git a/tests/baselines/reference/project/sourcerootUrlModuleSubfolderNoOutdir/node/test.js b/tests/baselines/reference/project/sourcerootUrlModuleSubfolderNoOutdir/node/test.js index 97ca26f319840..d90be1b614115 100644 --- a/tests/baselines/reference/project/sourcerootUrlModuleSubfolderNoOutdir/node/test.js +++ b/tests/baselines/reference/project/sourcerootUrlModuleSubfolderNoOutdir/node/test.js @@ -2,7 +2,7 @@ exports.__esModule = true; var m1 = require("ref/m1"); exports.a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/sourcerootUrlModuleSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js b/tests/baselines/reference/project/sourcerootUrlModuleSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js index 391c6ef6630d8..3eb8a0f5dea2e 100644 --- a/tests/baselines/reference/project/sourcerootUrlModuleSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js +++ b/tests/baselines/reference/project/sourcerootUrlModuleSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js @@ -2,7 +2,7 @@ define(["require", "exports"], function (require, exports) { "use strict"; exports.__esModule = true; exports.m1_a1 = 10; - var m1_c1 = (function () { + var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; diff --git a/tests/baselines/reference/project/sourcerootUrlModuleSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js b/tests/baselines/reference/project/sourcerootUrlModuleSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js index c95451ac730f8..efe432ad6fb5b 100644 --- a/tests/baselines/reference/project/sourcerootUrlModuleSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js +++ b/tests/baselines/reference/project/sourcerootUrlModuleSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js @@ -2,7 +2,7 @@ define(["require", "exports", "ref/m1"], function (require, exports, m1) { "use strict"; exports.__esModule = true; exports.a1 = 10; - var c1 = (function () { + var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/sourcerootUrlModuleSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js b/tests/baselines/reference/project/sourcerootUrlModuleSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js index 02586d67fcc6d..2db985c931fd6 100644 --- a/tests/baselines/reference/project/sourcerootUrlModuleSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js +++ b/tests/baselines/reference/project/sourcerootUrlModuleSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js @@ -1,7 +1,7 @@ "use strict"; exports.__esModule = true; exports.m1_a1 = 10; -var m1_c1 = (function () { +var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; diff --git a/tests/baselines/reference/project/sourcerootUrlModuleSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js b/tests/baselines/reference/project/sourcerootUrlModuleSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js index 97ca26f319840..d90be1b614115 100644 --- a/tests/baselines/reference/project/sourcerootUrlModuleSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js +++ b/tests/baselines/reference/project/sourcerootUrlModuleSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js @@ -2,7 +2,7 @@ exports.__esModule = true; var m1 = require("ref/m1"); exports.a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/sourcerootUrlModuleSubfolderSpecifyOutputFile/amd/bin/test.js b/tests/baselines/reference/project/sourcerootUrlModuleSubfolderSpecifyOutputFile/amd/bin/test.js index 22a9cf7b4d73d..91d7134f7a2c4 100644 --- a/tests/baselines/reference/project/sourcerootUrlModuleSubfolderSpecifyOutputFile/amd/bin/test.js +++ b/tests/baselines/reference/project/sourcerootUrlModuleSubfolderSpecifyOutputFile/amd/bin/test.js @@ -2,7 +2,7 @@ define("ref/m1", ["require", "exports"], function (require, exports) { "use strict"; exports.__esModule = true; exports.m1_a1 = 10; - var m1_c1 = (function () { + var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; @@ -18,7 +18,7 @@ define("test", ["require", "exports", "ref/m1"], function (require, exports, m1) "use strict"; exports.__esModule = true; exports.a1 = 10; - var c1 = (function () { + var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/sourcerootUrlMultifolderNoOutdir/amd/diskFile1.js b/tests/baselines/reference/project/sourcerootUrlMultifolderNoOutdir/amd/diskFile1.js index a1041b6d258ef..4708e36c671ce 100644 --- a/tests/baselines/reference/project/sourcerootUrlMultifolderNoOutdir/amd/diskFile1.js +++ b/tests/baselines/reference/project/sourcerootUrlMultifolderNoOutdir/amd/diskFile1.js @@ -1,5 +1,5 @@ var m2_a1 = 10; -var m2_c1 = (function () { +var m2_c1 = /** @class */ (function () { function m2_c1() { } return m2_c1; diff --git a/tests/baselines/reference/project/sourcerootUrlMultifolderNoOutdir/amd/ref/m1.js b/tests/baselines/reference/project/sourcerootUrlMultifolderNoOutdir/amd/ref/m1.js index b7283f7fd8830..4293cda52dba5 100644 --- a/tests/baselines/reference/project/sourcerootUrlMultifolderNoOutdir/amd/ref/m1.js +++ b/tests/baselines/reference/project/sourcerootUrlMultifolderNoOutdir/amd/ref/m1.js @@ -1,5 +1,5 @@ var m1_a1 = 10; -var m1_c1 = (function () { +var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; diff --git a/tests/baselines/reference/project/sourcerootUrlMultifolderNoOutdir/amd/test.js b/tests/baselines/reference/project/sourcerootUrlMultifolderNoOutdir/amd/test.js index 088a77f3f259c..02aa0b24321fd 100644 --- a/tests/baselines/reference/project/sourcerootUrlMultifolderNoOutdir/amd/test.js +++ b/tests/baselines/reference/project/sourcerootUrlMultifolderNoOutdir/amd/test.js @@ -1,7 +1,7 @@ /// /// var a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/sourcerootUrlMultifolderNoOutdir/node/diskFile1.js b/tests/baselines/reference/project/sourcerootUrlMultifolderNoOutdir/node/diskFile1.js index a1041b6d258ef..4708e36c671ce 100644 --- a/tests/baselines/reference/project/sourcerootUrlMultifolderNoOutdir/node/diskFile1.js +++ b/tests/baselines/reference/project/sourcerootUrlMultifolderNoOutdir/node/diskFile1.js @@ -1,5 +1,5 @@ var m2_a1 = 10; -var m2_c1 = (function () { +var m2_c1 = /** @class */ (function () { function m2_c1() { } return m2_c1; diff --git a/tests/baselines/reference/project/sourcerootUrlMultifolderNoOutdir/node/ref/m1.js b/tests/baselines/reference/project/sourcerootUrlMultifolderNoOutdir/node/ref/m1.js index b7283f7fd8830..4293cda52dba5 100644 --- a/tests/baselines/reference/project/sourcerootUrlMultifolderNoOutdir/node/ref/m1.js +++ b/tests/baselines/reference/project/sourcerootUrlMultifolderNoOutdir/node/ref/m1.js @@ -1,5 +1,5 @@ var m1_a1 = 10; -var m1_c1 = (function () { +var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; diff --git a/tests/baselines/reference/project/sourcerootUrlMultifolderNoOutdir/node/test.js b/tests/baselines/reference/project/sourcerootUrlMultifolderNoOutdir/node/test.js index 088a77f3f259c..02aa0b24321fd 100644 --- a/tests/baselines/reference/project/sourcerootUrlMultifolderNoOutdir/node/test.js +++ b/tests/baselines/reference/project/sourcerootUrlMultifolderNoOutdir/node/test.js @@ -1,7 +1,7 @@ /// /// var a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/sourcerootUrlMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/ref/m1.js b/tests/baselines/reference/project/sourcerootUrlMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/ref/m1.js index b7283f7fd8830..4293cda52dba5 100644 --- a/tests/baselines/reference/project/sourcerootUrlMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/ref/m1.js +++ b/tests/baselines/reference/project/sourcerootUrlMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/ref/m1.js @@ -1,5 +1,5 @@ var m1_a1 = 10; -var m1_c1 = (function () { +var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; diff --git a/tests/baselines/reference/project/sourcerootUrlMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/test.js b/tests/baselines/reference/project/sourcerootUrlMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/test.js index 088a77f3f259c..02aa0b24321fd 100644 --- a/tests/baselines/reference/project/sourcerootUrlMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/test.js +++ b/tests/baselines/reference/project/sourcerootUrlMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/test.js @@ -1,7 +1,7 @@ /// /// var a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/sourcerootUrlMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder_ref/m2.js b/tests/baselines/reference/project/sourcerootUrlMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder_ref/m2.js index a1041b6d258ef..4708e36c671ce 100644 --- a/tests/baselines/reference/project/sourcerootUrlMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder_ref/m2.js +++ b/tests/baselines/reference/project/sourcerootUrlMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder_ref/m2.js @@ -1,5 +1,5 @@ var m2_a1 = 10; -var m2_c1 = (function () { +var m2_c1 = /** @class */ (function () { function m2_c1() { } return m2_c1; diff --git a/tests/baselines/reference/project/sourcerootUrlMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/ref/m1.js b/tests/baselines/reference/project/sourcerootUrlMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/ref/m1.js index b7283f7fd8830..4293cda52dba5 100644 --- a/tests/baselines/reference/project/sourcerootUrlMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/ref/m1.js +++ b/tests/baselines/reference/project/sourcerootUrlMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/ref/m1.js @@ -1,5 +1,5 @@ var m1_a1 = 10; -var m1_c1 = (function () { +var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; diff --git a/tests/baselines/reference/project/sourcerootUrlMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/test.js b/tests/baselines/reference/project/sourcerootUrlMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/test.js index 088a77f3f259c..02aa0b24321fd 100644 --- a/tests/baselines/reference/project/sourcerootUrlMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/test.js +++ b/tests/baselines/reference/project/sourcerootUrlMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/test.js @@ -1,7 +1,7 @@ /// /// var a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/sourcerootUrlMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder_ref/m2.js b/tests/baselines/reference/project/sourcerootUrlMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder_ref/m2.js index a1041b6d258ef..4708e36c671ce 100644 --- a/tests/baselines/reference/project/sourcerootUrlMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder_ref/m2.js +++ b/tests/baselines/reference/project/sourcerootUrlMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder_ref/m2.js @@ -1,5 +1,5 @@ var m2_a1 = 10; -var m2_c1 = (function () { +var m2_c1 = /** @class */ (function () { function m2_c1() { } return m2_c1; diff --git a/tests/baselines/reference/project/sourcerootUrlMultifolderSpecifyOutputFile/amd/bin/test.js b/tests/baselines/reference/project/sourcerootUrlMultifolderSpecifyOutputFile/amd/bin/test.js index ad96cca3d7952..62f18329bd31e 100644 --- a/tests/baselines/reference/project/sourcerootUrlMultifolderSpecifyOutputFile/amd/bin/test.js +++ b/tests/baselines/reference/project/sourcerootUrlMultifolderSpecifyOutputFile/amd/bin/test.js @@ -1,5 +1,5 @@ var m1_a1 = 10; -var m1_c1 = (function () { +var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; @@ -9,7 +9,7 @@ function m1_f1() { return m1_instance1; } var m2_a1 = 10; -var m2_c1 = (function () { +var m2_c1 = /** @class */ (function () { function m2_c1() { } return m2_c1; @@ -21,7 +21,7 @@ function m2_f1() { /// /// var a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/sourcerootUrlMultifolderSpecifyOutputFile/node/bin/test.js b/tests/baselines/reference/project/sourcerootUrlMultifolderSpecifyOutputFile/node/bin/test.js index ad96cca3d7952..62f18329bd31e 100644 --- a/tests/baselines/reference/project/sourcerootUrlMultifolderSpecifyOutputFile/node/bin/test.js +++ b/tests/baselines/reference/project/sourcerootUrlMultifolderSpecifyOutputFile/node/bin/test.js @@ -1,5 +1,5 @@ var m1_a1 = 10; -var m1_c1 = (function () { +var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; @@ -9,7 +9,7 @@ function m1_f1() { return m1_instance1; } var m2_a1 = 10; -var m2_c1 = (function () { +var m2_c1 = /** @class */ (function () { function m2_c1() { } return m2_c1; @@ -21,7 +21,7 @@ function m2_f1() { /// /// var a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/sourcerootUrlSimpleNoOutdir/amd/m1.js b/tests/baselines/reference/project/sourcerootUrlSimpleNoOutdir/amd/m1.js index b7283f7fd8830..4293cda52dba5 100644 --- a/tests/baselines/reference/project/sourcerootUrlSimpleNoOutdir/amd/m1.js +++ b/tests/baselines/reference/project/sourcerootUrlSimpleNoOutdir/amd/m1.js @@ -1,5 +1,5 @@ var m1_a1 = 10; -var m1_c1 = (function () { +var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; diff --git a/tests/baselines/reference/project/sourcerootUrlSimpleNoOutdir/amd/test.js b/tests/baselines/reference/project/sourcerootUrlSimpleNoOutdir/amd/test.js index 679b65b57336e..febaeedb0f144 100644 --- a/tests/baselines/reference/project/sourcerootUrlSimpleNoOutdir/amd/test.js +++ b/tests/baselines/reference/project/sourcerootUrlSimpleNoOutdir/amd/test.js @@ -1,6 +1,6 @@ /// var a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/sourcerootUrlSimpleNoOutdir/node/m1.js b/tests/baselines/reference/project/sourcerootUrlSimpleNoOutdir/node/m1.js index b7283f7fd8830..4293cda52dba5 100644 --- a/tests/baselines/reference/project/sourcerootUrlSimpleNoOutdir/node/m1.js +++ b/tests/baselines/reference/project/sourcerootUrlSimpleNoOutdir/node/m1.js @@ -1,5 +1,5 @@ var m1_a1 = 10; -var m1_c1 = (function () { +var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; diff --git a/tests/baselines/reference/project/sourcerootUrlSimpleNoOutdir/node/test.js b/tests/baselines/reference/project/sourcerootUrlSimpleNoOutdir/node/test.js index 679b65b57336e..febaeedb0f144 100644 --- a/tests/baselines/reference/project/sourcerootUrlSimpleNoOutdir/node/test.js +++ b/tests/baselines/reference/project/sourcerootUrlSimpleNoOutdir/node/test.js @@ -1,6 +1,6 @@ /// var a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/sourcerootUrlSimpleSpecifyOutputDirectory/amd/outdir/simple/m1.js b/tests/baselines/reference/project/sourcerootUrlSimpleSpecifyOutputDirectory/amd/outdir/simple/m1.js index b7283f7fd8830..4293cda52dba5 100644 --- a/tests/baselines/reference/project/sourcerootUrlSimpleSpecifyOutputDirectory/amd/outdir/simple/m1.js +++ b/tests/baselines/reference/project/sourcerootUrlSimpleSpecifyOutputDirectory/amd/outdir/simple/m1.js @@ -1,5 +1,5 @@ var m1_a1 = 10; -var m1_c1 = (function () { +var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; diff --git a/tests/baselines/reference/project/sourcerootUrlSimpleSpecifyOutputDirectory/amd/outdir/simple/test.js b/tests/baselines/reference/project/sourcerootUrlSimpleSpecifyOutputDirectory/amd/outdir/simple/test.js index 679b65b57336e..febaeedb0f144 100644 --- a/tests/baselines/reference/project/sourcerootUrlSimpleSpecifyOutputDirectory/amd/outdir/simple/test.js +++ b/tests/baselines/reference/project/sourcerootUrlSimpleSpecifyOutputDirectory/amd/outdir/simple/test.js @@ -1,6 +1,6 @@ /// var a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/sourcerootUrlSimpleSpecifyOutputDirectory/node/outdir/simple/m1.js b/tests/baselines/reference/project/sourcerootUrlSimpleSpecifyOutputDirectory/node/outdir/simple/m1.js index b7283f7fd8830..4293cda52dba5 100644 --- a/tests/baselines/reference/project/sourcerootUrlSimpleSpecifyOutputDirectory/node/outdir/simple/m1.js +++ b/tests/baselines/reference/project/sourcerootUrlSimpleSpecifyOutputDirectory/node/outdir/simple/m1.js @@ -1,5 +1,5 @@ var m1_a1 = 10; -var m1_c1 = (function () { +var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; diff --git a/tests/baselines/reference/project/sourcerootUrlSimpleSpecifyOutputDirectory/node/outdir/simple/test.js b/tests/baselines/reference/project/sourcerootUrlSimpleSpecifyOutputDirectory/node/outdir/simple/test.js index 679b65b57336e..febaeedb0f144 100644 --- a/tests/baselines/reference/project/sourcerootUrlSimpleSpecifyOutputDirectory/node/outdir/simple/test.js +++ b/tests/baselines/reference/project/sourcerootUrlSimpleSpecifyOutputDirectory/node/outdir/simple/test.js @@ -1,6 +1,6 @@ /// var a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/sourcerootUrlSimpleSpecifyOutputFile/amd/bin/test.js b/tests/baselines/reference/project/sourcerootUrlSimpleSpecifyOutputFile/amd/bin/test.js index 481c10d1a06ad..8e0b6a1a8ff13 100644 --- a/tests/baselines/reference/project/sourcerootUrlSimpleSpecifyOutputFile/amd/bin/test.js +++ b/tests/baselines/reference/project/sourcerootUrlSimpleSpecifyOutputFile/amd/bin/test.js @@ -1,5 +1,5 @@ var m1_a1 = 10; -var m1_c1 = (function () { +var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; @@ -10,7 +10,7 @@ function m1_f1() { } /// var a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/sourcerootUrlSimpleSpecifyOutputFile/node/bin/test.js b/tests/baselines/reference/project/sourcerootUrlSimpleSpecifyOutputFile/node/bin/test.js index 481c10d1a06ad..8e0b6a1a8ff13 100644 --- a/tests/baselines/reference/project/sourcerootUrlSimpleSpecifyOutputFile/node/bin/test.js +++ b/tests/baselines/reference/project/sourcerootUrlSimpleSpecifyOutputFile/node/bin/test.js @@ -1,5 +1,5 @@ var m1_a1 = 10; -var m1_c1 = (function () { +var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; @@ -10,7 +10,7 @@ function m1_f1() { } /// var a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/sourcerootUrlSingleFileNoOutdir/amd/test.js b/tests/baselines/reference/project/sourcerootUrlSingleFileNoOutdir/amd/test.js index e5a1c12a7323d..eea2aa31cd4a1 100644 --- a/tests/baselines/reference/project/sourcerootUrlSingleFileNoOutdir/amd/test.js +++ b/tests/baselines/reference/project/sourcerootUrlSingleFileNoOutdir/amd/test.js @@ -1,5 +1,5 @@ var a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/sourcerootUrlSingleFileNoOutdir/node/test.js b/tests/baselines/reference/project/sourcerootUrlSingleFileNoOutdir/node/test.js index e5a1c12a7323d..eea2aa31cd4a1 100644 --- a/tests/baselines/reference/project/sourcerootUrlSingleFileNoOutdir/node/test.js +++ b/tests/baselines/reference/project/sourcerootUrlSingleFileNoOutdir/node/test.js @@ -1,5 +1,5 @@ var a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/sourcerootUrlSingleFileSpecifyOutputDirectory/amd/outdir/simple/test.js b/tests/baselines/reference/project/sourcerootUrlSingleFileSpecifyOutputDirectory/amd/outdir/simple/test.js index e5a1c12a7323d..eea2aa31cd4a1 100644 --- a/tests/baselines/reference/project/sourcerootUrlSingleFileSpecifyOutputDirectory/amd/outdir/simple/test.js +++ b/tests/baselines/reference/project/sourcerootUrlSingleFileSpecifyOutputDirectory/amd/outdir/simple/test.js @@ -1,5 +1,5 @@ var a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/sourcerootUrlSingleFileSpecifyOutputDirectory/node/outdir/simple/test.js b/tests/baselines/reference/project/sourcerootUrlSingleFileSpecifyOutputDirectory/node/outdir/simple/test.js index e5a1c12a7323d..eea2aa31cd4a1 100644 --- a/tests/baselines/reference/project/sourcerootUrlSingleFileSpecifyOutputDirectory/node/outdir/simple/test.js +++ b/tests/baselines/reference/project/sourcerootUrlSingleFileSpecifyOutputDirectory/node/outdir/simple/test.js @@ -1,5 +1,5 @@ var a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/sourcerootUrlSingleFileSpecifyOutputFile/amd/bin/test.js b/tests/baselines/reference/project/sourcerootUrlSingleFileSpecifyOutputFile/amd/bin/test.js index e5a1c12a7323d..eea2aa31cd4a1 100644 --- a/tests/baselines/reference/project/sourcerootUrlSingleFileSpecifyOutputFile/amd/bin/test.js +++ b/tests/baselines/reference/project/sourcerootUrlSingleFileSpecifyOutputFile/amd/bin/test.js @@ -1,5 +1,5 @@ var a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/sourcerootUrlSingleFileSpecifyOutputFile/node/bin/test.js b/tests/baselines/reference/project/sourcerootUrlSingleFileSpecifyOutputFile/node/bin/test.js index e5a1c12a7323d..eea2aa31cd4a1 100644 --- a/tests/baselines/reference/project/sourcerootUrlSingleFileSpecifyOutputFile/node/bin/test.js +++ b/tests/baselines/reference/project/sourcerootUrlSingleFileSpecifyOutputFile/node/bin/test.js @@ -1,5 +1,5 @@ var a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/sourcerootUrlSubfolderNoOutdir/amd/ref/m1.js b/tests/baselines/reference/project/sourcerootUrlSubfolderNoOutdir/amd/ref/m1.js index b7283f7fd8830..4293cda52dba5 100644 --- a/tests/baselines/reference/project/sourcerootUrlSubfolderNoOutdir/amd/ref/m1.js +++ b/tests/baselines/reference/project/sourcerootUrlSubfolderNoOutdir/amd/ref/m1.js @@ -1,5 +1,5 @@ var m1_a1 = 10; -var m1_c1 = (function () { +var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; diff --git a/tests/baselines/reference/project/sourcerootUrlSubfolderNoOutdir/amd/test.js b/tests/baselines/reference/project/sourcerootUrlSubfolderNoOutdir/amd/test.js index 408b7e46f6182..72395b6e4c854 100644 --- a/tests/baselines/reference/project/sourcerootUrlSubfolderNoOutdir/amd/test.js +++ b/tests/baselines/reference/project/sourcerootUrlSubfolderNoOutdir/amd/test.js @@ -1,6 +1,6 @@ /// var a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/sourcerootUrlSubfolderNoOutdir/node/ref/m1.js b/tests/baselines/reference/project/sourcerootUrlSubfolderNoOutdir/node/ref/m1.js index b7283f7fd8830..4293cda52dba5 100644 --- a/tests/baselines/reference/project/sourcerootUrlSubfolderNoOutdir/node/ref/m1.js +++ b/tests/baselines/reference/project/sourcerootUrlSubfolderNoOutdir/node/ref/m1.js @@ -1,5 +1,5 @@ var m1_a1 = 10; -var m1_c1 = (function () { +var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; diff --git a/tests/baselines/reference/project/sourcerootUrlSubfolderNoOutdir/node/test.js b/tests/baselines/reference/project/sourcerootUrlSubfolderNoOutdir/node/test.js index 408b7e46f6182..72395b6e4c854 100644 --- a/tests/baselines/reference/project/sourcerootUrlSubfolderNoOutdir/node/test.js +++ b/tests/baselines/reference/project/sourcerootUrlSubfolderNoOutdir/node/test.js @@ -1,6 +1,6 @@ /// var a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/sourcerootUrlSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js b/tests/baselines/reference/project/sourcerootUrlSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js index b7283f7fd8830..4293cda52dba5 100644 --- a/tests/baselines/reference/project/sourcerootUrlSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js +++ b/tests/baselines/reference/project/sourcerootUrlSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js @@ -1,5 +1,5 @@ var m1_a1 = 10; -var m1_c1 = (function () { +var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; diff --git a/tests/baselines/reference/project/sourcerootUrlSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js b/tests/baselines/reference/project/sourcerootUrlSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js index 408b7e46f6182..72395b6e4c854 100644 --- a/tests/baselines/reference/project/sourcerootUrlSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js +++ b/tests/baselines/reference/project/sourcerootUrlSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js @@ -1,6 +1,6 @@ /// var a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/sourcerootUrlSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js b/tests/baselines/reference/project/sourcerootUrlSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js index b7283f7fd8830..4293cda52dba5 100644 --- a/tests/baselines/reference/project/sourcerootUrlSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js +++ b/tests/baselines/reference/project/sourcerootUrlSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js @@ -1,5 +1,5 @@ var m1_a1 = 10; -var m1_c1 = (function () { +var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; diff --git a/tests/baselines/reference/project/sourcerootUrlSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js b/tests/baselines/reference/project/sourcerootUrlSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js index 408b7e46f6182..72395b6e4c854 100644 --- a/tests/baselines/reference/project/sourcerootUrlSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js +++ b/tests/baselines/reference/project/sourcerootUrlSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js @@ -1,6 +1,6 @@ /// var a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/sourcerootUrlSubfolderSpecifyOutputFile/amd/bin/test.js b/tests/baselines/reference/project/sourcerootUrlSubfolderSpecifyOutputFile/amd/bin/test.js index a456603674661..7c6145986c66a 100644 --- a/tests/baselines/reference/project/sourcerootUrlSubfolderSpecifyOutputFile/amd/bin/test.js +++ b/tests/baselines/reference/project/sourcerootUrlSubfolderSpecifyOutputFile/amd/bin/test.js @@ -1,5 +1,5 @@ var m1_a1 = 10; -var m1_c1 = (function () { +var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; @@ -10,7 +10,7 @@ function m1_f1() { } /// var a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/sourcerootUrlSubfolderSpecifyOutputFile/node/bin/test.js b/tests/baselines/reference/project/sourcerootUrlSubfolderSpecifyOutputFile/node/bin/test.js index a456603674661..7c6145986c66a 100644 --- a/tests/baselines/reference/project/sourcerootUrlSubfolderSpecifyOutputFile/node/bin/test.js +++ b/tests/baselines/reference/project/sourcerootUrlSubfolderSpecifyOutputFile/node/bin/test.js @@ -1,5 +1,5 @@ var m1_a1 = 10; -var m1_c1 = (function () { +var m1_c1 = /** @class */ (function () { function m1_c1() { } return m1_c1; @@ -10,7 +10,7 @@ function m1_f1() { } /// var a1 = 10; -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/project/visibilityOfTypeUsedAcrossModules/amd/fs.js b/tests/baselines/reference/project/visibilityOfTypeUsedAcrossModules/amd/fs.js index 66facecde7f6b..b07077a35d0e0 100644 --- a/tests/baselines/reference/project/visibilityOfTypeUsedAcrossModules/amd/fs.js +++ b/tests/baselines/reference/project/visibilityOfTypeUsedAcrossModules/amd/fs.js @@ -1,7 +1,7 @@ define(["require", "exports"], function (require, exports) { "use strict"; exports.__esModule = true; - var RM = (function () { + var RM = /** @class */ (function () { function RM() { } RM.prototype.getName = function () { diff --git a/tests/baselines/reference/project/visibilityOfTypeUsedAcrossModules/node/fs.js b/tests/baselines/reference/project/visibilityOfTypeUsedAcrossModules/node/fs.js index 221c232222727..8baa948ca7aea 100644 --- a/tests/baselines/reference/project/visibilityOfTypeUsedAcrossModules/node/fs.js +++ b/tests/baselines/reference/project/visibilityOfTypeUsedAcrossModules/node/fs.js @@ -1,6 +1,6 @@ "use strict"; exports.__esModule = true; -var RM = (function () { +var RM = /** @class */ (function () { function RM() { } RM.prototype.getName = function () { diff --git a/tests/baselines/reference/promiseChaining.js b/tests/baselines/reference/promiseChaining.js index afa55acb89457..3e4c73ff41fed 100644 --- a/tests/baselines/reference/promiseChaining.js +++ b/tests/baselines/reference/promiseChaining.js @@ -12,7 +12,7 @@ class Chain { //// [promiseChaining.js] -var Chain = (function () { +var Chain = /** @class */ (function () { function Chain(value) { this.value = value; } diff --git a/tests/baselines/reference/promiseChaining1.js b/tests/baselines/reference/promiseChaining1.js index ad2ddcf694b02..4491f973ad1b4 100644 --- a/tests/baselines/reference/promiseChaining1.js +++ b/tests/baselines/reference/promiseChaining1.js @@ -12,7 +12,7 @@ class Chain2 { //// [promiseChaining1.js] // same example but with constraints on each type parameter -var Chain2 = (function () { +var Chain2 = /** @class */ (function () { function Chain2(value) { this.value = value; } diff --git a/tests/baselines/reference/promiseChaining2.js b/tests/baselines/reference/promiseChaining2.js index d9ae5e8099c0f..3bd3ebc517c05 100644 --- a/tests/baselines/reference/promiseChaining2.js +++ b/tests/baselines/reference/promiseChaining2.js @@ -12,7 +12,7 @@ class Chain2 { //// [promiseChaining2.js] // same example but with constraints on each type parameter -var Chain2 = (function () { +var Chain2 = /** @class */ (function () { function Chain2(value) { this.value = value; } diff --git a/tests/baselines/reference/properties.js b/tests/baselines/reference/properties.js index 70bb62dd09d54..0b81d7671cdbb 100644 --- a/tests/baselines/reference/properties.js +++ b/tests/baselines/reference/properties.js @@ -13,7 +13,7 @@ class MyClass } //// [properties.js] -var MyClass = (function () { +var MyClass = /** @class */ (function () { function MyClass() { } Object.defineProperty(MyClass.prototype, "Count", { diff --git a/tests/baselines/reference/properties.sourcemap.txt b/tests/baselines/reference/properties.sourcemap.txt index 0afa8514e6636..762044e5c2b66 100644 --- a/tests/baselines/reference/properties.sourcemap.txt +++ b/tests/baselines/reference/properties.sourcemap.txt @@ -8,7 +8,7 @@ sources: properties.ts emittedFile:tests/cases/compiler/properties.js sourceFile:properties.ts ------------------------------------------------------------------- ->>>var MyClass = (function () { +>>>var MyClass = /** @class */ (function () { 1 > 2 >^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > diff --git a/tests/baselines/reference/propertiesAndIndexers.js b/tests/baselines/reference/propertiesAndIndexers.js index 2c678ba258f22..2a33ee07df0d8 100644 --- a/tests/baselines/reference/propertiesAndIndexers.js +++ b/tests/baselines/reference/propertiesAndIndexers.js @@ -62,12 +62,12 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var P = (function () { +var P = /** @class */ (function () { function P() { } return P; }()); -var Q = (function (_super) { +var Q = /** @class */ (function (_super) { __extends(Q, _super); function Q() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/propertiesAndIndexersForNumericNames.js b/tests/baselines/reference/propertiesAndIndexersForNumericNames.js index 409107960b3c4..32ca73a85f05e 100644 --- a/tests/baselines/reference/propertiesAndIndexersForNumericNames.js +++ b/tests/baselines/reference/propertiesAndIndexersForNumericNames.js @@ -43,7 +43,7 @@ class C { //// [propertiesAndIndexersForNumericNames.js] -var C = (function () { +var C = /** @class */ (function () { function C() { // These all have numeric names; they should error // because their types are not compatible with the numeric indexer. diff --git a/tests/baselines/reference/propertyAccess.js b/tests/baselines/reference/propertyAccess.js index 5904d66c372bb..4d8f5fb4c0864 100644 --- a/tests/baselines/reference/propertyAccess.js +++ b/tests/baselines/reference/propertyAccess.js @@ -161,12 +161,12 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var A = (function () { +var A = /** @class */ (function () { function A() { } return A; }()); -var B = (function (_super) { +var B = /** @class */ (function (_super) { __extends(B, _super); function B() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/propertyAccessOnTypeParameterWithConstraints.js b/tests/baselines/reference/propertyAccessOnTypeParameterWithConstraints.js index 63f91ae4f44c7..5b80071464d64 100644 --- a/tests/baselines/reference/propertyAccessOnTypeParameterWithConstraints.js +++ b/tests/baselines/reference/propertyAccessOnTypeParameterWithConstraints.js @@ -37,7 +37,7 @@ var r4 = b.foo(new Date()); //// [propertyAccessOnTypeParameterWithConstraints.js] // generic types should behave as if they have properties of their constraint type // no errors expected -var C = (function () { +var C = /** @class */ (function () { function C() { } C.prototype.f = function () { diff --git a/tests/baselines/reference/propertyAccessOnTypeParameterWithConstraints2.js b/tests/baselines/reference/propertyAccessOnTypeParameterWithConstraints2.js index 08e1a9ceb1175..f78cbdb15eb59 100644 --- a/tests/baselines/reference/propertyAccessOnTypeParameterWithConstraints2.js +++ b/tests/baselines/reference/propertyAccessOnTypeParameterWithConstraints2.js @@ -93,13 +93,13 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var A = (function () { +var A = /** @class */ (function () { function A() { } A.prototype.foo = function () { return ''; }; return A; }()); -var B = (function (_super) { +var B = /** @class */ (function (_super) { __extends(B, _super); function B() { return _super !== null && _super.apply(this, arguments) || this; @@ -109,7 +109,7 @@ var B = (function (_super) { }; return B; }(A)); -var C = (function () { +var C = /** @class */ (function () { function C() { } C.prototype.f = function () { diff --git a/tests/baselines/reference/propertyAccessOnTypeParameterWithConstraints3.js b/tests/baselines/reference/propertyAccessOnTypeParameterWithConstraints3.js index 0d94519795739..be0387c62f86d 100644 --- a/tests/baselines/reference/propertyAccessOnTypeParameterWithConstraints3.js +++ b/tests/baselines/reference/propertyAccessOnTypeParameterWithConstraints3.js @@ -68,13 +68,13 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var A = (function () { +var A = /** @class */ (function () { function A() { } A.prototype.foo = function () { return ''; }; return A; }()); -var B = (function (_super) { +var B = /** @class */ (function (_super) { __extends(B, _super); function B() { return _super !== null && _super.apply(this, arguments) || this; @@ -84,7 +84,7 @@ var B = (function (_super) { }; return B; }(A)); -var C = (function () { +var C = /** @class */ (function () { function C() { } C.prototype.f = function () { diff --git a/tests/baselines/reference/propertyAccessOnTypeParameterWithConstraints4.js b/tests/baselines/reference/propertyAccessOnTypeParameterWithConstraints4.js index 3c5a87e4d0603..c5ded1a2c2b44 100644 --- a/tests/baselines/reference/propertyAccessOnTypeParameterWithConstraints4.js +++ b/tests/baselines/reference/propertyAccessOnTypeParameterWithConstraints4.js @@ -33,7 +33,7 @@ var b = { var r4 = b.foo(new Date()); //// [propertyAccessOnTypeParameterWithConstraints4.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } C.prototype.f = function () { diff --git a/tests/baselines/reference/propertyAccessOnTypeParameterWithConstraints5.js b/tests/baselines/reference/propertyAccessOnTypeParameterWithConstraints5.js index a7cc39b7f0542..6ea9afc05c702 100644 --- a/tests/baselines/reference/propertyAccessOnTypeParameterWithConstraints5.js +++ b/tests/baselines/reference/propertyAccessOnTypeParameterWithConstraints5.js @@ -55,13 +55,13 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var A = (function () { +var A = /** @class */ (function () { function A() { } A.prototype.foo = function () { return ''; }; return A; }()); -var B = (function (_super) { +var B = /** @class */ (function (_super) { __extends(B, _super); function B() { return _super !== null && _super.apply(this, arguments) || this; @@ -71,7 +71,7 @@ var B = (function (_super) { }; return B; }(A)); -var C = (function () { +var C = /** @class */ (function () { function C() { } C.prototype.f = function () { diff --git a/tests/baselines/reference/propertyAccessOnTypeParameterWithoutConstraints.js b/tests/baselines/reference/propertyAccessOnTypeParameterWithoutConstraints.js index 0e5a1ee7baea4..45562e2c3b707 100644 --- a/tests/baselines/reference/propertyAccessOnTypeParameterWithoutConstraints.js +++ b/tests/baselines/reference/propertyAccessOnTypeParameterWithoutConstraints.js @@ -32,7 +32,7 @@ var b = { var r4 = b.foo(1); //// [propertyAccessOnTypeParameterWithoutConstraints.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } C.prototype.f = function () { diff --git a/tests/baselines/reference/propertyAccessibility1.js b/tests/baselines/reference/propertyAccessibility1.js index 3ba7b297cedd0..8806cbfc3f2a5 100644 --- a/tests/baselines/reference/propertyAccessibility1.js +++ b/tests/baselines/reference/propertyAccessibility1.js @@ -7,7 +7,7 @@ f.privProp; //// [propertyAccessibility1.js] -var Foo = (function () { +var Foo = /** @class */ (function () { function Foo() { this.privProp = 0; } diff --git a/tests/baselines/reference/propertyAccessibility2.js b/tests/baselines/reference/propertyAccessibility2.js index afce6c4c24a79..ddd028497f891 100644 --- a/tests/baselines/reference/propertyAccessibility2.js +++ b/tests/baselines/reference/propertyAccessibility2.js @@ -6,7 +6,7 @@ var c = C.x; //// [propertyAccessibility2.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } C.x = 1; diff --git a/tests/baselines/reference/propertyAndAccessorWithSameName.js b/tests/baselines/reference/propertyAndAccessorWithSameName.js index ece999fac5403..14c08ed2d6571 100644 --- a/tests/baselines/reference/propertyAndAccessorWithSameName.js +++ b/tests/baselines/reference/propertyAndAccessorWithSameName.js @@ -20,7 +20,7 @@ class E { } //// [propertyAndAccessorWithSameName.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } Object.defineProperty(C.prototype, "x", { @@ -32,7 +32,7 @@ var C = (function () { }); return C; }()); -var D = (function () { +var D = /** @class */ (function () { function D() { } Object.defineProperty(D.prototype, "x", { @@ -43,7 +43,7 @@ var D = (function () { }); return D; }()); -var E = (function () { +var E = /** @class */ (function () { function E() { } Object.defineProperty(E.prototype, "x", { diff --git a/tests/baselines/reference/propertyAndFunctionWithSameName.js b/tests/baselines/reference/propertyAndFunctionWithSameName.js index bb979735172ad..c7250ccdaa21b 100644 --- a/tests/baselines/reference/propertyAndFunctionWithSameName.js +++ b/tests/baselines/reference/propertyAndFunctionWithSameName.js @@ -12,7 +12,7 @@ class D { } //// [propertyAndFunctionWithSameName.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } C.prototype.x = function () { @@ -20,7 +20,7 @@ var C = (function () { }; return C; }()); -var D = (function () { +var D = /** @class */ (function () { function D() { } D.prototype.x = function (v) { }; // error diff --git a/tests/baselines/reference/propertyIdentityWithPrivacyMismatch.js b/tests/baselines/reference/propertyIdentityWithPrivacyMismatch.js index 457f929fe623d..fd3edbcb52cbe 100644 --- a/tests/baselines/reference/propertyIdentityWithPrivacyMismatch.js +++ b/tests/baselines/reference/propertyIdentityWithPrivacyMismatch.js @@ -34,12 +34,12 @@ define(["require", "exports"], function (require, exports) { exports.__esModule = true; var x; var x; // Should be error (mod1.Foo !== mod2.Foo) - var Foo1 = (function () { + var Foo1 = /** @class */ (function () { function Foo1() { } return Foo1; }()); - var Foo2 = (function () { + var Foo2 = /** @class */ (function () { function Foo2() { } return Foo2; diff --git a/tests/baselines/reference/propertyNameWithoutTypeAnnotation.js b/tests/baselines/reference/propertyNameWithoutTypeAnnotation.js index f9e106a378652..5f5bfb903e653 100644 --- a/tests/baselines/reference/propertyNameWithoutTypeAnnotation.js +++ b/tests/baselines/reference/propertyNameWithoutTypeAnnotation.js @@ -22,7 +22,7 @@ var r3 = a.foo; var r4 = b.foo; //// [propertyNameWithoutTypeAnnotation.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } return C; diff --git a/tests/baselines/reference/propertyNamedPrototype.js b/tests/baselines/reference/propertyNamedPrototype.js index 34a967a0c916b..62522cbfced74 100644 --- a/tests/baselines/reference/propertyNamedPrototype.js +++ b/tests/baselines/reference/propertyNamedPrototype.js @@ -5,7 +5,7 @@ class C { } //// [propertyNamedPrototype.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } return C; diff --git a/tests/baselines/reference/propertyNamesOfReservedWords.js b/tests/baselines/reference/propertyNamesOfReservedWords.js index 4c333f48cbb92..c640ab64a1667 100644 --- a/tests/baselines/reference/propertyNamesOfReservedWords.js +++ b/tests/baselines/reference/propertyNamesOfReservedWords.js @@ -277,7 +277,7 @@ var r7 = E.abstract; var r8 = E.as; //// [propertyNamesOfReservedWords.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } return C; diff --git a/tests/baselines/reference/propertyNamesWithStringLiteral.js b/tests/baselines/reference/propertyNamesWithStringLiteral.js index f17ddb84dc39c..9066432a24129 100644 --- a/tests/baselines/reference/propertyNamesWithStringLiteral.js +++ b/tests/baselines/reference/propertyNamesWithStringLiteral.js @@ -17,7 +17,7 @@ var a = Color.namedColors["pale blue"]; // should not error //// [propertyNamesWithStringLiteral.js] -var _Color = (function () { +var _Color = /** @class */ (function () { function _Color() { } return _Color; diff --git a/tests/baselines/reference/propertyOrdering.js b/tests/baselines/reference/propertyOrdering.js index 190117b66f44f..469a32dd9e45c 100644 --- a/tests/baselines/reference/propertyOrdering.js +++ b/tests/baselines/reference/propertyOrdering.js @@ -24,7 +24,7 @@ class Bar { //// [propertyOrdering.js] -var Foo = (function () { +var Foo = /** @class */ (function () { function Foo(store) { this._store = store; // no repro if this is first line in class body } @@ -34,7 +34,7 @@ var Foo = (function () { Foo.prototype.bar = function () { return this.store; }; // should be an error return Foo; }()); -var Bar = (function () { +var Bar = /** @class */ (function () { function Bar(store) { this._store = store; } diff --git a/tests/baselines/reference/propertyOrdering2.js b/tests/baselines/reference/propertyOrdering2.js index 783e7c8d00088..ac102157fcb20 100644 --- a/tests/baselines/reference/propertyOrdering2.js +++ b/tests/baselines/reference/propertyOrdering2.js @@ -9,7 +9,7 @@ class Foo { //// [propertyOrdering2.js] -var Foo = (function () { +var Foo = /** @class */ (function () { function Foo(x, y) { this.x = x; } diff --git a/tests/baselines/reference/propertyParameterWithQuestionMark.js b/tests/baselines/reference/propertyParameterWithQuestionMark.js index b72638387ddf4..c3990ecff86d8 100644 --- a/tests/baselines/reference/propertyParameterWithQuestionMark.js +++ b/tests/baselines/reference/propertyParameterWithQuestionMark.js @@ -10,7 +10,7 @@ v = v2; // Should succeed var v3: { x } = new C; // Should fail //// [propertyParameterWithQuestionMark.js] -var C = (function () { +var C = /** @class */ (function () { function C(x) { this.x = x; } diff --git a/tests/baselines/reference/propertyWrappedInTry.js b/tests/baselines/reference/propertyWrappedInTry.js index 96684f2b453e1..261fa54fae5bf 100644 --- a/tests/baselines/reference/propertyWrappedInTry.js +++ b/tests/baselines/reference/propertyWrappedInTry.js @@ -20,7 +20,7 @@ class Foo { //// [propertyWrappedInTry.js] -var Foo = (function () { +var Foo = /** @class */ (function () { function Foo() { } return Foo; diff --git a/tests/baselines/reference/protectedClassPropertyAccessibleWithinClass.js b/tests/baselines/reference/protectedClassPropertyAccessibleWithinClass.js index 85f63e11c68be..cd663ccc009f3 100644 --- a/tests/baselines/reference/protectedClassPropertyAccessibleWithinClass.js +++ b/tests/baselines/reference/protectedClassPropertyAccessibleWithinClass.js @@ -33,7 +33,7 @@ class C2 { //// [protectedClassPropertyAccessibleWithinClass.js] // no errors -var C = (function () { +var C = /** @class */ (function () { function C() { } Object.defineProperty(C.prototype, "y", { @@ -54,7 +54,7 @@ var C = (function () { return C; }()); // added level of function nesting -var C2 = (function () { +var C2 = /** @class */ (function () { function C2() { } Object.defineProperty(C2.prototype, "y", { diff --git a/tests/baselines/reference/protectedClassPropertyAccessibleWithinNestedClass.js b/tests/baselines/reference/protectedClassPropertyAccessibleWithinNestedClass.js index 2bc544e046ed9..aa3fc8961856f 100644 --- a/tests/baselines/reference/protectedClassPropertyAccessibleWithinNestedClass.js +++ b/tests/baselines/reference/protectedClassPropertyAccessibleWithinNestedClass.js @@ -39,7 +39,7 @@ class C { //// [protectedClassPropertyAccessibleWithinNestedClass.js] // no errors -var C = (function () { +var C = /** @class */ (function () { function C() { } Object.defineProperty(C.prototype, "y", { @@ -58,7 +58,7 @@ var C = (function () { C.foo = function () { return this.foo; }; C.bar = function () { this.foo(); }; C.prototype.bar = function () { - var C2 = (function () { + var C2 = /** @class */ (function () { function C2() { } C2.prototype.foo = function () { diff --git a/tests/baselines/reference/protectedClassPropertyAccessibleWithinNestedSubclass.js b/tests/baselines/reference/protectedClassPropertyAccessibleWithinNestedSubclass.js index f15f9a5b669a3..69752adc9dcd2 100644 --- a/tests/baselines/reference/protectedClassPropertyAccessibleWithinNestedSubclass.js +++ b/tests/baselines/reference/protectedClassPropertyAccessibleWithinNestedSubclass.js @@ -48,12 +48,12 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var B = (function () { +var B = /** @class */ (function () { function B() { } return B; }()); -var C = (function (_super) { +var C = /** @class */ (function (_super) { __extends(C, _super); function C() { return _super !== null && _super.apply(this, arguments) || this; @@ -74,7 +74,7 @@ var C = (function (_super) { C.foo = function () { return this.x; }; C.bar = function () { this.foo(); }; C.prototype.bar = function () { - var D = (function () { + var D = /** @class */ (function () { function D() { } D.prototype.foo = function () { @@ -94,7 +94,7 @@ var C = (function (_super) { }; return C; }(B)); -var E = (function (_super) { +var E = /** @class */ (function (_super) { __extends(E, _super); function E() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/protectedClassPropertyAccessibleWithinNestedSubclass1.js b/tests/baselines/reference/protectedClassPropertyAccessibleWithinNestedSubclass1.js index 8273b7e31bde2..d0e32470b81fe 100644 --- a/tests/baselines/reference/protectedClassPropertyAccessibleWithinNestedSubclass1.js +++ b/tests/baselines/reference/protectedClassPropertyAccessibleWithinNestedSubclass1.js @@ -125,11 +125,11 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var Base = (function () { +var Base = /** @class */ (function () { function Base() { } Base.prototype.method = function () { - var A = (function () { + var A = /** @class */ (function () { function A() { } A.prototype.methoda = function () { @@ -149,13 +149,13 @@ var Base = (function () { }; return Base; }()); -var Derived1 = (function (_super) { +var Derived1 = /** @class */ (function (_super) { __extends(Derived1, _super); function Derived1() { return _super !== null && _super.apply(this, arguments) || this; } Derived1.prototype.method1 = function () { - var B = (function () { + var B = /** @class */ (function () { function B() { } B.prototype.method1b = function () { @@ -175,13 +175,13 @@ var Derived1 = (function (_super) { }; return Derived1; }(Base)); -var Derived2 = (function (_super) { +var Derived2 = /** @class */ (function (_super) { __extends(Derived2, _super); function Derived2() { return _super !== null && _super.apply(this, arguments) || this; } Derived2.prototype.method2 = function () { - var C = (function () { + var C = /** @class */ (function () { function C() { } C.prototype.method2c = function () { @@ -201,13 +201,13 @@ var Derived2 = (function (_super) { }; return Derived2; }(Base)); -var Derived3 = (function (_super) { +var Derived3 = /** @class */ (function (_super) { __extends(Derived3, _super); function Derived3() { return _super !== null && _super.apply(this, arguments) || this; } Derived3.prototype.method3 = function () { - var D = (function () { + var D = /** @class */ (function () { function D() { } D.prototype.method3d = function () { @@ -227,13 +227,13 @@ var Derived3 = (function (_super) { }; return Derived3; }(Derived1)); -var Derived4 = (function (_super) { +var Derived4 = /** @class */ (function (_super) { __extends(Derived4, _super); function Derived4() { return _super !== null && _super.apply(this, arguments) || this; } Derived4.prototype.method4 = function () { - var E = (function () { + var E = /** @class */ (function () { function E() { } E.prototype.method4e = function () { diff --git a/tests/baselines/reference/protectedClassPropertyAccessibleWithinSubclass.js b/tests/baselines/reference/protectedClassPropertyAccessibleWithinSubclass.js index a2d35914cbe3c..da69a5e3ef463 100644 --- a/tests/baselines/reference/protectedClassPropertyAccessibleWithinSubclass.js +++ b/tests/baselines/reference/protectedClassPropertyAccessibleWithinSubclass.js @@ -31,12 +31,12 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var B = (function () { +var B = /** @class */ (function () { function B() { } return B; }()); -var C = (function (_super) { +var C = /** @class */ (function (_super) { __extends(C, _super); function C() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/protectedClassPropertyAccessibleWithinSubclass2.js b/tests/baselines/reference/protectedClassPropertyAccessibleWithinSubclass2.js index 7a9ee9f2268fd..ca8aed214ab62 100644 --- a/tests/baselines/reference/protectedClassPropertyAccessibleWithinSubclass2.js +++ b/tests/baselines/reference/protectedClassPropertyAccessibleWithinSubclass2.js @@ -105,7 +105,7 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var Base = (function () { +var Base = /** @class */ (function () { function Base() { } Base.prototype.method = function () { @@ -122,7 +122,7 @@ var Base = (function () { }; return Base; }()); -var Derived1 = (function (_super) { +var Derived1 = /** @class */ (function (_super) { __extends(Derived1, _super); function Derived1() { return _super !== null && _super.apply(this, arguments) || this; @@ -141,7 +141,7 @@ var Derived1 = (function (_super) { }; return Derived1; }(Base)); -var Derived2 = (function (_super) { +var Derived2 = /** @class */ (function (_super) { __extends(Derived2, _super); function Derived2() { return _super !== null && _super.apply(this, arguments) || this; @@ -160,7 +160,7 @@ var Derived2 = (function (_super) { }; return Derived2; }(Base)); -var Derived3 = (function (_super) { +var Derived3 = /** @class */ (function (_super) { __extends(Derived3, _super); function Derived3() { return _super !== null && _super.apply(this, arguments) || this; @@ -179,7 +179,7 @@ var Derived3 = (function (_super) { }; return Derived3; }(Derived1)); -var Derived4 = (function (_super) { +var Derived4 = /** @class */ (function (_super) { __extends(Derived4, _super); function Derived4() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/protectedClassPropertyAccessibleWithinSubclass3.js b/tests/baselines/reference/protectedClassPropertyAccessibleWithinSubclass3.js index 2b9faf6282ca5..2501a0d555ddc 100644 --- a/tests/baselines/reference/protectedClassPropertyAccessibleWithinSubclass3.js +++ b/tests/baselines/reference/protectedClassPropertyAccessibleWithinSubclass3.js @@ -24,7 +24,7 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var Base = (function () { +var Base = /** @class */ (function () { function Base() { } Base.prototype.method = function () { @@ -32,7 +32,7 @@ var Base = (function () { }; return Base; }()); -var Derived = (function (_super) { +var Derived = /** @class */ (function (_super) { __extends(Derived, _super); function Derived() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/protectedInstanceMemberAccessibility.js b/tests/baselines/reference/protectedInstanceMemberAccessibility.js index 6617636aa45c0..86ce4047a25c5 100644 --- a/tests/baselines/reference/protectedInstanceMemberAccessibility.js +++ b/tests/baselines/reference/protectedInstanceMemberAccessibility.js @@ -55,7 +55,7 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var A = (function () { +var A = /** @class */ (function () { function A() { } A.prototype.f = function () { @@ -63,7 +63,7 @@ var A = (function () { }; return A; }()); -var B = (function (_super) { +var B = /** @class */ (function (_super) { __extends(B, _super); function B() { return _super !== null && _super.apply(this, arguments) || this; @@ -95,7 +95,7 @@ var B = (function (_super) { }; return B; }(A)); -var C = (function (_super) { +var C = /** @class */ (function (_super) { __extends(C, _super); function C() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/protectedMembers.js b/tests/baselines/reference/protectedMembers.js index 7684ff8e658bd..2ef1759c150b8 100644 --- a/tests/baselines/reference/protectedMembers.js +++ b/tests/baselines/reference/protectedMembers.js @@ -127,7 +127,7 @@ var __extends = (this && this.__extends) || (function () { }; })(); // Class with protected members -var C1 = (function () { +var C1 = /** @class */ (function () { function C1() { } C1.prototype.f = function () { @@ -139,7 +139,7 @@ var C1 = (function () { return C1; }()); // Derived class accessing protected members -var C2 = (function (_super) { +var C2 = /** @class */ (function (_super) { __extends(C2, _super); function C2() { return _super !== null && _super.apply(this, arguments) || this; @@ -153,7 +153,7 @@ var C2 = (function (_super) { return C2; }(C1)); // Derived class making protected members public -var C3 = (function (_super) { +var C3 = /** @class */ (function (_super) { __extends(C3, _super); function C3() { return _super !== null && _super.apply(this, arguments) || this; @@ -184,19 +184,19 @@ c3.x; c3.f(); C3.sx; C3.sf(); -var A = (function () { +var A = /** @class */ (function () { function A() { } return A; }()); -var B = (function (_super) { +var B = /** @class */ (function (_super) { __extends(B, _super); function B() { return _super !== null && _super.apply(this, arguments) || this; } return B; }(A)); -var C = (function (_super) { +var C = /** @class */ (function (_super) { __extends(C, _super); function C() { return _super !== null && _super.apply(this, arguments) || this; @@ -210,24 +210,24 @@ var C = (function (_super) { }; return C; }(A)); -var D = (function (_super) { +var D = /** @class */ (function (_super) { __extends(D, _super); function D() { return _super !== null && _super.apply(this, arguments) || this; } return D; }(C)); -var CC = (function () { +var CC = /** @class */ (function () { function CC() { } return CC; }()); -var A1 = (function () { +var A1 = /** @class */ (function () { function A1() { } return A1; }()); -var B1 = (function () { +var B1 = /** @class */ (function () { function B1() { } return B1; @@ -236,25 +236,25 @@ var a1; var b1; a1 = b1; // Error, B1 doesn't derive from A1 b1 = a1; // Error, x is protected in A1 but public in B1 -var A2 = (function () { +var A2 = /** @class */ (function () { function A2() { } return A2; }()); -var B2 = (function (_super) { +var B2 = /** @class */ (function (_super) { __extends(B2, _super); function B2() { return _super !== null && _super.apply(this, arguments) || this; } return B2; }(A2)); -var A3 = (function () { +var A3 = /** @class */ (function () { function A3() { } return A3; }()); // Error x is protected in B3 but public in A3 -var B3 = (function (_super) { +var B3 = /** @class */ (function (_super) { __extends(B3, _super); function B3() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/protectedStaticClassPropertyAccessibleWithinSubclass.js b/tests/baselines/reference/protectedStaticClassPropertyAccessibleWithinSubclass.js index 238c0dc23841b..6653140183c22 100644 --- a/tests/baselines/reference/protectedStaticClassPropertyAccessibleWithinSubclass.js +++ b/tests/baselines/reference/protectedStaticClassPropertyAccessibleWithinSubclass.js @@ -54,7 +54,7 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var Base = (function () { +var Base = /** @class */ (function () { function Base() { } Base.staticMethod = function () { @@ -65,7 +65,7 @@ var Base = (function () { }; return Base; }()); -var Derived1 = (function (_super) { +var Derived1 = /** @class */ (function (_super) { __extends(Derived1, _super); function Derived1() { return _super !== null && _super.apply(this, arguments) || this; @@ -78,7 +78,7 @@ var Derived1 = (function (_super) { }; return Derived1; }(Base)); -var Derived2 = (function (_super) { +var Derived2 = /** @class */ (function (_super) { __extends(Derived2, _super); function Derived2() { return _super !== null && _super.apply(this, arguments) || this; @@ -91,7 +91,7 @@ var Derived2 = (function (_super) { }; return Derived2; }(Base)); -var Derived3 = (function (_super) { +var Derived3 = /** @class */ (function (_super) { __extends(Derived3, _super); function Derived3() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/protectedStaticClassPropertyAccessibleWithinSubclass2.js b/tests/baselines/reference/protectedStaticClassPropertyAccessibleWithinSubclass2.js index 969b7ebd7dc9c..0250054ac18aa 100644 --- a/tests/baselines/reference/protectedStaticClassPropertyAccessibleWithinSubclass2.js +++ b/tests/baselines/reference/protectedStaticClassPropertyAccessibleWithinSubclass2.js @@ -32,7 +32,7 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var Base = (function () { +var Base = /** @class */ (function () { function Base() { } Base.staticMethod = function () { @@ -40,7 +40,7 @@ var Base = (function () { }; return Base; }()); -var Derived1 = (function (_super) { +var Derived1 = /** @class */ (function (_super) { __extends(Derived1, _super); function Derived1() { return _super !== null && _super.apply(this, arguments) || this; @@ -51,7 +51,7 @@ var Derived1 = (function (_super) { }; return Derived1; }(Base)); -var Derived2 = (function (_super) { +var Derived2 = /** @class */ (function (_super) { __extends(Derived2, _super); function Derived2() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/protectedStaticNotAccessibleInClodule.js b/tests/baselines/reference/protectedStaticNotAccessibleInClodule.js index a141193840542..64b46eaa0e37b 100644 --- a/tests/baselines/reference/protectedStaticNotAccessibleInClodule.js +++ b/tests/baselines/reference/protectedStaticNotAccessibleInClodule.js @@ -13,7 +13,7 @@ module C { //// [protectedStaticNotAccessibleInClodule.js] // Any attempt to access a private property member outside the class body that contains its declaration results in a compile-time error. -var C = (function () { +var C = /** @class */ (function () { function C() { } return C; diff --git a/tests/baselines/reference/protoAsIndexInIndexExpression.js b/tests/baselines/reference/protoAsIndexInIndexExpression.js index 7805cebbee32d..d0d2eb52f7804 100644 --- a/tests/baselines/reference/protoAsIndexInIndexExpression.js +++ b/tests/baselines/reference/protoAsIndexInIndexExpression.js @@ -33,7 +33,7 @@ WorkspacePrototype['__proto__'] = EntityPrototype; var o = { "__proto__": 0 }; -var C = (function () { +var C = /** @class */ (function () { function C() { this["__proto__"] = 0; } diff --git a/tests/baselines/reference/protoInIndexer.js b/tests/baselines/reference/protoInIndexer.js index d1d47681e0c93..e37676a3c20ba 100644 --- a/tests/baselines/reference/protoInIndexer.js +++ b/tests/baselines/reference/protoInIndexer.js @@ -6,7 +6,7 @@ class X { } //// [protoInIndexer.js] -var X = (function () { +var X = /** @class */ (function () { function X() { this['__proto__'] = null; // used to cause ICE } diff --git a/tests/baselines/reference/prototypeInstantiatedWithBaseConstraint.js b/tests/baselines/reference/prototypeInstantiatedWithBaseConstraint.js index 3dd3a50321317..f4e74221fd8e1 100644 --- a/tests/baselines/reference/prototypeInstantiatedWithBaseConstraint.js +++ b/tests/baselines/reference/prototypeInstantiatedWithBaseConstraint.js @@ -6,7 +6,7 @@ class C { C.prototype.x.boo; // No error, prototype is instantiated to any //// [prototypeInstantiatedWithBaseConstraint.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } return C; diff --git a/tests/baselines/reference/publicIndexer.js b/tests/baselines/reference/publicIndexer.js index e55a6ace2c439..8b0b075bfed37 100644 --- a/tests/baselines/reference/publicIndexer.js +++ b/tests/baselines/reference/publicIndexer.js @@ -15,17 +15,17 @@ class E { //// [publicIndexer.js] // public indexers not allowed -var C = (function () { +var C = /** @class */ (function () { function C() { } return C; }()); -var D = (function () { +var D = /** @class */ (function () { function D() { } return D; }()); -var E = (function () { +var E = /** @class */ (function () { function E() { } return E; diff --git a/tests/baselines/reference/publicMemberImplementedAsPrivateInDerivedClass.js b/tests/baselines/reference/publicMemberImplementedAsPrivateInDerivedClass.js index fc8b07a52bdbd..fc8dfcb755ecf 100644 --- a/tests/baselines/reference/publicMemberImplementedAsPrivateInDerivedClass.js +++ b/tests/baselines/reference/publicMemberImplementedAsPrivateInDerivedClass.js @@ -8,7 +8,7 @@ class Foo implements Qux { //// [publicMemberImplementedAsPrivateInDerivedClass.js] -var Foo = (function () { +var Foo = /** @class */ (function () { function Foo() { } return Foo; diff --git a/tests/baselines/reference/qualifiedName_entity-name-resolution-does-not-affect-class-heritage.js b/tests/baselines/reference/qualifiedName_entity-name-resolution-does-not-affect-class-heritage.js index f7b49b4219a7f..255d0545ff7f7 100644 --- a/tests/baselines/reference/qualifiedName_entity-name-resolution-does-not-affect-class-heritage.js +++ b/tests/baselines/reference/qualifiedName_entity-name-resolution-does-not-affect-class-heritage.js @@ -21,7 +21,7 @@ var Alpha; (function (Alpha) { Alpha.x = 100; })(Alpha || (Alpha = {})); -var Beta = (function (_super) { +var Beta = /** @class */ (function (_super) { __extends(Beta, _super); function Beta() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/quotedAccessorName1.js b/tests/baselines/reference/quotedAccessorName1.js index fbc47ae18d29b..2a55f13e0de24 100644 --- a/tests/baselines/reference/quotedAccessorName1.js +++ b/tests/baselines/reference/quotedAccessorName1.js @@ -4,7 +4,7 @@ class C { } //// [quotedAccessorName1.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } Object.defineProperty(C.prototype, "foo", { diff --git a/tests/baselines/reference/quotedAccessorName2.js b/tests/baselines/reference/quotedAccessorName2.js index a5a3cb3f59813..c8f9a6024d811 100644 --- a/tests/baselines/reference/quotedAccessorName2.js +++ b/tests/baselines/reference/quotedAccessorName2.js @@ -4,7 +4,7 @@ class C { } //// [quotedAccessorName2.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } Object.defineProperty(C, "foo", { diff --git a/tests/baselines/reference/quotedFunctionName1.js b/tests/baselines/reference/quotedFunctionName1.js index f58d154bc7f96..d85262e8a42be 100644 --- a/tests/baselines/reference/quotedFunctionName1.js +++ b/tests/baselines/reference/quotedFunctionName1.js @@ -4,7 +4,7 @@ class Test1 { } //// [quotedFunctionName1.js] -var Test1 = (function () { +var Test1 = /** @class */ (function () { function Test1() { } Test1.prototype["prop1"] = function () { }; diff --git a/tests/baselines/reference/quotedFunctionName2.js b/tests/baselines/reference/quotedFunctionName2.js index 1508305c96939..9214f6060552e 100644 --- a/tests/baselines/reference/quotedFunctionName2.js +++ b/tests/baselines/reference/quotedFunctionName2.js @@ -4,7 +4,7 @@ class Test1 { } //// [quotedFunctionName2.js] -var Test1 = (function () { +var Test1 = /** @class */ (function () { function Test1() { } Test1["prop1"] = function () { }; diff --git a/tests/baselines/reference/quotedPropertyName1.js b/tests/baselines/reference/quotedPropertyName1.js index 91c0c2256e262..0ac95679209f8 100644 --- a/tests/baselines/reference/quotedPropertyName1.js +++ b/tests/baselines/reference/quotedPropertyName1.js @@ -4,7 +4,7 @@ class Test1 { } //// [quotedPropertyName1.js] -var Test1 = (function () { +var Test1 = /** @class */ (function () { function Test1() { this["prop1"] = 0; } diff --git a/tests/baselines/reference/quotedPropertyName2.js b/tests/baselines/reference/quotedPropertyName2.js index 1c4d85076eac1..6d6ad4f0c88a6 100644 --- a/tests/baselines/reference/quotedPropertyName2.js +++ b/tests/baselines/reference/quotedPropertyName2.js @@ -4,7 +4,7 @@ class Test1 { } //// [quotedPropertyName2.js] -var Test1 = (function () { +var Test1 = /** @class */ (function () { function Test1() { } Test1["prop1"] = 0; diff --git a/tests/baselines/reference/quotedPropertyName3.js b/tests/baselines/reference/quotedPropertyName3.js index 0b837addf2548..34ad126997ab5 100644 --- a/tests/baselines/reference/quotedPropertyName3.js +++ b/tests/baselines/reference/quotedPropertyName3.js @@ -8,7 +8,7 @@ class Test { } //// [quotedPropertyName3.js] -var Test = (function () { +var Test = /** @class */ (function () { function Test() { } Test.prototype.foo = function () { diff --git a/tests/baselines/reference/raiseErrorOnParameterProperty.js b/tests/baselines/reference/raiseErrorOnParameterProperty.js index 437da6c948f14..87b723dc6e024 100644 --- a/tests/baselines/reference/raiseErrorOnParameterProperty.js +++ b/tests/baselines/reference/raiseErrorOnParameterProperty.js @@ -8,7 +8,7 @@ var c1 = new C1(0); //// [raiseErrorOnParameterProperty.js] -var C1 = (function () { +var C1 = /** @class */ (function () { function C1(x) { this.x = x; } diff --git a/tests/baselines/reference/reachabilityChecks1.js b/tests/baselines/reference/reachabilityChecks1.js index 61bb2b42996fc..4cc5de737aed1 100644 --- a/tests/baselines/reference/reachabilityChecks1.js +++ b/tests/baselines/reference/reachabilityChecks1.js @@ -125,7 +125,7 @@ function f1(x) { } function f2() { return; - var A = (function () { + var A = /** @class */ (function () { function A() { } return A; diff --git a/tests/baselines/reference/readonlyConstructorAssignment.js b/tests/baselines/reference/readonlyConstructorAssignment.js index bb4ddec93a832..e143573e2b446 100644 --- a/tests/baselines/reference/readonlyConstructorAssignment.js +++ b/tests/baselines/reference/readonlyConstructorAssignment.js @@ -51,14 +51,14 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var A = (function () { +var A = /** @class */ (function () { function A(x) { this.x = x; this.x = 0; } return A; }()); -var B = (function (_super) { +var B = /** @class */ (function (_super) { __extends(B, _super); function B(x) { var _this = _super.call(this, x) || this; @@ -68,7 +68,7 @@ var B = (function (_super) { } return B; }(A)); -var C = (function (_super) { +var C = /** @class */ (function (_super) { __extends(C, _super); // This is the usual behavior of readonly properties: // if one is redeclared in a base class, then it can be assigned to. @@ -80,7 +80,7 @@ var C = (function (_super) { } return C; }(A)); -var D = (function () { +var D = /** @class */ (function () { function D(x) { this.x = x; this.x = 0; @@ -88,7 +88,7 @@ var D = (function () { return D; }()); // Fails, can't redeclare readonly property -var E = (function (_super) { +var E = /** @class */ (function (_super) { __extends(E, _super); function E(x) { var _this = _super.call(this, x) || this; diff --git a/tests/baselines/reference/readonlyInConstructorParameters.js b/tests/baselines/reference/readonlyInConstructorParameters.js index 41e9c57cd72c0..14092988b3d1a 100644 --- a/tests/baselines/reference/readonlyInConstructorParameters.js +++ b/tests/baselines/reference/readonlyInConstructorParameters.js @@ -14,20 +14,20 @@ class F { new F(1).x; //// [readonlyInConstructorParameters.js] -var C = (function () { +var C = /** @class */ (function () { function C(x) { this.x = x; } return C; }()); new C(1).x = 2; -var E = (function () { +var E = /** @class */ (function () { function E(x) { this.x = x; } return E; }()); -var F = (function () { +var F = /** @class */ (function () { function F(x) { this.x = x; } diff --git a/tests/baselines/reference/readonlyInDeclarationFile.js b/tests/baselines/reference/readonlyInDeclarationFile.js index 598c433d81fcb..667d2582f100d 100644 --- a/tests/baselines/reference/readonlyInDeclarationFile.js +++ b/tests/baselines/reference/readonlyInDeclarationFile.js @@ -54,7 +54,7 @@ function g() { } //// [readonlyInDeclarationFile.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } Object.defineProperty(C.prototype, "b1", { diff --git a/tests/baselines/reference/readonlyInNonPropertyParameters.js b/tests/baselines/reference/readonlyInNonPropertyParameters.js index 658cf1331cdaf..d4cffa3281e7e 100644 --- a/tests/baselines/reference/readonlyInNonPropertyParameters.js +++ b/tests/baselines/reference/readonlyInNonPropertyParameters.js @@ -10,7 +10,7 @@ class X { //// [readonlyInNonPropertyParameters.js] // `readonly` won't work outside of property parameters -var X = (function () { +var X = /** @class */ (function () { function X() { } X.prototype.method = function (x) { }; diff --git a/tests/baselines/reference/readonlyMembers.js b/tests/baselines/reference/readonlyMembers.js index 7ba4b992f7876..07345379e6f80 100644 --- a/tests/baselines/reference/readonlyMembers.js +++ b/tests/baselines/reference/readonlyMembers.js @@ -69,7 +69,7 @@ yy["foo"] = "abc"; var x = { a: 0 }; x.a = 1; // Error x.b = 1; // Error -var C = (function () { +var C = /** @class */ (function () { function C() { var _this = this; this.b = 1; diff --git a/tests/baselines/reference/readonlyReadonly.js b/tests/baselines/reference/readonlyReadonly.js index 0b804e147b6f9..5ccf41fe55c0d 100644 --- a/tests/baselines/reference/readonlyReadonly.js +++ b/tests/baselines/reference/readonlyReadonly.js @@ -5,7 +5,7 @@ class C { } //// [readonlyReadonly.js] -var C = (function () { +var C = /** @class */ (function () { function C(y) { this.y = y; } diff --git a/tests/baselines/reference/reassignStaticProp.js b/tests/baselines/reference/reassignStaticProp.js index 2bf2bafa128e2..6c34c01e51086 100644 --- a/tests/baselines/reference/reassignStaticProp.js +++ b/tests/baselines/reference/reassignStaticProp.js @@ -12,7 +12,7 @@ class foo { //// [reassignStaticProp.js] -var foo = (function () { +var foo = /** @class */ (function () { function foo() { } foo.bar = 1; diff --git a/tests/baselines/reference/recursiveBaseCheck3.js b/tests/baselines/reference/recursiveBaseCheck3.js index a9ea849cea085..7c2c88b085ad9 100644 --- a/tests/baselines/reference/recursiveBaseCheck3.js +++ b/tests/baselines/reference/recursiveBaseCheck3.js @@ -15,14 +15,14 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var A = (function (_super) { +var A = /** @class */ (function (_super) { __extends(A, _super); function A() { return _super !== null && _super.apply(this, arguments) || this; } return A; }(C)); -var C = (function (_super) { +var C = /** @class */ (function (_super) { __extends(C, _super); function C() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/recursiveBaseCheck4.js b/tests/baselines/reference/recursiveBaseCheck4.js index 7b0be0574418c..1eec1286e0b08 100644 --- a/tests/baselines/reference/recursiveBaseCheck4.js +++ b/tests/baselines/reference/recursiveBaseCheck4.js @@ -13,7 +13,7 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var M = (function (_super) { +var M = /** @class */ (function (_super) { __extends(M, _super); function M() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/recursiveBaseCheck5.js b/tests/baselines/reference/recursiveBaseCheck5.js index ac07ae9df4dc1..b7e348545b4b1 100644 --- a/tests/baselines/reference/recursiveBaseCheck5.js +++ b/tests/baselines/reference/recursiveBaseCheck5.js @@ -5,7 +5,7 @@ class X implements I2 { } (new X).blah; //// [recursiveBaseCheck5.js] -var X = (function () { +var X = /** @class */ (function () { function X() { } return X; diff --git a/tests/baselines/reference/recursiveBaseCheck6.js b/tests/baselines/reference/recursiveBaseCheck6.js index 6e639130839fd..1df02af415c54 100644 --- a/tests/baselines/reference/recursiveBaseCheck6.js +++ b/tests/baselines/reference/recursiveBaseCheck6.js @@ -13,7 +13,7 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var S18 = (function (_super) { +var S18 = /** @class */ (function (_super) { __extends(S18, _super); function S18() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/recursiveBaseConstructorCreation1.js b/tests/baselines/reference/recursiveBaseConstructorCreation1.js index c8507944ed751..781e91d4351f4 100644 --- a/tests/baselines/reference/recursiveBaseConstructorCreation1.js +++ b/tests/baselines/reference/recursiveBaseConstructorCreation1.js @@ -17,13 +17,13 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var C1 = (function () { +var C1 = /** @class */ (function () { function C1() { } C1.prototype.func = function (param) { }; return C1; }()); -var C2 = (function (_super) { +var C2 = /** @class */ (function (_super) { __extends(C2, _super); function C2() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/recursiveClassInstantiationsWithDefaultConstructors.js b/tests/baselines/reference/recursiveClassInstantiationsWithDefaultConstructors.js index 616d5392c8b77..7189c628accb8 100644 --- a/tests/baselines/reference/recursiveClassInstantiationsWithDefaultConstructors.js +++ b/tests/baselines/reference/recursiveClassInstantiationsWithDefaultConstructors.js @@ -22,14 +22,14 @@ var __extends = (this && this.__extends) || (function () { })(); var TypeScript2; (function (TypeScript2) { - var MemberName = (function () { + var MemberName = /** @class */ (function () { function MemberName() { this.prefix = ""; } return MemberName; }()); TypeScript2.MemberName = MemberName; - var MemberNameArray = (function (_super) { + var MemberNameArray = /** @class */ (function (_super) { __extends(MemberNameArray, _super); function MemberNameArray() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/recursiveClassReferenceTest.js b/tests/baselines/reference/recursiveClassReferenceTest.js index 2d44740ac73cd..627f517f4c19a 100644 --- a/tests/baselines/reference/recursiveClassReferenceTest.js +++ b/tests/baselines/reference/recursiveClassReferenceTest.js @@ -123,7 +123,7 @@ var Sample; (function (Thing_1) { var Find; (function (Find) { - var StartFindAction = (function () { + var StartFindAction = /** @class */ (function () { function StartFindAction() { } StartFindAction.prototype.getId = function () { return "yo"; }; @@ -142,7 +142,7 @@ var Sample; (function (Thing) { var Widgets; (function (Widgets) { - var FindWidget = (function () { + var FindWidget = /** @class */ (function () { function FindWidget(codeThing) { this.codeThing = codeThing; this.domNode = null; @@ -163,7 +163,7 @@ var Sample; })(Widgets = Thing.Widgets || (Thing.Widgets = {})); })(Thing = Sample.Thing || (Sample.Thing = {})); })(Sample || (Sample = {})); -var AbstractMode = (function () { +var AbstractMode = /** @class */ (function () { function AbstractMode() { } AbstractMode.prototype.getInitialState = function () { return null; }; @@ -176,7 +176,7 @@ var AbstractMode = (function () { (function (Languages) { var PlainText; (function (PlainText) { - var State = (function () { + var State = /** @class */ (function () { function State(mode) { this.mode = mode; } @@ -190,7 +190,7 @@ var AbstractMode = (function () { return State; }()); PlainText.State = State; - var Mode = (function (_super) { + var Mode = /** @class */ (function (_super) { __extends(Mode, _super); function Mode() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/recursiveClassReferenceTest.sourcemap.txt b/tests/baselines/reference/recursiveClassReferenceTest.sourcemap.txt index 4196b08c60984..07b13ffe30cfd 100644 --- a/tests/baselines/reference/recursiveClassReferenceTest.sourcemap.txt +++ b/tests/baselines/reference/recursiveClassReferenceTest.sourcemap.txt @@ -203,7 +203,7 @@ sourceFile:recursiveClassReferenceTest.ts 1->^^^^^^^^^^^^ 2 > ^^^^^^^^^^^ 3 > ^^^^ -4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^-> +4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1-> 2 > 3 > Find @@ -211,7 +211,7 @@ sourceFile:recursiveClassReferenceTest.ts 2 >Emitted(20, 24) Source(32, 29) + SourceIndex(0) 3 >Emitted(20, 28) Source(32, 33) + SourceIndex(0) --- ->>> var StartFindAction = (function () { +>>> var StartFindAction = /** @class */ (function () { 1->^^^^^^^^^^^^^^^^ 2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1-> { @@ -627,7 +627,7 @@ sourceFile:recursiveClassReferenceTest.ts 1->^^^^^^^^ 2 > ^^^^^^^^^^^ 3 > ^^^^^^^ -4 > ^^^^^^^^^^^^^^^^^^-> +4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1-> 2 > 3 > Widgets @@ -635,7 +635,7 @@ sourceFile:recursiveClassReferenceTest.ts 2 >Emitted(39, 20) Source(44, 21) + SourceIndex(0) 3 >Emitted(39, 27) Source(44, 28) + SourceIndex(0) --- ->>> var FindWidget = (function () { +>>> var FindWidget = /** @class */ (function () { 1->^^^^^^^^^^^^ 2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1-> { @@ -1083,7 +1083,7 @@ sourceFile:recursiveClassReferenceTest.ts 5 > ^^^^^ 6 > ^^^^^^ 7 > ^^^^^^^^ -8 > ^^^^^^-> +8 > ^^^^^^^^^^^^^^^^^^^^-> 1 > 2 >} 3 > @@ -1119,7 +1119,7 @@ sourceFile:recursiveClassReferenceTest.ts 6 >Emitted(60, 21) Source(44, 14) + SourceIndex(0) 7 >Emitted(60, 29) Source(64, 2) + SourceIndex(0) --- ->>>var AbstractMode = (function () { +>>>var AbstractMode = /** @class */ (function () { 1-> 2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1-> @@ -1362,7 +1362,7 @@ sourceFile:recursiveClassReferenceTest.ts 1->^^^^^^^^^^^^ 2 > ^^^^^^^^^^^ 3 > ^^^^^^^^^ -4 > ^^^^^^^^^^^-> +4 > ^^^^^^^^^^^^^^^^^^^^^^^^^-> 1-> 2 > 3 > PlainText @@ -1370,7 +1370,7 @@ sourceFile:recursiveClassReferenceTest.ts 2 >Emitted(73, 24) Source(76, 31) + SourceIndex(0) 3 >Emitted(73, 33) Source(76, 40) + SourceIndex(0) --- ->>> var State = (function () { +>>> var State = /** @class */ (function () { 1->^^^^^^^^^^^^^^^^ 2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1-> { @@ -1584,7 +1584,7 @@ sourceFile:recursiveClassReferenceTest.ts 2 > ^^^^^^^^^^^^^^^ 3 > ^^^^^^^^ 4 > ^ -5 > ^^^^^^^^-> +5 > ^^^^^^^^^^^^^^^^^^^^^^-> 1-> 2 > State 3 > implements IState { @@ -1605,7 +1605,7 @@ sourceFile:recursiveClassReferenceTest.ts 3 >Emitted(87, 40) Source(89, 3) + SourceIndex(0) 4 >Emitted(87, 41) Source(89, 3) + SourceIndex(0) --- ->>> var Mode = (function (_super) { +>>> var Mode = /** @class */ (function (_super) { 1->^^^^^^^^^^^^^^^^ 2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1-> diff --git a/tests/baselines/reference/recursiveCloduleReference.js b/tests/baselines/reference/recursiveCloduleReference.js index 3d261a4f9ae07..76e42327b5aac 100644 --- a/tests/baselines/reference/recursiveCloduleReference.js +++ b/tests/baselines/reference/recursiveCloduleReference.js @@ -13,7 +13,7 @@ module M //// [recursiveCloduleReference.js] var M; (function (M) { - var C = (function () { + var C = /** @class */ (function () { function C() { } return C; diff --git a/tests/baselines/reference/recursiveComplicatedClasses.js b/tests/baselines/reference/recursiveComplicatedClasses.js index cb46865c46f53..fb914dc958cc6 100644 --- a/tests/baselines/reference/recursiveComplicatedClasses.js +++ b/tests/baselines/reference/recursiveComplicatedClasses.js @@ -35,7 +35,7 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var Signature = (function () { +var Signature = /** @class */ (function () { function Signature() { this.parameters = null; } @@ -44,7 +44,7 @@ var Signature = (function () { function aEnclosesB(a) { return true; } -var Symbol = (function () { +var Symbol = /** @class */ (function () { function Symbol() { } Symbol.prototype.visible = function () { @@ -53,21 +53,21 @@ var Symbol = (function () { }; return Symbol; }()); -var InferenceSymbol = (function (_super) { +var InferenceSymbol = /** @class */ (function (_super) { __extends(InferenceSymbol, _super); function InferenceSymbol() { return _super !== null && _super.apply(this, arguments) || this; } return InferenceSymbol; }(Symbol)); -var ParameterSymbol = (function (_super) { +var ParameterSymbol = /** @class */ (function (_super) { __extends(ParameterSymbol, _super); function ParameterSymbol() { return _super !== null && _super.apply(this, arguments) || this; } return ParameterSymbol; }(InferenceSymbol)); -var TypeSymbol = (function (_super) { +var TypeSymbol = /** @class */ (function (_super) { __extends(TypeSymbol, _super); function TypeSymbol() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/recursiveExportAssignmentAndFindAliasedType1.js b/tests/baselines/reference/recursiveExportAssignmentAndFindAliasedType1.js index 87ef9fe86710f..151c719e0bd11 100644 --- a/tests/baselines/reference/recursiveExportAssignmentAndFindAliasedType1.js +++ b/tests/baselines/reference/recursiveExportAssignmentAndFindAliasedType1.js @@ -19,7 +19,7 @@ export var b: ClassB; // This should result in type ClassB //// [recursiveExportAssignmentAndFindAliasedType1_moduleB.js] define(["require", "exports"], function (require, exports) { "use strict"; - var ClassB = (function () { + var ClassB = /** @class */ (function () { function ClassB() { } return ClassB; diff --git a/tests/baselines/reference/recursiveExportAssignmentAndFindAliasedType2.js b/tests/baselines/reference/recursiveExportAssignmentAndFindAliasedType2.js index c38c38ea325c6..3ef3cc597f5fe 100644 --- a/tests/baselines/reference/recursiveExportAssignmentAndFindAliasedType2.js +++ b/tests/baselines/reference/recursiveExportAssignmentAndFindAliasedType2.js @@ -23,7 +23,7 @@ export var b: ClassB; // This should result in type ClassB //// [recursiveExportAssignmentAndFindAliasedType2_moduleB.js] define(["require", "exports"], function (require, exports) { "use strict"; - var ClassB = (function () { + var ClassB = /** @class */ (function () { function ClassB() { } return ClassB; diff --git a/tests/baselines/reference/recursiveExportAssignmentAndFindAliasedType3.js b/tests/baselines/reference/recursiveExportAssignmentAndFindAliasedType3.js index 178d8b3b3eed8..53ad4b5346468 100644 --- a/tests/baselines/reference/recursiveExportAssignmentAndFindAliasedType3.js +++ b/tests/baselines/reference/recursiveExportAssignmentAndFindAliasedType3.js @@ -27,7 +27,7 @@ export var b: ClassB; // This should result in type ClassB //// [recursiveExportAssignmentAndFindAliasedType3_moduleB.js] define(["require", "exports"], function (require, exports) { "use strict"; - var ClassB = (function () { + var ClassB = /** @class */ (function () { function ClassB() { } return ClassB; diff --git a/tests/baselines/reference/recursiveExportAssignmentAndFindAliasedType4.js b/tests/baselines/reference/recursiveExportAssignmentAndFindAliasedType4.js index 893c4ec990fb1..2ab16bea5ba88 100644 --- a/tests/baselines/reference/recursiveExportAssignmentAndFindAliasedType4.js +++ b/tests/baselines/reference/recursiveExportAssignmentAndFindAliasedType4.js @@ -21,7 +21,7 @@ define(["require", "exports", "recursiveExportAssignmentAndFindAliasedType4_modu //// [recursiveExportAssignmentAndFindAliasedType4_moduleB.js] define(["require", "exports"], function (require, exports) { "use strict"; - var ClassB = (function () { + var ClassB = /** @class */ (function () { function ClassB() { } return ClassB; diff --git a/tests/baselines/reference/recursiveExportAssignmentAndFindAliasedType5.js b/tests/baselines/reference/recursiveExportAssignmentAndFindAliasedType5.js index 39cb223d1a0f2..2fd8490563264 100644 --- a/tests/baselines/reference/recursiveExportAssignmentAndFindAliasedType5.js +++ b/tests/baselines/reference/recursiveExportAssignmentAndFindAliasedType5.js @@ -30,7 +30,7 @@ define(["require", "exports", "recursiveExportAssignmentAndFindAliasedType5_modu //// [recursiveExportAssignmentAndFindAliasedType5_moduleB.js] define(["require", "exports"], function (require, exports) { "use strict"; - var ClassB = (function () { + var ClassB = /** @class */ (function () { function ClassB() { } return ClassB; diff --git a/tests/baselines/reference/recursiveExportAssignmentAndFindAliasedType6.js b/tests/baselines/reference/recursiveExportAssignmentAndFindAliasedType6.js index d8541df0c2c1a..6d5cc60f5e4fd 100644 --- a/tests/baselines/reference/recursiveExportAssignmentAndFindAliasedType6.js +++ b/tests/baselines/reference/recursiveExportAssignmentAndFindAliasedType6.js @@ -39,7 +39,7 @@ define(["require", "exports", "recursiveExportAssignmentAndFindAliasedType6_modu //// [recursiveExportAssignmentAndFindAliasedType6_moduleB.js] define(["require", "exports"], function (require, exports) { "use strict"; - var ClassB = (function () { + var ClassB = /** @class */ (function () { function ClassB() { } return ClassB; diff --git a/tests/baselines/reference/recursiveExportAssignmentAndFindAliasedType7.js b/tests/baselines/reference/recursiveExportAssignmentAndFindAliasedType7.js index 01f818d5bb27b..c4bc8804f60e5 100644 --- a/tests/baselines/reference/recursiveExportAssignmentAndFindAliasedType7.js +++ b/tests/baselines/reference/recursiveExportAssignmentAndFindAliasedType7.js @@ -41,7 +41,7 @@ define(["require", "exports", "recursiveExportAssignmentAndFindAliasedType7_modu //// [recursiveExportAssignmentAndFindAliasedType7_moduleB.js] define(["require", "exports"], function (require, exports) { "use strict"; - var ClassB = (function () { + var ClassB = /** @class */ (function () { function ClassB() { } return ClassB; diff --git a/tests/baselines/reference/recursiveFunctionTypes.js b/tests/baselines/reference/recursiveFunctionTypes.js index 6ff9e4eb997b3..6a86362640558 100644 --- a/tests/baselines/reference/recursiveFunctionTypes.js +++ b/tests/baselines/reference/recursiveFunctionTypes.js @@ -55,7 +55,7 @@ function f2() { } function g2() { } function f3() { return f3; } var a = f3; // error -var C = (function () { +var C = /** @class */ (function () { function C() { } C.g = function (t) { }; diff --git a/tests/baselines/reference/recursiveFunctionTypes1.js b/tests/baselines/reference/recursiveFunctionTypes1.js index d219c74162590..21cabccd11182 100644 --- a/tests/baselines/reference/recursiveFunctionTypes1.js +++ b/tests/baselines/reference/recursiveFunctionTypes1.js @@ -4,7 +4,7 @@ class C { } //// [recursiveFunctionTypes1.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } C.g = function (t) { }; diff --git a/tests/baselines/reference/recursiveGetterAccess.js b/tests/baselines/reference/recursiveGetterAccess.js index efb9dda3b31d0..2563e0323547a 100644 --- a/tests/baselines/reference/recursiveGetterAccess.js +++ b/tests/baselines/reference/recursiveGetterAccess.js @@ -6,7 +6,7 @@ get testProp() { return this.testProp; } //// [recursiveGetterAccess.js] -var MyClass = (function () { +var MyClass = /** @class */ (function () { function MyClass() { } Object.defineProperty(MyClass.prototype, "testProp", { diff --git a/tests/baselines/reference/recursiveInheritance3.js b/tests/baselines/reference/recursiveInheritance3.js index 564d4fe6f3c64..7dc2bf649896e 100644 --- a/tests/baselines/reference/recursiveInheritance3.js +++ b/tests/baselines/reference/recursiveInheritance3.js @@ -9,7 +9,7 @@ interface I extends C { } //// [recursiveInheritance3.js] -var C = (function () { +var C = /** @class */ (function () { function C() { this.x = 1; } diff --git a/tests/baselines/reference/recursiveMods.js b/tests/baselines/reference/recursiveMods.js index f9f48a4a891ce..180fd8455ea01 100644 --- a/tests/baselines/reference/recursiveMods.js +++ b/tests/baselines/reference/recursiveMods.js @@ -28,7 +28,7 @@ export module Foo { exports.__esModule = true; var Foo; (function (Foo) { - var C = (function () { + var C = /** @class */ (function () { function C() { } return C; diff --git a/tests/baselines/reference/recursiveProperties.js b/tests/baselines/reference/recursiveProperties.js index 35a284dac89de..45ba1c169d848 100644 --- a/tests/baselines/reference/recursiveProperties.js +++ b/tests/baselines/reference/recursiveProperties.js @@ -8,7 +8,7 @@ class B { } //// [recursiveProperties.js] -var A = (function () { +var A = /** @class */ (function () { function A() { } Object.defineProperty(A.prototype, "testProp", { @@ -18,7 +18,7 @@ var A = (function () { }); return A; }()); -var B = (function () { +var B = /** @class */ (function () { function B() { } Object.defineProperty(B.prototype, "testProp", { diff --git a/tests/baselines/reference/recursiveSpecializationOfSignatures.js b/tests/baselines/reference/recursiveSpecializationOfSignatures.js index 496a74f8983c8..cc425af5891ac 100644 --- a/tests/baselines/reference/recursiveSpecializationOfSignatures.js +++ b/tests/baselines/reference/recursiveSpecializationOfSignatures.js @@ -7,7 +7,7 @@ constructor(public S17: S0 A>) { } //// [recursiveSpecializationOfSignatures.js] -var S0 = (function () { +var S0 = /** @class */ (function () { function S0(S17) { this.S17 = S17; } diff --git a/tests/baselines/reference/recursiveTypeInGenericConstraint.js b/tests/baselines/reference/recursiveTypeInGenericConstraint.js index 2fb45e1b9e36d..db0adcec33859 100644 --- a/tests/baselines/reference/recursiveTypeInGenericConstraint.js +++ b/tests/baselines/reference/recursiveTypeInGenericConstraint.js @@ -14,17 +14,17 @@ class D { var c1 = new Foo>(); // ok, circularity in assignment compat check causes success //// [recursiveTypeInGenericConstraint.js] -var G = (function () { +var G = /** @class */ (function () { function G() { } return G; }()); -var Foo = (function () { +var Foo = /** @class */ (function () { function Foo() { } return Foo; }()); -var D = (function () { +var D = /** @class */ (function () { function D() { } return D; diff --git a/tests/baselines/reference/recursiveTypeParameterConstraintReferenceLacksTypeArgs.js b/tests/baselines/reference/recursiveTypeParameterConstraintReferenceLacksTypeArgs.js index 7a889a8a62ac6..db805d47adc9f 100644 --- a/tests/baselines/reference/recursiveTypeParameterConstraintReferenceLacksTypeArgs.js +++ b/tests/baselines/reference/recursiveTypeParameterConstraintReferenceLacksTypeArgs.js @@ -2,7 +2,7 @@ class A { } //// [recursiveTypeParameterConstraintReferenceLacksTypeArgs.js] -var A = (function () { +var A = /** @class */ (function () { function A() { } return A; diff --git a/tests/baselines/reference/recursiveTypeParameterReferenceError1.js b/tests/baselines/reference/recursiveTypeParameterReferenceError1.js index a866b4fc78c09..5ac54c6e05b22 100644 --- a/tests/baselines/reference/recursiveTypeParameterReferenceError1.js +++ b/tests/baselines/reference/recursiveTypeParameterReferenceError1.js @@ -18,14 +18,14 @@ var r2 = f2.ofC4; //// [recursiveTypeParameterReferenceError1.js] -var X = (function () { +var X = /** @class */ (function () { function X() { } return X; }()); var f; var r = f.z; -var C2 = (function () { +var C2 = /** @class */ (function () { function C2() { } return C2; diff --git a/tests/baselines/reference/recursiveTypeRelations.js b/tests/baselines/reference/recursiveTypeRelations.js index d006c9482d833..c477ecf129498 100644 --- a/tests/baselines/reference/recursiveTypeRelations.js +++ b/tests/baselines/reference/recursiveTypeRelations.js @@ -40,7 +40,7 @@ export function css(styles: S, ...classNam "use strict"; // Repro from #14896 exports.__esModule = true; -var Query = (function () { +var Query = /** @class */ (function () { function Query() { } return Query; diff --git a/tests/baselines/reference/recursiveTypesUsedAsFunctionParameters.js b/tests/baselines/reference/recursiveTypesUsedAsFunctionParameters.js index c2286901a2997..12d0996fca038 100644 --- a/tests/baselines/reference/recursiveTypesUsedAsFunctionParameters.js +++ b/tests/baselines/reference/recursiveTypesUsedAsFunctionParameters.js @@ -44,12 +44,12 @@ function other, U>() { } //// [recursiveTypesUsedAsFunctionParameters.js] -var List = (function () { +var List = /** @class */ (function () { function List() { } return List; }()); -var MyList = (function () { +var MyList = /** @class */ (function () { function MyList() { } return MyList; diff --git a/tests/baselines/reference/recursivelySpecializedConstructorDeclaration.js b/tests/baselines/reference/recursivelySpecializedConstructorDeclaration.js index ee976ff3da188..beff303c54045 100644 --- a/tests/baselines/reference/recursivelySpecializedConstructorDeclaration.js +++ b/tests/baselines/reference/recursivelySpecializedConstructorDeclaration.js @@ -48,13 +48,13 @@ var MsPortal; (function (Base) { var ItemList; (function (ItemList) { - var ItemValue = (function () { + var ItemValue = /** @class */ (function () { function ItemValue(value) { } return ItemValue; }()); ItemList.ItemValue = ItemValue; - var ViewModel = (function (_super) { + var ViewModel = /** @class */ (function (_super) { __extends(ViewModel, _super); function ViewModel() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/reexportClassDefinition.js b/tests/baselines/reference/reexportClassDefinition.js index aae728c9e2567..38b94e5e443d8 100644 --- a/tests/baselines/reference/reexportClassDefinition.js +++ b/tests/baselines/reference/reexportClassDefinition.js @@ -19,7 +19,7 @@ class x extends foo2.x {} //// [foo1.js] "use strict"; -var x = (function () { +var x = /** @class */ (function () { function x() { } return x; @@ -45,7 +45,7 @@ var __extends = (this && this.__extends) || (function () { })(); exports.__esModule = true; var foo2 = require("./foo2"); -var x = (function (_super) { +var x = /** @class */ (function (_super) { __extends(x, _super); function x() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/reexportedMissingAlias.js b/tests/baselines/reference/reexportedMissingAlias.js index 792ea3eb5c2cd..01a992eddae1a 100644 --- a/tests/baselines/reference/reexportedMissingAlias.js +++ b/tests/baselines/reference/reexportedMissingAlias.js @@ -25,7 +25,7 @@ var __extends = (this && this.__extends) || (function () { })(); exports.__esModule = true; var first_1 = require("./first"); -var C = (function (_super) { +var C = /** @class */ (function (_super) { __extends(C, _super); function C() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/requireEmitSemicolon.js b/tests/baselines/reference/requireEmitSemicolon.js index 667002efeaa67..daef539e7de39 100644 --- a/tests/baselines/reference/requireEmitSemicolon.js +++ b/tests/baselines/reference/requireEmitSemicolon.js @@ -25,7 +25,7 @@ define(["require", "exports"], function (require, exports) { exports.__esModule = true; var Models; (function (Models) { - var Person = (function () { + var Person = /** @class */ (function () { function Person(name) { } return Person; @@ -39,7 +39,7 @@ define(["require", "exports", "requireEmitSemicolon_0"], function (require, expo exports.__esModule = true; var Database; (function (Database) { - var DB = (function () { + var DB = /** @class */ (function () { function DB() { } DB.prototype.findPerson = function (id) { diff --git a/tests/baselines/reference/requiredInitializedParameter2.js b/tests/baselines/reference/requiredInitializedParameter2.js index b46a6edfeb0aa..07f7bc91fed18 100644 --- a/tests/baselines/reference/requiredInitializedParameter2.js +++ b/tests/baselines/reference/requiredInitializedParameter2.js @@ -8,7 +8,7 @@ class C1 implements I1 { } //// [requiredInitializedParameter2.js] -var C1 = (function () { +var C1 = /** @class */ (function () { function C1() { } C1.prototype.method = function (a, b) { diff --git a/tests/baselines/reference/requiredInitializedParameter3.js b/tests/baselines/reference/requiredInitializedParameter3.js index 983955b79e832..19716f9f17505 100644 --- a/tests/baselines/reference/requiredInitializedParameter3.js +++ b/tests/baselines/reference/requiredInitializedParameter3.js @@ -8,7 +8,7 @@ class C1 implements I1 { } //// [requiredInitializedParameter3.js] -var C1 = (function () { +var C1 = /** @class */ (function () { function C1() { } C1.prototype.method = function (a, b) { diff --git a/tests/baselines/reference/requiredInitializedParameter4.js b/tests/baselines/reference/requiredInitializedParameter4.js index 11abdc20f411e..991ca443bddd5 100644 --- a/tests/baselines/reference/requiredInitializedParameter4.js +++ b/tests/baselines/reference/requiredInitializedParameter4.js @@ -4,7 +4,7 @@ class C1 { } //// [requiredInitializedParameter4.js] -var C1 = (function () { +var C1 = /** @class */ (function () { function C1() { } C1.prototype.method = function (a, b) { diff --git a/tests/baselines/reference/resolveTypeAliasWithSameLetDeclarationName1.js b/tests/baselines/reference/resolveTypeAliasWithSameLetDeclarationName1.js index 7793fc6c650bf..1a61e68e6d8ce 100644 --- a/tests/baselines/reference/resolveTypeAliasWithSameLetDeclarationName1.js +++ b/tests/baselines/reference/resolveTypeAliasWithSameLetDeclarationName1.js @@ -5,7 +5,7 @@ let baz: baz; //// [resolveTypeAliasWithSameLetDeclarationName1.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } return C; diff --git a/tests/baselines/reference/resolvingClassDeclarationWhenInBaseTypeResolution.js b/tests/baselines/reference/resolvingClassDeclarationWhenInBaseTypeResolution.js index 1a9a3dacbbaac..5195842956549 100644 --- a/tests/baselines/reference/resolvingClassDeclarationWhenInBaseTypeResolution.js +++ b/tests/baselines/reference/resolvingClassDeclarationWhenInBaseTypeResolution.js @@ -1032,7 +1032,7 @@ var __extends = (this && this.__extends) || (function () { })(); var rionegrensis; (function (rionegrensis) { - var caniventer = (function (_super) { + var caniventer = /** @class */ (function (_super) { __extends(caniventer, _super); function caniventer() { return _super !== null && _super.apply(this, arguments) || this; @@ -1070,7 +1070,7 @@ var rionegrensis; return caniventer; }(Lanthanum.nitidus)); rionegrensis.caniventer = caniventer; - var veraecrucis = (function (_super) { + var veraecrucis = /** @class */ (function (_super) { __extends(veraecrucis, _super); function veraecrucis() { return _super !== null && _super.apply(this, arguments) || this; @@ -1111,13 +1111,13 @@ var rionegrensis; })(rionegrensis || (rionegrensis = {})); var julianae; (function (julianae) { - var steerii = (function () { + var steerii = /** @class */ (function () { function steerii() { } return steerii; }()); julianae.steerii = steerii; - var nudicaudus = (function () { + var nudicaudus = /** @class */ (function () { function nudicaudus() { } nudicaudus.prototype.brandtii = function () { @@ -1153,7 +1153,7 @@ var julianae; return nudicaudus; }()); julianae.nudicaudus = nudicaudus; - var galapagoensis = (function () { + var galapagoensis = /** @class */ (function () { function galapagoensis() { } galapagoensis.prototype.isabellae = function () { @@ -1201,7 +1201,7 @@ var julianae; return galapagoensis; }()); julianae.galapagoensis = galapagoensis; - var albidens = (function () { + var albidens = /** @class */ (function () { function albidens() { } albidens.prototype.mattheyi = function () { @@ -1249,7 +1249,7 @@ var julianae; return albidens; }()); julianae.albidens = albidens; - var oralis = (function (_super) { + var oralis = /** @class */ (function (_super) { __extends(oralis, _super); function oralis() { return _super !== null && _super.apply(this, arguments) || this; @@ -1335,7 +1335,7 @@ var julianae; return oralis; }(caurinus.psilurus)); julianae.oralis = oralis; - var sumatrana = (function (_super) { + var sumatrana = /** @class */ (function (_super) { __extends(sumatrana, _super); function sumatrana() { return _super !== null && _super.apply(this, arguments) || this; @@ -1385,7 +1385,7 @@ var julianae; return sumatrana; }(Lanthanum.jugularis)); julianae.sumatrana = sumatrana; - var gerbillus = (function () { + var gerbillus = /** @class */ (function () { function gerbillus() { } gerbillus.prototype.pundti = function () { @@ -1457,7 +1457,7 @@ var julianae; return gerbillus; }()); julianae.gerbillus = gerbillus; - var acariensis = (function () { + var acariensis = /** @class */ (function () { function acariensis() { } acariensis.prototype.levicula = function () { @@ -1535,7 +1535,7 @@ var julianae; return acariensis; }()); julianae.acariensis = acariensis; - var durangae = (function (_super) { + var durangae = /** @class */ (function (_super) { __extends(durangae, _super); function durangae() { return _super !== null && _super.apply(this, arguments) || this; @@ -1564,7 +1564,7 @@ var julianae; })(julianae || (julianae = {})); var ruatanica; (function (ruatanica) { - var hector = (function () { + var hector = /** @class */ (function () { function hector() { } hector.prototype.humulis = function () { @@ -1585,7 +1585,7 @@ var ruatanica; })(ruatanica || (ruatanica = {})); var Lanthanum; (function (Lanthanum) { - var suillus = (function () { + var suillus = /** @class */ (function () { function suillus() { } suillus.prototype.spilosoma = function () { @@ -1609,7 +1609,7 @@ var Lanthanum; return suillus; }()); Lanthanum.suillus = suillus; - var nitidus = (function (_super) { + var nitidus = /** @class */ (function (_super) { __extends(nitidus, _super); function nitidus() { return _super !== null && _super.apply(this, arguments) || this; @@ -1677,7 +1677,7 @@ var Lanthanum; return nitidus; }(argurus.gilbertii)); Lanthanum.nitidus = nitidus; - var megalonyx = (function (_super) { + var megalonyx = /** @class */ (function (_super) { __extends(megalonyx, _super); function megalonyx() { return _super !== null && _super.apply(this, arguments) || this; @@ -1733,7 +1733,7 @@ var Lanthanum; return megalonyx; }(caurinus.johorensis)); Lanthanum.megalonyx = megalonyx; - var jugularis = (function () { + var jugularis = /** @class */ (function () { function jugularis() { } jugularis.prototype.torrei = function () { @@ -1826,7 +1826,7 @@ var Lanthanum; })(Lanthanum || (Lanthanum = {})); var rendalli; (function (rendalli) { - var zuluensis = (function (_super) { + var zuluensis = /** @class */ (function (_super) { __extends(zuluensis, _super); function zuluensis() { return _super !== null && _super.apply(this, arguments) || this; @@ -1918,7 +1918,7 @@ var rendalli; return zuluensis; }(julianae.steerii)); rendalli.zuluensis = zuluensis; - var moojeni = (function () { + var moojeni = /** @class */ (function () { function moojeni() { } moojeni.prototype.floweri = function () { @@ -1984,7 +1984,7 @@ var rendalli; return moojeni; }()); rendalli.moojeni = moojeni; - var crenulata = (function (_super) { + var crenulata = /** @class */ (function (_super) { __extends(crenulata, _super); function crenulata() { return _super !== null && _super.apply(this, arguments) || this; @@ -2013,7 +2013,7 @@ var rendalli; })(rendalli || (rendalli = {})); var trivirgatus; (function (trivirgatus) { - var tumidifrons = (function () { + var tumidifrons = /** @class */ (function () { function tumidifrons() { } tumidifrons.prototype.nivalis = function () { @@ -2067,7 +2067,7 @@ var trivirgatus; return tumidifrons; }()); trivirgatus.tumidifrons = tumidifrons; - var mixtus = (function (_super) { + var mixtus = /** @class */ (function (_super) { __extends(mixtus, _super); function mixtus() { return _super !== null && _super.apply(this, arguments) || this; @@ -2117,7 +2117,7 @@ var trivirgatus; return mixtus; }(argurus.pygmaea)); trivirgatus.mixtus = mixtus; - var lotor = (function () { + var lotor = /** @class */ (function () { function lotor() { } lotor.prototype.balensis = function () { @@ -2135,7 +2135,7 @@ var trivirgatus; return lotor; }()); trivirgatus.lotor = lotor; - var falconeri = (function () { + var falconeri = /** @class */ (function () { function falconeri() { } falconeri.prototype.cabrali = function () { @@ -2183,7 +2183,7 @@ var trivirgatus; return falconeri; }()); trivirgatus.falconeri = falconeri; - var oconnelli = (function () { + var oconnelli = /** @class */ (function () { function oconnelli() { } oconnelli.prototype.youngsoni = function () { @@ -2276,7 +2276,7 @@ var trivirgatus; })(trivirgatus || (trivirgatus = {})); var quasiater; (function (quasiater) { - var bobrinskoi = (function () { + var bobrinskoi = /** @class */ (function () { function bobrinskoi() { } bobrinskoi.prototype.crassicaudatus = function () { @@ -2308,7 +2308,7 @@ var quasiater; quasiater.bobrinskoi = bobrinskoi; })(quasiater || (quasiater = {})); (function (ruatanica) { - var americanus = (function (_super) { + var americanus = /** @class */ (function (_super) { __extends(americanus, _super); function americanus() { return _super !== null && _super.apply(this, arguments) || this; @@ -2343,7 +2343,7 @@ var quasiater; })(ruatanica || (ruatanica = {})); var lavali; (function (lavali) { - var wilsoni = (function (_super) { + var wilsoni = /** @class */ (function (_super) { __extends(wilsoni, _super); function wilsoni() { return _super !== null && _super.apply(this, arguments) || this; @@ -2429,13 +2429,13 @@ var lavali; return wilsoni; }(Lanthanum.nitidus)); lavali.wilsoni = wilsoni; - var beisa = (function () { + var beisa = /** @class */ (function () { function beisa() { } return beisa; }()); lavali.beisa = beisa; - var otion = (function (_super) { + var otion = /** @class */ (function (_super) { __extends(otion, _super); function otion() { return _super !== null && _super.apply(this, arguments) || this; @@ -2521,7 +2521,7 @@ var lavali; return otion; }(howi.coludo)); lavali.otion = otion; - var xanthognathus = (function () { + var xanthognathus = /** @class */ (function () { function xanthognathus() { } xanthognathus.prototype.nanulus = function () { @@ -2599,7 +2599,7 @@ var lavali; return xanthognathus; }()); lavali.xanthognathus = xanthognathus; - var thaeleri = (function (_super) { + var thaeleri = /** @class */ (function (_super) { __extends(thaeleri, _super); function thaeleri() { return _super !== null && _super.apply(this, arguments) || this; @@ -2655,7 +2655,7 @@ var lavali; return thaeleri; }(argurus.oreas)); lavali.thaeleri = thaeleri; - var lepturus = (function (_super) { + var lepturus = /** @class */ (function (_super) { __extends(lepturus, _super); function lepturus() { return _super !== null && _super.apply(this, arguments) || this; @@ -2678,7 +2678,7 @@ var lavali; })(lavali || (lavali = {})); var dogramacii; (function (dogramacii) { - var robustulus = (function (_super) { + var robustulus = /** @class */ (function (_super) { __extends(robustulus, _super); function robustulus() { return _super !== null && _super.apply(this, arguments) || this; @@ -2740,7 +2740,7 @@ var dogramacii; return robustulus; }(lavali.wilsoni)); dogramacii.robustulus = robustulus; - var koepckeae = (function () { + var koepckeae = /** @class */ (function () { function koepckeae() { } koepckeae.prototype.culturatus = function () { @@ -2752,7 +2752,7 @@ var dogramacii; return koepckeae; }()); dogramacii.koepckeae = koepckeae; - var kaiseri = (function () { + var kaiseri = /** @class */ (function () { function kaiseri() { } kaiseri.prototype.bedfordiae = function () { @@ -2836,7 +2836,7 @@ var dogramacii; return kaiseri; }()); dogramacii.kaiseri = kaiseri; - var aurata = (function () { + var aurata = /** @class */ (function () { function aurata() { } aurata.prototype.grunniens = function () { @@ -2893,7 +2893,7 @@ var dogramacii; })(dogramacii || (dogramacii = {})); var lutreolus; (function (lutreolus) { - var schlegeli = (function (_super) { + var schlegeli = /** @class */ (function (_super) { __extends(schlegeli, _super); function schlegeli() { return _super !== null && _super.apply(this, arguments) || this; @@ -2988,7 +2988,7 @@ var lutreolus; })(lutreolus || (lutreolus = {})); var argurus; (function (argurus) { - var dauricus = (function () { + var dauricus = /** @class */ (function () { function dauricus() { } dauricus.prototype.chinensis = function () { @@ -3063,7 +3063,7 @@ var argurus; })(argurus || (argurus = {})); var nigra; (function (nigra) { - var dolichurus = (function () { + var dolichurus = /** @class */ (function () { function dolichurus() { } dolichurus.prototype.solomonis = function () { @@ -3120,7 +3120,7 @@ var nigra; })(nigra || (nigra = {})); var panglima; (function (panglima) { - var amphibius = (function (_super) { + var amphibius = /** @class */ (function (_super) { __extends(amphibius, _super); function amphibius() { return _super !== null && _super.apply(this, arguments) || this; @@ -3164,7 +3164,7 @@ var panglima; return amphibius; }(caurinus.johorensis)); panglima.amphibius = amphibius; - var fundatus = (function (_super) { + var fundatus = /** @class */ (function (_super) { __extends(fundatus, _super); function fundatus() { return _super !== null && _super.apply(this, arguments) || this; @@ -3190,7 +3190,7 @@ var panglima; return fundatus; }(lutreolus.schlegeli)); panglima.fundatus = fundatus; - var abidi = (function (_super) { + var abidi = /** @class */ (function (_super) { __extends(abidi, _super); function abidi() { return _super !== null && _super.apply(this, arguments) || this; @@ -3230,7 +3230,7 @@ var panglima; panglima.abidi = abidi; })(panglima || (panglima = {})); (function (quasiater) { - var carolinensis = (function () { + var carolinensis = /** @class */ (function () { function carolinensis() { } carolinensis.prototype.concinna = function () { @@ -3281,7 +3281,7 @@ var panglima; })(quasiater || (quasiater = {})); var minutus; (function (minutus) { - var himalayana = (function (_super) { + var himalayana = /** @class */ (function (_super) { __extends(himalayana, _super); function himalayana() { return _super !== null && _super.apply(this, arguments) || this; @@ -3364,7 +3364,7 @@ var minutus; })(minutus || (minutus = {})); var caurinus; (function (caurinus) { - var mahaganus = (function (_super) { + var mahaganus = /** @class */ (function (_super) { __extends(mahaganus, _super); function mahaganus() { return _super !== null && _super.apply(this, arguments) || this; @@ -3423,7 +3423,7 @@ var caurinus; })(caurinus || (caurinus = {})); var macrorhinos; (function (macrorhinos) { - var marmosurus = (function () { + var marmosurus = /** @class */ (function () { function marmosurus() { } marmosurus.prototype.tansaniana = function () { @@ -3438,7 +3438,7 @@ var macrorhinos; })(macrorhinos || (macrorhinos = {})); var howi; (function (howi) { - var angulatus = (function (_super) { + var angulatus = /** @class */ (function (_super) { __extends(angulatus, _super); function angulatus() { return _super !== null && _super.apply(this, arguments) || this; @@ -3455,7 +3455,7 @@ var howi; })(howi || (howi = {})); var daubentonii; (function (daubentonii) { - var nesiotes = (function () { + var nesiotes = /** @class */ (function () { function nesiotes() { } return nesiotes; @@ -3463,7 +3463,7 @@ var daubentonii; daubentonii.nesiotes = nesiotes; })(daubentonii || (daubentonii = {})); (function (nigra) { - var thalia = (function () { + var thalia = /** @class */ (function () { function thalia() { } thalia.prototype.dichotomus = function () { @@ -3520,7 +3520,7 @@ var daubentonii; })(nigra || (nigra = {})); var sagitta; (function (sagitta) { - var walkeri = (function (_super) { + var walkeri = /** @class */ (function (_super) { __extends(walkeri, _super); function walkeri() { return _super !== null && _super.apply(this, arguments) || this; @@ -3536,7 +3536,7 @@ var sagitta; sagitta.walkeri = walkeri; })(sagitta || (sagitta = {})); (function (minutus) { - var inez = (function (_super) { + var inez = /** @class */ (function (_super) { __extends(inez, _super); function inez() { return _super !== null && _super.apply(this, arguments) || this; @@ -3552,7 +3552,7 @@ var sagitta; minutus.inez = inez; })(minutus || (minutus = {})); (function (macrorhinos) { - var konganensis = (function (_super) { + var konganensis = /** @class */ (function (_super) { __extends(konganensis, _super); function konganensis() { return _super !== null && _super.apply(this, arguments) || this; @@ -3563,7 +3563,7 @@ var sagitta; })(macrorhinos || (macrorhinos = {})); var panamensis; (function (panamensis) { - var linulus = (function (_super) { + var linulus = /** @class */ (function (_super) { __extends(linulus, _super); function linulus() { return _super !== null && _super.apply(this, arguments) || this; @@ -3627,7 +3627,7 @@ var panamensis; panamensis.linulus = linulus; })(panamensis || (panamensis = {})); (function (nigra) { - var gracilis = (function () { + var gracilis = /** @class */ (function () { function gracilis() { } gracilis.prototype.weddellii = function () { @@ -3714,7 +3714,7 @@ var panamensis; })(nigra || (nigra = {})); var samarensis; (function (samarensis) { - var pelurus = (function (_super) { + var pelurus = /** @class */ (function (_super) { __extends(pelurus, _super); function pelurus() { return _super !== null && _super.apply(this, arguments) || this; @@ -3800,7 +3800,7 @@ var samarensis; return pelurus; }(sagitta.stolzmanni)); samarensis.pelurus = pelurus; - var fuscus = (function (_super) { + var fuscus = /** @class */ (function (_super) { __extends(fuscus, _super); function fuscus() { return _super !== null && _super.apply(this, arguments) || this; @@ -3892,7 +3892,7 @@ var samarensis; return fuscus; }(macrorhinos.daphaenodon)); samarensis.fuscus = fuscus; - var pallidus = (function () { + var pallidus = /** @class */ (function () { function pallidus() { } pallidus.prototype.oblativa = function () { @@ -3922,7 +3922,7 @@ var samarensis; return pallidus; }()); samarensis.pallidus = pallidus; - var cahirinus = (function () { + var cahirinus = /** @class */ (function () { function cahirinus() { } cahirinus.prototype.alashanicus = function () { @@ -3960,7 +3960,7 @@ var samarensis; samarensis.cahirinus = cahirinus; })(samarensis || (samarensis = {})); (function (sagitta) { - var leptoceros = (function (_super) { + var leptoceros = /** @class */ (function (_super) { __extends(leptoceros, _super); function leptoceros() { return _super !== null && _super.apply(this, arguments) || this; @@ -4000,7 +4000,7 @@ var samarensis; sagitta.leptoceros = leptoceros; })(sagitta || (sagitta = {})); (function (daubentonii) { - var nigricans = (function (_super) { + var nigricans = /** @class */ (function (_super) { __extends(nigricans, _super); function nigricans() { return _super !== null && _super.apply(this, arguments) || this; @@ -4017,7 +4017,7 @@ var samarensis; })(daubentonii || (daubentonii = {})); var dammermani; (function (dammermani) { - var siberu = (function () { + var siberu = /** @class */ (function () { function siberu() { } return siberu; @@ -4025,7 +4025,7 @@ var dammermani; dammermani.siberu = siberu; })(dammermani || (dammermani = {})); (function (argurus) { - var pygmaea = (function (_super) { + var pygmaea = /** @class */ (function (_super) { __extends(pygmaea, _super); function pygmaea() { return _super !== null && _super.apply(this, arguments) || this; @@ -4054,7 +4054,7 @@ var dammermani; })(argurus || (argurus = {})); var chrysaeolus; (function (chrysaeolus) { - var sarasinorum = (function (_super) { + var sarasinorum = /** @class */ (function (_super) { __extends(sarasinorum, _super); function sarasinorum() { return _super !== null && _super.apply(this, arguments) || this; @@ -4106,7 +4106,7 @@ var chrysaeolus; chrysaeolus.sarasinorum = sarasinorum; })(chrysaeolus || (chrysaeolus = {})); (function (argurus) { - var wetmorei = (function () { + var wetmorei = /** @class */ (function () { function wetmorei() { } wetmorei.prototype.leucoptera = function () { @@ -4156,7 +4156,7 @@ var chrysaeolus; argurus.wetmorei = wetmorei; })(argurus || (argurus = {})); (function (argurus) { - var oreas = (function (_super) { + var oreas = /** @class */ (function (_super) { __extends(oreas, _super); function oreas() { return _super !== null && _super.apply(this, arguments) || this; @@ -4214,7 +4214,7 @@ var chrysaeolus; argurus.oreas = oreas; })(argurus || (argurus = {})); (function (daubentonii) { - var arboreus = (function () { + var arboreus = /** @class */ (function () { function arboreus() { } arboreus.prototype.capreolus = function () { @@ -4295,7 +4295,7 @@ var chrysaeolus; })(daubentonii || (daubentonii = {})); var patas; (function (patas) { - var uralensis = (function () { + var uralensis = /** @class */ (function () { function uralensis() { } uralensis.prototype.cartilagonodus = function () { @@ -4382,7 +4382,7 @@ var patas; })(patas || (patas = {})); var provocax; (function (provocax) { - var melanoleuca = (function (_super) { + var melanoleuca = /** @class */ (function (_super) { __extends(melanoleuca, _super); function melanoleuca() { return _super !== null && _super.apply(this, arguments) || this; @@ -4404,7 +4404,7 @@ var provocax; provocax.melanoleuca = melanoleuca; })(provocax || (provocax = {})); (function (sagitta) { - var sicarius = (function () { + var sicarius = /** @class */ (function () { function sicarius() { } sicarius.prototype.Chlorine = function () { @@ -4424,7 +4424,7 @@ var provocax; sagitta.sicarius = sicarius; })(sagitta || (sagitta = {})); (function (howi) { - var marcanoi = (function (_super) { + var marcanoi = /** @class */ (function (_super) { __extends(marcanoi, _super); function marcanoi() { return _super !== null && _super.apply(this, arguments) || this; @@ -4518,7 +4518,7 @@ var provocax; howi.marcanoi = marcanoi; })(howi || (howi = {})); (function (argurus) { - var gilbertii = (function () { + var gilbertii = /** @class */ (function () { function gilbertii() { } gilbertii.prototype.nasutus = function () { @@ -4599,7 +4599,7 @@ var provocax; })(argurus || (argurus = {})); var petrophilus; (function (petrophilus) { - var minutilla = (function () { + var minutilla = /** @class */ (function () { function minutilla() { } return minutilla; @@ -4607,7 +4607,7 @@ var petrophilus; petrophilus.minutilla = minutilla; })(petrophilus || (petrophilus = {})); (function (lutreolus) { - var punicus = (function () { + var punicus = /** @class */ (function () { function punicus() { } punicus.prototype.strandi = function () { @@ -4693,7 +4693,7 @@ var petrophilus; lutreolus.punicus = punicus; })(lutreolus || (lutreolus = {})); (function (macrorhinos) { - var daphaenodon = (function () { + var daphaenodon = /** @class */ (function () { function daphaenodon() { } daphaenodon.prototype.bredanensis = function () { @@ -4737,7 +4737,7 @@ var petrophilus; macrorhinos.daphaenodon = daphaenodon; })(macrorhinos || (macrorhinos = {})); (function (sagitta) { - var cinereus = (function () { + var cinereus = /** @class */ (function () { function cinereus() { } cinereus.prototype.zunigae = function () { @@ -4817,7 +4817,7 @@ var petrophilus; sagitta.cinereus = cinereus; })(sagitta || (sagitta = {})); (function (nigra) { - var caucasica = (function () { + var caucasica = /** @class */ (function () { function caucasica() { } return caucasica; @@ -4826,7 +4826,7 @@ var petrophilus; })(nigra || (nigra = {})); var gabriellae; (function (gabriellae) { - var klossii = (function (_super) { + var klossii = /** @class */ (function (_super) { __extends(klossii, _super); function klossii() { return _super !== null && _super.apply(this, arguments) || this; @@ -4834,7 +4834,7 @@ var gabriellae; return klossii; }(imperfecta.lasiurus)); gabriellae.klossii = klossii; - var amicus = (function () { + var amicus = /** @class */ (function () { function amicus() { } amicus.prototype.pirrensis = function () { @@ -4900,7 +4900,7 @@ var gabriellae; return amicus; }()); gabriellae.amicus = amicus; - var echinatus = (function () { + var echinatus = /** @class */ (function () { function echinatus() { } echinatus.prototype.tenuipes = function () { @@ -4915,7 +4915,7 @@ var gabriellae; })(gabriellae || (gabriellae = {})); var imperfecta; (function (imperfecta) { - var lasiurus = (function () { + var lasiurus = /** @class */ (function () { function lasiurus() { } lasiurus.prototype.marisae = function () { @@ -4957,7 +4957,7 @@ var imperfecta; return lasiurus; }()); imperfecta.lasiurus = lasiurus; - var subspinosus = (function () { + var subspinosus = /** @class */ (function () { function subspinosus() { } subspinosus.prototype.monticularis = function () { @@ -5029,7 +5029,7 @@ var imperfecta; return subspinosus; }()); imperfecta.subspinosus = subspinosus; - var ciliolabrum = (function (_super) { + var ciliolabrum = /** @class */ (function (_super) { __extends(ciliolabrum, _super); function ciliolabrum() { return _super !== null && _super.apply(this, arguments) || this; @@ -5057,7 +5057,7 @@ var imperfecta; imperfecta.ciliolabrum = ciliolabrum; })(imperfecta || (imperfecta = {})); (function (quasiater) { - var wattsi = (function () { + var wattsi = /** @class */ (function () { function wattsi() { } wattsi.prototype.lagotis = function () { @@ -5089,7 +5089,7 @@ var imperfecta; quasiater.wattsi = wattsi; })(quasiater || (quasiater = {})); (function (petrophilus) { - var sodyi = (function (_super) { + var sodyi = /** @class */ (function (_super) { __extends(sodyi, _super); function sodyi() { return _super !== null && _super.apply(this, arguments) || this; @@ -5153,7 +5153,7 @@ var imperfecta; petrophilus.sodyi = sodyi; })(petrophilus || (petrophilus = {})); (function (caurinus) { - var megaphyllus = (function (_super) { + var megaphyllus = /** @class */ (function (_super) { __extends(megaphyllus, _super); function megaphyllus() { return _super !== null && _super.apply(this, arguments) || this; @@ -5211,7 +5211,7 @@ var imperfecta; caurinus.megaphyllus = megaphyllus; })(caurinus || (caurinus = {})); (function (minutus) { - var portoricensis = (function () { + var portoricensis = /** @class */ (function () { function portoricensis() { } portoricensis.prototype.relictus = function () { @@ -5237,7 +5237,7 @@ var imperfecta; minutus.portoricensis = portoricensis; })(minutus || (minutus = {})); (function (lutreolus) { - var foina = (function () { + var foina = /** @class */ (function () { function foina() { } foina.prototype.tarfayensis = function () { @@ -5323,7 +5323,7 @@ var imperfecta; lutreolus.foina = foina; })(lutreolus || (lutreolus = {})); (function (lutreolus) { - var cor = (function (_super) { + var cor = /** @class */ (function (_super) { __extends(cor, _super); function cor() { return _super !== null && _super.apply(this, arguments) || this; @@ -5393,7 +5393,7 @@ var imperfecta; lutreolus.cor = cor; })(lutreolus || (lutreolus = {})); (function (howi) { - var coludo = (function () { + var coludo = /** @class */ (function () { function coludo() { } coludo.prototype.bernhardi = function () { @@ -5413,7 +5413,7 @@ var imperfecta; howi.coludo = coludo; })(howi || (howi = {})); (function (argurus) { - var germaini = (function (_super) { + var germaini = /** @class */ (function (_super) { __extends(germaini, _super); function germaini() { return _super !== null && _super.apply(this, arguments) || this; @@ -5435,7 +5435,7 @@ var imperfecta; argurus.germaini = germaini; })(argurus || (argurus = {})); (function (sagitta) { - var stolzmanni = (function () { + var stolzmanni = /** @class */ (function () { function stolzmanni() { } stolzmanni.prototype.riparius = function () { @@ -5509,7 +5509,7 @@ var imperfecta; sagitta.stolzmanni = stolzmanni; })(sagitta || (sagitta = {})); (function (dammermani) { - var melanops = (function (_super) { + var melanops = /** @class */ (function (_super) { __extends(melanops, _super); function melanops() { return _super !== null && _super.apply(this, arguments) || this; @@ -5597,7 +5597,7 @@ var imperfecta; dammermani.melanops = melanops; })(dammermani || (dammermani = {})); (function (argurus) { - var peninsulae = (function (_super) { + var peninsulae = /** @class */ (function (_super) { __extends(peninsulae, _super); function peninsulae() { return _super !== null && _super.apply(this, arguments) || this; @@ -5655,7 +5655,7 @@ var imperfecta; argurus.peninsulae = peninsulae; })(argurus || (argurus = {})); (function (argurus) { - var netscheri = (function () { + var netscheri = /** @class */ (function () { function netscheri() { } netscheri.prototype.gravis = function () { @@ -5741,7 +5741,7 @@ var imperfecta; argurus.netscheri = netscheri; })(argurus || (argurus = {})); (function (ruatanica) { - var Praseodymium = (function (_super) { + var Praseodymium = /** @class */ (function (_super) { __extends(Praseodymium, _super); function Praseodymium() { return _super !== null && _super.apply(this, arguments) || this; @@ -5829,7 +5829,7 @@ var imperfecta; ruatanica.Praseodymium = Praseodymium; })(ruatanica || (ruatanica = {})); (function (caurinus) { - var johorensis = (function (_super) { + var johorensis = /** @class */ (function (_super) { __extends(johorensis, _super); function johorensis() { return _super !== null && _super.apply(this, arguments) || this; @@ -5845,7 +5845,7 @@ var imperfecta; caurinus.johorensis = johorensis; })(caurinus || (caurinus = {})); (function (argurus) { - var luctuosa = (function () { + var luctuosa = /** @class */ (function () { function luctuosa() { } luctuosa.prototype.loriae = function () { @@ -5859,7 +5859,7 @@ var imperfecta; argurus.luctuosa = luctuosa; })(argurus || (argurus = {})); (function (panamensis) { - var setulosus = (function () { + var setulosus = /** @class */ (function () { function setulosus() { } setulosus.prototype.duthieae = function () { @@ -5915,7 +5915,7 @@ var imperfecta; panamensis.setulosus = setulosus; })(panamensis || (panamensis = {})); (function (petrophilus) { - var rosalia = (function () { + var rosalia = /** @class */ (function () { function rosalia() { } rosalia.prototype.palmeri = function () { @@ -5953,7 +5953,7 @@ var imperfecta; petrophilus.rosalia = rosalia; })(petrophilus || (petrophilus = {})); (function (caurinus) { - var psilurus = (function (_super) { + var psilurus = /** @class */ (function (_super) { __extends(psilurus, _super); function psilurus() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/restParamModifier.js b/tests/baselines/reference/restParamModifier.js index ed7307fcdef31..6e7ef6375bc62 100644 --- a/tests/baselines/reference/restParamModifier.js +++ b/tests/baselines/reference/restParamModifier.js @@ -4,7 +4,7 @@ class C { } //// [restParamModifier.js] -var C = (function () { +var C = /** @class */ (function () { function C(string) { if (string === void 0) { string = []; } } diff --git a/tests/baselines/reference/restParamModifier2.js b/tests/baselines/reference/restParamModifier2.js index e98aef3f9ad9a..50b91b302c6b0 100644 --- a/tests/baselines/reference/restParamModifier2.js +++ b/tests/baselines/reference/restParamModifier2.js @@ -4,7 +4,7 @@ class C { } //// [restParamModifier2.js] -var C = (function () { +var C = /** @class */ (function () { function C() { var rest = []; for (var _i = 0; _i < arguments.length; _i++) { diff --git a/tests/baselines/reference/restParameterAssignmentCompatibility.js b/tests/baselines/reference/restParameterAssignmentCompatibility.js index 01472c78c1ec5..5ad44dd1e0592 100644 --- a/tests/baselines/reference/restParameterAssignmentCompatibility.js +++ b/tests/baselines/reference/restParameterAssignmentCompatibility.js @@ -27,7 +27,7 @@ var t1: T1; t1 = s; // Similar to above, but optionality does not matter here. //// [restParameterAssignmentCompatibility.js] -var T = (function () { +var T = /** @class */ (function () { function T() { } T.prototype.m = function () { @@ -38,7 +38,7 @@ var T = (function () { }; return T; }()); -var S = (function () { +var S = /** @class */ (function () { function S() { } S.prototype.m = function (p1, p2) { @@ -50,7 +50,7 @@ var s; // M is a non - specialized call or construct signature and S' contains a call or construct signature N where, // the number of non-optional parameters in N is less than or equal to the total number of parameters in M, t = s; // Should be valid (rest params correspond to an infinite expansion of parameters) -var T1 = (function () { +var T1 = /** @class */ (function () { function T1() { } T1.prototype.m = function (p1, p2) { diff --git a/tests/baselines/reference/restParameterWithoutAnnotationIsAnyArray.js b/tests/baselines/reference/restParameterWithoutAnnotationIsAnyArray.js index 5c1db2c62e1b3..519634f41e238 100644 --- a/tests/baselines/reference/restParameterWithoutAnnotationIsAnyArray.js +++ b/tests/baselines/reference/restParameterWithoutAnnotationIsAnyArray.js @@ -46,7 +46,7 @@ var f2 = function () { y[_i - 1] = arguments[_i]; } }; -var C = (function () { +var C = /** @class */ (function () { function C() { } C.prototype.foo = function () { diff --git a/tests/baselines/reference/restParametersOfNonArrayTypes.js b/tests/baselines/reference/restParametersOfNonArrayTypes.js index 6714516772083..eee1f6d844a0d 100644 --- a/tests/baselines/reference/restParametersOfNonArrayTypes.js +++ b/tests/baselines/reference/restParametersOfNonArrayTypes.js @@ -45,7 +45,7 @@ var f2 = function () { y[_i - 1] = arguments[_i]; } }; -var C = (function () { +var C = /** @class */ (function () { function C() { } C.prototype.foo = function () { diff --git a/tests/baselines/reference/restParametersOfNonArrayTypes2.js b/tests/baselines/reference/restParametersOfNonArrayTypes2.js index 7df2458a27b3f..dc0527aa67a98 100644 --- a/tests/baselines/reference/restParametersOfNonArrayTypes2.js +++ b/tests/baselines/reference/restParametersOfNonArrayTypes2.js @@ -77,7 +77,7 @@ var f2 = function () { y[_i - 1] = arguments[_i]; } }; -var C = (function () { +var C = /** @class */ (function () { function C() { } C.prototype.foo = function () { @@ -127,7 +127,7 @@ var f4 = function () { y[_i - 1] = arguments[_i]; } }; -var C2 = (function () { +var C2 = /** @class */ (function () { function C2() { } C2.prototype.foo = function () { diff --git a/tests/baselines/reference/restParametersWithArrayTypeAnnotations.js b/tests/baselines/reference/restParametersWithArrayTypeAnnotations.js index 1004fdfcbcb41..4e1f02d6b882e 100644 --- a/tests/baselines/reference/restParametersWithArrayTypeAnnotations.js +++ b/tests/baselines/reference/restParametersWithArrayTypeAnnotations.js @@ -72,7 +72,7 @@ var f2 = function () { y[_i - 1] = arguments[_i]; } }; -var C = (function () { +var C = /** @class */ (function () { function C() { } C.prototype.foo = function () { @@ -122,7 +122,7 @@ var f4 = function () { y[_i - 1] = arguments[_i]; } }; -var C2 = (function () { +var C2 = /** @class */ (function () { function C2() { } C2.prototype.foo = function () { diff --git a/tests/baselines/reference/returnInConstructor1.js b/tests/baselines/reference/returnInConstructor1.js index 6bdcc0cb6a29d..4c7ba68594471 100644 --- a/tests/baselines/reference/returnInConstructor1.js +++ b/tests/baselines/reference/returnInConstructor1.js @@ -77,47 +77,47 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var A = (function () { +var A = /** @class */ (function () { function A() { return; } A.prototype.foo = function () { }; return A; }()); -var B = (function () { +var B = /** @class */ (function () { function B() { return 1; // error } B.prototype.foo = function () { }; return B; }()); -var C = (function () { +var C = /** @class */ (function () { function C() { return this; } C.prototype.foo = function () { }; return C; }()); -var D = (function () { +var D = /** @class */ (function () { function D() { return "test"; // error } D.prototype.foo = function () { }; return D; }()); -var E = (function () { +var E = /** @class */ (function () { function E() { return { foo: 1 }; } return E; }()); -var F = (function () { +var F = /** @class */ (function () { function F() { return { foo: 1 }; //error } return F; }()); -var G = (function () { +var G = /** @class */ (function () { function G() { this.test = 2; } @@ -125,7 +125,7 @@ var G = (function () { G.prototype.foo = function () { }; return G; }()); -var H = (function (_super) { +var H = /** @class */ (function (_super) { __extends(H, _super); function H() { var _this = _super.call(this) || this; @@ -133,7 +133,7 @@ var H = (function (_super) { } return H; }(F)); -var I = (function (_super) { +var I = /** @class */ (function (_super) { __extends(I, _super); function I() { var _this = _super.call(this) || this; diff --git a/tests/baselines/reference/returnStatements.js b/tests/baselines/reference/returnStatements.js index 617911be75977..8c3777bd10ca6 100644 --- a/tests/baselines/reference/returnStatements.js +++ b/tests/baselines/reference/returnStatements.js @@ -44,13 +44,13 @@ function fn5() { return true; } function fn6() { return new Date(12); } function fn7() { return null; } function fn8() { return; } // OK, eq. to 'return undefined' -var C = (function () { +var C = /** @class */ (function () { function C() { } C.prototype.dispose = function () { }; return C; }()); -var D = (function (_super) { +var D = /** @class */ (function (_super) { __extends(D, _super); function D() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/returnTypeTypeArguments.js b/tests/baselines/reference/returnTypeTypeArguments.js index ade97159091fc..d9264bdb7bc87 100644 --- a/tests/baselines/reference/returnTypeTypeArguments.js +++ b/tests/baselines/reference/returnTypeTypeArguments.js @@ -77,17 +77,17 @@ declare var a: { //// [returnTypeTypeArguments.js] -var One = (function () { +var One = /** @class */ (function () { function One() { } return One; }()); -var Two = (function () { +var Two = /** @class */ (function () { function Two() { } return Two; }()); -var Three = (function () { +var Three = /** @class */ (function () { function Three() { } return Three; @@ -98,7 +98,7 @@ function A3() { return null; } function B1() { return null; } function B2() { return null; } function B3() { return null; } -var C = (function () { +var C = /** @class */ (function () { function C() { } C.prototype.A1 = function () { return null; }; @@ -109,7 +109,7 @@ var C = (function () { C.prototype.B3 = function () { return null; }; return C; }()); -var D = (function () { +var D = /** @class */ (function () { function D() { } D.prototype.A2 = function () { return null; }; @@ -119,12 +119,12 @@ var D = (function () { D.prototype.B3 = function () { return null; }; return D; }()); -var Y = (function () { +var Y = /** @class */ (function () { function Y() { } return Y; }()); -var X = (function () { +var X = /** @class */ (function () { function X() { } return X; diff --git a/tests/baselines/reference/returnValueInSetter.js b/tests/baselines/reference/returnValueInSetter.js index 86a52670ac534..2fe980308b599 100644 --- a/tests/baselines/reference/returnValueInSetter.js +++ b/tests/baselines/reference/returnValueInSetter.js @@ -8,7 +8,7 @@ class f { //// [returnValueInSetter.js] -var f = (function () { +var f = /** @class */ (function () { function f() { } Object.defineProperty(f.prototype, "x", { diff --git a/tests/baselines/reference/scannerClass2.js b/tests/baselines/reference/scannerClass2.js index 339098b481a19..a244c21208708 100644 --- a/tests/baselines/reference/scannerClass2.js +++ b/tests/baselines/reference/scannerClass2.js @@ -8,7 +8,7 @@ //// [scannerClass2.js] "use strict"; exports.__esModule = true; -var LoggerAdapter = (function () { +var LoggerAdapter = /** @class */ (function () { function LoggerAdapter(logger) { this.logger = logger; this._information = this.logger.information(); diff --git a/tests/baselines/reference/scannertest1.js b/tests/baselines/reference/scannertest1.js index 2eb7115747624..cf289ddf73c9d 100644 --- a/tests/baselines/reference/scannertest1.js +++ b/tests/baselines/reference/scannertest1.js @@ -26,7 +26,7 @@ class CharacterInfo { //// [scannertest1.js] /// -var CharacterInfo = (function () { +var CharacterInfo = /** @class */ (function () { function CharacterInfo() { } CharacterInfo.isDecimalDigit = function (c) { diff --git a/tests/baselines/reference/scopeCheckClassProperty.js b/tests/baselines/reference/scopeCheckClassProperty.js index 13324e7447d1c..06a62d5a33bfa 100644 --- a/tests/baselines/reference/scopeCheckClassProperty.js +++ b/tests/baselines/reference/scopeCheckClassProperty.js @@ -11,14 +11,14 @@ class A { //// [scopeCheckClassProperty.js] -var C = (function () { +var C = /** @class */ (function () { function C() { this.x = new A().p; // should also be ok new A().p; // ok } return C; }()); -var A = (function () { +var A = /** @class */ (function () { function A() { this.p = ''; } diff --git a/tests/baselines/reference/scopeCheckExtendedClassInsidePublicMethod2.js b/tests/baselines/reference/scopeCheckExtendedClassInsidePublicMethod2.js index c72fe6dde7d10..939efe7572370 100644 --- a/tests/baselines/reference/scopeCheckExtendedClassInsidePublicMethod2.js +++ b/tests/baselines/reference/scopeCheckExtendedClassInsidePublicMethod2.js @@ -19,12 +19,12 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var C = (function () { +var C = /** @class */ (function () { function C() { } return C; }()); -var D = (function (_super) { +var D = /** @class */ (function (_super) { __extends(D, _super); function D() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/scopeCheckExtendedClassInsideStaticMethod1.js b/tests/baselines/reference/scopeCheckExtendedClassInsideStaticMethod1.js index 34c1698a3ea3b..33f78f5f6e122 100644 --- a/tests/baselines/reference/scopeCheckExtendedClassInsideStaticMethod1.js +++ b/tests/baselines/reference/scopeCheckExtendedClassInsideStaticMethod1.js @@ -19,12 +19,12 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var C = (function () { +var C = /** @class */ (function () { function C() { } return C; }()); -var D = (function (_super) { +var D = /** @class */ (function (_super) { __extends(D, _super); function D() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/scopeCheckInsidePublicMethod1.js b/tests/baselines/reference/scopeCheckInsidePublicMethod1.js index 46ee1fc719d93..be3be2a02427e 100644 --- a/tests/baselines/reference/scopeCheckInsidePublicMethod1.js +++ b/tests/baselines/reference/scopeCheckInsidePublicMethod1.js @@ -7,7 +7,7 @@ class C { } //// [scopeCheckInsidePublicMethod1.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } C.prototype.a = function () { diff --git a/tests/baselines/reference/scopeCheckInsideStaticMethod1.js b/tests/baselines/reference/scopeCheckInsideStaticMethod1.js index 138c9daa483c2..6e9bfffea0306 100644 --- a/tests/baselines/reference/scopeCheckInsideStaticMethod1.js +++ b/tests/baselines/reference/scopeCheckInsideStaticMethod1.js @@ -11,7 +11,7 @@ class C { } //// [scopeCheckInsideStaticMethod1.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } C.b = function () { diff --git a/tests/baselines/reference/scopeCheckStaticInitializer.js b/tests/baselines/reference/scopeCheckStaticInitializer.js index a9478d4480056..a03cce6e0ac9e 100644 --- a/tests/baselines/reference/scopeCheckStaticInitializer.js +++ b/tests/baselines/reference/scopeCheckStaticInitializer.js @@ -16,7 +16,7 @@ class After { //// [scopeCheckStaticInitializer.js] -var X = (function () { +var X = /** @class */ (function () { function X() { } X.method = function () { }; @@ -27,7 +27,7 @@ var X = (function () { X.data = 13; return X; }()); -var After = (function () { +var After = /** @class */ (function () { function After() { } After.method = function () { }; diff --git a/tests/baselines/reference/scopeResolutionIdentifiers.js b/tests/baselines/reference/scopeResolutionIdentifiers.js index ca45a95239ec5..0ffbee0734029 100644 --- a/tests/baselines/reference/scopeResolutionIdentifiers.js +++ b/tests/baselines/reference/scopeResolutionIdentifiers.js @@ -57,7 +57,7 @@ function fn() { var n = s; var n; } -var C = (function () { +var C = /** @class */ (function () { function C() { this.n = this.s; } diff --git a/tests/baselines/reference/scopeTests.js b/tests/baselines/reference/scopeTests.js index b60242c07147b..a39e9928c2293 100644 --- a/tests/baselines/reference/scopeTests.js +++ b/tests/baselines/reference/scopeTests.js @@ -22,12 +22,12 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var C = (function () { +var C = /** @class */ (function () { function C() { } return C; }()); -var D = (function (_super) { +var D = /** @class */ (function (_super) { __extends(D, _super); function D() { var _this = _super.call(this) || this; diff --git a/tests/baselines/reference/selfInCallback.js b/tests/baselines/reference/selfInCallback.js index a0b363ae08154..585e72ea54882 100644 --- a/tests/baselines/reference/selfInCallback.js +++ b/tests/baselines/reference/selfInCallback.js @@ -8,7 +8,7 @@ class C { } //// [selfInCallback.js] -var C = (function () { +var C = /** @class */ (function () { function C() { this.p1 = 0; } diff --git a/tests/baselines/reference/selfInLambdas.js b/tests/baselines/reference/selfInLambdas.js index b143c0c9e4ea3..aa1cf91eea5f1 100644 --- a/tests/baselines/reference/selfInLambdas.js +++ b/tests/baselines/reference/selfInLambdas.js @@ -57,7 +57,7 @@ var o = { }; } }; -var X = (function () { +var X = /** @class */ (function () { function X() { this.value = "value"; } diff --git a/tests/baselines/reference/selfRef.js b/tests/baselines/reference/selfRef.js index 7f13e04cef18a..696bf298b9696 100644 --- a/tests/baselines/reference/selfRef.js +++ b/tests/baselines/reference/selfRef.js @@ -21,7 +21,7 @@ module M //// [selfRef.js] var M; (function (M) { - var Test = (function () { + var Test = /** @class */ (function () { function Test() { this.name = "hello"; this.setName = function (value) { diff --git a/tests/baselines/reference/selfReferencesInFunctionParameters.js b/tests/baselines/reference/selfReferencesInFunctionParameters.js index 5dd662cf16959..01b19a631c172 100644 --- a/tests/baselines/reference/selfReferencesInFunctionParameters.js +++ b/tests/baselines/reference/selfReferencesInFunctionParameters.js @@ -21,7 +21,7 @@ function bar(x0, x) { if (x0 === void 0) { x0 = ""; } if (x === void 0) { x = x; } } -var C = (function () { +var C = /** @class */ (function () { function C(x, y) { if (x === void 0) { x = 1; } if (y === void 0) { y = y; } diff --git a/tests/baselines/reference/selfReferencingFile.js b/tests/baselines/reference/selfReferencingFile.js index 82b706c55e621..513b860bc1e20 100644 --- a/tests/baselines/reference/selfReferencingFile.js +++ b/tests/baselines/reference/selfReferencingFile.js @@ -7,7 +7,7 @@ class selfReferencingFile { //// [selfReferencingFile.js] /// -var selfReferencingFile = (function () { +var selfReferencingFile = /** @class */ (function () { function selfReferencingFile() { } return selfReferencingFile; diff --git a/tests/baselines/reference/selfReferencingFile2.js b/tests/baselines/reference/selfReferencingFile2.js index a14f9e1e87026..3e26d3a2516c9 100644 --- a/tests/baselines/reference/selfReferencingFile2.js +++ b/tests/baselines/reference/selfReferencingFile2.js @@ -7,7 +7,7 @@ class selfReferencingFile2 { //// [selfReferencingFile2.js] /// -var selfReferencingFile2 = (function () { +var selfReferencingFile2 = /** @class */ (function () { function selfReferencingFile2() { } return selfReferencingFile2; diff --git a/tests/baselines/reference/selfReferencingFile3.js b/tests/baselines/reference/selfReferencingFile3.js index 08db051ec1887..7503307ebaca0 100644 --- a/tests/baselines/reference/selfReferencingFile3.js +++ b/tests/baselines/reference/selfReferencingFile3.js @@ -7,7 +7,7 @@ class selfReferencingFile3 { //// [selfReferencingFile3.js] /// -var selfReferencingFile3 = (function () { +var selfReferencingFile3 = /** @class */ (function () { function selfReferencingFile3() { } return selfReferencingFile3; diff --git a/tests/baselines/reference/setterBeforeGetter.js b/tests/baselines/reference/setterBeforeGetter.js index d5200a4eb4d3d..743ad9da03977 100644 --- a/tests/baselines/reference/setterBeforeGetter.js +++ b/tests/baselines/reference/setterBeforeGetter.js @@ -13,7 +13,7 @@ class Foo { //// [setterBeforeGetter.js] -var Foo = (function () { +var Foo = /** @class */ (function () { function Foo() { } Object.defineProperty(Foo.prototype, "bar", { diff --git a/tests/baselines/reference/setterWithReturn.js b/tests/baselines/reference/setterWithReturn.js index b7fa5c67f8e0c..d4b6b92e85892 100644 --- a/tests/baselines/reference/setterWithReturn.js +++ b/tests/baselines/reference/setterWithReturn.js @@ -11,7 +11,7 @@ class C234 { } //// [setterWithReturn.js] -var C234 = (function () { +var C234 = /** @class */ (function () { function C234() { } Object.defineProperty(C234.prototype, "p1", { diff --git a/tests/baselines/reference/shadowPrivateMembers.js b/tests/baselines/reference/shadowPrivateMembers.js index ce0fd333b914b..3beaa037e0feb 100644 --- a/tests/baselines/reference/shadowPrivateMembers.js +++ b/tests/baselines/reference/shadowPrivateMembers.js @@ -14,13 +14,13 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var base = (function () { +var base = /** @class */ (function () { function base() { } base.prototype.n = function () { }; return base; }()); -var derived = (function (_super) { +var derived = /** @class */ (function (_super) { __extends(derived, _super); function derived() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/shadowedInternalModule.js b/tests/baselines/reference/shadowedInternalModule.js index d2566976092ef..5d8e33d5eeb6c 100644 --- a/tests/baselines/reference/shadowedInternalModule.js +++ b/tests/baselines/reference/shadowedInternalModule.js @@ -45,7 +45,7 @@ var B; })(B || (B = {})); var X; (function (X) { - var Y = (function () { + var Y = /** @class */ (function () { function Y() { } return Y; diff --git a/tests/baselines/reference/sigantureIsSubTypeIfTheyAreIdentical.js b/tests/baselines/reference/sigantureIsSubTypeIfTheyAreIdentical.js index 39b67f9026d94..6e42a3a67b0ab 100644 --- a/tests/baselines/reference/sigantureIsSubTypeIfTheyAreIdentical.js +++ b/tests/baselines/reference/sigantureIsSubTypeIfTheyAreIdentical.js @@ -9,7 +9,7 @@ class CacheService implements ICache { // Should not error that property type of } //// [sigantureIsSubTypeIfTheyAreIdentical.js] -var CacheService = (function () { +var CacheService = /** @class */ (function () { function CacheService() { } CacheService.prototype.get = function (key) { diff --git a/tests/baselines/reference/sourceMap-Comments.js b/tests/baselines/reference/sourceMap-Comments.js index e8177d5752c06..7db1fe70349af 100644 --- a/tests/baselines/reference/sourceMap-Comments.js +++ b/tests/baselines/reference/sourceMap-Comments.js @@ -25,7 +25,7 @@ var sas; (function (sas) { var tools; (function (tools) { - var Test = (function () { + var Test = /** @class */ (function () { function Test() { } Test.prototype.doX = function () { diff --git a/tests/baselines/reference/sourceMap-Comments.sourcemap.txt b/tests/baselines/reference/sourceMap-Comments.sourcemap.txt index f6009f3fc344e..ab5c2293f353f 100644 --- a/tests/baselines/reference/sourceMap-Comments.sourcemap.txt +++ b/tests/baselines/reference/sourceMap-Comments.sourcemap.txt @@ -90,7 +90,7 @@ sourceFile:sourceMap-Comments.ts 1->^^^^ 2 > ^^^^^^^^^^^ 3 > ^^^^^ -4 > ^^^^^^^^^^^^^^-> +4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1-> 2 > 3 > tools @@ -98,7 +98,7 @@ sourceFile:sourceMap-Comments.ts 2 >Emitted(4, 16) Source(1, 12) + SourceIndex(0) 3 >Emitted(4, 21) Source(1, 17) + SourceIndex(0) --- ->>> var Test = (function () { +>>> var Test = /** @class */ (function () { 1->^^^^^^^^ 2 > ^^^^^^^^^^^^^^^^^^^^^^-> 1-> { diff --git a/tests/baselines/reference/sourceMap-FileWithComments.js b/tests/baselines/reference/sourceMap-FileWithComments.js index 7fd47997c972c..dc76921c0389f 100644 --- a/tests/baselines/reference/sourceMap-FileWithComments.js +++ b/tests/baselines/reference/sourceMap-FileWithComments.js @@ -40,7 +40,7 @@ var dist = p.getDist(); var Shapes; (function (Shapes) { // Class - var Point = (function () { + var Point = /** @class */ (function () { // Constructor function Point(x, y) { this.x = x; diff --git a/tests/baselines/reference/sourceMap-FileWithComments.sourcemap.txt b/tests/baselines/reference/sourceMap-FileWithComments.sourcemap.txt index b53a0a4a7ce94..7ab22e9d0ad65 100644 --- a/tests/baselines/reference/sourceMap-FileWithComments.sourcemap.txt +++ b/tests/baselines/reference/sourceMap-FileWithComments.sourcemap.txt @@ -76,7 +76,7 @@ sourceFile:sourceMap-FileWithComments.ts >>> // Class 1 >^^^^ 2 > ^^^^^^^^ -3 > ^^^^^^^^^^^^^^^^^^^-> +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > { > > @@ -84,7 +84,7 @@ sourceFile:sourceMap-FileWithComments.ts 1 >Emitted(4, 5) Source(9, 5) + SourceIndex(0) 2 >Emitted(4, 13) Source(9, 13) + SourceIndex(0) --- ->>> var Point = (function () { +>>> var Point = /** @class */ (function () { 1->^^^^ 2 > ^^^^^^^^^^^^^^^^^^^-> 1-> diff --git a/tests/baselines/reference/sourceMapSample.js b/tests/baselines/reference/sourceMapSample.js index 4b710b89234cf..b9ef2611c9b11 100644 --- a/tests/baselines/reference/sourceMapSample.js +++ b/tests/baselines/reference/sourceMapSample.js @@ -41,7 +41,7 @@ var Foo; var Bar; (function (Bar) { "use strict"; - var Greeter = (function () { + var Greeter = /** @class */ (function () { function Greeter(greeting) { this.greeting = greeting; } diff --git a/tests/baselines/reference/sourceMapSample.sourcemap.txt b/tests/baselines/reference/sourceMapSample.sourcemap.txt index 03ded2b660978..a24bb2cbb062f 100644 --- a/tests/baselines/reference/sourceMapSample.sourcemap.txt +++ b/tests/baselines/reference/sourceMapSample.sourcemap.txt @@ -133,7 +133,7 @@ sourceFile:sourceMapSample.ts 1->^^^^^^^^ 2 > ^^^^^^^^^^^^ 3 > ^ -4 > ^^^^^^^^^^^^^^^^-> +4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1-> { > 2 > "use strict" @@ -142,7 +142,7 @@ sourceFile:sourceMapSample.ts 2 >Emitted(5, 21) Source(2, 17) + SourceIndex(0) 3 >Emitted(5, 22) Source(2, 18) + SourceIndex(0) --- ->>> var Greeter = (function () { +>>> var Greeter = /** @class */ (function () { 1->^^^^^^^^ 2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1-> diff --git a/tests/baselines/reference/sourceMapValidationClass.js b/tests/baselines/reference/sourceMapValidationClass.js index f0ddca123f9b6..803a266311422 100644 --- a/tests/baselines/reference/sourceMapValidationClass.js +++ b/tests/baselines/reference/sourceMapValidationClass.js @@ -19,7 +19,7 @@ class Greeter { } //// [sourceMapValidationClass.js] -var Greeter = (function () { +var Greeter = /** @class */ (function () { function Greeter(greeting) { var b = []; for (var _i = 1; _i < arguments.length; _i++) { diff --git a/tests/baselines/reference/sourceMapValidationClass.sourcemap.txt b/tests/baselines/reference/sourceMapValidationClass.sourcemap.txt index 08fdfe2bfc66b..137b83e230f87 100644 --- a/tests/baselines/reference/sourceMapValidationClass.sourcemap.txt +++ b/tests/baselines/reference/sourceMapValidationClass.sourcemap.txt @@ -8,7 +8,7 @@ sources: sourceMapValidationClass.ts emittedFile:tests/cases/compiler/sourceMapValidationClass.js sourceFile:sourceMapValidationClass.ts ------------------------------------------------------------------- ->>>var Greeter = (function () { +>>>var Greeter = /** @class */ (function () { 1 > 2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > diff --git a/tests/baselines/reference/sourceMapValidationClassWithDefaultConstructor.js b/tests/baselines/reference/sourceMapValidationClassWithDefaultConstructor.js index f76b44fdcd854..d53e9d373e62c 100644 --- a/tests/baselines/reference/sourceMapValidationClassWithDefaultConstructor.js +++ b/tests/baselines/reference/sourceMapValidationClassWithDefaultConstructor.js @@ -5,7 +5,7 @@ class Greeter { } //// [sourceMapValidationClassWithDefaultConstructor.js] -var Greeter = (function () { +var Greeter = /** @class */ (function () { function Greeter() { this.a = 10; this.nameA = "Ten"; diff --git a/tests/baselines/reference/sourceMapValidationClassWithDefaultConstructor.sourcemap.txt b/tests/baselines/reference/sourceMapValidationClassWithDefaultConstructor.sourcemap.txt index ad4b2800796e1..5c688dfab9dcd 100644 --- a/tests/baselines/reference/sourceMapValidationClassWithDefaultConstructor.sourcemap.txt +++ b/tests/baselines/reference/sourceMapValidationClassWithDefaultConstructor.sourcemap.txt @@ -8,7 +8,7 @@ sources: sourceMapValidationClassWithDefaultConstructor.ts emittedFile:tests/cases/compiler/sourceMapValidationClassWithDefaultConstructor.js sourceFile:sourceMapValidationClassWithDefaultConstructor.ts ------------------------------------------------------------------- ->>>var Greeter = (function () { +>>>var Greeter = /** @class */ (function () { 1 > 2 >^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > diff --git a/tests/baselines/reference/sourceMapValidationClassWithDefaultConstructorAndCapturedThisStatement.js b/tests/baselines/reference/sourceMapValidationClassWithDefaultConstructorAndCapturedThisStatement.js index ad92aa18eaec5..41443ad3e1343 100644 --- a/tests/baselines/reference/sourceMapValidationClassWithDefaultConstructorAndCapturedThisStatement.js +++ b/tests/baselines/reference/sourceMapValidationClassWithDefaultConstructorAndCapturedThisStatement.js @@ -5,7 +5,7 @@ class Greeter { } //// [sourceMapValidationClassWithDefaultConstructorAndCapturedThisStatement.js] -var Greeter = (function () { +var Greeter = /** @class */ (function () { function Greeter() { var _this = this; this.a = 10; diff --git a/tests/baselines/reference/sourceMapValidationClassWithDefaultConstructorAndCapturedThisStatement.sourcemap.txt b/tests/baselines/reference/sourceMapValidationClassWithDefaultConstructorAndCapturedThisStatement.sourcemap.txt index d5cb74636e7d3..5287799db9c98 100644 --- a/tests/baselines/reference/sourceMapValidationClassWithDefaultConstructorAndCapturedThisStatement.sourcemap.txt +++ b/tests/baselines/reference/sourceMapValidationClassWithDefaultConstructorAndCapturedThisStatement.sourcemap.txt @@ -8,7 +8,7 @@ sources: sourceMapValidationClassWithDefaultConstructorAndCapturedThisStatement. emittedFile:tests/cases/compiler/sourceMapValidationClassWithDefaultConstructorAndCapturedThisStatement.js sourceFile:sourceMapValidationClassWithDefaultConstructorAndCapturedThisStatement.ts ------------------------------------------------------------------- ->>>var Greeter = (function () { +>>>var Greeter = /** @class */ (function () { 1 > 2 >^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > diff --git a/tests/baselines/reference/sourceMapValidationClassWithDefaultConstructorAndExtendsClause.js b/tests/baselines/reference/sourceMapValidationClassWithDefaultConstructorAndExtendsClause.js index 44638fa007eb8..616cf950bcfa6 100644 --- a/tests/baselines/reference/sourceMapValidationClassWithDefaultConstructorAndExtendsClause.js +++ b/tests/baselines/reference/sourceMapValidationClassWithDefaultConstructorAndExtendsClause.js @@ -18,12 +18,12 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var AbstractGreeter = (function () { +var AbstractGreeter = /** @class */ (function () { function AbstractGreeter() { } return AbstractGreeter; }()); -var Greeter = (function (_super) { +var Greeter = /** @class */ (function (_super) { __extends(Greeter, _super); function Greeter() { var _this = _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/sourceMapValidationClassWithDefaultConstructorAndExtendsClause.sourcemap.txt b/tests/baselines/reference/sourceMapValidationClassWithDefaultConstructorAndExtendsClause.sourcemap.txt index 9fa37bcff06ba..dbda0afbf998b 100644 --- a/tests/baselines/reference/sourceMapValidationClassWithDefaultConstructorAndExtendsClause.sourcemap.txt +++ b/tests/baselines/reference/sourceMapValidationClassWithDefaultConstructorAndExtendsClause.sourcemap.txt @@ -18,7 +18,7 @@ sourceFile:sourceMapValidationClassWithDefaultConstructorAndExtendsClause.ts >>> d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); >>> }; >>>})(); ->>>var AbstractGreeter = (function () { +>>>var AbstractGreeter = /** @class */ (function () { 1 > 2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > @@ -53,7 +53,7 @@ sourceFile:sourceMapValidationClassWithDefaultConstructorAndExtendsClause.ts 2 >^ 3 > 4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > 2 >} 3 > @@ -64,7 +64,7 @@ sourceFile:sourceMapValidationClassWithDefaultConstructorAndExtendsClause.ts 3 >Emitted(15, 2) Source(1, 1) + SourceIndex(0) 4 >Emitted(15, 6) Source(2, 2) + SourceIndex(0) --- ->>>var Greeter = (function (_super) { +>>>var Greeter = /** @class */ (function (_super) { 1-> 2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1-> diff --git a/tests/baselines/reference/sourceMapValidationClasses.js b/tests/baselines/reference/sourceMapValidationClasses.js index 64517690f26e4..b9c3fcdc4316f 100644 --- a/tests/baselines/reference/sourceMapValidationClasses.js +++ b/tests/baselines/reference/sourceMapValidationClasses.js @@ -42,7 +42,7 @@ var Foo; var Bar; (function (Bar) { "use strict"; - var Greeter = (function () { + var Greeter = /** @class */ (function () { function Greeter(greeting) { this.greeting = greeting; } diff --git a/tests/baselines/reference/sourceMapValidationClasses.sourcemap.txt b/tests/baselines/reference/sourceMapValidationClasses.sourcemap.txt index 931c113ddc85b..efe8c68b7b753 100644 --- a/tests/baselines/reference/sourceMapValidationClasses.sourcemap.txt +++ b/tests/baselines/reference/sourceMapValidationClasses.sourcemap.txt @@ -135,7 +135,7 @@ sourceFile:sourceMapValidationClasses.ts 1->^^^^^^^^ 2 > ^^^^^^^^^^^^ 3 > ^ -4 > ^^^^^^^^^^^^^^^^-> +4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1-> { > 2 > "use strict" @@ -144,7 +144,7 @@ sourceFile:sourceMapValidationClasses.ts 2 >Emitted(5, 21) Source(2, 17) + SourceIndex(0) 3 >Emitted(5, 22) Source(2, 18) + SourceIndex(0) --- ->>> var Greeter = (function () { +>>> var Greeter = /** @class */ (function () { 1->^^^^^^^^ 2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1-> diff --git a/tests/baselines/reference/sourceMapValidationDecorators.js b/tests/baselines/reference/sourceMapValidationDecorators.js index c3bb5cd722526..cc7129a7f4dae 100644 --- a/tests/baselines/reference/sourceMapValidationDecorators.js +++ b/tests/baselines/reference/sourceMapValidationDecorators.js @@ -64,7 +64,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key, var __param = (this && this.__param) || function (paramIndex, decorator) { return function (target, key) { decorator(target, key, paramIndex); } }; -var Greeter = (function () { +var Greeter = /** @class */ (function () { function Greeter(greeting) { var b = []; for (var _i = 1; _i < arguments.length; _i++) { diff --git a/tests/baselines/reference/sourceMapValidationDecorators.sourcemap.txt b/tests/baselines/reference/sourceMapValidationDecorators.sourcemap.txt index 2cec971546b15..8849270fb61ed 100644 --- a/tests/baselines/reference/sourceMapValidationDecorators.sourcemap.txt +++ b/tests/baselines/reference/sourceMapValidationDecorators.sourcemap.txt @@ -17,7 +17,7 @@ sourceFile:sourceMapValidationDecorators.ts >>>var __param = (this && this.__param) || function (paramIndex, decorator) { >>> return function (target, key) { decorator(target, key, paramIndex); } >>>}; ->>>var Greeter = (function () { +>>>var Greeter = /** @class */ (function () { 1 > 2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 >declare function ClassDecorator1(target: Function): void; diff --git a/tests/baselines/reference/sourceMapValidationExportAssignment.js b/tests/baselines/reference/sourceMapValidationExportAssignment.js index f556ec0cb8197..3a8fd52b31e99 100644 --- a/tests/baselines/reference/sourceMapValidationExportAssignment.js +++ b/tests/baselines/reference/sourceMapValidationExportAssignment.js @@ -7,7 +7,7 @@ export = a; //// [sourceMapValidationExportAssignment.js] define(["require", "exports"], function (require, exports) { "use strict"; - var a = (function () { + var a = /** @class */ (function () { function a() { } return a; diff --git a/tests/baselines/reference/sourceMapValidationExportAssignment.sourcemap.txt b/tests/baselines/reference/sourceMapValidationExportAssignment.sourcemap.txt index cdb318d1e15d1..fd632130e732a 100644 --- a/tests/baselines/reference/sourceMapValidationExportAssignment.sourcemap.txt +++ b/tests/baselines/reference/sourceMapValidationExportAssignment.sourcemap.txt @@ -10,7 +10,7 @@ sourceFile:sourceMapValidationExportAssignment.ts ------------------------------------------------------------------- >>>define(["require", "exports"], function (require, exports) { >>> "use strict"; ->>> var a = (function () { +>>> var a = /** @class */ (function () { 1 >^^^^ 2 > ^^^^^^^^^^^^^^^^^^^-> 1 > diff --git a/tests/baselines/reference/sourceMapValidationExportAssignmentCommonjs.js b/tests/baselines/reference/sourceMapValidationExportAssignmentCommonjs.js index b524a09107b85..4fcbb1ce3a087 100644 --- a/tests/baselines/reference/sourceMapValidationExportAssignmentCommonjs.js +++ b/tests/baselines/reference/sourceMapValidationExportAssignmentCommonjs.js @@ -6,7 +6,7 @@ export = a; //// [sourceMapValidationExportAssignmentCommonjs.js] "use strict"; -var a = (function () { +var a = /** @class */ (function () { function a() { } return a; diff --git a/tests/baselines/reference/sourceMapValidationExportAssignmentCommonjs.sourcemap.txt b/tests/baselines/reference/sourceMapValidationExportAssignmentCommonjs.sourcemap.txt index ed6cf368d964e..491f087cb7a79 100644 --- a/tests/baselines/reference/sourceMapValidationExportAssignmentCommonjs.sourcemap.txt +++ b/tests/baselines/reference/sourceMapValidationExportAssignmentCommonjs.sourcemap.txt @@ -9,7 +9,7 @@ emittedFile:tests/cases/compiler/sourceMapValidationExportAssignmentCommonjs.js sourceFile:sourceMapValidationExportAssignmentCommonjs.ts ------------------------------------------------------------------- >>>"use strict"; ->>>var a = (function () { +>>>var a = /** @class */ (function () { 1 > 2 >^^^^^^^^^^^^^^^^^^^-> 1 > diff --git a/tests/baselines/reference/sourceMapValidationImport.js b/tests/baselines/reference/sourceMapValidationImport.js index 537c3c071350c..8d5b0f8441fb3 100644 --- a/tests/baselines/reference/sourceMapValidationImport.js +++ b/tests/baselines/reference/sourceMapValidationImport.js @@ -13,7 +13,7 @@ var y = new b(); exports.__esModule = true; var m; (function (m) { - var c = (function () { + var c = /** @class */ (function () { function c() { } return c; diff --git a/tests/baselines/reference/sourceMapValidationImport.sourcemap.txt b/tests/baselines/reference/sourceMapValidationImport.sourcemap.txt index d1fc9b1b72060..8d3a0328a31df 100644 --- a/tests/baselines/reference/sourceMapValidationImport.sourcemap.txt +++ b/tests/baselines/reference/sourceMapValidationImport.sourcemap.txt @@ -32,7 +32,7 @@ sourceFile:sourceMapValidationImport.ts 1-> 2 >^^^^^^^^^^^ 3 > ^ -4 > ^^^^^^^^^^^^^^^-> +4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1-> 2 >export module 3 > m @@ -40,7 +40,7 @@ sourceFile:sourceMapValidationImport.ts 2 >Emitted(4, 12) Source(1, 15) + SourceIndex(0) 3 >Emitted(4, 13) Source(1, 16) + SourceIndex(0) --- ->>> var c = (function () { +>>> var c = /** @class */ (function () { 1->^^^^ 2 > ^^^^^^^^^^^^^^^^^^^-> 1-> { diff --git a/tests/baselines/reference/sourceMapValidationWithComments.js b/tests/baselines/reference/sourceMapValidationWithComments.js index 653dcf3c90c35..2d14b54a23207 100644 --- a/tests/baselines/reference/sourceMapValidationWithComments.js +++ b/tests/baselines/reference/sourceMapValidationWithComments.js @@ -22,7 +22,7 @@ class DebugClass { } //// [sourceMapValidationWithComments.js] -var DebugClass = (function () { +var DebugClass = /** @class */ (function () { function DebugClass() { } DebugClass.debugFunc = function () { diff --git a/tests/baselines/reference/sourceMapValidationWithComments.sourcemap.txt b/tests/baselines/reference/sourceMapValidationWithComments.sourcemap.txt index 89d60b87c7db8..506f662e37d9a 100644 --- a/tests/baselines/reference/sourceMapValidationWithComments.sourcemap.txt +++ b/tests/baselines/reference/sourceMapValidationWithComments.sourcemap.txt @@ -8,7 +8,7 @@ sources: sourceMapValidationWithComments.ts emittedFile:tests/cases/compiler/sourceMapValidationWithComments.js sourceFile:sourceMapValidationWithComments.ts ------------------------------------------------------------------- ->>>var DebugClass = (function () { +>>>var DebugClass = /** @class */ (function () { 1 > 2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > diff --git a/tests/baselines/reference/sourceMapWithCaseSensitiveFileNames.js b/tests/baselines/reference/sourceMapWithCaseSensitiveFileNames.js index a41eea9cb281d..7f7d513a166ca 100644 --- a/tests/baselines/reference/sourceMapWithCaseSensitiveFileNames.js +++ b/tests/baselines/reference/sourceMapWithCaseSensitiveFileNames.js @@ -13,12 +13,12 @@ class d { //// [fooResult.js] // Note in the out result we are using same folder name only different in casing // Since this is case sensitive, the folders are different and hence the relative paths in sourcemap shouldn't be just app.ts or app2.ts -var c = (function () { +var c = /** @class */ (function () { function c() { } return c; }()); -var d = (function () { +var d = /** @class */ (function () { function d() { } return d; diff --git a/tests/baselines/reference/sourceMapWithCaseSensitiveFileNames.sourcemap.txt b/tests/baselines/reference/sourceMapWithCaseSensitiveFileNames.sourcemap.txt index fa1ae2e722180..834b858a7dc57 100644 --- a/tests/baselines/reference/sourceMapWithCaseSensitiveFileNames.sourcemap.txt +++ b/tests/baselines/reference/sourceMapWithCaseSensitiveFileNames.sourcemap.txt @@ -26,7 +26,7 @@ sourceFile:../testFiles/app.ts 1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) 2 >Emitted(2, 137) Source(2, 137) + SourceIndex(0) --- ->>>var c = (function () { +>>>var c = /** @class */ (function () { 1 > 2 >^^^^^^^^^^^^^^^^^^^-> 1 > @@ -62,7 +62,7 @@ sourceFile:../testFiles/app.ts 2 >^ 3 > 4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^-> +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > 2 >} 3 > @@ -77,7 +77,7 @@ sourceFile:../testFiles/app.ts emittedFile:tests/cases/compiler/testfiles/fooResult.js sourceFile:../testFiles/app2.ts ------------------------------------------------------------------- ->>>var d = (function () { +>>>var d = /** @class */ (function () { 1-> 2 >^^^^^^^^^^^^^^^^^^^-> 1-> diff --git a/tests/baselines/reference/sourceMapWithCaseSensitiveFileNamesAndOutDir.js b/tests/baselines/reference/sourceMapWithCaseSensitiveFileNamesAndOutDir.js index 3872068e7c29c..7b7abae996c67 100644 --- a/tests/baselines/reference/sourceMapWithCaseSensitiveFileNamesAndOutDir.js +++ b/tests/baselines/reference/sourceMapWithCaseSensitiveFileNamesAndOutDir.js @@ -13,13 +13,13 @@ class d { //// [app.js] // Note in the out result we are using same folder name only different in casing // Since this is case sensitive, the folders are different and hence the relative paths in sourcemap shouldn't be just app.ts or app2.ts -var c = (function () { +var c = /** @class */ (function () { function c() { } return c; }()); //# sourceMappingURL=app.js.map//// [app2.js] -var d = (function () { +var d = /** @class */ (function () { function d() { } return d; diff --git a/tests/baselines/reference/sourceMapWithCaseSensitiveFileNamesAndOutDir.sourcemap.txt b/tests/baselines/reference/sourceMapWithCaseSensitiveFileNamesAndOutDir.sourcemap.txt index bea8c2c6a9dbc..a5610c93e9b62 100644 --- a/tests/baselines/reference/sourceMapWithCaseSensitiveFileNamesAndOutDir.sourcemap.txt +++ b/tests/baselines/reference/sourceMapWithCaseSensitiveFileNamesAndOutDir.sourcemap.txt @@ -26,7 +26,7 @@ sourceFile:../testFiles/app.ts 1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) 2 >Emitted(2, 137) Source(2, 137) + SourceIndex(0) --- ->>>var c = (function () { +>>>var c = /** @class */ (function () { 1 > 2 >^^^^^^^^^^^^^^^^^^^-> 1 > @@ -83,7 +83,7 @@ sources: ../testFiles/app2.ts emittedFile:tests/cases/compiler/testfiles/app2.js sourceFile:../testFiles/app2.ts ------------------------------------------------------------------- ->>>var d = (function () { +>>>var d = /** @class */ (function () { 1 > 2 >^^^^^^^^^^^^^^^^^^^-> 1 > diff --git a/tests/baselines/reference/sourceMapWithMultipleFilesWithFileEndingWithInterface.js b/tests/baselines/reference/sourceMapWithMultipleFilesWithFileEndingWithInterface.js index 7e891c5765623..4b9816a6259dd 100644 --- a/tests/baselines/reference/sourceMapWithMultipleFilesWithFileEndingWithInterface.js +++ b/tests/baselines/reference/sourceMapWithMultipleFilesWithFileEndingWithInterface.js @@ -24,7 +24,7 @@ var M; })(M || (M = {})); var m1; (function (m1) { - var c1 = (function () { + var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/sourceMapWithMultipleFilesWithFileEndingWithInterface.sourcemap.txt b/tests/baselines/reference/sourceMapWithMultipleFilesWithFileEndingWithInterface.sourcemap.txt index 6895212b40168..824ff8ff81705 100644 --- a/tests/baselines/reference/sourceMapWithMultipleFilesWithFileEndingWithInterface.sourcemap.txt +++ b/tests/baselines/reference/sourceMapWithMultipleFilesWithFileEndingWithInterface.sourcemap.txt @@ -108,7 +108,7 @@ sourceFile:tests/cases/compiler/b.ts 1-> 2 >^^^^^^^^^^^ 3 > ^^ -4 > ^^^^^^^^^^^^^^^-> +4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1-> 2 >module 3 > m1 @@ -116,7 +116,7 @@ sourceFile:tests/cases/compiler/b.ts 2 >Emitted(6, 12) Source(1, 8) + SourceIndex(1) 3 >Emitted(6, 14) Source(1, 10) + SourceIndex(1) --- ->>> var c1 = (function () { +>>> var c1 = /** @class */ (function () { 1->^^^^ 2 > ^^^^^^^^^^^^^^^^^^^^-> 1-> { diff --git a/tests/baselines/reference/sourceMapWithNonCaseSensitiveFileNames.js b/tests/baselines/reference/sourceMapWithNonCaseSensitiveFileNames.js index b1da77bdb6760..76fd5061d05a7 100644 --- a/tests/baselines/reference/sourceMapWithNonCaseSensitiveFileNames.js +++ b/tests/baselines/reference/sourceMapWithNonCaseSensitiveFileNames.js @@ -13,12 +13,12 @@ class d { //// [fooResult.js] // Note in the out result we are using same folder name only different in casing // Since this is non case sensitive, the relative paths should be just app.ts and app2.ts in the sourcemap -var c = (function () { +var c = /** @class */ (function () { function c() { } return c; }()); -var d = (function () { +var d = /** @class */ (function () { function d() { } return d; diff --git a/tests/baselines/reference/sourceMapWithNonCaseSensitiveFileNames.sourcemap.txt b/tests/baselines/reference/sourceMapWithNonCaseSensitiveFileNames.sourcemap.txt index 25b3d6cfeaf53..9b54bd34d71e0 100644 --- a/tests/baselines/reference/sourceMapWithNonCaseSensitiveFileNames.sourcemap.txt +++ b/tests/baselines/reference/sourceMapWithNonCaseSensitiveFileNames.sourcemap.txt @@ -26,7 +26,7 @@ sourceFile:app.ts 1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) 2 >Emitted(2, 107) Source(2, 107) + SourceIndex(0) --- ->>>var c = (function () { +>>>var c = /** @class */ (function () { 1 > 2 >^^^^^^^^^^^^^^^^^^^-> 1 > @@ -62,7 +62,7 @@ sourceFile:app.ts 2 >^ 3 > 4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^-> +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > 2 >} 3 > @@ -77,7 +77,7 @@ sourceFile:app.ts emittedFile:tests/cases/compiler/testfiles/fooResult.js sourceFile:app2.ts ------------------------------------------------------------------- ->>>var d = (function () { +>>>var d = /** @class */ (function () { 1-> 2 >^^^^^^^^^^^^^^^^^^^-> 1-> diff --git a/tests/baselines/reference/sourceMapWithNonCaseSensitiveFileNamesAndOutDir.js b/tests/baselines/reference/sourceMapWithNonCaseSensitiveFileNamesAndOutDir.js index 0abd131f0f99c..3487a70dc7bb3 100644 --- a/tests/baselines/reference/sourceMapWithNonCaseSensitiveFileNamesAndOutDir.js +++ b/tests/baselines/reference/sourceMapWithNonCaseSensitiveFileNamesAndOutDir.js @@ -13,13 +13,13 @@ class d { //// [app.js] // Note in the out result we are using same folder name only different in casing // Since this is non case sensitive, the relative paths should be just app.ts and app2.ts in the sourcemap -var c = (function () { +var c = /** @class */ (function () { function c() { } return c; }()); //# sourceMappingURL=app.js.map//// [app2.js] -var d = (function () { +var d = /** @class */ (function () { function d() { } return d; diff --git a/tests/baselines/reference/sourceMapWithNonCaseSensitiveFileNamesAndOutDir.sourcemap.txt b/tests/baselines/reference/sourceMapWithNonCaseSensitiveFileNamesAndOutDir.sourcemap.txt index 7b4b590fad6c6..aa41dd50b4e68 100644 --- a/tests/baselines/reference/sourceMapWithNonCaseSensitiveFileNamesAndOutDir.sourcemap.txt +++ b/tests/baselines/reference/sourceMapWithNonCaseSensitiveFileNamesAndOutDir.sourcemap.txt @@ -26,7 +26,7 @@ sourceFile:app.ts 1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) 2 >Emitted(2, 107) Source(2, 107) + SourceIndex(0) --- ->>>var c = (function () { +>>>var c = /** @class */ (function () { 1 > 2 >^^^^^^^^^^^^^^^^^^^-> 1 > @@ -83,7 +83,7 @@ sources: app2.ts emittedFile:tests/cases/compiler/testfiles/app2.js sourceFile:app2.ts ------------------------------------------------------------------- ->>>var d = (function () { +>>>var d = /** @class */ (function () { 1 > 2 >^^^^^^^^^^^^^^^^^^^-> 1 > diff --git a/tests/baselines/reference/sourcemapValidationDuplicateNames.js b/tests/baselines/reference/sourcemapValidationDuplicateNames.js index 34804cc822756..bfe520d2b91d1 100644 --- a/tests/baselines/reference/sourcemapValidationDuplicateNames.js +++ b/tests/baselines/reference/sourcemapValidationDuplicateNames.js @@ -12,7 +12,7 @@ module m1 { var m1; (function (m1) { var x = 10; - var c = (function () { + var c = /** @class */ (function () { function c() { } return c; diff --git a/tests/baselines/reference/sourcemapValidationDuplicateNames.sourcemap.txt b/tests/baselines/reference/sourcemapValidationDuplicateNames.sourcemap.txt index d4b98001a57a1..2cab7b3c4aaa8 100644 --- a/tests/baselines/reference/sourcemapValidationDuplicateNames.sourcemap.txt +++ b/tests/baselines/reference/sourcemapValidationDuplicateNames.sourcemap.txt @@ -46,7 +46,7 @@ sourceFile:sourcemapValidationDuplicateNames.ts 4 > ^^^ 5 > ^^ 6 > ^ -7 > ^^^^^^^^^^^^-> +7 > ^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1-> { > 2 > var @@ -61,7 +61,7 @@ sourceFile:sourcemapValidationDuplicateNames.ts 5 >Emitted(3, 15) Source(2, 15) + SourceIndex(0) 6 >Emitted(3, 16) Source(2, 16) + SourceIndex(0) --- ->>> var c = (function () { +>>> var c = /** @class */ (function () { 1->^^^^ 2 > ^^^^^^^^^^^^^^^^^^^-> 1-> diff --git a/tests/baselines/reference/specializationOfExportedClass.js b/tests/baselines/reference/specializationOfExportedClass.js index da39b6eca19bd..7f066d1ce02fd 100644 --- a/tests/baselines/reference/specializationOfExportedClass.js +++ b/tests/baselines/reference/specializationOfExportedClass.js @@ -11,7 +11,7 @@ var x = new M.C(); //// [specializationOfExportedClass.js] var M; (function (M) { - var C = (function () { + var C = /** @class */ (function () { function C() { } return C; diff --git a/tests/baselines/reference/specializedInheritedConstructors1.js b/tests/baselines/reference/specializedInheritedConstructors1.js index cd137e6dcaea4..70c4f666d2f96 100644 --- a/tests/baselines/reference/specializedInheritedConstructors1.js +++ b/tests/baselines/reference/specializedInheritedConstructors1.js @@ -28,17 +28,17 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var View = (function () { +var View = /** @class */ (function () { function View(options) { } return View; }()); -var Model = (function () { +var Model = /** @class */ (function () { function Model() { } return Model; }()); -var MyView = (function (_super) { +var MyView = /** @class */ (function (_super) { __extends(MyView, _super); function MyView() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/specializedLambdaTypeArguments.js b/tests/baselines/reference/specializedLambdaTypeArguments.js index 9e5e6778659d3..7b7949bbef8f8 100644 --- a/tests/baselines/reference/specializedLambdaTypeArguments.js +++ b/tests/baselines/reference/specializedLambdaTypeArguments.js @@ -7,7 +7,7 @@ var a: X; //// [specializedLambdaTypeArguments.js] -var X = (function () { +var X = /** @class */ (function () { function X() { } return X; diff --git a/tests/baselines/reference/specializedOverloadWithRestParameters.js b/tests/baselines/reference/specializedOverloadWithRestParameters.js index 892f30441f8a6..26972cab1c593 100644 --- a/tests/baselines/reference/specializedOverloadWithRestParameters.js +++ b/tests/baselines/reference/specializedOverloadWithRestParameters.js @@ -23,13 +23,13 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var Base = (function () { +var Base = /** @class */ (function () { function Base() { } Base.prototype.foo = function () { }; return Base; }()); -var Derived1 = (function (_super) { +var Derived1 = /** @class */ (function (_super) { __extends(Derived1, _super); function Derived1() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/specializedSignatureIsNotSubtypeOfNonSpecializedSignature.js b/tests/baselines/reference/specializedSignatureIsNotSubtypeOfNonSpecializedSignature.js index 2654049a323e2..8de323b866751 100644 --- a/tests/baselines/reference/specializedSignatureIsNotSubtypeOfNonSpecializedSignature.js +++ b/tests/baselines/reference/specializedSignatureIsNotSubtypeOfNonSpecializedSignature.js @@ -65,19 +65,19 @@ var a3: { //// [specializedSignatureIsNotSubtypeOfNonSpecializedSignature.js] function foo(x) { } -var C = (function () { +var C = /** @class */ (function () { function C() { } C.prototype.foo = function (x) { }; return C; }()); -var C2 = (function () { +var C2 = /** @class */ (function () { function C2() { } C2.prototype.foo = function (x) { }; return C2; }()); -var C3 = (function () { +var C3 = /** @class */ (function () { function C3() { } C3.prototype.foo = function (x) { }; diff --git a/tests/baselines/reference/specializedSignatureIsSubtypeOfNonSpecializedSignature.js b/tests/baselines/reference/specializedSignatureIsSubtypeOfNonSpecializedSignature.js index f4e7961226a2b..e054c40804ef2 100644 --- a/tests/baselines/reference/specializedSignatureIsSubtypeOfNonSpecializedSignature.js +++ b/tests/baselines/reference/specializedSignatureIsSubtypeOfNonSpecializedSignature.js @@ -85,19 +85,19 @@ var a3: { // Specialized signatures must be a subtype of a non-specialized signature // All the below should not be errors function foo(x) { } -var C = (function () { +var C = /** @class */ (function () { function C() { } C.prototype.foo = function (x) { }; return C; }()); -var C2 = (function () { +var C2 = /** @class */ (function () { function C2() { } C2.prototype.foo = function (x) { }; return C2; }()); -var C3 = (function () { +var C3 = /** @class */ (function () { function C3() { } C3.prototype.foo = function (x) { }; diff --git a/tests/baselines/reference/spreadIntersectionJsx.js b/tests/baselines/reference/spreadIntersectionJsx.js index 9ba086dd765c2..14407a6eee2f7 100644 --- a/tests/baselines/reference/spreadIntersectionJsx.js +++ b/tests/baselines/reference/spreadIntersectionJsx.js @@ -16,12 +16,12 @@ var __assign = (this && this.__assign) || Object.assign || function(t) { return t; }; var React = null; -var A = (function () { +var A = /** @class */ (function () { function A() { } return A; }()); -var C = (function () { +var C = /** @class */ (function () { function C() { } return C; diff --git a/tests/baselines/reference/spreadMethods.js b/tests/baselines/reference/spreadMethods.js index 691d6fa282944..d91455e4e2ed1 100644 --- a/tests/baselines/reference/spreadMethods.js +++ b/tests/baselines/reference/spreadMethods.js @@ -33,7 +33,7 @@ var __assign = (this && this.__assign) || Object.assign || function(t) { } return t; }; -var K = (function () { +var K = /** @class */ (function () { function K() { this.p = 12; } diff --git a/tests/baselines/reference/staticAndMemberFunctions.js b/tests/baselines/reference/staticAndMemberFunctions.js index ddf47b941d46e..c7db76a0362cf 100644 --- a/tests/baselines/reference/staticAndMemberFunctions.js +++ b/tests/baselines/reference/staticAndMemberFunctions.js @@ -5,7 +5,7 @@ class T { } //// [staticAndMemberFunctions.js] -var T = (function () { +var T = /** @class */ (function () { function T() { } T.x = function () { }; diff --git a/tests/baselines/reference/staticAndNonStaticPropertiesSameName.js b/tests/baselines/reference/staticAndNonStaticPropertiesSameName.js index a5c7c5245e927..d35c0e0220d49 100644 --- a/tests/baselines/reference/staticAndNonStaticPropertiesSameName.js +++ b/tests/baselines/reference/staticAndNonStaticPropertiesSameName.js @@ -8,7 +8,7 @@ class C { } //// [staticAndNonStaticPropertiesSameName.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } C.prototype.f = function () { }; diff --git a/tests/baselines/reference/staticAnonymousTypeNotReferencingTypeParameter.js b/tests/baselines/reference/staticAnonymousTypeNotReferencingTypeParameter.js index 62a23d538c43b..83d72128212c3 100644 --- a/tests/baselines/reference/staticAnonymousTypeNotReferencingTypeParameter.js +++ b/tests/baselines/reference/staticAnonymousTypeNotReferencingTypeParameter.js @@ -145,7 +145,7 @@ interface Array { // This test case is a condensed version of Angular 2's ListWrapper. Prior to #7448 // this would cause the compiler to run out of memory. function outer(x) { - var Inner = (function () { + var Inner = /** @class */ (function () { function Inner() { } Inner.y = x; @@ -154,7 +154,7 @@ function outer(x) { return Inner; } var y = outer(5).y; -var ListWrapper2 = (function () { +var ListWrapper2 = /** @class */ (function () { function ListWrapper2() { } ListWrapper2.clone = function (dit, array) { return array.slice(0); }; @@ -184,7 +184,7 @@ var tessst; } tessst.funkyFor = funkyFor; })(tessst || (tessst = {})); -var ListWrapper = (function () { +var ListWrapper = /** @class */ (function () { function ListWrapper() { } // JS has no way to express a statically fixed size list, but dart does so we diff --git a/tests/baselines/reference/staticAsIdentifier.js b/tests/baselines/reference/staticAsIdentifier.js index e7751dfca96fe..d04fd375be5d0 100644 --- a/tests/baselines/reference/staticAsIdentifier.js +++ b/tests/baselines/reference/staticAsIdentifier.js @@ -5,7 +5,7 @@ class C { } //// [staticAsIdentifier.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } return C; diff --git a/tests/baselines/reference/staticClassMemberError.js b/tests/baselines/reference/staticClassMemberError.js index 62166aef8337e..17f1ad8188239 100644 --- a/tests/baselines/reference/staticClassMemberError.js +++ b/tests/baselines/reference/staticClassMemberError.js @@ -13,7 +13,7 @@ class Foo { } //// [staticClassMemberError.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } C.prototype.a = function () { @@ -21,7 +21,7 @@ var C = (function () { }; return C; }()); -var Foo = (function () { +var Foo = /** @class */ (function () { function Foo() { } return Foo; diff --git a/tests/baselines/reference/staticClassProps.js b/tests/baselines/reference/staticClassProps.js index 31aa67c56df4c..112c3525693e2 100644 --- a/tests/baselines/reference/staticClassProps.js +++ b/tests/baselines/reference/staticClassProps.js @@ -9,7 +9,7 @@ class C //// [staticClassProps.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } C.prototype.foo = function () { diff --git a/tests/baselines/reference/staticFactory1.js b/tests/baselines/reference/staticFactory1.js index b73dce8a0cf3b..d49987a120fd0 100644 --- a/tests/baselines/reference/staticFactory1.js +++ b/tests/baselines/reference/staticFactory1.js @@ -24,7 +24,7 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var Base = (function () { +var Base = /** @class */ (function () { function Base() { } Base.prototype.foo = function () { return 1; }; @@ -33,7 +33,7 @@ var Base = (function () { }; return Base; }()); -var Derived = (function (_super) { +var Derived = /** @class */ (function (_super) { __extends(Derived, _super); function Derived() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/staticGetter1.js b/tests/baselines/reference/staticGetter1.js index bffc1e03da048..f3911c1ab332d 100644 --- a/tests/baselines/reference/staticGetter1.js +++ b/tests/baselines/reference/staticGetter1.js @@ -9,7 +9,7 @@ class C { //// [staticGetter1.js] // once caused stack overflow -var C = (function () { +var C = /** @class */ (function () { function C() { } Object.defineProperty(C, "x", { diff --git a/tests/baselines/reference/staticGetter2.js b/tests/baselines/reference/staticGetter2.js index 0f59f434be6ce..b35f9ea9392c3 100644 --- a/tests/baselines/reference/staticGetter2.js +++ b/tests/baselines/reference/staticGetter2.js @@ -9,7 +9,7 @@ class C { //// [staticGetter2.js] // once caused stack overflow -var C = (function () { +var C = /** @class */ (function () { function C() { } C.x = function () { diff --git a/tests/baselines/reference/staticGetterAndSetter.js b/tests/baselines/reference/staticGetterAndSetter.js index 3ae3dfc7d1e87..5019b52856a3a 100644 --- a/tests/baselines/reference/staticGetterAndSetter.js +++ b/tests/baselines/reference/staticGetterAndSetter.js @@ -6,7 +6,7 @@ class Foo { //// [staticGetterAndSetter.js] -var Foo = (function () { +var Foo = /** @class */ (function () { function Foo() { } Object.defineProperty(Foo, "Foo", { diff --git a/tests/baselines/reference/staticIndexer.js b/tests/baselines/reference/staticIndexer.js index 1be0be2c8da14..26a0511c543ec 100644 --- a/tests/baselines/reference/staticIndexer.js +++ b/tests/baselines/reference/staticIndexer.js @@ -4,7 +4,7 @@ class C { } //// [staticIndexer.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } return C; diff --git a/tests/baselines/reference/staticIndexers.js b/tests/baselines/reference/staticIndexers.js index 610e805a3c11b..19badd7069b26 100644 --- a/tests/baselines/reference/staticIndexers.js +++ b/tests/baselines/reference/staticIndexers.js @@ -15,17 +15,17 @@ class E { //// [staticIndexers.js] // static indexers not allowed -var C = (function () { +var C = /** @class */ (function () { function C() { } return C; }()); -var D = (function () { +var D = /** @class */ (function () { function D() { } return D; }()); -var E = (function () { +var E = /** @class */ (function () { function E() { } return E; diff --git a/tests/baselines/reference/staticInheritance.js b/tests/baselines/reference/staticInheritance.js index 780e5e98782ac..a3ed7ddb7bc25 100644 --- a/tests/baselines/reference/staticInheritance.js +++ b/tests/baselines/reference/staticInheritance.js @@ -23,13 +23,13 @@ var __extends = (this && this.__extends) || (function () { }; })(); function doThing(x) { } -var A = (function () { +var A = /** @class */ (function () { function A() { this.p = doThing(A); // OK } return A; }()); -var B = (function (_super) { +var B = /** @class */ (function (_super) { __extends(B, _super); function B() { var _this = _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/staticInstanceResolution.js b/tests/baselines/reference/staticInstanceResolution.js index 788a8634c2eb4..af4ec7ab45d2e 100644 --- a/tests/baselines/reference/staticInstanceResolution.js +++ b/tests/baselines/reference/staticInstanceResolution.js @@ -15,7 +15,7 @@ class Comment { } //// [staticInstanceResolution.js] -var Comment = (function () { +var Comment = /** @class */ (function () { function Comment() { } Comment.prototype.getDocCommentText = function () { diff --git a/tests/baselines/reference/staticInstanceResolution2.js b/tests/baselines/reference/staticInstanceResolution2.js index 3bfb52c6b65f3..b7d93bff280e9 100644 --- a/tests/baselines/reference/staticInstanceResolution2.js +++ b/tests/baselines/reference/staticInstanceResolution2.js @@ -12,13 +12,13 @@ B.hasOwnProperty('foo'); //// [staticInstanceResolution2.js] -var A = (function () { +var A = /** @class */ (function () { function A() { } return A; }()); A.hasOwnProperty('foo'); -var B = (function () { +var B = /** @class */ (function () { function B() { } return B; diff --git a/tests/baselines/reference/staticInstanceResolution3.js b/tests/baselines/reference/staticInstanceResolution3.js index 747aa93e63183..7a72ae8532362 100644 --- a/tests/baselines/reference/staticInstanceResolution3.js +++ b/tests/baselines/reference/staticInstanceResolution3.js @@ -15,7 +15,7 @@ WinJS.Promise.timeout(10); //// [staticInstanceResolution3_0.js] "use strict"; exports.__esModule = true; -var Promise = (function () { +var Promise = /** @class */ (function () { function Promise() { } Promise.timeout = function (delay) { diff --git a/tests/baselines/reference/staticInstanceResolution4.js b/tests/baselines/reference/staticInstanceResolution4.js index ab98d9deb8e08..12d89b963f361 100644 --- a/tests/baselines/reference/staticInstanceResolution4.js +++ b/tests/baselines/reference/staticInstanceResolution4.js @@ -6,7 +6,7 @@ class A { A.foo(); //// [staticInstanceResolution4.js] -var A = (function () { +var A = /** @class */ (function () { function A() { } A.prototype.foo = function () { }; diff --git a/tests/baselines/reference/staticInstanceResolution5.js b/tests/baselines/reference/staticInstanceResolution5.js index 0bbd1cf412f07..d66531ff7b676 100644 --- a/tests/baselines/reference/staticInstanceResolution5.js +++ b/tests/baselines/reference/staticInstanceResolution5.js @@ -20,7 +20,7 @@ function z(w3: WinJS) { } define(["require", "exports"], function (require, exports) { "use strict"; exports.__esModule = true; - var Promise = (function () { + var Promise = /** @class */ (function () { function Promise() { } Promise.timeout = function (delay) { diff --git a/tests/baselines/reference/staticInterfaceAssignmentCompat.js b/tests/baselines/reference/staticInterfaceAssignmentCompat.js index 1368ffc2f73c6..89f3e5b2a6ef8 100644 --- a/tests/baselines/reference/staticInterfaceAssignmentCompat.js +++ b/tests/baselines/reference/staticInterfaceAssignmentCompat.js @@ -13,7 +13,7 @@ var x: ShapeFactory = Shape; //// [staticInterfaceAssignmentCompat.js] -var Shape = (function () { +var Shape = /** @class */ (function () { function Shape() { } Shape.create = function () { diff --git a/tests/baselines/reference/staticMemberAccessOffDerivedType1.js b/tests/baselines/reference/staticMemberAccessOffDerivedType1.js index 684594ffd5c55..162e10770d808 100644 --- a/tests/baselines/reference/staticMemberAccessOffDerivedType1.js +++ b/tests/baselines/reference/staticMemberAccessOffDerivedType1.js @@ -20,7 +20,7 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var SomeBase = (function () { +var SomeBase = /** @class */ (function () { function SomeBase() { } SomeBase.GetNumber = function () { @@ -28,7 +28,7 @@ var SomeBase = (function () { }; return SomeBase; }()); -var P = (function (_super) { +var P = /** @class */ (function (_super) { __extends(P, _super); function P() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/staticMemberAssignsToConstructorFunctionMembers.js b/tests/baselines/reference/staticMemberAssignsToConstructorFunctionMembers.js index 9f34914460c44..22dec085b1016 100644 --- a/tests/baselines/reference/staticMemberAssignsToConstructorFunctionMembers.js +++ b/tests/baselines/reference/staticMemberAssignsToConstructorFunctionMembers.js @@ -13,7 +13,7 @@ class C { } //// [staticMemberAssignsToConstructorFunctionMembers.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } C.foo = function () { diff --git a/tests/baselines/reference/staticMemberExportAccess.js b/tests/baselines/reference/staticMemberExportAccess.js index b0261e79c8ebb..6935283d4e3c2 100644 --- a/tests/baselines/reference/staticMemberExportAccess.js +++ b/tests/baselines/reference/staticMemberExportAccess.js @@ -21,7 +21,7 @@ var r4 = $.sammy.x; // error Sammy.bar(); //// [staticMemberExportAccess.js] -var Sammy = (function () { +var Sammy = /** @class */ (function () { function Sammy() { } Sammy.prototype.foo = function () { return "hi"; }; diff --git a/tests/baselines/reference/staticMemberInitialization.js b/tests/baselines/reference/staticMemberInitialization.js index c21c29ed4f815..adde0b4137758 100644 --- a/tests/baselines/reference/staticMemberInitialization.js +++ b/tests/baselines/reference/staticMemberInitialization.js @@ -7,7 +7,7 @@ var c = new C(); var r = C.x; //// [staticMemberInitialization.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } C.x = 1; diff --git a/tests/baselines/reference/staticMemberOfClassAndPublicMemberOfAnotherClassAssignment.js b/tests/baselines/reference/staticMemberOfClassAndPublicMemberOfAnotherClassAssignment.js index 00de82a4f6de7..8ce443fbeaed2 100644 --- a/tests/baselines/reference/staticMemberOfClassAndPublicMemberOfAnotherClassAssignment.js +++ b/tests/baselines/reference/staticMemberOfClassAndPublicMemberOfAnotherClassAssignment.js @@ -26,13 +26,13 @@ c = a; //// [staticMemberOfClassAndPublicMemberOfAnotherClassAssignment.js] -var B = (function () { +var B = /** @class */ (function () { function B() { } B.prototype.prop = function () { }; return B; }()); -var C = (function () { +var C = /** @class */ (function () { function C() { } C.prop = function () { }; diff --git a/tests/baselines/reference/staticMemberWithStringAndNumberNames.js b/tests/baselines/reference/staticMemberWithStringAndNumberNames.js index 2fdd64ea04b76..21be5b9817abd 100644 --- a/tests/baselines/reference/staticMemberWithStringAndNumberNames.js +++ b/tests/baselines/reference/staticMemberWithStringAndNumberNames.js @@ -13,7 +13,7 @@ class C { } //// [staticMemberWithStringAndNumberNames.js] -var C = (function () { +var C = /** @class */ (function () { function C() { this.x = C['foo']; this.x2 = C['0']; diff --git a/tests/baselines/reference/staticMembersUsingClassTypeParameter.js b/tests/baselines/reference/staticMembersUsingClassTypeParameter.js index c7355c01270f0..0389463a0d21b 100644 --- a/tests/baselines/reference/staticMembersUsingClassTypeParameter.js +++ b/tests/baselines/reference/staticMembersUsingClassTypeParameter.js @@ -17,19 +17,19 @@ class C3 { //// [staticMembersUsingClassTypeParameter.js] // BUG 745747 -var C = (function () { +var C = /** @class */ (function () { function C() { } C.f = function (x) { }; return C; }()); -var C2 = (function () { +var C2 = /** @class */ (function () { function C2() { } C2.f = function (x) { }; return C2; }()); -var C3 = (function () { +var C3 = /** @class */ (function () { function C3() { } C3.f = function (x) { }; diff --git a/tests/baselines/reference/staticMethodReferencingTypeArgument1.js b/tests/baselines/reference/staticMethodReferencingTypeArgument1.js index d4815aee2b651..83854f29145b3 100644 --- a/tests/baselines/reference/staticMethodReferencingTypeArgument1.js +++ b/tests/baselines/reference/staticMethodReferencingTypeArgument1.js @@ -19,7 +19,7 @@ module Editor { //// [staticMethodReferencingTypeArgument1.js] var Editor; (function (Editor) { - var List = (function () { + var List = /** @class */ (function () { function List(isHead, data) { this.isHead = isHead; this.data = data; diff --git a/tests/baselines/reference/staticMethodWithTypeParameterExtendsClauseDeclFile.js b/tests/baselines/reference/staticMethodWithTypeParameterExtendsClauseDeclFile.js index b8b5b030bcd87..4881d3a5814c4 100644 --- a/tests/baselines/reference/staticMethodWithTypeParameterExtendsClauseDeclFile.js +++ b/tests/baselines/reference/staticMethodWithTypeParameterExtendsClauseDeclFile.js @@ -24,18 +24,18 @@ export class publicClassWithWithPrivateTypeParameters { //// [staticMethodWithTypeParameterExtendsClauseDeclFile.js] "use strict"; exports.__esModule = true; -var privateClass = (function () { +var privateClass = /** @class */ (function () { function privateClass() { } return privateClass; }()); -var publicClass = (function () { +var publicClass = /** @class */ (function () { function publicClass() { } return publicClass; }()); exports.publicClass = publicClass; -var publicClassWithWithPrivateTypeParameters = (function () { +var publicClassWithWithPrivateTypeParameters = /** @class */ (function () { function publicClassWithWithPrivateTypeParameters() { } publicClassWithWithPrivateTypeParameters.myPrivateStaticMethod1 = function () { diff --git a/tests/baselines/reference/staticMethodsReferencingClassTypeParameters.js b/tests/baselines/reference/staticMethodsReferencingClassTypeParameters.js index 43c9ac9da0371..85b29fb9ec9e9 100644 --- a/tests/baselines/reference/staticMethodsReferencingClassTypeParameters.js +++ b/tests/baselines/reference/staticMethodsReferencingClassTypeParameters.js @@ -4,7 +4,7 @@ class C { } //// [staticMethodsReferencingClassTypeParameters.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } C.s = function (p) { return p; }; diff --git a/tests/baselines/reference/staticModifierAlreadySeen.js b/tests/baselines/reference/staticModifierAlreadySeen.js index 76f8b050d6f39..0a0aeb189f2f1 100644 --- a/tests/baselines/reference/staticModifierAlreadySeen.js +++ b/tests/baselines/reference/staticModifierAlreadySeen.js @@ -5,7 +5,7 @@ class C { } //// [staticModifierAlreadySeen.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } C.bar = function () { }; diff --git a/tests/baselines/reference/staticMustPrecedePublic.js b/tests/baselines/reference/staticMustPrecedePublic.js index c01a06ff27c82..0931871bd8c22 100644 --- a/tests/baselines/reference/staticMustPrecedePublic.js +++ b/tests/baselines/reference/staticMustPrecedePublic.js @@ -6,7 +6,7 @@ class Outer { //// [staticMustPrecedePublic.js] -var Outer = (function () { +var Outer = /** @class */ (function () { function Outer() { } return Outer; diff --git a/tests/baselines/reference/staticOffOfInstance1.js b/tests/baselines/reference/staticOffOfInstance1.js index fa9f99f71fb2f..3de501d0c0fc3 100644 --- a/tests/baselines/reference/staticOffOfInstance1.js +++ b/tests/baselines/reference/staticOffOfInstance1.js @@ -7,7 +7,7 @@ class List { } //// [staticOffOfInstance1.js] -var List = (function () { +var List = /** @class */ (function () { function List() { } List.prototype.Blah = function () { diff --git a/tests/baselines/reference/staticOffOfInstance2.js b/tests/baselines/reference/staticOffOfInstance2.js index e23416e29ddcc..af3ea7f882f26 100644 --- a/tests/baselines/reference/staticOffOfInstance2.js +++ b/tests/baselines/reference/staticOffOfInstance2.js @@ -9,7 +9,7 @@ class List { //// [staticOffOfInstance2.js] -var List = (function () { +var List = /** @class */ (function () { function List() { } List.prototype.Blah = function () { diff --git a/tests/baselines/reference/staticPropSuper.js b/tests/baselines/reference/staticPropSuper.js index dc308a4769e53..b8ee30af11e6b 100644 --- a/tests/baselines/reference/staticPropSuper.js +++ b/tests/baselines/reference/staticPropSuper.js @@ -46,12 +46,12 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var A = (function () { +var A = /** @class */ (function () { function A() { } return A; }()); -var B = (function (_super) { +var B = /** @class */ (function (_super) { __extends(B, _super); function B() { var _this = this; @@ -62,7 +62,7 @@ var B = (function (_super) { B.s = 9; return B; }(A)); -var C = (function (_super) { +var C = /** @class */ (function (_super) { __extends(C, _super); function C() { var _this = this; @@ -72,7 +72,7 @@ var C = (function (_super) { } return C; }(A)); -var D = (function (_super) { +var D = /** @class */ (function (_super) { __extends(D, _super); function D() { var _this = this; @@ -82,7 +82,7 @@ var D = (function (_super) { } return D; }(A)); -var E = (function (_super) { +var E = /** @class */ (function (_super) { __extends(E, _super); function E() { var _this = this; diff --git a/tests/baselines/reference/staticPropertyAndFunctionWithSameName.js b/tests/baselines/reference/staticPropertyAndFunctionWithSameName.js index 71db1ca8ef198..af13c9422aa22 100644 --- a/tests/baselines/reference/staticPropertyAndFunctionWithSameName.js +++ b/tests/baselines/reference/staticPropertyAndFunctionWithSameName.js @@ -10,12 +10,12 @@ class D { } //// [staticPropertyAndFunctionWithSameName.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } return C; }()); -var D = (function () { +var D = /** @class */ (function () { function D() { } D.prototype.f = function () { }; diff --git a/tests/baselines/reference/staticPropertyNameConflicts.js b/tests/baselines/reference/staticPropertyNameConflicts.js index b93b16550f0ca..6167d06dd8492 100644 --- a/tests/baselines/reference/staticPropertyNameConflicts.js +++ b/tests/baselines/reference/staticPropertyNameConflicts.js @@ -193,12 +193,12 @@ module TestOnDefaultExportedClass_10 { //// [staticPropertyNameConflicts.js] // name -var StaticName = (function () { +var StaticName = /** @class */ (function () { function StaticName() { } return StaticName; }()); -var StaticNameFn = (function () { +var StaticNameFn = /** @class */ (function () { function StaticNameFn() { } StaticNameFn.name = function () { }; // error @@ -206,12 +206,12 @@ var StaticNameFn = (function () { return StaticNameFn; }()); // length -var StaticLength = (function () { +var StaticLength = /** @class */ (function () { function StaticLength() { } return StaticLength; }()); -var StaticLengthFn = (function () { +var StaticLengthFn = /** @class */ (function () { function StaticLengthFn() { } StaticLengthFn.length = function () { }; // error @@ -219,12 +219,12 @@ var StaticLengthFn = (function () { return StaticLengthFn; }()); // prototype -var StaticPrototype = (function () { +var StaticPrototype = /** @class */ (function () { function StaticPrototype() { } return StaticPrototype; }()); -var StaticPrototypeFn = (function () { +var StaticPrototypeFn = /** @class */ (function () { function StaticPrototypeFn() { } StaticPrototypeFn.prototype = function () { }; // error @@ -232,12 +232,12 @@ var StaticPrototypeFn = (function () { return StaticPrototypeFn; }()); // caller -var StaticCaller = (function () { +var StaticCaller = /** @class */ (function () { function StaticCaller() { } return StaticCaller; }()); -var StaticCallerFn = (function () { +var StaticCallerFn = /** @class */ (function () { function StaticCallerFn() { } StaticCallerFn.caller = function () { }; // error @@ -245,12 +245,12 @@ var StaticCallerFn = (function () { return StaticCallerFn; }()); // arguments -var StaticArguments = (function () { +var StaticArguments = /** @class */ (function () { function StaticArguments() { } return StaticArguments; }()); -var StaticArgumentsFn = (function () { +var StaticArgumentsFn = /** @class */ (function () { function StaticArgumentsFn() { } StaticArgumentsFn.arguments = function () { }; // error @@ -259,12 +259,12 @@ var StaticArgumentsFn = (function () { }()); // === Static properties on anonymous classes === // name -var StaticName_Anonymous = (function () { +var StaticName_Anonymous = /** @class */ (function () { function class_1() { } return class_1; }()); -var StaticNameFn_Anonymous = (function () { +var StaticNameFn_Anonymous = /** @class */ (function () { function class_2() { } class_2.name = function () { }; // error @@ -272,12 +272,12 @@ var StaticNameFn_Anonymous = (function () { return class_2; }()); // length -var StaticLength_Anonymous = (function () { +var StaticLength_Anonymous = /** @class */ (function () { function class_3() { } return class_3; }()); -var StaticLengthFn_Anonymous = (function () { +var StaticLengthFn_Anonymous = /** @class */ (function () { function class_4() { } class_4.length = function () { }; // error @@ -285,12 +285,12 @@ var StaticLengthFn_Anonymous = (function () { return class_4; }()); // prototype -var StaticPrototype_Anonymous = (function () { +var StaticPrototype_Anonymous = /** @class */ (function () { function class_5() { } return class_5; }()); -var StaticPrototypeFn_Anonymous = (function () { +var StaticPrototypeFn_Anonymous = /** @class */ (function () { function class_6() { } class_6.prototype = function () { }; // error @@ -298,12 +298,12 @@ var StaticPrototypeFn_Anonymous = (function () { return class_6; }()); // caller -var StaticCaller_Anonymous = (function () { +var StaticCaller_Anonymous = /** @class */ (function () { function class_7() { } return class_7; }()); -var StaticCallerFn_Anonymous = (function () { +var StaticCallerFn_Anonymous = /** @class */ (function () { function class_8() { } class_8.caller = function () { }; // error @@ -311,12 +311,12 @@ var StaticCallerFn_Anonymous = (function () { return class_8; }()); // arguments -var StaticArguments_Anonymous = (function () { +var StaticArguments_Anonymous = /** @class */ (function () { function class_9() { } return class_9; }()); -var StaticArgumentsFn_Anonymous = (function () { +var StaticArgumentsFn_Anonymous = /** @class */ (function () { function class_10() { } class_10.arguments = function () { }; // error @@ -327,7 +327,7 @@ var StaticArgumentsFn_Anonymous = (function () { // name var TestOnDefaultExportedClass_1; (function (TestOnDefaultExportedClass_1) { - var StaticName = (function () { + var StaticName = /** @class */ (function () { function StaticName() { } return StaticName; @@ -335,7 +335,7 @@ var TestOnDefaultExportedClass_1; })(TestOnDefaultExportedClass_1 || (TestOnDefaultExportedClass_1 = {})); var TestOnDefaultExportedClass_2; (function (TestOnDefaultExportedClass_2) { - var StaticNameFn = (function () { + var StaticNameFn = /** @class */ (function () { function StaticNameFn() { } StaticNameFn.name = function () { }; // error @@ -346,7 +346,7 @@ var TestOnDefaultExportedClass_2; // length var TestOnDefaultExportedClass_3; (function (TestOnDefaultExportedClass_3) { - var StaticLength = (function () { + var StaticLength = /** @class */ (function () { function StaticLength() { } return StaticLength; @@ -355,7 +355,7 @@ var TestOnDefaultExportedClass_3; })(TestOnDefaultExportedClass_3 || (TestOnDefaultExportedClass_3 = {})); var TestOnDefaultExportedClass_4; (function (TestOnDefaultExportedClass_4) { - var StaticLengthFn = (function () { + var StaticLengthFn = /** @class */ (function () { function StaticLengthFn() { } StaticLengthFn.length = function () { }; // error @@ -367,7 +367,7 @@ var TestOnDefaultExportedClass_4; // prototype var TestOnDefaultExportedClass_5; (function (TestOnDefaultExportedClass_5) { - var StaticPrototype = (function () { + var StaticPrototype = /** @class */ (function () { function StaticPrototype() { } return StaticPrototype; @@ -376,7 +376,7 @@ var TestOnDefaultExportedClass_5; })(TestOnDefaultExportedClass_5 || (TestOnDefaultExportedClass_5 = {})); var TestOnDefaultExportedClass_6; (function (TestOnDefaultExportedClass_6) { - var StaticPrototypeFn = (function () { + var StaticPrototypeFn = /** @class */ (function () { function StaticPrototypeFn() { } StaticPrototypeFn.prototype = function () { }; // error @@ -388,7 +388,7 @@ var TestOnDefaultExportedClass_6; // caller var TestOnDefaultExportedClass_7; (function (TestOnDefaultExportedClass_7) { - var StaticCaller = (function () { + var StaticCaller = /** @class */ (function () { function StaticCaller() { } return StaticCaller; @@ -397,7 +397,7 @@ var TestOnDefaultExportedClass_7; })(TestOnDefaultExportedClass_7 || (TestOnDefaultExportedClass_7 = {})); var TestOnDefaultExportedClass_8; (function (TestOnDefaultExportedClass_8) { - var StaticCallerFn = (function () { + var StaticCallerFn = /** @class */ (function () { function StaticCallerFn() { } StaticCallerFn.caller = function () { }; // error @@ -409,7 +409,7 @@ var TestOnDefaultExportedClass_8; // arguments var TestOnDefaultExportedClass_9; (function (TestOnDefaultExportedClass_9) { - var StaticArguments = (function () { + var StaticArguments = /** @class */ (function () { function StaticArguments() { } return StaticArguments; @@ -418,7 +418,7 @@ var TestOnDefaultExportedClass_9; })(TestOnDefaultExportedClass_9 || (TestOnDefaultExportedClass_9 = {})); var TestOnDefaultExportedClass_10; (function (TestOnDefaultExportedClass_10) { - var StaticArgumentsFn = (function () { + var StaticArgumentsFn = /** @class */ (function () { function StaticArgumentsFn() { } StaticArgumentsFn.arguments = function () { }; // error diff --git a/tests/baselines/reference/staticPropertyNotInClassType.js b/tests/baselines/reference/staticPropertyNotInClassType.js index 6caa108a7106e..d6bbdc75accbc 100644 --- a/tests/baselines/reference/staticPropertyNotInClassType.js +++ b/tests/baselines/reference/staticPropertyNotInClassType.js @@ -42,7 +42,7 @@ module Generic { //// [staticPropertyNotInClassType.js] var NonGeneric; (function (NonGeneric) { - var C = (function () { + var C = /** @class */ (function () { function C(a, b) { this.a = a; this.b = b; @@ -67,7 +67,7 @@ var NonGeneric; })(NonGeneric || (NonGeneric = {})); var Generic; (function (Generic) { - var C = (function () { + var C = /** @class */ (function () { function C(a, b) { this.a = a; this.b = b; diff --git a/tests/baselines/reference/staticPrototypeProperty.js b/tests/baselines/reference/staticPrototypeProperty.js index 65e53b5522baa..190cb858e97b6 100644 --- a/tests/baselines/reference/staticPrototypeProperty.js +++ b/tests/baselines/reference/staticPrototypeProperty.js @@ -8,13 +8,13 @@ class C2 { } //// [staticPrototypeProperty.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } C.prototype = function () { }; return C; }()); -var C2 = (function () { +var C2 = /** @class */ (function () { function C2() { } return C2; diff --git a/tests/baselines/reference/staticPrototypePropertyOnClass.js b/tests/baselines/reference/staticPrototypePropertyOnClass.js index dff9a58073e88..6315b0039b22e 100644 --- a/tests/baselines/reference/staticPrototypePropertyOnClass.js +++ b/tests/baselines/reference/staticPrototypePropertyOnClass.js @@ -19,22 +19,22 @@ var c = c3; var d = c4; //// [staticPrototypePropertyOnClass.js] -var c1 = (function () { +var c1 = /** @class */ (function () { function c1() { } return c1; }()); -var c2 = (function () { +var c2 = /** @class */ (function () { function c2() { } return c2; }()); -var c3 = (function () { +var c3 = /** @class */ (function () { function c3() { } return c3; }()); -var c4 = (function () { +var c4 = /** @class */ (function () { function c4(param) { } return c4; diff --git a/tests/baselines/reference/staticVisibility.js b/tests/baselines/reference/staticVisibility.js index 60047c9c050e4..78f1dd1902453 100644 --- a/tests/baselines/reference/staticVisibility.js +++ b/tests/baselines/reference/staticVisibility.js @@ -37,7 +37,7 @@ static set Bar(bar:string) {barback = bar;} // not ok //// [staticVisibility.js] -var C1 = (function () { +var C1 = /** @class */ (function () { function C1() { var v = 0; s = 1; // should be error @@ -52,7 +52,7 @@ var C1 = (function () { }; return C1; }()); -var C2 = (function () { +var C2 = /** @class */ (function () { function C2() { this.barback = ""; } diff --git a/tests/baselines/reference/statics.js b/tests/baselines/reference/statics.js index 3776c09c8ceae..7f98cfe18f1eb 100644 --- a/tests/baselines/reference/statics.js +++ b/tests/baselines/reference/statics.js @@ -34,7 +34,7 @@ M.f(); //// [statics.js] var M; (function (M) { - var C = (function () { + var C = /** @class */ (function () { function C(c1, c2, c3) { var _this = this; this.c1 = c1; diff --git a/tests/baselines/reference/staticsInConstructorBodies.js b/tests/baselines/reference/staticsInConstructorBodies.js index 9bc3ed293251c..34ac94238e1ea 100644 --- a/tests/baselines/reference/staticsInConstructorBodies.js +++ b/tests/baselines/reference/staticsInConstructorBodies.js @@ -7,7 +7,7 @@ class C { } //// [staticsInConstructorBodies.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } C.m1 = function () { }; // ERROR diff --git a/tests/baselines/reference/staticsNotInScopeInClodule.js b/tests/baselines/reference/staticsNotInScopeInClodule.js index c43e22fce4ceb..29b9df475dd4f 100644 --- a/tests/baselines/reference/staticsNotInScopeInClodule.js +++ b/tests/baselines/reference/staticsNotInScopeInClodule.js @@ -8,7 +8,7 @@ module Clod { } //// [staticsNotInScopeInClodule.js] -var Clod = (function () { +var Clod = /** @class */ (function () { function Clod() { } Clod.x = 10; diff --git a/tests/baselines/reference/strictModeInConstructor.js b/tests/baselines/reference/strictModeInConstructor.js index eb2286556ac03..e151f257989a7 100644 --- a/tests/baselines/reference/strictModeInConstructor.js +++ b/tests/baselines/reference/strictModeInConstructor.js @@ -71,12 +71,12 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var A = (function () { +var A = /** @class */ (function () { function A() { } return A; }()); -var B = (function (_super) { +var B = /** @class */ (function (_super) { __extends(B, _super); function B() { "use strict"; // No error @@ -86,7 +86,7 @@ var B = (function (_super) { } return B; }(A)); -var C = (function (_super) { +var C = /** @class */ (function (_super) { __extends(C, _super); function C() { var _this = _super.call(this) || this; @@ -96,7 +96,7 @@ var C = (function (_super) { } return C; }(A)); -var D = (function (_super) { +var D = /** @class */ (function (_super) { __extends(D, _super); function D() { var _this = this; @@ -108,7 +108,7 @@ var D = (function (_super) { } return D; }(A)); -var Bs = (function (_super) { +var Bs = /** @class */ (function (_super) { __extends(Bs, _super); function Bs() { "use strict"; // No error @@ -117,7 +117,7 @@ var Bs = (function (_super) { Bs.s = 9; return Bs; }(A)); -var Cs = (function (_super) { +var Cs = /** @class */ (function (_super) { __extends(Cs, _super); function Cs() { var _this = _super.call(this) || this; @@ -127,7 +127,7 @@ var Cs = (function (_super) { Cs.s = 9; return Cs; }(A)); -var Ds = (function (_super) { +var Ds = /** @class */ (function (_super) { __extends(Ds, _super); function Ds() { var _this = this; diff --git a/tests/baselines/reference/strictModeReservedWord.js b/tests/baselines/reference/strictModeReservedWord.js index 07b514da9b74e..bd426c83a0c06 100644 --- a/tests/baselines/reference/strictModeReservedWord.js +++ b/tests/baselines/reference/strictModeReservedWord.js @@ -50,7 +50,7 @@ function foo() { function baz() { } function barn(cb) { } barn(function (private, public, package) { }); - var myClass = (function (_super) { + var myClass = /** @class */ (function (_super) { __extends(package, _super); function package() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/strictModeReservedWordInClassDeclaration.js b/tests/baselines/reference/strictModeReservedWordInClassDeclaration.js index 2539ce5dbbb46..6600e899f1824 100644 --- a/tests/baselines/reference/strictModeReservedWordInClassDeclaration.js +++ b/tests/baselines/reference/strictModeReservedWordInClassDeclaration.js @@ -39,14 +39,14 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var Foo = (function () { +var Foo = /** @class */ (function () { function Foo(private, public, static) { private = public = static; } Foo.prototype.banana = function (x) { }; return Foo; }()); -var C = (function () { +var C = /** @class */ (function () { function C(public, let) { this.public = public; } @@ -57,34 +57,34 @@ var C = (function () { C.prototype.pulbic = function () { }; // No Error; return C; }()); -var D = (function () { +var D = /** @class */ (function () { function D() { } return D; }()); -var E = (function () { +var E = /** @class */ (function () { function E() { } return E; }()); -var F = (function () { +var F = /** @class */ (function () { function F() { } return F; }()); -var F1 = (function () { +var F1 = /** @class */ (function () { function F1() { } return F1; }()); -var G = (function (_super) { +var G = /** @class */ (function (_super) { __extends(G, _super); function G() { return _super !== null && _super.apply(this, arguments) || this; } return G; }(package)); -var H = (function (_super) { +var H = /** @class */ (function (_super) { __extends(H, _super); function H() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/strictModeUseContextualKeyword.js b/tests/baselines/reference/strictModeUseContextualKeyword.js index d21463f3b398f..6d5d3dfd5e06b 100644 --- a/tests/baselines/reference/strictModeUseContextualKeyword.js +++ b/tests/baselines/reference/strictModeUseContextualKeyword.js @@ -17,7 +17,7 @@ function H() { "use strict"; var as = 0; function foo(as) { } -var C = (function () { +var C = /** @class */ (function () { function C() { } C.prototype.as = function () { }; diff --git a/tests/baselines/reference/stringIndexerAndConstructor.js b/tests/baselines/reference/stringIndexerAndConstructor.js index 7e38cff755552..63742f5de4c0d 100644 --- a/tests/baselines/reference/stringIndexerAndConstructor.js +++ b/tests/baselines/reference/stringIndexerAndConstructor.js @@ -14,7 +14,7 @@ interface I { } //// [stringIndexerAndConstructor.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } C.v = function () { }; diff --git a/tests/baselines/reference/stringIndexerAssignments2.js b/tests/baselines/reference/stringIndexerAssignments2.js index 94ce262aadca0..547211c3a19aa 100644 --- a/tests/baselines/reference/stringIndexerAssignments2.js +++ b/tests/baselines/reference/stringIndexerAssignments2.js @@ -21,17 +21,17 @@ x = a; x = b; //// [stringIndexerAssignments2.js] -var C1 = (function () { +var C1 = /** @class */ (function () { function C1() { } return C1; }()); -var C2 = (function () { +var C2 = /** @class */ (function () { function C2() { } return C2; }()); -var C3 = (function () { +var C3 = /** @class */ (function () { function C3() { } return C3; diff --git a/tests/baselines/reference/stringIndexerConstrainsPropertyDeclarations.js b/tests/baselines/reference/stringIndexerConstrainsPropertyDeclarations.js index 57df8ce288351..d405014bc6804 100644 --- a/tests/baselines/reference/stringIndexerConstrainsPropertyDeclarations.js +++ b/tests/baselines/reference/stringIndexerConstrainsPropertyDeclarations.js @@ -99,7 +99,7 @@ var b: { [x: string]: string; } = { //// [stringIndexerConstrainsPropertyDeclarations.js] // String indexer types constrain the types of named properties in their containing type -var C = (function () { +var C = /** @class */ (function () { function C() { } // ok Object.defineProperty(C.prototype, "X", { diff --git a/tests/baselines/reference/stringIndexerConstrainsPropertyDeclarations2.js b/tests/baselines/reference/stringIndexerConstrainsPropertyDeclarations2.js index f9942aff04232..01e9b00ec3a36 100644 --- a/tests/baselines/reference/stringIndexerConstrainsPropertyDeclarations2.js +++ b/tests/baselines/reference/stringIndexerConstrainsPropertyDeclarations2.js @@ -51,13 +51,13 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var A = (function () { +var A = /** @class */ (function () { function A() { } A.prototype.foo = function () { return ''; }; return A; }()); -var B = (function (_super) { +var B = /** @class */ (function (_super) { __extends(B, _super); function B() { return _super !== null && _super.apply(this, arguments) || this; @@ -65,7 +65,7 @@ var B = (function (_super) { B.prototype.bar = function () { return ''; }; return B; }(A)); -var Foo = (function () { +var Foo = /** @class */ (function () { function Foo() { } return Foo; diff --git a/tests/baselines/reference/stringIndexingResults.js b/tests/baselines/reference/stringIndexingResults.js index 53f82340353db..7bbe1400b9a5e 100644 --- a/tests/baselines/reference/stringIndexingResults.js +++ b/tests/baselines/reference/stringIndexingResults.js @@ -36,7 +36,7 @@ var r12 = b[1]; //// [stringIndexingResults.js] -var C = (function () { +var C = /** @class */ (function () { function C() { this.y = ''; } diff --git a/tests/baselines/reference/stringLiteralTypeIsSubtypeOfString.js b/tests/baselines/reference/stringLiteralTypeIsSubtypeOfString.js index 55ea133577104..83e659775604a 100644 --- a/tests/baselines/reference/stringLiteralTypeIsSubtypeOfString.js +++ b/tests/baselines/reference/stringLiteralTypeIsSubtypeOfString.js @@ -111,7 +111,7 @@ function f6(x) { } function f7(x) { } function f8(x) { } function f9(x) { } -var C = (function () { +var C = /** @class */ (function () { function C() { } C.prototype.toString = function () { return null; }; diff --git a/tests/baselines/reference/stringLiteralTypesInImplementationSignatures.js b/tests/baselines/reference/stringLiteralTypesInImplementationSignatures.js index e9bdc90ecf33b..5c0e9565fd028 100644 --- a/tests/baselines/reference/stringLiteralTypesInImplementationSignatures.js +++ b/tests/baselines/reference/stringLiteralTypesInImplementationSignatures.js @@ -31,7 +31,7 @@ var b = { function foo(x) { } var f = function foo(x) { }; var f2 = function (x, y) { }; -var C = (function () { +var C = /** @class */ (function () { function C() { } C.prototype.foo = function (x) { }; diff --git a/tests/baselines/reference/stringLiteralTypesInImplementationSignatures2.js b/tests/baselines/reference/stringLiteralTypesInImplementationSignatures2.js index a33c6424eda6c..3fcff8bc77b20 100644 --- a/tests/baselines/reference/stringLiteralTypesInImplementationSignatures2.js +++ b/tests/baselines/reference/stringLiteralTypesInImplementationSignatures2.js @@ -32,7 +32,7 @@ var b = { //// [stringLiteralTypesInImplementationSignatures2.js] // String literal types are only valid in overload signatures function foo(x) { } -var C = (function () { +var C = /** @class */ (function () { function C() { } C.prototype.foo = function (x) { }; diff --git a/tests/baselines/reference/stringNamedPropertyAccess.js b/tests/baselines/reference/stringNamedPropertyAccess.js index 01b634faf5ff7..2f46a893cbf1b 100644 --- a/tests/baselines/reference/stringNamedPropertyAccess.js +++ b/tests/baselines/reference/stringNamedPropertyAccess.js @@ -24,7 +24,7 @@ var b = { var r4 = b["a b"]; //// [stringNamedPropertyAccess.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } return C; diff --git a/tests/baselines/reference/stringNamedPropertyDuplicates.js b/tests/baselines/reference/stringNamedPropertyDuplicates.js index a1b4822b5da89..fd1305a2e57e7 100644 --- a/tests/baselines/reference/stringNamedPropertyDuplicates.js +++ b/tests/baselines/reference/stringNamedPropertyDuplicates.js @@ -22,7 +22,7 @@ var b = { } //// [stringNamedPropertyDuplicates.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } return C; diff --git a/tests/baselines/reference/stripInternal1.js b/tests/baselines/reference/stripInternal1.js index 475904906f01e..9df483631f725 100644 --- a/tests/baselines/reference/stripInternal1.js +++ b/tests/baselines/reference/stripInternal1.js @@ -6,7 +6,7 @@ class C { } //// [stripInternal1.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } C.prototype.foo = function () { }; diff --git a/tests/baselines/reference/subSubClassCanAccessProtectedConstructor.js b/tests/baselines/reference/subSubClassCanAccessProtectedConstructor.js index 5036df4a33003..bc74f76b30c04 100644 --- a/tests/baselines/reference/subSubClassCanAccessProtectedConstructor.js +++ b/tests/baselines/reference/subSubClassCanAccessProtectedConstructor.js @@ -27,13 +27,13 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var Base = (function () { +var Base = /** @class */ (function () { function Base() { this.instance1 = new Base(); // allowed } return Base; }()); -var Subclass = (function (_super) { +var Subclass = /** @class */ (function (_super) { __extends(Subclass, _super); function Subclass() { var _this = _super !== null && _super.apply(this, arguments) || this; @@ -43,7 +43,7 @@ var Subclass = (function (_super) { } return Subclass; }(Base)); -var SubclassOfSubclass = (function (_super) { +var SubclassOfSubclass = /** @class */ (function (_super) { __extends(SubclassOfSubclass, _super); function SubclassOfSubclass() { var _this = _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/subtypesOfAny.js b/tests/baselines/reference/subtypesOfAny.js index c07da732c1eef..3b575f84711b3 100644 --- a/tests/baselines/reference/subtypesOfAny.js +++ b/tests/baselines/reference/subtypesOfAny.js @@ -135,12 +135,12 @@ interface I20 { //// [subtypesOfAny.js] // every type is a subtype of any, no errors expected -var A = (function () { +var A = /** @class */ (function () { function A() { } return A; }()); -var A2 = (function () { +var A2 = /** @class */ (function () { function A2() { } return A2; @@ -153,7 +153,7 @@ function f() { } (function (f) { f.bar = 1; })(f || (f = {})); -var c = (function () { +var c = /** @class */ (function () { function c() { } return c; diff --git a/tests/baselines/reference/subtypesOfTypeParameter.js b/tests/baselines/reference/subtypesOfTypeParameter.js index 3c3a17d8f8471..8c68b46944bd0 100644 --- a/tests/baselines/reference/subtypesOfTypeParameter.js +++ b/tests/baselines/reference/subtypesOfTypeParameter.js @@ -117,12 +117,12 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var C3 = (function () { +var C3 = /** @class */ (function () { function C3() { } return C3; }()); -var D1 = (function (_super) { +var D1 = /** @class */ (function (_super) { __extends(D1, _super); function D1() { return _super !== null && _super.apply(this, arguments) || this; @@ -133,12 +133,12 @@ function f1(x, y) { var r = true ? x : y; // error var r = true ? y : x; // error } -var C1 = (function () { +var C1 = /** @class */ (function () { function C1() { } return C1; }()); -var C2 = (function () { +var C2 = /** @class */ (function () { function C2() { } return C2; @@ -151,7 +151,7 @@ function f() { } (function (f) { f.bar = 1; })(f || (f = {})); -var c = (function () { +var c = /** @class */ (function () { function c() { } return c; diff --git a/tests/baselines/reference/subtypesOfTypeParameterWithConstraints.js b/tests/baselines/reference/subtypesOfTypeParameterWithConstraints.js index b594eea6e4d8c..523503321e3c2 100644 --- a/tests/baselines/reference/subtypesOfTypeParameterWithConstraints.js +++ b/tests/baselines/reference/subtypesOfTypeParameterWithConstraints.js @@ -179,33 +179,33 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var C3 = (function () { +var C3 = /** @class */ (function () { function C3() { } return C3; }()); -var D1 = (function (_super) { +var D1 = /** @class */ (function (_super) { __extends(D1, _super); function D1() { return _super !== null && _super.apply(this, arguments) || this; } return D1; }(C3)); -var D2 = (function (_super) { +var D2 = /** @class */ (function (_super) { __extends(D2, _super); function D2() { return _super !== null && _super.apply(this, arguments) || this; } return D2; }(C3)); -var D3 = (function (_super) { +var D3 = /** @class */ (function (_super) { __extends(D3, _super); function D3() { return _super !== null && _super.apply(this, arguments) || this; } return D3; }(C3)); -var D4 = (function (_super) { +var D4 = /** @class */ (function (_super) { __extends(D4, _super); function D4() { return _super !== null && _super.apply(this, arguments) || this; @@ -215,21 +215,21 @@ var D4 = (function (_super) { // V > U > T // test if T is subtype of T, U, V // should all work -var D5 = (function (_super) { +var D5 = /** @class */ (function (_super) { __extends(D5, _super); function D5() { return _super !== null && _super.apply(this, arguments) || this; } return D5; }(C3)); -var D6 = (function (_super) { +var D6 = /** @class */ (function (_super) { __extends(D6, _super); function D6() { return _super !== null && _super.apply(this, arguments) || this; } return D6; }(C3)); -var D7 = (function (_super) { +var D7 = /** @class */ (function (_super) { __extends(D7, _super); function D7() { return _super !== null && _super.apply(this, arguments) || this; @@ -238,21 +238,21 @@ var D7 = (function (_super) { }(C3)); // test if U is a subtype of T, U, V // only a subtype of V and itself -var D8 = (function (_super) { +var D8 = /** @class */ (function (_super) { __extends(D8, _super); function D8() { return _super !== null && _super.apply(this, arguments) || this; } return D8; }(C3)); -var D9 = (function (_super) { +var D9 = /** @class */ (function (_super) { __extends(D9, _super); function D9() { return _super !== null && _super.apply(this, arguments) || this; } return D9; }(C3)); -var D10 = (function (_super) { +var D10 = /** @class */ (function (_super) { __extends(D10, _super); function D10() { return _super !== null && _super.apply(this, arguments) || this; @@ -261,21 +261,21 @@ var D10 = (function (_super) { }(C3)); // test if V is a subtype of T, U, V // only a subtype of itself -var D11 = (function (_super) { +var D11 = /** @class */ (function (_super) { __extends(D11, _super); function D11() { return _super !== null && _super.apply(this, arguments) || this; } return D11; }(C3)); -var D12 = (function (_super) { +var D12 = /** @class */ (function (_super) { __extends(D12, _super); function D12() { return _super !== null && _super.apply(this, arguments) || this; } return D12; }(C3)); -var D13 = (function (_super) { +var D13 = /** @class */ (function (_super) { __extends(D13, _super); function D13() { return _super !== null && _super.apply(this, arguments) || this; @@ -285,28 +285,28 @@ var D13 = (function (_super) { // Date > V > U > T // test if T is subtype of T, U, V, Date // should all work -var D14 = (function (_super) { +var D14 = /** @class */ (function (_super) { __extends(D14, _super); function D14() { return _super !== null && _super.apply(this, arguments) || this; } return D14; }(C3)); -var D15 = (function (_super) { +var D15 = /** @class */ (function (_super) { __extends(D15, _super); function D15() { return _super !== null && _super.apply(this, arguments) || this; } return D15; }(C3)); -var D16 = (function (_super) { +var D16 = /** @class */ (function (_super) { __extends(D16, _super); function D16() { return _super !== null && _super.apply(this, arguments) || this; } return D16; }(C3)); -var D17 = (function (_super) { +var D17 = /** @class */ (function (_super) { __extends(D17, _super); function D17() { return _super !== null && _super.apply(this, arguments) || this; @@ -315,28 +315,28 @@ var D17 = (function (_super) { }(C3)); // test if U is a subtype of T, U, V, Date // only a subtype of V, Date and itself -var D18 = (function (_super) { +var D18 = /** @class */ (function (_super) { __extends(D18, _super); function D18() { return _super !== null && _super.apply(this, arguments) || this; } return D18; }(C3)); -var D19 = (function (_super) { +var D19 = /** @class */ (function (_super) { __extends(D19, _super); function D19() { return _super !== null && _super.apply(this, arguments) || this; } return D19; }(C3)); -var D20 = (function (_super) { +var D20 = /** @class */ (function (_super) { __extends(D20, _super); function D20() { return _super !== null && _super.apply(this, arguments) || this; } return D20; }(C3)); -var D21 = (function (_super) { +var D21 = /** @class */ (function (_super) { __extends(D21, _super); function D21() { return _super !== null && _super.apply(this, arguments) || this; @@ -345,28 +345,28 @@ var D21 = (function (_super) { }(C3)); // test if V is a subtype of T, U, V, Date // only a subtype of itself and Date -var D22 = (function (_super) { +var D22 = /** @class */ (function (_super) { __extends(D22, _super); function D22() { return _super !== null && _super.apply(this, arguments) || this; } return D22; }(C3)); -var D23 = (function (_super) { +var D23 = /** @class */ (function (_super) { __extends(D23, _super); function D23() { return _super !== null && _super.apply(this, arguments) || this; } return D23; }(C3)); -var D24 = (function (_super) { +var D24 = /** @class */ (function (_super) { __extends(D24, _super); function D24() { return _super !== null && _super.apply(this, arguments) || this; } return D24; }(C3)); -var D25 = (function (_super) { +var D25 = /** @class */ (function (_super) { __extends(D25, _super); function D25() { return _super !== null && _super.apply(this, arguments) || this; @@ -375,28 +375,28 @@ var D25 = (function (_super) { }(C3)); // test if Date is a subtype of T, U, V, Date // only a subtype of itself -var D26 = (function (_super) { +var D26 = /** @class */ (function (_super) { __extends(D26, _super); function D26() { return _super !== null && _super.apply(this, arguments) || this; } return D26; }(C3)); -var D27 = (function (_super) { +var D27 = /** @class */ (function (_super) { __extends(D27, _super); function D27() { return _super !== null && _super.apply(this, arguments) || this; } return D27; }(C3)); -var D28 = (function (_super) { +var D28 = /** @class */ (function (_super) { __extends(D28, _super); function D28() { return _super !== null && _super.apply(this, arguments) || this; } return D28; }(C3)); -var D29 = (function (_super) { +var D29 = /** @class */ (function (_super) { __extends(D29, _super); function D29() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/subtypesOfTypeParameterWithConstraints2.js b/tests/baselines/reference/subtypesOfTypeParameterWithConstraints2.js index a41ab1d4e2eaf..c9b97d8c8c119 100644 --- a/tests/baselines/reference/subtypesOfTypeParameterWithConstraints2.js +++ b/tests/baselines/reference/subtypesOfTypeParameterWithConstraints2.js @@ -185,12 +185,12 @@ function f3(x, y) { var r3 = true ? y : new Date(); var r3 = true ? new Date() : y; } -var C1 = (function () { +var C1 = /** @class */ (function () { function C1() { } return C1; }()); -var C2 = (function () { +var C2 = /** @class */ (function () { function C2() { } return C2; @@ -203,7 +203,7 @@ function f() { } (function (f) { f.bar = 1; })(f || (f = {})); -var c = (function () { +var c = /** @class */ (function () { function c() { } return c; diff --git a/tests/baselines/reference/subtypesOfTypeParameterWithConstraints4.js b/tests/baselines/reference/subtypesOfTypeParameterWithConstraints4.js index b3fa597189883..310bbf39e56bd 100644 --- a/tests/baselines/reference/subtypesOfTypeParameterWithConstraints4.js +++ b/tests/baselines/reference/subtypesOfTypeParameterWithConstraints4.js @@ -90,7 +90,7 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var Foo = (function () { +var Foo = /** @class */ (function () { function Foo() { } return Foo; @@ -115,68 +115,68 @@ function f(t, u, v) { var r6 = true ? v : new Foo(); var r6 = true ? new Foo() : v; } -var B1 = (function () { +var B1 = /** @class */ (function () { function B1() { } return B1; }()); -var D1 = (function (_super) { +var D1 = /** @class */ (function (_super) { __extends(D1, _super); function D1() { return _super !== null && _super.apply(this, arguments) || this; } return D1; }(B1)); -var D2 = (function (_super) { +var D2 = /** @class */ (function (_super) { __extends(D2, _super); function D2() { return _super !== null && _super.apply(this, arguments) || this; } return D2; }(B1)); -var D3 = (function (_super) { +var D3 = /** @class */ (function (_super) { __extends(D3, _super); function D3() { return _super !== null && _super.apply(this, arguments) || this; } return D3; }(B1)); -var D4 = (function (_super) { +var D4 = /** @class */ (function (_super) { __extends(D4, _super); function D4() { return _super !== null && _super.apply(this, arguments) || this; } return D4; }(B1)); -var D5 = (function (_super) { +var D5 = /** @class */ (function (_super) { __extends(D5, _super); function D5() { return _super !== null && _super.apply(this, arguments) || this; } return D5; }(B1)); -var D6 = (function (_super) { +var D6 = /** @class */ (function (_super) { __extends(D6, _super); function D6() { return _super !== null && _super.apply(this, arguments) || this; } return D6; }(B1)); -var D7 = (function (_super) { +var D7 = /** @class */ (function (_super) { __extends(D7, _super); function D7() { return _super !== null && _super.apply(this, arguments) || this; } return D7; }(B1)); -var D8 = (function (_super) { +var D8 = /** @class */ (function (_super) { __extends(D8, _super); function D8() { return _super !== null && _super.apply(this, arguments) || this; } return D8; }(B1)); -var D9 = (function (_super) { +var D9 = /** @class */ (function (_super) { __extends(D9, _super); function D9() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/subtypesOfTypeParameterWithRecursiveConstraints.js b/tests/baselines/reference/subtypesOfTypeParameterWithRecursiveConstraints.js index 3d2fb052b41d5..bb66be0b57ebc 100644 --- a/tests/baselines/reference/subtypesOfTypeParameterWithRecursiveConstraints.js +++ b/tests/baselines/reference/subtypesOfTypeParameterWithRecursiveConstraints.js @@ -169,7 +169,7 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var Foo = (function () { +var Foo = /** @class */ (function () { function Foo() { } return Foo; @@ -214,68 +214,68 @@ function f(t, u, v) { } var M1; (function (M1) { - var Base = (function () { + var Base = /** @class */ (function () { function Base() { } return Base; }()); - var D1 = (function (_super) { + var D1 = /** @class */ (function (_super) { __extends(D1, _super); function D1() { return _super !== null && _super.apply(this, arguments) || this; } return D1; }(Base)); - var D2 = (function (_super) { + var D2 = /** @class */ (function (_super) { __extends(D2, _super); function D2() { return _super !== null && _super.apply(this, arguments) || this; } return D2; }(Base)); - var D3 = (function (_super) { + var D3 = /** @class */ (function (_super) { __extends(D3, _super); function D3() { return _super !== null && _super.apply(this, arguments) || this; } return D3; }(Base)); - var D4 = (function (_super) { + var D4 = /** @class */ (function (_super) { __extends(D4, _super); function D4() { return _super !== null && _super.apply(this, arguments) || this; } return D4; }(Base)); - var D5 = (function (_super) { + var D5 = /** @class */ (function (_super) { __extends(D5, _super); function D5() { return _super !== null && _super.apply(this, arguments) || this; } return D5; }(Base)); - var D6 = (function (_super) { + var D6 = /** @class */ (function (_super) { __extends(D6, _super); function D6() { return _super !== null && _super.apply(this, arguments) || this; } return D6; }(Base)); - var D7 = (function (_super) { + var D7 = /** @class */ (function (_super) { __extends(D7, _super); function D7() { return _super !== null && _super.apply(this, arguments) || this; } return D7; }(Base)); - var D8 = (function (_super) { + var D8 = /** @class */ (function (_super) { __extends(D8, _super); function D8() { return _super !== null && _super.apply(this, arguments) || this; } return D8; }(Base)); - var D9 = (function (_super) { + var D9 = /** @class */ (function (_super) { __extends(D9, _super); function D9() { return _super !== null && _super.apply(this, arguments) || this; @@ -285,68 +285,68 @@ var M1; })(M1 || (M1 = {})); var M2; (function (M2) { - var Base2 = (function () { + var Base2 = /** @class */ (function () { function Base2() { } return Base2; }()); - var D1 = (function (_super) { + var D1 = /** @class */ (function (_super) { __extends(D1, _super); function D1() { return _super !== null && _super.apply(this, arguments) || this; } return D1; }(Base2)); - var D2 = (function (_super) { + var D2 = /** @class */ (function (_super) { __extends(D2, _super); function D2() { return _super !== null && _super.apply(this, arguments) || this; } return D2; }(Base2)); - var D3 = (function (_super) { + var D3 = /** @class */ (function (_super) { __extends(D3, _super); function D3() { return _super !== null && _super.apply(this, arguments) || this; } return D3; }(Base2)); - var D4 = (function (_super) { + var D4 = /** @class */ (function (_super) { __extends(D4, _super); function D4() { return _super !== null && _super.apply(this, arguments) || this; } return D4; }(Base2)); - var D5 = (function (_super) { + var D5 = /** @class */ (function (_super) { __extends(D5, _super); function D5() { return _super !== null && _super.apply(this, arguments) || this; } return D5; }(Base2)); - var D6 = (function (_super) { + var D6 = /** @class */ (function (_super) { __extends(D6, _super); function D6() { return _super !== null && _super.apply(this, arguments) || this; } return D6; }(Base2)); - var D7 = (function (_super) { + var D7 = /** @class */ (function (_super) { __extends(D7, _super); function D7() { return _super !== null && _super.apply(this, arguments) || this; } return D7; }(Base2)); - var D8 = (function (_super) { + var D8 = /** @class */ (function (_super) { __extends(D8, _super); function D8() { return _super !== null && _super.apply(this, arguments) || this; } return D8; }(Base2)); - var D9 = (function (_super) { + var D9 = /** @class */ (function (_super) { __extends(D9, _super); function D9() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/subtypesOfUnion.js b/tests/baselines/reference/subtypesOfUnion.js index 8168798bce2bc..bf7b060367084 100644 --- a/tests/baselines/reference/subtypesOfUnion.js +++ b/tests/baselines/reference/subtypesOfUnion.js @@ -58,12 +58,12 @@ var E; E[E["e1"] = 0] = "e1"; E[E["e2"] = 1] = "e2"; })(E || (E = {})); -var A = (function () { +var A = /** @class */ (function () { function A() { } return A; }()); -var A2 = (function () { +var A2 = /** @class */ (function () { function A2() { } return A2; @@ -72,7 +72,7 @@ function f() { } (function (f) { f.bar = 1; })(f || (f = {})); -var c = (function () { +var c = /** @class */ (function () { function c() { } return c; diff --git a/tests/baselines/reference/subtypingTransitivity.js b/tests/baselines/reference/subtypingTransitivity.js index cbacd85a779ca..d87e56de18b52 100644 --- a/tests/baselines/reference/subtypingTransitivity.js +++ b/tests/baselines/reference/subtypingTransitivity.js @@ -30,19 +30,19 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var B = (function () { +var B = /** @class */ (function () { function B() { } return B; }()); -var D = (function (_super) { +var D = /** @class */ (function (_super) { __extends(D, _super); function D() { return _super !== null && _super.apply(this, arguments) || this; } return D; }(B)); -var D2 = (function (_super) { +var D2 = /** @class */ (function (_super) { __extends(D2, _super); function D2() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/subtypingWithCallSignatures2.js b/tests/baselines/reference/subtypingWithCallSignatures2.js index dfe34ca35f08f..fa89f645329c0 100644 --- a/tests/baselines/reference/subtypingWithCallSignatures2.js +++ b/tests/baselines/reference/subtypingWithCallSignatures2.js @@ -184,26 +184,26 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var Base = (function () { +var Base = /** @class */ (function () { function Base() { } return Base; }()); -var Derived = (function (_super) { +var Derived = /** @class */ (function (_super) { __extends(Derived, _super); function Derived() { return _super !== null && _super.apply(this, arguments) || this; } return Derived; }(Base)); -var Derived2 = (function (_super) { +var Derived2 = /** @class */ (function (_super) { __extends(Derived2, _super); function Derived2() { return _super !== null && _super.apply(this, arguments) || this; } return Derived2; }(Derived)); -var OtherDerived = (function (_super) { +var OtherDerived = /** @class */ (function (_super) { __extends(OtherDerived, _super); function OtherDerived() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/subtypingWithCallSignatures3.js b/tests/baselines/reference/subtypingWithCallSignatures3.js index d479bdbe618e8..c941a58544e44 100644 --- a/tests/baselines/reference/subtypingWithCallSignatures3.js +++ b/tests/baselines/reference/subtypingWithCallSignatures3.js @@ -133,26 +133,26 @@ var __extends = (this && this.__extends) || (function () { })(); var Errors; (function (Errors) { - var Base = (function () { + var Base = /** @class */ (function () { function Base() { } return Base; }()); - var Derived = (function (_super) { + var Derived = /** @class */ (function (_super) { __extends(Derived, _super); function Derived() { return _super !== null && _super.apply(this, arguments) || this; } return Derived; }(Base)); - var Derived2 = (function (_super) { + var Derived2 = /** @class */ (function (_super) { __extends(Derived2, _super); function Derived2() { return _super !== null && _super.apply(this, arguments) || this; } return Derived2; }(Derived)); - var OtherDerived = (function (_super) { + var OtherDerived = /** @class */ (function (_super) { __extends(OtherDerived, _super); function OtherDerived() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/subtypingWithCallSignatures4.js b/tests/baselines/reference/subtypingWithCallSignatures4.js index 09c5e8056ba0a..cdb6ccb12b0a6 100644 --- a/tests/baselines/reference/subtypingWithCallSignatures4.js +++ b/tests/baselines/reference/subtypingWithCallSignatures4.js @@ -123,26 +123,26 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var Base = (function () { +var Base = /** @class */ (function () { function Base() { } return Base; }()); -var Derived = (function (_super) { +var Derived = /** @class */ (function (_super) { __extends(Derived, _super); function Derived() { return _super !== null && _super.apply(this, arguments) || this; } return Derived; }(Base)); -var Derived2 = (function (_super) { +var Derived2 = /** @class */ (function (_super) { __extends(Derived2, _super); function Derived2() { return _super !== null && _super.apply(this, arguments) || this; } return Derived2; }(Derived)); -var OtherDerived = (function (_super) { +var OtherDerived = /** @class */ (function (_super) { __extends(OtherDerived, _super); function OtherDerived() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/subtypingWithConstructSignatures2.js b/tests/baselines/reference/subtypingWithConstructSignatures2.js index 55624b63f42f4..cc278b0be82ee 100644 --- a/tests/baselines/reference/subtypingWithConstructSignatures2.js +++ b/tests/baselines/reference/subtypingWithConstructSignatures2.js @@ -184,26 +184,26 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var Base = (function () { +var Base = /** @class */ (function () { function Base() { } return Base; }()); -var Derived = (function (_super) { +var Derived = /** @class */ (function (_super) { __extends(Derived, _super); function Derived() { return _super !== null && _super.apply(this, arguments) || this; } return Derived; }(Base)); -var Derived2 = (function (_super) { +var Derived2 = /** @class */ (function (_super) { __extends(Derived2, _super); function Derived2() { return _super !== null && _super.apply(this, arguments) || this; } return Derived2; }(Derived)); -var OtherDerived = (function (_super) { +var OtherDerived = /** @class */ (function (_super) { __extends(OtherDerived, _super); function OtherDerived() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/subtypingWithConstructSignatures3.js b/tests/baselines/reference/subtypingWithConstructSignatures3.js index a7a7f6203899c..8181d6711b681 100644 --- a/tests/baselines/reference/subtypingWithConstructSignatures3.js +++ b/tests/baselines/reference/subtypingWithConstructSignatures3.js @@ -135,26 +135,26 @@ var __extends = (this && this.__extends) || (function () { })(); var Errors; (function (Errors) { - var Base = (function () { + var Base = /** @class */ (function () { function Base() { } return Base; }()); - var Derived = (function (_super) { + var Derived = /** @class */ (function (_super) { __extends(Derived, _super); function Derived() { return _super !== null && _super.apply(this, arguments) || this; } return Derived; }(Base)); - var Derived2 = (function (_super) { + var Derived2 = /** @class */ (function (_super) { __extends(Derived2, _super); function Derived2() { return _super !== null && _super.apply(this, arguments) || this; } return Derived2; }(Derived)); - var OtherDerived = (function (_super) { + var OtherDerived = /** @class */ (function (_super) { __extends(OtherDerived, _super); function OtherDerived() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/subtypingWithConstructSignatures4.js b/tests/baselines/reference/subtypingWithConstructSignatures4.js index e8ca51f317ae0..cc9d12014046b 100644 --- a/tests/baselines/reference/subtypingWithConstructSignatures4.js +++ b/tests/baselines/reference/subtypingWithConstructSignatures4.js @@ -123,26 +123,26 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var Base = (function () { +var Base = /** @class */ (function () { function Base() { } return Base; }()); -var Derived = (function (_super) { +var Derived = /** @class */ (function (_super) { __extends(Derived, _super); function Derived() { return _super !== null && _super.apply(this, arguments) || this; } return Derived; }(Base)); -var Derived2 = (function (_super) { +var Derived2 = /** @class */ (function (_super) { __extends(Derived2, _super); function Derived2() { return _super !== null && _super.apply(this, arguments) || this; } return Derived2; }(Derived)); -var OtherDerived = (function (_super) { +var OtherDerived = /** @class */ (function (_super) { __extends(OtherDerived, _super); function OtherDerived() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/subtypingWithConstructSignatures5.js b/tests/baselines/reference/subtypingWithConstructSignatures5.js index c99e215bc895b..dcc43dfba232d 100644 --- a/tests/baselines/reference/subtypingWithConstructSignatures5.js +++ b/tests/baselines/reference/subtypingWithConstructSignatures5.js @@ -61,26 +61,26 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var Base = (function () { +var Base = /** @class */ (function () { function Base() { } return Base; }()); -var Derived = (function (_super) { +var Derived = /** @class */ (function (_super) { __extends(Derived, _super); function Derived() { return _super !== null && _super.apply(this, arguments) || this; } return Derived; }(Base)); -var Derived2 = (function (_super) { +var Derived2 = /** @class */ (function (_super) { __extends(Derived2, _super); function Derived2() { return _super !== null && _super.apply(this, arguments) || this; } return Derived2; }(Derived)); -var OtherDerived = (function (_super) { +var OtherDerived = /** @class */ (function (_super) { __extends(OtherDerived, _super); function OtherDerived() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/subtypingWithConstructSignatures6.js b/tests/baselines/reference/subtypingWithConstructSignatures6.js index cbd8eebf47c33..44761f9ff4381 100644 --- a/tests/baselines/reference/subtypingWithConstructSignatures6.js +++ b/tests/baselines/reference/subtypingWithConstructSignatures6.js @@ -64,26 +64,26 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var Base = (function () { +var Base = /** @class */ (function () { function Base() { } return Base; }()); -var Derived = (function (_super) { +var Derived = /** @class */ (function (_super) { __extends(Derived, _super); function Derived() { return _super !== null && _super.apply(this, arguments) || this; } return Derived; }(Base)); -var Derived2 = (function (_super) { +var Derived2 = /** @class */ (function (_super) { __extends(Derived2, _super); function Derived2() { return _super !== null && _super.apply(this, arguments) || this; } return Derived2; }(Derived)); -var OtherDerived = (function (_super) { +var OtherDerived = /** @class */ (function (_super) { __extends(OtherDerived, _super); function OtherDerived() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/subtypingWithNumericIndexer.js b/tests/baselines/reference/subtypingWithNumericIndexer.js index 7f1409179359d..05b31838bb68f 100644 --- a/tests/baselines/reference/subtypingWithNumericIndexer.js +++ b/tests/baselines/reference/subtypingWithNumericIndexer.js @@ -51,19 +51,19 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var A = (function () { +var A = /** @class */ (function () { function A() { } return A; }()); -var B = (function (_super) { +var B = /** @class */ (function (_super) { __extends(B, _super); function B() { return _super !== null && _super.apply(this, arguments) || this; } return B; }(A)); -var B2 = (function (_super) { +var B2 = /** @class */ (function (_super) { __extends(B2, _super); function B2() { return _super !== null && _super.apply(this, arguments) || this; @@ -72,33 +72,33 @@ var B2 = (function (_super) { }(A)); var Generics; (function (Generics) { - var A = (function () { + var A = /** @class */ (function () { function A() { } return A; }()); - var B = (function (_super) { + var B = /** @class */ (function (_super) { __extends(B, _super); function B() { return _super !== null && _super.apply(this, arguments) || this; } return B; }(A)); - var B2 = (function (_super) { + var B2 = /** @class */ (function (_super) { __extends(B2, _super); function B2() { return _super !== null && _super.apply(this, arguments) || this; } return B2; }(A)); - var B3 = (function (_super) { + var B3 = /** @class */ (function (_super) { __extends(B3, _super); function B3() { return _super !== null && _super.apply(this, arguments) || this; } return B3; }(A)); - var B4 = (function (_super) { + var B4 = /** @class */ (function (_super) { __extends(B4, _super); function B4() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/subtypingWithNumericIndexer3.js b/tests/baselines/reference/subtypingWithNumericIndexer3.js index e8fbc59bed768..e909c1a2413e9 100644 --- a/tests/baselines/reference/subtypingWithNumericIndexer3.js +++ b/tests/baselines/reference/subtypingWithNumericIndexer3.js @@ -55,19 +55,19 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var A = (function () { +var A = /** @class */ (function () { function A() { } return A; }()); -var B = (function (_super) { +var B = /** @class */ (function (_super) { __extends(B, _super); function B() { return _super !== null && _super.apply(this, arguments) || this; } return B; }(A)); -var B2 = (function (_super) { +var B2 = /** @class */ (function (_super) { __extends(B2, _super); function B2() { return _super !== null && _super.apply(this, arguments) || this; @@ -76,40 +76,40 @@ var B2 = (function (_super) { }(A)); var Generics; (function (Generics) { - var A = (function () { + var A = /** @class */ (function () { function A() { } return A; }()); - var B = (function (_super) { + var B = /** @class */ (function (_super) { __extends(B, _super); function B() { return _super !== null && _super.apply(this, arguments) || this; } return B; }(A)); - var B2 = (function (_super) { + var B2 = /** @class */ (function (_super) { __extends(B2, _super); function B2() { return _super !== null && _super.apply(this, arguments) || this; } return B2; }(A)); - var B3 = (function (_super) { + var B3 = /** @class */ (function (_super) { __extends(B3, _super); function B3() { return _super !== null && _super.apply(this, arguments) || this; } return B3; }(A)); - var B4 = (function (_super) { + var B4 = /** @class */ (function (_super) { __extends(B4, _super); function B4() { return _super !== null && _super.apply(this, arguments) || this; } return B4; }(A)); - var B5 = (function (_super) { + var B5 = /** @class */ (function (_super) { __extends(B5, _super); function B5() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/subtypingWithNumericIndexer4.js b/tests/baselines/reference/subtypingWithNumericIndexer4.js index ce3ed4fb4de73..1007610ec7d0d 100644 --- a/tests/baselines/reference/subtypingWithNumericIndexer4.js +++ b/tests/baselines/reference/subtypingWithNumericIndexer4.js @@ -39,12 +39,12 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var A = (function () { +var A = /** @class */ (function () { function A() { } return A; }()); -var B = (function (_super) { +var B = /** @class */ (function (_super) { __extends(B, _super); function B() { return _super !== null && _super.apply(this, arguments) || this; @@ -53,19 +53,19 @@ var B = (function (_super) { }(A)); var Generics; (function (Generics) { - var A = (function () { + var A = /** @class */ (function () { function A() { } return A; }()); - var B = (function (_super) { + var B = /** @class */ (function (_super) { __extends(B, _super); function B() { return _super !== null && _super.apply(this, arguments) || this; } return B; }(A)); - var B3 = (function (_super) { + var B3 = /** @class */ (function (_super) { __extends(B3, _super); function B3() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/subtypingWithNumericIndexer5.js b/tests/baselines/reference/subtypingWithNumericIndexer5.js index 50e54d888e739..0959d02cad8c7 100644 --- a/tests/baselines/reference/subtypingWithNumericIndexer5.js +++ b/tests/baselines/reference/subtypingWithNumericIndexer5.js @@ -45,39 +45,39 @@ module Generics { //// [subtypingWithNumericIndexer5.js] // Derived type indexer must be subtype of base type indexer -var B = (function () { +var B = /** @class */ (function () { function B() { } return B; }()); -var B2 = (function () { +var B2 = /** @class */ (function () { function B2() { } return B2; }()); var Generics; (function (Generics) { - var B = (function () { + var B = /** @class */ (function () { function B() { } return B; }()); - var B2 = (function () { + var B2 = /** @class */ (function () { function B2() { } return B2; }()); - var B3 = (function () { + var B3 = /** @class */ (function () { function B3() { } return B3; }()); - var B4 = (function () { + var B4 = /** @class */ (function () { function B4() { } return B4; }()); - var B5 = (function () { + var B5 = /** @class */ (function () { function B5() { } return B5; diff --git a/tests/baselines/reference/subtypingWithObjectMembers.js b/tests/baselines/reference/subtypingWithObjectMembers.js index 7f1c9e9e492a8..6eb943738ce92 100644 --- a/tests/baselines/reference/subtypingWithObjectMembers.js +++ b/tests/baselines/reference/subtypingWithObjectMembers.js @@ -78,19 +78,19 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var Base = (function () { +var Base = /** @class */ (function () { function Base() { } return Base; }()); -var Derived = (function (_super) { +var Derived = /** @class */ (function (_super) { __extends(Derived, _super); function Derived() { return _super !== null && _super.apply(this, arguments) || this; } return Derived; }(Base)); -var Derived2 = (function (_super) { +var Derived2 = /** @class */ (function (_super) { __extends(Derived2, _super); function Derived2() { return _super !== null && _super.apply(this, arguments) || this; @@ -99,36 +99,36 @@ var Derived2 = (function (_super) { }(Derived)); // N and M have the same name, same accessibility, same optionality, and N is a subtype of M // foo properties are valid, bar properties cause errors in the derived class declarations -var A = (function () { +var A = /** @class */ (function () { function A() { } return A; }()); -var B = (function (_super) { +var B = /** @class */ (function (_super) { __extends(B, _super); function B() { return _super !== null && _super.apply(this, arguments) || this; } return B; }(A)); -var A2 = (function () { +var A2 = /** @class */ (function () { function A2() { } return A2; }()); -var B2 = (function (_super) { +var B2 = /** @class */ (function (_super) { __extends(B2, _super); function B2() { return _super !== null && _super.apply(this, arguments) || this; } return B2; }(A2)); -var A3 = (function () { +var A3 = /** @class */ (function () { function A3() { } return A3; }()); -var B3 = (function (_super) { +var B3 = /** @class */ (function (_super) { __extends(B3, _super); function B3() { return _super !== null && _super.apply(this, arguments) || this; @@ -137,36 +137,36 @@ var B3 = (function (_super) { }(A3)); var TwoLevels; (function (TwoLevels) { - var A = (function () { + var A = /** @class */ (function () { function A() { } return A; }()); - var B = (function (_super) { + var B = /** @class */ (function (_super) { __extends(B, _super); function B() { return _super !== null && _super.apply(this, arguments) || this; } return B; }(A)); - var A2 = (function () { + var A2 = /** @class */ (function () { function A2() { } return A2; }()); - var B2 = (function (_super) { + var B2 = /** @class */ (function (_super) { __extends(B2, _super); function B2() { return _super !== null && _super.apply(this, arguments) || this; } return B2; }(A2)); - var A3 = (function () { + var A3 = /** @class */ (function () { function A3() { } return A3; }()); - var B3 = (function (_super) { + var B3 = /** @class */ (function (_super) { __extends(B3, _super); function B3() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/subtypingWithObjectMembers4.js b/tests/baselines/reference/subtypingWithObjectMembers4.js index e453b508c34b4..3f684786b001a 100644 --- a/tests/baselines/reference/subtypingWithObjectMembers4.js +++ b/tests/baselines/reference/subtypingWithObjectMembers4.js @@ -45,48 +45,48 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var Base = (function () { +var Base = /** @class */ (function () { function Base() { } return Base; }()); -var Derived = (function (_super) { +var Derived = /** @class */ (function (_super) { __extends(Derived, _super); function Derived() { return _super !== null && _super.apply(this, arguments) || this; } return Derived; }(Base)); -var A = (function () { +var A = /** @class */ (function () { function A() { } return A; }()); -var B = (function (_super) { +var B = /** @class */ (function (_super) { __extends(B, _super); function B() { return _super !== null && _super.apply(this, arguments) || this; } return B; }(A)); -var A2 = (function () { +var A2 = /** @class */ (function () { function A2() { } return A2; }()); -var B2 = (function (_super) { +var B2 = /** @class */ (function (_super) { __extends(B2, _super); function B2() { return _super !== null && _super.apply(this, arguments) || this; } return B2; }(A2)); -var A3 = (function () { +var A3 = /** @class */ (function () { function A3() { } return A3; }()); -var B3 = (function (_super) { +var B3 = /** @class */ (function (_super) { __extends(B3, _super); function B3() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/subtypingWithObjectMembers5.js b/tests/baselines/reference/subtypingWithObjectMembers5.js index 4a0ac276594bd..45a6c3f80c028 100644 --- a/tests/baselines/reference/subtypingWithObjectMembers5.js +++ b/tests/baselines/reference/subtypingWithObjectMembers5.js @@ -68,17 +68,17 @@ module Optional { // foo properties are valid, bar properties cause errors in the derived class declarations var NotOptional; (function (NotOptional) { - var B = (function () { + var B = /** @class */ (function () { function B() { } return B; }()); - var B2 = (function () { + var B2 = /** @class */ (function () { function B2() { } return B2; }()); - var B3 = (function () { + var B3 = /** @class */ (function () { function B3() { } return B3; @@ -87,17 +87,17 @@ var NotOptional; // same cases as above but with optional var Optional; (function (Optional) { - var B = (function () { + var B = /** @class */ (function () { function B() { } return B; }()); - var B2 = (function () { + var B2 = /** @class */ (function () { function B2() { } return B2; }()); - var B3 = (function () { + var B3 = /** @class */ (function () { function B3() { } return B3; diff --git a/tests/baselines/reference/subtypingWithObjectMembersAccessibility.js b/tests/baselines/reference/subtypingWithObjectMembersAccessibility.js index fae7c452edc9d..dd865802fd0f7 100644 --- a/tests/baselines/reference/subtypingWithObjectMembersAccessibility.js +++ b/tests/baselines/reference/subtypingWithObjectMembersAccessibility.js @@ -45,48 +45,48 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var Base = (function () { +var Base = /** @class */ (function () { function Base() { } return Base; }()); -var Derived = (function (_super) { +var Derived = /** @class */ (function (_super) { __extends(Derived, _super); function Derived() { return _super !== null && _super.apply(this, arguments) || this; } return Derived; }(Base)); -var A = (function () { +var A = /** @class */ (function () { function A() { } return A; }()); -var B = (function (_super) { +var B = /** @class */ (function (_super) { __extends(B, _super); function B() { return _super !== null && _super.apply(this, arguments) || this; } return B; }(A)); -var A2 = (function () { +var A2 = /** @class */ (function () { function A2() { } return A2; }()); -var B2 = (function (_super) { +var B2 = /** @class */ (function (_super) { __extends(B2, _super); function B2() { return _super !== null && _super.apply(this, arguments) || this; } return B2; }(A2)); -var A3 = (function () { +var A3 = /** @class */ (function () { function A3() { } return A3; }()); -var B3 = (function (_super) { +var B3 = /** @class */ (function (_super) { __extends(B3, _super); function B3() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/subtypingWithObjectMembersAccessibility2.js b/tests/baselines/reference/subtypingWithObjectMembersAccessibility2.js index 6fd845d227773..987a4f33ba1fd 100644 --- a/tests/baselines/reference/subtypingWithObjectMembersAccessibility2.js +++ b/tests/baselines/reference/subtypingWithObjectMembersAccessibility2.js @@ -73,12 +73,12 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var Base = (function () { +var Base = /** @class */ (function () { function Base() { } return Base; }()); -var Derived = (function (_super) { +var Derived = /** @class */ (function (_super) { __extends(Derived, _super); function Derived() { return _super !== null && _super.apply(this, arguments) || this; @@ -87,36 +87,36 @@ var Derived = (function (_super) { }(Base)); var ExplicitPublic; (function (ExplicitPublic) { - var A = (function () { + var A = /** @class */ (function () { function A() { } return A; }()); - var B = (function (_super) { + var B = /** @class */ (function (_super) { __extends(B, _super); function B() { return _super !== null && _super.apply(this, arguments) || this; } return B; }(A)); - var A2 = (function () { + var A2 = /** @class */ (function () { function A2() { } return A2; }()); - var B2 = (function (_super) { + var B2 = /** @class */ (function (_super) { __extends(B2, _super); function B2() { return _super !== null && _super.apply(this, arguments) || this; } return B2; }(A2)); - var A3 = (function () { + var A3 = /** @class */ (function () { function A3() { } return A3; }()); - var B3 = (function (_super) { + var B3 = /** @class */ (function (_super) { __extends(B3, _super); function B3() { return _super !== null && _super.apply(this, arguments) || this; @@ -126,36 +126,36 @@ var ExplicitPublic; })(ExplicitPublic || (ExplicitPublic = {})); var ImplicitPublic; (function (ImplicitPublic) { - var A = (function () { + var A = /** @class */ (function () { function A() { } return A; }()); - var B = (function (_super) { + var B = /** @class */ (function (_super) { __extends(B, _super); function B() { return _super !== null && _super.apply(this, arguments) || this; } return B; }(A)); - var A2 = (function () { + var A2 = /** @class */ (function () { function A2() { } return A2; }()); - var B2 = (function (_super) { + var B2 = /** @class */ (function (_super) { __extends(B2, _super); function B2() { return _super !== null && _super.apply(this, arguments) || this; } return B2; }(A2)); - var A3 = (function () { + var A3 = /** @class */ (function () { function A3() { } return A3; }()); - var B3 = (function (_super) { + var B3 = /** @class */ (function (_super) { __extends(B3, _super); function B3() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/subtypingWithStringIndexer.js b/tests/baselines/reference/subtypingWithStringIndexer.js index 36382a4ff91ed..efed7de33bd53 100644 --- a/tests/baselines/reference/subtypingWithStringIndexer.js +++ b/tests/baselines/reference/subtypingWithStringIndexer.js @@ -52,19 +52,19 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var A = (function () { +var A = /** @class */ (function () { function A() { } return A; }()); -var B = (function (_super) { +var B = /** @class */ (function (_super) { __extends(B, _super); function B() { return _super !== null && _super.apply(this, arguments) || this; } return B; }(A)); -var B2 = (function (_super) { +var B2 = /** @class */ (function (_super) { __extends(B2, _super); function B2() { return _super !== null && _super.apply(this, arguments) || this; @@ -73,33 +73,33 @@ var B2 = (function (_super) { }(A)); var Generics; (function (Generics) { - var A = (function () { + var A = /** @class */ (function () { function A() { } return A; }()); - var B = (function (_super) { + var B = /** @class */ (function (_super) { __extends(B, _super); function B() { return _super !== null && _super.apply(this, arguments) || this; } return B; }(A)); - var B2 = (function (_super) { + var B2 = /** @class */ (function (_super) { __extends(B2, _super); function B2() { return _super !== null && _super.apply(this, arguments) || this; } return B2; }(A)); - var B3 = (function (_super) { + var B3 = /** @class */ (function (_super) { __extends(B3, _super); function B3() { return _super !== null && _super.apply(this, arguments) || this; } return B3; }(A)); - var B4 = (function (_super) { + var B4 = /** @class */ (function (_super) { __extends(B4, _super); function B4() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/subtypingWithStringIndexer3.js b/tests/baselines/reference/subtypingWithStringIndexer3.js index ed8e027e7c57f..7180dd5bd6edb 100644 --- a/tests/baselines/reference/subtypingWithStringIndexer3.js +++ b/tests/baselines/reference/subtypingWithStringIndexer3.js @@ -55,19 +55,19 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var A = (function () { +var A = /** @class */ (function () { function A() { } return A; }()); -var B = (function (_super) { +var B = /** @class */ (function (_super) { __extends(B, _super); function B() { return _super !== null && _super.apply(this, arguments) || this; } return B; }(A)); -var B2 = (function (_super) { +var B2 = /** @class */ (function (_super) { __extends(B2, _super); function B2() { return _super !== null && _super.apply(this, arguments) || this; @@ -76,40 +76,40 @@ var B2 = (function (_super) { }(A)); var Generics; (function (Generics) { - var A = (function () { + var A = /** @class */ (function () { function A() { } return A; }()); - var B = (function (_super) { + var B = /** @class */ (function (_super) { __extends(B, _super); function B() { return _super !== null && _super.apply(this, arguments) || this; } return B; }(A)); - var B2 = (function (_super) { + var B2 = /** @class */ (function (_super) { __extends(B2, _super); function B2() { return _super !== null && _super.apply(this, arguments) || this; } return B2; }(A)); - var B3 = (function (_super) { + var B3 = /** @class */ (function (_super) { __extends(B3, _super); function B3() { return _super !== null && _super.apply(this, arguments) || this; } return B3; }(A)); - var B4 = (function (_super) { + var B4 = /** @class */ (function (_super) { __extends(B4, _super); function B4() { return _super !== null && _super.apply(this, arguments) || this; } return B4; }(A)); - var B5 = (function (_super) { + var B5 = /** @class */ (function (_super) { __extends(B5, _super); function B5() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/subtypingWithStringIndexer4.js b/tests/baselines/reference/subtypingWithStringIndexer4.js index d8a9693e1a140..c6fd758965df1 100644 --- a/tests/baselines/reference/subtypingWithStringIndexer4.js +++ b/tests/baselines/reference/subtypingWithStringIndexer4.js @@ -39,12 +39,12 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var A = (function () { +var A = /** @class */ (function () { function A() { } return A; }()); -var B = (function (_super) { +var B = /** @class */ (function (_super) { __extends(B, _super); function B() { return _super !== null && _super.apply(this, arguments) || this; @@ -53,19 +53,19 @@ var B = (function (_super) { }(A)); var Generics; (function (Generics) { - var A = (function () { + var A = /** @class */ (function () { function A() { } return A; }()); - var B = (function (_super) { + var B = /** @class */ (function (_super) { __extends(B, _super); function B() { return _super !== null && _super.apply(this, arguments) || this; } return B; }(A)); - var B3 = (function (_super) { + var B3 = /** @class */ (function (_super) { __extends(B3, _super); function B3() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/super.js b/tests/baselines/reference/super.js index 3dd0e9ed538be..e635a5423784f 100644 --- a/tests/baselines/reference/super.js +++ b/tests/baselines/reference/super.js @@ -48,7 +48,7 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var Base = (function () { +var Base = /** @class */ (function () { function Base() { var x; } @@ -60,7 +60,7 @@ var Base = (function () { }; return Base; }()); -var Sub1 = (function (_super) { +var Sub1 = /** @class */ (function (_super) { __extends(Sub1, _super); function Sub1() { return _super !== null && _super.apply(this, arguments) || this; @@ -70,7 +70,7 @@ var Sub1 = (function (_super) { }; return Sub1; }(Base)); -var SubSub1 = (function (_super) { +var SubSub1 = /** @class */ (function (_super) { __extends(SubSub1, _super); function SubSub1() { return _super !== null && _super.apply(this, arguments) || this; @@ -80,7 +80,7 @@ var SubSub1 = (function (_super) { }; return SubSub1; }(Sub1)); -var Base2 = (function () { +var Base2 = /** @class */ (function () { function Base2() { } Base2.prototype.foo = function () { diff --git a/tests/baselines/reference/super1.js b/tests/baselines/reference/super1.js index 1ed0edbe0512d..859aea6e2b6aa 100644 --- a/tests/baselines/reference/super1.js +++ b/tests/baselines/reference/super1.js @@ -78,7 +78,7 @@ var __extends = (this && this.__extends) || (function () { }; })(); // Case 1 -var Base1 = (function () { +var Base1 = /** @class */ (function () { function Base1() { } Base1.prototype.foo = function () { @@ -86,7 +86,7 @@ var Base1 = (function () { }; return Base1; }()); -var Sub1 = (function (_super) { +var Sub1 = /** @class */ (function (_super) { __extends(Sub1, _super); function Sub1() { return _super !== null && _super.apply(this, arguments) || this; @@ -96,7 +96,7 @@ var Sub1 = (function (_super) { }; return Sub1; }(Base1)); -var SubSub1 = (function (_super) { +var SubSub1 = /** @class */ (function (_super) { __extends(SubSub1, _super); function SubSub1() { return _super !== null && _super.apply(this, arguments) || this; @@ -107,7 +107,7 @@ var SubSub1 = (function (_super) { return SubSub1; }(Sub1)); // Case 2 -var Base2 = (function () { +var Base2 = /** @class */ (function () { function Base2() { } Base2.prototype.foo = function () { @@ -115,7 +115,7 @@ var Base2 = (function () { }; return Base2; }()); -var SubE2 = (function (_super) { +var SubE2 = /** @class */ (function (_super) { __extends(SubE2, _super); function SubE2() { return _super !== null && _super.apply(this, arguments) || this; @@ -126,7 +126,7 @@ var SubE2 = (function (_super) { return SubE2; }(Base2)); // Case 3 -var Base3 = (function () { +var Base3 = /** @class */ (function () { function Base3() { } Base3.prototype.foo = function () { @@ -134,7 +134,7 @@ var Base3 = (function () { }; return Base3; }()); -var SubE3 = (function (_super) { +var SubE3 = /** @class */ (function (_super) { __extends(SubE3, _super); function SubE3() { return _super !== null && _super.apply(this, arguments) || this; @@ -147,7 +147,7 @@ var SubE3 = (function (_super) { // Case 4 var Base4; (function (Base4) { - var Sub4 = (function () { + var Sub4 = /** @class */ (function () { function Sub4() { } Sub4.prototype.x = function () { @@ -155,7 +155,7 @@ var Base4; }; return Sub4; }()); - var SubSub4 = (function (_super) { + var SubSub4 = /** @class */ (function (_super) { __extends(SubSub4, _super); function SubSub4() { return _super !== null && _super.apply(this, arguments) || this; @@ -166,7 +166,7 @@ var Base4; return SubSub4; }(Sub4)); Base4.SubSub4 = SubSub4; - var Sub4E = (function () { + var Sub4E = /** @class */ (function () { function Sub4E() { } Sub4E.prototype.x = function () { diff --git a/tests/baselines/reference/super2.js b/tests/baselines/reference/super2.js index 0f2101bc4dd34..85a1911e07c82 100644 --- a/tests/baselines/reference/super2.js +++ b/tests/baselines/reference/super2.js @@ -62,7 +62,7 @@ var __extends = (this && this.__extends) || (function () { }; })(); // Case 5 -var Base5 = (function () { +var Base5 = /** @class */ (function () { function Base5() { } Base5.prototype.x = function () { @@ -73,7 +73,7 @@ var Base5 = (function () { }; return Base5; }()); -var Sub5 = (function (_super) { +var Sub5 = /** @class */ (function (_super) { __extends(Sub5, _super); function Sub5() { return _super !== null && _super.apply(this, arguments) || this; @@ -83,7 +83,7 @@ var Sub5 = (function (_super) { }; return Sub5; }(Base5)); -var SubSub5 = (function (_super) { +var SubSub5 = /** @class */ (function (_super) { __extends(SubSub5, _super); function SubSub5() { return _super !== null && _super.apply(this, arguments) || this; @@ -97,7 +97,7 @@ var SubSub5 = (function (_super) { return SubSub5; }(Sub5)); // Case 6 -var Base6 = (function () { +var Base6 = /** @class */ (function () { function Base6() { } Base6.prototype.x = function () { @@ -105,7 +105,7 @@ var Base6 = (function () { }; return Base6; }()); -var Sub6 = (function (_super) { +var Sub6 = /** @class */ (function (_super) { __extends(Sub6, _super); function Sub6() { return _super !== null && _super.apply(this, arguments) || this; @@ -115,7 +115,7 @@ var Sub6 = (function (_super) { }; return Sub6; }(Base6)); -var SubSub6 = (function (_super) { +var SubSub6 = /** @class */ (function (_super) { __extends(SubSub6, _super); function SubSub6() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/superAccess.js b/tests/baselines/reference/superAccess.js index aac0025961359..fe89bee065579 100644 --- a/tests/baselines/reference/superAccess.js +++ b/tests/baselines/reference/superAccess.js @@ -24,7 +24,7 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var MyBase = (function () { +var MyBase = /** @class */ (function () { function MyBase() { this.S2 = "test"; this.f = function () { return 5; }; @@ -32,7 +32,7 @@ var MyBase = (function () { MyBase.S1 = 5; return MyBase; }()); -var MyDerived = (function (_super) { +var MyDerived = /** @class */ (function (_super) { __extends(MyDerived, _super); function MyDerived() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/superAccess2.js b/tests/baselines/reference/superAccess2.js index 9fa848dbf6a6f..de755361a16ca 100644 --- a/tests/baselines/reference/superAccess2.js +++ b/tests/baselines/reference/superAccess2.js @@ -35,14 +35,14 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var P = (function () { +var P = /** @class */ (function () { function P() { } P.prototype.x = function () { }; P.y = function () { }; return P; }()); -var Q = (function (_super) { +var Q = /** @class */ (function (_super) { __extends(Q, _super); // Super is not allowed in constructor args function Q(z, zz, zzz) { diff --git a/tests/baselines/reference/superAccessInFatArrow1.js b/tests/baselines/reference/superAccessInFatArrow1.js index ebbf9ccf8d23a..14b9764960efb 100644 --- a/tests/baselines/reference/superAccessInFatArrow1.js +++ b/tests/baselines/reference/superAccessInFatArrow1.js @@ -28,7 +28,7 @@ var __extends = (this && this.__extends) || (function () { })(); var test; (function (test) { - var A = (function () { + var A = /** @class */ (function () { function A() { } A.prototype.foo = function () { @@ -36,7 +36,7 @@ var test; return A; }()); test.A = A; - var B = (function (_super) { + var B = /** @class */ (function (_super) { __extends(B, _super); function B() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/superCallArgsMustMatch.js b/tests/baselines/reference/superCallArgsMustMatch.js index 113fbd6962565..5efe451c42f62 100644 --- a/tests/baselines/reference/superCallArgsMustMatch.js +++ b/tests/baselines/reference/superCallArgsMustMatch.js @@ -36,13 +36,13 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var T5 = (function () { +var T5 = /** @class */ (function () { function T5(bar) { this.bar = bar; } return T5; }()); -var T6 = (function (_super) { +var T6 = /** @class */ (function (_super) { __extends(T6, _super); function T6() { var _this = diff --git a/tests/baselines/reference/superCallAssignResult.js b/tests/baselines/reference/superCallAssignResult.js index a4525cb6ec864..69ee20dbbd33b 100644 --- a/tests/baselines/reference/superCallAssignResult.js +++ b/tests/baselines/reference/superCallAssignResult.js @@ -21,12 +21,12 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var E = (function () { +var E = /** @class */ (function () { function E(arg) { } return E; }()); -var H = (function (_super) { +var H = /** @class */ (function (_super) { __extends(H, _super); function H() { var _this = this; diff --git a/tests/baselines/reference/superCallBeforeThisAccessing1.js b/tests/baselines/reference/superCallBeforeThisAccessing1.js index 3045968da16cd..7a02083f3915d 100644 --- a/tests/baselines/reference/superCallBeforeThisAccessing1.js +++ b/tests/baselines/reference/superCallBeforeThisAccessing1.js @@ -27,12 +27,12 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var Base = (function () { +var Base = /** @class */ (function () { function Base(c) { } return Base; }()); -var D = (function (_super) { +var D = /** @class */ (function (_super) { __extends(D, _super); function D() { var _this = _super.call(this, i) || this; diff --git a/tests/baselines/reference/superCallBeforeThisAccessing2.js b/tests/baselines/reference/superCallBeforeThisAccessing2.js index d78ba6e4875ab..fc2d479173a32 100644 --- a/tests/baselines/reference/superCallBeforeThisAccessing2.js +++ b/tests/baselines/reference/superCallBeforeThisAccessing2.js @@ -21,12 +21,12 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var Base = (function () { +var Base = /** @class */ (function () { function Base(c) { } return Base; }()); -var D = (function (_super) { +var D = /** @class */ (function (_super) { __extends(D, _super); function D() { var _this = _super.call(this, function () { _this._t; }) || this; diff --git a/tests/baselines/reference/superCallBeforeThisAccessing3.js b/tests/baselines/reference/superCallBeforeThisAccessing3.js index 0bf37369b7e1f..cef50370abb75 100644 --- a/tests/baselines/reference/superCallBeforeThisAccessing3.js +++ b/tests/baselines/reference/superCallBeforeThisAccessing3.js @@ -24,12 +24,12 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var Base = (function () { +var Base = /** @class */ (function () { function Base(c) { } return Base; }()); -var D = (function (_super) { +var D = /** @class */ (function (_super) { __extends(D, _super); function D() { var _this = this; diff --git a/tests/baselines/reference/superCallBeforeThisAccessing4.js b/tests/baselines/reference/superCallBeforeThisAccessing4.js index 80a71d02d4d72..91fc6e06dbe41 100644 --- a/tests/baselines/reference/superCallBeforeThisAccessing4.js +++ b/tests/baselines/reference/superCallBeforeThisAccessing4.js @@ -26,7 +26,7 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var D = (function (_super) { +var D = /** @class */ (function (_super) { __extends(D, _super); function D() { this._t; @@ -34,7 +34,7 @@ var D = (function (_super) { } return D; }(null)); -var E = (function (_super) { +var E = /** @class */ (function (_super) { __extends(E, _super); function E() { _this = _super.call(this) || this; diff --git a/tests/baselines/reference/superCallBeforeThisAccessing5.js b/tests/baselines/reference/superCallBeforeThisAccessing5.js index 42049ff2b3227..6a73a597132bc 100644 --- a/tests/baselines/reference/superCallBeforeThisAccessing5.js +++ b/tests/baselines/reference/superCallBeforeThisAccessing5.js @@ -18,7 +18,7 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var D = (function (_super) { +var D = /** @class */ (function (_super) { __extends(D, _super); function D() { this._t; // No error diff --git a/tests/baselines/reference/superCallBeforeThisAccessing6.js b/tests/baselines/reference/superCallBeforeThisAccessing6.js index 244e21e6f73ff..2586f31cc1f96 100644 --- a/tests/baselines/reference/superCallBeforeThisAccessing6.js +++ b/tests/baselines/reference/superCallBeforeThisAccessing6.js @@ -21,12 +21,12 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var Base = (function () { +var Base = /** @class */ (function () { function Base(c) { } return Base; }()); -var D = (function (_super) { +var D = /** @class */ (function (_super) { __extends(D, _super); function D() { var _this = _super.call(this, _this) || this; diff --git a/tests/baselines/reference/superCallBeforeThisAccessing7.js b/tests/baselines/reference/superCallBeforeThisAccessing7.js index 90bc4e5c46697..9037e5641daef 100644 --- a/tests/baselines/reference/superCallBeforeThisAccessing7.js +++ b/tests/baselines/reference/superCallBeforeThisAccessing7.js @@ -24,12 +24,12 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var Base = (function () { +var Base = /** @class */ (function () { function Base(c) { } return Base; }()); -var D = (function (_super) { +var D = /** @class */ (function (_super) { __extends(D, _super); function D() { var _this = this; diff --git a/tests/baselines/reference/superCallBeforeThisAccessing8.js b/tests/baselines/reference/superCallBeforeThisAccessing8.js index 2bf736819864d..992dcfb253b62 100644 --- a/tests/baselines/reference/superCallBeforeThisAccessing8.js +++ b/tests/baselines/reference/superCallBeforeThisAccessing8.js @@ -24,12 +24,12 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var Base = (function () { +var Base = /** @class */ (function () { function Base(c) { } return Base; }()); -var D = (function (_super) { +var D = /** @class */ (function (_super) { __extends(D, _super); function D() { var _this = this; diff --git a/tests/baselines/reference/superCallFromClassThatDerivesFromGenericType1.js b/tests/baselines/reference/superCallFromClassThatDerivesFromGenericType1.js index 4ee302020ef6f..13331f08e5637 100644 --- a/tests/baselines/reference/superCallFromClassThatDerivesFromGenericType1.js +++ b/tests/baselines/reference/superCallFromClassThatDerivesFromGenericType1.js @@ -22,7 +22,7 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var D = (function (_super) { +var D = /** @class */ (function (_super) { __extends(D, _super); function D() { return _super.call(this) || this; diff --git a/tests/baselines/reference/superCallFromClassThatDerivesFromGenericType2.js b/tests/baselines/reference/superCallFromClassThatDerivesFromGenericType2.js index 3d9c8ff717e75..b30f82f42443b 100644 --- a/tests/baselines/reference/superCallFromClassThatDerivesFromGenericType2.js +++ b/tests/baselines/reference/superCallFromClassThatDerivesFromGenericType2.js @@ -21,7 +21,7 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var D = (function (_super) { +var D = /** @class */ (function (_super) { __extends(D, _super); function D() { return _super.call(this) || this; diff --git a/tests/baselines/reference/superCallFromClassThatDerivesFromGenericTypeButWithIncorrectNumberOfTypeArguments1.js b/tests/baselines/reference/superCallFromClassThatDerivesFromGenericTypeButWithIncorrectNumberOfTypeArguments1.js index a80ea5c047d7d..d7fd051216b35 100644 --- a/tests/baselines/reference/superCallFromClassThatDerivesFromGenericTypeButWithIncorrectNumberOfTypeArguments1.js +++ b/tests/baselines/reference/superCallFromClassThatDerivesFromGenericTypeButWithIncorrectNumberOfTypeArguments1.js @@ -20,13 +20,13 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var A = (function () { +var A = /** @class */ (function () { function A(map) { this.map = map; } return A; }()); -var B = (function (_super) { +var B = /** @class */ (function (_super) { __extends(B, _super); function B() { return _super.call(this, function (value) { return String(value); }) || this; diff --git a/tests/baselines/reference/superCallFromClassThatDerivesFromGenericTypeButWithNoTypeArguments1.js b/tests/baselines/reference/superCallFromClassThatDerivesFromGenericTypeButWithNoTypeArguments1.js index c73e6d6cb44f4..2408d3d1d8264 100644 --- a/tests/baselines/reference/superCallFromClassThatDerivesFromGenericTypeButWithNoTypeArguments1.js +++ b/tests/baselines/reference/superCallFromClassThatDerivesFromGenericTypeButWithNoTypeArguments1.js @@ -20,13 +20,13 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var A = (function () { +var A = /** @class */ (function () { function A(map) { this.map = map; } return A; }()); -var B = (function (_super) { +var B = /** @class */ (function (_super) { __extends(B, _super); function B() { return _super.call(this, function (value) { return String(value); }) || this; diff --git a/tests/baselines/reference/superCallFromClassThatDerivesNonGenericTypeButWithTypeArguments1.js b/tests/baselines/reference/superCallFromClassThatDerivesNonGenericTypeButWithTypeArguments1.js index 8c345104e287b..e4751928ac047 100644 --- a/tests/baselines/reference/superCallFromClassThatDerivesNonGenericTypeButWithTypeArguments1.js +++ b/tests/baselines/reference/superCallFromClassThatDerivesNonGenericTypeButWithTypeArguments1.js @@ -20,13 +20,13 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var A = (function () { +var A = /** @class */ (function () { function A(map) { this.map = map; } return A; }()); -var B = (function (_super) { +var B = /** @class */ (function (_super) { __extends(B, _super); function B() { return _super.call(this, function (value) { return String(value); }) || this; diff --git a/tests/baselines/reference/superCallFromClassThatHasNoBaseType1.js b/tests/baselines/reference/superCallFromClassThatHasNoBaseType1.js index 33cbede2ab277..1e01e4ad5ea5b 100644 --- a/tests/baselines/reference/superCallFromClassThatHasNoBaseType1.js +++ b/tests/baselines/reference/superCallFromClassThatHasNoBaseType1.js @@ -10,13 +10,13 @@ class B { } //// [superCallFromClassThatHasNoBaseType1.js] -var A = (function () { +var A = /** @class */ (function () { function A(map) { this.map = map; } return A; }()); -var B = (function () { +var B = /** @class */ (function () { function B() { _this = _super.call(this, function (value) { return String(value); }) || this; } diff --git a/tests/baselines/reference/superCallInConstructorWithNoBaseType.js b/tests/baselines/reference/superCallInConstructorWithNoBaseType.js index dcbebeaa452e6..1550a0c6ad9f5 100644 --- a/tests/baselines/reference/superCallInConstructorWithNoBaseType.js +++ b/tests/baselines/reference/superCallInConstructorWithNoBaseType.js @@ -12,13 +12,13 @@ class D { } //// [superCallInConstructorWithNoBaseType.js] -var C = (function () { +var C = /** @class */ (function () { function C() { _this = _super.call(this) || this; // error } return C; }()); -var D = (function () { +var D = /** @class */ (function () { function D(x) { _this = _super.call(this) || this; // error this.x = x; diff --git a/tests/baselines/reference/superCallInNonStaticMethod.js b/tests/baselines/reference/superCallInNonStaticMethod.js index 056dda2bf3392..67f419c61259e 100644 --- a/tests/baselines/reference/superCallInNonStaticMethod.js +++ b/tests/baselines/reference/superCallInNonStaticMethod.js @@ -61,14 +61,14 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var Doing = (function () { +var Doing = /** @class */ (function () { function Doing() { } Doing.prototype.instanceMethod = function () { }; return Doing; }()); -var Other = (function (_super) { +var Other = /** @class */ (function (_super) { __extends(Other, _super); function Other() { var _this = _super.call(this) || this; diff --git a/tests/baselines/reference/superCallInStaticMethod.js b/tests/baselines/reference/superCallInStaticMethod.js index c07c64304df9e..3a3b3bedb5373 100644 --- a/tests/baselines/reference/superCallInStaticMethod.js +++ b/tests/baselines/reference/superCallInStaticMethod.js @@ -57,14 +57,14 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var Doing = (function () { +var Doing = /** @class */ (function () { function Doing() { } Doing.staticMethod = function () { }; return Doing; }()); -var Other = (function (_super) { +var Other = /** @class */ (function (_super) { __extends(Other, _super); function Other() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/superCallInsideClassDeclaration.js b/tests/baselines/reference/superCallInsideClassDeclaration.js index ff82203764787..f580953c20996 100644 --- a/tests/baselines/reference/superCallInsideClassDeclaration.js +++ b/tests/baselines/reference/superCallInsideClassDeclaration.js @@ -27,21 +27,21 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var A = (function () { +var A = /** @class */ (function () { function A() { } return A; }()); -var C = (function () { +var C = /** @class */ (function () { function C() { } return C; }()); -var B = (function (_super) { +var B = /** @class */ (function (_super) { __extends(B, _super); function B() { var _this = this; - var D = (function (_super) { + var D = /** @class */ (function (_super) { __extends(D, _super); function D() { return _super.call(this) || this; diff --git a/tests/baselines/reference/superCallInsideClassExpression.js b/tests/baselines/reference/superCallInsideClassExpression.js index e1d146aa131e4..ada91eccb3c35 100644 --- a/tests/baselines/reference/superCallInsideClassExpression.js +++ b/tests/baselines/reference/superCallInsideClassExpression.js @@ -27,21 +27,21 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var A = (function () { +var A = /** @class */ (function () { function A() { } return A; }()); -var C = (function () { +var C = /** @class */ (function () { function C() { } return C; }()); -var B = (function (_super) { +var B = /** @class */ (function (_super) { __extends(B, _super); function B() { var _this = this; - var D = (function (_super) { + var D = /** @class */ (function (_super) { __extends(class_1, _super); function class_1() { return _super.call(this) || this; diff --git a/tests/baselines/reference/superCallInsideObjectLiteralExpression.js b/tests/baselines/reference/superCallInsideObjectLiteralExpression.js index 541539d39aca2..2ef12583cf283 100644 --- a/tests/baselines/reference/superCallInsideObjectLiteralExpression.js +++ b/tests/baselines/reference/superCallInsideObjectLiteralExpression.js @@ -23,14 +23,14 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var A = (function () { +var A = /** @class */ (function () { function A() { } A.prototype.foo = function () { }; return A; }()); -var B = (function (_super) { +var B = /** @class */ (function (_super) { __extends(B, _super); function B() { var _this = this; diff --git a/tests/baselines/reference/superCallOutsideConstructor.js b/tests/baselines/reference/superCallOutsideConstructor.js index 60e9411d4142d..2660b49a5f850 100644 --- a/tests/baselines/reference/superCallOutsideConstructor.js +++ b/tests/baselines/reference/superCallOutsideConstructor.js @@ -33,13 +33,13 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var C = (function () { +var C = /** @class */ (function () { function C() { } C.prototype.foo = function () { }; return C; }()); -var D = (function (_super) { +var D = /** @class */ (function (_super) { __extends(D, _super); function D() { var _this = _super.call(this) || this; diff --git a/tests/baselines/reference/superCallParameterContextualTyping1.js b/tests/baselines/reference/superCallParameterContextualTyping1.js index c846a029c917f..7a3db022239cf 100644 --- a/tests/baselines/reference/superCallParameterContextualTyping1.js +++ b/tests/baselines/reference/superCallParameterContextualTyping1.js @@ -22,13 +22,13 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var A = (function () { +var A = /** @class */ (function () { function A(map) { this.map = map; } return A; }()); -var B = (function (_super) { +var B = /** @class */ (function (_super) { __extends(B, _super); // Ensure 'value' is of type 'number (and not '{}') by using its 'toExponential()' method. function B() { diff --git a/tests/baselines/reference/superCallParameterContextualTyping2.js b/tests/baselines/reference/superCallParameterContextualTyping2.js index 7cd480d1b6529..b546ccb38cdbf 100644 --- a/tests/baselines/reference/superCallParameterContextualTyping2.js +++ b/tests/baselines/reference/superCallParameterContextualTyping2.js @@ -21,13 +21,13 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var A = (function () { +var A = /** @class */ (function () { function A(map) { this.map = map; } return A; }()); -var C = (function (_super) { +var C = /** @class */ (function (_super) { __extends(C, _super); // Ensure 'value' is not of type 'any' by invoking it with type arguments. function C() { diff --git a/tests/baselines/reference/superCallParameterContextualTyping3.js b/tests/baselines/reference/superCallParameterContextualTyping3.js index c955f210779ba..faca2388f2388 100644 --- a/tests/baselines/reference/superCallParameterContextualTyping3.js +++ b/tests/baselines/reference/superCallParameterContextualTyping3.js @@ -42,14 +42,14 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var CBase = (function () { +var CBase = /** @class */ (function () { function CBase(param) { } CBase.prototype.foo = function (param) { }; return CBase; }()); -var C = (function (_super) { +var C = /** @class */ (function (_super) { __extends(C, _super); function C() { var _this = diff --git a/tests/baselines/reference/superCallWithCommentEmit01.js b/tests/baselines/reference/superCallWithCommentEmit01.js index 993776f0057a0..806fb63e5943c 100644 --- a/tests/baselines/reference/superCallWithCommentEmit01.js +++ b/tests/baselines/reference/superCallWithCommentEmit01.js @@ -21,13 +21,13 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var A = (function () { +var A = /** @class */ (function () { function A(text) { this.text = text; } return A; }()); -var B = (function (_super) { +var B = /** @class */ (function (_super) { __extends(B, _super); function B(text) { // this is subclass constructor diff --git a/tests/baselines/reference/superCallWithMissingBaseClass.js b/tests/baselines/reference/superCallWithMissingBaseClass.js index 71c408f6df84b..19deaff153433 100644 --- a/tests/baselines/reference/superCallWithMissingBaseClass.js +++ b/tests/baselines/reference/superCallWithMissingBaseClass.js @@ -20,7 +20,7 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var Foo = (function (_super) { +var Foo = /** @class */ (function (_super) { __extends(Foo, _super); function Foo() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/superCalls.js b/tests/baselines/reference/superCalls.js index 8c1e70e0c9d00..2a62f17462f2b 100644 --- a/tests/baselines/reference/superCalls.js +++ b/tests/baselines/reference/superCalls.js @@ -41,14 +41,14 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var Base = (function () { +var Base = /** @class */ (function () { function Base(n) { this.x = 43; } return Base; }()); function v() { } -var Derived = (function (_super) { +var Derived = /** @class */ (function (_super) { __extends(Derived, _super); //super call in class constructor of derived type function Derived(q) { @@ -61,12 +61,12 @@ var Derived = (function (_super) { } return Derived; }(Base)); -var OtherBase = (function () { +var OtherBase = /** @class */ (function () { function OtherBase() { } return OtherBase; }()); -var OtherDerived = (function (_super) { +var OtherDerived = /** @class */ (function (_super) { __extends(OtherDerived, _super); function OtherDerived() { var _this = this; diff --git a/tests/baselines/reference/superCallsInConstructor.js b/tests/baselines/reference/superCallsInConstructor.js index b5d653dc34f57..d82fa5fc2f53d 100644 --- a/tests/baselines/reference/superCallsInConstructor.js +++ b/tests/baselines/reference/superCallsInConstructor.js @@ -31,19 +31,19 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var C = (function () { +var C = /** @class */ (function () { function C() { } C.prototype.foo = function () { }; C.prototype.bar = function () { }; return C; }()); -var Base = (function () { +var Base = /** @class */ (function () { function Base() { } return Base; }()); -var Derived = (function (_super) { +var Derived = /** @class */ (function (_super) { __extends(Derived, _super); function Derived() { var _this = this; diff --git a/tests/baselines/reference/superErrors.js b/tests/baselines/reference/superErrors.js index cf7edc83a63a2..87d4e3bb85a29 100644 --- a/tests/baselines/reference/superErrors.js +++ b/tests/baselines/reference/superErrors.js @@ -69,7 +69,7 @@ function foo() { var y = function () { return _super.; }; var z = function () { return function () { return function () { return _super.; }; }; }; } -var User = (function () { +var User = /** @class */ (function () { function User() { this.name = "Bob"; } @@ -78,7 +78,7 @@ var User = (function () { }; return User; }()); -var RegisteredUser = (function (_super) { +var RegisteredUser = /** @class */ (function (_super) { __extends(RegisteredUser, _super); function RegisteredUser() { var _this = _super.call(this) || this; diff --git a/tests/baselines/reference/superHasMethodsFromMergedInterface.js b/tests/baselines/reference/superHasMethodsFromMergedInterface.js index e7086106210cd..3fafeb2297498 100644 --- a/tests/baselines/reference/superHasMethodsFromMergedInterface.js +++ b/tests/baselines/reference/superHasMethodsFromMergedInterface.js @@ -19,13 +19,13 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var C = (function () { +var C = /** @class */ (function () { function C() { } C.prototype.m1 = function () { }; return C; }()); -var Sub = (function (_super) { +var Sub = /** @class */ (function (_super) { __extends(Sub, _super); function Sub() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/superInCatchBlock1.js b/tests/baselines/reference/superInCatchBlock1.js index 1f7375fe36081..5fcb4f41c1955 100644 --- a/tests/baselines/reference/superInCatchBlock1.js +++ b/tests/baselines/reference/superInCatchBlock1.js @@ -24,13 +24,13 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var A = (function () { +var A = /** @class */ (function () { function A() { } A.prototype.m = function () { }; return A; }()); -var B = (function (_super) { +var B = /** @class */ (function (_super) { __extends(B, _super); function B() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/superInConstructorParam1.js b/tests/baselines/reference/superInConstructorParam1.js index 89f88c43c4a08..f9317ee790adc 100644 --- a/tests/baselines/reference/superInConstructorParam1.js +++ b/tests/baselines/reference/superInConstructorParam1.js @@ -21,7 +21,7 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var B = (function () { +var B = /** @class */ (function () { function B() { } B.prototype.foo = function () { @@ -29,7 +29,7 @@ var B = (function () { }; return B; }()); -var C = (function (_super) { +var C = /** @class */ (function (_super) { __extends(C, _super); function C(a) { if (a === void 0) { a = _super.prototype.foo.call(_this); } diff --git a/tests/baselines/reference/superInLambdas.js b/tests/baselines/reference/superInLambdas.js index 83dad0b32515c..653d3ae84c14b 100644 --- a/tests/baselines/reference/superInLambdas.js +++ b/tests/baselines/reference/superInLambdas.js @@ -78,7 +78,7 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var User = (function () { +var User = /** @class */ (function () { function User() { this.name = "Bob"; } @@ -87,7 +87,7 @@ var User = (function () { }; return User; }()); -var RegisteredUser = (function (_super) { +var RegisteredUser = /** @class */ (function (_super) { __extends(RegisteredUser, _super); function RegisteredUser() { var _this = _super.call(this) || this; @@ -107,7 +107,7 @@ var RegisteredUser = (function (_super) { }; return RegisteredUser; }(User)); -var RegisteredUser2 = (function (_super) { +var RegisteredUser2 = /** @class */ (function (_super) { __extends(RegisteredUser2, _super); function RegisteredUser2() { var _this = _super.call(this) || this; @@ -123,7 +123,7 @@ var RegisteredUser2 = (function (_super) { }; return RegisteredUser2; }(User)); -var RegisteredUser3 = (function (_super) { +var RegisteredUser3 = /** @class */ (function (_super) { __extends(RegisteredUser3, _super); function RegisteredUser3() { var _this = _super.call(this) || this; @@ -139,7 +139,7 @@ var RegisteredUser3 = (function (_super) { }; return RegisteredUser3; }(User)); -var RegisteredUser4 = (function (_super) { +var RegisteredUser4 = /** @class */ (function (_super) { __extends(RegisteredUser4, _super); function RegisteredUser4() { var _this = _super.call(this) || this; diff --git a/tests/baselines/reference/superInObjectLiterals_ES5.js b/tests/baselines/reference/superInObjectLiterals_ES5.js index 81d8c09da0d6a..7f1254940e12b 100644 --- a/tests/baselines/reference/superInObjectLiterals_ES5.js +++ b/tests/baselines/reference/superInObjectLiterals_ES5.js @@ -96,13 +96,13 @@ var obj = { _super.method.call(_this); } }; -var A = (function () { +var A = /** @class */ (function () { function A() { } A.prototype.method = function () { }; return A; }()); -var B = (function (_super) { +var B = /** @class */ (function (_super) { __extends(B, _super); function B() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/superNewCall1.js b/tests/baselines/reference/superNewCall1.js index 687f0847fa92d..6b0bd3c10f493 100644 --- a/tests/baselines/reference/superNewCall1.js +++ b/tests/baselines/reference/superNewCall1.js @@ -22,13 +22,13 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var A = (function () { +var A = /** @class */ (function () { function A(map) { this.map = map; } return A; }()); -var B = (function (_super) { +var B = /** @class */ (function (_super) { __extends(B, _super); function B() { var _this = this; diff --git a/tests/baselines/reference/superPropertyAccess.js b/tests/baselines/reference/superPropertyAccess.js index d84bb5c08b829..cc9758a161736 100644 --- a/tests/baselines/reference/superPropertyAccess.js +++ b/tests/baselines/reference/superPropertyAccess.js @@ -46,7 +46,7 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var MyBase = (function () { +var MyBase = /** @class */ (function () { function MyBase() { this.m2 = function () { }; this.d1 = 42; @@ -62,7 +62,7 @@ var MyBase = (function () { }); return MyBase; }()); -var MyDerived = (function (_super) { +var MyDerived = /** @class */ (function (_super) { __extends(MyDerived, _super); function MyDerived() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/superPropertyAccess1.js b/tests/baselines/reference/superPropertyAccess1.js index 8779dd7069b36..7ced94b9c7e8c 100644 --- a/tests/baselines/reference/superPropertyAccess1.js +++ b/tests/baselines/reference/superPropertyAccess1.js @@ -38,7 +38,7 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var C = (function () { +var C = /** @class */ (function () { function C() { } C.prototype.foo = function () { }; @@ -52,7 +52,7 @@ var C = (function () { C.prototype.bar = function () { }; return C; }()); -var D = (function (_super) { +var D = /** @class */ (function (_super) { __extends(D, _super); function D() { var _this = _super.call(this) || this; diff --git a/tests/baselines/reference/superPropertyAccess2.js b/tests/baselines/reference/superPropertyAccess2.js index a6fb7c95b0c81..5f129b0373904 100644 --- a/tests/baselines/reference/superPropertyAccess2.js +++ b/tests/baselines/reference/superPropertyAccess2.js @@ -38,7 +38,7 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var C = (function () { +var C = /** @class */ (function () { function C() { } C.foo = function () { }; @@ -52,7 +52,7 @@ var C = (function () { C.bar = function () { }; return C; }()); -var D = (function (_super) { +var D = /** @class */ (function (_super) { __extends(D, _super); function D() { var _this = _super.call(this) || this; diff --git a/tests/baselines/reference/superPropertyAccessInComputedPropertiesOfNestedType_ES5.js b/tests/baselines/reference/superPropertyAccessInComputedPropertiesOfNestedType_ES5.js index cf256fa91eca4..0232e63d5bb1a 100644 --- a/tests/baselines/reference/superPropertyAccessInComputedPropertiesOfNestedType_ES5.js +++ b/tests/baselines/reference/superPropertyAccessInComputedPropertiesOfNestedType_ES5.js @@ -25,20 +25,20 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var A = (function () { +var A = /** @class */ (function () { function A() { } A.prototype.foo = function () { return 1; }; return A; }()); -var B = (function (_super) { +var B = /** @class */ (function (_super) { __extends(B, _super); function B() { return _super !== null && _super.apply(this, arguments) || this; } B.prototype.foo = function () { return 2; }; B.prototype.bar = function () { - return (function () { + return /** @class */ (function () { function class_1() { } class_1.prototype[_super.prototype.foo.call(this)] = function () { diff --git a/tests/baselines/reference/superPropertyAccessInSuperCall01.js b/tests/baselines/reference/superPropertyAccessInSuperCall01.js index d5800323de250..8ec09f258d500 100644 --- a/tests/baselines/reference/superPropertyAccessInSuperCall01.js +++ b/tests/baselines/reference/superPropertyAccessInSuperCall01.js @@ -22,13 +22,13 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var A = (function () { +var A = /** @class */ (function () { function A(f) { } A.prototype.blah = function () { return ""; }; return A; }()); -var B = (function (_super) { +var B = /** @class */ (function (_super) { __extends(B, _super); function B() { var _this = _super.call(this, _super.prototype.blah.call(_this)) || this; diff --git a/tests/baselines/reference/superPropertyAccessNoError.js b/tests/baselines/reference/superPropertyAccessNoError.js index d2e3d7aad4148..3414c1f9d0531 100644 --- a/tests/baselines/reference/superPropertyAccessNoError.js +++ b/tests/baselines/reference/superPropertyAccessNoError.js @@ -87,7 +87,7 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var SomeBaseClass = (function () { +var SomeBaseClass = /** @class */ (function () { function SomeBaseClass() { } SomeBaseClass.prototype.func = function () { @@ -101,7 +101,7 @@ var SomeBaseClass = (function () { }; return SomeBaseClass; }()); -var SomeDerivedClass = (function (_super) { +var SomeDerivedClass = /** @class */ (function (_super) { __extends(SomeDerivedClass, _super); function SomeDerivedClass() { var _this = _super.call(this) || this; diff --git a/tests/baselines/reference/superPropertyAccess_ES5.js b/tests/baselines/reference/superPropertyAccess_ES5.js index 406fa087a4440..6350253222bf1 100644 --- a/tests/baselines/reference/superPropertyAccess_ES5.js +++ b/tests/baselines/reference/superPropertyAccess_ES5.js @@ -39,7 +39,7 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var MyBase = (function () { +var MyBase = /** @class */ (function () { function MyBase() { } MyBase.prototype.getValue = function () { return 1; }; @@ -50,7 +50,7 @@ var MyBase = (function () { }); return MyBase; }()); -var MyDerived = (function (_super) { +var MyDerived = /** @class */ (function (_super) { __extends(MyDerived, _super); function MyDerived() { var _this = _super.call(this) || this; @@ -62,7 +62,7 @@ var MyDerived = (function (_super) { }(MyBase)); var d = new MyDerived(); var f3 = d.value; -var A = (function () { +var A = /** @class */ (function () { function A() { } Object.defineProperty(A.prototype, "property", { @@ -73,7 +73,7 @@ var A = (function () { }); return A; }()); -var B = (function (_super) { +var B = /** @class */ (function (_super) { __extends(B, _super); function B() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/superPropertyInConstructorBeforeSuperCall.js b/tests/baselines/reference/superPropertyInConstructorBeforeSuperCall.js index eb698f1ae7e1a..ed34c69caca35 100644 --- a/tests/baselines/reference/superPropertyInConstructorBeforeSuperCall.js +++ b/tests/baselines/reference/superPropertyInConstructorBeforeSuperCall.js @@ -26,13 +26,13 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var B = (function () { +var B = /** @class */ (function () { function B(x) { } B.prototype.x = function () { return ""; }; return B; }()); -var C1 = (function (_super) { +var C1 = /** @class */ (function (_super) { __extends(C1, _super); function C1() { var _this = this; @@ -42,7 +42,7 @@ var C1 = (function (_super) { } return C1; }(B)); -var C2 = (function (_super) { +var C2 = /** @class */ (function (_super) { __extends(C2, _super); function C2() { var _this = _super.call(this, _super.prototype.x.call(_this)) || this; diff --git a/tests/baselines/reference/superSymbolIndexedAccess5.js b/tests/baselines/reference/superSymbolIndexedAccess5.js index 5820c56504d45..16f89096bab0f 100644 --- a/tests/baselines/reference/superSymbolIndexedAccess5.js +++ b/tests/baselines/reference/superSymbolIndexedAccess5.js @@ -25,7 +25,7 @@ var __extends = (this && this.__extends) || (function () { }; })(); var symbol; -var Foo = (function () { +var Foo = /** @class */ (function () { function Foo() { } Foo.prototype[symbol] = function () { @@ -33,7 +33,7 @@ var Foo = (function () { }; return Foo; }()); -var Bar = (function (_super) { +var Bar = /** @class */ (function (_super) { __extends(Bar, _super); function Bar() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/superSymbolIndexedAccess6.js b/tests/baselines/reference/superSymbolIndexedAccess6.js index 459842982026d..3783c462a9fcd 100644 --- a/tests/baselines/reference/superSymbolIndexedAccess6.js +++ b/tests/baselines/reference/superSymbolIndexedAccess6.js @@ -25,7 +25,7 @@ var __extends = (this && this.__extends) || (function () { }; })(); var symbol; -var Foo = (function () { +var Foo = /** @class */ (function () { function Foo() { } Foo[symbol] = function () { @@ -33,7 +33,7 @@ var Foo = (function () { }; return Foo; }()); -var Bar = (function (_super) { +var Bar = /** @class */ (function (_super) { __extends(Bar, _super); function Bar() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/superWithGenericSpecialization.js b/tests/baselines/reference/superWithGenericSpecialization.js index 6f3cee935ef57..066ee1793b1c2 100644 --- a/tests/baselines/reference/superWithGenericSpecialization.js +++ b/tests/baselines/reference/superWithGenericSpecialization.js @@ -25,12 +25,12 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var C = (function () { +var C = /** @class */ (function () { function C() { } return C; }()); -var D = (function (_super) { +var D = /** @class */ (function (_super) { __extends(D, _super); function D() { return _super.call(this) || this; diff --git a/tests/baselines/reference/superWithGenerics.js b/tests/baselines/reference/superWithGenerics.js index a66656832f43f..bf0057a438333 100644 --- a/tests/baselines/reference/superWithGenerics.js +++ b/tests/baselines/reference/superWithGenerics.js @@ -22,7 +22,7 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var D = (function (_super) { +var D = /** @class */ (function (_super) { __extends(D, _super); function D() { return _super.call(this) || this; diff --git a/tests/baselines/reference/superWithTypeArgument.js b/tests/baselines/reference/superWithTypeArgument.js index 34cb3137ee895..7a7616ac958d3 100644 --- a/tests/baselines/reference/superWithTypeArgument.js +++ b/tests/baselines/reference/superWithTypeArgument.js @@ -20,12 +20,12 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var C = (function () { +var C = /** @class */ (function () { function C() { } return C; }()); -var D = (function (_super) { +var D = /** @class */ (function (_super) { __extends(D, _super); function D() { var _this = this; diff --git a/tests/baselines/reference/superWithTypeArgument2.js b/tests/baselines/reference/superWithTypeArgument2.js index e382f1923c98d..0131402acc4a4 100644 --- a/tests/baselines/reference/superWithTypeArgument2.js +++ b/tests/baselines/reference/superWithTypeArgument2.js @@ -20,12 +20,12 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var C = (function () { +var C = /** @class */ (function () { function C() { } return C; }()); -var D = (function (_super) { +var D = /** @class */ (function (_super) { __extends(D, _super); function D(x) { var _this = this; diff --git a/tests/baselines/reference/superWithTypeArgument3.js b/tests/baselines/reference/superWithTypeArgument3.js index d5c61d54fb65a..9acde49e99774 100644 --- a/tests/baselines/reference/superWithTypeArgument3.js +++ b/tests/baselines/reference/superWithTypeArgument3.js @@ -24,13 +24,13 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var C = (function () { +var C = /** @class */ (function () { function C() { } C.prototype.bar = function (x) { }; return C; }()); -var D = (function (_super) { +var D = /** @class */ (function (_super) { __extends(D, _super); function D() { var _this = this; diff --git a/tests/baselines/reference/super_inside-object-literal-getters-and-setters.js b/tests/baselines/reference/super_inside-object-literal-getters-and-setters.js index 140f8258669b1..0cd3599db5678 100644 --- a/tests/baselines/reference/super_inside-object-literal-getters-and-setters.js +++ b/tests/baselines/reference/super_inside-object-literal-getters-and-setters.js @@ -53,13 +53,13 @@ var ObjectLiteral; } }; })(ObjectLiteral || (ObjectLiteral = {})); -var F = (function () { +var F = /** @class */ (function () { function F() { } F.prototype.test = function () { return ""; }; return F; }()); -var SuperObjectTest = (function (_super) { +var SuperObjectTest = /** @class */ (function (_super) { __extends(SuperObjectTest, _super); function SuperObjectTest() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/switchAssignmentCompat.js b/tests/baselines/reference/switchAssignmentCompat.js index c88b07059a213..4905e3c3b2e25 100644 --- a/tests/baselines/reference/switchAssignmentCompat.js +++ b/tests/baselines/reference/switchAssignmentCompat.js @@ -7,7 +7,7 @@ switch (0) { //// [switchAssignmentCompat.js] -var Foo = (function () { +var Foo = /** @class */ (function () { function Foo() { } return Foo; diff --git a/tests/baselines/reference/switchCasesExpressionTypeMismatch.js b/tests/baselines/reference/switchCasesExpressionTypeMismatch.js index 43a4322457938..d2112a592fc59 100644 --- a/tests/baselines/reference/switchCasesExpressionTypeMismatch.js +++ b/tests/baselines/reference/switchCasesExpressionTypeMismatch.js @@ -20,7 +20,7 @@ switch (s) { //// [switchCasesExpressionTypeMismatch.js] -var Foo = (function () { +var Foo = /** @class */ (function () { function Foo() { } return Foo; diff --git a/tests/baselines/reference/switchComparableCompatForBrands.js b/tests/baselines/reference/switchComparableCompatForBrands.js index 316edfc9c31b1..6ad58b30ecad7 100644 --- a/tests/baselines/reference/switchComparableCompatForBrands.js +++ b/tests/baselines/reference/switchComparableCompatForBrands.js @@ -15,7 +15,7 @@ function test(strInput: string & MyBrand) { //// [switchComparableCompatForBrands.js] -var MyBrand = (function () { +var MyBrand = /** @class */ (function () { function MyBrand() { } return MyBrand; diff --git a/tests/baselines/reference/switchStatements.js b/tests/baselines/reference/switchStatements.js index 6bce62c108bb3..7ca009c3110e6 100644 --- a/tests/baselines/reference/switchStatements.js +++ b/tests/baselines/reference/switchStatements.js @@ -95,12 +95,12 @@ switch (x) { default: } // basic assignable check, rest covered in tests for 'assignement compatibility' -var C = (function () { +var C = /** @class */ (function () { function C() { } return C; }()); -var D = (function (_super) { +var D = /** @class */ (function (_super) { __extends(D, _super); function D() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/systemModule17.js b/tests/baselines/reference/systemModule17.js index bab203d8aa231..825b5be6ba156 100644 --- a/tests/baselines/reference/systemModule17.js +++ b/tests/baselines/reference/systemModule17.js @@ -46,7 +46,7 @@ System.register([], function (exports_1, context_1) { return { setters: [], execute: function () { - A = (function () { + A = /** @class */ (function () { function A() { } return A; diff --git a/tests/baselines/reference/systemModule3.js b/tests/baselines/reference/systemModule3.js index b7a91ac5d4ac8..d4f8e33f1ffcf 100644 --- a/tests/baselines/reference/systemModule3.js +++ b/tests/baselines/reference/systemModule3.js @@ -44,7 +44,7 @@ System.register([], function (exports_1, context_1) { return { setters: [], execute: function () { - C = (function () { + C = /** @class */ (function () { function C() { } return C; @@ -61,7 +61,7 @@ System.register([], function (exports_1, context_1) { return { setters: [], execute: function () { - default_1 = (function () { + default_1 = /** @class */ (function () { function default_1() { } return default_1; diff --git a/tests/baselines/reference/systemModule6.js b/tests/baselines/reference/systemModule6.js index 3632881127a73..9c04f07825e58 100644 --- a/tests/baselines/reference/systemModule6.js +++ b/tests/baselines/reference/systemModule6.js @@ -16,7 +16,7 @@ System.register([], function (exports_1, context_1) { return { setters: [], execute: function () { - C = (function () { + C = /** @class */ (function () { function C() { } return C; diff --git a/tests/baselines/reference/systemModuleDeclarationMerging.js b/tests/baselines/reference/systemModuleDeclarationMerging.js index 9a48570fb113e..7dbcd37c66fa8 100644 --- a/tests/baselines/reference/systemModuleDeclarationMerging.js +++ b/tests/baselines/reference/systemModuleDeclarationMerging.js @@ -22,7 +22,7 @@ System.register([], function (exports_1, context_1) { var x; })(F || (F = {})); exports_1("F", F); - C = (function () { + C = /** @class */ (function () { function C() { } return C; diff --git a/tests/baselines/reference/systemModuleExportDefault.js b/tests/baselines/reference/systemModuleExportDefault.js index 98fa71de5e2c9..9b055e0362218 100644 --- a/tests/baselines/reference/systemModuleExportDefault.js +++ b/tests/baselines/reference/systemModuleExportDefault.js @@ -46,7 +46,7 @@ System.register([], function (exports_1, context_1) { return { setters: [], execute: function () { - default_1 = (function () { + default_1 = /** @class */ (function () { function default_1() { } return default_1; @@ -63,7 +63,7 @@ System.register([], function (exports_1, context_1) { return { setters: [], execute: function () { - C = (function () { + C = /** @class */ (function () { function C() { } return C; diff --git a/tests/baselines/reference/systemModuleNonTopLevelModuleMembers.js b/tests/baselines/reference/systemModuleNonTopLevelModuleMembers.js index 8337b4faea996..278354690b748 100644 --- a/tests/baselines/reference/systemModuleNonTopLevelModuleMembers.js +++ b/tests/baselines/reference/systemModuleNonTopLevelModuleMembers.js @@ -21,7 +21,7 @@ System.register([], function (exports_1, context_1) { return { setters: [], execute: function () { - TopLevelClass = (function () { + TopLevelClass = /** @class */ (function () { function TopLevelClass() { } return TopLevelClass; @@ -36,7 +36,7 @@ System.register([], function (exports_1, context_1) { })(TopLevelEnum || (TopLevelEnum = {})); exports_1("TopLevelEnum", TopLevelEnum); (function (TopLevelModule2) { - var NonTopLevelClass = (function () { + var NonTopLevelClass = /** @class */ (function () { function NonTopLevelClass() { } return NonTopLevelClass; diff --git a/tests/baselines/reference/systemModuleWithSuperClass.js b/tests/baselines/reference/systemModuleWithSuperClass.js index 5964cb9c27f86..74c9986fc1f67 100644 --- a/tests/baselines/reference/systemModuleWithSuperClass.js +++ b/tests/baselines/reference/systemModuleWithSuperClass.js @@ -19,7 +19,7 @@ System.register([], function (exports_1, context_1) { return { setters: [], execute: function () { - Foo = (function () { + Foo = /** @class */ (function () { function Foo() { } return Foo; @@ -50,7 +50,7 @@ System.register(["./foo"], function (exports_1, context_1) { } ], execute: function () { - Bar = (function (_super) { + Bar = /** @class */ (function (_super) { __extends(Bar, _super); function Bar() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/taggedTemplateWithConstructableTag01.js b/tests/baselines/reference/taggedTemplateWithConstructableTag01.js index dbcb70edf0061..dacae2f529e15 100644 --- a/tests/baselines/reference/taggedTemplateWithConstructableTag01.js +++ b/tests/baselines/reference/taggedTemplateWithConstructableTag01.js @@ -4,7 +4,7 @@ class CtorTag { } CtorTag `Hello world!`; //// [taggedTemplateWithConstructableTag01.js] -var CtorTag = (function () { +var CtorTag = /** @class */ (function () { function CtorTag() { } return CtorTag; diff --git a/tests/baselines/reference/targetTypeBaseCalls.js b/tests/baselines/reference/targetTypeBaseCalls.js index 70e14fd521f68..f769d93063eca 100644 --- a/tests/baselines/reference/targetTypeBaseCalls.js +++ b/tests/baselines/reference/targetTypeBaseCalls.js @@ -30,14 +30,14 @@ var __extends = (this && this.__extends) || (function () { }; })(); function foo(x) { } -var Foo = (function () { +var Foo = /** @class */ (function () { function Foo(x) { } return Foo; }()); foo(function (s) { s = 5; }); // Error, can’t assign number to string new Foo(function (s) { s = 5; }); // error, if types are applied correctly -var Bar = (function (_super) { +var Bar = /** @class */ (function (_super) { __extends(Bar, _super); function Bar() { return _super.call(this, function (s) { s = 5; }) || this; diff --git a/tests/baselines/reference/templateStringsArrayTypeDefinedInES5Mode.js b/tests/baselines/reference/templateStringsArrayTypeDefinedInES5Mode.js index 7c8beb428c83d..517383f6f2906 100644 --- a/tests/baselines/reference/templateStringsArrayTypeDefinedInES5Mode.js +++ b/tests/baselines/reference/templateStringsArrayTypeDefinedInES5Mode.js @@ -10,7 +10,7 @@ f({}, 10, 10); f `abcdef${ 1234 }${ 5678 }ghijkl`; //// [templateStringsArrayTypeDefinedInES5Mode.js] -var TemplateStringsArray = (function () { +var TemplateStringsArray = /** @class */ (function () { function TemplateStringsArray() { } return TemplateStringsArray; diff --git a/tests/baselines/reference/testContainerList.js b/tests/baselines/reference/testContainerList.js index 19e54a2782fc9..25b19cc98e1c3 100644 --- a/tests/baselines/reference/testContainerList.js +++ b/tests/baselines/reference/testContainerList.js @@ -11,7 +11,7 @@ module A { // Regression test for #325 var A; (function (A) { - var C = (function () { + var C = /** @class */ (function () { function C(d) { this.d = d; } diff --git a/tests/baselines/reference/thisBinding.js b/tests/baselines/reference/thisBinding.js index d8d7f5b7c0a32..b0b05e23e80d4 100644 --- a/tests/baselines/reference/thisBinding.js +++ b/tests/baselines/reference/thisBinding.js @@ -24,7 +24,7 @@ class C { //// [thisBinding.js] var M; (function (M) { - var C = (function () { + var C = /** @class */ (function () { function C() { this.x = 0; ({ z: 10, f: this.f }).f(({})); @@ -37,7 +37,7 @@ var M; }()); M.C = C; })(M || (M = {})); -var C = (function () { +var C = /** @class */ (function () { function C() { } C.prototype.f = function (x) { diff --git a/tests/baselines/reference/thisBinding2.js b/tests/baselines/reference/thisBinding2.js index 142cd9db4a5a2..27bd7c3bec7ac 100644 --- a/tests/baselines/reference/thisBinding2.js +++ b/tests/baselines/reference/thisBinding2.js @@ -22,7 +22,7 @@ var messenger = { //// [thisBinding2.js] -var C = (function () { +var C = /** @class */ (function () { function C() { var _this = this; this.x = (function () { diff --git a/tests/baselines/reference/thisCapture1.js b/tests/baselines/reference/thisCapture1.js index 8ee3fa2fddcf6..bab60aa042414 100644 --- a/tests/baselines/reference/thisCapture1.js +++ b/tests/baselines/reference/thisCapture1.js @@ -10,7 +10,7 @@ class X { } //// [thisCapture1.js] -var X = (function () { +var X = /** @class */ (function () { function X() { this.y = 0; } diff --git a/tests/baselines/reference/thisExpressionInCallExpressionWithTypeArguments.js b/tests/baselines/reference/thisExpressionInCallExpressionWithTypeArguments.js index 9aea88edf4678..d3a67a9b92901 100644 --- a/tests/baselines/reference/thisExpressionInCallExpressionWithTypeArguments.js +++ b/tests/baselines/reference/thisExpressionInCallExpressionWithTypeArguments.js @@ -5,7 +5,7 @@ class C { //// [thisExpressionInCallExpressionWithTypeArguments.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } C.prototype.foo = function () { diff --git a/tests/baselines/reference/thisExpressionOfGenericObject.js b/tests/baselines/reference/thisExpressionOfGenericObject.js index a6cfdeb4d0743..bf4b9257e11d9 100644 --- a/tests/baselines/reference/thisExpressionOfGenericObject.js +++ b/tests/baselines/reference/thisExpressionOfGenericObject.js @@ -8,7 +8,7 @@ class MyClass1 { //// [thisExpressionOfGenericObject.js] -var MyClass1 = (function () { +var MyClass1 = /** @class */ (function () { function MyClass1() { var _this = this; (function () { return _this; }); diff --git a/tests/baselines/reference/thisInAccessors.js b/tests/baselines/reference/thisInAccessors.js index 6c0b492d878be..739cc183affc7 100644 --- a/tests/baselines/reference/thisInAccessors.js +++ b/tests/baselines/reference/thisInAccessors.js @@ -32,7 +32,7 @@ class GetterAndSetter { //// [thisInAccessors.js] // this capture only in getter -var GetterOnly = (function () { +var GetterOnly = /** @class */ (function () { function GetterOnly() { } Object.defineProperty(GetterOnly.prototype, "Value", { @@ -49,7 +49,7 @@ var GetterOnly = (function () { return GetterOnly; }()); // this capture only in setter -var SetterOnly = (function () { +var SetterOnly = /** @class */ (function () { function SetterOnly() { } Object.defineProperty(SetterOnly.prototype, "Value", { @@ -66,7 +66,7 @@ var SetterOnly = (function () { return SetterOnly; }()); // this capture only in both setter and getter -var GetterAndSetter = (function () { +var GetterAndSetter = /** @class */ (function () { function GetterAndSetter() { } Object.defineProperty(GetterAndSetter.prototype, "Value", { diff --git a/tests/baselines/reference/thisInArrowFunctionInStaticInitializer1.js b/tests/baselines/reference/thisInArrowFunctionInStaticInitializer1.js index 88a4f5c6e5ccc..97e958ace5ec1 100644 --- a/tests/baselines/reference/thisInArrowFunctionInStaticInitializer1.js +++ b/tests/baselines/reference/thisInArrowFunctionInStaticInitializer1.js @@ -10,7 +10,7 @@ class Vector { //// [thisInArrowFunctionInStaticInitializer1.js] function log(a) { } -var Vector = (function () { +var Vector = /** @class */ (function () { function Vector() { } Vector.foo = function () { diff --git a/tests/baselines/reference/thisInConstructorParameter1.js b/tests/baselines/reference/thisInConstructorParameter1.js index 32d50bc1edec2..bbaac843b6a5f 100644 --- a/tests/baselines/reference/thisInConstructorParameter1.js +++ b/tests/baselines/reference/thisInConstructorParameter1.js @@ -5,7 +5,7 @@ class Foo { } //// [thisInConstructorParameter1.js] -var Foo = (function () { +var Foo = /** @class */ (function () { function Foo(x) { if (x === void 0) { x = this.y; } } diff --git a/tests/baselines/reference/thisInConstructorParameter2.js b/tests/baselines/reference/thisInConstructorParameter2.js index 7260ecafcb98c..6a27183800c2d 100644 --- a/tests/baselines/reference/thisInConstructorParameter2.js +++ b/tests/baselines/reference/thisInConstructorParameter2.js @@ -10,7 +10,7 @@ class P { } //// [thisInConstructorParameter2.js] -var P = (function () { +var P = /** @class */ (function () { function P(z, zz) { if (z === void 0) { z = this; } if (zz === void 0) { zz = this; } diff --git a/tests/baselines/reference/thisInGenericStaticMembers.js b/tests/baselines/reference/thisInGenericStaticMembers.js index 11dc7b28081a7..748065790e346 100644 --- a/tests/baselines/reference/thisInGenericStaticMembers.js +++ b/tests/baselines/reference/thisInGenericStaticMembers.js @@ -28,7 +28,7 @@ class B { //// [thisInGenericStaticMembers.js] // this.call in static generic method not resolved correctly -var A = (function () { +var A = /** @class */ (function () { function A() { } A.one = function (source, value) { @@ -39,7 +39,7 @@ var A = (function () { }; return A; }()); -var B = (function () { +var B = /** @class */ (function () { function B() { } B.one = function (source, value) { diff --git a/tests/baselines/reference/thisInInnerFunctions.js b/tests/baselines/reference/thisInInnerFunctions.js index ec8a387bd1b05..c34aa32736b55 100644 --- a/tests/baselines/reference/thisInInnerFunctions.js +++ b/tests/baselines/reference/thisInInnerFunctions.js @@ -18,7 +18,7 @@ function test() { //// [thisInInnerFunctions.js] -var Foo = (function () { +var Foo = /** @class */ (function () { function Foo() { this.x = "hello"; } diff --git a/tests/baselines/reference/thisInInstanceMemberInitializer.js b/tests/baselines/reference/thisInInstanceMemberInitializer.js index 71db30b05403d..70d2c91319dea 100644 --- a/tests/baselines/reference/thisInInstanceMemberInitializer.js +++ b/tests/baselines/reference/thisInInstanceMemberInitializer.js @@ -9,13 +9,13 @@ class D { } //// [thisInInstanceMemberInitializer.js] -var C = (function () { +var C = /** @class */ (function () { function C() { this.x = this; } return C; }()); -var D = (function () { +var D = /** @class */ (function () { function D() { this.x = this; } diff --git a/tests/baselines/reference/thisInInvalidContexts.js b/tests/baselines/reference/thisInInvalidContexts.js index 24b25d46a34b7..635eff25cf4a1 100644 --- a/tests/baselines/reference/thisInInvalidContexts.js +++ b/tests/baselines/reference/thisInInvalidContexts.js @@ -60,18 +60,18 @@ var __extends = (this && this.__extends) || (function () { }; })(); //'this' in static member initializer -var ErrClass1 = (function () { +var ErrClass1 = /** @class */ (function () { function ErrClass1() { } ErrClass1.t = this; // Error return ErrClass1; }()); -var BaseErrClass = (function () { +var BaseErrClass = /** @class */ (function () { function BaseErrClass(t) { } return BaseErrClass; }()); -var ClassWithNoInitializer = (function (_super) { +var ClassWithNoInitializer = /** @class */ (function (_super) { __extends(ClassWithNoInitializer, _super); //'this' in optional super call function ClassWithNoInitializer() { @@ -80,7 +80,7 @@ var ClassWithNoInitializer = (function (_super) { } return ClassWithNoInitializer; }(BaseErrClass)); -var ClassWithInitializer = (function (_super) { +var ClassWithInitializer = /** @class */ (function (_super) { __extends(ClassWithInitializer, _super); //'this' in required super call function ClassWithInitializer() { @@ -100,7 +100,7 @@ var M; //'this' as a type argument function genericFunc(x) { } genericFunc(undefined); // Should be an error -var ErrClass3 = (function (_super) { +var ErrClass3 = /** @class */ (function (_super) { __extends(ErrClass3, _super); function ErrClass3() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/thisInInvalidContextsExternalModule.js b/tests/baselines/reference/thisInInvalidContextsExternalModule.js index 845183d8df5f1..ea69a582730e3 100644 --- a/tests/baselines/reference/thisInInvalidContextsExternalModule.js +++ b/tests/baselines/reference/thisInInvalidContextsExternalModule.js @@ -61,18 +61,18 @@ var __extends = (this && this.__extends) || (function () { }; })(); //'this' in static member initializer -var ErrClass1 = (function () { +var ErrClass1 = /** @class */ (function () { function ErrClass1() { } ErrClass1.t = this; // Error return ErrClass1; }()); -var BaseErrClass = (function () { +var BaseErrClass = /** @class */ (function () { function BaseErrClass(t) { } return BaseErrClass; }()); -var ClassWithNoInitializer = (function (_super) { +var ClassWithNoInitializer = /** @class */ (function (_super) { __extends(ClassWithNoInitializer, _super); //'this' in optional super call function ClassWithNoInitializer() { @@ -81,7 +81,7 @@ var ClassWithNoInitializer = (function (_super) { } return ClassWithNoInitializer; }(BaseErrClass)); -var ClassWithInitializer = (function (_super) { +var ClassWithInitializer = /** @class */ (function (_super) { __extends(ClassWithInitializer, _super); //'this' in required super call function ClassWithInitializer() { @@ -101,7 +101,7 @@ var M; //'this' as a type argument function genericFunc(x) { } genericFunc(undefined); // Should be an error -var ErrClass3 = (function (_super) { +var ErrClass3 = /** @class */ (function (_super) { __extends(ErrClass3, _super); function ErrClass3() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/thisInLambda.js b/tests/baselines/reference/thisInLambda.js index b121947ce9b95..45455eaa13efa 100644 --- a/tests/baselines/reference/thisInLambda.js +++ b/tests/baselines/reference/thisInLambda.js @@ -19,7 +19,7 @@ class myCls { } //// [thisInLambda.js] -var Foo = (function () { +var Foo = /** @class */ (function () { function Foo() { this.x = "hello"; } @@ -31,7 +31,7 @@ var Foo = (function () { return Foo; }()); function myFn(a) { } -var myCls = (function () { +var myCls = /** @class */ (function () { function myCls() { var _this = this; myFn(function () { diff --git a/tests/baselines/reference/thisInObjectLiterals.js b/tests/baselines/reference/thisInObjectLiterals.js index 6331f12105d91..22b3c6ba5be65 100644 --- a/tests/baselines/reference/thisInObjectLiterals.js +++ b/tests/baselines/reference/thisInObjectLiterals.js @@ -20,7 +20,7 @@ var obj: { f: () => any; }; //// [thisInObjectLiterals.js] -var MyClass = (function () { +var MyClass = /** @class */ (function () { function MyClass() { } MyClass.prototype.fn = function () { diff --git a/tests/baselines/reference/thisInOuterClassBody.js b/tests/baselines/reference/thisInOuterClassBody.js index 40e4a2e2485da..2b4e3a1aabdb6 100644 --- a/tests/baselines/reference/thisInOuterClassBody.js +++ b/tests/baselines/reference/thisInOuterClassBody.js @@ -21,7 +21,7 @@ class Foo { } //// [thisInOuterClassBody.js] -var Foo = (function () { +var Foo = /** @class */ (function () { function Foo() { this.x = this; } diff --git a/tests/baselines/reference/thisInPropertyBoundDeclarations.js b/tests/baselines/reference/thisInPropertyBoundDeclarations.js index 0b378cec51aaf..15c0bf5951986 100644 --- a/tests/baselines/reference/thisInPropertyBoundDeclarations.js +++ b/tests/baselines/reference/thisInPropertyBoundDeclarations.js @@ -68,7 +68,7 @@ class B { } //// [thisInPropertyBoundDeclarations.js] -var Bug = (function () { +var Bug = /** @class */ (function () { function Bug() { } Bug.prototype.foo = function (name) { @@ -82,7 +82,7 @@ var Bug = (function () { return Bug; }()); // Valid use of this in a property bound decl -var A = (function () { +var A = /** @class */ (function () { function A() { this.prop1 = function () { this; @@ -110,7 +110,7 @@ var A = (function () { } return A; }()); -var B = (function () { +var B = /** @class */ (function () { function B() { var _this = this; this.prop1 = this; diff --git a/tests/baselines/reference/thisInStaticMethod1.js b/tests/baselines/reference/thisInStaticMethod1.js index a42415c0b62b1..bbeb55c48fb1f 100644 --- a/tests/baselines/reference/thisInStaticMethod1.js +++ b/tests/baselines/reference/thisInStaticMethod1.js @@ -8,7 +8,7 @@ class foo { var x = foo.bar(); //// [thisInStaticMethod1.js] -var foo = (function () { +var foo = /** @class */ (function () { function foo() { } foo.bar = function () { diff --git a/tests/baselines/reference/thisInStatics.js b/tests/baselines/reference/thisInStatics.js index b3f688903c685..dfb0dc19f877c 100644 --- a/tests/baselines/reference/thisInStatics.js +++ b/tests/baselines/reference/thisInStatics.js @@ -11,7 +11,7 @@ class C { } //// [thisInStatics.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } C.f = function () { diff --git a/tests/baselines/reference/thisInSuperCall.js b/tests/baselines/reference/thisInSuperCall.js index e28588b2142bb..85fd3f31b8a31 100644 --- a/tests/baselines/reference/thisInSuperCall.js +++ b/tests/baselines/reference/thisInSuperCall.js @@ -33,12 +33,12 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var Base = (function () { +var Base = /** @class */ (function () { function Base(x) { } return Base; }()); -var Foo = (function (_super) { +var Foo = /** @class */ (function (_super) { __extends(Foo, _super); function Foo() { var _this = _super.call(this, _this) || this; @@ -46,7 +46,7 @@ var Foo = (function (_super) { } return Foo; }(Base)); -var Foo2 = (function (_super) { +var Foo2 = /** @class */ (function (_super) { __extends(Foo2, _super); function Foo2() { var _this = _super.call(this, _this) || this; @@ -55,7 +55,7 @@ var Foo2 = (function (_super) { } return Foo2; }(Base)); -var Foo3 = (function (_super) { +var Foo3 = /** @class */ (function (_super) { __extends(Foo3, _super); function Foo3(p) { var _this = _super.call(this, _this) || this; diff --git a/tests/baselines/reference/thisInSuperCall1.js b/tests/baselines/reference/thisInSuperCall1.js index c975c10927e9e..fe074c247c0f7 100644 --- a/tests/baselines/reference/thisInSuperCall1.js +++ b/tests/baselines/reference/thisInSuperCall1.js @@ -21,12 +21,12 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var Base = (function () { +var Base = /** @class */ (function () { function Base(a) { } return Base; }()); -var Foo = (function (_super) { +var Foo = /** @class */ (function (_super) { __extends(Foo, _super); function Foo(x) { var _this = _super.call(this, _this) || this; diff --git a/tests/baselines/reference/thisInSuperCall2.js b/tests/baselines/reference/thisInSuperCall2.js index 7112f7b21d15e..cb231c6e3b353 100644 --- a/tests/baselines/reference/thisInSuperCall2.js +++ b/tests/baselines/reference/thisInSuperCall2.js @@ -30,12 +30,12 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var Base = (function () { +var Base = /** @class */ (function () { function Base(a) { } return Base; }()); -var Foo = (function (_super) { +var Foo = /** @class */ (function (_super) { __extends(Foo, _super); function Foo() { var _this = _super.call(this, _this) || this; @@ -43,7 +43,7 @@ var Foo = (function (_super) { } return Foo; }(Base)); -var Foo2 = (function (_super) { +var Foo2 = /** @class */ (function (_super) { __extends(Foo2, _super); function Foo2() { var _this = _super.call(this, _this) || this; diff --git a/tests/baselines/reference/thisInSuperCall3.js b/tests/baselines/reference/thisInSuperCall3.js index 2e07d2948433a..29c67e8bbeec8 100644 --- a/tests/baselines/reference/thisInSuperCall3.js +++ b/tests/baselines/reference/thisInSuperCall3.js @@ -23,12 +23,12 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var Base = (function () { +var Base = /** @class */ (function () { function Base(a) { } return Base; }()); -var Foo = (function (_super) { +var Foo = /** @class */ (function (_super) { __extends(Foo, _super); function Foo() { var _this = _super.call(this, _this) || this; diff --git a/tests/baselines/reference/thisTypeAndConstraints.js b/tests/baselines/reference/thisTypeAndConstraints.js index 3800b8bc5e385..b9b2dfba2e35f 100644 --- a/tests/baselines/reference/thisTypeAndConstraints.js +++ b/tests/baselines/reference/thisTypeAndConstraints.js @@ -23,7 +23,7 @@ class B { //// [thisTypeAndConstraints.js] -var A = (function () { +var A = /** @class */ (function () { function A() { } A.prototype.self = function () { @@ -37,7 +37,7 @@ function f(x) { } x = x.self(); } -var B = (function () { +var B = /** @class */ (function () { function B() { } B.prototype.foo = function (x) { diff --git a/tests/baselines/reference/thisTypeAsConstraint.js b/tests/baselines/reference/thisTypeAsConstraint.js index b5a7113549dba..f11a754a458cd 100644 --- a/tests/baselines/reference/thisTypeAsConstraint.js +++ b/tests/baselines/reference/thisTypeAsConstraint.js @@ -5,7 +5,7 @@ class C { } //// [thisTypeAsConstraint.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } C.prototype.m = function () { diff --git a/tests/baselines/reference/thisTypeErrors.js b/tests/baselines/reference/thisTypeErrors.js index f246b80f4f4f6..96039071cb655 100644 --- a/tests/baselines/reference/thisTypeErrors.js +++ b/tests/baselines/reference/thisTypeErrors.js @@ -64,12 +64,12 @@ function f1(x) { var y; return this; } -var C1 = (function () { +var C1 = /** @class */ (function () { function C1() { } return C1; }()); -var C2 = (function () { +var C2 = /** @class */ (function () { function C2() { } C2.foo = function (x) { @@ -82,7 +82,7 @@ var N1; (function (N1) { N1.y = this; })(N1 || (N1 = {})); -var C3 = (function () { +var C3 = /** @class */ (function () { function C3() { this.x1 = { g: function (x) { diff --git a/tests/baselines/reference/thisTypeErrors2.js b/tests/baselines/reference/thisTypeErrors2.js index 4546dcd219987..0d044525fc38d 100644 --- a/tests/baselines/reference/thisTypeErrors2.js +++ b/tests/baselines/reference/thisTypeErrors2.js @@ -15,17 +15,17 @@ class Derived { //// [thisTypeErrors2.js] -var Base = (function () { +var Base = /** @class */ (function () { function Base(a) { } return Base; }()); -var Generic = (function () { +var Generic = /** @class */ (function () { function Generic() { } return Generic; }()); -var Derived = (function () { +var Derived = /** @class */ (function () { function Derived(host) { this.host = host; var self = this; diff --git a/tests/baselines/reference/thisTypeInAccessors.js b/tests/baselines/reference/thisTypeInAccessors.js index ed339d0366a56..bae75af559977 100644 --- a/tests/baselines/reference/thisTypeInAccessors.js +++ b/tests/baselines/reference/thisTypeInAccessors.js @@ -57,7 +57,7 @@ var copiedFromGetterUnannotated = { get x() { return this.n; }, set x(n) { this.n = n; } }; -var Explicit = (function () { +var Explicit = /** @class */ (function () { function Explicit() { this.n = 17; } @@ -69,7 +69,7 @@ var Explicit = (function () { }); return Explicit; }()); -var Contextual = (function () { +var Contextual = /** @class */ (function () { function Contextual() { this.n = 21; } diff --git a/tests/baselines/reference/thisTypeInClasses.js b/tests/baselines/reference/thisTypeInClasses.js index c6790b3d52d79..b10fcbcf61248 100644 --- a/tests/baselines/reference/thisTypeInClasses.js +++ b/tests/baselines/reference/thisTypeInClasses.js @@ -51,23 +51,23 @@ class C5 { //// [thisTypeInClasses.js] -var C1 = (function () { +var C1 = /** @class */ (function () { function C1() { } C1.prototype.f = function (x) { return undefined; }; return C1; }()); -var C2 = (function () { +var C2 = /** @class */ (function () { function C2() { } return C2; }()); -var C3 = (function () { +var C3 = /** @class */ (function () { function C3() { } return C3; }()); -var C5 = (function () { +var C5 = /** @class */ (function () { function C5() { } C5.prototype.foo = function () { diff --git a/tests/baselines/reference/thisTypeInFunctions.js b/tests/baselines/reference/thisTypeInFunctions.js index 68513c151d98a..36ce0574a5dd9 100644 --- a/tests/baselines/reference/thisTypeInFunctions.js +++ b/tests/baselines/reference/thisTypeInFunctions.js @@ -207,12 +207,12 @@ var __extends = (this && this.__extends) || (function () { })(); var _this = this; // body checking -var B = (function () { +var B = /** @class */ (function () { function B() { } return B; }()); -var C = (function () { +var C = /** @class */ (function () { function C() { } C.prototype.explicitThis = function (m) { @@ -229,7 +229,7 @@ var C = (function () { }; return C; }()); -var D = (function (_super) { +var D = /** @class */ (function (_super) { __extends(D, _super); function D() { return _super !== null && _super.apply(this, arguments) || this; @@ -330,7 +330,7 @@ c.explicitC = function (m) { return this.n + m; }; // this:void compatibility c.explicitVoid = function (n) { return n; }; // class-based assignability -var Base1 = (function () { +var Base1 = /** @class */ (function () { function Base1() { } Base1.prototype.polymorphic = function () { return this.x; }; @@ -338,21 +338,21 @@ var Base1 = (function () { Base1.explicitStatic = function () { return this.y; }; return Base1; }()); -var Derived1 = (function (_super) { +var Derived1 = /** @class */ (function (_super) { __extends(Derived1, _super); function Derived1() { return _super !== null && _super.apply(this, arguments) || this; } return Derived1; }(Base1)); -var Base2 = (function () { +var Base2 = /** @class */ (function () { function Base2() { } Base2.prototype.polymorphic = function () { return this.y; }; Base2.prototype.explicit = function () { return this.x; }; return Base2; }()); -var Derived2 = (function (_super) { +var Derived2 = /** @class */ (function (_super) { __extends(Derived2, _super); function Derived2() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/thisTypeInFunctionsNegative.js b/tests/baselines/reference/thisTypeInFunctionsNegative.js index 6cf6f4778274e..e342a819906c4 100644 --- a/tests/baselines/reference/thisTypeInFunctionsNegative.js +++ b/tests/baselines/reference/thisTypeInFunctionsNegative.js @@ -188,7 +188,7 @@ var __extends = (this && this.__extends) || (function () { }; })(); var _this = this; -var C = (function () { +var C = /** @class */ (function () { function C() { } C.prototype.explicitThis = function (m) { @@ -208,7 +208,7 @@ var C = (function () { }; return C; }()); -var D = (function () { +var D = /** @class */ (function () { function D() { } D.prototype.explicitThis = function (m) { @@ -290,7 +290,7 @@ c.explicitThis = d.explicitThis; c.explicitVoid = d.explicitD; c.explicitVoid = d.explicitThis; /// class-based polymorphic assignability (with inheritance!) /// -var Base1 = (function () { +var Base1 = /** @class */ (function () { function Base1() { } Base1.prototype.polymorphic = function () { return this.x; }; @@ -298,21 +298,21 @@ var Base1 = (function () { Base1.explicitStatic = function () { return this.x; }; return Base1; }()); -var Derived1 = (function (_super) { +var Derived1 = /** @class */ (function (_super) { __extends(Derived1, _super); function Derived1() { return _super !== null && _super.apply(this, arguments) || this; } return Derived1; }(Base1)); -var Base2 = (function () { +var Base2 = /** @class */ (function () { function Base2() { } Base2.prototype.polymorphic = function () { return this.y; }; Base2.prototype.explicit = function () { return this.x; }; return Base2; }()); -var Derived2 = (function (_super) { +var Derived2 = /** @class */ (function (_super) { __extends(Derived2, _super); function Derived2() { return _super !== null && _super.apply(this, arguments) || this; @@ -331,7 +331,7 @@ function VoidThis() { } var voidThis = new VoidThis(); ///// syntax-ish errors ///// -var ThisConstructor = (function () { +var ThisConstructor = /** @class */ (function () { function ThisConstructor(n) { this.n = n; } diff --git a/tests/baselines/reference/thisWhenTypeCheckFails.js b/tests/baselines/reference/thisWhenTypeCheckFails.js index fee1ef2d61ea7..ed818e1ac32ca 100644 --- a/tests/baselines/reference/thisWhenTypeCheckFails.js +++ b/tests/baselines/reference/thisWhenTypeCheckFails.js @@ -9,7 +9,7 @@ class c { //// [thisWhenTypeCheckFails.js] -var c = (function () { +var c = /** @class */ (function () { function c() { } c.prototype.n = function () { diff --git a/tests/baselines/reference/throwInEnclosingStatements.js b/tests/baselines/reference/throwInEnclosingStatements.js index eb4da2e6c4d13..e1760cd6e8b65 100644 --- a/tests/baselines/reference/throwInEnclosingStatements.js +++ b/tests/baselines/reference/throwInEnclosingStatements.js @@ -75,7 +75,7 @@ var j = 0; while (j < 0) { throw j; } -var C = (function () { +var C = /** @class */ (function () { function C() { throw this; } diff --git a/tests/baselines/reference/throwStatements.js b/tests/baselines/reference/throwStatements.js index 0773ecba845ab..ab66fc4ad961c 100644 --- a/tests/baselines/reference/throwStatements.js +++ b/tests/baselines/reference/throwStatements.js @@ -87,12 +87,12 @@ throw new D(); //// [throwStatements.js] // all legal -var C = (function () { +var C = /** @class */ (function () { function C() { } return C; }()); -var D = (function () { +var D = /** @class */ (function () { function D() { } return D; @@ -100,7 +100,7 @@ var D = (function () { function F(x) { return 42; } var M; (function (M) { - var A = (function () { + var A = /** @class */ (function () { function A() { } return A; diff --git a/tests/baselines/reference/tooManyTypeParameters1.js b/tests/baselines/reference/tooManyTypeParameters1.js index 085a6bd13e3d1..a40efee7028fc 100644 --- a/tests/baselines/reference/tooManyTypeParameters1.js +++ b/tests/baselines/reference/tooManyTypeParameters1.js @@ -16,7 +16,7 @@ function f() { } f(); var x = function () { }; x(); -var C = (function () { +var C = /** @class */ (function () { function C() { } return C; diff --git a/tests/baselines/reference/topLevel.js b/tests/baselines/reference/topLevel.js index 1908ab8c729cb..05622165a5fef 100644 --- a/tests/baselines/reference/topLevel.js +++ b/tests/baselines/reference/topLevel.js @@ -28,7 +28,7 @@ result+=(M.origin.move(1,1)); //// [topLevel.js] -var Point = (function () { +var Point = /** @class */ (function () { function Point(x, y) { this.x = x; this.y = y; diff --git a/tests/baselines/reference/trailingCommaInHeterogenousArrayLiteral1.js b/tests/baselines/reference/trailingCommaInHeterogenousArrayLiteral1.js index 8041025f66ab0..a3a1775130966 100644 --- a/tests/baselines/reference/trailingCommaInHeterogenousArrayLiteral1.js +++ b/tests/baselines/reference/trailingCommaInHeterogenousArrayLiteral1.js @@ -10,7 +10,7 @@ class arrTest { //// [trailingCommaInHeterogenousArrayLiteral1.js] -var arrTest = (function () { +var arrTest = /** @class */ (function () { function arrTest() { } arrTest.prototype.test = function (arg1) { }; diff --git a/tests/baselines/reference/trailingCommasInFunctionParametersAndArguments.js b/tests/baselines/reference/trailingCommasInFunctionParametersAndArguments.js index 64df1ec5a7512..e796a6b518c70 100644 --- a/tests/baselines/reference/trailingCommasInFunctionParametersAndArguments.js +++ b/tests/baselines/reference/trailingCommasInFunctionParametersAndArguments.js @@ -41,7 +41,7 @@ f2.apply(void 0, []); f3(1); f3(1, 2); // Works for constructors too -var X = (function () { +var X = /** @class */ (function () { function X(a) { } Object.defineProperty(X.prototype, "x", { diff --git a/tests/baselines/reference/trailingCommasInGetter.js b/tests/baselines/reference/trailingCommasInGetter.js index 926545a8cbae6..3151729a66ad4 100644 --- a/tests/baselines/reference/trailingCommasInGetter.js +++ b/tests/baselines/reference/trailingCommasInGetter.js @@ -5,7 +5,7 @@ class X { //// [trailingCommasInGetter.js] -var X = (function () { +var X = /** @class */ (function () { function X() { } Object.defineProperty(X.prototype, "x", { diff --git a/tests/baselines/reference/transitiveTypeArgumentInference1.js b/tests/baselines/reference/transitiveTypeArgumentInference1.js index 3f7aed892e12e..6e66294a66c48 100644 --- a/tests/baselines/reference/transitiveTypeArgumentInference1.js +++ b/tests/baselines/reference/transitiveTypeArgumentInference1.js @@ -15,7 +15,7 @@ var c = new C(i); //// [transitiveTypeArgumentInference1.js] var i = null; -var C = (function () { +var C = /** @class */ (function () { function C(p) { } return C; diff --git a/tests/baselines/reference/transpile/Correctly serialize metadata when transpile with CommonJS option.js b/tests/baselines/reference/transpile/Correctly serialize metadata when transpile with CommonJS option.js index 9bdbfba8396b6..2b52d660f4e54 100644 --- a/tests/baselines/reference/transpile/Correctly serialize metadata when transpile with CommonJS option.js +++ b/tests/baselines/reference/transpile/Correctly serialize metadata when transpile with CommonJS option.js @@ -10,7 +10,7 @@ var __metadata = (this && this.__metadata) || function (k, v) { }; Object.defineProperty(exports, "__esModule", { value: true }); var ng = require("angular2/core"); -var MyClass1 = (function () { +var MyClass1 = /** @class */ (function () { function MyClass1(_elementRef) { this._elementRef = _elementRef; } diff --git a/tests/baselines/reference/transpile/Correctly serialize metadata when transpile with System option.js b/tests/baselines/reference/transpile/Correctly serialize metadata when transpile with System option.js index e79eeceae5063..00be51ec29e1e 100644 --- a/tests/baselines/reference/transpile/Correctly serialize metadata when transpile with System option.js +++ b/tests/baselines/reference/transpile/Correctly serialize metadata when transpile with System option.js @@ -18,7 +18,7 @@ System.register(["angular2/core"], function (exports_1, context_1) { } ], execute: function () { - MyClass1 = (function () { + MyClass1 = /** @class */ (function () { function MyClass1(_elementRef) { this._elementRef = _elementRef; } diff --git a/tests/baselines/reference/transpile/Transpile with emit decorators and emit metadata.js b/tests/baselines/reference/transpile/Transpile with emit decorators and emit metadata.js index 236f91f959473..ed922d3f48a69 100644 --- a/tests/baselines/reference/transpile/Transpile with emit decorators and emit metadata.js +++ b/tests/baselines/reference/transpile/Transpile with emit decorators and emit metadata.js @@ -4,7 +4,7 @@ var db_1 = require("./db"); function someDecorator(target) { return target; } -var MyClass = (function () { +var MyClass = /** @class */ (function () { function MyClass(db) { this.db = db; this.db.doSomething(); diff --git a/tests/baselines/reference/tsxAttributeResolution10.js b/tests/baselines/reference/tsxAttributeResolution10.js index 141743c17bc20..0853ce0bf543d 100644 --- a/tests/baselines/reference/tsxAttributeResolution10.js +++ b/tests/baselines/reference/tsxAttributeResolution10.js @@ -34,7 +34,7 @@ export class MyComponent { define(["require", "exports"], function (require, exports) { "use strict"; exports.__esModule = true; - var MyComponent = (function () { + var MyComponent = /** @class */ (function () { function MyComponent() { } MyComponent.prototype.render = function () { diff --git a/tests/baselines/reference/tsxAttributeResolution11.js b/tests/baselines/reference/tsxAttributeResolution11.js index c4d62a7147aa3..e89a00cd63bc2 100644 --- a/tests/baselines/reference/tsxAttributeResolution11.js +++ b/tests/baselines/reference/tsxAttributeResolution11.js @@ -29,7 +29,7 @@ var x = ; //// [file.jsx] -var MyComponent = (function () { +var MyComponent = /** @class */ (function () { function MyComponent() { } MyComponent.prototype.render = function () { diff --git a/tests/baselines/reference/tsxAttributeResolution15.js b/tests/baselines/reference/tsxAttributeResolution15.js index 0fbc01e6e0fce..358f83016a84b 100644 --- a/tests/baselines/reference/tsxAttributeResolution15.js +++ b/tests/baselines/reference/tsxAttributeResolution15.js @@ -30,7 +30,7 @@ var __extends = (this && this.__extends) || (function () { var _this = this; exports.__esModule = true; var React = require("react"); -var BigGreeter = (function (_super) { +var BigGreeter = /** @class */ (function (_super) { __extends(BigGreeter, _super); function BigGreeter() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/tsxAttributeResolution16.js b/tests/baselines/reference/tsxAttributeResolution16.js index 1c05446b4938e..d0506b0ab14f8 100644 --- a/tests/baselines/reference/tsxAttributeResolution16.js +++ b/tests/baselines/reference/tsxAttributeResolution16.js @@ -38,7 +38,7 @@ var __extends = (this && this.__extends) || (function () { })(); exports.__esModule = true; var React = require("react"); -var AddressComp = (function (_super) { +var AddressComp = /** @class */ (function (_super) { __extends(AddressComp, _super); function AddressComp() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/tsxAttributeResolution9.js b/tests/baselines/reference/tsxAttributeResolution9.js index a982fea412b1e..4180e6a662d59 100644 --- a/tests/baselines/reference/tsxAttributeResolution9.js +++ b/tests/baselines/reference/tsxAttributeResolution9.js @@ -30,7 +30,7 @@ export class MyComponent { define(["require", "exports"], function (require, exports) { "use strict"; exports.__esModule = true; - var MyComponent = (function () { + var MyComponent = /** @class */ (function () { function MyComponent() { } MyComponent.prototype.render = function () { diff --git a/tests/baselines/reference/tsxCorrectlyParseLessThanComparison1.js b/tests/baselines/reference/tsxCorrectlyParseLessThanComparison1.js index f6403804fae29..55d09cf308531 100644 --- a/tests/baselines/reference/tsxCorrectlyParseLessThanComparison1.js +++ b/tests/baselines/reference/tsxCorrectlyParseLessThanComparison1.js @@ -32,7 +32,7 @@ var __extends = (this && this.__extends) || (function () { }; })(); exports.__esModule = true; -var ShortDetails = (function (_super) { +var ShortDetails = /** @class */ (function (_super) { __extends(ShortDetails, _super); function ShortDetails() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/tsxDefaultAttributesResolution1.js b/tests/baselines/reference/tsxDefaultAttributesResolution1.js index 8d22db3b69f13..10266147f3ab9 100644 --- a/tests/baselines/reference/tsxDefaultAttributesResolution1.js +++ b/tests/baselines/reference/tsxDefaultAttributesResolution1.js @@ -27,7 +27,7 @@ var __extends = (this && this.__extends) || (function () { })(); exports.__esModule = true; var React = require("react"); -var Poisoned = (function (_super) { +var Poisoned = /** @class */ (function (_super) { __extends(Poisoned, _super); function Poisoned() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/tsxDefaultAttributesResolution2.js b/tests/baselines/reference/tsxDefaultAttributesResolution2.js index 38735169f10a3..f83fc00a2f1f7 100644 --- a/tests/baselines/reference/tsxDefaultAttributesResolution2.js +++ b/tests/baselines/reference/tsxDefaultAttributesResolution2.js @@ -27,7 +27,7 @@ var __extends = (this && this.__extends) || (function () { })(); exports.__esModule = true; var React = require("react"); -var Poisoned = (function (_super) { +var Poisoned = /** @class */ (function (_super) { __extends(Poisoned, _super); function Poisoned() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/tsxDefaultAttributesResolution3.js b/tests/baselines/reference/tsxDefaultAttributesResolution3.js index 14da51516b578..43fef39620d76 100644 --- a/tests/baselines/reference/tsxDefaultAttributesResolution3.js +++ b/tests/baselines/reference/tsxDefaultAttributesResolution3.js @@ -27,7 +27,7 @@ var __extends = (this && this.__extends) || (function () { })(); exports.__esModule = true; var React = require("react"); -var Poisoned = (function (_super) { +var Poisoned = /** @class */ (function (_super) { __extends(Poisoned, _super); function Poisoned() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/tsxDefaultImports.js b/tests/baselines/reference/tsxDefaultImports.js index c3a287c478d19..a0ca09cd8405a 100644 --- a/tests/baselines/reference/tsxDefaultImports.js +++ b/tests/baselines/reference/tsxDefaultImports.js @@ -20,7 +20,7 @@ var SomeEnum; (function (SomeEnum) { SomeEnum[SomeEnum["one"] = 0] = "one"; })(SomeEnum || (SomeEnum = {})); -var SomeClass = (function () { +var SomeClass = /** @class */ (function () { function SomeClass() { } SomeClass.E = SomeEnum; diff --git a/tests/baselines/reference/tsxDynamicTagName5.js b/tests/baselines/reference/tsxDynamicTagName5.js index 1aa3650a9632d..3014c8857de1a 100644 --- a/tests/baselines/reference/tsxDynamicTagName5.js +++ b/tests/baselines/reference/tsxDynamicTagName5.js @@ -32,7 +32,7 @@ var __extends = (this && this.__extends) || (function () { })(); exports.__esModule = true; var React = require("react"); -var Text = (function (_super) { +var Text = /** @class */ (function (_super) { __extends(Text, _super); function Text() { var _this = _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/tsxDynamicTagName7.js b/tests/baselines/reference/tsxDynamicTagName7.js index 1bfade5d5da29..1a845130b4d5d 100644 --- a/tests/baselines/reference/tsxDynamicTagName7.js +++ b/tests/baselines/reference/tsxDynamicTagName7.js @@ -32,7 +32,7 @@ var __extends = (this && this.__extends) || (function () { })(); exports.__esModule = true; var React = require("react"); -var Text = (function (_super) { +var Text = /** @class */ (function (_super) { __extends(Text, _super); function Text() { var _this = _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/tsxDynamicTagName8.js b/tests/baselines/reference/tsxDynamicTagName8.js index 34a587c7d19b3..b35c1b88bcffb 100644 --- a/tests/baselines/reference/tsxDynamicTagName8.js +++ b/tests/baselines/reference/tsxDynamicTagName8.js @@ -32,7 +32,7 @@ var __extends = (this && this.__extends) || (function () { })(); exports.__esModule = true; var React = require("react"); -var Text = (function (_super) { +var Text = /** @class */ (function (_super) { __extends(Text, _super); function Text() { var _this = _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/tsxDynamicTagName9.js b/tests/baselines/reference/tsxDynamicTagName9.js index e5229f97a39da..113629006f6e8 100644 --- a/tests/baselines/reference/tsxDynamicTagName9.js +++ b/tests/baselines/reference/tsxDynamicTagName9.js @@ -32,7 +32,7 @@ var __extends = (this && this.__extends) || (function () { })(); exports.__esModule = true; var React = require("react"); -var Text = (function (_super) { +var Text = /** @class */ (function (_super) { __extends(Text, _super); function Text() { var _this = _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/tsxElementResolution.js b/tests/baselines/reference/tsxElementResolution.js index 6b0f49c19b670..5140e1116ced3 100644 --- a/tests/baselines/reference/tsxElementResolution.js +++ b/tests/baselines/reference/tsxElementResolution.js @@ -25,19 +25,19 @@ var e = ; //// [tsxElementResolution.jsx] -var foundFirst = (function () { +var foundFirst = /** @class */ (function () { function foundFirst() { } return foundFirst; }()); -var Other = (function () { +var Other = /** @class */ (function () { function Other() { } return Other; }()); var Dotted; (function (Dotted) { - var Name = (function () { + var Name = /** @class */ (function () { function Name() { } return Name; diff --git a/tests/baselines/reference/tsxElementResolution19.js b/tests/baselines/reference/tsxElementResolution19.js index d63ab29794d2d..60b72237354e9 100644 --- a/tests/baselines/reference/tsxElementResolution19.js +++ b/tests/baselines/reference/tsxElementResolution19.js @@ -23,7 +23,7 @@ import {MyClass} from './file1'; define(["require", "exports"], function (require, exports) { "use strict"; exports.__esModule = true; - var MyClass = (function () { + var MyClass = /** @class */ (function () { function MyClass() { } return MyClass; diff --git a/tests/baselines/reference/tsxEmit1.js b/tests/baselines/reference/tsxEmit1.js index dacb3ad621ad1..5e9817b94d66d 100644 --- a/tests/baselines/reference/tsxEmit1.js +++ b/tests/baselines/reference/tsxEmit1.js @@ -54,7 +54,7 @@ var openClosed2 =
foo
; var openClosed3 =
{p}
; var openClosed4 =
{p < p}
; var openClosed5 =
{p > p}
; -var SomeClass = (function () { +var SomeClass = /** @class */ (function () { function SomeClass() { } SomeClass.prototype.f = function () { diff --git a/tests/baselines/reference/tsxEmit3.js b/tests/baselines/reference/tsxEmit3.js index 402782f899d17..c1dc074bfe648 100644 --- a/tests/baselines/reference/tsxEmit3.js +++ b/tests/baselines/reference/tsxEmit3.js @@ -43,7 +43,7 @@ module M { //// [file.jsx] var M; (function (M) { - var Foo = (function () { + var Foo = /** @class */ (function () { function Foo() { } return Foo; @@ -51,7 +51,7 @@ var M; M.Foo = Foo; var S; (function (S) { - var Bar = (function () { + var Bar = /** @class */ (function () { function Bar() { } return Bar; diff --git a/tests/baselines/reference/tsxEmit3.sourcemap.txt b/tests/baselines/reference/tsxEmit3.sourcemap.txt index 91bc3b839af02..d6622d8532cfd 100644 --- a/tests/baselines/reference/tsxEmit3.sourcemap.txt +++ b/tests/baselines/reference/tsxEmit3.sourcemap.txt @@ -40,7 +40,7 @@ sourceFile:file.tsx 1-> 2 >^^^^^^^^^^^ 3 > ^ -4 > ^^^^^^^^^^^^^^^^^-> +4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1-> 2 >module 3 > M @@ -48,7 +48,7 @@ sourceFile:file.tsx 2 >Emitted(2, 12) Source(6, 8) + SourceIndex(0) 3 >Emitted(2, 13) Source(6, 9) + SourceIndex(0) --- ->>> var Foo = (function () { +>>> var Foo = /** @class */ (function () { 1->^^^^ 2 > ^^^^^^^^^^^^^^^^^^^^^-> 1-> { @@ -132,7 +132,7 @@ sourceFile:file.tsx 1->^^^^ 2 > ^^^^^^^^^^^ 3 > ^ -4 > ^^^^^^^^^^^^^^^^^-> +4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1-> 2 > export module 3 > S @@ -140,7 +140,7 @@ sourceFile:file.tsx 2 >Emitted(10, 16) Source(8, 16) + SourceIndex(0) 3 >Emitted(10, 17) Source(8, 17) + SourceIndex(0) --- ->>> var Bar = (function () { +>>> var Bar = /** @class */ (function () { 1->^^^^^^^^ 2 > ^^^^^^^^^^^^^^^^^^^^^-> 1-> { diff --git a/tests/baselines/reference/tsxExternalModuleEmit1.js b/tests/baselines/reference/tsxExternalModuleEmit1.js index 578d952be983d..941da1971d554 100644 --- a/tests/baselines/reference/tsxExternalModuleEmit1.js +++ b/tests/baselines/reference/tsxExternalModuleEmit1.js @@ -44,7 +44,7 @@ var __extends = (this && this.__extends) || (function () { })(); exports.__esModule = true; var React = require("react"); -var Button = (function (_super) { +var Button = /** @class */ (function (_super) { __extends(Button, _super); function Button() { return _super !== null && _super.apply(this, arguments) || this; @@ -71,7 +71,7 @@ exports.__esModule = true; var React = require("react"); // Should see var button_1 = require('./button') here var button_1 = require("./button"); -var App = (function (_super) { +var App = /** @class */ (function (_super) { __extends(App, _super); function App() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/tsxGenericAttributesType3.js b/tests/baselines/reference/tsxGenericAttributesType3.js index 51491d99aa2a1..876b5a6ad0037 100644 --- a/tests/baselines/reference/tsxGenericAttributesType3.js +++ b/tests/baselines/reference/tsxGenericAttributesType3.js @@ -26,7 +26,7 @@ var __extends = (this && this.__extends) || (function () { })(); exports.__esModule = true; var React = require("react"); -var B1 = (function (_super) { +var B1 = /** @class */ (function (_super) { __extends(B1, _super); function B1() { return _super !== null && _super.apply(this, arguments) || this; @@ -36,7 +36,7 @@ var B1 = (function (_super) { }; return B1; }(React.Component)); -var B = (function (_super) { +var B = /** @class */ (function (_super) { __extends(B, _super); function B() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/tsxGenericAttributesType4.js b/tests/baselines/reference/tsxGenericAttributesType4.js index a00d03cd61bf0..1f8c9a631c016 100644 --- a/tests/baselines/reference/tsxGenericAttributesType4.js +++ b/tests/baselines/reference/tsxGenericAttributesType4.js @@ -27,7 +27,7 @@ var __extends = (this && this.__extends) || (function () { })(); exports.__esModule = true; var React = require("react"); -var B1 = (function (_super) { +var B1 = /** @class */ (function (_super) { __extends(B1, _super); function B1() { return _super !== null && _super.apply(this, arguments) || this; @@ -37,7 +37,7 @@ var B1 = (function (_super) { }; return B1; }(React.Component)); -var B = (function (_super) { +var B = /** @class */ (function (_super) { __extends(B, _super); function B() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/tsxGenericAttributesType5.js b/tests/baselines/reference/tsxGenericAttributesType5.js index cb535417dd661..402ed461a4fdc 100644 --- a/tests/baselines/reference/tsxGenericAttributesType5.js +++ b/tests/baselines/reference/tsxGenericAttributesType5.js @@ -28,7 +28,7 @@ var __extends = (this && this.__extends) || (function () { })(); exports.__esModule = true; var React = require("react"); -var B1 = (function (_super) { +var B1 = /** @class */ (function (_super) { __extends(B1, _super); function B1() { return _super !== null && _super.apply(this, arguments) || this; @@ -38,7 +38,7 @@ var B1 = (function (_super) { }; return B1; }(React.Component)); -var B = (function (_super) { +var B = /** @class */ (function (_super) { __extends(B, _super); function B() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/tsxGenericAttributesType6.js b/tests/baselines/reference/tsxGenericAttributesType6.js index 84cab3e1f94b2..cc65bd1fbb683 100644 --- a/tests/baselines/reference/tsxGenericAttributesType6.js +++ b/tests/baselines/reference/tsxGenericAttributesType6.js @@ -27,7 +27,7 @@ var __extends = (this && this.__extends) || (function () { })(); exports.__esModule = true; var React = require("react"); -var B1 = (function (_super) { +var B1 = /** @class */ (function (_super) { __extends(B1, _super); function B1() { return _super !== null && _super.apply(this, arguments) || this; @@ -37,7 +37,7 @@ var B1 = (function (_super) { }; return B1; }(React.Component)); -var B = (function (_super) { +var B = /** @class */ (function (_super) { __extends(B, _super); function B() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/tsxGenericAttributesType9.js b/tests/baselines/reference/tsxGenericAttributesType9.js index c53a8de520e52..18e516ad6b66d 100644 --- a/tests/baselines/reference/tsxGenericAttributesType9.js +++ b/tests/baselines/reference/tsxGenericAttributesType9.js @@ -28,7 +28,7 @@ var __extends = (this && this.__extends) || (function () { exports.__esModule = true; var React = require("react"); function makeP(Ctor) { - return (function (_super) { + return /** @class */ (function (_super) { __extends(class_1, _super); function class_1() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/tsxReactEmit1.js b/tests/baselines/reference/tsxReactEmit1.js index 20a91b3fe89e0..80b3c52ee20ed 100644 --- a/tests/baselines/reference/tsxReactEmit1.js +++ b/tests/baselines/reference/tsxReactEmit1.js @@ -55,7 +55,7 @@ var openClosed2 = React.createElement("div", { n: 'm' }, "foo"); var openClosed3 = React.createElement("div", { n: 'm' }, p); var openClosed4 = React.createElement("div", { n: 'm' }, p < p); var openClosed5 = React.createElement("div", { n: 'm', b: true }, p > p); -var SomeClass = (function () { +var SomeClass = /** @class */ (function () { function SomeClass() { } SomeClass.prototype.f = function () { diff --git a/tests/baselines/reference/tsxSpreadAttributesResolution1.js b/tests/baselines/reference/tsxSpreadAttributesResolution1.js index 7d83e9bd39067..2333dcb9db6c0 100644 --- a/tests/baselines/reference/tsxSpreadAttributesResolution1.js +++ b/tests/baselines/reference/tsxSpreadAttributesResolution1.js @@ -28,7 +28,7 @@ var __extends = (this && this.__extends) || (function () { })(); exports.__esModule = true; var React = require("react"); -var Poisoned = (function (_super) { +var Poisoned = /** @class */ (function (_super) { __extends(Poisoned, _super); function Poisoned() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/tsxSpreadAttributesResolution10.js b/tests/baselines/reference/tsxSpreadAttributesResolution10.js index f8d56f608de9f..ef9e7cf039fed 100644 --- a/tests/baselines/reference/tsxSpreadAttributesResolution10.js +++ b/tests/baselines/reference/tsxSpreadAttributesResolution10.js @@ -37,7 +37,7 @@ var __extends = (this && this.__extends) || (function () { })(); exports.__esModule = true; var React = require("react"); -var Opt = (function (_super) { +var Opt = /** @class */ (function (_super) { __extends(Opt, _super); function Opt() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/tsxSpreadAttributesResolution11.js b/tests/baselines/reference/tsxSpreadAttributesResolution11.js index 44e2dcd529211..4517eab96ca78 100644 --- a/tests/baselines/reference/tsxSpreadAttributesResolution11.js +++ b/tests/baselines/reference/tsxSpreadAttributesResolution11.js @@ -53,7 +53,7 @@ var obj3 = { y: true, overwrite: "hi" }; -var OverWriteAttr = (function (_super) { +var OverWriteAttr = /** @class */ (function (_super) { __extends(OverWriteAttr, _super); function OverWriteAttr() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/tsxSpreadAttributesResolution12.js b/tests/baselines/reference/tsxSpreadAttributesResolution12.js index a68755a7592d2..3ccf0e45bc372 100644 --- a/tests/baselines/reference/tsxSpreadAttributesResolution12.js +++ b/tests/baselines/reference/tsxSpreadAttributesResolution12.js @@ -54,7 +54,7 @@ var obj3 = { y: false, overwrite: "hi" }; -var OverWriteAttr = (function (_super) { +var OverWriteAttr = /** @class */ (function (_super) { __extends(OverWriteAttr, _super); function OverWriteAttr() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/tsxSpreadAttributesResolution2.js b/tests/baselines/reference/tsxSpreadAttributesResolution2.js index ad2af27548582..39b2387214df1 100644 --- a/tests/baselines/reference/tsxSpreadAttributesResolution2.js +++ b/tests/baselines/reference/tsxSpreadAttributesResolution2.js @@ -35,7 +35,7 @@ var __extends = (this && this.__extends) || (function () { })(); exports.__esModule = true; var React = require("react"); -var Poisoned = (function (_super) { +var Poisoned = /** @class */ (function (_super) { __extends(Poisoned, _super); function Poisoned() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/tsxSpreadAttributesResolution3.js b/tests/baselines/reference/tsxSpreadAttributesResolution3.js index e2e0f38da0d51..01ea2b148cec5 100644 --- a/tests/baselines/reference/tsxSpreadAttributesResolution3.js +++ b/tests/baselines/reference/tsxSpreadAttributesResolution3.js @@ -35,7 +35,7 @@ var __extends = (this && this.__extends) || (function () { })(); exports.__esModule = true; var React = require("react"); -var Poisoned = (function (_super) { +var Poisoned = /** @class */ (function (_super) { __extends(Poisoned, _super); function Poisoned() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/tsxSpreadAttributesResolution4.js b/tests/baselines/reference/tsxSpreadAttributesResolution4.js index 3ac18a7c21931..94b28a2764149 100644 --- a/tests/baselines/reference/tsxSpreadAttributesResolution4.js +++ b/tests/baselines/reference/tsxSpreadAttributesResolution4.js @@ -49,7 +49,7 @@ var __extends = (this && this.__extends) || (function () { var _this = this; exports.__esModule = true; var React = require("react"); -var Poisoned = (function (_super) { +var Poisoned = /** @class */ (function (_super) { __extends(Poisoned, _super); function Poisoned() { return _super !== null && _super.apply(this, arguments) || this; @@ -65,7 +65,7 @@ var obj = { }; // OK var p = ; -var EmptyProp = (function (_super) { +var EmptyProp = /** @class */ (function (_super) { __extends(EmptyProp, _super); function EmptyProp() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/tsxSpreadAttributesResolution5.js b/tests/baselines/reference/tsxSpreadAttributesResolution5.js index 192f4b78770bd..949c1614b1cf9 100644 --- a/tests/baselines/reference/tsxSpreadAttributesResolution5.js +++ b/tests/baselines/reference/tsxSpreadAttributesResolution5.js @@ -47,7 +47,7 @@ var __extends = (this && this.__extends) || (function () { })(); exports.__esModule = true; var React = require("react"); -var Poisoned = (function (_super) { +var Poisoned = /** @class */ (function (_super) { __extends(Poisoned, _super); function Poisoned() { return _super !== null && _super.apply(this, arguments) || this; @@ -63,7 +63,7 @@ var obj = { }; // Error as "obj" has type { x: string; y: number } var p = ; -var EmptyProp = (function (_super) { +var EmptyProp = /** @class */ (function (_super) { __extends(EmptyProp, _super); function EmptyProp() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/tsxSpreadAttributesResolution6.js b/tests/baselines/reference/tsxSpreadAttributesResolution6.js index e6d714a670507..1265378d129c4 100644 --- a/tests/baselines/reference/tsxSpreadAttributesResolution6.js +++ b/tests/baselines/reference/tsxSpreadAttributesResolution6.js @@ -31,7 +31,7 @@ var __extends = (this && this.__extends) || (function () { })(); exports.__esModule = true; var React = require("react"); -var TextComponent = (function (_super) { +var TextComponent = /** @class */ (function (_super) { __extends(TextComponent, _super); function TextComponent() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/tsxSpreadAttributesResolution7.js b/tests/baselines/reference/tsxSpreadAttributesResolution7.js index d93e2e80a9242..f140df0e9d248 100644 --- a/tests/baselines/reference/tsxSpreadAttributesResolution7.js +++ b/tests/baselines/reference/tsxSpreadAttributesResolution7.js @@ -38,7 +38,7 @@ var __extends = (this && this.__extends) || (function () { })(); exports.__esModule = true; var React = require("react"); -var TextComponent = (function (_super) { +var TextComponent = /** @class */ (function (_super) { __extends(TextComponent, _super); function TextComponent() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/tsxSpreadAttributesResolution8.js b/tests/baselines/reference/tsxSpreadAttributesResolution8.js index 9b07fa5e903bc..d8aad9952dd8f 100644 --- a/tests/baselines/reference/tsxSpreadAttributesResolution8.js +++ b/tests/baselines/reference/tsxSpreadAttributesResolution8.js @@ -48,7 +48,7 @@ var obj3 = { y: true, overwrite: "hi" }; -var OverWriteAttr = (function (_super) { +var OverWriteAttr = /** @class */ (function (_super) { __extends(OverWriteAttr, _super); function OverWriteAttr() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/tsxSpreadAttributesResolution9.js b/tests/baselines/reference/tsxSpreadAttributesResolution9.js index c7379ab2db1d9..890a686d26633 100644 --- a/tests/baselines/reference/tsxSpreadAttributesResolution9.js +++ b/tests/baselines/reference/tsxSpreadAttributesResolution9.js @@ -38,7 +38,7 @@ var __extends = (this && this.__extends) || (function () { })(); exports.__esModule = true; var React = require("react"); -var Opt = (function (_super) { +var Opt = /** @class */ (function (_super) { __extends(Opt, _super); function Opt() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/tsxStatelessFunctionComponents2.js b/tests/baselines/reference/tsxStatelessFunctionComponents2.js index 90112ef1f139a..73cbeaed8a1eb 100644 --- a/tests/baselines/reference/tsxStatelessFunctionComponents2.js +++ b/tests/baselines/reference/tsxStatelessFunctionComponents2.js @@ -54,7 +54,7 @@ var React = require("react"); function Greet(x) { return
Hello, {x}
; } -var BigGreeter = (function (_super) { +var BigGreeter = /** @class */ (function (_super) { __extends(BigGreeter, _super); function BigGreeter() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/tsxTypeErrors.js b/tests/baselines/reference/tsxTypeErrors.js index 690503e075d3b..80ec56592674a 100644 --- a/tests/baselines/reference/tsxTypeErrors.js +++ b/tests/baselines/reference/tsxTypeErrors.js @@ -44,7 +44,7 @@ var a3 =
; // Mistyped html name (error) var e1 = ; // A custom type -var MyClass = (function () { +var MyClass = /** @class */ (function () { function MyClass() { } return MyClass; diff --git a/tests/baselines/reference/tsxUnionElementType3.js b/tests/baselines/reference/tsxUnionElementType3.js index 7724c9aebae00..12ded8bb127e5 100644 --- a/tests/baselines/reference/tsxUnionElementType3.js +++ b/tests/baselines/reference/tsxUnionElementType3.js @@ -50,7 +50,7 @@ var __extends = (this && this.__extends) || (function () { })(); exports.__esModule = true; var React = require("react"); -var RC1 = (function (_super) { +var RC1 = /** @class */ (function (_super) { __extends(RC1, _super); function RC1() { return _super !== null && _super.apply(this, arguments) || this; @@ -60,7 +60,7 @@ var RC1 = (function (_super) { }; return RC1; }(React.Component)); -var RC2 = (function (_super) { +var RC2 = /** @class */ (function (_super) { __extends(RC2, _super); function RC2() { return _super !== null && _super.apply(this, arguments) || this; @@ -71,7 +71,7 @@ var RC2 = (function (_super) { RC2.prototype.method = function () { }; return RC2; }(React.Component)); -var RC3 = (function (_super) { +var RC3 = /** @class */ (function (_super) { __extends(RC3, _super); function RC3() { return _super !== null && _super.apply(this, arguments) || this; @@ -81,7 +81,7 @@ var RC3 = (function (_super) { }; return RC3; }(React.Component)); -var RC4 = (function (_super) { +var RC4 = /** @class */ (function (_super) { __extends(RC4, _super); function RC4() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/tsxUnionElementType4.js b/tests/baselines/reference/tsxUnionElementType4.js index c09dcb522002d..d67fa22988dfb 100644 --- a/tests/baselines/reference/tsxUnionElementType4.js +++ b/tests/baselines/reference/tsxUnionElementType4.js @@ -49,7 +49,7 @@ var __extends = (this && this.__extends) || (function () { })(); exports.__esModule = true; var React = require("react"); -var RC1 = (function (_super) { +var RC1 = /** @class */ (function (_super) { __extends(RC1, _super); function RC1() { return _super !== null && _super.apply(this, arguments) || this; @@ -59,7 +59,7 @@ var RC1 = (function (_super) { }; return RC1; }(React.Component)); -var RC2 = (function (_super) { +var RC2 = /** @class */ (function (_super) { __extends(RC2, _super); function RC2() { return _super !== null && _super.apply(this, arguments) || this; @@ -70,7 +70,7 @@ var RC2 = (function (_super) { RC2.prototype.method = function () { }; return RC2; }(React.Component)); -var RC3 = (function (_super) { +var RC3 = /** @class */ (function (_super) { __extends(RC3, _super); function RC3() { return _super !== null && _super.apply(this, arguments) || this; @@ -80,7 +80,7 @@ var RC3 = (function (_super) { }; return RC3; }(React.Component)); -var RC4 = (function (_super) { +var RC4 = /** @class */ (function (_super) { __extends(RC4, _super); function RC4() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/tsxUnionTypeComponent1.js b/tests/baselines/reference/tsxUnionTypeComponent1.js index 7c5349cdc5f85..1d1e2b521ec37 100644 --- a/tests/baselines/reference/tsxUnionTypeComponent1.js +++ b/tests/baselines/reference/tsxUnionTypeComponent1.js @@ -37,7 +37,7 @@ var __extends = (this && this.__extends) || (function () { })(); exports.__esModule = true; var React = require("react"); -var MyComponent = (function (_super) { +var MyComponent = /** @class */ (function (_super) { __extends(MyComponent, _super); function MyComponent() { return _super !== null && _super.apply(this, arguments) || this; @@ -51,7 +51,7 @@ var MyComponent = (function (_super) { // Stateless Component As Props React.createElement(MyComponent, { AnyComponent: function () { return React.createElement("button", null, "test"); } }); // Component Class as Props -var MyButtonComponent = (function (_super) { +var MyButtonComponent = /** @class */ (function (_super) { __extends(MyButtonComponent, _super); function MyButtonComponent() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/twoAccessorsWithSameName.js b/tests/baselines/reference/twoAccessorsWithSameName.js index 0021c5ac13186..4bc385652c47e 100644 --- a/tests/baselines/reference/twoAccessorsWithSameName.js +++ b/tests/baselines/reference/twoAccessorsWithSameName.js @@ -35,7 +35,7 @@ var y = { } //// [twoAccessorsWithSameName.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } Object.defineProperty(C.prototype, "x", { @@ -45,7 +45,7 @@ var C = (function () { }); return C; }()); -var D = (function () { +var D = /** @class */ (function () { function D() { } Object.defineProperty(D.prototype, "x", { @@ -55,7 +55,7 @@ var D = (function () { }); return D; }()); -var E = (function () { +var E = /** @class */ (function () { function E() { } Object.defineProperty(E.prototype, "x", { diff --git a/tests/baselines/reference/twoAccessorsWithSameName2.js b/tests/baselines/reference/twoAccessorsWithSameName2.js index 12210f49daeb6..449adca8bf2b8 100644 --- a/tests/baselines/reference/twoAccessorsWithSameName2.js +++ b/tests/baselines/reference/twoAccessorsWithSameName2.js @@ -17,7 +17,7 @@ class E { } //// [twoAccessorsWithSameName2.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } Object.defineProperty(C, "x", { @@ -27,7 +27,7 @@ var C = (function () { }); return C; }()); -var D = (function () { +var D = /** @class */ (function () { function D() { } Object.defineProperty(D, "x", { @@ -37,7 +37,7 @@ var D = (function () { }); return D; }()); -var E = (function () { +var E = /** @class */ (function () { function E() { } Object.defineProperty(E, "x", { diff --git a/tests/baselines/reference/typeAliases.js b/tests/baselines/reference/typeAliases.js index fd63fc6ca4afd..a2df358ca3f40 100644 --- a/tests/baselines/reference/typeAliases.js +++ b/tests/baselines/reference/typeAliases.js @@ -94,7 +94,7 @@ var x5; var x5; var x6; var x6; -var C7 = (function () { +var C7 = /** @class */ (function () { function C7() { } return C7; diff --git a/tests/baselines/reference/typeAliasesForObjectTypes.js b/tests/baselines/reference/typeAliasesForObjectTypes.js index 0c78e7f42a4a8..d67f57ec2ae67 100644 --- a/tests/baselines/reference/typeAliasesForObjectTypes.js +++ b/tests/baselines/reference/typeAliasesForObjectTypes.js @@ -16,7 +16,7 @@ type T3 = { x: T } //// [typeAliasesForObjectTypes.js] -var C1 = (function () { +var C1 = /** @class */ (function () { function C1() { } return C1; diff --git a/tests/baselines/reference/typeArgumentInferenceOrdering.js b/tests/baselines/reference/typeArgumentInferenceOrdering.js index f7a46c843857a..54be99736b60e 100644 --- a/tests/baselines/reference/typeArgumentInferenceOrdering.js +++ b/tests/baselines/reference/typeArgumentInferenceOrdering.js @@ -15,7 +15,7 @@ function foo(f: { y: T }): T { return null } var x = foo(new C()).x; // was Error that property x does not exist on type {} //// [typeArgumentInferenceOrdering.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } return C; diff --git a/tests/baselines/reference/typeArgumentInferenceWithClassExpression1.js b/tests/baselines/reference/typeArgumentInferenceWithClassExpression1.js index 44b37cc3be568..6bd71b160bb3b 100644 --- a/tests/baselines/reference/typeArgumentInferenceWithClassExpression1.js +++ b/tests/baselines/reference/typeArgumentInferenceWithClassExpression1.js @@ -7,14 +7,14 @@ foo(class { static prop = "hello" }).length; //// [typeArgumentInferenceWithClassExpression1.js] function foo(x) { - if (x === void 0) { x = (function () { + if (x === void 0) { x = /** @class */ (function () { function class_1() { } return class_1; }()); } return undefined; } -foo((_a = (function () { +foo((_a = /** @class */ (function () { function class_2() { } return class_2; diff --git a/tests/baselines/reference/typeArgumentInferenceWithClassExpression2.js b/tests/baselines/reference/typeArgumentInferenceWithClassExpression2.js index bd221a3013733..102c1ee78bc85 100644 --- a/tests/baselines/reference/typeArgumentInferenceWithClassExpression2.js +++ b/tests/baselines/reference/typeArgumentInferenceWithClassExpression2.js @@ -8,7 +8,7 @@ foo(class { static prop = "hello" }).length; //// [typeArgumentInferenceWithClassExpression2.js] function foo(x) { - if (x === void 0) { x = (function () { + if (x === void 0) { x = /** @class */ (function () { function class_1() { } return class_1; @@ -16,7 +16,7 @@ function foo(x) { return undefined; } // Should not infer string because it is a static property -foo((_a = (function () { +foo((_a = /** @class */ (function () { function class_2() { } return class_2; diff --git a/tests/baselines/reference/typeArgumentInferenceWithClassExpression3.js b/tests/baselines/reference/typeArgumentInferenceWithClassExpression3.js index 1fb9cf8c3cf1a..601fe599436bd 100644 --- a/tests/baselines/reference/typeArgumentInferenceWithClassExpression3.js +++ b/tests/baselines/reference/typeArgumentInferenceWithClassExpression3.js @@ -7,14 +7,14 @@ foo(class { prop = "hello" }).length; //// [typeArgumentInferenceWithClassExpression3.js] function foo(x) { - if (x === void 0) { x = (function () { + if (x === void 0) { x = /** @class */ (function () { function class_1() { } return class_1; }()); } return undefined; } -foo((function () { +foo(/** @class */ (function () { function class_2() { this.prop = "hello"; } diff --git a/tests/baselines/reference/typeAssertions.js b/tests/baselines/reference/typeAssertions.js index 694fc617c5b7a..349b06b40f6d4 100644 --- a/tests/baselines/reference/typeAssertions.js +++ b/tests/baselines/reference/typeAssertions.js @@ -71,19 +71,19 @@ var s; // Type assertion of non - unary expression var a = "" + 4; var s = "" + 4; -var SomeBase = (function () { +var SomeBase = /** @class */ (function () { function SomeBase() { } return SomeBase; }()); -var SomeDerived = (function (_super) { +var SomeDerived = /** @class */ (function (_super) { __extends(SomeDerived, _super); function SomeDerived() { return _super !== null && _super.apply(this, arguments) || this; } return SomeDerived; }(SomeBase)); -var SomeOther = (function () { +var SomeOther = /** @class */ (function () { function SomeOther() { } return SomeOther; diff --git a/tests/baselines/reference/typeCheckTypeArgument.js b/tests/baselines/reference/typeCheckTypeArgument.js index d4db194a1f9d3..f5e03b554589d 100644 --- a/tests/baselines/reference/typeCheckTypeArgument.js +++ b/tests/baselines/reference/typeCheckTypeArgument.js @@ -15,13 +15,13 @@ class Foo2 { //// [typeCheckTypeArgument.js] var f; -var Foo = (function () { +var Foo = /** @class */ (function () { function Foo() { } return Foo; }()); function bar() { } -var Foo2 = (function () { +var Foo2 = /** @class */ (function () { function Foo2() { } Foo2.prototype.method = function () { }; diff --git a/tests/baselines/reference/typeConstraintsWithConstructSignatures.js b/tests/baselines/reference/typeConstraintsWithConstructSignatures.js index b5d2574834a51..0cc2449a3a6ec 100644 --- a/tests/baselines/reference/typeConstraintsWithConstructSignatures.js +++ b/tests/baselines/reference/typeConstraintsWithConstructSignatures.js @@ -13,7 +13,7 @@ class C { //// [typeConstraintsWithConstructSignatures.js] -var C = (function () { +var C = /** @class */ (function () { function C(data, data2) { this.data = data; this.data2 = data2; diff --git a/tests/baselines/reference/typeGuardFunction.js b/tests/baselines/reference/typeGuardFunction.js index 20518ddab2156..7050ac64620bc 100644 --- a/tests/baselines/reference/typeGuardFunction.js +++ b/tests/baselines/reference/typeGuardFunction.js @@ -93,17 +93,17 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var A = (function () { +var A = /** @class */ (function () { function A() { } return A; }()); -var B = (function () { +var B = /** @class */ (function () { function B() { } return B; }()); -var C = (function (_super) { +var C = /** @class */ (function (_super) { __extends(C, _super); function C() { return _super !== null && _super.apply(this, arguments) || this; @@ -131,7 +131,7 @@ if (isC_multipleParams(a, 0)) { } // Methods var obj; -var D = (function () { +var D = /** @class */ (function () { function D() { } D.prototype.method1 = function (p1) { diff --git a/tests/baselines/reference/typeGuardFunctionErrors.js b/tests/baselines/reference/typeGuardFunctionErrors.js index cc773ae11b166..c147fcf2ce1fa 100644 --- a/tests/baselines/reference/typeGuardFunctionErrors.js +++ b/tests/baselines/reference/typeGuardFunctionErrors.js @@ -155,17 +155,17 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var A = (function () { +var A = /** @class */ (function () { function A() { } return A; }()); -var B = (function () { +var B = /** @class */ (function () { function B() { } return B; }()); -var C = (function (_super) { +var C = /** @class */ (function (_super) { __extends(C, _super); function C() { return _super !== null && _super.apply(this, arguments) || this; @@ -242,7 +242,7 @@ A; } ; // Non-compatiable type predicate positions for signature declarations -var D = (function () { +var D = /** @class */ (function () { function D(p1) { return true; } diff --git a/tests/baselines/reference/typeGuardFunctionGenerics.js b/tests/baselines/reference/typeGuardFunctionGenerics.js index 56d1f9361ae86..702803d62bbca 100644 --- a/tests/baselines/reference/typeGuardFunctionGenerics.js +++ b/tests/baselines/reference/typeGuardFunctionGenerics.js @@ -43,17 +43,17 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var A = (function () { +var A = /** @class */ (function () { function A() { } return A; }()); -var B = (function () { +var B = /** @class */ (function () { function B() { } return B; }()); -var C = (function (_super) { +var C = /** @class */ (function (_super) { __extends(C, _super); function C() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/typeGuardFunctionOfFormThis.js b/tests/baselines/reference/typeGuardFunctionOfFormThis.js index 7ebee44cc307b..7b22c303a1e91 100644 --- a/tests/baselines/reference/typeGuardFunctionOfFormThis.js +++ b/tests/baselines/reference/typeGuardFunctionOfFormThis.js @@ -152,7 +152,7 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var RoyalGuard = (function () { +var RoyalGuard = /** @class */ (function () { function RoyalGuard() { } RoyalGuard.prototype.isLeader = function () { @@ -163,7 +163,7 @@ var RoyalGuard = (function () { }; return RoyalGuard; }()); -var LeadGuard = (function (_super) { +var LeadGuard = /** @class */ (function (_super) { __extends(LeadGuard, _super); function LeadGuard() { return _super !== null && _super.apply(this, arguments) || this; @@ -172,7 +172,7 @@ var LeadGuard = (function (_super) { ; return LeadGuard; }(RoyalGuard)); -var FollowerGuard = (function (_super) { +var FollowerGuard = /** @class */ (function (_super) { __extends(FollowerGuard, _super); function FollowerGuard() { return _super !== null && _super.apply(this, arguments) || this; @@ -214,7 +214,7 @@ if (holder2.a.isLeader()) { else { holder2.a; } -var ArrowGuard = (function () { +var ArrowGuard = /** @class */ (function () { function ArrowGuard() { var _this = this; this.isElite = function () { @@ -226,7 +226,7 @@ var ArrowGuard = (function () { } return ArrowGuard; }()); -var ArrowElite = (function (_super) { +var ArrowElite = /** @class */ (function (_super) { __extends(ArrowElite, _super); function ArrowElite() { return _super !== null && _super.apply(this, arguments) || this; @@ -234,7 +234,7 @@ var ArrowElite = (function (_super) { ArrowElite.prototype.defend = function () { }; return ArrowElite; }(ArrowGuard)); -var ArrowMedic = (function (_super) { +var ArrowMedic = /** @class */ (function (_super) { __extends(ArrowMedic, _super); function ArrowMedic() { return _super !== null && _super.apply(this, arguments) || this; @@ -259,7 +259,7 @@ else if (crate.isSupplies()) { // Matching guards should be assignable a.isFollower = b.isFollower; a.isLeader = b.isLeader; -var MimicGuard = (function () { +var MimicGuard = /** @class */ (function () { function MimicGuard() { } MimicGuard.prototype.isLeader = function () { return this instanceof MimicLeader; }; @@ -268,7 +268,7 @@ var MimicGuard = (function () { ; return MimicGuard; }()); -var MimicLeader = (function (_super) { +var MimicLeader = /** @class */ (function (_super) { __extends(MimicLeader, _super); function MimicLeader() { return _super !== null && _super.apply(this, arguments) || this; @@ -276,7 +276,7 @@ var MimicLeader = (function (_super) { MimicLeader.prototype.lead = function () { }; return MimicLeader; }(MimicGuard)); -var MimicFollower = (function (_super) { +var MimicFollower = /** @class */ (function (_super) { __extends(MimicFollower, _super); function MimicFollower() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/typeGuardFunctionOfFormThisErrors.js b/tests/baselines/reference/typeGuardFunctionOfFormThisErrors.js index e25c9a2dc9d74..84db5d4a4a9c6 100644 --- a/tests/baselines/reference/typeGuardFunctionOfFormThisErrors.js +++ b/tests/baselines/reference/typeGuardFunctionOfFormThisErrors.js @@ -70,7 +70,7 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var RoyalGuard = (function () { +var RoyalGuard = /** @class */ (function () { function RoyalGuard() { } RoyalGuard.prototype.isLeader = function () { @@ -81,7 +81,7 @@ var RoyalGuard = (function () { }; return RoyalGuard; }()); -var LeadGuard = (function (_super) { +var LeadGuard = /** @class */ (function (_super) { __extends(LeadGuard, _super); function LeadGuard() { return _super !== null && _super.apply(this, arguments) || this; @@ -90,7 +90,7 @@ var LeadGuard = (function (_super) { ; return LeadGuard; }(RoyalGuard)); -var FollowerGuard = (function (_super) { +var FollowerGuard = /** @class */ (function (_super) { __extends(FollowerGuard, _super); function FollowerGuard() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/typeGuardInClass.js b/tests/baselines/reference/typeGuardInClass.js index 4d3eac9d0e387..34be96895538c 100644 --- a/tests/baselines/reference/typeGuardInClass.js +++ b/tests/baselines/reference/typeGuardInClass.js @@ -20,7 +20,7 @@ else { //// [typeGuardInClass.js] var x; if (typeof x === "string") { - var n = (function () { + var n = /** @class */ (function () { function class_1() { var y = x; } @@ -28,7 +28,7 @@ if (typeof x === "string") { }()); } else { - var m = (function () { + var m = /** @class */ (function () { function class_2() { var y = x; } diff --git a/tests/baselines/reference/typeGuardOfFormExpr1AndExpr2.js b/tests/baselines/reference/typeGuardOfFormExpr1AndExpr2.js index 5724c218ad33a..01d4b9a2eaab7 100644 --- a/tests/baselines/reference/typeGuardOfFormExpr1AndExpr2.js +++ b/tests/baselines/reference/typeGuardOfFormExpr1AndExpr2.js @@ -53,7 +53,7 @@ var num; var strOrNum; var strOrNumOrBool; var numOrBool; -var C = (function () { +var C = /** @class */ (function () { function C() { } return C; diff --git a/tests/baselines/reference/typeGuardOfFormExpr1OrExpr2.js b/tests/baselines/reference/typeGuardOfFormExpr1OrExpr2.js index 78a6e7732fb6f..c0eed2313f163 100644 --- a/tests/baselines/reference/typeGuardOfFormExpr1OrExpr2.js +++ b/tests/baselines/reference/typeGuardOfFormExpr1OrExpr2.js @@ -53,7 +53,7 @@ var num; var strOrNum; var strOrNumOrBool; var numOrBool; -var C = (function () { +var C = /** @class */ (function () { function C() { } return C; diff --git a/tests/baselines/reference/typeGuardOfFormInstanceOf.js b/tests/baselines/reference/typeGuardOfFormInstanceOf.js index 1c11ce87d66c8..562a9f85f84e4 100644 --- a/tests/baselines/reference/typeGuardOfFormInstanceOf.js +++ b/tests/baselines/reference/typeGuardOfFormInstanceOf.js @@ -83,24 +83,24 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var C1 = (function () { +var C1 = /** @class */ (function () { function C1() { } return C1; }()); -var C2 = (function () { +var C2 = /** @class */ (function () { function C2() { } return C2; }()); -var D1 = (function (_super) { +var D1 = /** @class */ (function (_super) { __extends(D1, _super); function D1() { return _super !== null && _super.apply(this, arguments) || this; } return D1; }(C1)); -var C3 = (function () { +var C3 = /** @class */ (function () { function C3() { } return C3; diff --git a/tests/baselines/reference/typeGuardOfFormIsType.js b/tests/baselines/reference/typeGuardOfFormIsType.js index a8ea6272c6265..cc569309196d4 100644 --- a/tests/baselines/reference/typeGuardOfFormIsType.js +++ b/tests/baselines/reference/typeGuardOfFormIsType.js @@ -47,17 +47,17 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var C1 = (function () { +var C1 = /** @class */ (function () { function C1() { } return C1; }()); -var C2 = (function () { +var C2 = /** @class */ (function () { function C2() { } return C2; }()); -var D1 = (function (_super) { +var D1 = /** @class */ (function (_super) { __extends(D1, _super); function D1() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/typeGuardOfFormThisMember.js b/tests/baselines/reference/typeGuardOfFormThisMember.js index ef9e51d7a775f..59888d63a2d9a 100644 --- a/tests/baselines/reference/typeGuardOfFormThisMember.js +++ b/tests/baselines/reference/typeGuardOfFormThisMember.js @@ -96,7 +96,7 @@ var __extends = (this && this.__extends) || (function () { // There's a 'File' class in the stdlib, wrap with a namespace to avoid collision var Test; (function (Test) { - var FileSystemObject = (function () { + var FileSystemObject = /** @class */ (function () { function FileSystemObject(path) { this.path = path; } @@ -120,7 +120,7 @@ var Test; return FileSystemObject; }()); Test.FileSystemObject = FileSystemObject; - var File = (function (_super) { + var File = /** @class */ (function (_super) { __extends(File, _super); function File(path, content) { var _this = _super.call(this, path) || this; @@ -130,7 +130,7 @@ var Test; return File; }(FileSystemObject)); Test.File = File; - var Directory = (function (_super) { + var Directory = /** @class */ (function (_super) { __extends(Directory, _super); function Directory() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/typeGuardOfFormThisMemberErrors.js b/tests/baselines/reference/typeGuardOfFormThisMemberErrors.js index 5dc77a29ec20c..115fc248b7081 100644 --- a/tests/baselines/reference/typeGuardOfFormThisMemberErrors.js +++ b/tests/baselines/reference/typeGuardOfFormThisMemberErrors.js @@ -46,7 +46,7 @@ var __extends = (this && this.__extends) || (function () { // There's a 'File' class in the stdlib, wrap with a namespace to avoid collision var Test; (function (Test) { - var FileSystemObject = (function () { + var FileSystemObject = /** @class */ (function () { function FileSystemObject(path) { this.path = path; } @@ -70,7 +70,7 @@ var Test; return FileSystemObject; }()); Test.FileSystemObject = FileSystemObject; - var File = (function (_super) { + var File = /** @class */ (function (_super) { __extends(File, _super); function File(path, content) { var _this = _super.call(this, path) || this; @@ -80,7 +80,7 @@ var Test; return File; }(FileSystemObject)); Test.File = File; - var Directory = (function (_super) { + var Directory = /** @class */ (function (_super) { __extends(Directory, _super); function Directory() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/typeGuardOfFormTypeOfBoolean.js b/tests/baselines/reference/typeGuardOfFormTypeOfBoolean.js index 7d68b89337300..a8b056b5da2cf 100644 --- a/tests/baselines/reference/typeGuardOfFormTypeOfBoolean.js +++ b/tests/baselines/reference/typeGuardOfFormTypeOfBoolean.js @@ -87,7 +87,7 @@ else { //// [typeGuardOfFormTypeOfBoolean.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } return C; diff --git a/tests/baselines/reference/typeGuardOfFormTypeOfEqualEqualHasNoEffect.js b/tests/baselines/reference/typeGuardOfFormTypeOfEqualEqualHasNoEffect.js index b3a3b8028ec69..1e805436bc210 100644 --- a/tests/baselines/reference/typeGuardOfFormTypeOfEqualEqualHasNoEffect.js +++ b/tests/baselines/reference/typeGuardOfFormTypeOfEqualEqualHasNoEffect.js @@ -36,7 +36,7 @@ else { } //// [typeGuardOfFormTypeOfEqualEqualHasNoEffect.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } return C; diff --git a/tests/baselines/reference/typeGuardOfFormTypeOfNotEqualHasNoEffect.js b/tests/baselines/reference/typeGuardOfFormTypeOfNotEqualHasNoEffect.js index 3c095f195071d..71bfed7060424 100644 --- a/tests/baselines/reference/typeGuardOfFormTypeOfNotEqualHasNoEffect.js +++ b/tests/baselines/reference/typeGuardOfFormTypeOfNotEqualHasNoEffect.js @@ -36,7 +36,7 @@ else { } //// [typeGuardOfFormTypeOfNotEqualHasNoEffect.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } return C; diff --git a/tests/baselines/reference/typeGuardOfFormTypeOfNumber.js b/tests/baselines/reference/typeGuardOfFormTypeOfNumber.js index 3bea6e87d2b29..55f16dda01d71 100644 --- a/tests/baselines/reference/typeGuardOfFormTypeOfNumber.js +++ b/tests/baselines/reference/typeGuardOfFormTypeOfNumber.js @@ -86,7 +86,7 @@ else { //// [typeGuardOfFormTypeOfNumber.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } return C; diff --git a/tests/baselines/reference/typeGuardOfFormTypeOfOther.js b/tests/baselines/reference/typeGuardOfFormTypeOfOther.js index 571edc7e5a2e8..49d751fc55537 100644 --- a/tests/baselines/reference/typeGuardOfFormTypeOfOther.js +++ b/tests/baselines/reference/typeGuardOfFormTypeOfOther.js @@ -82,7 +82,7 @@ else { //// [typeGuardOfFormTypeOfOther.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } return C; diff --git a/tests/baselines/reference/typeGuardOfFormTypeOfString.js b/tests/baselines/reference/typeGuardOfFormTypeOfString.js index d79f73a87c5f1..ba7727cfd593a 100644 --- a/tests/baselines/reference/typeGuardOfFormTypeOfString.js +++ b/tests/baselines/reference/typeGuardOfFormTypeOfString.js @@ -86,7 +86,7 @@ else { //// [typeGuardOfFormTypeOfString.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } return C; diff --git a/tests/baselines/reference/typeGuardsInClassAccessors.js b/tests/baselines/reference/typeGuardsInClassAccessors.js index 935f4e0fc392c..fe053e72b9afc 100644 --- a/tests/baselines/reference/typeGuardsInClassAccessors.js +++ b/tests/baselines/reference/typeGuardsInClassAccessors.js @@ -109,7 +109,7 @@ class ClassWithAccessors { var num; var strOrNum; var var1; -var ClassWithAccessors = (function () { +var ClassWithAccessors = /** @class */ (function () { function ClassWithAccessors() { } Object.defineProperty(ClassWithAccessors.prototype, "p1", { diff --git a/tests/baselines/reference/typeGuardsInClassMethods.js b/tests/baselines/reference/typeGuardsInClassMethods.js index f5ad4e6325d81..2e978d960d0d7 100644 --- a/tests/baselines/reference/typeGuardsInClassMethods.js +++ b/tests/baselines/reference/typeGuardsInClassMethods.js @@ -74,7 +74,7 @@ class C1 { // variables in global var num; var var1; -var C1 = (function () { +var C1 = /** @class */ (function () { function C1(param) { // global vars in function declaration num = typeof var1 === "string" && var1.length; // string diff --git a/tests/baselines/reference/typeGuardsInProperties.js b/tests/baselines/reference/typeGuardsInProperties.js index 77d4f3a609665..43828573aa9d8 100644 --- a/tests/baselines/reference/typeGuardsInProperties.js +++ b/tests/baselines/reference/typeGuardsInProperties.js @@ -30,7 +30,7 @@ strOrNum = typeof obj1.x === "string" && obj1.x; // string | number // have no effect on members of objects such as properties. var num; var strOrNum; -var C1 = (function () { +var C1 = /** @class */ (function () { function C1() { } Object.defineProperty(C1.prototype, "pp3", { diff --git a/tests/baselines/reference/typeGuardsNestedAssignments.js b/tests/baselines/reference/typeGuardsNestedAssignments.js index 297f747b30a02..55778a49941a3 100644 --- a/tests/baselines/reference/typeGuardsNestedAssignments.js +++ b/tests/baselines/reference/typeGuardsNestedAssignments.js @@ -46,7 +46,7 @@ while ((match = re.exec("xxx")) != null) { } //// [typeGuardsNestedAssignments.js] -var Foo = (function () { +var Foo = /** @class */ (function () { function Foo() { } return Foo; diff --git a/tests/baselines/reference/typeGuardsOnClassProperty.js b/tests/baselines/reference/typeGuardsOnClassProperty.js index abe031e96e672..accc61a3deb49 100644 --- a/tests/baselines/reference/typeGuardsOnClassProperty.js +++ b/tests/baselines/reference/typeGuardsOnClassProperty.js @@ -33,7 +33,7 @@ if (typeof prop1 === "string" && prop1.toLocaleLowerCase()) { } // have no effect on members of objects such as properties. // Note that the class's property must be copied to a local variable for // the type guard to have an effect -var D = (function () { +var D = /** @class */ (function () { function D() { } D.prototype.getData = function () { diff --git a/tests/baselines/reference/typeGuardsTypeParameters.js b/tests/baselines/reference/typeGuardsTypeParameters.js index a2348ca5d4cc1..724f7a105c9c8 100644 --- a/tests/baselines/reference/typeGuardsTypeParameters.js +++ b/tests/baselines/reference/typeGuardsTypeParameters.js @@ -36,7 +36,7 @@ function fun(item: { [P in keyof T]: T[P] }) { //// [typeGuardsTypeParameters.js] // Type guards involving type parameters produce intersection types -var C = (function () { +var C = /** @class */ (function () { function C() { } return C; diff --git a/tests/baselines/reference/typeIdentityConsidersBrands.js b/tests/baselines/reference/typeIdentityConsidersBrands.js index c3b25239024b1..94a6f65937ce3 100644 --- a/tests/baselines/reference/typeIdentityConsidersBrands.js +++ b/tests/baselines/reference/typeIdentityConsidersBrands.js @@ -33,22 +33,22 @@ foo2(a2); // should error //// [typeIdentityConsidersBrands.js] -var X = (function () { +var X = /** @class */ (function () { function X() { } return X; }()); -var Y = (function () { +var Y = /** @class */ (function () { function Y() { } return Y; }()); -var X_1 = (function () { +var X_1 = /** @class */ (function () { function X_1() { } return X_1; }()); -var Y_1 = (function () { +var Y_1 = /** @class */ (function () { function Y_1() { } return Y_1; diff --git a/tests/baselines/reference/typeInferenceLiteralUnion.js b/tests/baselines/reference/typeInferenceLiteralUnion.js index 289dd4130460b..d8d0dfff8af3b 100644 --- a/tests/baselines/reference/typeInferenceLiteralUnion.js +++ b/tests/baselines/reference/typeInferenceLiteralUnion.js @@ -40,7 +40,7 @@ extentMixed = extent([new NumCoercible(10), 13, '12', true]); "use strict"; exports.__esModule = true; // Not very useful, but meets Numeric -var NumCoercible = (function () { +var NumCoercible = /** @class */ (function () { function NumCoercible(a) { this.a = a; } diff --git a/tests/baselines/reference/typeInferenceReturnTypeCallback.js b/tests/baselines/reference/typeInferenceReturnTypeCallback.js index 6de0cb5524c81..54e4d85aab13d 100644 --- a/tests/baselines/reference/typeInferenceReturnTypeCallback.js +++ b/tests/baselines/reference/typeInferenceReturnTypeCallback.js @@ -22,7 +22,7 @@ class Cons implements IList{ } //// [typeInferenceReturnTypeCallback.js] -var Nil = (function () { +var Nil = /** @class */ (function () { function Nil() { } Nil.prototype.map = function (f) { @@ -30,7 +30,7 @@ var Nil = (function () { }; return Nil; }()); -var Cons = (function () { +var Cons = /** @class */ (function () { function Cons() { } Cons.prototype.map = function (f) { diff --git a/tests/baselines/reference/typeMatch1.js b/tests/baselines/reference/typeMatch1.js index f78cb04f28538..c3e4c5f2a3bb9 100644 --- a/tests/baselines/reference/typeMatch1.js +++ b/tests/baselines/reference/typeMatch1.js @@ -31,12 +31,12 @@ var i2; var x3 = i; var x4 = i2; var x5 = i2; -var C = (function () { +var C = /** @class */ (function () { function C() { } return C; }()); -var D = (function () { +var D = /** @class */ (function () { function D() { } return D; diff --git a/tests/baselines/reference/typeMatch2.js b/tests/baselines/reference/typeMatch2.js index 8d42126fb1f25..aefd3de9c9b5c 100644 --- a/tests/baselines/reference/typeMatch2.js +++ b/tests/baselines/reference/typeMatch2.js @@ -62,12 +62,12 @@ function f1() { a = { x: 1, y: 2, z: 3 }; a = { x: 1, z: 3 }; // error } -var Animal = (function () { +var Animal = /** @class */ (function () { function Animal() { } return Animal; }()); -var Giraffe = (function (_super) { +var Giraffe = /** @class */ (function (_super) { __extends(Giraffe, _super); function Giraffe() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/typeName1.js b/tests/baselines/reference/typeName1.js index 3d65ccd6d0010..afb612f3ddf9c 100644 --- a/tests/baselines/reference/typeName1.js +++ b/tests/baselines/reference/typeName1.js @@ -28,7 +28,7 @@ var x15:number=C; //// [typeName1.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } return C; diff --git a/tests/baselines/reference/typeOfPrototype.js b/tests/baselines/reference/typeOfPrototype.js index 3e8b31869361c..01279cc563230 100644 --- a/tests/baselines/reference/typeOfPrototype.js +++ b/tests/baselines/reference/typeOfPrototype.js @@ -7,7 +7,7 @@ Foo.prototype.bar = undefined; // Should be OK //// [typeOfPrototype.js] -var Foo = (function () { +var Foo = /** @class */ (function () { function Foo() { this.bar = 3; } diff --git a/tests/baselines/reference/typeOfSuperCall.js b/tests/baselines/reference/typeOfSuperCall.js index c1598be5c3258..3837f4717c890 100644 --- a/tests/baselines/reference/typeOfSuperCall.js +++ b/tests/baselines/reference/typeOfSuperCall.js @@ -19,12 +19,12 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var C = (function () { +var C = /** @class */ (function () { function C() { } return C; }()); -var D = (function (_super) { +var D = /** @class */ (function (_super) { __extends(D, _super); function D() { var _this = this; diff --git a/tests/baselines/reference/typeOfThis.js b/tests/baselines/reference/typeOfThis.js index c1febeae4e4d8..42593bd3d2ae3 100644 --- a/tests/baselines/reference/typeOfThis.js +++ b/tests/baselines/reference/typeOfThis.js @@ -179,7 +179,7 @@ this.spaaaaace = 4; //// [typeOfThis.js] var _this = this; -var MyTestClass = (function () { +var MyTestClass = /** @class */ (function () { function MyTestClass() { var _this = this; this.someFunc = function () { @@ -249,7 +249,7 @@ var MyTestClass = (function () { }); return MyTestClass; }()); -var MyGenericTestClass = (function () { +var MyGenericTestClass = /** @class */ (function () { function MyGenericTestClass() { var _this = this; this.someFunc = function () { diff --git a/tests/baselines/reference/typeOfThisInAccessor.js b/tests/baselines/reference/typeOfThisInAccessor.js index eff26c713d716..2fdde586ceaaa 100644 --- a/tests/baselines/reference/typeOfThisInAccessor.js +++ b/tests/baselines/reference/typeOfThisInAccessor.js @@ -32,7 +32,7 @@ var x = { } //// [typeOfThisInAccessor.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } Object.defineProperty(C.prototype, "x", { @@ -53,7 +53,7 @@ var C = (function () { }); return C; }()); -var D = (function () { +var D = /** @class */ (function () { function D() { } Object.defineProperty(D.prototype, "x", { diff --git a/tests/baselines/reference/typeOfThisInConstructorParamList.js b/tests/baselines/reference/typeOfThisInConstructorParamList.js index bee1710ca58f8..572ee20230927 100644 --- a/tests/baselines/reference/typeOfThisInConstructorParamList.js +++ b/tests/baselines/reference/typeOfThisInConstructorParamList.js @@ -8,7 +8,7 @@ class ErrClass { //// [typeOfThisInConstructorParamList.js] //type of 'this' in constructor param list is the class instance type (error) -var ErrClass = (function () { +var ErrClass = /** @class */ (function () { // Should be an error function ErrClass(f) { if (f === void 0) { f = this; } diff --git a/tests/baselines/reference/typeOfThisInFunctionExpression.js b/tests/baselines/reference/typeOfThisInFunctionExpression.js index 9fafdcd11b619..13dad696aa2d4 100644 --- a/tests/baselines/reference/typeOfThisInFunctionExpression.js +++ b/tests/baselines/reference/typeOfThisInFunctionExpression.js @@ -59,7 +59,7 @@ var t2 = function f() { var x = this; var x; }; -var C = (function () { +var C = /** @class */ (function () { function C() { this.x = function () { var q; diff --git a/tests/baselines/reference/typeOfThisInInstanceMember.js b/tests/baselines/reference/typeOfThisInInstanceMember.js index fce84290d5e38..7987c1aaabdd7 100644 --- a/tests/baselines/reference/typeOfThisInInstanceMember.js +++ b/tests/baselines/reference/typeOfThisInInstanceMember.js @@ -32,7 +32,7 @@ rs.forEach(x => { }); //// [typeOfThisInInstanceMember.js] -var C = (function () { +var C = /** @class */ (function () { function C(x) { this.x = this; var t = this; diff --git a/tests/baselines/reference/typeOfThisInInstanceMember2.js b/tests/baselines/reference/typeOfThisInInstanceMember2.js index 2b8867e7ec89a..4e07609c0f290 100644 --- a/tests/baselines/reference/typeOfThisInInstanceMember2.js +++ b/tests/baselines/reference/typeOfThisInInstanceMember2.js @@ -36,7 +36,7 @@ rs.forEach(x => { }); //// [typeOfThisInInstanceMember2.js] -var C = (function () { +var C = /** @class */ (function () { function C(x) { this.x = this; var t = this; diff --git a/tests/baselines/reference/typeOfThisInMemberFunctions.js b/tests/baselines/reference/typeOfThisInMemberFunctions.js index 9ef1e3a4d7d39..bab170f029b96 100644 --- a/tests/baselines/reference/typeOfThisInMemberFunctions.js +++ b/tests/baselines/reference/typeOfThisInMemberFunctions.js @@ -32,7 +32,7 @@ class E { } //// [typeOfThisInMemberFunctions.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } C.prototype.foo = function () { @@ -43,7 +43,7 @@ var C = (function () { }; return C; }()); -var D = (function () { +var D = /** @class */ (function () { function D() { } D.prototype.foo = function () { @@ -54,7 +54,7 @@ var D = (function () { }; return D; }()); -var E = (function () { +var E = /** @class */ (function () { function E() { } E.prototype.foo = function () { diff --git a/tests/baselines/reference/typeOfThisInStaticMembers.js b/tests/baselines/reference/typeOfThisInStaticMembers.js index 039693224b768..bf7746021378d 100644 --- a/tests/baselines/reference/typeOfThisInStaticMembers.js +++ b/tests/baselines/reference/typeOfThisInStaticMembers.js @@ -35,7 +35,7 @@ var r7 = new t2(''); //// [typeOfThisInStaticMembers.js] -var C = (function () { +var C = /** @class */ (function () { function C(x) { } C.bar = function () { @@ -50,7 +50,7 @@ var t = C.bar(); var r2 = t.foo + 1; var r3 = t.bar(); var r4 = new t(1); -var C2 = (function () { +var C2 = /** @class */ (function () { function C2(x) { } C2.bar = function () { diff --git a/tests/baselines/reference/typeOfThisInStaticMembers2.js b/tests/baselines/reference/typeOfThisInStaticMembers2.js index b01770446beea..72243cdd3e619 100644 --- a/tests/baselines/reference/typeOfThisInStaticMembers2.js +++ b/tests/baselines/reference/typeOfThisInStaticMembers2.js @@ -8,13 +8,13 @@ class C2 { } //// [typeOfThisInStaticMembers2.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } C.foo = this; // error return C; }()); -var C2 = (function () { +var C2 = /** @class */ (function () { function C2() { } C2.foo = this; // error diff --git a/tests/baselines/reference/typeOfThisInStatics.js b/tests/baselines/reference/typeOfThisInStatics.js index 01519018ba251..e8de4e56a87ca 100644 --- a/tests/baselines/reference/typeOfThisInStatics.js +++ b/tests/baselines/reference/typeOfThisInStatics.js @@ -11,7 +11,7 @@ class C { //// [typeOfThisInStatics.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } C.foo = function () { diff --git a/tests/baselines/reference/typeParamExtendsOtherTypeParam.js b/tests/baselines/reference/typeParamExtendsOtherTypeParam.js index 70c6aa843708a..626a9e8c01271 100644 --- a/tests/baselines/reference/typeParamExtendsOtherTypeParam.js +++ b/tests/baselines/reference/typeParamExtendsOtherTypeParam.js @@ -31,12 +31,12 @@ var x8: B; //// [typeParamExtendsOtherTypeParam.js] -var A = (function () { +var A = /** @class */ (function () { function A() { } return A; }()); -var B = (function () { +var B = /** @class */ (function () { function B() { } return B; diff --git a/tests/baselines/reference/typeParameterAsBaseClass.js b/tests/baselines/reference/typeParameterAsBaseClass.js index ad48f6f37bc1f..b68b346abbbe4 100644 --- a/tests/baselines/reference/typeParameterAsBaseClass.js +++ b/tests/baselines/reference/typeParameterAsBaseClass.js @@ -13,14 +13,14 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var C = (function (_super) { +var C = /** @class */ (function (_super) { __extends(C, _super); function C() { return _super !== null && _super.apply(this, arguments) || this; } return C; }(T)); -var C2 = (function () { +var C2 = /** @class */ (function () { function C2() { } return C2; diff --git a/tests/baselines/reference/typeParameterAsBaseType.js b/tests/baselines/reference/typeParameterAsBaseType.js index 68eea323f0bd2..c593180eea4b4 100644 --- a/tests/baselines/reference/typeParameterAsBaseType.js +++ b/tests/baselines/reference/typeParameterAsBaseType.js @@ -23,14 +23,14 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var C = (function (_super) { +var C = /** @class */ (function (_super) { __extends(C, _super); function C() { return _super !== null && _super.apply(this, arguments) || this; } return C; }(T)); -var C2 = (function (_super) { +var C2 = /** @class */ (function (_super) { __extends(C2, _super); function C2() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/typeParameterAsTypeArgument.js b/tests/baselines/reference/typeParameterAsTypeArgument.js index 957177c273569..807e559440376 100644 --- a/tests/baselines/reference/typeParameterAsTypeArgument.js +++ b/tests/baselines/reference/typeParameterAsTypeArgument.js @@ -34,7 +34,7 @@ function foo(x, y) { foo(y, y); return new C(); } -var C = (function () { +var C = /** @class */ (function () { function C() { } return C; diff --git a/tests/baselines/reference/typeParameterAssignability3.js b/tests/baselines/reference/typeParameterAssignability3.js index f0391571e2bd4..16f9e414774a6 100644 --- a/tests/baselines/reference/typeParameterAssignability3.js +++ b/tests/baselines/reference/typeParameterAssignability3.js @@ -27,7 +27,7 @@ class C { //// [typeParameterAssignability3.js] // type parameters are not assignable to one another unless directly or indirectly constrained to one another -var Foo = (function () { +var Foo = /** @class */ (function () { function Foo() { } return Foo; @@ -42,7 +42,7 @@ function foo(t, u) { t = u; // error u = t; // error } -var C = (function () { +var C = /** @class */ (function () { function C() { var _this = this; this.r = function () { diff --git a/tests/baselines/reference/typeParameterAssignmentCompat1.js b/tests/baselines/reference/typeParameterAssignmentCompat1.js index c7570a7d0657f..b220df1d8249e 100644 --- a/tests/baselines/reference/typeParameterAssignmentCompat1.js +++ b/tests/baselines/reference/typeParameterAssignmentCompat1.js @@ -26,7 +26,7 @@ function f() { x = y; // should be an error return x; } -var C = (function () { +var C = /** @class */ (function () { function C() { } C.prototype.f = function () { diff --git a/tests/baselines/reference/typeParameterDirectlyConstrainedToItself.js b/tests/baselines/reference/typeParameterDirectlyConstrainedToItself.js index bf7106c6e3710..9efb268b33ea1 100644 --- a/tests/baselines/reference/typeParameterDirectlyConstrainedToItself.js +++ b/tests/baselines/reference/typeParameterDirectlyConstrainedToItself.js @@ -20,12 +20,12 @@ var b2 = () => { } //// [typeParameterDirectlyConstrainedToItself.js] // all of the below should be errors -var C = (function () { +var C = /** @class */ (function () { function C() { } return C; }()); -var C2 = (function () { +var C2 = /** @class */ (function () { function C2() { } return C2; diff --git a/tests/baselines/reference/typeParameterExplicitlyExtendsAny.js b/tests/baselines/reference/typeParameterExplicitlyExtendsAny.js index 3c2ec6c5977de..983b25b8e8d5f 100644 --- a/tests/baselines/reference/typeParameterExplicitlyExtendsAny.js +++ b/tests/baselines/reference/typeParameterExplicitlyExtendsAny.js @@ -51,7 +51,7 @@ function f(x) { x[100]; x['hello']; } -var MyClass = (function () { +var MyClass = /** @class */ (function () { function MyClass() { } MyClass.displayTree1 = function (tree) { diff --git a/tests/baselines/reference/typeParameterExtendingUnion1.js b/tests/baselines/reference/typeParameterExtendingUnion1.js index b582877f35cda..5f2cb7cae094a 100644 --- a/tests/baselines/reference/typeParameterExtendingUnion1.js +++ b/tests/baselines/reference/typeParameterExtendingUnion1.js @@ -23,20 +23,20 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var Animal = (function () { +var Animal = /** @class */ (function () { function Animal() { } Animal.prototype.run = function () { }; return Animal; }()); -var Cat = (function (_super) { +var Cat = /** @class */ (function (_super) { __extends(Cat, _super); function Cat() { return _super !== null && _super.apply(this, arguments) || this; } return Cat; }(Animal)); -var Dog = (function (_super) { +var Dog = /** @class */ (function (_super) { __extends(Dog, _super); function Dog() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/typeParameterExtendingUnion2.js b/tests/baselines/reference/typeParameterExtendingUnion2.js index b96298c574f12..49bb9d3d327c4 100644 --- a/tests/baselines/reference/typeParameterExtendingUnion2.js +++ b/tests/baselines/reference/typeParameterExtendingUnion2.js @@ -23,20 +23,20 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var Animal = (function () { +var Animal = /** @class */ (function () { function Animal() { } Animal.prototype.run = function () { }; return Animal; }()); -var Cat = (function (_super) { +var Cat = /** @class */ (function (_super) { __extends(Cat, _super); function Cat() { return _super !== null && _super.apply(this, arguments) || this; } return Cat; }(Animal)); -var Dog = (function (_super) { +var Dog = /** @class */ (function (_super) { __extends(Dog, _super); function Dog() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/typeParameterInConstraint1.js b/tests/baselines/reference/typeParameterInConstraint1.js index d49a72f871a11..9127d3c407729 100644 --- a/tests/baselines/reference/typeParameterInConstraint1.js +++ b/tests/baselines/reference/typeParameterInConstraint1.js @@ -3,7 +3,7 @@ class C { } //// [typeParameterInConstraint1.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } return C; diff --git a/tests/baselines/reference/typeParameterIndirectlyConstrainedToItself.js b/tests/baselines/reference/typeParameterIndirectlyConstrainedToItself.js index 25f410c3a7bb4..58d559d7fee15 100644 --- a/tests/baselines/reference/typeParameterIndirectlyConstrainedToItself.js +++ b/tests/baselines/reference/typeParameterIndirectlyConstrainedToItself.js @@ -19,12 +19,12 @@ var b2 = () => { } class D { } //// [typeParameterIndirectlyConstrainedToItself.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } return C; }()); -var C2 = (function () { +var C2 = /** @class */ (function () { function C2() { } return C2; @@ -34,7 +34,7 @@ function f2() { } var a; var b = function () { }; var b2 = function () { }; -var D = (function () { +var D = /** @class */ (function () { function D() { } return D; diff --git a/tests/baselines/reference/typeParameterListWithTrailingComma1.js b/tests/baselines/reference/typeParameterListWithTrailingComma1.js index b0121fde8fec5..cf0dcff903398 100644 --- a/tests/baselines/reference/typeParameterListWithTrailingComma1.js +++ b/tests/baselines/reference/typeParameterListWithTrailingComma1.js @@ -3,7 +3,7 @@ class C { } //// [typeParameterListWithTrailingComma1.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } return C; diff --git a/tests/baselines/reference/typeParameterUsedAsConstraint.js b/tests/baselines/reference/typeParameterUsedAsConstraint.js index 627eb6cc64ed8..2499bcae1dada 100644 --- a/tests/baselines/reference/typeParameterUsedAsConstraint.js +++ b/tests/baselines/reference/typeParameterUsedAsConstraint.js @@ -36,32 +36,32 @@ var a6: { (): void } //// [typeParameterUsedAsConstraint.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } return C; }()); -var C2 = (function () { +var C2 = /** @class */ (function () { function C2() { } return C2; }()); -var C3 = (function () { +var C3 = /** @class */ (function () { function C3() { } return C3; }()); -var C4 = (function () { +var C4 = /** @class */ (function () { function C4() { } return C4; }()); -var C5 = (function () { +var C5 = /** @class */ (function () { function C5() { } return C5; }()); -var C6 = (function () { +var C6 = /** @class */ (function () { function C6() { } return C6; diff --git a/tests/baselines/reference/typeParameterUsedAsTypeParameterConstraint4.js b/tests/baselines/reference/typeParameterUsedAsTypeParameterConstraint4.js index d78cf2aa3665c..8afaa264ee69a 100644 --- a/tests/baselines/reference/typeParameterUsedAsTypeParameterConstraint4.js +++ b/tests/baselines/reference/typeParameterUsedAsTypeParameterConstraint4.js @@ -56,7 +56,7 @@ var f4 = (x: V, y: X) => { // error //// [typeParameterUsedAsTypeParameterConstraint4.js] // Type parameters are in scope in their own and other type parameter lists // Some negative cases -var C = (function () { +var C = /** @class */ (function () { function C() { } C.prototype.foo = function (x) { diff --git a/tests/baselines/reference/typeParameterWithInvalidConstraintType.js b/tests/baselines/reference/typeParameterWithInvalidConstraintType.js index 40a2aeacf4b3e..99388d495f5a9 100644 --- a/tests/baselines/reference/typeParameterWithInvalidConstraintType.js +++ b/tests/baselines/reference/typeParameterWithInvalidConstraintType.js @@ -10,7 +10,7 @@ class A { } //// [typeParameterWithInvalidConstraintType.js] -var A = (function () { +var A = /** @class */ (function () { function A() { } A.prototype.foo = function () { diff --git a/tests/baselines/reference/typeParametersAndParametersInComputedNames.js b/tests/baselines/reference/typeParametersAndParametersInComputedNames.js index 7f2c04c2ec34b..19e318ae09c4a 100644 --- a/tests/baselines/reference/typeParametersAndParametersInComputedNames.js +++ b/tests/baselines/reference/typeParametersAndParametersInComputedNames.js @@ -12,7 +12,7 @@ class A { function foo(a) { return ""; } -var A = (function () { +var A = /** @class */ (function () { function A() { } A.prototype[foo(a)] = function (a) { diff --git a/tests/baselines/reference/typeParametersAreIdenticalToThemselves.js b/tests/baselines/reference/typeParametersAreIdenticalToThemselves.js index 699f3f2f26e5c..58f07dd085be8 100644 --- a/tests/baselines/reference/typeParametersAreIdenticalToThemselves.js +++ b/tests/baselines/reference/typeParametersAreIdenticalToThemselves.js @@ -84,7 +84,7 @@ function foo3(x, y) { function inner(x) { } function inner2(x) { } } -var C = (function () { +var C = /** @class */ (function () { function C() { } C.prototype.foo1 = function (x) { }; @@ -93,7 +93,7 @@ var C = (function () { C.prototype.foo4 = function (x) { }; return C; }()); -var C2 = (function () { +var C2 = /** @class */ (function () { function C2() { } C2.prototype.foo1 = function (x) { }; diff --git a/tests/baselines/reference/typeParametersAvailableInNestedScope.js b/tests/baselines/reference/typeParametersAvailableInNestedScope.js index d1b50029d23c2..156d572dfa58d 100644 --- a/tests/baselines/reference/typeParametersAvailableInNestedScope.js +++ b/tests/baselines/reference/typeParametersAvailableInNestedScope.js @@ -22,7 +22,7 @@ c.data = c.foo(); //// [typeParametersAvailableInNestedScope.js] -var C = (function () { +var C = /** @class */ (function () { function C() { this.x = function (a) { var y; diff --git a/tests/baselines/reference/typeParametersInStaticAccessors.js b/tests/baselines/reference/typeParametersInStaticAccessors.js index d9b33399af1f9..ec58167ac083b 100644 --- a/tests/baselines/reference/typeParametersInStaticAccessors.js +++ b/tests/baselines/reference/typeParametersInStaticAccessors.js @@ -5,7 +5,7 @@ class foo { } //// [typeParametersInStaticAccessors.js] -var foo = (function () { +var foo = /** @class */ (function () { function foo() { } Object.defineProperty(foo, "Foo", { diff --git a/tests/baselines/reference/typeParametersInStaticMethods.js b/tests/baselines/reference/typeParametersInStaticMethods.js index be69c87e59950..1fd97f885c850 100644 --- a/tests/baselines/reference/typeParametersInStaticMethods.js +++ b/tests/baselines/reference/typeParametersInStaticMethods.js @@ -5,7 +5,7 @@ class foo { } //// [typeParametersInStaticMethods.js] -var foo = (function () { +var foo = /** @class */ (function () { function foo() { } foo.M = function (x) { diff --git a/tests/baselines/reference/typeParametersInStaticProperties.js b/tests/baselines/reference/typeParametersInStaticProperties.js index 071dbf28dcb17..c2866766694ff 100644 --- a/tests/baselines/reference/typeParametersInStaticProperties.js +++ b/tests/baselines/reference/typeParametersInStaticProperties.js @@ -4,7 +4,7 @@ class foo { } //// [typeParametersInStaticProperties.js] -var foo = (function () { +var foo = /** @class */ (function () { function foo() { } return foo; diff --git a/tests/baselines/reference/typeQueryOnClass.js b/tests/baselines/reference/typeQueryOnClass.js index 85dff0de831e0..85ae02c0d6c5c 100644 --- a/tests/baselines/reference/typeQueryOnClass.js +++ b/tests/baselines/reference/typeQueryOnClass.js @@ -57,7 +57,7 @@ var r3: typeof D; var r4: typeof d; //// [typeQueryOnClass.js] -var C = (function () { +var C = /** @class */ (function () { function C(x) { var _this = this; this.x = x; @@ -107,7 +107,7 @@ var c; // BUG 820454 var r1; var r2; -var D = (function () { +var D = /** @class */ (function () { function D(y) { this.y = y; } diff --git a/tests/baselines/reference/typeQueryWithReservedWords.js b/tests/baselines/reference/typeQueryWithReservedWords.js index 09c3b642a36d0..092f359d29595 100644 --- a/tests/baselines/reference/typeQueryWithReservedWords.js +++ b/tests/baselines/reference/typeQueryWithReservedWords.js @@ -16,7 +16,7 @@ interface IScope { //// [typeQueryWithReservedWords.js] -var Controller = (function () { +var Controller = /** @class */ (function () { function Controller() { } Controller.prototype.create = function () { diff --git a/tests/baselines/reference/typeReferenceDirectives9.js b/tests/baselines/reference/typeReferenceDirectives9.js index 54685ef7961b2..368b8b30f4bca 100644 --- a/tests/baselines/reference/typeReferenceDirectives9.js +++ b/tests/baselines/reference/typeReferenceDirectives9.js @@ -34,7 +34,7 @@ export const bar = Cls.bar(); //// [main.js] "use strict"; exports.__esModule = true; -var Cls = (function () { +var Cls = /** @class */ (function () { function Cls() { } return Cls; diff --git a/tests/baselines/reference/typeRelationships.js b/tests/baselines/reference/typeRelationships.js index 5227a109b172a..3d4d5ec91ac05 100644 --- a/tests/baselines/reference/typeRelationships.js +++ b/tests/baselines/reference/typeRelationships.js @@ -51,7 +51,7 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var C = (function () { +var C = /** @class */ (function () { function C() { this.self = this; this.c = new C(); @@ -74,7 +74,7 @@ var C = (function () { }; return C; }()); -var D = (function (_super) { +var D = /** @class */ (function (_super) { __extends(D, _super); function D() { var _this = _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/typeResolution.js b/tests/baselines/reference/typeResolution.js index cb8a40cf0a6e6..7bca7b1c5b826 100644 --- a/tests/baselines/reference/typeResolution.js +++ b/tests/baselines/reference/typeResolution.js @@ -120,7 +120,7 @@ define(["require", "exports"], function (require, exports) { (function (SubModule1) { var SubSubModule1; (function (SubSubModule1) { - var ClassA = (function () { + var ClassA = /** @class */ (function () { function ClassA() { } ClassA.prototype.AisIn1_1_1 = function () { @@ -150,7 +150,7 @@ define(["require", "exports"], function (require, exports) { return ClassA; }()); SubSubModule1.ClassA = ClassA; - var ClassB = (function () { + var ClassB = /** @class */ (function () { function ClassB() { } ClassB.prototype.BisIn1_1_1 = function () { @@ -183,7 +183,7 @@ define(["require", "exports"], function (require, exports) { return ClassB; }()); SubSubModule1.ClassB = ClassB; - var NonExportedClassQ = (function () { + var NonExportedClassQ = /** @class */ (function () { function NonExportedClassQ() { function QQ() { /* Sampling of stuff from AisIn1_1_1 */ @@ -201,7 +201,7 @@ define(["require", "exports"], function (require, exports) { }()); })(SubSubModule1 = SubModule1.SubSubModule1 || (SubModule1.SubSubModule1 = {})); // Should have no effect on S1.SS1.ClassA above because it is not exported - var ClassA = (function () { + var ClassA = /** @class */ (function () { function ClassA() { function AA() { var a2; @@ -223,21 +223,21 @@ define(["require", "exports"], function (require, exports) { var SubSubModule2; (function (SubSubModule2) { // No code here since these are the mirror of the above calls - var ClassA = (function () { + var ClassA = /** @class */ (function () { function ClassA() { } ClassA.prototype.AisIn1_2_2 = function () { }; return ClassA; }()); SubSubModule2.ClassA = ClassA; - var ClassB = (function () { + var ClassB = /** @class */ (function () { function ClassB() { } ClassB.prototype.BisIn1_2_2 = function () { }; return ClassB; }()); SubSubModule2.ClassB = ClassB; - var ClassC = (function () { + var ClassC = /** @class */ (function () { function ClassC() { } ClassC.prototype.CisIn1_2_2 = function () { }; @@ -246,7 +246,7 @@ define(["require", "exports"], function (require, exports) { SubSubModule2.ClassC = ClassC; })(SubSubModule2 = SubModule2.SubSubModule2 || (SubModule2.SubSubModule2 = {})); })(SubModule2 = TopLevelModule1.SubModule2 || (TopLevelModule1.SubModule2 = {})); - var ClassA = (function () { + var ClassA = /** @class */ (function () { function ClassA() { } ClassA.prototype.AisIn1 = function () { }; @@ -254,7 +254,7 @@ define(["require", "exports"], function (require, exports) { }()); var NotExportedModule; (function (NotExportedModule) { - var ClassA = (function () { + var ClassA = /** @class */ (function () { function ClassA() { } return ClassA; @@ -266,7 +266,7 @@ define(["require", "exports"], function (require, exports) { (function (TopLevelModule2) { var SubModule3; (function (SubModule3) { - var ClassA = (function () { + var ClassA = /** @class */ (function () { function ClassA() { } ClassA.prototype.AisIn2_3 = function () { }; diff --git a/tests/baselines/reference/typeResolution.sourcemap.txt b/tests/baselines/reference/typeResolution.sourcemap.txt index 19e8b9991d154..b0af6e8e86b39 100644 --- a/tests/baselines/reference/typeResolution.sourcemap.txt +++ b/tests/baselines/reference/typeResolution.sourcemap.txt @@ -312,7 +312,7 @@ sourceFile:typeResolution.ts 1->^^^^^^^^^^^^ 2 > ^^^^^^^^^^^ 3 > ^^^^^^^^^^^^^ -4 > ^^^^^^^^-> +4 > ^^^^^^^^^^^^^^^^^^^^^^-> 1-> 2 > export module 3 > SubSubModule1 @@ -320,7 +320,7 @@ sourceFile:typeResolution.ts 2 >Emitted(9, 24) Source(3, 23) + SourceIndex(0) 3 >Emitted(9, 37) Source(3, 36) + SourceIndex(0) --- ->>> var ClassA = (function () { +>>> var ClassA = /** @class */ (function () { 1->^^^^^^^^^^^^^^^^ 2 > ^^^^^^^^^^^^^^^^^^^^^^^^-> 1-> { @@ -797,6 +797,7 @@ sourceFile:typeResolution.ts 2 > ^^^^^^^^^^^^^^^^^^^^ 3 > ^^^^^^^^^ 4 > ^ +5 > ^^^^^^^^^^^^-> 1-> 2 > ClassA 3 > { @@ -825,12 +826,12 @@ sourceFile:typeResolution.ts 3 >Emitted(39, 46) Source(23, 14) + SourceIndex(0) 4 >Emitted(39, 47) Source(23, 14) + SourceIndex(0) --- ->>> var ClassB = (function () { -1 >^^^^^^^^^^^^^^^^ +>>> var ClassB = /** @class */ (function () { +1->^^^^^^^^^^^^^^^^ 2 > ^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > +1-> > -1 >Emitted(40, 17) Source(24, 13) + SourceIndex(0) +1->Emitted(40, 17) Source(24, 13) + SourceIndex(0) --- >>> function ClassB() { 1->^^^^^^^^^^^^^^^^^^^^ @@ -1354,7 +1355,7 @@ sourceFile:typeResolution.ts 2 > ^^^^^^^^^^^^^^^^^^^^ 3 > ^^^^^^^^^ 4 > ^ -5 > ^^^^^^^^^-> +5 > ^^^^^^^^^^^^^^^^^^^^^^^-> 1-> 2 > ClassB 3 > { @@ -1386,7 +1387,7 @@ sourceFile:typeResolution.ts 3 >Emitted(72, 46) Source(46, 14) + SourceIndex(0) 4 >Emitted(72, 47) Source(46, 14) + SourceIndex(0) --- ->>> var NonExportedClassQ = (function () { +>>> var NonExportedClassQ = /** @class */ (function () { 1->^^^^^^^^^^^^^^^^ 2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1-> @@ -1710,7 +1711,7 @@ sourceFile:typeResolution.ts 1 >Emitted(90, 13) Source(61, 9) + SourceIndex(0) 2 >Emitted(90, 87) Source(61, 83) + SourceIndex(0) --- ->>> var ClassA = (function () { +>>> var ClassA = /** @class */ (function () { 1 >^^^^^^^^^^^^ 2 > ^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > @@ -2126,7 +2127,7 @@ sourceFile:typeResolution.ts 1->Emitted(112, 17) Source(78, 13) + SourceIndex(0) 2 >Emitted(112, 78) Source(78, 74) + SourceIndex(0) --- ->>> var ClassA = (function () { +>>> var ClassA = /** @class */ (function () { 1 >^^^^^^^^^^^^^^^^ 2 > ^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > @@ -2193,6 +2194,7 @@ sourceFile:typeResolution.ts 2 > ^^^^^^^^^^^^^^^^^^^^ 3 > ^^^^^^^^^ 4 > ^ +5 > ^^^^^^^^^^^^-> 1-> 2 > ClassA 3 > { public AisIn1_2_2() { } } @@ -2202,12 +2204,12 @@ sourceFile:typeResolution.ts 3 >Emitted(119, 46) Source(79, 60) + SourceIndex(0) 4 >Emitted(119, 47) Source(79, 60) + SourceIndex(0) --- ->>> var ClassB = (function () { -1 >^^^^^^^^^^^^^^^^ +>>> var ClassB = /** @class */ (function () { +1->^^^^^^^^^^^^^^^^ 2 > ^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > +1-> > -1 >Emitted(120, 17) Source(80, 13) + SourceIndex(0) +1->Emitted(120, 17) Source(80, 13) + SourceIndex(0) --- >>> function ClassB() { 1->^^^^^^^^^^^^^^^^^^^^ @@ -2269,6 +2271,7 @@ sourceFile:typeResolution.ts 2 > ^^^^^^^^^^^^^^^^^^^^ 3 > ^^^^^^^^^ 4 > ^ +5 > ^^^^^^^^^^^^-> 1-> 2 > ClassB 3 > { public BisIn1_2_2() { } } @@ -2278,12 +2281,12 @@ sourceFile:typeResolution.ts 3 >Emitted(126, 46) Source(80, 60) + SourceIndex(0) 4 >Emitted(126, 47) Source(80, 60) + SourceIndex(0) --- ->>> var ClassC = (function () { -1 >^^^^^^^^^^^^^^^^ +>>> var ClassC = /** @class */ (function () { +1->^^^^^^^^^^^^^^^^ 2 > ^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > +1-> > -1 >Emitted(127, 17) Source(81, 13) + SourceIndex(0) +1->Emitted(127, 17) Source(81, 13) + SourceIndex(0) --- >>> function ClassC() { 1->^^^^^^^^^^^^^^^^^^^^ @@ -2437,7 +2440,7 @@ sourceFile:typeResolution.ts 8 >Emitted(135, 82) Source(76, 29) + SourceIndex(0) 9 >Emitted(135, 90) Source(87, 6) + SourceIndex(0) --- ->>> var ClassA = (function () { +>>> var ClassA = /** @class */ (function () { 1 >^^^^^^^^ 2 > ^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > @@ -2532,7 +2535,7 @@ sourceFile:typeResolution.ts 1->^^^^^^^^ 2 > ^^^^^^^^^^^ 3 > ^^^^^^^^^^^^^^^^^ -4 > ^^^^-> +4 > ^^^^^^^^^^^^^^^^^^-> 1-> 2 > module 3 > NotExportedModule @@ -2540,7 +2543,7 @@ sourceFile:typeResolution.ts 2 >Emitted(143, 20) Source(97, 12) + SourceIndex(0) 3 >Emitted(143, 37) Source(97, 29) + SourceIndex(0) --- ->>> var ClassA = (function () { +>>> var ClassA = /** @class */ (function () { 1->^^^^^^^^^^^^ 2 > ^^^^^^^^^^^^^^^^^^^^^^^^-> 1-> { @@ -2814,7 +2817,7 @@ sourceFile:typeResolution.ts 1->^^^^^^^^ 2 > ^^^^^^^^^^^ 3 > ^^^^^^^^^^ -4 > ^^^^^^^^^^^-> +4 > ^^^^^^^^^^^^^^^^^^^^^^^^^-> 1-> 2 > export module 3 > SubModule3 @@ -2822,7 +2825,7 @@ sourceFile:typeResolution.ts 2 >Emitted(155, 20) Source(103, 19) + SourceIndex(0) 3 >Emitted(155, 30) Source(103, 29) + SourceIndex(0) --- ->>> var ClassA = (function () { +>>> var ClassA = /** @class */ (function () { 1->^^^^^^^^^^^^ 2 > ^^^^^^^^^^^^^^^^^^^^^^^^-> 1-> { diff --git a/tests/baselines/reference/typeUsedAsValueError.js b/tests/baselines/reference/typeUsedAsValueError.js index d45299564c008..f4b6147932796 100644 --- a/tests/baselines/reference/typeUsedAsValueError.js +++ b/tests/baselines/reference/typeUsedAsValueError.js @@ -24,7 +24,7 @@ acceptsSomeType(someType); acceptsSomeType(someTypeNotFound); //// [typeUsedAsValueError.js] -var SomeClass = (function () { +var SomeClass = /** @class */ (function () { function SomeClass() { } return SomeClass; diff --git a/tests/baselines/reference/typeValueConflict1.js b/tests/baselines/reference/typeValueConflict1.js index e0b829faf616a..dde15cf4d130c 100644 --- a/tests/baselines/reference/typeValueConflict1.js +++ b/tests/baselines/reference/typeValueConflict1.js @@ -24,7 +24,7 @@ var __extends = (this && this.__extends) || (function () { })(); var M1; (function (M1) { - var A = (function () { + var A = /** @class */ (function () { function A() { } return A; @@ -35,7 +35,7 @@ var M2; (function (M2) { var M1 = 0; // Should error. M1 should bind to the variable, not to the module. - var B = (function (_super) { + var B = /** @class */ (function (_super) { __extends(B, _super); function B() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/typeValueConflict2.js b/tests/baselines/reference/typeValueConflict2.js index 6782384b895f4..b9541c36a059a 100644 --- a/tests/baselines/reference/typeValueConflict2.js +++ b/tests/baselines/reference/typeValueConflict2.js @@ -31,7 +31,7 @@ var __extends = (this && this.__extends) || (function () { })(); var M1; (function (M1) { - var A = (function () { + var A = /** @class */ (function () { function A(a) { } return A; @@ -42,7 +42,7 @@ var M2; (function (M2) { var M1 = 0; // Should error. M1 should bind to the variable, not to the module. - var B = (function (_super) { + var B = /** @class */ (function (_super) { __extends(B, _super); function B() { return _super !== null && _super.apply(this, arguments) || this; @@ -53,7 +53,7 @@ var M2; var M3; (function (M3) { // Shouldn't error - var B = (function (_super) { + var B = /** @class */ (function (_super) { __extends(B, _super); function B() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/typeVariableTypeGuards.js b/tests/baselines/reference/typeVariableTypeGuards.js index 8525bde0f779c..378146359c85c 100644 --- a/tests/baselines/reference/typeVariableTypeGuards.js +++ b/tests/baselines/reference/typeVariableTypeGuards.js @@ -95,7 +95,7 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var A = (function () { +var A = /** @class */ (function () { function A() { } A.prototype.doSomething = function () { @@ -103,7 +103,7 @@ var A = (function () { }; return A; }()); -var Monkey = (function () { +var Monkey = /** @class */ (function () { function Monkey() { } Monkey.prototype.render = function () { @@ -113,7 +113,7 @@ var Monkey = (function () { }; return Monkey; }()); -var BigMonkey = (function (_super) { +var BigMonkey = /** @class */ (function (_super) { __extends(BigMonkey, _super); function BigMonkey() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/typedGenericPrototypeMember.js b/tests/baselines/reference/typedGenericPrototypeMember.js index 16b4d93315fb2..a6096c5c37d74 100644 --- a/tests/baselines/reference/typedGenericPrototypeMember.js +++ b/tests/baselines/reference/typedGenericPrototypeMember.js @@ -7,7 +7,7 @@ List.prototype.add("abc"); // Valid because T is instantiated to any //// [typedGenericPrototypeMember.js] -var List = (function () { +var List = /** @class */ (function () { function List() { } List.prototype.add = function (item) { }; diff --git a/tests/baselines/reference/typeofANonExportedType.js b/tests/baselines/reference/typeofANonExportedType.js index ba4451243cafe..97edc2d0922ba 100644 --- a/tests/baselines/reference/typeofANonExportedType.js +++ b/tests/baselines/reference/typeofANonExportedType.js @@ -56,7 +56,7 @@ export var r13: typeof foo; exports.__esModule = true; var x = 1; var y = { foo: '' }; -var C = (function () { +var C = /** @class */ (function () { function C() { } return C; @@ -66,7 +66,7 @@ var i2; var M; (function (M) { M.foo = ''; - var C = (function () { + var C = /** @class */ (function () { function C() { } return C; @@ -80,7 +80,7 @@ var E; function foo() { } (function (foo) { foo.y = 1; - var C = (function () { + var C = /** @class */ (function () { function C() { } return C; diff --git a/tests/baselines/reference/typeofAmbientExternalModules.js b/tests/baselines/reference/typeofAmbientExternalModules.js index 2500193ebde82..9d2ef995ade41 100644 --- a/tests/baselines/reference/typeofAmbientExternalModules.js +++ b/tests/baselines/reference/typeofAmbientExternalModules.js @@ -21,7 +21,7 @@ y2 = ext; //// [typeofAmbientExternalModules_0.js] "use strict"; exports.__esModule = true; -var C = (function () { +var C = /** @class */ (function () { function C() { } return C; @@ -29,7 +29,7 @@ var C = (function () { exports.C = C; //// [typeofAmbientExternalModules_1.js] "use strict"; -var D = (function () { +var D = /** @class */ (function () { function D() { } return D; diff --git a/tests/baselines/reference/typeofAnExportedType.js b/tests/baselines/reference/typeofAnExportedType.js index e166f6b745b19..54d1e85c32ceb 100644 --- a/tests/baselines/reference/typeofAnExportedType.js +++ b/tests/baselines/reference/typeofAnExportedType.js @@ -56,7 +56,7 @@ export var r13: typeof foo; exports.__esModule = true; exports.x = 1; exports.y = { foo: '' }; -var C = (function () { +var C = /** @class */ (function () { function C() { } return C; @@ -67,7 +67,7 @@ var i2; var M; (function (M) { M.foo = ''; - var C = (function () { + var C = /** @class */ (function () { function C() { } return C; @@ -83,7 +83,7 @@ function foo() { } exports.foo = foo; (function (foo) { foo.y = 1; - var C = (function () { + var C = /** @class */ (function () { function C() { } return C; diff --git a/tests/baselines/reference/typeofClass.js b/tests/baselines/reference/typeofClass.js index 8b257583d7b92..24bda113b7609 100644 --- a/tests/baselines/reference/typeofClass.js +++ b/tests/baselines/reference/typeofClass.js @@ -12,7 +12,7 @@ k2.foo; k2.bar; //// [typeofClass.js] -var K = (function () { +var K = /** @class */ (function () { function K() { } return K; diff --git a/tests/baselines/reference/typeofClass2.js b/tests/baselines/reference/typeofClass2.js index f5b11e0c8338f..1ff84cfc57e65 100644 --- a/tests/baselines/reference/typeofClass2.js +++ b/tests/baselines/reference/typeofClass2.js @@ -32,14 +32,14 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var C = (function () { +var C = /** @class */ (function () { function C(x) { } C.foo = function (x) { }; C.bar = function (x) { }; return C; }()); -var D = (function (_super) { +var D = /** @class */ (function (_super) { __extends(D, _super); function D() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/typeofClassWithPrivates.js b/tests/baselines/reference/typeofClassWithPrivates.js index e517f6e471258..606f77c77444b 100644 --- a/tests/baselines/reference/typeofClassWithPrivates.js +++ b/tests/baselines/reference/typeofClassWithPrivates.js @@ -11,7 +11,7 @@ var r: typeof C; var r2: typeof c; //// [typeofClassWithPrivates.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } return C; diff --git a/tests/baselines/reference/typeofExternalModules.js b/tests/baselines/reference/typeofExternalModules.js index 97c6b6d7278a1..3c9f5b8f9cc61 100644 --- a/tests/baselines/reference/typeofExternalModules.js +++ b/tests/baselines/reference/typeofExternalModules.js @@ -19,7 +19,7 @@ y2 = ext; //// [typeofExternalModules_external.js] "use strict"; exports.__esModule = true; -var C = (function () { +var C = /** @class */ (function () { function C() { } return C; @@ -27,7 +27,7 @@ var C = (function () { exports.C = C; //// [typeofExternalModules_exportAssign.js] "use strict"; -var D = (function () { +var D = /** @class */ (function () { function D() { } return D; diff --git a/tests/baselines/reference/typeofInternalModules.js b/tests/baselines/reference/typeofInternalModules.js index 7f15dc87a4670..03c41d9e02845 100644 --- a/tests/baselines/reference/typeofInternalModules.js +++ b/tests/baselines/reference/typeofInternalModules.js @@ -29,7 +29,7 @@ var Outer; (function (Outer) { var instantiated; (function (instantiated) { - var C = (function () { + var C = /** @class */ (function () { function C() { } return C; diff --git a/tests/baselines/reference/typeofModuleWithoutExports.js b/tests/baselines/reference/typeofModuleWithoutExports.js index a29bd9b6a376b..907e178615c53 100644 --- a/tests/baselines/reference/typeofModuleWithoutExports.js +++ b/tests/baselines/reference/typeofModuleWithoutExports.js @@ -12,7 +12,7 @@ var r: typeof M; var M; (function (M) { var x = 1; - var C = (function () { + var C = /** @class */ (function () { function C() { } return C; diff --git a/tests/baselines/reference/typeofOperatorWithAnyOtherType.js b/tests/baselines/reference/typeofOperatorWithAnyOtherType.js index a868aad18155e..ca72b70973a25 100644 --- a/tests/baselines/reference/typeofOperatorWithAnyOtherType.js +++ b/tests/baselines/reference/typeofOperatorWithAnyOtherType.js @@ -85,7 +85,7 @@ function foo() { var a; return a; } -var A = (function () { +var A = /** @class */ (function () { function A() { } A.foo = function () { diff --git a/tests/baselines/reference/typeofOperatorWithBooleanType.js b/tests/baselines/reference/typeofOperatorWithBooleanType.js index fec36d6ab703c..e5ad1cf8bbe1d 100644 --- a/tests/baselines/reference/typeofOperatorWithBooleanType.js +++ b/tests/baselines/reference/typeofOperatorWithBooleanType.js @@ -54,7 +54,7 @@ z: typeof M.n; // typeof operator on boolean type var BOOLEAN; function foo() { return true; } -var A = (function () { +var A = /** @class */ (function () { function A() { } A.foo = function () { return false; }; diff --git a/tests/baselines/reference/typeofOperatorWithNumberType.js b/tests/baselines/reference/typeofOperatorWithNumberType.js index ecf3eebe5b6f8..4ee59ba786970 100644 --- a/tests/baselines/reference/typeofOperatorWithNumberType.js +++ b/tests/baselines/reference/typeofOperatorWithNumberType.js @@ -62,7 +62,7 @@ z: typeof M.n; var NUMBER; var NUMBER1 = [1, 2]; function foo() { return 1; } -var A = (function () { +var A = /** @class */ (function () { function A() { } A.foo = function () { return 1; }; diff --git a/tests/baselines/reference/typeofOperatorWithStringType.js b/tests/baselines/reference/typeofOperatorWithStringType.js index 14b712397dfe6..4dce5b072cb4f 100644 --- a/tests/baselines/reference/typeofOperatorWithStringType.js +++ b/tests/baselines/reference/typeofOperatorWithStringType.js @@ -62,7 +62,7 @@ z: typeof M.n; var STRING; var STRING1 = ["", "abc"]; function foo() { return "abc"; } -var A = (function () { +var A = /** @class */ (function () { function A() { } A.foo = function () { return ""; }; diff --git a/tests/baselines/reference/typeofProperty.js b/tests/baselines/reference/typeofProperty.js index 04fe5faa5c67d..439f9c0e47a39 100644 --- a/tests/baselines/reference/typeofProperty.js +++ b/tests/baselines/reference/typeofProperty.js @@ -48,22 +48,22 @@ var x2: typeof viInstance.x; // x2: string //// [typeofProperty.js] -var C1 = (function () { +var C1 = /** @class */ (function () { function C1() { } return C1; }()); -var C2 = (function () { +var C2 = /** @class */ (function () { function C2() { } return C2; }()); -var C3 = (function () { +var C3 = /** @class */ (function () { function C3() { } return C3; }()); -var ValidClass = (function () { +var ValidClass = /** @class */ (function () { function ValidClass() { } return ValidClass; diff --git a/tests/baselines/reference/typeofUsedBeforeBlockScoped.js b/tests/baselines/reference/typeofUsedBeforeBlockScoped.js index cc9003dd4f6e4..3963df601948a 100644 --- a/tests/baselines/reference/typeofUsedBeforeBlockScoped.js +++ b/tests/baselines/reference/typeofUsedBeforeBlockScoped.js @@ -9,7 +9,7 @@ let o = { n: 12 }; //// [typeofUsedBeforeBlockScoped.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } C.s = 2; diff --git a/tests/baselines/reference/typesWithDuplicateTypeParameters.js b/tests/baselines/reference/typesWithDuplicateTypeParameters.js index d0c6c450e4b52..9adb3ec016ed2 100644 --- a/tests/baselines/reference/typesWithDuplicateTypeParameters.js +++ b/tests/baselines/reference/typesWithDuplicateTypeParameters.js @@ -9,12 +9,12 @@ function f() { } function f2() { } //// [typesWithDuplicateTypeParameters.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } return C; }()); -var C2 = (function () { +var C2 = /** @class */ (function () { function C2() { } return C2; diff --git a/tests/baselines/reference/typesWithPrivateConstructor.js b/tests/baselines/reference/typesWithPrivateConstructor.js index e5c59b99e931c..b9c021a682fe6 100644 --- a/tests/baselines/reference/typesWithPrivateConstructor.js +++ b/tests/baselines/reference/typesWithPrivateConstructor.js @@ -15,14 +15,14 @@ var c2 = new C2(); // error C2 is private var r2: (x: number) => void = c2.constructor; //// [typesWithPrivateConstructor.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } return C; }()); var c = new C(); // error C is private var r = c.constructor; -var C2 = (function () { +var C2 = /** @class */ (function () { function C2(x) { } return C2; diff --git a/tests/baselines/reference/typesWithProtectedConstructor.js b/tests/baselines/reference/typesWithProtectedConstructor.js index ab13dda8581bb..ba676c5af8f59 100644 --- a/tests/baselines/reference/typesWithProtectedConstructor.js +++ b/tests/baselines/reference/typesWithProtectedConstructor.js @@ -15,14 +15,14 @@ var c2 = new C2(); // error C2 is protected var r2: (x: number) => void = c2.constructor; //// [typesWithProtectedConstructor.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } return C; }()); var c = new C(); // error C is protected var r = c.constructor; -var C2 = (function () { +var C2 = /** @class */ (function () { function C2(x) { } return C2; diff --git a/tests/baselines/reference/typesWithPublicConstructor.js b/tests/baselines/reference/typesWithPublicConstructor.js index 1078c95467ca8..7267d8e5ead23 100644 --- a/tests/baselines/reference/typesWithPublicConstructor.js +++ b/tests/baselines/reference/typesWithPublicConstructor.js @@ -18,14 +18,14 @@ var r2: (x: number) => void = c2.constructor; //// [typesWithPublicConstructor.js] // public is allowed on a constructor but is not meaningful -var C = (function () { +var C = /** @class */ (function () { function C() { } return C; }()); var c = new C(); var r = c.constructor; -var C2 = (function () { +var C2 = /** @class */ (function () { function C2(x) { } return C2; diff --git a/tests/baselines/reference/typesWithSpecializedCallSignatures.js b/tests/baselines/reference/typesWithSpecializedCallSignatures.js index 7a006e1a8ce2f..65afb6d62c53b 100644 --- a/tests/baselines/reference/typesWithSpecializedCallSignatures.js +++ b/tests/baselines/reference/typesWithSpecializedCallSignatures.js @@ -53,26 +53,26 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var Base = (function () { +var Base = /** @class */ (function () { function Base() { } return Base; }()); -var Derived1 = (function (_super) { +var Derived1 = /** @class */ (function (_super) { __extends(Derived1, _super); function Derived1() { return _super !== null && _super.apply(this, arguments) || this; } return Derived1; }(Base)); -var Derived2 = (function (_super) { +var Derived2 = /** @class */ (function (_super) { __extends(Derived2, _super); function Derived2() { return _super !== null && _super.apply(this, arguments) || this; } return Derived2; }(Base)); -var C = (function () { +var C = /** @class */ (function () { function C() { } C.prototype.foo = function (x) { diff --git a/tests/baselines/reference/typesWithSpecializedConstructSignatures.js b/tests/baselines/reference/typesWithSpecializedConstructSignatures.js index b3de7f2efc5b3..db9502457d9d9 100644 --- a/tests/baselines/reference/typesWithSpecializedConstructSignatures.js +++ b/tests/baselines/reference/typesWithSpecializedConstructSignatures.js @@ -51,26 +51,26 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var Base = (function () { +var Base = /** @class */ (function () { function Base() { } return Base; }()); -var Derived1 = (function (_super) { +var Derived1 = /** @class */ (function (_super) { __extends(Derived1, _super); function Derived1() { return _super !== null && _super.apply(this, arguments) || this; } return Derived1; }(Base)); -var Derived2 = (function (_super) { +var Derived2 = /** @class */ (function (_super) { __extends(Derived2, _super); function Derived2() { return _super !== null && _super.apply(this, arguments) || this; } return Derived2; }(Base)); -var C = (function () { +var C = /** @class */ (function () { function C(x) { return x; } diff --git a/tests/baselines/reference/undeclaredBase.js b/tests/baselines/reference/undeclaredBase.js index fcb8ed3959570..169bc54b87d83 100644 --- a/tests/baselines/reference/undeclaredBase.js +++ b/tests/baselines/reference/undeclaredBase.js @@ -16,7 +16,7 @@ var __extends = (this && this.__extends) || (function () { })(); var M; (function (M) { - var C = (function (_super) { + var C = /** @class */ (function (_super) { __extends(C, _super); function C() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/undeclaredMethod.js b/tests/baselines/reference/undeclaredMethod.js index 071f45776aa57..4b269fd0bc304 100644 --- a/tests/baselines/reference/undeclaredMethod.js +++ b/tests/baselines/reference/undeclaredMethod.js @@ -15,7 +15,7 @@ c.saltbar(); // crash //// [undeclaredMethod.js] var M; (function (M) { - var C = (function () { + var C = /** @class */ (function () { function C() { } C.prototype.salt = function () { }; diff --git a/tests/baselines/reference/undefinedAssignableToEveryType.js b/tests/baselines/reference/undefinedAssignableToEveryType.js index 9646e7f4e87d5..507f647763a97 100644 --- a/tests/baselines/reference/undefinedAssignableToEveryType.js +++ b/tests/baselines/reference/undefinedAssignableToEveryType.js @@ -43,7 +43,7 @@ function foo(x: T, y: U, z: V) { //} //// [undefinedAssignableToEveryType.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } return C; diff --git a/tests/baselines/reference/undefinedIsSubtypeOfEverything.js b/tests/baselines/reference/undefinedIsSubtypeOfEverything.js index c5b08f061fda0..5492de86ce86e 100644 --- a/tests/baselines/reference/undefinedIsSubtypeOfEverything.js +++ b/tests/baselines/reference/undefinedIsSubtypeOfEverything.js @@ -133,110 +133,110 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var Base = (function () { +var Base = /** @class */ (function () { function Base() { } return Base; }()); -var D0 = (function (_super) { +var D0 = /** @class */ (function (_super) { __extends(D0, _super); function D0() { return _super !== null && _super.apply(this, arguments) || this; } return D0; }(Base)); -var DA = (function (_super) { +var DA = /** @class */ (function (_super) { __extends(DA, _super); function DA() { return _super !== null && _super.apply(this, arguments) || this; } return DA; }(Base)); -var D1 = (function (_super) { +var D1 = /** @class */ (function (_super) { __extends(D1, _super); function D1() { return _super !== null && _super.apply(this, arguments) || this; } return D1; }(Base)); -var D1A = (function (_super) { +var D1A = /** @class */ (function (_super) { __extends(D1A, _super); function D1A() { return _super !== null && _super.apply(this, arguments) || this; } return D1A; }(Base)); -var D2 = (function (_super) { +var D2 = /** @class */ (function (_super) { __extends(D2, _super); function D2() { return _super !== null && _super.apply(this, arguments) || this; } return D2; }(Base)); -var D2A = (function (_super) { +var D2A = /** @class */ (function (_super) { __extends(D2A, _super); function D2A() { return _super !== null && _super.apply(this, arguments) || this; } return D2A; }(Base)); -var D3 = (function (_super) { +var D3 = /** @class */ (function (_super) { __extends(D3, _super); function D3() { return _super !== null && _super.apply(this, arguments) || this; } return D3; }(Base)); -var D3A = (function (_super) { +var D3A = /** @class */ (function (_super) { __extends(D3A, _super); function D3A() { return _super !== null && _super.apply(this, arguments) || this; } return D3A; }(Base)); -var D4 = (function (_super) { +var D4 = /** @class */ (function (_super) { __extends(D4, _super); function D4() { return _super !== null && _super.apply(this, arguments) || this; } return D4; }(Base)); -var D5 = (function (_super) { +var D5 = /** @class */ (function (_super) { __extends(D5, _super); function D5() { return _super !== null && _super.apply(this, arguments) || this; } return D5; }(Base)); -var D6 = (function (_super) { +var D6 = /** @class */ (function (_super) { __extends(D6, _super); function D6() { return _super !== null && _super.apply(this, arguments) || this; } return D6; }(Base)); -var D7 = (function (_super) { +var D7 = /** @class */ (function (_super) { __extends(D7, _super); function D7() { return _super !== null && _super.apply(this, arguments) || this; } return D7; }(Base)); -var D8 = (function (_super) { +var D8 = /** @class */ (function (_super) { __extends(D8, _super); function D8() { return _super !== null && _super.apply(this, arguments) || this; } return D8; }(Base)); -var D9 = (function (_super) { +var D9 = /** @class */ (function (_super) { __extends(D9, _super); function D9() { return _super !== null && _super.apply(this, arguments) || this; } return D9; }(Base)); -var D10 = (function (_super) { +var D10 = /** @class */ (function (_super) { __extends(D10, _super); function D10() { return _super !== null && _super.apply(this, arguments) || this; @@ -247,7 +247,7 @@ var E; (function (E) { E[E["A"] = 0] = "A"; })(E || (E = {})); -var D11 = (function (_super) { +var D11 = /** @class */ (function (_super) { __extends(D11, _super); function D11() { return _super !== null && _super.apply(this, arguments) || this; @@ -258,14 +258,14 @@ function f() { } (function (f) { f.bar = 1; })(f || (f = {})); -var D12 = (function (_super) { +var D12 = /** @class */ (function (_super) { __extends(D12, _super); function D12() { return _super !== null && _super.apply(this, arguments) || this; } return D12; }(Base)); -var c = (function () { +var c = /** @class */ (function () { function c() { } return c; @@ -273,21 +273,21 @@ var c = (function () { (function (c) { c.bar = 1; })(c || (c = {})); -var D13 = (function (_super) { +var D13 = /** @class */ (function (_super) { __extends(D13, _super); function D13() { return _super !== null && _super.apply(this, arguments) || this; } return D13; }(Base)); -var D14 = (function (_super) { +var D14 = /** @class */ (function (_super) { __extends(D14, _super); function D14() { return _super !== null && _super.apply(this, arguments) || this; } return D14; }(Base)); -var D15 = (function (_super) { +var D15 = /** @class */ (function (_super) { __extends(D15, _super); function D15() { return _super !== null && _super.apply(this, arguments) || this; @@ -297,14 +297,14 @@ var D15 = (function (_super) { //class D15 extends Base { // foo: U; //} -var D16 = (function (_super) { +var D16 = /** @class */ (function (_super) { __extends(D16, _super); function D16() { return _super !== null && _super.apply(this, arguments) || this; } return D16; }(Base)); -var D17 = (function (_super) { +var D17 = /** @class */ (function (_super) { __extends(D17, _super); function D17() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/undefinedTypeAssignment4.js b/tests/baselines/reference/undefinedTypeAssignment4.js index 575042b72c0e4..227111db2546c 100644 --- a/tests/baselines/reference/undefinedTypeAssignment4.js +++ b/tests/baselines/reference/undefinedTypeAssignment4.js @@ -13,7 +13,7 @@ var y: typeof undefined; //// [undefinedTypeAssignment4.js] -var undefined = (function () { +var undefined = /** @class */ (function () { function undefined() { } return undefined; diff --git a/tests/baselines/reference/underscoreMapFirst.js b/tests/baselines/reference/underscoreMapFirst.js index dcd95f85a12dc..ae4e2e400451a 100644 --- a/tests/baselines/reference/underscoreMapFirst.js +++ b/tests/baselines/reference/underscoreMapFirst.js @@ -59,7 +59,7 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var MyView = (function (_super) { +var MyView = /** @class */ (function (_super) { __extends(MyView, _super); function MyView() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/underscoreThisInDerivedClass01.js b/tests/baselines/reference/underscoreThisInDerivedClass01.js index 412364e55dda7..4663b4f75ecde 100644 --- a/tests/baselines/reference/underscoreThisInDerivedClass01.js +++ b/tests/baselines/reference/underscoreThisInDerivedClass01.js @@ -43,13 +43,13 @@ var __extends = (this && this.__extends) || (function () { // Constructors have adopted the same identifier name ('_this') // for capturing any potential return values from super calls, // so we expect the same behavior. -var C = (function () { +var C = /** @class */ (function () { function C() { return {}; } return C; }()); -var D = (function (_super) { +var D = /** @class */ (function (_super) { __extends(D, _super); function D() { var _this = this; diff --git a/tests/baselines/reference/underscoreThisInDerivedClass02.js b/tests/baselines/reference/underscoreThisInDerivedClass02.js index cb51f248e078e..d88f8eba10190 100644 --- a/tests/baselines/reference/underscoreThisInDerivedClass02.js +++ b/tests/baselines/reference/underscoreThisInDerivedClass02.js @@ -32,13 +32,13 @@ var __extends = (this && this.__extends) || (function () { // Original test intent: // Errors on '_this' should be reported in derived constructors, // even if 'super()' is not called. -var C = (function () { +var C = /** @class */ (function () { function C() { return {}; } return C; }()); -var D = (function (_super) { +var D = /** @class */ (function (_super) { __extends(D, _super); function D() { var _this = this; diff --git a/tests/baselines/reference/unexpectedStatementBlockTerminator.js b/tests/baselines/reference/unexpectedStatementBlockTerminator.js index f06b75c1340e7..fb932bbbf6da2 100644 --- a/tests/baselines/reference/unexpectedStatementBlockTerminator.js +++ b/tests/baselines/reference/unexpectedStatementBlockTerminator.js @@ -8,12 +8,12 @@ function Goo() {return {a:1,b:2};} //// [unexpectedStatementBlockTerminator.js] -var Foo = (function () { +var Foo = /** @class */ (function () { function Foo() { } return Foo; }()); -var Bar = (function () { +var Bar = /** @class */ (function () { function Bar() { } return Bar; diff --git a/tests/baselines/reference/unexportedInstanceClassVariables.js b/tests/baselines/reference/unexportedInstanceClassVariables.js index 5cb0723931a3e..470ed4c1ff837 100644 --- a/tests/baselines/reference/unexportedInstanceClassVariables.js +++ b/tests/baselines/reference/unexportedInstanceClassVariables.js @@ -15,14 +15,14 @@ module M{ //// [unexportedInstanceClassVariables.js] var M; (function (M) { - var A = (function () { + var A = /** @class */ (function () { function A(val) { } return A; }()); })(M || (M = {})); (function (M) { - var A = (function () { + var A = /** @class */ (function () { function A() { } return A; diff --git a/tests/baselines/reference/unionSubtypeIfEveryConstituentTypeIsSubtype.js b/tests/baselines/reference/unionSubtypeIfEveryConstituentTypeIsSubtype.js index a8cc0e12d27ae..70cdcf3c31fd9 100644 --- a/tests/baselines/reference/unionSubtypeIfEveryConstituentTypeIsSubtype.js +++ b/tests/baselines/reference/unionSubtypeIfEveryConstituentTypeIsSubtype.js @@ -149,12 +149,12 @@ var e; e[e["e1"] = 0] = "e1"; e[e["e2"] = 1] = "e2"; })(e || (e = {})); -var A = (function () { +var A = /** @class */ (function () { function A() { } return A; }()); -var A2 = (function () { +var A2 = /** @class */ (function () { function A2() { } return A2; @@ -167,7 +167,7 @@ function f() { } (function (f) { f.bar = 1; })(f || (f = {})); -var c = (function () { +var c = /** @class */ (function () { function c() { } return c; diff --git a/tests/baselines/reference/unionTypeEquivalence.js b/tests/baselines/reference/unionTypeEquivalence.js index 11ef3a7974eaf..a1e58dc4f946d 100644 --- a/tests/baselines/reference/unionTypeEquivalence.js +++ b/tests/baselines/reference/unionTypeEquivalence.js @@ -31,12 +31,12 @@ var __extends = (this && this.__extends) || (function () { }; })(); // A | B is equivalent to A if B is a subtype of A -var C = (function () { +var C = /** @class */ (function () { function C() { } return C; }()); -var D = (function (_super) { +var D = /** @class */ (function (_super) { __extends(D, _super); function D() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/unionTypeFromArrayLiteral.js b/tests/baselines/reference/unionTypeFromArrayLiteral.js index 11f53a8b98562..b7390535b02dc 100644 --- a/tests/baselines/reference/unionTypeFromArrayLiteral.js +++ b/tests/baselines/reference/unionTypeFromArrayLiteral.js @@ -44,19 +44,19 @@ var arr3Tuple = [3, "three"]; // [number, string] var arr4Tuple = [3, "three", "hello"]; // [number, string, string] var arrEmpty = []; var arr5Tuple = ["hello", true, false, " hello", true, 10, "any"]; // Tuple -var C = (function () { +var C = /** @class */ (function () { function C() { } C.prototype.foo = function () { }; return C; }()); -var D = (function () { +var D = /** @class */ (function () { function D() { } D.prototype.foo2 = function () { }; return D; }()); -var E = (function (_super) { +var E = /** @class */ (function (_super) { __extends(E, _super); function E() { return _super !== null && _super.apply(this, arguments) || this; @@ -64,7 +64,7 @@ var E = (function (_super) { E.prototype.foo3 = function () { }; return E; }(C)); -var F = (function (_super) { +var F = /** @class */ (function (_super) { __extends(F, _super); function F() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/unionTypePropertyAccessibility.js b/tests/baselines/reference/unionTypePropertyAccessibility.js index afa8d07c242bc..95c7601a7a9bc 100644 --- a/tests/baselines/reference/unionTypePropertyAccessibility.js +++ b/tests/baselines/reference/unionTypePropertyAccessibility.js @@ -49,22 +49,22 @@ v15.member; //// [unionTypePropertyAccessibility.js] -var Default = (function () { +var Default = /** @class */ (function () { function Default() { } return Default; }()); -var Public = (function () { +var Public = /** @class */ (function () { function Public() { } return Public; }()); -var Protected = (function () { +var Protected = /** @class */ (function () { function Protected() { } return Protected; }()); -var Private = (function () { +var Private = /** @class */ (function () { function Private() { } return Private; diff --git a/tests/baselines/reference/unionTypeWithRecursiveSubtypeReduction1.js b/tests/baselines/reference/unionTypeWithRecursiveSubtypeReduction1.js index 46ca2a40e83dc..d7ba2008d0156 100644 --- a/tests/baselines/reference/unionTypeWithRecursiveSubtypeReduction1.js +++ b/tests/baselines/reference/unionTypeWithRecursiveSubtypeReduction1.js @@ -20,22 +20,22 @@ t.parent; //// [unionTypeWithRecursiveSubtypeReduction1.js] -var Module = (function () { +var Module = /** @class */ (function () { function Module() { } return Module; }()); -var Namespace = (function () { +var Namespace = /** @class */ (function () { function Namespace() { } return Namespace; }()); -var Class = (function () { +var Class = /** @class */ (function () { function Class() { } return Class; }()); -var Property = (function () { +var Property = /** @class */ (function () { function Property() { } return Property; diff --git a/tests/baselines/reference/unionTypeWithRecursiveSubtypeReduction2.js b/tests/baselines/reference/unionTypeWithRecursiveSubtypeReduction2.js index b3eeb8ea2442a..268e5574db00a 100644 --- a/tests/baselines/reference/unionTypeWithRecursiveSubtypeReduction2.js +++ b/tests/baselines/reference/unionTypeWithRecursiveSubtypeReduction2.js @@ -22,22 +22,22 @@ p = c; //// [unionTypeWithRecursiveSubtypeReduction2.js] -var Module = (function () { +var Module = /** @class */ (function () { function Module() { } return Module; }()); -var Namespace = (function () { +var Namespace = /** @class */ (function () { function Namespace() { } return Namespace; }()); -var Class = (function () { +var Class = /** @class */ (function () { function Class() { } return Class; }()); -var Property = (function () { +var Property = /** @class */ (function () { function Property() { } return Property; diff --git a/tests/baselines/reference/unionTypesAssignability.js b/tests/baselines/reference/unionTypesAssignability.js index a26de7d2747dd..94ead2da0cac4 100644 --- a/tests/baselines/reference/unionTypesAssignability.js +++ b/tests/baselines/reference/unionTypesAssignability.js @@ -85,12 +85,12 @@ var __extends = (this && this.__extends) || (function () { }; })(); var unionNumberString; -var C = (function () { +var C = /** @class */ (function () { function C() { } return C; }()); -var D = (function (_super) { +var D = /** @class */ (function (_super) { __extends(D, _super); function D() { return _super !== null && _super.apply(this, arguments) || this; @@ -98,7 +98,7 @@ var D = (function (_super) { D.prototype.foo1 = function () { }; return D; }(C)); -var E = (function (_super) { +var E = /** @class */ (function (_super) { __extends(E, _super); function E() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/unknownSymbolInGenericReturnType.js b/tests/baselines/reference/unknownSymbolInGenericReturnType.js index 27788285b2403..5f8f1c0178380 100644 --- a/tests/baselines/reference/unknownSymbolInGenericReturnType.js +++ b/tests/baselines/reference/unknownSymbolInGenericReturnType.js @@ -13,7 +13,7 @@ class Linq { //// [unknownSymbolInGenericReturnType.js] -var Linq = (function () { +var Linq = /** @class */ (function () { function Linq() { } Linq.select = function (values, func) { diff --git a/tests/baselines/reference/unknownSymbols1.js b/tests/baselines/reference/unknownSymbols1.js index 7ec636f672a93..144565016c09d 100644 --- a/tests/baselines/reference/unknownSymbols1.js +++ b/tests/baselines/reference/unknownSymbols1.js @@ -50,22 +50,22 @@ function foo2() { return asdf; } var z = x; // should be an error -var C = (function () { +var C = /** @class */ (function () { function C() { } return C; }()); -var C2 = (function () { +var C2 = /** @class */ (function () { function C2() { } return C2; }()); -var C3 = (function () { +var C3 = /** @class */ (function () { function C3(x) { } return C3; }()); -var C4 = (function (_super) { +var C4 = /** @class */ (function (_super) { __extends(C4, _super); function C4() { return _super.call(this, asdf) || this; @@ -73,7 +73,7 @@ var C4 = (function (_super) { return C4; }(C3)); var x2 = this.asdf; // no error, this is any -var C5 = (function () { +var C5 = /** @class */ (function () { function C5() { this.asdf = asdf; } diff --git a/tests/baselines/reference/unknownTypeArgOnCall.js b/tests/baselines/reference/unknownTypeArgOnCall.js index 129e2e351f15a..3176ab8d565f1 100644 --- a/tests/baselines/reference/unknownTypeArgOnCall.js +++ b/tests/baselines/reference/unknownTypeArgOnCall.js @@ -9,7 +9,7 @@ var r = f.clone() //// [unknownTypeArgOnCall.js] -var Foo = (function () { +var Foo = /** @class */ (function () { function Foo() { } Foo.prototype.clone = function () { diff --git a/tests/baselines/reference/unqualifiedCallToClassStatic1.js b/tests/baselines/reference/unqualifiedCallToClassStatic1.js index 6c78a737fe862..2ca2dfe713104 100644 --- a/tests/baselines/reference/unqualifiedCallToClassStatic1.js +++ b/tests/baselines/reference/unqualifiedCallToClassStatic1.js @@ -7,7 +7,7 @@ class Vector { } //// [unqualifiedCallToClassStatic1.js] -var Vector = (function () { +var Vector = /** @class */ (function () { function Vector() { } Vector.foo = function () { diff --git a/tests/baselines/reference/unspecializedConstraints.js b/tests/baselines/reference/unspecializedConstraints.js index 4c459c29be1d6..aa2cbd22c5055 100644 --- a/tests/baselines/reference/unspecializedConstraints.js +++ b/tests/baselines/reference/unspecializedConstraints.js @@ -166,12 +166,12 @@ var __extends = (this && this.__extends) || (function () { })(); var ts; (function (ts) { - var Symbol = (function () { + var Symbol = /** @class */ (function () { function Symbol() { } return Symbol; }()); - var Type = (function (_super) { + var Type = /** @class */ (function (_super) { __extends(Type, _super); function Type() { return _super !== null && _super.apply(this, arguments) || this; @@ -235,7 +235,7 @@ var ts; }; return Type; }(Symbol)); - var Property = (function (_super) { + var Property = /** @class */ (function (_super) { __extends(Property, _super); function Property(name, type, flags) { var _this = _super.call(this) || this; @@ -256,7 +256,7 @@ var ts; PropertyFlags[PropertyFlags["Optional"] = 1] = "Optional"; PropertyFlags[PropertyFlags["Private"] = 2] = "Private"; })(PropertyFlags || (PropertyFlags = {})); - var Signature = (function (_super) { + var Signature = /** @class */ (function (_super) { __extends(Signature, _super); function Signature(typeParameters, parameters, returnType) { var _this = _super.call(this) || this; @@ -277,7 +277,7 @@ var ts; }; return Signature; }(Symbol)); - var Parameter = (function (_super) { + var Parameter = /** @class */ (function (_super) { __extends(Parameter, _super); function Parameter(name, type, flags) { var _this = _super.call(this) || this; diff --git a/tests/baselines/reference/untypedFunctionCallsWithTypeParameters1.js b/tests/baselines/reference/untypedFunctionCallsWithTypeParameters1.js index a4f2d1ff2fcf7..fcea4e7b757de 100644 --- a/tests/baselines/reference/untypedFunctionCallsWithTypeParameters1.js +++ b/tests/baselines/reference/untypedFunctionCallsWithTypeParameters1.js @@ -61,7 +61,7 @@ var y = x; var r2 = y(); var c; var r3 = c(); // should be an error -var C = (function () { +var C = /** @class */ (function () { function C() { this.prototype = null; this.length = 1; @@ -72,7 +72,7 @@ var C = (function () { }()); var c2; var r4 = c2(); // should be an error -var C2 = (function (_super) { +var C2 = /** @class */ (function (_super) { __extends(C2, _super); function C2() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/unusedClassesinModule1.js b/tests/baselines/reference/unusedClassesinModule1.js index 4ffdc0d881280..3739a6cd63686 100644 --- a/tests/baselines/reference/unusedClassesinModule1.js +++ b/tests/baselines/reference/unusedClassesinModule1.js @@ -9,7 +9,7 @@ module A { //// [unusedClassesinModule1.js] var A; (function (A) { - var Calculator = (function () { + var Calculator = /** @class */ (function () { function Calculator() { } Calculator.prototype.handelChar = function () { diff --git a/tests/baselines/reference/unusedClassesinNamespace1.js b/tests/baselines/reference/unusedClassesinNamespace1.js index 0698cda666f04..b0c085c127dfc 100644 --- a/tests/baselines/reference/unusedClassesinNamespace1.js +++ b/tests/baselines/reference/unusedClassesinNamespace1.js @@ -8,7 +8,7 @@ namespace Validation { //// [unusedClassesinNamespace1.js] var Validation; (function (Validation) { - var c1 = (function () { + var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/unusedClassesinNamespace2.js b/tests/baselines/reference/unusedClassesinNamespace2.js index 79f400ecbc54b..039d34f2ca09d 100644 --- a/tests/baselines/reference/unusedClassesinNamespace2.js +++ b/tests/baselines/reference/unusedClassesinNamespace2.js @@ -12,12 +12,12 @@ namespace Validation { //// [unusedClassesinNamespace2.js] var Validation; (function (Validation) { - var c1 = (function () { + var c1 = /** @class */ (function () { function c1() { } return c1; }()); - var c2 = (function () { + var c2 = /** @class */ (function () { function c2() { } return c2; diff --git a/tests/baselines/reference/unusedClassesinNamespace3.js b/tests/baselines/reference/unusedClassesinNamespace3.js index d5139df3dad09..67a31a67a449f 100644 --- a/tests/baselines/reference/unusedClassesinNamespace3.js +++ b/tests/baselines/reference/unusedClassesinNamespace3.js @@ -14,12 +14,12 @@ namespace Validation { //// [unusedClassesinNamespace3.js] var Validation; (function (Validation) { - var c1 = (function () { + var c1 = /** @class */ (function () { function c1() { } return c1; }()); - var c2 = (function () { + var c2 = /** @class */ (function () { function c2() { } return c2; diff --git a/tests/baselines/reference/unusedClassesinNamespace4.js b/tests/baselines/reference/unusedClassesinNamespace4.js index 096e7acb62bd7..1db8c805ccdb9 100644 --- a/tests/baselines/reference/unusedClassesinNamespace4.js +++ b/tests/baselines/reference/unusedClassesinNamespace4.js @@ -26,18 +26,18 @@ var __extends = (this && this.__extends) || (function () { })(); var Validation; (function (Validation) { - var c1 = (function () { + var c1 = /** @class */ (function () { function c1() { } return c1; }()); - var c2 = (function () { + var c2 = /** @class */ (function () { function c2() { } return c2; }()); Validation.c2 = c2; - var c3 = (function (_super) { + var c3 = /** @class */ (function (_super) { __extends(c3, _super); function c3() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/unusedClassesinNamespace5.js b/tests/baselines/reference/unusedClassesinNamespace5.js index c96b9e3a06b9d..0c4ef8ee44be7 100644 --- a/tests/baselines/reference/unusedClassesinNamespace5.js +++ b/tests/baselines/reference/unusedClassesinNamespace5.js @@ -16,18 +16,18 @@ namespace Validation { //// [unusedClassesinNamespace5.js] var Validation; (function (Validation) { - var c1 = (function () { + var c1 = /** @class */ (function () { function c1() { } return c1; }()); - var c2 = (function () { + var c2 = /** @class */ (function () { function c2() { } return c2; }()); Validation.c2 = c2; - var c3 = (function () { + var c3 = /** @class */ (function () { function c3() { } return c3; diff --git a/tests/baselines/reference/unusedGetterInClass.js b/tests/baselines/reference/unusedGetterInClass.js index 2109ff9ebe482..0bdbf0066086c 100644 --- a/tests/baselines/reference/unusedGetterInClass.js +++ b/tests/baselines/reference/unusedGetterInClass.js @@ -8,7 +8,7 @@ class Employee { } //// [unusedGetterInClass.js] -var Employee = (function () { +var Employee = /** @class */ (function () { function Employee() { } Object.defineProperty(Employee.prototype, "fullName", { diff --git a/tests/baselines/reference/unusedIdentifiersConsolidated1.js b/tests/baselines/reference/unusedIdentifiersConsolidated1.js index 401da10769792..f0c63e3b76597 100644 --- a/tests/baselines/reference/unusedIdentifiersConsolidated1.js +++ b/tests/baselines/reference/unusedIdentifiersConsolidated1.js @@ -115,7 +115,7 @@ var __extends = (this && this.__extends) || (function () { function greeter(person) { var unused = 20; } -var Dummy = (function () { +var Dummy = /** @class */ (function () { function Dummy(message) { var unused2 = 22; this.greeting = "Dummy Message"; @@ -136,7 +136,7 @@ var Validation; (function (Validation) { var lettersRegexp = /^[A-Za-z]+$/; var numberRegexp = /^[0-9]+$/; - var LettersOnlyValidator = (function () { + var LettersOnlyValidator = /** @class */ (function () { function LettersOnlyValidator() { } LettersOnlyValidator.prototype.isAcceptable = function (s2) { @@ -147,7 +147,7 @@ var Validation; return LettersOnlyValidator; }()); Validation.LettersOnlyValidator = LettersOnlyValidator; - var ZipCodeValidator = (function () { + var ZipCodeValidator = /** @class */ (function () { function ZipCodeValidator() { } ZipCodeValidator.prototype.isAcceptable = function (s3) { @@ -156,7 +156,7 @@ var Validation; return ZipCodeValidator; }()); Validation.ZipCodeValidator = ZipCodeValidator; - var dummy = (function () { + var dummy = /** @class */ (function () { function dummy() { } return dummy; @@ -164,12 +164,12 @@ var Validation; })(Validation || (Validation = {})); var Greeter; (function (Greeter) { - var class1 = (function () { + var class1 = /** @class */ (function () { function class1() { } return class1; }()); - var class2 = (function (_super) { + var class2 = /** @class */ (function (_super) { __extends(class2, _super); function class2() { return _super !== null && _super.apply(this, arguments) || this; @@ -177,12 +177,12 @@ var Greeter; return class2; }(class1)); Greeter.class2 = class2; - var class3 = (function () { + var class3 = /** @class */ (function () { function class3() { } return class3; }()); - var class4 = (function () { + var class4 = /** @class */ (function () { function class4() { } return class4; diff --git a/tests/baselines/reference/unusedImportDeclaration.js b/tests/baselines/reference/unusedImportDeclaration.js index 37f88dc65c32a..df84d925cd12c 100644 --- a/tests/baselines/reference/unusedImportDeclaration.js +++ b/tests/baselines/reference/unusedImportDeclaration.js @@ -17,7 +17,7 @@ foo("IN " + thingy.me + "!"); //// [unusedImportDeclaration_testerB.js] "use strict"; -var TesterB = (function () { +var TesterB = /** @class */ (function () { function TesterB() { } return TesterB; diff --git a/tests/baselines/reference/unusedImports1.js b/tests/baselines/reference/unusedImports1.js index 6e7f90b9d544e..dba6514344e72 100644 --- a/tests/baselines/reference/unusedImports1.js +++ b/tests/baselines/reference/unusedImports1.js @@ -11,7 +11,7 @@ import {Calculator} from "./file1" //// [file1.js] "use strict"; exports.__esModule = true; -var Calculator = (function () { +var Calculator = /** @class */ (function () { function Calculator() { } return Calculator; diff --git a/tests/baselines/reference/unusedImports10.js b/tests/baselines/reference/unusedImports10.js index 5f40c1f1fa18d..7c0341d821e55 100644 --- a/tests/baselines/reference/unusedImports10.js +++ b/tests/baselines/reference/unusedImports10.js @@ -13,7 +13,7 @@ module B { //// [unusedImports10.js] var A; (function (A) { - var Calculator = (function () { + var Calculator = /** @class */ (function () { function Calculator() { } Calculator.prototype.handelChar = function () { diff --git a/tests/baselines/reference/unusedImports11.js b/tests/baselines/reference/unusedImports11.js index def7220e54579..198dc10e75823 100644 --- a/tests/baselines/reference/unusedImports11.js +++ b/tests/baselines/reference/unusedImports11.js @@ -20,7 +20,7 @@ new r.Member(); //// [b.js] "use strict"; exports.__esModule = true; -var Member = (function () { +var Member = /** @class */ (function () { function Member() { } return Member; diff --git a/tests/baselines/reference/unusedImports12.js b/tests/baselines/reference/unusedImports12.js index 32f0c05136029..4dc10f1114bdd 100644 --- a/tests/baselines/reference/unusedImports12.js +++ b/tests/baselines/reference/unusedImports12.js @@ -15,7 +15,7 @@ import r = require("./b"); //// [b.js] "use strict"; exports.__esModule = true; -var Member = (function () { +var Member = /** @class */ (function () { function Member() { } return Member; diff --git a/tests/baselines/reference/unusedImports2.js b/tests/baselines/reference/unusedImports2.js index 5f01507a44431..cfece638c0148 100644 --- a/tests/baselines/reference/unusedImports2.js +++ b/tests/baselines/reference/unusedImports2.js @@ -19,7 +19,7 @@ x.handleChar(); //// [file1.js] "use strict"; exports.__esModule = true; -var Calculator = (function () { +var Calculator = /** @class */ (function () { function Calculator() { } Calculator.prototype.handleChar = function () { }; diff --git a/tests/baselines/reference/unusedImports3.js b/tests/baselines/reference/unusedImports3.js index 788cecf54703b..9c6bde30c3e01 100644 --- a/tests/baselines/reference/unusedImports3.js +++ b/tests/baselines/reference/unusedImports3.js @@ -22,7 +22,7 @@ test2(); //// [file1.js] "use strict"; exports.__esModule = true; -var Calculator = (function () { +var Calculator = /** @class */ (function () { function Calculator() { } Calculator.prototype.handleChar = function () { }; diff --git a/tests/baselines/reference/unusedImports4.js b/tests/baselines/reference/unusedImports4.js index cfcc9eb1a61c0..e6bb41a27f0ad 100644 --- a/tests/baselines/reference/unusedImports4.js +++ b/tests/baselines/reference/unusedImports4.js @@ -23,7 +23,7 @@ test2(); //// [file1.js] "use strict"; exports.__esModule = true; -var Calculator = (function () { +var Calculator = /** @class */ (function () { function Calculator() { } Calculator.prototype.handleChar = function () { }; diff --git a/tests/baselines/reference/unusedImports5.js b/tests/baselines/reference/unusedImports5.js index 0ee931e57a59b..7a3b428f0f2cb 100644 --- a/tests/baselines/reference/unusedImports5.js +++ b/tests/baselines/reference/unusedImports5.js @@ -23,7 +23,7 @@ test(); //// [file1.js] "use strict"; exports.__esModule = true; -var Calculator = (function () { +var Calculator = /** @class */ (function () { function Calculator() { } Calculator.prototype.handleChar = function () { }; diff --git a/tests/baselines/reference/unusedImports6.js b/tests/baselines/reference/unusedImports6.js index ea7392de4e15c..e6c61a8c3adaf 100644 --- a/tests/baselines/reference/unusedImports6.js +++ b/tests/baselines/reference/unusedImports6.js @@ -23,7 +23,7 @@ import d from "./file1" //// [file1.js] "use strict"; exports.__esModule = true; -var Calculator = (function () { +var Calculator = /** @class */ (function () { function Calculator() { } Calculator.prototype.handleChar = function () { }; diff --git a/tests/baselines/reference/unusedImports7.js b/tests/baselines/reference/unusedImports7.js index dc4f707f62999..ff410cf04b081 100644 --- a/tests/baselines/reference/unusedImports7.js +++ b/tests/baselines/reference/unusedImports7.js @@ -21,7 +21,7 @@ import * as n from "./file1" //// [file1.js] "use strict"; exports.__esModule = true; -var Calculator = (function () { +var Calculator = /** @class */ (function () { function Calculator() { } Calculator.prototype.handleChar = function () { }; diff --git a/tests/baselines/reference/unusedImports8.js b/tests/baselines/reference/unusedImports8.js index 88983976362b1..45eded59c2afc 100644 --- a/tests/baselines/reference/unusedImports8.js +++ b/tests/baselines/reference/unusedImports8.js @@ -23,7 +23,7 @@ t1(); //// [file1.js] "use strict"; exports.__esModule = true; -var Calculator = (function () { +var Calculator = /** @class */ (function () { function Calculator() { } Calculator.prototype.handleChar = function () { }; diff --git a/tests/baselines/reference/unusedImports9.js b/tests/baselines/reference/unusedImports9.js index e089a1445b9c3..8ed4d5efd1bbb 100644 --- a/tests/baselines/reference/unusedImports9.js +++ b/tests/baselines/reference/unusedImports9.js @@ -19,7 +19,7 @@ import c = require('./file1') //// [file1.js] "use strict"; exports.__esModule = true; -var Calculator = (function () { +var Calculator = /** @class */ (function () { function Calculator() { } Calculator.prototype.handleChar = function () { }; diff --git a/tests/baselines/reference/unusedInterfaceinNamespace4.js b/tests/baselines/reference/unusedInterfaceinNamespace4.js index 76d89639413dd..78447bc756a0a 100644 --- a/tests/baselines/reference/unusedInterfaceinNamespace4.js +++ b/tests/baselines/reference/unusedInterfaceinNamespace4.js @@ -20,7 +20,7 @@ namespace Validation { //// [unusedInterfaceinNamespace4.js] var Validation; (function (Validation) { - var c1 = (function () { + var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/unusedInterfaceinNamespace5.js b/tests/baselines/reference/unusedInterfaceinNamespace5.js index 2b5d61450f242..e4aba1deba3e8 100644 --- a/tests/baselines/reference/unusedInterfaceinNamespace5.js +++ b/tests/baselines/reference/unusedInterfaceinNamespace5.js @@ -26,7 +26,7 @@ namespace Validation { //// [unusedInterfaceinNamespace5.js] var Validation; (function (Validation) { - var c1 = (function () { + var c1 = /** @class */ (function () { function c1() { } return c1; diff --git a/tests/baselines/reference/unusedInvalidTypeArguments.js b/tests/baselines/reference/unusedInvalidTypeArguments.js index 9f32181a0fb34..86433be8ad9ec 100644 --- a/tests/baselines/reference/unusedInvalidTypeArguments.js +++ b/tests/baselines/reference/unusedInvalidTypeArguments.js @@ -64,13 +64,13 @@ var __extends = (this && this.__extends) || (function () { }; })(); exports.__esModule = true; -var C = (function () { +var C = /** @class */ (function () { function C() { } return C; }()); // This uses getTypeFromClassOrInterfaceReference instead of getTypeFromTypeAliasReference. -var D = (function (_super) { +var D = /** @class */ (function (_super) { __extends(D, _super); function D() { return _super !== null && _super.apply(this, arguments) || this; @@ -108,7 +108,7 @@ var __extends = (this && this.__extends) || (function () { })(); exports.__esModule = true; var unknown_1 = require("unknown"); -var C = (function (_super) { +var C = /** @class */ (function (_super) { __extends(C, _super); function C() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/unusedLocalProperty.js b/tests/baselines/reference/unusedLocalProperty.js index a124b752125d7..d265345c109dc 100644 --- a/tests/baselines/reference/unusedLocalProperty.js +++ b/tests/baselines/reference/unusedLocalProperty.js @@ -13,7 +13,7 @@ class Animal { //// [unusedLocalProperty.js] -var Animal = (function () { +var Animal = /** @class */ (function () { function Animal(species) { this.species = species; } diff --git a/tests/baselines/reference/unusedLocalsAndParameters.js b/tests/baselines/reference/unusedLocalsAndParameters.js index eb4db589c5369..c66040cf50f95 100644 --- a/tests/baselines/reference/unusedLocalsAndParameters.js +++ b/tests/baselines/reference/unusedLocalsAndParameters.js @@ -97,7 +97,7 @@ fexp(0); // arrow function paramter var farrow = function (a) { }; -var C = (function () { +var C = /** @class */ (function () { function C() { } // Method declaration paramter @@ -112,7 +112,7 @@ var C = (function () { }); return C; }()); -var E = (function () { +var E = /** @class */ (function () { function class_1() { } // Method declaration paramter diff --git a/tests/baselines/reference/unusedLocalsAndParametersDeferred.js b/tests/baselines/reference/unusedLocalsAndParametersDeferred.js index faa5ad2b0dfe2..df8b7d7e48731 100644 --- a/tests/baselines/reference/unusedLocalsAndParametersDeferred.js +++ b/tests/baselines/reference/unusedLocalsAndParametersDeferred.js @@ -187,7 +187,7 @@ var farrow = function (a) { }; farrow(2); var prop1; -var C = (function () { +var C = /** @class */ (function () { function C() { // in a property initalizer this.p = defered(function () { @@ -214,7 +214,7 @@ var C = (function () { }()); new C(); var prop2; -var E = (function () { +var E = /** @class */ (function () { function class_1() { // in a property initalizer this.p = defered(function () { diff --git a/tests/baselines/reference/unusedLocalsAndParametersOverloadSignatures.js b/tests/baselines/reference/unusedLocalsAndParametersOverloadSignatures.js index 559a2cb7761e8..883c127e585cc 100644 --- a/tests/baselines/reference/unusedLocalsAndParametersOverloadSignatures.js +++ b/tests/baselines/reference/unusedLocalsAndParametersOverloadSignatures.js @@ -29,7 +29,7 @@ function func(details, message) { return details + message; } exports.func = func; -var C = (function () { +var C = /** @class */ (function () { function C(details, message) { details + message; } diff --git a/tests/baselines/reference/unusedLocalsInMethod1.js b/tests/baselines/reference/unusedLocalsInMethod1.js index cec478ef204db..52250609b8176 100644 --- a/tests/baselines/reference/unusedLocalsInMethod1.js +++ b/tests/baselines/reference/unusedLocalsInMethod1.js @@ -6,7 +6,7 @@ class greeter { } //// [unusedLocalsInMethod1.js] -var greeter = (function () { +var greeter = /** @class */ (function () { function greeter() { } greeter.prototype.function1 = function () { diff --git a/tests/baselines/reference/unusedLocalsInMethod2.js b/tests/baselines/reference/unusedLocalsInMethod2.js index f02d27f586e5d..e232b9bf2630b 100644 --- a/tests/baselines/reference/unusedLocalsInMethod2.js +++ b/tests/baselines/reference/unusedLocalsInMethod2.js @@ -7,7 +7,7 @@ class greeter { } //// [unusedLocalsInMethod2.js] -var greeter = (function () { +var greeter = /** @class */ (function () { function greeter() { } greeter.prototype.function1 = function () { diff --git a/tests/baselines/reference/unusedLocalsInMethod3.js b/tests/baselines/reference/unusedLocalsInMethod3.js index e13958c13b6d9..7b027d719fd2a 100644 --- a/tests/baselines/reference/unusedLocalsInMethod3.js +++ b/tests/baselines/reference/unusedLocalsInMethod3.js @@ -7,7 +7,7 @@ class greeter { } //// [unusedLocalsInMethod3.js] -var greeter = (function () { +var greeter = /** @class */ (function () { function greeter() { } greeter.prototype.function1 = function () { diff --git a/tests/baselines/reference/unusedLocalsinConstructor1.js b/tests/baselines/reference/unusedLocalsinConstructor1.js index 5e3528d95ce18..a0c8eba7867d1 100644 --- a/tests/baselines/reference/unusedLocalsinConstructor1.js +++ b/tests/baselines/reference/unusedLocalsinConstructor1.js @@ -6,7 +6,7 @@ class greeter { } //// [unusedLocalsinConstructor1.js] -var greeter = (function () { +var greeter = /** @class */ (function () { function greeter() { var unused = 20; } diff --git a/tests/baselines/reference/unusedLocalsinConstructor2.js b/tests/baselines/reference/unusedLocalsinConstructor2.js index 53f9e747659e7..b61d8be9cb92d 100644 --- a/tests/baselines/reference/unusedLocalsinConstructor2.js +++ b/tests/baselines/reference/unusedLocalsinConstructor2.js @@ -8,7 +8,7 @@ class greeter { } //// [unusedLocalsinConstructor2.js] -var greeter = (function () { +var greeter = /** @class */ (function () { function greeter() { var unused = 20; var used = "dummy"; diff --git a/tests/baselines/reference/unusedMultipleParameter1InContructor.js b/tests/baselines/reference/unusedMultipleParameter1InContructor.js index a41b54ad726d1..d018dcbfd85f8 100644 --- a/tests/baselines/reference/unusedMultipleParameter1InContructor.js +++ b/tests/baselines/reference/unusedMultipleParameter1InContructor.js @@ -7,7 +7,7 @@ class Dummy { } //// [unusedMultipleParameter1InContructor.js] -var Dummy = (function () { +var Dummy = /** @class */ (function () { function Dummy(person, person2) { var unused = 20; person2 = "Dummy value"; diff --git a/tests/baselines/reference/unusedMultipleParameter2InContructor.js b/tests/baselines/reference/unusedMultipleParameter2InContructor.js index eab051fcb7c2f..a21c8be5f2aab 100644 --- a/tests/baselines/reference/unusedMultipleParameter2InContructor.js +++ b/tests/baselines/reference/unusedMultipleParameter2InContructor.js @@ -7,7 +7,7 @@ class Dummy { } //// [unusedMultipleParameter2InContructor.js] -var Dummy = (function () { +var Dummy = /** @class */ (function () { function Dummy(person, person2, person3) { var unused = 20; person2 = "Dummy value"; diff --git a/tests/baselines/reference/unusedMultipleParameters1InMethodDeclaration.js b/tests/baselines/reference/unusedMultipleParameters1InMethodDeclaration.js index 3189618a48a06..e06930a9f948b 100644 --- a/tests/baselines/reference/unusedMultipleParameters1InMethodDeclaration.js +++ b/tests/baselines/reference/unusedMultipleParameters1InMethodDeclaration.js @@ -7,7 +7,7 @@ class Dummy { } //// [unusedMultipleParameters1InMethodDeclaration.js] -var Dummy = (function () { +var Dummy = /** @class */ (function () { function Dummy() { } Dummy.prototype.greeter = function (person, person2) { diff --git a/tests/baselines/reference/unusedMultipleParameters2InMethodDeclaration.js b/tests/baselines/reference/unusedMultipleParameters2InMethodDeclaration.js index 357a96c2e24e4..b72cccdf84a69 100644 --- a/tests/baselines/reference/unusedMultipleParameters2InMethodDeclaration.js +++ b/tests/baselines/reference/unusedMultipleParameters2InMethodDeclaration.js @@ -7,7 +7,7 @@ class Dummy { } //// [unusedMultipleParameters2InMethodDeclaration.js] -var Dummy = (function () { +var Dummy = /** @class */ (function () { function Dummy() { } Dummy.prototype.greeter = function (person, person2, person3) { diff --git a/tests/baselines/reference/unusedParameterProperty1.js b/tests/baselines/reference/unusedParameterProperty1.js index aa9bafdc65a0a..424235247f833 100644 --- a/tests/baselines/reference/unusedParameterProperty1.js +++ b/tests/baselines/reference/unusedParameterProperty1.js @@ -8,7 +8,7 @@ class A { //// [unusedParameterProperty1.js] -var A = (function () { +var A = /** @class */ (function () { function A(used) { this.used = used; var foge = used; diff --git a/tests/baselines/reference/unusedParameterProperty2.js b/tests/baselines/reference/unusedParameterProperty2.js index 6488a7f6b9924..f5533288237b9 100644 --- a/tests/baselines/reference/unusedParameterProperty2.js +++ b/tests/baselines/reference/unusedParameterProperty2.js @@ -8,7 +8,7 @@ class A { //// [unusedParameterProperty2.js] -var A = (function () { +var A = /** @class */ (function () { function A(used) { this.used = used; var foge = used; diff --git a/tests/baselines/reference/unusedParametersInLambda1.js b/tests/baselines/reference/unusedParametersInLambda1.js index 58fe26677bf84..6b53aa5915b0f 100644 --- a/tests/baselines/reference/unusedParametersInLambda1.js +++ b/tests/baselines/reference/unusedParametersInLambda1.js @@ -7,7 +7,7 @@ class A { } //// [unusedParametersInLambda1.js] -var A = (function () { +var A = /** @class */ (function () { function A() { } A.prototype.f1 = function () { diff --git a/tests/baselines/reference/unusedParametersInLambda2.js b/tests/baselines/reference/unusedParametersInLambda2.js index 836c88a725015..bf96932559c91 100644 --- a/tests/baselines/reference/unusedParametersInLambda2.js +++ b/tests/baselines/reference/unusedParametersInLambda2.js @@ -8,7 +8,7 @@ class A { } //// [unusedParametersInLambda2.js] -var A = (function () { +var A = /** @class */ (function () { function A() { } A.prototype.f1 = function () { diff --git a/tests/baselines/reference/unusedParametersThis.js b/tests/baselines/reference/unusedParametersThis.js index 5e96781edaa72..590fffd7d53c3 100644 --- a/tests/baselines/reference/unusedParametersThis.js +++ b/tests/baselines/reference/unusedParametersThis.js @@ -34,7 +34,7 @@ var f2 = function f2(this: A): number { }; //// [unusedParametersThis.js] -var A = (function () { +var A = /** @class */ (function () { function A() { } A.prototype.method = function () { diff --git a/tests/baselines/reference/unusedParametersinConstructor1.js b/tests/baselines/reference/unusedParametersinConstructor1.js index 97f5c3619ccca..b17415b442c6d 100644 --- a/tests/baselines/reference/unusedParametersinConstructor1.js +++ b/tests/baselines/reference/unusedParametersinConstructor1.js @@ -5,7 +5,7 @@ class greeter { } //// [unusedParametersinConstructor1.js] -var greeter = (function () { +var greeter = /** @class */ (function () { function greeter(param1) { } return greeter; diff --git a/tests/baselines/reference/unusedParametersinConstructor2.js b/tests/baselines/reference/unusedParametersinConstructor2.js index fb96127045f8e..91c49cb37b5c5 100644 --- a/tests/baselines/reference/unusedParametersinConstructor2.js +++ b/tests/baselines/reference/unusedParametersinConstructor2.js @@ -6,7 +6,7 @@ class greeter { } //// [unusedParametersinConstructor2.js] -var greeter = (function () { +var greeter = /** @class */ (function () { function greeter(param1, param2) { param2 = param2 + "dummy value"; } diff --git a/tests/baselines/reference/unusedParametersinConstructor3.js b/tests/baselines/reference/unusedParametersinConstructor3.js index 493632e32408b..6199c6a63690c 100644 --- a/tests/baselines/reference/unusedParametersinConstructor3.js +++ b/tests/baselines/reference/unusedParametersinConstructor3.js @@ -6,7 +6,7 @@ class greeter { } //// [unusedParametersinConstructor3.js] -var greeter = (function () { +var greeter = /** @class */ (function () { function greeter(param1, param2, param3) { param2 = param2 + "dummy value"; } diff --git a/tests/baselines/reference/unusedPrivateMembers.js b/tests/baselines/reference/unusedPrivateMembers.js index 35efb9bd91285..05c55c1ecc49d 100644 --- a/tests/baselines/reference/unusedPrivateMembers.js +++ b/tests/baselines/reference/unusedPrivateMembers.js @@ -49,7 +49,7 @@ class Test5 { //// [unusedPrivateMembers.js] -var Test1 = (function () { +var Test1 = /** @class */ (function () { function Test1() { } Test1.prototype.initializeInternal = function () { @@ -60,7 +60,7 @@ var Test1 = (function () { }; return Test1; }()); -var Test2 = (function () { +var Test2 = /** @class */ (function () { function Test2() { this.p = 0; } @@ -70,7 +70,7 @@ var Test2 = (function () { }; return Test2; }()); -var Test3 = (function () { +var Test3 = /** @class */ (function () { function Test3() { } Object.defineProperty(Test3.prototype, "x", { @@ -86,7 +86,7 @@ var Test3 = (function () { }; return Test3; }()); -var Test4 = (function () { +var Test4 = /** @class */ (function () { function Test4() { } Object.defineProperty(Test4.prototype, "x", { @@ -102,7 +102,7 @@ var Test4 = (function () { }; return Test4; }()); -var Test5 = (function () { +var Test5 = /** @class */ (function () { function Test5() { } Test5.prototype.test = function () { diff --git a/tests/baselines/reference/unusedPrivateMethodInClass1.js b/tests/baselines/reference/unusedPrivateMethodInClass1.js index 9383d12dc557b..209f6611186c5 100644 --- a/tests/baselines/reference/unusedPrivateMethodInClass1.js +++ b/tests/baselines/reference/unusedPrivateMethodInClass1.js @@ -7,7 +7,7 @@ class greeter { } //// [unusedPrivateMethodInClass1.js] -var greeter = (function () { +var greeter = /** @class */ (function () { function greeter() { } greeter.prototype.function1 = function () { diff --git a/tests/baselines/reference/unusedPrivateMethodInClass2.js b/tests/baselines/reference/unusedPrivateMethodInClass2.js index 247a1be4f5919..9095b3be7728f 100644 --- a/tests/baselines/reference/unusedPrivateMethodInClass2.js +++ b/tests/baselines/reference/unusedPrivateMethodInClass2.js @@ -12,7 +12,7 @@ class greeter { } //// [unusedPrivateMethodInClass2.js] -var greeter = (function () { +var greeter = /** @class */ (function () { function greeter() { } greeter.prototype.function1 = function () { diff --git a/tests/baselines/reference/unusedPrivateMethodInClass3.js b/tests/baselines/reference/unusedPrivateMethodInClass3.js index 94c9c1d8ff4ab..588ca2162aebc 100644 --- a/tests/baselines/reference/unusedPrivateMethodInClass3.js +++ b/tests/baselines/reference/unusedPrivateMethodInClass3.js @@ -17,7 +17,7 @@ class greeter { } //// [unusedPrivateMethodInClass3.js] -var greeter = (function () { +var greeter = /** @class */ (function () { function greeter() { } greeter.prototype.function1 = function () { diff --git a/tests/baselines/reference/unusedPrivateMethodInClass4.js b/tests/baselines/reference/unusedPrivateMethodInClass4.js index f767a13917c6c..2bad875fdca08 100644 --- a/tests/baselines/reference/unusedPrivateMethodInClass4.js +++ b/tests/baselines/reference/unusedPrivateMethodInClass4.js @@ -18,7 +18,7 @@ class greeter { } //// [unusedPrivateMethodInClass4.js] -var greeter = (function () { +var greeter = /** @class */ (function () { function greeter() { } greeter.prototype.function1 = function () { diff --git a/tests/baselines/reference/unusedPrivateVariableInClass1.js b/tests/baselines/reference/unusedPrivateVariableInClass1.js index cfdb228dc69a2..b1633eca4253d 100644 --- a/tests/baselines/reference/unusedPrivateVariableInClass1.js +++ b/tests/baselines/reference/unusedPrivateVariableInClass1.js @@ -4,7 +4,7 @@ class greeter { } //// [unusedPrivateVariableInClass1.js] -var greeter = (function () { +var greeter = /** @class */ (function () { function greeter() { } return greeter; diff --git a/tests/baselines/reference/unusedPrivateVariableInClass2.js b/tests/baselines/reference/unusedPrivateVariableInClass2.js index dcfa689211ca9..f97a457c4c93a 100644 --- a/tests/baselines/reference/unusedPrivateVariableInClass2.js +++ b/tests/baselines/reference/unusedPrivateVariableInClass2.js @@ -5,7 +5,7 @@ class greeter { } //// [unusedPrivateVariableInClass2.js] -var greeter = (function () { +var greeter = /** @class */ (function () { function greeter() { } return greeter; diff --git a/tests/baselines/reference/unusedPrivateVariableInClass3.js b/tests/baselines/reference/unusedPrivateVariableInClass3.js index 609187b334042..1de392364f08f 100644 --- a/tests/baselines/reference/unusedPrivateVariableInClass3.js +++ b/tests/baselines/reference/unusedPrivateVariableInClass3.js @@ -6,7 +6,7 @@ class greeter { } //// [unusedPrivateVariableInClass3.js] -var greeter = (function () { +var greeter = /** @class */ (function () { function greeter() { } return greeter; diff --git a/tests/baselines/reference/unusedPrivateVariableInClass4.js b/tests/baselines/reference/unusedPrivateVariableInClass4.js index 809e6cf754e9c..21c910f702c25 100644 --- a/tests/baselines/reference/unusedPrivateVariableInClass4.js +++ b/tests/baselines/reference/unusedPrivateVariableInClass4.js @@ -10,7 +10,7 @@ class greeter { } //// [unusedPrivateVariableInClass4.js] -var greeter = (function () { +var greeter = /** @class */ (function () { function greeter() { } greeter.prototype.method1 = function () { diff --git a/tests/baselines/reference/unusedPrivateVariableInClass5.js b/tests/baselines/reference/unusedPrivateVariableInClass5.js index ae3684ada3e27..a0ad7bf002111 100644 --- a/tests/baselines/reference/unusedPrivateVariableInClass5.js +++ b/tests/baselines/reference/unusedPrivateVariableInClass5.js @@ -10,7 +10,7 @@ class greeter { } //// [unusedPrivateVariableInClass5.js] -var greeter = (function () { +var greeter = /** @class */ (function () { function greeter() { this.x = "dummy value"; } diff --git a/tests/baselines/reference/unusedSetterInClass.js b/tests/baselines/reference/unusedSetterInClass.js index b9d14b8edaafc..30911d8ef2ad8 100644 --- a/tests/baselines/reference/unusedSetterInClass.js +++ b/tests/baselines/reference/unusedSetterInClass.js @@ -8,7 +8,7 @@ class Employee { } //// [unusedSetterInClass.js] -var Employee = (function () { +var Employee = /** @class */ (function () { function Employee() { } Object.defineProperty(Employee.prototype, "fullName", { diff --git a/tests/baselines/reference/unusedSingleParameterInContructor.js b/tests/baselines/reference/unusedSingleParameterInContructor.js index c40120f4a1fa0..959355936f86f 100644 --- a/tests/baselines/reference/unusedSingleParameterInContructor.js +++ b/tests/baselines/reference/unusedSingleParameterInContructor.js @@ -6,7 +6,7 @@ class Dummy { } //// [unusedSingleParameterInContructor.js] -var Dummy = (function () { +var Dummy = /** @class */ (function () { function Dummy(person) { var unused = 20; } diff --git a/tests/baselines/reference/unusedSingleParameterInMethodDeclaration.js b/tests/baselines/reference/unusedSingleParameterInMethodDeclaration.js index a173da2a95edf..27adc84bcd637 100644 --- a/tests/baselines/reference/unusedSingleParameterInMethodDeclaration.js +++ b/tests/baselines/reference/unusedSingleParameterInMethodDeclaration.js @@ -6,7 +6,7 @@ class Dummy { } //// [unusedSingleParameterInMethodDeclaration.js] -var Dummy = (function () { +var Dummy = /** @class */ (function () { function Dummy() { } Dummy.prototype.greeter = function (person) { diff --git a/tests/baselines/reference/unusedTypeParameterInLambda1.js b/tests/baselines/reference/unusedTypeParameterInLambda1.js index 78433757ed79c..9c29d459abb36 100644 --- a/tests/baselines/reference/unusedTypeParameterInLambda1.js +++ b/tests/baselines/reference/unusedTypeParameterInLambda1.js @@ -8,7 +8,7 @@ class A { } //// [unusedTypeParameterInLambda1.js] -var A = (function () { +var A = /** @class */ (function () { function A() { } A.prototype.f1 = function () { diff --git a/tests/baselines/reference/unusedTypeParameterInLambda2.js b/tests/baselines/reference/unusedTypeParameterInLambda2.js index 46332f44dbdfc..c1dc98dabeb48 100644 --- a/tests/baselines/reference/unusedTypeParameterInLambda2.js +++ b/tests/baselines/reference/unusedTypeParameterInLambda2.js @@ -9,7 +9,7 @@ class A { } //// [unusedTypeParameterInLambda2.js] -var A = (function () { +var A = /** @class */ (function () { function A() { } A.prototype.f1 = function () { diff --git a/tests/baselines/reference/unusedTypeParameterInLambda3.js b/tests/baselines/reference/unusedTypeParameterInLambda3.js index 27899320fc26c..780d2aa13fc16 100644 --- a/tests/baselines/reference/unusedTypeParameterInLambda3.js +++ b/tests/baselines/reference/unusedTypeParameterInLambda3.js @@ -7,7 +7,7 @@ var y: new (a:T)=>void; //// [unusedTypeParameterInLambda3.js] -var A = (function () { +var A = /** @class */ (function () { function A() { } return A; diff --git a/tests/baselines/reference/unusedTypeParameterInMethod1.js b/tests/baselines/reference/unusedTypeParameterInMethod1.js index d35afc1cdb330..5de10c69493c8 100644 --- a/tests/baselines/reference/unusedTypeParameterInMethod1.js +++ b/tests/baselines/reference/unusedTypeParameterInMethod1.js @@ -9,7 +9,7 @@ class A { } //// [unusedTypeParameterInMethod1.js] -var A = (function () { +var A = /** @class */ (function () { function A() { } A.prototype.f1 = function () { diff --git a/tests/baselines/reference/unusedTypeParameterInMethod2.js b/tests/baselines/reference/unusedTypeParameterInMethod2.js index c5b70ef8d8a50..c0aeffcb78c6f 100644 --- a/tests/baselines/reference/unusedTypeParameterInMethod2.js +++ b/tests/baselines/reference/unusedTypeParameterInMethod2.js @@ -9,7 +9,7 @@ class A { } //// [unusedTypeParameterInMethod2.js] -var A = (function () { +var A = /** @class */ (function () { function A() { } A.prototype.f1 = function () { diff --git a/tests/baselines/reference/unusedTypeParameterInMethod3.js b/tests/baselines/reference/unusedTypeParameterInMethod3.js index 3b6a19191bb1c..f11acd02f3325 100644 --- a/tests/baselines/reference/unusedTypeParameterInMethod3.js +++ b/tests/baselines/reference/unusedTypeParameterInMethod3.js @@ -9,7 +9,7 @@ class A { } //// [unusedTypeParameterInMethod3.js] -var A = (function () { +var A = /** @class */ (function () { function A() { } A.prototype.f1 = function () { diff --git a/tests/baselines/reference/unusedTypeParameterInMethod4.js b/tests/baselines/reference/unusedTypeParameterInMethod4.js index fcb368276d199..2f1dfa002708d 100644 --- a/tests/baselines/reference/unusedTypeParameterInMethod4.js +++ b/tests/baselines/reference/unusedTypeParameterInMethod4.js @@ -6,7 +6,7 @@ class A { } //// [unusedTypeParameterInMethod4.js] -var A = (function () { +var A = /** @class */ (function () { function A() { } A.prototype.f1 = function () { diff --git a/tests/baselines/reference/unusedTypeParameterInMethod5.js b/tests/baselines/reference/unusedTypeParameterInMethod5.js index a0381374052ad..5ea0cdd822aae 100644 --- a/tests/baselines/reference/unusedTypeParameterInMethod5.js +++ b/tests/baselines/reference/unusedTypeParameterInMethod5.js @@ -6,7 +6,7 @@ class A { } //// [unusedTypeParameterInMethod5.js] -var A = (function () { +var A = /** @class */ (function () { function A() { this.f1 = function () { }; diff --git a/tests/baselines/reference/unusedTypeParameters1.js b/tests/baselines/reference/unusedTypeParameters1.js index 244bda4867fba..bf781f8b2e105 100644 --- a/tests/baselines/reference/unusedTypeParameters1.js +++ b/tests/baselines/reference/unusedTypeParameters1.js @@ -4,7 +4,7 @@ class greeter { } //// [unusedTypeParameters1.js] -var greeter = (function () { +var greeter = /** @class */ (function () { function greeter() { } return greeter; diff --git a/tests/baselines/reference/unusedTypeParameters2.js b/tests/baselines/reference/unusedTypeParameters2.js index ed89c5550234c..1a59a186815f0 100644 --- a/tests/baselines/reference/unusedTypeParameters2.js +++ b/tests/baselines/reference/unusedTypeParameters2.js @@ -8,7 +8,7 @@ class greeter { } //// [unusedTypeParameters2.js] -var greeter = (function () { +var greeter = /** @class */ (function () { function greeter() { } greeter.prototype.function1 = function () { diff --git a/tests/baselines/reference/unusedTypeParameters3.js b/tests/baselines/reference/unusedTypeParameters3.js index 5644a177bef2a..42d357a9614cd 100644 --- a/tests/baselines/reference/unusedTypeParameters3.js +++ b/tests/baselines/reference/unusedTypeParameters3.js @@ -8,7 +8,7 @@ class greeter { } //// [unusedTypeParameters3.js] -var greeter = (function () { +var greeter = /** @class */ (function () { function greeter() { } greeter.prototype.function1 = function () { diff --git a/tests/baselines/reference/unusedTypeParameters5.js b/tests/baselines/reference/unusedTypeParameters5.js index 8c7c71b60f753..0ae317306011c 100644 --- a/tests/baselines/reference/unusedTypeParameters5.js +++ b/tests/baselines/reference/unusedTypeParameters5.js @@ -8,7 +8,7 @@ var x: { } //// [unusedTypeParameters5.js] -var A = (function () { +var A = /** @class */ (function () { function A() { } return A; diff --git a/tests/baselines/reference/unusedTypeParameters6.js b/tests/baselines/reference/unusedTypeParameters6.js index 3276c3ff6cc88..abb3176800794 100644 --- a/tests/baselines/reference/unusedTypeParameters6.js +++ b/tests/baselines/reference/unusedTypeParameters6.js @@ -7,7 +7,7 @@ class C { } interface C { a: T; } //// [a.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } return C; diff --git a/tests/baselines/reference/unusedTypeParameters7.js b/tests/baselines/reference/unusedTypeParameters7.js index 9bae0894ff3dc..9979164fcbf7c 100644 --- a/tests/baselines/reference/unusedTypeParameters7.js +++ b/tests/baselines/reference/unusedTypeParameters7.js @@ -7,7 +7,7 @@ class C { a: T; } interface C { } //// [a.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } return C; diff --git a/tests/baselines/reference/unusedTypeParameters8.js b/tests/baselines/reference/unusedTypeParameters8.js index f55537901ccbd..7dba318aab049 100644 --- a/tests/baselines/reference/unusedTypeParameters8.js +++ b/tests/baselines/reference/unusedTypeParameters8.js @@ -7,7 +7,7 @@ class C { } interface C { } //// [a.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } return C; diff --git a/tests/baselines/reference/unusedTypeParameters9.js b/tests/baselines/reference/unusedTypeParameters9.js index c905505652cac..bd0aad9a8482f 100644 --- a/tests/baselines/reference/unusedTypeParameters9.js +++ b/tests/baselines/reference/unusedTypeParameters9.js @@ -16,13 +16,13 @@ interface C3 { e: any; } //// [unusedTypeParameters9.js] // clas + interface -var C1 = (function () { +var C1 = /** @class */ (function () { function C1() { } return C1; }()); // interface + class -var C2 = (function () { +var C2 = /** @class */ (function () { function C2() { } return C2; diff --git a/tests/baselines/reference/unusedVariablesinNamespaces2.js b/tests/baselines/reference/unusedVariablesinNamespaces2.js index f306f3992e111..c47b4a2beff48 100644 --- a/tests/baselines/reference/unusedVariablesinNamespaces2.js +++ b/tests/baselines/reference/unusedVariablesinNamespaces2.js @@ -15,7 +15,7 @@ var Validation; (function (Validation) { var lettersRegexp = /^[A-Za-z]+$/; var numberRegexp = /^[0-9]+$/; - var LettersOnlyValidator = (function () { + var LettersOnlyValidator = /** @class */ (function () { function LettersOnlyValidator() { } LettersOnlyValidator.prototype.isAcceptable = function (s2) { diff --git a/tests/baselines/reference/unusedVariablesinNamespaces3.js b/tests/baselines/reference/unusedVariablesinNamespaces3.js index f293f589d6585..4cd23c58a82fc 100644 --- a/tests/baselines/reference/unusedVariablesinNamespaces3.js +++ b/tests/baselines/reference/unusedVariablesinNamespaces3.js @@ -17,7 +17,7 @@ var Validation; var lettersRegexp = /^[A-Za-z]+$/; var numberRegexp = /^[0-9]+$/; Validation.anotherUnusedVariable = "Dummy value"; - var LettersOnlyValidator = (function () { + var LettersOnlyValidator = /** @class */ (function () { function LettersOnlyValidator() { } LettersOnlyValidator.prototype.isAcceptable = function (s2) { diff --git a/tests/baselines/reference/usingModuleWithExportImportInValuePosition.js b/tests/baselines/reference/usingModuleWithExportImportInValuePosition.js index a57e18fec7228..f39bf0d83a273 100644 --- a/tests/baselines/reference/usingModuleWithExportImportInValuePosition.js +++ b/tests/baselines/reference/usingModuleWithExportImportInValuePosition.js @@ -23,7 +23,7 @@ var c: C.a.B.Id; var A; (function (A) { A.x = 'hello world'; - var Point = (function () { + var Point = /** @class */ (function () { function Point(x, y) { this.x = x; this.y = y; diff --git a/tests/baselines/reference/validNullAssignments.js b/tests/baselines/reference/validNullAssignments.js index 8509a46cc975e..7b8f1de38b998 100644 --- a/tests/baselines/reference/validNullAssignments.js +++ b/tests/baselines/reference/validNullAssignments.js @@ -42,7 +42,7 @@ var E; E[E["A"] = 0] = "A"; })(E || (E = {})); E.A = null; // error -var C = (function () { +var C = /** @class */ (function () { function C() { } return C; diff --git a/tests/baselines/reference/validUndefinedAssignments.js b/tests/baselines/reference/validUndefinedAssignments.js index 792b277ae172a..2df3961dcd96e 100644 --- a/tests/baselines/reference/validUndefinedAssignments.js +++ b/tests/baselines/reference/validUndefinedAssignments.js @@ -31,7 +31,7 @@ var c = x; var d = x; var e = x; e = x; // should work -var C = (function () { +var C = /** @class */ (function () { function C() { } return C; diff --git a/tests/baselines/reference/validUseOfThisInSuper.js b/tests/baselines/reference/validUseOfThisInSuper.js index d3f574c3cef16..4f55ab71dd1bb 100644 --- a/tests/baselines/reference/validUseOfThisInSuper.js +++ b/tests/baselines/reference/validUseOfThisInSuper.js @@ -20,13 +20,13 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var Base = (function () { +var Base = /** @class */ (function () { function Base(b) { this.b = b; } return Base; }()); -var Super = (function (_super) { +var Super = /** @class */ (function (_super) { __extends(Super, _super); function Super() { var _this = _super.call(this, (function () { return _this; })()) || this; diff --git a/tests/baselines/reference/varArgConstructorMemberParameter.js b/tests/baselines/reference/varArgConstructorMemberParameter.js index 0d80c2b4dbbd7..095b36a9af77e 100644 --- a/tests/baselines/reference/varArgConstructorMemberParameter.js +++ b/tests/baselines/reference/varArgConstructorMemberParameter.js @@ -13,7 +13,7 @@ class Foo3 { //// [varArgConstructorMemberParameter.js] -var Foo1 = (function () { +var Foo1 = /** @class */ (function () { function Foo1() { var args = []; for (var _i = 0; _i < arguments.length; _i++) { @@ -22,13 +22,13 @@ var Foo1 = (function () { } return Foo1; }()); -var Foo2 = (function () { +var Foo2 = /** @class */ (function () { function Foo2(args) { this.args = args; } return Foo2; }()); -var Foo3 = (function () { +var Foo3 = /** @class */ (function () { function Foo3() { var args = []; for (var _i = 0; _i < arguments.length; _i++) { diff --git a/tests/baselines/reference/varArgsOnConstructorTypes.js b/tests/baselines/reference/varArgsOnConstructorTypes.js index 9c790e7a48bbf..02923b556413e 100644 --- a/tests/baselines/reference/varArgsOnConstructorTypes.js +++ b/tests/baselines/reference/varArgsOnConstructorTypes.js @@ -38,13 +38,13 @@ var __extends = (this && this.__extends) || (function () { define(["require", "exports"], function (require, exports) { "use strict"; exports.__esModule = true; - var A = (function () { + var A = /** @class */ (function () { function A(ctor) { } return A; }()); exports.A = A; - var B = (function (_super) { + var B = /** @class */ (function (_super) { __extends(B, _super); function B(element, url) { var _this = _super.call(this, element) || this; diff --git a/tests/baselines/reference/varAsID.js b/tests/baselines/reference/varAsID.js index 9e449751bc429..be6e8921560e1 100644 --- a/tests/baselines/reference/varAsID.js +++ b/tests/baselines/reference/varAsID.js @@ -19,14 +19,14 @@ var f2 = new Foo2(); //// [varAsID.js] -var Foo = (function () { +var Foo = /** @class */ (function () { function Foo() { this.x = 1; } return Foo; }()); var f = new Foo(); -var Foo2 = (function () { +var Foo2 = /** @class */ (function () { function Foo2() { this.x = 1; } diff --git a/tests/baselines/reference/vararg.js b/tests/baselines/reference/vararg.js index bd4a79b462631..9e5aa0c797255 100644 --- a/tests/baselines/reference/vararg.js +++ b/tests/baselines/reference/vararg.js @@ -41,7 +41,7 @@ result+=x.fonly("a","b","c","d"); //ok //// [vararg.js] var M; (function (M) { - var C = (function () { + var C = /** @class */ (function () { function C() { } C.prototype.f = function (x) { diff --git a/tests/baselines/reference/vardecl.js b/tests/baselines/reference/vardecl.js index a7ebb811c505c..8f774772c626d 100644 --- a/tests/baselines/reference/vardecl.js +++ b/tests/baselines/reference/vardecl.js @@ -134,13 +134,13 @@ var m2; var m1; var a2, b22 = 10, b222; var m3; - var C = (function () { + var C = /** @class */ (function () { function C(b) { this.b = b; } return C; }()); - var C2 = (function () { + var C2 = /** @class */ (function () { function C2(b) { this.b = b; } diff --git a/tests/baselines/reference/variableDeclaratorResolvedDuringContextualTyping.js b/tests/baselines/reference/variableDeclaratorResolvedDuringContextualTyping.js index ed6111ec3c570..e8af78ca5983a 100644 --- a/tests/baselines/reference/variableDeclaratorResolvedDuringContextualTyping.js +++ b/tests/baselines/reference/variableDeclaratorResolvedDuringContextualTyping.js @@ -131,14 +131,14 @@ var WinJS; })(WinJS || (WinJS = {})); var Errors; (function (Errors) { - var ConnectionError /* extends Error */ = (function () { + var ConnectionError /* extends Error */ = /** @class */ (function () { function ConnectionError(request) { } return ConnectionError; }()); Errors.ConnectionError = ConnectionError; })(Errors || (Errors = {})); -var FileService = (function () { +var FileService = /** @class */ (function () { function FileService() { } FileService.prototype.uploadData = function () { diff --git a/tests/baselines/reference/visSyntax.js b/tests/baselines/reference/visSyntax.js index 8d7d5991503d5..536ace5346ee7 100644 --- a/tests/baselines/reference/visSyntax.js +++ b/tests/baselines/reference/visSyntax.js @@ -14,7 +14,7 @@ module M { //// [visSyntax.js] var M; (function (M) { - var C = (function () { + var C = /** @class */ (function () { function C() { } return C; diff --git a/tests/baselines/reference/visibilityOfTypeParameters.js b/tests/baselines/reference/visibilityOfTypeParameters.js index 3a1adf3f97d35..b76364d4ec54c 100644 --- a/tests/baselines/reference/visibilityOfTypeParameters.js +++ b/tests/baselines/reference/visibilityOfTypeParameters.js @@ -8,7 +8,7 @@ export class MyClass { //// [visibilityOfTypeParameters.js] "use strict"; exports.__esModule = true; -var MyClass = (function () { +var MyClass = /** @class */ (function () { function MyClass() { } MyClass.prototype.myMethod = function (val) { diff --git a/tests/baselines/reference/voidOperatorWithAnyOtherType.js b/tests/baselines/reference/voidOperatorWithAnyOtherType.js index cbae98f67fc60..64a65f763a66b 100644 --- a/tests/baselines/reference/voidOperatorWithAnyOtherType.js +++ b/tests/baselines/reference/voidOperatorWithAnyOtherType.js @@ -71,7 +71,7 @@ function foo() { var a; return a; } -var A = (function () { +var A = /** @class */ (function () { function A() { } A.foo = function () { diff --git a/tests/baselines/reference/voidOperatorWithBooleanType.js b/tests/baselines/reference/voidOperatorWithBooleanType.js index bd6faedcb2b5e..a9a77a9a90629 100644 --- a/tests/baselines/reference/voidOperatorWithBooleanType.js +++ b/tests/baselines/reference/voidOperatorWithBooleanType.js @@ -42,7 +42,7 @@ void M.n; // void operator on boolean type var BOOLEAN; function foo() { return true; } -var A = (function () { +var A = /** @class */ (function () { function A() { } A.foo = function () { return false; }; diff --git a/tests/baselines/reference/voidOperatorWithNumberType.js b/tests/baselines/reference/voidOperatorWithNumberType.js index ca17612c6cc56..98e321573ad54 100644 --- a/tests/baselines/reference/voidOperatorWithNumberType.js +++ b/tests/baselines/reference/voidOperatorWithNumberType.js @@ -50,7 +50,7 @@ void objA.a, M.n; var NUMBER; var NUMBER1 = [1, 2]; function foo() { return 1; } -var A = (function () { +var A = /** @class */ (function () { function A() { } A.foo = function () { return 1; }; diff --git a/tests/baselines/reference/voidOperatorWithStringType.js b/tests/baselines/reference/voidOperatorWithStringType.js index eaaa981528d00..142c3cdecd62b 100644 --- a/tests/baselines/reference/voidOperatorWithStringType.js +++ b/tests/baselines/reference/voidOperatorWithStringType.js @@ -49,7 +49,7 @@ void objA.a,M.n; var STRING; var STRING1 = ["", "abc"]; function foo() { return "abc"; } -var A = (function () { +var A = /** @class */ (function () { function A() { } A.foo = function () { return ""; }; diff --git a/tests/baselines/reference/weakType.js b/tests/baselines/reference/weakType.js index 5637271ccec3a..0de18497673cc 100644 --- a/tests/baselines/reference/weakType.js +++ b/tests/baselines/reference/weakType.js @@ -81,7 +81,7 @@ function del(options, error) { changes.push(options); changes.push(error); } -var K = (function () { +var K = /** @class */ (function () { function K(s) { } return K; diff --git a/tests/baselines/reference/withImportDecl.js b/tests/baselines/reference/withImportDecl.js index f0a1a2d2f148d..5c9d693c006c1 100644 --- a/tests/baselines/reference/withImportDecl.js +++ b/tests/baselines/reference/withImportDecl.js @@ -47,7 +47,7 @@ b.foo; define(["require", "exports"], function (require, exports) { "use strict"; exports.__esModule = true; - var A = (function () { + var A = /** @class */ (function () { function A() { } return A; diff --git a/tests/baselines/reference/withStatementErrors.js b/tests/baselines/reference/withStatementErrors.js index de2fb40dac917..a5db8edc5afe8 100644 --- a/tests/baselines/reference/withStatementErrors.js +++ b/tests/baselines/reference/withStatementErrors.js @@ -24,7 +24,7 @@ with (ooo.eee.oo.ah_ah.ting.tang.walla.walla) { bang = true; // no error function bar() { } // no error bar(); // no error - var C = (function () { + var C = /** @class */ (function () { function C() { } return C; diff --git a/tests/baselines/reference/witness.js b/tests/baselines/reference/witness.js index ebd1669d17764..63ffc45411100 100644 --- a/tests/baselines/reference/witness.js +++ b/tests/baselines/reference/witness.js @@ -144,7 +144,7 @@ function fn(pInit) { if (pInit === void 0) { pInit = pInit; } var pInit; } -var InitClass = (function () { +var InitClass = /** @class */ (function () { function InitClass() { this.x = this.x; } @@ -213,7 +213,7 @@ function fnArg2() { } var t = fnArg2(); // t: should be 'any', but is 'string' // New operator -var C = (function () { +var C = /** @class */ (function () { function C() { } C.prototype.fn1 = function () { @@ -246,7 +246,7 @@ var M2; var y; })(M2 || (M2 = {})); // Property access of class instance type -var C2 = (function () { +var C2 = /** @class */ (function () { function C2() { this.n = this.n; // n: any } @@ -255,7 +255,7 @@ var C2 = (function () { var c2inst = new C2().n; var c2inst; // Constructor function property access -var C3 = (function () { +var C3 = /** @class */ (function () { function C3() { } C3.q = C3.q; diff --git a/tests/baselines/reference/wrappedAndRecursiveConstraints.js b/tests/baselines/reference/wrappedAndRecursiveConstraints.js index 06103235ecb97..e89ba3c922c6e 100644 --- a/tests/baselines/reference/wrappedAndRecursiveConstraints.js +++ b/tests/baselines/reference/wrappedAndRecursiveConstraints.js @@ -18,7 +18,7 @@ var r = c.foo(y); //// [wrappedAndRecursiveConstraints.js] // no errors expected -var C = (function () { +var C = /** @class */ (function () { function C(data) { this.data = data; } diff --git a/tests/baselines/reference/wrappedAndRecursiveConstraints2.js b/tests/baselines/reference/wrappedAndRecursiveConstraints2.js index ae8b28c5eb0ab..71a6be8b7a93c 100644 --- a/tests/baselines/reference/wrappedAndRecursiveConstraints2.js +++ b/tests/baselines/reference/wrappedAndRecursiveConstraints2.js @@ -7,7 +7,7 @@ var c = new C(1); var c = new C(new C('')); // error //// [wrappedAndRecursiveConstraints2.js] -var C = (function () { +var C = /** @class */ (function () { function C(x) { } return C; diff --git a/tests/baselines/reference/wrappedAndRecursiveConstraints3.js b/tests/baselines/reference/wrappedAndRecursiveConstraints3.js index b5d6e65a1832a..f56ab0b62c59f 100644 --- a/tests/baselines/reference/wrappedAndRecursiveConstraints3.js +++ b/tests/baselines/reference/wrappedAndRecursiveConstraints3.js @@ -17,7 +17,7 @@ var r2 = r(''); //// [wrappedAndRecursiveConstraints3.js] // no errors expected -var C = (function () { +var C = /** @class */ (function () { function C(x) { } C.prototype.foo = function (x) { diff --git a/tests/baselines/reference/wrappedAndRecursiveConstraints4.js b/tests/baselines/reference/wrappedAndRecursiveConstraints4.js index 2a84f8cc4262c..322c78c7f2aa3 100644 --- a/tests/baselines/reference/wrappedAndRecursiveConstraints4.js +++ b/tests/baselines/reference/wrappedAndRecursiveConstraints4.js @@ -14,7 +14,7 @@ var r = c.foo(''); var r2 = r({ length: 3, charAt: (x: number) => { '' } }); // error //// [wrappedAndRecursiveConstraints4.js] -var C = (function () { +var C = /** @class */ (function () { function C(x) { } C.prototype.foo = function (x) { From 115884aa30e23b751981585f0121e29a9ebd276a Mon Sep 17 00:00:00 2001 From: Ron Buckton Date: Wed, 21 Jun 2017 18:20:46 -0700 Subject: [PATCH 011/237] Follow symbol through commonjs require for inferred class type --- src/compiler/checker.ts | 31 ++++++++--- .../reference/constructorFunctions2.symbols | 41 ++++++++++++++ .../reference/constructorFunctions2.types | 55 +++++++++++++++++++ .../salsa/constructorFunctions2.ts | 18 ++++++ 4 files changed, 136 insertions(+), 9 deletions(-) create mode 100644 tests/baselines/reference/constructorFunctions2.symbols create mode 100644 tests/baselines/reference/constructorFunctions2.types create mode 100644 tests/cases/conformance/salsa/constructorFunctions2.ts diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 05c20ffb11acc..29b0420201e73 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -16073,8 +16073,8 @@ namespace ts { * Indicates whether a declaration can be treated as a constructor in a JavaScript * file. */ - function isJavaScriptConstructor(node: Declaration): boolean { - if (isInJavaScriptFile(node)) { + function isJavaScriptConstructor(node: Declaration | undefined): boolean { + if (node && isInJavaScriptFile(node)) { // If the node has a @class tag, treat it like a constructor. if (getJSDocClassTag(node)) return true; @@ -16089,6 +16089,21 @@ namespace ts { return false; } + function getJavaScriptClassType(symbol: Symbol): Type | undefined { + if (symbol && isDeclarationOfFunctionOrClassExpression(symbol)) { + symbol = getSymbolOfNode((symbol.valueDeclaration).initializer); + } + if (isJavaScriptConstructor(symbol.valueDeclaration)) { + return getInferredClassType(symbol); + } + if (symbol.flags & SymbolFlags.Variable) { + const valueType = getTypeOfSymbol(symbol); + if (valueType.symbol && !isInferredClassType(valueType) && isJavaScriptConstructor(valueType.symbol.valueDeclaration)) { + return getInferredClassType(valueType.symbol); + } + } + } + function getInferredClassType(symbol: Symbol) { const links = getSymbolLinks(symbol); if (!links.inferredClassType) { @@ -16132,16 +16147,14 @@ namespace ts { // in a JS file // Note:JS inferred classes might come from a variable declaration instead of a function declaration. // In this case, using getResolvedSymbol directly is required to avoid losing the members from the declaration. - let funcSymbol = node.expression.kind === SyntaxKind.Identifier ? + const funcSymbol = node.expression.kind === SyntaxKind.Identifier ? getResolvedSymbol(node.expression as Identifier) : checkExpression(node.expression).symbol; - if (funcSymbol && isDeclarationOfFunctionOrClassExpression(funcSymbol)) { - funcSymbol = getSymbolOfNode((funcSymbol.valueDeclaration).initializer); - } - if (funcSymbol && funcSymbol.flags & SymbolFlags.Function && (funcSymbol.members || getJSDocClassTag(funcSymbol.valueDeclaration))) { - return getInferredClassType(funcSymbol); + const type = funcSymbol && getJavaScriptClassType(funcSymbol); + if (type) { + return type; } - else if (noImplicitAny) { + if (noImplicitAny) { error(node, Diagnostics.new_expression_whose_target_lacks_a_construct_signature_implicitly_has_an_any_type); } return anyType; diff --git a/tests/baselines/reference/constructorFunctions2.symbols b/tests/baselines/reference/constructorFunctions2.symbols new file mode 100644 index 0000000000000..1046aa32e9a62 --- /dev/null +++ b/tests/baselines/reference/constructorFunctions2.symbols @@ -0,0 +1,41 @@ +=== tests/cases/conformance/salsa/node.d.ts === +declare function require(id: string): any; +>require : Symbol(require, Decl(node.d.ts, 0, 0)) +>id : Symbol(id, Decl(node.d.ts, 0, 25)) + +declare var module: any, exports: any; +>module : Symbol(module, Decl(node.d.ts, 1, 11)) +>exports : Symbol(exports, Decl(node.d.ts, 1, 24)) + +=== tests/cases/conformance/salsa/index.js === +const A = require("./other"); +>A : Symbol(A, Decl(index.js, 0, 5)) +>require : Symbol(require, Decl(node.d.ts, 0, 0)) +>"./other" : Symbol("tests/cases/conformance/salsa/other", Decl(other.js, 0, 0)) + +const a = new A().id; +>a : Symbol(a, Decl(index.js, 1, 5)) +>new A().id : Symbol(A.id, Decl(other.js, 0, 14)) +>A : Symbol(A, Decl(index.js, 0, 5)) +>id : Symbol(A.id, Decl(other.js, 0, 14)) + +const B = function() { this.id = 1; } +>B : Symbol(B, Decl(index.js, 3, 5)) +>id : Symbol(B.id, Decl(index.js, 3, 22)) + +const b = new B().id; +>b : Symbol(b, Decl(index.js, 4, 5)) +>new B().id : Symbol(B.id, Decl(index.js, 3, 22)) +>B : Symbol(B, Decl(index.js, 3, 5)) +>id : Symbol(B.id, Decl(index.js, 3, 22)) + +=== tests/cases/conformance/salsa/other.js === +function A() { this.id = 1; } +>A : Symbol(A, Decl(other.js, 0, 0)) +>id : Symbol(A.id, Decl(other.js, 0, 14)) + +module.exports = A; +>module : Symbol(export=, Decl(other.js, 0, 29)) +>exports : Symbol(export=, Decl(other.js, 0, 29)) +>A : Symbol(A, Decl(other.js, 0, 0)) + diff --git a/tests/baselines/reference/constructorFunctions2.types b/tests/baselines/reference/constructorFunctions2.types new file mode 100644 index 0000000000000..e96053b4f4901 --- /dev/null +++ b/tests/baselines/reference/constructorFunctions2.types @@ -0,0 +1,55 @@ +=== tests/cases/conformance/salsa/node.d.ts === +declare function require(id: string): any; +>require : (id: string) => any +>id : string + +declare var module: any, exports: any; +>module : any +>exports : any + +=== tests/cases/conformance/salsa/index.js === +const A = require("./other"); +>A : () => void +>require("./other") : () => void +>require : (id: string) => any +>"./other" : "./other" + +const a = new A().id; +>a : number +>new A().id : number +>new A() : { id: number; } +>A : () => void +>id : number + +const B = function() { this.id = 1; } +>B : () => void +>function() { this.id = 1; } : () => void +>this.id = 1 : 1 +>this.id : any +>this : any +>id : any +>1 : 1 + +const b = new B().id; +>b : number +>new B().id : number +>new B() : { id: number; } +>B : () => void +>id : number + +=== tests/cases/conformance/salsa/other.js === +function A() { this.id = 1; } +>A : () => void +>this.id = 1 : 1 +>this.id : any +>this : any +>id : any +>1 : 1 + +module.exports = A; +>module.exports = A : () => void +>module.exports : any +>module : any +>exports : any +>A : () => void + diff --git a/tests/cases/conformance/salsa/constructorFunctions2.ts b/tests/cases/conformance/salsa/constructorFunctions2.ts new file mode 100644 index 0000000000000..13a6e7b9a3a85 --- /dev/null +++ b/tests/cases/conformance/salsa/constructorFunctions2.ts @@ -0,0 +1,18 @@ +// @allowJs: true +// @checkJs: true +// @noEmit: true +// @module: commonjs +// @filename: node.d.ts +declare function require(id: string): any; +declare var module: any, exports: any; + +// @filename: index.js +const A = require("./other"); +const a = new A().id; + +const B = function() { this.id = 1; } +const b = new B().id; + +// @filename: other.js +function A() { this.id = 1; } +module.exports = A; \ No newline at end of file From e8f674fafbf513164054cbddf23274129a7f9526 Mon Sep 17 00:00:00 2001 From: Homa Wong Date: Tue, 18 Jul 2017 00:58:05 -0700 Subject: [PATCH 012/237] Update es5.d.ts --- src/lib/es5.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/es5.d.ts b/src/lib/es5.d.ts index 48a97fa665853..d42b9140a8f1e 100644 --- a/src/lib/es5.d.ts +++ b/src/lib/es5.d.ts @@ -216,7 +216,7 @@ interface ObjectConstructor { * Returns the names of the enumerable properties and methods of an object. * @param o Object that contains the properties and methods. This can be an object that you created or an existing Document Object Model (DOM) object. */ - keys(o: any): string[]; + keys(o: {}): string[]; } /** From d1459f7e9cab507d1e5c860faf79ae05d95dd38f Mon Sep 17 00:00:00 2001 From: vvakame Date: Tue, 25 Jul 2017 18:24:04 +0900 Subject: [PATCH 013/237] Add SpaceBetweenOpenParens rule --- src/services/formatting/rules.ts | 4 +++- .../fourslash/formattingSpaceBetweenParent.ts | 14 ++++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) create mode 100644 tests/cases/fourslash/formattingSpaceBetweenParent.ts diff --git a/src/services/formatting/rules.ts b/src/services/formatting/rules.ts index 15bbf5041d308..2daf8d9d284d5 100644 --- a/src/services/formatting/rules.ts +++ b/src/services/formatting/rules.ts @@ -195,6 +195,7 @@ namespace ts.formatting { // Insert space after opening and before closing nonempty parenthesis public SpaceAfterOpenParen: Rule; public SpaceBeforeCloseParen: Rule; + public SpaceBetweenOpenParens: Rule; public NoSpaceBetweenParens: Rule; public NoSpaceAfterOpenParen: Rule; public NoSpaceBeforeCloseParen: Rule; @@ -457,6 +458,7 @@ namespace ts.formatting { // Insert space after opening and before closing nonempty parenthesis this.SpaceAfterOpenParen = new Rule(RuleDescriptor.create3(SyntaxKind.OpenParenToken, Shared.TokenRange.Any), RuleOperation.create2(new RuleOperationContext(Rules.IsOptionEnabled("insertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis"), Rules.IsNonJsxSameLineTokenContext), RuleAction.Space)); this.SpaceBeforeCloseParen = new Rule(RuleDescriptor.create2(Shared.TokenRange.Any, SyntaxKind.CloseParenToken), RuleOperation.create2(new RuleOperationContext(Rules.IsOptionEnabled("insertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis"), Rules.IsNonJsxSameLineTokenContext), RuleAction.Space)); + this.SpaceBetweenOpenParens = new Rule(RuleDescriptor.create1(SyntaxKind.OpenParenToken, SyntaxKind.OpenParenToken), RuleOperation.create2(new RuleOperationContext(Rules.IsOptionEnabled("insertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis"), Rules.IsNonJsxSameLineTokenContext), RuleAction.Space)); this.NoSpaceBetweenParens = new Rule(RuleDescriptor.create1(SyntaxKind.OpenParenToken, SyntaxKind.CloseParenToken), RuleOperation.create2(new RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), RuleAction.Delete)); this.NoSpaceAfterOpenParen = new Rule(RuleDescriptor.create3(SyntaxKind.OpenParenToken, Shared.TokenRange.Any), RuleOperation.create2(new RuleOperationContext(Rules.IsOptionDisabledOrUndefined("insertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis"), Rules.IsNonJsxSameLineTokenContext), RuleAction.Delete)); this.NoSpaceBeforeCloseParen = new Rule(RuleDescriptor.create2(Shared.TokenRange.Any, SyntaxKind.CloseParenToken), RuleOperation.create2(new RuleOperationContext(Rules.IsOptionDisabledOrUndefined("insertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis"), Rules.IsNonJsxSameLineTokenContext), RuleAction.Delete)); @@ -544,7 +546,7 @@ namespace ts.formatting { this.SpaceAfterComma, this.NoSpaceAfterComma, this.SpaceAfterAnonymousFunctionKeyword, this.NoSpaceAfterAnonymousFunctionKeyword, this.SpaceAfterKeywordInControl, this.NoSpaceAfterKeywordInControl, - this.SpaceAfterOpenParen, this.SpaceBeforeCloseParen, this.NoSpaceBetweenParens, this.NoSpaceAfterOpenParen, this.NoSpaceBeforeCloseParen, + this.SpaceAfterOpenParen, this.SpaceBeforeCloseParen, this.SpaceBetweenOpenParens, this.NoSpaceBetweenParens, this.NoSpaceAfterOpenParen, this.NoSpaceBeforeCloseParen, this.SpaceAfterOpenBracket, this.SpaceBeforeCloseBracket, this.NoSpaceBetweenBrackets, this.NoSpaceAfterOpenBracket, this.NoSpaceBeforeCloseBracket, this.SpaceAfterOpenBrace, this.SpaceBeforeCloseBrace, this.NoSpaceBetweenEmptyBraceBrackets, this.NoSpaceAfterOpenBrace, this.NoSpaceBeforeCloseBrace, this.SpaceAfterTemplateHeadAndMiddle, this.SpaceBeforeTemplateMiddleAndTail, this.NoSpaceAfterTemplateHeadAndMiddle, this.NoSpaceBeforeTemplateMiddleAndTail, diff --git a/tests/cases/fourslash/formattingSpaceBetweenParent.ts b/tests/cases/fourslash/formattingSpaceBetweenParent.ts new file mode 100644 index 0000000000000..60ec632f59c8b --- /dev/null +++ b/tests/cases/fourslash/formattingSpaceBetweenParent.ts @@ -0,0 +1,14 @@ +/// + +/////*1*/foo(() => 1); +/////*2*/foo(1); +/////*3*/if((true)){} + +format.setOption("InsertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis", true); +format.document(); +goTo.marker("1"); +verify.currentLineContentIs("foo( () => 1 );"); +goTo.marker("2"); +verify.currentLineContentIs("foo( 1 );"); +goTo.marker("3"); +verify.currentLineContentIs("if ( ( true ) ) { }"); From 43981eaa48b70017666875d7c6f325fd9bf5aa6b Mon Sep 17 00:00:00 2001 From: Nathan Shively-Sanders Date: Tue, 25 Jul 2017 09:38:55 -0700 Subject: [PATCH 014/237] Use type param constraints for computed prop types --- src/compiler/checker.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index c2f40c169dc3f..6da61b974f18e 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -13330,10 +13330,13 @@ namespace ts { const links = getNodeLinks(node.expression); if (!links.resolvedType) { links.resolvedType = checkExpression(node.expression); + const t = links.resolvedType.flags & TypeFlags.TypeVariable ? + getBaseConstraintOfType(links.resolvedType) || emptyObjectType : + links.resolvedType; // This will allow types number, string, symbol or any. It will also allow enums, the unknown // type, and any union of these types (like string | number). - if (!isTypeAnyOrAllConstituentTypesHaveKind(links.resolvedType, TypeFlags.NumberLike | TypeFlags.StringLike | TypeFlags.ESSymbol)) { + if (!isTypeAnyOrAllConstituentTypesHaveKind(t, TypeFlags.NumberLike | TypeFlags.StringLike | TypeFlags.ESSymbol)) { error(node, Diagnostics.A_computed_property_name_must_be_of_type_string_number_symbol_or_any); } else { From 1fb6d349f1148ab87fbe43cabf099790a4657530 Mon Sep 17 00:00:00 2001 From: Nathan Shively-Sanders Date: Tue, 25 Jul 2017 09:39:54 -0700 Subject: [PATCH 015/237] Test:use type param constraints for computed prop types --- .../computedPropertyNames51_ES5.errors.txt | 15 +++++++++++++ .../reference/computedPropertyNames51_ES5.js | 21 +++++++++++++++++++ .../computedPropertyNames51_ES6.errors.txt | 15 +++++++++++++ .../reference/computedPropertyNames51_ES6.js | 20 ++++++++++++++++++ .../computedPropertyNames8_ES5.errors.txt | 5 +---- .../computedPropertyNames8_ES6.errors.txt | 5 +---- .../computedPropertyNames51_ES5.ts | 8 +++++++ .../computedPropertyNames51_ES6.ts | 9 ++++++++ 8 files changed, 90 insertions(+), 8 deletions(-) create mode 100644 tests/baselines/reference/computedPropertyNames51_ES5.errors.txt create mode 100644 tests/baselines/reference/computedPropertyNames51_ES5.js create mode 100644 tests/baselines/reference/computedPropertyNames51_ES6.errors.txt create mode 100644 tests/baselines/reference/computedPropertyNames51_ES6.js create mode 100644 tests/cases/conformance/es6/computedProperties/computedPropertyNames51_ES5.ts create mode 100644 tests/cases/conformance/es6/computedProperties/computedPropertyNames51_ES6.ts diff --git a/tests/baselines/reference/computedPropertyNames51_ES5.errors.txt b/tests/baselines/reference/computedPropertyNames51_ES5.errors.txt new file mode 100644 index 0000000000000..3ee876feaed1f --- /dev/null +++ b/tests/baselines/reference/computedPropertyNames51_ES5.errors.txt @@ -0,0 +1,15 @@ +tests/cases/conformance/es6/computedProperties/computedPropertyNames51_ES5.ts(5,9): error TS2464: A computed property name must be of type 'string', 'number', 'symbol', or 'any'. + + +==== tests/cases/conformance/es6/computedProperties/computedPropertyNames51_ES5.ts (1 errors) ==== + function f() { + var t: T; + var k: K; + var v = { + [t]: 0, + ~~~ +!!! error TS2464: A computed property name must be of type 'string', 'number', 'symbol', or 'any'. + [k]: 1 + }; + } + \ No newline at end of file diff --git a/tests/baselines/reference/computedPropertyNames51_ES5.js b/tests/baselines/reference/computedPropertyNames51_ES5.js new file mode 100644 index 0000000000000..9f138b37f3dab --- /dev/null +++ b/tests/baselines/reference/computedPropertyNames51_ES5.js @@ -0,0 +1,21 @@ +//// [computedPropertyNames51_ES5.ts] +function f() { + var t: T; + var k: K; + var v = { + [t]: 0, + [k]: 1 + }; +} + + +//// [computedPropertyNames51_ES5.js] +function f() { + var t; + var k; + var v = (_a = {}, + _a[t] = 0, + _a[k] = 1, + _a); + var _a; +} diff --git a/tests/baselines/reference/computedPropertyNames51_ES6.errors.txt b/tests/baselines/reference/computedPropertyNames51_ES6.errors.txt new file mode 100644 index 0000000000000..b85ae8f48d04b --- /dev/null +++ b/tests/baselines/reference/computedPropertyNames51_ES6.errors.txt @@ -0,0 +1,15 @@ +tests/cases/conformance/es6/computedProperties/computedPropertyNames51_ES6.ts(5,9): error TS2464: A computed property name must be of type 'string', 'number', 'symbol', or 'any'. + + +==== tests/cases/conformance/es6/computedProperties/computedPropertyNames51_ES6.ts (1 errors) ==== + function f() { + var t: T; + var k: K; + var v = { + [t]: 0, + ~~~ +!!! error TS2464: A computed property name must be of type 'string', 'number', 'symbol', or 'any'. + [k]: 1 + }; + } + \ No newline at end of file diff --git a/tests/baselines/reference/computedPropertyNames51_ES6.js b/tests/baselines/reference/computedPropertyNames51_ES6.js new file mode 100644 index 0000000000000..361af9cc15a6b --- /dev/null +++ b/tests/baselines/reference/computedPropertyNames51_ES6.js @@ -0,0 +1,20 @@ +//// [computedPropertyNames51_ES6.ts] +function f() { + var t: T; + var k: K; + var v = { + [t]: 0, + [k]: 1 + }; +} + + +//// [computedPropertyNames51_ES6.js] +function f() { + var t; + var k; + var v = { + [t]: 0, + [k]: 1 + }; +} diff --git a/tests/baselines/reference/computedPropertyNames8_ES5.errors.txt b/tests/baselines/reference/computedPropertyNames8_ES5.errors.txt index 9fbd14a92fb07..56dbe16a52317 100644 --- a/tests/baselines/reference/computedPropertyNames8_ES5.errors.txt +++ b/tests/baselines/reference/computedPropertyNames8_ES5.errors.txt @@ -1,8 +1,7 @@ tests/cases/conformance/es6/computedProperties/computedPropertyNames8_ES5.ts(5,9): error TS2464: A computed property name must be of type 'string', 'number', 'symbol', or 'any'. -tests/cases/conformance/es6/computedProperties/computedPropertyNames8_ES5.ts(6,9): error TS2464: A computed property name must be of type 'string', 'number', 'symbol', or 'any'. -==== tests/cases/conformance/es6/computedProperties/computedPropertyNames8_ES5.ts (2 errors) ==== +==== tests/cases/conformance/es6/computedProperties/computedPropertyNames8_ES5.ts (1 errors) ==== function f() { var t: T; var u: U; @@ -11,7 +10,5 @@ tests/cases/conformance/es6/computedProperties/computedPropertyNames8_ES5.ts(6,9 ~~~ !!! error TS2464: A computed property name must be of type 'string', 'number', 'symbol', or 'any'. [u]: 1 - ~~~ -!!! error TS2464: A computed property name must be of type 'string', 'number', 'symbol', or 'any'. }; } \ No newline at end of file diff --git a/tests/baselines/reference/computedPropertyNames8_ES6.errors.txt b/tests/baselines/reference/computedPropertyNames8_ES6.errors.txt index 22674a3992cbc..9996f35f063c7 100644 --- a/tests/baselines/reference/computedPropertyNames8_ES6.errors.txt +++ b/tests/baselines/reference/computedPropertyNames8_ES6.errors.txt @@ -1,8 +1,7 @@ tests/cases/conformance/es6/computedProperties/computedPropertyNames8_ES6.ts(5,9): error TS2464: A computed property name must be of type 'string', 'number', 'symbol', or 'any'. -tests/cases/conformance/es6/computedProperties/computedPropertyNames8_ES6.ts(6,9): error TS2464: A computed property name must be of type 'string', 'number', 'symbol', or 'any'. -==== tests/cases/conformance/es6/computedProperties/computedPropertyNames8_ES6.ts (2 errors) ==== +==== tests/cases/conformance/es6/computedProperties/computedPropertyNames8_ES6.ts (1 errors) ==== function f() { var t: T; var u: U; @@ -11,7 +10,5 @@ tests/cases/conformance/es6/computedProperties/computedPropertyNames8_ES6.ts(6,9 ~~~ !!! error TS2464: A computed property name must be of type 'string', 'number', 'symbol', or 'any'. [u]: 1 - ~~~ -!!! error TS2464: A computed property name must be of type 'string', 'number', 'symbol', or 'any'. }; } \ No newline at end of file diff --git a/tests/cases/conformance/es6/computedProperties/computedPropertyNames51_ES5.ts b/tests/cases/conformance/es6/computedProperties/computedPropertyNames51_ES5.ts new file mode 100644 index 0000000000000..1d467245fb2ce --- /dev/null +++ b/tests/cases/conformance/es6/computedProperties/computedPropertyNames51_ES5.ts @@ -0,0 +1,8 @@ +function f() { + var t: T; + var k: K; + var v = { + [t]: 0, + [k]: 1 + }; +} diff --git a/tests/cases/conformance/es6/computedProperties/computedPropertyNames51_ES6.ts b/tests/cases/conformance/es6/computedProperties/computedPropertyNames51_ES6.ts new file mode 100644 index 0000000000000..ca209996c4c3c --- /dev/null +++ b/tests/cases/conformance/es6/computedProperties/computedPropertyNames51_ES6.ts @@ -0,0 +1,9 @@ +// @target: es6 +function f() { + var t: T; + var k: K; + var v = { + [t]: 0, + [k]: 1 + }; +} From 838fbdd9ca5902308af91ce6dee45e2a66f8c719 Mon Sep 17 00:00:00 2001 From: Nathan Shively-Sanders Date: Wed, 26 Jul 2017 16:28:24 -0700 Subject: [PATCH 016/237] Make isTypeOfKind delegate to isTypeAssignableTo This improves a number of error messages to do with adding 'null' or 'undefined' with other types. It also allows you to add two type parameters that both extend `number`. --- src/compiler/checker.ts | 89 ++++++++++--------- ...WithNullValueAndInvalidOperator.errors.txt | 66 +++++++------- ...orWithNullValueAndValidOperator.errors.txt | 60 ++++++------- ...thOnlyNullValueOrUndefinedValue.errors.txt | 38 +++----- ...ditionOperatorWithTypeParameter.errors.txt | 12 +-- ...ndefinedValueAndInvalidOperands.errors.txt | 66 +++++++------- ...hUndefinedValueAndValidOperator.errors.txt | 60 ++++++------- ...wiseNotOperatorWithAnyOtherType.errors.txt | 29 +++--- ...itionAssignmentLHSCanBeAssigned.errors.txt | 24 ++--- ...onAssignmentWithInvalidOperands.errors.txt | 36 ++++---- ...thAnyOtherTypeInvalidOperations.errors.txt | 56 ++++-------- .../deleteOperatorWithAnyOtherType.errors.txt | 29 +++--- ...thAnyOtherTypeInvalidOperations.errors.txt | 56 ++++-------- ...icalNotOperatorWithAnyOtherType.errors.txt | 29 +++--- tests/baselines/reference/null.errors.txt | 6 +- .../operatorAddNullUndefined.errors.txt | 86 ++++++++---------- .../plusOperatorWithAnyOtherType.errors.txt | 29 +++--- .../reference/typeParamExtendsNumber.js | 19 ++++ .../reference/typeParamExtendsNumber.symbols | 20 +++++ .../reference/typeParamExtendsNumber.types | 23 +++++ .../typeofOperatorWithAnyOtherType.errors.txt | 29 +++--- .../voidOperatorWithAnyOtherType.errors.txt | 29 +++--- .../cases/compiler/typeParamExtendsNumber.ts | 7 ++ 23 files changed, 429 insertions(+), 469 deletions(-) create mode 100644 tests/baselines/reference/typeParamExtendsNumber.js create mode 100644 tests/baselines/reference/typeParamExtendsNumber.symbols create mode 100644 tests/baselines/reference/typeParamExtendsNumber.types create mode 100644 tests/cases/compiler/typeParamExtendsNumber.ts diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 6da61b974f18e..d1c18ef61d807 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -7526,11 +7526,11 @@ namespace ts { return getTypeOfSymbol(prop); } } - if (isTypeAnyOrAllConstituentTypesHaveKind(indexType, TypeFlags.StringLike | TypeFlags.NumberLike | TypeFlags.ESSymbol)) { + if (!(indexType.flags & TypeFlags.Nullable) && isTypeOfKind(indexType, TypeFlags.StringLike | TypeFlags.NumberLike | TypeFlags.ESSymbol)) { if (isTypeAny(objectType)) { return anyType; } - const indexInfo = isTypeAnyOrAllConstituentTypesHaveKind(indexType, TypeFlags.NumberLike) && getIndexInfoOfType(objectType, IndexKind.Number) || + const indexInfo = isTypeOfKind(indexType, TypeFlags.NumberLike) && getIndexInfoOfType(objectType, IndexKind.Number) || getIndexInfoOfType(objectType, IndexKind.String) || undefined; if (indexInfo) { @@ -11286,7 +11286,7 @@ namespace ts { (parent.parent).operatorToken.kind === SyntaxKind.EqualsToken && (parent.parent).left === parent && !isAssignmentTarget(parent.parent) && - isTypeAnyOrAllConstituentTypesHaveKind(getTypeOfExpression((parent).argumentExpression), TypeFlags.NumberLike | TypeFlags.Undefined); + isTypeOfKind(getTypeOfExpression((parent).argumentExpression), TypeFlags.NumberLike); return isLengthPushOrUnshift || isElementAssignment; } @@ -11458,7 +11458,7 @@ namespace ts { } else { const indexType = getTypeOfExpression(((node).left).argumentExpression); - if (isTypeAnyOrAllConstituentTypesHaveKind(indexType, TypeFlags.NumberLike | TypeFlags.Undefined)) { + if (isTypeOfKind(indexType, TypeFlags.NumberLike)) { evolvedType = addEvolvingArrayElementType(evolvedType, (node).right); } } @@ -13290,11 +13290,7 @@ namespace ts { function isNumericComputedName(name: ComputedPropertyName): boolean { // It seems odd to consider an expression of type Any to result in a numeric name, // but this behavior is consistent with checkIndexedAccess - return isTypeAnyOrAllConstituentTypesHaveKind(checkComputedPropertyName(name), TypeFlags.NumberLike); - } - - function isTypeAnyOrAllConstituentTypesHaveKind(type: Type, kind: TypeFlags): boolean { - return isTypeAny(type) || isTypeOfKind(type, kind); + return isTypeOfKind(checkComputedPropertyName(name), TypeFlags.NumberLike); } function isInfinityOrNaNString(name: string | __String): boolean { @@ -13330,13 +13326,9 @@ namespace ts { const links = getNodeLinks(node.expression); if (!links.resolvedType) { links.resolvedType = checkExpression(node.expression); - const t = links.resolvedType.flags & TypeFlags.TypeVariable ? - getBaseConstraintOfType(links.resolvedType) || emptyObjectType : - links.resolvedType; - // This will allow types number, string, symbol or any. It will also allow enums, the unknown // type, and any union of these types (like string | number). - if (!isTypeAnyOrAllConstituentTypesHaveKind(t, TypeFlags.NumberLike | TypeFlags.StringLike | TypeFlags.ESSymbol)) { + if (links.resolvedType.flags & TypeFlags.Nullable || !isTypeOfKind(links.resolvedType, TypeFlags.StringLike | TypeFlags.NumberLike | TypeFlags.ESSymbol)) { error(node, Diagnostics.A_computed_property_name_must_be_of_type_string_number_symbol_or_any); } else { @@ -16821,7 +16813,7 @@ namespace ts { } function checkArithmeticOperandType(operand: Node, type: Type, diagnostic: DiagnosticMessage): boolean { - if (!isTypeAnyOrAllConstituentTypesHaveKind(type, TypeFlags.NumberLike)) { + if (!isTypeOfKind(type, TypeFlags.NumberLike)) { error(operand, diagnostic); return false; } @@ -16994,31 +16986,43 @@ namespace ts { return false; } - // Return true if type is of the given kind. A union type is of a given kind if all constituent types - // are of the given kind. An intersection type is of a given kind if at least one constituent type is - // of the given kind. - function isTypeOfKind(type: Type, kind: TypeFlags): boolean { - if (type.flags & kind) { + function isTypeOfKind(source: Type, kind: TypeFlags, excludeAny?: boolean) { + if (source.flags & kind) { return true; } - if (type.flags & TypeFlags.Union) { - const types = (type).types; - for (const t of types) { - if (!isTypeOfKind(t, kind)) { - return false; - } - } - return true; + if (excludeAny && source.flags & (TypeFlags.Any | TypeFlags.Void | TypeFlags.Undefined | TypeFlags.Null)) { + // TODO: The callers who want this should really handle these cases FIRST + return false; } - if (type.flags & TypeFlags.Intersection) { - const types = (type).types; - for (const t of types) { - if (isTypeOfKind(t, kind)) { - return true; - } - } + const targets = []; + if (kind & TypeFlags.NumberLike) { + targets.push(numberType); } - return false; + if (kind & TypeFlags.StringLike) { + targets.push(stringType); + } + if (kind & TypeFlags.BooleanLike) { + targets.push(booleanType); + } + if (kind & TypeFlags.Void) { + targets.push(voidType); + } + if (kind & TypeFlags.Never) { + targets.push(neverType); + } + if (kind & TypeFlags.Null) { + targets.push(nullType); + } + if (kind & TypeFlags.Undefined) { + targets.push(undefinedType); + } + if (kind & TypeFlags.ESSymbol) { + targets.push(esSymbolType); + } + if (kind & TypeFlags.NonPrimitive) { + targets.push(nonPrimitiveType); + } + return isTypeAssignableTo(source, getUnionType(targets)); } function isConstEnumObjectType(type: Type): boolean { @@ -17038,7 +17042,7 @@ namespace ts { // and the right operand to be of type Any, a subtype of the 'Function' interface type, or have a call or construct signature. // The result is always of the Boolean primitive type. // NOTE: do not raise error if leftType is unknown as related error was already reported - if (isTypeOfKind(leftType, TypeFlags.Primitive)) { + if (isTypeOfKind(leftType, TypeFlags.Primitive, /*excludeAny*/ true)) { error(left, Diagnostics.The_left_hand_side_of_an_instanceof_expression_must_be_of_type_any_an_object_type_or_a_type_parameter); } // NOTE: do not raise error if right is unknown as related error was already reported @@ -17064,7 +17068,7 @@ namespace ts { if (!(isTypeComparableTo(leftType, stringType) || isTypeOfKind(leftType, TypeFlags.NumberLike | TypeFlags.ESSymbol))) { error(left, Diagnostics.The_left_hand_side_of_an_in_expression_must_be_of_type_any_string_number_or_symbol); } - if (!isTypeAnyOrAllConstituentTypesHaveKind(rightType, TypeFlags.Object | TypeFlags.TypeVariable | TypeFlags.NonPrimitive)) { + if (!isTypeOfKind(rightType, TypeFlags.NonPrimitive | TypeFlags.TypeVariable)) { error(right, Diagnostics.The_right_hand_side_of_an_in_expression_must_be_of_type_any_an_object_type_or_a_type_parameter); } return booleanType; @@ -17373,25 +17377,26 @@ namespace ts { return silentNeverType; } - if (!isTypeOfKind(leftType, TypeFlags.Any | TypeFlags.StringLike) && !isTypeOfKind(rightType, TypeFlags.Any | TypeFlags.StringLike)) { + if (!isTypeOfKind(leftType, TypeFlags.StringLike) && !isTypeOfKind(rightType, TypeFlags.StringLike)) { leftType = checkNonNullType(leftType, left); rightType = checkNonNullType(rightType, right); } let resultType: Type; - if (isTypeOfKind(leftType, TypeFlags.NumberLike) && isTypeOfKind(rightType, TypeFlags.NumberLike)) { + if (isTypeOfKind(leftType, TypeFlags.NumberLike, /*excludeAny*/ true) && isTypeOfKind(rightType, TypeFlags.NumberLike, /*excludeAny*/ true)) { // Operands of an enum type are treated as having the primitive type Number. // If both operands are of the Number primitive type, the result is of the Number primitive type. resultType = numberType; } else { - if (isTypeOfKind(leftType, TypeFlags.StringLike) || isTypeOfKind(rightType, TypeFlags.StringLike)) { + if (isTypeOfKind(leftType, TypeFlags.StringLike, /*excludeAny*/ true) || isTypeOfKind(rightType, TypeFlags.StringLike, /*excludeAny*/ true)) { // If one or both operands are of the String primitive type, the result is of the String primitive type. resultType = stringType; } else if (isTypeAny(leftType) || isTypeAny(rightType)) { // Otherwise, the result is of type Any. // NOTE: unknown type here denotes error type. Old compiler treated this case as any type so do we. + // TODO: Reorder this to check for any (plus void/undefined/null) first resultType = leftType === unknownType || rightType === unknownType ? unknownType : anyType; } @@ -20317,7 +20322,7 @@ namespace ts { // unknownType is returned i.e. if node.expression is identifier whose name cannot be resolved // in this case error about missing name is already reported - do not report extra one - if (!isTypeAnyOrAllConstituentTypesHaveKind(rightType, TypeFlags.Object | TypeFlags.TypeVariable | TypeFlags.NonPrimitive)) { + if (!isTypeOfKind(rightType, TypeFlags.NonPrimitive | TypeFlags.TypeVariable)) { error(node.expression, Diagnostics.The_right_hand_side_of_a_for_in_statement_must_be_of_type_any_an_object_type_or_a_type_parameter); } diff --git a/tests/baselines/reference/additionOperatorWithNullValueAndInvalidOperator.errors.txt b/tests/baselines/reference/additionOperatorWithNullValueAndInvalidOperator.errors.txt index 5f0d78c59d5a9..891fe86dcd162 100644 --- a/tests/baselines/reference/additionOperatorWithNullValueAndInvalidOperator.errors.txt +++ b/tests/baselines/reference/additionOperatorWithNullValueAndInvalidOperator.errors.txt @@ -1,14 +1,14 @@ -tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithNullValueAndInvalidOperator.ts(11,10): error TS2531: Object is possibly 'null'. -tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithNullValueAndInvalidOperator.ts(12,10): error TS2531: Object is possibly 'null'. -tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithNullValueAndInvalidOperator.ts(13,10): error TS2531: Object is possibly 'null'. -tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithNullValueAndInvalidOperator.ts(14,14): error TS2531: Object is possibly 'null'. -tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithNullValueAndInvalidOperator.ts(15,14): error TS2531: Object is possibly 'null'. -tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithNullValueAndInvalidOperator.ts(16,10): error TS2531: Object is possibly 'null'. -tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithNullValueAndInvalidOperator.ts(19,10): error TS2531: Object is possibly 'null'. -tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithNullValueAndInvalidOperator.ts(20,10): error TS2531: Object is possibly 'null'. -tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithNullValueAndInvalidOperator.ts(21,10): error TS2531: Object is possibly 'null'. -tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithNullValueAndInvalidOperator.ts(22,11): error TS2531: Object is possibly 'null'. -tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithNullValueAndInvalidOperator.ts(23,11): error TS2531: Object is possibly 'null'. +tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithNullValueAndInvalidOperator.ts(11,10): error TS2365: Operator '+' cannot be applied to types 'null' and 'boolean'. +tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithNullValueAndInvalidOperator.ts(12,10): error TS2365: Operator '+' cannot be applied to types 'null' and 'Object'. +tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithNullValueAndInvalidOperator.ts(13,10): error TS2365: Operator '+' cannot be applied to types 'null' and 'void'. +tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithNullValueAndInvalidOperator.ts(14,10): error TS2365: Operator '+' cannot be applied to types 'boolean' and 'null'. +tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithNullValueAndInvalidOperator.ts(15,10): error TS2365: Operator '+' cannot be applied to types 'Object' and 'null'. +tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithNullValueAndInvalidOperator.ts(16,10): error TS2365: Operator '+' cannot be applied to types 'null' and 'void'. +tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithNullValueAndInvalidOperator.ts(19,10): error TS2365: Operator '+' cannot be applied to types 'null' and 'Number'. +tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithNullValueAndInvalidOperator.ts(20,10): error TS2365: Operator '+' cannot be applied to types 'null' and 'true'. +tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithNullValueAndInvalidOperator.ts(21,10): error TS2365: Operator '+' cannot be applied to types 'null' and '{ a: string; }'. +tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithNullValueAndInvalidOperator.ts(22,11): error TS2365: Operator '+' cannot be applied to types 'null' and 'void'. +tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithNullValueAndInvalidOperator.ts(23,11): error TS2365: Operator '+' cannot be applied to types 'null' and '() => void'. ==== tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithNullValueAndInvalidOperator.ts (11 errors) ==== @@ -23,37 +23,37 @@ tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOpe // null + boolean/Object var r1 = null + a; - ~~~~ -!!! error TS2531: Object is possibly 'null'. + ~~~~~~~~ +!!! error TS2365: Operator '+' cannot be applied to types 'null' and 'boolean'. var r2 = null + b; - ~~~~ -!!! error TS2531: Object is possibly 'null'. + ~~~~~~~~ +!!! error TS2365: Operator '+' cannot be applied to types 'null' and 'Object'. var r3 = null + c; - ~~~~ -!!! error TS2531: Object is possibly 'null'. + ~~~~~~~~ +!!! error TS2365: Operator '+' cannot be applied to types 'null' and 'void'. var r4 = a + null; - ~~~~ -!!! error TS2531: Object is possibly 'null'. + ~~~~~~~~ +!!! error TS2365: Operator '+' cannot be applied to types 'boolean' and 'null'. var r5 = b + null; - ~~~~ -!!! error TS2531: Object is possibly 'null'. + ~~~~~~~~ +!!! error TS2365: Operator '+' cannot be applied to types 'Object' and 'null'. var r6 = null + c; - ~~~~ -!!! error TS2531: Object is possibly 'null'. + ~~~~~~~~ +!!! error TS2365: Operator '+' cannot be applied to types 'null' and 'void'. // other cases var r7 = null + d; - ~~~~ -!!! error TS2531: Object is possibly 'null'. + ~~~~~~~~ +!!! error TS2365: Operator '+' cannot be applied to types 'null' and 'Number'. var r8 = null + true; - ~~~~ -!!! error TS2531: Object is possibly 'null'. + ~~~~~~~~~~~ +!!! error TS2365: Operator '+' cannot be applied to types 'null' and 'true'. var r9 = null + { a: '' }; - ~~~~ -!!! error TS2531: Object is possibly 'null'. + ~~~~~~~~~~~~~~~~ +!!! error TS2365: Operator '+' cannot be applied to types 'null' and '{ a: string; }'. var r10 = null + foo(); - ~~~~ -!!! error TS2531: Object is possibly 'null'. + ~~~~~~~~~~~~ +!!! error TS2365: Operator '+' cannot be applied to types 'null' and 'void'. var r11 = null + (() => { }); - ~~~~ -!!! error TS2531: Object is possibly 'null'. \ No newline at end of file + ~~~~~~~~~~~~~~~~~~ +!!! error TS2365: Operator '+' cannot be applied to types 'null' and '() => void'. \ No newline at end of file diff --git a/tests/baselines/reference/additionOperatorWithNullValueAndValidOperator.errors.txt b/tests/baselines/reference/additionOperatorWithNullValueAndValidOperator.errors.txt index db01a42c8bddd..b722fd1be4654 100644 --- a/tests/baselines/reference/additionOperatorWithNullValueAndValidOperator.errors.txt +++ b/tests/baselines/reference/additionOperatorWithNullValueAndValidOperator.errors.txt @@ -1,13 +1,13 @@ -tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithNullValueAndValidOperator.ts(15,10): error TS2531: Object is possibly 'null'. -tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithNullValueAndValidOperator.ts(16,10): error TS2531: Object is possibly 'null'. -tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithNullValueAndValidOperator.ts(17,10): error TS2531: Object is possibly 'null'. -tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithNullValueAndValidOperator.ts(18,10): error TS2531: Object is possibly 'null'. -tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithNullValueAndValidOperator.ts(19,10): error TS2531: Object is possibly 'null'. -tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithNullValueAndValidOperator.ts(20,14): error TS2531: Object is possibly 'null'. -tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithNullValueAndValidOperator.ts(21,14): error TS2531: Object is possibly 'null'. -tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithNullValueAndValidOperator.ts(22,15): error TS2531: Object is possibly 'null'. -tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithNullValueAndValidOperator.ts(23,17): error TS2531: Object is possibly 'null'. -tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithNullValueAndValidOperator.ts(24,20): error TS2531: Object is possibly 'null'. +tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithNullValueAndValidOperator.ts(15,10): error TS2365: Operator '+' cannot be applied to types 'null' and 'number'. +tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithNullValueAndValidOperator.ts(16,10): error TS2365: Operator '+' cannot be applied to types 'null' and '1'. +tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithNullValueAndValidOperator.ts(17,10): error TS2365: Operator '+' cannot be applied to types 'null' and 'E'. +tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithNullValueAndValidOperator.ts(18,10): error TS2365: Operator '+' cannot be applied to types 'null' and 'E.a'. +tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithNullValueAndValidOperator.ts(19,10): error TS2365: Operator '+' cannot be applied to types 'null' and 'E.a'. +tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithNullValueAndValidOperator.ts(20,10): error TS2365: Operator '+' cannot be applied to types 'number' and 'null'. +tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithNullValueAndValidOperator.ts(21,10): error TS2365: Operator '+' cannot be applied to types '1' and 'null'. +tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithNullValueAndValidOperator.ts(22,11): error TS2365: Operator '+' cannot be applied to types 'E' and 'null'. +tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithNullValueAndValidOperator.ts(23,11): error TS2365: Operator '+' cannot be applied to types 'E.a' and 'null'. +tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithNullValueAndValidOperator.ts(24,11): error TS2365: Operator '+' cannot be applied to types 'E.a' and 'null'. ==== tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithNullValueAndValidOperator.ts (10 errors) ==== @@ -26,35 +26,35 @@ tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOpe // null + number/enum var r3 = null + b; - ~~~~ -!!! error TS2531: Object is possibly 'null'. + ~~~~~~~~ +!!! error TS2365: Operator '+' cannot be applied to types 'null' and 'number'. var r4 = null + 1; - ~~~~ -!!! error TS2531: Object is possibly 'null'. + ~~~~~~~~ +!!! error TS2365: Operator '+' cannot be applied to types 'null' and '1'. var r5 = null + c; - ~~~~ -!!! error TS2531: Object is possibly 'null'. + ~~~~~~~~ +!!! error TS2365: Operator '+' cannot be applied to types 'null' and 'E'. var r6 = null + E.a; - ~~~~ -!!! error TS2531: Object is possibly 'null'. + ~~~~~~~~~~ +!!! error TS2365: Operator '+' cannot be applied to types 'null' and 'E.a'. var r7 = null + E['a']; - ~~~~ -!!! error TS2531: Object is possibly 'null'. + ~~~~~~~~~~~~~ +!!! error TS2365: Operator '+' cannot be applied to types 'null' and 'E.a'. var r8 = b + null; - ~~~~ -!!! error TS2531: Object is possibly 'null'. + ~~~~~~~~ +!!! error TS2365: Operator '+' cannot be applied to types 'number' and 'null'. var r9 = 1 + null; - ~~~~ -!!! error TS2531: Object is possibly 'null'. + ~~~~~~~~ +!!! error TS2365: Operator '+' cannot be applied to types '1' and 'null'. var r10 = c + null - ~~~~ -!!! error TS2531: Object is possibly 'null'. + ~~~~~~~~ +!!! error TS2365: Operator '+' cannot be applied to types 'E' and 'null'. var r11 = E.a + null; - ~~~~ -!!! error TS2531: Object is possibly 'null'. + ~~~~~~~~~~ +!!! error TS2365: Operator '+' cannot be applied to types 'E.a' and 'null'. var r12 = E['a'] + null; - ~~~~ -!!! error TS2531: Object is possibly 'null'. + ~~~~~~~~~~~~~ +!!! error TS2365: Operator '+' cannot be applied to types 'E.a' and 'null'. // null + string var r13 = null + d; diff --git a/tests/baselines/reference/additionOperatorWithOnlyNullValueOrUndefinedValue.errors.txt b/tests/baselines/reference/additionOperatorWithOnlyNullValueOrUndefinedValue.errors.txt index aef66891be072..b4746ff1e68b0 100644 --- a/tests/baselines/reference/additionOperatorWithOnlyNullValueOrUndefinedValue.errors.txt +++ b/tests/baselines/reference/additionOperatorWithOnlyNullValueOrUndefinedValue.errors.txt @@ -1,32 +1,20 @@ -tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithOnlyNullValueOrUndefinedValue.ts(2,10): error TS2531: Object is possibly 'null'. -tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithOnlyNullValueOrUndefinedValue.ts(2,17): error TS2531: Object is possibly 'null'. -tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithOnlyNullValueOrUndefinedValue.ts(3,10): error TS2531: Object is possibly 'null'. -tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithOnlyNullValueOrUndefinedValue.ts(3,17): error TS2532: Object is possibly 'undefined'. -tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithOnlyNullValueOrUndefinedValue.ts(4,10): error TS2532: Object is possibly 'undefined'. -tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithOnlyNullValueOrUndefinedValue.ts(4,22): error TS2531: Object is possibly 'null'. -tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithOnlyNullValueOrUndefinedValue.ts(5,10): error TS2532: Object is possibly 'undefined'. -tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithOnlyNullValueOrUndefinedValue.ts(5,22): error TS2532: Object is possibly 'undefined'. +tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithOnlyNullValueOrUndefinedValue.ts(2,10): error TS2365: Operator '+' cannot be applied to types 'null' and 'null'. +tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithOnlyNullValueOrUndefinedValue.ts(3,10): error TS2365: Operator '+' cannot be applied to types 'null' and 'undefined'. +tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithOnlyNullValueOrUndefinedValue.ts(4,10): error TS2365: Operator '+' cannot be applied to types 'undefined' and 'null'. +tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithOnlyNullValueOrUndefinedValue.ts(5,10): error TS2365: Operator '+' cannot be applied to types 'undefined' and 'undefined'. -==== tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithOnlyNullValueOrUndefinedValue.ts (8 errors) ==== +==== tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithOnlyNullValueOrUndefinedValue.ts (4 errors) ==== // bug 819721 var r1 = null + null; - ~~~~ -!!! error TS2531: Object is possibly 'null'. - ~~~~ -!!! error TS2531: Object is possibly 'null'. + ~~~~~~~~~~~ +!!! error TS2365: Operator '+' cannot be applied to types 'null' and 'null'. var r2 = null + undefined; - ~~~~ -!!! error TS2531: Object is possibly 'null'. - ~~~~~~~~~ -!!! error TS2532: Object is possibly 'undefined'. + ~~~~~~~~~~~~~~~~ +!!! error TS2365: Operator '+' cannot be applied to types 'null' and 'undefined'. var r3 = undefined + null; - ~~~~~~~~~ -!!! error TS2532: Object is possibly 'undefined'. - ~~~~ -!!! error TS2531: Object is possibly 'null'. + ~~~~~~~~~~~~~~~~ +!!! error TS2365: Operator '+' cannot be applied to types 'undefined' and 'null'. var r4 = undefined + undefined; - ~~~~~~~~~ -!!! error TS2532: Object is possibly 'undefined'. - ~~~~~~~~~ -!!! error TS2532: Object is possibly 'undefined'. \ No newline at end of file + ~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2365: Operator '+' cannot be applied to types 'undefined' and 'undefined'. \ No newline at end of file diff --git a/tests/baselines/reference/additionOperatorWithTypeParameter.errors.txt b/tests/baselines/reference/additionOperatorWithTypeParameter.errors.txt index 478c4fdee3f88..bdb81190b5098 100644 --- a/tests/baselines/reference/additionOperatorWithTypeParameter.errors.txt +++ b/tests/baselines/reference/additionOperatorWithTypeParameter.errors.txt @@ -8,8 +8,8 @@ tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOpe tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithTypeParameter.ts(27,15): error TS2365: Operator '+' cannot be applied to types 'Object' and 'T'. tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithTypeParameter.ts(28,15): error TS2365: Operator '+' cannot be applied to types 'E' and 'T'. tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithTypeParameter.ts(29,15): error TS2365: Operator '+' cannot be applied to types 'void' and 'T'. -tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithTypeParameter.ts(32,19): error TS2531: Object is possibly 'null'. -tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithTypeParameter.ts(33,19): error TS2532: Object is possibly 'undefined'. +tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithTypeParameter.ts(32,15): error TS2365: Operator '+' cannot be applied to types 'T' and 'null'. +tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithTypeParameter.ts(33,15): error TS2365: Operator '+' cannot be applied to types 'T' and 'undefined'. tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithTypeParameter.ts(34,15): error TS2365: Operator '+' cannot be applied to types 'T' and 'T'. tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithTypeParameter.ts(35,15): error TS2365: Operator '+' cannot be applied to types 'T' and 'U'. tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithTypeParameter.ts(36,15): error TS2365: Operator '+' cannot be applied to types 'T' and '() => void'. @@ -69,11 +69,11 @@ tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOpe // other cases var r15 = t + null; - ~~~~ -!!! error TS2531: Object is possibly 'null'. + ~~~~~~~~ +!!! error TS2365: Operator '+' cannot be applied to types 'T' and 'null'. var r16 = t + undefined; - ~~~~~~~~~ -!!! error TS2532: Object is possibly 'undefined'. + ~~~~~~~~~~~~~ +!!! error TS2365: Operator '+' cannot be applied to types 'T' and 'undefined'. var r17 = t + t; ~~~~~ !!! error TS2365: Operator '+' cannot be applied to types 'T' and 'T'. diff --git a/tests/baselines/reference/additionOperatorWithUndefinedValueAndInvalidOperands.errors.txt b/tests/baselines/reference/additionOperatorWithUndefinedValueAndInvalidOperands.errors.txt index 06e8c67b10568..6be41e81fd532 100644 --- a/tests/baselines/reference/additionOperatorWithUndefinedValueAndInvalidOperands.errors.txt +++ b/tests/baselines/reference/additionOperatorWithUndefinedValueAndInvalidOperands.errors.txt @@ -1,14 +1,14 @@ -tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithUndefinedValueAndInvalidOperands.ts(11,10): error TS2532: Object is possibly 'undefined'. -tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithUndefinedValueAndInvalidOperands.ts(12,10): error TS2532: Object is possibly 'undefined'. -tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithUndefinedValueAndInvalidOperands.ts(13,10): error TS2532: Object is possibly 'undefined'. -tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithUndefinedValueAndInvalidOperands.ts(14,14): error TS2532: Object is possibly 'undefined'. -tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithUndefinedValueAndInvalidOperands.ts(15,14): error TS2532: Object is possibly 'undefined'. -tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithUndefinedValueAndInvalidOperands.ts(16,10): error TS2532: Object is possibly 'undefined'. -tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithUndefinedValueAndInvalidOperands.ts(19,10): error TS2532: Object is possibly 'undefined'. -tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithUndefinedValueAndInvalidOperands.ts(20,10): error TS2532: Object is possibly 'undefined'. -tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithUndefinedValueAndInvalidOperands.ts(21,10): error TS2532: Object is possibly 'undefined'. -tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithUndefinedValueAndInvalidOperands.ts(22,11): error TS2532: Object is possibly 'undefined'. -tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithUndefinedValueAndInvalidOperands.ts(23,11): error TS2532: Object is possibly 'undefined'. +tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithUndefinedValueAndInvalidOperands.ts(11,10): error TS2365: Operator '+' cannot be applied to types 'undefined' and 'boolean'. +tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithUndefinedValueAndInvalidOperands.ts(12,10): error TS2365: Operator '+' cannot be applied to types 'undefined' and 'Object'. +tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithUndefinedValueAndInvalidOperands.ts(13,10): error TS2365: Operator '+' cannot be applied to types 'undefined' and 'void'. +tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithUndefinedValueAndInvalidOperands.ts(14,10): error TS2365: Operator '+' cannot be applied to types 'boolean' and 'undefined'. +tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithUndefinedValueAndInvalidOperands.ts(15,10): error TS2365: Operator '+' cannot be applied to types 'Object' and 'undefined'. +tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithUndefinedValueAndInvalidOperands.ts(16,10): error TS2365: Operator '+' cannot be applied to types 'undefined' and 'void'. +tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithUndefinedValueAndInvalidOperands.ts(19,10): error TS2365: Operator '+' cannot be applied to types 'undefined' and 'Number'. +tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithUndefinedValueAndInvalidOperands.ts(20,10): error TS2365: Operator '+' cannot be applied to types 'undefined' and 'true'. +tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithUndefinedValueAndInvalidOperands.ts(21,10): error TS2365: Operator '+' cannot be applied to types 'undefined' and '{ a: string; }'. +tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithUndefinedValueAndInvalidOperands.ts(22,11): error TS2365: Operator '+' cannot be applied to types 'undefined' and 'void'. +tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithUndefinedValueAndInvalidOperands.ts(23,11): error TS2365: Operator '+' cannot be applied to types 'undefined' and '() => void'. ==== tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithUndefinedValueAndInvalidOperands.ts (11 errors) ==== @@ -23,37 +23,37 @@ tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOpe // undefined + boolean/Object var r1 = undefined + a; - ~~~~~~~~~ -!!! error TS2532: Object is possibly 'undefined'. + ~~~~~~~~~~~~~ +!!! error TS2365: Operator '+' cannot be applied to types 'undefined' and 'boolean'. var r2 = undefined + b; - ~~~~~~~~~ -!!! error TS2532: Object is possibly 'undefined'. + ~~~~~~~~~~~~~ +!!! error TS2365: Operator '+' cannot be applied to types 'undefined' and 'Object'. var r3 = undefined + c; - ~~~~~~~~~ -!!! error TS2532: Object is possibly 'undefined'. + ~~~~~~~~~~~~~ +!!! error TS2365: Operator '+' cannot be applied to types 'undefined' and 'void'. var r4 = a + undefined; - ~~~~~~~~~ -!!! error TS2532: Object is possibly 'undefined'. + ~~~~~~~~~~~~~ +!!! error TS2365: Operator '+' cannot be applied to types 'boolean' and 'undefined'. var r5 = b + undefined; - ~~~~~~~~~ -!!! error TS2532: Object is possibly 'undefined'. + ~~~~~~~~~~~~~ +!!! error TS2365: Operator '+' cannot be applied to types 'Object' and 'undefined'. var r6 = undefined + c; - ~~~~~~~~~ -!!! error TS2532: Object is possibly 'undefined'. + ~~~~~~~~~~~~~ +!!! error TS2365: Operator '+' cannot be applied to types 'undefined' and 'void'. // other cases var r7 = undefined + d; - ~~~~~~~~~ -!!! error TS2532: Object is possibly 'undefined'. + ~~~~~~~~~~~~~ +!!! error TS2365: Operator '+' cannot be applied to types 'undefined' and 'Number'. var r8 = undefined + true; - ~~~~~~~~~ -!!! error TS2532: Object is possibly 'undefined'. + ~~~~~~~~~~~~~~~~ +!!! error TS2365: Operator '+' cannot be applied to types 'undefined' and 'true'. var r9 = undefined + { a: '' }; - ~~~~~~~~~ -!!! error TS2532: Object is possibly 'undefined'. + ~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2365: Operator '+' cannot be applied to types 'undefined' and '{ a: string; }'. var r10 = undefined + foo(); - ~~~~~~~~~ -!!! error TS2532: Object is possibly 'undefined'. + ~~~~~~~~~~~~~~~~~ +!!! error TS2365: Operator '+' cannot be applied to types 'undefined' and 'void'. var r11 = undefined + (() => { }); - ~~~~~~~~~ -!!! error TS2532: Object is possibly 'undefined'. \ No newline at end of file + ~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2365: Operator '+' cannot be applied to types 'undefined' and '() => void'. \ No newline at end of file diff --git a/tests/baselines/reference/additionOperatorWithUndefinedValueAndValidOperator.errors.txt b/tests/baselines/reference/additionOperatorWithUndefinedValueAndValidOperator.errors.txt index 04c0e2f3266e7..db2446aa3f9db 100644 --- a/tests/baselines/reference/additionOperatorWithUndefinedValueAndValidOperator.errors.txt +++ b/tests/baselines/reference/additionOperatorWithUndefinedValueAndValidOperator.errors.txt @@ -1,13 +1,13 @@ -tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithUndefinedValueAndValidOperator.ts(15,10): error TS2532: Object is possibly 'undefined'. -tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithUndefinedValueAndValidOperator.ts(16,10): error TS2532: Object is possibly 'undefined'. -tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithUndefinedValueAndValidOperator.ts(17,10): error TS2532: Object is possibly 'undefined'. -tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithUndefinedValueAndValidOperator.ts(18,10): error TS2532: Object is possibly 'undefined'. -tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithUndefinedValueAndValidOperator.ts(19,10): error TS2532: Object is possibly 'undefined'. -tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithUndefinedValueAndValidOperator.ts(20,14): error TS2532: Object is possibly 'undefined'. -tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithUndefinedValueAndValidOperator.ts(21,14): error TS2532: Object is possibly 'undefined'. -tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithUndefinedValueAndValidOperator.ts(22,15): error TS2532: Object is possibly 'undefined'. -tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithUndefinedValueAndValidOperator.ts(23,17): error TS2532: Object is possibly 'undefined'. -tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithUndefinedValueAndValidOperator.ts(24,20): error TS2532: Object is possibly 'undefined'. +tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithUndefinedValueAndValidOperator.ts(15,10): error TS2365: Operator '+' cannot be applied to types 'undefined' and 'number'. +tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithUndefinedValueAndValidOperator.ts(16,10): error TS2365: Operator '+' cannot be applied to types 'undefined' and '1'. +tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithUndefinedValueAndValidOperator.ts(17,10): error TS2365: Operator '+' cannot be applied to types 'undefined' and 'E'. +tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithUndefinedValueAndValidOperator.ts(18,10): error TS2365: Operator '+' cannot be applied to types 'undefined' and 'E.a'. +tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithUndefinedValueAndValidOperator.ts(19,10): error TS2365: Operator '+' cannot be applied to types 'undefined' and 'E.a'. +tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithUndefinedValueAndValidOperator.ts(20,10): error TS2365: Operator '+' cannot be applied to types 'number' and 'undefined'. +tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithUndefinedValueAndValidOperator.ts(21,10): error TS2365: Operator '+' cannot be applied to types '1' and 'undefined'. +tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithUndefinedValueAndValidOperator.ts(22,11): error TS2365: Operator '+' cannot be applied to types 'E' and 'undefined'. +tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithUndefinedValueAndValidOperator.ts(23,11): error TS2365: Operator '+' cannot be applied to types 'E.a' and 'undefined'. +tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithUndefinedValueAndValidOperator.ts(24,11): error TS2365: Operator '+' cannot be applied to types 'E.a' and 'undefined'. ==== tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithUndefinedValueAndValidOperator.ts (10 errors) ==== @@ -26,35 +26,35 @@ tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOpe // undefined + number/enum var r3 = undefined + b; - ~~~~~~~~~ -!!! error TS2532: Object is possibly 'undefined'. + ~~~~~~~~~~~~~ +!!! error TS2365: Operator '+' cannot be applied to types 'undefined' and 'number'. var r4 = undefined + 1; - ~~~~~~~~~ -!!! error TS2532: Object is possibly 'undefined'. + ~~~~~~~~~~~~~ +!!! error TS2365: Operator '+' cannot be applied to types 'undefined' and '1'. var r5 = undefined + c; - ~~~~~~~~~ -!!! error TS2532: Object is possibly 'undefined'. + ~~~~~~~~~~~~~ +!!! error TS2365: Operator '+' cannot be applied to types 'undefined' and 'E'. var r6 = undefined + E.a; - ~~~~~~~~~ -!!! error TS2532: Object is possibly 'undefined'. + ~~~~~~~~~~~~~~~ +!!! error TS2365: Operator '+' cannot be applied to types 'undefined' and 'E.a'. var r7 = undefined + E['a']; - ~~~~~~~~~ -!!! error TS2532: Object is possibly 'undefined'. + ~~~~~~~~~~~~~~~~~~ +!!! error TS2365: Operator '+' cannot be applied to types 'undefined' and 'E.a'. var r8 = b + undefined; - ~~~~~~~~~ -!!! error TS2532: Object is possibly 'undefined'. + ~~~~~~~~~~~~~ +!!! error TS2365: Operator '+' cannot be applied to types 'number' and 'undefined'. var r9 = 1 + undefined; - ~~~~~~~~~ -!!! error TS2532: Object is possibly 'undefined'. + ~~~~~~~~~~~~~ +!!! error TS2365: Operator '+' cannot be applied to types '1' and 'undefined'. var r10 = c + undefined - ~~~~~~~~~ -!!! error TS2532: Object is possibly 'undefined'. + ~~~~~~~~~~~~~ +!!! error TS2365: Operator '+' cannot be applied to types 'E' and 'undefined'. var r11 = E.a + undefined; - ~~~~~~~~~ -!!! error TS2532: Object is possibly 'undefined'. + ~~~~~~~~~~~~~~~ +!!! error TS2365: Operator '+' cannot be applied to types 'E.a' and 'undefined'. var r12 = E['a'] + undefined; - ~~~~~~~~~ -!!! error TS2532: Object is possibly 'undefined'. + ~~~~~~~~~~~~~~~~~~ +!!! error TS2365: Operator '+' cannot be applied to types 'E.a' and 'undefined'. // undefined + string var r13 = undefined + d; diff --git a/tests/baselines/reference/bitwiseNotOperatorWithAnyOtherType.errors.txt b/tests/baselines/reference/bitwiseNotOperatorWithAnyOtherType.errors.txt index 411c7099f1149..795a9f0863dc1 100644 --- a/tests/baselines/reference/bitwiseNotOperatorWithAnyOtherType.errors.txt +++ b/tests/baselines/reference/bitwiseNotOperatorWithAnyOtherType.errors.txt @@ -1,14 +1,11 @@ tests/cases/conformance/expressions/unaryOperators/bitwiseNotOperator/bitwiseNotOperatorWithAnyOtherType.ts(34,24): error TS2532: Object is possibly 'undefined'. tests/cases/conformance/expressions/unaryOperators/bitwiseNotOperator/bitwiseNotOperatorWithAnyOtherType.ts(35,24): error TS2531: Object is possibly 'null'. -tests/cases/conformance/expressions/unaryOperators/bitwiseNotOperator/bitwiseNotOperatorWithAnyOtherType.ts(46,26): error TS2531: Object is possibly 'null'. -tests/cases/conformance/expressions/unaryOperators/bitwiseNotOperator/bitwiseNotOperatorWithAnyOtherType.ts(46,33): error TS2532: Object is possibly 'undefined'. -tests/cases/conformance/expressions/unaryOperators/bitwiseNotOperator/bitwiseNotOperatorWithAnyOtherType.ts(47,26): error TS2531: Object is possibly 'null'. -tests/cases/conformance/expressions/unaryOperators/bitwiseNotOperator/bitwiseNotOperatorWithAnyOtherType.ts(47,33): error TS2531: Object is possibly 'null'. -tests/cases/conformance/expressions/unaryOperators/bitwiseNotOperator/bitwiseNotOperatorWithAnyOtherType.ts(48,26): error TS2532: Object is possibly 'undefined'. -tests/cases/conformance/expressions/unaryOperators/bitwiseNotOperator/bitwiseNotOperatorWithAnyOtherType.ts(48,38): error TS2532: Object is possibly 'undefined'. +tests/cases/conformance/expressions/unaryOperators/bitwiseNotOperator/bitwiseNotOperatorWithAnyOtherType.ts(46,26): error TS2365: Operator '+' cannot be applied to types 'null' and 'undefined'. +tests/cases/conformance/expressions/unaryOperators/bitwiseNotOperator/bitwiseNotOperatorWithAnyOtherType.ts(47,26): error TS2365: Operator '+' cannot be applied to types 'null' and 'null'. +tests/cases/conformance/expressions/unaryOperators/bitwiseNotOperator/bitwiseNotOperatorWithAnyOtherType.ts(48,26): error TS2365: Operator '+' cannot be applied to types 'undefined' and 'undefined'. -==== tests/cases/conformance/expressions/unaryOperators/bitwiseNotOperator/bitwiseNotOperatorWithAnyOtherType.ts (8 errors) ==== +==== tests/cases/conformance/expressions/unaryOperators/bitwiseNotOperator/bitwiseNotOperatorWithAnyOtherType.ts (5 errors) ==== // ~ operator on any type var ANY: any; @@ -59,20 +56,14 @@ tests/cases/conformance/expressions/unaryOperators/bitwiseNotOperator/bitwiseNot var ResultIsNumber14 = ~A.foo(); var ResultIsNumber15 = ~(ANY + ANY1); var ResultIsNumber16 = ~(null + undefined); - ~~~~ -!!! error TS2531: Object is possibly 'null'. - ~~~~~~~~~ -!!! error TS2532: Object is possibly 'undefined'. + ~~~~~~~~~~~~~~~~ +!!! error TS2365: Operator '+' cannot be applied to types 'null' and 'undefined'. var ResultIsNumber17 = ~(null + null); - ~~~~ -!!! error TS2531: Object is possibly 'null'. - ~~~~ -!!! error TS2531: Object is possibly 'null'. + ~~~~~~~~~~~ +!!! error TS2365: Operator '+' cannot be applied to types 'null' and 'null'. var ResultIsNumber18 = ~(undefined + undefined); - ~~~~~~~~~ -!!! error TS2532: Object is possibly 'undefined'. - ~~~~~~~~~ -!!! error TS2532: Object is possibly 'undefined'. + ~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2365: Operator '+' cannot be applied to types 'undefined' and 'undefined'. // multiple ~ operators var ResultIsNumber19 = ~~ANY; diff --git a/tests/baselines/reference/compoundAdditionAssignmentLHSCanBeAssigned.errors.txt b/tests/baselines/reference/compoundAdditionAssignmentLHSCanBeAssigned.errors.txt index 08d8fd0c6d3f7..f7df532b20ed9 100644 --- a/tests/baselines/reference/compoundAdditionAssignmentLHSCanBeAssigned.errors.txt +++ b/tests/baselines/reference/compoundAdditionAssignmentLHSCanBeAssigned.errors.txt @@ -1,7 +1,7 @@ -tests/cases/conformance/expressions/assignmentOperator/compoundAdditionAssignmentLHSCanBeAssigned.ts(32,7): error TS2531: Object is possibly 'null'. -tests/cases/conformance/expressions/assignmentOperator/compoundAdditionAssignmentLHSCanBeAssigned.ts(33,7): error TS2532: Object is possibly 'undefined'. -tests/cases/conformance/expressions/assignmentOperator/compoundAdditionAssignmentLHSCanBeAssigned.ts(39,7): error TS2531: Object is possibly 'null'. -tests/cases/conformance/expressions/assignmentOperator/compoundAdditionAssignmentLHSCanBeAssigned.ts(40,7): error TS2532: Object is possibly 'undefined'. +tests/cases/conformance/expressions/assignmentOperator/compoundAdditionAssignmentLHSCanBeAssigned.ts(32,1): error TS2365: Operator '+=' cannot be applied to types 'number' and 'null'. +tests/cases/conformance/expressions/assignmentOperator/compoundAdditionAssignmentLHSCanBeAssigned.ts(33,1): error TS2365: Operator '+=' cannot be applied to types 'number' and 'undefined'. +tests/cases/conformance/expressions/assignmentOperator/compoundAdditionAssignmentLHSCanBeAssigned.ts(39,1): error TS2365: Operator '+=' cannot be applied to types 'E' and 'null'. +tests/cases/conformance/expressions/assignmentOperator/compoundAdditionAssignmentLHSCanBeAssigned.ts(40,1): error TS2365: Operator '+=' cannot be applied to types 'E' and 'undefined'. ==== tests/cases/conformance/expressions/assignmentOperator/compoundAdditionAssignmentLHSCanBeAssigned.ts (4 errors) ==== @@ -37,22 +37,22 @@ tests/cases/conformance/expressions/assignmentOperator/compoundAdditionAssignmen x3 += 0; x3 += E.a; x3 += null; - ~~~~ -!!! error TS2531: Object is possibly 'null'. + ~~~~~~~~~~ +!!! error TS2365: Operator '+=' cannot be applied to types 'number' and 'null'. x3 += undefined; - ~~~~~~~~~ -!!! error TS2532: Object is possibly 'undefined'. + ~~~~~~~~~~~~~~~ +!!! error TS2365: Operator '+=' cannot be applied to types 'number' and 'undefined'. var x4: E; x4 += a; x4 += 0; x4 += E.a; x4 += null; - ~~~~ -!!! error TS2531: Object is possibly 'null'. + ~~~~~~~~~~ +!!! error TS2365: Operator '+=' cannot be applied to types 'E' and 'null'. x4 += undefined; - ~~~~~~~~~ -!!! error TS2532: Object is possibly 'undefined'. + ~~~~~~~~~~~~~~~ +!!! error TS2365: Operator '+=' cannot be applied to types 'E' and 'undefined'. var x5: boolean; x5 += a; diff --git a/tests/baselines/reference/compoundAdditionAssignmentWithInvalidOperands.errors.txt b/tests/baselines/reference/compoundAdditionAssignmentWithInvalidOperands.errors.txt index 1812065f149ca..e570f2f6cf0ef 100644 --- a/tests/baselines/reference/compoundAdditionAssignmentWithInvalidOperands.errors.txt +++ b/tests/baselines/reference/compoundAdditionAssignmentWithInvalidOperands.errors.txt @@ -3,22 +3,22 @@ tests/cases/conformance/expressions/assignmentOperator/compoundAdditionAssignmen tests/cases/conformance/expressions/assignmentOperator/compoundAdditionAssignmentWithInvalidOperands.ts(8,1): error TS2365: Operator '+=' cannot be applied to types 'boolean' and '0'. tests/cases/conformance/expressions/assignmentOperator/compoundAdditionAssignmentWithInvalidOperands.ts(9,1): error TS2365: Operator '+=' cannot be applied to types 'boolean' and 'E.a'. tests/cases/conformance/expressions/assignmentOperator/compoundAdditionAssignmentWithInvalidOperands.ts(10,1): error TS2365: Operator '+=' cannot be applied to types 'boolean' and '{}'. -tests/cases/conformance/expressions/assignmentOperator/compoundAdditionAssignmentWithInvalidOperands.ts(11,7): error TS2531: Object is possibly 'null'. -tests/cases/conformance/expressions/assignmentOperator/compoundAdditionAssignmentWithInvalidOperands.ts(12,7): error TS2532: Object is possibly 'undefined'. +tests/cases/conformance/expressions/assignmentOperator/compoundAdditionAssignmentWithInvalidOperands.ts(11,1): error TS2365: Operator '+=' cannot be applied to types 'boolean' and 'null'. +tests/cases/conformance/expressions/assignmentOperator/compoundAdditionAssignmentWithInvalidOperands.ts(12,1): error TS2365: Operator '+=' cannot be applied to types 'boolean' and 'undefined'. tests/cases/conformance/expressions/assignmentOperator/compoundAdditionAssignmentWithInvalidOperands.ts(15,1): error TS2365: Operator '+=' cannot be applied to types '{}' and 'void'. tests/cases/conformance/expressions/assignmentOperator/compoundAdditionAssignmentWithInvalidOperands.ts(16,1): error TS2365: Operator '+=' cannot be applied to types '{}' and 'true'. tests/cases/conformance/expressions/assignmentOperator/compoundAdditionAssignmentWithInvalidOperands.ts(17,1): error TS2365: Operator '+=' cannot be applied to types '{}' and '0'. tests/cases/conformance/expressions/assignmentOperator/compoundAdditionAssignmentWithInvalidOperands.ts(18,1): error TS2365: Operator '+=' cannot be applied to types '{}' and 'E.a'. tests/cases/conformance/expressions/assignmentOperator/compoundAdditionAssignmentWithInvalidOperands.ts(19,1): error TS2365: Operator '+=' cannot be applied to types '{}' and '{}'. -tests/cases/conformance/expressions/assignmentOperator/compoundAdditionAssignmentWithInvalidOperands.ts(20,7): error TS2531: Object is possibly 'null'. -tests/cases/conformance/expressions/assignmentOperator/compoundAdditionAssignmentWithInvalidOperands.ts(21,7): error TS2532: Object is possibly 'undefined'. +tests/cases/conformance/expressions/assignmentOperator/compoundAdditionAssignmentWithInvalidOperands.ts(20,1): error TS2365: Operator '+=' cannot be applied to types '{}' and 'null'. +tests/cases/conformance/expressions/assignmentOperator/compoundAdditionAssignmentWithInvalidOperands.ts(21,1): error TS2365: Operator '+=' cannot be applied to types '{}' and 'undefined'. tests/cases/conformance/expressions/assignmentOperator/compoundAdditionAssignmentWithInvalidOperands.ts(24,1): error TS2365: Operator '+=' cannot be applied to types 'void' and 'void'. tests/cases/conformance/expressions/assignmentOperator/compoundAdditionAssignmentWithInvalidOperands.ts(25,1): error TS2365: Operator '+=' cannot be applied to types 'void' and 'true'. tests/cases/conformance/expressions/assignmentOperator/compoundAdditionAssignmentWithInvalidOperands.ts(26,1): error TS2365: Operator '+=' cannot be applied to types 'void' and '0'. tests/cases/conformance/expressions/assignmentOperator/compoundAdditionAssignmentWithInvalidOperands.ts(27,1): error TS2365: Operator '+=' cannot be applied to types 'void' and 'E.a'. tests/cases/conformance/expressions/assignmentOperator/compoundAdditionAssignmentWithInvalidOperands.ts(28,1): error TS2365: Operator '+=' cannot be applied to types 'void' and '{}'. -tests/cases/conformance/expressions/assignmentOperator/compoundAdditionAssignmentWithInvalidOperands.ts(29,7): error TS2531: Object is possibly 'null'. -tests/cases/conformance/expressions/assignmentOperator/compoundAdditionAssignmentWithInvalidOperands.ts(30,7): error TS2532: Object is possibly 'undefined'. +tests/cases/conformance/expressions/assignmentOperator/compoundAdditionAssignmentWithInvalidOperands.ts(29,1): error TS2365: Operator '+=' cannot be applied to types 'void' and 'null'. +tests/cases/conformance/expressions/assignmentOperator/compoundAdditionAssignmentWithInvalidOperands.ts(30,1): error TS2365: Operator '+=' cannot be applied to types 'void' and 'undefined'. tests/cases/conformance/expressions/assignmentOperator/compoundAdditionAssignmentWithInvalidOperands.ts(33,1): error TS2365: Operator '+=' cannot be applied to types 'number' and 'void'. tests/cases/conformance/expressions/assignmentOperator/compoundAdditionAssignmentWithInvalidOperands.ts(34,1): error TS2365: Operator '+=' cannot be applied to types 'number' and 'true'. tests/cases/conformance/expressions/assignmentOperator/compoundAdditionAssignmentWithInvalidOperands.ts(35,1): error TS2365: Operator '+=' cannot be applied to types 'number' and '{}'. @@ -49,11 +49,11 @@ tests/cases/conformance/expressions/assignmentOperator/compoundAdditionAssignmen ~~~~~~~~ !!! error TS2365: Operator '+=' cannot be applied to types 'boolean' and '{}'. x1 += null; - ~~~~ -!!! error TS2531: Object is possibly 'null'. + ~~~~~~~~~~ +!!! error TS2365: Operator '+=' cannot be applied to types 'boolean' and 'null'. x1 += undefined; - ~~~~~~~~~ -!!! error TS2532: Object is possibly 'undefined'. + ~~~~~~~~~~~~~~~ +!!! error TS2365: Operator '+=' cannot be applied to types 'boolean' and 'undefined'. var x2: {}; x2 += a; @@ -72,11 +72,11 @@ tests/cases/conformance/expressions/assignmentOperator/compoundAdditionAssignmen ~~~~~~~~ !!! error TS2365: Operator '+=' cannot be applied to types '{}' and '{}'. x2 += null; - ~~~~ -!!! error TS2531: Object is possibly 'null'. + ~~~~~~~~~~ +!!! error TS2365: Operator '+=' cannot be applied to types '{}' and 'null'. x2 += undefined; - ~~~~~~~~~ -!!! error TS2532: Object is possibly 'undefined'. + ~~~~~~~~~~~~~~~ +!!! error TS2365: Operator '+=' cannot be applied to types '{}' and 'undefined'. var x3: void; x3 += a; @@ -95,11 +95,11 @@ tests/cases/conformance/expressions/assignmentOperator/compoundAdditionAssignmen ~~~~~~~~ !!! error TS2365: Operator '+=' cannot be applied to types 'void' and '{}'. x3 += null; - ~~~~ -!!! error TS2531: Object is possibly 'null'. + ~~~~~~~~~~ +!!! error TS2365: Operator '+=' cannot be applied to types 'void' and 'null'. x3 += undefined; - ~~~~~~~~~ -!!! error TS2532: Object is possibly 'undefined'. + ~~~~~~~~~~~~~~~ +!!! error TS2365: Operator '+=' cannot be applied to types 'void' and 'undefined'. var x4: number; x4 += a; diff --git a/tests/baselines/reference/decrementOperatorWithAnyOtherTypeInvalidOperations.errors.txt b/tests/baselines/reference/decrementOperatorWithAnyOtherTypeInvalidOperations.errors.txt index 33e31bc947861..ff54b4d52c6fb 100644 --- a/tests/baselines/reference/decrementOperatorWithAnyOtherTypeInvalidOperations.errors.txt +++ b/tests/baselines/reference/decrementOperatorWithAnyOtherTypeInvalidOperations.errors.txt @@ -19,27 +19,21 @@ tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOp tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithAnyOtherTypeInvalidOperations.ts(46,26): error TS2357: The operand of an increment or decrement operator must be a variable or a property access. tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithAnyOtherTypeInvalidOperations.ts(47,26): error TS2357: The operand of an increment or decrement operator must be a variable or a property access. tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithAnyOtherTypeInvalidOperations.ts(48,26): error TS2357: The operand of an increment or decrement operator must be a variable or a property access. -tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithAnyOtherTypeInvalidOperations.ts(48,27): error TS2531: Object is possibly 'null'. -tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithAnyOtherTypeInvalidOperations.ts(48,34): error TS2532: Object is possibly 'undefined'. +tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithAnyOtherTypeInvalidOperations.ts(48,27): error TS2365: Operator '+' cannot be applied to types 'null' and 'undefined'. tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithAnyOtherTypeInvalidOperations.ts(49,26): error TS2357: The operand of an increment or decrement operator must be a variable or a property access. -tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithAnyOtherTypeInvalidOperations.ts(49,27): error TS2531: Object is possibly 'null'. -tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithAnyOtherTypeInvalidOperations.ts(49,34): error TS2531: Object is possibly 'null'. +tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithAnyOtherTypeInvalidOperations.ts(49,27): error TS2365: Operator '+' cannot be applied to types 'null' and 'null'. tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithAnyOtherTypeInvalidOperations.ts(50,26): error TS2357: The operand of an increment or decrement operator must be a variable or a property access. -tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithAnyOtherTypeInvalidOperations.ts(50,27): error TS2532: Object is possibly 'undefined'. -tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithAnyOtherTypeInvalidOperations.ts(50,39): error TS2532: Object is possibly 'undefined'. +tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithAnyOtherTypeInvalidOperations.ts(50,27): error TS2365: Operator '+' cannot be applied to types 'undefined' and 'undefined'. tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithAnyOtherTypeInvalidOperations.ts(51,26): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithAnyOtherTypeInvalidOperations.ts(52,26): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithAnyOtherTypeInvalidOperations.ts(54,24): error TS2357: The operand of an increment or decrement operator must be a variable or a property access. tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithAnyOtherTypeInvalidOperations.ts(55,24): error TS2357: The operand of an increment or decrement operator must be a variable or a property access. tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithAnyOtherTypeInvalidOperations.ts(56,24): error TS2357: The operand of an increment or decrement operator must be a variable or a property access. -tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithAnyOtherTypeInvalidOperations.ts(56,25): error TS2531: Object is possibly 'null'. -tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithAnyOtherTypeInvalidOperations.ts(56,32): error TS2532: Object is possibly 'undefined'. +tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithAnyOtherTypeInvalidOperations.ts(56,25): error TS2365: Operator '+' cannot be applied to types 'null' and 'undefined'. tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithAnyOtherTypeInvalidOperations.ts(57,24): error TS2357: The operand of an increment or decrement operator must be a variable or a property access. -tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithAnyOtherTypeInvalidOperations.ts(57,25): error TS2531: Object is possibly 'null'. -tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithAnyOtherTypeInvalidOperations.ts(57,32): error TS2531: Object is possibly 'null'. +tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithAnyOtherTypeInvalidOperations.ts(57,25): error TS2365: Operator '+' cannot be applied to types 'null' and 'null'. tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithAnyOtherTypeInvalidOperations.ts(58,24): error TS2357: The operand of an increment or decrement operator must be a variable or a property access. -tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithAnyOtherTypeInvalidOperations.ts(58,25): error TS2532: Object is possibly 'undefined'. -tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithAnyOtherTypeInvalidOperations.ts(58,37): error TS2532: Object is possibly 'undefined'. +tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithAnyOtherTypeInvalidOperations.ts(58,25): error TS2365: Operator '+' cannot be applied to types 'undefined' and 'undefined'. tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithAnyOtherTypeInvalidOperations.ts(59,24): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithAnyOtherTypeInvalidOperations.ts(60,24): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithAnyOtherTypeInvalidOperations.ts(63,3): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. @@ -58,7 +52,7 @@ tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOp tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithAnyOtherTypeInvalidOperations.ts(72,12): error TS1109: Expression expected. -==== tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithAnyOtherTypeInvalidOperations.ts (58 errors) ==== +==== tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithAnyOtherTypeInvalidOperations.ts (52 errors) ==== // -- operator on any type var ANY1: any; var ANY2: any[] = ["", ""]; @@ -149,24 +143,18 @@ tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOp var ResultIsNumber19 = --(null + undefined); ~~~~~~~~~~~~~~~~~~ !!! error TS2357: The operand of an increment or decrement operator must be a variable or a property access. - ~~~~ -!!! error TS2531: Object is possibly 'null'. - ~~~~~~~~~ -!!! error TS2532: Object is possibly 'undefined'. + ~~~~~~~~~~~~~~~~ +!!! error TS2365: Operator '+' cannot be applied to types 'null' and 'undefined'. var ResultIsNumber20 = --(null + null); ~~~~~~~~~~~~~ !!! error TS2357: The operand of an increment or decrement operator must be a variable or a property access. - ~~~~ -!!! error TS2531: Object is possibly 'null'. - ~~~~ -!!! error TS2531: Object is possibly 'null'. + ~~~~~~~~~~~ +!!! error TS2365: Operator '+' cannot be applied to types 'null' and 'null'. var ResultIsNumber21 = --(undefined + undefined); ~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2357: The operand of an increment or decrement operator must be a variable or a property access. - ~~~~~~~~~ -!!! error TS2532: Object is possibly 'undefined'. - ~~~~~~~~~ -!!! error TS2532: Object is possibly 'undefined'. + ~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2365: Operator '+' cannot be applied to types 'undefined' and 'undefined'. var ResultIsNumber22 = --obj1.x; ~~~~~~ !!! error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. @@ -183,24 +171,18 @@ tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOp var ResultIsNumber26 = (null + undefined)--; ~~~~~~~~~~~~~~~~~~ !!! error TS2357: The operand of an increment or decrement operator must be a variable or a property access. - ~~~~ -!!! error TS2531: Object is possibly 'null'. - ~~~~~~~~~ -!!! error TS2532: Object is possibly 'undefined'. + ~~~~~~~~~~~~~~~~ +!!! error TS2365: Operator '+' cannot be applied to types 'null' and 'undefined'. var ResultIsNumber27 = (null + null)--; ~~~~~~~~~~~~~ !!! error TS2357: The operand of an increment or decrement operator must be a variable or a property access. - ~~~~ -!!! error TS2531: Object is possibly 'null'. - ~~~~ -!!! error TS2531: Object is possibly 'null'. + ~~~~~~~~~~~ +!!! error TS2365: Operator '+' cannot be applied to types 'null' and 'null'. var ResultIsNumber28 = (undefined + undefined)--; ~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2357: The operand of an increment or decrement operator must be a variable or a property access. - ~~~~~~~~~ -!!! error TS2532: Object is possibly 'undefined'. - ~~~~~~~~~ -!!! error TS2532: Object is possibly 'undefined'. + ~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2365: Operator '+' cannot be applied to types 'undefined' and 'undefined'. var ResultIsNumber29 = obj1.x--; ~~~~~~ !!! error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. diff --git a/tests/baselines/reference/deleteOperatorWithAnyOtherType.errors.txt b/tests/baselines/reference/deleteOperatorWithAnyOtherType.errors.txt index f2260b110365a..5ea3f6135c16c 100644 --- a/tests/baselines/reference/deleteOperatorWithAnyOtherType.errors.txt +++ b/tests/baselines/reference/deleteOperatorWithAnyOtherType.errors.txt @@ -9,15 +9,12 @@ tests/cases/conformance/expressions/unaryOperators/deleteOperator/deleteOperator tests/cases/conformance/expressions/unaryOperators/deleteOperator/deleteOperatorWithAnyOtherType.ts(42,32): error TS2703: The operand of a delete operator must be a property reference. tests/cases/conformance/expressions/unaryOperators/deleteOperator/deleteOperatorWithAnyOtherType.ts(43,32): error TS2703: The operand of a delete operator must be a property reference. tests/cases/conformance/expressions/unaryOperators/deleteOperator/deleteOperatorWithAnyOtherType.ts(44,33): error TS2703: The operand of a delete operator must be a property reference. -tests/cases/conformance/expressions/unaryOperators/deleteOperator/deleteOperatorWithAnyOtherType.ts(45,33): error TS2531: Object is possibly 'null'. +tests/cases/conformance/expressions/unaryOperators/deleteOperator/deleteOperatorWithAnyOtherType.ts(45,33): error TS2365: Operator '+' cannot be applied to types 'null' and 'undefined'. tests/cases/conformance/expressions/unaryOperators/deleteOperator/deleteOperatorWithAnyOtherType.ts(45,33): error TS2703: The operand of a delete operator must be a property reference. -tests/cases/conformance/expressions/unaryOperators/deleteOperator/deleteOperatorWithAnyOtherType.ts(45,40): error TS2532: Object is possibly 'undefined'. -tests/cases/conformance/expressions/unaryOperators/deleteOperator/deleteOperatorWithAnyOtherType.ts(46,33): error TS2531: Object is possibly 'null'. +tests/cases/conformance/expressions/unaryOperators/deleteOperator/deleteOperatorWithAnyOtherType.ts(46,33): error TS2365: Operator '+' cannot be applied to types 'null' and 'null'. tests/cases/conformance/expressions/unaryOperators/deleteOperator/deleteOperatorWithAnyOtherType.ts(46,33): error TS2703: The operand of a delete operator must be a property reference. -tests/cases/conformance/expressions/unaryOperators/deleteOperator/deleteOperatorWithAnyOtherType.ts(46,40): error TS2531: Object is possibly 'null'. -tests/cases/conformance/expressions/unaryOperators/deleteOperator/deleteOperatorWithAnyOtherType.ts(47,33): error TS2532: Object is possibly 'undefined'. +tests/cases/conformance/expressions/unaryOperators/deleteOperator/deleteOperatorWithAnyOtherType.ts(47,33): error TS2365: Operator '+' cannot be applied to types 'undefined' and 'undefined'. tests/cases/conformance/expressions/unaryOperators/deleteOperator/deleteOperatorWithAnyOtherType.ts(47,33): error TS2703: The operand of a delete operator must be a property reference. -tests/cases/conformance/expressions/unaryOperators/deleteOperator/deleteOperatorWithAnyOtherType.ts(47,45): error TS2532: Object is possibly 'undefined'. tests/cases/conformance/expressions/unaryOperators/deleteOperator/deleteOperatorWithAnyOtherType.ts(50,32): error TS2703: The operand of a delete operator must be a property reference. tests/cases/conformance/expressions/unaryOperators/deleteOperator/deleteOperatorWithAnyOtherType.ts(50,39): error TS2703: The operand of a delete operator must be a property reference. tests/cases/conformance/expressions/unaryOperators/deleteOperator/deleteOperatorWithAnyOtherType.ts(51,32): error TS2703: The operand of a delete operator must be a property reference. @@ -28,7 +25,7 @@ tests/cases/conformance/expressions/unaryOperators/deleteOperator/deleteOperator tests/cases/conformance/expressions/unaryOperators/deleteOperator/deleteOperatorWithAnyOtherType.ts(57,8): error TS2703: The operand of a delete operator must be a property reference. -==== tests/cases/conformance/expressions/unaryOperators/deleteOperator/deleteOperatorWithAnyOtherType.ts (28 errors) ==== +==== tests/cases/conformance/expressions/unaryOperators/deleteOperator/deleteOperatorWithAnyOtherType.ts (25 errors) ==== // delete operator on any type var ANY: any; @@ -96,26 +93,20 @@ tests/cases/conformance/expressions/unaryOperators/deleteOperator/deleteOperator ~~~~~~~~~~ !!! error TS2703: The operand of a delete operator must be a property reference. var ResultIsBoolean17 = delete (null + undefined); - ~~~~ -!!! error TS2531: Object is possibly 'null'. + ~~~~~~~~~~~~~~~~ +!!! error TS2365: Operator '+' cannot be applied to types 'null' and 'undefined'. ~~~~~~~~~~~~~~~~ !!! error TS2703: The operand of a delete operator must be a property reference. - ~~~~~~~~~ -!!! error TS2532: Object is possibly 'undefined'. var ResultIsBoolean18 = delete (null + null); - ~~~~ -!!! error TS2531: Object is possibly 'null'. + ~~~~~~~~~~~ +!!! error TS2365: Operator '+' cannot be applied to types 'null' and 'null'. ~~~~~~~~~~~ !!! error TS2703: The operand of a delete operator must be a property reference. - ~~~~ -!!! error TS2531: Object is possibly 'null'. var ResultIsBoolean19 = delete (undefined + undefined); - ~~~~~~~~~ -!!! error TS2532: Object is possibly 'undefined'. + ~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2365: Operator '+' cannot be applied to types 'undefined' and 'undefined'. ~~~~~~~~~~~~~~~~~~~~~ !!! error TS2703: The operand of a delete operator must be a property reference. - ~~~~~~~~~ -!!! error TS2532: Object is possibly 'undefined'. // multiple delete operators var ResultIsBoolean20 = delete delete ANY; diff --git a/tests/baselines/reference/incrementOperatorWithAnyOtherTypeInvalidOperations.errors.txt b/tests/baselines/reference/incrementOperatorWithAnyOtherTypeInvalidOperations.errors.txt index afdddab86a7ec..690f3391933d7 100644 --- a/tests/baselines/reference/incrementOperatorWithAnyOtherTypeInvalidOperations.errors.txt +++ b/tests/baselines/reference/incrementOperatorWithAnyOtherTypeInvalidOperations.errors.txt @@ -19,27 +19,21 @@ tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOp tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOperatorWithAnyOtherTypeInvalidOperations.ts(46,26): error TS2357: The operand of an increment or decrement operator must be a variable or a property access. tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOperatorWithAnyOtherTypeInvalidOperations.ts(47,26): error TS2357: The operand of an increment or decrement operator must be a variable or a property access. tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOperatorWithAnyOtherTypeInvalidOperations.ts(48,26): error TS2357: The operand of an increment or decrement operator must be a variable or a property access. -tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOperatorWithAnyOtherTypeInvalidOperations.ts(48,27): error TS2531: Object is possibly 'null'. -tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOperatorWithAnyOtherTypeInvalidOperations.ts(48,34): error TS2532: Object is possibly 'undefined'. +tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOperatorWithAnyOtherTypeInvalidOperations.ts(48,27): error TS2365: Operator '+' cannot be applied to types 'null' and 'undefined'. tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOperatorWithAnyOtherTypeInvalidOperations.ts(49,26): error TS2357: The operand of an increment or decrement operator must be a variable or a property access. -tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOperatorWithAnyOtherTypeInvalidOperations.ts(49,27): error TS2531: Object is possibly 'null'. -tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOperatorWithAnyOtherTypeInvalidOperations.ts(49,34): error TS2531: Object is possibly 'null'. +tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOperatorWithAnyOtherTypeInvalidOperations.ts(49,27): error TS2365: Operator '+' cannot be applied to types 'null' and 'null'. tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOperatorWithAnyOtherTypeInvalidOperations.ts(50,26): error TS2357: The operand of an increment or decrement operator must be a variable or a property access. -tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOperatorWithAnyOtherTypeInvalidOperations.ts(50,27): error TS2532: Object is possibly 'undefined'. -tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOperatorWithAnyOtherTypeInvalidOperations.ts(50,39): error TS2532: Object is possibly 'undefined'. +tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOperatorWithAnyOtherTypeInvalidOperations.ts(50,27): error TS2365: Operator '+' cannot be applied to types 'undefined' and 'undefined'. tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOperatorWithAnyOtherTypeInvalidOperations.ts(51,26): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOperatorWithAnyOtherTypeInvalidOperations.ts(52,26): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOperatorWithAnyOtherTypeInvalidOperations.ts(54,24): error TS2357: The operand of an increment or decrement operator must be a variable or a property access. tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOperatorWithAnyOtherTypeInvalidOperations.ts(55,24): error TS2357: The operand of an increment or decrement operator must be a variable or a property access. tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOperatorWithAnyOtherTypeInvalidOperations.ts(56,24): error TS2357: The operand of an increment or decrement operator must be a variable or a property access. -tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOperatorWithAnyOtherTypeInvalidOperations.ts(56,25): error TS2531: Object is possibly 'null'. -tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOperatorWithAnyOtherTypeInvalidOperations.ts(56,32): error TS2532: Object is possibly 'undefined'. +tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOperatorWithAnyOtherTypeInvalidOperations.ts(56,25): error TS2365: Operator '+' cannot be applied to types 'null' and 'undefined'. tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOperatorWithAnyOtherTypeInvalidOperations.ts(57,24): error TS2357: The operand of an increment or decrement operator must be a variable or a property access. -tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOperatorWithAnyOtherTypeInvalidOperations.ts(57,25): error TS2531: Object is possibly 'null'. -tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOperatorWithAnyOtherTypeInvalidOperations.ts(57,32): error TS2531: Object is possibly 'null'. +tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOperatorWithAnyOtherTypeInvalidOperations.ts(57,25): error TS2365: Operator '+' cannot be applied to types 'null' and 'null'. tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOperatorWithAnyOtherTypeInvalidOperations.ts(58,24): error TS2357: The operand of an increment or decrement operator must be a variable or a property access. -tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOperatorWithAnyOtherTypeInvalidOperations.ts(58,25): error TS2532: Object is possibly 'undefined'. -tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOperatorWithAnyOtherTypeInvalidOperations.ts(58,37): error TS2532: Object is possibly 'undefined'. +tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOperatorWithAnyOtherTypeInvalidOperations.ts(58,25): error TS2365: Operator '+' cannot be applied to types 'undefined' and 'undefined'. tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOperatorWithAnyOtherTypeInvalidOperations.ts(59,24): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOperatorWithAnyOtherTypeInvalidOperations.ts(60,24): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOperatorWithAnyOtherTypeInvalidOperations.ts(63,3): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. @@ -53,7 +47,7 @@ tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOp tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOperatorWithAnyOtherTypeInvalidOperations.ts(69,12): error TS1109: Expression expected. -==== tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOperatorWithAnyOtherTypeInvalidOperations.ts (53 errors) ==== +==== tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOperatorWithAnyOtherTypeInvalidOperations.ts (47 errors) ==== // ++ operator on any type var ANY1: any; var ANY2: any[] = [1, 2]; @@ -144,24 +138,18 @@ tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOp var ResultIsNumber19 = ++(null + undefined); ~~~~~~~~~~~~~~~~~~ !!! error TS2357: The operand of an increment or decrement operator must be a variable or a property access. - ~~~~ -!!! error TS2531: Object is possibly 'null'. - ~~~~~~~~~ -!!! error TS2532: Object is possibly 'undefined'. + ~~~~~~~~~~~~~~~~ +!!! error TS2365: Operator '+' cannot be applied to types 'null' and 'undefined'. var ResultIsNumber20 = ++(null + null); ~~~~~~~~~~~~~ !!! error TS2357: The operand of an increment or decrement operator must be a variable or a property access. - ~~~~ -!!! error TS2531: Object is possibly 'null'. - ~~~~ -!!! error TS2531: Object is possibly 'null'. + ~~~~~~~~~~~ +!!! error TS2365: Operator '+' cannot be applied to types 'null' and 'null'. var ResultIsNumber21 = ++(undefined + undefined); ~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2357: The operand of an increment or decrement operator must be a variable or a property access. - ~~~~~~~~~ -!!! error TS2532: Object is possibly 'undefined'. - ~~~~~~~~~ -!!! error TS2532: Object is possibly 'undefined'. + ~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2365: Operator '+' cannot be applied to types 'undefined' and 'undefined'. var ResultIsNumber22 = ++obj1.x; ~~~~~~ !!! error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. @@ -178,24 +166,18 @@ tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOp var ResultIsNumber26 = (null + undefined)++; ~~~~~~~~~~~~~~~~~~ !!! error TS2357: The operand of an increment or decrement operator must be a variable or a property access. - ~~~~ -!!! error TS2531: Object is possibly 'null'. - ~~~~~~~~~ -!!! error TS2532: Object is possibly 'undefined'. + ~~~~~~~~~~~~~~~~ +!!! error TS2365: Operator '+' cannot be applied to types 'null' and 'undefined'. var ResultIsNumber27 = (null + null)++; ~~~~~~~~~~~~~ !!! error TS2357: The operand of an increment or decrement operator must be a variable or a property access. - ~~~~ -!!! error TS2531: Object is possibly 'null'. - ~~~~ -!!! error TS2531: Object is possibly 'null'. + ~~~~~~~~~~~ +!!! error TS2365: Operator '+' cannot be applied to types 'null' and 'null'. var ResultIsNumber28 = (undefined + undefined)++; ~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2357: The operand of an increment or decrement operator must be a variable or a property access. - ~~~~~~~~~ -!!! error TS2532: Object is possibly 'undefined'. - ~~~~~~~~~ -!!! error TS2532: Object is possibly 'undefined'. + ~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2365: Operator '+' cannot be applied to types 'undefined' and 'undefined'. var ResultIsNumber29 = obj1.x++; ~~~~~~ !!! error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. diff --git a/tests/baselines/reference/logicalNotOperatorWithAnyOtherType.errors.txt b/tests/baselines/reference/logicalNotOperatorWithAnyOtherType.errors.txt index 0cb9869ca4cc3..ad951adf5f7e4 100644 --- a/tests/baselines/reference/logicalNotOperatorWithAnyOtherType.errors.txt +++ b/tests/baselines/reference/logicalNotOperatorWithAnyOtherType.errors.txt @@ -1,13 +1,10 @@ -tests/cases/conformance/expressions/unaryOperators/logicalNotOperator/logicalNotOperatorWithAnyOtherType.ts(45,27): error TS2531: Object is possibly 'null'. -tests/cases/conformance/expressions/unaryOperators/logicalNotOperator/logicalNotOperatorWithAnyOtherType.ts(45,34): error TS2532: Object is possibly 'undefined'. -tests/cases/conformance/expressions/unaryOperators/logicalNotOperator/logicalNotOperatorWithAnyOtherType.ts(46,27): error TS2531: Object is possibly 'null'. -tests/cases/conformance/expressions/unaryOperators/logicalNotOperator/logicalNotOperatorWithAnyOtherType.ts(46,34): error TS2531: Object is possibly 'null'. -tests/cases/conformance/expressions/unaryOperators/logicalNotOperator/logicalNotOperatorWithAnyOtherType.ts(47,27): error TS2532: Object is possibly 'undefined'. -tests/cases/conformance/expressions/unaryOperators/logicalNotOperator/logicalNotOperatorWithAnyOtherType.ts(47,39): error TS2532: Object is possibly 'undefined'. +tests/cases/conformance/expressions/unaryOperators/logicalNotOperator/logicalNotOperatorWithAnyOtherType.ts(45,27): error TS2365: Operator '+' cannot be applied to types 'null' and 'undefined'. +tests/cases/conformance/expressions/unaryOperators/logicalNotOperator/logicalNotOperatorWithAnyOtherType.ts(46,27): error TS2365: Operator '+' cannot be applied to types 'null' and 'null'. +tests/cases/conformance/expressions/unaryOperators/logicalNotOperator/logicalNotOperatorWithAnyOtherType.ts(47,27): error TS2365: Operator '+' cannot be applied to types 'undefined' and 'undefined'. tests/cases/conformance/expressions/unaryOperators/logicalNotOperator/logicalNotOperatorWithAnyOtherType.ts(57,1): error TS2695: Left side of comma operator is unused and has no side effects. -==== tests/cases/conformance/expressions/unaryOperators/logicalNotOperator/logicalNotOperatorWithAnyOtherType.ts (7 errors) ==== +==== tests/cases/conformance/expressions/unaryOperators/logicalNotOperator/logicalNotOperatorWithAnyOtherType.ts (4 errors) ==== // ! operator on any type var ANY: any; @@ -53,20 +50,14 @@ tests/cases/conformance/expressions/unaryOperators/logicalNotOperator/logicalNot var ResultIsBoolean15 = !A.foo(); var ResultIsBoolean16 = !(ANY + ANY1); var ResultIsBoolean17 = !(null + undefined); - ~~~~ -!!! error TS2531: Object is possibly 'null'. - ~~~~~~~~~ -!!! error TS2532: Object is possibly 'undefined'. + ~~~~~~~~~~~~~~~~ +!!! error TS2365: Operator '+' cannot be applied to types 'null' and 'undefined'. var ResultIsBoolean18 = !(null + null); - ~~~~ -!!! error TS2531: Object is possibly 'null'. - ~~~~ -!!! error TS2531: Object is possibly 'null'. + ~~~~~~~~~~~ +!!! error TS2365: Operator '+' cannot be applied to types 'null' and 'null'. var ResultIsBoolean19 = !(undefined + undefined); - ~~~~~~~~~ -!!! error TS2532: Object is possibly 'undefined'. - ~~~~~~~~~ -!!! error TS2532: Object is possibly 'undefined'. + ~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2365: Operator '+' cannot be applied to types 'undefined' and 'undefined'. // multiple ! operators var ResultIsBoolean20 = !!ANY; diff --git a/tests/baselines/reference/null.errors.txt b/tests/baselines/reference/null.errors.txt index 6b05bfb94d12d..ed6db12d99b66 100644 --- a/tests/baselines/reference/null.errors.txt +++ b/tests/baselines/reference/null.errors.txt @@ -1,12 +1,12 @@ -tests/cases/compiler/null.ts(3,9): error TS2531: Object is possibly 'null'. +tests/cases/compiler/null.ts(3,7): error TS2365: Operator '+' cannot be applied to types '3' and 'null'. ==== tests/cases/compiler/null.ts (1 errors) ==== var x=null; var y=3+x; var z=3+null; - ~~~~ -!!! error TS2531: Object is possibly 'null'. + ~~~~~~ +!!! error TS2365: Operator '+' cannot be applied to types '3' and 'null'. class C { } function f() { diff --git a/tests/baselines/reference/operatorAddNullUndefined.errors.txt b/tests/baselines/reference/operatorAddNullUndefined.errors.txt index 871ef3fc98f47..c6a74080394e0 100644 --- a/tests/baselines/reference/operatorAddNullUndefined.errors.txt +++ b/tests/baselines/reference/operatorAddNullUndefined.errors.txt @@ -1,68 +1,56 @@ -tests/cases/compiler/operatorAddNullUndefined.ts(2,10): error TS2531: Object is possibly 'null'. -tests/cases/compiler/operatorAddNullUndefined.ts(2,17): error TS2531: Object is possibly 'null'. -tests/cases/compiler/operatorAddNullUndefined.ts(3,10): error TS2531: Object is possibly 'null'. -tests/cases/compiler/operatorAddNullUndefined.ts(3,17): error TS2532: Object is possibly 'undefined'. -tests/cases/compiler/operatorAddNullUndefined.ts(4,10): error TS2532: Object is possibly 'undefined'. -tests/cases/compiler/operatorAddNullUndefined.ts(4,22): error TS2531: Object is possibly 'null'. -tests/cases/compiler/operatorAddNullUndefined.ts(5,10): error TS2532: Object is possibly 'undefined'. -tests/cases/compiler/operatorAddNullUndefined.ts(5,22): error TS2532: Object is possibly 'undefined'. -tests/cases/compiler/operatorAddNullUndefined.ts(6,14): error TS2531: Object is possibly 'null'. -tests/cases/compiler/operatorAddNullUndefined.ts(7,14): error TS2532: Object is possibly 'undefined'. -tests/cases/compiler/operatorAddNullUndefined.ts(8,10): error TS2531: Object is possibly 'null'. -tests/cases/compiler/operatorAddNullUndefined.ts(9,10): error TS2532: Object is possibly 'undefined'. -tests/cases/compiler/operatorAddNullUndefined.ts(14,11): error TS2531: Object is possibly 'null'. -tests/cases/compiler/operatorAddNullUndefined.ts(15,11): error TS2532: Object is possibly 'undefined'. -tests/cases/compiler/operatorAddNullUndefined.ts(16,17): error TS2531: Object is possibly 'null'. -tests/cases/compiler/operatorAddNullUndefined.ts(17,17): error TS2532: Object is possibly 'undefined'. +tests/cases/compiler/operatorAddNullUndefined.ts(2,10): error TS2365: Operator '+' cannot be applied to types 'null' and 'null'. +tests/cases/compiler/operatorAddNullUndefined.ts(3,10): error TS2365: Operator '+' cannot be applied to types 'null' and 'undefined'. +tests/cases/compiler/operatorAddNullUndefined.ts(4,10): error TS2365: Operator '+' cannot be applied to types 'undefined' and 'null'. +tests/cases/compiler/operatorAddNullUndefined.ts(5,10): error TS2365: Operator '+' cannot be applied to types 'undefined' and 'undefined'. +tests/cases/compiler/operatorAddNullUndefined.ts(6,10): error TS2365: Operator '+' cannot be applied to types '1' and 'null'. +tests/cases/compiler/operatorAddNullUndefined.ts(7,10): error TS2365: Operator '+' cannot be applied to types '1' and 'undefined'. +tests/cases/compiler/operatorAddNullUndefined.ts(8,10): error TS2365: Operator '+' cannot be applied to types 'null' and '1'. +tests/cases/compiler/operatorAddNullUndefined.ts(9,10): error TS2365: Operator '+' cannot be applied to types 'undefined' and '1'. +tests/cases/compiler/operatorAddNullUndefined.ts(14,11): error TS2365: Operator '+' cannot be applied to types 'null' and 'E'. +tests/cases/compiler/operatorAddNullUndefined.ts(15,11): error TS2365: Operator '+' cannot be applied to types 'undefined' and 'E'. +tests/cases/compiler/operatorAddNullUndefined.ts(16,11): error TS2365: Operator '+' cannot be applied to types 'E' and 'null'. +tests/cases/compiler/operatorAddNullUndefined.ts(17,11): error TS2365: Operator '+' cannot be applied to types 'E' and 'undefined'. -==== tests/cases/compiler/operatorAddNullUndefined.ts (16 errors) ==== +==== tests/cases/compiler/operatorAddNullUndefined.ts (12 errors) ==== enum E { x } var x1 = null + null; - ~~~~ -!!! error TS2531: Object is possibly 'null'. - ~~~~ -!!! error TS2531: Object is possibly 'null'. + ~~~~~~~~~~~ +!!! error TS2365: Operator '+' cannot be applied to types 'null' and 'null'. var x2 = null + undefined; - ~~~~ -!!! error TS2531: Object is possibly 'null'. - ~~~~~~~~~ -!!! error TS2532: Object is possibly 'undefined'. + ~~~~~~~~~~~~~~~~ +!!! error TS2365: Operator '+' cannot be applied to types 'null' and 'undefined'. var x3 = undefined + null; - ~~~~~~~~~ -!!! error TS2532: Object is possibly 'undefined'. - ~~~~ -!!! error TS2531: Object is possibly 'null'. + ~~~~~~~~~~~~~~~~ +!!! error TS2365: Operator '+' cannot be applied to types 'undefined' and 'null'. var x4 = undefined + undefined; - ~~~~~~~~~ -!!! error TS2532: Object is possibly 'undefined'. - ~~~~~~~~~ -!!! error TS2532: Object is possibly 'undefined'. + ~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2365: Operator '+' cannot be applied to types 'undefined' and 'undefined'. var x5 = 1 + null; - ~~~~ -!!! error TS2531: Object is possibly 'null'. + ~~~~~~~~ +!!! error TS2365: Operator '+' cannot be applied to types '1' and 'null'. var x6 = 1 + undefined; - ~~~~~~~~~ -!!! error TS2532: Object is possibly 'undefined'. + ~~~~~~~~~~~~~ +!!! error TS2365: Operator '+' cannot be applied to types '1' and 'undefined'. var x7 = null + 1; - ~~~~ -!!! error TS2531: Object is possibly 'null'. + ~~~~~~~~ +!!! error TS2365: Operator '+' cannot be applied to types 'null' and '1'. var x8 = undefined + 1; - ~~~~~~~~~ -!!! error TS2532: Object is possibly 'undefined'. + ~~~~~~~~~~~~~ +!!! error TS2365: Operator '+' cannot be applied to types 'undefined' and '1'. var x9 = "test" + null; var x10 = "test" + undefined; var x11 = null + "test"; var x12 = undefined + "test"; var x13 = null + E.x - ~~~~ -!!! error TS2531: Object is possibly 'null'. + ~~~~~~~~~~ +!!! error TS2365: Operator '+' cannot be applied to types 'null' and 'E'. var x14 = undefined + E.x - ~~~~~~~~~ -!!! error TS2532: Object is possibly 'undefined'. + ~~~~~~~~~~~~~~~ +!!! error TS2365: Operator '+' cannot be applied to types 'undefined' and 'E'. var x15 = E.x + null - ~~~~ -!!! error TS2531: Object is possibly 'null'. + ~~~~~~~~~~ +!!! error TS2365: Operator '+' cannot be applied to types 'E' and 'null'. var x16 = E.x + undefined - ~~~~~~~~~ -!!! error TS2532: Object is possibly 'undefined'. \ No newline at end of file + ~~~~~~~~~~~~~~~ +!!! error TS2365: Operator '+' cannot be applied to types 'E' and 'undefined'. \ No newline at end of file diff --git a/tests/baselines/reference/plusOperatorWithAnyOtherType.errors.txt b/tests/baselines/reference/plusOperatorWithAnyOtherType.errors.txt index d693aaa17d96c..561215bbd9593 100644 --- a/tests/baselines/reference/plusOperatorWithAnyOtherType.errors.txt +++ b/tests/baselines/reference/plusOperatorWithAnyOtherType.errors.txt @@ -1,15 +1,12 @@ tests/cases/conformance/expressions/unaryOperators/plusOperator/plusOperatorWithAnyOtherType.ts(34,24): error TS2532: Object is possibly 'undefined'. tests/cases/conformance/expressions/unaryOperators/plusOperator/plusOperatorWithAnyOtherType.ts(35,24): error TS2531: Object is possibly 'null'. -tests/cases/conformance/expressions/unaryOperators/plusOperator/plusOperatorWithAnyOtherType.ts(46,26): error TS2531: Object is possibly 'null'. -tests/cases/conformance/expressions/unaryOperators/plusOperator/plusOperatorWithAnyOtherType.ts(46,33): error TS2532: Object is possibly 'undefined'. -tests/cases/conformance/expressions/unaryOperators/plusOperator/plusOperatorWithAnyOtherType.ts(47,26): error TS2531: Object is possibly 'null'. -tests/cases/conformance/expressions/unaryOperators/plusOperator/plusOperatorWithAnyOtherType.ts(47,33): error TS2531: Object is possibly 'null'. -tests/cases/conformance/expressions/unaryOperators/plusOperator/plusOperatorWithAnyOtherType.ts(48,26): error TS2532: Object is possibly 'undefined'. -tests/cases/conformance/expressions/unaryOperators/plusOperator/plusOperatorWithAnyOtherType.ts(48,38): error TS2532: Object is possibly 'undefined'. +tests/cases/conformance/expressions/unaryOperators/plusOperator/plusOperatorWithAnyOtherType.ts(46,26): error TS2365: Operator '+' cannot be applied to types 'null' and 'undefined'. +tests/cases/conformance/expressions/unaryOperators/plusOperator/plusOperatorWithAnyOtherType.ts(47,26): error TS2365: Operator '+' cannot be applied to types 'null' and 'null'. +tests/cases/conformance/expressions/unaryOperators/plusOperator/plusOperatorWithAnyOtherType.ts(48,26): error TS2365: Operator '+' cannot be applied to types 'undefined' and 'undefined'. tests/cases/conformance/expressions/unaryOperators/plusOperator/plusOperatorWithAnyOtherType.ts(54,1): error TS2695: Left side of comma operator is unused and has no side effects. -==== tests/cases/conformance/expressions/unaryOperators/plusOperator/plusOperatorWithAnyOtherType.ts (9 errors) ==== +==== tests/cases/conformance/expressions/unaryOperators/plusOperator/plusOperatorWithAnyOtherType.ts (6 errors) ==== // + operator on any type var ANY: any; @@ -60,20 +57,14 @@ tests/cases/conformance/expressions/unaryOperators/plusOperator/plusOperatorWith var ResultIsNumber15 = +A.foo(); var ResultIsNumber16 = +(ANY + ANY1); var ResultIsNumber17 = +(null + undefined); - ~~~~ -!!! error TS2531: Object is possibly 'null'. - ~~~~~~~~~ -!!! error TS2532: Object is possibly 'undefined'. + ~~~~~~~~~~~~~~~~ +!!! error TS2365: Operator '+' cannot be applied to types 'null' and 'undefined'. var ResultIsNumber18 = +(null + null); - ~~~~ -!!! error TS2531: Object is possibly 'null'. - ~~~~ -!!! error TS2531: Object is possibly 'null'. + ~~~~~~~~~~~ +!!! error TS2365: Operator '+' cannot be applied to types 'null' and 'null'. var ResultIsNumber19 = +(undefined + undefined); - ~~~~~~~~~ -!!! error TS2532: Object is possibly 'undefined'. - ~~~~~~~~~ -!!! error TS2532: Object is possibly 'undefined'. + ~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2365: Operator '+' cannot be applied to types 'undefined' and 'undefined'. // miss assignment operators +ANY; diff --git a/tests/baselines/reference/typeParamExtendsNumber.js b/tests/baselines/reference/typeParamExtendsNumber.js new file mode 100644 index 0000000000000..70548e7985610 --- /dev/null +++ b/tests/baselines/reference/typeParamExtendsNumber.js @@ -0,0 +1,19 @@ +//// [typeParamExtendsNumber.ts] +function f() { + var t: T; + var v = { + [t]: 0 + } + return t + t; +} + + +//// [typeParamExtendsNumber.js] +function f() { + var t; + var v = (_a = {}, + _a[t] = 0, + _a); + return t + t; + var _a; +} diff --git a/tests/baselines/reference/typeParamExtendsNumber.symbols b/tests/baselines/reference/typeParamExtendsNumber.symbols new file mode 100644 index 0000000000000..032f08bd58c26 --- /dev/null +++ b/tests/baselines/reference/typeParamExtendsNumber.symbols @@ -0,0 +1,20 @@ +=== tests/cases/compiler/typeParamExtendsNumber.ts === +function f() { +>f : Symbol(f, Decl(typeParamExtendsNumber.ts, 0, 0)) +>T : Symbol(T, Decl(typeParamExtendsNumber.ts, 0, 11)) + + var t: T; +>t : Symbol(t, Decl(typeParamExtendsNumber.ts, 1, 7)) +>T : Symbol(T, Decl(typeParamExtendsNumber.ts, 0, 11)) + + var v = { +>v : Symbol(v, Decl(typeParamExtendsNumber.ts, 2, 7)) + + [t]: 0 +>t : Symbol(t, Decl(typeParamExtendsNumber.ts, 1, 7)) + } + return t + t; +>t : Symbol(t, Decl(typeParamExtendsNumber.ts, 1, 7)) +>t : Symbol(t, Decl(typeParamExtendsNumber.ts, 1, 7)) +} + diff --git a/tests/baselines/reference/typeParamExtendsNumber.types b/tests/baselines/reference/typeParamExtendsNumber.types new file mode 100644 index 0000000000000..9034e23ee23d4 --- /dev/null +++ b/tests/baselines/reference/typeParamExtendsNumber.types @@ -0,0 +1,23 @@ +=== tests/cases/compiler/typeParamExtendsNumber.ts === +function f() { +>f : () => number +>T : T + + var t: T; +>t : T +>T : T + + var v = { +>v : { [x: number]: number; } +>{ [t]: 0 } : { [x: number]: number; } + + [t]: 0 +>t : T +>0 : 0 + } + return t + t; +>t + t : number +>t : T +>t : T +} + diff --git a/tests/baselines/reference/typeofOperatorWithAnyOtherType.errors.txt b/tests/baselines/reference/typeofOperatorWithAnyOtherType.errors.txt index 3680b1be60fe8..9357cf4e4cc36 100644 --- a/tests/baselines/reference/typeofOperatorWithAnyOtherType.errors.txt +++ b/tests/baselines/reference/typeofOperatorWithAnyOtherType.errors.txt @@ -1,9 +1,6 @@ -tests/cases/conformance/expressions/unaryOperators/typeofOperator/typeofOperatorWithAnyOtherType.ts(46,32): error TS2531: Object is possibly 'null'. -tests/cases/conformance/expressions/unaryOperators/typeofOperator/typeofOperatorWithAnyOtherType.ts(46,39): error TS2532: Object is possibly 'undefined'. -tests/cases/conformance/expressions/unaryOperators/typeofOperator/typeofOperatorWithAnyOtherType.ts(47,32): error TS2531: Object is possibly 'null'. -tests/cases/conformance/expressions/unaryOperators/typeofOperator/typeofOperatorWithAnyOtherType.ts(47,39): error TS2531: Object is possibly 'null'. -tests/cases/conformance/expressions/unaryOperators/typeofOperator/typeofOperatorWithAnyOtherType.ts(48,32): error TS2532: Object is possibly 'undefined'. -tests/cases/conformance/expressions/unaryOperators/typeofOperator/typeofOperatorWithAnyOtherType.ts(48,44): error TS2532: Object is possibly 'undefined'. +tests/cases/conformance/expressions/unaryOperators/typeofOperator/typeofOperatorWithAnyOtherType.ts(46,32): error TS2365: Operator '+' cannot be applied to types 'null' and 'undefined'. +tests/cases/conformance/expressions/unaryOperators/typeofOperator/typeofOperatorWithAnyOtherType.ts(47,32): error TS2365: Operator '+' cannot be applied to types 'null' and 'null'. +tests/cases/conformance/expressions/unaryOperators/typeofOperator/typeofOperatorWithAnyOtherType.ts(48,32): error TS2365: Operator '+' cannot be applied to types 'undefined' and 'undefined'. tests/cases/conformance/expressions/unaryOperators/typeofOperator/typeofOperatorWithAnyOtherType.ts(58,1): error TS2695: Left side of comma operator is unused and has no side effects. tests/cases/conformance/expressions/unaryOperators/typeofOperator/typeofOperatorWithAnyOtherType.ts(68,1): error TS7028: Unused label. tests/cases/conformance/expressions/unaryOperators/typeofOperator/typeofOperatorWithAnyOtherType.ts(69,1): error TS7028: Unused label. @@ -14,7 +11,7 @@ tests/cases/conformance/expressions/unaryOperators/typeofOperator/typeofOperator tests/cases/conformance/expressions/unaryOperators/typeofOperator/typeofOperatorWithAnyOtherType.ts(74,1): error TS7028: Unused label. -==== tests/cases/conformance/expressions/unaryOperators/typeofOperator/typeofOperatorWithAnyOtherType.ts (14 errors) ==== +==== tests/cases/conformance/expressions/unaryOperators/typeofOperator/typeofOperatorWithAnyOtherType.ts (11 errors) ==== // typeof operator on any type var ANY: any; @@ -61,20 +58,14 @@ tests/cases/conformance/expressions/unaryOperators/typeofOperator/typeofOperator var ResultIsString15 = typeof A.foo(); var ResultIsString16 = typeof (ANY + ANY1); var ResultIsString17 = typeof (null + undefined); - ~~~~ -!!! error TS2531: Object is possibly 'null'. - ~~~~~~~~~ -!!! error TS2532: Object is possibly 'undefined'. + ~~~~~~~~~~~~~~~~ +!!! error TS2365: Operator '+' cannot be applied to types 'null' and 'undefined'. var ResultIsString18 = typeof (null + null); - ~~~~ -!!! error TS2531: Object is possibly 'null'. - ~~~~ -!!! error TS2531: Object is possibly 'null'. + ~~~~~~~~~~~ +!!! error TS2365: Operator '+' cannot be applied to types 'null' and 'null'. var ResultIsString19 = typeof (undefined + undefined); - ~~~~~~~~~ -!!! error TS2532: Object is possibly 'undefined'. - ~~~~~~~~~ -!!! error TS2532: Object is possibly 'undefined'. + ~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2365: Operator '+' cannot be applied to types 'undefined' and 'undefined'. // multiple typeof operators var ResultIsString20 = typeof typeof ANY; diff --git a/tests/baselines/reference/voidOperatorWithAnyOtherType.errors.txt b/tests/baselines/reference/voidOperatorWithAnyOtherType.errors.txt index 5867a7ad6f5d2..7230f90c4f392 100644 --- a/tests/baselines/reference/voidOperatorWithAnyOtherType.errors.txt +++ b/tests/baselines/reference/voidOperatorWithAnyOtherType.errors.txt @@ -1,12 +1,9 @@ -tests/cases/conformance/expressions/unaryOperators/voidOperator/voidOperatorWithAnyOtherType.ts(46,27): error TS2531: Object is possibly 'null'. -tests/cases/conformance/expressions/unaryOperators/voidOperator/voidOperatorWithAnyOtherType.ts(46,34): error TS2532: Object is possibly 'undefined'. -tests/cases/conformance/expressions/unaryOperators/voidOperator/voidOperatorWithAnyOtherType.ts(47,27): error TS2531: Object is possibly 'null'. -tests/cases/conformance/expressions/unaryOperators/voidOperator/voidOperatorWithAnyOtherType.ts(47,34): error TS2531: Object is possibly 'null'. -tests/cases/conformance/expressions/unaryOperators/voidOperator/voidOperatorWithAnyOtherType.ts(48,27): error TS2532: Object is possibly 'undefined'. -tests/cases/conformance/expressions/unaryOperators/voidOperator/voidOperatorWithAnyOtherType.ts(48,39): error TS2532: Object is possibly 'undefined'. +tests/cases/conformance/expressions/unaryOperators/voidOperator/voidOperatorWithAnyOtherType.ts(46,27): error TS2365: Operator '+' cannot be applied to types 'null' and 'undefined'. +tests/cases/conformance/expressions/unaryOperators/voidOperator/voidOperatorWithAnyOtherType.ts(47,27): error TS2365: Operator '+' cannot be applied to types 'null' and 'null'. +tests/cases/conformance/expressions/unaryOperators/voidOperator/voidOperatorWithAnyOtherType.ts(48,27): error TS2365: Operator '+' cannot be applied to types 'undefined' and 'undefined'. -==== tests/cases/conformance/expressions/unaryOperators/voidOperator/voidOperatorWithAnyOtherType.ts (6 errors) ==== +==== tests/cases/conformance/expressions/unaryOperators/voidOperator/voidOperatorWithAnyOtherType.ts (3 errors) ==== // void operator on any type var ANY: any; @@ -53,20 +50,14 @@ tests/cases/conformance/expressions/unaryOperators/voidOperator/voidOperatorWith var ResultIsAny15 = void A.foo(); var ResultIsAny16 = void (ANY + ANY1); var ResultIsAny17 = void (null + undefined); - ~~~~ -!!! error TS2531: Object is possibly 'null'. - ~~~~~~~~~ -!!! error TS2532: Object is possibly 'undefined'. + ~~~~~~~~~~~~~~~~ +!!! error TS2365: Operator '+' cannot be applied to types 'null' and 'undefined'. var ResultIsAny18 = void (null + null); - ~~~~ -!!! error TS2531: Object is possibly 'null'. - ~~~~ -!!! error TS2531: Object is possibly 'null'. + ~~~~~~~~~~~ +!!! error TS2365: Operator '+' cannot be applied to types 'null' and 'null'. var ResultIsAny19 = void (undefined + undefined); - ~~~~~~~~~ -!!! error TS2532: Object is possibly 'undefined'. - ~~~~~~~~~ -!!! error TS2532: Object is possibly 'undefined'. + ~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2365: Operator '+' cannot be applied to types 'undefined' and 'undefined'. // multiple void operators var ResultIsAny20 = void void ANY; diff --git a/tests/cases/compiler/typeParamExtendsNumber.ts b/tests/cases/compiler/typeParamExtendsNumber.ts new file mode 100644 index 0000000000000..89b60c990a245 --- /dev/null +++ b/tests/cases/compiler/typeParamExtendsNumber.ts @@ -0,0 +1,7 @@ +function f() { + var t: T; + var v = { + [t]: 0 + } + return t + t; +} From 5272ec63091f96bf25df326267f69d5fca00a407 Mon Sep 17 00:00:00 2001 From: Ryan Cavanaugh Date: Thu, 27 Jul 2017 16:07:50 -0700 Subject: [PATCH 017/237] Types Map WIP --- Gulpfile.ts | 21 +- Jakefile.js | 16 +- .../unittests/tsserverProjectSystem.ts | 33 +- src/server/editorServices.ts | 64 ++- src/server/project.ts | 10 + src/server/server.ts | 11 +- src/server/shared.ts | 1 + src/server/typesMap.json | 487 ++++++++++++++++++ .../typingsInstaller/nodeTypingsInstaller.ts | 10 +- .../typingsInstaller/typingsInstaller.ts | 19 +- src/server/utilities.ts | 2 +- src/services/jsTyping.ts | 8 + 12 files changed, 642 insertions(+), 40 deletions(-) create mode 100644 src/server/typesMap.json diff --git a/Gulpfile.ts b/Gulpfile.ts index f6e5ed627d8b9..f70e8a88aabc1 100644 --- a/Gulpfile.ts +++ b/Gulpfile.ts @@ -464,6 +464,7 @@ gulp.task(serverFile, /*help*/ false, [servicesFile, typingsInstallerJs, cancell .pipe(gulp.dest("src/server")); }); +const typesMapJson = path.join(builtLocalDirectory, "typesMap.json"); const tsserverLibraryFile = path.join(builtLocalDirectory, "tsserverlibrary.js"); const tsserverLibraryDefinitionFile = path.join(builtLocalDirectory, "tsserverlibrary.d.ts"); @@ -473,7 +474,7 @@ gulp.task(tsserverLibraryFile, /*help*/ false, [servicesFile], (done) => { .pipe(sourcemaps.init()) .pipe(newer(tsserverLibraryFile)) .pipe(serverLibraryProject()); - + return merge2([ js.pipe(prependCopyright()) .pipe(sourcemaps.write(".")) @@ -486,7 +487,23 @@ gulp.task(tsserverLibraryFile, /*help*/ false, [servicesFile], (done) => { ]); }); -gulp.task("lssl", "Builds language service server library", [tsserverLibraryFile]); +gulp.task(typesMapJson, /*help*/ false, [], (done) => { + fs.readFile('src/server/typesMaps.json', 'utf-8', (err, data) => { + if (err) { + return done(err); + } + try { + JSON.parse(data); + } catch (e) { + done(e); + } + fs.writeFile(typesMapJson, data, err => { + done(err); + }); + }); +}); + +gulp.task("lssl", "Builds language service server library", [tsserverLibraryFile, typesMapJson]); gulp.task("local", "Builds the full compiler and services", [builtLocalCompiler, servicesFile, serverFile, builtGeneratedDiagnosticMessagesJSON, tsserverLibraryFile]); gulp.task("tsc", "Builds only the compiler", [builtLocalCompiler]); diff --git a/Jakefile.js b/Jakefile.js index 31243f77c4284..0ddfeb19fbe19 100644 --- a/Jakefile.js +++ b/Jakefile.js @@ -88,6 +88,8 @@ var watchGuardSources = filesFromConfig(path.join(serverDirectory, "watchGuard/t var serverSources = filesFromConfig(path.join(serverDirectory, "tsconfig.json")) var languageServiceLibrarySources = filesFromConfig(path.join(serverDirectory, "tsconfig.library.json")); +var typesMapOutputPath = path.join(builtLocalDirectory, 'typesMap.json'); + var harnessCoreSources = [ "harness.ts", "virtualFileSystem.ts", @@ -422,6 +424,7 @@ var buildProtocolTs = path.join(scriptsDirectory, "buildProtocol.ts"); var buildProtocolJs = path.join(scriptsDirectory, "buildProtocol.js"); var buildProtocolDts = path.join(builtLocalDirectory, "protocol.d.ts"); var typescriptServicesDts = path.join(builtLocalDirectory, "typescriptServices.d.ts"); +var typesMapJson = path.join(builtLocalDirectory, "typesMap.json"); file(buildProtocolTs); @@ -603,6 +606,16 @@ var serverFile = path.join(builtLocalDirectory, "tsserver.js"); compileFile(serverFile, serverSources, [builtLocalDirectory, copyright, cancellationTokenFile, typingsInstallerFile, watchGuardFile].concat(serverSources).concat(servicesSources), /*prefixes*/ [copyright], /*useBuiltCompiler*/ true, { types: ["node"], preserveConstEnums: true, lib: "es6" }); var tsserverLibraryFile = path.join(builtLocalDirectory, "tsserverlibrary.js"); var tsserverLibraryDefinitionFile = path.join(builtLocalDirectory, "tsserverlibrary.d.ts"); +file(typesMapOutputPath, function() { + var content = fs.readFileSync(path.join(serverDirectory, 'typesMap.json')); + // Validate that it's valid JSON + try { + JSON.parse(content); + } catch (e) { + console.log("Parse error in typesMap.json: " + e); + } + fs.writeFileSync(typesMapOutputPath, content); +}); compileFile( tsserverLibraryFile, languageServiceLibrarySources, @@ -625,7 +638,7 @@ compileFile( // Local target to build the language service server library desc("Builds language service server library"); -task("lssl", [tsserverLibraryFile, tsserverLibraryDefinitionFile]); +task("lssl", [tsserverLibraryFile, tsserverLibraryDefinitionFile, typesMapOutputPath]); desc("Emit the start of the build fold"); task("build-fold-start", [], function () { @@ -654,7 +667,6 @@ task("release", function () { // Set the default task to "local" task("default", ["local"]); - // Cleans the built directory desc("Cleans the compiler output, declare files, and tests"); task("clean", function () { diff --git a/src/harness/unittests/tsserverProjectSystem.ts b/src/harness/unittests/tsserverProjectSystem.ts index f11900aea110a..4942a8ef53b30 100644 --- a/src/harness/unittests/tsserverProjectSystem.ts +++ b/src/harness/unittests/tsserverProjectSystem.ts @@ -18,14 +18,24 @@ namespace ts.projectSystem { }) }; - const customSafeList = { - path: "/typeMapList.json", - content: JSON.stringify({ - "quack": { - "match": "/duckquack-(\\d+)\\.min\\.js", - "types": ["duck-types"] + const customTypesMap = { + path: "/typesMap.json", + content: `{ + "typesMap": { + "jquery": { + "match": "jquery(-(\\\\.?\\\\d+)+)?(\\\\.intellisense)?(\\\\.min)?\\\\.js$", + "types": ["jquery"] + }, + "quack": { + "match": "/duckquack-(\\\\d+)\\\\.min\\\\.js", + "types": ["duck-types"] + } }, - }) + "simpleMap": { + "Bacon": "baconjs", + "bliss": "blissfuljs" + } + }` }; export interface PostExecAction { @@ -59,7 +69,7 @@ namespace ts.projectSystem { installTypingHost: server.ServerHost, readonly typesRegistry = createMap(), log?: TI.Log) { - super(installTypingHost, globalTypingsCacheLocation, safeList.path, throttleLimit, log); + super(installTypingHost, globalTypingsCacheLocation, safeList.path, customTypesMap.path, throttleLimit, log); } protected postExecActions: PostExecAction[] = []; @@ -218,7 +228,7 @@ namespace ts.projectSystem { constructor(host: server.ServerHost, logger: server.Logger, cancellationToken: HostCancellationToken, useSingleInferredProject: boolean, typingsInstaller: server.ITypingsInstaller, eventHandler: server.ProjectServiceEventHandler) { super({ - host, logger, cancellationToken, useSingleInferredProject, typingsInstaller, eventHandler + host, logger, cancellationToken, useSingleInferredProject, typingsInstaller, eventHandler, typesMapLocation: customTypesMap.path }); } @@ -1479,9 +1489,8 @@ namespace ts.projectSystem { path: "/lib/duckquack-3.min.js", content: "whoa do @@ not parse me ok thanks!!!" }; - const host = createServerHost([customSafeList, file1, office]); + const host = createServerHost([file1, office, customTypesMap]); const projectService = createProjectService(host); - projectService.loadSafeList(customSafeList.path); try { projectService.openExternalProject({ projectFileName: "project", options: {}, rootFiles: toExternalFiles([file1.path, office.path]) }); const proj = projectService.externalProjects[0]; @@ -1491,7 +1500,7 @@ namespace ts.projectSystem { projectService.resetSafeList(); } }); - + it("ignores files excluded by the default type list", () => { const file1 = { path: "/a/b/f1.ts", diff --git a/src/server/editorServices.ts b/src/server/editorServices.ts index 4ffdf5d6c5d99..54b393053ca9f 100644 --- a/src/server/editorServices.ts +++ b/src/server/editorServices.ts @@ -109,6 +109,11 @@ namespace ts.server { "smart": IndentStyle.Smart }); + export interface TypesMapFile { + typesMap: SafeList; + simpleMap: string[]; + } + /** * How to understand this block: * * The 'match' property is a regexp that matches a filename. @@ -329,6 +334,7 @@ namespace ts.server { globalPlugins?: string[]; pluginProbeLocations?: string[]; allowLocalPluginLoads?: boolean; + typesMapLocation?: string; } export class ProjectService { @@ -389,6 +395,7 @@ namespace ts.server { public readonly globalPlugins: ReadonlyArray; public readonly pluginProbeLocations: ReadonlyArray; public readonly allowLocalPluginLoads: boolean; + public readonly typesMapLocation: string | undefined; /** Tracks projects that we have already sent telemetry for. */ private readonly seenProjects = createMap(); @@ -404,6 +411,7 @@ namespace ts.server { this.globalPlugins = opts.globalPlugins || emptyArray; this.pluginProbeLocations = opts.pluginProbeLocations || emptyArray; this.allowLocalPluginLoads = !!opts.allowLocalPluginLoads; + this.typesMapLocation = (opts.typesMapLocation === undefined) ? combinePaths(this.host.getExecutingFilePath(), '../typesMap.json') : opts.typesMapLocation; Debug.assert(!!this.host.createHash, "'ServerHost.createHash' is required for ProjectService"); @@ -411,6 +419,10 @@ namespace ts.server { this.directoryWatchers = new DirectoryWatchers(this); this.throttledOperations = new ThrottledOperations(this.host); + if (opts.typesMapLocation) { + this.loadTypesMap(); + } + this.typingsInstaller.attach(this); this.typingsCache = new TypingsCache(this.typingsInstaller); @@ -447,6 +459,25 @@ namespace ts.server { }); } + private loadTypesMap() { + if (!this.host.fileExists(this.typesMapLocation)) { + this.logger.info(`Provided types map file "${this.typesMapLocation}" doesn't exist`); + return; + } + try { + const raw: TypesMapFile = JSON.parse(this.host.readFile(this.typesMapLocation)); + // Parse the regexps + for (const k of Object.keys(raw.typesMap)) { + raw.typesMap[k].match = new RegExp(raw.typesMap[k].match as {} as string, "i"); + } + // raw is now fixed and ready + this.safelist = raw.typesMap; + } catch(e) { + this.logger.info(`Error loading types map: ${e}`); + this.safelist = defaultTypeSafeList; + } + } + updateTypingsForProject(response: SetTypings | InvalidateCachedTypings): void { const project = this.findProject(response.projectName); if (!project) { @@ -1623,23 +1654,14 @@ namespace ts.server { this.safelist = defaultTypeSafeList; } - loadSafeList(fileName: string): void { - const raw: SafeList = JSON.parse(this.host.readFile(fileName, "utf-8")); - // Parse the regexps - for (const k of Object.keys(raw)) { - raw[k].match = new RegExp(raw[k].match as {} as string, "i"); - } - // raw is now fixed and ready - this.safelist = raw; - } - - applySafeList(proj: protocol.ExternalProject): void { + applySafeList(proj: protocol.ExternalProject): NormalizedPath[] { const { rootFiles, typeAcquisition } = proj; const types = (typeAcquisition && typeAcquisition.include) || []; const excludeRules: string[] = []; - const normalizedNames = rootFiles.map(f => normalizeSlashes(f.fileName)); + const normalizedNames = rootFiles.map(f => normalizeSlashes(f.fileName)) as NormalizedPath[]; + const excludedFiles: NormalizedPath[] = []; for (const name of Object.keys(this.safelist)) { const rule = this.safelist[name]; @@ -1698,7 +1720,17 @@ namespace ts.server { } const excludeRegexes = excludeRules.map(e => new RegExp(e, "i")); - proj.rootFiles = proj.rootFiles.filter((_file, index) => !excludeRegexes.some(re => re.test(normalizedNames[index]))); + const filesToKeep: ts.server.protocol.ExternalFile[] = []; + for(let i = 0; i < proj.rootFiles.length; i++) { + if (excludeRegexes.some(re => re.test(normalizedNames[i]))) { + excludedFiles.push(normalizedNames[i]); + } + else { + filesToKeep.push(proj.rootFiles[i]); + } + } + proj.rootFiles = filesToKeep; + return excludedFiles; } openExternalProject(proj: protocol.ExternalProject, suppressRefreshOfInferredProjects = false): void { @@ -1709,7 +1741,7 @@ namespace ts.server { proj.typeAcquisition = typeAcquisition; } - this.applySafeList(proj); + const excludedFiles = this.applySafeList(proj); let tsConfigFiles: NormalizedPath[]; const rootFiles: protocol.ExternalFile[] = []; @@ -1733,6 +1765,7 @@ namespace ts.server { const externalProject = this.findExternalProjectByProjectName(proj.projectFileName); let exisingConfigFiles: string[]; if (externalProject) { + externalProject.excludedFiles = excludedFiles; if (!tsConfigFiles) { const compilerOptions = convertCompilerOptions(proj.options); if (this.exceededTotalSizeLimitForNonTsFiles(proj.projectFileName, compilerOptions, proj.rootFiles, externalFilePropertyReader)) { @@ -1802,7 +1835,8 @@ namespace ts.server { else { // no config files - remove the item from the collection this.externalProjectToConfiguredProjectMap.delete(proj.projectFileName); - this.createAndAddExternalProject(proj.projectFileName, rootFiles, proj.options, proj.typeAcquisition); + const newProj = this.createAndAddExternalProject(proj.projectFileName, rootFiles, proj.options, proj.typeAcquisition); + newProj.excludedFiles = excludedFiles; } if (!suppressRefreshOfInferredProjects) { this.refreshInferredProjects(); diff --git a/src/server/project.ts b/src/server/project.ts index 106089fad977b..6686f4c1a8317 100644 --- a/src/server/project.ts +++ b/src/server/project.ts @@ -375,6 +375,10 @@ namespace ts.server { return this.getLanguageService().getEmitOutput(info.fileName, emitOnlyDtsFiles); } + getExcludedFiles(): ReadonlyArray { + return emptyArray; + } + getFileNames(excludeFilesFromExternalLibraries?: boolean, excludeConfigFiles?: boolean) { if (!this.program) { return []; @@ -1161,6 +1165,7 @@ namespace ts.server { * These are created only if a host explicitly calls `openExternalProject`. */ export class ExternalProject extends Project { + excludedFiles: ReadonlyArray = []; private typeAcquisition: TypeAcquisition; constructor(public externalProjectName: string, projectService: ProjectService, @@ -1170,6 +1175,11 @@ namespace ts.server { public compileOnSaveEnabled: boolean, private readonly projectFilePath?: string) { super(externalProjectName, ProjectKind.External, projectService, documentRegistry, /*hasExplicitListOfFiles*/ true, languageServiceEnabled, compilerOptions, compileOnSaveEnabled); + + } + + getExcludedFiles() { + return this.excludedFiles; } getProjectRootPath() { diff --git a/src/server/server.ts b/src/server/server.ts index 6600b63dcb1bf..06e2a6482d7ca 100644 --- a/src/server/server.ts +++ b/src/server/server.ts @@ -13,6 +13,7 @@ namespace ts.server { globalTypingsCacheLocation: string; logger: Logger; typingSafeListLocation: string; + typesMapLocation: string | undefined; npmLocation: string | undefined; telemetryEnabled: boolean; globalPlugins: string[]; @@ -243,6 +244,7 @@ namespace ts.server { eventPort: number, readonly globalTypingsCacheLocation: string, readonly typingSafeListLocation: string, + readonly typesMapLocation: string, private readonly npmLocation: string | undefined, private newLine: string) { this.throttledOperations = new ThrottledOperations(host); @@ -288,6 +290,9 @@ namespace ts.server { if (this.typingSafeListLocation) { args.push(Arguments.TypingSafeListLocation, this.typingSafeListLocation); } + if (this.typesMapLocation) { + args.push(Arguments.TypesMapLocation, this.typesMapLocation); + } if (this.npmLocation) { args.push(Arguments.NpmLocation, this.npmLocation); } @@ -401,10 +406,10 @@ namespace ts.server { class IOSession extends Session { constructor(options: IOSessionOptions) { - const { host, installerEventPort, globalTypingsCacheLocation, typingSafeListLocation, npmLocation, canUseEvents } = options; + const { host, installerEventPort, globalTypingsCacheLocation, typingSafeListLocation, typesMapLocation, npmLocation, canUseEvents } = options; const typingsInstaller = disableAutomaticTypingAcquisition ? undefined - : new NodeTypingsInstaller(telemetryEnabled, logger, host, installerEventPort, globalTypingsCacheLocation, typingSafeListLocation, npmLocation, host.newLine); + : new NodeTypingsInstaller(telemetryEnabled, logger, host, installerEventPort, globalTypingsCacheLocation, typingSafeListLocation, typesMapLocation, npmLocation, host.newLine); super({ host, @@ -758,6 +763,7 @@ namespace ts.server { } const typingSafeListLocation = findArgument(Arguments.TypingSafeListLocation); + const typesMapLocation = findArgument(Arguments.TypesMapLocation) || combinePaths(sys.getExecutingFilePath(), '../typesMap.json'); const npmLocation = findArgument(Arguments.NpmLocation); const globalPlugins = (findArgument("--globalPlugins") || "").split(","); @@ -777,6 +783,7 @@ namespace ts.server { disableAutomaticTypingAcquisition, globalTypingsCacheLocation: getGlobalTypingsCacheLocation(), typingSafeListLocation, + typesMapLocation, npmLocation, telemetryEnabled, logger, diff --git a/src/server/shared.ts b/src/server/shared.ts index 1285eba06e180..66f739a5b974a 100644 --- a/src/server/shared.ts +++ b/src/server/shared.ts @@ -12,6 +12,7 @@ namespace ts.server { export const LogFile = "--logFile"; export const EnableTelemetry = "--enableTelemetry"; export const TypingSafeListLocation = "--typingSafeListLocation"; + export const TypesMapLocation = "--typesMapLocation"; /** * This argument specifies the location of the NPM executable. * typingsInstaller will run the command with `${npmLocation} install ...`. diff --git a/src/server/typesMap.json b/src/server/typesMap.json new file mode 100644 index 0000000000000..5e7df046dbea0 --- /dev/null +++ b/src/server/typesMap.json @@ -0,0 +1,487 @@ +{ + "typesMap": { + "jquery": { + "match": "jquery(-(\\.?\\d+)+)?(\\.intellisense)?(\\.min)?\\.js$", + "types": ["jquery"] + }, + "WinJS": { + "match": "^(.*\\/winjs-[.\\d]+)\\/js\\/base\\.js$", + "exclude": [["^", 1, "/.*"]], + "types": ["winjs"] + }, + "Kendo": { + "match": "^(.*\\/kendo)\\/kendo\\.all\\.min\\.js$", + "exclude": [["^", 1, "/.*"]], + "types": ["kendo-ui"] + }, + "Office Nuget": { + "match": "^(.*\\/office\\/1)\\/excel-\\d+\\.debug\\.js$", + "exclude": [["^", 1, "/.*"]], + "types": ["office"] + }, + "Minified files": { + "match": "^(.+\\.min\\.js)$", + "exclude": [["^", 1, "$"]] + } + }, + "simpleMap": { + "accounting": "accounting", + "ace.js": "ace", + "ag-grid": "ag-grid", + "alertify": "alertify", + "alt": "alt", + "amcharts.js": "amcharts", + "amplify": "amplifyjs", + "angular": "angular", + "angular-bootstrap-lightbox": "angular-bootstrap-lightbox", + "angular-cookie": "angular-cookie", + "angular-file-upload": "angular-file-upload", + "angularfire": "angularfire", + "angular-gettext": "angular-gettext", + "angular-google-analytics": "angular-google-analytics", + "angular-local-storage": "angular-local-storage", + "angularLocalStorage": "angularLocalStorage", + "angular-scroll": "angular-scroll", + "angular-spinner": "angular-spinner", + "angular-strap": "angular-strap", + "angulartics": "angulartics", + "angular-toastr": "angular-toastr", + "angular-translate": "angular-translate", + "angular-ui-router": "angular-ui-router", + "angular-ui-tree": "angular-ui-tree", + "angular-wizard": "angular-wizard", + "async": "async", + "atmosphere": "atmosphere", + "aws-sdk": "aws-sdk", + "aws-sdk-js": "aws-sdk", + "axios": "axios", + "backbone": "backbone", + "backbone.layoutmanager": "backbone.layoutmanager", + "backbone.paginator": "backbone.paginator", + "backbone.radio": "backbone.radio", + "backbone-associations": "backbone-associations", + "backbone-relational": "backbone-relational", + "backgrid": "backgrid", + "Bacon": "baconjs", + "benchmark": "benchmark", + "blazy": "blazy", + "bliss": "blissfuljs", + "bluebird": "bluebird", + "body-parser": "body-parser", + "bootbox": "bootbox", + "bootstrap": "bootstrap", + "bootstrap-editable": "x-editable", + "bootstrap-maxlength": "bootstrap-maxlength", + "bootstrap-notify": "bootstrap-notify", + "bootstrap-slider": "bootstrap-slider", + "bootstrap-switch": "bootstrap-switch", + "bowser": "bowser", + "breeze": "breeze", + "browserify": "browserify", + "bson": "bson", + "c3": "c3", + "canvasjs": "canvasjs", + "chai": "chai", + "chalk": "chalk", + "chance": "chance", + "chartist": "chartist", + "cheerio": "cheerio", + "chokidar": "chokidar", + "chosen.jquery": "chosen", + "chroma": "chroma-js", + "ckeditor.js": "ckeditor", + "cli-color": "cli-color", + "clipboard": "clipboard", + "codemirror": "codemirror", + "colors": "colors", + "commander": "commander", + "commonmark": "commonmark", + "compression": "compression", + "confidence": "confidence", + "connect": "connect", + "Control.FullScreen": "leaflet.fullscreen", + "cookie": "cookie", + "cookie-parser": "cookie-parser", + "cookies": "cookies", + "core": "core-js", + "core-js": "core-js", + "crossfilter": "crossfilter", + "crossroads": "crossroads", + "css": "css", + "ct-ui-router-extras": "ui-router-extras", + "d3": "d3", + "dagre-d3": "dagre-d3", + "dat.gui": "dat-gui", + "debug": "debug", + "deep-diff": "deep-diff", + "Dexie": "dexie", + "dialogs": "angular-dialog-service", + "dojo.js": "dojo", + "doT": "dot", + "dragula": "dragula", + "drop": "drop", + "dropbox": "dropboxjs", + "dropzone": "dropzone", + "Dts Name": "Dts Name", + "dust-core": "dustjs-linkedin", + "easeljs": "easeljs", + "ejs": "ejs", + "ember": "ember", + "envify": "envify", + "epiceditor": "epiceditor", + "es6-promise": "es6-promise", + "ES6-Promise": "es6-promise", + "es6-shim": "es6-shim", + "expect": "expect", + "express": "express", + "express-session": "express-session", + "ext-all.js": "extjs", + "extend": "extend", + "fabric": "fabricjs", + "faker": "faker", + "fastclick": "fastclick", + "favico": "favico.js", + "featherlight": "featherlight", + "FileSaver": "FileSaver", + "fingerprint": "fingerprintjs", + "fixed-data-table": "fixed-data-table", + "flickity.pkgd": "flickity", + "flight": "flight", + "flow": "flowjs", + "Flux": "flux", + "formly": "angular-formly", + "foundation": "foundation", + "fpsmeter": "fpsmeter", + "fuse": "fuse", + "generator": "yeoman-generator", + "gl-matrix": "gl-matrix", + "globalize": "globalize", + "graceful-fs": "graceful-fs", + "gridstack": "gridstack", + "gulp": "gulp", + "gulp-rename": "gulp-rename", + "gulp-uglify": "gulp-uglify", + "gulp-util": "gulp-util", + "hammer": "hammerjs", + "handlebars": "handlebars", + "hasher": "hasher", + "he": "he", + "hello.all": "hellojs", + "highcharts.js": "highcharts", + "highlight": "highlightjs", + "history": "history", + "History": "history", + "hopscotch": "hopscotch", + "hotkeys": "angular-hotkeys", + "html2canvas": "html2canvas", + "humane": "humane", + "i18next": "i18next", + "icheck": "icheck", + "impress": "impress", + "incremental-dom": "incremental-dom", + "Inquirer": "inquirer", + "insight": "insight", + "interact": "interactjs", + "intercom": "intercomjs", + "intro": "intro.js", + "ion.rangeSlider": "ion.rangeSlider", + "ionic": "ionic", + "is": "is_js", + "iscroll": "iscroll", + "jade": "jade", + "jasmine": "jasmine", + "joint": "jointjs", + "jquery": "jquery", + "jquery.address": "jquery.address", + "jquery.are-you-sure": "jquery.are-you-sure", + "jquery.blockUI": "jquery.blockUI", + "jquery.bootstrap.wizard": "jquery.bootstrap.wizard", + "jquery.bootstrap-touchspin": "bootstrap-touchspin", + "jquery.color": "jquery.color", + "jquery.colorbox": "jquery.colorbox", + "jquery.contextMenu": "jquery.contextMenu", + "jquery.cookie": "jquery.cookie", + "jquery.customSelect": "jquery.customSelect", + "jquery.cycle.all": "jquery.cycle", + "jquery.cycle2": "jquery.cycle2", + "jquery.dataTables": "jquery.dataTables", + "jquery.dropotron": "jquery.dropotron", + "jquery.fancybox.pack.js": "fancybox", + "jquery.fancytree-all": "jquery.fancytree", + "jquery.fileupload": "jquery.fileupload", + "jquery.flot": "flot", + "jquery.form": "jquery.form", + "jquery.gridster": "jquery.gridster", + "jquery.handsontable.full": "jquery-handsontable", + "jquery.joyride": "jquery.joyride", + "jquery.jqGrid": "jqgrid", + "jquery.mmenu": "jquery.mmenu", + "jquery.mockjax": "jquery-mockjax", + "jquery.noty": "jquery.noty", + "jquery.payment": "jquery.payment", + "jquery.pjax": "jquery.pjax", + "jquery.placeholder": "jquery.placeholder", + "jquery.qrcode": "jquery.qrcode", + "jquery.qtip": "qtip2", + "jquery.raty": "raty", + "jquery.scrollTo": "jquery.scrollTo", + "jquery.signalR": "signalr", + "jquery.simplemodal": "jquery.simplemodal", + "jquery.timeago": "jquery.timeago", + "jquery.tinyscrollbar": "jquery.tinyscrollbar", + "jquery.tipsy": "jquery.tipsy", + "jquery.tooltipster": "tooltipster", + "jquery.transit": "jquery.transit", + "jquery.uniform": "jquery.uniform", + "jquery.watch": "watch", + "jquery-sortable": "jquery-sortable", + "jquery-ui": "jqueryui", + "js.cookie": "js-cookie", + "js-data": "js-data", + "js-data-angular": "js-data-angular", + "js-data-http": "js-data-http", + "jsdom": "jsdom", + "jsnlog": "jsnlog", + "json5": "json5", + "jspdf": "jspdf", + "jsrender": "jsrender", + "js-signals": "js-signals", + "jstorage": "jstorage", + "jstree": "jstree", + "js-yaml": "js-yaml", + "jszip": "jszip", + "katex": "katex", + "kefir": "kefir", + "keymaster": "keymaster", + "keypress": "keypress", + "kinetic": "kineticjs", + "knockback": "knockback", + "knockout": "knockout", + "knockout.mapping": "knockout.mapping", + "knockout.validation": "knockout.validation", + "knockout-paging": "knockout-paging", + "knockout-pre-rendered": "knockout-pre-rendered", + "ladda": "ladda", + "later": "later", + "lazy": "lazy.js", + "Leaflet.Editable": "leaflet-editable", + "leaflet.js": "leaflet", + "less": "less", + "linq": "linq", + "loading-bar": "angular-loading-bar", + "lodash": "lodash", + "log4javascript": "log4javascript", + "loglevel": "loglevel", + "lokijs": "lokijs", + "lovefield": "lovefield", + "lunr": "lunr", + "lz-string": "lz-string", + "mailcheck": "mailcheck", + "maquette": "maquette", + "marked": "marked", + "math": "mathjs", + "MathJax.js": "mathjax", + "matter": "matter-js", + "md5": "blueimp-md5", + "md5.js": "crypto-js", + "messenger": "messenger", + "method-override": "method-override", + "minimatch": "minimatch", + "minimist": "minimist", + "mithril": "mithril", + "mobile-detect": "mobile-detect", + "mocha": "mocha", + "mock-ajax": "jasmine-ajax", + "modernizr": "modernizr", + "Modernizr": "Modernizr", + "moment": "moment", + "moment-range": "moment-range", + "moment-timezone": "moment-timezone", + "mongoose": "mongoose", + "morgan": "morgan", + "mousetrap": "mousetrap", + "ms": "ms", + "mustache": "mustache", + "native.history": "history", + "nconf": "nconf", + "ncp": "ncp", + "nedb": "nedb", + "ng-cordova": "ng-cordova", + "ngDialog": "ng-dialog", + "ng-flow-standalone": "ng-flow", + "ng-grid": "ng-grid", + "ng-i18next": "ng-i18next", + "ng-table": "ng-table", + "node_redis": "redis", + "node-clone": "clone", + "node-fs-extra": "fs-extra", + "node-glob": "glob", + "Nodemailer": "nodemailer", + "node-mime": "mime", + "node-mkdirp": "mkdirp", + "node-mongodb-native": "mongodb", + "node-mysql": "mysql", + "node-open": "open", + "node-optimist": "optimist", + "node-progress": "progress", + "node-semver": "semver", + "node-tar": "tar", + "node-uuid": "node-uuid", + "node-xml2js": "xml2js", + "nopt": "nopt", + "notify": "notify", + "nouislider": "nouislider", + "npm": "npm", + "nprogress": "nprogress", + "numbro": "numbro", + "numeral": "numeraljs", + "nunjucks": "nunjucks", + "nv.d3": "nvd3", + "object-assign": "object-assign", + "oboe-browser": "oboe", + "office": "office-js", + "offline": "offline-js", + "onsenui": "onsenui", + "OpenLayers.js": "openlayers", + "openpgp": "openpgp", + "p2": "p2", + "packery.pkgd": "packery", + "page": "page", + "pako": "pako", + "papaparse": "papaparse", + "passport": "passport", + "passport-local": "passport-local", + "path": "pathjs", + "peer": "peerjs", + "peg": "pegjs", + "photoswipe": "photoswipe", + "picker.js": "pickadate", + "pikaday": "pikaday", + "pixi": "pixi.js", + "platform": "platform", + "Please": "pleasejs", + "plottable": "plottable", + "polymer": "polymer", + "postal": "postal", + "preloadjs": "preloadjs", + "progress": "progress", + "purify": "dompurify", + "purl": "purl", + "q": "q", + "qs": "qs", + "qunit": "qunit", + "ractive": "ractive", + "rangy-core": "rangy", + "raphael": "raphael", + "raven": "ravenjs", + "react": "react", + "react-bootstrap": "react-bootstrap", + "react-intl": "react-intl", + "react-redux": "react-redux", + "ReactRouter": "react-router", + "ready": "domready", + "redux": "redux", + "request": "request", + "require": "require", + "restangular": "restangular", + "reveal": "reveal", + "rickshaw": "rickshaw", + "rimraf": "rimraf", + "rivets": "rivets", + "rx": "rx", + "rx.angular": "rx-angular", + "sammy": "sammyjs", + "SAT": "sat", + "sax-js": "sax", + "screenfull": "screenfull", + "seedrandom": "seedrandom", + "select2": "select2", + "selectize": "selectize", + "serve-favicon": "serve-favicon", + "serve-static": "serve-static", + "shelljs": "shelljs", + "should": "should", + "showdown": "showdown", + "sigma": "sigmajs", + "signature_pad": "signature_pad", + "sinon": "sinon", + "sjcl": "sjcl", + "slick": "slick-carousel", + "smoothie": "smoothie", + "socket.io": "socket.io", + "socket.io-client": "socket.io-client", + "sockjs": "sockjs-client", + "sortable": "angular-ui-sortable", + "soundjs": "soundjs", + "source-map": "source-map", + "spectrum": "spectrum", + "spin": "spin", + "sprintf": "sprintf", + "stampit": "stampit", + "state-machine": "state-machine", + "Stats": "stats", + "store": "storejs", + "string": "string", + "string_score": "string_score", + "strophe": "strophe", + "stylus": "stylus", + "sugar": "sugar", + "superagent": "superagent", + "svg": "svgjs", + "svg-injector": "svg-injector", + "swfobject": "swfobject", + "swig": "swig", + "swipe": "swipe", + "swiper": "swiper", + "system.js": "systemjs", + "tether": "tether", + "three": "threejs", + "through": "through", + "through2": "through2", + "timeline": "timelinejs", + "tinycolor": "tinycolor", + "tmhDynamicLocale": "angular-dynamic-locale", + "toaster": "angularjs-toaster", + "toastr": "toastr", + "tracking": "tracking", + "trunk8": "trunk8", + "turf": "turf", + "tweenjs": "tweenjs", + "TweenMax": "gsap", + "twig": "twig", + "twix": "twix", + "typeahead.bundle": "typeahead", + "typescript": "typescript", + "ui": "winjs", + "ui-bootstrap-tpls": "angular-ui-bootstrap", + "ui-grid": "ui-grid", + "uikit": "uikit", + "underscore": "underscore", + "underscore.string": "underscore.string", + "update-notifier": "update-notifier", + "url": "jsurl", + "UUID": "uuid", + "validator": "validator", + "vega": "vega", + "vex": "vex-js", + "video": "videojs", + "vue": "vue", + "vue-router": "vue-router", + "webtorrent": "webtorrent", + "when": "when", + "winston": "winston", + "wrench-js": "wrench", + "ws": "ws", + "xlsx": "xlsx", + "xml2json": "x2js", + "xmlbuilder-js": "xmlbuilder", + "xregexp": "xregexp", + "yargs": "yargs", + "yosay": "yosay", + "yui": "yui", + "yui3": "yui", + "zepto": "zepto", + "ZeroClipboard": "zeroclipboard", + "ZSchema-browser": "z-schema" + } +} \ No newline at end of file diff --git a/src/server/typingsInstaller/nodeTypingsInstaller.ts b/src/server/typingsInstaller/nodeTypingsInstaller.ts index de23b2649a6b6..e7987a767e03a 100644 --- a/src/server/typingsInstaller/nodeTypingsInstaller.ts +++ b/src/server/typingsInstaller/nodeTypingsInstaller.ts @@ -17,10 +17,10 @@ namespace ts.server.typingsInstaller { constructor(private readonly logFile?: string) { } - isEnabled() { + isEnabled = () => { return this.logEnabled && this.logFile !== undefined; } - writeLine(text: string) { + writeLine = (text: string) => { try { fs.appendFileSync(this.logFile, text + sys.newLine); } @@ -77,11 +77,12 @@ namespace ts.server.typingsInstaller { private delayedInitializationError: InitializationFailedResponse; - constructor(globalTypingsCacheLocation: string, typingSafeListLocation: string, npmLocation: string | undefined, throttleLimit: number, log: Log) { + constructor(globalTypingsCacheLocation: string, typingSafeListLocation: string, typesMapLocation: string, npmLocation: string | undefined, throttleLimit: number, log: Log) { super( sys, globalTypingsCacheLocation, typingSafeListLocation ? toPath(typingSafeListLocation, "", createGetCanonicalFileName(sys.useCaseSensitiveFileNames)) : toPath("typingSafeList.json", __dirname, createGetCanonicalFileName(sys.useCaseSensitiveFileNames)), + typesMapLocation ? toPath(typesMapLocation, "", createGetCanonicalFileName(sys.useCaseSensitiveFileNames)) : toPath("typesMap.json", __dirname, createGetCanonicalFileName(sys.useCaseSensitiveFileNames)), throttleLimit, log); this.npmPath = npmLocation !== undefined ? npmLocation : getDefaultNPMLocation(process.argv[0]); @@ -175,6 +176,7 @@ namespace ts.server.typingsInstaller { const logFilePath = findArgument(server.Arguments.LogFile); const globalTypingsCacheLocation = findArgument(server.Arguments.GlobalCacheLocation); const typingSafeListLocation = findArgument(server.Arguments.TypingSafeListLocation); + const typesMapLocation = findArgument(server.Arguments.TypesMapLocation); const npmLocation = findArgument(server.Arguments.NpmLocation); const log = new FileLog(logFilePath); @@ -189,6 +191,6 @@ namespace ts.server.typingsInstaller { } process.exit(0); }); - const installer = new NodeTypingsInstaller(globalTypingsCacheLocation, typingSafeListLocation, npmLocation, /*throttleLimit*/5, log); + const installer = new NodeTypingsInstaller(globalTypingsCacheLocation, typingSafeListLocation, typesMapLocation, npmLocation, /*throttleLimit*/5, log); installer.listen(); } diff --git a/src/server/typingsInstaller/typingsInstaller.ts b/src/server/typingsInstaller/typingsInstaller.ts index 8a3840fd98430..4624a8cc33a83 100644 --- a/src/server/typingsInstaller/typingsInstaller.ts +++ b/src/server/typingsInstaller/typingsInstaller.ts @@ -97,10 +97,11 @@ namespace ts.server.typingsInstaller { protected readonly installTypingHost: InstallTypingHost, private readonly globalCachePath: string, private readonly safeListPath: Path, + private readonly typesMapLocation: Path, private readonly throttleLimit: number, protected readonly log = nullLog) { if (this.log.isEnabled()) { - this.log.writeLine(`Global cache location '${globalCachePath}', safe file path '${safeListPath}'`); + this.log.writeLine(`Global cache location '${globalCachePath}', safe file path '${safeListPath}', types map path ${typesMapLocation}`); } this.processCacheLocation(this.globalCachePath); } @@ -145,7 +146,7 @@ namespace ts.server.typingsInstaller { } if (this.safeList === undefined) { - this.safeList = JsTyping.loadSafeList(this.installTypingHost, this.safeListPath); + this.initializeSafeList(); } const discoverTypingsResult = JsTyping.discoverTypings( this.installTypingHost, @@ -178,6 +179,20 @@ namespace ts.server.typingsInstaller { } } + private initializeSafeList() { + // Prefer the safe list from the types map if it exists + if (this.typesMapLocation) { + const safeListFromMap = JsTyping.loadTypesMap(this.installTypingHost, this.typesMapLocation); + if (safeListFromMap) { + this.log.writeLine(`Loaded safelist from types map file '${this.typesMapLocation}'`); + this.safeList = safeListFromMap; + return; + } + this.log.writeLine(`Failed to load safelist from types map file '${this.typesMapLocation}'`); + } + this.safeList = JsTyping.loadSafeList(this.installTypingHost, this.safeListPath); + } + private processCacheLocation(cacheLocation: string) { if (this.log.isEnabled()) { this.log.writeLine(`Processing cache location '${cacheLocation}'`); diff --git a/src/server/utilities.ts b/src/server/utilities.ts index 174bcc17dfcf3..4d237bf5ded85 100644 --- a/src/server/utilities.ts +++ b/src/server/utilities.ts @@ -49,7 +49,7 @@ namespace ts.server { export function createInstallTypingsRequest(project: Project, typeAcquisition: TypeAcquisition, unresolvedImports: SortedReadonlyArray, cachePath?: string): DiscoverTypings { return { projectName: project.getProjectName(), - fileNames: project.getFileNames(/*excludeFilesFromExternalLibraries*/ true, /*excludeConfigFiles*/ true), + fileNames: project.getFileNames(/*excludeFilesFromExternalLibraries*/ true, /*excludeConfigFiles*/ true).concat(project.getExcludedFiles() as NormalizedPath[]), compilerOptions: project.getCompilerOptions(), typeAcquisition, unresolvedImports, diff --git a/src/services/jsTyping.ts b/src/services/jsTyping.ts index 84f2ef5ba9a4c..6421cb932cd13 100644 --- a/src/services/jsTyping.ts +++ b/src/services/jsTyping.ts @@ -46,6 +46,14 @@ namespace ts.JsTyping { return createMapFromTemplate(result.config); } + export function loadTypesMap(host: TypingResolutionHost, typesMapPath: Path): SafeList | undefined { + const result = readConfigFile(typesMapPath, path => host.readFile(path)); + if (result.config) { + return createMapFromTemplate(result.config.simpleMap); + } + return undefined; + } + /** * @param host is the object providing I/O related operations. * @param fileNames are the file names that belong to the same project From f2a801e49c81303f0b002724027f25f3da7d63b8 Mon Sep 17 00:00:00 2001 From: Ryan Cavanaugh Date: Thu, 27 Jul 2017 16:22:10 -0700 Subject: [PATCH 018/237] Add gulpfile support --- Gulpfile.ts | 25 +++++++++---------------- 1 file changed, 9 insertions(+), 16 deletions(-) diff --git a/Gulpfile.ts b/Gulpfile.ts index f70e8a88aabc1..abc71380d2f5d 100644 --- a/Gulpfile.ts +++ b/Gulpfile.ts @@ -468,7 +468,7 @@ const typesMapJson = path.join(builtLocalDirectory, "typesMap.json"); const tsserverLibraryFile = path.join(builtLocalDirectory, "tsserverlibrary.js"); const tsserverLibraryDefinitionFile = path.join(builtLocalDirectory, "tsserverlibrary.d.ts"); -gulp.task(tsserverLibraryFile, /*help*/ false, [servicesFile], (done) => { +gulp.task(tsserverLibraryFile, /*help*/ false, [servicesFile, typesMapJson], (done) => { const serverLibraryProject = tsc.createProject("src/server/tsconfig.library.json", getCompilerSettings({}, /*useBuiltCompiler*/ true)); const {js, dts}: { js: NodeJS.ReadableStream, dts: NodeJS.ReadableStream } = serverLibraryProject.src() .pipe(sourcemaps.init()) @@ -487,23 +487,16 @@ gulp.task(tsserverLibraryFile, /*help*/ false, [servicesFile], (done) => { ]); }); -gulp.task(typesMapJson, /*help*/ false, [], (done) => { - fs.readFile('src/server/typesMaps.json', 'utf-8', (err, data) => { - if (err) { - return done(err); - } - try { - JSON.parse(data); - } catch (e) { - done(e); - } - fs.writeFile(typesMapJson, data, err => { - done(err); - }); - }); +gulp.task(typesMapJson, /*help*/ false, [], () => { + return gulp.src('src/server/typesMap.json') + .pipe(insert.transform((contents, file) => { + JSON.parse(contents); + return contents; + })) + .pipe(gulp.dest(builtLocalDirectory)); }); -gulp.task("lssl", "Builds language service server library", [tsserverLibraryFile, typesMapJson]); +gulp.task("lssl", "Builds language service server library", [tsserverLibraryFile]); gulp.task("local", "Builds the full compiler and services", [builtLocalCompiler, servicesFile, serverFile, builtGeneratedDiagnosticMessagesJSON, tsserverLibraryFile]); gulp.task("tsc", "Builds only the compiler", [builtLocalCompiler]); From 253cde49077de5c67f5371dab5a2710428ef9c90 Mon Sep 17 00:00:00 2001 From: Ryan Cavanaugh Date: Thu, 27 Jul 2017 16:59:31 -0700 Subject: [PATCH 019/237] Fix tests --- Gulpfile.ts | 4 ++-- package.json | 3 +++ src/harness/unittests/tsserverProjectSystem.ts | 15 ++++++++------- src/harness/unittests/typingsInstaller.ts | 9 +++++---- src/server/editorServices.ts | 7 ++++--- src/server/server.ts | 2 +- 6 files changed, 23 insertions(+), 17 deletions(-) diff --git a/Gulpfile.ts b/Gulpfile.ts index abc71380d2f5d..a28408c46146e 100644 --- a/Gulpfile.ts +++ b/Gulpfile.ts @@ -474,7 +474,7 @@ gulp.task(tsserverLibraryFile, /*help*/ false, [servicesFile, typesMapJson], (do .pipe(sourcemaps.init()) .pipe(newer(tsserverLibraryFile)) .pipe(serverLibraryProject()); - + return merge2([ js.pipe(prependCopyright()) .pipe(sourcemaps.write(".")) @@ -488,7 +488,7 @@ gulp.task(tsserverLibraryFile, /*help*/ false, [servicesFile, typesMapJson], (do }); gulp.task(typesMapJson, /*help*/ false, [], () => { - return gulp.src('src/server/typesMap.json') + return gulp.src("src/server/typesMap.json") .pipe(insert.transform((contents, file) => { JSON.parse(contents); return contents; diff --git a/package.json b/package.json index 5a3bc7ad58c6c..94d5f54a64a48 100644 --- a/package.json +++ b/package.json @@ -95,5 +95,8 @@ "fs": false, "os": false, "path": false + }, + "dependencies": { + "browser-resolve": "^1.11.2" } } diff --git a/src/harness/unittests/tsserverProjectSystem.ts b/src/harness/unittests/tsserverProjectSystem.ts index 4942a8ef53b30..a6d669b3681ce 100644 --- a/src/harness/unittests/tsserverProjectSystem.ts +++ b/src/harness/unittests/tsserverProjectSystem.ts @@ -18,7 +18,7 @@ namespace ts.projectSystem { }) }; - const customTypesMap = { + export const customTypesMap = { path: "/typesMap.json", content: `{ "typesMap": { @@ -33,7 +33,11 @@ namespace ts.projectSystem { }, "simpleMap": { "Bacon": "baconjs", - "bliss": "blissfuljs" + "bliss": "blissfuljs", + "commander": "commander", + "cordova": "cordova", + "react": "react", + "lodash": "lodash" } }` }; @@ -297,10 +301,7 @@ namespace ts.projectSystem { } export function checkFileNames(caption: string, actualFileNames: string[], expectedFileNames: string[]) { - assert.equal(actualFileNames.length, expectedFileNames.length, `${caption}: incorrect actual number of files, expected ${JSON.stringify(expectedFileNames)}, got ${actualFileNames}`); - for (const f of expectedFileNames) { - assert.isTrue(contains(actualFileNames, f), `${caption}: expected to find ${f} in ${JSON.stringify(actualFileNames)}`); - } + assert.sameMembers(actualFileNames, expectedFileNames, caption); } export function checkNumberOfConfiguredProjects(projectService: server.ProjectService, expected: number) { @@ -1500,7 +1501,7 @@ namespace ts.projectSystem { projectService.resetSafeList(); } }); - + it("ignores files excluded by the default type list", () => { const file1 = { path: "/a/b/f1.ts", diff --git a/src/harness/unittests/typingsInstaller.ts b/src/harness/unittests/typingsInstaller.ts index a0a770ad09327..7285dadb0a64b 100644 --- a/src/harness/unittests/typingsInstaller.ts +++ b/src/harness/unittests/typingsInstaller.ts @@ -322,7 +322,7 @@ namespace ts.projectSystem { content: "declare const lodash: { x: number }" }; - const host = createServerHost([file1, file2, file3]); + const host = createServerHost([file1, file2, file3, customTypesMap]); const installer = new (class extends Installer { constructor() { super(host, { typesRegistry: createTypesRegistry("lodash", "react") }); @@ -347,6 +347,7 @@ namespace ts.projectSystem { projectService.checkNumberOfProjects({ externalProjects: 1 }); checkProjectActualFiles(p, [file1.path, file2.path, file3.path]); + debugger; installer.installAll(/*expectedCount*/ 1); checkNumberOfProjects(projectService, { externalProjects: 1 }); @@ -445,7 +446,7 @@ namespace ts.projectSystem { content: "declare const moment: { x: number }" }; - const host = createServerHost([file1, file2, file3, packageJson]); + const host = createServerHost([file1, file2, file3, packageJson, customTypesMap]); const installer = new (class extends Installer { constructor() { super(host, { typesRegistry: createTypesRegistry("jquery", "commander", "moment", "express") }); @@ -521,7 +522,7 @@ namespace ts.projectSystem { }; const typingFiles = [commander, express, jquery, moment, lodash]; - const host = createServerHost([lodashJs, commanderJs, file3, packageJson]); + const host = createServerHost([lodashJs, commanderJs, file3, packageJson, customTypesMap]); const installer = new (class extends Installer { constructor() { super(host, { throttleLimit: 3, typesRegistry: createTypesRegistry("commander", "express", "jquery", "moment", "lodash") }); @@ -600,7 +601,7 @@ namespace ts.projectSystem { typings: typingsName("gulp") }; - const host = createServerHost([lodashJs, commanderJs, file3]); + const host = createServerHost([lodashJs, commanderJs, file3, customTypesMap]); const installer = new (class extends Installer { constructor() { super(host, { throttleLimit: 1, typesRegistry: createTypesRegistry("commander", "jquery", "lodash", "cordova", "gulp", "grunt") }); diff --git a/src/server/editorServices.ts b/src/server/editorServices.ts index 54b393053ca9f..226ba99fbea28 100644 --- a/src/server/editorServices.ts +++ b/src/server/editorServices.ts @@ -411,7 +411,7 @@ namespace ts.server { this.globalPlugins = opts.globalPlugins || emptyArray; this.pluginProbeLocations = opts.pluginProbeLocations || emptyArray; this.allowLocalPluginLoads = !!opts.allowLocalPluginLoads; - this.typesMapLocation = (opts.typesMapLocation === undefined) ? combinePaths(this.host.getExecutingFilePath(), '../typesMap.json') : opts.typesMapLocation; + this.typesMapLocation = (opts.typesMapLocation === undefined) ? combinePaths(this.host.getExecutingFilePath(), "../typesMap.json") : opts.typesMapLocation; Debug.assert(!!this.host.createHash, "'ServerHost.createHash' is required for ProjectService"); @@ -472,7 +472,8 @@ namespace ts.server { } // raw is now fixed and ready this.safelist = raw.typesMap; - } catch(e) { + } + catch (e) { this.logger.info(`Error loading types map: ${e}`); this.safelist = defaultTypeSafeList; } @@ -1721,7 +1722,7 @@ namespace ts.server { const excludeRegexes = excludeRules.map(e => new RegExp(e, "i")); const filesToKeep: ts.server.protocol.ExternalFile[] = []; - for(let i = 0; i < proj.rootFiles.length; i++) { + for (let i = 0; i < proj.rootFiles.length; i++) { if (excludeRegexes.some(re => re.test(normalizedNames[i]))) { excludedFiles.push(normalizedNames[i]); } diff --git a/src/server/server.ts b/src/server/server.ts index 06e2a6482d7ca..c44cf3621976d 100644 --- a/src/server/server.ts +++ b/src/server/server.ts @@ -763,7 +763,7 @@ namespace ts.server { } const typingSafeListLocation = findArgument(Arguments.TypingSafeListLocation); - const typesMapLocation = findArgument(Arguments.TypesMapLocation) || combinePaths(sys.getExecutingFilePath(), '../typesMap.json'); + const typesMapLocation = findArgument(Arguments.TypesMapLocation) || combinePaths(sys.getExecutingFilePath(), "../typesMap.json"); const npmLocation = findArgument(Arguments.NpmLocation); const globalPlugins = (findArgument("--globalPlugins") || "").split(","); From e83a8ea2fc0f4580114ec313e064074d34dbadaf Mon Sep 17 00:00:00 2001 From: Ryan Cavanaugh Date: Thu, 27 Jul 2017 17:01:18 -0700 Subject: [PATCH 020/237] Remove debugger; --- src/harness/unittests/typingsInstaller.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/src/harness/unittests/typingsInstaller.ts b/src/harness/unittests/typingsInstaller.ts index 7285dadb0a64b..a4064f7a2d8fc 100644 --- a/src/harness/unittests/typingsInstaller.ts +++ b/src/harness/unittests/typingsInstaller.ts @@ -347,7 +347,6 @@ namespace ts.projectSystem { projectService.checkNumberOfProjects({ externalProjects: 1 }); checkProjectActualFiles(p, [file1.path, file2.path, file3.path]); - debugger; installer.installAll(/*expectedCount*/ 1); checkNumberOfProjects(projectService, { externalProjects: 1 }); From b17bd97e71aee2c8b1bceb1ea94533b0d272aafe Mon Sep 17 00:00:00 2001 From: Tingan Ho Date: Sun, 30 Jul 2017 10:29:09 +0200 Subject: [PATCH 021/237] Clean up --- src/compiler/checker.ts | 2 +- src/compiler/types.ts | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 4de0c7a2a6c37..f3979d8044181 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -481,7 +481,7 @@ namespace ts { Type, ResolvedBaseConstructorType, DeclaredType, - ResolvedReturnType + ResolvedReturnType, } const enum CheckMode { diff --git a/src/compiler/types.ts b/src/compiler/types.ts index 09f1b5cfcc53c..fb7a6745d0c19 100644 --- a/src/compiler/types.ts +++ b/src/compiler/types.ts @@ -4001,7 +4001,6 @@ namespace ts { ContainsBindingPattern = 1 << 23, ContainsYield = 1 << 24, ContainsHoistedDeclarationOrCompletion = 1 << 25, - ContainsDynamicImport = 1 << 26, // Please leave this as 1 << 29. From 99c662b5e4e2548ea6607c027ba7d2373ec2ff45 Mon Sep 17 00:00:00 2001 From: Tingan Ho Date: Sun, 30 Jul 2017 10:29:30 +0200 Subject: [PATCH 022/237] Add diagnostics --- src/compiler/diagnosticMessages.json | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/compiler/diagnosticMessages.json b/src/compiler/diagnosticMessages.json index 3b4b0ddf66711..fbd91f33905f9 100644 --- a/src/compiler/diagnosticMessages.json +++ b/src/compiler/diagnosticMessages.json @@ -2196,6 +2196,10 @@ "category": "Error", "code": 2713 }, + "Duplicate identifier '_ignoredCatchParameter'. Compiler uses the parameter declaration '_ignoredCatchParameter' to bind ignored catched exceptions.": { + "category": "Error", + "code": 2714 + }, "Import declaration '{0}' is using private name '{1}'.": { "category": "Error", From b917eb022558af24b7a8e01f8bff4c249480f012 Mon Sep 17 00:00:00 2001 From: Tingan Ho Date: Sun, 30 Jul 2017 10:30:59 +0200 Subject: [PATCH 023/237] Adds optional catch parameter into the compiler --- src/compiler/binder.ts | 5 ++++- src/compiler/checker.ts | 12 ++++++++++++ src/compiler/emitter.ts | 10 ++++++---- src/compiler/parser.ts | 5 +++-- src/compiler/types.ts | 4 ++-- 5 files changed, 27 insertions(+), 9 deletions(-) diff --git a/src/compiler/binder.ts b/src/compiler/binder.ts index 2fbd0c3e1412a..aa42d1b251bcc 100644 --- a/src/compiler/binder.ts +++ b/src/compiler/binder.ts @@ -2921,7 +2921,10 @@ namespace ts { function computeCatchClause(node: CatchClause, subtreeFlags: TransformFlags) { let transformFlags = subtreeFlags; - if (node.variableDeclaration && isBindingPattern(node.variableDeclaration.name)) { + if (!node.variableDeclaration) { + transformFlags |= TransformFlags.AssertESNext; + } + else if (/* node.variableDeclaration && */ isBindingPattern(node.variableDeclaration.name)) { transformFlags |= TransformFlags.AssertES2015; } diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index f3979d8044181..8c7e7abef1c56 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -20885,6 +20885,18 @@ namespace ts { } } } + else if (/* !catchClause.variableDeclaration && */ languageVersion < ScriptTarget.ESNext) { + const blockLocals = catchClause.block.locals; + debugger; + if (blockLocals) { + forEachKey(blockLocals, caughtName => { + if (caughtName === "_ignoredCatchParameter") { + const localSymbol = blockLocals.get(caughtName); + grammarErrorOnNode(localSymbol.valueDeclaration, Diagnostics.Duplicate_identifier_ignoredCatchParameter_Compiler_uses_the_parameter_declaration_ignoredCatchParameter_to_bind_ignored_catched_exceptions); + } + }); + } + } checkBlock(catchClause.block); } diff --git a/src/compiler/emitter.ts b/src/compiler/emitter.ts index de08b209d3e4e..1c5194054cacd 100644 --- a/src/compiler/emitter.ts +++ b/src/compiler/emitter.ts @@ -2131,10 +2131,12 @@ namespace ts { function emitCatchClause(node: CatchClause) { const openParenPos = writeToken(SyntaxKind.CatchKeyword, node.pos); write(" "); - writeToken(SyntaxKind.OpenParenToken, openParenPos); - emit(node.variableDeclaration); - writeToken(SyntaxKind.CloseParenToken, node.variableDeclaration ? node.variableDeclaration.end : openParenPos); - write(" "); + if (node.variableDeclaration) { + writeToken(SyntaxKind.OpenParenToken, openParenPos); + emit(node.variableDeclaration); + writeToken(SyntaxKind.CloseParenToken, node.variableDeclaration ? node.variableDeclaration.end : openParenPos); + write(" "); + } emit(node.block); } diff --git a/src/compiler/parser.ts b/src/compiler/parser.ts index 34670cd28349a..12c516c88b03e 100644 --- a/src/compiler/parser.ts +++ b/src/compiler/parser.ts @@ -4778,11 +4778,12 @@ namespace ts { function parseCatchClause(): CatchClause { const result = createNode(SyntaxKind.CatchClause); parseExpected(SyntaxKind.CatchKeyword); - if (parseExpected(SyntaxKind.OpenParenToken)) { + + if (parseOptional(SyntaxKind.OpenParenToken)) { result.variableDeclaration = parseVariableDeclaration(); + parseExpected(SyntaxKind.CloseParenToken); } - parseExpected(SyntaxKind.CloseParenToken); result.block = parseBlock(/*ignoreMissingOpenBrace*/ false); return finishNode(result); } diff --git a/src/compiler/types.ts b/src/compiler/types.ts index fb7a6745d0c19..5210b89eb1fbc 100644 --- a/src/compiler/types.ts +++ b/src/compiler/types.ts @@ -1807,8 +1807,8 @@ namespace ts { export interface CatchClause extends Node { kind: SyntaxKind.CatchClause; - parent?: TryStatement; - variableDeclaration: VariableDeclaration; + parent: TryStatement; + variableDeclaration?: VariableDeclaration; block: Block; } From 148a494c90d0849ad94de02f34975dd8960e22be Mon Sep 17 00:00:00 2001 From: Tingan Ho Date: Sun, 30 Jul 2017 10:31:31 +0200 Subject: [PATCH 024/237] Adds transformers for ignored catch parameter --- src/compiler/transformers/es2015.ts | 2 +- src/compiler/transformers/esnext.ts | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/compiler/transformers/es2015.ts b/src/compiler/transformers/es2015.ts index f97de018d4ad0..ebfd0b0069f97 100644 --- a/src/compiler/transformers/es2015.ts +++ b/src/compiler/transformers/es2015.ts @@ -3173,7 +3173,7 @@ namespace ts { function visitCatchClause(node: CatchClause): CatchClause { const ancestorFacts = enterSubtree(HierarchyFacts.BlockScopeExcludes, HierarchyFacts.BlockScopeIncludes); let updated: CatchClause; - if (isBindingPattern(node.variableDeclaration.name)) { + if (node.variableDeclaration && isBindingPattern(node.variableDeclaration.name)) { const temp = createTempVariable(/*recordTempVariable*/ undefined); const newVariableDeclaration = createVariableDeclaration(temp); setTextRange(newVariableDeclaration, node.variableDeclaration); diff --git a/src/compiler/transformers/esnext.ts b/src/compiler/transformers/esnext.ts index 3d8840019326d..597b9d55b1648 100644 --- a/src/compiler/transformers/esnext.ts +++ b/src/compiler/transformers/esnext.ts @@ -101,6 +101,8 @@ namespace ts { return visitExpressionStatement(node as ExpressionStatement); case SyntaxKind.ParenthesizedExpression: return visitParenthesizedExpression(node as ParenthesizedExpression, noDestructuringValue); + case SyntaxKind.CatchClause: + return visitCatchClause(node as CatchClause); default: return visitEachChild(node, visitor, context); } @@ -212,6 +214,13 @@ namespace ts { return visitEachChild(node, noDestructuringValue ? visitorNoDestructuringValue : visitor, context); } + function visitCatchClause(node: CatchClause): CatchClause { + if (!node.variableDeclaration) { + return updateCatchClause(node, createVariableDeclaration("_ignoredCatchParameter"), node.block); + } + return visitEachChild(node, visitor, context); + } + /** * Visits a BinaryExpression that contains a destructuring assignment. * From e349943c07e4f0ca52110d109705ba4797c86e74 Mon Sep 17 00:00:00 2001 From: Tingan Ho Date: Sun, 30 Jul 2017 10:32:39 +0200 Subject: [PATCH 025/237] Add tests --- .../statements/tryStatements/invalidTryStatements.ts | 5 +++++ .../statements/tryStatements/tryStatements.ts | 9 ++++----- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/tests/cases/conformance/statements/tryStatements/invalidTryStatements.ts b/tests/cases/conformance/statements/tryStatements/invalidTryStatements.ts index c838cf45f6948..6ecdfe1065609 100644 --- a/tests/cases/conformance/statements/tryStatements/invalidTryStatements.ts +++ b/tests/cases/conformance/statements/tryStatements/invalidTryStatements.ts @@ -8,5 +8,10 @@ function fn() { try { } catch (z: any) { } try { } catch (a: number) { } try { } catch (y: string) { } + + + try { } catch { + let _ignoredCatchParameter; // Should error since we downlevel emit this variable. + } } diff --git a/tests/cases/conformance/statements/tryStatements/tryStatements.ts b/tests/cases/conformance/statements/tryStatements/tryStatements.ts index 691c046d6d14d..42f549e6911ad 100644 --- a/tests/cases/conformance/statements/tryStatements/tryStatements.ts +++ b/tests/cases/conformance/statements/tryStatements/tryStatements.ts @@ -1,11 +1,10 @@ + function fn() { - try { + try { } catch { } - } catch (x) { - var x: any; - } + try { } catch (x) { var x: any; } try { } finally { } - try { }catch(z){ } finally { } + try { } catch(z) { } finally { } } \ No newline at end of file From 90ea10e45e7fb49f1fe3eb26e4f5bbc634256d07 Mon Sep 17 00:00:00 2001 From: Tingan Ho Date: Sun, 30 Jul 2017 10:33:22 +0200 Subject: [PATCH 026/237] Accept baselines --- ...tructorWithIncompleteTypeAnnotation.errors.txt | 4 ++-- .../constructorWithIncompleteTypeAnnotation.js | 2 +- .../emitter.ignoredCatchParameter.esnext.js | 11 +++++++++++ .../emitter.ignoredCatchParameter.esnext.symbols | 7 +++++++ .../emitter.ignoredCatchParameter.esnext.types | 7 +++++++ .../reference/invalidTryStatements.errors.txt | 10 +++++++++- tests/baselines/reference/invalidTryStatements.js | 9 +++++++++ .../reference/invalidTryStatements2.errors.txt | 5 +---- .../baselines/reference/invalidTryStatements2.js | 2 +- tests/baselines/reference/tryStatements.js | 13 ++++++------- tests/baselines/reference/tryStatements.symbols | 15 ++++++--------- tests/baselines/reference/tryStatements.types | 9 +++------ 12 files changed, 63 insertions(+), 31 deletions(-) create mode 100644 tests/baselines/reference/emitter.ignoredCatchParameter.esnext.js create mode 100644 tests/baselines/reference/emitter.ignoredCatchParameter.esnext.symbols create mode 100644 tests/baselines/reference/emitter.ignoredCatchParameter.esnext.types diff --git a/tests/baselines/reference/constructorWithIncompleteTypeAnnotation.errors.txt b/tests/baselines/reference/constructorWithIncompleteTypeAnnotation.errors.txt index 1d37b20a3b3e8..708f175c00250 100644 --- a/tests/baselines/reference/constructorWithIncompleteTypeAnnotation.errors.txt +++ b/tests/baselines/reference/constructorWithIncompleteTypeAnnotation.errors.txt @@ -34,7 +34,7 @@ tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(138,13): error T tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(141,32): error TS1005: '{' expected. tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(143,13): error TS1005: 'try' expected. tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(159,24): error TS1109: Expression expected. -tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(159,30): error TS1005: '(' expected. +tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(159,30): error TS1005: '{' expected. tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(159,31): error TS2304: Cannot find name 'Property'. tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(166,13): error TS2365: Operator '+=' cannot be applied to types 'number' and 'void'. tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(180,40): error TS2447: The '^' operator is not allowed for boolean types. Consider using '!==' instead. @@ -323,7 +323,7 @@ tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(261,1): error TS ~~~~~ !!! error TS1109: Expression expected. ~ -!!! error TS1005: '(' expected. +!!! error TS1005: '{' expected. ~~~~~~~~ !!! error TS2304: Cannot find name 'Property'. retVal += c.Member(); diff --git a/tests/baselines/reference/constructorWithIncompleteTypeAnnotation.js b/tests/baselines/reference/constructorWithIncompleteTypeAnnotation.js index 8e9dc6da68831..013692a488949 100644 --- a/tests/baselines/reference/constructorWithIncompleteTypeAnnotation.js +++ b/tests/baselines/reference/constructorWithIncompleteTypeAnnotation.js @@ -441,7 +441,7 @@ var BasicFeatures = (function () { var xx = c; retVal += ; try { } - catch () { } + catch (_ignoredCatchParameter) { } Property; retVal += c.Member(); retVal += xx.Foo() ? 0 : 1; diff --git a/tests/baselines/reference/emitter.ignoredCatchParameter.esnext.js b/tests/baselines/reference/emitter.ignoredCatchParameter.esnext.js new file mode 100644 index 0000000000000..0f9254fd3cbaf --- /dev/null +++ b/tests/baselines/reference/emitter.ignoredCatchParameter.esnext.js @@ -0,0 +1,11 @@ +//// [emitter.ignoredCatchParameter.esnext.ts] +function fn() { + try {} catch {} +} + + +//// [emitter.ignoredCatchParameter.esnext.js] +function fn() { + try { } + catch { } +} diff --git a/tests/baselines/reference/emitter.ignoredCatchParameter.esnext.symbols b/tests/baselines/reference/emitter.ignoredCatchParameter.esnext.symbols new file mode 100644 index 0000000000000..78838a33011ac --- /dev/null +++ b/tests/baselines/reference/emitter.ignoredCatchParameter.esnext.symbols @@ -0,0 +1,7 @@ +=== tests/cases/conformance/emitter/esnext/noCatchParameter/emitter.ignoredCatchParameter.esnext.ts === +function fn() { +>fn : Symbol(fn, Decl(emitter.ignoredCatchParameter.esnext.ts, 0, 0)) + + try {} catch {} +} + diff --git a/tests/baselines/reference/emitter.ignoredCatchParameter.esnext.types b/tests/baselines/reference/emitter.ignoredCatchParameter.esnext.types new file mode 100644 index 0000000000000..06bf4ab268274 --- /dev/null +++ b/tests/baselines/reference/emitter.ignoredCatchParameter.esnext.types @@ -0,0 +1,7 @@ +=== tests/cases/conformance/emitter/esnext/noCatchParameter/emitter.ignoredCatchParameter.esnext.ts === +function fn() { +>fn : () => void + + try {} catch {} +} + diff --git a/tests/baselines/reference/invalidTryStatements.errors.txt b/tests/baselines/reference/invalidTryStatements.errors.txt index a2f8a7bac0c96..08dc5f1dfa0d0 100644 --- a/tests/baselines/reference/invalidTryStatements.errors.txt +++ b/tests/baselines/reference/invalidTryStatements.errors.txt @@ -1,9 +1,10 @@ tests/cases/conformance/statements/tryStatements/invalidTryStatements.ts(8,23): error TS1196: Catch clause variable cannot have a type annotation. tests/cases/conformance/statements/tryStatements/invalidTryStatements.ts(9,23): error TS1196: Catch clause variable cannot have a type annotation. tests/cases/conformance/statements/tryStatements/invalidTryStatements.ts(10,23): error TS1196: Catch clause variable cannot have a type annotation. +tests/cases/conformance/statements/tryStatements/invalidTryStatements.ts(14,13): error TS2714: Duplicate identifier '_ignoredCatchParameter'. Compiler uses the parameter declaration '_ignoredCatchParameter' to bind ignored catched exceptions. -==== tests/cases/conformance/statements/tryStatements/invalidTryStatements.ts (3 errors) ==== +==== tests/cases/conformance/statements/tryStatements/invalidTryStatements.ts (4 errors) ==== function fn() { try { } catch (x) { @@ -20,6 +21,13 @@ tests/cases/conformance/statements/tryStatements/invalidTryStatements.ts(10,23): try { } catch (y: string) { } ~~~~~~ !!! error TS1196: Catch clause variable cannot have a type annotation. + + + try { } catch { + let _ignoredCatchParameter; // Should error since we downlevel emit this variable. + ~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2714: Duplicate identifier '_ignoredCatchParameter'. Compiler uses the parameter declaration '_ignoredCatchParameter' to bind ignored catched exceptions. + } } \ No newline at end of file diff --git a/tests/baselines/reference/invalidTryStatements.js b/tests/baselines/reference/invalidTryStatements.js index 343ad6e058400..1436c83ae07dc 100644 --- a/tests/baselines/reference/invalidTryStatements.js +++ b/tests/baselines/reference/invalidTryStatements.js @@ -9,6 +9,11 @@ function fn() { try { } catch (z: any) { } try { } catch (a: number) { } try { } catch (y: string) { } + + + try { } catch { + let _ignoredCatchParameter; // Should error since we downlevel emit this variable. + } } @@ -27,4 +32,8 @@ function fn() { catch (a) { } try { } catch (y) { } + try { } + catch (_ignoredCatchParameter) { + var _ignoredCatchParameter = void 0; // Should error since we downlevel emit this variable. + } } diff --git a/tests/baselines/reference/invalidTryStatements2.errors.txt b/tests/baselines/reference/invalidTryStatements2.errors.txt index f2e88cfdc22a6..e1d285b8c8806 100644 --- a/tests/baselines/reference/invalidTryStatements2.errors.txt +++ b/tests/baselines/reference/invalidTryStatements2.errors.txt @@ -1,4 +1,3 @@ -tests/cases/conformance/statements/tryStatements/invalidTryStatements2.ts(3,13): error TS1005: '(' expected. tests/cases/conformance/statements/tryStatements/invalidTryStatements2.ts(6,5): error TS1005: 'try' expected. tests/cases/conformance/statements/tryStatements/invalidTryStatements2.ts(12,5): error TS1005: 'try' expected. tests/cases/conformance/statements/tryStatements/invalidTryStatements2.ts(13,5): error TS1005: 'try' expected. @@ -6,12 +5,10 @@ tests/cases/conformance/statements/tryStatements/invalidTryStatements2.ts(22,5): tests/cases/conformance/statements/tryStatements/invalidTryStatements2.ts(26,5): error TS1005: 'try' expected. -==== tests/cases/conformance/statements/tryStatements/invalidTryStatements2.ts (6 errors) ==== +==== tests/cases/conformance/statements/tryStatements/invalidTryStatements2.ts (5 errors) ==== function fn() { try { } catch { // syntax error, missing '(x)' - ~ -!!! error TS1005: '(' expected. } catch(x) { } // error missing try diff --git a/tests/baselines/reference/invalidTryStatements2.js b/tests/baselines/reference/invalidTryStatements2.js index 118b607817ad4..44fb6bb707115 100644 --- a/tests/baselines/reference/invalidTryStatements2.js +++ b/tests/baselines/reference/invalidTryStatements2.js @@ -32,7 +32,7 @@ function fn2() { function fn() { try { } - catch () { + catch (_ignoredCatchParameter) { } try { } diff --git a/tests/baselines/reference/tryStatements.js b/tests/baselines/reference/tryStatements.js index 723014c1b5259..da126cbcc6c48 100644 --- a/tests/baselines/reference/tryStatements.js +++ b/tests/baselines/reference/tryStatements.js @@ -1,20 +1,19 @@ //// [tryStatements.ts] function fn() { - try { + try { } catch { } - } catch (x) { - var x: any; - } + try { } catch (x) { var x: any; } try { } finally { } - try { }catch(z){ } finally { } + try { } catch(z) { } finally { } } //// [tryStatements.js] function fn() { - try { - } + try { } + catch (_ignoredCatchParameter) { } + try { } catch (x) { var x; } diff --git a/tests/baselines/reference/tryStatements.symbols b/tests/baselines/reference/tryStatements.symbols index 945ca2d9d8894..cc0147726659d 100644 --- a/tests/baselines/reference/tryStatements.symbols +++ b/tests/baselines/reference/tryStatements.symbols @@ -2,17 +2,14 @@ function fn() { >fn : Symbol(fn, Decl(tryStatements.ts, 0, 0)) - try { + try { } catch { } - } catch (x) { ->x : Symbol(x, Decl(tryStatements.ts, 3, 13)) - - var x: any; ->x : Symbol(x, Decl(tryStatements.ts, 4, 11)) - } + try { } catch (x) { var x: any; } +>x : Symbol(x, Decl(tryStatements.ts, 3, 19)) +>x : Symbol(x, Decl(tryStatements.ts, 3, 27)) try { } finally { } - try { }catch(z){ } finally { } ->z : Symbol(z, Decl(tryStatements.ts, 9, 17)) + try { } catch(z) { } finally { } +>z : Symbol(z, Decl(tryStatements.ts, 7, 18)) } diff --git a/tests/baselines/reference/tryStatements.types b/tests/baselines/reference/tryStatements.types index 07bc3997d8316..49e89dd79c020 100644 --- a/tests/baselines/reference/tryStatements.types +++ b/tests/baselines/reference/tryStatements.types @@ -2,17 +2,14 @@ function fn() { >fn : () => void - try { + try { } catch { } - } catch (x) { + try { } catch (x) { var x: any; } >x : any - - var x: any; >x : any - } try { } finally { } - try { }catch(z){ } finally { } + try { } catch(z) { } finally { } >z : any } From c65e5a1d137a99de621a91ed9a2507beb8a6477f Mon Sep 17 00:00:00 2001 From: Tingan Ho Date: Sun, 30 Jul 2017 11:03:43 +0200 Subject: [PATCH 027/237] Removes valid test cases from invalid test case file --- src/compiler/types.ts | 2 +- .../reference/invalidTryStatements2.errors.txt | 12 ++++-------- tests/baselines/reference/invalidTryStatements2.js | 8 -------- .../tryStatements/invalidTryStatements2.ts | 4 ---- 4 files changed, 5 insertions(+), 21 deletions(-) diff --git a/src/compiler/types.ts b/src/compiler/types.ts index 5210b89eb1fbc..c97020c1142de 100644 --- a/src/compiler/types.ts +++ b/src/compiler/types.ts @@ -1807,7 +1807,7 @@ namespace ts { export interface CatchClause extends Node { kind: SyntaxKind.CatchClause; - parent: TryStatement; + parent?: TryStatement; // We parse missing try statements variableDeclaration?: VariableDeclaration; block: Block; } diff --git a/tests/baselines/reference/invalidTryStatements2.errors.txt b/tests/baselines/reference/invalidTryStatements2.errors.txt index e1d285b8c8806..38c30fb32ab17 100644 --- a/tests/baselines/reference/invalidTryStatements2.errors.txt +++ b/tests/baselines/reference/invalidTryStatements2.errors.txt @@ -1,16 +1,12 @@ -tests/cases/conformance/statements/tryStatements/invalidTryStatements2.ts(6,5): error TS1005: 'try' expected. -tests/cases/conformance/statements/tryStatements/invalidTryStatements2.ts(12,5): error TS1005: 'try' expected. -tests/cases/conformance/statements/tryStatements/invalidTryStatements2.ts(13,5): error TS1005: 'try' expected. +tests/cases/conformance/statements/tryStatements/invalidTryStatements2.ts(2,5): error TS1005: 'try' expected. +tests/cases/conformance/statements/tryStatements/invalidTryStatements2.ts(8,5): error TS1005: 'try' expected. +tests/cases/conformance/statements/tryStatements/invalidTryStatements2.ts(9,5): error TS1005: 'try' expected. +tests/cases/conformance/statements/tryStatements/invalidTryStatements2.ts(18,5): error TS1005: 'try' expected. tests/cases/conformance/statements/tryStatements/invalidTryStatements2.ts(22,5): error TS1005: 'try' expected. -tests/cases/conformance/statements/tryStatements/invalidTryStatements2.ts(26,5): error TS1005: 'try' expected. ==== tests/cases/conformance/statements/tryStatements/invalidTryStatements2.ts (5 errors) ==== function fn() { - try { - } catch { // syntax error, missing '(x)' - } - catch(x) { } // error missing try ~~~~~ !!! error TS1005: 'try' expected. diff --git a/tests/baselines/reference/invalidTryStatements2.js b/tests/baselines/reference/invalidTryStatements2.js index 44fb6bb707115..45b150b4094d7 100644 --- a/tests/baselines/reference/invalidTryStatements2.js +++ b/tests/baselines/reference/invalidTryStatements2.js @@ -1,9 +1,5 @@ //// [invalidTryStatements2.ts] function fn() { - try { - } catch { // syntax error, missing '(x)' - } - catch(x) { } // error missing try finally{ } // potential error; can be absorbed by the 'catch' @@ -30,10 +26,6 @@ function fn2() { //// [invalidTryStatements2.js] function fn() { - try { - } - catch (_ignoredCatchParameter) { - } try { } catch (x) { } // error missing try diff --git a/tests/cases/conformance/statements/tryStatements/invalidTryStatements2.ts b/tests/cases/conformance/statements/tryStatements/invalidTryStatements2.ts index 6937e509845ac..205d6f3f193f4 100644 --- a/tests/cases/conformance/statements/tryStatements/invalidTryStatements2.ts +++ b/tests/cases/conformance/statements/tryStatements/invalidTryStatements2.ts @@ -1,8 +1,4 @@ function fn() { - try { - } catch { // syntax error, missing '(x)' - } - catch(x) { } // error missing try finally{ } // potential error; can be absorbed by the 'catch' From de38ef74a4bfe79656a21a6d78f2a7802d2e8324 Mon Sep 17 00:00:00 2001 From: Tingan Ho Date: Sun, 30 Jul 2017 11:06:11 +0200 Subject: [PATCH 028/237] remove debugger --- src/compiler/checker.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 8c7e7abef1c56..6d07025a41fe8 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -20887,7 +20887,6 @@ namespace ts { } else if (/* !catchClause.variableDeclaration && */ languageVersion < ScriptTarget.ESNext) { const blockLocals = catchClause.block.locals; - debugger; if (blockLocals) { forEachKey(blockLocals, caughtName => { if (caughtName === "_ignoredCatchParameter") { From 58c8a2c03dcbfda2430039a623c0a13ae1425ea4 Mon Sep 17 00:00:00 2001 From: Tingan Ho Date: Sun, 30 Jul 2017 11:32:17 +0200 Subject: [PATCH 029/237] adds test for try-catch-finally --- tests/baselines/reference/tryStatements.js | 5 +++++ tests/baselines/reference/tryStatements.symbols | 4 +++- tests/baselines/reference/tryStatements.types | 2 ++ .../conformance/statements/tryStatements/tryStatements.ts | 2 ++ 4 files changed, 12 insertions(+), 1 deletion(-) diff --git a/tests/baselines/reference/tryStatements.js b/tests/baselines/reference/tryStatements.js index da126cbcc6c48..d99d0f91b35ea 100644 --- a/tests/baselines/reference/tryStatements.js +++ b/tests/baselines/reference/tryStatements.js @@ -6,6 +6,8 @@ function fn() { try { } finally { } + try { } catch { } finally { } + try { } catch(z) { } finally { } } @@ -20,6 +22,9 @@ function fn() { try { } finally { } try { } + catch (_ignoredCatchParameter) { } + finally { } + try { } catch (z) { } finally { } } diff --git a/tests/baselines/reference/tryStatements.symbols b/tests/baselines/reference/tryStatements.symbols index cc0147726659d..5bcb897d1931e 100644 --- a/tests/baselines/reference/tryStatements.symbols +++ b/tests/baselines/reference/tryStatements.symbols @@ -10,6 +10,8 @@ function fn() { try { } finally { } + try { } catch { } finally { } + try { } catch(z) { } finally { } ->z : Symbol(z, Decl(tryStatements.ts, 7, 18)) +>z : Symbol(z, Decl(tryStatements.ts, 9, 18)) } diff --git a/tests/baselines/reference/tryStatements.types b/tests/baselines/reference/tryStatements.types index 49e89dd79c020..cdc0a7c981d0d 100644 --- a/tests/baselines/reference/tryStatements.types +++ b/tests/baselines/reference/tryStatements.types @@ -10,6 +10,8 @@ function fn() { try { } finally { } + try { } catch { } finally { } + try { } catch(z) { } finally { } >z : any } diff --git a/tests/cases/conformance/statements/tryStatements/tryStatements.ts b/tests/cases/conformance/statements/tryStatements/tryStatements.ts index 42f549e6911ad..3fb395ca0ea06 100644 --- a/tests/cases/conformance/statements/tryStatements/tryStatements.ts +++ b/tests/cases/conformance/statements/tryStatements/tryStatements.ts @@ -6,5 +6,7 @@ function fn() { try { } finally { } + try { } catch { } finally { } + try { } catch(z) { } finally { } } \ No newline at end of file From 81fb3f702a9322139d433570d01f1dcde9abb729 Mon Sep 17 00:00:00 2001 From: Tingan Ho Date: Tue, 1 Aug 2017 22:10:12 +0200 Subject: [PATCH 030/237] Addresses CR feedback --- src/compiler/binder.ts | 2 +- src/compiler/checker.ts | 11 ----------- src/compiler/diagnosticMessages.json | 4 ---- src/compiler/transformers/es2015.ts | 3 ++- src/compiler/transformers/esnext.ts | 2 +- src/compiler/types.ts | 2 +- .../statements/tryStatements/invalidTryStatements.ts | 5 ----- 7 files changed, 5 insertions(+), 24 deletions(-) diff --git a/src/compiler/binder.ts b/src/compiler/binder.ts index aa42d1b251bcc..45880f855fd7e 100644 --- a/src/compiler/binder.ts +++ b/src/compiler/binder.ts @@ -2924,7 +2924,7 @@ namespace ts { if (!node.variableDeclaration) { transformFlags |= TransformFlags.AssertESNext; } - else if (/* node.variableDeclaration && */ isBindingPattern(node.variableDeclaration.name)) { + else if (isBindingPattern(node.variableDeclaration.name)) { transformFlags |= TransformFlags.AssertES2015; } diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 6d07025a41fe8..f3979d8044181 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -20885,17 +20885,6 @@ namespace ts { } } } - else if (/* !catchClause.variableDeclaration && */ languageVersion < ScriptTarget.ESNext) { - const blockLocals = catchClause.block.locals; - if (blockLocals) { - forEachKey(blockLocals, caughtName => { - if (caughtName === "_ignoredCatchParameter") { - const localSymbol = blockLocals.get(caughtName); - grammarErrorOnNode(localSymbol.valueDeclaration, Diagnostics.Duplicate_identifier_ignoredCatchParameter_Compiler_uses_the_parameter_declaration_ignoredCatchParameter_to_bind_ignored_catched_exceptions); - } - }); - } - } checkBlock(catchClause.block); } diff --git a/src/compiler/diagnosticMessages.json b/src/compiler/diagnosticMessages.json index fbd91f33905f9..3b4b0ddf66711 100644 --- a/src/compiler/diagnosticMessages.json +++ b/src/compiler/diagnosticMessages.json @@ -2196,10 +2196,6 @@ "category": "Error", "code": 2713 }, - "Duplicate identifier '_ignoredCatchParameter'. Compiler uses the parameter declaration '_ignoredCatchParameter' to bind ignored catched exceptions.": { - "category": "Error", - "code": 2714 - }, "Import declaration '{0}' is using private name '{1}'.": { "category": "Error", diff --git a/src/compiler/transformers/es2015.ts b/src/compiler/transformers/es2015.ts index ebfd0b0069f97..41e68baa523f1 100644 --- a/src/compiler/transformers/es2015.ts +++ b/src/compiler/transformers/es2015.ts @@ -3173,7 +3173,8 @@ namespace ts { function visitCatchClause(node: CatchClause): CatchClause { const ancestorFacts = enterSubtree(HierarchyFacts.BlockScopeExcludes, HierarchyFacts.BlockScopeIncludes); let updated: CatchClause; - if (node.variableDeclaration && isBindingPattern(node.variableDeclaration.name)) { + Debug.assert(!!node.variableDeclaration, "Catch clauses should always be present when downleveling ES2015 code."); + if (isBindingPattern(node.variableDeclaration.name)) { const temp = createTempVariable(/*recordTempVariable*/ undefined); const newVariableDeclaration = createVariableDeclaration(temp); setTextRange(newVariableDeclaration, node.variableDeclaration); diff --git a/src/compiler/transformers/esnext.ts b/src/compiler/transformers/esnext.ts index 597b9d55b1648..11e79ae9eebed 100644 --- a/src/compiler/transformers/esnext.ts +++ b/src/compiler/transformers/esnext.ts @@ -216,7 +216,7 @@ namespace ts { function visitCatchClause(node: CatchClause): CatchClause { if (!node.variableDeclaration) { - return updateCatchClause(node, createVariableDeclaration("_ignoredCatchParameter"), node.block); + return updateCatchClause(node, createVariableDeclaration(createTempVariable(/*recordTempVariable*/ undefined)), node.block); } return visitEachChild(node, visitor, context); } diff --git a/src/compiler/types.ts b/src/compiler/types.ts index c97020c1142de..9cf8e6fdf0017 100644 --- a/src/compiler/types.ts +++ b/src/compiler/types.ts @@ -1807,7 +1807,7 @@ namespace ts { export interface CatchClause extends Node { kind: SyntaxKind.CatchClause; - parent?: TryStatement; // We parse missing try statements + parent?: TryStatement; // We make this optional to parse missing try statements variableDeclaration?: VariableDeclaration; block: Block; } diff --git a/tests/cases/conformance/statements/tryStatements/invalidTryStatements.ts b/tests/cases/conformance/statements/tryStatements/invalidTryStatements.ts index 6ecdfe1065609..c838cf45f6948 100644 --- a/tests/cases/conformance/statements/tryStatements/invalidTryStatements.ts +++ b/tests/cases/conformance/statements/tryStatements/invalidTryStatements.ts @@ -8,10 +8,5 @@ function fn() { try { } catch (z: any) { } try { } catch (a: number) { } try { } catch (y: string) { } - - - try { } catch { - let _ignoredCatchParameter; // Should error since we downlevel emit this variable. - } } From dbdbb05c66d3255e0b13a94a24c5ccb46a71ad08 Mon Sep 17 00:00:00 2001 From: Tingan Ho Date: Tue, 1 Aug 2017 22:23:34 +0200 Subject: [PATCH 031/237] Accept baselines --- .../constructorWithIncompleteTypeAnnotation.js | 2 +- .../reference/invalidTryStatements.errors.txt | 10 +--------- tests/baselines/reference/invalidTryStatements.js | 9 --------- tests/baselines/reference/tryStatements.js | 4 ++-- 4 files changed, 4 insertions(+), 21 deletions(-) diff --git a/tests/baselines/reference/constructorWithIncompleteTypeAnnotation.js b/tests/baselines/reference/constructorWithIncompleteTypeAnnotation.js index 013692a488949..f33c4b6d3161e 100644 --- a/tests/baselines/reference/constructorWithIncompleteTypeAnnotation.js +++ b/tests/baselines/reference/constructorWithIncompleteTypeAnnotation.js @@ -441,7 +441,7 @@ var BasicFeatures = (function () { var xx = c; retVal += ; try { } - catch (_ignoredCatchParameter) { } + catch (_a) { } Property; retVal += c.Member(); retVal += xx.Foo() ? 0 : 1; diff --git a/tests/baselines/reference/invalidTryStatements.errors.txt b/tests/baselines/reference/invalidTryStatements.errors.txt index 08dc5f1dfa0d0..a2f8a7bac0c96 100644 --- a/tests/baselines/reference/invalidTryStatements.errors.txt +++ b/tests/baselines/reference/invalidTryStatements.errors.txt @@ -1,10 +1,9 @@ tests/cases/conformance/statements/tryStatements/invalidTryStatements.ts(8,23): error TS1196: Catch clause variable cannot have a type annotation. tests/cases/conformance/statements/tryStatements/invalidTryStatements.ts(9,23): error TS1196: Catch clause variable cannot have a type annotation. tests/cases/conformance/statements/tryStatements/invalidTryStatements.ts(10,23): error TS1196: Catch clause variable cannot have a type annotation. -tests/cases/conformance/statements/tryStatements/invalidTryStatements.ts(14,13): error TS2714: Duplicate identifier '_ignoredCatchParameter'. Compiler uses the parameter declaration '_ignoredCatchParameter' to bind ignored catched exceptions. -==== tests/cases/conformance/statements/tryStatements/invalidTryStatements.ts (4 errors) ==== +==== tests/cases/conformance/statements/tryStatements/invalidTryStatements.ts (3 errors) ==== function fn() { try { } catch (x) { @@ -21,13 +20,6 @@ tests/cases/conformance/statements/tryStatements/invalidTryStatements.ts(14,13): try { } catch (y: string) { } ~~~~~~ !!! error TS1196: Catch clause variable cannot have a type annotation. - - - try { } catch { - let _ignoredCatchParameter; // Should error since we downlevel emit this variable. - ~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2714: Duplicate identifier '_ignoredCatchParameter'. Compiler uses the parameter declaration '_ignoredCatchParameter' to bind ignored catched exceptions. - } } \ No newline at end of file diff --git a/tests/baselines/reference/invalidTryStatements.js b/tests/baselines/reference/invalidTryStatements.js index 1436c83ae07dc..343ad6e058400 100644 --- a/tests/baselines/reference/invalidTryStatements.js +++ b/tests/baselines/reference/invalidTryStatements.js @@ -9,11 +9,6 @@ function fn() { try { } catch (z: any) { } try { } catch (a: number) { } try { } catch (y: string) { } - - - try { } catch { - let _ignoredCatchParameter; // Should error since we downlevel emit this variable. - } } @@ -32,8 +27,4 @@ function fn() { catch (a) { } try { } catch (y) { } - try { } - catch (_ignoredCatchParameter) { - var _ignoredCatchParameter = void 0; // Should error since we downlevel emit this variable. - } } diff --git a/tests/baselines/reference/tryStatements.js b/tests/baselines/reference/tryStatements.js index d99d0f91b35ea..fa5c9b5c92b3d 100644 --- a/tests/baselines/reference/tryStatements.js +++ b/tests/baselines/reference/tryStatements.js @@ -14,7 +14,7 @@ function fn() { //// [tryStatements.js] function fn() { try { } - catch (_ignoredCatchParameter) { } + catch (_a) { } try { } catch (x) { var x; @@ -22,7 +22,7 @@ function fn() { try { } finally { } try { } - catch (_ignoredCatchParameter) { } + catch (_b) { } finally { } try { } catch (z) { } From 192628510fc2494e8843ccc4d797d7b1a168f1d5 Mon Sep 17 00:00:00 2001 From: Tingan Ho Date: Wed, 2 Aug 2017 12:05:10 +0200 Subject: [PATCH 032/237] Fixes CR comments --- src/compiler/transformers/es2015.ts | 2 +- src/compiler/transformers/esnext.ts | 6 +++++- .../reference/emitter.ignoredCatchParameter.esnext.js | 11 ----------- .../emitter.ignoredCatchParameter.esnext.symbols | 7 ------- .../emitter.ignoredCatchParameter.esnext.types | 7 ------- .../noCatchBinding/emitter.noCatchBinding.esnext.ts | 8 ++++++++ .../statements/tryStatements/tryStatements.ts | 9 ++++++++- 7 files changed, 22 insertions(+), 28 deletions(-) delete mode 100644 tests/baselines/reference/emitter.ignoredCatchParameter.esnext.js delete mode 100644 tests/baselines/reference/emitter.ignoredCatchParameter.esnext.symbols delete mode 100644 tests/baselines/reference/emitter.ignoredCatchParameter.esnext.types create mode 100644 tests/cases/conformance/emitter/esnext/noCatchBinding/emitter.noCatchBinding.esnext.ts diff --git a/src/compiler/transformers/es2015.ts b/src/compiler/transformers/es2015.ts index 41e68baa523f1..5173352469935 100644 --- a/src/compiler/transformers/es2015.ts +++ b/src/compiler/transformers/es2015.ts @@ -2491,7 +2491,7 @@ namespace ts { const catchVariable = getGeneratedNameForNode(errorRecord); const returnMethod = createTempVariable(/*recordTempVariable*/ undefined); const values = createValuesHelper(context, expression, node.expression); - const next = createCall(createPropertyAccess(iterator, "next" ), /*typeArguments*/ undefined, []); + const next = createCall(createPropertyAccess(iterator, "next"), /*typeArguments*/ undefined, []); hoistVariableDeclaration(errorRecord); hoistVariableDeclaration(returnMethod); diff --git a/src/compiler/transformers/esnext.ts b/src/compiler/transformers/esnext.ts index 11e79ae9eebed..8d71016b0519c 100644 --- a/src/compiler/transformers/esnext.ts +++ b/src/compiler/transformers/esnext.ts @@ -216,7 +216,11 @@ namespace ts { function visitCatchClause(node: CatchClause): CatchClause { if (!node.variableDeclaration) { - return updateCatchClause(node, createVariableDeclaration(createTempVariable(/*recordTempVariable*/ undefined)), node.block); + return updateCatchClause( + node, + createVariableDeclaration(createTempVariable(/*recordTempVariable*/ undefined)), + visitNode(node.block, visitor, isBlock) + ); } return visitEachChild(node, visitor, context); } diff --git a/tests/baselines/reference/emitter.ignoredCatchParameter.esnext.js b/tests/baselines/reference/emitter.ignoredCatchParameter.esnext.js deleted file mode 100644 index 0f9254fd3cbaf..0000000000000 --- a/tests/baselines/reference/emitter.ignoredCatchParameter.esnext.js +++ /dev/null @@ -1,11 +0,0 @@ -//// [emitter.ignoredCatchParameter.esnext.ts] -function fn() { - try {} catch {} -} - - -//// [emitter.ignoredCatchParameter.esnext.js] -function fn() { - try { } - catch { } -} diff --git a/tests/baselines/reference/emitter.ignoredCatchParameter.esnext.symbols b/tests/baselines/reference/emitter.ignoredCatchParameter.esnext.symbols deleted file mode 100644 index 78838a33011ac..0000000000000 --- a/tests/baselines/reference/emitter.ignoredCatchParameter.esnext.symbols +++ /dev/null @@ -1,7 +0,0 @@ -=== tests/cases/conformance/emitter/esnext/noCatchParameter/emitter.ignoredCatchParameter.esnext.ts === -function fn() { ->fn : Symbol(fn, Decl(emitter.ignoredCatchParameter.esnext.ts, 0, 0)) - - try {} catch {} -} - diff --git a/tests/baselines/reference/emitter.ignoredCatchParameter.esnext.types b/tests/baselines/reference/emitter.ignoredCatchParameter.esnext.types deleted file mode 100644 index 06bf4ab268274..0000000000000 --- a/tests/baselines/reference/emitter.ignoredCatchParameter.esnext.types +++ /dev/null @@ -1,7 +0,0 @@ -=== tests/cases/conformance/emitter/esnext/noCatchParameter/emitter.ignoredCatchParameter.esnext.ts === -function fn() { ->fn : () => void - - try {} catch {} -} - diff --git a/tests/cases/conformance/emitter/esnext/noCatchBinding/emitter.noCatchBinding.esnext.ts b/tests/cases/conformance/emitter/esnext/noCatchBinding/emitter.noCatchBinding.esnext.ts new file mode 100644 index 0000000000000..8e87b3c8c8fc6 --- /dev/null +++ b/tests/cases/conformance/emitter/esnext/noCatchBinding/emitter.noCatchBinding.esnext.ts @@ -0,0 +1,8 @@ +// @target: esnext +function f() { + try { } catch { } + try { } catch { + try { } catch { } + } + try { } catch { } finally { } +} \ No newline at end of file diff --git a/tests/cases/conformance/statements/tryStatements/tryStatements.ts b/tests/cases/conformance/statements/tryStatements/tryStatements.ts index 3fb395ca0ea06..0a47ba7a94bef 100644 --- a/tests/cases/conformance/statements/tryStatements/tryStatements.ts +++ b/tests/cases/conformance/statements/tryStatements/tryStatements.ts @@ -2,11 +2,18 @@ function fn() { try { } catch { } + try { } catch { + try { } catch { + try { } catch { } + } + try { } catch { } + } + try { } catch (x) { var x: any; } try { } finally { } try { } catch { } finally { } - try { } catch(z) { } finally { } + try { } catch (z) { } finally { } } \ No newline at end of file From 053b708bf136295af812a97fb93b1554285d60bf Mon Sep 17 00:00:00 2001 From: Tingan Ho Date: Wed, 2 Aug 2017 17:53:46 +0200 Subject: [PATCH 033/237] Accept baseline --- .../emitter.noCatchBinding.esnext.js | 22 +++++++++++++++++++ .../emitter.noCatchBinding.esnext.symbols | 10 +++++++++ .../emitter.noCatchBinding.esnext.types | 10 +++++++++ tests/baselines/reference/tryStatements.js | 21 ++++++++++++++++-- .../baselines/reference/tryStatements.symbols | 15 +++++++++---- tests/baselines/reference/tryStatements.types | 9 +++++++- 6 files changed, 80 insertions(+), 7 deletions(-) create mode 100644 tests/baselines/reference/emitter.noCatchBinding.esnext.js create mode 100644 tests/baselines/reference/emitter.noCatchBinding.esnext.symbols create mode 100644 tests/baselines/reference/emitter.noCatchBinding.esnext.types diff --git a/tests/baselines/reference/emitter.noCatchBinding.esnext.js b/tests/baselines/reference/emitter.noCatchBinding.esnext.js new file mode 100644 index 0000000000000..f47a947ca1a48 --- /dev/null +++ b/tests/baselines/reference/emitter.noCatchBinding.esnext.js @@ -0,0 +1,22 @@ +//// [emitter.noCatchBinding.esnext.ts] +function f() { + try { } catch { } + try { } catch { + try { } catch { } + } + try { } catch { } finally { } +} + +//// [emitter.noCatchBinding.esnext.js] +function f() { + try { } + catch { } + try { } + catch { + try { } + catch { } + } + try { } + catch { } + finally { } +} diff --git a/tests/baselines/reference/emitter.noCatchBinding.esnext.symbols b/tests/baselines/reference/emitter.noCatchBinding.esnext.symbols new file mode 100644 index 0000000000000..91242f5b01cee --- /dev/null +++ b/tests/baselines/reference/emitter.noCatchBinding.esnext.symbols @@ -0,0 +1,10 @@ +=== tests/cases/conformance/emitter/esnext/noCatchBinding/emitter.noCatchBinding.esnext.ts === +function f() { +>f : Symbol(f, Decl(emitter.noCatchBinding.esnext.ts, 0, 0)) + + try { } catch { } + try { } catch { + try { } catch { } + } + try { } catch { } finally { } +} diff --git a/tests/baselines/reference/emitter.noCatchBinding.esnext.types b/tests/baselines/reference/emitter.noCatchBinding.esnext.types new file mode 100644 index 0000000000000..70c2b728a5dc6 --- /dev/null +++ b/tests/baselines/reference/emitter.noCatchBinding.esnext.types @@ -0,0 +1,10 @@ +=== tests/cases/conformance/emitter/esnext/noCatchBinding/emitter.noCatchBinding.esnext.ts === +function f() { +>f : () => void + + try { } catch { } + try { } catch { + try { } catch { } + } + try { } catch { } finally { } +} diff --git a/tests/baselines/reference/tryStatements.js b/tests/baselines/reference/tryStatements.js index fa5c9b5c92b3d..64fe2cf06a763 100644 --- a/tests/baselines/reference/tryStatements.js +++ b/tests/baselines/reference/tryStatements.js @@ -2,13 +2,20 @@ function fn() { try { } catch { } + try { } catch { + try { } catch { + try { } catch { } + } + try { } catch { } + } + try { } catch (x) { var x: any; } try { } finally { } try { } catch { } finally { } - try { } catch(z) { } finally { } + try { } catch (z) { } finally { } } //// [tryStatements.js] @@ -16,13 +23,23 @@ function fn() { try { } catch (_a) { } try { } + catch (_b) { + try { } + catch (_c) { + try { } + catch (_d) { } + } + try { } + catch (_e) { } + } + try { } catch (x) { var x; } try { } finally { } try { } - catch (_b) { } + catch (_f) { } finally { } try { } catch (z) { } diff --git a/tests/baselines/reference/tryStatements.symbols b/tests/baselines/reference/tryStatements.symbols index 5bcb897d1931e..69e9918a98b42 100644 --- a/tests/baselines/reference/tryStatements.symbols +++ b/tests/baselines/reference/tryStatements.symbols @@ -4,14 +4,21 @@ function fn() { try { } catch { } + try { } catch { + try { } catch { + try { } catch { } + } + try { } catch { } + } + try { } catch (x) { var x: any; } ->x : Symbol(x, Decl(tryStatements.ts, 3, 19)) ->x : Symbol(x, Decl(tryStatements.ts, 3, 27)) +>x : Symbol(x, Decl(tryStatements.ts, 10, 19)) +>x : Symbol(x, Decl(tryStatements.ts, 10, 27)) try { } finally { } try { } catch { } finally { } - try { } catch(z) { } finally { } ->z : Symbol(z, Decl(tryStatements.ts, 9, 18)) + try { } catch (z) { } finally { } +>z : Symbol(z, Decl(tryStatements.ts, 16, 19)) } diff --git a/tests/baselines/reference/tryStatements.types b/tests/baselines/reference/tryStatements.types index cdc0a7c981d0d..05c0256813540 100644 --- a/tests/baselines/reference/tryStatements.types +++ b/tests/baselines/reference/tryStatements.types @@ -4,6 +4,13 @@ function fn() { try { } catch { } + try { } catch { + try { } catch { + try { } catch { } + } + try { } catch { } + } + try { } catch (x) { var x: any; } >x : any >x : any @@ -12,6 +19,6 @@ function fn() { try { } catch { } finally { } - try { } catch(z) { } finally { } + try { } catch (z) { } finally { } >z : any } From d07eca72a36bd4031b54b238698f23fa6590a155 Mon Sep 17 00:00:00 2001 From: Nathan Shively-Sanders Date: Wed, 2 Aug 2017 09:38:44 -0700 Subject: [PATCH 034/237] Improve name:isTypeAssignableToKind+cleanup TODOs --- src/compiler/checker.ts | 68 +++++++++++++++++++---------------------- 1 file changed, 32 insertions(+), 36 deletions(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index d1c18ef61d807..419a93994e60c 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -7526,11 +7526,11 @@ namespace ts { return getTypeOfSymbol(prop); } } - if (!(indexType.flags & TypeFlags.Nullable) && isTypeOfKind(indexType, TypeFlags.StringLike | TypeFlags.NumberLike | TypeFlags.ESSymbol)) { + if (!(indexType.flags & TypeFlags.Nullable) && isTypeAssignableToKind(indexType, TypeFlags.StringLike | TypeFlags.NumberLike | TypeFlags.ESSymbol)) { if (isTypeAny(objectType)) { return anyType; } - const indexInfo = isTypeOfKind(indexType, TypeFlags.NumberLike) && getIndexInfoOfType(objectType, IndexKind.Number) || + const indexInfo = isTypeAssignableToKind(indexType, TypeFlags.NumberLike) && getIndexInfoOfType(objectType, IndexKind.Number) || getIndexInfoOfType(objectType, IndexKind.String) || undefined; if (indexInfo) { @@ -11286,7 +11286,7 @@ namespace ts { (parent.parent).operatorToken.kind === SyntaxKind.EqualsToken && (parent.parent).left === parent && !isAssignmentTarget(parent.parent) && - isTypeOfKind(getTypeOfExpression((parent).argumentExpression), TypeFlags.NumberLike); + isTypeAssignableToKind(getTypeOfExpression((parent).argumentExpression), TypeFlags.NumberLike); return isLengthPushOrUnshift || isElementAssignment; } @@ -11458,7 +11458,7 @@ namespace ts { } else { const indexType = getTypeOfExpression(((node).left).argumentExpression); - if (isTypeOfKind(indexType, TypeFlags.NumberLike)) { + if (isTypeAssignableToKind(indexType, TypeFlags.NumberLike)) { evolvedType = addEvolvingArrayElementType(evolvedType, (node).right); } } @@ -13290,7 +13290,7 @@ namespace ts { function isNumericComputedName(name: ComputedPropertyName): boolean { // It seems odd to consider an expression of type Any to result in a numeric name, // but this behavior is consistent with checkIndexedAccess - return isTypeOfKind(checkComputedPropertyName(name), TypeFlags.NumberLike); + return isTypeAssignableToKind(checkComputedPropertyName(name), TypeFlags.NumberLike); } function isInfinityOrNaNString(name: string | __String): boolean { @@ -13328,7 +13328,7 @@ namespace ts { links.resolvedType = checkExpression(node.expression); // This will allow types number, string, symbol or any. It will also allow enums, the unknown // type, and any union of these types (like string | number). - if (links.resolvedType.flags & TypeFlags.Nullable || !isTypeOfKind(links.resolvedType, TypeFlags.StringLike | TypeFlags.NumberLike | TypeFlags.ESSymbol)) { + if (links.resolvedType.flags & TypeFlags.Nullable || !isTypeAssignableToKind(links.resolvedType, TypeFlags.StringLike | TypeFlags.NumberLike | TypeFlags.ESSymbol)) { error(node, Diagnostics.A_computed_property_name_must_be_of_type_string_number_symbol_or_any); } else { @@ -15431,7 +15431,7 @@ namespace ts { case SyntaxKind.ComputedPropertyName: const nameType = checkComputedPropertyName(element.name); - if (isTypeOfKind(nameType, TypeFlags.ESSymbol)) { + if (isTypeAssignableToKind(nameType, TypeFlags.ESSymbol)) { return nameType; } else { @@ -16813,7 +16813,7 @@ namespace ts { } function checkArithmeticOperandType(operand: Node, type: Type, diagnostic: DiagnosticMessage): boolean { - if (!isTypeOfKind(type, TypeFlags.NumberLike)) { + if (!isTypeAssignableToKind(type, TypeFlags.NumberLike)) { error(operand, diagnostic); return false; } @@ -16986,12 +16986,11 @@ namespace ts { return false; } - function isTypeOfKind(source: Type, kind: TypeFlags, excludeAny?: boolean) { + function isTypeAssignableToKind(source: Type, kind: TypeFlags, strict?: boolean) { if (source.flags & kind) { return true; } - if (excludeAny && source.flags & (TypeFlags.Any | TypeFlags.Void | TypeFlags.Undefined | TypeFlags.Null)) { - // TODO: The callers who want this should really handle these cases FIRST + if (strict && source.flags & (TypeFlags.Any | TypeFlags.Void | TypeFlags.Undefined | TypeFlags.Null)) { return false; } const targets = []; @@ -17042,7 +17041,7 @@ namespace ts { // and the right operand to be of type Any, a subtype of the 'Function' interface type, or have a call or construct signature. // The result is always of the Boolean primitive type. // NOTE: do not raise error if leftType is unknown as related error was already reported - if (isTypeOfKind(leftType, TypeFlags.Primitive, /*excludeAny*/ true)) { + if (!(leftType.flags & TypeFlags.Any) && isTypeAssignableToKind(leftType, TypeFlags.Primitive)) { error(left, Diagnostics.The_left_hand_side_of_an_instanceof_expression_must_be_of_type_any_an_object_type_or_a_type_parameter); } // NOTE: do not raise error if right is unknown as related error was already reported @@ -17065,10 +17064,10 @@ namespace ts { // The in operator requires the left operand to be of type Any, the String primitive type, or the Number primitive type, // and the right operand to be of type Any, an object type, or a type parameter type. // The result is always of the Boolean primitive type. - if (!(isTypeComparableTo(leftType, stringType) || isTypeOfKind(leftType, TypeFlags.NumberLike | TypeFlags.ESSymbol))) { + if (!(isTypeComparableTo(leftType, stringType) || isTypeAssignableToKind(leftType, TypeFlags.NumberLike | TypeFlags.ESSymbol))) { error(left, Diagnostics.The_left_hand_side_of_an_in_expression_must_be_of_type_any_string_number_or_symbol); } - if (!isTypeOfKind(rightType, TypeFlags.NonPrimitive | TypeFlags.TypeVariable)) { + if (!isTypeAssignableToKind(rightType, TypeFlags.NonPrimitive | TypeFlags.TypeVariable)) { error(right, Diagnostics.The_right_hand_side_of_an_in_expression_must_be_of_type_any_an_object_type_or_a_type_parameter); } return booleanType; @@ -17377,33 +17376,30 @@ namespace ts { return silentNeverType; } - if (!isTypeOfKind(leftType, TypeFlags.StringLike) && !isTypeOfKind(rightType, TypeFlags.StringLike)) { + if (!isTypeAssignableToKind(leftType, TypeFlags.StringLike) && !isTypeAssignableToKind(rightType, TypeFlags.StringLike)) { leftType = checkNonNullType(leftType, left); rightType = checkNonNullType(rightType, right); } let resultType: Type; - if (isTypeOfKind(leftType, TypeFlags.NumberLike, /*excludeAny*/ true) && isTypeOfKind(rightType, TypeFlags.NumberLike, /*excludeAny*/ true)) { + if (isTypeAssignableToKind(leftType, TypeFlags.NumberLike, /*strict*/ true) && isTypeAssignableToKind(rightType, TypeFlags.NumberLike, /*strict*/ true)) { // Operands of an enum type are treated as having the primitive type Number. // If both operands are of the Number primitive type, the result is of the Number primitive type. resultType = numberType; } - else { - if (isTypeOfKind(leftType, TypeFlags.StringLike, /*excludeAny*/ true) || isTypeOfKind(rightType, TypeFlags.StringLike, /*excludeAny*/ true)) { + else if (isTypeAssignableToKind(leftType, TypeFlags.StringLike, /*strict*/ true) || isTypeAssignableToKind(rightType, TypeFlags.StringLike, /*strict*/ true)) { // If one or both operands are of the String primitive type, the result is of the String primitive type. resultType = stringType; - } - else if (isTypeAny(leftType) || isTypeAny(rightType)) { - // Otherwise, the result is of type Any. - // NOTE: unknown type here denotes error type. Old compiler treated this case as any type so do we. - // TODO: Reorder this to check for any (plus void/undefined/null) first - resultType = leftType === unknownType || rightType === unknownType ? unknownType : anyType; - } + } + else if (isTypeAny(leftType) || isTypeAny(rightType)) { + // Otherwise, the result is of type Any. + // NOTE: unknown type here denotes error type. Old compiler treated this case as any type so do we. + resultType = leftType === unknownType || rightType === unknownType ? unknownType : anyType; + } - // Symbols are not allowed at all in arithmetic expressions - if (resultType && !checkForDisallowedESSymbolOperand(operator)) { - return resultType; - } + // Symbols are not allowed at all in arithmetic expressions + if (resultType && !checkForDisallowedESSymbolOperand(operator)) { + return resultType; } if (!resultType) { @@ -18620,7 +18616,7 @@ namespace ts { } // Check if we're indexing with a numeric type and the object type is a generic // type with a constraint that has a numeric index signature. - if (maybeTypeOfKind(objectType, TypeFlags.TypeVariable) && isTypeOfKind(indexType, TypeFlags.NumberLike)) { + if (maybeTypeOfKind(objectType, TypeFlags.TypeVariable) && isTypeAssignableToKind(indexType, TypeFlags.NumberLike)) { const constraint = getBaseConstraintOfType(objectType); if (constraint && getIndexInfoOfType(constraint, IndexKind.Number)) { return type; @@ -20322,7 +20318,7 @@ namespace ts { // unknownType is returned i.e. if node.expression is identifier whose name cannot be resolved // in this case error about missing name is already reported - do not report extra one - if (!isTypeOfKind(rightType, TypeFlags.NonPrimitive | TypeFlags.TypeVariable)) { + if (!isTypeAssignableToKind(rightType, TypeFlags.NonPrimitive | TypeFlags.TypeVariable)) { error(node.expression, Diagnostics.The_right_hand_side_of_a_for_in_statement_must_be_of_type_any_an_object_type_or_a_type_parameter); } @@ -23303,22 +23299,22 @@ namespace ts { else if (type.flags & TypeFlags.Any) { return TypeReferenceSerializationKind.ObjectType; } - else if (isTypeOfKind(type, TypeFlags.Void | TypeFlags.Nullable | TypeFlags.Never)) { + else if (isTypeAssignableToKind(type, TypeFlags.Void | TypeFlags.Nullable | TypeFlags.Never)) { return TypeReferenceSerializationKind.VoidNullableOrNeverType; } - else if (isTypeOfKind(type, TypeFlags.BooleanLike)) { + else if (isTypeAssignableToKind(type, TypeFlags.BooleanLike)) { return TypeReferenceSerializationKind.BooleanType; } - else if (isTypeOfKind(type, TypeFlags.NumberLike)) { + else if (isTypeAssignableToKind(type, TypeFlags.NumberLike)) { return TypeReferenceSerializationKind.NumberLikeType; } - else if (isTypeOfKind(type, TypeFlags.StringLike)) { + else if (isTypeAssignableToKind(type, TypeFlags.StringLike)) { return TypeReferenceSerializationKind.StringLikeType; } else if (isTupleType(type)) { return TypeReferenceSerializationKind.ArrayLikeType; } - else if (isTypeOfKind(type, TypeFlags.ESSymbol)) { + else if (isTypeAssignableToKind(type, TypeFlags.ESSymbol)) { return TypeReferenceSerializationKind.ESSymbolType; } else if (isFunctionType(type)) { From 011f712d980305c990c237dd46e9a9e1c1f2ce4c Mon Sep 17 00:00:00 2001 From: Nathan Shively-Sanders Date: Wed, 2 Aug 2017 09:58:01 -0700 Subject: [PATCH 035/237] isTypeAssignableToKind:Chain isTypeAssignableTo calls Instead of building up a list and creating a union type. --- src/compiler/checker.ts | 44 ++++++++++++----------------------------- 1 file changed, 13 insertions(+), 31 deletions(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 419a93994e60c..e67ee72ffcac4 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -13328,7 +13328,9 @@ namespace ts { links.resolvedType = checkExpression(node.expression); // This will allow types number, string, symbol or any. It will also allow enums, the unknown // type, and any union of these types (like string | number). - if (links.resolvedType.flags & TypeFlags.Nullable || !isTypeAssignableToKind(links.resolvedType, TypeFlags.StringLike | TypeFlags.NumberLike | TypeFlags.ESSymbol)) { + if (links.resolvedType.flags & TypeFlags.Nullable || + !isTypeAssignableToKind(links.resolvedType, TypeFlags.StringLike | TypeFlags.NumberLike | TypeFlags.ESSymbol) && + !isTypeAssignableTo(links.resolvedType, getUnionType([stringType, numberType, esSymbolType]))) { error(node, Diagnostics.A_computed_property_name_must_be_of_type_string_number_symbol_or_any); } else { @@ -16986,42 +16988,22 @@ namespace ts { return false; } - function isTypeAssignableToKind(source: Type, kind: TypeFlags, strict?: boolean) { + function isTypeAssignableToKind(source: Type, kind: TypeFlags, strict?: boolean): boolean { if (source.flags & kind) { return true; } if (strict && source.flags & (TypeFlags.Any | TypeFlags.Void | TypeFlags.Undefined | TypeFlags.Null)) { return false; } - const targets = []; - if (kind & TypeFlags.NumberLike) { - targets.push(numberType); - } - if (kind & TypeFlags.StringLike) { - targets.push(stringType); - } - if (kind & TypeFlags.BooleanLike) { - targets.push(booleanType); - } - if (kind & TypeFlags.Void) { - targets.push(voidType); - } - if (kind & TypeFlags.Never) { - targets.push(neverType); - } - if (kind & TypeFlags.Null) { - targets.push(nullType); - } - if (kind & TypeFlags.Undefined) { - targets.push(undefinedType); - } - if (kind & TypeFlags.ESSymbol) { - targets.push(esSymbolType); - } - if (kind & TypeFlags.NonPrimitive) { - targets.push(nonPrimitiveType); - } - return isTypeAssignableTo(source, getUnionType(targets)); + return kind & TypeFlags.NumberLike && isTypeAssignableTo(source, numberType) || + kind & TypeFlags.StringLike && isTypeAssignableTo(source, stringType) || + kind & TypeFlags.BooleanLike && isTypeAssignableTo(source, booleanType) || + kind & TypeFlags.Void && isTypeAssignableTo(source, voidType) || + kind & TypeFlags.Never && isTypeAssignableTo(source, neverType) || + kind & TypeFlags.Null && isTypeAssignableTo(source, nullType) || + kind & TypeFlags.Undefined && isTypeAssignableTo(source, undefinedType) || + kind & TypeFlags.ESSymbol && isTypeAssignableTo(source, esSymbolType) || + kind & TypeFlags.NonPrimitive && isTypeAssignableTo(source, nonPrimitiveType); } function isConstEnumObjectType(type: Type): boolean { From aed386c796046153e76196af8ed4135cbeaebc8c Mon Sep 17 00:00:00 2001 From: Nathan Shively-Sanders Date: Wed, 2 Aug 2017 10:33:15 -0700 Subject: [PATCH 036/237] Add regression test cases and rename test --- .../reference/typeParamExtendsNumber.js | 19 ---- .../reference/typeParamExtendsNumber.symbols | 20 ----- .../reference/typeParamExtendsNumber.types | 23 ----- .../typeParameterExtendsPrimitive.js | 51 +++++++++++ .../typeParameterExtendsPrimitive.symbols | 82 +++++++++++++++++ .../typeParameterExtendsPrimitive.types | 90 +++++++++++++++++++ .../cases/compiler/typeParamExtendsNumber.ts | 7 -- .../compiler/typeParameterExtendsPrimitive.ts | 25 ++++++ 8 files changed, 248 insertions(+), 69 deletions(-) delete mode 100644 tests/baselines/reference/typeParamExtendsNumber.js delete mode 100644 tests/baselines/reference/typeParamExtendsNumber.symbols delete mode 100644 tests/baselines/reference/typeParamExtendsNumber.types create mode 100644 tests/baselines/reference/typeParameterExtendsPrimitive.js create mode 100644 tests/baselines/reference/typeParameterExtendsPrimitive.symbols create mode 100644 tests/baselines/reference/typeParameterExtendsPrimitive.types delete mode 100644 tests/cases/compiler/typeParamExtendsNumber.ts create mode 100644 tests/cases/compiler/typeParameterExtendsPrimitive.ts diff --git a/tests/baselines/reference/typeParamExtendsNumber.js b/tests/baselines/reference/typeParamExtendsNumber.js deleted file mode 100644 index 70548e7985610..0000000000000 --- a/tests/baselines/reference/typeParamExtendsNumber.js +++ /dev/null @@ -1,19 +0,0 @@ -//// [typeParamExtendsNumber.ts] -function f() { - var t: T; - var v = { - [t]: 0 - } - return t + t; -} - - -//// [typeParamExtendsNumber.js] -function f() { - var t; - var v = (_a = {}, - _a[t] = 0, - _a); - return t + t; - var _a; -} diff --git a/tests/baselines/reference/typeParamExtendsNumber.symbols b/tests/baselines/reference/typeParamExtendsNumber.symbols deleted file mode 100644 index 032f08bd58c26..0000000000000 --- a/tests/baselines/reference/typeParamExtendsNumber.symbols +++ /dev/null @@ -1,20 +0,0 @@ -=== tests/cases/compiler/typeParamExtendsNumber.ts === -function f() { ->f : Symbol(f, Decl(typeParamExtendsNumber.ts, 0, 0)) ->T : Symbol(T, Decl(typeParamExtendsNumber.ts, 0, 11)) - - var t: T; ->t : Symbol(t, Decl(typeParamExtendsNumber.ts, 1, 7)) ->T : Symbol(T, Decl(typeParamExtendsNumber.ts, 0, 11)) - - var v = { ->v : Symbol(v, Decl(typeParamExtendsNumber.ts, 2, 7)) - - [t]: 0 ->t : Symbol(t, Decl(typeParamExtendsNumber.ts, 1, 7)) - } - return t + t; ->t : Symbol(t, Decl(typeParamExtendsNumber.ts, 1, 7)) ->t : Symbol(t, Decl(typeParamExtendsNumber.ts, 1, 7)) -} - diff --git a/tests/baselines/reference/typeParamExtendsNumber.types b/tests/baselines/reference/typeParamExtendsNumber.types deleted file mode 100644 index 9034e23ee23d4..0000000000000 --- a/tests/baselines/reference/typeParamExtendsNumber.types +++ /dev/null @@ -1,23 +0,0 @@ -=== tests/cases/compiler/typeParamExtendsNumber.ts === -function f() { ->f : () => number ->T : T - - var t: T; ->t : T ->T : T - - var v = { ->v : { [x: number]: number; } ->{ [t]: 0 } : { [x: number]: number; } - - [t]: 0 ->t : T ->0 : 0 - } - return t + t; ->t + t : number ->t : T ->t : T -} - diff --git a/tests/baselines/reference/typeParameterExtendsPrimitive.js b/tests/baselines/reference/typeParameterExtendsPrimitive.js new file mode 100644 index 0000000000000..1774db19f6ead --- /dev/null +++ b/tests/baselines/reference/typeParameterExtendsPrimitive.js @@ -0,0 +1,51 @@ +//// [typeParameterExtendsPrimitive.ts] +// #14473 +function f() { + var t: T; + var v = { + [t]: 0 + } + return t + t; +} + +// #15501 +interface I { x: number } +type IdMap = { [P in keyof T]: T[P] }; +function g(i: IdMap) { + const n: number = i.x; + return i.x * 2; +} + +// #17069 +function h, K extends string>(array: T[], prop: K): number { + let result = 0; + for (const v of array) { + result += v[prop]; + } + return result; +} + + +//// [typeParameterExtendsPrimitive.js] +// #14473 +function f() { + var t; + var v = (_a = {}, + _a[t] = 0, + _a); + return t + t; + var _a; +} +function g(i) { + var n = i.x; + return i.x * 2; +} +// #17069 +function h(array, prop) { + var result = 0; + for (var _i = 0, array_1 = array; _i < array_1.length; _i++) { + var v = array_1[_i]; + result += v[prop]; + } + return result; +} diff --git a/tests/baselines/reference/typeParameterExtendsPrimitive.symbols b/tests/baselines/reference/typeParameterExtendsPrimitive.symbols new file mode 100644 index 0000000000000..acac75272ac84 --- /dev/null +++ b/tests/baselines/reference/typeParameterExtendsPrimitive.symbols @@ -0,0 +1,82 @@ +=== tests/cases/compiler/typeParameterExtendsPrimitive.ts === +// #14473 +function f() { +>f : Symbol(f, Decl(typeParameterExtendsPrimitive.ts, 0, 0)) +>T : Symbol(T, Decl(typeParameterExtendsPrimitive.ts, 1, 11)) + + var t: T; +>t : Symbol(t, Decl(typeParameterExtendsPrimitive.ts, 2, 7)) +>T : Symbol(T, Decl(typeParameterExtendsPrimitive.ts, 1, 11)) + + var v = { +>v : Symbol(v, Decl(typeParameterExtendsPrimitive.ts, 3, 7)) + + [t]: 0 +>t : Symbol(t, Decl(typeParameterExtendsPrimitive.ts, 2, 7)) + } + return t + t; +>t : Symbol(t, Decl(typeParameterExtendsPrimitive.ts, 2, 7)) +>t : Symbol(t, Decl(typeParameterExtendsPrimitive.ts, 2, 7)) +} + +// #15501 +interface I { x: number } +>I : Symbol(I, Decl(typeParameterExtendsPrimitive.ts, 7, 1)) +>x : Symbol(I.x, Decl(typeParameterExtendsPrimitive.ts, 10, 13)) + +type IdMap = { [P in keyof T]: T[P] }; +>IdMap : Symbol(IdMap, Decl(typeParameterExtendsPrimitive.ts, 10, 25)) +>T : Symbol(T, Decl(typeParameterExtendsPrimitive.ts, 11, 11)) +>P : Symbol(P, Decl(typeParameterExtendsPrimitive.ts, 11, 19)) +>T : Symbol(T, Decl(typeParameterExtendsPrimitive.ts, 11, 11)) +>T : Symbol(T, Decl(typeParameterExtendsPrimitive.ts, 11, 11)) +>P : Symbol(P, Decl(typeParameterExtendsPrimitive.ts, 11, 19)) + +function g(i: IdMap) { +>g : Symbol(g, Decl(typeParameterExtendsPrimitive.ts, 11, 41)) +>T : Symbol(T, Decl(typeParameterExtendsPrimitive.ts, 12, 11)) +>I : Symbol(I, Decl(typeParameterExtendsPrimitive.ts, 7, 1)) +>i : Symbol(i, Decl(typeParameterExtendsPrimitive.ts, 12, 24)) +>IdMap : Symbol(IdMap, Decl(typeParameterExtendsPrimitive.ts, 10, 25)) +>T : Symbol(T, Decl(typeParameterExtendsPrimitive.ts, 12, 11)) + + const n: number = i.x; +>n : Symbol(n, Decl(typeParameterExtendsPrimitive.ts, 13, 9)) +>i.x : Symbol(x, Decl(typeParameterExtendsPrimitive.ts, 10, 13)) +>i : Symbol(i, Decl(typeParameterExtendsPrimitive.ts, 12, 24)) +>x : Symbol(x, Decl(typeParameterExtendsPrimitive.ts, 10, 13)) + + return i.x * 2; +>i.x : Symbol(x, Decl(typeParameterExtendsPrimitive.ts, 10, 13)) +>i : Symbol(i, Decl(typeParameterExtendsPrimitive.ts, 12, 24)) +>x : Symbol(x, Decl(typeParameterExtendsPrimitive.ts, 10, 13)) +} + +// #17069 +function h, K extends string>(array: T[], prop: K): number { +>h : Symbol(h, Decl(typeParameterExtendsPrimitive.ts, 15, 1)) +>T : Symbol(T, Decl(typeParameterExtendsPrimitive.ts, 18, 11)) +>Record : Symbol(Record, Decl(lib.d.ts, --, --)) +>K : Symbol(K, Decl(typeParameterExtendsPrimitive.ts, 18, 39)) +>K : Symbol(K, Decl(typeParameterExtendsPrimitive.ts, 18, 39)) +>array : Symbol(array, Decl(typeParameterExtendsPrimitive.ts, 18, 58)) +>T : Symbol(T, Decl(typeParameterExtendsPrimitive.ts, 18, 11)) +>prop : Symbol(prop, Decl(typeParameterExtendsPrimitive.ts, 18, 69)) +>K : Symbol(K, Decl(typeParameterExtendsPrimitive.ts, 18, 39)) + + let result = 0; +>result : Symbol(result, Decl(typeParameterExtendsPrimitive.ts, 19, 7)) + + for (const v of array) { +>v : Symbol(v, Decl(typeParameterExtendsPrimitive.ts, 20, 14)) +>array : Symbol(array, Decl(typeParameterExtendsPrimitive.ts, 18, 58)) + + result += v[prop]; +>result : Symbol(result, Decl(typeParameterExtendsPrimitive.ts, 19, 7)) +>v : Symbol(v, Decl(typeParameterExtendsPrimitive.ts, 20, 14)) +>prop : Symbol(prop, Decl(typeParameterExtendsPrimitive.ts, 18, 69)) + } + return result; +>result : Symbol(result, Decl(typeParameterExtendsPrimitive.ts, 19, 7)) +} + diff --git a/tests/baselines/reference/typeParameterExtendsPrimitive.types b/tests/baselines/reference/typeParameterExtendsPrimitive.types new file mode 100644 index 0000000000000..1e8eb7f40e058 --- /dev/null +++ b/tests/baselines/reference/typeParameterExtendsPrimitive.types @@ -0,0 +1,90 @@ +=== tests/cases/compiler/typeParameterExtendsPrimitive.ts === +// #14473 +function f() { +>f : () => number +>T : T + + var t: T; +>t : T +>T : T + + var v = { +>v : { [x: number]: number; } +>{ [t]: 0 } : { [x: number]: number; } + + [t]: 0 +>t : T +>0 : 0 + } + return t + t; +>t + t : number +>t : T +>t : T +} + +// #15501 +interface I { x: number } +>I : I +>x : number + +type IdMap = { [P in keyof T]: T[P] }; +>IdMap : IdMap +>T : T +>P : P +>T : T +>T : T +>P : P + +function g(i: IdMap) { +>g : (i: IdMap) => number +>T : T +>I : I +>i : IdMap +>IdMap : IdMap +>T : T + + const n: number = i.x; +>n : number +>i.x : T["x"] +>i : IdMap +>x : T["x"] + + return i.x * 2; +>i.x * 2 : number +>i.x : T["x"] +>i : IdMap +>x : T["x"] +>2 : 2 +} + +// #17069 +function h, K extends string>(array: T[], prop: K): number { +>h : , K extends string>(array: T[], prop: K) => number +>T : T +>Record : Record +>K : K +>K : K +>array : T[] +>T : T +>prop : K +>K : K + + let result = 0; +>result : number +>0 : 0 + + for (const v of array) { +>v : T +>array : T[] + + result += v[prop]; +>result += v[prop] : number +>result : number +>v[prop] : T[K] +>v : T +>prop : K + } + return result; +>result : number +} + diff --git a/tests/cases/compiler/typeParamExtendsNumber.ts b/tests/cases/compiler/typeParamExtendsNumber.ts deleted file mode 100644 index 89b60c990a245..0000000000000 --- a/tests/cases/compiler/typeParamExtendsNumber.ts +++ /dev/null @@ -1,7 +0,0 @@ -function f() { - var t: T; - var v = { - [t]: 0 - } - return t + t; -} diff --git a/tests/cases/compiler/typeParameterExtendsPrimitive.ts b/tests/cases/compiler/typeParameterExtendsPrimitive.ts new file mode 100644 index 0000000000000..b94a44b46600b --- /dev/null +++ b/tests/cases/compiler/typeParameterExtendsPrimitive.ts @@ -0,0 +1,25 @@ +// #14473 +function f() { + var t: T; + var v = { + [t]: 0 + } + return t + t; +} + +// #15501 +interface I { x: number } +type IdMap = { [P in keyof T]: T[P] }; +function g(i: IdMap) { + const n: number = i.x; + return i.x * 2; +} + +// #17069 +function h, K extends string>(array: T[], prop: K): number { + let result = 0; + for (const v of array) { + result += v[prop]; + } + return result; +} From d5c24f3cd3bd0d5375a92ffc5a9b1620ed1d6571 Mon Sep 17 00:00:00 2001 From: Tingan Ho Date: Wed, 2 Aug 2017 20:13:43 +0200 Subject: [PATCH 037/237] Addresses CR comment --- src/compiler/emitter.ts | 2 +- src/compiler/factory.ts | 4 ++-- src/compiler/parser.ts | 4 ++++ src/compiler/transformers/es2015.ts | 2 +- src/compiler/types.ts | 2 +- 5 files changed, 9 insertions(+), 5 deletions(-) diff --git a/src/compiler/emitter.ts b/src/compiler/emitter.ts index 1c5194054cacd..24769afd5d45a 100644 --- a/src/compiler/emitter.ts +++ b/src/compiler/emitter.ts @@ -2134,7 +2134,7 @@ namespace ts { if (node.variableDeclaration) { writeToken(SyntaxKind.OpenParenToken, openParenPos); emit(node.variableDeclaration); - writeToken(SyntaxKind.CloseParenToken, node.variableDeclaration ? node.variableDeclaration.end : openParenPos); + writeToken(SyntaxKind.CloseParenToken, node.variableDeclaration.end); write(" "); } emit(node.block); diff --git a/src/compiler/factory.ts b/src/compiler/factory.ts index 34727e4c41422..47df0a9bdc27a 100644 --- a/src/compiler/factory.ts +++ b/src/compiler/factory.ts @@ -2128,14 +2128,14 @@ namespace ts { : node; } - export function createCatchClause(variableDeclaration: string | VariableDeclaration, block: Block) { + export function createCatchClause(variableDeclaration: string | VariableDeclaration | undefined, block: Block) { const node = createSynthesizedNode(SyntaxKind.CatchClause); node.variableDeclaration = typeof variableDeclaration === "string" ? createVariableDeclaration(variableDeclaration) : variableDeclaration; node.block = block; return node; } - export function updateCatchClause(node: CatchClause, variableDeclaration: VariableDeclaration, block: Block) { + export function updateCatchClause(node: CatchClause, variableDeclaration: VariableDeclaration | undefined, block: Block) { return node.variableDeclaration !== variableDeclaration || node.block !== block ? updateNode(createCatchClause(variableDeclaration, block), node) diff --git a/src/compiler/parser.ts b/src/compiler/parser.ts index 12c516c88b03e..4547df15790df 100644 --- a/src/compiler/parser.ts +++ b/src/compiler/parser.ts @@ -4783,6 +4783,10 @@ namespace ts { result.variableDeclaration = parseVariableDeclaration(); parseExpected(SyntaxKind.CloseParenToken); } + else { + // Keep shape of node to not avoid degrading performance. + result.variableDeclaration = undefined; + } result.block = parseBlock(/*ignoreMissingOpenBrace*/ false); return finishNode(result); diff --git a/src/compiler/transformers/es2015.ts b/src/compiler/transformers/es2015.ts index 5173352469935..2b0b175e2a56f 100644 --- a/src/compiler/transformers/es2015.ts +++ b/src/compiler/transformers/es2015.ts @@ -3173,7 +3173,7 @@ namespace ts { function visitCatchClause(node: CatchClause): CatchClause { const ancestorFacts = enterSubtree(HierarchyFacts.BlockScopeExcludes, HierarchyFacts.BlockScopeIncludes); let updated: CatchClause; - Debug.assert(!!node.variableDeclaration, "Catch clauses should always be present when downleveling ES2015 code."); + Debug.assert(!!node.variableDeclaration, "Catch clause variable should always be present when downleveling ES2015."); if (isBindingPattern(node.variableDeclaration.name)) { const temp = createTempVariable(/*recordTempVariable*/ undefined); const newVariableDeclaration = createVariableDeclaration(temp); diff --git a/src/compiler/types.ts b/src/compiler/types.ts index 9cf8e6fdf0017..ca70a6fe20921 100644 --- a/src/compiler/types.ts +++ b/src/compiler/types.ts @@ -1807,7 +1807,7 @@ namespace ts { export interface CatchClause extends Node { kind: SyntaxKind.CatchClause; - parent?: TryStatement; // We make this optional to parse missing try statements + parent?: TryStatement; variableDeclaration?: VariableDeclaration; block: Block; } From f9e85ec0917342727957f160acf43e3890f46762 Mon Sep 17 00:00:00 2001 From: Tingan Ho Date: Wed, 2 Aug 2017 20:48:31 +0200 Subject: [PATCH 038/237] Adds missing test cases --- .../invalidTryStatements2.errors.txt | 40 +++++++++--------- .../reference/invalidTryStatements2.js | 42 ++++++++----------- .../tryStatements/invalidTryStatements2.ts | 22 ++++------ 3 files changed, 48 insertions(+), 56 deletions(-) diff --git a/tests/baselines/reference/invalidTryStatements2.errors.txt b/tests/baselines/reference/invalidTryStatements2.errors.txt index 38c30fb32ab17..d43c33e55a31d 100644 --- a/tests/baselines/reference/invalidTryStatements2.errors.txt +++ b/tests/baselines/reference/invalidTryStatements2.errors.txt @@ -1,17 +1,23 @@ tests/cases/conformance/statements/tryStatements/invalidTryStatements2.ts(2,5): error TS1005: 'try' expected. -tests/cases/conformance/statements/tryStatements/invalidTryStatements2.ts(8,5): error TS1005: 'try' expected. -tests/cases/conformance/statements/tryStatements/invalidTryStatements2.ts(9,5): error TS1005: 'try' expected. -tests/cases/conformance/statements/tryStatements/invalidTryStatements2.ts(18,5): error TS1005: 'try' expected. -tests/cases/conformance/statements/tryStatements/invalidTryStatements2.ts(22,5): error TS1005: 'try' expected. +tests/cases/conformance/statements/tryStatements/invalidTryStatements2.ts(6,12): error TS1005: 'finally' expected. +tests/cases/conformance/statements/tryStatements/invalidTryStatements2.ts(10,5): error TS1005: 'try' expected. +tests/cases/conformance/statements/tryStatements/invalidTryStatements2.ts(11,5): error TS1005: 'try' expected. +tests/cases/conformance/statements/tryStatements/invalidTryStatements2.ts(15,5): error TS1005: 'try' expected. +tests/cases/conformance/statements/tryStatements/invalidTryStatements2.ts(17,5): error TS1005: 'try' expected. +tests/cases/conformance/statements/tryStatements/invalidTryStatements2.ts(19,20): error TS1003: Identifier expected. -==== tests/cases/conformance/statements/tryStatements/invalidTryStatements2.ts (5 errors) ==== +==== tests/cases/conformance/statements/tryStatements/invalidTryStatements2.ts (7 errors) ==== function fn() { catch(x) { } // error missing try ~~~~~ !!! error TS1005: 'try' expected. - finally{ } // potential error; can be absorbed by the 'catch' + finally { } // potential error; can be absorbed by the 'catch' + + try { }; // missing finally + ~ +!!! error TS1005: 'finally' expected. } function fn2() { @@ -21,22 +27,18 @@ tests/cases/conformance/statements/tryStatements/invalidTryStatements2.ts(22,5): catch (x) { } // error missing try ~~~~~ !!! error TS1005: 'try' expected. + + try { } finally { } // statement is here, so the 'catch' clause above doesn't absorb errors from the 'finally' clause below - // no error - try { - } - finally { - } - - // error missing try - finally { + finally { } // error missing try ~~~~~~~ !!! error TS1005: 'try' expected. - } - - // error missing try - catch (x) { + + catch (x) { } // error missing try ~~~~~ !!! error TS1005: 'try' expected. - } + + try { } catch () { } // error missing catch binding + ~ +!!! error TS1003: Identifier expected. } \ No newline at end of file diff --git a/tests/baselines/reference/invalidTryStatements2.js b/tests/baselines/reference/invalidTryStatements2.js index 45b150b4094d7..25d411ca484c3 100644 --- a/tests/baselines/reference/invalidTryStatements2.js +++ b/tests/baselines/reference/invalidTryStatements2.js @@ -2,26 +2,22 @@ function fn() { catch(x) { } // error missing try - finally{ } // potential error; can be absorbed by the 'catch' + finally { } // potential error; can be absorbed by the 'catch' + + try { }; // missing finally } function fn2() { finally { } // error missing try catch (x) { } // error missing try + + try { } finally { } // statement is here, so the 'catch' clause above doesn't absorb errors from the 'finally' clause below - // no error - try { - } - finally { - } - - // error missing try - finally { - } + finally { } // error missing try + + catch (x) { } // error missing try - // error missing try - catch (x) { - } + try { } catch () { } // error missing catch binding } //// [invalidTryStatements2.js] @@ -30,6 +26,9 @@ function fn() { } catch (x) { } // error missing try finally { } // potential error; can be absorbed by the 'catch' + try { } + finally { } + ; // missing finally } function fn2() { try { @@ -38,19 +37,14 @@ function fn2() { try { } catch (x) { } // error missing try - // no error + try { } + finally { } // statement is here, so the 'catch' clause above doesn't absorb errors from the 'finally' clause below try { } - finally { - } - // error missing try - try { - } - finally { - } - // error missing try + finally { } // error missing try try { } - catch (x) { - } + catch (x) { } // error missing try + try { } + catch () { } // error missing catch binding } diff --git a/tests/cases/conformance/statements/tryStatements/invalidTryStatements2.ts b/tests/cases/conformance/statements/tryStatements/invalidTryStatements2.ts index 205d6f3f193f4..d3d261830f4aa 100644 --- a/tests/cases/conformance/statements/tryStatements/invalidTryStatements2.ts +++ b/tests/cases/conformance/statements/tryStatements/invalidTryStatements2.ts @@ -1,24 +1,20 @@ function fn() { catch(x) { } // error missing try - finally{ } // potential error; can be absorbed by the 'catch' + finally { } // potential error; can be absorbed by the 'catch' + + try { }; // missing finally } function fn2() { finally { } // error missing try catch (x) { } // error missing try + + try { } finally { } // statement is here, so the 'catch' clause above doesn't absorb errors from the 'finally' clause below - // no error - try { - } - finally { - } - - // error missing try - finally { - } + finally { } // error missing try + + catch (x) { } // error missing try - // error missing try - catch (x) { - } + try { } catch () { } // error missing catch binding } \ No newline at end of file From 4f3e13ab8c290fe8a29d661fec280ff700f68021 Mon Sep 17 00:00:00 2001 From: Tingan Ho Date: Wed, 2 Aug 2017 20:50:45 +0200 Subject: [PATCH 039/237] Typo --- tests/baselines/reference/invalidTryStatements2.errors.txt | 2 +- tests/baselines/reference/invalidTryStatements2.js | 4 ++-- .../statements/tryStatements/invalidTryStatements2.ts | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/baselines/reference/invalidTryStatements2.errors.txt b/tests/baselines/reference/invalidTryStatements2.errors.txt index d43c33e55a31d..a7c436236f2e4 100644 --- a/tests/baselines/reference/invalidTryStatements2.errors.txt +++ b/tests/baselines/reference/invalidTryStatements2.errors.txt @@ -15,7 +15,7 @@ tests/cases/conformance/statements/tryStatements/invalidTryStatements2.ts(19,20) finally { } // potential error; can be absorbed by the 'catch' - try { }; // missing finally + try { }; // error missing finally ~ !!! error TS1005: 'finally' expected. } diff --git a/tests/baselines/reference/invalidTryStatements2.js b/tests/baselines/reference/invalidTryStatements2.js index 25d411ca484c3..50aff00c51555 100644 --- a/tests/baselines/reference/invalidTryStatements2.js +++ b/tests/baselines/reference/invalidTryStatements2.js @@ -4,7 +4,7 @@ function fn() { finally { } // potential error; can be absorbed by the 'catch' - try { }; // missing finally + try { }; // error missing finally } function fn2() { @@ -28,7 +28,7 @@ function fn() { finally { } // potential error; can be absorbed by the 'catch' try { } finally { } - ; // missing finally + ; // error missing finally } function fn2() { try { diff --git a/tests/cases/conformance/statements/tryStatements/invalidTryStatements2.ts b/tests/cases/conformance/statements/tryStatements/invalidTryStatements2.ts index d3d261830f4aa..7fb1b135c906b 100644 --- a/tests/cases/conformance/statements/tryStatements/invalidTryStatements2.ts +++ b/tests/cases/conformance/statements/tryStatements/invalidTryStatements2.ts @@ -3,7 +3,7 @@ function fn() { finally { } // potential error; can be absorbed by the 'catch' - try { }; // missing finally + try { }; // error missing finally } function fn2() { From 3da1a53d7ec22a78346e373c9d5f887538a800d8 Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Wed, 2 Aug 2017 12:50:04 -0700 Subject: [PATCH 040/237] Amend comment about explicitly setting catch clause variables to 'undefined'. --- src/compiler/parser.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/compiler/parser.ts b/src/compiler/parser.ts index 4547df15790df..155ad3999bfa3 100644 --- a/src/compiler/parser.ts +++ b/src/compiler/parser.ts @@ -4784,7 +4784,7 @@ namespace ts { parseExpected(SyntaxKind.CloseParenToken); } else { - // Keep shape of node to not avoid degrading performance. + // Keep shape of node to avoid degrading performance. result.variableDeclaration = undefined; } From fa7f3e85fe21bd17136a1cc77fe67b1a2fede2fb Mon Sep 17 00:00:00 2001 From: Ron Buckton Date: Thu, 3 Aug 2017 16:03:24 -0700 Subject: [PATCH 041/237] Adds support for inferred project isolation by projectRootPath --- src/harness/harnessLanguageService.ts | 1 + .../unittests/cachingInServerLSHost.ts | 1 + src/harness/unittests/compileOnSave.ts | 3 +- src/harness/unittests/session.ts | 3 + .../unittests/tsserverProjectSystem.ts | 182 +++++++++++++++--- src/server/editorServices.ts | 136 +++++++++---- src/server/project.ts | 4 +- src/server/protocol.ts | 7 + src/server/server.ts | 4 + src/server/session.ts | 4 +- 10 files changed, 278 insertions(+), 67 deletions(-) diff --git a/src/harness/harnessLanguageService.ts b/src/harness/harnessLanguageService.ts index c604b2246566a..9f4649e4d4c5c 100644 --- a/src/harness/harnessLanguageService.ts +++ b/src/harness/harnessLanguageService.ts @@ -828,6 +828,7 @@ namespace Harness.LanguageService { host: serverHost, cancellationToken: ts.server.nullCancellationToken, useSingleInferredProject: false, + useInferredProjectPerProjectRoot: false, typingsInstaller: undefined, byteLength: Utils.byteLength, hrtime: process.hrtime, diff --git a/src/harness/unittests/cachingInServerLSHost.ts b/src/harness/unittests/cachingInServerLSHost.ts index eb2907e89dea6..ea5b8f021e773 100644 --- a/src/harness/unittests/cachingInServerLSHost.ts +++ b/src/harness/unittests/cachingInServerLSHost.ts @@ -69,6 +69,7 @@ namespace ts { logger, cancellationToken: { isCancellationRequested: () => false }, useSingleInferredProject: false, + useInferredProjectPerProjectRoot: false, typingsInstaller: undefined }; const projectService = new server.ProjectService(svcOpts); diff --git a/src/harness/unittests/compileOnSave.ts b/src/harness/unittests/compileOnSave.ts index 79e1f921dcb82..9321577c7288d 100644 --- a/src/harness/unittests/compileOnSave.ts +++ b/src/harness/unittests/compileOnSave.ts @@ -36,6 +36,7 @@ namespace ts.projectSystem { host, cancellationToken: nullCancellationToken, useSingleInferredProject: false, + useInferredProjectPerProjectRoot: false, typingsInstaller: typingsInstaller || server.nullTypingsInstaller, byteLength: Utils.byteLength, hrtime: process.hrtime, @@ -550,7 +551,7 @@ namespace ts.projectSystem { }; const host = createServerHost([file1, file2, configFile, libFile], { newLine: "\r\n" }); const typingsInstaller = createTestTypingsInstaller(host); - const session = createSession(host, typingsInstaller); + const session = createSession(host, { typingsInstaller }); openFilesForSession([file1, file2], session); const compileFileRequest = makeSessionRequest(CommandNames.CompileOnSaveEmitFile, { file: file1.path, projectFileName: configFile.path }); diff --git a/src/harness/unittests/session.ts b/src/harness/unittests/session.ts index 862ebee4b03ab..4b79f71a7d697 100644 --- a/src/harness/unittests/session.ts +++ b/src/harness/unittests/session.ts @@ -55,6 +55,7 @@ namespace ts.server { host: mockHost, cancellationToken: nullCancellationToken, useSingleInferredProject: false, + useInferredProjectPerProjectRoot: false, typingsInstaller: undefined, byteLength: Utils.byteLength, hrtime: process.hrtime, @@ -405,6 +406,7 @@ namespace ts.server { host: mockHost, cancellationToken: nullCancellationToken, useSingleInferredProject: false, + useInferredProjectPerProjectRoot: false, typingsInstaller: undefined, byteLength: Utils.byteLength, hrtime: process.hrtime, @@ -472,6 +474,7 @@ namespace ts.server { host: mockHost, cancellationToken: nullCancellationToken, useSingleInferredProject: false, + useInferredProjectPerProjectRoot: false, typingsInstaller: undefined, byteLength: Utils.byteLength, hrtime: process.hrtime, diff --git a/src/harness/unittests/tsserverProjectSystem.ts b/src/harness/unittests/tsserverProjectSystem.ts index 4a7cafa245bb9..2d6b370e23f29 100644 --- a/src/harness/unittests/tsserverProjectSystem.ts +++ b/src/harness/unittests/tsserverProjectSystem.ts @@ -186,23 +186,25 @@ namespace ts.projectSystem { } } - export function createSession(host: server.ServerHost, typingsInstaller?: server.ITypingsInstaller, projectServiceEventHandler?: server.ProjectServiceEventHandler, cancellationToken?: server.ServerCancellationToken, throttleWaitMilliseconds?: number) { - if (typingsInstaller === undefined) { - typingsInstaller = new TestTypingsInstaller("/a/data/", /*throttleLimit*/5, host); + export function createSession(host: server.ServerHost, opts: Partial = {}) { + if (opts.typingsInstaller === undefined) { + opts.typingsInstaller = new TestTypingsInstaller("/a/data/", /*throttleLimit*/5, host); } - const opts: server.SessionOptions = { + if (opts.eventHandler !== undefined) { + opts.canUseEvents = true; + } + return new TestSession({ host, - cancellationToken: cancellationToken || server.nullCancellationToken, + cancellationToken: server.nullCancellationToken, useSingleInferredProject: false, - typingsInstaller, + useInferredProjectPerProjectRoot: false, + typingsInstaller: opts.typingsInstaller, byteLength: Utils.byteLength, hrtime: process.hrtime, logger: nullLogger, - canUseEvents: projectServiceEventHandler !== undefined, - eventHandler: projectServiceEventHandler, - throttleWaitMilliseconds - }; - return new TestSession(opts); + canUseEvents: false, + ...opts + }); } export interface CreateProjectServiceParameters { @@ -216,9 +218,16 @@ namespace ts.projectSystem { export class TestProjectService extends server.ProjectService { constructor(host: server.ServerHost, logger: server.Logger, cancellationToken: HostCancellationToken, useSingleInferredProject: boolean, - typingsInstaller: server.ITypingsInstaller, eventHandler: server.ProjectServiceEventHandler) { + typingsInstaller: server.ITypingsInstaller, eventHandler: server.ProjectServiceEventHandler, opts: Partial = {}) { super({ - host, logger, cancellationToken, useSingleInferredProject, typingsInstaller, eventHandler + host, + logger, + cancellationToken, + useSingleInferredProject, + useInferredProjectPerProjectRoot: false, + typingsInstaller, + eventHandler, + ...opts }); } @@ -632,7 +641,7 @@ namespace ts.projectSystem { } } - describe("tsserver-project-system", () => { + describe("tsserverProjectSystem", () => { const commonFile1: FileOrFolder = { path: "/a/b/commonFile1.ts", content: "let x = 1" @@ -2231,13 +2240,16 @@ namespace ts.projectSystem { filePath === f2.path ? server.maxProgramSizeForNonTsFiles + 1 : originalGetFileSize.call(host, filePath); let lastEvent: server.ProjectLanguageServiceStateEvent; - const session = createSession(host, /*typingsInstaller*/ undefined, e => { - if (e.eventName === server.ConfigFileDiagEvent || e.eventName === server.ContextEvent || e.eventName === server.ProjectInfoTelemetryEvent) { - return; + const session = createSession(host, { + canUseEvents: true, + eventHandler: e => { + if (e.eventName === server.ConfigFileDiagEvent || e.eventName === server.ContextEvent || e.eventName === server.ProjectInfoTelemetryEvent) { + return; + } + assert.equal(e.eventName, server.ProjectLanguageServiceStateEvent); + assert.equal(e.data.project.getProjectName(), config.path, "project name"); + lastEvent = e; } - assert.equal(e.eventName, server.ProjectLanguageServiceStateEvent); - assert.equal(e.data.project.getProjectName(), config.path, "project name"); - lastEvent = e; }); session.executeCommand({ seq: 0, @@ -2281,12 +2293,15 @@ namespace ts.projectSystem { host.getFileSize = (filePath: string) => filePath === f2.path ? server.maxProgramSizeForNonTsFiles + 1 : originalGetFileSize.call(host, filePath); let lastEvent: server.ProjectLanguageServiceStateEvent; - const session = createSession(host, /*typingsInstaller*/ undefined, e => { - if (e.eventName === server.ConfigFileDiagEvent || e.eventName === server.ProjectInfoTelemetryEvent) { - return; + const session = createSession(host, { + canUseEvents: true, + eventHandler: e => { + if (e.eventName === server.ConfigFileDiagEvent || e.eventName === server.ProjectInfoTelemetryEvent) { + return; + } + assert.equal(e.eventName, server.ProjectLanguageServiceStateEvent); + lastEvent = e; } - assert.equal(e.eventName, server.ProjectLanguageServiceStateEvent); - lastEvent = e; }); session.executeCommand({ seq: 0, @@ -3070,7 +3085,10 @@ namespace ts.projectSystem { }; const host = createServerHost([file, configFile]); - const session = createSession(host, /*typingsInstaller*/ undefined, serverEventManager.handler); + const session = createSession(host, { + canUseEvents: true, + eventHandler: serverEventManager.handler + }); openFilesForSession([file], session); serverEventManager.checkEventCountOfType("configFileDiag", 1); @@ -3097,7 +3115,10 @@ namespace ts.projectSystem { }; const host = createServerHost([file, configFile]); - const session = createSession(host, /*typingsInstaller*/ undefined, serverEventManager.handler); + const session = createSession(host, { + canUseEvents: true, + eventHandler: serverEventManager.handler + }); openFilesForSession([file], session); serverEventManager.checkEventCountOfType("configFileDiag", 1); }); @@ -3116,7 +3137,10 @@ namespace ts.projectSystem { }; const host = createServerHost([file, configFile]); - const session = createSession(host, /*typingsInstaller*/ undefined, serverEventManager.handler); + const session = createSession(host, { + canUseEvents: true, + eventHandler: serverEventManager.handler + }); openFilesForSession([file], session); serverEventManager.checkEventCountOfType("configFileDiag", 1); @@ -3505,6 +3529,93 @@ namespace ts.projectSystem { checkNumberOfProjects(projectService, { inferredProjects: 1 }); checkProjectActualFiles(projectService.inferredProjects[0], [f.path]); }); + + it("inferred projects per project root", () => { + const file1 = { path: "/a/file1.ts", content: "let x = 1;", projectRootPath: "/a" }; + const file2 = { path: "/a/file2.ts", content: "let y = 2;", projectRootPath: "/a" }; + const file3 = { path: "/b/file2.ts", content: "let x = 3;", projectRootPath: "/b" }; + const file4 = { path: "/c/file3.ts", content: "let z = 4;" }; + const host = createServerHost([file1, file2, file3, file4]); + const session = createSession(host, { + useSingleInferredProject: true, + useInferredProjectPerProjectRoot: true + }); + session.executeCommand({ + seq: 1, + type: "request", + command: CommandNames.CompilerOptionsForInferredProjects, + arguments: { + options: { + allowJs: true, + target: ScriptTarget.ESNext + } + } + }); + session.executeCommand({ + seq: 2, + type: "request", + command: CommandNames.CompilerOptionsForInferredProjects, + arguments: { + options: { + allowJs: true, + target: ScriptTarget.ES2015 + }, + projectRootPath: "/b" + } + }); + session.executeCommand({ + seq: 3, + type: "request", + command: CommandNames.Open, + arguments: { + file: file1.path, + fileContent: file1.content, + scriptKindName: "JS", + projectRootPath: file1.projectRootPath + } + }); + session.executeCommand({ + seq: 4, + type: "request", + command: CommandNames.Open, + arguments: { + file: file2.path, + fileContent: file2.content, + scriptKindName: "JS", + projectRootPath: file2.projectRootPath + } + }); + session.executeCommand({ + seq: 5, + type: "request", + command: CommandNames.Open, + arguments: { + file: file3.path, + fileContent: file3.content, + scriptKindName: "JS", + projectRootPath: file3.projectRootPath + } + }); + session.executeCommand({ + seq: 6, + type: "request", + command: CommandNames.Open, + arguments: { + file: file4.path, + fileContent: file4.content, + scriptKindName: "JS" + } + }); + + const projectService = session.getProjectService(); + checkNumberOfProjects(projectService, { inferredProjects: 3 }); + checkProjectActualFiles(projectService.inferredProjects[0], [file4.path]); + checkProjectActualFiles(projectService.inferredProjects[1], [file1.path, file2.path]); + checkProjectActualFiles(projectService.inferredProjects[2], [file3.path]); + assert.equal(projectService.inferredProjects[0].getCompilerOptions().target, ScriptTarget.ESNext); + assert.equal(projectService.inferredProjects[1].getCompilerOptions().target, ScriptTarget.ESNext); + assert.equal(projectService.inferredProjects[2].getCompilerOptions().target, ScriptTarget.ES2015); + }); }); describe("No overwrite emit error", () => { @@ -3698,7 +3809,7 @@ namespace ts.projectSystem { resetRequest: noop }; - const session = createSession(host, /*typingsInstaller*/ undefined, /*projectServiceEventHandler*/ undefined, cancellationToken); + const session = createSession(host, { cancellationToken }); expectedRequestId = session.getNextSeq(); session.executeCommandSeq({ @@ -3738,7 +3849,11 @@ namespace ts.projectSystem { const cancellationToken = new TestServerCancellationToken(); const host = createServerHost([f1, config]); - const session = createSession(host, /*typingsInstaller*/ undefined, () => { }, cancellationToken); + const session = createSession(host, { + canUseEvents: true, + eventHandler: () => { }, + cancellationToken + }); { session.executeCommandSeq({ command: "open", @@ -3871,7 +3986,12 @@ namespace ts.projectSystem { }; const cancellationToken = new TestServerCancellationToken(/*cancelAfterRequest*/ 3); const host = createServerHost([f1, config]); - const session = createSession(host, /*typingsInstaller*/ undefined, () => { }, cancellationToken, /*throttleWaitMilliseconds*/ 0); + const session = createSession(host, { + canUseEvents: true, + eventHandler: () => { }, + cancellationToken, + throttleWaitMilliseconds: 0 + }); { session.executeCommandSeq({ command: "open", diff --git a/src/server/editorServices.ts b/src/server/editorServices.ts index 4ffdf5d6c5d99..e7e041711a9b0 100644 --- a/src/server/editorServices.ts +++ b/src/server/editorServices.ts @@ -323,6 +323,7 @@ namespace ts.server { logger: Logger; cancellationToken: HostCancellationToken; useSingleInferredProject: boolean; + useInferredProjectPerProjectRoot: boolean; typingsInstaller: ITypingsInstaller; eventHandler?: ProjectServiceEventHandler; throttleWaitMilliseconds?: number; @@ -364,7 +365,7 @@ namespace ts.server { readonly openFiles: ScriptInfo[] = []; private compilerOptionsForInferredProjects: CompilerOptions; - private compileOnSaveForInferredProjects: boolean; + private compilerOptionsForInferredProjectsPerProjectRoot = createMap(); private readonly projectToSizeMap: Map = createMap(); private readonly directoryWatchers: DirectoryWatchers; private readonly throttledOperations: ThrottledOperations; @@ -382,6 +383,7 @@ namespace ts.server { public readonly logger: Logger; public readonly cancellationToken: HostCancellationToken; public readonly useSingleInferredProject: boolean; + public readonly useInferredProjectPerProjectRoot: boolean; public readonly typingsInstaller: ITypingsInstaller; public readonly throttleWaitMilliseconds?: number; private readonly eventHandler?: ProjectServiceEventHandler; @@ -398,6 +400,7 @@ namespace ts.server { this.logger = opts.logger; this.cancellationToken = opts.cancellationToken; this.useSingleInferredProject = opts.useSingleInferredProject; + this.useInferredProjectPerProjectRoot = opts.useInferredProjectPerProjectRoot; this.typingsInstaller = opts.typingsInstaller || nullTypingsInstaller; this.throttleWaitMilliseconds = opts.throttleWaitMilliseconds; this.eventHandler = opts.eventHandler; @@ -463,17 +466,33 @@ namespace ts.server { project.updateGraph(); } - setCompilerOptionsForInferredProjects(projectCompilerOptions: protocol.ExternalProjectCompilerOptions): void { - this.compilerOptionsForInferredProjects = convertCompilerOptions(projectCompilerOptions); + setCompilerOptionsForInferredProjects(projectCompilerOptions: protocol.ExternalProjectCompilerOptions, projectRootPath?: string): void { + // ignore this settings if we are not creating inferred projects per project root. + if (projectRootPath && !this.useInferredProjectPerProjectRoot) return; + + const compilerOptionsForInferredProjects = convertCompilerOptions(projectCompilerOptions); + // always set 'allowNonTsExtensions' for inferred projects since user cannot configure it from the outside // previously we did not expose a way for user to change these settings and this option was enabled by default - this.compilerOptionsForInferredProjects.allowNonTsExtensions = true; - this.compileOnSaveForInferredProjects = projectCompilerOptions.compileOnSave; - for (const proj of this.inferredProjects) { - proj.setCompilerOptions(this.compilerOptionsForInferredProjects); - proj.compileOnSaveEnabled = projectCompilerOptions.compileOnSave; + compilerOptionsForInferredProjects.allowNonTsExtensions = true; + + if (projectRootPath) { + this.compilerOptionsForInferredProjectsPerProjectRoot.set(projectRootPath, compilerOptionsForInferredProjects); + } + else { + this.compilerOptionsForInferredProjects = compilerOptionsForInferredProjects; } - this.updateProjectGraphs(this.inferredProjects); + + const updatedProjects: Project[] = []; + for (const project of this.inferredProjects) { + if (project.projectRootPath === projectRootPath || (project.projectRootPath && !this.compilerOptionsForInferredProjectsPerProjectRoot.has(project.projectRootPath))) { + project.setCompilerOptions(compilerOptionsForInferredProjects); + project.compileOnSaveEnabled = compilerOptionsForInferredProjects.compileOnSave; + updatedProjects.push(project); + } + } + + this.updateProjectGraphs(updatedProjects); } stopWatchingDirectory(directory: string) { @@ -713,7 +732,7 @@ namespace ts.server { } } - private assignScriptInfoToInferredProjectIfNecessary(info: ScriptInfo, addToListOfOpenFiles: boolean): void { + private assignScriptInfoToInferredProjectIfNecessary(info: ScriptInfo, addToListOfOpenFiles: boolean, projectRootPath?: string): void { const externalProject = this.findContainingExternalProject(info.fileName); if (externalProject) { // file is already included in some external project - do nothing @@ -741,30 +760,30 @@ namespace ts.server { } if (info.containingProjects.length === 0) { - // create new inferred project p with the newly opened file as root - // or add root to existing inferred project if 'useOneInferredProject' is true - const inferredProject = this.createInferredProjectWithRootFileIfNecessary(info); - if (!this.useSingleInferredProject) { - // if useOneInferredProject is not set then try to fixup ownership of open files - // check 'defaultProject !== inferredProject' is necessary to handle cases - // when creation inferred project for some file has added other open files into this project (i.e. as referenced files) - // we definitely don't want to delete the project that was just created + // get (or create) an inferred project using the newly opened file as a root. + const inferredProject = this.createInferredProjectWithRootFileIfNecessary(info, projectRootPath); + if (!this.useSingleInferredProject && !inferredProject.projectRootPath) { + // if useSingleInferredProject is false and the inferred project is not associated + // with a project root, then try to repair the ownership of open files. for (const f of this.openFiles) { if (f.containingProjects.length === 0 || !inferredProject.containsScriptInfo(f)) { // this is orphaned file that we have not processed yet - skip it continue; } - for (const fContainingProject of f.containingProjects) { - if (fContainingProject.projectKind === ProjectKind.Inferred && - fContainingProject.isRoot(f) && - fContainingProject !== inferredProject) { - + for (const containingProject of f.containingProjects) { + // We verify 'containingProject !== inferredProject' to handle cases + // where the inferred project for some file has added other open files + // into this project (i.e. as referenced files) as we don't want to + // delete the project that was just created + if (containingProject.projectKind === ProjectKind.Inferred && + containingProject !== inferredProject && + containingProject.isRoot(f)) { // open file used to be root in inferred project, // this inferred project is different from the one we've just created for current file // and new inferred project references this open file. // We should delete old inferred project and attach open file to the new one - this.removeProject(fContainingProject); + this.removeProject(containingProject); f.attachToProject(inferredProject); } } @@ -1285,11 +1304,65 @@ namespace ts.server { return configFileErrors; } - createInferredProjectWithRootFileIfNecessary(root: ScriptInfo) { - const useExistingProject = this.useSingleInferredProject && this.inferredProjects.length; - const project = useExistingProject - ? this.inferredProjects[0] - : new InferredProject(this, this.documentRegistry, this.compilerOptionsForInferredProjects); + private getOrCreateInferredProjectForProjectRootPathIfEnabled(root: ScriptInfo, projectRootPath: string | undefined): InferredProject | undefined { + if (!this.useInferredProjectPerProjectRoot) { + return undefined; + } + + if (projectRootPath) { + // if we have an explicit project root path, find (or create) the matching inferred project. + for (const project of this.inferredProjects) { + if (project.projectRootPath === projectRootPath) { + return project; + } + } + return this.createInferredProject(/*isSingleInferredProject*/ false, projectRootPath); + } + + // we don't have an explicit root path, so we should try to find an inferred project that best matches the file. + let bestMatch: InferredProject; + for (const project of this.inferredProjects) { + // ignore single inferred projects (handled elsewhere) + if (!project.projectRootPath) continue; + // ignore inferred projects that don't contain the root's path + if (!containsPath(project.projectRootPath, root.path, this.host.getCurrentDirectory(), !this.host.useCaseSensitiveFileNames)) continue; + // ignore inferred projects that are higher up in the project root. + // TODO(rbuckton): Should we add the file as a root to these as well? + if (bestMatch && bestMatch.projectRootPath.length > project.projectRootPath.length) continue; + bestMatch = project; + } + + return bestMatch; + } + + private getOrCreateSingleInferredProjectIfEnabled(): InferredProject | undefined { + if (!this.useSingleInferredProject) { + return undefined; + } + + if (this.inferredProjects.length > 0 && this.inferredProjects[0].projectRootPath === undefined) { + return this.inferredProjects[0]; + } + + return this.createInferredProject(/*isSingleInferredProject*/ true); + } + + private createInferredProject(isSingleInferredProject?: boolean, projectRootPath?: string): InferredProject { + const compilerOptions = projectRootPath && this.compilerOptionsForInferredProjectsPerProjectRoot.get(projectRootPath) || this.compilerOptionsForInferredProjects; + const project = new InferredProject(this, this.documentRegistry, compilerOptions, projectRootPath); + if (isSingleInferredProject) { + this.inferredProjects.unshift(project); + } + else { + this.inferredProjects.push(project); + } + return project; + } + + createInferredProjectWithRootFileIfNecessary(root: ScriptInfo, projectRootPath?: string) { + const project = this.getOrCreateInferredProjectForProjectRootPathIfEnabled(root, projectRootPath) || + this.getOrCreateSingleInferredProjectIfEnabled() || + this.createInferredProject(); project.addRoot(root); @@ -1300,9 +1373,6 @@ namespace ts.server { project.updateGraph(); - if (!useExistingProject) { - this.inferredProjects.push(project); - } return project; } @@ -1476,7 +1546,7 @@ namespace ts.server { // at this point if file is the part of some configured/external project then this project should be created const info = this.getOrCreateScriptInfoForNormalizedPath(fileName, /*openedByClient*/ true, fileContent, scriptKind, hasMixedContent); - this.assignScriptInfoToInferredProjectIfNecessary(info, /*addToListOfOpenFiles*/ true); + this.assignScriptInfoToInferredProjectIfNecessary(info, /*addToListOfOpenFiles*/ true, projectRootPath); // Delete the orphan files here because there might be orphan script infos (which are not part of project) // when some file/s were closed which resulted in project removal. // It was then postponed to cleanup these script infos so that they can be reused if diff --git a/src/server/project.ts b/src/server/project.ts index 524b6c4d28d3d..7f02b0ec84d55 100644 --- a/src/server/project.ts +++ b/src/server/project.ts @@ -836,6 +836,7 @@ namespace ts.server { * the file and its imports/references are put into an InferredProject. */ export class InferredProject extends Project { + public readonly projectRootPath: string | undefined; private static readonly newName = (() => { let nextId = 1; @@ -875,7 +876,7 @@ namespace ts.server { // Used to keep track of what directories are watched for this project directoriesWatchedForTsconfig: string[] = []; - constructor(projectService: ProjectService, documentRegistry: DocumentRegistry, compilerOptions: CompilerOptions) { + constructor(projectService: ProjectService, documentRegistry: DocumentRegistry, compilerOptions: CompilerOptions, projectRootPath?: string) { super(InferredProject.newName(), ProjectKind.Inferred, projectService, @@ -884,6 +885,7 @@ namespace ts.server { /*languageServiceEnabled*/ true, compilerOptions, /*compileOnSaveEnabled*/ false); + this.projectRootPath = projectRootPath; } addRoot(info: ScriptInfo) { diff --git a/src/server/protocol.ts b/src/server/protocol.ts index b6756a7d4ff11..c0760dbfd3898 100644 --- a/src/server/protocol.ts +++ b/src/server/protocol.ts @@ -1304,6 +1304,13 @@ namespace ts.server.protocol { * Compiler options to be used with inferred projects. */ options: ExternalProjectCompilerOptions; + + /** + * Specifies the project root path used to scope commpiler options. + * This message is ignored if this property has been specified and the server is not + * configured to create an inferred project per project root. + */ + projectRootPath?: string; } /** diff --git a/src/server/server.ts b/src/server/server.ts index 6600b63dcb1bf..9026a624bb8b9 100644 --- a/src/server/server.ts +++ b/src/server/server.ts @@ -9,6 +9,7 @@ namespace ts.server { canUseEvents: boolean; installerEventPort: number; useSingleInferredProject: boolean; + useInferredProjectPerProjectRoot: boolean; disableAutomaticTypingAcquisition: boolean; globalTypingsCacheLocation: string; logger: Logger; @@ -410,6 +411,7 @@ namespace ts.server { host, cancellationToken, useSingleInferredProject, + useInferredProjectPerProjectRoot, typingsInstaller: typingsInstaller || nullTypingsInstaller, byteLength: Buffer.byteLength, hrtime: process.hrtime, @@ -765,6 +767,7 @@ namespace ts.server { const allowLocalPluginLoads = hasArgument("--allowLocalPluginLoads"); const useSingleInferredProject = hasArgument("--useSingleInferredProject"); + const useInferredProjectPerProjectRoot = hasArgument("--useInferredProjectPerProjectRoot"); const disableAutomaticTypingAcquisition = hasArgument("--disableAutomaticTypingAcquisition"); const telemetryEnabled = hasArgument(Arguments.EnableTelemetry); @@ -774,6 +777,7 @@ namespace ts.server { installerEventPort: eventPort, canUseEvents: eventPort === undefined, useSingleInferredProject, + useInferredProjectPerProjectRoot, disableAutomaticTypingAcquisition, globalTypingsCacheLocation: getGlobalTypingsCacheLocation(), typingSafeListLocation, diff --git a/src/server/session.ts b/src/server/session.ts index 074ba4d6ca1b9..cf27bbc6133aa 100644 --- a/src/server/session.ts +++ b/src/server/session.ts @@ -251,6 +251,7 @@ namespace ts.server { host: ServerHost; cancellationToken: ServerCancellationToken; useSingleInferredProject: boolean; + useInferredProjectPerProjectRoot: boolean; typingsInstaller: ITypingsInstaller; byteLength: (buf: string, encoding?: string) => number; hrtime: (start?: number[]) => number[]; @@ -311,6 +312,7 @@ namespace ts.server { logger: this.logger, cancellationToken: this.cancellationToken, useSingleInferredProject: opts.useSingleInferredProject, + useInferredProjectPerProjectRoot: opts.useInferredProjectPerProjectRoot, typingsInstaller: this.typingsInstaller, throttleWaitMilliseconds, eventHandler: this.eventHandler, @@ -744,7 +746,7 @@ namespace ts.server { } private setCompilerOptionsForInferredProjects(args: protocol.SetCompilerOptionsForInferredProjectsArgs): void { - this.projectService.setCompilerOptionsForInferredProjects(args.options); + this.projectService.setCompilerOptionsForInferredProjects(args.options, args.projectRootPath); } private getProjectInfo(args: protocol.ProjectInfoRequestArgs): protocol.ProjectInfo { From b747c2dd96ede26c853dee1d8882d73bb6d8ddf8 Mon Sep 17 00:00:00 2001 From: Ron Buckton Date: Thu, 3 Aug 2017 18:30:09 -0700 Subject: [PATCH 042/237] exclude node_modules unless explicitly included --- src/compiler/commandLineParser.ts | 6 +- src/compiler/core.ts | 101 ++++++--- src/harness/unittests/matchFiles.ts | 193 ++++++++++++------ .../nodeModulesMaxDepthExceeded.errors.txt | 2 +- .../nodeModulesMaxDepthExceeded.errors.txt | 2 +- .../maxDepthExceeded/tsconfig.json | 2 +- 6 files changed, 200 insertions(+), 106 deletions(-) diff --git a/src/compiler/commandLineParser.ts b/src/compiler/commandLineParser.ts index 554b46dcdfe3e..b0cb7f940292f 100644 --- a/src/compiler/commandLineParser.ts +++ b/src/compiler/commandLineParser.ts @@ -1446,14 +1446,10 @@ namespace ts { } } else { - // If no includes were specified, exclude common package folders and the outDir - const specs = includeSpecs ? [] : ["node_modules", "bower_components", "jspm_packages"]; - const outDir = raw["compilerOptions"] && raw["compilerOptions"]["outDir"]; if (outDir) { - specs.push(outDir); + excludeSpecs = [outDir]; } - excludeSpecs = specs; } if (fileNames === undefined && includeSpecs === undefined) { diff --git a/src/compiler/core.ts b/src/compiler/core.ts index 728fb433c049b..07f979333b636 100644 --- a/src/compiler/core.ts +++ b/src/compiler/core.ts @@ -1889,14 +1889,54 @@ namespace ts { const reservedCharacterPattern = /[^\w\s\/]/g; const wildcardCharCodes = [CharacterCodes.asterisk, CharacterCodes.question]; - /** - * Matches any single directory segment unless it is the last segment and a .min.js file - * Breakdown: - * [^./] # matches everything up to the first . character (excluding directory seperators) - * (\\.(?!min\\.js$))? # matches . characters but not if they are part of the .min.js file extension - */ - const singleAsteriskRegexFragmentFiles = "([^./]|(\\.(?!min\\.js$))?)*"; - const singleAsteriskRegexFragmentOther = "[^/]*"; + /* @internal */ + export const commonPackageFolders: ReadonlyArray = ["node_modules", "bower_components", "jspm_packages"]; + + const implicitExcludePathRegexPattern = `(?!(${commonPackageFolders.join("|")})(/|$))`; + + interface WildcardMatcher { + singleAsteriskRegexFragment: string; + doubleAsteriskRegexFragment: string; + replaceWildcardCharacter: (match: string) => string; + } + + const filesMatcher: WildcardMatcher = { + /** + * Matches any single directory segment unless it is the last segment and a .min.js file + * Breakdown: + * [^./] # matches everything up to the first . character (excluding directory seperators) + * (\\.(?!min\\.js$))? # matches . characters but not if they are part of the .min.js file extension + */ + singleAsteriskRegexFragment: "([^./]|(\\.(?!min\\.js$))?)*", + /** + * Regex for the ** wildcard. Matches any number of subdirectories. When used for including + * files or directories, does not match subdirectories that start with a . character + */ + doubleAsteriskRegexFragment: `(/${implicitExcludePathRegexPattern}[^/.][^/]*)*?`, + replaceWildcardCharacter: match => replaceWildcardCharacter(match, filesMatcher.singleAsteriskRegexFragment) + }; + + const directoriesMatcher: WildcardMatcher = { + singleAsteriskRegexFragment: "[^/]*", + /** + * Regex for the ** wildcard. Matches any number of subdirectories. When used for including + * files or directories, does not match subdirectories that start with a . character + */ + doubleAsteriskRegexFragment: `(/${implicitExcludePathRegexPattern}[^/.][^/]*)*?`, + replaceWildcardCharacter: match => replaceWildcardCharacter(match, directoriesMatcher.singleAsteriskRegexFragment) + }; + + const excludeMatcher: WildcardMatcher = { + singleAsteriskRegexFragment: "[^/]*", + doubleAsteriskRegexFragment: "(/.+?)?", + replaceWildcardCharacter: match => replaceWildcardCharacter(match, excludeMatcher.singleAsteriskRegexFragment) + }; + + const wildcardMatchers = { + files: filesMatcher, + directories: directoriesMatcher, + exclude: excludeMatcher + }; export function getRegularExpressionForWildcard(specs: ReadonlyArray, basePath: string, usage: "files" | "directories" | "exclude"): string | undefined { const patterns = getRegularExpressionsForWildcards(specs, basePath, usage); @@ -1915,17 +1955,8 @@ namespace ts { return undefined; } - const replaceWildcardCharacter = usage === "files" ? replaceWildCardCharacterFiles : replaceWildCardCharacterOther; - const singleAsteriskRegexFragment = usage === "files" ? singleAsteriskRegexFragmentFiles : singleAsteriskRegexFragmentOther; - - /** - * Regex for the ** wildcard. Matches any number of subdirectories. When used for including - * files or directories, does not match subdirectories that start with a . character - */ - const doubleAsteriskRegexFragment = usage === "exclude" ? "(/.+?)?" : "(/[^/.][^/]*)*?"; - return flatMap(specs, spec => - spec && getSubPatternFromSpec(spec, basePath, usage, singleAsteriskRegexFragment, doubleAsteriskRegexFragment, replaceWildcardCharacter)); + spec && getSubPatternFromSpec(spec, basePath, usage, wildcardMatchers[usage])); } /** @@ -1936,7 +1967,7 @@ namespace ts { return !/[.*?]/.test(lastPathComponent); } - function getSubPatternFromSpec(spec: string, basePath: string, usage: "files" | "directories" | "exclude", singleAsteriskRegexFragment: string, doubleAsteriskRegexFragment: string, replaceWildcardCharacter: (match: string) => string): string | undefined { + function getSubPatternFromSpec(spec: string, basePath: string, usage: "files" | "directories" | "exclude", { singleAsteriskRegexFragment, doubleAsteriskRegexFragment, replaceWildcardCharacter }: WildcardMatcher): string | undefined { let subpattern = ""; let hasRecursiveDirectoryWildcard = false; let hasWrittenComponent = false; @@ -1975,20 +2006,36 @@ namespace ts { } if (usage !== "exclude") { + let componentPattern = ""; // The * and ? wildcards should not match directories or files that start with . if they // appear first in a component. Dotted directories and files can be included explicitly // like so: **/.*/.* if (component.charCodeAt(0) === CharacterCodes.asterisk) { - subpattern += "([^./]" + singleAsteriskRegexFragment + ")?"; + componentPattern += "([^./]" + singleAsteriskRegexFragment + ")?"; component = component.substr(1); } else if (component.charCodeAt(0) === CharacterCodes.question) { - subpattern += "[^./]"; + componentPattern += "[^./]"; component = component.substr(1); } - } - subpattern += component.replace(reservedCharacterPattern, replaceWildcardCharacter); + componentPattern += component.replace(reservedCharacterPattern, replaceWildcardCharacter); + + // Patterns should not include subfolders like node_modules unless they are + // explicitly included as part of the path. + // + // As an optimization, if the component pattern is the same as the component, + // then there definitely were no wildcard characters and we do not need to + // add the exclusion pattern. + if (componentPattern !== component) { + subpattern += implicitExcludePathRegexPattern; + } + + subpattern += componentPattern; + } + else { + subpattern += component.replace(reservedCharacterPattern, replaceWildcardCharacter); + } } hasWrittenComponent = true; @@ -2002,14 +2049,6 @@ namespace ts { return subpattern; } - function replaceWildCardCharacterFiles(match: string) { - return replaceWildcardCharacter(match, singleAsteriskRegexFragmentFiles); - } - - function replaceWildCardCharacterOther(match: string) { - return replaceWildcardCharacter(match, singleAsteriskRegexFragmentOther); - } - function replaceWildcardCharacter(match: string, singleAsteriskRegexFragment: string) { return match === "*" ? singleAsteriskRegexFragment : match === "?" ? "[^/]" : "\\" + match; } diff --git a/src/harness/unittests/matchFiles.ts b/src/harness/unittests/matchFiles.ts index e04546719302a..71b1bfff11abb 100644 --- a/src/harness/unittests/matchFiles.ts +++ b/src/harness/unittests/matchFiles.ts @@ -73,6 +73,7 @@ namespace ts { "c:/dev/a.d.ts", "c:/dev/a.js", "c:/dev/b.ts", + "c:/dev/x/a.ts", "c:/dev/node_modules/a.ts", "c:/dev/bower_components/a.ts", "c:/dev/jspm_packages/a.ts" @@ -141,7 +142,8 @@ namespace ts { errors: [], fileNames: [ "c:/dev/a.ts", - "c:/dev/b.ts" + "c:/dev/b.ts", + "c:/dev/x/a.ts" ], wildcardDirectories: { "c:/dev": ts.WatchDirectoryFlags.Recursive @@ -462,7 +464,6 @@ namespace ts { }; validateMatches(expected, json, caseInsensitiveHost, caseInsensitiveBasePath); }); - it("same named declarations are excluded", () => { const json = { include: [ @@ -651,71 +652,127 @@ namespace ts { }; validateMatches(expected, json, caseInsensitiveHost, caseInsensitiveBasePath); }); - it("with common package folders and no exclusions", () => { - const json = { - include: [ - "**/a.ts" - ] - }; - const expected: ts.ParsedCommandLine = { - options: {}, - errors: [], - fileNames: [ - "c:/dev/a.ts", - "c:/dev/bower_components/a.ts", - "c:/dev/jspm_packages/a.ts", - "c:/dev/node_modules/a.ts" - ], - wildcardDirectories: { - "c:/dev": ts.WatchDirectoryFlags.Recursive - }, - }; - validateMatches(expected, json, caseInsensitiveCommonFoldersHost, caseInsensitiveBasePath); - }); - it("with common package folders and exclusions", () => { - const json = { - include: [ - "**/a.ts" - ], - exclude: [ - "a.ts" - ] - }; - const expected: ts.ParsedCommandLine = { - options: {}, - errors: [], - fileNames: [ - "c:/dev/bower_components/a.ts", - "c:/dev/jspm_packages/a.ts", - "c:/dev/node_modules/a.ts" - ], - wildcardDirectories: { - "c:/dev": ts.WatchDirectoryFlags.Recursive - }, - }; - validateMatches(expected, json, caseInsensitiveCommonFoldersHost, caseInsensitiveBasePath); - }); - it("with common package folders and empty exclude", () => { - const json = { - include: [ - "**/a.ts" - ], - exclude: [] - }; - const expected: ts.ParsedCommandLine = { - options: {}, - errors: [], - fileNames: [ - "c:/dev/a.ts", - "c:/dev/bower_components/a.ts", - "c:/dev/jspm_packages/a.ts", - "c:/dev/node_modules/a.ts" - ], - wildcardDirectories: { - "c:/dev": ts.WatchDirectoryFlags.Recursive - }, - }; - validateMatches(expected, json, caseInsensitiveCommonFoldersHost, caseInsensitiveBasePath); + describe("with common package folders", () => { + it("and no exclusions", () => { + const json = { + include: [ + "**/a.ts" + ] + }; + const expected: ts.ParsedCommandLine = { + options: {}, + errors: [], + fileNames: [ + "c:/dev/a.ts", + "c:/dev/x/a.ts" + ], + wildcardDirectories: { + "c:/dev": ts.WatchDirectoryFlags.Recursive + }, + }; + validateMatches(expected, json, caseInsensitiveCommonFoldersHost, caseInsensitiveBasePath); + }); + it("and exclusions", () => { + const json = { + include: [ + "**/?.ts" + ], + exclude: [ + "a.ts" + ] + }; + const expected: ts.ParsedCommandLine = { + options: {}, + errors: [], + fileNames: [ + "c:/dev/b.ts", + "c:/dev/x/a.ts" + ], + wildcardDirectories: { + "c:/dev": ts.WatchDirectoryFlags.Recursive + }, + }; + validateMatches(expected, json, caseInsensitiveCommonFoldersHost, caseInsensitiveBasePath); + }); + it("and empty exclude", () => { + const json = { + include: [ + "**/a.ts" + ], + exclude: [] + }; + const expected: ts.ParsedCommandLine = { + options: {}, + errors: [], + fileNames: [ + "c:/dev/a.ts", + "c:/dev/x/a.ts" + ], + wildcardDirectories: { + "c:/dev": ts.WatchDirectoryFlags.Recursive + }, + }; + validateMatches(expected, json, caseInsensitiveCommonFoldersHost, caseInsensitiveBasePath); + }); + it("and explicit recursive include", () => { + const json = { + include: [ + "**/a.ts", + "**/node_modules/a.ts" + ] + }; + const expected: ts.ParsedCommandLine = { + options: {}, + errors: [], + fileNames: [ + "c:/dev/a.ts", + "c:/dev/x/a.ts", + "c:/dev/node_modules/a.ts" + ], + wildcardDirectories: { + "c:/dev": ts.WatchDirectoryFlags.Recursive + }, + }; + validateMatches(expected, json, caseInsensitiveCommonFoldersHost, caseInsensitiveBasePath); + }); + it("and wildcard include", () => { + const json = { + include: [ + "*/a.ts" + ] + }; + const expected: ts.ParsedCommandLine = { + options: {}, + errors: [], + fileNames: [ + "c:/dev/x/a.ts" + ], + wildcardDirectories: { + "c:/dev": ts.WatchDirectoryFlags.Recursive + }, + }; + validateMatches(expected, json, caseInsensitiveCommonFoldersHost, caseInsensitiveBasePath); + }); + it("and explicit wildcard include", () => { + const json = { + include: [ + "*/a.ts", + "node_modules/a.ts" + ] + }; + const expected: ts.ParsedCommandLine = { + options: {}, + errors: [], + fileNames: [ + "c:/dev/x/a.ts", + "c:/dev/node_modules/a.ts" + ], + wildcardDirectories: { + "c:/dev": ts.WatchDirectoryFlags.Recursive + }, + }; + validateMatches(expected, json, caseInsensitiveCommonFoldersHost, caseInsensitiveBasePath); + }); }); it("exclude .js files when allowJs=false", () => { const json = { @@ -1066,6 +1123,7 @@ namespace ts { }; validateMatches(expected, json, caseInsensitiveHost, caseInsensitiveBasePath); }); + describe("with trailing recursive directory", () => { it("in includes", () => { const json = { @@ -1264,6 +1322,7 @@ namespace ts { }); }); }); + describe("with files or folders that begin with a .", () => { it("that are not explicitly included", () => { const json = { diff --git a/tests/baselines/reference/project/nodeModulesMaxDepthExceeded/amd/nodeModulesMaxDepthExceeded.errors.txt b/tests/baselines/reference/project/nodeModulesMaxDepthExceeded/amd/nodeModulesMaxDepthExceeded.errors.txt index a1b170ce6656b..bd2dd6231f38f 100644 --- a/tests/baselines/reference/project/nodeModulesMaxDepthExceeded/amd/nodeModulesMaxDepthExceeded.errors.txt +++ b/tests/baselines/reference/project/nodeModulesMaxDepthExceeded/amd/nodeModulesMaxDepthExceeded.errors.txt @@ -9,7 +9,7 @@ maxDepthExceeded/root.ts(4,4): error TS2540: Cannot assign to 'rel' because it i "maxNodeModuleJsDepth": 1, // Note: Module m1 is already included as a root file "outDir": "built" }, - "include": ["**/*"], + "include": ["**/*", "node_modules/**/*"], "exclude": ["node_modules/m2/**/*"] } diff --git a/tests/baselines/reference/project/nodeModulesMaxDepthExceeded/node/nodeModulesMaxDepthExceeded.errors.txt b/tests/baselines/reference/project/nodeModulesMaxDepthExceeded/node/nodeModulesMaxDepthExceeded.errors.txt index a1b170ce6656b..bd2dd6231f38f 100644 --- a/tests/baselines/reference/project/nodeModulesMaxDepthExceeded/node/nodeModulesMaxDepthExceeded.errors.txt +++ b/tests/baselines/reference/project/nodeModulesMaxDepthExceeded/node/nodeModulesMaxDepthExceeded.errors.txt @@ -9,7 +9,7 @@ maxDepthExceeded/root.ts(4,4): error TS2540: Cannot assign to 'rel' because it i "maxNodeModuleJsDepth": 1, // Note: Module m1 is already included as a root file "outDir": "built" }, - "include": ["**/*"], + "include": ["**/*", "node_modules/**/*"], "exclude": ["node_modules/m2/**/*"] } diff --git a/tests/cases/projects/NodeModulesSearch/maxDepthExceeded/tsconfig.json b/tests/cases/projects/NodeModulesSearch/maxDepthExceeded/tsconfig.json index 52633bb5a98f9..b2ee28482bab7 100644 --- a/tests/cases/projects/NodeModulesSearch/maxDepthExceeded/tsconfig.json +++ b/tests/cases/projects/NodeModulesSearch/maxDepthExceeded/tsconfig.json @@ -4,6 +4,6 @@ "maxNodeModuleJsDepth": 1, // Note: Module m1 is already included as a root file "outDir": "built" }, - "include": ["**/*"], + "include": ["**/*", "node_modules/**/*"], "exclude": ["node_modules/m2/**/*"] } From 777bc575ac8117994acd34c9716854c40c92c59e Mon Sep 17 00:00:00 2001 From: Arthur Ozga Date: Fri, 4 Aug 2017 15:51:06 -0700 Subject: [PATCH 043/237] implementation comment --- src/services/formatting/formatting.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/services/formatting/formatting.ts b/src/services/formatting/formatting.ts index c4c4bad5de886..fbda42d3840d7 100644 --- a/src/services/formatting/formatting.ts +++ b/src/services/formatting/formatting.ts @@ -1168,6 +1168,14 @@ namespace ts.formatting { } export function getRangeOfEnclosingComment(sourceFile: SourceFile, position: number, onlyMultiLine: boolean): CommentRange | undefined { + // Considering a fixed position, + // - trailing comments are those following and on the same line as the position. + // - leading comments are those in the range [position, start of next non-trivia token) + // that are not trailing comments of that position. + // + // Note, `node.start` is the start-position of the first comment following the previous + // token that is not a trailing comment, so the leading and trailing comments of all + // tokens contain all comments in a sourcefile disjointly. const precedingToken = findPrecedingToken(position, sourceFile); const trailingRangesOfPreviousToken = precedingToken && getTrailingCommentRanges(sourceFile.text, precedingToken.end); const leadingCommentRangesOfNextToken = getLeadingCommentRangesOfNode(getTokenAtPosition(sourceFile, position, /*includeJsDocComment*/ false), sourceFile); From c7f665faa165b02345b8be22b12ff747425a67e6 Mon Sep 17 00:00:00 2001 From: Ryan Cavanaugh Date: Fri, 4 Aug 2017 16:10:33 -0700 Subject: [PATCH 044/237] Extract Method (squash) --- .vscode/tasks.json | 7 + Jakefile.js | 1 + src/compiler/checker.ts | 7 +- src/compiler/diagnosticMessages.json | 10 + src/compiler/transformers/es2015.ts | 2 +- src/compiler/types.ts | 3 +- src/compiler/utilities.ts | 49 +- src/harness/fourslash.ts | 95 +- src/harness/unittests/extractMethods.ts | 591 +++++++++ src/services/codefixes/importFixes.ts | 2 +- .../refactors/convertFunctionToEs6Class.ts | 2 +- src/services/refactors/extractMethod.ts | 1154 +++++++++++++++++ src/services/refactors/refactors.ts | 1 + src/services/textChanges.ts | 170 ++- src/services/types.ts | 1 - .../reference/extractMethod/extractMethod1.js | 98 ++ .../extractMethod/extractMethod10.js | 55 + .../extractMethod/extractMethod11.js | 69 + .../extractMethod/extractMethod12.js | 36 + .../reference/extractMethod/extractMethod2.js | 85 ++ .../reference/extractMethod/extractMethod3.js | 80 ++ .../reference/extractMethod/extractMethod4.js | 90 ++ .../reference/extractMethod/extractMethod5.js | 98 ++ .../reference/extractMethod/extractMethod6.js | 101 ++ .../reference/extractMethod/extractMethod7.js | 111 ++ .../reference/extractMethod/extractMethod8.js | 65 + .../reference/extractMethod/extractMethod9.js | 65 + tests/baselines/reference/extractMethod1.js | 98 ++ tests/baselines/reference/extractMethod10.js | 70 + tests/baselines/reference/extractMethod11.js | 86 ++ tests/baselines/reference/extractMethod12.js | 36 + tests/baselines/reference/extractMethod2.js | 85 ++ tests/baselines/reference/extractMethod3.js | 80 ++ tests/baselines/reference/extractMethod4.js | 90 ++ tests/baselines/reference/extractMethod5.js | 98 ++ tests/baselines/reference/extractMethod6.js | 101 ++ tests/baselines/reference/extractMethod7.js | 111 ++ tests/baselines/reference/extractMethod8.js | 57 + tests/baselines/reference/extractMethod9.js | 65 + .../completionListIsGlobalCompletion.ts | 2 +- tests/cases/fourslash/extract-method1.ts | 33 + tests/cases/fourslash/extract-method10.ts | 6 + tests/cases/fourslash/extract-method11.ts | 28 + tests/cases/fourslash/extract-method13.ts | 30 + tests/cases/fourslash/extract-method14.ts | 24 + tests/cases/fourslash/extract-method15.ts | 22 + tests/cases/fourslash/extract-method17.ts | 10 + tests/cases/fourslash/extract-method18.ts | 21 + tests/cases/fourslash/extract-method19.ts | 22 + tests/cases/fourslash/extract-method2.ts | 28 + tests/cases/fourslash/extract-method20.ts | 14 + tests/cases/fourslash/extract-method21.ts | 25 + tests/cases/fourslash/extract-method22.ts | 10 + tests/cases/fourslash/extract-method23.ts | 8 + tests/cases/fourslash/extract-method24.ts | 19 + tests/cases/fourslash/extract-method3.ts | 18 + tests/cases/fourslash/extract-method4.ts | 14 + tests/cases/fourslash/extract-method5.ts | 20 + tests/cases/fourslash/extract-method6.ts | 16 + tests/cases/fourslash/extract-method7.ts | 16 + tests/cases/fourslash/extract-method8.ts | 17 + tests/cases/fourslash/extract-method9.ts | 11 + tests/cases/fourslash/fourslash.ts | 5 + 63 files changed, 4367 insertions(+), 77 deletions(-) create mode 100644 src/harness/unittests/extractMethods.ts create mode 100644 src/services/refactors/extractMethod.ts create mode 100644 tests/baselines/reference/extractMethod/extractMethod1.js create mode 100644 tests/baselines/reference/extractMethod/extractMethod10.js create mode 100644 tests/baselines/reference/extractMethod/extractMethod11.js create mode 100644 tests/baselines/reference/extractMethod/extractMethod12.js create mode 100644 tests/baselines/reference/extractMethod/extractMethod2.js create mode 100644 tests/baselines/reference/extractMethod/extractMethod3.js create mode 100644 tests/baselines/reference/extractMethod/extractMethod4.js create mode 100644 tests/baselines/reference/extractMethod/extractMethod5.js create mode 100644 tests/baselines/reference/extractMethod/extractMethod6.js create mode 100644 tests/baselines/reference/extractMethod/extractMethod7.js create mode 100644 tests/baselines/reference/extractMethod/extractMethod8.js create mode 100644 tests/baselines/reference/extractMethod/extractMethod9.js create mode 100644 tests/baselines/reference/extractMethod1.js create mode 100644 tests/baselines/reference/extractMethod10.js create mode 100644 tests/baselines/reference/extractMethod11.js create mode 100644 tests/baselines/reference/extractMethod12.js create mode 100644 tests/baselines/reference/extractMethod2.js create mode 100644 tests/baselines/reference/extractMethod3.js create mode 100644 tests/baselines/reference/extractMethod4.js create mode 100644 tests/baselines/reference/extractMethod5.js create mode 100644 tests/baselines/reference/extractMethod6.js create mode 100644 tests/baselines/reference/extractMethod7.js create mode 100644 tests/baselines/reference/extractMethod8.js create mode 100644 tests/baselines/reference/extractMethod9.js create mode 100644 tests/cases/fourslash/extract-method1.ts create mode 100644 tests/cases/fourslash/extract-method10.ts create mode 100644 tests/cases/fourslash/extract-method11.ts create mode 100644 tests/cases/fourslash/extract-method13.ts create mode 100644 tests/cases/fourslash/extract-method14.ts create mode 100644 tests/cases/fourslash/extract-method15.ts create mode 100644 tests/cases/fourslash/extract-method17.ts create mode 100644 tests/cases/fourslash/extract-method18.ts create mode 100644 tests/cases/fourslash/extract-method19.ts create mode 100644 tests/cases/fourslash/extract-method2.ts create mode 100644 tests/cases/fourslash/extract-method20.ts create mode 100644 tests/cases/fourslash/extract-method21.ts create mode 100644 tests/cases/fourslash/extract-method22.ts create mode 100644 tests/cases/fourslash/extract-method23.ts create mode 100644 tests/cases/fourslash/extract-method24.ts create mode 100644 tests/cases/fourslash/extract-method3.ts create mode 100644 tests/cases/fourslash/extract-method4.ts create mode 100644 tests/cases/fourslash/extract-method5.ts create mode 100644 tests/cases/fourslash/extract-method6.ts create mode 100644 tests/cases/fourslash/extract-method7.ts create mode 100644 tests/cases/fourslash/extract-method8.ts create mode 100644 tests/cases/fourslash/extract-method9.ts diff --git a/.vscode/tasks.json b/.vscode/tasks.json index f3c59a6171768..31928f73ce217 100644 --- a/.vscode/tasks.json +++ b/.vscode/tasks.json @@ -18,6 +18,13 @@ "problemMatcher": [ "$tsc" ] + }, + { + "taskName": "tests", + "showOutput": "silent", + "problemMatcher": [ + "$tsc" + ] } ] } \ No newline at end of file diff --git a/Jakefile.js b/Jakefile.js index 31243f77c4284..3f4439a8cb7fa 100644 --- a/Jakefile.js +++ b/Jakefile.js @@ -133,6 +133,7 @@ var harnessSources = harnessCoreSources.concat([ "projectErrors.ts", "matchFiles.ts", "initializeTSConfig.ts", + "extractMethods.ts", "printer.ts", "textChanges.ts", "telemetry.ts", diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 1c0f15e27aa5b..68546b7ff9f41 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -223,11 +223,10 @@ namespace ts { getSuggestionForNonexistentProperty: (node, type) => unescapeLeadingUnderscores(getSuggestionForNonexistentProperty(node, type)), getSuggestionForNonexistentSymbol: (location, name, meaning) => unescapeLeadingUnderscores(getSuggestionForNonexistentSymbol(location, escapeLeadingUnderscores(name), meaning)), getBaseConstraintOfType, - getJsxNamespace: () => unescapeLeadingUnderscores(getJsxNamespace()), - resolveNameAtLocation(location: Node, name: string, meaning: SymbolFlags): Symbol | undefined { - location = getParseTreeNode(location); - return resolveName(location, escapeLeadingUnderscores(name), meaning, /*nameNotFoundMessage*/ undefined, escapeLeadingUnderscores(name)); + resolveName(name, location, meaning) { + return resolveName(location, name as __String, meaning, /*nameNotFoundMessage*/ undefined, /*nameArg*/ undefined); }, + getJsxNamespace: () => unescapeLeadingUnderscores(getJsxNamespace()), }; const tupleTypes: GenericType[] = []; diff --git a/src/compiler/diagnosticMessages.json b/src/compiler/diagnosticMessages.json index 3b4b0ddf66711..34742a57ed16b 100644 --- a/src/compiler/diagnosticMessages.json +++ b/src/compiler/diagnosticMessages.json @@ -3673,5 +3673,15 @@ "Convert function '{0}' to class": { "category": "Message", "code": 95002 + }, + + "Extract function": { + "category": "Message", + "code": 95003 + }, + + "Extract function into '{0}'": { + "category": "Message", + "code": 95004 } } diff --git a/src/compiler/transformers/es2015.ts b/src/compiler/transformers/es2015.ts index f97de018d4ad0..da827d7b63e9d 100644 --- a/src/compiler/transformers/es2015.ts +++ b/src/compiler/transformers/es2015.ts @@ -394,7 +394,7 @@ namespace ts { function shouldVisitNode(node: Node): boolean { return (node.transformFlags & TransformFlags.ContainsES2015) !== 0 || convertedLoopState !== undefined - || (hierarchyFacts & HierarchyFacts.ConstructorWithCapturedSuper && isStatement(node)) + || (hierarchyFacts & HierarchyFacts.ConstructorWithCapturedSuper && isStatementOrBlock(node)) || (isIterationStatement(node, /*lookInLabeledStatements*/ false) && shouldConvertIterationStatementBody(node)) || isTypeScriptClassWrapper(node); } diff --git a/src/compiler/types.ts b/src/compiler/types.ts index 09f1b5cfcc53c..fd7bb665e7281 100644 --- a/src/compiler/types.ts +++ b/src/compiler/types.ts @@ -2606,9 +2606,8 @@ namespace ts { * Does not include properties of primitive types. */ /* @internal */ getAllPossiblePropertiesOfType(type: Type): Symbol[]; - + /* @internal */ resolveName(name: string, location: Node, meaning: SymbolFlags): Symbol | undefined; /* @internal */ getJsxNamespace(): string; - /* @internal */ resolveNameAtLocation(location: Node, name: string, meaning: SymbolFlags): Symbol | undefined; } export enum NodeBuilderFlags { diff --git a/src/compiler/utilities.ts b/src/compiler/utilities.ts index 76d242e8b08d8..619966725a7cb 100644 --- a/src/compiler/utilities.ts +++ b/src/compiler/utilities.ts @@ -693,7 +693,7 @@ namespace ts { // At this point, node is either a qualified name or an identifier Debug.assert(node.kind === SyntaxKind.Identifier || node.kind === SyntaxKind.QualifiedName || node.kind === SyntaxKind.PropertyAccessExpression, "'node' was expected to be a qualified name, identifier or property access in 'isPartOfTypeNode'."); - // falls through + // falls through case SyntaxKind.QualifiedName: case SyntaxKind.PropertyAccessExpression: case SyntaxKind.ThisKeyword: @@ -968,7 +968,7 @@ namespace ts { if (!includeArrowFunctions) { continue; } - // falls through + // falls through case SyntaxKind.FunctionDeclaration: case SyntaxKind.FunctionExpression: case SyntaxKind.ModuleDeclaration: @@ -1027,7 +1027,7 @@ namespace ts { if (!stopOnFunctions) { continue; } - // falls through + // falls through case SyntaxKind.PropertyDeclaration: case SyntaxKind.PropertySignature: case SyntaxKind.MethodDeclaration: @@ -1211,7 +1211,7 @@ namespace ts { if (node.parent.kind === SyntaxKind.TypeQuery || isJSXTagName(node)) { return true; } - // falls through + // falls through case SyntaxKind.NumericLiteral: case SyntaxKind.StringLiteral: case SyntaxKind.ThisKeyword: @@ -1499,8 +1499,8 @@ namespace ts { parent.parent.kind === SyntaxKind.VariableStatement; const variableStatementNode = isInitializerOfVariableDeclarationInStatement ? parent.parent.parent : - isVariableOfVariableDeclarationStatement ? parent.parent : - undefined; + isVariableOfVariableDeclarationStatement ? parent.parent : + undefined; if (variableStatementNode) { getJSDocCommentsAndTagsWorker(variableStatementNode); } @@ -1614,7 +1614,7 @@ namespace ts { if (isInJavaScriptFile(node)) { if (node.type && node.type.kind === SyntaxKind.JSDocVariadicType || forEach(getJSDocParameterTags(node), - t => t.typeExpression && t.typeExpression.type.kind === SyntaxKind.JSDocVariadicType)) { + t => t.typeExpression && t.typeExpression.type.kind === SyntaxKind.JSDocVariadicType)) { return true; } } @@ -1907,7 +1907,7 @@ namespace ts { if (node.asteriskToken) { flags |= FunctionFlags.Generator; } - // falls through + // falls through case SyntaxKind.ArrowFunction: if (hasModifier(node, ModifierFlags.Async)) { flags |= FunctionFlags.Async; @@ -5123,6 +5123,19 @@ namespace ts { return isUnaryExpressionKind(skipPartiallyEmittedExpressions(node).kind); } + /* @internal */ + export function isUnaryExpressionWithWrite(expr: Node): expr is PrefixUnaryExpression | PostfixUnaryExpression { + switch (expr.kind) { + case SyntaxKind.PostfixUnaryExpression: + return true; + case SyntaxKind.PrefixUnaryExpression: + return (expr).operator === SyntaxKind.PlusPlusToken || + (expr).operator === SyntaxKind.MinusMinusToken; + default: + return false; + } + } + function isExpressionKind(kind: SyntaxKind) { return kind === SyntaxKind.ConditionalExpression || kind === SyntaxKind.YieldExpression @@ -5337,7 +5350,25 @@ namespace ts { const kind = node.kind; return isStatementKindButNotDeclarationKind(kind) || isDeclarationStatementKind(kind) - || kind === SyntaxKind.Block; + || isBlockStatement(node); + } + + /* @internal */ + export function isStatementOrBlock(node: Node): node is Statement { + const kind = node.kind; + return isStatementKindButNotDeclarationKind(kind) + || isDeclarationStatementKind(kind) + || node.kind === SyntaxKind.Block; + } + + function isBlockStatement(node: Node): node is Block { + if (node.kind !== SyntaxKind.Block) return false; + if (node.parent !== undefined) { + if (node.parent.kind === SyntaxKind.TryStatement || node.parent.kind === SyntaxKind.CatchClause) { + return false; + } + } + return !isFunctionBlock(node); } // Module references diff --git a/src/harness/fourslash.ts b/src/harness/fourslash.ts index c6ec0f257b606..7f8ded3e2599b 100644 --- a/src/harness/fourslash.ts +++ b/src/harness/fourslash.ts @@ -187,6 +187,9 @@ namespace FourSlash { // The current caret position in the active file public currentCaretPosition = 0; + // The position of the end of the current selection, or -1 if nothing is selected + public selectionEnd = -1; + public lastKnownMarker = ""; // The file that's currently 'opened' @@ -433,11 +436,19 @@ namespace FourSlash { public goToPosition(pos: number) { this.currentCaretPosition = pos; + this.selectionEnd = -1; + } + + public select(startMarker: string, endMarker: string) { + const start = this.getMarkerByName(startMarker), end = this.getMarkerByName(endMarker); + this.goToPosition(start.position); + this.selectionEnd = end.position; } public moveCaretRight(count = 1) { this.currentCaretPosition += count; this.currentCaretPosition = Math.min(this.currentCaretPosition, this.getFileContent(this.activeFile.fileName).length); + this.selectionEnd = -1; } // Opens a file given its 0-based index or fileName @@ -980,9 +991,9 @@ namespace FourSlash { } for (const reference of expectedReferences) { - const {fileName, start, end} = reference; + const { fileName, start, end } = reference; if (reference.marker && reference.marker.data) { - const {isWriteAccess, isDefinition} = reference.marker.data; + const { isWriteAccess, isDefinition } = reference.marker.data; this.verifyReferencesWorker(actualReferences, fileName, start, end, isWriteAccess, isDefinition); } else { @@ -1193,7 +1204,7 @@ namespace FourSlash { displayParts: ts.SymbolDisplayPart[], documentation: ts.SymbolDisplayPart[], tags: ts.JSDocTagInfo[] - ) { + ) { const actualQuickInfo = this.languageService.getQuickInfoAtPosition(this.activeFile.fileName, this.currentCaretPosition); assert.equal(actualQuickInfo.kind, kind, this.messageAtLastKnownMarker("QuickInfo kind")); @@ -1789,19 +1800,16 @@ namespace FourSlash { // We get back a set of edits, but langSvc.editScript only accepts one at a time. Use this to keep track // of the incremental offset from each edit to the next. We assume these edit ranges don't overlap - edits = edits.sort((a, b) => a.span.start - b.span.start); - for (let i = 0; i < edits.length - 1; i++) { - const firstEditSpan = edits[i].span; - const firstEditEnd = firstEditSpan.start + firstEditSpan.length; - assert.isTrue(firstEditEnd <= edits[i + 1].span.start); - } + // Copy this so we don't ruin someone else's copy + edits = JSON.parse(JSON.stringify(edits)); // Get a snapshot of the content of the file so we can make sure any formatting edits didn't destroy non-whitespace characters const oldContent = this.getFileContent(fileName); let runningOffset = 0; - for (const edit of edits) { - const offsetStart = edit.span.start + runningOffset; + for (let i = 0; i < edits.length; i++) { + const edit = edits[i]; + const offsetStart = edit.span.start; const offsetEnd = offsetStart + edit.span.length; this.editScriptAndUpdateMarkers(fileName, offsetStart, offsetEnd, edit.newText); const editDelta = edit.newText.length - edit.span.length; @@ -1816,8 +1824,13 @@ namespace FourSlash { } } runningOffset += editDelta; - // TODO: Consider doing this at least some of the time for higher fidelity. Currently causes a failure (bug 707150) - // this.languageService.getScriptLexicalStructure(fileName); + + // Update positions of any future edits affected by this change + for (let j = i + 1; j < edits.length; j++) { + if (edits[j].span.start >= edits[i].span.start) { + edits[j].span.start += editDelta; + } + } } if (isFormattingEdit) { @@ -1901,7 +1914,7 @@ namespace FourSlash { this.goToPosition(len); } - public goToRangeStart({fileName, start}: Range) { + public goToRangeStart({ fileName, start }: Range) { this.openFile(fileName); this.goToPosition(start); } @@ -2075,7 +2088,7 @@ namespace FourSlash { return result; } - private rangeText({fileName, start, end}: Range): string { + private rangeText({ fileName, start, end }: Range): string { return this.getFileContent(fileName).slice(start, end); } @@ -2361,7 +2374,7 @@ namespace FourSlash { private applyCodeActions(actions: ts.CodeAction[], index?: number): void { if (index === undefined) { if (!(actions && actions.length === 1)) { - this.raiseError(`Should find exactly one codefix, but ${actions ? actions.length : "none"} found. ${actions ? actions.map(a => `${Harness.IO.newLine()} "${a.description}"`) : "" }`); + this.raiseError(`Should find exactly one codefix, but ${actions ? actions.length : "none"} found. ${actions ? actions.map(a => `${Harness.IO.newLine()} "${a.description}"`) : ""}`); } index = 0; } @@ -2736,6 +2749,30 @@ namespace FourSlash { } } + private getSelection() { + return ({ + pos: this.currentCaretPosition, + end: this.selectionEnd === -1 ? this.currentCaretPosition : this.selectionEnd + }); + } + + public verifyRefactorAvailable(negative: boolean, name?: string, subName?: string) { + const selection = this.getSelection(); + + let refactors = this.languageService.getApplicableRefactors(this.activeFile.fileName, selection) || []; + if (name) { + refactors = refactors.filter(r => r.name === name && (subName === undefined || r.actions.some(a => a.name === subName))); + } + const isAvailable = refactors.length > 0; + + if (negative && isAvailable) { + this.raiseError(`verifyApplicableRefactorAvailableForRange failed - expected no refactor but found some.`); + } + else if (!negative && !isAvailable) { + this.raiseError(`verifyApplicableRefactorAvailableForRange failed - expected a refactor but found none.`); + } + } + public verifyApplicableRefactorAvailableForRange(negative: boolean) { const ranges = this.getRanges(); if (!(ranges && ranges.length === 1)) { @@ -2752,6 +2789,20 @@ namespace FourSlash { } } + public applyRefactor(refactorName: string, actionName: string) { + const range = this.getSelection(); + const refactors = this.languageService.getApplicableRefactors(this.activeFile.fileName, range); + const refactor = ts.find(refactors, r => r.name === refactorName); + if (!refactor) { + this.raiseError(`The expected refactor: ${refactorName} is not available at the marker location.`); + } + + const editInfo = this.languageService.getEditsForRefactor(this.activeFile.fileName, this.formatCodeSettings, range, refactorName, actionName); + for (const edit of editInfo.edits) { + this.applyEdits(edit.fileName, edit.textChanges, /*isFormattingEdit*/ false); + } + } + public verifyFileAfterApplyingRefactorAtMarker( markerName: string, expectedContent: string, @@ -3496,6 +3547,10 @@ namespace FourSlashInterface { public file(indexOrName: any, content?: string, scriptKindName?: string): void { this.state.openFile(indexOrName, content, scriptKindName); } + + public select(startMarker: string, endMarker: string) { + this.state.select(startMarker, endMarker); + } } export class VerifyNegatable { @@ -3617,6 +3672,10 @@ namespace FourSlashInterface { public applicableRefactorAvailableForRange() { this.state.verifyApplicableRefactorAvailableForRange(this.negative); } + + public refactorAvailable(name?: string, subName?: string) { + this.state.verifyRefactorAvailable(this.negative, name, subName); + } } export class Verify extends VerifyNegatable { @@ -4012,6 +4071,10 @@ namespace FourSlashInterface { public disableFormatting() { this.state.enableFormatting = false; } + + public applyRefactor(refactorName: string, actionName: string) { + this.state.applyRefactor(refactorName, actionName); + } } export class Debug { diff --git a/src/harness/unittests/extractMethods.ts b/src/harness/unittests/extractMethods.ts new file mode 100644 index 0000000000000..4b5d1911b4914 --- /dev/null +++ b/src/harness/unittests/extractMethods.ts @@ -0,0 +1,591 @@ +/// +/// + +namespace ts { + interface Range { + start: number; + end: number; + name: string; + } + + interface Test { + source: string; + ranges: Map; + } + + function extractTest(source: string): Test { + const activeRanges: Range[] = []; + let text = ""; + let lastPos = 0; + let pos = 0; + const ranges = createMap(); + + while (pos < source.length) { + if (source.charCodeAt(pos) === CharacterCodes.openBracket && + (source.charCodeAt(pos + 1) === CharacterCodes.hash || source.charCodeAt(pos + 1) === CharacterCodes.$)) { + const saved = pos; + pos += 2; + const s = pos; + consumeIdentifier(); + const e = pos; + if (source.charCodeAt(pos) === CharacterCodes.bar) { + pos++; + text += source.substring(lastPos, saved); + const name = s === e + ? source.charCodeAt(saved + 1) === CharacterCodes.hash ? "selection" : "extracted" + : source.substring(s, e); + activeRanges.push({ name, start: text.length, end: undefined }); + lastPos = pos; + continue; + } + else { + pos = saved; + } + } + else if (source.charCodeAt(pos) === CharacterCodes.bar && source.charCodeAt(pos + 1) === CharacterCodes.closeBracket) { + text += source.substring(lastPos, pos); + activeRanges[activeRanges.length - 1].end = text.length; + const range = activeRanges.pop(); + if (range.name in ranges) { + throw new Error(`Duplicate name of range ${range.name}`); + } + ranges.set(range.name, range); + pos += 2; + lastPos = pos; + continue; + } + pos++; + } + text += source.substring(lastPos, pos); + + function consumeIdentifier() { + while (isIdentifierPart(source.charCodeAt(pos), ScriptTarget.Latest)) { + pos++; + } + } + return { source: text, ranges }; + } + + const newLineCharacter = "\n"; + function getRuleProvider(action?: (opts: FormatCodeSettings) => void) { + const options = { + indentSize: 4, + tabSize: 4, + newLineCharacter, + convertTabsToSpaces: true, + indentStyle: ts.IndentStyle.Smart, + insertSpaceAfterConstructor: false, + insertSpaceAfterCommaDelimiter: true, + insertSpaceAfterSemicolonInForStatements: true, + insertSpaceBeforeAndAfterBinaryOperators: true, + insertSpaceAfterKeywordsInControlFlowStatements: true, + insertSpaceAfterFunctionKeywordForAnonymousFunctions: false, + insertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis: false, + insertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets: false, + insertSpaceAfterOpeningAndBeforeClosingNonemptyBraces: true, + insertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces: false, + insertSpaceAfterOpeningAndBeforeClosingJsxExpressionBraces: false, + insertSpaceBeforeFunctionParenthesis: false, + placeOpenBraceOnNewLineForFunctions: false, + placeOpenBraceOnNewLineForControlBlocks: false, + }; + if (action) { + action(options); + } + const rulesProvider = new formatting.RulesProvider(); + rulesProvider.ensureUpToDate(options); + return rulesProvider; + } + + function testExtractRangeFailed(caption: string, s: string, expectedErrors: string[]) { + return it(caption, () => { + const t = extractTest(s); + const file = createSourceFile("a.ts", t.source, ScriptTarget.Latest, /*setParentNodes*/ true); + const selectionRange = t.ranges.get("selection"); + if (!selectionRange) { + throw new Error(`Test ${s} does not specify selection range`); + } + const result = refactor.extractMethod.getRangeToExtract(file, createTextSpanFromBounds(selectionRange.start, selectionRange.end)); + assert(result.targetRange === undefined, "failure expected"); + const sortedErrors = result.errors.map(e => e.messageText).sort(); + assert.deepEqual(sortedErrors, expectedErrors.sort(), "unexpected errors"); + }); + } + + function testExtractRange(s: string): void { + const t = extractTest(s); + const f = createSourceFile("a.ts", t.source, ScriptTarget.Latest, /*setParentNodes*/ true); + const selectionRange = t.ranges.get("selection"); + if (!selectionRange) { + throw new Error(`Test ${s} does not specify selection range`); + } + const result = refactor.extractMethod.getRangeToExtract(f, createTextSpanFromBounds(selectionRange.start, selectionRange.end)); + const expectedRange = t.ranges.get("extracted"); + if (expectedRange) { + let start: number, end: number; + if (ts.isArray(result.targetRange.range)) { + start = result.targetRange.range[0].getStart(f); + end = ts.lastOrUndefined(result.targetRange.range).getEnd(); + } + else { + start = result.targetRange.range.getStart(f); + end = result.targetRange.range.getEnd(); + } + assert.equal(start, expectedRange.start, "incorrect start of range"); + assert.equal(end, expectedRange.end, "incorrect end of range"); + } + else { + assert.isTrue(!result.targetRange, `expected range to extract to be undefined`); + } + } + + describe("extractMethods", () => { + it("get extract range from selection", () => { + testExtractRange(` + [#| + [$|var x = 1; + var y = 2;|]|] + `); + testExtractRange(` + [#| + var x = 1; + var y = 2|]; + `); + testExtractRange(` + [#|var x = 1|]; + var y = 2; + `); + testExtractRange(` + if ([#|[#extracted|a && b && c && d|]|]) { + } + `); + testExtractRange(` + if [#|(a && b && c && d|]) { + } + `); + testExtractRange(` + if (a && b && c && d) { + [#| [$|var x = 1; + console.log(x);|] |] + } + `); + testExtractRange(` + [#| + if (a) { + return 100; + } |] + `); + testExtractRange(` + function foo() { + [#| [$|if (a) { + } + return 100|] |] + } + `); + testExtractRange(` + [#| + [$|l1: + if (x) { + break l1; + }|]|] + `); + testExtractRange(` + [#| + [$|l2: + { + if (x) { + } + break l2; + }|]|] + `); + testExtractRange(` + while (true) { + [#| if(x) { + } + break; |] + } + `); + testExtractRange(` + while (true) { + [#| if(x) { + } + continue; |] + } + `); + testExtractRange(` + l3: + { + [#| + if (x) { + } + break l3; |] + } + `); + testExtractRange(` + function f() { + while (true) { + [#| + if (x) { + return; + } |] + } + } + `); + testExtractRange(` + function f() { + while (true) { + [#| + [$|if (x) { + } + return;|] + |] + } + } + `); + testExtractRange(` + function f() { + return [#| [$|1 + 2|] |]+ 3; + } + } + `); + testExtractRange(` + function f() { + return [$|1 + [#|2 + 3|]|]; + } + } + `); + testExtractRange(` + function f() { + return [$|1 + 2 + [#|3 + 4|]|]; + } + } + `); + }); + + testExtractRangeFailed("extractRangeFailed1", + ` +namespace A { + function f() { + [#| + let x = 1 + if (x) { + return 10; + } + |] + } +} + `, + [ + "Cannot extract range containing conditional return statement." + ]); + + testExtractRangeFailed("extractRangeFailed2", + ` +namespace A { + function f() { + while (true) { + [#| + let x = 1 + if (x) { + break; + } + |] + } + } +} + `, + [ + "Cannot extract range containing conditional break or continue statements." + ]); + + testExtractRangeFailed("extractRangeFailed3", + ` +namespace A { + function f() { + while (true) { + [#| + let x = 1 + if (x) { + continue; + } + |] + } + } +} + `, + [ + "Cannot extract range containing conditional break or continue statements." + ]); + + testExtractRangeFailed("extractRangeFailed4", + ` +namespace A { + function f() { + l1: { + [#| + let x = 1 + if (x) { + break l1; + } + |] + } + } +} + `, + [ + "Cannot extract range containing labeled break or continue with target outside of the range." + ]); + + testExtractRangeFailed("extractRangeFailed5", + ` +namespace A { + function f() { + [#| + try { + f2() + return 10; + } + catch (e) { + } + |] + } + function f2() { + } +} + `, + [ + "Cannot extract range containing conditional return statement." + ]); + + testExtractRangeFailed("extractRangeFailed6", + ` +namespace A { + function f() { + [#| + try { + f2() + } + catch (e) { + return 10; + } + |] + } + function f2() { + } +} + `, + [ + "Cannot extract range containing conditional return statement." + ]); + + testExtractMethod("extractMethod1", + `namespace A { + let x = 1; + function foo() { + } + namespace B { + function a() { + let a = 1; + [#| + let y = 5; + let z = x; + a = y; + foo();|] + } + } +}`); + testExtractMethod("extractMethod2", + `namespace A { + let x = 1; + function foo() { + } + namespace B { + function a() { + [#| + let y = 5; + let z = x; + return foo();|] + } + } +}`); + testExtractMethod("extractMethod3", + `namespace A { + function foo() { + } + namespace B { + function* a(z: number) { + [#| + let y = 5; + yield z; + return foo();|] + } + } +}`); + testExtractMethod("extractMethod4", + `namespace A { + function foo() { + } + namespace B { + async function a(z: number, z1: any) { + [#| + let y = 5; + if (z) { + await z1; + } + return foo();|] + } + } +}`); + testExtractMethod("extractMethod5", + `namespace A { + let x = 1; + export function foo() { + } + namespace B { + function a() { + let a = 1; + [#| + let y = 5; + let z = x; + a = y; + foo();|] + } + } +}`); + testExtractMethod("extractMethod6", + `namespace A { + let x = 1; + export function foo() { + } + namespace B { + function a() { + let a = 1; + [#| + let y = 5; + let z = x; + a = y; + return foo();|] + } + } +}`); + testExtractMethod("extractMethod7", + `namespace A { + let x = 1; + export namespace C { + export function foo() { + } + } + namespace B { + function a() { + let a = 1; + [#| + let y = 5; + let z = x; + a = y; + return C.foo();|] + } + } +}`); + testExtractMethod("extractMethod8", + `namespace A { + let x = 1; + namespace B { + function a() { + let a1 = 1; + return 1 + [#|a1 + x|] + 100; + } + } +}`); + testExtractMethod("extractMethod9", + `namespace A { + export interface I { x: number }; + namespace B { + function a() { + [#|let a1: I = { x: 1 }; + return a1.x + 10;|] + } + } +}`); + testExtractMethod("extractMethod10", + `namespace A { + export interface I { x: number }; + class C { + a() { + let z = 1; + [#|let a1: I = { x: 1 }; + return a1.x + 10;|] + } + } +}`); + testExtractMethod("extractMethod11", + `namespace A { + let y = 1; + class C { + a() { + let z = 1; + [#|let a1 = { x: 1 }; + y = 10; + z = 42; + return a1.x + 10;|] + } + } +}`); + testExtractMethod("extractMethod12", + `namespace A { + let y = 1; + class C { + b() {} + a() { + let z = 1; + [#|let a1 = { x: 1 }; + y = 10; + z = 42; + this.b(); + return a1.x + 10;|] + } + } +}`); + }); + + + function testExtractMethod(caption: string, text: string) { + it(caption, () => { + Harness.Baseline.runBaseline(`extractMethod/${caption}.js`, () => { + const t = extractTest(text); + const selectionRange = t.ranges.get("selection"); + if (!selectionRange) { + throw new Error(`Test ${caption} does not specify selection range`); + } + const f = { + path: "/a.ts", + content: t.source + }; + const host = projectSystem.createServerHost([f]); + const projectService = projectSystem.createProjectService(host); + projectService.openClientFile(f.path); + const program = projectService.inferredProjects[0].getLanguageService().getProgram(); + const sourceFile = program.getSourceFile(f.path); + const context: RefactorContext = { + cancellationToken: { throwIfCancellationRequested() { }, isCancellationRequested() { return false; } }, + newLineCharacter, + program, + file: sourceFile, + startPosition: -1, + rulesProvider: getRuleProvider() + }; + const result = refactor.extractMethod.getRangeToExtract(sourceFile, createTextSpanFromBounds(selectionRange.start, selectionRange.end)); + assert.equal(result.errors, undefined, "expect no errors"); + const results = refactor.extractMethod.extractRange(result.targetRange, context); + const data: string[] = []; + data.push(`==ORIGINAL==`); + data.push(sourceFile.text); + for (const r of results) { + const changes = refactor.extractMethod.extractRange(result.targetRange, context, results.indexOf(r))[0].changes; + data.push(`==SCOPE::${r.scopeDescription}==`); + data.push(textChanges.applyChanges(sourceFile.text, changes[0].textChanges)); + } + return data.join(newLineCharacter); + }); + }); + } +} diff --git a/src/services/codefixes/importFixes.ts b/src/services/codefixes/importFixes.ts index d6fb8de9259b2..9fff51ee411d9 100644 --- a/src/services/codefixes/importFixes.ts +++ b/src/services/codefixes/importFixes.ts @@ -147,7 +147,7 @@ namespace ts.codefix { } else if (isJsxOpeningLikeElement(token.parent) && token.parent.tagName === token) { // The error wasn't for the symbolAtLocation, it was for the JSX tag itself, which needs access to e.g. `React`. - symbol = checker.getAliasedSymbol(checker.resolveNameAtLocation(token, checker.getJsxNamespace(), SymbolFlags.Value)); + symbol = checker.getAliasedSymbol(checker.resolveName(checker.getJsxNamespace(), token.parent.tagName, SymbolFlags.Value)); symbolName = symbol.name; } else { diff --git a/src/services/refactors/convertFunctionToEs6Class.ts b/src/services/refactors/convertFunctionToEs6Class.ts index 45adfb4b03900..bf0e4e22658b7 100644 --- a/src/services/refactors/convertFunctionToEs6Class.ts +++ b/src/services/refactors/convertFunctionToEs6Class.ts @@ -1,6 +1,6 @@ /* @internal */ -namespace ts.refactor { +namespace ts.refactor.convertFunctionToES6Class { const actionName = "convert"; const convertFunctionToES6Class: Refactor = { diff --git a/src/services/refactors/extractMethod.ts b/src/services/refactors/extractMethod.ts new file mode 100644 index 0000000000000..65e29138e9597 --- /dev/null +++ b/src/services/refactors/extractMethod.ts @@ -0,0 +1,1154 @@ +/// +/// + +/* @internal */ +namespace ts.refactor.extractMethod { + const extractMethod: Refactor = { + name: "Extract Method", + description: Diagnostics.Extract_function.message, + getAvailableActions, + getEditsForAction, + }; + + registerRefactor(extractMethod); + + /** Compute the associated code actions */ + function getAvailableActions(context: RefactorContext): ApplicableRefactorInfo[] | undefined { + const rangeToExtract = getRangeToExtract(context.file, { start: context.startPosition, length: context.endPosition - context.startPosition }); + + const targetRange: TargetRange = rangeToExtract.targetRange; + if (targetRange === undefined) { + return undefined; + } + + const extractions = extractRange(targetRange, context); + if (extractions === undefined) { + // No extractions possible + return undefined; + } + + const actions: RefactorActionInfo[] = []; + const usedNames: Map = createMap(); + + let i = 0; + for (const extr of extractions) { + // Skip these since we don't have a way to report errors yet + if (extr.errors && extr.errors.length) { + continue; + } + + // Don't issue refactorings with duplicated names + const description = formatStringFromArgs(Diagnostics.Extract_function_into_0.message, [extr.scopeDescription]); + if (!usedNames.get(description)) { + usedNames.set(description, true); + actions.push({ + description, + name: `scope_${i}` + }); + } + i++; + } + + if (actions.length === 0) { + return undefined; + } + + return [{ + name: extractMethod.name, + description: extractMethod.description, + inlineable: true, + actions + }]; + } + + function getEditsForAction(context: RefactorContext, actionName: string): RefactorEditInfo | undefined { + const length = context.endPosition === undefined ? 0 : context.endPosition - context.startPosition; + const rangeToExtract = getRangeToExtract(context.file, { start: context.startPosition, length }); + const targetRange: TargetRange = rangeToExtract.targetRange; + + const parsedIndexMatch = /scope_(\d+)/.exec(actionName); + if (!parsedIndexMatch) { + throw new Error("Expected to match the regexp"); + } + const index = +parsedIndexMatch[1]; + if (!isFinite(index)) { + throw new Error("Expected to parse a number from the scope index"); + } + + const extractions = extractRange(targetRange, context, index); + if (extractions === undefined) { + // Scope is no longer valid from when the user issued the refactor + // return undefined; + return undefined; + } + return ({ edits: extractions[0].changes }); + } + + // Move these into diagnostic messages if they become user-facing + namespace Messages { + function createMessage(message: string): DiagnosticMessage { + return { message, code: 0, category: DiagnosticCategory.Message, key: message }; + } + + export const CannotExtractFunction: DiagnosticMessage = createMessage("Cannot extract function."); + export const StatementOrExpressionExpected: DiagnosticMessage = createMessage("Statement or expression expected."); + export const CannotExtractRangeContainingConditionalBreakOrContinueStatements: DiagnosticMessage = createMessage("Cannot extract range containing conditional break or continue statements."); + export const CannotExtractRangeContainingConditionalReturnStatement: DiagnosticMessage = createMessage("Cannot extract range containing conditional return statement."); + export const CannotExtractRangeContainingLabeledBreakOrContinueStatementWithTargetOutsideOfTheRange: DiagnosticMessage = createMessage("Cannot extract range containing labeled break or continue with target outside of the range."); + export const CannotExtractRangeThatContainsWritesToReferencesLocatedOutsideOfTheTargetRangeInGenerators: DiagnosticMessage = createMessage("Cannot extract range containing writes to references located outside of the target range in generators."); + export const TypeWillNotBeVisibleInTheNewScope = createMessage("Type will not visible in the new scope."); + export const FunctionWillNotBeVisibleInTheNewScope = createMessage("Function will not visible in the new scope."); + export const InsufficientSelection = createMessage("Select more than a single identifier."); + export const CannotExtractExportedEntity = createMessage("Cannot extract exported declaration"); + export const CannotCombineWritesAndReturns = createMessage("Cannot combine writes and returns"); + export const CannotExtractReadonlyPropertyInitializerOutsideConstructor = createMessage("Cannot move initialization of read-only class property outside of the constructor"); + export const CannotExtractAmbientBlock = createMessage("Cannot extract code from ambient contexts"); + } + + export enum RangeFacts { + None = 0, + HasReturn = 1 << 0, + IsGenerator = 1 << 1, + IsAsyncFunction = 1 << 2, + UsesThis = 1 << 3, + /** + * The range is in a function which needs the 'static' modifier in a class + */ + InStaticRegion = 1 << 4 + } + + /** + * Represents an expression or a list of statements that should be extracted with some extra information + */ + export interface TargetRange { + readonly range: Expression | Statement[]; + readonly facts: RangeFacts; + /** + * A list of symbols that are declared in the selected range which are visible in the containing lexical scope + * Used to ensure we don't turn something used outside the range free (or worse, resolve to a different entity). + */ + readonly declarations: Symbol[]; + } + + /** + * Result of 'getRangeToExtract' operation: contains either a range or a list of errors + */ + export type RangeToExtract = { + readonly targetRange?: never; + readonly errors: ReadonlyArray; + } | { + readonly targetRange: TargetRange; + readonly errors?: never; + }; + + /* + * Scopes that can store newly extracted method + */ + export type Scope = FunctionLikeDeclaration | SourceFile | ModuleBlock | ClassLikeDeclaration; + + /** + * Result of 'extractRange' operation for a specific scope. + * Stores either a list of changes that should be applied to extract a range or a list of errors + */ + export interface ExtractResultForScope { + readonly scope: Scope; + readonly scopeDescription: string; + readonly changes?: FileTextChanges[]; + readonly errors?: Diagnostic[]; + } + + /** + * getRangeToExtract takes a span inside a text file and returns either an expression or an array + * of statements representing the minimum set of nodes needed to extract the entire span. This + * process may fail, in which case a set of errors is returned instead (these are currently + * not shown to the user, but can be used by us diagnostically) + */ + export function getRangeToExtract(sourceFile: SourceFile, span: TextSpan): RangeToExtract { + const length = span.length || 0; + // Walk up starting from the the start position until we find a non-SourceFile node that subsumes the selected span. + // This may fail (e.g. you select two statements in the root of a source file) + let start = getParentNodeInSpan(getTokenAtPosition(sourceFile, span.start, /*includeJsDocComment*/ false), sourceFile, span); + // Do the same for the ending position + let end = getParentNodeInSpan(findTokenOnLeftOfPosition(sourceFile, textSpanEnd(span)), sourceFile, span); + + const declarations: Symbol[] = []; + + // We'll modify these flags as we walk the tree to collect data + // about what things need to be done as part of the extraction. + let rangeFacts = RangeFacts.None; + + if (!start || !end) { + // cannot find either start or end node + return { errors: [createFileDiagnostic(sourceFile, span.start, length, Messages.CannotExtractFunction)] }; + } + + if (start.parent !== end.parent) { + // handle cases like 1 + [2 + 3] + 4 + // user selection is marked with []. + // in this case 2 + 3 does not belong to the same tree node + // instead the shape of the tree looks like this: + // + + // / \ + // + 4 + // / \ + // + 3 + // / \ + // 1 2 + // in this case there is no such one node that covers ends of selection and is located inside the selection + // to handle this we check if both start and end of the selection belong to some binary operation + // and start node is parented by the parent of the end node + // if this is the case - expand the selection to the entire parent of end node (in this case it will be [1 + 2 + 3] + 4) + const startParent = skipParentheses(start.parent); + const endParent = skipParentheses(end.parent); + if (isBinaryExpression(startParent) && isBinaryExpression(endParent) && isNodeDescendantOf(startParent, endParent)) { + start = end = endParent; + } + else { + // start and end nodes belong to different subtrees + return createErrorResult(sourceFile, span.start, length, Messages.CannotExtractFunction); + } + } + if (start !== end) { + // start and end should be statements and parent should be either block or a source file + if (!isBlockLike(start.parent)) { + return createErrorResult(sourceFile, span.start, length, Messages.CannotExtractFunction); + } + const statements: Statement[] = []; + for (const statement of (start.parent).statements) { + if (statement === start || statements.length) { + const errors = checkNode(statement); + if (errors) { + return { errors }; + } + statements.push(statement); + } + if (statement === end) { + break; + } + } + return { targetRange: { range: statements, facts: rangeFacts, declarations } }; + } + else { + // We have a single expression (start) + const errors = checkRootNode(start) || checkNode(start); + if (errors) { + return { errors }; + } + + // If our selection is the expression in an ExrpessionStatement, expand + // the selection to include the enclosing Statement (this stops us + // from trying to care about the return value of the extracted function + // and eliminates double semicolon insertion in certain scenarios) + const range = isStatement(start) + ? [start] + : start.parent && start.parent.kind === SyntaxKind.ExpressionStatement + ? [start.parent as Statement] + : start; + + return { targetRange: { range, facts: rangeFacts, declarations } }; + } + + function createErrorResult(sourceFile: SourceFile, start: number, length: number, message: DiagnosticMessage): RangeToExtract { + return { errors: [createFileDiagnostic(sourceFile, start, length, message)] }; + } + + function checkRootNode(node: Node): Diagnostic[] | undefined { + if (isIdentifier(node)) { + return [createDiagnosticForNode(node, Messages.InsufficientSelection)]; + } + return undefined; + } + + // Verifies whether we can actually extract this node or not. + function checkNode(nodeToCheck: Node): Diagnostic[] | undefined { + const enum PermittedJumps { + None = 0, + Break = 1 << 0, + Continue = 1 << 1, + Return = 1 << 2 + } + if (!isStatement(nodeToCheck) && !(isExpression(nodeToCheck) && isLegalExpressionExtraction(nodeToCheck))) { + return [createDiagnosticForNode(nodeToCheck, Messages.StatementOrExpressionExpected)]; + } + + if (isInAmbientContext(nodeToCheck)) { + return [createDiagnosticForNode(nodeToCheck, Messages.CannotExtractAmbientBlock)]; + } + + // If we're in a class, see if we're in a static region (static property initializer, static method, class constructor parameter default) or not + const stoppingPoint: Node = getContainingClass(nodeToCheck); + if (stoppingPoint) { + let current: Node = nodeToCheck; + while (current !== stoppingPoint) { + if (current.kind === SyntaxKind.PropertyDeclaration) { + if (hasModifier(current, ModifierFlags.Static)) { + rangeFacts |= RangeFacts.InStaticRegion; + } + break; + } + else if (current.kind === SyntaxKind.Parameter) { + const ctorOrMethod = getContainingFunction(current); + if (ctorOrMethod.kind === SyntaxKind.Constructor) { + rangeFacts |= RangeFacts.InStaticRegion; + } + break; + } + else if (current.kind === SyntaxKind.MethodDeclaration) { + if (hasModifier(current, ModifierFlags.Static)) { + rangeFacts |= RangeFacts.InStaticRegion; + } + } + current = current.parent; + } + } + + let errors: Diagnostic[]; + let permittedJumps = PermittedJumps.Return; + let seenLabels: Array<__String>; + + visit(nodeToCheck); + + return errors; + + function visit(node: Node) { + if (errors) { + // already found an error - can stop now + return true; + } + + if (isDeclaration(node)) { + const declaringNode = (node.kind === SyntaxKind.VariableDeclaration) ? node.parent.parent : node; + if (hasModifier(declaringNode, ModifierFlags.Export)) { + (errors || (errors = []).push(createDiagnosticForNode(node, Messages.CannotExtractExportedEntity))); + return true; + } + declarations.push(node.symbol); + } + + // Some things can't be extracted in certain situations + switch (node.kind) { + case SyntaxKind.ImportDeclaration: + (errors || (errors = [])).push(createDiagnosticForNode(node, Messages.CannotExtractFunction)); + return true; + case SyntaxKind.SuperKeyword: + // For a super *constructor call*, we have to be extracting the entire class, + // but a super *method call* simply implies a 'this' reference + if (node.parent.kind === SyntaxKind.CallExpression) { + // Super constructor call + const containingClass = getContainingClass(node); + if (containingClass.pos < span.start || containingClass.end >= (span.start + span.length)) { + (errors || (errors = [])).push(createDiagnosticForNode(node, Messages.CannotExtractFunction)); + return true; + } + } + else { + rangeFacts |= RangeFacts.UsesThis; + } + break; + } + + if (!node || isFunctionLike(node) || isClassLike(node)) { + switch (node.kind) { + case SyntaxKind.FunctionDeclaration: + case SyntaxKind.ClassDeclaration: + if (node.parent.kind === SyntaxKind.SourceFile && (node.parent as ts.SourceFile).externalModuleIndicator === undefined) { + // You cannot extract global declarations + (errors || (errors = [])).push(createDiagnosticForNode(node, Messages.FunctionWillNotBeVisibleInTheNewScope)); + } + break; + } + + // do not dive into functions or classes + return false; + } + const savedPermittedJumps = permittedJumps; + if (node.parent) { + switch (node.parent.kind) { + case SyntaxKind.IfStatement: + if ((node.parent).thenStatement === node || (node.parent).elseStatement === node) { + // forbid all jumps inside thenStatement or elseStatement + permittedJumps = PermittedJumps.None; + } + break; + case SyntaxKind.TryStatement: + if ((node.parent).tryBlock === node) { + // forbid all jumps inside try blocks + permittedJumps = PermittedJumps.None; + } + else if ((node.parent).finallyBlock === node) { + // allow unconditional returns from finally blocks + permittedJumps = PermittedJumps.Return; + } + break; + case SyntaxKind.CatchClause: + if ((node.parent).block === node) { + // forbid all jumps inside the block of catch clause + permittedJumps = PermittedJumps.None; + } + break; + case SyntaxKind.CaseClause: + if ((node).expression !== node) { + // allow unlabeled break inside case clauses + permittedJumps |= PermittedJumps.Break; + } + break; + default: + if (isIterationStatement(node.parent, /*lookInLabeledStatements*/ false)) { + if ((node.parent).statement === node) { + // allow unlabeled break/continue inside loops + permittedJumps |= PermittedJumps.Break | PermittedJumps.Continue; + } + } + break; + } + } + + switch (node.kind) { + case SyntaxKind.ThisType: + case SyntaxKind.ThisKeyword: + rangeFacts |= RangeFacts.UsesThis; + break; + case SyntaxKind.LabeledStatement: + { + const label = (node).label; + (seenLabels || (seenLabels = [])).push(label.escapedText); + forEachChild(node, visit); + seenLabels.pop(); + break; + } + case SyntaxKind.BreakStatement: + case SyntaxKind.ContinueStatement: + { + const label = (node).label; + if (label) { + if (!contains(seenLabels, label.escapedText)) { + // attempts to jump to label that is not in range to be extracted + (errors || (errors = [])).push(createDiagnosticForNode(node, Messages.CannotExtractRangeContainingLabeledBreakOrContinueStatementWithTargetOutsideOfTheRange)); + } + } + else { + if (!(permittedJumps & (SyntaxKind.BreakStatement ? PermittedJumps.Break : PermittedJumps.Continue))) { + // attempt to break or continue in a forbidden context + (errors || (errors = [])).push(createDiagnosticForNode(node, Messages.CannotExtractRangeContainingConditionalBreakOrContinueStatements)); + } + } + break; + } + case SyntaxKind.AwaitExpression: + rangeFacts |= RangeFacts.IsAsyncFunction; + break; + case SyntaxKind.YieldExpression: + rangeFacts |= RangeFacts.IsGenerator; + break; + case SyntaxKind.ReturnStatement: + if (permittedJumps & PermittedJumps.Return) { + rangeFacts |= RangeFacts.HasReturn; + } + else { + (errors || (errors = [])).push(createDiagnosticForNode(node, Messages.CannotExtractRangeContainingConditionalReturnStatement)); + } + break; + default: + forEachChild(node, visit); + break; + } + + permittedJumps = savedPermittedJumps; + } + } + } + + function isValidExtractionTarget(node: Node) { + // Note that we don't use isFunctionLike because we don't want to put the extracted closure *inside* a method + return (node.kind === SyntaxKind.FunctionDeclaration) || (node.kind === SyntaxKind.Constructor) || isSourceFile(node) || isModuleBlock(node) || isClassLike(node); + } + + /** + * Computes possible places we could extract the function into. For example, + * you may be able to extract into a class method *or* local closure *or* namespace function, + * depending on what's in the extracted body. + */ + export function collectEnclosingScopes(range: TargetRange): Scope[] | undefined { + let current: Node = isArray(range.range) ? firstOrUndefined(range.range) : range.range; + if (range.facts & RangeFacts.UsesThis) { + // if range uses this as keyword or as type inside the class then it can only be extracted to a method of the containing class + const containingClass = getContainingClass(current); + if (containingClass) { + return [containingClass]; + } + } + + const start = current; + + let scopes: Scope[] | undefined = undefined; + while (current) { + // We want to find the nearest parent where we can place an "equivalent" sibling to the node we're extracting out of. + // Walk up to the closest parent of a place where we can logically put a sibling: + // * Function declaration + // * Class declaration or expression + // * Module/namespace or source file + if (current !== start && isValidExtractionTarget(current)) { + (scopes = scopes || []).push(current as FunctionLikeDeclaration); + } + + // A function parameter's initializer is actually in the outer scope, not the function declaration + if (current && current.parent && current.parent.kind === SyntaxKind.Parameter) { + // Skip all the way to the outer scope of the function that declared this parameter + current = current.parent.parent.parent; + } + else { + current = current.parent; + } + + } + return scopes; + } + + /** + * Given a piece of text to extract ('targetRange'), computes a list of possible extractions. + * Each returned ExtractResultForScope corresponds to a possible target scope and is either a set of changes + * or an error explaining why we can't extract into that scope. + */ + export function extractRange(targetRange: TargetRange, context: RefactorContext, requestedChangesIndex: number = undefined): ReadonlyArray | undefined { + const { file: sourceFile } = context; + + if (targetRange === undefined) { + return undefined; + } + + const scopes = collectEnclosingScopes(targetRange); + if (scopes === undefined) { + return undefined; + } + + const enclosingTextRange = getEnclosingTextRange(targetRange, sourceFile); + const { target, usagesPerScope, errorsPerScope } = collectReadsAndWrites( + targetRange, + scopes, + enclosingTextRange, + sourceFile, + context.program.getTypeChecker()); + + context.cancellationToken.throwIfCancellationRequested(); + + if (requestedChangesIndex !== undefined) { + if (errorsPerScope[requestedChangesIndex].length) { + return undefined; + } + return [extractFunctionInScope(target, scopes[requestedChangesIndex], usagesPerScope[requestedChangesIndex], targetRange, context)]; + } + else { + return scopes.map((scope, i) => { + const errors = errorsPerScope[i]; + if (errors.length) { + return { + scope, + scopeDescription: getDescriptionForScope(scope), + errors + }; + } + return { scope, scopeDescription: getDescriptionForScope(scope) }; + }); + } + } + + function getDescriptionForScope(scope: Scope) { + if (isFunctionLike(scope)) { + switch (scope.kind) { + case SyntaxKind.Constructor: + return "constructor"; + case SyntaxKind.FunctionExpression: + return scope.name + ? `function expression ${scope.name.getText()}` + : "anonymous function expression"; + case SyntaxKind.FunctionDeclaration: + return `function ${scope.name.getText()}`; + case SyntaxKind.ArrowFunction: + return "arrow function"; + case SyntaxKind.MethodDeclaration: + return `method ${scope.name.getText()}`; + case SyntaxKind.GetAccessor: + return `get ${scope.name.getText()}`; + case SyntaxKind.SetAccessor: + return `set ${scope.name.getText()}`; + } + } + else if (isModuleBlock(scope)) { + return `namespace ${scope.parent.name.getText()}`; + } + else if (isClassLike(scope)) { + return scope.kind === SyntaxKind.ClassDeclaration + ? `class ${scope.name.text}` + : scope.name.text + ? `class expression ${scope.name.text}` + : "anonymous class expression"; + } + else if (isSourceFile(scope)) { + return `file '${scope.fileName}'`; + } + else { + return "unknown"; + } + } + + function getUniqueName(isNameOkay: (name: __String) => boolean) { + let functionNameText = "newFunction" as __String; + if (isNameOkay(functionNameText)) { + return functionNameText; + } + let i = 1; + while (!isNameOkay(functionNameText = `newFunction_${i}` as __String)) { + i++; + } + return functionNameText; + } + + export function extractFunctionInScope( + node: Statement | Expression | Block, + scope: Scope, + { usages: usagesInScope, substitutions }: ScopeUsages, + range: TargetRange, + context: RefactorContext): ExtractResultForScope { + + const checker = context.program.getTypeChecker(); + + // Make a unique name for the extracted function + let functionNameText: __String; + if (isClassLike(scope)) { + const type = range.facts & RangeFacts.InStaticRegion ? checker.getTypeOfSymbolAtLocation(scope.symbol, scope) : checker.getDeclaredTypeOfSymbol(scope.symbol); + const props = checker.getPropertiesOfType(type); + functionNameText = getUniqueName(n => props.every(p => p.name !== n)); + } + else { + const file = scope.getSourceFile(); + functionNameText = getUniqueName(n => !file.identifiers.has(n as string)); + } + const isJS = isInJavaScriptFile(scope); + + const functionName = createIdentifier(functionNameText as string); + const functionReference = createIdentifier(functionNameText as string); + + let returnType: TypeNode = undefined; + const parameters: ParameterDeclaration[] = []; + const callArguments: Identifier[] = []; + let writes: UsageEntry[]; + usagesInScope.forEach((usage, name) => { + let typeNode: TypeNode = undefined; + if (!isJS) { + let type = checker.getTypeOfSymbolAtLocation(usage.symbol, usage.node); + // Widen the type so we don't emit nonsense annotations like "function fn(x: 3) {" + type = checker.getBaseTypeOfLiteralType(type); + typeNode = checker.typeToTypeNode(type, node, NodeBuilderFlags.NoTruncation); + } + + const paramDecl = createParameter( + /*decorators*/ undefined, + /*modifiers*/ undefined, + /*dotDotDotToken*/ undefined, + /*name*/ name, + /*questionToken*/ undefined, + typeNode + ); + parameters.push(paramDecl); + if (usage.usage === Usage.Write) { + (writes || (writes = [])).push(usage); + } + callArguments.push(createIdentifier(name)); + }); + + // Provide explicit return types for contexutally-typed functions + // to avoid problems when there are literal types present + if (isExpression(node) && !isJS) { + const contextualType = checker.getContextualType(node); + returnType = checker.typeToTypeNode(contextualType); + } + + const { body, returnValueProperty } = transformFunctionBody(node); + let newFunction: MethodDeclaration | FunctionDeclaration; + + if (isClassLike(scope)) { + // always create private method in TypeScript files + const modifiers: Modifier[] = isJS ? [] : [createToken(SyntaxKind.PrivateKeyword)]; + if (range.facts & RangeFacts.IsAsyncFunction) { + modifiers.push(createToken(SyntaxKind.AsyncKeyword)); + } + if (range.facts & RangeFacts.InStaticRegion) { + modifiers.push(createToken(SyntaxKind.StaticKeyword)); + } + newFunction = createMethod( + /*decorators*/ undefined, + modifiers, + range.facts & RangeFacts.IsGenerator ? createToken(SyntaxKind.AsteriskToken) : undefined, + functionName, + /*questionToken*/ undefined, + /*typeParameters*/[], + parameters, + returnType, + body + ); + } + else { + newFunction = createFunctionDeclaration( + /*decorators*/ undefined, + range.facts & RangeFacts.IsAsyncFunction ? [createToken(SyntaxKind.AsyncKeyword)] : undefined, + range.facts & RangeFacts.IsGenerator ? createToken(SyntaxKind.AsteriskToken) : undefined, + functionName, + /*typeParameters*/[], + parameters, + returnType, + body + ); + } + + const changeTracker = textChanges.ChangeTracker.fromCodeFixContext(context); + // insert function at the end of the scope + changeTracker.insertNodeBefore(context.file, scope.getLastToken(), newFunction, { prefix: context.newLineCharacter, suffix: context.newLineCharacter }); + + const newNodes: Node[] = []; + // replace range with function call + let call: Expression = createCall( + isClassLike(scope) ? createPropertyAccess(range.facts & RangeFacts.InStaticRegion ? createIdentifier(scope.name.getText()) : createThis(), functionReference) : functionReference, + /*typeArguments*/ undefined, + callArguments); + if (range.facts & RangeFacts.IsGenerator) { + call = createYield(createToken(SyntaxKind.AsteriskToken), call); + } + if (range.facts & RangeFacts.IsAsyncFunction) { + call = createAwait(call); + } + + if (writes) { + if (returnValueProperty) { + // has both writes and return, need to create variable declaration to hold return value; + newNodes.push(createVariableStatement( + /*modifiers*/ undefined, + [createVariableDeclaration(returnValueProperty, createKeywordTypeNode(SyntaxKind.AnyKeyword))] + )); + } + + const assignments = getPropertyAssignmentsForWrites(writes); + if (returnValueProperty) { + assignments.unshift(createShorthandPropertyAssignment(returnValueProperty)); + } + + // propagate writes back + if (assignments.length === 1) { + if (returnValueProperty) { + newNodes.push(createReturn(createIdentifier(returnValueProperty))); + } + else { + newNodes.push(createStatement(createBinary(assignments[0].name, SyntaxKind.EqualsToken, call))); + } + } + else { + // emit e.g. + // { a, b, __return } = newFunction(a, b); + // return __return; + newNodes.push(createStatement(createBinary(createObjectLiteral(assignments), SyntaxKind.EqualsToken, call))); + if (returnValueProperty) { + newNodes.push(createReturn(createIdentifier(returnValueProperty))); + } + } + } + else { + if (range.facts & RangeFacts.HasReturn) { + newNodes.push(createReturn(call)); + } + else if (isArray(range.range)) { + newNodes.push(createStatement(call)); + } + else { + newNodes.push(call); + } + } + + if (isArray(range.range)) { + changeTracker.replaceNodesWithNodes(context.file, range.range, newNodes, { + nodeSeparator: context.newLineCharacter, + suffix: context.newLineCharacter // insert newline only when replacing statements + }); + } + else { + changeTracker.replaceNodeWithNodes(context.file, range.range, newNodes, { nodeSeparator: context.newLineCharacter }); + } + + return { + scope, + scopeDescription: getDescriptionForScope(scope), + changes: changeTracker.getChanges() + }; + + function getPropertyAssignmentsForWrites(writes: UsageEntry[]) { + return writes.map(w => createShorthandPropertyAssignment(w.symbol.name)); + } + + function generateReturnValueProperty() { + return "__return"; + } + + function transformFunctionBody(body: Node) { + if (isBlock(body) && !writes && substitutions.size === 0) { + // already block, no writes to propagate back, no substitutions - can use node as is + return { body: createBlock(body.statements, /*multLine*/ true), returnValueProperty: undefined }; + } + let returnValueProperty: string; + const statements = createNodeArray(isBlock(body) ? body.statements.slice(0) : [isStatement(body) ? body : createReturn(body)]); + // rewrite body if either there are writes that should be propagated back via return statements or there are substitutions + if (writes || substitutions.size) { + const rewrittenStatements = visitNodes(statements, visitor).slice(); + if (writes && !(range.facts & RangeFacts.HasReturn) && isStatement(body)) { + // add return at the end to propagate writes back in case if control flow falls out of the function body + // it is ok to know that range has at least one return since it we only allow unconditional returns + const assignments = getPropertyAssignmentsForWrites(writes); + if (assignments.length === 1) { + rewrittenStatements.push(createReturn(assignments[0].name)); + } + else { + rewrittenStatements.push(createReturn(createObjectLiteral(assignments))); + } + } + return { body: createBlock(rewrittenStatements, /*multiLine*/ true), returnValueProperty }; + } + else { + return { body: createBlock(statements, /*multiLine*/ true), returnValueProperty: undefined }; + } + + function visitor(node: Node): VisitResult { + if (node.kind === SyntaxKind.ReturnStatement && writes) { + const assignments: ObjectLiteralElementLike[] = getPropertyAssignmentsForWrites(writes); + if ((node).expression) { + if (!returnValueProperty) { + returnValueProperty = generateReturnValueProperty(); + } + assignments.unshift(createPropertyAssignment(returnValueProperty, visitNode((node).expression, visitor))); + } + if (assignments.length === 1) { + return createReturn(assignments[0].name as Expression); + } + else { + return createReturn(createObjectLiteral(assignments)); + } + } + else { + const substitution = substitutions.get(getNodeId(node).toString()); + return substitution || visitEachChild(node, visitor, nullTransformationContext); + } + } + } + } + + function isModuleBlock(n: Node): n is ModuleBlock { + return n.kind === SyntaxKind.ModuleBlock; + } + + function isReadonlyArray(v: any): v is ReadonlyArray { + return isArray(v); + } + + /** + * Produces a range that spans the entirety of nodes, given a selection + * that might start/end in the middle of nodes. + * + * For example, when the user makes a selection like this + * v---v + * var someThing = foo + bar; + * this returns ^-------^ + */ + function getEnclosingTextRange(targetRange: TargetRange, sourceFile: SourceFile): TextRange { + return isReadonlyArray(targetRange.range) + ? { pos: targetRange.range[0].getStart(sourceFile), end: targetRange.range[targetRange.range.length - 1].getEnd() } + : targetRange.range; + } + + const enum Usage { + // value should be passed to extracted method + Read = 1, + // value should be passed to extracted method and propagated back + Write = 2 + } + + interface UsageEntry { + readonly usage: Usage; + readonly symbol: Symbol; + readonly node: Node; + } + + interface ScopeUsages { + usages: Map; + substitutions: Map; + } + + function collectReadsAndWrites( + targetRange: TargetRange, + scopes: Scope[], + enclosingTextRange: TextRange, + sourceFile: SourceFile, + checker: TypeChecker) { + + const usagesPerScope: ScopeUsages[] = []; + const substitutionsPerScope: Map[] = []; + const errorsPerScope: Diagnostic[][] = []; + const visibleDeclarationsInExtractedRange: Symbol[] = []; + + // initialize results + for (const _ of scopes) { + usagesPerScope.push({ usages: createMap(), substitutions: createMap() }); + substitutionsPerScope.push(createMap()); + errorsPerScope.push([]); + } + const seenUsages = createMap(); + let valueUsage = Usage.Read; + const target = isReadonlyArray(targetRange.range) ? createBlock(targetRange.range) : targetRange.range; + const containingLexicalScopeOfExtraction = isBlockScope(scopes[0], scopes[0].parent) ? scopes[0] : getEnclosingBlockScopeContainer(scopes[0]); + + collectUsages(target); + + for (let i = 0; i < scopes.length; i++) { + let hasWrite = false; + let readonlyClassPropertyWrite: Declaration | undefined = undefined; + usagesPerScope[i].usages.forEach(value => { + if (value.usage === Usage.Write) { + hasWrite = true; + if (value.symbol.flags & SymbolFlags.ClassMember && + value.symbol.valueDeclaration && + hasModifier(value.symbol.valueDeclaration, ModifierFlags.Readonly)) { + readonlyClassPropertyWrite = value.symbol.valueDeclaration; + } + } + }); + + if (hasWrite && !isArray(targetRange.range) && isExpression(targetRange.range)) { + errorsPerScope[i].push(createDiagnosticForNode(targetRange.range, Messages.CannotCombineWritesAndReturns)); + } + else if (readonlyClassPropertyWrite && i > 0) { + errorsPerScope[i].push(createDiagnosticForNode(readonlyClassPropertyWrite, Messages.CannotCombineWritesAndReturns)); + } + } + + // If there are any declarations in the extracted block that are used in the same enclosing + // lexical scope, we can't move the extraction "up" as those declarations will become unreachable + if (visibleDeclarationsInExtractedRange.length) { + forEachChild(containingLexicalScopeOfExtraction, checkForUsedDeclarations); + } + + return { target, usagesPerScope, errorsPerScope }; + + function collectUsages(node: Node) { + if (isDeclaration(node) && node.symbol) { + visibleDeclarationsInExtractedRange.push(node.symbol); + } + + if (isAssignmentExpression(node)) { + const savedValueUsage = valueUsage; + // use 'write' as default usage for values + valueUsage = Usage.Write; + collectUsages(node.left); + valueUsage = savedValueUsage; + + collectUsages(node.right); + } + else if (isUnaryExpressionWithWrite(node)) { + const savedValueUsage = valueUsage; + valueUsage = Usage.Write; + collectUsages(node.operand); + valueUsage = savedValueUsage; + } + else if (isPropertyAccessExpression(node) || isElementAccessExpression(node)) { + const savedValueUsage = valueUsage; + // use 'write' as default usage for values + valueUsage = Usage.Read; + forEachChild(node, collectUsages); + valueUsage = savedValueUsage; + } + else if (isIdentifier(node)) { + if (!node.parent) { + return; + } + if (isQualifiedName(node.parent) && node !== node.parent.left) { + return; + } + if (isPropertyAccessExpression(node.parent) && node !== node.parent.expression) { + return; + } + recordUsage(node, valueUsage, /*isTypeNode*/ isPartOfTypeNode(node)); + } + else { + forEachChild(node, collectUsages); + } + } + + function recordUsage(n: Identifier, usage: Usage, isTypeNode: boolean) { + const symbolId = recordUsagebySymbol(n, usage, isTypeNode); + if (symbolId) { + for (let i = 0; i < scopes.length; i++) { + // push substitution from map to map to simplify rewriting + const substitition = substitutionsPerScope[i].get(symbolId); + if (substitition) { + usagesPerScope[i].substitutions.set(getNodeId(n).toString(), substitition); + } + } + } + } + + function recordUsagebySymbol(identifier: Identifier, usage: Usage, isTypeName: boolean) { + const symbol = checker.getSymbolAtLocation(identifier); + if (!symbol) { + // cannot find symbol - do nothing + return undefined; + } + const symbolId = getSymbolId(symbol).toString(); + const lastUsage = seenUsages.get(symbolId); + // there are two kinds of value usages + // - reads - if range contains a read from the value located outside of the range then value should be passed as a parameter + // - writes - if range contains a write to a value located outside the range the value should be passed as a parameter and + // returned as a return value + // 'write' case is a superset of 'read' so if we already have processed 'write' of some symbol there is not need to handle 'read' + // since all information is already recorded + if (lastUsage && lastUsage >= usage) { + return symbolId; + } + + seenUsages.set(symbolId, usage); + if (lastUsage) { + // if we get here this means that we are trying to handle 'write' and 'read' was already processed + // walk scopes and update existing records. + for (const perScope of usagesPerScope) { + const prevEntry = perScope.usages.get(identifier.text as string); + if (prevEntry) { + perScope.usages.set(identifier.text as string, { usage, symbol, node: identifier }); + } + } + return symbolId; + } + // find first declaration in this file + const declInFile = find(symbol.getDeclarations(), d => d.getSourceFile() === sourceFile); + if (!declInFile) { + return undefined; + } + if (rangeContainsRange(enclosingTextRange, declInFile)) { + // declaration is located in range to be extracted - do nothing + return undefined; + } + if (targetRange.facts & RangeFacts.IsGenerator && usage === Usage.Write) { + // this is write to a reference located outside of the target scope and range is extracted into generator + // currently this is unsupported scenario + for (const errors of errorsPerScope) { + errors.push(createDiagnosticForNode(identifier, Messages.CannotExtractRangeThatContainsWritesToReferencesLocatedOutsideOfTheTargetRangeInGenerators)); + } + } + for (let i = 0; i < scopes.length; i++) { + const scope = scopes[i]; + const resolvedSymbol = checker.resolveName(symbol.name, scope, symbol.flags); + if (resolvedSymbol === symbol) { + continue; + } + if (!substitutionsPerScope[i].has(symbolId)) { + const substitution = tryReplaceWithQualifiedNameOrPropertyAccess(symbol.exportSymbol || symbol, scope, isTypeName); + if (substitution) { + substitutionsPerScope[i].set(symbolId, substitution); + } + else if (isTypeName) { + errorsPerScope[i].push(createDiagnosticForNode(identifier, Messages.TypeWillNotBeVisibleInTheNewScope)); + } + else { + usagesPerScope[i].usages.set(identifier.text as string, { usage, symbol, node: identifier }); + } + } + } + return symbolId; + } + + function checkForUsedDeclarations(node: Node) { + // If this node is entirely within the original extraction range, we don't need to do anything. + if (node === targetRange.range || (isArray(targetRange.range) && targetRange.range.indexOf(node as Statement) >= 0)) { + return; + } + + // Otherwise check and recurse. + const sym = checker.getSymbolAtLocation(node); + if (sym && visibleDeclarationsInExtractedRange.some(d => d === sym)) { + for (const scope of errorsPerScope) { + scope.push(createDiagnosticForNode(node, Messages.CannotExtractExportedEntity)); + } + return true; + } + else { + forEachChild(node, checkForUsedDeclarations); + } + } + + function tryReplaceWithQualifiedNameOrPropertyAccess(symbol: Symbol, scopeDecl: Node, isTypeNode: boolean): PropertyAccessExpression | EntityName { + if (!symbol) { + return undefined; + } + if (symbol.getDeclarations().some(d => d.parent === scopeDecl)) { + return createIdentifier(symbol.name); + } + const prefix = tryReplaceWithQualifiedNameOrPropertyAccess(symbol.parent, scopeDecl, isTypeNode); + if (prefix === undefined) { + return undefined; + } + return isTypeNode ? createQualifiedName(prefix, createIdentifier(symbol.name)) : createPropertyAccess(prefix, symbol.name); + } + } + + function getParentNodeInSpan(node: Node, file: SourceFile, span: TextSpan): Node { + while (node) { + if (!node.parent) { + return undefined; + } + if (isSourceFile(node.parent) || !spanContainsNode(span, node.parent, file)) { + return node; + } + + node = node.parent; + } + } + + function spanContainsNode(span: TextSpan, node: Node, file: SourceFile): boolean { + return textSpanContainsPosition(span, node.getStart(file)) && + node.getEnd() <= textSpanEnd(span); + } + + /** + * Computes whether or not a node represents an expression in a position where it could + * be extracted. + * The isExpression() in utilities.ts returns some false positives we need to handle, + * such as `import x from 'y'` -- the 'y' is a StringLiteral but is *not* an expression + * in the sense of something that you could extract on + */ + function isLegalExpressionExtraction(node: Node): boolean { + switch (node.parent.kind) { + case SyntaxKind.EnumMember: + return false; + } + + switch (node.kind) { + case SyntaxKind.StringLiteral: + return node.parent.kind !== SyntaxKind.ImportDeclaration && + node.parent.kind !== SyntaxKind.ImportSpecifier; + + case SyntaxKind.SpreadElement: + case SyntaxKind.ObjectBindingPattern: + case SyntaxKind.BindingElement: + return false; + + case SyntaxKind.Identifier: + return node.parent.kind !== SyntaxKind.BindingElement && + node.parent.kind !== SyntaxKind.ImportSpecifier; + } + return true; + } + + function isBlockLike(node: Node): node is BlockLike { + switch (node.kind) { + case SyntaxKind.Block: + case SyntaxKind.SourceFile: + case SyntaxKind.ModuleBlock: + case SyntaxKind.CaseClause: + return true; + default: + return false; + } + } +} diff --git a/src/services/refactors/refactors.ts b/src/services/refactors/refactors.ts index 4c4ecb33416b1..3a33ccc83c2b8 100644 --- a/src/services/refactors/refactors.ts +++ b/src/services/refactors/refactors.ts @@ -1 +1,2 @@ /// +/// diff --git a/src/services/textChanges.ts b/src/services/textChanges.ts index d468263227e1e..5480c8f34a5fe 100644 --- a/src/services/textChanges.ts +++ b/src/services/textChanges.ts @@ -64,7 +64,7 @@ namespace ts.textChanges { */ export type ConfigurableStartEnd = ConfigurableStart & ConfigurableEnd; - export interface InsertNodeOptions { + interface InsertNodeOptions { /** * Text to be inserted before the new node */ @@ -83,16 +83,43 @@ namespace ts.textChanges { delta?: number; } - export type ChangeNodeOptions = ConfigurableStartEnd & InsertNodeOptions; + enum ChangeKind { + Remove, + ReplaceWithSingleNode, + ReplaceWithMultipleNodes + } + + type Change = ReplaceWithSingleNode | ReplaceWithMultipleNodes | RemoveNode; - interface Change { + interface BaseChange { readonly sourceFile: SourceFile; readonly range: TextRange; + } + + interface ChangeNodeOptions extends ConfigurableStartEnd, InsertNodeOptions { readonly useIndentationFromFile?: boolean; - readonly node?: Node; + } + interface ReplaceWithSingleNode extends BaseChange { + readonly kind: ChangeKind.ReplaceWithSingleNode; + readonly node: Node; readonly options?: ChangeNodeOptions; } + interface RemoveNode extends BaseChange { + readonly kind: ChangeKind.Remove; + readonly node?: never; + readonly options?: never; + } + + interface ChangeMultipleNodesOptions extends ChangeNodeOptions { + nodeSeparator: string; + } + interface ReplaceWithMultipleNodes extends BaseChange { + readonly kind: ChangeKind.ReplaceWithMultipleNodes; + readonly nodes: ReadonlyArray; + readonly options?: ChangeMultipleNodesOptions; + } + export function getSeparatorCharacter(separator: Token) { return tokenToString(separator.kind); } @@ -153,12 +180,16 @@ namespace ts.textChanges { return s; } + function getNewlineKind(context: { newLineCharacter: string }) { + return context.newLineCharacter === "\n" ? NewLineKind.LineFeed : NewLineKind.CarriageReturnLineFeed; + } + export class ChangeTracker { private changes: Change[] = []; private readonly newLineCharacter: string; - public static fromCodeFixContext(context: { newLineCharacter: string, rulesProvider: formatting.RulesProvider }) { - return new ChangeTracker(context.newLineCharacter === "\n" ? NewLineKind.LineFeed : NewLineKind.CarriageReturnLineFeed, context.rulesProvider); + public static fromCodeFixContext(context: { newLineCharacter: string, rulesProvider?: formatting.RulesProvider }) { + return new ChangeTracker(getNewlineKind(context), context.rulesProvider); } constructor( @@ -168,22 +199,22 @@ namespace ts.textChanges { this.newLineCharacter = getNewLineCharacter({ newLine }); } - public deleteNode(sourceFile: SourceFile, node: Node, options: ConfigurableStartEnd = {}) { - const startPosition = getAdjustedStartPosition(sourceFile, node, options, Position.FullStart); - const endPosition = getAdjustedEndPosition(sourceFile, node, options); - this.changes.push({ sourceFile, options, range: { pos: startPosition, end: endPosition } }); + public deleteRange(sourceFile: SourceFile, range: TextRange) { + this.changes.push({ kind: ChangeKind.Remove, sourceFile, range }); return this; } - public deleteRange(sourceFile: SourceFile, range: TextRange) { - this.changes.push({ sourceFile, range }); + public deleteNode(sourceFile: SourceFile, node: Node, options: ConfigurableStartEnd = {}) { + const startPosition = getAdjustedStartPosition(sourceFile, node, options, Position.FullStart); + const endPosition = getAdjustedEndPosition(sourceFile, node, options); + this.changes.push({ kind: ChangeKind.Remove, sourceFile, range: { pos: startPosition, end: endPosition } }); return this; } public deleteNodeRange(sourceFile: SourceFile, startNode: Node, endNode: Node, options: ConfigurableStartEnd = {}) { const startPosition = getAdjustedStartPosition(sourceFile, startNode, options, Position.FullStart); const endPosition = getAdjustedEndPosition(sourceFile, endNode, options); - this.changes.push({ sourceFile, options, range: { pos: startPosition, end: endPosition } }); + this.changes.push({ kind: ChangeKind.Remove, sourceFile, range: { pos: startPosition, end: endPosition } }); return this; } @@ -223,33 +254,74 @@ namespace ts.textChanges { } public replaceRange(sourceFile: SourceFile, range: TextRange, newNode: Node, options: InsertNodeOptions = {}) { - this.changes.push({ sourceFile, range, options, node: newNode }); + this.changes.push({ kind: ChangeKind.ReplaceWithSingleNode, sourceFile, range, options, node: newNode }); return this; } public replaceNode(sourceFile: SourceFile, oldNode: Node, newNode: Node, options: ChangeNodeOptions = {}) { const startPosition = getAdjustedStartPosition(sourceFile, oldNode, options, Position.Start); const endPosition = getAdjustedEndPosition(sourceFile, oldNode, options); - this.changes.push({ sourceFile, options, useIndentationFromFile: true, node: newNode, range: { pos: startPosition, end: endPosition } }); - return this; + return this.replaceWithSingle(sourceFile, startPosition, endPosition, newNode, options); } public replaceNodeRange(sourceFile: SourceFile, startNode: Node, endNode: Node, newNode: Node, options: ChangeNodeOptions = {}) { const startPosition = getAdjustedStartPosition(sourceFile, startNode, options, Position.Start); const endPosition = getAdjustedEndPosition(sourceFile, endNode, options); - this.changes.push({ sourceFile, options, useIndentationFromFile: true, node: newNode, range: { pos: startPosition, end: endPosition } }); + return this.replaceWithSingle(sourceFile, startPosition, endPosition, newNode, options); + } + + private replaceWithSingle(sourceFile: SourceFile, startPosition: number, endPosition: number, newNode: Node, options: ChangeNodeOptions): this { + this.changes.push({ + kind: ChangeKind.ReplaceWithSingleNode, + sourceFile, + options, + node: newNode, + range: { pos: startPosition, end: endPosition } + }); + return this; + } + + private replaceWithMultiple(sourceFile: SourceFile, startPosition: number, endPosition: number, newNodes: ReadonlyArray, options: ChangeMultipleNodesOptions): this { + this.changes.push({ + kind: ChangeKind.ReplaceWithMultipleNodes, + sourceFile, + options, + nodes: newNodes, + range: { pos: startPosition, end: endPosition } + }); return this; } + public replaceNodeWithNodes(sourceFile: SourceFile, oldNode: Node, newNodes: ReadonlyArray, options: ChangeMultipleNodesOptions) { + const startPosition = getAdjustedStartPosition(sourceFile, oldNode, options, Position.Start); + const endPosition = getAdjustedEndPosition(sourceFile, oldNode, options); + return this.replaceWithMultiple(sourceFile, startPosition, endPosition, newNodes, options); + } + + public replaceNodesWithNodes(sourceFile: SourceFile, oldNodes: ReadonlyArray, newNodes: ReadonlyArray, options: ChangeMultipleNodesOptions) { + const startPosition = getAdjustedStartPosition(sourceFile, oldNodes[0], options, Position.Start); + const endPosition = getAdjustedEndPosition(sourceFile, lastOrUndefined(oldNodes), options); + return this.replaceWithMultiple(sourceFile, startPosition, endPosition, newNodes, options); + } + + public replaceRangeWithNodes(sourceFile: SourceFile, range: TextRange, newNodes: ReadonlyArray, options: ChangeMultipleNodesOptions) { + return this.replaceWithMultiple(sourceFile, range.pos, range.end, newNodes, options); + } + + public replaceNodeRangeWithNodes(sourceFile: SourceFile, startNode: Node, endNode: Node, newNodes: ReadonlyArray, options: ChangeMultipleNodesOptions) { + const startPosition = getAdjustedStartPosition(sourceFile, startNode, options, Position.Start); + const endPosition = getAdjustedEndPosition(sourceFile, endNode, options); + return this.replaceWithMultiple(sourceFile, startPosition, endPosition, newNodes, options); + } + public insertNodeAt(sourceFile: SourceFile, pos: number, newNode: Node, options: InsertNodeOptions = {}) { - this.changes.push({ sourceFile, options, node: newNode, range: { pos, end: pos } }); + this.changes.push({ kind: ChangeKind.ReplaceWithSingleNode, sourceFile, options, node: newNode, range: { pos, end: pos } }); return this; } public insertNodeBefore(sourceFile: SourceFile, before: Node, newNode: Node, options: InsertNodeOptions & ConfigurableStart = {}) { const startPosition = getAdjustedStartPosition(sourceFile, before, options, Position.Start); - this.changes.push({ sourceFile, options, useIndentationFromFile: true, node: newNode, range: { pos: startPosition, end: startPosition } }); - return this; + return this.replaceWithSingle(sourceFile, startPosition, startPosition, newNode, options); } public insertNodeAfter(sourceFile: SourceFile, after: Node, newNode: Node, options: InsertNodeOptions & ConfigurableEnd = {}) { @@ -261,6 +333,7 @@ namespace ts.textChanges { // if not - insert semicolon to preserve the code from changing the meaning due to ASI if (sourceFile.text.charCodeAt(after.end - 1) !== CharacterCodes.semicolon) { this.changes.push({ + kind: ChangeKind.ReplaceWithSingleNode, sourceFile, options: {}, range: { pos: after.end, end: after.end }, @@ -269,8 +342,7 @@ namespace ts.textChanges { } } const endPosition = getAdjustedEndPosition(sourceFile, after, options); - this.changes.push({ sourceFile, options, useIndentationFromFile: true, node: newNode, range: { pos: endPosition, end: endPosition } }); - return this; + return this.replaceWithSingle(sourceFile, endPosition, endPosition, newNode, options); } /** @@ -339,10 +411,10 @@ namespace ts.textChanges { } this.changes.push({ + kind: ChangeKind.ReplaceWithSingleNode, sourceFile, range: { pos: startPos, end: containingList[index + 1].getStart(sourceFile) }, node: newNode, - useIndentationFromFile: true, options: { prefix, // write separator and leading trivia of the next element as suffix @@ -383,6 +455,7 @@ namespace ts.textChanges { if (multilineList) { // insert separator immediately following the 'after' node to preserve comments in trailing trivia this.changes.push({ + kind: ChangeKind.ReplaceWithSingleNode, sourceFile, range: { pos: end, end }, node: createToken(separator), @@ -396,6 +469,7 @@ namespace ts.textChanges { insertPos--; } this.changes.push({ + kind: ChangeKind.ReplaceWithSingleNode, sourceFile, range: { pos: insertPos, end: insertPos }, node: newNode, @@ -404,6 +478,7 @@ namespace ts.textChanges { } else { this.changes.push({ + kind: ChangeKind.ReplaceWithSingleNode, sourceFile, range: { pos: end, end }, node: newNode, @@ -446,38 +521,51 @@ namespace ts.textChanges { } private computeNewText(change: Change, sourceFile: SourceFile): string { - if (!change.node) { + if (change.kind === ChangeKind.Remove) { // deletion case return ""; } + const options = change.options || {}; - const nonFormattedText = getNonformattedText(change.node, sourceFile, this.newLine); + let text: string; + const pos = change.range.pos; + const posStartsLine = getLineStartPositionForPosition(pos, sourceFile) === pos; + if (change.kind === ChangeKind.ReplaceWithMultipleNodes) { + const parts = change.nodes.map(n => this.getFormattedTextOfNode(n, sourceFile, pos, options)); + text = parts.join(change.options.nodeSeparator); + } + else { + Debug.assert(change.kind === ChangeKind.ReplaceWithSingleNode, "change.kind === ReplaceWithSingleNode"); + text = this.getFormattedTextOfNode(change.node, sourceFile, pos, options); + } + // strip initial indentation (spaces or tabs) if text will be inserted in the middle of the line + text = (posStartsLine || options.indentation !== undefined) ? text : text.replace(/^\s+/, ""); + return (options.prefix || "") + text + (options.suffix || ""); + } + + private getFormattedTextOfNode(node: Node, sourceFile: SourceFile, pos: number, options: ChangeNodeOptions): string { + const nonformattedText = getNonformattedText(node, sourceFile, this.newLine); if (this.validator) { - this.validator(nonFormattedText); + this.validator(nonformattedText); } const formatOptions = this.rulesProvider.getFormatOptions(); - const pos = change.range.pos; const posStartsLine = getLineStartPositionForPosition(pos, sourceFile) === pos; const initialIndentation = - change.options.indentation !== undefined - ? change.options.indentation - : change.useIndentationFromFile - ? formatting.SmartIndenter.getIndentation(change.range.pos, sourceFile, formatOptions, posStartsLine || (change.options.prefix === this.newLineCharacter)) + options.indentation !== undefined + ? options.indentation + : (options.useIndentationFromFile !== false) + ? formatting.SmartIndenter.getIndentation(pos, sourceFile, formatOptions, posStartsLine || (options.prefix === this.newLineCharacter)) : 0; const delta = - change.options.delta !== undefined - ? change.options.delta - : formatting.SmartIndenter.shouldIndentChildNode(change.node) - ? formatOptions.indentSize + options.delta !== undefined + ? options.delta + : formatting.SmartIndenter.shouldIndentChildNode(node) + ? (formatOptions.indentSize || 0) : 0; - let text = applyFormatting(nonFormattedText, sourceFile, initialIndentation, delta, this.rulesProvider); - // strip initial indentation (spaces or tabs) if text will be inserted in the middle of the line - // however keep indentation if it is was forced - text = posStartsLine || change.options.indentation !== undefined ? text : text.replace(/^\s+/, ""); - return (options.prefix || "") + text + (options.suffix || ""); + return applyFormatting(nonformattedText, sourceFile, initialIndentation, delta, this.rulesProvider); } private static normalize(changes: Change[]): Change[] { @@ -654,4 +742,4 @@ namespace ts.textChanges { this.lastNonTriviaPosition = 0; } } -} \ No newline at end of file +} diff --git a/src/services/types.ts b/src/services/types.ts index 6ff7402f3ad0c..b034e2813c6e1 100644 --- a/src/services/types.ts +++ b/src/services/types.ts @@ -271,7 +271,6 @@ namespace ts { isValidBraceCompletionAtPosition(fileName: string, position: number, openingBrace: number): boolean; getCodeFixesAtPosition(fileName: string, start: number, end: number, errorCodes: number[], formatOptions: FormatCodeSettings): CodeAction[]; - getApplicableRefactors(fileName: string, positionOrRaneg: number | TextRange): ApplicableRefactorInfo[]; getEditsForRefactor(fileName: string, formatOptions: FormatCodeSettings, positionOrRange: number | TextRange, refactorName: string, actionName: string): RefactorEditInfo | undefined; diff --git a/tests/baselines/reference/extractMethod/extractMethod1.js b/tests/baselines/reference/extractMethod/extractMethod1.js new file mode 100644 index 0000000000000..60c7e301616e8 --- /dev/null +++ b/tests/baselines/reference/extractMethod/extractMethod1.js @@ -0,0 +1,98 @@ +==ORIGINAL== +namespace A { + let x = 1; + function foo() { + } + namespace B { + function a() { + let a = 1; + + let y = 5; + let z = x; + a = y; + foo(); + } + } +} +==SCOPE::function a== +namespace A { + let x = 1; + function foo() { + } + namespace B { + function a() { + let a = 1; + + newFunction(); + + function newFunction() { + let y = 5; + let z = x; + a = y; + foo(); + } + } + } +} +==SCOPE::namespace B== +namespace A { + let x = 1; + function foo() { + } + namespace B { + function a() { + let a = 1; + + a = newFunction(a); + } + + function newFunction(a: number) { + let y = 5; + let z = x; + a = y; + foo(); + return a; + } + } +} +==SCOPE::namespace A== +namespace A { + let x = 1; + function foo() { + } + namespace B { + function a() { + let a = 1; + + a = newFunction(a); + } + } + + function newFunction(a: number) { + let y = 5; + let z = x; + a = y; + foo(); + return a; + } +} +==SCOPE::file '/a.ts'== +namespace A { + let x = 1; + function foo() { + } + namespace B { + function a() { + let a = 1; + + a = newFunction(x, a, foo); + } + } +} +function newFunction(x: number, a: number, foo: () => void) { + let y = 5; + let z = x; + a = y; + foo(); + return a; +} diff --git a/tests/baselines/reference/extractMethod/extractMethod10.js b/tests/baselines/reference/extractMethod/extractMethod10.js new file mode 100644 index 0000000000000..02923b7ab50c7 --- /dev/null +++ b/tests/baselines/reference/extractMethod/extractMethod10.js @@ -0,0 +1,55 @@ +==ORIGINAL== +namespace A { + export interface I { x: number }; + class C { + a() { + let z = 1; + let a1: I = { x: 1 }; + return a1.x + 10; + } + } +} +==SCOPE::class C== +namespace A { + export interface I { x: number }; + class C { + a() { + let z = 1; + return this.newFunction(); + } + + private newFunction() { + let a1: I = { x: 1 }; + return a1.x + 10; + } + } +} +==SCOPE::namespace A== +namespace A { + export interface I { x: number }; + class C { + a() { + let z = 1; + return newFunction(); + } + } + + function newFunction() { + let a1: I = { x: 1 }; + return a1.x + 10; + } +} +==SCOPE::file '/a.ts'== +namespace A { + export interface I { x: number }; + class C { + a() { + let z = 1; + return newFunction(); + } + } +} +function newFunction() { + let a1: A.I = { x: 1 }; + return a1.x + 10; +} diff --git a/tests/baselines/reference/extractMethod/extractMethod11.js b/tests/baselines/reference/extractMethod/extractMethod11.js new file mode 100644 index 0000000000000..77565e7b0a778 --- /dev/null +++ b/tests/baselines/reference/extractMethod/extractMethod11.js @@ -0,0 +1,69 @@ +==ORIGINAL== +namespace A { + let y = 1; + class C { + a() { + let z = 1; + let a1 = { x: 1 }; + y = 10; + z = 42; + return a1.x + 10; + } + } +} +==SCOPE::class C== +namespace A { + let y = 1; + class C { + a() { + let z = 1; + var __return: any; + ({ __return, z } = this.newFunction(z)); + return __return; + } + + private newFunction(z: number) { + let a1 = { x: 1 }; + y = 10; + z = 42; + return { __return: a1.x + 10, z }; + } + } +} +==SCOPE::namespace A== +namespace A { + let y = 1; + class C { + a() { + let z = 1; + var __return: any; + ({ __return, z } = newFunction(z)); + return __return; + } + } + + function newFunction(z: number) { + let a1 = { x: 1 }; + y = 10; + z = 42; + return { __return: a1.x + 10, z }; + } +} +==SCOPE::file '/a.ts'== +namespace A { + let y = 1; + class C { + a() { + let z = 1; + var __return: any; + ({ __return, y, z } = newFunction(y, z)); + return __return; + } + } +} +function newFunction(y: number, z: number) { + let a1 = { x: 1 }; + y = 10; + z = 42; + return { __return: a1.x + 10, y, z }; +} diff --git a/tests/baselines/reference/extractMethod/extractMethod12.js b/tests/baselines/reference/extractMethod/extractMethod12.js new file mode 100644 index 0000000000000..8ff6e130dad2a --- /dev/null +++ b/tests/baselines/reference/extractMethod/extractMethod12.js @@ -0,0 +1,36 @@ +==ORIGINAL== +namespace A { + let y = 1; + class C { + b() {} + a() { + let z = 1; + let a1 = { x: 1 }; + y = 10; + z = 42; + this.b(); + return a1.x + 10; + } + } +} +==SCOPE::class C== +namespace A { + let y = 1; + class C { + b() {} + a() { + let z = 1; + var __return: any; + ({ __return, z } = this.newFunction(z)); + return __return; + } + + private newFunction(z: number) { + let a1 = { x: 1 }; + y = 10; + z = 42; + this.b(); + return { __return: a1.x + 10, z }; + } + } +} \ No newline at end of file diff --git a/tests/baselines/reference/extractMethod/extractMethod2.js b/tests/baselines/reference/extractMethod/extractMethod2.js new file mode 100644 index 0000000000000..28c27993d7165 --- /dev/null +++ b/tests/baselines/reference/extractMethod/extractMethod2.js @@ -0,0 +1,85 @@ +==ORIGINAL== +namespace A { + let x = 1; + function foo() { + } + namespace B { + function a() { + + let y = 5; + let z = x; + return foo(); + } + } +} +==SCOPE::function a== +namespace A { + let x = 1; + function foo() { + } + namespace B { + function a() { + + return newFunction(); + + function newFunction() { + let y = 5; + let z = x; + return foo(); + } + } + } +} +==SCOPE::namespace B== +namespace A { + let x = 1; + function foo() { + } + namespace B { + function a() { + + return newFunction(); + } + + function newFunction() { + let y = 5; + let z = x; + return foo(); + } + } +} +==SCOPE::namespace A== +namespace A { + let x = 1; + function foo() { + } + namespace B { + function a() { + + return newFunction(); + } + } + + function newFunction() { + let y = 5; + let z = x; + return foo(); + } +} +==SCOPE::file '/a.ts'== +namespace A { + let x = 1; + function foo() { + } + namespace B { + function a() { + + return newFunction(x, foo); + } + } +} +function newFunction(x: number, foo: () => void) { + let y = 5; + let z = x; + return foo(); +} diff --git a/tests/baselines/reference/extractMethod/extractMethod3.js b/tests/baselines/reference/extractMethod/extractMethod3.js new file mode 100644 index 0000000000000..e5903ead18199 --- /dev/null +++ b/tests/baselines/reference/extractMethod/extractMethod3.js @@ -0,0 +1,80 @@ +==ORIGINAL== +namespace A { + function foo() { + } + namespace B { + function* a(z: number) { + + let y = 5; + yield z; + return foo(); + } + } +} +==SCOPE::function a== +namespace A { + function foo() { + } + namespace B { + function* a(z: number) { + + return yield* newFunction(); + + function* newFunction() { + let y = 5; + yield z; + return foo(); + } + } + } +} +==SCOPE::namespace B== +namespace A { + function foo() { + } + namespace B { + function* a(z: number) { + + return yield* newFunction(z); + } + + function* newFunction(z: number) { + let y = 5; + yield z; + return foo(); + } + } +} +==SCOPE::namespace A== +namespace A { + function foo() { + } + namespace B { + function* a(z: number) { + + return yield* newFunction(z); + } + } + + function* newFunction(z: number) { + let y = 5; + yield z; + return foo(); + } +} +==SCOPE::file '/a.ts'== +namespace A { + function foo() { + } + namespace B { + function* a(z: number) { + + return yield* newFunction(z, foo); + } + } +} +function* newFunction(z: number, foo: () => void) { + let y = 5; + yield z; + return foo(); +} diff --git a/tests/baselines/reference/extractMethod/extractMethod4.js b/tests/baselines/reference/extractMethod/extractMethod4.js new file mode 100644 index 0000000000000..6b9e2eed099d3 --- /dev/null +++ b/tests/baselines/reference/extractMethod/extractMethod4.js @@ -0,0 +1,90 @@ +==ORIGINAL== +namespace A { + function foo() { + } + namespace B { + async function a(z: number, z1: any) { + + let y = 5; + if (z) { + await z1; + } + return foo(); + } + } +} +==SCOPE::function a== +namespace A { + function foo() { + } + namespace B { + async function a(z: number, z1: any) { + + return await newFunction(); + + async function newFunction() { + let y = 5; + if(z) { + await z1; + } + return foo(); + } + } + } +} +==SCOPE::namespace B== +namespace A { + function foo() { + } + namespace B { + async function a(z: number, z1: any) { + + return await newFunction(z, z1); + } + + async function newFunction(z: number, z1: any) { + let y = 5; + if(z) { + await z1; + } + return foo(); + } + } +} +==SCOPE::namespace A== +namespace A { + function foo() { + } + namespace B { + async function a(z: number, z1: any) { + + return await newFunction(z, z1); + } + } + + async function newFunction(z: number, z1: any) { + let y = 5; + if(z) { + await z1; + } + return foo(); + } +} +==SCOPE::file '/a.ts'== +namespace A { + function foo() { + } + namespace B { + async function a(z: number, z1: any) { + + return await newFunction(z, z1, foo); + } + } +} +async function newFunction(z: number, z1: any, foo: () => void) { + let y = 5; + if(z) { + await z1; +} + return foo(); +} diff --git a/tests/baselines/reference/extractMethod/extractMethod5.js b/tests/baselines/reference/extractMethod/extractMethod5.js new file mode 100644 index 0000000000000..cf63cb2a93214 --- /dev/null +++ b/tests/baselines/reference/extractMethod/extractMethod5.js @@ -0,0 +1,98 @@ +==ORIGINAL== +namespace A { + let x = 1; + export function foo() { + } + namespace B { + function a() { + let a = 1; + + let y = 5; + let z = x; + a = y; + foo(); + } + } +} +==SCOPE::function a== +namespace A { + let x = 1; + export function foo() { + } + namespace B { + function a() { + let a = 1; + + newFunction(); + + function newFunction() { + let y = 5; + let z = x; + a = y; + foo(); + } + } + } +} +==SCOPE::namespace B== +namespace A { + let x = 1; + export function foo() { + } + namespace B { + function a() { + let a = 1; + + a = newFunction(a); + } + + function newFunction(a: number) { + let y = 5; + let z = x; + a = y; + foo(); + return a; + } + } +} +==SCOPE::namespace A== +namespace A { + let x = 1; + export function foo() { + } + namespace B { + function a() { + let a = 1; + + a = newFunction(a); + } + } + + function newFunction(a: number) { + let y = 5; + let z = x; + a = y; + foo(); + return a; + } +} +==SCOPE::file '/a.ts'== +namespace A { + let x = 1; + export function foo() { + } + namespace B { + function a() { + let a = 1; + + a = newFunction(x, a); + } + } +} +function newFunction(x: number, a: number) { + let y = 5; + let z = x; + a = y; + A.foo(); + return a; +} diff --git a/tests/baselines/reference/extractMethod/extractMethod6.js b/tests/baselines/reference/extractMethod/extractMethod6.js new file mode 100644 index 0000000000000..99f52e9febbe0 --- /dev/null +++ b/tests/baselines/reference/extractMethod/extractMethod6.js @@ -0,0 +1,101 @@ +==ORIGINAL== +namespace A { + let x = 1; + export function foo() { + } + namespace B { + function a() { + let a = 1; + + let y = 5; + let z = x; + a = y; + return foo(); + } + } +} +==SCOPE::function a== +namespace A { + let x = 1; + export function foo() { + } + namespace B { + function a() { + let a = 1; + + return newFunction(); + + function newFunction() { + let y = 5; + let z = x; + a = y; + return foo(); + } + } + } +} +==SCOPE::namespace B== +namespace A { + let x = 1; + export function foo() { + } + namespace B { + function a() { + let a = 1; + + var __return: any; + ({ __return, a } = newFunction(a)); + return __return; + } + + function newFunction(a: number) { + let y = 5; + let z = x; + a = y; + return { __return: foo(), a }; + } + } +} +==SCOPE::namespace A== +namespace A { + let x = 1; + export function foo() { + } + namespace B { + function a() { + let a = 1; + + var __return: any; + ({ __return, a } = newFunction(a)); + return __return; + } + } + + function newFunction(a: number) { + let y = 5; + let z = x; + a = y; + return { __return: foo(), a }; + } +} +==SCOPE::file '/a.ts'== +namespace A { + let x = 1; + export function foo() { + } + namespace B { + function a() { + let a = 1; + + var __return: any; + ({ __return, a } = newFunction(x, a)); + return __return; + } + } +} +function newFunction(x: number, a: number) { + let y = 5; + let z = x; + a = y; + return { __return: A.foo(), a }; +} diff --git a/tests/baselines/reference/extractMethod/extractMethod7.js b/tests/baselines/reference/extractMethod/extractMethod7.js new file mode 100644 index 0000000000000..09d5edaa2c05d --- /dev/null +++ b/tests/baselines/reference/extractMethod/extractMethod7.js @@ -0,0 +1,111 @@ +==ORIGINAL== +namespace A { + let x = 1; + export namespace C { + export function foo() { + } + } + namespace B { + function a() { + let a = 1; + + let y = 5; + let z = x; + a = y; + return C.foo(); + } + } +} +==SCOPE::function a== +namespace A { + let x = 1; + export namespace C { + export function foo() { + } + } + namespace B { + function a() { + let a = 1; + + return newFunction(); + + function newFunction() { + let y = 5; + let z = x; + a = y; + return C.foo(); + } + } + } +} +==SCOPE::namespace B== +namespace A { + let x = 1; + export namespace C { + export function foo() { + } + } + namespace B { + function a() { + let a = 1; + + var __return: any; + ({ __return, a } = newFunction(a)); + return __return; + } + + function newFunction(a: number) { + let y = 5; + let z = x; + a = y; + return { __return: C.foo(), a }; + } + } +} +==SCOPE::namespace A== +namespace A { + let x = 1; + export namespace C { + export function foo() { + } + } + namespace B { + function a() { + let a = 1; + + var __return: any; + ({ __return, a } = newFunction(a)); + return __return; + } + } + + function newFunction(a: number) { + let y = 5; + let z = x; + a = y; + return { __return: C.foo(), a }; + } +} +==SCOPE::file '/a.ts'== +namespace A { + let x = 1; + export namespace C { + export function foo() { + } + } + namespace B { + function a() { + let a = 1; + + var __return: any; + ({ __return, a } = newFunction(x, a)); + return __return; + } + } +} +function newFunction(x: number, a: number) { + let y = 5; + let z = x; + a = y; + return { __return: A.C.foo(), a }; +} diff --git a/tests/baselines/reference/extractMethod/extractMethod8.js b/tests/baselines/reference/extractMethod/extractMethod8.js new file mode 100644 index 0000000000000..fe9cf2a92f0fd --- /dev/null +++ b/tests/baselines/reference/extractMethod/extractMethod8.js @@ -0,0 +1,65 @@ +==ORIGINAL== +namespace A { + let x = 1; + namespace B { + function a() { + let a1 = 1; + return 1 + a1 + x + 100; + } + } +} +==SCOPE::function a== +namespace A { + let x = 1; + namespace B { + function a() { + let a1 = 1; + return newFunction() + 100; + + function newFunction() { + return 1 + a1 + x; + } + } + } +} +==SCOPE::namespace B== +namespace A { + let x = 1; + namespace B { + function a() { + let a1 = 1; + return newFunction(a1) + 100; + } + + function newFunction(a1: number) { + return 1 + a1 + x; + } + } +} +==SCOPE::namespace A== +namespace A { + let x = 1; + namespace B { + function a() { + let a1 = 1; + return newFunction(a1) + 100; + } + } + + function newFunction(a1: number) { + return 1 + a1 + x; + } +} +==SCOPE::file '/a.ts'== +namespace A { + let x = 1; + namespace B { + function a() { + let a1 = 1; + return newFunction(a1, x) + 100; + } + } +} +function newFunction(a1: number, x: number) { + return 1 + a1 + x; +} diff --git a/tests/baselines/reference/extractMethod/extractMethod9.js b/tests/baselines/reference/extractMethod/extractMethod9.js new file mode 100644 index 0000000000000..fcc5dcd23de07 --- /dev/null +++ b/tests/baselines/reference/extractMethod/extractMethod9.js @@ -0,0 +1,65 @@ +==ORIGINAL== +namespace A { + export interface I { x: number }; + namespace B { + function a() { + let a1: I = { x: 1 }; + return a1.x + 10; + } + } +} +==SCOPE::function a== +namespace A { + export interface I { x: number }; + namespace B { + function a() { + return newFunction(); + + function newFunction() { + let a1: I = { x: 1 }; + return a1.x + 10; + } + } + } +} +==SCOPE::namespace B== +namespace A { + export interface I { x: number }; + namespace B { + function a() { + return newFunction(); + } + + function newFunction() { + let a1: I = { x: 1 }; + return a1.x + 10; + } + } +} +==SCOPE::namespace A== +namespace A { + export interface I { x: number }; + namespace B { + function a() { + return newFunction(); + } + } + + function newFunction() { + let a1: I = { x: 1 }; + return a1.x + 10; + } +} +==SCOPE::file '/a.ts'== +namespace A { + export interface I { x: number }; + namespace B { + function a() { + return newFunction(); + } + } +} +function newFunction() { + let a1: A.I = { x: 1 }; + return a1.x + 10; +} diff --git a/tests/baselines/reference/extractMethod1.js b/tests/baselines/reference/extractMethod1.js new file mode 100644 index 0000000000000..699916b0dc229 --- /dev/null +++ b/tests/baselines/reference/extractMethod1.js @@ -0,0 +1,98 @@ +==ORIGINAL== +namespace A { + let x = 1; + function foo() { + } + namespace B { + function a() { + let a = 1; + + let y = 5; + let z = x; + a = y; + foo(); + } + } +} +==SCOPE::function a== +namespace A { + let x = 1; + function foo() { + } + namespace B { + function a() { + let a = 1; + + newFunction(); + + function newFunction() { + let y = 5; + let z = x; + a = y; + foo(); + } + } + } +} +==SCOPE::namespace B== +namespace A { + let x = 1; + function foo() { + } + namespace B { + function a() { + let a = 1; + + ({ a } = newFunction(a)); + } + + function newFunction(a: any) { + let y = 5; + let z = x; + a = y; + foo(); + return { a }; + } + } +} +==SCOPE::namespace A== +namespace A { + let x = 1; + function foo() { + } + namespace B { + function a() { + let a = 1; + + ({ a } = newFunction(a)); + } + } + + function newFunction(a: any) { + let y = 5; + let z = x; + a = y; + foo(); + return { a }; + } +} +==SCOPE::file '/a.ts'== +namespace A { + let x = 1; + function foo() { + } + namespace B { + function a() { + let a = 1; + + ({ a } = newFunction(x, a, foo)); + } + } +} +function newFunction(x: any, a: any, foo: any) { + let y = 5; + let z = x; + a = y; + foo(); + return { a }; +} diff --git a/tests/baselines/reference/extractMethod10.js b/tests/baselines/reference/extractMethod10.js new file mode 100644 index 0000000000000..e416a66e262ac --- /dev/null +++ b/tests/baselines/reference/extractMethod10.js @@ -0,0 +1,70 @@ +==ORIGINAL== +namespace A { + export interface I { x: number }; + class C { + a() { + let z = 1; + let a1: I = { x: 1 }; + return a1.x + 10; + } + } +} +==SCOPE::method a== +namespace A { + export interface I { x: number }; + class C { + a() { + let z = 1; + return newFunction(); + + function newFunction() { + let a1: I = { x: 1 }; + return a1.x + 10; + } + } + } +} +==SCOPE::class C== +namespace A { + export interface I { x: number }; + class C { + a() { + let z = 1; + return this.newFunction(); + } + + private newFunction() { + let a1: I = { x: 1 }; + return a1.x + 10; + } + } +} +==SCOPE::namespace A== +namespace A { + export interface I { x: number }; + class C { + a() { + let z = 1; + return newFunction(); + } + } + + function newFunction() { + let a1: I = { x: 1 }; + return a1.x + 10; + } +} +==SCOPE::file '/a.ts'== +namespace A { + export interface I { x: number }; + class C { + a() { + let z = 1; + return newFunction(); + } + } +} +function newFunction() { + let a1: A.I = { x: 1 }; + return a1.x + 10; +} diff --git a/tests/baselines/reference/extractMethod11.js b/tests/baselines/reference/extractMethod11.js new file mode 100644 index 0000000000000..4cbd31d445321 --- /dev/null +++ b/tests/baselines/reference/extractMethod11.js @@ -0,0 +1,86 @@ +==ORIGINAL== +namespace A { + let y = 1; + class C { + a() { + let z = 1; + let a1 = { x: 1 }; + y = 10; + z = 42; + return a1.x + 10; + } + } +} +==SCOPE::method a== +namespace A { + let y = 1; + class C { + a() { + let z = 1; + return newFunction(); + + function newFunction() { + let a1 = { x: 1 }; + y = 10; + z = 42; + return a1.x + 10; + } + } + } +} +==SCOPE::class C== +namespace A { + let y = 1; + class C { + a() { + let z = 1; + var __return: any; + ({ z, __return } = this.newFunction(z)); + return __return; + } + + private newFunction(z: any) { + let a1 = { x: 1 }; + y = 10; + z = 42; + return { z, __return: a1.x + 10 }; + } + } +} +==SCOPE::namespace A== +namespace A { + let y = 1; + class C { + a() { + let z = 1; + var __return: any; + ({ z, __return } = newFunction(z)); + return __return; + } + } + + function newFunction(z: any) { + let a1 = { x: 1 }; + y = 10; + z = 42; + return { z, __return: a1.x + 10 }; + } +} +==SCOPE::file '/a.ts'== +namespace A { + let y = 1; + class C { + a() { + let z = 1; + var __return: any; + ({ y, z, __return } = newFunction(y, z)); + return __return; + } + } +} +function newFunction(y: any, z: any) { + let a1 = { x: 1 }; + y = 10; + z = 42; + return { y, z, __return: a1.x + 10 }; +} diff --git a/tests/baselines/reference/extractMethod12.js b/tests/baselines/reference/extractMethod12.js new file mode 100644 index 0000000000000..da0788a937fcf --- /dev/null +++ b/tests/baselines/reference/extractMethod12.js @@ -0,0 +1,36 @@ +==ORIGINAL== +namespace A { + let y = 1; + class C { + b() {} + a() { + let z = 1; + let a1 = { x: 1 }; + y = 10; + z = 42; + this.b(); + return a1.x + 10; + } + } +} +==SCOPE::class C== +namespace A { + let y = 1; + class C { + b() {} + a() { + let z = 1; + var __return: any; + ({ z, __return } = this.newFunction(z)); + return __return; + } + + private newFunction(z: any) { + let a1 = { x: 1 }; + y = 10; + z = 42; + this.b(); + return { z, __return: a1.x + 10 }; + } + } +} \ No newline at end of file diff --git a/tests/baselines/reference/extractMethod2.js b/tests/baselines/reference/extractMethod2.js new file mode 100644 index 0000000000000..a89fe52f2fb54 --- /dev/null +++ b/tests/baselines/reference/extractMethod2.js @@ -0,0 +1,85 @@ +==ORIGINAL== +namespace A { + let x = 1; + function foo() { + } + namespace B { + function a() { + + let y = 5; + let z = x; + return foo(); + } + } +} +==SCOPE::function a== +namespace A { + let x = 1; + function foo() { + } + namespace B { + function a() { + + return newFunction(); + + function newFunction() { + let y = 5; + let z = x; + return foo(); + } + } + } +} +==SCOPE::namespace B== +namespace A { + let x = 1; + function foo() { + } + namespace B { + function a() { + + return newFunction(); + } + + function newFunction() { + let y = 5; + let z = x; + return foo(); + } + } +} +==SCOPE::namespace A== +namespace A { + let x = 1; + function foo() { + } + namespace B { + function a() { + + return newFunction(); + } + } + + function newFunction() { + let y = 5; + let z = x; + return foo(); + } +} +==SCOPE::file '/a.ts'== +namespace A { + let x = 1; + function foo() { + } + namespace B { + function a() { + + return newFunction(x, foo); + } + } +} +function newFunction(x: any, foo: any) { + let y = 5; + let z = x; + return foo(); +} diff --git a/tests/baselines/reference/extractMethod3.js b/tests/baselines/reference/extractMethod3.js new file mode 100644 index 0000000000000..847e196130ce5 --- /dev/null +++ b/tests/baselines/reference/extractMethod3.js @@ -0,0 +1,80 @@ +==ORIGINAL== +namespace A { + function foo() { + } + namespace B { + function* a(z: number) { + + let y = 5; + yield z; + return foo(); + } + } +} +==SCOPE::function a== +namespace A { + function foo() { + } + namespace B { + function* a(z: number) { + + return yield* newFunction(); + + function* newFunction() { + let y = 5; + yield z; + return foo(); + } + } + } +} +==SCOPE::namespace B== +namespace A { + function foo() { + } + namespace B { + function* a(z: number) { + + return yield* newFunction(z); + } + + function* newFunction(z: any) { + let y = 5; + yield z; + return foo(); + } + } +} +==SCOPE::namespace A== +namespace A { + function foo() { + } + namespace B { + function* a(z: number) { + + return yield* newFunction(z); + } + } + + function* newFunction(z: any) { + let y = 5; + yield z; + return foo(); + } +} +==SCOPE::file '/a.ts'== +namespace A { + function foo() { + } + namespace B { + function* a(z: number) { + + return yield* newFunction(z, foo); + } + } +} +function* newFunction(z: any, foo: any) { + let y = 5; + yield z; + return foo(); +} diff --git a/tests/baselines/reference/extractMethod4.js b/tests/baselines/reference/extractMethod4.js new file mode 100644 index 0000000000000..25f410eeecbde --- /dev/null +++ b/tests/baselines/reference/extractMethod4.js @@ -0,0 +1,90 @@ +==ORIGINAL== +namespace A { + function foo() { + } + namespace B { + async function a(z: number, z1: any) { + + let y = 5; + if (z) { + await z1; + } + return foo(); + } + } +} +==SCOPE::function a== +namespace A { + function foo() { + } + namespace B { + async function a(z: number, z1: any) { + + return await newFunction(); + + async function newFunction() { + let y = 5; + if (z) { + await z1; + } + return foo(); + } + } + } +} +==SCOPE::namespace B== +namespace A { + function foo() { + } + namespace B { + async function a(z: number, z1: any) { + + return await newFunction(z, z1); + } + + async function newFunction(z: any, z1: any) { + let y = 5; + if (z) { + await z1; + } + return foo(); + } + } +} +==SCOPE::namespace A== +namespace A { + function foo() { + } + namespace B { + async function a(z: number, z1: any) { + + return await newFunction(z, z1); + } + } + + async function newFunction(z: any, z1: any) { + let y = 5; + if (z) { + await z1; + } + return foo(); + } +} +==SCOPE::file '/a.ts'== +namespace A { + function foo() { + } + namespace B { + async function a(z: number, z1: any) { + + return await newFunction(z, z1, foo); + } + } +} +async function newFunction(z: any, z1: any, foo: any) { + let y = 5; + if (z) { + await z1; + } + return foo(); +} diff --git a/tests/baselines/reference/extractMethod5.js b/tests/baselines/reference/extractMethod5.js new file mode 100644 index 0000000000000..135c4ed5f621c --- /dev/null +++ b/tests/baselines/reference/extractMethod5.js @@ -0,0 +1,98 @@ +==ORIGINAL== +namespace A { + let x = 1; + export function foo() { + } + namespace B { + function a() { + let a = 1; + + let y = 5; + let z = x; + a = y; + foo(); + } + } +} +==SCOPE::function a== +namespace A { + let x = 1; + export function foo() { + } + namespace B { + function a() { + let a = 1; + + newFunction(); + + function newFunction() { + let y = 5; + let z = x; + a = y; + foo(); + } + } + } +} +==SCOPE::namespace B== +namespace A { + let x = 1; + export function foo() { + } + namespace B { + function a() { + let a = 1; + + ({ a } = newFunction(a)); + } + + function newFunction(a: any) { + let y = 5; + let z = x; + a = y; + foo(); + return { a }; + } + } +} +==SCOPE::namespace A== +namespace A { + let x = 1; + export function foo() { + } + namespace B { + function a() { + let a = 1; + + ({ a } = newFunction(a)); + } + } + + function newFunction(a: any) { + let y = 5; + let z = x; + a = y; + foo(); + return { a }; + } +} +==SCOPE::file '/a.ts'== +namespace A { + let x = 1; + export function foo() { + } + namespace B { + function a() { + let a = 1; + + ({ a } = newFunction(x, a)); + } + } +} +function newFunction(x: any, a: any) { + let y = 5; + let z = x; + a = y; + A.foo(); + return { a }; +} diff --git a/tests/baselines/reference/extractMethod6.js b/tests/baselines/reference/extractMethod6.js new file mode 100644 index 0000000000000..94fcc8e6e310d --- /dev/null +++ b/tests/baselines/reference/extractMethod6.js @@ -0,0 +1,101 @@ +==ORIGINAL== +namespace A { + let x = 1; + export function foo() { + } + namespace B { + function a() { + let a = 1; + + let y = 5; + let z = x; + a = y; + return foo(); + } + } +} +==SCOPE::function a== +namespace A { + let x = 1; + export function foo() { + } + namespace B { + function a() { + let a = 1; + + return newFunction(); + + function newFunction() { + let y = 5; + let z = x; + a = y; + return foo(); + } + } + } +} +==SCOPE::namespace B== +namespace A { + let x = 1; + export function foo() { + } + namespace B { + function a() { + let a = 1; + + var __return: any; + ({ a, __return } = newFunction(a)); + return __return; + } + + function newFunction(a: any) { + let y = 5; + let z = x; + a = y; + return { a, __return: foo() }; + } + } +} +==SCOPE::namespace A== +namespace A { + let x = 1; + export function foo() { + } + namespace B { + function a() { + let a = 1; + + var __return: any; + ({ a, __return } = newFunction(a)); + return __return; + } + } + + function newFunction(a: any) { + let y = 5; + let z = x; + a = y; + return { a, __return: foo() }; + } +} +==SCOPE::file '/a.ts'== +namespace A { + let x = 1; + export function foo() { + } + namespace B { + function a() { + let a = 1; + + var __return: any; + ({ a, __return } = newFunction(x, a)); + return __return; + } + } +} +function newFunction(x: any, a: any) { + let y = 5; + let z = x; + a = y; + return { a, __return: A.foo() }; +} diff --git a/tests/baselines/reference/extractMethod7.js b/tests/baselines/reference/extractMethod7.js new file mode 100644 index 0000000000000..c7c3cc8d77a7c --- /dev/null +++ b/tests/baselines/reference/extractMethod7.js @@ -0,0 +1,111 @@ +==ORIGINAL== +namespace A { + let x = 1; + export namespace C { + export function foo() { + } + } + namespace B { + function a() { + let a = 1; + + let y = 5; + let z = x; + a = y; + return C.foo(); + } + } +} +==SCOPE::function a== +namespace A { + let x = 1; + export namespace C { + export function foo() { + } + } + namespace B { + function a() { + let a = 1; + + return newFunction(); + + function newFunction() { + let y = 5; + let z = x; + a = y; + return C.foo(); + } + } + } +} +==SCOPE::namespace B== +namespace A { + let x = 1; + export namespace C { + export function foo() { + } + } + namespace B { + function a() { + let a = 1; + + var __return: any; + ({ a, __return } = newFunction(a)); + return __return; + } + + function newFunction(a: any) { + let y = 5; + let z = x; + a = y; + return { a, __return: C.foo() }; + } + } +} +==SCOPE::namespace A== +namespace A { + let x = 1; + export namespace C { + export function foo() { + } + } + namespace B { + function a() { + let a = 1; + + var __return: any; + ({ a, __return } = newFunction(a)); + return __return; + } + } + + function newFunction(a: any) { + let y = 5; + let z = x; + a = y; + return { a, __return: C.foo() }; + } +} +==SCOPE::file '/a.ts'== +namespace A { + let x = 1; + export namespace C { + export function foo() { + } + } + namespace B { + function a() { + let a = 1; + + var __return: any; + ({ a, __return } = newFunction(x, a)); + return __return; + } + } +} +function newFunction(x: any, a: any) { + let y = 5; + let z = x; + a = y; + return { a, __return: A.C.foo() }; +} diff --git a/tests/baselines/reference/extractMethod8.js b/tests/baselines/reference/extractMethod8.js new file mode 100644 index 0000000000000..f030b0ea4afac --- /dev/null +++ b/tests/baselines/reference/extractMethod8.js @@ -0,0 +1,57 @@ +==ORIGINAL== +namespace A { + let x = 1; + namespace B { + function a() { + let a1 = 1; + return 1 + a1 + x + 100; + } + } +} +==SCOPE::function a== +namespace A { + let x = 1; + namespace B { + function a() { + let a1 = 1; + return newFunction() + 100; + + function newFunction() { 1 + a1 + x; } + } + } +} +==SCOPE::namespace B== +namespace A { + let x = 1; + namespace B { + function a() { + let a1 = 1; + return newFunction(a1) + 100; + } + + function newFunction(a1: any) { 1 + a1 + x; } + } +} +==SCOPE::namespace A== +namespace A { + let x = 1; + namespace B { + function a() { + let a1 = 1; + return newFunction(a1) + 100; + } + } + + function newFunction(a1: any) { 1 + a1 + x; } +} +==SCOPE::file '/a.ts'== +namespace A { + let x = 1; + namespace B { + function a() { + let a1 = 1; + return newFunction(a1, x) + 100; + } + } +} +function newFunction(a1: any, x: any) { 1 + a1 + x; } diff --git a/tests/baselines/reference/extractMethod9.js b/tests/baselines/reference/extractMethod9.js new file mode 100644 index 0000000000000..fcc5dcd23de07 --- /dev/null +++ b/tests/baselines/reference/extractMethod9.js @@ -0,0 +1,65 @@ +==ORIGINAL== +namespace A { + export interface I { x: number }; + namespace B { + function a() { + let a1: I = { x: 1 }; + return a1.x + 10; + } + } +} +==SCOPE::function a== +namespace A { + export interface I { x: number }; + namespace B { + function a() { + return newFunction(); + + function newFunction() { + let a1: I = { x: 1 }; + return a1.x + 10; + } + } + } +} +==SCOPE::namespace B== +namespace A { + export interface I { x: number }; + namespace B { + function a() { + return newFunction(); + } + + function newFunction() { + let a1: I = { x: 1 }; + return a1.x + 10; + } + } +} +==SCOPE::namespace A== +namespace A { + export interface I { x: number }; + namespace B { + function a() { + return newFunction(); + } + } + + function newFunction() { + let a1: I = { x: 1 }; + return a1.x + 10; + } +} +==SCOPE::file '/a.ts'== +namespace A { + export interface I { x: number }; + namespace B { + function a() { + return newFunction(); + } + } +} +function newFunction() { + let a1: A.I = { x: 1 }; + return a1.x + 10; +} diff --git a/tests/cases/fourslash/completionListIsGlobalCompletion.ts b/tests/cases/fourslash/completionListIsGlobalCompletion.ts index 121ab940d6549..49196bdabd4f6 100644 --- a/tests/cases/fourslash/completionListIsGlobalCompletion.ts +++ b/tests/cases/fourslash/completionListIsGlobalCompletion.ts @@ -47,7 +47,7 @@ verify.completionListIsGlobal(true); goTo.marker("6"); verify.completionListIsGlobal(false); goTo.marker("7"); -verify.completionListIsGlobal(true); +verify.completionListIsGlobal(false); goTo.marker("8"); verify.completionListIsGlobal(false); goTo.marker("9"); diff --git a/tests/cases/fourslash/extract-method1.ts b/tests/cases/fourslash/extract-method1.ts new file mode 100644 index 0000000000000..7f5c2ac2d500a --- /dev/null +++ b/tests/cases/fourslash/extract-method1.ts @@ -0,0 +1,33 @@ +/// + +//// class Foo { +//// someMethod(m: number) { +//// /*start*/var x = m; +//// x = x * 3; +//// var y = 30; +//// var z = y + x; +//// console.log(z);/*end*/ +//// var q = 10; +//// return q; +//// } +//// } + +goTo.select('start', 'end') +verify.refactorAvailable('Extract Method'); +edit.applyRefactor('Extract Method', "scope_0"); +verify.currentFileContentIs( +`class Foo { + someMethod(m: number) { + this.newFunction(m); + var q = 10; + return q; + } + + private newFunction(m: number) { + var x = m; + x = x * 3; + var y = 30; + var z = y + x; + console.log(z); + } +}`); diff --git a/tests/cases/fourslash/extract-method10.ts b/tests/cases/fourslash/extract-method10.ts new file mode 100644 index 0000000000000..1a02bfa00f53e --- /dev/null +++ b/tests/cases/fourslash/extract-method10.ts @@ -0,0 +1,6 @@ +/// + +//// (x => x)(/*1*/x => x/*2*/)(1); + +goTo.select('1', '2'); +edit.applyRefactor('Extract Method', 'scope_0'); diff --git a/tests/cases/fourslash/extract-method11.ts b/tests/cases/fourslash/extract-method11.ts new file mode 100644 index 0000000000000..705f2373104de --- /dev/null +++ b/tests/cases/fourslash/extract-method11.ts @@ -0,0 +1,28 @@ +/// + +// Nonexhaustive list of things it should be illegal to be extract-method on + +// * Import declarations +// * Super calls +// * Function body blocks +// * try/catch blocks + +//// /*1a*/import * as x from 'y';/*1b*/ +//// namespace N { +//// /*oka*/class C extends B { +//// constructor() { +//// /*2a*/super();/*2b*/ +//// } +//// }/*okb*/ +//// } +//// function f() /*3a*/{ return 0 }/*3b*/ +//// try /*4a*/{ console.log }/*4b*/ catch (e) /*5a*/{ console.log; }/*5b*/ + +for (const m of ['1', '2', '3', '4', '5']) { + goTo.select(m + 'a', m + 'b'); + verify.not.refactorAvailable('Extract Method'); +} + +// Verify we can still extract the entire class +goTo.select('oka', 'okb'); +verify.refactorAvailable('Extract Method'); diff --git a/tests/cases/fourslash/extract-method13.ts b/tests/cases/fourslash/extract-method13.ts new file mode 100644 index 0000000000000..b9b7c0096aabc --- /dev/null +++ b/tests/cases/fourslash/extract-method13.ts @@ -0,0 +1,30 @@ +/// + +// Extracting from a static context should make static methods. +// Also checks that we correctly find non-conflicting names in static contexts. + +//// class C { +//// static j = /*c*/100/*d*/; +//// constructor(q: string = /*a*/"hello"/*b*/) { +//// } +//// } + +goTo.select('a', 'b'); +edit.applyRefactor('Extract Method', 'scope_0'); + +goTo.select('c', 'd'); +edit.applyRefactor('Extract Method', 'scope_0'); + +verify.currentFileContentIs(`class C { + static j = C.newFunction_1(); + constructor(q: string = C.newFunction()) { + } + + private static newFunction(): string { + return "hello"; + } + + private static newFunction_1() { + return 100; + } +}`); \ No newline at end of file diff --git a/tests/cases/fourslash/extract-method14.ts b/tests/cases/fourslash/extract-method14.ts new file mode 100644 index 0000000000000..c8bab1b3a56d7 --- /dev/null +++ b/tests/cases/fourslash/extract-method14.ts @@ -0,0 +1,24 @@ +/// + +// Don't emit type annotations in JavaScript files +// Also tests that single-variable return extractions don't get superfluous destructuring + +// @allowNonTsExtensions: true +// @Filename: foo.js +//// function foo() { +//// var i = 10; +//// /*a*/return i++;/*b*/ +//// } + +goTo.select('a', 'b'); +edit.applyRefactor('Extract Method', 'scope_1'); +verify.currentFileContentIs(`function foo() { + var i = 10; + var __return: any; + ({ __return, i } = newFunction(i)); + return __return; +} +function newFunction(i) { + return { __return: i++, i }; +} +`); \ No newline at end of file diff --git a/tests/cases/fourslash/extract-method15.ts b/tests/cases/fourslash/extract-method15.ts new file mode 100644 index 0000000000000..ef62bd3fd3f74 --- /dev/null +++ b/tests/cases/fourslash/extract-method15.ts @@ -0,0 +1,22 @@ +/// + +// Extracting an increment expression (not statement) should do the right thing, +// including not generating extra destructuring unless needed + +//// function foo() { +//// var i = 10; +//// /*a*/i++/*b*/; +//// } + +goTo.select('a', 'b'); +edit.applyRefactor('Extract Method', 'scope_1'); + +verify.currentFileContentIs(`function foo() { + var i = 10; + i = newFunction(i); +} +function newFunction(i: number) { + i++; + return i; +} +`); diff --git a/tests/cases/fourslash/extract-method17.ts b/tests/cases/fourslash/extract-method17.ts new file mode 100644 index 0000000000000..ce54896604dd9 --- /dev/null +++ b/tests/cases/fourslash/extract-method17.ts @@ -0,0 +1,10 @@ +/// + +//// function foo () { +//// var x = 3; +//// var y = /*start*/x++ + 5/*end*/; +//// } + +goTo.select('start', 'end') +verify.refactorAvailable('Extract Method', 'scope_0'); +verify.not.refactorAvailable('Extract Method', 'scope_1'); diff --git a/tests/cases/fourslash/extract-method18.ts b/tests/cases/fourslash/extract-method18.ts new file mode 100644 index 0000000000000..9d87979a1ed1c --- /dev/null +++ b/tests/cases/fourslash/extract-method18.ts @@ -0,0 +1,21 @@ +/// + +// Don't try to propagate property accessed variables back, +// or emit spurious returns when the value is clearly ignored + +//// function fn() { +//// const x = { m: 1 }; +//// /*a*/x.m = 3/*b*/; +//// } + +goTo.select('a', 'b') +verify.refactorAvailable('Extract Method'); +edit.applyRefactor('Extract Method', "scope_1"); +verify.currentFileContentIs(`function fn() { + const x = { m: 1 }; + newFunction(x); +} +function newFunction(x: { m: number; }) { + x.m = 3; +} +`); diff --git a/tests/cases/fourslash/extract-method19.ts b/tests/cases/fourslash/extract-method19.ts new file mode 100644 index 0000000000000..54f79311cc72b --- /dev/null +++ b/tests/cases/fourslash/extract-method19.ts @@ -0,0 +1,22 @@ +/// + +// New function names should be totally new to the file + +//// function fn() { +//// /*a*/console.log("hi");/*b*/ +//// } +//// +//// function newFunction() { } + +goTo.select('a', 'b') +verify.refactorAvailable('Extract Method'); +edit.applyRefactor('Extract Method', "scope_0"); +verify.currentFileContentIs(`function fn() { + newFunction_1(); + + function newFunction_1() { + console.log("hi"); + } +} + +function newFunction() { }`); diff --git a/tests/cases/fourslash/extract-method2.ts b/tests/cases/fourslash/extract-method2.ts new file mode 100644 index 0000000000000..0a4f346307b5f --- /dev/null +++ b/tests/cases/fourslash/extract-method2.ts @@ -0,0 +1,28 @@ +/// + +//// namespace NS { +//// class Q { +//// foo() { +//// console.log('100'); +//// const m = 10, j = "hello", k = {x: "what"}; +//// const q = /*start*/m + j + k/*end*/; +//// } +//// } +//// } +goTo.select('start', 'end') +verify.refactorAvailable('Extract Method'); +edit.applyRefactor('Extract Method', "scope_2"); +verify.currentFileContentIs( +`namespace NS { + class Q { + foo() { + console.log('100'); + const m = 10, j = "hello", k = {x: "what"}; + const q = newFunction(m, j, k); + } + } +} +function newFunction(m: number, j: string, k: { x: string; }) { + return m + j + k; +} +`); diff --git a/tests/cases/fourslash/extract-method20.ts b/tests/cases/fourslash/extract-method20.ts new file mode 100644 index 0000000000000..04990001b5f0e --- /dev/null +++ b/tests/cases/fourslash/extract-method20.ts @@ -0,0 +1,14 @@ +/// + +// Shouldn't be able to extract a readonly property initializer outside the constructor + +//// class Foo { +//// readonly prop; +//// constructor() { +//// /*a*/this.prop = 10;/*b*/ +//// } +//// } + +goTo.select('a', 'b') +verify.refactorAvailable('Extract Method', 'scope_0'); +verify.not.refactorAvailable('Extract Method', 'scope_1'); diff --git a/tests/cases/fourslash/extract-method21.ts b/tests/cases/fourslash/extract-method21.ts new file mode 100644 index 0000000000000..0168daf5fcb02 --- /dev/null +++ b/tests/cases/fourslash/extract-method21.ts @@ -0,0 +1,25 @@ +/// + +// Extracting from a static method should create a static method + +//// class Foo { +//// static method() { +//// /*start*/return 1;/*end*/ +//// } +//// } + +goTo.select('start', 'end') + +verify.refactorAvailable('Extract Method'); + +edit.applyRefactor('Extract Method', "scope_0"); + +verify.currentFileContentIs(`class Foo { + static method() { + return Foo.newFunction(); + } + + private static newFunction() { + return 1; + } +}`); \ No newline at end of file diff --git a/tests/cases/fourslash/extract-method22.ts b/tests/cases/fourslash/extract-method22.ts new file mode 100644 index 0000000000000..7486520e700f7 --- /dev/null +++ b/tests/cases/fourslash/extract-method22.ts @@ -0,0 +1,10 @@ +/// + +// You may not extract variable declarations with the export modifier + +//// namespace NS { +//// /*start*/export var x = 10;/*end*/ +//// } + +goTo.select('start', 'end') +verify.not.refactorAvailable('Extract Method'); diff --git a/tests/cases/fourslash/extract-method23.ts b/tests/cases/fourslash/extract-method23.ts new file mode 100644 index 0000000000000..7da8f175f1353 --- /dev/null +++ b/tests/cases/fourslash/extract-method23.ts @@ -0,0 +1,8 @@ +/// + +//// declare namespace Foo { +//// const x = /*start*/3/*end*/; +//// } + +goTo.select('start', 'end') +verify.not.refactorAvailable('Extract Method'); diff --git a/tests/cases/fourslash/extract-method24.ts b/tests/cases/fourslash/extract-method24.ts new file mode 100644 index 0000000000000..9eebc00316bd6 --- /dev/null +++ b/tests/cases/fourslash/extract-method24.ts @@ -0,0 +1,19 @@ +/// + +//// function M() { +//// let a = [1,2,3]; +//// let x = 0; +//// console.log(/*a*/a[x]/*b*/); +//// } + +goTo.select('a', 'b') +edit.applyRefactor('Extract Method', 'scope_1'); +verify.currentFileContentIs(`function M() { + let a = [1,2,3]; + let x = 0; + console.log(newFunction(a, x)); +} +function newFunction(a: number[], x: number): any { + return a[x]; +} +`); \ No newline at end of file diff --git a/tests/cases/fourslash/extract-method3.ts b/tests/cases/fourslash/extract-method3.ts new file mode 100644 index 0000000000000..af543121eebf2 --- /dev/null +++ b/tests/cases/fourslash/extract-method3.ts @@ -0,0 +1,18 @@ +/// + +//// namespace NS { +//// class Q { +//// foo() { +//// console.log('100'); +//// const m = 10, j = "hello", k = {x: "what"}; +//// const q = /*a*/m/*b*/; +//// } +//// } +//// } + +// Don't offer to to 'extract method' a single identifier + +goTo.marker('a'); +verify.not.refactorAvailable('Extract Method'); +goTo.select('a', 'b'); +verify.not.refactorAvailable('Extract Method'); diff --git a/tests/cases/fourslash/extract-method4.ts b/tests/cases/fourslash/extract-method4.ts new file mode 100644 index 0000000000000..ec8f39f354189 --- /dev/null +++ b/tests/cases/fourslash/extract-method4.ts @@ -0,0 +1,14 @@ +/// + +//// let a = 1, b = 2, c = 3, d = 4; +//// namespace NS { +//// class Q { +//// foo() { +//// a = /*1*/b = c/*2*/ = d; +//// } +//// } +//// } + +// Should rewrite to a = newFunc(); function() { return b = c = d; } +goTo.select('1', '2'); +verify.not.refactorAvailable('Extract Method'); diff --git a/tests/cases/fourslash/extract-method5.ts b/tests/cases/fourslash/extract-method5.ts new file mode 100644 index 0000000000000..ac09f92cc0520 --- /dev/null +++ b/tests/cases/fourslash/extract-method5.ts @@ -0,0 +1,20 @@ +/// + +// Extraction in the context of a contextual +// type needs to produce an explicit return type +// annotation in the extracted function + +//// function f() { +//// var x: 1 | 2 | 3 = /*start*/2/*end*/; +//// } + +goTo.select('start', 'end'); +edit.applyRefactor('Extract Method', 'scope_0'); +verify.currentFileContentIs( +`function f() { + var x: 1 | 2 | 3 = newFunction(); + + function newFunction(): 1 | 2 | 3 { + return 2; + } +}`); \ No newline at end of file diff --git a/tests/cases/fourslash/extract-method6.ts b/tests/cases/fourslash/extract-method6.ts new file mode 100644 index 0000000000000..f188ab319e9b8 --- /dev/null +++ b/tests/cases/fourslash/extract-method6.ts @@ -0,0 +1,16 @@ +/// + +// Cannot extract globally-declared functions or +// those with non-selected local references + +//// /*f1a*/function f() { +//// /*g1a*/function g() { } +//// g();/*g1b*/ +//// g(); +//// }/*f1b*/ + +goTo.select('f1a', 'f1b'); +verify.not.refactorAvailable('Extract Method'); +goTo.select('g1a', 'g1b'); +verify.not.refactorAvailable('Extract Method'); + diff --git a/tests/cases/fourslash/extract-method7.ts b/tests/cases/fourslash/extract-method7.ts new file mode 100644 index 0000000000000..4c95c6a551d57 --- /dev/null +++ b/tests/cases/fourslash/extract-method7.ts @@ -0,0 +1,16 @@ +/// + +// You cannot extract a function initializer into the function's body. +// The innermost scope (scope_0) is the sibling of the function, not the function itself. + +//// function fn(x = /*a*/3/*b*/) { +//// } + +goTo.select('a', 'b'); +edit.applyRefactor('Extract Method', 'scope_0'); +verify.currentFileContentIs(`function fn(x = newFunction()) { +} +function newFunction() { + return 3; +} +`); diff --git a/tests/cases/fourslash/extract-method8.ts b/tests/cases/fourslash/extract-method8.ts new file mode 100644 index 0000000000000..28068dd7c783b --- /dev/null +++ b/tests/cases/fourslash/extract-method8.ts @@ -0,0 +1,17 @@ +/// + +// You cannot extract an exported function declaration + +//// namespace ns { +//// /*a*/export function fn() { +//// +//// } +//// fn(); +//// /*b*/ +//// } + +goTo.select('a', 'b'); +verify.not.refactorAvailable("Extract Method"); +edit.deleteAtCaret('export'.length); +goTo.select('a', 'b'); +verify.refactorAvailable("Extract Method"); diff --git a/tests/cases/fourslash/extract-method9.ts b/tests/cases/fourslash/extract-method9.ts new file mode 100644 index 0000000000000..f70ef20a87b56 --- /dev/null +++ b/tests/cases/fourslash/extract-method9.ts @@ -0,0 +1,11 @@ +/// + +//// function f() { +//// /*a*/function q() { } +//// q();/*b*/ +//// q(); +//// } + +goTo.select('a', 'b'); +verify.not.refactorAvailable("Extract Method"); + diff --git a/tests/cases/fourslash/fourslash.ts b/tests/cases/fourslash/fourslash.ts index 59cb881ab7b09..5175b52df6c9f 100644 --- a/tests/cases/fourslash/fourslash.ts +++ b/tests/cases/fourslash/fourslash.ts @@ -130,6 +130,7 @@ declare namespace FourSlashInterface { position(position: number, fileName?: string): any; file(index: number, content?: string, scriptKindName?: string): any; file(name: string, content?: string, scriptKindName?: string): any; + select(startMarker: string, endMarker: string): void; } class verifyNegatable { private negative; @@ -156,6 +157,8 @@ declare namespace FourSlashInterface { applicableRefactorAvailableAtMarker(markerName: string): void; codeFixDiagnosticsAvailableAtMarkers(markerNames: string[], diagnosticCode?: number): void; applicableRefactorAvailableForRange(): void; + + refactorAvailable(name?: string, subName?: string); } class verify extends verifyNegatable { assertHasRanges(ranges: Range[]): void; @@ -305,6 +308,8 @@ declare namespace FourSlashInterface { moveLeft(count?: number): void; enableFormatting(): void; disableFormatting(): void; + + applyRefactor(refactorName: string, actionName: string): void; } class debug { printCurrentParameterHelp(): void; From b44ac91de932012d54b576e9ae343aac7ce8c940 Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Fri, 4 Aug 2017 23:45:09 -0700 Subject: [PATCH 045/237] Added failing test for a before-transform that indirectly replaces a namespace declaration. --- src/harness/unittests/transform.ts | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/src/harness/unittests/transform.ts b/src/harness/unittests/transform.ts index 537235f2f6776..5799de1bfbd36 100644 --- a/src/harness/unittests/transform.ts +++ b/src/harness/unittests/transform.ts @@ -74,6 +74,32 @@ namespace ts { } }).outputText; }); + + testBaseline("synthesizedNamespace", () => { + return ts.transpileModule(`namespace Reflect { const x = 1; }`, { + transformers: { + before: [forceSyntheticModuleDeclaration], + }, + compilerOptions: { + newLine: NewLineKind.CarriageReturnLineFeed, + } + }).outputText; + + function forceSyntheticModuleDeclaration(context: ts.TransformationContext) { + return (sourceFile: ts.SourceFile): ts.SourceFile => { + return visitNode(sourceFile); + + function visitNode(node: T): T { + if (node.kind === ts.SyntaxKind.ModuleBlock) { + const block = node as T & ts.ModuleBlock; + const statements = ts.createNodeArray([...block.statements]); + return ts.updateModuleBlock(block, statements) as typeof block; + } + return ts.visitEachChild(node, visitNode, context); + } + }; + } + }) }); } From 5cb5cf14de2cc46613214b258eb5c5e52881c632 Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Fri, 4 Aug 2017 23:48:45 -0700 Subject: [PATCH 046/237] Accepted baselines. --- .../transformApi/transformsCorrectly.synthesizedNamespace.js | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 tests/baselines/reference/transformApi/transformsCorrectly.synthesizedNamespace.js diff --git a/tests/baselines/reference/transformApi/transformsCorrectly.synthesizedNamespace.js b/tests/baselines/reference/transformApi/transformsCorrectly.synthesizedNamespace.js new file mode 100644 index 0000000000000..5897d293ff5fd --- /dev/null +++ b/tests/baselines/reference/transformApi/transformsCorrectly.synthesizedNamespace.js @@ -0,0 +1,3 @@ +(function (Reflect) { + var x = 1; +})(Reflect || (Reflect = {})); From 9f1b7471139f3ed91b2b987dcb2cacb66b9de0cb Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Sat, 5 Aug 2017 00:12:54 -0700 Subject: [PATCH 047/237] Made the first-declaration check conservative in the TypeScript transform. --- src/compiler/transformers/ts.ts | 17 +++++++++-------- src/harness/unittests/transform.ts | 2 +- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/src/compiler/transformers/ts.ts b/src/compiler/transformers/ts.ts index 19ba8b1f2d25f..89693c0d22ab8 100644 --- a/src/compiler/transformers/ts.ts +++ b/src/compiler/transformers/ts.ts @@ -2639,9 +2639,6 @@ namespace ts { /** * Records that a declaration was emitted in the current scope, if it was the first * declaration for the provided symbol. - * - * NOTE: if there is ever a transformation above this one, we may not be able to rely - * on symbol names. */ function recordEmittedDeclarationInScope(node: Node) { const name = node.symbol && node.symbol.escapedName; @@ -2657,10 +2654,13 @@ namespace ts { } /** - * Determines whether a declaration is the first declaration with the same name emitted - * in the current scope. + * Determines whether a declaration is *could* be the first declaration with + * the same name emitted in the current scope. Only returns false if we are absolutely + * certain a previous declaration has been emitted. */ - function isFirstEmittedDeclarationInScope(node: Node) { + function isPotentiallyFirstEmittedDeclarationInScope(node: Node) { + // If the node has a named symbol, then we have enough knowledge to determine + // whether a prior declaration has been emitted. if (currentScopeFirstDeclarationsOfName) { const name = node.symbol && node.symbol.escapedName; if (name) { @@ -2668,7 +2668,8 @@ namespace ts { } } - return false; + // Otherwise, we can't be sure. For example, this node could be synthetic. + return true; } /** @@ -2690,7 +2691,7 @@ namespace ts { setOriginalNode(statement, node); recordEmittedDeclarationInScope(node); - if (isFirstEmittedDeclarationInScope(node)) { + if (isPotentiallyFirstEmittedDeclarationInScope(node)) { // Adjust the source map emit to match the old emitter. if (node.kind === SyntaxKind.EnumDeclaration) { setSourceMapRange(statement.declarationList, node); diff --git a/src/harness/unittests/transform.ts b/src/harness/unittests/transform.ts index 5799de1bfbd36..74b92f7c5a73c 100644 --- a/src/harness/unittests/transform.ts +++ b/src/harness/unittests/transform.ts @@ -99,7 +99,7 @@ namespace ts { } }; } - }) + }); }); } From 22e0d9f7911124f23ee7cfd6e67dc1cf063a4e75 Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Sat, 5 Aug 2017 00:14:23 -0700 Subject: [PATCH 048/237] Accepted baselines. --- tests/baselines/reference/parserEnumDeclaration4.js | 1 + tests/baselines/reference/reservedWords2.js | 1 + .../transformApi/transformsCorrectly.synthesizedNamespace.js | 1 + 3 files changed, 3 insertions(+) diff --git a/tests/baselines/reference/parserEnumDeclaration4.js b/tests/baselines/reference/parserEnumDeclaration4.js index d5b1e696a3d7a..47450d419e157 100644 --- a/tests/baselines/reference/parserEnumDeclaration4.js +++ b/tests/baselines/reference/parserEnumDeclaration4.js @@ -3,6 +3,7 @@ enum void { } //// [parserEnumDeclaration4.js] +var ; (function () { })( || ( = {})); void {}; diff --git a/tests/baselines/reference/reservedWords2.js b/tests/baselines/reference/reservedWords2.js index f172f37d05396..da6a35bba82b3 100644 --- a/tests/baselines/reference/reservedWords2.js +++ b/tests/baselines/reference/reservedWords2.js @@ -35,6 +35,7 @@ debugger; if () ; [1, 2]; +var ; (function () { })( || ( = {})); void {}; diff --git a/tests/baselines/reference/transformApi/transformsCorrectly.synthesizedNamespace.js b/tests/baselines/reference/transformApi/transformsCorrectly.synthesizedNamespace.js index 5897d293ff5fd..76d5d9a4dab86 100644 --- a/tests/baselines/reference/transformApi/transformsCorrectly.synthesizedNamespace.js +++ b/tests/baselines/reference/transformApi/transformsCorrectly.synthesizedNamespace.js @@ -1,3 +1,4 @@ +var Reflect; (function (Reflect) { var x = 1; })(Reflect || (Reflect = {})); From a282cbb07e18f0ef1bfd21633f8b461fa961e42f Mon Sep 17 00:00:00 2001 From: Nathan Shively-Sanders Date: Mon, 7 Aug 2017 10:56:18 -0700 Subject: [PATCH 049/237] Weak type errors for signature-only types too Now source types that only have a call signature (like functions) or construct signature will get a weak type error too. This is really good for catching uncalled functions: ```ts functionTakingWeakType(returnWeakType); // OOPS. Forgot to call `returnWeakType()`. That's an error! ``` --- src/compiler/checker.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index a8af11e780305..990bfd546a358 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -8938,7 +8938,9 @@ namespace ts { !(target.flags & TypeFlags.Union) && !isIntersectionConstituent && source !== globalObjectType && - getPropertiesOfType(source).length > 0 && + (getPropertiesOfType(source).length > 0 || + getSignaturesOfType(source, SignatureKind.Call).length > 0 || + getSignaturesOfType(source, SignatureKind.Construct).length > 0) && isWeakType(target) && !hasCommonProperties(source, target)) { if (reportErrors) { From 068cb8d5d05e5f46decd3e205b2b09d7455369da Mon Sep 17 00:00:00 2001 From: Nathan Shively-Sanders Date: Mon, 7 Aug 2017 10:58:07 -0700 Subject: [PATCH 050/237] Update weakType test + baselines --- tests/baselines/reference/weakType.errors.txt | 28 +++++++++++++------ tests/baselines/reference/weakType.js | 10 ++++--- tests/cases/compiler/weakType.ts | 7 +++-- 3 files changed, 31 insertions(+), 14 deletions(-) diff --git a/tests/baselines/reference/weakType.errors.txt b/tests/baselines/reference/weakType.errors.txt index 441ef70ac1674..b08dcc3398079 100644 --- a/tests/baselines/reference/weakType.errors.txt +++ b/tests/baselines/reference/weakType.errors.txt @@ -1,14 +1,17 @@ -tests/cases/compiler/weakType.ts(16,13): error TS2559: Type '12' has no properties in common with type 'Settings'. -tests/cases/compiler/weakType.ts(17,13): error TS2559: Type '"completely wrong"' has no properties in common with type 'Settings'. -tests/cases/compiler/weakType.ts(18,13): error TS2559: Type 'false' has no properties in common with type 'Settings'. -tests/cases/compiler/weakType.ts(35,18): error TS2559: Type '{ error?: number; }' has no properties in common with type 'ChangeOptions'. -tests/cases/compiler/weakType.ts(60,5): error TS2322: Type '{ properties: { wrong: string; }; }' is not assignable to type 'Weak & Spoiler'. +tests/cases/compiler/weakType.ts(15,13): error TS2559: Type '() => { timeout: number; }' has no properties in common with type 'Settings'. +tests/cases/compiler/weakType.ts(16,13): error TS2559: Type '() => void' has no properties in common with type 'Settings'. +tests/cases/compiler/weakType.ts(17,13): error TS2559: Type 'CtorOnly' has no properties in common with type 'Settings'. +tests/cases/compiler/weakType.ts(18,13): error TS2559: Type '12' has no properties in common with type 'Settings'. +tests/cases/compiler/weakType.ts(19,13): error TS2559: Type '"completely wrong"' has no properties in common with type 'Settings'. +tests/cases/compiler/weakType.ts(20,13): error TS2559: Type 'false' has no properties in common with type 'Settings'. +tests/cases/compiler/weakType.ts(37,18): error TS2559: Type '{ error?: number; }' has no properties in common with type 'ChangeOptions'. +tests/cases/compiler/weakType.ts(62,5): error TS2322: Type '{ properties: { wrong: string; }; }' is not assignable to type 'Weak & Spoiler'. Type '{ properties: { wrong: string; }; }' is not assignable to type 'Weak'. Types of property 'properties' are incompatible. Type '{ wrong: string; }' has no properties in common with type '{ b?: number; }'. -==== tests/cases/compiler/weakType.ts (5 errors) ==== +==== tests/cases/compiler/weakType.ts (8 errors) ==== interface Settings { timeout?: number; onError?(): void; @@ -17,13 +20,21 @@ tests/cases/compiler/weakType.ts(60,5): error TS2322: Type '{ properties: { wron function getDefaultSettings() { return { timeout: 1000 }; } + interface CtorOnly { + new(s: string): string + } function doSomething(settings: Settings) { /* ... */ } // forgot to call `getDefaultSettings` - // but it is not caught because we don't check for call signatures doSomething(getDefaultSettings); - // same for arrow expressions: + ~~~~~~~~~~~~~~~~~~ +!!! error TS2559: Type '() => { timeout: number; }' has no properties in common with type 'Settings'. doSomething(() => { }); + ~~~~~~~~~ +!!! error TS2559: Type '() => void' has no properties in common with type 'Settings'. + doSomething(null as CtorOnly); + ~~~~~~~~~~~~~~~~ +!!! error TS2559: Type 'CtorOnly' has no properties in common with type 'Settings'. doSomething(12); ~~ !!! error TS2559: Type '12' has no properties in common with type 'Settings'. @@ -82,4 +93,5 @@ tests/cases/compiler/weakType.ts(60,5): error TS2322: Type '{ properties: { wron !!! error TS2322: Type '{ properties: { wrong: string; }; }' is not assignable to type 'Weak'. !!! error TS2322: Types of property 'properties' are incompatible. !!! error TS2322: Type '{ wrong: string; }' has no properties in common with type '{ b?: number; }'. + \ No newline at end of file diff --git a/tests/baselines/reference/weakType.js b/tests/baselines/reference/weakType.js index 5637271ccec3a..999269384dcdd 100644 --- a/tests/baselines/reference/weakType.js +++ b/tests/baselines/reference/weakType.js @@ -7,13 +7,15 @@ interface Settings { function getDefaultSettings() { return { timeout: 1000 }; } +interface CtorOnly { + new(s: string): string +} function doSomething(settings: Settings) { /* ... */ } // forgot to call `getDefaultSettings` -// but it is not caught because we don't check for call signatures doSomething(getDefaultSettings); -// same for arrow expressions: doSomething(() => { }); +doSomething(null as CtorOnly); doSomething(12); doSomething('completely wrong'); doSomething(false); @@ -59,6 +61,7 @@ declare let unknown: { } } let weak: Weak & Spoiler = unknown + //// [weakType.js] @@ -67,10 +70,9 @@ function getDefaultSettings() { } function doSomething(settings) { } // forgot to call `getDefaultSettings` -// but it is not caught because we don't check for call signatures doSomething(getDefaultSettings); -// same for arrow expressions: doSomething(function () { }); +doSomething(null); doSomething(12); doSomething('completely wrong'); doSomething(false); diff --git a/tests/cases/compiler/weakType.ts b/tests/cases/compiler/weakType.ts index ffe51205e53c5..8fda5df916608 100644 --- a/tests/cases/compiler/weakType.ts +++ b/tests/cases/compiler/weakType.ts @@ -6,13 +6,15 @@ interface Settings { function getDefaultSettings() { return { timeout: 1000 }; } +interface CtorOnly { + new(s: string): string +} function doSomething(settings: Settings) { /* ... */ } // forgot to call `getDefaultSettings` -// but it is not caught because we don't check for call signatures doSomething(getDefaultSettings); -// same for arrow expressions: doSomething(() => { }); +doSomething(null as CtorOnly); doSomething(12); doSomething('completely wrong'); doSomething(false); @@ -58,3 +60,4 @@ declare let unknown: { } } let weak: Weak & Spoiler = unknown + From 091376f46ff928feb79b6faee3dd1b88804fd336 Mon Sep 17 00:00:00 2001 From: Arthur Ozga Date: Mon, 7 Aug 2017 15:45:56 -0700 Subject: [PATCH 051/237] supressFormatOnKeyInComments --- src/services/formatting/smartIndenter.ts | 10 +++++----- src/services/services.ts | 25 +++++++++++++----------- 2 files changed, 19 insertions(+), 16 deletions(-) diff --git a/src/services/formatting/smartIndenter.ts b/src/services/formatting/smartIndenter.ts index d0651ce140fee..b0d58ddad1226 100644 --- a/src/services/formatting/smartIndenter.ts +++ b/src/services/formatting/smartIndenter.ts @@ -31,6 +31,11 @@ namespace ts.formatting { return 0; } + const indentationOfEnclosingMultiLineComment = getIndentationOfEnclosingMultiLineComment(sourceFile, position, options); + if (indentationOfEnclosingMultiLineComment >= 0) { + return indentationOfEnclosingMultiLineComment; + } + const precedingToken = findPrecedingToken(position, sourceFile); if (!precedingToken) { return getBaseIndentation(options); @@ -44,11 +49,6 @@ namespace ts.formatting { const lineAtPosition = sourceFile.getLineAndCharacterOfPosition(position).line; - const indentationOfEnclosingMultiLineComment = getIndentationOfEnclosingMultiLineComment(sourceFile, position, options); - if (indentationOfEnclosingMultiLineComment >= 0) { - return indentationOfEnclosingMultiLineComment; - } - // indentation is first non-whitespace character in a previous line // for block indentation, we should look for a line which contains something that's not // whitespace. diff --git a/src/services/services.ts b/src/services/services.ts index d63102588857f..5a70ccca50189 100644 --- a/src/services/services.ts +++ b/src/services/services.ts @@ -1757,17 +1757,20 @@ namespace ts { function getFormattingEditsAfterKeystroke(fileName: string, position: number, key: string, options: FormatCodeOptions | FormatCodeSettings): TextChange[] { const sourceFile = syntaxTreeCache.getCurrentSourceFile(fileName); const settings = toEditorSettings(options); - if (key === "{") { - return formatting.formatOnOpeningCurly(position, sourceFile, getRuleProvider(settings), settings); - } - else if (key === "}") { - return formatting.formatOnClosingCurly(position, sourceFile, getRuleProvider(settings), settings); - } - else if (key === ";") { - return formatting.formatOnSemicolon(position, sourceFile, getRuleProvider(settings), settings); - } - else if (key === "\n") { - return formatting.formatOnEnter(position, sourceFile, getRuleProvider(settings), settings); + + if (!isInComment(sourceFile, position)) { + if (key === "{") { + return formatting.formatOnOpeningCurly(position, sourceFile, getRuleProvider(settings), settings); + } + else if (key === "}") { + return formatting.formatOnClosingCurly(position, sourceFile, getRuleProvider(settings), settings); + } + else if (key === ";") { + return formatting.formatOnSemicolon(position, sourceFile, getRuleProvider(settings), settings); + } + else if (key === "\n") { + return formatting.formatOnEnter(position, sourceFile, getRuleProvider(settings), settings); + } } return []; From b07aa0d97143cbcb5f15f005b00d0f4b36dbb981 Mon Sep 17 00:00:00 2001 From: Ron Buckton Date: Mon, 7 Aug 2017 17:58:32 -0700 Subject: [PATCH 052/237] fix lint errors --- src/compiler/core.ts | 6 +++--- src/harness/unittests/matchFiles.ts | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/compiler/core.ts b/src/compiler/core.ts index 07f979333b636..456026166405a 100644 --- a/src/compiler/core.ts +++ b/src/compiler/core.ts @@ -2021,16 +2021,16 @@ namespace ts { componentPattern += component.replace(reservedCharacterPattern, replaceWildcardCharacter); - // Patterns should not include subfolders like node_modules unless they are + // Patterns should not include subfolders like node_modules unless they are // explicitly included as part of the path. // - // As an optimization, if the component pattern is the same as the component, + // As an optimization, if the component pattern is the same as the component, // then there definitely were no wildcard characters and we do not need to // add the exclusion pattern. if (componentPattern !== component) { subpattern += implicitExcludePathRegexPattern; } - + subpattern += componentPattern; } else { diff --git a/src/harness/unittests/matchFiles.ts b/src/harness/unittests/matchFiles.ts index 71b1bfff11abb..9e2a5883754d9 100644 --- a/src/harness/unittests/matchFiles.ts +++ b/src/harness/unittests/matchFiles.ts @@ -1322,7 +1322,7 @@ namespace ts { }); }); }); - + describe("with files or folders that begin with a .", () => { it("that are not explicitly included", () => { const json = { From 813aaf40c01c4e46cb9a5477dcf1a65c031745d9 Mon Sep 17 00:00:00 2001 From: Ron Buckton Date: Mon, 7 Aug 2017 18:20:57 -0700 Subject: [PATCH 053/237] fix lint errors --- src/harness/harness.ts | 2 +- src/lib/es2015.symbol.wellknown.d.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/harness/harness.ts b/src/harness/harness.ts index 55a8f3ebb4d71..7122f55cae2ad 100644 --- a/src/harness/harness.ts +++ b/src/harness/harness.ts @@ -420,7 +420,7 @@ namespace Utils { const maxHarnessFrames = 1; - export function filterStack(error: Error, stackTraceLimit: number = Infinity) { + export function filterStack(error: Error, stackTraceLimit = Infinity) { const stack = (error).stack; if (stack) { const lines = stack.split(/\r\n?|\n/g); diff --git a/src/lib/es2015.symbol.wellknown.d.ts b/src/lib/es2015.symbol.wellknown.d.ts index 578cf0acbc2f2..b7c2610e652c6 100644 --- a/src/lib/es2015.symbol.wellknown.d.ts +++ b/src/lib/es2015.symbol.wellknown.d.ts @@ -110,7 +110,7 @@ interface Map { readonly [Symbol.toStringTag]: "Map"; } -interface WeakMap{ +interface WeakMap { readonly [Symbol.toStringTag]: "WeakMap"; } From 51e9aef2a7362cd82fce55901d0de82c521a8a89 Mon Sep 17 00:00:00 2001 From: Karlis Gangis Date: Tue, 8 Aug 2017 09:32:37 +0300 Subject: [PATCH 054/237] FileWatcher - handle empty directory path as the current directory Fixes #14559 --- src/compiler/sys.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/compiler/sys.ts b/src/compiler/sys.ts index 89cfb074bffed..8a4c4ad22cc5b 100644 --- a/src/compiler/sys.ts +++ b/src/compiler/sys.ts @@ -153,7 +153,7 @@ namespace ts { return; } watcher = _fs.watch( - dirPath, + dirPath || ".", { persistent: true }, (eventName: string, relativeFileName: string) => fileEventHandler(eventName, relativeFileName, dirPath) ); From 9ea2350a6d8119156674759327333e6e2082ad10 Mon Sep 17 00:00:00 2001 From: Andy Date: Tue, 8 Aug 2017 07:31:21 -0700 Subject: [PATCH 055/237] Simplify parameters to updateProjectStructure and updateErrorCheck (#17175) --- src/server/session.ts | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/src/server/session.ts b/src/server/session.ts index 074ba4d6ca1b9..8fa580d7225ad 100644 --- a/src/server/session.ts +++ b/src/server/session.ts @@ -337,7 +337,7 @@ namespace ts.server { case ContextEvent: const { project, fileName } = event.data; this.projectService.logger.info(`got context event, updating diagnostics for ${fileName}`); - this.errorCheck.startNew(next => this.updateErrorCheck(next, [{ fileName, project }], this.changeSeq, (n) => n === this.changeSeq, 100)); + this.errorCheck.startNew(next => this.updateErrorCheck(next, [{ fileName, project }], 100)); break; case ConfigFileDiagEvent: const { triggerFile, configFileName, diagnostics } = event.data; @@ -453,22 +453,23 @@ namespace ts.server { } } - private updateProjectStructure(seq: number, matchSeq: (seq: number) => boolean, ms = 1500) { + private updateProjectStructure() { + const ms = 1500; + const seq = this.changeSeq; this.host.setTimeout(() => { - if (matchSeq(seq)) { + if (this.changeSeq === seq) { this.projectService.refreshInferredProjects(); } }, ms); } - private updateErrorCheck(next: NextStep, checkList: PendingErrorCheck[], seq: number, matchSeq: (seq: number) => boolean, ms = 1500, followMs = 200, requireOpen = true) { - if (followMs > ms) { - followMs = ms; - } + private updateErrorCheck(next: NextStep, checkList: PendingErrorCheck[], ms: number, requireOpen = true) { + const seq = this.changeSeq; + const followMs = Math.min(ms, 200); let index = 0; const checkOne = () => { - if (matchSeq(seq)) { + if (this.changeSeq === seq) { const checkSpec = checkList[index]; index++; if (checkSpec.project.containsFile(checkSpec.fileName, requireOpen)) { @@ -483,7 +484,7 @@ namespace ts.server { } }; - if ((checkList.length > index) && (matchSeq(seq))) { + if (checkList.length > index && this.changeSeq === seq) { next.delay(ms, checkOne); } } @@ -1262,14 +1263,14 @@ namespace ts.server { } private getDiagnostics(next: NextStep, delay: number, fileNames: string[]): void { - const checkList = mapDefined(fileNames, uncheckedFileName => { + const checkList = mapDefined(fileNames, uncheckedFileName => { const fileName = toNormalizedPath(uncheckedFileName); const project = this.projectService.getDefaultProjectForFile(fileName, /*refreshInferredProjects*/ true); return project && { fileName, project }; }); if (checkList.length > 0) { - this.updateErrorCheck(next, checkList, this.changeSeq, (n) => n === this.changeSeq, delay); + this.updateErrorCheck(next, checkList, delay); } } @@ -1283,7 +1284,7 @@ namespace ts.server { scriptInfo.editContent(start, end, args.insertString); this.changeSeq++; } - this.updateProjectStructure(this.changeSeq, n => n === this.changeSeq); + this.updateProjectStructure(); } } @@ -1638,7 +1639,7 @@ namespace ts.server { const checkList = fileNamesInProject.map(fileName => ({ fileName, project })); // Project level error analysis runs on background files too, therefore // doesn't require the file to be opened - this.updateErrorCheck(next, checkList, this.changeSeq, (n) => n === this.changeSeq, delay, 200, /*requireOpen*/ false); + this.updateErrorCheck(next, checkList, delay, /*requireOpen*/ false); } } From 382785a5282f6d49dae0f6af483c8acdaf89ed78 Mon Sep 17 00:00:00 2001 From: Andy Date: Tue, 8 Aug 2017 07:54:08 -0700 Subject: [PATCH 056/237] Fix logging of module resolution errors (#17144) --- src/compiler/moduleNameResolver.ts | 2 +- src/harness/harnessLanguageService.ts | 2 +- src/server/project.ts | 3 ++- src/server/server.ts | 2 -- src/server/types.ts | 2 +- 5 files changed, 5 insertions(+), 6 deletions(-) diff --git a/src/compiler/moduleNameResolver.ts b/src/compiler/moduleNameResolver.ts index 513c741ba0960..be867db974363 100644 --- a/src/compiler/moduleNameResolver.ts +++ b/src/compiler/moduleNameResolver.ts @@ -678,7 +678,7 @@ namespace ts { const { resolvedModule, failedLookupLocations } = nodeModuleNameResolverWorker(moduleName, initialDir, { moduleResolution: ts.ModuleResolutionKind.NodeJs, allowJs: true }, host, /*cache*/ undefined, /*jsOnly*/ true); if (!resolvedModule) { - throw new Error(`Could not resolve JS module ${moduleName} starting at ${initialDir}. Looked in: ${failedLookupLocations.join(", ")}`); + throw new Error(`Could not resolve JS module '${moduleName}' starting at '${initialDir}'. Looked in: ${failedLookupLocations.join(", ")}`); } return resolvedModule.resolvedFileName; } diff --git a/src/harness/harnessLanguageService.ts b/src/harness/harnessLanguageService.ts index c604b2246566a..994ebe67e0cd1 100644 --- a/src/harness/harnessLanguageService.ts +++ b/src/harness/harnessLanguageService.ts @@ -795,7 +795,7 @@ namespace Harness.LanguageService { default: return { module: undefined, - error: "Could not resolve module" + error: new Error("Could not resolve module") }; } diff --git a/src/server/project.ts b/src/server/project.ts index 524b6c4d28d3d..5a92e6505e064 100644 --- a/src/server/project.ts +++ b/src/server/project.ts @@ -170,7 +170,8 @@ namespace ts.server { log(`Loading ${moduleName} from ${initialDir} (resolved to ${resolvedPath})`); const result = host.require(resolvedPath, moduleName); if (result.error) { - log(`Failed to load module: ${JSON.stringify(result.error)}`); + const err = result.error.stack || result.error.message || JSON.stringify(result.error); + log(`Failed to load module '${moduleName}': ${err}`); return undefined; } return result.module; diff --git a/src/server/server.ts b/src/server/server.ts index b72cc2f5a8109..d0044153b91fb 100644 --- a/src/server/server.ts +++ b/src/server/server.ts @@ -116,8 +116,6 @@ namespace ts.server { birthtime: Date; } - type RequireResult = { module: {}, error: undefined } | { module: undefined, error: {} }; - const readline: { createInterface(options: ReadLineOptions): NodeJS.EventEmitter; } = require("readline"); diff --git a/src/server/types.ts b/src/server/types.ts index 07b94fe827e19..4fc4356a4a97f 100644 --- a/src/server/types.ts +++ b/src/server/types.ts @@ -9,7 +9,7 @@ declare namespace ts.server { data: any; } - type RequireResult = { module: {}, error: undefined } | { module: undefined, error: {} }; + type RequireResult = { module: {}, error: undefined } | { module: undefined, error: { stack?: string, message?: string } }; export interface ServerHost extends System { setTimeout(callback: (...args: any[]) => void, ms: number, ...args: any[]): any; clearTimeout(timeoutId: any): void; From a9a30d76fb39a55d91f633b3555d90c4f438d9ae Mon Sep 17 00:00:00 2001 From: Andy Date: Tue, 8 Aug 2017 07:55:03 -0700 Subject: [PATCH 057/237] Fix parsing of globalPlugins and pluginProbeLocations: Don't include empty string (#17143) --- src/server/server.ts | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/server/server.ts b/src/server/server.ts index d0044153b91fb..2bf10964fa39a 100644 --- a/src/server/server.ts +++ b/src/server/server.ts @@ -760,8 +760,16 @@ namespace ts.server { const typingSafeListLocation = findArgument(Arguments.TypingSafeListLocation); const npmLocation = findArgument(Arguments.NpmLocation); - const globalPlugins = (findArgument("--globalPlugins") || "").split(","); - const pluginProbeLocations = (findArgument("--pluginProbeLocations") || "").split(","); + function parseStringArray(argName: string): string[] { + const arg = findArgument(argName); + if (arg === undefined) { + return emptyArray as string[]; // TODO: https://github.com/Microsoft/TypeScript/issues/16312 + } + return arg.split(",").filter(name => name !== ""); + } + + const globalPlugins = parseStringArray("--globalPlugins"); + const pluginProbeLocations = parseStringArray("--pluginProbeLocations"); const allowLocalPluginLoads = hasArgument("--allowLocalPluginLoads"); const useSingleInferredProject = hasArgument("--useSingleInferredProject"); From ceae613e4c0ba36829a2381687883ecdc6b169c3 Mon Sep 17 00:00:00 2001 From: Andy Date: Tue, 8 Aug 2017 07:56:14 -0700 Subject: [PATCH 058/237] Add lint rule to check that `Debug.assert` calls do not eagerly interpolate strings (#17125) * And lint rule to check that `Debug.assert` calls do not eagerly interpolate strings * Use more specific 'assert' functions to avoid callbacks * Respond to PR feedback --- scripts/tslint/booleanTriviaRule.ts | 3 +- scripts/tslint/debugAssertRule.ts | 45 +++++++++++++++++++++++++ src/compiler/core.ts | 37 ++++++++++++++++---- src/compiler/transformers/generators.ts | 2 +- src/server/project.ts | 2 +- src/services/classifier.ts | 4 +-- src/services/services.ts | 2 +- src/services/signatureHelp.ts | 12 +++++-- src/services/transpile.ts | 4 +-- tslint.json | 1 + 10 files changed, 95 insertions(+), 17 deletions(-) create mode 100644 scripts/tslint/debugAssertRule.ts diff --git a/scripts/tslint/booleanTriviaRule.ts b/scripts/tslint/booleanTriviaRule.ts index 189dafac77e64..c498131be16d2 100644 --- a/scripts/tslint/booleanTriviaRule.ts +++ b/scripts/tslint/booleanTriviaRule.ts @@ -34,6 +34,7 @@ function walk(ctx: Lint.WalkContext): void { switch (methodName) { case "apply": case "assert": + case "assertEqual": case "call": case "equal": case "fail": @@ -69,7 +70,7 @@ function walk(ctx: Lint.WalkContext): void { const ranges = ts.getTrailingCommentRanges(sourceFile.text, arg.pos) || ts.getLeadingCommentRanges(sourceFile.text, arg.pos); if (ranges === undefined || ranges.length !== 1 || ranges[0].kind !== ts.SyntaxKind.MultiLineCommentTrivia) { - ctx.addFailureAtNode(arg, "Tag boolean argument with parameter name"); + ctx.addFailureAtNode(arg, "Tag argument with parameter name"); return; } diff --git a/scripts/tslint/debugAssertRule.ts b/scripts/tslint/debugAssertRule.ts new file mode 100644 index 0000000000000..933b27697b01b --- /dev/null +++ b/scripts/tslint/debugAssertRule.ts @@ -0,0 +1,45 @@ +import * as Lint from "tslint/lib"; +import * as ts from "typescript"; + +export class Rule extends Lint.Rules.AbstractRule { + public apply(sourceFile: ts.SourceFile): Lint.RuleFailure[] { + return this.applyWithFunction(sourceFile, ctx => walk(ctx)); + } +} + +function walk(ctx: Lint.WalkContext): void { + ts.forEachChild(ctx.sourceFile, function recur(node) { + if (ts.isCallExpression(node)) { + checkCall(node); + } + ts.forEachChild(node, recur); + }); + + function checkCall(node: ts.CallExpression) { + if (!isDebugAssert(node.expression) || node.arguments.length < 2) { + return; + } + + const message = node.arguments[1]; + if (!ts.isStringLiteral(message)) { + ctx.addFailureAtNode(message, "Second argument to 'Debug.assert' should be a string literal."); + } + + if (node.arguments.length < 3) { + return; + } + + const message2 = node.arguments[2]; + if (!ts.isStringLiteral(message2) && !ts.isArrowFunction(message2)) { + ctx.addFailureAtNode(message, "Third argument to 'Debug.assert' should be a string literal or arrow function."); + } + } + + function isDebugAssert(expr: ts.Node): boolean { + return ts.isPropertyAccessExpression(expr) && isName(expr.expression, "Debug") && isName(expr.name, "assert"); + } + + function isName(expr: ts.Node, text: string): boolean { + return ts.isIdentifier(expr) && expr.text === text; + } +} diff --git a/src/compiler/core.ts b/src/compiler/core.ts index f7ea05836701e..bc131b201fd64 100644 --- a/src/compiler/core.ts +++ b/src/compiler/core.ts @@ -1290,12 +1290,12 @@ namespace ts { export function createFileDiagnostic(file: SourceFile, start: number, length: number, message: DiagnosticMessage): Diagnostic { const end = start + length; - Debug.assert(start >= 0, "start must be non-negative, is " + start); - Debug.assert(length >= 0, "length must be non-negative, is " + length); + Debug.assertGreaterThanOrEqual(start, 0); + Debug.assertGreaterThanOrEqual(length, 0); if (file) { - Debug.assert(start <= file.text.length, `start must be within the bounds of the file. ${start} > ${file.text.length}`); - Debug.assert(end <= file.text.length, `end must be the bounds of the file. ${end} > ${file.text.length}`); + Debug.assertLessThanOrEqual(start, file.text.length); + Debug.assertLessThanOrEqual(end, file.text.length); } let text = getLocaleSpecificMessage(message); @@ -2389,15 +2389,40 @@ namespace ts { return currentAssertionLevel >= level; } - export function assert(expression: boolean, message?: string, verboseDebugInfo?: () => string, stackCrawlMark?: Function): void { + export function assert(expression: boolean, message?: string, verboseDebugInfo?: string | (() => string), stackCrawlMark?: Function): void { if (!expression) { if (verboseDebugInfo) { - message += "\r\nVerbose Debug Information: " + verboseDebugInfo(); + message += "\r\nVerbose Debug Information: " + (typeof verboseDebugInfo === "string" ? verboseDebugInfo : verboseDebugInfo()); } fail(message ? "False expression: " + message : "False expression.", stackCrawlMark || assert); } } + export function assertEqual(a: T, b: T, msg?: string, msg2?: string): void { + if (a !== b) { + const message = msg ? msg2 ? `${msg} ${msg2}` : msg : ""; + fail(`Expected ${a} === ${b}. ${message}`); + } + } + + export function assertLessThan(a: number, b: number, msg?: string): void { + if (a >= b) { + fail(`Expected ${a} < ${b}. ${msg || ""}`); + } + } + + export function assertLessThanOrEqual(a: number, b: number): void { + if (a > b) { + fail(`Expected ${a} <= ${b}`); + } + } + + export function assertGreaterThanOrEqual(a: number, b: number): void { + if (a < b) { + fail(`Expected ${a} >= ${b}`); + } + } + export function fail(message?: string, stackCrawlMark?: Function): void { debugger; const e = new Error(message ? `Debug Failure. ${message}` : "Debug Failure."); diff --git a/src/compiler/transformers/generators.ts b/src/compiler/transformers/generators.ts index 41edf24fe9e5e..5e2016ab59064 100644 --- a/src/compiler/transformers/generators.ts +++ b/src/compiler/transformers/generators.ts @@ -2448,7 +2448,7 @@ namespace ts { * @param location An optional source map location for the statement. */ function createInlineBreak(label: Label, location?: TextRange): ReturnStatement { - Debug.assert(label > 0, `Invalid label: ${label}`); + Debug.assertLessThan(0, label, "Invalid label"); return setTextRange( createReturn( createArrayLiteral([ diff --git a/src/server/project.ts b/src/server/project.ts index 5a92e6505e064..844ded761d802 100644 --- a/src/server/project.ts +++ b/src/server/project.ts @@ -363,7 +363,7 @@ namespace ts.server { return map(this.program.getSourceFiles(), sourceFile => { const scriptInfo = this.projectService.getScriptInfoForPath(sourceFile.path); if (!scriptInfo) { - Debug.assert(false, `scriptInfo for a file '${sourceFile.fileName}' is missing.`); + Debug.fail(`scriptInfo for a file '${sourceFile.fileName}' is missing.`); } return scriptInfo; }); diff --git a/src/services/classifier.ts b/src/services/classifier.ts index dc5d99bc4904c..4552d8bf98571 100644 --- a/src/services/classifier.ts +++ b/src/services/classifier.ts @@ -260,11 +260,11 @@ namespace ts { templateStack.pop(); } else { - Debug.assert(token === SyntaxKind.TemplateMiddle, "Should have been a template middle. Was " + token); + Debug.assertEqual(token, SyntaxKind.TemplateMiddle, "Should have been a template middle."); } } else { - Debug.assert(lastTemplateStackToken === SyntaxKind.OpenBraceToken, "Should have been an open brace. Was: " + token); + Debug.assertEqual(lastTemplateStackToken, SyntaxKind.OpenBraceToken, "Should have been an open brace"); templateStack.pop(); } } diff --git a/src/services/services.ts b/src/services/services.ts index 6a171ad916647..874c2feb107f1 100644 --- a/src/services/services.ts +++ b/src/services/services.ts @@ -1258,7 +1258,7 @@ namespace ts { // We do not support the scenario where a host can modify a registered // file's script kind, i.e. in one project some file is treated as ".ts" // and in another as ".js" - Debug.assert(hostFileInformation.scriptKind === oldSourceFile.scriptKind, "Registered script kind (" + oldSourceFile.scriptKind + ") should match new script kind (" + hostFileInformation.scriptKind + ") for file: " + path); + Debug.assertEqual(hostFileInformation.scriptKind, oldSourceFile.scriptKind, "Registered script kind should match new script kind.", path); return documentRegistry.updateDocumentWithKey(fileName, path, newSettings, documentRegistryBucketKey, hostFileInformation.scriptSnapshot, hostFileInformation.version, hostFileInformation.scriptKind); } diff --git a/src/services/signatureHelp.ts b/src/services/signatureHelp.ts index f008c829116f7..2976b0d28ee97 100644 --- a/src/services/signatureHelp.ts +++ b/src/services/signatureHelp.ts @@ -136,7 +136,9 @@ namespace ts.SignatureHelp { const kind = invocation.typeArguments && invocation.typeArguments.pos === list.pos ? ArgumentListKind.TypeArguments : ArgumentListKind.CallArguments; const argumentCount = getArgumentCount(list); - Debug.assert(argumentIndex === 0 || argumentIndex < argumentCount, `argumentCount < argumentIndex, ${argumentCount} < ${argumentIndex}`); + if (argumentIndex !== 0) { + Debug.assertLessThan(argumentIndex, argumentCount); + } const argumentsSpan = getApplicableSpanForArguments(list, sourceFile); return { kind, invocation, argumentsSpan, argumentIndex, argumentCount }; } @@ -270,7 +272,9 @@ namespace ts.SignatureHelp { ? 1 : (tagExpression.template).templateSpans.length + 1; - Debug.assert(argumentIndex === 0 || argumentIndex < argumentCount, `argumentCount < argumentIndex, ${argumentCount} < ${argumentIndex}`); + if (argumentIndex !== 0) { + Debug.assertLessThan(argumentIndex, argumentCount); + } return { kind: ArgumentListKind.TaggedTemplateArguments, invocation: tagExpression, @@ -402,7 +406,9 @@ namespace ts.SignatureHelp { }; }); - Debug.assert(argumentIndex === 0 || argumentIndex < argumentCount, `argumentCount < argumentIndex, ${argumentCount} < ${argumentIndex}`); + if (argumentIndex !== 0) { + Debug.assertLessThan(argumentIndex, argumentCount); + } const selectedItemIndex = candidates.indexOf(resolvedSignature); Debug.assert(selectedItemIndex !== -1); // If candidates is non-empty it should always include bestSignature. We check for an empty candidates before calling this function. diff --git a/src/services/transpile.ts b/src/services/transpile.ts index 561c188c6cdf4..79a69b886d99c 100644 --- a/src/services/transpile.ts +++ b/src/services/transpile.ts @@ -78,11 +78,11 @@ namespace ts { getSourceFile: (fileName) => fileName === normalizePath(inputFileName) ? sourceFile : undefined, writeFile: (name, text) => { if (fileExtensionIs(name, ".map")) { - Debug.assert(sourceMapText === undefined, `Unexpected multiple source map outputs for the file '${name}'`); + Debug.assertEqual(sourceMapText, undefined, "Unexpected multiple source map outputs, file:", name); sourceMapText = text; } else { - Debug.assert(outputText === undefined, `Unexpected multiple outputs for the file: '${name}'`); + Debug.assertEqual(outputText, undefined, "Unexpected multiple outputs, file:", name); outputText = text; } }, diff --git a/tslint.json b/tslint.json index bcd4dfa22238b..de60ad7683aa0 100644 --- a/tslint.json +++ b/tslint.json @@ -7,6 +7,7 @@ "check-space" ], "curly":[true, "ignore-same-line"], + "debug-assert": true, "indent": [true, "spaces" ], From e1802f49660a30df702c160f4ed001ccacdb33e3 Mon Sep 17 00:00:00 2001 From: Andy Date: Tue, 8 Aug 2017 10:49:49 -0700 Subject: [PATCH 059/237] MultistepOperation: Don't need 'completed', just use `requestId === undefined` (#17173) * MultistepOperation: Don't need 'completed', just use `requestId === undefined` * Check for `requestId !== undefined` --- src/server/session.ts | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/src/server/session.ts b/src/server/session.ts index 8fa580d7225ad..5c9d210939cb4 100644 --- a/src/server/session.ts +++ b/src/server/session.ts @@ -163,26 +163,22 @@ namespace ts.server { * Scheduling is done via instance of NextStep. If on current step subsequent step was not scheduled - operation is assumed to be completed. */ class MultistepOperation implements NextStep { - private requestId: number; + private requestId: number | undefined; private timerHandle: any; - private immediateId: any; - private completed = true; + private immediateId: number | undefined; constructor(private readonly operationHost: MultistepOperationHost) {} public startNew(action: (next: NextStep) => void) { this.complete(); this.requestId = this.operationHost.getCurrentRequestId(); - this.completed = false; this.executeAction(action); } private complete() { - if (!this.completed) { - if (this.requestId) { - this.operationHost.sendRequestCompletedEvent(this.requestId); - } - this.completed = true; + if (this.requestId !== undefined) { + this.operationHost.sendRequestCompletedEvent(this.requestId); + this.requestId = undefined; } this.setTimerHandle(undefined); this.setImmediateId(undefined); From f69ce5c0c8930a4a4912014e41fe6487410acb3d Mon Sep 17 00:00:00 2001 From: Andy Date: Tue, 8 Aug 2017 10:54:18 -0700 Subject: [PATCH 060/237] Convert two arrays to readonly (#17685) --- src/server/editorServices.ts | 4 ++-- src/server/server.ts | 8 ++++---- src/server/session.ts | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/server/editorServices.ts b/src/server/editorServices.ts index 4ffdf5d6c5d99..5bb1da251eacb 100644 --- a/src/server/editorServices.ts +++ b/src/server/editorServices.ts @@ -326,8 +326,8 @@ namespace ts.server { typingsInstaller: ITypingsInstaller; eventHandler?: ProjectServiceEventHandler; throttleWaitMilliseconds?: number; - globalPlugins?: string[]; - pluginProbeLocations?: string[]; + globalPlugins?: ReadonlyArray; + pluginProbeLocations?: ReadonlyArray; allowLocalPluginLoads?: boolean; } diff --git a/src/server/server.ts b/src/server/server.ts index 2bf10964fa39a..6b89019632fe9 100644 --- a/src/server/server.ts +++ b/src/server/server.ts @@ -15,8 +15,8 @@ namespace ts.server { typingSafeListLocation: string; npmLocation: string | undefined; telemetryEnabled: boolean; - globalPlugins: string[]; - pluginProbeLocations: string[]; + globalPlugins: ReadonlyArray; + pluginProbeLocations: ReadonlyArray; allowLocalPluginLoads: boolean; } @@ -760,10 +760,10 @@ namespace ts.server { const typingSafeListLocation = findArgument(Arguments.TypingSafeListLocation); const npmLocation = findArgument(Arguments.NpmLocation); - function parseStringArray(argName: string): string[] { + function parseStringArray(argName: string): ReadonlyArray { const arg = findArgument(argName); if (arg === undefined) { - return emptyArray as string[]; // TODO: https://github.com/Microsoft/TypeScript/issues/16312 + return emptyArray; } return arg.split(",").filter(name => name !== ""); } diff --git a/src/server/session.ts b/src/server/session.ts index 5c9d210939cb4..d8e0f695deff5 100644 --- a/src/server/session.ts +++ b/src/server/session.ts @@ -255,8 +255,8 @@ namespace ts.server { eventHandler?: ProjectServiceEventHandler; throttleWaitMilliseconds?: number; - globalPlugins?: string[]; - pluginProbeLocations?: string[]; + globalPlugins?: ReadonlyArray; + pluginProbeLocations?: ReadonlyArray; allowLocalPluginLoads?: boolean; } From 5141ce751d9887a8b402a34d66c63581c17aed00 Mon Sep 17 00:00:00 2001 From: Andy Date: Tue, 8 Aug 2017 11:02:10 -0700 Subject: [PATCH 061/237] Deduplicate unresolvedImports (#17248) * Deduplicate unresolvedImports * Add `isNonDuplicateInSortedArray` helper --- src/compiler/core.ts | 8 ++++---- src/server/project.ts | 4 ++-- src/server/utilities.ts | 9 +++++++++ src/services/jsTyping.ts | 2 +- 4 files changed, 16 insertions(+), 7 deletions(-) diff --git a/src/compiler/core.ts b/src/compiler/core.ts index bc131b201fd64..d5c8396d06d6b 100644 --- a/src/compiler/core.ts +++ b/src/compiler/core.ts @@ -361,11 +361,11 @@ namespace ts { return false; } - export function filterMutate(array: T[], f: (x: T) => boolean): void { + export function filterMutate(array: T[], f: (x: T, i: number, array: T[]) => boolean): void { let outIndex = 0; - for (const item of array) { - if (f(item)) { - array[outIndex] = item; + for (let i = 0; i < array.length; i++) { + if (f(array[i], i, array)) { + array[outIndex] = array[i]; outIndex++; } } diff --git a/src/server/project.ts b/src/server/project.ts index 844ded761d802..97c8eb706f31f 100644 --- a/src/server/project.ts +++ b/src/server/project.ts @@ -495,7 +495,7 @@ namespace ts.server { this.projectStateVersion++; } - private extractUnresolvedImportsFromSourceFile(file: SourceFile, result: string[]) { + private extractUnresolvedImportsFromSourceFile(file: SourceFile, result: Push) { const cached = this.cachedUnresolvedImportsPerFile.get(file.path); if (cached) { // found cached result - use it and return @@ -555,7 +555,7 @@ namespace ts.server { for (const sourceFile of this.program.getSourceFiles()) { this.extractUnresolvedImportsFromSourceFile(sourceFile, result); } - this.lastCachedUnresolvedImportsList = toSortedArray(result); + this.lastCachedUnresolvedImportsList = toDeduplicatedSortedArray(result); } unresolvedImports = this.lastCachedUnresolvedImportsList; diff --git a/src/server/utilities.ts b/src/server/utilities.ts index fc88f11408a93..5efb20d074fae 100644 --- a/src/server/utilities.ts +++ b/src/server/utilities.ts @@ -262,6 +262,15 @@ namespace ts.server { return arr as SortedArray; } + export function toDeduplicatedSortedArray(arr: string[]): SortedArray { + arr.sort(); + filterMutate(arr, isNonDuplicateInSortedArray); + return arr as SortedArray; + } + function isNonDuplicateInSortedArray(value: T, index: number, array: T[]) { + return index === 0 || value !== array[index - 1]; + } + export function enumerateInsertsAndDeletes(newItems: SortedReadonlyArray, oldItems: SortedReadonlyArray, inserted: (newItem: T) => void, deleted: (oldItem: T) => void, compare?: Comparer) { compare = compare || compareValues; let newIndex = 0; diff --git a/src/services/jsTyping.ts b/src/services/jsTyping.ts index 4de7bb3191d10..5e7b7d424f894 100644 --- a/src/services/jsTyping.ts +++ b/src/services/jsTyping.ts @@ -35,7 +35,7 @@ namespace ts.JsTyping { "crypto", "stream", "util", "assert", "tty", "domain", "constants", "process", "v8", "timers", "console"]; - const nodeCoreModules = arrayToMap(nodeCoreModuleList, x => x); + const nodeCoreModules = arrayToSet(nodeCoreModuleList); /** * A map of loose file names to library names that we are confident require typings From eb8bcd77cba70b2dcafaaa687aeac06500f717d8 Mon Sep 17 00:00:00 2001 From: Andy Date: Tue, 8 Aug 2017 11:02:53 -0700 Subject: [PATCH 062/237] tsserverProjectSystem.ts: Remove unnecessary 'export's (#17201) * tsserverProjectSystem.ts: Remove unnecessary 'export's * Export `PostExecAction` --- .../unittests/tsserverProjectSystem.ts | 34 +++++++++---------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/src/harness/unittests/tsserverProjectSystem.ts b/src/harness/unittests/tsserverProjectSystem.ts index 4a7cafa245bb9..e2b516ddae661 100644 --- a/src/harness/unittests/tsserverProjectSystem.ts +++ b/src/harness/unittests/tsserverProjectSystem.ts @@ -45,7 +45,7 @@ namespace ts.projectSystem { getLogFileName: (): string => undefined }; - export const { content: libFileContent } = Harness.getDefaultLibraryFile(Harness.IO); + const { content: libFileContent } = Harness.getDefaultLibraryFile(Harness.IO); export const libFile: FileOrFolder = { path: "/a/lib/lib.d.ts", content: libFileContent @@ -118,7 +118,7 @@ namespace ts.projectSystem { return JSON.stringify({ dependencies }); } - export function getExecutingFilePathFromLibFile(): string { + function getExecutingFilePathFromLibFile(): string { return combinePaths(getDirectoryPath(libFile.path), "tsc.js"); } @@ -130,7 +130,7 @@ namespace ts.projectSystem { return map(fileNames, toExternalFile); } - export class TestServerEventManager { + class TestServerEventManager { public events: server.ProjectServiceEvent[] = []; handler: server.ProjectServiceEventHandler = (event: server.ProjectServiceEvent) => { @@ -143,7 +143,7 @@ namespace ts.projectSystem { } } - export interface TestServerHostCreationParameters { + interface TestServerHostCreationParameters { useCaseSensitiveFileNames?: boolean; executingFilePath?: string; currentDirectory?: string; @@ -205,7 +205,7 @@ namespace ts.projectSystem { return new TestSession(opts); } - export interface CreateProjectServiceParameters { + interface CreateProjectServiceParameters { cancellationToken?: HostCancellationToken; logger?: server.Logger; useSingleInferredProject?: boolean; @@ -253,15 +253,15 @@ namespace ts.projectSystem { entries: FSEntry[]; } - export function isFolder(s: FSEntry): s is Folder { + function isFolder(s: FSEntry): s is Folder { return isArray((s).entries); } - export function isFile(s: FSEntry): s is File { + function isFile(s: FSEntry): s is File { return typeof (s).content === "string"; } - export function addFolder(fullPath: string, toPath: (s: string) => Path, fs: Map): Folder { + function addFolder(fullPath: string, toPath: (s: string) => Path, fs: Map): Folder { const path = toPath(fullPath); if (fs.has(path)) { Debug.assert(isFolder(fs.get(path))); @@ -279,29 +279,29 @@ namespace ts.projectSystem { return entry; } - export function checkMapKeys(caption: string, map: Map, expectedKeys: string[]) { + function checkMapKeys(caption: string, map: Map, expectedKeys: string[]) { assert.equal(map.size, expectedKeys.length, `${caption}: incorrect size of map`); for (const name of expectedKeys) { assert.isTrue(map.has(name), `${caption} is expected to contain ${name}, actual keys: ${arrayFrom(map.keys())}`); } } - export function checkFileNames(caption: string, actualFileNames: string[], expectedFileNames: string[]) { + function checkFileNames(caption: string, actualFileNames: string[], expectedFileNames: string[]) { assert.equal(actualFileNames.length, expectedFileNames.length, `${caption}: incorrect actual number of files, expected ${JSON.stringify(expectedFileNames)}, got ${actualFileNames}`); for (const f of expectedFileNames) { assert.isTrue(contains(actualFileNames, f), `${caption}: expected to find ${f} in ${JSON.stringify(actualFileNames)}`); } } - export function checkNumberOfConfiguredProjects(projectService: server.ProjectService, expected: number) { + function checkNumberOfConfiguredProjects(projectService: server.ProjectService, expected: number) { assert.equal(projectService.configuredProjects.length, expected, `expected ${expected} configured project(s)`); } - export function checkNumberOfExternalProjects(projectService: server.ProjectService, expected: number) { + function checkNumberOfExternalProjects(projectService: server.ProjectService, expected: number) { assert.equal(projectService.externalProjects.length, expected, `expected ${expected} external project(s)`); } - export function checkNumberOfInferredProjects(projectService: server.ProjectService, expected: number) { + function checkNumberOfInferredProjects(projectService: server.ProjectService, expected: number) { assert.equal(projectService.inferredProjects.length, expected, `expected ${expected} inferred project(s)`); } @@ -315,7 +315,7 @@ namespace ts.projectSystem { checkMapKeys("watchedFiles", host.watchedFiles, expectedFiles); } - export function checkWatchedDirectories(host: TestServerHost, expectedDirectories: string[]) { + function checkWatchedDirectories(host: TestServerHost, expectedDirectories: string[]) { checkMapKeys("watchedDirectories", host.watchedDirectories, expectedDirectories); } @@ -323,11 +323,11 @@ namespace ts.projectSystem { checkFileNames(`${server.ProjectKind[project.projectKind]} project, actual files`, project.getFileNames(), expectedFiles); } - export function checkProjectRootFiles(project: server.Project, expectedFiles: string[]) { + function checkProjectRootFiles(project: server.Project, expectedFiles: string[]) { checkFileNames(`${server.ProjectKind[project.projectKind]} project, rootFileNames`, project.getRootFiles(), expectedFiles); } - export class Callbacks { + class Callbacks { private map: TimeOutCallback[] = []; private nextId = 1; @@ -363,7 +363,7 @@ namespace ts.projectSystem { } } - export type TimeOutCallback = () => any; + type TimeOutCallback = () => any; export class TestServerHost implements server.ServerHost { args: string[] = []; From 94518e853303b4a4a5cb178976593a6c4e319082 Mon Sep 17 00:00:00 2001 From: Andy Date: Tue, 8 Aug 2017 11:18:20 -0700 Subject: [PATCH 063/237] Don't count self-reference when setting `isReferenced` (#17495) * Don't count self-reference when setting `isReferenced` * Improve comment --- src/compiler/checker.ts | 25 ++-------- .../noUnusedLocals_selfReference.errors.txt | 28 +++++++++++ .../reference/noUnusedLocals_selfReference.js | 49 +++++++++++++++++++ ...LocalsAndParametersTypeAliases2.errors.txt | 5 +- .../compiler/noUnusedLocals_selfReference.ts | 17 +++++++ tests/webTestServer.ts | 16 ------ 6 files changed, 102 insertions(+), 38 deletions(-) create mode 100644 tests/baselines/reference/noUnusedLocals_selfReference.errors.txt create mode 100644 tests/baselines/reference/noUnusedLocals_selfReference.js create mode 100644 tests/cases/compiler/noUnusedLocals_selfReference.ts diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 10400a3853a12..1113d131a038e 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -1086,7 +1086,10 @@ namespace ts { location = location.parent; } - if (result && nameNotFoundMessage && noUnusedIdentifiers) { + // We just climbed up parents looking for the name, meaning that we started in a descendant node of `lastLocation`. + // If `result === lastLocation.symbol`, that means that we are somewhere inside `lastLocation` looking up a name, and resolving to `lastLocation` itself. + // That means that this is a self-reference of `lastLocation`, and shouldn't count this when considering whether `lastLocation` is used. + if (result && nameNotFoundMessage && noUnusedIdentifiers && result !== lastLocation.symbol) { result.isReferenced = true; } @@ -10800,17 +10803,6 @@ namespace ts { return undefined; } - function getLeftmostIdentifierOrThis(node: Node): Node { - switch (node.kind) { - case SyntaxKind.Identifier: - case SyntaxKind.ThisKeyword: - return node; - case SyntaxKind.PropertyAccessExpression: - return getLeftmostIdentifierOrThis((node).expression); - } - return undefined; - } - function getBindingElementNameText(element: BindingElement): string | undefined { if (element.parent.kind === SyntaxKind.ObjectBindingPattern) { const name = element.propertyName || element.name; @@ -18520,15 +18512,6 @@ namespace ts { return forEachChild(n, containsSuperCall); } - function markThisReferencesAsErrors(n: Node): void { - if (n.kind === SyntaxKind.ThisKeyword) { - error(n, Diagnostics.this_cannot_be_referenced_in_current_location); - } - else if (n.kind !== SyntaxKind.FunctionExpression && n.kind !== SyntaxKind.FunctionDeclaration) { - forEachChild(n, markThisReferencesAsErrors); - } - } - function isInstancePropertyWithInitializer(n: Node): boolean { return n.kind === SyntaxKind.PropertyDeclaration && !(getModifierFlags(n) & ModifierFlags.Static) && diff --git a/tests/baselines/reference/noUnusedLocals_selfReference.errors.txt b/tests/baselines/reference/noUnusedLocals_selfReference.errors.txt new file mode 100644 index 0000000000000..af40081e71c2c --- /dev/null +++ b/tests/baselines/reference/noUnusedLocals_selfReference.errors.txt @@ -0,0 +1,28 @@ +tests/cases/compiler/noUnusedLocals_selfReference.ts(3,10): error TS6133: 'f' is declared but never used. +tests/cases/compiler/noUnusedLocals_selfReference.ts(4,7): error TS6133: 'C' is declared but never used. +tests/cases/compiler/noUnusedLocals_selfReference.ts(7,6): error TS6133: 'E' is declared but never used. + + +==== tests/cases/compiler/noUnusedLocals_selfReference.ts (3 errors) ==== + export {}; // Make this a module scope, so these are local variables. + + function f() { f; } + ~ +!!! error TS6133: 'f' is declared but never used. + class C { + ~ +!!! error TS6133: 'C' is declared but never used. + m() { C; } + } + enum E { A = 0, B = E.A } + ~ +!!! error TS6133: 'E' is declared but never used. + + // Does not detect mutual recursion. + function g() { D; } + class D { m() { g; } } + + // Does not work on private methods. + class P { private m() { this.m; } } + P; + \ No newline at end of file diff --git a/tests/baselines/reference/noUnusedLocals_selfReference.js b/tests/baselines/reference/noUnusedLocals_selfReference.js new file mode 100644 index 0000000000000..74a39923d574f --- /dev/null +++ b/tests/baselines/reference/noUnusedLocals_selfReference.js @@ -0,0 +1,49 @@ +//// [noUnusedLocals_selfReference.ts] +export {}; // Make this a module scope, so these are local variables. + +function f() { f; } +class C { + m() { C; } +} +enum E { A = 0, B = E.A } + +// Does not detect mutual recursion. +function g() { D; } +class D { m() { g; } } + +// Does not work on private methods. +class P { private m() { this.m; } } +P; + + +//// [noUnusedLocals_selfReference.js] +"use strict"; +exports.__esModule = true; +function f() { f; } +var C = (function () { + function C() { + } + C.prototype.m = function () { C; }; + return C; +}()); +var E; +(function (E) { + E[E["A"] = 0] = "A"; + E[E["B"] = 0] = "B"; +})(E || (E = {})); +// Does not detect mutual recursion. +function g() { D; } +var D = (function () { + function D() { + } + D.prototype.m = function () { g; }; + return D; +}()); +// Does not work on private methods. +var P = (function () { + function P() { + } + P.prototype.m = function () { this.m; }; + return P; +}()); +P; diff --git a/tests/baselines/reference/unusedLocalsAndParametersTypeAliases2.errors.txt b/tests/baselines/reference/unusedLocalsAndParametersTypeAliases2.errors.txt index 528ca9f9e730a..e5c6f476480b9 100644 --- a/tests/baselines/reference/unusedLocalsAndParametersTypeAliases2.errors.txt +++ b/tests/baselines/reference/unusedLocalsAndParametersTypeAliases2.errors.txt @@ -1,8 +1,9 @@ tests/cases/compiler/unusedLocalsAndParametersTypeAliases2.ts(2,6): error TS6133: 'handler1' is declared but never used. +tests/cases/compiler/unusedLocalsAndParametersTypeAliases2.ts(5,10): error TS6133: 'foo' is declared but never used. tests/cases/compiler/unusedLocalsAndParametersTypeAliases2.ts(6,10): error TS6133: 'handler2' is declared but never used. -==== tests/cases/compiler/unusedLocalsAndParametersTypeAliases2.ts (2 errors) ==== +==== tests/cases/compiler/unusedLocalsAndParametersTypeAliases2.ts (3 errors) ==== // unused type handler1 = () => void; ~~~~~~~~ @@ -10,6 +11,8 @@ tests/cases/compiler/unusedLocalsAndParametersTypeAliases2.ts(6,10): error TS613 function foo() { + ~~~ +!!! error TS6133: 'foo' is declared but never used. type handler2 = () => void; ~~~~~~~~ !!! error TS6133: 'handler2' is declared but never used. diff --git a/tests/cases/compiler/noUnusedLocals_selfReference.ts b/tests/cases/compiler/noUnusedLocals_selfReference.ts new file mode 100644 index 0000000000000..8eb528743c0ba --- /dev/null +++ b/tests/cases/compiler/noUnusedLocals_selfReference.ts @@ -0,0 +1,17 @@ +// @noUnusedLocals: true + +export {}; // Make this a module scope, so these are local variables. + +function f() { f; } +class C { + m() { C; } +} +enum E { A = 0, B = E.A } + +// Does not detect mutual recursion. +function g() { D; } +class D { m() { g; } } + +// Does not work on private methods. +class P { private m() { this.m; } } +P; diff --git a/tests/webTestServer.ts b/tests/webTestServer.ts index abfd71a8ffff2..20228f9a7412c 100644 --- a/tests/webTestServer.ts +++ b/tests/webTestServer.ts @@ -125,22 +125,6 @@ function dir(dirPath: string, spec?: string, options?: any) { } } -// fs.rmdirSync won't delete directories with files in it -function deleteFolderRecursive(dirPath: string) { - if (fs.existsSync(dirPath)) { - fs.readdirSync(dirPath).forEach((file) => { - const curPath = path.join(dirPath, file); - if (fs.statSync(curPath).isDirectory()) { // recurse - deleteFolderRecursive(curPath); - } - else { // delete file - fs.unlinkSync(curPath); - } - }); - fs.rmdirSync(dirPath); - } -}; - function writeFile(path: string, data: any) { ensureDirectoriesExist(getDirectoryPath(path)); fs.writeFileSync(path, data); From d99a492ddd7f30450268ed49fa1be308ee43690d Mon Sep 17 00:00:00 2001 From: Andy Date: Tue, 8 Aug 2017 11:22:22 -0700 Subject: [PATCH 064/237] Simplify server logger (#17271) * Simplify server logger * Move function printProjects out of inner closure --- src/harness/harnessLanguageService.ts | 13 ++-- .../unittests/cachingInServerLSHost.ts | 14 +--- src/harness/unittests/session.ts | 18 +----- .../unittests/tsserverProjectSystem.ts | 13 ++-- src/server/editorServices.ts | 30 ++++----- src/server/server.ts | 64 ++++++++++--------- src/server/session.ts | 4 +- src/server/utilities.ts | 15 +---- 8 files changed, 67 insertions(+), 104 deletions(-) diff --git a/src/harness/harnessLanguageService.ts b/src/harness/harnessLanguageService.ts index 994ebe67e0cd1..af5a998df99b2 100644 --- a/src/harness/harnessLanguageService.ts +++ b/src/harness/harnessLanguageService.ts @@ -681,11 +681,11 @@ namespace Harness.LanguageService { } info(message: string): void { - return this.host.log(message); + this.host.log(message); } - msg(message: string) { - return this.host.log(message); + err(message: string): void { + this.host.log(message); } loggingEnabled() { @@ -700,17 +700,12 @@ namespace Harness.LanguageService { return false; } - - endGroup(): void { - } + group() { throw ts.notImplemented(); } perftrc(message: string): void { return this.host.log(message); } - startGroup(): void { - } - setTimeout(callback: (...args: any[]) => void, ms: number, ...args: any[]): any { return setTimeout(callback, ms, args); } diff --git a/src/harness/unittests/cachingInServerLSHost.ts b/src/harness/unittests/cachingInServerLSHost.ts index eb2907e89dea6..92c10c1ff6d5e 100644 --- a/src/harness/unittests/cachingInServerLSHost.ts +++ b/src/harness/unittests/cachingInServerLSHost.ts @@ -52,21 +52,9 @@ namespace ts { } function createProject(rootFile: string, serverHost: server.ServerHost): { project: server.Project, rootScriptInfo: server.ScriptInfo } { - const logger: server.Logger = { - close: noop, - hasLevel: () => false, - loggingEnabled: () => false, - perftrc: noop, - info: noop, - startGroup: noop, - endGroup: noop, - msg: noop, - getLogFileName: (): string => undefined - }; - const svcOpts: server.ProjectServiceOptions = { host: serverHost, - logger, + logger: projectSystem.nullLogger, cancellationToken: { isCancellationRequested: () => false }, useSingleInferredProject: false, typingsInstaller: undefined diff --git a/src/harness/unittests/session.ts b/src/harness/unittests/session.ts index 862ebee4b03ab..1ce5792a81bec 100644 --- a/src/harness/unittests/session.ts +++ b/src/harness/unittests/session.ts @@ -28,18 +28,6 @@ namespace ts.server { createHash: Harness.LanguageService.mockHash, }; - const mockLogger: Logger = { - close: noop, - hasLevel(): boolean { return false; }, - loggingEnabled(): boolean { return false; }, - perftrc: noop, - info: noop, - startGroup: noop, - endGroup: noop, - msg: noop, - getLogFileName: (): string => undefined - }; - class TestSession extends Session { getProjectService() { return this.projectService; @@ -58,7 +46,7 @@ namespace ts.server { typingsInstaller: undefined, byteLength: Utils.byteLength, hrtime: process.hrtime, - logger: mockLogger, + logger: projectSystem.nullLogger, canUseEvents: true }; return new TestSession(opts); @@ -408,7 +396,7 @@ namespace ts.server { typingsInstaller: undefined, byteLength: Utils.byteLength, hrtime: process.hrtime, - logger: mockLogger, + logger: projectSystem.nullLogger, canUseEvents: true }); this.addProtocolHandler(this.customHandler, () => { @@ -475,7 +463,7 @@ namespace ts.server { typingsInstaller: undefined, byteLength: Utils.byteLength, hrtime: process.hrtime, - logger: mockLogger, + logger: projectSystem.nullLogger, canUseEvents: true }); this.addProtocolHandler("echo", (req: protocol.Request) => ({ diff --git a/src/harness/unittests/tsserverProjectSystem.ts b/src/harness/unittests/tsserverProjectSystem.ts index e2b516ddae661..6c60160740ef5 100644 --- a/src/harness/unittests/tsserverProjectSystem.ts +++ b/src/harness/unittests/tsserverProjectSystem.ts @@ -34,14 +34,13 @@ namespace ts.projectSystem { } export const nullLogger: server.Logger = { - close: () => void 0, - hasLevel: () => void 0, + close: noop, + hasLevel: () => false, loggingEnabled: () => false, - perftrc: () => void 0, - info: () => void 0, - startGroup: () => void 0, - endGroup: () => void 0, - msg: () => void 0, + perftrc: noop, + info: noop, + err: noop, + group: noop, getLogFileName: (): string => undefined }; diff --git a/src/server/editorServices.ts b/src/server/editorServices.ts index 5bb1da251eacb..554ac337920bd 100644 --- a/src/server/editorServices.ts +++ b/src/server/editorServices.ts @@ -928,26 +928,24 @@ namespace ts.server { return; } - this.logger.startGroup(); + this.logger.group(info => { + let counter = 0; + counter = printProjects(this.externalProjects, info, counter); + counter = printProjects(this.configuredProjects, info, counter); + printProjects(this.inferredProjects, info, counter); - let counter = 0; - counter = printProjects(this.logger, this.externalProjects, counter); - counter = printProjects(this.logger, this.configuredProjects, counter); - counter = printProjects(this.logger, this.inferredProjects, counter); - - this.logger.info("Open files: "); - for (const rootFile of this.openFiles) { - this.logger.info(`\t${rootFile.fileName}`); - } - - this.logger.endGroup(); + info("Open files: "); + for (const rootFile of this.openFiles) { + info(`\t${rootFile.fileName}`); + } + }); - function printProjects(logger: Logger, projects: Project[], counter: number) { + function printProjects(projects: Project[], info: (msg: string) => void, counter: number): number { for (const project of projects) { project.updateGraph(); - logger.info(`Project '${project.getProjectName()}' (${ProjectKind[project.projectKind]}) ${counter}`); - logger.info(project.filesToString()); - logger.info("-----------------------------------------------"); + info(`Project '${project.getProjectName()}' (${ProjectKind[project.projectKind]}) ${counter}`); + info(project.filesToString()); + info("-----------------------------------------------"); counter++; } return counter; diff --git a/src/server/server.ts b/src/server/server.ts index 6b89019632fe9..47a858c0efd89 100644 --- a/src/server/server.ts +++ b/src/server/server.ts @@ -139,8 +139,6 @@ namespace ts.server { class Logger implements server.Logger { private fd = -1; private seq = 0; - private inGroup = false; - private firstInGroup = true; constructor(private readonly logFilename: string, private readonly traceToConsole: boolean, @@ -170,22 +168,24 @@ namespace ts.server { } perftrc(s: string) { - this.msg(s, Msg.Perf); + this.msg(s, "Perf"); } info(s: string) { - this.msg(s, Msg.Info); + this.msg(s, "Info"); } - startGroup() { - this.inGroup = true; - this.firstInGroup = true; + err(s: string) { + this.msg(s, "Err"); } - endGroup() { - this.inGroup = false; + group(logGroupEntries: (log: (msg: string) => void) => void) { + let firstInGroup = false; + logGroupEntries(s => { + this.msg(s, "Info", /*inGroup*/ true, firstInGroup); + firstInGroup = false; + }); this.seq++; - this.firstInGroup = true; } loggingEnabled() { @@ -196,26 +196,32 @@ namespace ts.server { return this.loggingEnabled() && this.level >= level; } - msg(s: string, type: Msg.Types = Msg.Err) { - if (this.fd >= 0 || this.traceToConsole) { - s = `[${nowString()}] ${s}\n`; + private msg(s: string, type: string, inGroup = false, firstInGroup = false) { + if (!this.canWrite) return; + + s = `[${nowString()}] ${s}\n`; + if (!inGroup || firstInGroup) { const prefix = Logger.padStringRight(type + " " + this.seq.toString(), " "); - if (this.firstInGroup) { - s = prefix + s; - this.firstInGroup = false; - } - if (!this.inGroup) { - this.seq++; - this.firstInGroup = true; - } - if (this.fd >= 0) { - const buf = new Buffer(s); - // tslint:disable-next-line no-null-keyword - fs.writeSync(this.fd, buf, 0, buf.length, /*position*/ null); - } - if (this.traceToConsole) { - console.warn(s); - } + s = prefix + s; + } + this.write(s); + if (!inGroup) { + this.seq++; + } + } + + private get canWrite() { + return this.fd >= 0 || this.traceToConsole; + } + + private write(s: string) { + if (this.fd >= 0) { + const buf = new Buffer(s); + // tslint:disable-next-line no-null-keyword + fs.writeSync(this.fd, buf, 0, buf.length, /*position*/ null); + } + if (this.traceToConsole) { + console.warn(s); } } } diff --git a/src/server/session.ts b/src/server/session.ts index d8e0f695deff5..3c9c1b714de19 100644 --- a/src/server/session.ts +++ b/src/server/session.ts @@ -366,7 +366,7 @@ namespace ts.server { msg += "\n" + (err).stack; } } - this.logger.msg(msg, Msg.Err); + this.logger.err(msg); } public send(msg: protocol.Message) { @@ -1946,7 +1946,7 @@ namespace ts.server { return this.executeWithRequestId(request.seq, () => handler(request)); } else { - this.logger.msg(`Unrecognized JSON command: ${JSON.stringify(request)}`, Msg.Err); + this.logger.err(`Unrecognized JSON command: ${JSON.stringify(request)}`); this.output(undefined, CommandNames.Unknown, request.seq, `Unrecognized JSON command: ${request.command}`); return { responseRequired: false }; } diff --git a/src/server/utilities.ts b/src/server/utilities.ts index 5efb20d074fae..0d4bc101ff63a 100644 --- a/src/server/utilities.ts +++ b/src/server/utilities.ts @@ -17,22 +17,11 @@ namespace ts.server { loggingEnabled(): boolean; perftrc(s: string): void; info(s: string): void; - startGroup(): void; - endGroup(): void; - msg(s: string, type?: Msg.Types): void; + err(s: string): void; + group(logGroupEntries: (log: (msg: string) => void) => void): void; getLogFileName(): string; } - export namespace Msg { - export type Err = "Err"; - export const Err: Err = "Err"; - export type Info = "Info"; - export const Info: Info = "Info"; - export type Perf = "Perf"; - export const Perf: Perf = "Perf"; - export type Types = Err | Info | Perf; - } - function getProjectRootPath(project: Project): Path { switch (project.projectKind) { case ProjectKind.Configured: From 7ff1d8e797afee9b20ce233a1fbe15a19af2f56c Mon Sep 17 00:00:00 2001 From: Nathan Shively-Sanders Date: Tue, 8 Aug 2017 11:25:32 -0700 Subject: [PATCH 065/237] Add specific weak type error for callable types "Did you mean to call it?" --- src/compiler/checker.ts | 10 +++++++++- src/compiler/diagnosticMessages.json | 4 ++++ tests/baselines/reference/weakType.errors.txt | 18 +++++++++--------- tests/baselines/reference/weakType.js | 6 +++--- tests/cases/compiler/weakType.ts | 4 ++-- 5 files changed, 27 insertions(+), 15 deletions(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 4dd2058d4d3ff..2b910e6abb84d 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -8944,7 +8944,15 @@ namespace ts { isWeakType(target) && !hasCommonProperties(source, target)) { if (reportErrors) { - reportError(Diagnostics.Type_0_has_no_properties_in_common_with_type_1, typeToString(source), typeToString(target)); + const calls = getSignaturesOfType(source, SignatureKind.Call); + const constructs = getSignaturesOfType(source, SignatureKind.Construct); + if (calls.length > 0 && isRelatedTo(getReturnTypeOfSignature(calls[0]), target, /*reportErrors*/ false) || + constructs.length > 0 && isRelatedTo(getReturnTypeOfSignature(constructs[0]), target, /*reportErrors*/ false)) { + reportError(Diagnostics.Value_of_type_0_has_no_properties_in_common_with_type_1_Did_you_mean_to_call_it, typeToString(source), typeToString(target)); + } + else { + reportError(Diagnostics.Type_0_has_no_properties_in_common_with_type_1, typeToString(source), typeToString(target)); + } } return Ternary.False; } diff --git a/src/compiler/diagnosticMessages.json b/src/compiler/diagnosticMessages.json index 3b4b0ddf66711..03164c54ffd48 100644 --- a/src/compiler/diagnosticMessages.json +++ b/src/compiler/diagnosticMessages.json @@ -1908,6 +1908,10 @@ "category": "Error", "code": 2559 }, + "Value of type '{0}' has no properties in common with type '{1}'. Did you mean to call it?": { + "category": "Error", + "code": 2560 + }, "JSX element attributes type '{0}' may not be a union type.": { "category": "Error", "code": 2600 diff --git a/tests/baselines/reference/weakType.errors.txt b/tests/baselines/reference/weakType.errors.txt index b08dcc3398079..ffc1d23759358 100644 --- a/tests/baselines/reference/weakType.errors.txt +++ b/tests/baselines/reference/weakType.errors.txt @@ -1,6 +1,6 @@ -tests/cases/compiler/weakType.ts(15,13): error TS2559: Type '() => { timeout: number; }' has no properties in common with type 'Settings'. -tests/cases/compiler/weakType.ts(16,13): error TS2559: Type '() => void' has no properties in common with type 'Settings'. -tests/cases/compiler/weakType.ts(17,13): error TS2559: Type 'CtorOnly' has no properties in common with type 'Settings'. +tests/cases/compiler/weakType.ts(15,13): error TS2560: Value of type '() => { timeout: number; }' has no properties in common with type 'Settings'. Did you mean to call it? +tests/cases/compiler/weakType.ts(16,13): error TS2560: Value of type '() => { timeout: number; }' has no properties in common with type 'Settings'. Did you mean to call it? +tests/cases/compiler/weakType.ts(17,13): error TS2560: Value of type 'CtorOnly' has no properties in common with type 'Settings'. Did you mean to call it? tests/cases/compiler/weakType.ts(18,13): error TS2559: Type '12' has no properties in common with type 'Settings'. tests/cases/compiler/weakType.ts(19,13): error TS2559: Type '"completely wrong"' has no properties in common with type 'Settings'. tests/cases/compiler/weakType.ts(20,13): error TS2559: Type 'false' has no properties in common with type 'Settings'. @@ -21,20 +21,20 @@ tests/cases/compiler/weakType.ts(62,5): error TS2322: Type '{ properties: { wron return { timeout: 1000 }; } interface CtorOnly { - new(s: string): string + new(s: string): { timeout: 1000 } } function doSomething(settings: Settings) { /* ... */ } // forgot to call `getDefaultSettings` doSomething(getDefaultSettings); ~~~~~~~~~~~~~~~~~~ -!!! error TS2559: Type '() => { timeout: number; }' has no properties in common with type 'Settings'. - doSomething(() => { }); - ~~~~~~~~~ -!!! error TS2559: Type '() => void' has no properties in common with type 'Settings'. +!!! error TS2560: Value of type '() => { timeout: number; }' has no properties in common with type 'Settings'. Did you mean to call it? + doSomething(() => ({ timeout: 1000 })); + ~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2560: Value of type '() => { timeout: number; }' has no properties in common with type 'Settings'. Did you mean to call it? doSomething(null as CtorOnly); ~~~~~~~~~~~~~~~~ -!!! error TS2559: Type 'CtorOnly' has no properties in common with type 'Settings'. +!!! error TS2560: Value of type 'CtorOnly' has no properties in common with type 'Settings'. Did you mean to call it? doSomething(12); ~~ !!! error TS2559: Type '12' has no properties in common with type 'Settings'. diff --git a/tests/baselines/reference/weakType.js b/tests/baselines/reference/weakType.js index 999269384dcdd..2a1dc4ca0e40d 100644 --- a/tests/baselines/reference/weakType.js +++ b/tests/baselines/reference/weakType.js @@ -8,13 +8,13 @@ function getDefaultSettings() { return { timeout: 1000 }; } interface CtorOnly { - new(s: string): string + new(s: string): { timeout: 1000 } } function doSomething(settings: Settings) { /* ... */ } // forgot to call `getDefaultSettings` doSomething(getDefaultSettings); -doSomething(() => { }); +doSomething(() => ({ timeout: 1000 })); doSomething(null as CtorOnly); doSomething(12); doSomething('completely wrong'); @@ -71,7 +71,7 @@ function getDefaultSettings() { function doSomething(settings) { } // forgot to call `getDefaultSettings` doSomething(getDefaultSettings); -doSomething(function () { }); +doSomething(function () { return ({ timeout: 1000 }); }); doSomething(null); doSomething(12); doSomething('completely wrong'); diff --git a/tests/cases/compiler/weakType.ts b/tests/cases/compiler/weakType.ts index 8fda5df916608..08c9d95e672e6 100644 --- a/tests/cases/compiler/weakType.ts +++ b/tests/cases/compiler/weakType.ts @@ -7,13 +7,13 @@ function getDefaultSettings() { return { timeout: 1000 }; } interface CtorOnly { - new(s: string): string + new(s: string): { timeout: 1000 } } function doSomething(settings: Settings) { /* ... */ } // forgot to call `getDefaultSettings` doSomething(getDefaultSettings); -doSomething(() => { }); +doSomething(() => ({ timeout: 1000 })); doSomething(null as CtorOnly); doSomething(12); doSomething('completely wrong'); From 85f59098d3e16010bff6f82a1e9b7ee33b9a6859 Mon Sep 17 00:00:00 2001 From: Andy Date: Tue, 8 Aug 2017 11:38:41 -0700 Subject: [PATCH 066/237] validateSpecs: Use array helpers (#17275) * validateSpecs: Use array helpers * Make filter predicate smaller * forEach -> for-of --- src/compiler/commandLineParser.ts | 34 ++++++++++++++++--------------- 1 file changed, 18 insertions(+), 16 deletions(-) diff --git a/src/compiler/commandLineParser.ts b/src/compiler/commandLineParser.ts index b0cb7f940292f..e82e70dc764b4 100644 --- a/src/compiler/commandLineParser.ts +++ b/src/compiler/commandLineParser.ts @@ -2011,23 +2011,13 @@ namespace ts { } function validateSpecs(specs: ReadonlyArray, errors: Push, allowTrailingRecursion: boolean, jsonSourceFile: JsonSourceFile, specKey: string) { - const validSpecs: string[] = []; - for (const spec of specs) { - if (!allowTrailingRecursion && invalidTrailingRecursionPattern.test(spec)) { - errors.push(createDiagnostic(Diagnostics.File_specification_cannot_end_in_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0, spec)); + return specs.filter(spec => { + const diag = specToDiagnostic(spec, allowTrailingRecursion); + if (diag !== undefined) { + errors.push(createDiagnostic(diag, spec)); } - else if (invalidMultipleRecursionPatterns.test(spec)) { - errors.push(createDiagnostic(Diagnostics.File_specification_cannot_contain_multiple_recursive_directory_wildcards_Asterisk_Asterisk_Colon_0, spec)); - } - else if (invalidDotDotAfterRecursiveWildcardPattern.test(spec)) { - errors.push(createDiagnostic(Diagnostics.File_specification_cannot_contain_a_parent_directory_that_appears_after_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0, spec)); - } - else { - validSpecs.push(spec); - } - } - - return validSpecs; + return diag === undefined; + }); function createDiagnostic(message: DiagnosticMessage, spec: string): Diagnostic { if (jsonSourceFile && jsonSourceFile.jsonObject) { @@ -2045,6 +2035,18 @@ namespace ts { } } + function specToDiagnostic(spec: string, allowTrailingRecursion: boolean): ts.DiagnosticMessage | undefined { + if (!allowTrailingRecursion && invalidTrailingRecursionPattern.test(spec)) { + return Diagnostics.File_specification_cannot_end_in_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0; + } + else if (invalidMultipleRecursionPatterns.test(spec)) { + return Diagnostics.File_specification_cannot_contain_multiple_recursive_directory_wildcards_Asterisk_Asterisk_Colon_0; + } + else if (invalidDotDotAfterRecursiveWildcardPattern.test(spec)) { + return Diagnostics.File_specification_cannot_contain_a_parent_directory_that_appears_after_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0; + } + } + /** * Gets directories in a set of include patterns that should be watched for changes. */ From af20adb13732ee1e50d38e397699016b85d1f84d Mon Sep 17 00:00:00 2001 From: Wesley Wigham Date: Tue, 8 Aug 2017 13:06:12 -0700 Subject: [PATCH 067/237] Add tests for #15358 (#17664) --- ...ckTypePredicateForRedundantProperties.errors.txt | 13 +++++++++++++ .../checkTypePredicateForRedundantProperties.js | 10 ++++++++++ .../checkTypePredicateForRedundantProperties.ts | 3 +++ 3 files changed, 26 insertions(+) create mode 100644 tests/baselines/reference/checkTypePredicateForRedundantProperties.errors.txt create mode 100644 tests/baselines/reference/checkTypePredicateForRedundantProperties.js create mode 100644 tests/cases/compiler/checkTypePredicateForRedundantProperties.ts diff --git a/tests/baselines/reference/checkTypePredicateForRedundantProperties.errors.txt b/tests/baselines/reference/checkTypePredicateForRedundantProperties.errors.txt new file mode 100644 index 0000000000000..a5cb9b0a0989e --- /dev/null +++ b/tests/baselines/reference/checkTypePredicateForRedundantProperties.errors.txt @@ -0,0 +1,13 @@ +tests/cases/compiler/checkTypePredicateForRedundantProperties.ts(1,35): error TS2300: Duplicate identifier 'a'. +tests/cases/compiler/checkTypePredicateForRedundantProperties.ts(1,46): error TS2300: Duplicate identifier 'a'. + + +==== tests/cases/compiler/checkTypePredicateForRedundantProperties.ts (2 errors) ==== + function addProp2(x: any): x is { a: string; a: string; } { + ~ +!!! error TS2300: Duplicate identifier 'a'. + ~ +!!! error TS2300: Duplicate identifier 'a'. + return true; + } + \ No newline at end of file diff --git a/tests/baselines/reference/checkTypePredicateForRedundantProperties.js b/tests/baselines/reference/checkTypePredicateForRedundantProperties.js new file mode 100644 index 0000000000000..8f7be2bfbbc61 --- /dev/null +++ b/tests/baselines/reference/checkTypePredicateForRedundantProperties.js @@ -0,0 +1,10 @@ +//// [checkTypePredicateForRedundantProperties.ts] +function addProp2(x: any): x is { a: string; a: string; } { + return true; +} + + +//// [checkTypePredicateForRedundantProperties.js] +function addProp2(x) { + return true; +} diff --git a/tests/cases/compiler/checkTypePredicateForRedundantProperties.ts b/tests/cases/compiler/checkTypePredicateForRedundantProperties.ts new file mode 100644 index 0000000000000..35222f1e9db73 --- /dev/null +++ b/tests/cases/compiler/checkTypePredicateForRedundantProperties.ts @@ -0,0 +1,3 @@ +function addProp2(x: any): x is { a: string; a: string; } { + return true; +} From a46d6bde974ead83b5bb4bfbfa76d085d391137d Mon Sep 17 00:00:00 2001 From: Wesley Wigham Date: Tue, 8 Aug 2017 13:07:27 -0700 Subject: [PATCH 068/237] Add a seperate cache for the all attributes version of the jsx attributes type (#17620) --- src/compiler/checker.ts | 12 +++++------- src/compiler/types.ts | 1 + 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 579a234cb95e9..c164833ca47b7 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -14107,11 +14107,8 @@ namespace ts { */ function resolveCustomJsxElementAttributesType(openingLikeElement: JsxOpeningLikeElement, shouldIncludeAllStatelessAttributesType: boolean, - elementType?: Type, + elementType: Type = checkExpression(openingLikeElement.tagName), elementClassType?: Type): Type { - if (!elementType) { - elementType = checkExpression(openingLikeElement.tagName); - } if (elementType.flags & TypeFlags.Union) { const types = (elementType as UnionType).types; @@ -14245,11 +14242,12 @@ namespace ts { */ function getCustomJsxElementAttributesType(node: JsxOpeningLikeElement, shouldIncludeAllStatelessAttributesType: boolean): Type { const links = getNodeLinks(node); - if (!links.resolvedJsxElementAttributesType) { + const linkLocation = shouldIncludeAllStatelessAttributesType ? "resolvedJsxElementAllAttributesType" : "resolvedJsxElementAttributesType"; + if (!links[linkLocation]) { const elemClassType = getJsxGlobalElementClassType(); - return links.resolvedJsxElementAttributesType = resolveCustomJsxElementAttributesType(node, shouldIncludeAllStatelessAttributesType, /*elementType*/ undefined, elemClassType); + return links[linkLocation] = resolveCustomJsxElementAttributesType(node, shouldIncludeAllStatelessAttributesType, /*elementType*/ undefined, elemClassType); } - return links.resolvedJsxElementAttributesType; + return links[linkLocation]; } /** diff --git a/src/compiler/types.ts b/src/compiler/types.ts index 3b57608abc5ac..0eb7f03e3ec43 100644 --- a/src/compiler/types.ts +++ b/src/compiler/types.ts @@ -3067,6 +3067,7 @@ namespace ts { hasReportedStatementInAmbientContext?: boolean; // Cache boolean if we report statements in ambient context jsxFlags?: JsxFlags; // flags for knowing what kind of element/attributes we're dealing with resolvedJsxElementAttributesType?: Type; // resolved element attributes type of a JSX openinglike element + resolvedJsxElementAllAttributesType?: Type; // resolved all element attributes type of a JSX openinglike element hasSuperCall?: boolean; // recorded result when we try to find super-call. We only try to find one if this flag is undefined, indicating that we haven't made an attempt. superCall?: ExpressionStatement; // Cached first super-call found in the constructor. Used in checking whether super is called before this-accessing switchTypes?: Type[]; // Cached array of switch case expression types From 3deb39bba6bfa7dc0482bf1a6ad4494ed04dc3c1 Mon Sep 17 00:00:00 2001 From: Andy Date: Tue, 8 Aug 2017 14:01:16 -0700 Subject: [PATCH 069/237] Remove unnecessary check that type is ObjectType (#17418) --- src/compiler/checker.ts | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index c164833ca47b7..b427ae34b6990 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -3420,9 +3420,7 @@ namespace ts { if (!symbolStack) { symbolStack = []; } - const isConstructorObject = type.flags & TypeFlags.Object && - getObjectFlags(type) & ObjectFlags.Anonymous && - type.symbol && type.symbol.flags & SymbolFlags.Class; + const isConstructorObject = type.objectFlags & ObjectFlags.Anonymous && type.symbol && type.symbol.flags & SymbolFlags.Class; if (isConstructorObject) { writeLiteralType(type, flags); } From d2625678f9d67062dee980bf8ae1ee9298d2e272 Mon Sep 17 00:00:00 2001 From: Wesley Wigham Date: Tue, 8 Aug 2017 14:44:41 -0700 Subject: [PATCH 070/237] Add test case from #14439 (#17627) --- .../reference/mixingApparentTypeOverrides.js | 84 +++++++++++++++++++ .../mixingApparentTypeOverrides.symbols | 67 +++++++++++++++ .../mixingApparentTypeOverrides.types | 76 +++++++++++++++++ .../compiler/mixingApparentTypeOverrides.ts | 28 +++++++ 4 files changed, 255 insertions(+) create mode 100644 tests/baselines/reference/mixingApparentTypeOverrides.js create mode 100644 tests/baselines/reference/mixingApparentTypeOverrides.symbols create mode 100644 tests/baselines/reference/mixingApparentTypeOverrides.types create mode 100644 tests/cases/compiler/mixingApparentTypeOverrides.ts diff --git a/tests/baselines/reference/mixingApparentTypeOverrides.js b/tests/baselines/reference/mixingApparentTypeOverrides.js new file mode 100644 index 0000000000000..20db894abb8d1 --- /dev/null +++ b/tests/baselines/reference/mixingApparentTypeOverrides.js @@ -0,0 +1,84 @@ +//// [mixingApparentTypeOverrides.ts] +type Constructor = new(...args: any[]) => T; +function Tagged>(Base: T) { + return class extends Base { + _tag: string; + constructor(...args: any[]) { + super(...args); + this._tag = ""; + } + }; +} + +class A { + toString () { + return "class A"; + } +} + +class B extends Tagged(A) { + toString () { // Should not be an error + return "class B"; + } +} + +class C extends A { + toString () { // Should not be an error + return "class C"; + } +} + +//// [mixingApparentTypeOverrides.js] +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +function Tagged(Base) { + return (function (_super) { + __extends(class_1, _super); + function class_1() { + var args = []; + for (var _i = 0; _i < arguments.length; _i++) { + args[_i] = arguments[_i]; + } + var _this = _super.apply(this, args) || this; + _this._tag = ""; + return _this; + } + return class_1; + }(Base)); +} +var A = (function () { + function A() { + } + A.prototype.toString = function () { + return "class A"; + }; + return A; +}()); +var B = (function (_super) { + __extends(B, _super); + function B() { + return _super !== null && _super.apply(this, arguments) || this; + } + B.prototype.toString = function () { + return "class B"; + }; + return B; +}(Tagged(A))); +var C = (function (_super) { + __extends(C, _super); + function C() { + return _super !== null && _super.apply(this, arguments) || this; + } + C.prototype.toString = function () { + return "class C"; + }; + return C; +}(A)); diff --git a/tests/baselines/reference/mixingApparentTypeOverrides.symbols b/tests/baselines/reference/mixingApparentTypeOverrides.symbols new file mode 100644 index 0000000000000..ea0adbb8acd96 --- /dev/null +++ b/tests/baselines/reference/mixingApparentTypeOverrides.symbols @@ -0,0 +1,67 @@ +=== tests/cases/compiler/mixingApparentTypeOverrides.ts === +type Constructor = new(...args: any[]) => T; +>Constructor : Symbol(Constructor, Decl(mixingApparentTypeOverrides.ts, 0, 0)) +>T : Symbol(T, Decl(mixingApparentTypeOverrides.ts, 0, 17)) +>args : Symbol(args, Decl(mixingApparentTypeOverrides.ts, 0, 26)) +>T : Symbol(T, Decl(mixingApparentTypeOverrides.ts, 0, 17)) + +function Tagged>(Base: T) { +>Tagged : Symbol(Tagged, Decl(mixingApparentTypeOverrides.ts, 0, 47)) +>T : Symbol(T, Decl(mixingApparentTypeOverrides.ts, 1, 16)) +>Constructor : Symbol(Constructor, Decl(mixingApparentTypeOverrides.ts, 0, 0)) +>Base : Symbol(Base, Decl(mixingApparentTypeOverrides.ts, 1, 43)) +>T : Symbol(T, Decl(mixingApparentTypeOverrides.ts, 1, 16)) + + return class extends Base { +>Base : Symbol(Base, Decl(mixingApparentTypeOverrides.ts, 1, 43)) + + _tag: string; +>_tag : Symbol((Anonymous class)._tag, Decl(mixingApparentTypeOverrides.ts, 2, 29)) + + constructor(...args: any[]) { +>args : Symbol(args, Decl(mixingApparentTypeOverrides.ts, 4, 16)) + + super(...args); +>super : Symbol(T, Decl(mixingApparentTypeOverrides.ts, 1, 16)) +>args : Symbol(args, Decl(mixingApparentTypeOverrides.ts, 4, 16)) + + this._tag = ""; +>this._tag : Symbol((Anonymous class)._tag, Decl(mixingApparentTypeOverrides.ts, 2, 29)) +>this : Symbol((Anonymous class), Decl(mixingApparentTypeOverrides.ts, 2, 8)) +>_tag : Symbol((Anonymous class)._tag, Decl(mixingApparentTypeOverrides.ts, 2, 29)) + } + }; +} + +class A { +>A : Symbol(A, Decl(mixingApparentTypeOverrides.ts, 9, 1)) + + toString () { +>toString : Symbol(A.toString, Decl(mixingApparentTypeOverrides.ts, 11, 9)) + + return "class A"; + } +} + +class B extends Tagged(A) { +>B : Symbol(B, Decl(mixingApparentTypeOverrides.ts, 15, 1)) +>Tagged : Symbol(Tagged, Decl(mixingApparentTypeOverrides.ts, 0, 47)) +>A : Symbol(A, Decl(mixingApparentTypeOverrides.ts, 9, 1)) + + toString () { // Should not be an error +>toString : Symbol(B.toString, Decl(mixingApparentTypeOverrides.ts, 17, 27)) + + return "class B"; + } +} + +class C extends A { +>C : Symbol(C, Decl(mixingApparentTypeOverrides.ts, 21, 1)) +>A : Symbol(A, Decl(mixingApparentTypeOverrides.ts, 9, 1)) + + toString () { // Should not be an error +>toString : Symbol(C.toString, Decl(mixingApparentTypeOverrides.ts, 23, 19)) + + return "class C"; + } +} diff --git a/tests/baselines/reference/mixingApparentTypeOverrides.types b/tests/baselines/reference/mixingApparentTypeOverrides.types new file mode 100644 index 0000000000000..eae9c391a7890 --- /dev/null +++ b/tests/baselines/reference/mixingApparentTypeOverrides.types @@ -0,0 +1,76 @@ +=== tests/cases/compiler/mixingApparentTypeOverrides.ts === +type Constructor = new(...args: any[]) => T; +>Constructor : Constructor +>T : T +>args : any[] +>T : T + +function Tagged>(Base: T) { +>Tagged : >(Base: T) => { new (...args: any[]): (Anonymous class); prototype: Tagged.(Anonymous class); } & T +>T : T +>Constructor : Constructor +>Base : T +>T : T + + return class extends Base { +>class extends Base { _tag: string; constructor(...args: any[]) { super(...args); this._tag = ""; } } : { new (...args: any[]): (Anonymous class); prototype: Tagged.(Anonymous class); } & T +>Base : {} + + _tag: string; +>_tag : string + + constructor(...args: any[]) { +>args : any[] + + super(...args); +>super(...args) : void +>super : T +>...args : any +>args : any[] + + this._tag = ""; +>this._tag = "" : "" +>this._tag : string +>this : this +>_tag : string +>"" : "" + } + }; +} + +class A { +>A : A + + toString () { +>toString : () => string + + return "class A"; +>"class A" : "class A" + } +} + +class B extends Tagged(A) { +>B : B +>Tagged(A) : Tagged.(Anonymous class) & A +>Tagged : >(Base: T) => { new (...args: any[]): (Anonymous class); prototype: Tagged.(Anonymous class); } & T +>A : typeof A + + toString () { // Should not be an error +>toString : () => string + + return "class B"; +>"class B" : "class B" + } +} + +class C extends A { +>C : C +>A : A + + toString () { // Should not be an error +>toString : () => string + + return "class C"; +>"class C" : "class C" + } +} diff --git a/tests/cases/compiler/mixingApparentTypeOverrides.ts b/tests/cases/compiler/mixingApparentTypeOverrides.ts new file mode 100644 index 0000000000000..5d68c58d46132 --- /dev/null +++ b/tests/cases/compiler/mixingApparentTypeOverrides.ts @@ -0,0 +1,28 @@ +type Constructor = new(...args: any[]) => T; +function Tagged>(Base: T) { + return class extends Base { + _tag: string; + constructor(...args: any[]) { + super(...args); + this._tag = ""; + } + }; +} + +class A { + toString () { + return "class A"; + } +} + +class B extends Tagged(A) { + toString () { // Should not be an error + return "class B"; + } +} + +class C extends A { + toString () { // Should not be an error + return "class C"; + } +} \ No newline at end of file From e47df360dc050bce8fa3f559c6506d1a8e739d7c Mon Sep 17 00:00:00 2001 From: Nathan Shively-Sanders Date: Tue, 8 Aug 2017 14:51:06 -0700 Subject: [PATCH 071/237] Use isTypeAny instead of checking flags directly --- src/compiler/checker.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 0fc2b9275152f..ff1d157c4fa93 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -17148,7 +17148,7 @@ namespace ts { // and the right operand to be of type Any, a subtype of the 'Function' interface type, or have a call or construct signature. // The result is always of the Boolean primitive type. // NOTE: do not raise error if leftType is unknown as related error was already reported - if (!(leftType.flags & TypeFlags.Any) && isTypeAssignableToKind(leftType, TypeFlags.Primitive)) { + if (!isTypeAny(leftType) && isTypeAssignableToKind(leftType, TypeFlags.Primitive)) { error(left, Diagnostics.The_left_hand_side_of_an_instanceof_expression_must_be_of_type_any_an_object_type_or_a_type_parameter); } // NOTE: do not raise error if right is unknown as related error was already reported From fac93a304c816eea3b4f078ffe6f4567da145098 Mon Sep 17 00:00:00 2001 From: Nathan Shively-Sanders Date: Tue, 8 Aug 2017 16:11:42 -0700 Subject: [PATCH 072/237] Add parentheses:clarify evaluation order of &&/|| in isTypeAssignableToKind --- src/compiler/checker.ts | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index ff1d157c4fa93..33457daeccbca 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -17120,15 +17120,15 @@ namespace ts { if (strict && source.flags & (TypeFlags.Any | TypeFlags.Void | TypeFlags.Undefined | TypeFlags.Null)) { return false; } - return kind & TypeFlags.NumberLike && isTypeAssignableTo(source, numberType) || - kind & TypeFlags.StringLike && isTypeAssignableTo(source, stringType) || - kind & TypeFlags.BooleanLike && isTypeAssignableTo(source, booleanType) || - kind & TypeFlags.Void && isTypeAssignableTo(source, voidType) || - kind & TypeFlags.Never && isTypeAssignableTo(source, neverType) || - kind & TypeFlags.Null && isTypeAssignableTo(source, nullType) || - kind & TypeFlags.Undefined && isTypeAssignableTo(source, undefinedType) || - kind & TypeFlags.ESSymbol && isTypeAssignableTo(source, esSymbolType) || - kind & TypeFlags.NonPrimitive && isTypeAssignableTo(source, nonPrimitiveType); + return (kind & TypeFlags.NumberLike && isTypeAssignableTo(source, numberType)) || + (kind & TypeFlags.StringLike && isTypeAssignableTo(source, stringType)) || + (kind & TypeFlags.BooleanLike && isTypeAssignableTo(source, booleanType)) || + (kind & TypeFlags.Void && isTypeAssignableTo(source, voidType)) || + (kind & TypeFlags.Never && isTypeAssignableTo(source, neverType)) || + (kind & TypeFlags.Null && isTypeAssignableTo(source, nullType)) || + (kind & TypeFlags.Undefined && isTypeAssignableTo(source, undefinedType)) || + (kind & TypeFlags.ESSymbol && isTypeAssignableTo(source, esSymbolType)) || + (kind & TypeFlags.NonPrimitive && isTypeAssignableTo(source, nonPrimitiveType)); } function isConstEnumObjectType(type: Type): boolean { From 43e758e1a96f2f8a93eefe215af9c30c0c90fbe0 Mon Sep 17 00:00:00 2001 From: Wesley Wigham Date: Tue, 8 Aug 2017 17:01:18 -0700 Subject: [PATCH 073/237] Create synthetic default exports for dynamic imports (#17492) * Create synthetic default exports for dynamic imports * Slightly better solution * Actually accept baselines * Slightly adjust synthetic type * Cache synthetic type * Inline variables, remove non-required calls * Rename function --- src/compiler/checker.ts | 29 ++++++++- src/compiler/types.ts | 5 ++ .../importCallExpressionAsyncES3System.types | 30 +++++----- .../importCallExpressionAsyncES5System.types | 30 +++++----- .../importCallExpressionAsyncES6System.types | 30 +++++----- .../importCallExpressionES5System.types | 34 +++++------ .../importCallExpressionES6System.types | 34 +++++------ .../importCallExpressionInSystem1.types | 26 ++++---- .../importCallExpressionInSystem2.types | 2 +- .../importCallExpressionInSystem3.types | 6 +- .../importCallExpressionInSystem4.types | 60 +++++++++---------- ...ntheticDefaultExportsWithDynamicImports.js | 19 ++++++ ...icDefaultExportsWithDynamicImports.symbols | 17 ++++++ ...eticDefaultExportsWithDynamicImports.types | 22 +++++++ ...ntheticDefaultExportsWithDynamicImports.ts | 9 +++ 15 files changed, 224 insertions(+), 129 deletions(-) create mode 100644 tests/baselines/reference/syntheticDefaultExportsWithDynamicImports.js create mode 100644 tests/baselines/reference/syntheticDefaultExportsWithDynamicImports.symbols create mode 100644 tests/baselines/reference/syntheticDefaultExportsWithDynamicImports.types create mode 100644 tests/cases/compiler/syntheticDefaultExportsWithDynamicImports.ts diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index e220021803047..1d1d16b7ee11e 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -1757,7 +1757,7 @@ namespace ts { // An external module with an 'export =' declaration resolves to the target of the 'export =' declaration, // and an external module with no 'export =' declaration resolves to the module itself. function resolveExternalModuleSymbol(moduleSymbol: Symbol, dontResolveAlias?: boolean): Symbol { - return moduleSymbol && getMergedSymbol(resolveSymbol(moduleSymbol.exports.get("export=" as __String), dontResolveAlias)) || moduleSymbol; + return moduleSymbol && getMergedSymbol(resolveSymbol(moduleSymbol.exports.get(InternalSymbolName.ExportEquals), dontResolveAlias)) || moduleSymbol; } // An external module with an 'export =' declaration may be referenced as an ES6 module provided the 'export =' @@ -1772,7 +1772,7 @@ namespace ts { } function hasExportAssignmentSymbol(moduleSymbol: Symbol): boolean { - return moduleSymbol.exports.get("export=" as __String) !== undefined; + return moduleSymbol.exports.get(InternalSymbolName.ExportEquals) !== undefined; } function getExportsOfModuleAsArray(moduleSymbol: Symbol): Symbol[] { @@ -16402,12 +16402,35 @@ namespace ts { if (moduleSymbol) { const esModuleSymbol = resolveESModuleSymbol(moduleSymbol, specifier, /*dontRecursivelyResolve*/ true); if (esModuleSymbol) { - return createPromiseReturnType(node, getTypeOfSymbol(esModuleSymbol)); + return createPromiseReturnType(node, getTypeWithSyntheticDefaultImportType(getTypeOfSymbol(esModuleSymbol), esModuleSymbol)); } } return createPromiseReturnType(node, anyType); } + function getTypeWithSyntheticDefaultImportType(type: Type, symbol: Symbol): Type { + if (allowSyntheticDefaultImports && type && type !== unknownType) { + const synthType = type as SyntheticDefaultModuleType; + if (!synthType.syntheticType) { + if (!getPropertyOfType(type, InternalSymbolName.Default)) { + const memberTable = createSymbolTable(); + const newSymbol = createSymbol(SymbolFlags.Alias, InternalSymbolName.Default); + newSymbol.target = resolveSymbol(symbol); + memberTable.set(InternalSymbolName.Default, newSymbol); + const anonymousSymbol = createSymbol(SymbolFlags.TypeLiteral, InternalSymbolName.Type); + const defaultContainingObject = createAnonymousType(anonymousSymbol, memberTable, emptyArray, emptyArray, /*stringIndexInfo*/ undefined, /*numberIndexInfo*/ undefined); + anonymousSymbol.type = defaultContainingObject; + synthType.syntheticType = getIntersectionType([type, defaultContainingObject]); + } + else { + synthType.syntheticType = type; + } + } + return synthType.syntheticType; + } + return type; + } + function isCommonJsRequire(node: Node) { if (!isRequireCall(node, /*checkArgumentIsStringLiteral*/ true)) { return false; diff --git a/src/compiler/types.ts b/src/compiler/types.ts index 259dad75b000a..27dcbda309ffd 100644 --- a/src/compiler/types.ts +++ b/src/compiler/types.ts @@ -3318,6 +3318,11 @@ namespace ts { awaitedTypeOfType?: Type; } + /* @internal */ + export interface SyntheticDefaultModuleType extends Type { + syntheticType?: Type; + } + export interface TypeVariable extends Type { /* @internal */ resolvedBaseConstraint: Type; diff --git a/tests/baselines/reference/importCallExpressionAsyncES3System.types b/tests/baselines/reference/importCallExpressionAsyncES3System.types index 4f6a2bb31bea1..90c981c01ca75 100644 --- a/tests/baselines/reference/importCallExpressionAsyncES3System.types +++ b/tests/baselines/reference/importCallExpressionAsyncES3System.types @@ -3,9 +3,9 @@ export async function fn() { >fn : () => Promise const req = await import('./test') // ONE ->req : typeof "tests/cases/conformance/dynamicImport/test" ->await import('./test') : typeof "tests/cases/conformance/dynamicImport/test" ->import('./test') : Promise +>req : typeof "tests/cases/conformance/dynamicImport/test" & { default: typeof "tests/cases/conformance/dynamicImport/test"; } +>await import('./test') : typeof "tests/cases/conformance/dynamicImport/test" & { default: typeof "tests/cases/conformance/dynamicImport/test"; } +>import('./test') : Promise >'./test' : "./test" } @@ -16,9 +16,9 @@ export class cl1 { >m : () => Promise const req = await import('./test') // TWO ->req : typeof "tests/cases/conformance/dynamicImport/test" ->await import('./test') : typeof "tests/cases/conformance/dynamicImport/test" ->import('./test') : Promise +>req : typeof "tests/cases/conformance/dynamicImport/test" & { default: typeof "tests/cases/conformance/dynamicImport/test"; } +>await import('./test') : typeof "tests/cases/conformance/dynamicImport/test" & { default: typeof "tests/cases/conformance/dynamicImport/test"; } +>import('./test') : Promise >'./test' : "./test" } } @@ -32,9 +32,9 @@ export const obj = { >async () => { const req = await import('./test') // THREE } : () => Promise const req = await import('./test') // THREE ->req : typeof "tests/cases/conformance/dynamicImport/test" ->await import('./test') : typeof "tests/cases/conformance/dynamicImport/test" ->import('./test') : Promise +>req : typeof "tests/cases/conformance/dynamicImport/test" & { default: typeof "tests/cases/conformance/dynamicImport/test"; } +>await import('./test') : typeof "tests/cases/conformance/dynamicImport/test" & { default: typeof "tests/cases/conformance/dynamicImport/test"; } +>import('./test') : Promise >'./test' : "./test" } } @@ -51,9 +51,9 @@ export class cl2 { >async () => { const req = await import('./test') // FOUR } : () => Promise const req = await import('./test') // FOUR ->req : typeof "tests/cases/conformance/dynamicImport/test" ->await import('./test') : typeof "tests/cases/conformance/dynamicImport/test" ->import('./test') : Promise +>req : typeof "tests/cases/conformance/dynamicImport/test" & { default: typeof "tests/cases/conformance/dynamicImport/test"; } +>await import('./test') : typeof "tests/cases/conformance/dynamicImport/test" & { default: typeof "tests/cases/conformance/dynamicImport/test"; } +>import('./test') : Promise >'./test' : "./test" } } @@ -64,9 +64,9 @@ export const l = async () => { >async () => { const req = await import('./test') // FIVE} : () => Promise const req = await import('./test') // FIVE ->req : typeof "tests/cases/conformance/dynamicImport/test" ->await import('./test') : typeof "tests/cases/conformance/dynamicImport/test" ->import('./test') : Promise +>req : typeof "tests/cases/conformance/dynamicImport/test" & { default: typeof "tests/cases/conformance/dynamicImport/test"; } +>await import('./test') : typeof "tests/cases/conformance/dynamicImport/test" & { default: typeof "tests/cases/conformance/dynamicImport/test"; } +>import('./test') : Promise >'./test' : "./test" } diff --git a/tests/baselines/reference/importCallExpressionAsyncES5System.types b/tests/baselines/reference/importCallExpressionAsyncES5System.types index 4f6a2bb31bea1..90c981c01ca75 100644 --- a/tests/baselines/reference/importCallExpressionAsyncES5System.types +++ b/tests/baselines/reference/importCallExpressionAsyncES5System.types @@ -3,9 +3,9 @@ export async function fn() { >fn : () => Promise const req = await import('./test') // ONE ->req : typeof "tests/cases/conformance/dynamicImport/test" ->await import('./test') : typeof "tests/cases/conformance/dynamicImport/test" ->import('./test') : Promise +>req : typeof "tests/cases/conformance/dynamicImport/test" & { default: typeof "tests/cases/conformance/dynamicImport/test"; } +>await import('./test') : typeof "tests/cases/conformance/dynamicImport/test" & { default: typeof "tests/cases/conformance/dynamicImport/test"; } +>import('./test') : Promise >'./test' : "./test" } @@ -16,9 +16,9 @@ export class cl1 { >m : () => Promise const req = await import('./test') // TWO ->req : typeof "tests/cases/conformance/dynamicImport/test" ->await import('./test') : typeof "tests/cases/conformance/dynamicImport/test" ->import('./test') : Promise +>req : typeof "tests/cases/conformance/dynamicImport/test" & { default: typeof "tests/cases/conformance/dynamicImport/test"; } +>await import('./test') : typeof "tests/cases/conformance/dynamicImport/test" & { default: typeof "tests/cases/conformance/dynamicImport/test"; } +>import('./test') : Promise >'./test' : "./test" } } @@ -32,9 +32,9 @@ export const obj = { >async () => { const req = await import('./test') // THREE } : () => Promise const req = await import('./test') // THREE ->req : typeof "tests/cases/conformance/dynamicImport/test" ->await import('./test') : typeof "tests/cases/conformance/dynamicImport/test" ->import('./test') : Promise +>req : typeof "tests/cases/conformance/dynamicImport/test" & { default: typeof "tests/cases/conformance/dynamicImport/test"; } +>await import('./test') : typeof "tests/cases/conformance/dynamicImport/test" & { default: typeof "tests/cases/conformance/dynamicImport/test"; } +>import('./test') : Promise >'./test' : "./test" } } @@ -51,9 +51,9 @@ export class cl2 { >async () => { const req = await import('./test') // FOUR } : () => Promise const req = await import('./test') // FOUR ->req : typeof "tests/cases/conformance/dynamicImport/test" ->await import('./test') : typeof "tests/cases/conformance/dynamicImport/test" ->import('./test') : Promise +>req : typeof "tests/cases/conformance/dynamicImport/test" & { default: typeof "tests/cases/conformance/dynamicImport/test"; } +>await import('./test') : typeof "tests/cases/conformance/dynamicImport/test" & { default: typeof "tests/cases/conformance/dynamicImport/test"; } +>import('./test') : Promise >'./test' : "./test" } } @@ -64,9 +64,9 @@ export const l = async () => { >async () => { const req = await import('./test') // FIVE} : () => Promise const req = await import('./test') // FIVE ->req : typeof "tests/cases/conformance/dynamicImport/test" ->await import('./test') : typeof "tests/cases/conformance/dynamicImport/test" ->import('./test') : Promise +>req : typeof "tests/cases/conformance/dynamicImport/test" & { default: typeof "tests/cases/conformance/dynamicImport/test"; } +>await import('./test') : typeof "tests/cases/conformance/dynamicImport/test" & { default: typeof "tests/cases/conformance/dynamicImport/test"; } +>import('./test') : Promise >'./test' : "./test" } diff --git a/tests/baselines/reference/importCallExpressionAsyncES6System.types b/tests/baselines/reference/importCallExpressionAsyncES6System.types index 4f6a2bb31bea1..90c981c01ca75 100644 --- a/tests/baselines/reference/importCallExpressionAsyncES6System.types +++ b/tests/baselines/reference/importCallExpressionAsyncES6System.types @@ -3,9 +3,9 @@ export async function fn() { >fn : () => Promise const req = await import('./test') // ONE ->req : typeof "tests/cases/conformance/dynamicImport/test" ->await import('./test') : typeof "tests/cases/conformance/dynamicImport/test" ->import('./test') : Promise +>req : typeof "tests/cases/conformance/dynamicImport/test" & { default: typeof "tests/cases/conformance/dynamicImport/test"; } +>await import('./test') : typeof "tests/cases/conformance/dynamicImport/test" & { default: typeof "tests/cases/conformance/dynamicImport/test"; } +>import('./test') : Promise >'./test' : "./test" } @@ -16,9 +16,9 @@ export class cl1 { >m : () => Promise const req = await import('./test') // TWO ->req : typeof "tests/cases/conformance/dynamicImport/test" ->await import('./test') : typeof "tests/cases/conformance/dynamicImport/test" ->import('./test') : Promise +>req : typeof "tests/cases/conformance/dynamicImport/test" & { default: typeof "tests/cases/conformance/dynamicImport/test"; } +>await import('./test') : typeof "tests/cases/conformance/dynamicImport/test" & { default: typeof "tests/cases/conformance/dynamicImport/test"; } +>import('./test') : Promise >'./test' : "./test" } } @@ -32,9 +32,9 @@ export const obj = { >async () => { const req = await import('./test') // THREE } : () => Promise const req = await import('./test') // THREE ->req : typeof "tests/cases/conformance/dynamicImport/test" ->await import('./test') : typeof "tests/cases/conformance/dynamicImport/test" ->import('./test') : Promise +>req : typeof "tests/cases/conformance/dynamicImport/test" & { default: typeof "tests/cases/conformance/dynamicImport/test"; } +>await import('./test') : typeof "tests/cases/conformance/dynamicImport/test" & { default: typeof "tests/cases/conformance/dynamicImport/test"; } +>import('./test') : Promise >'./test' : "./test" } } @@ -51,9 +51,9 @@ export class cl2 { >async () => { const req = await import('./test') // FOUR } : () => Promise const req = await import('./test') // FOUR ->req : typeof "tests/cases/conformance/dynamicImport/test" ->await import('./test') : typeof "tests/cases/conformance/dynamicImport/test" ->import('./test') : Promise +>req : typeof "tests/cases/conformance/dynamicImport/test" & { default: typeof "tests/cases/conformance/dynamicImport/test"; } +>await import('./test') : typeof "tests/cases/conformance/dynamicImport/test" & { default: typeof "tests/cases/conformance/dynamicImport/test"; } +>import('./test') : Promise >'./test' : "./test" } } @@ -64,9 +64,9 @@ export const l = async () => { >async () => { const req = await import('./test') // FIVE} : () => Promise const req = await import('./test') // FIVE ->req : typeof "tests/cases/conformance/dynamicImport/test" ->await import('./test') : typeof "tests/cases/conformance/dynamicImport/test" ->import('./test') : Promise +>req : typeof "tests/cases/conformance/dynamicImport/test" & { default: typeof "tests/cases/conformance/dynamicImport/test"; } +>await import('./test') : typeof "tests/cases/conformance/dynamicImport/test" & { default: typeof "tests/cases/conformance/dynamicImport/test"; } +>import('./test') : Promise >'./test' : "./test" } diff --git a/tests/baselines/reference/importCallExpressionES5System.types b/tests/baselines/reference/importCallExpressionES5System.types index e97f722b14ff5..02bd64142d499 100644 --- a/tests/baselines/reference/importCallExpressionES5System.types +++ b/tests/baselines/reference/importCallExpressionES5System.types @@ -5,41 +5,41 @@ export function foo() { return "foo"; } === tests/cases/conformance/dynamicImport/1.ts === import("./0"); ->import("./0") : Promise +>import("./0") : Promise >"./0" : "./0" var p1 = import("./0"); ->p1 : Promise ->import("./0") : Promise +>p1 : Promise +>import("./0") : Promise >"./0" : "./0" p1.then(zero => { >p1.then(zero => { return zero.foo();}) : Promise ->p1.then : (onfulfilled?: (value: typeof "tests/cases/conformance/dynamicImport/0") => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise ->p1 : Promise ->then : (onfulfilled?: (value: typeof "tests/cases/conformance/dynamicImport/0") => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise ->zero => { return zero.foo();} : (zero: typeof "tests/cases/conformance/dynamicImport/0") => string ->zero : typeof "tests/cases/conformance/dynamicImport/0" +>p1.then : (onfulfilled?: (value: typeof "tests/cases/conformance/dynamicImport/0" & { default: typeof "tests/cases/conformance/dynamicImport/0"; }) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>p1 : Promise +>then : (onfulfilled?: (value: typeof "tests/cases/conformance/dynamicImport/0" & { default: typeof "tests/cases/conformance/dynamicImport/0"; }) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>zero => { return zero.foo();} : (zero: typeof "tests/cases/conformance/dynamicImport/0" & { default: typeof "tests/cases/conformance/dynamicImport/0"; }) => string +>zero : typeof "tests/cases/conformance/dynamicImport/0" & { default: typeof "tests/cases/conformance/dynamicImport/0"; } return zero.foo(); >zero.foo() : string >zero.foo : () => string ->zero : typeof "tests/cases/conformance/dynamicImport/0" +>zero : typeof "tests/cases/conformance/dynamicImport/0" & { default: typeof "tests/cases/conformance/dynamicImport/0"; } >foo : () => string }); export var p2 = import("./0"); ->p2 : Promise ->import("./0") : Promise +>p2 : Promise +>import("./0") : Promise >"./0" : "./0" function foo() { >foo : () => void const p2 = import("./0"); ->p2 : Promise ->import("./0") : Promise +>p2 : Promise +>import("./0") : Promise >"./0" : "./0" } @@ -50,8 +50,8 @@ class C { >method : () => void const loadAsync = import ("./0"); ->loadAsync : Promise ->import ("./0") : Promise +>loadAsync : Promise +>import ("./0") : Promise >"./0" : "./0" } } @@ -63,8 +63,8 @@ export class D { >method : () => void const loadAsync = import ("./0"); ->loadAsync : Promise ->import ("./0") : Promise +>loadAsync : Promise +>import ("./0") : Promise >"./0" : "./0" } } diff --git a/tests/baselines/reference/importCallExpressionES6System.types b/tests/baselines/reference/importCallExpressionES6System.types index e97f722b14ff5..02bd64142d499 100644 --- a/tests/baselines/reference/importCallExpressionES6System.types +++ b/tests/baselines/reference/importCallExpressionES6System.types @@ -5,41 +5,41 @@ export function foo() { return "foo"; } === tests/cases/conformance/dynamicImport/1.ts === import("./0"); ->import("./0") : Promise +>import("./0") : Promise >"./0" : "./0" var p1 = import("./0"); ->p1 : Promise ->import("./0") : Promise +>p1 : Promise +>import("./0") : Promise >"./0" : "./0" p1.then(zero => { >p1.then(zero => { return zero.foo();}) : Promise ->p1.then : (onfulfilled?: (value: typeof "tests/cases/conformance/dynamicImport/0") => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise ->p1 : Promise ->then : (onfulfilled?: (value: typeof "tests/cases/conformance/dynamicImport/0") => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise ->zero => { return zero.foo();} : (zero: typeof "tests/cases/conformance/dynamicImport/0") => string ->zero : typeof "tests/cases/conformance/dynamicImport/0" +>p1.then : (onfulfilled?: (value: typeof "tests/cases/conformance/dynamicImport/0" & { default: typeof "tests/cases/conformance/dynamicImport/0"; }) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>p1 : Promise +>then : (onfulfilled?: (value: typeof "tests/cases/conformance/dynamicImport/0" & { default: typeof "tests/cases/conformance/dynamicImport/0"; }) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>zero => { return zero.foo();} : (zero: typeof "tests/cases/conformance/dynamicImport/0" & { default: typeof "tests/cases/conformance/dynamicImport/0"; }) => string +>zero : typeof "tests/cases/conformance/dynamicImport/0" & { default: typeof "tests/cases/conformance/dynamicImport/0"; } return zero.foo(); >zero.foo() : string >zero.foo : () => string ->zero : typeof "tests/cases/conformance/dynamicImport/0" +>zero : typeof "tests/cases/conformance/dynamicImport/0" & { default: typeof "tests/cases/conformance/dynamicImport/0"; } >foo : () => string }); export var p2 = import("./0"); ->p2 : Promise ->import("./0") : Promise +>p2 : Promise +>import("./0") : Promise >"./0" : "./0" function foo() { >foo : () => void const p2 = import("./0"); ->p2 : Promise ->import("./0") : Promise +>p2 : Promise +>import("./0") : Promise >"./0" : "./0" } @@ -50,8 +50,8 @@ class C { >method : () => void const loadAsync = import ("./0"); ->loadAsync : Promise ->import ("./0") : Promise +>loadAsync : Promise +>import ("./0") : Promise >"./0" : "./0" } } @@ -63,8 +63,8 @@ export class D { >method : () => void const loadAsync = import ("./0"); ->loadAsync : Promise ->import ("./0") : Promise +>loadAsync : Promise +>import ("./0") : Promise >"./0" : "./0" } } diff --git a/tests/baselines/reference/importCallExpressionInSystem1.types b/tests/baselines/reference/importCallExpressionInSystem1.types index 661d27d14692e..a82d817675388 100644 --- a/tests/baselines/reference/importCallExpressionInSystem1.types +++ b/tests/baselines/reference/importCallExpressionInSystem1.types @@ -5,40 +5,40 @@ export function foo() { return "foo"; } === tests/cases/conformance/dynamicImport/1.ts === import("./0"); ->import("./0") : Promise +>import("./0") : Promise >"./0" : "./0" var p1 = import("./0"); ->p1 : Promise ->import("./0") : Promise +>p1 : Promise +>import("./0") : Promise >"./0" : "./0" p1.then(zero => { >p1.then(zero => { return zero.foo();}) : Promise ->p1.then : (onfulfilled?: (value: typeof "tests/cases/conformance/dynamicImport/0") => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise ->p1 : Promise ->then : (onfulfilled?: (value: typeof "tests/cases/conformance/dynamicImport/0") => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise ->zero => { return zero.foo();} : (zero: typeof "tests/cases/conformance/dynamicImport/0") => string ->zero : typeof "tests/cases/conformance/dynamicImport/0" +>p1.then : (onfulfilled?: (value: typeof "tests/cases/conformance/dynamicImport/0" & { default: typeof "tests/cases/conformance/dynamicImport/0"; }) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>p1 : Promise +>then : (onfulfilled?: (value: typeof "tests/cases/conformance/dynamicImport/0" & { default: typeof "tests/cases/conformance/dynamicImport/0"; }) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>zero => { return zero.foo();} : (zero: typeof "tests/cases/conformance/dynamicImport/0" & { default: typeof "tests/cases/conformance/dynamicImport/0"; }) => string +>zero : typeof "tests/cases/conformance/dynamicImport/0" & { default: typeof "tests/cases/conformance/dynamicImport/0"; } return zero.foo(); >zero.foo() : string >zero.foo : () => string ->zero : typeof "tests/cases/conformance/dynamicImport/0" +>zero : typeof "tests/cases/conformance/dynamicImport/0" & { default: typeof "tests/cases/conformance/dynamicImport/0"; } >foo : () => string }); export var p2 = import("./0"); ->p2 : Promise ->import("./0") : Promise +>p2 : Promise +>import("./0") : Promise >"./0" : "./0" function foo() { >foo : () => void const p2 = import("./0"); ->p2 : Promise ->import("./0") : Promise +>p2 : Promise +>import("./0") : Promise >"./0" : "./0" } diff --git a/tests/baselines/reference/importCallExpressionInSystem2.types b/tests/baselines/reference/importCallExpressionInSystem2.types index 44b17eb51fd5c..160da81b214fb 100644 --- a/tests/baselines/reference/importCallExpressionInSystem2.types +++ b/tests/baselines/reference/importCallExpressionInSystem2.types @@ -41,6 +41,6 @@ function foo(x: Promise) { foo(import("./0")); >foo(import("./0")) : void >foo : (x: Promise) => void ->import("./0") : Promise +>import("./0") : Promise >"./0" : "./0" diff --git a/tests/baselines/reference/importCallExpressionInSystem3.types b/tests/baselines/reference/importCallExpressionInSystem3.types index e517be6e722f4..08bf03fb506ad 100644 --- a/tests/baselines/reference/importCallExpressionInSystem3.types +++ b/tests/baselines/reference/importCallExpressionInSystem3.types @@ -14,9 +14,9 @@ async function foo() { class C extends (await import("./0")).B {} >C : C >(await import("./0")).B : B ->(await import("./0")) : typeof "tests/cases/conformance/dynamicImport/0" ->await import("./0") : typeof "tests/cases/conformance/dynamicImport/0" ->import("./0") : Promise +>(await import("./0")) : typeof "tests/cases/conformance/dynamicImport/0" & { default: typeof "tests/cases/conformance/dynamicImport/0"; } +>await import("./0") : typeof "tests/cases/conformance/dynamicImport/0" & { default: typeof "tests/cases/conformance/dynamicImport/0"; } +>import("./0") : Promise >"./0" : "./0" >B : typeof B diff --git a/tests/baselines/reference/importCallExpressionInSystem4.types b/tests/baselines/reference/importCallExpressionInSystem4.types index 156247851c914..c9f2b2e5211ac 100644 --- a/tests/baselines/reference/importCallExpressionInSystem4.types +++ b/tests/baselines/reference/importCallExpressionInSystem4.types @@ -24,27 +24,27 @@ class C { >C : C private myModule = import("./0"); ->myModule : Promise ->import("./0") : Promise +>myModule : Promise +>import("./0") : Promise >"./0" : "./0" method() { >method : () => void const loadAsync = import("./0"); ->loadAsync : Promise ->import("./0") : Promise +>loadAsync : Promise +>import("./0") : Promise >"./0" : "./0" this.myModule.then(Zero => { >this.myModule.then(Zero => { console.log(Zero.foo()); }, async err => { console.log(err); let one = await import("./1"); console.log(one.backup()); }) : Promise ->this.myModule.then : (onfulfilled?: (value: typeof "tests/cases/conformance/dynamicImport/0") => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise ->this.myModule : Promise +>this.myModule.then : (onfulfilled?: (value: typeof "tests/cases/conformance/dynamicImport/0" & { default: typeof "tests/cases/conformance/dynamicImport/0"; }) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>this.myModule : Promise >this : this ->myModule : Promise ->then : (onfulfilled?: (value: typeof "tests/cases/conformance/dynamicImport/0") => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise ->Zero => { console.log(Zero.foo()); } : (Zero: typeof "tests/cases/conformance/dynamicImport/0") => void ->Zero : typeof "tests/cases/conformance/dynamicImport/0" +>myModule : Promise +>then : (onfulfilled?: (value: typeof "tests/cases/conformance/dynamicImport/0" & { default: typeof "tests/cases/conformance/dynamicImport/0"; }) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>Zero => { console.log(Zero.foo()); } : (Zero: typeof "tests/cases/conformance/dynamicImport/0" & { default: typeof "tests/cases/conformance/dynamicImport/0"; }) => void +>Zero : typeof "tests/cases/conformance/dynamicImport/0" & { default: typeof "tests/cases/conformance/dynamicImport/0"; } console.log(Zero.foo()); >console.log(Zero.foo()) : any @@ -53,7 +53,7 @@ class C { >log : any >Zero.foo() : string >Zero.foo : () => string ->Zero : typeof "tests/cases/conformance/dynamicImport/0" +>Zero : typeof "tests/cases/conformance/dynamicImport/0" & { default: typeof "tests/cases/conformance/dynamicImport/0"; } >foo : () => string }, async err => { @@ -68,9 +68,9 @@ class C { >err : any let one = await import("./1"); ->one : typeof "tests/cases/conformance/dynamicImport/1" ->await import("./1") : typeof "tests/cases/conformance/dynamicImport/1" ->import("./1") : Promise +>one : typeof "tests/cases/conformance/dynamicImport/1" & { default: typeof "tests/cases/conformance/dynamicImport/1"; } +>await import("./1") : typeof "tests/cases/conformance/dynamicImport/1" & { default: typeof "tests/cases/conformance/dynamicImport/1"; } +>import("./1") : Promise >"./1" : "./1" console.log(one.backup()); @@ -80,7 +80,7 @@ class C { >log : any >one.backup() : string >one.backup : () => string ->one : typeof "tests/cases/conformance/dynamicImport/1" +>one : typeof "tests/cases/conformance/dynamicImport/1" & { default: typeof "tests/cases/conformance/dynamicImport/1"; } >backup : () => string }); @@ -91,27 +91,27 @@ export class D { >D : D private myModule = import("./0"); ->myModule : Promise ->import("./0") : Promise +>myModule : Promise +>import("./0") : Promise >"./0" : "./0" method() { >method : () => void const loadAsync = import("./0"); ->loadAsync : Promise ->import("./0") : Promise +>loadAsync : Promise +>import("./0") : Promise >"./0" : "./0" this.myModule.then(Zero => { >this.myModule.then(Zero => { console.log(Zero.foo()); }, async err => { console.log(err); let one = await import("./1"); console.log(one.backup()); }) : Promise ->this.myModule.then : (onfulfilled?: (value: typeof "tests/cases/conformance/dynamicImport/0") => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise ->this.myModule : Promise +>this.myModule.then : (onfulfilled?: (value: typeof "tests/cases/conformance/dynamicImport/0" & { default: typeof "tests/cases/conformance/dynamicImport/0"; }) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>this.myModule : Promise >this : this ->myModule : Promise ->then : (onfulfilled?: (value: typeof "tests/cases/conformance/dynamicImport/0") => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise ->Zero => { console.log(Zero.foo()); } : (Zero: typeof "tests/cases/conformance/dynamicImport/0") => void ->Zero : typeof "tests/cases/conformance/dynamicImport/0" +>myModule : Promise +>then : (onfulfilled?: (value: typeof "tests/cases/conformance/dynamicImport/0" & { default: typeof "tests/cases/conformance/dynamicImport/0"; }) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>Zero => { console.log(Zero.foo()); } : (Zero: typeof "tests/cases/conformance/dynamicImport/0" & { default: typeof "tests/cases/conformance/dynamicImport/0"; }) => void +>Zero : typeof "tests/cases/conformance/dynamicImport/0" & { default: typeof "tests/cases/conformance/dynamicImport/0"; } console.log(Zero.foo()); >console.log(Zero.foo()) : any @@ -120,7 +120,7 @@ export class D { >log : any >Zero.foo() : string >Zero.foo : () => string ->Zero : typeof "tests/cases/conformance/dynamicImport/0" +>Zero : typeof "tests/cases/conformance/dynamicImport/0" & { default: typeof "tests/cases/conformance/dynamicImport/0"; } >foo : () => string }, async err => { @@ -135,9 +135,9 @@ export class D { >err : any let one = await import("./1"); ->one : typeof "tests/cases/conformance/dynamicImport/1" ->await import("./1") : typeof "tests/cases/conformance/dynamicImport/1" ->import("./1") : Promise +>one : typeof "tests/cases/conformance/dynamicImport/1" & { default: typeof "tests/cases/conformance/dynamicImport/1"; } +>await import("./1") : typeof "tests/cases/conformance/dynamicImport/1" & { default: typeof "tests/cases/conformance/dynamicImport/1"; } +>import("./1") : Promise >"./1" : "./1" console.log(one.backup()); @@ -147,7 +147,7 @@ export class D { >log : any >one.backup() : string >one.backup : () => string ->one : typeof "tests/cases/conformance/dynamicImport/1" +>one : typeof "tests/cases/conformance/dynamicImport/1" & { default: typeof "tests/cases/conformance/dynamicImport/1"; } >backup : () => string }); diff --git a/tests/baselines/reference/syntheticDefaultExportsWithDynamicImports.js b/tests/baselines/reference/syntheticDefaultExportsWithDynamicImports.js new file mode 100644 index 0000000000000..c49924191e56e --- /dev/null +++ b/tests/baselines/reference/syntheticDefaultExportsWithDynamicImports.js @@ -0,0 +1,19 @@ +//// [tests/cases/compiler/syntheticDefaultExportsWithDynamicImports.ts] //// + +//// [index.d.ts] +declare function packageExport(x: number): string; +export = packageExport; + +//// [index.ts] +import("package").then(({default: foo}) => foo(42)); + +//// [index.js] +System.register([], function (exports_1, context_1) { + var __moduleName = context_1 && context_1.id; + return { + setters: [], + execute: function () { + context_1.import("package").then(({ default: foo }) => foo(42)); + } + }; +}); diff --git a/tests/baselines/reference/syntheticDefaultExportsWithDynamicImports.symbols b/tests/baselines/reference/syntheticDefaultExportsWithDynamicImports.symbols new file mode 100644 index 0000000000000..8501971115352 --- /dev/null +++ b/tests/baselines/reference/syntheticDefaultExportsWithDynamicImports.symbols @@ -0,0 +1,17 @@ +=== tests/cases/compiler/node_modules/package/index.d.ts === +declare function packageExport(x: number): string; +>packageExport : Symbol(packageExport, Decl(index.d.ts, 0, 0)) +>x : Symbol(x, Decl(index.d.ts, 0, 31)) + +export = packageExport; +>packageExport : Symbol(packageExport, Decl(index.d.ts, 0, 0)) + +=== tests/cases/compiler/index.ts === +import("package").then(({default: foo}) => foo(42)); +>import("package").then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>"package" : Symbol("tests/cases/compiler/node_modules/package/index", Decl(index.d.ts, 0, 0)) +>then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>default : Symbol(default) +>foo : Symbol(foo, Decl(index.ts, 0, 25)) +>foo : Symbol(foo, Decl(index.ts, 0, 25)) + diff --git a/tests/baselines/reference/syntheticDefaultExportsWithDynamicImports.types b/tests/baselines/reference/syntheticDefaultExportsWithDynamicImports.types new file mode 100644 index 0000000000000..1c38ecc466ce5 --- /dev/null +++ b/tests/baselines/reference/syntheticDefaultExportsWithDynamicImports.types @@ -0,0 +1,22 @@ +=== tests/cases/compiler/node_modules/package/index.d.ts === +declare function packageExport(x: number): string; +>packageExport : (x: number) => string +>x : number + +export = packageExport; +>packageExport : (x: number) => string + +=== tests/cases/compiler/index.ts === +import("package").then(({default: foo}) => foo(42)); +>import("package").then(({default: foo}) => foo(42)) : Promise +>import("package").then : string) & { default: (x: number) => string; }, TResult2 = never>(onfulfilled?: (value: ((x: number) => string) & { default: (x: number) => string; }) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>import("package") : Promise<((x: number) => string) & { default: (x: number) => string; }> +>"package" : "package" +>then : string) & { default: (x: number) => string; }, TResult2 = never>(onfulfilled?: (value: ((x: number) => string) & { default: (x: number) => string; }) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>({default: foo}) => foo(42) : ({ default: foo }: ((x: number) => string) & { default: (x: number) => string; }) => string +>default : any +>foo : (x: number) => string +>foo(42) : string +>foo : (x: number) => string +>42 : 42 + diff --git a/tests/cases/compiler/syntheticDefaultExportsWithDynamicImports.ts b/tests/cases/compiler/syntheticDefaultExportsWithDynamicImports.ts new file mode 100644 index 0000000000000..07f08d031850d --- /dev/null +++ b/tests/cases/compiler/syntheticDefaultExportsWithDynamicImports.ts @@ -0,0 +1,9 @@ +// @module: system +// @target: es6 +// @moduleResolution: node +// @filename: node_modules/package/index.d.ts +declare function packageExport(x: number): string; +export = packageExport; + +// @filename: index.ts +import("package").then(({default: foo}) => foo(42)); \ No newline at end of file From 81e1e26a6c038d11a32a95d4f301e37c190a22ef Mon Sep 17 00:00:00 2001 From: Wesley Wigham Date: Tue, 8 Aug 2017 17:20:25 -0700 Subject: [PATCH 074/237] TSLint now realizes when you attempt to use a rule which is not present (#17688) --- Jakefile.js | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/Jakefile.js b/Jakefile.js index 31243f77c4284..e6ff364e58bd4 100644 --- a/Jakefile.js +++ b/Jakefile.js @@ -1122,14 +1122,15 @@ task("update-sublime", ["local", serverFile], function () { var tslintRuleDir = "scripts/tslint"; var tslintRules = [ - "nextLineRule", "booleanTriviaRule", - "typeOperatorSpacingRule", - "noInOperatorRule", + "debugAssertRule", + "nextLineRule", + "noBomRule", "noIncrementDecrementRule", - "objectLiteralSurroundingSpaceRule", + "noInOperatorRule", "noTypeAssertionWhitespaceRule", - "noBomRule" + "objectLiteralSurroundingSpaceRule", + "typeOperatorSpacingRule", ]; var tslintRulesFiles = tslintRules.map(function (p) { return path.join(tslintRuleDir, p + ".ts"); From 37b9b7089c3c31adf37b9abdbc0467db2020a7c2 Mon Sep 17 00:00:00 2001 From: Ron Buckton Date: Tue, 8 Aug 2017 17:23:50 -0700 Subject: [PATCH 075/237] PR Feedback --- .../unittests/tsserverProjectSystem.ts | 15 ++++++---- src/server/editorServices.ts | 30 ++++++++++++------- 2 files changed, 29 insertions(+), 16 deletions(-) diff --git a/src/harness/unittests/tsserverProjectSystem.ts b/src/harness/unittests/tsserverProjectSystem.ts index 2d6b370e23f29..362bd847d6af2 100644 --- a/src/harness/unittests/tsserverProjectSystem.ts +++ b/src/harness/unittests/tsserverProjectSystem.ts @@ -188,23 +188,26 @@ namespace ts.projectSystem { export function createSession(host: server.ServerHost, opts: Partial = {}) { if (opts.typingsInstaller === undefined) { - opts.typingsInstaller = new TestTypingsInstaller("/a/data/", /*throttleLimit*/5, host); + opts.typingsInstaller = new TestTypingsInstaller("/a/data/", /*throttleLimit*/ 5, host); } + if (opts.eventHandler !== undefined) { opts.canUseEvents = true; } - return new TestSession({ + + const sessionOptions: server.SessionOptions = { host, cancellationToken: server.nullCancellationToken, useSingleInferredProject: false, useInferredProjectPerProjectRoot: false, - typingsInstaller: opts.typingsInstaller, + typingsInstaller: undefined, byteLength: Utils.byteLength, hrtime: process.hrtime, logger: nullLogger, - canUseEvents: false, - ...opts - }); + canUseEvents: false + }; + + return new TestSession({ ...sessionOptions, ...opts }); } export interface CreateProjectServiceParameters { diff --git a/src/server/editorServices.ts b/src/server/editorServices.ts index e7e041711a9b0..6084b38bf839e 100644 --- a/src/server/editorServices.ts +++ b/src/server/editorServices.ts @@ -467,27 +467,28 @@ namespace ts.server { } setCompilerOptionsForInferredProjects(projectCompilerOptions: protocol.ExternalProjectCompilerOptions, projectRootPath?: string): void { - // ignore this settings if we are not creating inferred projects per project root. - if (projectRootPath && !this.useInferredProjectPerProjectRoot) return; + Debug.assert(projectRootPath === undefined || this.useInferredProjectPerProjectRoot, "Setting compiler options per project root path is only supported when useInferredProjectPerProjectRoot is enabled"); - const compilerOptionsForInferredProjects = convertCompilerOptions(projectCompilerOptions); + const compilerOptions = convertCompilerOptions(projectCompilerOptions); // always set 'allowNonTsExtensions' for inferred projects since user cannot configure it from the outside // previously we did not expose a way for user to change these settings and this option was enabled by default - compilerOptionsForInferredProjects.allowNonTsExtensions = true; + compilerOptions.allowNonTsExtensions = true; if (projectRootPath) { - this.compilerOptionsForInferredProjectsPerProjectRoot.set(projectRootPath, compilerOptionsForInferredProjects); + this.compilerOptionsForInferredProjectsPerProjectRoot.set(projectRootPath, compilerOptions); } else { - this.compilerOptionsForInferredProjects = compilerOptionsForInferredProjects; + this.compilerOptionsForInferredProjects = compilerOptions; } const updatedProjects: Project[] = []; for (const project of this.inferredProjects) { - if (project.projectRootPath === projectRootPath || (project.projectRootPath && !this.compilerOptionsForInferredProjectsPerProjectRoot.has(project.projectRootPath))) { - project.setCompilerOptions(compilerOptionsForInferredProjects); - project.compileOnSaveEnabled = compilerOptionsForInferredProjects.compileOnSave; + if (projectRootPath ? + project.projectRootPath === projectRootPath : + !project.projectRootPath || !this.compilerOptionsForInferredProjectsPerProjectRoot.has(project.projectRootPath)) { + project.setCompilerOptions(compilerOptions); + project.compileOnSaveEnabled = compilerOptions.compileOnSave; updatedProjects.push(project); } } @@ -1319,7 +1320,8 @@ namespace ts.server { return this.createInferredProject(/*isSingleInferredProject*/ false, projectRootPath); } - // we don't have an explicit root path, so we should try to find an inferred project that best matches the file. + // we don't have an explicit root path, so we should try to find an inferred project + // that more closely contains the file. let bestMatch: InferredProject; for (const project of this.inferredProjects) { // ignore single inferred projects (handled elsewhere) @@ -1340,6 +1342,14 @@ namespace ts.server { return undefined; } + // If `useInferredProjectPerProjectRoot` is not enabled, then there will only be one + // inferred project for all files. If `useInferredProjectPerProjectRoot` is enabled + // then we want to put all files that are not opened with a `projectRootPath` into + // the same inferred project. + // + // To avoid the cost of searching through the array and to optimize for the case where + // `useInferredProjectPerProjectRoot` is not enabled, we will always put the inferred + // project for non-rooted files at the front of the array. if (this.inferredProjects.length > 0 && this.inferredProjects[0].projectRootPath === undefined) { return this.inferredProjects[0]; } From c399230767a470e703e361333bac0cb6be513b8c Mon Sep 17 00:00:00 2001 From: Wesley Wigham Date: Tue, 8 Aug 2017 19:53:53 -0700 Subject: [PATCH 076/237] Retain comments inside return statements (#17557) * Retain comments inside return statements by including the return keyword in the parse tree * Revert "Retain comments inside return statements by including the return keyword in the parse tree" This reverts commit 5d2142edb1ffb9f6cb150b815aff6e627ae80449. * Readd test * Function for handling printing comments on a token --- src/compiler/comments.ts | 6 +++--- src/compiler/emitter.ts | 14 +++++++++++++- .../baselines/reference/jsdocCastCommentEmit.js | 17 +++++++++++++++++ .../reference/jsdocCastCommentEmit.symbols | 10 ++++++++++ .../reference/jsdocCastCommentEmit.types | 11 +++++++++++ tests/cases/compiler/jsdocCastCommentEmit.ts | 7 +++++++ 6 files changed, 61 insertions(+), 4 deletions(-) create mode 100644 tests/baselines/reference/jsdocCastCommentEmit.js create mode 100644 tests/baselines/reference/jsdocCastCommentEmit.symbols create mode 100644 tests/baselines/reference/jsdocCastCommentEmit.types create mode 100644 tests/cases/compiler/jsdocCastCommentEmit.ts diff --git a/src/compiler/comments.ts b/src/compiler/comments.ts index 06285309f6474..50d706d3c42b4 100644 --- a/src/compiler/comments.ts +++ b/src/compiler/comments.ts @@ -8,7 +8,7 @@ namespace ts { setWriter(writer: EmitTextWriter): void; emitNodeWithComments(hint: EmitHint, node: Node, emitCallback: (hint: EmitHint, node: Node) => void): void; emitBodyWithDetachedComments(node: Node, detachedRange: TextRange, emitCallback: (node: Node) => void): void; - emitTrailingCommentsOfPosition(pos: number): void; + emitTrailingCommentsOfPosition(pos: number, prefixSpace?: boolean): void; emitLeadingCommentsOfPosition(pos: number): void; } @@ -306,7 +306,7 @@ namespace ts { } } - function emitTrailingCommentsOfPosition(pos: number) { + function emitTrailingCommentsOfPosition(pos: number, prefixSpace?: boolean) { if (disabled) { return; } @@ -315,7 +315,7 @@ namespace ts { performance.mark("beforeEmitTrailingCommentsOfPosition"); } - forEachTrailingCommentToEmit(pos, emitTrailingCommentOfPosition); + forEachTrailingCommentToEmit(pos, prefixSpace ? emitTrailingComment : emitTrailingCommentOfPosition); if (extendedDiagnostics) { performance.measure("commentTime", "beforeEmitTrailingCommentsOfPosition"); diff --git a/src/compiler/emitter.ts b/src/compiler/emitter.ts index 9eb1af2f187ce..923e6da421540 100644 --- a/src/compiler/emitter.ts +++ b/src/compiler/emitter.ts @@ -1572,8 +1572,20 @@ namespace ts { write(";"); } + function emitTokenWithComment(token: SyntaxKind, pos: number, contextNode?: Node) { + const node = contextNode && getParseTreeNode(contextNode); + if (node && node.kind === contextNode.kind) { + pos = skipTrivia(currentSourceFile.text, pos); + } + pos = writeToken(token, pos, /*contextNode*/ contextNode); + if (node && node.kind === contextNode.kind) { + emitTrailingCommentsOfPosition(pos, /*prefixSpace*/ true); + } + return pos; + } + function emitReturnStatement(node: ReturnStatement) { - writeToken(SyntaxKind.ReturnKeyword, node.pos, /*contextNode*/ node); + emitTokenWithComment(SyntaxKind.ReturnKeyword, node.pos, /*contextNode*/ node); emitExpressionWithPrefix(" ", node.expression); write(";"); } diff --git a/tests/baselines/reference/jsdocCastCommentEmit.js b/tests/baselines/reference/jsdocCastCommentEmit.js new file mode 100644 index 0000000000000..d071f8f6b2b46 --- /dev/null +++ b/tests/baselines/reference/jsdocCastCommentEmit.js @@ -0,0 +1,17 @@ +//// [jsdocCastCommentEmit.ts] +// allowJs: true +// checkJs: true +// outDir: out/ +// filename: input.js +function f() { + return /* @type {number} */ 42; +} + +//// [jsdocCastCommentEmit.js] +// allowJs: true +// checkJs: true +// outDir: out/ +// filename: input.js +function f() { + return /* @type {number} */ 42; +} diff --git a/tests/baselines/reference/jsdocCastCommentEmit.symbols b/tests/baselines/reference/jsdocCastCommentEmit.symbols new file mode 100644 index 0000000000000..5490315bc19ea --- /dev/null +++ b/tests/baselines/reference/jsdocCastCommentEmit.symbols @@ -0,0 +1,10 @@ +=== tests/cases/compiler/jsdocCastCommentEmit.ts === +// allowJs: true +// checkJs: true +// outDir: out/ +// filename: input.js +function f() { +>f : Symbol(f, Decl(jsdocCastCommentEmit.ts, 0, 0)) + + return /* @type {number} */ 42; +} diff --git a/tests/baselines/reference/jsdocCastCommentEmit.types b/tests/baselines/reference/jsdocCastCommentEmit.types new file mode 100644 index 0000000000000..3d4c3e47e46f5 --- /dev/null +++ b/tests/baselines/reference/jsdocCastCommentEmit.types @@ -0,0 +1,11 @@ +=== tests/cases/compiler/jsdocCastCommentEmit.ts === +// allowJs: true +// checkJs: true +// outDir: out/ +// filename: input.js +function f() { +>f : () => number + + return /* @type {number} */ 42; +>42 : 42 +} diff --git a/tests/cases/compiler/jsdocCastCommentEmit.ts b/tests/cases/compiler/jsdocCastCommentEmit.ts new file mode 100644 index 0000000000000..5e7230bd04947 --- /dev/null +++ b/tests/cases/compiler/jsdocCastCommentEmit.ts @@ -0,0 +1,7 @@ +// allowJs: true +// checkJs: true +// outDir: out/ +// filename: input.js +function f() { + return /* @type {number} */ 42; +} \ No newline at end of file From bd68122821500e15e49f63e1ad8f7e90fd4ae3c2 Mon Sep 17 00:00:00 2001 From: Andy Date: Wed, 9 Aug 2017 10:59:10 -0700 Subject: [PATCH 077/237] scriptVersionCache: Export less (#17202) * scriptVersionCache: Export less * Remove LineIndexForTest, use LineIndex * Add /* @internal */ to class LineIndex * Make CharRangeSelection a const enum --- src/server/scriptInfo.ts | 15 ++++----- src/server/scriptVersionCache.ts | 53 ++++++++++++++++++++------------ 2 files changed, 40 insertions(+), 28 deletions(-) diff --git a/src/server/scriptInfo.ts b/src/server/scriptInfo.ts index ce1de6f5040fb..4d73fc47403ca 100644 --- a/src/server/scriptInfo.ts +++ b/src/server/scriptInfo.ts @@ -16,7 +16,7 @@ namespace ts.server { public getVersion() { return this.svc - ? `SVC-${this.svcVersion}-${this.svc.getSnapshot().version}` + ? `SVC-${this.svcVersion}-${this.svc.getSnapshotVersion()}` : `Text-${this.textVersion}`; } @@ -62,22 +62,19 @@ namespace ts.server { } public getLineInfo(line: number): AbsolutePositionAndLineText { - return this.switchToScriptVersionCache().getSnapshot().index.lineNumberToInfo(line); + return this.switchToScriptVersionCache().getLineInfo(line); } /** * @param line 0 based index */ - lineToTextSpan(line: number) { + lineToTextSpan(line: number): TextSpan { if (!this.svc) { const lineMap = this.getLineMap(); const start = lineMap[line]; // -1 since line is 1-based const end = line + 1 < lineMap.length ? lineMap[line + 1] : this.text.length; return createTextSpanFromBounds(start, end); } - const index = this.svc.getSnapshot().index; - const { lineText, absolutePosition } = index.lineNumberToInfo(line + 1); - const len = lineText !== undefined ? lineText.length : index.absolutePositionOfStartOfLine(line + 2) - absolutePosition; - return createTextSpan(absolutePosition, len); + return this.svc.lineToTextSpan(line); } /** @@ -90,7 +87,7 @@ namespace ts.server { } // TODO: assert this offset is actually on the line - return this.svc.getSnapshot().index.absolutePositionOfStartOfLine(line) + (offset - 1); + return this.svc.lineOffsetToPosition(line, offset); } positionToLineOffset(position: number): protocol.Location { @@ -98,7 +95,7 @@ namespace ts.server { const { line, character } = computeLineAndCharacterOfPosition(this.getLineMap(), position); return { line: line + 1, offset: character + 1 }; } - return this.svc.getSnapshot().index.positionToLineOffset(position); + return this.svc.positionToLineOffset(position); } private getFileText(tempFileName?: string) { diff --git a/src/server/scriptVersionCache.ts b/src/server/scriptVersionCache.ts index b6a189904dbbb..e4b4183526329 100644 --- a/src/server/scriptVersionCache.ts +++ b/src/server/scriptVersionCache.ts @@ -5,7 +5,7 @@ namespace ts.server { const lineCollectionCapacity = 4; - export interface LineCollection { + interface LineCollection { charCount(): number; lineCount(): number; isLeaf(): this is LineLeaf; @@ -17,7 +17,7 @@ namespace ts.server { lineText: string | undefined; } - export enum CharRangeSection { + const enum CharRangeSection { PreStart, Start, Entire, @@ -26,7 +26,7 @@ namespace ts.server { PostEnd } - export interface ILineIndexWalker { + interface ILineIndexWalker { goSubtree: boolean; done: boolean; leaf(relativeStart: number, relativeLength: number, lineCollection: LineLeaf): void; @@ -243,7 +243,7 @@ namespace ts.server { } // text change information - export class TextChange { + class TextChange { constructor(public pos: number, public deleteLen: number, public insertedText?: string) { } @@ -285,17 +285,6 @@ namespace ts.server { } } - latest() { - return this.versions[this.currentVersionToIndex()]; - } - - latestVersion() { - if (this.changes.length > 0) { - this.getSnapshot(); - } - return this.currentVersion; - } - // reload whole script, leaving no change history behind reload reload(script: string) { this.currentVersion++; @@ -314,7 +303,9 @@ namespace ts.server { this.minVersion = this.currentVersion; } - getSnapshot() { + getSnapshot(): IScriptSnapshot { return this._getSnapshot(); } + + private _getSnapshot(): LineIndexSnapshot { let snap = this.versions[this.currentVersionToIndex()]; if (this.changes.length > 0) { let snapIndex = snap.index; @@ -334,6 +325,29 @@ namespace ts.server { return snap; } + getSnapshotVersion(): number { + return this._getSnapshot().version; + } + + getLineInfo(line: number): AbsolutePositionAndLineText { + return this._getSnapshot().index.lineNumberToInfo(line); + } + + lineOffsetToPosition(line: number, column: number): number { + return this._getSnapshot().index.absolutePositionOfStartOfLine(line) + (column - 1); + } + + positionToLineOffset(position: number): protocol.Location { + return this._getSnapshot().index.positionToLineOffset(position); + } + + lineToTextSpan(line: number): TextSpan { + const index = this._getSnapshot().index; + const { lineText, absolutePosition } = index.lineNumberToInfo(line + 1); + const len = lineText !== undefined ? lineText.length : index.absolutePositionOfStartOfLine(line + 2) - absolutePosition; + return createTextSpan(absolutePosition, len); + } + getTextChangesBetweenVersions(oldVersion: number, newVersion: number) { if (oldVersion < newVersion) { if (oldVersion >= this.minVersion) { @@ -365,7 +379,7 @@ namespace ts.server { } } - export class LineIndexSnapshot implements IScriptSnapshot { + class LineIndexSnapshot implements IScriptSnapshot { constructor(readonly version: number, readonly cache: ScriptVersionCache, readonly index: LineIndex, readonly changesSincePreviousVersion: ReadonlyArray = emptyArray) { } @@ -389,6 +403,7 @@ namespace ts.server { } } + /* @internal */ export class LineIndex { root: LineNode; // set this to true to check each edit for accuracy @@ -561,7 +576,7 @@ namespace ts.server { } } - export class LineNode implements LineCollection { + class LineNode implements LineCollection { totalChars = 0; totalLines = 0; @@ -844,7 +859,7 @@ namespace ts.server { } } - export class LineLeaf implements LineCollection { + class LineLeaf implements LineCollection { constructor(public text: string) { } From b8c37bb50c0e6bd9b10c93351c4837a3bf34339b Mon Sep 17 00:00:00 2001 From: Andy Date: Wed, 9 Aug 2017 13:43:25 -0700 Subject: [PATCH 078/237] Inline childFromLineNumber and childFromCharOffset (#17018) * Inline childFromLineNumber and childFromCharOffset * Handle empty document -- root node with 0 children * Fix test --- src/harness/unittests/versionCache.ts | 6 ++ src/server/scriptVersionCache.ts | 80 ++++++++------------------- 2 files changed, 28 insertions(+), 58 deletions(-) diff --git a/src/harness/unittests/versionCache.ts b/src/harness/unittests/versionCache.ts index 10790d41302ca..bbd23f25dac32 100644 --- a/src/harness/unittests/versionCache.ts +++ b/src/harness/unittests/versionCache.ts @@ -49,6 +49,12 @@ var q:Point=p;`; validateEditAtLineCharIndex = undefined; }); + it("handles empty lines array", () => { + const lineIndex = new server.LineIndex(); + lineIndex.load([]); + assert.deepEqual(lineIndex.positionToLineOffset(0), { line: 1, offset: 1 }); + }); + it(`change 9 1 0 1 {"y"}`, () => { validateEditAtLineCharIndex(9, 1, 0, "y"); }); diff --git a/src/server/scriptVersionCache.ts b/src/server/scriptVersionCache.ts index e4b4183526329..451536a0caaaf 100644 --- a/src/server/scriptVersionCache.ts +++ b/src/server/scriptVersionCache.ts @@ -675,45 +675,29 @@ namespace ts.server { // Input position is relative to the start of this node. // Output line number is absolute. charOffsetToLineInfo(lineNumberAccumulator: number, relativePosition: number): { oneBasedLine: number, zeroBasedColumn: number, lineText: string | undefined } { - const childInfo = this.childFromCharOffset(lineNumberAccumulator, relativePosition); - if (!childInfo.child) { - return { - oneBasedLine: lineNumberAccumulator, - zeroBasedColumn: relativePosition, - lineText: undefined, - }; - } - else if (childInfo.childIndex < this.children.length) { - if (childInfo.child.isLeaf()) { - return { - oneBasedLine: childInfo.lineNumberAccumulator, - zeroBasedColumn: childInfo.relativePosition, - lineText: childInfo.child.text, - }; + if (this.children.length === 0) { + // Root node might have no children if this is an empty document. + return { oneBasedLine: lineNumberAccumulator, zeroBasedColumn: relativePosition, lineText: undefined }; + } + + for (const child of this.children) { + if (child.charCount() > relativePosition) { + if (child.isLeaf()) { + return { oneBasedLine: lineNumberAccumulator, zeroBasedColumn: relativePosition, lineText: child.text }; + } + else { + return (child).charOffsetToLineInfo(lineNumberAccumulator, relativePosition); + } } else { - const lineNode = (childInfo.child); - return lineNode.charOffsetToLineInfo(childInfo.lineNumberAccumulator, childInfo.relativePosition); + relativePosition -= child.charCount(); + lineNumberAccumulator += child.lineCount(); } } - else { - const lineInfo = this.lineNumberToInfo(this.lineCount(), 0); - return { oneBasedLine: this.lineCount(), zeroBasedColumn: lineInfo.leaf.charCount(), lineText: undefined }; - } - } - lineNumberToInfo(relativeOneBasedLine: number, positionAccumulator: number): { position: number, leaf: LineLeaf | undefined } { - const childInfo = this.childFromLineNumber(relativeOneBasedLine, positionAccumulator); - if (!childInfo.child) { - return { position: positionAccumulator, leaf: undefined }; - } - else if (childInfo.child.isLeaf()) { - return { position: childInfo.positionAccumulator, leaf: childInfo.child }; - } - else { - const lineNode = (childInfo.child); - return lineNode.lineNumberToInfo(childInfo.relativeOneBasedLine, childInfo.positionAccumulator); - } + // Skipped all children + const { leaf } = this.lineNumberToInfo(this.lineCount(), 0); + return { oneBasedLine: this.lineCount(), zeroBasedColumn: leaf.charCount(), lineText: undefined }; } /** @@ -721,39 +705,19 @@ namespace ts.server { * Output line number is relative to the child. * positionAccumulator will be an absolute position once relativeLineNumber reaches 0. */ - private childFromLineNumber(relativeOneBasedLine: number, positionAccumulator: number): { child: LineCollection, relativeOneBasedLine: number, positionAccumulator: number } { - let child: LineCollection; - let i: number; - for (i = 0; i < this.children.length; i++) { - child = this.children[i]; + lineNumberToInfo(relativeOneBasedLine: number, positionAccumulator: number): { position: number, leaf: LineLeaf | undefined } { + for (const child of this.children) { const childLineCount = child.lineCount(); if (childLineCount >= relativeOneBasedLine) { - break; + return child.isLeaf() ? { position: positionAccumulator, leaf: child } : (child).lineNumberToInfo(relativeOneBasedLine, positionAccumulator); } else { relativeOneBasedLine -= childLineCount; positionAccumulator += child.charCount(); } } - return { child, relativeOneBasedLine, positionAccumulator }; - } - private childFromCharOffset(lineNumberAccumulator: number, relativePosition: number - ): { child: LineCollection, childIndex: number, relativePosition: number, lineNumberAccumulator: number } { - let child: LineCollection; - let i: number; - let len: number; - for (i = 0, len = this.children.length; i < len; i++) { - child = this.children[i]; - if (child.charCount() > relativePosition) { - break; - } - else { - relativePosition -= child.charCount(); - lineNumberAccumulator += child.lineCount(); - } - } - return { child, childIndex: i, relativePosition, lineNumberAccumulator }; + return { position: positionAccumulator, leaf: undefined }; } private splitAfter(childIndex: number) { From f124e199718b9cda06654af2ce487f1d6a332b34 Mon Sep 17 00:00:00 2001 From: Andy Date: Wed, 9 Aug 2017 13:46:47 -0700 Subject: [PATCH 079/237] Session: don't return undefined if a response is required (#17165) * Session: don't return undefined if a response is required * Use ReadonlyArray and emptyArray * Remove inferred return type --- src/harness/unittests/projectErrors.ts | 4 +- src/server/editorServices.ts | 18 ++++---- src/server/project.ts | 8 ++-- src/server/protocol.ts | 2 +- src/server/session.ts | 62 +++++++++++++------------- 5 files changed, 48 insertions(+), 46 deletions(-) diff --git a/src/harness/unittests/projectErrors.ts b/src/harness/unittests/projectErrors.ts index f250d4d9b36f4..4a76ed2c98c76 100644 --- a/src/harness/unittests/projectErrors.ts +++ b/src/harness/unittests/projectErrors.ts @@ -4,12 +4,12 @@ namespace ts.projectSystem { describe("Project errors", () => { - function checkProjectErrors(projectFiles: server.ProjectFilesWithTSDiagnostics, expectedErrors: string[]) { + function checkProjectErrors(projectFiles: server.ProjectFilesWithTSDiagnostics, expectedErrors: ReadonlyArray): void { assert.isTrue(projectFiles !== undefined, "missing project files"); checkProjectErrorsWorker(projectFiles.projectErrors, expectedErrors); } - function checkProjectErrorsWorker(errors: Diagnostic[], expectedErrors: string[]) { + function checkProjectErrorsWorker(errors: ReadonlyArray, expectedErrors: ReadonlyArray): void { assert.equal(errors ? errors.length : 0, expectedErrors.length, `expected ${expectedErrors.length} error in the list`); if (expectedErrors.length) { for (let i = 0; i < errors.length; i++) { diff --git a/src/server/editorServices.ts b/src/server/editorServices.ts index 554ac337920bd..a17ce1d578768 100644 --- a/src/server/editorServices.ts +++ b/src/server/editorServices.ts @@ -22,7 +22,7 @@ namespace ts.server { export interface ConfigFileDiagEvent { eventName: typeof ConfigFileDiagEvent; - data: { triggerFile: string, configFileName: string, diagnostics: Diagnostic[] }; + data: { triggerFile: string, configFileName: string, diagnostics: ReadonlyArray }; } export interface ProjectLanguageServiceStateEvent { @@ -200,7 +200,7 @@ namespace ts.server { /** * This helper function processes a list of projects and return the concatenated, sortd and deduplicated output of processing each project. */ - export function combineProjectOutput(projects: Project[], action: (project: Project) => T[], comparer?: (a: T, b: T) => number, areEqual?: (a: T, b: T) => boolean) { + export function combineProjectOutput(projects: ReadonlyArray, action: (project: Project) => ReadonlyArray, comparer?: (a: T, b: T) => number, areEqual?: (a: T, b: T) => boolean) { const result = flatMap(projects, action).sort(comparer); return projects.length > 1 ? deduplicate(result, areEqual) : result; } @@ -220,14 +220,14 @@ namespace ts.server { interface OpenConfigFileResult { success: boolean; - errors?: Diagnostic[]; + errors?: ReadonlyArray; project?: ConfiguredProject; } export interface OpenConfiguredProjectResult { configFileName?: NormalizedPath; - configFileErrors?: Diagnostic[]; + configFileErrors?: ReadonlyArray; } interface FilePropertyReader { @@ -1100,18 +1100,18 @@ namespace ts.server { } } - private reportConfigFileDiagnostics(configFileName: string, diagnostics: Diagnostic[], triggerFile: string) { + private reportConfigFileDiagnostics(configFileName: string, diagnostics: ReadonlyArray, triggerFile: string) { if (!this.eventHandler) { return; } this.eventHandler({ eventName: ConfigFileDiagEvent, - data: { configFileName, diagnostics: diagnostics || [], triggerFile } + data: { configFileName, diagnostics: diagnostics || emptyArray, triggerFile } }); } - private createAndAddConfiguredProject(configFileName: NormalizedPath, projectOptions: ProjectOptions, configFileErrors: Diagnostic[], clientFileName?: string) { + private createAndAddConfiguredProject(configFileName: NormalizedPath, projectOptions: ProjectOptions, configFileErrors: ReadonlyArray, clientFileName?: string) { const sizeLimitExceeded = this.exceededTotalSizeLimitForNonTsFiles(configFileName, projectOptions.compilerOptions, projectOptions.files, fileNamePropertyReader); const project = new ConfiguredProject( configFileName, @@ -1143,7 +1143,7 @@ namespace ts.server { } } - private addFilesToProjectAndUpdateGraph(project: ConfiguredProject | ExternalProject, files: T[], propertyReader: FilePropertyReader, clientFileName: string, typeAcquisition: TypeAcquisition, configFileErrors: Diagnostic[]): void { + private addFilesToProjectAndUpdateGraph(project: ConfiguredProject | ExternalProject, files: T[], propertyReader: FilePropertyReader, clientFileName: string, typeAcquisition: TypeAcquisition, configFileErrors: ReadonlyArray): void { let errors: Diagnostic[]; for (const f of files) { const rootFilename = propertyReader.getFileName(f); @@ -1456,7 +1456,7 @@ namespace ts.server { openClientFileWithNormalizedPath(fileName: NormalizedPath, fileContent?: string, scriptKind?: ScriptKind, hasMixedContent?: boolean, projectRootPath?: NormalizedPath): OpenConfiguredProjectResult { let configFileName: NormalizedPath; - let configFileErrors: Diagnostic[]; + let configFileErrors: ReadonlyArray; let project: ConfiguredProject | ExternalProject = this.findContainingExternalProject(fileName); if (!project) { diff --git a/src/server/project.ts b/src/server/project.ts index 97c8eb706f31f..50020682ab04e 100644 --- a/src/server/project.ts +++ b/src/server/project.ts @@ -54,7 +54,7 @@ namespace ts.server { /* @internal */ export interface ProjectFilesWithTSDiagnostics extends protocol.ProjectFiles { - projectErrors: Diagnostic[]; + projectErrors: ReadonlyArray; } export class UnresolvedImportsMap { @@ -147,7 +147,7 @@ namespace ts.server { private typingFiles: SortedReadonlyArray; - protected projectErrors: Diagnostic[]; + protected projectErrors: ReadonlyArray; public typesVersion = 0; @@ -1045,7 +1045,7 @@ namespace ts.server { return getDirectoryPath(this.getConfigFilePath()); } - setProjectErrors(projectErrors: Diagnostic[]) { + setProjectErrors(projectErrors: ReadonlyArray) { this.projectErrors = projectErrors; } @@ -1189,7 +1189,7 @@ namespace ts.server { return this.typeAcquisition; } - setProjectErrors(projectErrors: Diagnostic[]) { + setProjectErrors(projectErrors: ReadonlyArray) { this.projectErrors = projectErrors; } diff --git a/src/server/protocol.ts b/src/server/protocol.ts index b6756a7d4ff11..a75c04764c036 100644 --- a/src/server/protocol.ts +++ b/src/server/protocol.ts @@ -914,7 +914,7 @@ namespace ts.server.protocol { /** * An array of span groups (one per file) that refer to the item to be renamed. */ - locs: SpanGroup[]; + locs: ReadonlyArray; } /** diff --git a/src/server/session.ts b/src/server/session.ts index 3c9c1b714de19..0b746e4090a57 100644 --- a/src/server/session.ts +++ b/src/server/session.ts @@ -379,7 +379,7 @@ namespace ts.server { this.host.write(formatMessage(msg, this.logger, this.byteLength, this.host.newLine)); } - public configFileDiagnosticEvent(triggerFile: string, configFile: string, diagnostics: Diagnostic[]) { + public configFileDiagnosticEvent(triggerFile: string, configFile: string, diagnostics: ReadonlyArray) { const bakedDiags = map(diagnostics, diagnostic => formatConfigFileDiag(diagnostic, /*includeFileName*/ true)); const ev: protocol.ConfigFileDiagnosticEvent = { seq: 0, @@ -539,7 +539,7 @@ namespace ts.server { ); } - private convertToDiagnosticsWithLinePositionFromDiagnosticFile(diagnostics: Diagnostic[]) { + private convertToDiagnosticsWithLinePositionFromDiagnosticFile(diagnostics: ReadonlyArray): protocol.DiagnosticWithLinePosition[] { return diagnostics.map(d => { message: flattenDiagnosticMessageText(d.messageText, this.host.newLine), start: d.start, @@ -565,7 +565,7 @@ namespace ts.server { ); } - private convertToDiagnosticsWithLinePosition(diagnostics: Diagnostic[], scriptInfo: ScriptInfo) { + private convertToDiagnosticsWithLinePosition(diagnostics: ReadonlyArray, scriptInfo: ScriptInfo): protocol.DiagnosticWithLinePosition[] { return diagnostics.map(d => { message: flattenDiagnosticMessageText(d.messageText, this.host.newLine), start: d.start, @@ -578,10 +578,12 @@ namespace ts.server { }); } - private getDiagnosticsWorker(args: protocol.FileRequestArgs, isSemantic: boolean, selector: (project: Project, file: string) => Diagnostic[], includeLinePosition: boolean) { + private getDiagnosticsWorker( + args: protocol.FileRequestArgs, isSemantic: boolean, selector: (project: Project, file: string) => ReadonlyArray, includeLinePosition: boolean + ): ReadonlyArray | ReadonlyArray { const { project, file } = this.getFileAndProject(args); if (isSemantic && isDeclarationFileInJSOnlyNonConfiguredProject(project, file)) { - return []; + return emptyArray; } const scriptInfo = project.getScriptInfoForNormalizedPath(file); const diagnostics = selector(project, file); @@ -590,14 +592,14 @@ namespace ts.server { : diagnostics.map(d => formatDiag(file, project, d)); } - private getDefinition(args: protocol.FileLocationRequestArgs, simplifiedResult: boolean): protocol.FileSpan[] | DefinitionInfo[] { + private getDefinition(args: protocol.FileLocationRequestArgs, simplifiedResult: boolean): ReadonlyArray | ReadonlyArray { const { file, project } = this.getFileAndProject(args); const scriptInfo = project.getScriptInfoForNormalizedPath(file); const position = this.getPosition(args, scriptInfo); const definitions = project.getLanguageService().getDefinitionAtPosition(file, position); if (!definitions) { - return undefined; + return emptyArray; } if (simplifiedResult) { @@ -615,7 +617,7 @@ namespace ts.server { } } - private getTypeDefinition(args: protocol.FileLocationRequestArgs): protocol.FileSpan[] { + private getTypeDefinition(args: protocol.FileLocationRequestArgs): ReadonlyArray { const { file, project } = this.getFileAndProject(args); const scriptInfo = project.getScriptInfoForNormalizedPath(file); const position = this.getPosition(args, scriptInfo); @@ -635,12 +637,12 @@ namespace ts.server { }); } - private getImplementation(args: protocol.FileLocationRequestArgs, simplifiedResult: boolean): protocol.FileSpan[] | ImplementationLocation[] { + private getImplementation(args: protocol.FileLocationRequestArgs, simplifiedResult: boolean): ReadonlyArray | ReadonlyArray { const { file, project } = this.getFileAndProject(args); const position = this.getPosition(args, project.getScriptInfoForNormalizedPath(file)); const implementations = project.getLanguageService().getImplementationAtPosition(file, position); if (!implementations) { - return []; + return emptyArray; } if (simplifiedResult) { return implementations.map(({ fileName, textSpan }) => { @@ -657,7 +659,7 @@ namespace ts.server { } } - private getOccurrences(args: protocol.FileLocationRequestArgs): protocol.OccurrencesResponseItem[] { + private getOccurrences(args: protocol.FileLocationRequestArgs): ReadonlyArray { const { file, project } = this.getFileAndProject(args); const scriptInfo = project.getScriptInfoForNormalizedPath(file); const position = this.getPosition(args, scriptInfo); @@ -665,7 +667,7 @@ namespace ts.server { const occurrences = project.getLanguageService().getOccurrencesAtPosition(file, position); if (!occurrences) { - return undefined; + return emptyArray; } return occurrences.map(occurrence => { @@ -687,17 +689,17 @@ namespace ts.server { }); } - private getSyntacticDiagnosticsSync(args: protocol.SyntacticDiagnosticsSyncRequestArgs): protocol.Diagnostic[] | protocol.DiagnosticWithLinePosition[] { + private getSyntacticDiagnosticsSync(args: protocol.SyntacticDiagnosticsSyncRequestArgs): ReadonlyArray | ReadonlyArray { const { configFile } = this.getConfigFileAndProject(args); if (configFile) { // all the config file errors are reported as part of semantic check so nothing to report here - return []; + return emptyArray; } return this.getDiagnosticsWorker(args, /*isSemantic*/ false, (project, file) => project.getLanguageService().getSyntacticDiagnostics(file), args.includeLinePosition); } - private getSemanticDiagnosticsSync(args: protocol.SemanticDiagnosticsSyncRequestArgs): protocol.Diagnostic[] | protocol.DiagnosticWithLinePosition[] { + private getSemanticDiagnosticsSync(args: protocol.SemanticDiagnosticsSyncRequestArgs): ReadonlyArray | ReadonlyArray { const { configFile, project } = this.getConfigFileAndProject(args); if (configFile) { return this.getConfigFileDiagnostics(configFile, project, args.includeLinePosition); @@ -705,7 +707,7 @@ namespace ts.server { return this.getDiagnosticsWorker(args, /*isSemantic*/ true, (project, file) => project.getLanguageService().getSemanticDiagnostics(file), args.includeLinePosition); } - private getDocumentHighlights(args: protocol.DocumentHighlightsRequestArgs, simplifiedResult: boolean): protocol.DocumentHighlightsItem[] | DocumentHighlights[] { + private getDocumentHighlights(args: protocol.DocumentHighlightsRequestArgs, simplifiedResult: boolean): ReadonlyArray | ReadonlyArray { const { file, project } = this.getFileAndProject(args); const scriptInfo = project.getScriptInfoForNormalizedPath(file); const position = this.getPosition(args, scriptInfo); @@ -796,7 +798,7 @@ namespace ts.server { return info.getDefaultProject(); } - private getRenameLocations(args: protocol.RenameRequestArgs, simplifiedResult: boolean): protocol.RenameResponseBody | RenameLocation[] { + private getRenameLocations(args: protocol.RenameRequestArgs, simplifiedResult: boolean): protocol.RenameResponseBody | ReadonlyArray { const file = toNormalizedPath(args.file); const info = this.projectService.getScriptInfoForNormalizedPath(file); const position = this.getPosition(args, info); @@ -813,7 +815,7 @@ namespace ts.server { if (!renameInfo.canRename) { return { info: renameInfo, - locs: [] + locs: emptyArray }; } @@ -822,7 +824,7 @@ namespace ts.server { (project: Project) => { const renameLocations = project.getLanguageService().findRenameLocations(file, position, args.findInStrings, args.findInComments); if (!renameLocations) { - return []; + return emptyArray; } return renameLocations.map(location => { @@ -899,7 +901,7 @@ namespace ts.server { } } - private getReferences(args: protocol.FileLocationRequestArgs, simplifiedResult: boolean): protocol.ReferencesResponseBody | ReferencedSymbol[] { + private getReferences(args: protocol.FileLocationRequestArgs, simplifiedResult: boolean): protocol.ReferencesResponseBody | ReadonlyArray { const file = toNormalizedPath(args.file); const projects = this.getProjects(args); @@ -909,7 +911,7 @@ namespace ts.server { if (simplifiedResult) { const nameInfo = defaultProject.getLanguageService().getQuickInfoAtPosition(file, position); if (!nameInfo) { - return undefined; + return emptyArray; } const displayString = displayPartsToString(nameInfo.displayParts); @@ -921,7 +923,7 @@ namespace ts.server { (project: Project) => { const references = project.getLanguageService().getReferencesAtPosition(file, position); if (!references) { - return []; + return emptyArray; } return references.map(ref => { @@ -978,7 +980,7 @@ namespace ts.server { if (this.eventHandler) { this.eventHandler({ eventName: "configFileDiag", - data: { triggerFile: fileName, configFileName, diagnostics: configFileErrors || [] } + data: { triggerFile: fileName, configFileName, diagnostics: configFileErrors || emptyArray } }); } } @@ -1163,7 +1165,7 @@ namespace ts.server { }); } - private getCompletions(args: protocol.CompletionsRequestArgs, simplifiedResult: boolean): protocol.CompletionEntry[] | CompletionInfo { + private getCompletions(args: protocol.CompletionsRequestArgs, simplifiedResult: boolean): ReadonlyArray | CompletionInfo { const prefix = args.prefix || ""; const { file, project } = this.getFileAndProject(args); @@ -1172,7 +1174,7 @@ namespace ts.server { const completions = project.getLanguageService().getCompletionsAtPosition(file, position); if (!completions) { - return undefined; + return emptyArray; } if (simplifiedResult) { return mapDefined(completions.entries, entry => { @@ -1188,7 +1190,7 @@ namespace ts.server { } } - private getCompletionEntryDetails(args: protocol.CompletionDetailsRequestArgs): protocol.CompletionEntryDetails[] { + private getCompletionEntryDetails(args: protocol.CompletionDetailsRequestArgs): ReadonlyArray { const { file, project } = this.getFileAndProject(args); const scriptInfo = project.getScriptInfoForNormalizedPath(file); const position = this.getPosition(args, scriptInfo); @@ -1197,12 +1199,12 @@ namespace ts.server { project.getLanguageService().getCompletionEntryDetails(file, position, entryName)); } - private getCompileOnSaveAffectedFileList(args: protocol.FileRequestArgs): protocol.CompileOnSaveAffectedFileListSingleProject[] { + private getCompileOnSaveAffectedFileList(args: protocol.FileRequestArgs): ReadonlyArray { const info = this.projectService.getScriptInfo(args.file); const result: protocol.CompileOnSaveAffectedFileListSingleProject[] = []; if (!info) { - return []; + return emptyArray; } // if specified a project, we only return affected file list in this project @@ -1360,7 +1362,7 @@ namespace ts.server { : tree; } - private getNavigateToItems(args: protocol.NavtoRequestArgs, simplifiedResult: boolean): protocol.NavtoItem[] | NavigateToItem[] { + private getNavigateToItems(args: protocol.NavtoRequestArgs, simplifiedResult: boolean): ReadonlyArray | ReadonlyArray { const projects = this.getProjects(args); const fileName = args.currentFileOnly ? args.file && normalizeSlashes(args.file) : undefined; @@ -1370,7 +1372,7 @@ namespace ts.server { project => { const navItems = project.getLanguageService().getNavigateToItems(args.searchValue, args.maxResultCount, fileName, /*excludeDts*/ project.isNonTsProject()); if (!navItems) { - return []; + return emptyArray; } return navItems.map((navItem) => { From 39e0cc61a7daa28e61a6b51ca961d40631579627 Mon Sep 17 00:00:00 2001 From: Yui Date: Wed, 9 Aug 2017 13:47:44 -0700 Subject: [PATCH 080/237] Fix 16628: "undefined" exception when name of binding element in binding pattern is empty (#17132) * Handle the case where binding pattern name element is empty * Update tests and baselines * Feedback from PR * Handle empty binding patterns more generally in emitter * Dont simply handling fo empty binding patterns and stay spec compliant * PR feedback --- src/compiler/declarationEmitter.ts | 4 ++++ src/compiler/transformers/destructuring.ts | 5 ++++- src/compiler/transformers/es2015.ts | 9 +++++---- src/compiler/utilities.ts | 14 ++++++++++++++ .../bindingPatternOmittedExpressionNesting.js | 11 +++++++++++ .../bindingPatternOmittedExpressionNesting.symbols | 4 ++++ .../bindingPatternOmittedExpressionNesting.types | 9 +++++++++ .../reference/emptyAssignmentPatterns01_ES5.js | 5 ++++- .../emptyAssignmentPatterns01_ES5.symbols | 1 + .../reference/emptyAssignmentPatterns01_ES5.types | 6 ++++++ .../bindingPatternOmittedExpressionNesting.ts | 2 ++ .../destructuring/emptyAssignmentPatterns01_ES5.ts | 4 +++- 12 files changed, 67 insertions(+), 7 deletions(-) create mode 100644 tests/baselines/reference/bindingPatternOmittedExpressionNesting.js create mode 100644 tests/baselines/reference/bindingPatternOmittedExpressionNesting.symbols create mode 100644 tests/baselines/reference/bindingPatternOmittedExpressionNesting.types create mode 100644 tests/cases/compiler/bindingPatternOmittedExpressionNesting.ts diff --git a/src/compiler/declarationEmitter.ts b/src/compiler/declarationEmitter.ts index 43f7446865f93..2c4be2ae7c3d2 100644 --- a/src/compiler/declarationEmitter.ts +++ b/src/compiler/declarationEmitter.ts @@ -1367,6 +1367,10 @@ namespace ts { } function writeVariableStatement(node: VariableStatement) { + // If binding pattern doesn't have name, then there is nothing to be emitted for declaration file i.e. const [,] = [1,2]. + if (every(node.declarationList && node.declarationList.declarations, decl => decl.name && isEmptyBindingPattern(decl.name))) { + return; + } emitJsDocComments(node); emitModuleElementDeclarationFlags(node); if (isLet(node.declarationList)) { diff --git a/src/compiler/transformers/destructuring.ts b/src/compiler/transformers/destructuring.ts index 45ad53ffbed31..2249e57731214 100644 --- a/src/compiler/transformers/destructuring.ts +++ b/src/compiler/transformers/destructuring.ts @@ -331,11 +331,14 @@ namespace ts { location ); } - else if (numElements !== 1 && (flattenContext.level < FlattenLevel.ObjectRest || numElements === 0)) { + else if (numElements !== 1 && (flattenContext.level < FlattenLevel.ObjectRest || numElements === 0) + || every(elements, isOmittedExpression)) { // For anything other than a single-element destructuring we need to generate a temporary // to ensure value is evaluated exactly once. Additionally, if we have zero elements // we need to emit *something* to ensure that in case a 'var' keyword was already emitted, // so in that case, we'll intentionally create that temporary. + // Or all the elements of the binding pattern are omitted expression such as "var [,] = [1,2]", + // then we will create temporary variable. const reuseIdentifierExpressions = !isDeclarationBindingElement(parent) || numElements !== 0; value = ensureIdentifier(flattenContext, value, reuseIdentifierExpressions, location); } diff --git a/src/compiler/transformers/es2015.ts b/src/compiler/transformers/es2015.ts index 2b0b175e2a56f..2803575a73f39 100644 --- a/src/compiler/transformers/es2015.ts +++ b/src/compiler/transformers/es2015.ts @@ -2105,13 +2105,14 @@ namespace ts { setCommentRange(declarationList, node); if (node.transformFlags & TransformFlags.ContainsBindingPattern - && (isBindingPattern(node.declarations[0].name) - || isBindingPattern(lastOrUndefined(node.declarations).name))) { + && (isBindingPattern(node.declarations[0].name) || isBindingPattern(lastOrUndefined(node.declarations).name))) { // If the first or last declaration is a binding pattern, we need to modify // the source map range for the declaration list. const firstDeclaration = firstOrUndefined(declarations); - const lastDeclaration = lastOrUndefined(declarations); - setSourceMapRange(declarationList, createRange(firstDeclaration.pos, lastDeclaration.end)); + if (firstDeclaration) { + const lastDeclaration = lastOrUndefined(declarations); + setSourceMapRange(declarationList, createRange(firstDeclaration.pos, lastDeclaration.end)); + } } return declarationList; diff --git a/src/compiler/utilities.ts b/src/compiler/utilities.ts index 76d242e8b08d8..f6d8c634c43f2 100644 --- a/src/compiler/utilities.ts +++ b/src/compiler/utilities.ts @@ -3856,6 +3856,20 @@ namespace ts { return hasModifier(node, ModifierFlags.ParameterPropertyModifier) && node.parent.kind === SyntaxKind.Constructor && isClassLike(node.parent.parent); } + export function isEmptyBindingPattern(node: BindingName): node is BindingPattern { + if (isBindingPattern(node)) { + return every(node.elements, isEmptyBindingElement); + } + return false; + } + + export function isEmptyBindingElement(node: BindingElement): boolean { + if (isOmittedExpression(node)) { + return true; + } + return isEmptyBindingPattern(node.name); + } + function walkUpBindingElementsAndPatterns(node: Node): Node { while (node && (node.kind === SyntaxKind.BindingElement || isBindingPattern(node))) { node = node.parent; diff --git a/tests/baselines/reference/bindingPatternOmittedExpressionNesting.js b/tests/baselines/reference/bindingPatternOmittedExpressionNesting.js new file mode 100644 index 0000000000000..e2dff30887937 --- /dev/null +++ b/tests/baselines/reference/bindingPatternOmittedExpressionNesting.js @@ -0,0 +1,11 @@ +//// [bindingPatternOmittedExpressionNesting.ts] +export let [,,[,[],,[],]] = undefined as any; + +//// [bindingPatternOmittedExpressionNesting.js] +"use strict"; +exports.__esModule = true; +exports._a = (_b = undefined, _c = _b[2], _d = _c[1], _e = _c[3]); +var _b, _c, _d, _e; + + +//// [bindingPatternOmittedExpressionNesting.d.ts] diff --git a/tests/baselines/reference/bindingPatternOmittedExpressionNesting.symbols b/tests/baselines/reference/bindingPatternOmittedExpressionNesting.symbols new file mode 100644 index 0000000000000..25db0dd62719e --- /dev/null +++ b/tests/baselines/reference/bindingPatternOmittedExpressionNesting.symbols @@ -0,0 +1,4 @@ +=== tests/cases/compiler/bindingPatternOmittedExpressionNesting.ts === +export let [,,[,[],,[],]] = undefined as any; +>undefined : Symbol(undefined) + diff --git a/tests/baselines/reference/bindingPatternOmittedExpressionNesting.types b/tests/baselines/reference/bindingPatternOmittedExpressionNesting.types new file mode 100644 index 0000000000000..2c5211c9d9d68 --- /dev/null +++ b/tests/baselines/reference/bindingPatternOmittedExpressionNesting.types @@ -0,0 +1,9 @@ +=== tests/cases/compiler/bindingPatternOmittedExpressionNesting.ts === +export let [,,[,[],,[],]] = undefined as any; +> : undefined +> : undefined +> : undefined +> : undefined +>undefined as any : any +>undefined : undefined + diff --git a/tests/baselines/reference/emptyAssignmentPatterns01_ES5.js b/tests/baselines/reference/emptyAssignmentPatterns01_ES5.js index bd7ca29344631..82f23d24ea583 100644 --- a/tests/baselines/reference/emptyAssignmentPatterns01_ES5.js +++ b/tests/baselines/reference/emptyAssignmentPatterns01_ES5.js @@ -2,12 +2,15 @@ var a: any; ({} = a); -([] = a); +([] = a); + +var [,] = [1,2]; //// [emptyAssignmentPatterns01_ES5.js] var a; (a); (a); +var _a = [1, 2]; //// [emptyAssignmentPatterns01_ES5.d.ts] diff --git a/tests/baselines/reference/emptyAssignmentPatterns01_ES5.symbols b/tests/baselines/reference/emptyAssignmentPatterns01_ES5.symbols index e8c3f93c01389..30676ec457995 100644 --- a/tests/baselines/reference/emptyAssignmentPatterns01_ES5.symbols +++ b/tests/baselines/reference/emptyAssignmentPatterns01_ES5.symbols @@ -8,3 +8,4 @@ var a: any; ([] = a); >a : Symbol(a, Decl(emptyAssignmentPatterns01_ES5.ts, 0, 3)) +var [,] = [1,2]; diff --git a/tests/baselines/reference/emptyAssignmentPatterns01_ES5.types b/tests/baselines/reference/emptyAssignmentPatterns01_ES5.types index b298c7f66eebd..a744a190d036b 100644 --- a/tests/baselines/reference/emptyAssignmentPatterns01_ES5.types +++ b/tests/baselines/reference/emptyAssignmentPatterns01_ES5.types @@ -14,3 +14,9 @@ var a: any; >[] : undefined[] >a : any +var [,] = [1,2]; +> : undefined +>[1,2] : [number, number] +>1 : 1 +>2 : 2 + diff --git a/tests/cases/compiler/bindingPatternOmittedExpressionNesting.ts b/tests/cases/compiler/bindingPatternOmittedExpressionNesting.ts new file mode 100644 index 0000000000000..56ae688e715a5 --- /dev/null +++ b/tests/cases/compiler/bindingPatternOmittedExpressionNesting.ts @@ -0,0 +1,2 @@ +// @declaration: true +export let [,,[,[],,[],]] = undefined as any; \ No newline at end of file diff --git a/tests/cases/conformance/es6/destructuring/emptyAssignmentPatterns01_ES5.ts b/tests/cases/conformance/es6/destructuring/emptyAssignmentPatterns01_ES5.ts index 44175dbb63a40..f093413b63ffc 100644 --- a/tests/cases/conformance/es6/destructuring/emptyAssignmentPatterns01_ES5.ts +++ b/tests/cases/conformance/es6/destructuring/emptyAssignmentPatterns01_ES5.ts @@ -4,4 +4,6 @@ var a: any; ({} = a); -([] = a); \ No newline at end of file +([] = a); + +var [,] = [1,2]; \ No newline at end of file From e73d58e21ca18dc79318c71906e9b93d92261fd6 Mon Sep 17 00:00:00 2001 From: Andy Date: Wed, 9 Aug 2017 13:53:54 -0700 Subject: [PATCH 081/237] findAllReferences: Type parameter is not globally visible (#16419) * findAllReferences: Type parameter is not globally visible * Add test for merged interface * Clean up comment --- src/services/findAllReferences.ts | 15 ++++++++++----- .../findAllRefsTypeParameterInMergedInterface.ts | 6 ++++++ 2 files changed, 16 insertions(+), 5 deletions(-) create mode 100644 tests/cases/fourslash/findAllRefsTypeParameterInMergedInterface.ts diff --git a/src/services/findAllReferences.ts b/src/services/findAllReferences.ts index 204de12a10c96..ad26dae21158b 100644 --- a/src/services/findAllReferences.ts +++ b/src/services/findAllReferences.ts @@ -652,10 +652,15 @@ namespace ts.FindAllReferences.Core { return undefined; } - // If the symbol has a parent, it's globally visible. - // Unless that parent is an external module, then we should only search in the module (and recurse on the export later). - // But if the parent is a module that has `export as namespace`, then the symbol *is* globally visible. - if (parent && !((parent.flags & SymbolFlags.Module) && isExternalModuleSymbol(parent) && !parent.globalExports)) { + /* + If the symbol has a parent, it's globally visible unless: + - It's a private property (handled above). + - It's a type parameter. + - The parent is an external module: then we should only search in the module (and recurse on the export later). + - But if the parent has `export as namespace`, the symbol is globally visible through that namespace. + */ + const exposedByParent = parent && !(symbol.flags & SymbolFlags.TypeParameter); + if (exposedByParent && !((parent.flags & SymbolFlags.Module) && isExternalModuleSymbol(parent) && !parent.globalExports)) { return undefined; } @@ -682,7 +687,7 @@ namespace ts.FindAllReferences.Core { // declare module "a" { export type T = number; } // declare module "b" { import { T } from "a"; export const x: T; } // So we must search the whole source file. (Because we will mark the source file as seen, we we won't return to it when searching for imports.) - return parent ? scope.getSourceFile() : scope; + return exposedByParent ? scope.getSourceFile() : scope; } function getPossibleSymbolReferencePositions(sourceFile: SourceFile, symbolName: string, container: Node = sourceFile): number[] { diff --git a/tests/cases/fourslash/findAllRefsTypeParameterInMergedInterface.ts b/tests/cases/fourslash/findAllRefsTypeParameterInMergedInterface.ts new file mode 100644 index 0000000000000..d489a51ccdd76 --- /dev/null +++ b/tests/cases/fourslash/findAllRefsTypeParameterInMergedInterface.ts @@ -0,0 +1,6 @@ +/// + +////interface I<[|{| "isWriteAccess": true, "isDefinition": true |}T|]> { a: [|T|] } +////interface I<[|{| "isWriteAccess": true, "isDefinition": true |}T|]> { b: [|T|] } + +verify.singleReferenceGroup("(type parameter) T in I"); From 6221d7089e0f10ba0ce85026bd7273ee0bd376f0 Mon Sep 17 00:00:00 2001 From: Wesley Wigham Date: Wed, 9 Aug 2017 14:03:37 -0700 Subject: [PATCH 082/237] Fix import addition location (#17327) * Add test with bug * Fix for import placement * Consolidate comment recognition functions into utilities * Add another test with all 3 kinds * Recognize path directives as part of triple slash directives * Also handle no-default-lib triple-slash comments * Test for all the triple-slash kinds * Keep import-placement logic in the quickfix, since its not really a node start; accept new baselines * Work in not-ES6, use a real no-lib comment * Remove no default lib triple slash comment, it disables checking and thereby quick fixes * Copy regex rather than have a regex copy --- src/compiler/comments.ts | 12 +------ src/compiler/utilities.ts | 36 ++++++++++++++++--- src/services/codefixes/importFixes.ts | 24 ++++++++++++- tests/baselines/reference/1.0lib-noErrors.js | 1 + .../reference/typeReferenceDirectives1.js | 1 + .../reference/typeReferenceDirectives3.js | 1 + .../importNameCodeFixNewImportAmbient2.ts | 4 +-- ...portNameCodeFixNewImportFileAllComments.ts | 35 ++++++++++++++++++ ...ameCodeFixNewImportFileDetachedComments.ts | 23 ++++++++++++ 9 files changed, 118 insertions(+), 19 deletions(-) create mode 100644 tests/cases/fourslash/importNameCodeFixNewImportFileAllComments.ts create mode 100644 tests/cases/fourslash/importNameCodeFixNewImportFileDetachedComments.ts diff --git a/src/compiler/comments.ts b/src/compiler/comments.ts index 50d706d3c42b4..adf15c7e28d5c 100644 --- a/src/compiler/comments.ts +++ b/src/compiler/comments.ts @@ -415,17 +415,7 @@ namespace ts { * @return true if the comment is a triple-slash comment else false */ function isTripleSlashComment(commentPos: number, commentEnd: number) { - // Verify this is /// comment, but do the regexp match only when we first can find /// in the comment text - // so that we don't end up computing comment string and doing match for all // comments - if (currentText.charCodeAt(commentPos + 1) === CharacterCodes.slash && - commentPos + 2 < commentEnd && - currentText.charCodeAt(commentPos + 2) === CharacterCodes.slash) { - const textSubStr = currentText.substring(commentPos, commentEnd); - return textSubStr.match(fullTripleSlashReferencePathRegEx) || - textSubStr.match(fullTripleSlashAMDReferencePathRegEx) ? - true : false; - } - return false; + return isRecognizedTripleSlashComment(currentText, commentPos, commentEnd); } } } \ No newline at end of file diff --git a/src/compiler/utilities.ts b/src/compiler/utilities.ts index f6d8c634c43f2..cc75edc3f373a 100644 --- a/src/compiler/utilities.ts +++ b/src/compiler/utilities.ts @@ -262,6 +262,32 @@ namespace ts { return !nodeIsMissing(node); } + /** + * Determine if the given comment is a triple-slash + * + * @return true if the comment is a triple-slash comment else false + */ + export function isRecognizedTripleSlashComment(text: string, commentPos: number, commentEnd: number) { + // Verify this is /// comment, but do the regexp match only when we first can find /// in the comment text + // so that we don't end up computing comment string and doing match for all // comments + if (text.charCodeAt(commentPos + 1) === CharacterCodes.slash && + commentPos + 2 < commentEnd && + text.charCodeAt(commentPos + 2) === CharacterCodes.slash) { + const textSubStr = text.substring(commentPos, commentEnd); + return textSubStr.match(fullTripleSlashReferencePathRegEx) || + textSubStr.match(fullTripleSlashAMDReferencePathRegEx) || + textSubStr.match(fullTripleSlashReferenceTypeReferenceDirectiveRegEx) || + textSubStr.match(defaultLibReferenceRegEx) ? + true : false; + } + return false; + } + + export function isPinnedComment(text: string, comment: CommentRange) { + return text.charCodeAt(comment.pos + 1) === CharacterCodes.asterisk && + text.charCodeAt(comment.pos + 2) === CharacterCodes.exclamation; + } + export function getTokenPosOfNode(node: Node, sourceFile?: SourceFileLike, includeJsDoc?: boolean): number { // With nodes that have no width (i.e. 'Missing' nodes), we actually *don't* // want to skip trivia because this will launch us forward to the next token. @@ -660,6 +686,7 @@ namespace ts { export let fullTripleSlashReferencePathRegEx = /^(\/\/\/\s*/; export let fullTripleSlashReferenceTypeReferenceDirectiveRegEx = /^(\/\/\/\s*/; export let fullTripleSlashAMDReferencePathRegEx = /^(\/\/\/\s*/; + export let defaultLibReferenceRegEx = /^(\/\/\/\s*/; export function isPartOfTypeNode(node: Node): boolean { if (SyntaxKind.FirstTypeNode <= node.kind && node.kind <= SyntaxKind.LastTypeNode) { @@ -1846,7 +1873,7 @@ namespace ts { export function getFileReferenceFromReferencePath(comment: string, commentRange: CommentRange): ReferencePathMatchResult { const simpleReferenceRegEx = /^\/\/\/\s*/gim; + const isNoDefaultLibRegEx = new RegExp(defaultLibReferenceRegEx.source, "gim"); if (simpleReferenceRegEx.test(comment)) { if (isNoDefaultLibRegEx.test(comment)) { return { isNoDefaultLib: true }; @@ -2823,7 +2850,7 @@ namespace ts { // // var x = 10; if (node.pos === 0) { - leadingComments = filter(getLeadingCommentRanges(text, node.pos), isPinnedComment); + leadingComments = filter(getLeadingCommentRanges(text, node.pos), isPinnedCommentLocal); } } else { @@ -2869,9 +2896,8 @@ namespace ts { return currentDetachedCommentInfo; - function isPinnedComment(comment: CommentRange) { - return text.charCodeAt(comment.pos + 1) === CharacterCodes.asterisk && - text.charCodeAt(comment.pos + 2) === CharacterCodes.exclamation; + function isPinnedCommentLocal(comment: CommentRange) { + return isPinnedComment(text, comment); } } diff --git a/src/services/codefixes/importFixes.ts b/src/services/codefixes/importFixes.ts index d6fb8de9259b2..903d18179db58 100644 --- a/src/services/codefixes/importFixes.ts +++ b/src/services/codefixes/importFixes.ts @@ -396,7 +396,7 @@ namespace ts.codefix { : createImportClause(/*name*/ undefined, createNamedImports([createImportSpecifier(/*propertyName*/ undefined, createIdentifier(symbolName))])); const importDecl = createImportDeclaration(/*decorators*/ undefined, /*modifiers*/ undefined, importClause, createLiteral(moduleSpecifierWithoutQuotes)); if (!lastImportDeclaration) { - changeTracker.insertNodeAt(sourceFile, sourceFile.getStart(), importDecl, { suffix: `${context.newLineCharacter}${context.newLineCharacter}` }); + changeTracker.insertNodeAt(sourceFile, getSourceFileImportLocation(sourceFile), importDecl, { suffix: `${context.newLineCharacter}${context.newLineCharacter}` }); } else { changeTracker.insertNodeAfter(sourceFile, lastImportDeclaration, importDecl, { suffix: context.newLineCharacter }); @@ -413,6 +413,28 @@ namespace ts.codefix { moduleSpecifierWithoutQuotes ); + function getSourceFileImportLocation(node: SourceFile) { + // For a source file, it is possible there are detached comments we should not skip + const text = node.text; + let ranges = getLeadingCommentRanges(text, 0); + if (!ranges) return 0; + let position = 0; + // However we should still skip a pinned comment at the top + if (ranges.length && ranges[0].kind === SyntaxKind.MultiLineCommentTrivia && isPinnedComment(text, ranges[0])) { + position = ranges[0].end + 1; + ranges = ranges.slice(1); + } + // As well as any triple slash references + for (const range of ranges) { + if (range.kind === SyntaxKind.SingleLineCommentTrivia && isRecognizedTripleSlashComment(node.text, range.pos, range.end)) { + position = range.end + 1; + continue; + } + break; + } + return position; + } + function getModuleSpecifierForNewImport() { const fileName = sourceFile.fileName; const moduleFileName = moduleSymbol.valueDeclaration.getSourceFile().fileName; diff --git a/tests/baselines/reference/1.0lib-noErrors.js b/tests/baselines/reference/1.0lib-noErrors.js index 1dcfa9743b2b8..ade0f4bf903b9 100644 --- a/tests/baselines/reference/1.0lib-noErrors.js +++ b/tests/baselines/reference/1.0lib-noErrors.js @@ -1158,3 +1158,4 @@ MERCHANTABLITY OR NON-INFRINGEMENT. See the Apache Version 2.0 License for specific language governing permissions and limitations under the License. ***************************************************************************** */ +/// diff --git a/tests/baselines/reference/typeReferenceDirectives1.js b/tests/baselines/reference/typeReferenceDirectives1.js index a0865e544a890..9ff2e66ff634e 100644 --- a/tests/baselines/reference/typeReferenceDirectives1.js +++ b/tests/baselines/reference/typeReferenceDirectives1.js @@ -10,6 +10,7 @@ interface A { } //// [app.js] +/// //// [app.d.ts] diff --git a/tests/baselines/reference/typeReferenceDirectives3.js b/tests/baselines/reference/typeReferenceDirectives3.js index b320e602237a5..28d57f93fe512 100644 --- a/tests/baselines/reference/typeReferenceDirectives3.js +++ b/tests/baselines/reference/typeReferenceDirectives3.js @@ -16,6 +16,7 @@ interface A { } //// [app.js] +/// /// diff --git a/tests/cases/fourslash/importNameCodeFixNewImportAmbient2.ts b/tests/cases/fourslash/importNameCodeFixNewImportAmbient2.ts index a23d7684d0ab5..64a8c28b3f8f6 100644 --- a/tests/cases/fourslash/importNameCodeFixNewImportAmbient2.ts +++ b/tests/cases/fourslash/importNameCodeFixNewImportAmbient2.ts @@ -1,6 +1,6 @@ /// -////[|/* +////[|/*! //// * I'm a license or something //// */ ////f1/*0*/();|] @@ -12,7 +12,7 @@ //// } verify.importFixAtPosition([ -`/* +`/*! * I'm a license or something */ import { f1 } from "ambient-module"; diff --git a/tests/cases/fourslash/importNameCodeFixNewImportFileAllComments.ts b/tests/cases/fourslash/importNameCodeFixNewImportFileAllComments.ts new file mode 100644 index 0000000000000..9dc914ba693c1 --- /dev/null +++ b/tests/cases/fourslash/importNameCodeFixNewImportFileAllComments.ts @@ -0,0 +1,35 @@ +/// + +//// [|/*! +//// * This is a license or something +//// */ +//// /// +//// /// +//// /// +//// /** +//// * This is a comment intended to be attached to this interface +//// */ +//// export interface SomeInterface { +//// } +//// f1/*0*/();|] + +// @Filename: module.ts +//// export function f1() {} +//// export var v1 = 5; + +verify.importFixAtPosition([ +`/*! + * This is a license or something + */ +/// +/// +/// +import { f1 } from "./module"; + +/** + * This is a comment intended to be attached to this interface + */ +export interface SomeInterface { +} +f1();` +]); \ No newline at end of file diff --git a/tests/cases/fourslash/importNameCodeFixNewImportFileDetachedComments.ts b/tests/cases/fourslash/importNameCodeFixNewImportFileDetachedComments.ts new file mode 100644 index 0000000000000..cfb537047fbbd --- /dev/null +++ b/tests/cases/fourslash/importNameCodeFixNewImportFileDetachedComments.ts @@ -0,0 +1,23 @@ +/// + +//// [|/** +//// * This is a comment intended to be attached to this interface +//// */ +//// export interface SomeInterface { +//// } +//// f1/*0*/();|] + +// @Filename: module.ts +//// export function f1() {} +//// export var v1 = 5; + +verify.importFixAtPosition([ +`import { f1 } from "./module"; + +/** + * This is a comment intended to be attached to this interface + */ +export interface SomeInterface { +} +f1();` +]); From f28f5fd0412ec7c6c08c3ee214232a8db68a372c Mon Sep 17 00:00:00 2001 From: Andy Date: Wed, 9 Aug 2017 14:09:52 -0700 Subject: [PATCH 083/237] Don't check function expression grammar if this is SkipContextSensitive (#17698) --- src/compiler/checker.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 1d1d16b7ee11e..f6ceab48ae80f 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -16851,18 +16851,18 @@ namespace ts { function checkFunctionExpressionOrObjectLiteralMethod(node: FunctionExpression | MethodDeclaration, checkMode?: CheckMode): Type { Debug.assert(node.kind !== SyntaxKind.MethodDeclaration || isObjectLiteralMethod(node)); - // Grammar checking - const hasGrammarError = checkGrammarFunctionLikeDeclaration(node); - if (!hasGrammarError && node.kind === SyntaxKind.FunctionExpression) { - checkGrammarForGenerator(node); - } - // The identityMapper object is used to indicate that function expressions are wildcards if (checkMode === CheckMode.SkipContextSensitive && isContextSensitive(node)) { checkNodeDeferred(node); return anyFunctionType; } + // Grammar checking + const hasGrammarError = checkGrammarFunctionLikeDeclaration(node); + if (!hasGrammarError && node.kind === SyntaxKind.FunctionExpression) { + checkGrammarForGenerator(node); + } + const links = getNodeLinks(node); const type = getTypeOfSymbol(node.symbol); From a6f37f55e495c76874ef4c79a55e103f16be85f1 Mon Sep 17 00:00:00 2001 From: Wesley Wigham Date: Wed, 9 Aug 2017 14:27:37 -0700 Subject: [PATCH 084/237] Add a leading space on binary operator token trailing comments (#17691) * Add a leading space on token trailing comments * Demystify comment --- src/compiler/emitter.ts | 2 +- .../reference/commentOnBinaryOperator1.js | 2 +- .../commentsArgumentsOfCallExpression2.js | 2 +- tests/baselines/reference/jsdocTypeTagCast.js | 22 +++++++++---------- .../reference/parser15.4.4.14-9-2.js | 6 ++--- .../parserGreaterThanTokenAmbiguity10.js | 2 +- .../parserGreaterThanTokenAmbiguity15.js | 2 +- .../parserGreaterThanTokenAmbiguity20.js | 2 +- .../parserGreaterThanTokenAmbiguity5.js | 2 +- .../typeGuardsInConditionalExpression.js | 2 +- 10 files changed, 22 insertions(+), 22 deletions(-) diff --git a/src/compiler/emitter.ts b/src/compiler/emitter.ts index 923e6da421540..d51f7ada3dec3 100644 --- a/src/compiler/emitter.ts +++ b/src/compiler/emitter.ts @@ -1348,7 +1348,7 @@ namespace ts { increaseIndentIf(indentBeforeOperator, isCommaOperator ? " " : undefined); emitLeadingCommentsOfPosition(node.operatorToken.pos); writeTokenNode(node.operatorToken); - emitTrailingCommentsOfPosition(node.operatorToken.end); + emitTrailingCommentsOfPosition(node.operatorToken.end, /*prefixSpace*/ true); // Binary operators should have a space before the comment starts increaseIndentIf(indentAfterOperator, " "); emitExpression(node.right); decreaseIndentIf(indentBeforeOperator, indentAfterOperator); diff --git a/tests/baselines/reference/commentOnBinaryOperator1.js b/tests/baselines/reference/commentOnBinaryOperator1.js index daad6f5bdde12..73db1caeab51b 100644 --- a/tests/baselines/reference/commentOnBinaryOperator1.js +++ b/tests/baselines/reference/commentOnBinaryOperator1.js @@ -21,5 +21,5 @@ var b = 'some' + 'text'; var c = 'some' /* comment */ - +/*comment1*/ + + /*comment1*/ 'text'; diff --git a/tests/baselines/reference/commentsArgumentsOfCallExpression2.js b/tests/baselines/reference/commentsArgumentsOfCallExpression2.js index e05256b86b62d..f89e67ef3d8b3 100644 --- a/tests/baselines/reference/commentsArgumentsOfCallExpression2.js +++ b/tests/baselines/reference/commentsArgumentsOfCallExpression2.js @@ -14,7 +14,7 @@ foo( function foo(/*c1*/ x, /*d1*/ y, /*e1*/ w) { } var a, b; foo(/*c2*/ 1, /*d2*/ 1 + 2, /*e1*/ a + b); -foo(/*c3*/ function () { }, /*d2*/ function () { }, /*e2*/ a +/*e3*/ b); +foo(/*c3*/ function () { }, /*d2*/ function () { }, /*e2*/ a + /*e3*/ b); foo(/*c3*/ function () { }, /*d3*/ function () { }, /*e3*/ (a + b)); foo( /*c4*/ function () { }, diff --git a/tests/baselines/reference/jsdocTypeTagCast.js b/tests/baselines/reference/jsdocTypeTagCast.js index ffe59d0138d1f..efada5ee4dc88 100644 --- a/tests/baselines/reference/jsdocTypeTagCast.js +++ b/tests/baselines/reference/jsdocTypeTagCast.js @@ -97,7 +97,7 @@ var a; /** @type {string} */ var s; var a = ("" + 4); -var s = "" +/** @type {*} */ (4); +var s = "" + /** @type {*} */ (4); var SomeBase = (function () { function SomeBase() { this.p = 42; @@ -128,19 +128,19 @@ var someBase = new SomeBase(); var someDerived = new SomeDerived(); var someOther = new SomeOther(); var someFakeClass = new SomeFakeClass(); -someBase =/** @type {SomeBase} */ (someDerived); -someBase =/** @type {SomeBase} */ (someBase); -someBase =/** @type {SomeBase} */ (someOther); // Error -someDerived =/** @type {SomeDerived} */ (someDerived); -someDerived =/** @type {SomeDerived} */ (someBase); -someDerived =/** @type {SomeDerived} */ (someOther); // Error -someOther =/** @type {SomeOther} */ (someDerived); // Error -someOther =/** @type {SomeOther} */ (someBase); // Error -someOther =/** @type {SomeOther} */ (someOther); +someBase = /** @type {SomeBase} */ (someDerived); +someBase = /** @type {SomeBase} */ (someBase); +someBase = /** @type {SomeBase} */ (someOther); // Error +someDerived = /** @type {SomeDerived} */ (someDerived); +someDerived = /** @type {SomeDerived} */ (someBase); +someDerived = /** @type {SomeDerived} */ (someOther); // Error +someOther = /** @type {SomeOther} */ (someDerived); // Error +someOther = /** @type {SomeOther} */ (someBase); // Error +someOther = /** @type {SomeOther} */ (someOther); someFakeClass = someBase; someFakeClass = someDerived; someBase = someFakeClass; // Error -someBase =/** @type {SomeBase} */ (someFakeClass); +someBase = /** @type {SomeBase} */ (someFakeClass); // Type assertion cannot be a type-predicate type /** @type {number | string} */ var numOrStr; diff --git a/tests/baselines/reference/parser15.4.4.14-9-2.js b/tests/baselines/reference/parser15.4.4.14-9-2.js index e24da870d3e00..78ddfbac26bea 100644 --- a/tests/baselines/reference/parser15.4.4.14-9-2.js +++ b/tests/baselines/reference/parser15.4.4.14-9-2.js @@ -41,9 +41,9 @@ function testcase() { var one = 1; var _float = -(4 / 3); var a = new Array(false, undefined, null, "0", obj, -1.3333333333333, "str", -0, true, +0, one, 1, 0, false, _float, -(4 / 3)); - if (a.indexOf(-(4 / 3)) === 14 &&// a[14]=_float===-(4/3) - a.indexOf(0) === 7 &&// a[7] = +0, 0===+0 - a.indexOf(-0) === 7 &&// a[7] = +0, -0===+0 + if (a.indexOf(-(4 / 3)) === 14 && // a[14]=_float===-(4/3) + a.indexOf(0) === 7 && // a[7] = +0, 0===+0 + a.indexOf(-0) === 7 && // a[7] = +0, -0===+0 a.indexOf(1) === 10) { return true; } diff --git a/tests/baselines/reference/parserGreaterThanTokenAmbiguity10.js b/tests/baselines/reference/parserGreaterThanTokenAmbiguity10.js index 7ff9e380dcf04..11275fe94b847 100644 --- a/tests/baselines/reference/parserGreaterThanTokenAmbiguity10.js +++ b/tests/baselines/reference/parserGreaterThanTokenAmbiguity10.js @@ -7,5 +7,5 @@ //// [parserGreaterThanTokenAmbiguity10.js] 1 // before - >>>// after + >>> // after 2; diff --git a/tests/baselines/reference/parserGreaterThanTokenAmbiguity15.js b/tests/baselines/reference/parserGreaterThanTokenAmbiguity15.js index 03e6211ae1529..af9e54988740a 100644 --- a/tests/baselines/reference/parserGreaterThanTokenAmbiguity15.js +++ b/tests/baselines/reference/parserGreaterThanTokenAmbiguity15.js @@ -7,5 +7,5 @@ //// [parserGreaterThanTokenAmbiguity15.js] 1 // before - >>=// after + >>= // after 2; diff --git a/tests/baselines/reference/parserGreaterThanTokenAmbiguity20.js b/tests/baselines/reference/parserGreaterThanTokenAmbiguity20.js index ba5e380043db1..a8c960bd159b8 100644 --- a/tests/baselines/reference/parserGreaterThanTokenAmbiguity20.js +++ b/tests/baselines/reference/parserGreaterThanTokenAmbiguity20.js @@ -7,5 +7,5 @@ //// [parserGreaterThanTokenAmbiguity20.js] 1 // Before - >>>=// after + >>>= // after 2; diff --git a/tests/baselines/reference/parserGreaterThanTokenAmbiguity5.js b/tests/baselines/reference/parserGreaterThanTokenAmbiguity5.js index e240746caa421..7252cfb39e000 100644 --- a/tests/baselines/reference/parserGreaterThanTokenAmbiguity5.js +++ b/tests/baselines/reference/parserGreaterThanTokenAmbiguity5.js @@ -7,5 +7,5 @@ //// [parserGreaterThanTokenAmbiguity5.js] 1 // before - >>// after + >> // after 2; diff --git a/tests/baselines/reference/typeGuardsInConditionalExpression.js b/tests/baselines/reference/typeGuardsInConditionalExpression.js index 8be83a887b1ef..fa44556c199a7 100644 --- a/tests/baselines/reference/typeGuardsInConditionalExpression.js +++ b/tests/baselines/reference/typeGuardsInConditionalExpression.js @@ -138,7 +138,7 @@ function foo8(x) { var b; return typeof x === "string" ? x === "hello" - : ((b = x) &&// number | boolean + : ((b = x) && // number | boolean (typeof x === "boolean" ? x // boolean : x == 10)); // boolean From 17a6f7b56a7ac12664629a5be84c97e08830d910 Mon Sep 17 00:00:00 2001 From: Andy Date: Wed, 9 Aug 2017 14:37:59 -0700 Subject: [PATCH 085/237] Remove unused internal utilities (#17380) * Remove unused internal utilities * Handle undefined input to `mapDefined` --- src/compiler/checker.ts | 4 +- src/compiler/core.ts | 14 ++- src/compiler/transformers/jsx.ts | 2 +- src/compiler/utilities.ts | 201 +------------------------------ src/services/symbolDisplay.ts | 2 +- 5 files changed, 18 insertions(+), 205 deletions(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index f6ceab48ae80f..ac77a64bb64b6 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -5096,8 +5096,8 @@ namespace ts { return unknownType; } - const declaration = findDeclaration( - symbol, d => d.kind === SyntaxKind.JSDocTypedefTag || d.kind === SyntaxKind.TypeAliasDeclaration); + const declaration = find(symbol.declarations, d => + d.kind === SyntaxKind.JSDocTypedefTag || d.kind === SyntaxKind.TypeAliasDeclaration); let type = getTypeFromTypeNode(declaration.kind === SyntaxKind.JSDocTypedefTag ? declaration.typeExpression : declaration.type); if (popTypeResolution()) { diff --git a/src/compiler/core.ts b/src/compiler/core.ts index d5c8396d06d6b..688ae52a3ec4b 100644 --- a/src/compiler/core.ts +++ b/src/compiler/core.ts @@ -501,13 +501,15 @@ namespace ts { return result || array; } - export function mapDefined(array: ReadonlyArray, mapFn: (x: T, i: number) => U | undefined): U[] { + export function mapDefined(array: ReadonlyArray | undefined, mapFn: (x: T, i: number) => U | undefined): U[] { const result: U[] = []; - for (let i = 0; i < array.length; i++) { - const item = array[i]; - const mapped = mapFn(item, i); - if (mapped !== undefined) { - result.push(mapped); + if (array) { + for (let i = 0; i < array.length; i++) { + const item = array[i]; + const mapped = mapFn(item, i); + if (mapped !== undefined) { + result.push(mapped); + } } } return result; diff --git a/src/compiler/transformers/jsx.ts b/src/compiler/transformers/jsx.ts index d5bf20a525d9e..0d00f4d48a343 100644 --- a/src/compiler/transformers/jsx.ts +++ b/src/compiler/transformers/jsx.ts @@ -114,7 +114,7 @@ namespace ts { compilerOptions.reactNamespace, tagName, objectProperties, - filter(map(children, transformJsxChildToExpression), isDefined), + mapDefined(children, transformJsxChildToExpression), node, location ); diff --git a/src/compiler/utilities.ts b/src/compiler/utilities.ts index cc75edc3f373a..15762292015dc 100644 --- a/src/compiler/utilities.ts +++ b/src/compiler/utilities.ts @@ -27,20 +27,6 @@ namespace ts { return undefined; } - export function findDeclaration(symbol: Symbol, predicate: (node: Declaration) => node is T): T | undefined; - export function findDeclaration(symbol: Symbol, predicate: (node: Declaration) => boolean): Declaration | undefined; - export function findDeclaration(symbol: Symbol, predicate: (node: Declaration) => boolean): Declaration | undefined { - const declarations = symbol.declarations; - if (declarations) { - for (const declaration of declarations) { - if (predicate(declaration)) { - return declaration; - } - } - } - return undefined; - } - export interface StringSymbolWriter extends SymbolWriter { string(): string; } @@ -112,19 +98,16 @@ namespace ts { sourceFile.resolvedTypeReferenceDirectiveNames.set(typeReferenceDirectiveName, resolvedTypeReferenceDirective); } - /* @internal */ export function moduleResolutionIsEqualTo(oldResolution: ResolvedModuleFull, newResolution: ResolvedModuleFull): boolean { return oldResolution.isExternalLibraryImport === newResolution.isExternalLibraryImport && oldResolution.extension === newResolution.extension && oldResolution.resolvedFileName === newResolution.resolvedFileName; } - /* @internal */ export function typeDirectiveIsEqualTo(oldResolution: ResolvedTypeReferenceDirective, newResolution: ResolvedTypeReferenceDirective): boolean { return oldResolution.resolvedFileName === newResolution.resolvedFileName && oldResolution.primary === newResolution.primary; } - /* @internal */ export function hasChangesInResolutions( names: ReadonlyArray, newResolutions: ReadonlyArray, @@ -203,14 +186,6 @@ namespace ts { return `${file.fileName}(${loc.line + 1},${loc.character + 1})`; } - export function getStartPosOfNode(node: Node): number { - return node.pos; - } - - export function isDefined(value: any): boolean { - return value !== undefined; - } - export function getEndLinePosition(line: number, sourceFile: SourceFileLike): number { Debug.assert(line >= 0); const lineStarts = getLineStarts(sourceFile); @@ -463,7 +438,7 @@ namespace ts { return isExternalModule(node) || compilerOptions.isolatedModules; } - export function isBlockScope(node: Node, parentNode: Node) { + function isBlockScope(node: Node, parentNode: Node) { switch (node.kind) { case SyntaxKind.SourceFile: case SyntaxKind.CaseBlock: @@ -664,10 +639,6 @@ namespace ts { return getLeadingCommentRanges(sourceFileOfNode.text, node.pos); } - export function getLeadingCommentRangesOfNodeFromText(node: Node, text: string) { - return getLeadingCommentRanges(text, node.pos); - } - export function getJSDocCommentRanges(node: Node, text: string) { const commentRanges = (node.kind === SyntaxKind.Parameter || node.kind === SyntaxKind.TypeParameter || @@ -675,7 +646,7 @@ namespace ts { node.kind === SyntaxKind.ArrowFunction || node.kind === SyntaxKind.ParenthesizedExpression) ? concatenate(getTrailingCommentRanges(text, node.pos), getLeadingCommentRanges(text, node.pos)) : - getLeadingCommentRangesOfNodeFromText(node, text); + getLeadingCommentRanges(text, node.pos); // True if the comment starts with '/**' but not if it is '/**/' return filter(commentRanges, comment => text.charCodeAt(comment.pos + 1) === CharacterCodes.asterisk && @@ -683,10 +654,10 @@ namespace ts { text.charCodeAt(comment.pos + 3) !== CharacterCodes.slash); } - export let fullTripleSlashReferencePathRegEx = /^(\/\/\/\s*/; - export let fullTripleSlashReferenceTypeReferenceDirectiveRegEx = /^(\/\/\/\s*/; - export let fullTripleSlashAMDReferencePathRegEx = /^(\/\/\/\s*/; - export let defaultLibReferenceRegEx = /^(\/\/\/\s*/; + export const fullTripleSlashReferencePathRegEx = /^(\/\/\/\s*/; + const fullTripleSlashReferenceTypeReferenceDirectiveRegEx = /^(\/\/\/\s*/; + export const fullTripleSlashAMDReferencePathRegEx = /^(\/\/\/\s*/; + const defaultLibReferenceRegEx = /^(\/\/\/\s*/; export function isPartOfTypeNode(node: Node): boolean { if (SyntaxKind.FirstTypeNode <= node.kind && node.kind <= SyntaxKind.LastTypeNode) { @@ -2095,10 +2066,6 @@ namespace ts { return getParseTreeNode(sourceFile, isSourceFile) || sourceFile; } - export function getOriginalSourceFiles(sourceFiles: ReadonlyArray) { - return sameMap(sourceFiles, getOriginalSourceFile); - } - export const enum Associativity { Left, Right @@ -3090,24 +3057,6 @@ namespace ts { return false; } - // Returns false if this heritage clause element's expression contains something unsupported - // (i.e. not a name or dotted name). - export function isSupportedExpressionWithTypeArguments(node: ExpressionWithTypeArguments): boolean { - return isSupportedExpressionWithTypeArgumentsRest(node.expression); - } - - function isSupportedExpressionWithTypeArgumentsRest(node: Expression): boolean { - if (node.kind === SyntaxKind.Identifier) { - return true; - } - else if (isPropertyAccessExpression(node)) { - return isSupportedExpressionWithTypeArgumentsRest(node.expression); - } - else { - return false; - } - } - export function isExpressionWithTypeArgumentsInClassExtendsClause(node: Node): boolean { return tryGetClassExtendingExpressionWithTypeArguments(node) !== undefined; } @@ -3244,81 +3193,6 @@ namespace ts { return carriageReturnLineFeed; } - /** - * Tests whether a node and its subtree is simple enough to have its position - * information ignored when emitting source maps in a destructuring assignment. - * - * @param node The expression to test. - */ - export function isSimpleExpression(node: Expression): boolean { - return isSimpleExpressionWorker(node, 0); - } - - function isSimpleExpressionWorker(node: Expression, depth: number): boolean { - if (depth <= 5) { - const kind = node.kind; - if (kind === SyntaxKind.StringLiteral - || kind === SyntaxKind.NumericLiteral - || kind === SyntaxKind.RegularExpressionLiteral - || kind === SyntaxKind.NoSubstitutionTemplateLiteral - || kind === SyntaxKind.Identifier - || kind === SyntaxKind.ThisKeyword - || kind === SyntaxKind.SuperKeyword - || kind === SyntaxKind.TrueKeyword - || kind === SyntaxKind.FalseKeyword - || kind === SyntaxKind.NullKeyword) { - return true; - } - else if (kind === SyntaxKind.PropertyAccessExpression) { - return isSimpleExpressionWorker((node).expression, depth + 1); - } - else if (kind === SyntaxKind.ElementAccessExpression) { - return isSimpleExpressionWorker((node).expression, depth + 1) - && isSimpleExpressionWorker((node).argumentExpression, depth + 1); - } - else if (kind === SyntaxKind.PrefixUnaryExpression - || kind === SyntaxKind.PostfixUnaryExpression) { - return isSimpleExpressionWorker((node).operand, depth + 1); - } - else if (kind === SyntaxKind.BinaryExpression) { - return (node).operatorToken.kind !== SyntaxKind.AsteriskAsteriskToken - && isSimpleExpressionWorker((node).left, depth + 1) - && isSimpleExpressionWorker((node).right, depth + 1); - } - else if (kind === SyntaxKind.ConditionalExpression) { - return isSimpleExpressionWorker((node).condition, depth + 1) - && isSimpleExpressionWorker((node).whenTrue, depth + 1) - && isSimpleExpressionWorker((node).whenFalse, depth + 1); - } - else if (kind === SyntaxKind.VoidExpression - || kind === SyntaxKind.TypeOfExpression - || kind === SyntaxKind.DeleteExpression) { - return isSimpleExpressionWorker((node).expression, depth + 1); - } - else if (kind === SyntaxKind.ArrayLiteralExpression) { - return (node).elements.length === 0; - } - else if (kind === SyntaxKind.ObjectLiteralExpression) { - return (node).properties.length === 0; - } - else if (kind === SyntaxKind.CallExpression) { - if (!isSimpleExpressionWorker((node).expression, depth + 1)) { - return false; - } - - for (const argument of (node).arguments) { - if (!isSimpleExpressionWorker(argument, depth + 1)) { - return false; - } - } - - return true; - } - } - - return false; - } - /** * Formats an enum value as a string for debugging and debug assertions. */ @@ -3391,24 +3265,6 @@ namespace ts { return formatEnum(flags, (ts).ObjectFlags, /*isFlags*/ true); } - export function getRangePos(range: TextRange | undefined) { - return range ? range.pos : -1; - } - - export function getRangeEnd(range: TextRange | undefined) { - return range ? range.end : -1; - } - - /** - * Increases (or decreases) a position by the provided amount. - * - * @param pos The position. - * @param value The delta. - */ - export function movePos(pos: number, value: number) { - return positionIsSynthesized(pos) ? -1 : pos + value; - } - /** * Creates a new TextRange from the provided pos and end. * @@ -3466,26 +3322,6 @@ namespace ts { return range.pos === range.end; } - /** - * Creates a new TextRange from a provided range with its end position collapsed to its - * start position. - * - * @param range A TextRange. - */ - export function collapseRangeToStart(range: TextRange): TextRange { - return isCollapsedRange(range) ? range : moveRangeEnd(range, range.pos); - } - - /** - * Creates a new TextRange from a provided range with its start position collapsed to its - * end position. - * - * @param range A TextRange. - */ - export function collapseRangeToEnd(range: TextRange): TextRange { - return isCollapsedRange(range) ? range : moveRangePos(range, range.end); - } - /** * Creates a new TextRange for a token at the provides start position. * @@ -3549,31 +3385,6 @@ namespace ts { return node.initializer !== undefined; } - /** - * Gets a value indicating whether a node is merged with a class declaration in the same scope. - */ - export function isMergedWithClass(node: Node) { - if (node.symbol) { - for (const declaration of node.symbol.declarations) { - if (declaration.kind === SyntaxKind.ClassDeclaration && declaration !== node) { - return true; - } - } - } - - return false; - } - - /** - * Gets a value indicating whether a node is the first declaration of its kind. - * - * @param node A Declaration node. - * @param kind The SyntaxKind to find among related declarations. - */ - export function isFirstDeclarationOfKind(node: Node, kind: SyntaxKind) { - return node.symbol && getDeclarationOfKind(node.symbol, kind) === node; - } - export function isWatchSet(options: CompilerOptions) { // Firefox has Object.prototype.watch return options.watch && options.hasOwnProperty("watch"); diff --git a/src/services/symbolDisplay.ts b/src/services/symbolDisplay.ts index 0cb3916c9c5b9..303bb8395eee6 100644 --- a/src/services/symbolDisplay.ts +++ b/src/services/symbolDisplay.ts @@ -203,7 +203,7 @@ namespace ts.SymbolDisplay { // get the signature from the declaration and write it const functionDeclaration = location.parent; // Use function declaration to write the signatures only if the symbol corresponding to this declaration - const locationIsSymbolDeclaration = findDeclaration(symbol, declaration => + const locationIsSymbolDeclaration = find(symbol.declarations, declaration => declaration === (location.kind === SyntaxKind.ConstructorKeyword ? functionDeclaration.parent : functionDeclaration)); if (locationIsSymbolDeclaration) { From 37b20ee670e9a89307b0e69960a2cbce104f93e5 Mon Sep 17 00:00:00 2001 From: Andy Date: Wed, 9 Aug 2017 14:39:06 -0700 Subject: [PATCH 086/237] For duplicate source files of the same package, make one redirect to the other (#16274) * For duplicate source files of the same package, make one redirect to the other * Add reuseProgramStructure tests * Copy `sourceFileToPackageId` and `isSourceFileTargetOfRedirect` only if we completely reuse old structure * Use fallthrough instead of early exit from loop * Use a set to efficiently detect duplicate package names * Move map setting outside of createRedirectSourceFile * Correctly handle seenPackageNames set * sourceFileToPackageId -> sourceFileToPackageName * Renames * Respond to PR comments * Fix bug where `oldSourceFile !== newSourceFile` because oldSourceFile was a redirect * Clean up redirectInfo * Respond to PR comments --- src/compiler/core.ts | 15 +- src/compiler/moduleNameResolver.ts | 110 ++++++++---- src/compiler/program.ts | 104 +++++++++++- src/compiler/types.ts | 40 +++++ src/compiler/utilities.ts | 7 +- src/harness/fourslash.ts | 41 ++--- src/harness/harnessLanguageService.ts | 4 +- .../unittests/reuseProgramStructure.ts | 158 ++++++++++++++---- .../reference/duplicatePackage.errors.txt | 48 ++++++ tests/baselines/reference/duplicatePackage.js | 52 ++++++ .../duplicatePackage_withErrors.errors.txt | 27 +++ .../reference/duplicatePackage_withErrors.js | 28 ++++ tests/cases/compiler/duplicatePackage.ts | 42 +++++ .../compiler/duplicatePackage_withErrors.ts | 23 +++ .../fourslash/duplicatePackageServices.ts | 46 +++++ .../duplicatePackageServices_fileChanges.ts | 57 +++++++ 16 files changed, 696 insertions(+), 106 deletions(-) create mode 100644 tests/baselines/reference/duplicatePackage.errors.txt create mode 100644 tests/baselines/reference/duplicatePackage.js create mode 100644 tests/baselines/reference/duplicatePackage_withErrors.errors.txt create mode 100644 tests/baselines/reference/duplicatePackage_withErrors.js create mode 100644 tests/cases/compiler/duplicatePackage.ts create mode 100644 tests/cases/compiler/duplicatePackage_withErrors.ts create mode 100644 tests/cases/fourslash/duplicatePackageServices.ts create mode 100644 tests/cases/fourslash/duplicatePackageServices_fileChanges.ts diff --git a/src/compiler/core.ts b/src/compiler/core.ts index 688ae52a3ec4b..85514987b3b03 100644 --- a/src/compiler/core.ts +++ b/src/compiler/core.ts @@ -2210,20 +2210,14 @@ namespace ts { /** Must have ".d.ts" first because if ".ts" goes first, that will be detected as the extension instead of ".d.ts". */ export const supportedTypescriptExtensionsForExtractExtension: ReadonlyArray = [Extension.Dts, Extension.Ts, Extension.Tsx]; export const supportedJavascriptExtensions: ReadonlyArray = [Extension.Js, Extension.Jsx]; - const allSupportedExtensions = [...supportedTypeScriptExtensions, ...supportedJavascriptExtensions]; + const allSupportedExtensions: ReadonlyArray = [...supportedTypeScriptExtensions, ...supportedJavascriptExtensions]; export function getSupportedExtensions(options?: CompilerOptions, extraFileExtensions?: ReadonlyArray): ReadonlyArray { const needAllExtensions = options && options.allowJs; if (!extraFileExtensions || extraFileExtensions.length === 0 || !needAllExtensions) { return needAllExtensions ? allSupportedExtensions : supportedTypeScriptExtensions; } - const extensions: string[] = allSupportedExtensions.slice(0); - for (const extInfo of extraFileExtensions) { - if (extensions.indexOf(extInfo.extension) === -1) { - extensions.push(extInfo.extension); - } - } - return extensions; + return deduplicate([...allSupportedExtensions, ...extraFileExtensions.map(e => e.extension)]); } export function hasJavaScriptFileExtension(fileName: string) { @@ -2590,6 +2584,11 @@ namespace ts { } Debug.fail(`File ${path} has unknown extension.`); } + + export function isAnySupportedFileExtension(path: string): boolean { + return tryGetExtensionFromPath(path) !== undefined; + } + export function tryGetExtensionFromPath(path: string): Extension | undefined { return find(supportedTypescriptExtensionsForExtractExtension, e => fileExtensionIs(path, e)) || find(supportedJavascriptExtensions, e => fileExtensionIs(path, e)); } diff --git a/src/compiler/moduleNameResolver.ts b/src/compiler/moduleNameResolver.ts index be867db974363..2b3974e5287f9 100644 --- a/src/compiler/moduleNameResolver.ts +++ b/src/compiler/moduleNameResolver.ts @@ -13,13 +13,32 @@ namespace ts { return compilerOptions.traceResolution && host.trace !== undefined; } - /** - * Result of trying to resolve a module. - * At least one of `ts` and `js` should be defined, or the whole thing should be `undefined`. - */ + /** Array that is only intended to be pushed to, never read. */ + /* @internal */ + export interface Push { + push(value: T): void; + } + + function withPackageId(packageId: PackageId | undefined, r: PathAndExtension | undefined): Resolved { + return r && { path: r.path, extension: r.ext, packageId }; + } + + function noPackageId(r: PathAndExtension | undefined): Resolved { + return withPackageId(/*packageId*/ undefined, r); + } + + /** Result of trying to resolve a module. */ interface Resolved { path: string; extension: Extension; + packageId: PackageId | undefined; + } + + /** Result of trying to resolve a module at a file. Needs to have 'packageId' added later. */ + interface PathAndExtension { + path: string; + // (Use a different name than `extension` to make sure Resolved isn't assignable to PathAndExtension.) + ext: Extension; } /** @@ -43,7 +62,7 @@ namespace ts { function createResolvedModuleWithFailedLookupLocations(resolved: Resolved | undefined, isExternalLibraryImport: boolean, failedLookupLocations: string[]): ResolvedModuleWithFailedLookupLocations { return { - resolvedModule: resolved && { resolvedFileName: resolved.path, extension: resolved.extension, isExternalLibraryImport }, + resolvedModule: resolved && { resolvedFileName: resolved.path, extension: resolved.extension, isExternalLibraryImport, packageId: resolved.packageId }, failedLookupLocations }; } @@ -54,9 +73,16 @@ namespace ts { traceEnabled: boolean; } + interface PackageJson { + name?: string; + version?: string; + typings?: string; + types?: string; + main?: string; + } + /** Reads from "main" or "types"/"typings" depending on `extensions`. */ - function tryReadPackageJsonFields(readTypes: boolean, packageJsonPath: string, baseDirectory: string, state: ModuleResolutionState): string | undefined { - const jsonContent = readJson(packageJsonPath, state.host); + function tryReadPackageJsonFields(readTypes: boolean, jsonContent: PackageJson, baseDirectory: string, state: ModuleResolutionState): string | undefined { return readTypes ? tryReadFromField("typings") || tryReadFromField("types") : tryReadFromField("main"); function tryReadFromField(fieldName: "typings" | "types" | "main"): string | undefined { @@ -83,7 +109,7 @@ namespace ts { } } - function readJson(path: string, host: ModuleResolutionHost): { typings?: string, types?: string, main?: string } { + function readJson(path: string, host: ModuleResolutionHost): PackageJson { try { const jsonText = host.readFile(path); return jsonText ? JSON.parse(jsonText) : {}; @@ -646,7 +672,7 @@ namespace ts { if (extension !== undefined) { const path = tryFile(candidate, failedLookupLocations, /*onlyRecordFailures*/ false, state); if (path !== undefined) { - return { path, extension }; + return { path, extension, packageId: undefined }; } } @@ -709,7 +735,7 @@ namespace ts { } const resolved = loadModuleFromNodeModules(extensions, moduleName, containingDirectory, failedLookupLocations, state, cache); // For node_modules lookups, get the real path so that multiple accesses to an `npm link`-ed module do not create duplicate files. - return resolved && { value: resolved.value && { resolved: { path: realpath(resolved.value.path, host, traceEnabled), extension: resolved.value.extension }, isExternalLibraryImport: true } }; + return resolved && { value: resolved.value && { resolved: { ...resolved.value, path: realpath(resolved.value.path, host, traceEnabled) }, isExternalLibraryImport: true } }; } else { const candidate = normalizePath(combinePaths(containingDirectory, moduleName)); @@ -747,7 +773,7 @@ namespace ts { } const resolvedFromFile = loadModuleFromFile(extensions, candidate, failedLookupLocations, onlyRecordFailures, state); if (resolvedFromFile) { - return resolvedFromFile; + return noPackageId(resolvedFromFile); } } if (!onlyRecordFailures) { @@ -768,11 +794,15 @@ namespace ts { return !host.directoryExists || host.directoryExists(directoryName); } + function loadModuleFromFileNoPackageId(extensions: Extensions, candidate: string, failedLookupLocations: Push, onlyRecordFailures: boolean, state: ModuleResolutionState): Resolved { + return noPackageId(loadModuleFromFile(extensions, candidate, failedLookupLocations, onlyRecordFailures, state)); + } + /** * @param {boolean} onlyRecordFailures - if true then function won't try to actually load files but instead record all attempts as failures. This flag is necessary * in cases when we know upfront that all load attempts will fail (because containing folder does not exists) however we still need to record all failed lookup locations. */ - function loadModuleFromFile(extensions: Extensions, candidate: string, failedLookupLocations: Push, onlyRecordFailures: boolean, state: ModuleResolutionState): Resolved | undefined { + function loadModuleFromFile(extensions: Extensions, candidate: string, failedLookupLocations: Push, onlyRecordFailures: boolean, state: ModuleResolutionState): PathAndExtension | undefined { // First, try adding an extension. An import of "foo" could be matched by a file "foo.ts", or "foo.js" by "foo.js.ts" const resolvedByAddingExtension = tryAddingExtensions(candidate, extensions, failedLookupLocations, onlyRecordFailures, state); if (resolvedByAddingExtension) { @@ -792,7 +822,7 @@ namespace ts { } /** Try to return an existing file that adds one of the `extensions` to `candidate`. */ - function tryAddingExtensions(candidate: string, extensions: Extensions, failedLookupLocations: Push, onlyRecordFailures: boolean, state: ModuleResolutionState): Resolved | undefined { + function tryAddingExtensions(candidate: string, extensions: Extensions, failedLookupLocations: Push, onlyRecordFailures: boolean, state: ModuleResolutionState): PathAndExtension | undefined { if (!onlyRecordFailures) { // check if containing folder exists - if it doesn't then just record failures for all supported extensions without disk probing const directory = getDirectoryPath(candidate); @@ -810,9 +840,9 @@ namespace ts { return tryExtension(Extension.Js) || tryExtension(Extension.Jsx); } - function tryExtension(extension: Extension): Resolved | undefined { - const path = tryFile(candidate + extension, failedLookupLocations, onlyRecordFailures, state); - return path && { path, extension }; + function tryExtension(ext: Extension): PathAndExtension | undefined { + const path = tryFile(candidate + ext, failedLookupLocations, onlyRecordFailures, state); + return path && { path, ext }; } } @@ -838,12 +868,23 @@ namespace ts { function loadNodeModuleFromDirectory(extensions: Extensions, candidate: string, failedLookupLocations: Push, onlyRecordFailures: boolean, state: ModuleResolutionState, considerPackageJson = true): Resolved | undefined { const directoryExists = !onlyRecordFailures && directoryProbablyExists(candidate, state.host); + let packageId: PackageId | undefined; + if (considerPackageJson) { const packageJsonPath = pathToPackageJson(candidate); if (directoryExists && state.host.fileExists(packageJsonPath)) { - const fromPackageJson = loadModuleFromPackageJson(packageJsonPath, extensions, candidate, failedLookupLocations, state); + if (state.traceEnabled) { + trace(state.host, Diagnostics.Found_package_json_at_0, packageJsonPath); + } + const jsonContent = readJson(packageJsonPath, state.host); + + if (typeof jsonContent.name === "string" && typeof jsonContent.version === "string") { + packageId = { name: jsonContent.name, version: jsonContent.version }; + } + + const fromPackageJson = loadModuleFromPackageJson(jsonContent, extensions, candidate, failedLookupLocations, state); if (fromPackageJson) { - return fromPackageJson; + return withPackageId(packageId, fromPackageJson); } } else { @@ -855,15 +896,11 @@ namespace ts { } } - return loadModuleFromFile(extensions, combinePaths(candidate, "index"), failedLookupLocations, !directoryExists, state); + return withPackageId(packageId, loadModuleFromFile(extensions, combinePaths(candidate, "index"), failedLookupLocations, !directoryExists, state)); } - function loadModuleFromPackageJson(packageJsonPath: string, extensions: Extensions, candidate: string, failedLookupLocations: Push, state: ModuleResolutionState): Resolved | undefined { - if (state.traceEnabled) { - trace(state.host, Diagnostics.Found_package_json_at_0, packageJsonPath); - } - - const file = tryReadPackageJsonFields(extensions !== Extensions.JavaScript, packageJsonPath, candidate, state); + function loadModuleFromPackageJson(jsonContent: PackageJson, extensions: Extensions, candidate: string, failedLookupLocations: Push, state: ModuleResolutionState): PathAndExtension | undefined { + const file = tryReadPackageJsonFields(extensions !== Extensions.JavaScript, jsonContent, candidate, state); if (!file) { return undefined; } @@ -883,13 +920,18 @@ namespace ts { // Even if extensions is DtsOnly, we can still look up a .ts file as a result of package.json "types" const nextExtensions = extensions === Extensions.DtsOnly ? Extensions.TypeScript : extensions; // Don't do package.json lookup recursively, because Node.js' package lookup doesn't. - return nodeLoadModuleByRelativeName(nextExtensions, file, failedLookupLocations, onlyRecordFailures, state, /*considerPackageJson*/ false); + const result = nodeLoadModuleByRelativeName(nextExtensions, file, failedLookupLocations, onlyRecordFailures, state, /*considerPackageJson*/ false); + if (result) { + // It won't have a `packageId` set, because we disabled `considerPackageJson`. + Debug.assert(result.packageId === undefined); + return { path: result.path, ext: result.extension }; + } } /** Resolve from an arbitrarily specified file. Return `undefined` if it has an unsupported extension. */ - function resolvedIfExtensionMatches(extensions: Extensions, path: string): Resolved | undefined { - const extension = tryGetExtensionFromPath(path); - return extension !== undefined && extensionIsOk(extensions, extension) ? { path, extension } : undefined; + function resolvedIfExtensionMatches(extensions: Extensions, path: string): PathAndExtension | undefined { + const ext = tryGetExtensionFromPath(path); + return ext !== undefined && extensionIsOk(extensions, ext) ? { path, ext } : undefined; } /** True if `extension` is one of the supported `extensions`. */ @@ -911,7 +953,7 @@ namespace ts { function loadModuleFromNodeModulesFolder(extensions: Extensions, moduleName: string, nodeModulesFolder: string, nodeModulesFolderExists: boolean, failedLookupLocations: Push, state: ModuleResolutionState): Resolved | undefined { const candidate = normalizePath(combinePaths(nodeModulesFolder, moduleName)); - return loadModuleFromFile(extensions, candidate, failedLookupLocations, !nodeModulesFolderExists, state) || + return loadModuleFromFileNoPackageId(extensions, candidate, failedLookupLocations, !nodeModulesFolderExists, state) || loadNodeModuleFromDirectory(extensions, candidate, failedLookupLocations, !nodeModulesFolderExists, state); } @@ -996,7 +1038,7 @@ namespace ts { if (traceEnabled) { trace(host, Diagnostics.Resolution_for_module_0_was_found_in_cache, moduleName); } - return { value: result.resolvedModule && { path: result.resolvedModule.resolvedFileName, extension: result.resolvedModule.extension } }; + return { value: result.resolvedModule && { path: result.resolvedModule.resolvedFileName, extension: result.resolvedModule.extension, packageId: result.resolvedModule.packageId } }; } } @@ -1010,7 +1052,7 @@ namespace ts { return createResolvedModuleWithFailedLookupLocations(resolved && resolved.value, /*isExternalLibraryImport*/ false, failedLookupLocations); function tryResolve(extensions: Extensions): SearchResult { - const resolvedUsingSettings = tryLoadModuleUsingOptionalResolutionSettings(extensions, moduleName, containingDirectory, loadModuleFromFile, failedLookupLocations, state); + const resolvedUsingSettings = tryLoadModuleUsingOptionalResolutionSettings(extensions, moduleName, containingDirectory, loadModuleFromFileNoPackageId, failedLookupLocations, state); if (resolvedUsingSettings) { return { value: resolvedUsingSettings }; } @@ -1024,7 +1066,7 @@ namespace ts { return resolutionFromCache; } const searchName = normalizePath(combinePaths(directory, moduleName)); - return toSearchResult(loadModuleFromFile(extensions, searchName, failedLookupLocations, /*onlyRecordFailures*/ false, state)); + return toSearchResult(loadModuleFromFileNoPackageId(extensions, searchName, failedLookupLocations, /*onlyRecordFailures*/ false, state)); }); if (resolved) { return resolved; @@ -1036,7 +1078,7 @@ namespace ts { } else { const candidate = normalizePath(combinePaths(containingDirectory, moduleName)); - return toSearchResult(loadModuleFromFile(extensions, candidate, failedLookupLocations, /*onlyRecordFailures*/ false, state)); + return toSearchResult(loadModuleFromFileNoPackageId(extensions, candidate, failedLookupLocations, /*onlyRecordFailures*/ false, state)); } } } diff --git a/src/compiler/program.ts b/src/compiler/program.ts index 64e8eb0c80392..305058285f999 100644 --- a/src/compiler/program.ts +++ b/src/compiler/program.ts @@ -472,6 +472,15 @@ namespace ts { resolveTypeReferenceDirectiveNamesWorker = (typeReferenceDirectiveNames, containingFile) => loadWithLocalCache(checkAllDefined(typeReferenceDirectiveNames), containingFile, loader); } + // Map from a stringified PackageId to the source file with that id. + // Only one source file may have a given packageId. Others become redirects (see createRedirectSourceFile). + // `packageIdToSourceFile` is only used while building the program, while `sourceFileToPackageName` and `isSourceFileTargetOfRedirect` are kept around. + const packageIdToSourceFile = createMap(); + // Maps from a SourceFile's `.path` to the name of the package it was imported with. + let sourceFileToPackageName = createMap(); + // See `sourceFileIsRedirectedTo`. + let redirectTargetsSet = createMap(); + const filesByName = createMap(); // stores 'filename -> file association' ignoring case // used to track cases when two file names differ only in casing @@ -548,6 +557,8 @@ namespace ts { isSourceFileFromExternalLibrary, dropDiagnosticsProducingTypeChecker, getSourceFileFromReference, + sourceFileToPackageName, + redirectTargetsSet, }; verifyCompilerOptions(); @@ -773,8 +784,12 @@ namespace ts { const modifiedSourceFiles: { oldFile: SourceFile, newFile: SourceFile }[] = []; oldProgram.structureIsReused = StructureIsReused.Completely; - for (const oldSourceFile of oldProgram.getSourceFiles()) { - const newSourceFile = host.getSourceFileByPath + const oldSourceFiles = oldProgram.getSourceFiles(); + const enum SeenPackageName { Exists, Modified } + const seenPackageNames = createMap(); + + for (const oldSourceFile of oldSourceFiles) { + let newSourceFile = host.getSourceFileByPath ? host.getSourceFileByPath(oldSourceFile.fileName, oldSourceFile.path, options.target) : host.getSourceFile(oldSourceFile.fileName, options.target); @@ -782,10 +797,46 @@ namespace ts { return oldProgram.structureIsReused = StructureIsReused.Not; } + Debug.assert(!newSourceFile.redirectInfo, "Host should not return a redirect source file from `getSourceFile`"); + + let fileChanged: boolean; + if (oldSourceFile.redirectInfo) { + // We got `newSourceFile` by path, so it is actually for the unredirected file. + // This lets us know if the unredirected file has changed. If it has we should break the redirect. + if (newSourceFile !== oldSourceFile.redirectInfo.unredirected) { + // Underlying file has changed. Might not redirect anymore. Must rebuild program. + return oldProgram.structureIsReused = StructureIsReused.Not; + } + fileChanged = false; + newSourceFile = oldSourceFile; // Use the redirect. + } + else if (oldProgram.redirectTargetsSet.has(oldSourceFile.path)) { + // If a redirected-to source file changes, the redirect may be broken. + if (newSourceFile !== oldSourceFile) { + return oldProgram.structureIsReused = StructureIsReused.Not; + } + fileChanged = false; + } + else { + fileChanged = newSourceFile !== oldSourceFile; + } + newSourceFile.path = oldSourceFile.path; filePaths.push(newSourceFile.path); - if (oldSourceFile !== newSourceFile) { + const packageName = oldProgram.sourceFileToPackageName.get(oldSourceFile.path); + if (packageName !== undefined) { + // If there are 2 different source files for the same package name and at least one of them changes, + // they might become redirects. So we must rebuild the program. + const prevKind = seenPackageNames.get(packageName); + const newKind = fileChanged ? SeenPackageName.Modified : SeenPackageName.Exists; + if ((prevKind !== undefined && newKind === SeenPackageName.Modified) || prevKind === SeenPackageName.Modified) { + return oldProgram.structureIsReused = StructureIsReused.Not; + } + seenPackageNames.set(packageName, newKind); + } + + if (fileChanged) { // The `newSourceFile` object was created for the new program. if (oldSourceFile.hasNoDefaultLib !== newSourceFile.hasNoDefaultLib) { @@ -897,6 +948,9 @@ namespace ts { } resolvedTypeReferenceDirectives = oldProgram.getResolvedTypeReferenceDirectives(); + sourceFileToPackageName = oldProgram.sourceFileToPackageName; + redirectTargetsSet = oldProgram.redirectTargetsSet; + return oldProgram.structureIsReused = StructureIsReused.Completely; } @@ -1537,7 +1591,7 @@ namespace ts { /** This has side effects through `findSourceFile`. */ function processSourceFile(fileName: string, isDefaultLib: boolean, refFile?: SourceFile, refPos?: number, refEnd?: number): void { getSourceFileFromReferenceWorker(fileName, - fileName => findSourceFile(fileName, toPath(fileName), isDefaultLib, refFile, refPos, refEnd), + fileName => findSourceFile(fileName, toPath(fileName), isDefaultLib, refFile, refPos, refEnd, /*packageId*/ undefined), (diagnostic, ...args) => { fileProcessingDiagnostics.add(refFile !== undefined && refEnd !== undefined && refPos !== undefined ? createFileDiagnostic(refFile, refPos, refEnd - refPos, diagnostic, ...args) @@ -1556,8 +1610,26 @@ namespace ts { } } + function createRedirectSourceFile(redirectTarget: SourceFile, unredirected: SourceFile, fileName: string, path: Path): SourceFile { + const redirect: SourceFile = Object.create(redirectTarget); + redirect.fileName = fileName; + redirect.path = path; + redirect.redirectInfo = { redirectTarget, unredirected }; + Object.defineProperties(redirect, { + id: { + get(this: SourceFile) { return this.redirectInfo.redirectTarget.id; }, + set(this: SourceFile, value: SourceFile["id"]) { this.redirectInfo.redirectTarget.id = value; }, + }, + symbol: { + get(this: SourceFile) { return this.redirectInfo.redirectTarget.symbol; }, + set(this: SourceFile, value: SourceFile["symbol"]) { this.redirectInfo.redirectTarget.symbol = value; }, + }, + }); + return redirect; + } + // Get source file from normalized fileName - function findSourceFile(fileName: string, path: Path, isDefaultLib: boolean, refFile?: SourceFile, refPos?: number, refEnd?: number): SourceFile { + function findSourceFile(fileName: string, path: Path, isDefaultLib: boolean, refFile: SourceFile, refPos: number, refEnd: number, packageId: PackageId | undefined): SourceFile | undefined { if (filesByName.has(path)) { const file = filesByName.get(path); // try to check if we've already seen this file but with a different casing in path @@ -1600,6 +1672,26 @@ namespace ts { } }); + if (packageId) { + const packageIdKey = `${packageId.name}@${packageId.version}`; + const fileFromPackageId = packageIdToSourceFile.get(packageIdKey); + if (fileFromPackageId) { + // Some other SourceFile already exists with this package name and version. + // Instead of creating a duplicate, just redirect to the existing one. + const dupFile = createRedirectSourceFile(fileFromPackageId, file, fileName, path); + redirectTargetsSet.set(fileFromPackageId.path, true); + filesByName.set(path, dupFile); + sourceFileToPackageName.set(path, packageId.name); + files.push(dupFile); + return dupFile; + } + else if (file) { + // This is the first source file to have this packageId. + packageIdToSourceFile.set(packageIdKey, file); + sourceFileToPackageName.set(path, packageId.name); + } + } + filesByName.set(path, file); if (file) { sourceFilesFoundSearchingNodeModules.set(path, currentNodeModulesDepth > 0); @@ -1762,7 +1854,7 @@ namespace ts { else if (shouldAddFile) { const path = toPath(resolvedFileName); const pos = skipTrivia(file.text, file.imports[i].pos); - findSourceFile(resolvedFileName, path, /*isDefaultLib*/ false, file, pos, file.imports[i].end); + findSourceFile(resolvedFileName, path, /*isDefaultLib*/ false, file, pos, file.imports[i].end, resolution.packageId); } if (isFromNodeModulesSearch) { diff --git a/src/compiler/types.ts b/src/compiler/types.ts index 27dcbda309ffd..76c0b640f4570 100644 --- a/src/compiler/types.ts +++ b/src/compiler/types.ts @@ -2255,6 +2255,17 @@ namespace ts { } + /* @internal */ + export interface RedirectInfo { + /** Source file this redirects to. */ + readonly redirectTarget: SourceFile; + /** + * Source file for the duplicate package. This will not be used by the Program, + * but we need to keep this around so we can watch for changes in underlying. + */ + readonly unredirected: SourceFile; + } + // Source files are declarations when they are external modules. export interface SourceFile extends Declaration { kind: SyntaxKind.SourceFile; @@ -2265,6 +2276,13 @@ namespace ts { /* @internal */ path: Path; text: string; + /** + * If two source files are for the same version of the same package, one will redirect to the other. + * (See `createRedirectSourceFile` in program.ts.) + * The redirect will have this set. The other will not have anything set, but see Program#sourceFileIsRedirectedTo. + */ + /* @internal */ redirectInfo?: RedirectInfo | undefined; + amdDependencies: AmdDependency[]; moduleName: string; referencedFiles: FileReference[]; @@ -2435,6 +2453,11 @@ namespace ts { /* @internal */ structureIsReused?: StructureIsReused; /* @internal */ getSourceFileFromReference(referencingFile: SourceFile, ref: FileReference): SourceFile | undefined; + + /** Given a source file, get the name of the package it was imported from. */ + /* @internal */ sourceFileToPackageName: Map; + /** Set of all source files that some other source file redirects to. */ + /* @internal */ redirectTargetsSet: Map; } /* @internal */ @@ -3925,6 +3948,7 @@ namespace ts { /** * ResolvedModule with an explicitly provided `extension` property. * Prefer this over `ResolvedModule`. + * If changing this, remember to change `moduleResolutionIsEqualTo`. */ export interface ResolvedModuleFull extends ResolvedModule { /** @@ -3932,6 +3956,22 @@ namespace ts { * This is optional for backwards-compatibility, but will be added if not provided. */ extension: Extension; + packageId?: PackageId; + } + + /** + * Unique identifier with a package name and version. + * If changing this, remember to change `packageIdIsEqual`. + */ + export interface PackageId { + /** + * Name of the package. + * Should not include `@types`. + * If accessing a non-index file, this should include its name e.g. "foo/bar". + */ + name: string; + /** Version of the package, e.g. "1.2.3" */ + version: string; } export const enum Extension { diff --git a/src/compiler/utilities.ts b/src/compiler/utilities.ts index 15762292015dc..769b2ce3a93de 100644 --- a/src/compiler/utilities.ts +++ b/src/compiler/utilities.ts @@ -101,7 +101,12 @@ namespace ts { export function moduleResolutionIsEqualTo(oldResolution: ResolvedModuleFull, newResolution: ResolvedModuleFull): boolean { return oldResolution.isExternalLibraryImport === newResolution.isExternalLibraryImport && oldResolution.extension === newResolution.extension && - oldResolution.resolvedFileName === newResolution.resolvedFileName; + oldResolution.resolvedFileName === newResolution.resolvedFileName && + packageIdIsEqual(oldResolution.packageId, newResolution.packageId); + } + + function packageIdIsEqual(a: PackageId | undefined, b: PackageId | undefined): boolean { + return a === b || a && b && a.name === b.name && a.version === b.version; } export function typeDirectiveIsEqualTo(oldResolution: ResolvedTypeReferenceDirective, newResolution: ResolvedTypeReferenceDirective): boolean { diff --git a/src/harness/fourslash.ts b/src/harness/fourslash.ts index c6ec0f257b606..5052363c1baa7 100644 --- a/src/harness/fourslash.ts +++ b/src/harness/fourslash.ts @@ -451,7 +451,7 @@ namespace FourSlash { this.languageServiceAdapterHost.openFile(fileToOpen.fileName, content, scriptKindName); } - public verifyErrorExistsBetweenMarkers(startMarkerName: string, endMarkerName: string, negative: boolean) { + public verifyErrorExistsBetweenMarkers(startMarkerName: string, endMarkerName: string, shouldExist: boolean) { const startMarker = this.getMarkerByName(startMarkerName); const endMarker = this.getMarkerByName(endMarkerName); const predicate = (errorMinChar: number, errorLimChar: number, startPos: number, endPos: number) => @@ -459,9 +459,9 @@ namespace FourSlash { const exists = this.anyErrorInRange(predicate, startMarker, endMarker); - if (exists !== negative) { - this.printErrorLog(negative, this.getAllDiagnostics()); - throw new Error(`Failure between markers: '${startMarkerName}', '${endMarkerName}'`); + if (exists !== shouldExist) { + this.printErrorLog(shouldExist, this.getAllDiagnostics()); + throw new Error(`${shouldExist ? "Expected" : "Did not expect"} failure between markers: '${startMarkerName}', '${endMarkerName}'`); } } @@ -483,10 +483,11 @@ namespace FourSlash { } private getAllDiagnostics(): ts.Diagnostic[] { - return ts.flatMap(this.languageServiceAdapterHost.getFilenames(), fileName => this.getDiagnostics(fileName)); + return ts.flatMap(this.languageServiceAdapterHost.getFilenames(), fileName => + ts.isAnySupportedFileExtension(fileName) ? this.getDiagnostics(fileName) : []); } - public verifyErrorExistsAfterMarker(markerName: string, negative: boolean, after: boolean) { + public verifyErrorExistsAfterMarker(markerName: string, shouldExist: boolean, after: boolean) { const marker: Marker = this.getMarkerByName(markerName); let predicate: (errorMinChar: number, errorLimChar: number, startPos: number, endPos: number) => boolean; @@ -502,30 +503,15 @@ namespace FourSlash { const exists = this.anyErrorInRange(predicate, marker); const diagnostics = this.getAllDiagnostics(); - if (exists !== negative) { - this.printErrorLog(negative, diagnostics); - throw new Error("Failure at marker: " + markerName); + if (exists !== shouldExist) { + this.printErrorLog(shouldExist, diagnostics); + throw new Error(`${shouldExist ? "Expected" : "Did not expect"} failure at marker '${markerName}'`); } } - private anyErrorInRange(predicate: (errorMinChar: number, errorLimChar: number, startPos: number, endPos: number) => boolean, startMarker: Marker, endMarker?: Marker) { - - const errors = this.getDiagnostics(startMarker.fileName); - let exists = false; - - const startPos = startMarker.position; - let endPos: number = undefined; - if (endMarker !== undefined) { - endPos = endMarker.position; - } - - errors.forEach(function (error: ts.Diagnostic) { - if (predicate(error.start, error.start + error.length, startPos, endPos)) { - exists = true; - } - }); - - return exists; + private anyErrorInRange(predicate: (errorMinChar: number, errorLimChar: number, startPos: number, endPos: number) => boolean, startMarker: Marker, endMarker?: Marker): boolean { + return this.getDiagnostics(startMarker.fileName).some(({ start, length }) => + predicate(start, start + length, startMarker.position, endMarker === undefined ? undefined : endMarker.position)); } private printErrorLog(expectErrors: boolean, errors: ts.Diagnostic[]) { @@ -550,6 +536,7 @@ namespace FourSlash { public verifyNoErrors() { ts.forEachKey(this.inputFiles, fileName => { + if (!ts.isAnySupportedFileExtension(fileName)) return; const errors = this.getDiagnostics(fileName); if (errors.length) { this.printErrorLog(/*expectErrors*/ false, errors); diff --git a/src/harness/harnessLanguageService.ts b/src/harness/harnessLanguageService.ts index af5a998df99b2..b67468206fbfd 100644 --- a/src/harness/harnessLanguageService.ts +++ b/src/harness/harnessLanguageService.ts @@ -193,7 +193,9 @@ namespace Harness.LanguageService { } getCurrentDirectory(): string { return virtualFileSystemRoot; } getDefaultLibFileName(): string { return Harness.Compiler.defaultLibFileName; } - getScriptFileNames(): string[] { return this.getFilenames(); } + getScriptFileNames(): string[] { + return this.getFilenames().filter(ts.isAnySupportedFileExtension); + } getScriptSnapshot(fileName: string): ts.IScriptSnapshot { const script = this.getScriptInfo(fileName); return script ? new ScriptSnapshot(script) : undefined; diff --git a/src/harness/unittests/reuseProgramStructure.ts b/src/harness/unittests/reuseProgramStructure.ts index de5f5a756d866..5062f4c4b39ee 100644 --- a/src/harness/unittests/reuseProgramStructure.ts +++ b/src/harness/unittests/reuseProgramStructure.ts @@ -109,7 +109,10 @@ namespace ts { function createTestCompilerHost(texts: NamedSourceText[], target: ScriptTarget, oldProgram?: ProgramWithSourceTexts): TestCompilerHost { const files = arrayToMap(texts, t => t.name, t => { if (oldProgram) { - const oldFile = oldProgram.getSourceFile(t.name); + let oldFile = oldProgram.getSourceFile(t.name); + if (oldFile && oldFile.redirectInfo) { + oldFile = oldFile.redirectInfo.unredirected; + } if (oldFile && oldFile.sourceText.getVersion() === t.text.getVersion()) { return oldFile; } @@ -171,11 +174,16 @@ namespace ts { return program; } + function updateProgramText(files: ReadonlyArray, fileName: string, newProgramText: string) { + const file = find(files, f => f.name === fileName)!; + file.text = file.text.updateProgram(newProgramText); + } + function checkResolvedTypeDirective(expected: ResolvedTypeReferenceDirective, actual: ResolvedTypeReferenceDirective): boolean { if (!expected === !actual) { if (expected) { - assert.isTrue(expected.resolvedFileName === actual.resolvedFileName, `'resolvedFileName': expected '${expected.resolvedFileName}' to be equal to '${actual.resolvedFileName}'`); - assert.isTrue(expected.primary === actual.primary, `'primary': expected '${expected.primary}' to be equal to '${actual.primary}'`); + assert.equal(expected.resolvedFileName, actual.resolvedFileName, `'resolvedFileName': expected '${expected.resolvedFileName}' to be equal to '${actual.resolvedFileName}'`); + assert.equal(expected.primary, actual.primary, `'primary': expected '${expected.primary}' to be equal to '${actual.primary}'`); } return true; } @@ -238,7 +246,7 @@ namespace ts { const program_2 = updateProgram(program_1, ["a.ts"], { target }, files => { files[0].text = files[0].text.updateProgram("var x = 100"); }); - assert.isTrue(program_1.structureIsReused === StructureIsReused.Completely); + assert.equal(program_1.structureIsReused, StructureIsReused.Completely); const program1Diagnostics = program_1.getSemanticDiagnostics(program_1.getSourceFile("a.ts")); const program2Diagnostics = program_2.getSemanticDiagnostics(program_1.getSourceFile("a.ts")); assert.equal(program1Diagnostics.length, program2Diagnostics.length); @@ -249,7 +257,7 @@ namespace ts { const program_2 = updateProgram(program_1, ["a.ts"], { target }, files => { files[0].text = files[0].text.updateProgram("var x = 100"); }); - assert.isTrue(program_1.structureIsReused === StructureIsReused.Completely); + assert.equal(program_1.structureIsReused, StructureIsReused.Completely); const program1Diagnostics = program_1.getSemanticDiagnostics(program_1.getSourceFile("a.ts")); const program2Diagnostics = program_2.getSemanticDiagnostics(program_1.getSourceFile("a.ts")); assert.equal(program1Diagnostics.length, program2Diagnostics.length); @@ -263,19 +271,19 @@ namespace ts { `; files[0].text = files[0].text.updateReferences(newReferences); }); - assert.isTrue(program_1.structureIsReused === StructureIsReused.SafeModules); + assert.equal(program_1.structureIsReused, StructureIsReused.SafeModules); }); it("fails if change affects type references", () => { const program_1 = newProgram(files, ["a.ts"], { types: ["a"] }); updateProgram(program_1, ["a.ts"], { types: ["b"] }, noop); - assert.isTrue(program_1.structureIsReused === StructureIsReused.Not); + assert.equal(program_1.structureIsReused, StructureIsReused.Not); }); it("succeeds if change doesn't affect type references", () => { const program_1 = newProgram(files, ["a.ts"], { types: ["a"] }); updateProgram(program_1, ["a.ts"], { types: ["a"] }, noop); - assert.isTrue(program_1.structureIsReused === StructureIsReused.Completely); + assert.equal(program_1.structureIsReused, StructureIsReused.Completely); }); it("fails if change affects imports", () => { @@ -283,7 +291,7 @@ namespace ts { updateProgram(program_1, ["a.ts"], { target }, files => { files[2].text = files[2].text.updateImportsAndExports("import x from 'b'"); }); - assert.isTrue(program_1.structureIsReused === StructureIsReused.SafeModules); + assert.equal(program_1.structureIsReused, StructureIsReused.SafeModules); }); it("fails if change affects type directives", () => { @@ -295,25 +303,25 @@ namespace ts { /// `; files[0].text = files[0].text.updateReferences(newReferences); }); - assert.isTrue(program_1.structureIsReused === StructureIsReused.SafeModules); + assert.equal(program_1.structureIsReused, StructureIsReused.SafeModules); }); it("fails if module kind changes", () => { const program_1 = newProgram(files, ["a.ts"], { target, module: ModuleKind.CommonJS }); updateProgram(program_1, ["a.ts"], { target, module: ModuleKind.AMD }, noop); - assert.isTrue(program_1.structureIsReused === StructureIsReused.Not); + assert.equal(program_1.structureIsReused, StructureIsReused.Not); }); it("fails if rootdir changes", () => { const program_1 = newProgram(files, ["a.ts"], { target, module: ModuleKind.CommonJS, rootDir: "/a/b" }); updateProgram(program_1, ["a.ts"], { target, module: ModuleKind.CommonJS, rootDir: "/a/c" }, noop); - assert.isTrue(program_1.structureIsReused === StructureIsReused.Not); + assert.equal(program_1.structureIsReused, StructureIsReused.Not); }); it("fails if config path changes", () => { const program_1 = newProgram(files, ["a.ts"], { target, module: ModuleKind.CommonJS, configFilePath: "/a/b/tsconfig.json" }); updateProgram(program_1, ["a.ts"], { target, module: ModuleKind.CommonJS, configFilePath: "/a/c/tsconfig.json" }, noop); - assert.isTrue(program_1.structureIsReused === StructureIsReused.Not); + assert.equal(program_1.structureIsReused, StructureIsReused.Not); }); it("succeeds if missing files remain missing", () => { @@ -357,7 +365,7 @@ namespace ts { const program_2 = updateProgram(program_1, ["a.ts"], options, files => { files[0].text = files[0].text.updateProgram("var x = 2"); }); - assert.isTrue(program_1.structureIsReused === StructureIsReused.Completely); + assert.equal(program_1.structureIsReused, StructureIsReused.Completely); // content of resolution cache should not change checkResolvedModulesCache(program_1, "a.ts", createMapFromTemplate({ "b": createResolvedModule("b.ts") })); @@ -367,7 +375,7 @@ namespace ts { const program_3 = updateProgram(program_2, ["a.ts"], options, files => { files[0].text = files[0].text.updateImportsAndExports(""); }); - assert.isTrue(program_2.structureIsReused === StructureIsReused.SafeModules); + assert.equal(program_2.structureIsReused, StructureIsReused.SafeModules); checkResolvedModulesCache(program_3, "a.ts", /*expectedContent*/ undefined); const program_4 = updateProgram(program_3, ["a.ts"], options, files => { @@ -376,7 +384,7 @@ namespace ts { `; files[0].text = files[0].text.updateImportsAndExports(newImports); }); - assert.isTrue(program_3.structureIsReused === StructureIsReused.SafeModules); + assert.equal(program_3.structureIsReused, StructureIsReused.SafeModules); checkResolvedModulesCache(program_4, "a.ts", createMapFromTemplate({ "b": createResolvedModule("b.ts"), "c": undefined })); }); @@ -394,7 +402,7 @@ namespace ts { const program_2 = updateProgram(program_1, ["/a.ts"], options, files => { files[0].text = files[0].text.updateProgram("var x = 2"); }); - assert.isTrue(program_1.structureIsReused === StructureIsReused.Completely); + assert.equal(program_1.structureIsReused, StructureIsReused.Completely); // content of resolution cache should not change checkResolvedTypeDirectivesCache(program_1, "/a.ts", createMapFromTemplate({ "typedefs": { resolvedFileName: "/types/typedefs/index.d.ts", primary: true } })); @@ -405,7 +413,7 @@ namespace ts { files[0].text = files[0].text.updateReferences(""); }); - assert.isTrue(program_2.structureIsReused === StructureIsReused.SafeModules); + assert.equal(program_2.structureIsReused, StructureIsReused.SafeModules); checkResolvedTypeDirectivesCache(program_3, "/a.ts", /*expectedContent*/ undefined); updateProgram(program_3, ["/a.ts"], options, files => { @@ -414,7 +422,7 @@ namespace ts { `; files[0].text = files[0].text.updateReferences(newReferences); }); - assert.isTrue(program_3.structureIsReused === StructureIsReused.SafeModules); + assert.equal(program_3.structureIsReused, StructureIsReused.SafeModules); checkResolvedTypeDirectivesCache(program_1, "/a.ts", createMapFromTemplate({ "typedefs": { resolvedFileName: "/types/typedefs/index.d.ts", primary: true } })); }); @@ -454,7 +462,7 @@ namespace ts { "initialProgram: execute module resolution normally."); const initialProgramDiagnostics = initialProgram.getSemanticDiagnostics(initialProgram.getSourceFile("file1.ts")); - assert(initialProgramDiagnostics.length === 1, `initialProgram: import should fail.`); + assert.lengthOf(initialProgramDiagnostics, 1, `initialProgram: import should fail.`); } const afterNpmInstallProgram = updateProgram(initialProgram, rootFiles.map(f => f.name), options, f => { @@ -478,7 +486,7 @@ namespace ts { "afterNpmInstallProgram: execute module resolution normally."); const afterNpmInstallProgramDiagnostics = afterNpmInstallProgram.getSemanticDiagnostics(afterNpmInstallProgram.getSourceFile("file1.ts")); - assert(afterNpmInstallProgramDiagnostics.length === 0, `afterNpmInstallProgram: program is well-formed with import.`); + assert.lengthOf(afterNpmInstallProgramDiagnostics, 0, `afterNpmInstallProgram: program is well-formed with import.`); } }); @@ -617,10 +625,10 @@ namespace ts { "File 'f1.ts' exist - use it as a name resolution result.", "======== Module name './f1' was successfully resolved to 'f1.ts'. ========" ], - "program_1: execute module reoslution normally."); + "program_1: execute module resolution normally."); const program_1Diagnostics = program_1.getSemanticDiagnostics(program_1.getSourceFile("f2.ts")); - assert(program_1Diagnostics.length === expectedErrors, `initial program should be well-formed`); + assert.lengthOf(program_1Diagnostics, expectedErrors, `initial program should be well-formed`); } const indexOfF1 = 6; const program_2 = updateProgram(program_1, program_1.getRootFileNames(), options, f => { @@ -630,7 +638,7 @@ namespace ts { { const program_2Diagnostics = program_2.getSemanticDiagnostics(program_2.getSourceFile("f2.ts")); - assert(program_2Diagnostics.length === expectedErrors, `removing no-default-lib shouldn't affect any types used.`); + assert.lengthOf(program_2Diagnostics, expectedErrors, `removing no-default-lib shouldn't affect any types used.`); assert.deepEqual(program_2.host.getTrace(), [ "======== Resolving type reference directive 'typerefs1', containing file 'f1.ts', root directory 'node_modules/@types'. ========", @@ -659,7 +667,7 @@ namespace ts { { const program_3Diagnostics = program_3.getSemanticDiagnostics(program_3.getSourceFile("f2.ts")); - assert(program_3Diagnostics.length === expectedErrors, `typerefs2 was unused, so diagnostics should be unaffected.`); + assert.lengthOf(program_3Diagnostics, expectedErrors, `typerefs2 was unused, so diagnostics should be unaffected.`); assert.deepEqual(program_3.host.getTrace(), [ "======== Resolving module './b1' from 'f1.ts'. ========", @@ -684,7 +692,7 @@ namespace ts { { const program_4Diagnostics = program_4.getSemanticDiagnostics(program_4.getSourceFile("f2.ts")); - assert(program_4Diagnostics.length === expectedErrors, `a1.ts was unused, so diagnostics should be unaffected.`); + assert.lengthOf(program_4Diagnostics, expectedErrors, `a1.ts was unused, so diagnostics should be unaffected.`); assert.deepEqual(program_4.host.getTrace(), [ "======== Resolving module './b1' from 'f1.ts'. ========", @@ -708,7 +716,7 @@ namespace ts { { const program_5Diagnostics = program_5.getSemanticDiagnostics(program_5.getSourceFile("f2.ts")); - assert(program_5Diagnostics.length === ++expectedErrors, `import of BB in f1 fails. BB is of type any. Add one error`); + assert.lengthOf(program_5Diagnostics, ++expectedErrors, `import of BB in f1 fails. BB is of type any. Add one error`); assert.deepEqual(program_5.host.getTrace(), [ "======== Resolving module './b1' from 'f1.ts'. ========", @@ -725,7 +733,7 @@ namespace ts { { const program_6Diagnostics = program_6.getSemanticDiagnostics(program_6.getSourceFile("f2.ts")); - assert(program_6Diagnostics.length === expectedErrors, `import of BB in f1 fails.`); + assert.lengthOf(program_6Diagnostics, expectedErrors, `import of BB in f1 fails.`); assert.deepEqual(program_6.host.getTrace(), [ "======== Resolving module './b1' from 'f1.ts'. ========", @@ -749,7 +757,7 @@ namespace ts { { const program_7Diagnostics = program_7.getSemanticDiagnostics(program_7.getSourceFile("f2.ts")); - assert(program_7Diagnostics.length === expectedErrors, `removing import is noop with respect to program, so no change in diagnostics.`); + assert.lengthOf(program_7Diagnostics, expectedErrors, `removing import is noop with respect to program, so no change in diagnostics.`); assert.deepEqual(program_7.host.getTrace(), [ "======== Resolving type reference directive 'typerefs2', containing file 'f2.ts', root directory 'node_modules/@types'. ========", @@ -762,6 +770,98 @@ namespace ts { ], "program_7 should reuse module resolutions in f2 since it is unchanged"); } }); + + describe("redirects", () => { + const axIndex = "/node_modules/a/node_modules/x/index.d.ts"; + const axPackage = "/node_modules/a/node_modules/x/package.json"; + const bxIndex = "/node_modules/b/node_modules/x/index.d.ts"; + const bxPackage = "/node_modules/b/node_modules/x/package.json"; + const root = "/a.ts"; + const compilerOptions = { target, moduleResolution: ModuleResolutionKind.NodeJs }; + + function createRedirectProgram(options?: { bText: string, bVersion: string }): ProgramWithSourceTexts { + const files: NamedSourceText[] = [ + { + name: "/node_modules/a/index.d.ts", + text: SourceText.New("", 'import X from "x";', "export function a(x: X): void;"), + }, + { + name: axIndex, + text: SourceText.New("", "", "export default class X { private x: number; }"), + }, + { + name: axPackage, + text: SourceText.New("", "", JSON.stringify({ name: "x", version: "1.2.3" })), + }, + { + name: "/node_modules/b/index.d.ts", + text: SourceText.New("", 'import X from "x";', "export const b: X;"), + }, + { + name: bxIndex, + text: SourceText.New("", "", options ? options.bText : "export default class X { private x: number; }"), + }, + { + name: bxPackage, + text: SourceText.New("", "", JSON.stringify({ name: "x", version: options ? options.bVersion : "1.2.3" })), + }, + { + name: root, + text: SourceText.New("", 'import { a } from "a"; import { b } from "b";', "a(b)"), + }, + ]; + + return newProgram(files, [root], compilerOptions); + } + + function updateRedirectProgram(program: ProgramWithSourceTexts, updater: (files: NamedSourceText[]) => void): ProgramWithSourceTexts { + return updateProgram(program, [root], compilerOptions, updater); + } + + it("No changes -> redirect not broken", () => { + const program_1 = createRedirectProgram(); + + const program_2 = updateRedirectProgram(program_1, files => { + updateProgramText(files, root, "const x = 1;"); + }); + assert.equal(program_1.structureIsReused, StructureIsReused.Completely); + assert.deepEqual(program_2.getSemanticDiagnostics(), emptyArray); + }); + + it("Target changes -> redirect broken", () => { + const program_1 = createRedirectProgram(); + assert.deepEqual(program_1.getSemanticDiagnostics(), emptyArray); + + const program_2 = updateRedirectProgram(program_1, files => { + updateProgramText(files, axIndex, "export default class X { private x: number; private y: number; }"); + updateProgramText(files, axPackage, JSON.stringify('{ name: "x", version: "1.2.4" }')); + }); + assert.equal(program_1.structureIsReused, StructureIsReused.Not); + assert.lengthOf(program_2.getSemanticDiagnostics(), 1); + }); + + it("Underlying changes -> redirect broken", () => { + const program_1 = createRedirectProgram(); + + const program_2 = updateRedirectProgram(program_1, files => { + updateProgramText(files, bxIndex, "export default class X { private x: number; private y: number; }"); + updateProgramText(files, bxPackage, JSON.stringify({ name: "x", version: "1.2.4" })); + }); + assert.equal(program_1.structureIsReused, StructureIsReused.Not); + assert.lengthOf(program_2.getSemanticDiagnostics(), 1); + }); + + it("Previously duplicate packages -> program structure not reused", () => { + const program_1 = createRedirectProgram({ bVersion: "1.2.4", bText: "export = class X { private x: number; }" }); + + const program_2 = updateRedirectProgram(program_1, files => { + updateProgramText(files, bxIndex, "export default class X { private x: number; }"); + updateProgramText(files, bxPackage, JSON.stringify({ name: "x", version: "1.2.3" })); + }); + assert.equal(program_1.structureIsReused, StructureIsReused.Not); + assert.deepEqual(program_2.getSemanticDiagnostics(), []); + }); + }); }); describe("host is optional", () => { diff --git a/tests/baselines/reference/duplicatePackage.errors.txt b/tests/baselines/reference/duplicatePackage.errors.txt new file mode 100644 index 0000000000000..917ed711c640d --- /dev/null +++ b/tests/baselines/reference/duplicatePackage.errors.txt @@ -0,0 +1,48 @@ +/src/a.ts(5,3): error TS2345: Argument of type 'X' is not assignable to parameter of type 'X'. + Types have separate declarations of a private property 'x'. + + +==== /src/a.ts (1 errors) ==== + import { a } from "a"; + import { b } from "b"; + import { c } from "c"; + a(b); // Works + a(c); // Error, these are from different versions of the library. + ~ +!!! error TS2345: Argument of type 'X' is not assignable to parameter of type 'X'. +!!! error TS2345: Types have separate declarations of a private property 'x'. + +==== /node_modules/a/index.d.ts (0 errors) ==== + import X from "x"; + export function a(x: X): void; + +==== /node_modules/a/node_modules/x/index.d.ts (0 errors) ==== + export default class X { + private x: number; + } + +==== /node_modules/a/node_modules/x/package.json (0 errors) ==== + { "name": "x", "version": "1.2.3" } + +==== /node_modules/b/index.d.ts (0 errors) ==== + import X from "x"; + export const b: X; + +==== /node_modules/b/node_modules/x/index.d.ts (0 errors) ==== + content not parsed + +==== /node_modules/b/node_modules/x/package.json (0 errors) ==== + { "name": "x", "version": "1.2.3" } + +==== /node_modules/c/index.d.ts (0 errors) ==== + import X from "x"; + export const c: X; + +==== /node_modules/c/node_modules/x/index.d.ts (0 errors) ==== + export default class X { + private x: number; + } + +==== /node_modules/c/node_modules/x/package.json (0 errors) ==== + { "name": "x", "version": "1.2.4" } + \ No newline at end of file diff --git a/tests/baselines/reference/duplicatePackage.js b/tests/baselines/reference/duplicatePackage.js new file mode 100644 index 0000000000000..ada5c900b9371 --- /dev/null +++ b/tests/baselines/reference/duplicatePackage.js @@ -0,0 +1,52 @@ +//// [tests/cases/compiler/duplicatePackage.ts] //// + +//// [index.d.ts] +import X from "x"; +export function a(x: X): void; + +//// [index.d.ts] +export default class X { + private x: number; +} + +//// [package.json] +{ "name": "x", "version": "1.2.3" } + +//// [index.d.ts] +import X from "x"; +export const b: X; + +//// [index.d.ts] +content not parsed + +//// [package.json] +{ "name": "x", "version": "1.2.3" } + +//// [index.d.ts] +import X from "x"; +export const c: X; + +//// [index.d.ts] +export default class X { + private x: number; +} + +//// [package.json] +{ "name": "x", "version": "1.2.4" } + +//// [a.ts] +import { a } from "a"; +import { b } from "b"; +import { c } from "c"; +a(b); // Works +a(c); // Error, these are from different versions of the library. + + +//// [a.js] +"use strict"; +exports.__esModule = true; +var a_1 = require("a"); +var b_1 = require("b"); +var c_1 = require("c"); +a_1.a(b_1.b); // Works +a_1.a(c_1.c); // Error, these are from different versions of the library. diff --git a/tests/baselines/reference/duplicatePackage_withErrors.errors.txt b/tests/baselines/reference/duplicatePackage_withErrors.errors.txt new file mode 100644 index 0000000000000..ad24637e98331 --- /dev/null +++ b/tests/baselines/reference/duplicatePackage_withErrors.errors.txt @@ -0,0 +1,27 @@ +/node_modules/a/node_modules/x/index.d.ts(1,18): error TS1254: A 'const' initializer in an ambient context must be a string or numeric literal. + + +==== /src/a.ts (0 errors) ==== + import { x as xa } from "a"; + import { x as xb } from "b"; + +==== /node_modules/a/index.d.ts (0 errors) ==== + export { x } from "x"; + +==== /node_modules/a/node_modules/x/index.d.ts (1 errors) ==== + export const x = 1 + 1; + ~~~~~ +!!! error TS1254: A 'const' initializer in an ambient context must be a string or numeric literal. + +==== /node_modules/a/node_modules/x/package.json (0 errors) ==== + { "name": "x", "version": "1.2.3" } + +==== /node_modules/b/index.d.ts (0 errors) ==== + export { x } from "x"; + +==== /node_modules/b/node_modules/x/index.d.ts (0 errors) ==== + content not parsed + +==== /node_modules/b/node_modules/x/package.json (0 errors) ==== + { "name": "x", "version": "1.2.3" } + \ No newline at end of file diff --git a/tests/baselines/reference/duplicatePackage_withErrors.js b/tests/baselines/reference/duplicatePackage_withErrors.js new file mode 100644 index 0000000000000..a7fdafd522f5e --- /dev/null +++ b/tests/baselines/reference/duplicatePackage_withErrors.js @@ -0,0 +1,28 @@ +//// [tests/cases/compiler/duplicatePackage_withErrors.ts] //// + +//// [index.d.ts] +export { x } from "x"; + +//// [index.d.ts] +export const x = 1 + 1; + +//// [package.json] +{ "name": "x", "version": "1.2.3" } + +//// [index.d.ts] +export { x } from "x"; + +//// [index.d.ts] +content not parsed + +//// [package.json] +{ "name": "x", "version": "1.2.3" } + +//// [a.ts] +import { x as xa } from "a"; +import { x as xb } from "b"; + + +//// [a.js] +"use strict"; +exports.__esModule = true; diff --git a/tests/cases/compiler/duplicatePackage.ts b/tests/cases/compiler/duplicatePackage.ts new file mode 100644 index 0000000000000..31df2d2450883 --- /dev/null +++ b/tests/cases/compiler/duplicatePackage.ts @@ -0,0 +1,42 @@ +// @noImplicitReferences: true + +// @Filename: /node_modules/a/index.d.ts +import X from "x"; +export function a(x: X): void; + +// @Filename: /node_modules/a/node_modules/x/index.d.ts +export default class X { + private x: number; +} + +// @Filename: /node_modules/a/node_modules/x/package.json +{ "name": "x", "version": "1.2.3" } + +// @Filename: /node_modules/b/index.d.ts +import X from "x"; +export const b: X; + +// @Filename: /node_modules/b/node_modules/x/index.d.ts +content not parsed + +// @Filename: /node_modules/b/node_modules/x/package.json +{ "name": "x", "version": "1.2.3" } + +// @Filename: /node_modules/c/index.d.ts +import X from "x"; +export const c: X; + +// @Filename: /node_modules/c/node_modules/x/index.d.ts +export default class X { + private x: number; +} + +// @Filename: /node_modules/c/node_modules/x/package.json +{ "name": "x", "version": "1.2.4" } + +// @Filename: /src/a.ts +import { a } from "a"; +import { b } from "b"; +import { c } from "c"; +a(b); // Works +a(c); // Error, these are from different versions of the library. diff --git a/tests/cases/compiler/duplicatePackage_withErrors.ts b/tests/cases/compiler/duplicatePackage_withErrors.ts new file mode 100644 index 0000000000000..266c7239971d7 --- /dev/null +++ b/tests/cases/compiler/duplicatePackage_withErrors.ts @@ -0,0 +1,23 @@ +// @noImplicitReferences: true + +// @Filename: /node_modules/a/index.d.ts +export { x } from "x"; + +// @Filename: /node_modules/a/node_modules/x/index.d.ts +export const x = 1 + 1; + +// @Filename: /node_modules/a/node_modules/x/package.json +{ "name": "x", "version": "1.2.3" } + +// @Filename: /node_modules/b/index.d.ts +export { x } from "x"; + +// @Filename: /node_modules/b/node_modules/x/index.d.ts +content not parsed + +// @Filename: /node_modules/b/node_modules/x/package.json +{ "name": "x", "version": "1.2.3" } + +// @Filename: /src/a.ts +import { x as xa } from "a"; +import { x as xb } from "b"; diff --git a/tests/cases/fourslash/duplicatePackageServices.ts b/tests/cases/fourslash/duplicatePackageServices.ts new file mode 100644 index 0000000000000..360611ad1403b --- /dev/null +++ b/tests/cases/fourslash/duplicatePackageServices.ts @@ -0,0 +1,46 @@ +/// +// @noImplicitReferences: true + +// @Filename: /node_modules/a/index.d.ts +////import /*useAX*/[|{| "isWriteAccess": true, "isDefinition": true |}X|] from "x"; +////export function a(x: [|X|]): void; + +// @Filename: /node_modules/a/node_modules/x/index.d.ts +////export default class /*defAX*/[|{| "isWriteAccess": true, "isDefinition": true |}X|] { +//// private x: number; +////} + +// @Filename: /node_modules/a/node_modules/x/package.json +////{ "name": "x", "version": "1.2.3" } + +// @Filename: /node_modules/b/index.d.ts +////import /*useBX*/[|{| "isWriteAccess": true, "isDefinition": true |}X|] from "x"; +////export const b: [|X|]; + +// @Filename: /node_modules/b/node_modules/x/index.d.ts +////export default class /*defBX*/[|{| "isWriteAccess": true, "isDefinition": true |}X|] { +//// private x: number; +////} + +// @Filename: /node_modules/b/node_modules/x/package.json +////{ "name": "x", "version": "1.2./*bVersionPatch*/3" } + +// @Filename: /src/a.ts +////import { a } from "a"; +////import { b } from "b"; +////a(/*error*/b); + +goTo.file("/src/a.ts"); +verify.numberOfErrorsInCurrentFile(0); +verify.goToDefinition("useAX", "defAX"); +verify.goToDefinition("useBX", "defAX"); + +const [r0, r1, r2, r3, r4, r5] = test.ranges(); +const aImport = { definition: "import X", ranges: [r0, r1] }; +const def = { definition: "class X", ranges: [r2] }; +const bImport = { definition: "import X", ranges: [r3, r4] }; +verify.referenceGroups([r0, r1], [aImport, def, bImport]); +verify.referenceGroups([r2], [def, aImport, bImport]); +verify.referenceGroups([r3, r4], [bImport, def, aImport]); + +verify.referenceGroups(r5, [def, aImport, bImport]); diff --git a/tests/cases/fourslash/duplicatePackageServices_fileChanges.ts b/tests/cases/fourslash/duplicatePackageServices_fileChanges.ts new file mode 100644 index 0000000000000..203277d7ad467 --- /dev/null +++ b/tests/cases/fourslash/duplicatePackageServices_fileChanges.ts @@ -0,0 +1,57 @@ +/// +// @noImplicitReferences: true + +// @Filename: /node_modules/a/index.d.ts +////import X from "x"; +////export function a(x: X): void; + +// @Filename: /node_modules/a/node_modules/x/index.d.ts +////export default class /*defAX*/X { +//// private x: number; +////} + +// @Filename: /node_modules/a/node_modules/x/package.json +////{ "name": "x", "version": "1.2./*aVersionPatch*/3" } + +// @Filename: /node_modules/b/index.d.ts +////import X from "x"; +////export const b: X; + +// @Filename: /node_modules/b/node_modules/x/index.d.ts +////export default class /*defBX*/X { +//// private x: number; +////} + +// @Filename: /node_modules/b/node_modules/x/package.json +////{ "name": "x", "version": "1.2./*bVersionPatch*/3" } + +// @Filename: /src/a.ts +////import { a } from "a"; +////import { b } from "b"; +////a(/*error*/b); + +goTo.file("/src/a.ts"); +verify.numberOfErrorsInCurrentFile(0); + +testChangeAndChangeBack("aVersionPatch", "defAX"); +testChangeAndChangeBack("bVersionPatch", "defBX"); + +function testChangeAndChangeBack(versionPatch: string, def: string) { + goTo.marker(versionPatch); + edit.insert("4"); + goTo.marker(def); + edit.insert(" "); + + // No longer have identical packageId, so we get errors. + verify.errorExistsAfterMarker("error"); + + // Undo the change. + goTo.marker(versionPatch); + edit.deleteAtCaret(); + goTo.marker(def); + edit.deleteAtCaret(); + + // Back to being identical. + goTo.file("/src/a.ts"); + verify.numberOfErrorsInCurrentFile(0); +} From e1ba65ae643a4cb06b809b3a8980dd4991e4b89f Mon Sep 17 00:00:00 2001 From: Andy Date: Wed, 9 Aug 2017 14:41:38 -0700 Subject: [PATCH 087/237] Add simple version of `chooseOverload` for common case of single non-generic signature (#17589) * Add simple version of `chooseOverload` for common case of single non-generic signature * Use a single function --- src/compiler/checker.ts | 17 +++++++-- ...ntextualTypingFunctionReturningFunction.js | 19 ++++++++++ ...ualTypingFunctionReturningFunction.symbols | 31 ++++++++++++++++ ...xtualTypingFunctionReturningFunction.types | 36 +++++++++++++++++++ ...lidThisEmitInContextualObjectLiteral.types | 6 ++-- ...ntextualTypingFunctionReturningFunction.ts | 11 ++++++ 6 files changed, 115 insertions(+), 5 deletions(-) create mode 100644 tests/baselines/reference/contextualTypingFunctionReturningFunction.js create mode 100644 tests/baselines/reference/contextualTypingFunctionReturningFunction.symbols create mode 100644 tests/baselines/reference/contextualTypingFunctionReturningFunction.types create mode 100644 tests/cases/compiler/contextualTypingFunctionReturningFunction.ts diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index ac77a64bb64b6..46cb8bb49371c 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -15705,9 +15705,10 @@ namespace ts { // // For a decorator, no arguments are susceptible to contextual typing due to the fact // decorators are applied to a declaration by the emitter, and not to an expression. + const isSingleNonGenericCandidate = candidates.length === 1 && !candidates[0].typeParameters; let excludeArgument: boolean[]; let excludeCount = 0; - if (!isDecorator) { + if (!isDecorator && !isSingleNonGenericCandidate) { // We do not need to call `getEffectiveArgumentCount` here as it only // applies when calculating the number of arguments for a decorator. for (let i = isTaggedTemplate ? 1 : 0; i < args.length; i++) { @@ -15860,6 +15861,19 @@ namespace ts { function chooseOverload(candidates: Signature[], relation: Map, signatureHelpTrailingComma = false) { candidateForArgumentError = undefined; candidateForTypeArgumentError = undefined; + + if (isSingleNonGenericCandidate) { + const candidate = candidates[0]; + if (!hasCorrectArity(node, args, candidate, signatureHelpTrailingComma)) { + return undefined; + } + if (!checkApplicableSignature(node, args, candidate, relation, excludeArgument, /*reportErrors*/ false)) { + candidateForArgumentError = candidate; + return undefined; + } + return candidate; + } + for (let candidateIndex = 0; candidateIndex < candidates.length; candidateIndex++) { const originalCandidate = candidates[candidateIndex]; if (!hasCorrectArity(node, args, originalCandidate, signatureHelpTrailingComma)) { @@ -15907,7 +15921,6 @@ namespace ts { return undefined; } - } function getLongestCandidateIndex(candidates: Signature[], argsCount: number): number { diff --git a/tests/baselines/reference/contextualTypingFunctionReturningFunction.js b/tests/baselines/reference/contextualTypingFunctionReturningFunction.js new file mode 100644 index 0000000000000..31f89bdefd835 --- /dev/null +++ b/tests/baselines/reference/contextualTypingFunctionReturningFunction.js @@ -0,0 +1,19 @@ +//// [contextualTypingFunctionReturningFunction.ts] +interface I { + a(s: string): void; + b(): (n: number) => void; +} + +declare function f(i: I): void; + +f({ + a: s => {}, + b: () => n => {}, +}); + + +//// [contextualTypingFunctionReturningFunction.js] +f({ + a: function (s) { }, + b: function () { return function (n) { }; } +}); diff --git a/tests/baselines/reference/contextualTypingFunctionReturningFunction.symbols b/tests/baselines/reference/contextualTypingFunctionReturningFunction.symbols new file mode 100644 index 0000000000000..509c712974503 --- /dev/null +++ b/tests/baselines/reference/contextualTypingFunctionReturningFunction.symbols @@ -0,0 +1,31 @@ +=== tests/cases/compiler/contextualTypingFunctionReturningFunction.ts === +interface I { +>I : Symbol(I, Decl(contextualTypingFunctionReturningFunction.ts, 0, 0)) + + a(s: string): void; +>a : Symbol(I.a, Decl(contextualTypingFunctionReturningFunction.ts, 0, 13)) +>s : Symbol(s, Decl(contextualTypingFunctionReturningFunction.ts, 1, 3)) + + b(): (n: number) => void; +>b : Symbol(I.b, Decl(contextualTypingFunctionReturningFunction.ts, 1, 20)) +>n : Symbol(n, Decl(contextualTypingFunctionReturningFunction.ts, 2, 7)) +} + +declare function f(i: I): void; +>f : Symbol(f, Decl(contextualTypingFunctionReturningFunction.ts, 3, 1)) +>i : Symbol(i, Decl(contextualTypingFunctionReturningFunction.ts, 5, 19)) +>I : Symbol(I, Decl(contextualTypingFunctionReturningFunction.ts, 0, 0)) + +f({ +>f : Symbol(f, Decl(contextualTypingFunctionReturningFunction.ts, 3, 1)) + + a: s => {}, +>a : Symbol(a, Decl(contextualTypingFunctionReturningFunction.ts, 7, 3)) +>s : Symbol(s, Decl(contextualTypingFunctionReturningFunction.ts, 8, 3)) + + b: () => n => {}, +>b : Symbol(b, Decl(contextualTypingFunctionReturningFunction.ts, 8, 12)) +>n : Symbol(n, Decl(contextualTypingFunctionReturningFunction.ts, 9, 9)) + +}); + diff --git a/tests/baselines/reference/contextualTypingFunctionReturningFunction.types b/tests/baselines/reference/contextualTypingFunctionReturningFunction.types new file mode 100644 index 0000000000000..8185819acf63b --- /dev/null +++ b/tests/baselines/reference/contextualTypingFunctionReturningFunction.types @@ -0,0 +1,36 @@ +=== tests/cases/compiler/contextualTypingFunctionReturningFunction.ts === +interface I { +>I : I + + a(s: string): void; +>a : (s: string) => void +>s : string + + b(): (n: number) => void; +>b : () => (n: number) => void +>n : number +} + +declare function f(i: I): void; +>f : (i: I) => void +>i : I +>I : I + +f({ +>f({ a: s => {}, b: () => n => {},}) : void +>f : (i: I) => void +>{ a: s => {}, b: () => n => {},} : { a: (s: string) => void; b: () => (n: number) => void; } + + a: s => {}, +>a : (s: string) => void +>s => {} : (s: string) => void +>s : string + + b: () => n => {}, +>b : () => (n: number) => void +>() => n => {} : () => (n: number) => void +>n => {} : (n: number) => void +>n : number + +}); + diff --git a/tests/baselines/reference/invalidThisEmitInContextualObjectLiteral.types b/tests/baselines/reference/invalidThisEmitInContextualObjectLiteral.types index 290b0a78eb29d..8cb32eb84bd76 100644 --- a/tests/baselines/reference/invalidThisEmitInContextualObjectLiteral.types +++ b/tests/baselines/reference/invalidThisEmitInContextualObjectLiteral.types @@ -25,7 +25,7 @@ class TestController { >this.m : (def: IDef) => void >this : this >m : (def: IDef) => void ->{ p1: e => { }, p2: () => { return vvvvvvvvv => this; }, } : { p1: (e: string) => void; p2: () => {}; } +>{ p1: e => { }, p2: () => { return vvvvvvvvv => this; }, } : { p1: (e: string) => void; p2: () => (vvvvvvvvv: number) => this; } p1: e => { }, >p1 : (e: string) => void @@ -33,8 +33,8 @@ class TestController { >e : string p2: () => { return vvvvvvvvv => this; }, ->p2 : () => {} ->() => { return vvvvvvvvv => this; } : () => {} +>p2 : () => (vvvvvvvvv: number) => this +>() => { return vvvvvvvvv => this; } : () => (vvvvvvvvv: number) => this >vvvvvvvvv => this : (vvvvvvvvv: number) => this >vvvvvvvvv : number >this : this diff --git a/tests/cases/compiler/contextualTypingFunctionReturningFunction.ts b/tests/cases/compiler/contextualTypingFunctionReturningFunction.ts new file mode 100644 index 0000000000000..2b371937f5cb4 --- /dev/null +++ b/tests/cases/compiler/contextualTypingFunctionReturningFunction.ts @@ -0,0 +1,11 @@ +interface I { + a(s: string): void; + b(): (n: number) => void; +} + +declare function f(i: I): void; + +f({ + a: s => {}, + b: () => n => {}, +}); From 1663d01844ee79b9d87ad07008e5c6d7cb2cc28b Mon Sep 17 00:00:00 2001 From: uniqueiniquity Date: Wed, 9 Aug 2017 14:38:26 -0700 Subject: [PATCH 088/237] Fix outlining of objects in array --- src/services/outliningElementsCollector.ts | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/services/outliningElementsCollector.ts b/src/services/outliningElementsCollector.ts index 5099f8b66bdd5..0958892c1e61a 100644 --- a/src/services/outliningElementsCollector.ts +++ b/src/services/outliningElementsCollector.ts @@ -16,6 +16,18 @@ namespace ts.OutliningElementsCollector { } } + function addOutliningForObjectLiteralsInArray(startElement: Node, endElement: Node, autoCollapse: boolean) { + if (startElement && endElement) { + const span: OutliningSpan = { + textSpan: createTextSpanFromBounds(startElement.getStart(), endElement.end), + hintSpan: createTextSpanFromBounds(startElement.getStart(), endElement.end), + bannerText: collapseText, + autoCollapse + }; + elements.push(span); + } + } + function addOutliningSpanComments(commentSpan: CommentRange, autoCollapse: boolean) { if (commentSpan) { const span: OutliningSpan = { @@ -161,6 +173,10 @@ namespace ts.OutliningElementsCollector { case SyntaxKind.CaseBlock: { const openBrace = findChildOfKind(n, SyntaxKind.OpenBraceToken, sourceFile); const closeBrace = findChildOfKind(n, SyntaxKind.CloseBraceToken, sourceFile); + if (n.kind === SyntaxKind.ObjectLiteralExpression && n.parent.kind === SyntaxKind.ArrayLiteralExpression) { + addOutliningForObjectLiteralsInArray(openBrace, closeBrace, autoCollapse(n)); + break; + } addOutliningSpan(n, openBrace, closeBrace, autoCollapse(n)); break; } From 8ae7c6c227a009c977344abe655ecac39ceb14e2 Mon Sep 17 00:00:00 2001 From: Nathan Shively-Sanders Date: Wed, 9 Aug 2017 15:43:47 -0700 Subject: [PATCH 089/237] Fix type predicate index in error reporting Previously type predicate error checking didn't take the `this` parameter into account when checking for errors. This led to spurious errors. Note that it's not feasible to change the initial value of `parameterIndex` because several checks refer to the original declaration, for example to make sure that a type predicate doesn't refer to a rest parameter. --- src/compiler/checker.ts | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 46cb8bb49371c..aaf5b0bc4f998 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -8592,7 +8592,7 @@ namespace ts { // The following block preserves behavior forbidding boolean returning functions from being assignable to type guard returning functions if (target.typePredicate) { if (source.typePredicate) { - result &= compareTypePredicateRelatedTo(source.typePredicate, target.typePredicate, reportErrors, errorReporter, compareTypes); + result &= compareTypePredicateRelatedTo(source.typePredicate, target.typePredicate, source.declaration, target.declaration, reportErrors, errorReporter, compareTypes); } else if (isIdentifierTypePredicate(target.typePredicate)) { if (reportErrors) { @@ -8614,8 +8614,11 @@ namespace ts { return result; } - function compareTypePredicateRelatedTo(source: TypePredicate, + function compareTypePredicateRelatedTo( + source: TypePredicate, target: TypePredicate, + sourceDeclaration: SignatureDeclaration, + targetDeclaration: SignatureDeclaration, reportErrors: boolean, errorReporter: ErrorReporter, compareTypes: (s: Type, t: Type, reportErrors?: boolean) => Ternary): Ternary { @@ -8628,11 +8631,13 @@ namespace ts { } if (source.kind === TypePredicateKind.Identifier) { - const sourceIdentifierPredicate = source as IdentifierTypePredicate; - const targetIdentifierPredicate = target as IdentifierTypePredicate; - if (sourceIdentifierPredicate.parameterIndex !== targetIdentifierPredicate.parameterIndex) { + const sourcePredicate = source as IdentifierTypePredicate; + const targetPredicate = target as IdentifierTypePredicate; + const sourceIndex = sourcePredicate.parameterIndex - (getThisParameter(sourceDeclaration) ? 1 : 0); + const targetIndex = targetPredicate.parameterIndex - (getThisParameter(targetDeclaration) ? 1 : 0); + if (sourceIndex !== targetIndex) { if (reportErrors) { - errorReporter(Diagnostics.Parameter_0_is_not_in_the_same_position_as_parameter_1, sourceIdentifierPredicate.parameterName, targetIdentifierPredicate.parameterName); + errorReporter(Diagnostics.Parameter_0_is_not_in_the_same_position_as_parameter_1, sourcePredicate.parameterName, targetPredicate.parameterName); errorReporter(Diagnostics.Type_predicate_0_is_not_assignable_to_1, typePredicateToString(source), typePredicateToString(target)); } return Ternary.False; From a59f77ffb41efa059ece19665147e562841b987f Mon Sep 17 00:00:00 2001 From: Nathan Shively-Sanders Date: Wed, 9 Aug 2017 15:45:28 -0700 Subject: [PATCH 090/237] Test:type predicate uses correct index to report errors --- .../reference/thisTypeInTypePredicate.js | 7 ++++++ .../reference/thisTypeInTypePredicate.symbols | 18 +++++++++++++++ .../reference/thisTypeInTypePredicate.types | 23 +++++++++++++++++++ .../types/thisType/thisTypeInTypePredicate.ts | 2 ++ 4 files changed, 50 insertions(+) create mode 100644 tests/baselines/reference/thisTypeInTypePredicate.js create mode 100644 tests/baselines/reference/thisTypeInTypePredicate.symbols create mode 100644 tests/baselines/reference/thisTypeInTypePredicate.types create mode 100644 tests/cases/conformance/types/thisType/thisTypeInTypePredicate.ts diff --git a/tests/baselines/reference/thisTypeInTypePredicate.js b/tests/baselines/reference/thisTypeInTypePredicate.js new file mode 100644 index 0000000000000..1b9a48daeea6a --- /dev/null +++ b/tests/baselines/reference/thisTypeInTypePredicate.js @@ -0,0 +1,7 @@ +//// [thisTypeInTypePredicate.ts] +declare function filter(f: (this: void, x: any) => x is S): S[]; +const numbers = filter((x): x is number => 'number' == typeof x) + + +//// [thisTypeInTypePredicate.js] +var numbers = filter(function (x) { return 'number' == typeof x; }); diff --git a/tests/baselines/reference/thisTypeInTypePredicate.symbols b/tests/baselines/reference/thisTypeInTypePredicate.symbols new file mode 100644 index 0000000000000..ff18f450a0ec0 --- /dev/null +++ b/tests/baselines/reference/thisTypeInTypePredicate.symbols @@ -0,0 +1,18 @@ +=== tests/cases/conformance/types/thisType/thisTypeInTypePredicate.ts === +declare function filter(f: (this: void, x: any) => x is S): S[]; +>filter : Symbol(filter, Decl(thisTypeInTypePredicate.ts, 0, 0)) +>S : Symbol(S, Decl(thisTypeInTypePredicate.ts, 0, 24)) +>f : Symbol(f, Decl(thisTypeInTypePredicate.ts, 0, 27)) +>this : Symbol(this, Decl(thisTypeInTypePredicate.ts, 0, 31)) +>x : Symbol(x, Decl(thisTypeInTypePredicate.ts, 0, 42)) +>x : Symbol(x, Decl(thisTypeInTypePredicate.ts, 0, 42)) +>S : Symbol(S, Decl(thisTypeInTypePredicate.ts, 0, 24)) +>S : Symbol(S, Decl(thisTypeInTypePredicate.ts, 0, 24)) + +const numbers = filter((x): x is number => 'number' == typeof x) +>numbers : Symbol(numbers, Decl(thisTypeInTypePredicate.ts, 1, 5)) +>filter : Symbol(filter, Decl(thisTypeInTypePredicate.ts, 0, 0)) +>x : Symbol(x, Decl(thisTypeInTypePredicate.ts, 1, 32)) +>x : Symbol(x, Decl(thisTypeInTypePredicate.ts, 1, 32)) +>x : Symbol(x, Decl(thisTypeInTypePredicate.ts, 1, 32)) + diff --git a/tests/baselines/reference/thisTypeInTypePredicate.types b/tests/baselines/reference/thisTypeInTypePredicate.types new file mode 100644 index 0000000000000..cc92ce811b8eb --- /dev/null +++ b/tests/baselines/reference/thisTypeInTypePredicate.types @@ -0,0 +1,23 @@ +=== tests/cases/conformance/types/thisType/thisTypeInTypePredicate.ts === +declare function filter(f: (this: void, x: any) => x is S): S[]; +>filter : (f: (this: void, x: any) => x is S) => S[] +>S : S +>f : (this: void, x: any) => x is S +>this : void +>x : any +>x : any +>S : S +>S : S + +const numbers = filter((x): x is number => 'number' == typeof x) +>numbers : number[] +>filter((x): x is number => 'number' == typeof x) : number[] +>filter : (f: (this: void, x: any) => x is S) => S[] +>(x): x is number => 'number' == typeof x : (this: void, x: any) => x is number +>x : any +>x : any +>'number' == typeof x : boolean +>'number' : "number" +>typeof x : "string" | "number" | "boolean" | "symbol" | "undefined" | "object" | "function" +>x : any + diff --git a/tests/cases/conformance/types/thisType/thisTypeInTypePredicate.ts b/tests/cases/conformance/types/thisType/thisTypeInTypePredicate.ts new file mode 100644 index 0000000000000..ed0ebc75a22ab --- /dev/null +++ b/tests/cases/conformance/types/thisType/thisTypeInTypePredicate.ts @@ -0,0 +1,2 @@ +declare function filter(f: (this: void, x: any) => x is S): S[]; +const numbers = filter((x): x is number => 'number' == typeof x) From df5e1a0f6971a06916be4f6046267c0b72ddedde Mon Sep 17 00:00:00 2001 From: uniqueiniquity Date: Wed, 9 Aug 2017 15:55:02 -0700 Subject: [PATCH 091/237] add fourslash test --- .../getOutliningForObjectsInArray.ts | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 tests/cases/fourslash/getOutliningForObjectsInArray.ts diff --git a/tests/cases/fourslash/getOutliningForObjectsInArray.ts b/tests/cases/fourslash/getOutliningForObjectsInArray.ts new file mode 100644 index 0000000000000..87d2bc96e2e2f --- /dev/null +++ b/tests/cases/fourslash/getOutliningForObjectsInArray.ts @@ -0,0 +1,23 @@ +/// + +////// objects in x should generate outlining spans that do not render in VS +//// const x =[| [ +//// [|{ a: 0 }|], +//// [|{ b: 1 }|], +//// [|{ c: 2 }|] +//// ]|]; +//// +////// objects in y should generate outlining spans that render as expected +//// const y =[| [ +//// [|{ +//// a: 0 +//// }|], +//// [|{ +//// b: 1 +//// }|], +//// [|{ +//// c: 2 +//// }|] +//// ]|]; + +verify.outliningSpansInCurrentFile(test.ranges()); \ No newline at end of file From 50b2b77f440788f8023488d5fdbeb0c1d0a3c661 Mon Sep 17 00:00:00 2001 From: Nathan Shively-Sanders Date: Wed, 9 Aug 2017 16:14:00 -0700 Subject: [PATCH 092/237] Add readonly check to property access of index signature Unfortunately, the checking code isn't reusable in a large chunk, so I copied it from `getPropertyTypeForIndexType`. It still might be better to extract the four lines to report the error into its own function. --- src/compiler/checker.ts | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 46cb8bb49371c..5b1d4d77bf74b 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -14599,9 +14599,13 @@ namespace ts { } const prop = getPropertyOfType(apparentType, right.escapedText); if (!prop) { - const stringIndexType = getIndexTypeOfType(apparentType, IndexKind.String); - if (stringIndexType) { - return stringIndexType; + const indexInfo = getIndexInfoOfType(apparentType, IndexKind.String); + if (indexInfo && indexInfo.type) { + if (indexInfo.isReadonly && (isAssignmentTarget(node) || isDeleteTarget(node))) { + error(node, Diagnostics.Index_signature_in_type_0_only_permits_reading, typeToString(apparentType)); + return unknownType; + } + return indexInfo.type; } if (right.escapedText && !checkAndReportErrorForExtendingInterface(node)) { reportNonexistentProperty(right, type.flags & TypeFlags.TypeParameter && (type as TypeParameter).isThisType ? apparentType : type); From 4828c7a62b93efafb65b0b4f9bfb58470bc18aa1 Mon Sep 17 00:00:00 2001 From: Wesley Wigham Date: Wed, 9 Aug 2017 16:16:16 -0700 Subject: [PATCH 093/237] Lower RWC Harness Memory Overhead (#17692) * Allow original compilation to be freed before checking declarations * Use string concatenation in error baseline * Fix lints * No ternary --- src/harness/harness.ts | 52 ++++++++++++++++++++++++++++++---------- src/harness/rwcRunner.ts | 24 +++++++++++-------- 2 files changed, 53 insertions(+), 23 deletions(-) diff --git a/src/harness/harness.ts b/src/harness/harness.ts index 7122f55cae2ad..4e42dc41fd8b8 100644 --- a/src/harness/harness.ts +++ b/src/harness/harness.ts @@ -1194,13 +1194,21 @@ namespace Harness { return { result, options }; } - export function compileDeclarationFiles(inputFiles: TestFile[], + export interface DeclarationCompilationContext { + declInputFiles: TestFile[]; + declOtherFiles: TestFile[]; + harnessSettings: TestCaseParser.CompilerSettings & HarnessOptions; + options: ts.CompilerOptions; + currentDirectory: string; + } + + export function prepareDeclarationCompilationContext(inputFiles: TestFile[], otherFiles: TestFile[], result: CompilerResult, harnessSettings: TestCaseParser.CompilerSettings & HarnessOptions, options: ts.CompilerOptions, // Current directory is needed for rwcRunner to be able to use currentDirectory defined in json file - currentDirectory: string) { + currentDirectory: string): DeclarationCompilationContext | undefined { if (options.declaration && result.errors.length === 0 && result.declFilesCode.length !== result.files.length) { throw new Error("There were no errors and declFiles generated did not match number of js files generated"); } @@ -1212,8 +1220,7 @@ namespace Harness { if (options.declaration && result.errors.length === 0 && result.declFilesCode.length > 0) { ts.forEach(inputFiles, file => addDtsFile(file, declInputFiles)); ts.forEach(otherFiles, file => addDtsFile(file, declOtherFiles)); - const output = compileFiles(declInputFiles, declOtherFiles, harnessSettings, options, currentDirectory || harnessSettings["currentDirectory"]); - return { declInputFiles, declOtherFiles, declResult: output.result }; + return { declInputFiles, declOtherFiles, harnessSettings, options, currentDirectory: currentDirectory || harnessSettings["currentDirectory"] }; } function addDtsFile(file: TestFile, dtsFiles: TestFile[]) { @@ -1259,6 +1266,15 @@ namespace Harness { } } + export function compileDeclarationFiles(context: DeclarationCompilationContext | undefined) { + if (!context) { + return; + } + const { declInputFiles, declOtherFiles, harnessSettings, options, currentDirectory } = context; + const output = compileFiles(declInputFiles, declOtherFiles, harnessSettings, options, currentDirectory); + return { declInputFiles, declOtherFiles, declResult: output.result }; + } + function normalizeLineEndings(text: string, lineEnding: string): string { let normalized = text.replace(/\r\n?/g, "\n"); if (lineEnding !== "\n") { @@ -1273,10 +1289,19 @@ namespace Harness { export function getErrorBaseline(inputFiles: TestFile[], diagnostics: ts.Diagnostic[]) { diagnostics.sort(ts.compareDiagnostics); - const outputLines: string[] = []; + let outputLines = ""; // Count up all errors that were found in files other than lib.d.ts so we don't miss any let totalErrorsReportedInNonLibraryFiles = 0; + let firstLine = true; + function newLine() { + if (firstLine) { + firstLine = false; + return ""; + } + return "\r\n"; + } + function outputErrorText(error: ts.Diagnostic) { const message = ts.flattenDiagnosticMessageText(error.messageText, Harness.IO.newLine()); @@ -1285,7 +1310,7 @@ namespace Harness { .map(s => s.length > 0 && s.charAt(s.length - 1) === "\r" ? s.substr(0, s.length - 1) : s) .filter(s => s.length > 0) .map(s => "!!! " + ts.DiagnosticCategory[error.category].toLowerCase() + " TS" + error.code + ": " + s); - errLines.forEach(e => outputLines.push(e)); + errLines.forEach(e => outputLines += (newLine() + e)); // do not count errors from lib.d.ts here, they are computed separately as numLibraryDiagnostics // if lib.d.ts is explicitly included in input files and there are some errors in it (i.e. because of duplicate identifiers) @@ -1311,7 +1336,7 @@ namespace Harness { // Header - outputLines.push("==== " + inputFile.unitName + " (" + fileErrors.length + " errors) ===="); + outputLines += (newLine() + "==== " + inputFile.unitName + " (" + fileErrors.length + " errors) ===="); // Make sure we emit something for every error let markedErrorCount = 0; @@ -1340,7 +1365,7 @@ namespace Harness { nextLineStart = lineStarts[lineIndex + 1]; } // Emit this line from the original file - outputLines.push(" " + line); + outputLines += (newLine() + " " + line); fileErrors.forEach(err => { // Does any error start or continue on to this line? Emit squiggles const end = ts.textSpanEnd(err); @@ -1352,7 +1377,7 @@ namespace Harness { // Calculate the start of the squiggle const squiggleStart = Math.max(0, relativeOffset); // TODO/REVIEW: this doesn't work quite right in the browser if a multi file test has files whose names are just the right length relative to one another - outputLines.push(" " + line.substr(0, squiggleStart).replace(/[^\s]/g, " ") + new Array(Math.min(length, line.length - squiggleStart) + 1).join("~")); + outputLines += (newLine() + " " + line.substr(0, squiggleStart).replace(/[^\s]/g, " ") + new Array(Math.min(length, line.length - squiggleStart) + 1).join("~")); // If the error ended here, or we're at the end of the file, emit its message if ((lineIndex === lines.length - 1) || nextLineStart > end) { @@ -1383,7 +1408,7 @@ namespace Harness { assert.equal(totalErrorsReportedInNonLibraryFiles + numLibraryDiagnostics + numTest262HarnessDiagnostics, diagnostics.length, "total number of errors"); return minimalDiagnosticsToString(diagnostics) + - Harness.IO.newLine() + Harness.IO.newLine() + outputLines.join("\r\n"); + Harness.IO.newLine() + Harness.IO.newLine() + outputLines; } export function doErrorBaseline(baselinePath: string, inputFiles: TestFile[], errors: ts.Diagnostic[]) { @@ -1586,9 +1611,10 @@ namespace Harness { } } - const declFileCompilationResult = - Harness.Compiler.compileDeclarationFiles( - toBeCompiled, otherFiles, result, harnessSettings, options, /*currentDirectory*/ undefined); + const declFileContext = Harness.Compiler.prepareDeclarationCompilationContext( + toBeCompiled, otherFiles, result, harnessSettings, options, /*currentDirectory*/ undefined + ); + const declFileCompilationResult = Harness.Compiler.compileDeclarationFiles(declFileContext); if (declFileCompilationResult && declFileCompilationResult.declResult.errors.length) { jsCode += "\r\n\r\n//// [DtsFileErrors]\r\n"; diff --git a/src/harness/rwcRunner.ts b/src/harness/rwcRunner.ts index 98663863a937b..a1dc50349e42c 100644 --- a/src/harness/rwcRunner.ts +++ b/src/harness/rwcRunner.ts @@ -208,6 +208,14 @@ namespace RWC { }, baselineOpts); }); + it("has the expected types", () => { + // We don't need to pass the extension here because "doTypeAndSymbolBaseline" will append appropriate extension of ".types" or ".symbols" + Harness.Compiler.doTypeAndSymbolBaseline(baseName, compilerResult, inputFiles + .concat(otherFiles) + .filter(file => !!compilerResult.program.getSourceFile(file.unitName)) + .filter(e => !Harness.isDefaultLibraryFile(e.unitName)), baselineOpts); + }); + // Ideally, a generated declaration file will have no errors. But we allow generated // declaration file errors as part of the baseline. it("has the expected errors in generated declaration files", () => { @@ -217,8 +225,12 @@ namespace RWC { return null; } - const declFileCompilationResult = Harness.Compiler.compileDeclarationFiles( - inputFiles, otherFiles, compilerResult, /*harnessSettings*/ undefined, compilerOptions, currentDirectory); + const declContext = Harness.Compiler.prepareDeclarationCompilationContext( + inputFiles, otherFiles, compilerResult, /*harnessSettings*/ undefined, compilerOptions, currentDirectory + ); + // Reset compilerResult before calling into `compileDeclarationFiles` so the memory from the original compilation can be freed + compilerResult = undefined; + const declFileCompilationResult = Harness.Compiler.compileDeclarationFiles(declContext); return Harness.Compiler.minimalDiagnosticsToString(declFileCompilationResult.declResult.errors) + Harness.IO.newLine() + Harness.IO.newLine() + @@ -226,14 +238,6 @@ namespace RWC { }, baselineOpts); } }); - - it("has the expected types", () => { - // We don't need to pass the extension here because "doTypeAndSymbolBaseline" will append appropriate extension of ".types" or ".symbols" - Harness.Compiler.doTypeAndSymbolBaseline(baseName, compilerResult, inputFiles - .concat(otherFiles) - .filter(file => !!compilerResult.program.getSourceFile(file.unitName)) - .filter(e => !Harness.isDefaultLibraryFile(e.unitName)), baselineOpts); - }); }); } } From 85c10320db20136977adb10d7f71f48fcccfe8f7 Mon Sep 17 00:00:00 2001 From: Nathan Shively-Sanders Date: Wed, 9 Aug 2017 16:16:28 -0700 Subject: [PATCH 094/237] Test:property access respects readonly index signature --- ...ropertyAccessOfReadonlyIndexSignature.errors.txt | 13 +++++++++++++ .../propertyAccessOfReadonlyIndexSignature.js | 11 +++++++++++ .../propertyAccessOfReadonlyIndexSignature.ts | 6 ++++++ 3 files changed, 30 insertions(+) create mode 100644 tests/baselines/reference/propertyAccessOfReadonlyIndexSignature.errors.txt create mode 100644 tests/baselines/reference/propertyAccessOfReadonlyIndexSignature.js create mode 100644 tests/cases/compiler/propertyAccessOfReadonlyIndexSignature.ts diff --git a/tests/baselines/reference/propertyAccessOfReadonlyIndexSignature.errors.txt b/tests/baselines/reference/propertyAccessOfReadonlyIndexSignature.errors.txt new file mode 100644 index 0000000000000..8fa06244162f0 --- /dev/null +++ b/tests/baselines/reference/propertyAccessOfReadonlyIndexSignature.errors.txt @@ -0,0 +1,13 @@ +tests/cases/compiler/propertyAccessOfReadonlyIndexSignature.ts(6,1): error TS2542: Index signature in type 'Test' only permits reading. + + +==== tests/cases/compiler/propertyAccessOfReadonlyIndexSignature.ts (1 errors) ==== + interface Test { + readonly [key: string]: string; + } + + declare var a: Test; + a.foo = 'baz'; + ~~~~~ +!!! error TS2542: Index signature in type 'Test' only permits reading. + \ No newline at end of file diff --git a/tests/baselines/reference/propertyAccessOfReadonlyIndexSignature.js b/tests/baselines/reference/propertyAccessOfReadonlyIndexSignature.js new file mode 100644 index 0000000000000..a1069eca553b8 --- /dev/null +++ b/tests/baselines/reference/propertyAccessOfReadonlyIndexSignature.js @@ -0,0 +1,11 @@ +//// [propertyAccessOfReadonlyIndexSignature.ts] +interface Test { + readonly [key: string]: string; +} + +declare var a: Test; +a.foo = 'baz'; + + +//// [propertyAccessOfReadonlyIndexSignature.js] +a.foo = 'baz'; diff --git a/tests/cases/compiler/propertyAccessOfReadonlyIndexSignature.ts b/tests/cases/compiler/propertyAccessOfReadonlyIndexSignature.ts new file mode 100644 index 0000000000000..c5f28c5b09732 --- /dev/null +++ b/tests/cases/compiler/propertyAccessOfReadonlyIndexSignature.ts @@ -0,0 +1,6 @@ +interface Test { + readonly [key: string]: string; +} + +declare var a: Test; +a.foo = 'baz'; From 8fde483393cf85a04fb96425a4252fa8c4e80a98 Mon Sep 17 00:00:00 2001 From: Wesley Wigham Date: Thu, 10 Aug 2017 00:10:36 -0700 Subject: [PATCH 095/237] Add test for #16144 (#17712) --- tests/baselines/reference/tsxUnionSpread.js | 38 ++++++++++ .../reference/tsxUnionSpread.symbols | 64 ++++++++++++++++ .../baselines/reference/tsxUnionSpread.types | 74 +++++++++++++++++++ tests/cases/compiler/tsxUnionSpread.tsx | 24 ++++++ 4 files changed, 200 insertions(+) create mode 100644 tests/baselines/reference/tsxUnionSpread.js create mode 100644 tests/baselines/reference/tsxUnionSpread.symbols create mode 100644 tests/baselines/reference/tsxUnionSpread.types create mode 100644 tests/cases/compiler/tsxUnionSpread.tsx diff --git a/tests/baselines/reference/tsxUnionSpread.js b/tests/baselines/reference/tsxUnionSpread.js new file mode 100644 index 0000000000000..f84e6ab21668c --- /dev/null +++ b/tests/baselines/reference/tsxUnionSpread.js @@ -0,0 +1,38 @@ +//// [index.tsx] +namespace JSX { + export interface Element {} +} + +export type CatInfo = { type: 'Cat'; subType: string; }; +export type DogInfo = { type: 'Dog'; }; +export type AnimalInfo = CatInfo | DogInfo; + +function AnimalComponent(info: AnimalInfo): JSX.Element { + return undefined as any; +} + +function getProps(): AnimalInfo { + // this may be from server or whatever ... + return { type: 'Cat', subType: 'Large' }; +} + +var props:AnimalInfo = getProps(); +var component = + +var props2:AnimalInfo = { type: 'Cat', subType: 'Large' }; +var component2 = + +//// [index.jsx] +"use strict"; +exports.__esModule = true; +function AnimalComponent(info) { + return undefined; +} +function getProps() { + // this may be from server or whatever ... + return { type: 'Cat', subType: 'Large' }; +} +var props = getProps(); +var component = ; +var props2 = { type: 'Cat', subType: 'Large' }; +var component2 = ; diff --git a/tests/baselines/reference/tsxUnionSpread.symbols b/tests/baselines/reference/tsxUnionSpread.symbols new file mode 100644 index 0000000000000..fa838773a8a42 --- /dev/null +++ b/tests/baselines/reference/tsxUnionSpread.symbols @@ -0,0 +1,64 @@ +=== tests/cases/compiler/index.tsx === +namespace JSX { +>JSX : Symbol(JSX, Decl(index.tsx, 0, 0)) + + export interface Element {} +>Element : Symbol(Element, Decl(index.tsx, 0, 15)) +} + +export type CatInfo = { type: 'Cat'; subType: string; }; +>CatInfo : Symbol(CatInfo, Decl(index.tsx, 2, 1)) +>type : Symbol(type, Decl(index.tsx, 4, 23)) +>subType : Symbol(subType, Decl(index.tsx, 4, 36)) + +export type DogInfo = { type: 'Dog'; }; +>DogInfo : Symbol(DogInfo, Decl(index.tsx, 4, 56)) +>type : Symbol(type, Decl(index.tsx, 5, 23)) + +export type AnimalInfo = CatInfo | DogInfo; +>AnimalInfo : Symbol(AnimalInfo, Decl(index.tsx, 5, 39)) +>CatInfo : Symbol(CatInfo, Decl(index.tsx, 2, 1)) +>DogInfo : Symbol(DogInfo, Decl(index.tsx, 4, 56)) + +function AnimalComponent(info: AnimalInfo): JSX.Element { +>AnimalComponent : Symbol(AnimalComponent, Decl(index.tsx, 6, 43)) +>info : Symbol(info, Decl(index.tsx, 8, 25)) +>AnimalInfo : Symbol(AnimalInfo, Decl(index.tsx, 5, 39)) +>JSX : Symbol(JSX, Decl(index.tsx, 0, 0)) +>Element : Symbol(JSX.Element, Decl(index.tsx, 0, 15)) + + return undefined as any; +>undefined : Symbol(undefined) +} + +function getProps(): AnimalInfo { +>getProps : Symbol(getProps, Decl(index.tsx, 10, 1)) +>AnimalInfo : Symbol(AnimalInfo, Decl(index.tsx, 5, 39)) + + // this may be from server or whatever ... + return { type: 'Cat', subType: 'Large' }; +>type : Symbol(type, Decl(index.tsx, 14, 12)) +>subType : Symbol(subType, Decl(index.tsx, 14, 25)) +} + +var props:AnimalInfo = getProps(); +>props : Symbol(props, Decl(index.tsx, 17, 3)) +>AnimalInfo : Symbol(AnimalInfo, Decl(index.tsx, 5, 39)) +>getProps : Symbol(getProps, Decl(index.tsx, 10, 1)) + +var component = +>component : Symbol(component, Decl(index.tsx, 18, 3)) +>AnimalComponent : Symbol(AnimalComponent, Decl(index.tsx, 6, 43)) +>props : Symbol(props, Decl(index.tsx, 17, 3)) + +var props2:AnimalInfo = { type: 'Cat', subType: 'Large' }; +>props2 : Symbol(props2, Decl(index.tsx, 20, 3)) +>AnimalInfo : Symbol(AnimalInfo, Decl(index.tsx, 5, 39)) +>type : Symbol(type, Decl(index.tsx, 20, 25)) +>subType : Symbol(subType, Decl(index.tsx, 20, 38)) + +var component2 = +>component2 : Symbol(component2, Decl(index.tsx, 21, 3)) +>AnimalComponent : Symbol(AnimalComponent, Decl(index.tsx, 6, 43)) +>props2 : Symbol(props2, Decl(index.tsx, 20, 3)) + diff --git a/tests/baselines/reference/tsxUnionSpread.types b/tests/baselines/reference/tsxUnionSpread.types new file mode 100644 index 0000000000000..11e6308fe18c4 --- /dev/null +++ b/tests/baselines/reference/tsxUnionSpread.types @@ -0,0 +1,74 @@ +=== tests/cases/compiler/index.tsx === +namespace JSX { +>JSX : any + + export interface Element {} +>Element : Element +} + +export type CatInfo = { type: 'Cat'; subType: string; }; +>CatInfo : CatInfo +>type : "Cat" +>subType : string + +export type DogInfo = { type: 'Dog'; }; +>DogInfo : DogInfo +>type : "Dog" + +export type AnimalInfo = CatInfo | DogInfo; +>AnimalInfo : AnimalInfo +>CatInfo : CatInfo +>DogInfo : DogInfo + +function AnimalComponent(info: AnimalInfo): JSX.Element { +>AnimalComponent : (info: AnimalInfo) => JSX.Element +>info : AnimalInfo +>AnimalInfo : AnimalInfo +>JSX : any +>Element : JSX.Element + + return undefined as any; +>undefined as any : any +>undefined : undefined +} + +function getProps(): AnimalInfo { +>getProps : () => AnimalInfo +>AnimalInfo : AnimalInfo + + // this may be from server or whatever ... + return { type: 'Cat', subType: 'Large' }; +>{ type: 'Cat', subType: 'Large' } : { type: "Cat"; subType: string; } +>type : string +>'Cat' : "Cat" +>subType : string +>'Large' : "Large" +} + +var props:AnimalInfo = getProps(); +>props : AnimalInfo +>AnimalInfo : AnimalInfo +>getProps() : AnimalInfo +>getProps : () => AnimalInfo + +var component = +>component : any +> : any +>AnimalComponent : (info: AnimalInfo) => JSX.Element +>props : AnimalInfo + +var props2:AnimalInfo = { type: 'Cat', subType: 'Large' }; +>props2 : AnimalInfo +>AnimalInfo : AnimalInfo +>{ type: 'Cat', subType: 'Large' } : { type: "Cat"; subType: string; } +>type : string +>'Cat' : "Cat" +>subType : string +>'Large' : "Large" + +var component2 = +>component2 : any +> : any +>AnimalComponent : (info: AnimalInfo) => JSX.Element +>props2 : CatInfo + diff --git a/tests/cases/compiler/tsxUnionSpread.tsx b/tests/cases/compiler/tsxUnionSpread.tsx new file mode 100644 index 0000000000000..daa663db87f03 --- /dev/null +++ b/tests/cases/compiler/tsxUnionSpread.tsx @@ -0,0 +1,24 @@ +// @jsx: preserve +// @filename: index.tsx +namespace JSX { + export interface Element {} +} + +export type CatInfo = { type: 'Cat'; subType: string; }; +export type DogInfo = { type: 'Dog'; }; +export type AnimalInfo = CatInfo | DogInfo; + +function AnimalComponent(info: AnimalInfo): JSX.Element { + return undefined as any; +} + +function getProps(): AnimalInfo { + // this may be from server or whatever ... + return { type: 'Cat', subType: 'Large' }; +} + +var props:AnimalInfo = getProps(); +var component = + +var props2:AnimalInfo = { type: 'Cat', subType: 'Large' }; +var component2 = \ No newline at end of file From 2c4361aadf40584404b0aad2d5bce91743f8cc5b Mon Sep 17 00:00:00 2001 From: Andy Date: Thu, 10 Aug 2017 06:51:50 -0700 Subject: [PATCH 096/237] Simplify `assignTypeToParameterAndFixTypeParameters` (#17706) --- src/compiler/checker.ts | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index aaf5b0bc4f998..62c8cb5f56a6d 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -16586,14 +16586,14 @@ namespace ts { // When contextual typing assigns a type to a parameter that contains a binding pattern, we also need to push // the destructured type into the contained binding elements. - function assignBindingElementTypes(node: VariableLikeDeclaration) { - if (isBindingPattern(node.name)) { - for (const element of node.name.elements) { - if (!isOmittedExpression(element)) { - if (element.name.kind === SyntaxKind.Identifier) { - getSymbolLinks(getSymbolOfNode(element)).type = getTypeForBindingElement(element); - } - assignBindingElementTypes(element); + function assignBindingElementTypes(pattern: BindingPattern) { + for (const element of pattern.elements) { + if (!isOmittedExpression(element)) { + if (element.name.kind === SyntaxKind.Identifier) { + getSymbolLinks(getSymbolOfNode(element)).type = getTypeForBindingElement(element); + } + else { + assignBindingElementTypes(element.name); } } } @@ -16603,13 +16603,14 @@ namespace ts { const links = getSymbolLinks(parameter); if (!links.type) { links.type = contextualType; - const name = getNameOfDeclaration(parameter.valueDeclaration); - // if inference didn't come up with anything but {}, fall back to the binding pattern if present. - if (links.type === emptyObjectType && - (name.kind === SyntaxKind.ObjectBindingPattern || name.kind === SyntaxKind.ArrayBindingPattern)) { - links.type = getTypeFromBindingPattern(name); + const decl = parameter.valueDeclaration as ParameterDeclaration; + if (decl.name.kind !== SyntaxKind.Identifier) { + // if inference didn't come up with anything but {}, fall back to the binding pattern if present. + if (links.type === emptyObjectType) { + links.type = getTypeFromBindingPattern(decl.name); + } + assignBindingElementTypes(decl.name); } - assignBindingElementTypes(parameter.valueDeclaration); } } From 4c824505ade0740cf2848ebd862eccbabd1771db Mon Sep 17 00:00:00 2001 From: Andy Date: Thu, 10 Aug 2017 06:53:48 -0700 Subject: [PATCH 097/237] Treat NoSubstitutionTemplateLiteral same as a StringLiteral (#17704) --- src/compiler/checker.ts | 16 +++++++--------- tests/baselines/reference/asOperator3.types | 4 ++-- tests/baselines/reference/asOperatorASI.types | 2 +- .../reference/computedPropertyNames10_ES5.types | 2 +- .../reference/computedPropertyNames10_ES6.types | 2 +- .../reference/computedPropertyNames11_ES5.types | 2 +- .../reference/computedPropertyNames11_ES6.types | 2 +- .../reference/computedPropertyNames13_ES5.types | 2 +- .../reference/computedPropertyNames13_ES6.types | 2 +- .../reference/computedPropertyNames16_ES5.types | 2 +- .../reference/computedPropertyNames16_ES6.types | 2 +- .../reference/computedPropertyNames4_ES5.types | 2 +- .../reference/computedPropertyNames4_ES6.types | 2 +- ...nWithDefaultParameterWithNoStatements4.types | 4 ++-- ...LiteralTypesWithTemplateStrings01.errors.txt | 17 ----------------- ...ingLiteralTypesWithTemplateStrings01.symbols | 14 ++++++++++++++ ...tringLiteralTypesWithTemplateStrings01.types | 17 +++++++++++++++++ ...LiteralTypesWithTemplateStrings02.errors.txt | 4 ++-- ...PlainCharactersThatArePartsOfEscapes01.types | 2 +- ...nCharactersThatArePartsOfEscapes01_ES6.types | 2 +- ...edTemplateStringsWithMultilineTemplate.types | 2 +- ...emplateStringsWithMultilineTemplateES6.types | 2 +- ...aggedTemplateStringsWithTagsTypedAsAny.types | 12 ++++++------ ...edTemplateStringsWithTagsTypedAsAnyES6.types | 12 ++++++------ .../taggedTemplateStringsWithTypedTags.types | 10 +++++----- .../taggedTemplateStringsWithTypedTagsES6.types | 10 +++++----- ...edTemplateStringsWithWhitespaceEscapes.types | 2 +- ...emplateStringsWithWhitespaceEscapesES6.types | 2 +- .../taggedTemplateUntypedTagCall01.types | 2 +- ...emplateStringControlCharacterEscapes01.types | 2 +- ...ateStringControlCharacterEscapes01_ES6.types | 2 +- ...emplateStringControlCharacterEscapes02.types | 2 +- ...ateStringControlCharacterEscapes02_ES6.types | 2 +- ...emplateStringControlCharacterEscapes03.types | 2 +- ...ateStringControlCharacterEscapes03_ES6.types | 2 +- ...emplateStringControlCharacterEscapes04.types | 2 +- ...ateStringControlCharacterEscapes04_ES6.types | 2 +- .../templateStringInEqualityChecks.types | 4 ++-- .../templateStringInEqualityChecksES6.types | 4 ++-- .../templateStringInIndexExpression.types | 2 +- .../templateStringInIndexExpressionES6.types | 2 +- .../templateStringInSwitchAndCase.types | 4 ++-- .../templateStringInSwitchAndCaseES6.types | 4 ++-- .../reference/templateStringMultiline1.types | 2 +- .../templateStringMultiline1_ES6.types | 2 +- .../reference/templateStringMultiline2.types | 2 +- .../templateStringMultiline2_ES6.types | 2 +- .../reference/templateStringMultiline3.types | 2 +- .../templateStringMultiline3_ES6.types | 2 +- ...PlainCharactersThatArePartsOfEscapes01.types | 2 +- ...nCharactersThatArePartsOfEscapes01_ES6.types | 2 +- .../reference/templateStringTermination1.types | 2 +- .../templateStringTermination1_ES6.types | 2 +- .../reference/templateStringTermination2.types | 2 +- .../templateStringTermination2_ES6.types | 2 +- .../reference/templateStringTermination3.types | 2 +- .../templateStringTermination3_ES6.types | 2 +- .../reference/templateStringTermination4.types | 2 +- .../templateStringTermination4_ES6.types | 2 +- .../reference/templateStringTermination5.types | 2 +- .../templateStringTermination5_ES6.types | 2 +- .../templateStringWhitespaceEscapes1.types | 2 +- .../templateStringWhitespaceEscapes1_ES6.types | 2 +- .../templateStringWhitespaceEscapes2.types | 2 +- .../templateStringWhitespaceEscapes2_ES6.types | 2 +- .../templateStringWithBackslashEscapes01.types | 8 ++++---- ...mplateStringWithBackslashEscapes01_ES6.types | 8 ++++---- ...templateStringWithEmptyLiteralPortions.types | 2 +- ...plateStringWithEmptyLiteralPortionsES6.types | 2 +- .../templateStringWithPropertyAccess.types | 2 +- .../templateStringWithPropertyAccessES6.types | 2 +- .../reference/typeGuardIntersectionTypes.types | 8 ++++---- ...nicodeExtendedEscapesInTemplates01_ES5.types | 2 +- ...nicodeExtendedEscapesInTemplates01_ES6.types | 2 +- ...nicodeExtendedEscapesInTemplates02_ES5.types | 2 +- ...nicodeExtendedEscapesInTemplates02_ES6.types | 2 +- ...nicodeExtendedEscapesInTemplates03_ES5.types | 2 +- ...nicodeExtendedEscapesInTemplates03_ES6.types | 2 +- ...nicodeExtendedEscapesInTemplates04_ES5.types | 2 +- ...nicodeExtendedEscapesInTemplates04_ES6.types | 2 +- ...nicodeExtendedEscapesInTemplates05_ES5.types | 2 +- ...nicodeExtendedEscapesInTemplates05_ES6.types | 2 +- ...nicodeExtendedEscapesInTemplates06_ES5.types | 2 +- ...nicodeExtendedEscapesInTemplates06_ES6.types | 2 +- ...nicodeExtendedEscapesInTemplates08_ES5.types | 2 +- ...nicodeExtendedEscapesInTemplates08_ES6.types | 2 +- ...nicodeExtendedEscapesInTemplates09_ES5.types | 2 +- ...nicodeExtendedEscapesInTemplates09_ES6.types | 2 +- ...nicodeExtendedEscapesInTemplates10_ES5.types | 2 +- ...nicodeExtendedEscapesInTemplates10_ES6.types | 2 +- ...nicodeExtendedEscapesInTemplates11_ES5.types | 2 +- ...nicodeExtendedEscapesInTemplates11_ES6.types | 2 +- ...nicodeExtendedEscapesInTemplates13_ES5.types | 2 +- ...nicodeExtendedEscapesInTemplates13_ES6.types | 2 +- ...nicodeExtendedEscapesInTemplates15_ES5.types | 2 +- ...nicodeExtendedEscapesInTemplates15_ES6.types | 2 +- ...nicodeExtendedEscapesInTemplates16_ES5.types | 2 +- ...nicodeExtendedEscapesInTemplates16_ES6.types | 2 +- ...nicodeExtendedEscapesInTemplates18_ES5.types | 2 +- ...nicodeExtendedEscapesInTemplates18_ES6.types | 2 +- ...nicodeExtendedEscapesInTemplates20_ES5.types | 2 +- ...nicodeExtendedEscapesInTemplates20_ES6.types | 2 +- 102 files changed, 170 insertions(+), 158 deletions(-) delete mode 100644 tests/baselines/reference/stringLiteralTypesWithTemplateStrings01.errors.txt create mode 100644 tests/baselines/reference/stringLiteralTypesWithTemplateStrings01.symbols create mode 100644 tests/baselines/reference/stringLiteralTypesWithTemplateStrings01.types diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 62c8cb5f56a6d..25004df71e0d7 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -17757,15 +17757,14 @@ namespace ts { return getBestChoiceType(type1, type2); } - function checkLiteralExpression(node: Expression): Type { - if (node.kind === SyntaxKind.NumericLiteral) { - checkGrammarNumericLiteral(node); - } + function checkLiteralExpression(node: LiteralExpression | Token): Type { switch (node.kind) { + case SyntaxKind.NoSubstitutionTemplateLiteral: case SyntaxKind.StringLiteral: - return getFreshTypeOfLiteralType(getLiteralType((node).text)); + return getFreshTypeOfLiteralType(getLiteralType(node.text)); case SyntaxKind.NumericLiteral: - return getFreshTypeOfLiteralType(getLiteralType(+(node).text)); + checkGrammarNumericLiteral(node); + return getFreshTypeOfLiteralType(getLiteralType(+node.text)); case SyntaxKind.TrueKeyword: return trueType; case SyntaxKind.FalseKeyword: @@ -17983,15 +17982,14 @@ namespace ts { return checkSuperExpression(node); case SyntaxKind.NullKeyword: return nullWideningType; + case SyntaxKind.NoSubstitutionTemplateLiteral: case SyntaxKind.StringLiteral: case SyntaxKind.NumericLiteral: case SyntaxKind.TrueKeyword: case SyntaxKind.FalseKeyword: - return checkLiteralExpression(node); + return checkLiteralExpression(node as LiteralExpression); case SyntaxKind.TemplateExpression: return checkTemplateExpression(node); - case SyntaxKind.NoSubstitutionTemplateLiteral: - return stringType; case SyntaxKind.RegularExpressionLiteral: return globalRegExpType; case SyntaxKind.ArrayLiteralExpression: diff --git a/tests/baselines/reference/asOperator3.types b/tests/baselines/reference/asOperator3.types index a888d70892b3e..e5e319d3caf3a 100644 --- a/tests/baselines/reference/asOperator3.types +++ b/tests/baselines/reference/asOperator3.types @@ -36,7 +36,7 @@ var d = `Hello ${123} World` as string; var e = `Hello` as string; >e : string >`Hello` as string : string ->`Hello` : string +>`Hello` : "Hello" var f = 1 + `${1} end of string` as string; >f : string @@ -59,5 +59,5 @@ var h = tag `Hello` as string; >tag `Hello` as string : string >tag `Hello` : any >tag : (...x: any[]) => any ->`Hello` : string +>`Hello` : "Hello" diff --git a/tests/baselines/reference/asOperatorASI.types b/tests/baselines/reference/asOperatorASI.types index e5e1de88c29fd..985806bf040e2 100644 --- a/tests/baselines/reference/asOperatorASI.types +++ b/tests/baselines/reference/asOperatorASI.types @@ -14,7 +14,7 @@ var x = 10 as `Hello world`; // should not error >as `Hello world` : any >as : (...args: any[]) => any ->`Hello world` : string +>`Hello world` : "Hello world" // Example 2 var y = 20 diff --git a/tests/baselines/reference/computedPropertyNames10_ES5.types b/tests/baselines/reference/computedPropertyNames10_ES5.types index 9613097929857..4750d44fde8b2 100644 --- a/tests/baselines/reference/computedPropertyNames10_ES5.types +++ b/tests/baselines/reference/computedPropertyNames10_ES5.types @@ -46,7 +46,7 @@ var v = { >true : true [`hello bye`]() { }, ->`hello bye` : string +>`hello bye` : "hello bye" [`hello ${a} bye`]() { } >`hello ${a} bye` : string diff --git a/tests/baselines/reference/computedPropertyNames10_ES6.types b/tests/baselines/reference/computedPropertyNames10_ES6.types index 5bbda2e8f19c0..3a12047f588fe 100644 --- a/tests/baselines/reference/computedPropertyNames10_ES6.types +++ b/tests/baselines/reference/computedPropertyNames10_ES6.types @@ -46,7 +46,7 @@ var v = { >true : true [`hello bye`]() { }, ->`hello bye` : string +>`hello bye` : "hello bye" [`hello ${a} bye`]() { } >`hello ${a} bye` : string diff --git a/tests/baselines/reference/computedPropertyNames11_ES5.types b/tests/baselines/reference/computedPropertyNames11_ES5.types index 88fbc690323e8..08aa14aa91145 100644 --- a/tests/baselines/reference/computedPropertyNames11_ES5.types +++ b/tests/baselines/reference/computedPropertyNames11_ES5.types @@ -55,7 +55,7 @@ var v = { >0 : 0 set [`hello bye`](v) { }, ->`hello bye` : string +>`hello bye` : "hello bye" >v : any get [`hello ${a} bye`]() { return 0; } diff --git a/tests/baselines/reference/computedPropertyNames11_ES6.types b/tests/baselines/reference/computedPropertyNames11_ES6.types index 458d6d1de4904..2f61eb59d6179 100644 --- a/tests/baselines/reference/computedPropertyNames11_ES6.types +++ b/tests/baselines/reference/computedPropertyNames11_ES6.types @@ -55,7 +55,7 @@ var v = { >0 : 0 set [`hello bye`](v) { }, ->`hello bye` : string +>`hello bye` : "hello bye" >v : any get [`hello ${a} bye`]() { return 0; } diff --git a/tests/baselines/reference/computedPropertyNames13_ES5.types b/tests/baselines/reference/computedPropertyNames13_ES5.types index 2585fe15f94e9..a4381fdb891e6 100644 --- a/tests/baselines/reference/computedPropertyNames13_ES5.types +++ b/tests/baselines/reference/computedPropertyNames13_ES5.types @@ -45,7 +45,7 @@ class C { >true : true [`hello bye`]() { } ->`hello bye` : string +>`hello bye` : "hello bye" static [`hello ${a} bye`]() { } >`hello ${a} bye` : string diff --git a/tests/baselines/reference/computedPropertyNames13_ES6.types b/tests/baselines/reference/computedPropertyNames13_ES6.types index 61e8cae265c0a..48a989f9af1dd 100644 --- a/tests/baselines/reference/computedPropertyNames13_ES6.types +++ b/tests/baselines/reference/computedPropertyNames13_ES6.types @@ -45,7 +45,7 @@ class C { >true : true [`hello bye`]() { } ->`hello bye` : string +>`hello bye` : "hello bye" static [`hello ${a} bye`]() { } >`hello ${a} bye` : string diff --git a/tests/baselines/reference/computedPropertyNames16_ES5.types b/tests/baselines/reference/computedPropertyNames16_ES5.types index 5c0fb34bc25dc..5f14d4d4c5d7f 100644 --- a/tests/baselines/reference/computedPropertyNames16_ES5.types +++ b/tests/baselines/reference/computedPropertyNames16_ES5.types @@ -54,7 +54,7 @@ class C { >0 : 0 set [`hello bye`](v) { } ->`hello bye` : string +>`hello bye` : "hello bye" >v : any get [`hello ${a} bye`]() { return 0; } diff --git a/tests/baselines/reference/computedPropertyNames16_ES6.types b/tests/baselines/reference/computedPropertyNames16_ES6.types index 7ebb2cd006051..d7f00f77d324d 100644 --- a/tests/baselines/reference/computedPropertyNames16_ES6.types +++ b/tests/baselines/reference/computedPropertyNames16_ES6.types @@ -54,7 +54,7 @@ class C { >0 : 0 set [`hello bye`](v) { } ->`hello bye` : string +>`hello bye` : "hello bye" >v : any get [`hello ${a} bye`]() { return 0; } diff --git a/tests/baselines/reference/computedPropertyNames4_ES5.types b/tests/baselines/reference/computedPropertyNames4_ES5.types index 6f875aaddac3f..fc883aa2833b8 100644 --- a/tests/baselines/reference/computedPropertyNames4_ES5.types +++ b/tests/baselines/reference/computedPropertyNames4_ES5.types @@ -55,7 +55,7 @@ var v = { >0 : 0 [`hello bye`]: 0, ->`hello bye` : string +>`hello bye` : "hello bye" >0 : 0 [`hello ${a} bye`]: 0 diff --git a/tests/baselines/reference/computedPropertyNames4_ES6.types b/tests/baselines/reference/computedPropertyNames4_ES6.types index e9feac0a81fcb..5704841b97fdb 100644 --- a/tests/baselines/reference/computedPropertyNames4_ES6.types +++ b/tests/baselines/reference/computedPropertyNames4_ES6.types @@ -55,7 +55,7 @@ var v = { >0 : 0 [`hello bye`]: 0, ->`hello bye` : string +>`hello bye` : "hello bye" >0 : 0 [`hello ${a} bye`]: 0 diff --git a/tests/baselines/reference/functionWithDefaultParameterWithNoStatements4.types b/tests/baselines/reference/functionWithDefaultParameterWithNoStatements4.types index bfc627fa60a34..3e6c4f65f4382 100644 --- a/tests/baselines/reference/functionWithDefaultParameterWithNoStatements4.types +++ b/tests/baselines/reference/functionWithDefaultParameterWithNoStatements4.types @@ -2,10 +2,10 @@ function foo(a = ``) { } >foo : (a?: string) => void >a : string ->`` : string +>`` : "" function bar(a = ``) { >bar : (a?: string) => void >a : string ->`` : string +>`` : "" } diff --git a/tests/baselines/reference/stringLiteralTypesWithTemplateStrings01.errors.txt b/tests/baselines/reference/stringLiteralTypesWithTemplateStrings01.errors.txt deleted file mode 100644 index a1819ddb82f72..0000000000000 --- a/tests/baselines/reference/stringLiteralTypesWithTemplateStrings01.errors.txt +++ /dev/null @@ -1,17 +0,0 @@ -tests/cases/conformance/types/stringLiteral/stringLiteralTypesWithTemplateStrings01.ts(1,5): error TS2322: Type 'string' is not assignable to type '"ABC"'. -tests/cases/conformance/types/stringLiteral/stringLiteralTypesWithTemplateStrings01.ts(2,5): error TS2322: Type 'string' is not assignable to type '"DE\nF"'. -tests/cases/conformance/types/stringLiteral/stringLiteralTypesWithTemplateStrings01.ts(5,5): error TS2322: Type 'string' is not assignable to type '"JK`L"'. - - -==== tests/cases/conformance/types/stringLiteral/stringLiteralTypesWithTemplateStrings01.ts (3 errors) ==== - let ABC: "ABC" = `ABC`; - ~~~ -!!! error TS2322: Type 'string' is not assignable to type '"ABC"'. - let DE_NEWLINE_F: "DE\nF" = `DE - ~~~~~~~~~~~~ -!!! error TS2322: Type 'string' is not assignable to type '"DE\nF"'. - F`; - let G_QUOTE_HI: 'G"HI'; - let JK_BACKTICK_L: "JK`L" = `JK\`L`; - ~~~~~~~~~~~~~ -!!! error TS2322: Type 'string' is not assignable to type '"JK`L"'. \ No newline at end of file diff --git a/tests/baselines/reference/stringLiteralTypesWithTemplateStrings01.symbols b/tests/baselines/reference/stringLiteralTypesWithTemplateStrings01.symbols new file mode 100644 index 0000000000000..3ca04bd04af11 --- /dev/null +++ b/tests/baselines/reference/stringLiteralTypesWithTemplateStrings01.symbols @@ -0,0 +1,14 @@ +=== tests/cases/conformance/types/stringLiteral/stringLiteralTypesWithTemplateStrings01.ts === +let ABC: "ABC" = `ABC`; +>ABC : Symbol(ABC, Decl(stringLiteralTypesWithTemplateStrings01.ts, 0, 3)) + +let DE_NEWLINE_F: "DE\nF" = `DE +>DE_NEWLINE_F : Symbol(DE_NEWLINE_F, Decl(stringLiteralTypesWithTemplateStrings01.ts, 1, 3)) + +F`; +let G_QUOTE_HI: 'G"HI'; +>G_QUOTE_HI : Symbol(G_QUOTE_HI, Decl(stringLiteralTypesWithTemplateStrings01.ts, 3, 3)) + +let JK_BACKTICK_L: "JK`L" = `JK\`L`; +>JK_BACKTICK_L : Symbol(JK_BACKTICK_L, Decl(stringLiteralTypesWithTemplateStrings01.ts, 4, 3)) + diff --git a/tests/baselines/reference/stringLiteralTypesWithTemplateStrings01.types b/tests/baselines/reference/stringLiteralTypesWithTemplateStrings01.types new file mode 100644 index 0000000000000..abe2943d07d97 --- /dev/null +++ b/tests/baselines/reference/stringLiteralTypesWithTemplateStrings01.types @@ -0,0 +1,17 @@ +=== tests/cases/conformance/types/stringLiteral/stringLiteralTypesWithTemplateStrings01.ts === +let ABC: "ABC" = `ABC`; +>ABC : "ABC" +>`ABC` : "ABC" + +let DE_NEWLINE_F: "DE\nF" = `DE +>DE_NEWLINE_F : "DE\nF" +>`DEF` : "DE\nF" + +F`; +let G_QUOTE_HI: 'G"HI'; +>G_QUOTE_HI : "G\"HI" + +let JK_BACKTICK_L: "JK`L" = `JK\`L`; +>JK_BACKTICK_L : "JK`L" +>`JK\`L` : "JK`L" + diff --git a/tests/baselines/reference/stringLiteralTypesWithTemplateStrings02.errors.txt b/tests/baselines/reference/stringLiteralTypesWithTemplateStrings02.errors.txt index 8c69e595e255a..4137661f0bef9 100644 --- a/tests/baselines/reference/stringLiteralTypesWithTemplateStrings02.errors.txt +++ b/tests/baselines/reference/stringLiteralTypesWithTemplateStrings02.errors.txt @@ -1,11 +1,11 @@ -tests/cases/conformance/types/stringLiteral/stringLiteralTypesWithTemplateStrings02.ts(1,5): error TS2322: Type 'string' is not assignable to type '"AB\r\nC"'. +tests/cases/conformance/types/stringLiteral/stringLiteralTypesWithTemplateStrings02.ts(1,5): error TS2322: Type '"AB\nC"' is not assignable to type '"AB\r\nC"'. tests/cases/conformance/types/stringLiteral/stringLiteralTypesWithTemplateStrings02.ts(3,5): error TS2322: Type 'string' is not assignable to type '"DE\nF"'. ==== tests/cases/conformance/types/stringLiteral/stringLiteralTypesWithTemplateStrings02.ts (2 errors) ==== let abc: "AB\r\nC" = `AB ~~~ -!!! error TS2322: Type 'string' is not assignable to type '"AB\r\nC"'. +!!! error TS2322: Type '"AB\nC"' is not assignable to type '"AB\r\nC"'. C`; let de_NEWLINE_f: "DE\nF" = `DE${"\n"}F`; ~~~~~~~~~~~~ diff --git a/tests/baselines/reference/taggedTemplateStringsPlainCharactersThatArePartsOfEscapes01.types b/tests/baselines/reference/taggedTemplateStringsPlainCharactersThatArePartsOfEscapes01.types index 9b394f2bceb7c..9f4ee0eb73a5f 100644 --- a/tests/baselines/reference/taggedTemplateStringsPlainCharactersThatArePartsOfEscapes01.types +++ b/tests/baselines/reference/taggedTemplateStringsPlainCharactersThatArePartsOfEscapes01.types @@ -8,5 +8,5 @@ function f(...x: any[]) { f `0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 2028 2029 0085 t v f b r n` >f `0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 2028 2029 0085 t v f b r n` : void >f : (...x: any[]) => void ->`0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 2028 2029 0085 t v f b r n` : string +>`0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 2028 2029 0085 t v f b r n` : "0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 2028 2029 0085 t v f b r n" diff --git a/tests/baselines/reference/taggedTemplateStringsPlainCharactersThatArePartsOfEscapes01_ES6.types b/tests/baselines/reference/taggedTemplateStringsPlainCharactersThatArePartsOfEscapes01_ES6.types index 775914faeeaf1..89a33c69fe061 100644 --- a/tests/baselines/reference/taggedTemplateStringsPlainCharactersThatArePartsOfEscapes01_ES6.types +++ b/tests/baselines/reference/taggedTemplateStringsPlainCharactersThatArePartsOfEscapes01_ES6.types @@ -8,5 +8,5 @@ function f(...x: any[]) { f `0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 2028 2029 0085 t v f b r n` >f `0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 2028 2029 0085 t v f b r n` : void >f : (...x: any[]) => void ->`0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 2028 2029 0085 t v f b r n` : string +>`0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 2028 2029 0085 t v f b r n` : "0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 2028 2029 0085 t v f b r n" diff --git a/tests/baselines/reference/taggedTemplateStringsWithMultilineTemplate.types b/tests/baselines/reference/taggedTemplateStringsWithMultilineTemplate.types index 52f7a517a4a59..d37c81fb88437 100644 --- a/tests/baselines/reference/taggedTemplateStringsWithMultilineTemplate.types +++ b/tests/baselines/reference/taggedTemplateStringsWithMultilineTemplate.types @@ -7,7 +7,7 @@ function f(...args: any[]): void { f ` >f `\` : void >f : (...args: any[]) => void ->`\` : string +>`\` : "\n\n" \ diff --git a/tests/baselines/reference/taggedTemplateStringsWithMultilineTemplateES6.types b/tests/baselines/reference/taggedTemplateStringsWithMultilineTemplateES6.types index 35374be6436e0..6582d8eb4a527 100644 --- a/tests/baselines/reference/taggedTemplateStringsWithMultilineTemplateES6.types +++ b/tests/baselines/reference/taggedTemplateStringsWithMultilineTemplateES6.types @@ -7,7 +7,7 @@ function f(...args: any[]): void { f ` >f `\` : void >f : (...args: any[]) => void ->`\` : string +>`\` : "\n\n" \ diff --git a/tests/baselines/reference/taggedTemplateStringsWithTagsTypedAsAny.types b/tests/baselines/reference/taggedTemplateStringsWithTagsTypedAsAny.types index 9e894240c939d..9bd975bb472ec 100644 --- a/tests/baselines/reference/taggedTemplateStringsWithTagsTypedAsAny.types +++ b/tests/baselines/reference/taggedTemplateStringsWithTagsTypedAsAny.types @@ -5,7 +5,7 @@ var f: any; f `abc` >f `abc` : any >f : any ->`abc` : string +>`abc` : "abc" f `abc${1}def${2}ghi`; >f `abc${1}def${2}ghi` : any @@ -21,7 +21,7 @@ f.g.h `abc` >f : any >g : any >h : any ->`abc` : string +>`abc` : "abc" f.g.h `abc${1}def${2}ghi`; >f.g.h `abc${1}def${2}ghi` : any @@ -38,7 +38,7 @@ f `abc`.member >f `abc`.member : any >f `abc` : any >f : any ->`abc` : string +>`abc` : "abc" >member : any f `abc${1}def${2}ghi`.member; @@ -54,7 +54,7 @@ f `abc`["member"]; >f `abc`["member"] : any >f `abc` : any >f : any ->`abc` : string +>`abc` : "abc" >"member" : "member" f `abc${1}def${2}ghi`["member"]; @@ -72,7 +72,7 @@ f `abc`["member"].someOtherTag `abc${1}def${2}ghi`; >f `abc`["member"] : any >f `abc` : any >f : any ->`abc` : string +>`abc` : "abc" >"member" : "member" >someOtherTag : any >`abc${1}def${2}ghi` : string @@ -99,7 +99,7 @@ f.thisIsNotATag(`abc`); >f.thisIsNotATag : any >f : any >thisIsNotATag : any ->`abc` : string +>`abc` : "abc" f.thisIsNotATag(`abc${1}def${2}ghi`); >f.thisIsNotATag(`abc${1}def${2}ghi`) : any diff --git a/tests/baselines/reference/taggedTemplateStringsWithTagsTypedAsAnyES6.types b/tests/baselines/reference/taggedTemplateStringsWithTagsTypedAsAnyES6.types index 99bb10f354616..3fde2cd552d42 100644 --- a/tests/baselines/reference/taggedTemplateStringsWithTagsTypedAsAnyES6.types +++ b/tests/baselines/reference/taggedTemplateStringsWithTagsTypedAsAnyES6.types @@ -5,7 +5,7 @@ var f: any; f `abc` >f `abc` : any >f : any ->`abc` : string +>`abc` : "abc" f `abc${1}def${2}ghi`; >f `abc${1}def${2}ghi` : any @@ -21,7 +21,7 @@ f.g.h `abc` >f : any >g : any >h : any ->`abc` : string +>`abc` : "abc" f.g.h `abc${1}def${2}ghi`; >f.g.h `abc${1}def${2}ghi` : any @@ -38,7 +38,7 @@ f `abc`.member >f `abc`.member : any >f `abc` : any >f : any ->`abc` : string +>`abc` : "abc" >member : any f `abc${1}def${2}ghi`.member; @@ -54,7 +54,7 @@ f `abc`["member"]; >f `abc`["member"] : any >f `abc` : any >f : any ->`abc` : string +>`abc` : "abc" >"member" : "member" f `abc${1}def${2}ghi`["member"]; @@ -72,7 +72,7 @@ f `abc`["member"].someOtherTag `abc${1}def${2}ghi`; >f `abc`["member"] : any >f `abc` : any >f : any ->`abc` : string +>`abc` : "abc" >"member" : "member" >someOtherTag : any >`abc${1}def${2}ghi` : string @@ -99,7 +99,7 @@ f.thisIsNotATag(`abc`); >f.thisIsNotATag : any >f : any >thisIsNotATag : any ->`abc` : string +>`abc` : "abc" f.thisIsNotATag(`abc${1}def${2}ghi`); >f.thisIsNotATag(`abc${1}def${2}ghi`) : any diff --git a/tests/baselines/reference/taggedTemplateStringsWithTypedTags.types b/tests/baselines/reference/taggedTemplateStringsWithTypedTags.types index 69b9368f765a9..02c50b835c1ab 100644 --- a/tests/baselines/reference/taggedTemplateStringsWithTypedTags.types +++ b/tests/baselines/reference/taggedTemplateStringsWithTypedTags.types @@ -36,7 +36,7 @@ var f: I; f `abc` >f `abc` : I >f : I ->`abc` : string +>`abc` : "abc" f `abc${1}def${2}ghi`; >f `abc${1}def${2}ghi` : I @@ -49,7 +49,7 @@ f `abc`.member >f `abc`.member : I >f `abc` : I >f : I ->`abc` : string +>`abc` : "abc" >member : I f `abc${1}def${2}ghi`.member; @@ -65,7 +65,7 @@ f `abc`["member"]; >f `abc`["member"] : I >f `abc` : I >f : I ->`abc` : string +>`abc` : "abc" >"member" : "member" f `abc${1}def${2}ghi`["member"]; @@ -83,7 +83,7 @@ f `abc`[0].member `abc${1}def${2}ghi`; >f `abc`[0] : I >f `abc` : I >f : I ->`abc` : string +>`abc` : "abc" >0 : 0 >member : I >`abc${1}def${2}ghi` : string @@ -110,7 +110,7 @@ f.thisIsNotATag(`abc`); >f.thisIsNotATag : (x: string) => void >f : I >thisIsNotATag : (x: string) => void ->`abc` : string +>`abc` : "abc" f.thisIsNotATag(`abc${1}def${2}ghi`); >f.thisIsNotATag(`abc${1}def${2}ghi`) : void diff --git a/tests/baselines/reference/taggedTemplateStringsWithTypedTagsES6.types b/tests/baselines/reference/taggedTemplateStringsWithTypedTagsES6.types index 97e2f011ca669..51fd5907f3c62 100644 --- a/tests/baselines/reference/taggedTemplateStringsWithTypedTagsES6.types +++ b/tests/baselines/reference/taggedTemplateStringsWithTypedTagsES6.types @@ -36,7 +36,7 @@ var f: I; f `abc` >f `abc` : I >f : I ->`abc` : string +>`abc` : "abc" f `abc${1}def${2}ghi`; >f `abc${1}def${2}ghi` : I @@ -49,7 +49,7 @@ f `abc`.member >f `abc`.member : I >f `abc` : I >f : I ->`abc` : string +>`abc` : "abc" >member : I f `abc${1}def${2}ghi`.member; @@ -65,7 +65,7 @@ f `abc`["member"]; >f `abc`["member"] : I >f `abc` : I >f : I ->`abc` : string +>`abc` : "abc" >"member" : "member" f `abc${1}def${2}ghi`["member"]; @@ -83,7 +83,7 @@ f `abc`[0].member `abc${1}def${2}ghi`; >f `abc`[0] : I >f `abc` : I >f : I ->`abc` : string +>`abc` : "abc" >0 : 0 >member : I >`abc${1}def${2}ghi` : string @@ -110,7 +110,7 @@ f.thisIsNotATag(`abc`); >f.thisIsNotATag : (x: string) => void >f : I >thisIsNotATag : (x: string) => void ->`abc` : string +>`abc` : "abc" f.thisIsNotATag(`abc${1}def${2}ghi`); >f.thisIsNotATag(`abc${1}def${2}ghi`) : void diff --git a/tests/baselines/reference/taggedTemplateStringsWithWhitespaceEscapes.types b/tests/baselines/reference/taggedTemplateStringsWithWhitespaceEscapes.types index e8c940954459f..97fb79dc1b43f 100644 --- a/tests/baselines/reference/taggedTemplateStringsWithWhitespaceEscapes.types +++ b/tests/baselines/reference/taggedTemplateStringsWithWhitespaceEscapes.types @@ -7,5 +7,5 @@ function f(...args: any[]) { f `\t\n\v\f\r\\`; >f `\t\n\v\f\r\\` : void >f : (...args: any[]) => void ->`\t\n\v\f\r\\` : string +>`\t\n\v\f\r\\` : "\t\n\v\f\r\\" diff --git a/tests/baselines/reference/taggedTemplateStringsWithWhitespaceEscapesES6.types b/tests/baselines/reference/taggedTemplateStringsWithWhitespaceEscapesES6.types index a4fa109cec72d..df78ab603b5be 100644 --- a/tests/baselines/reference/taggedTemplateStringsWithWhitespaceEscapesES6.types +++ b/tests/baselines/reference/taggedTemplateStringsWithWhitespaceEscapesES6.types @@ -7,5 +7,5 @@ function f(...args: any[]) { f `\t\n\v\f\r\\`; >f `\t\n\v\f\r\\` : void >f : (...args: any[]) => void ->`\t\n\v\f\r\\` : string +>`\t\n\v\f\r\\` : "\t\n\v\f\r\\" diff --git a/tests/baselines/reference/taggedTemplateUntypedTagCall01.types b/tests/baselines/reference/taggedTemplateUntypedTagCall01.types index 3949869550cf0..4fc03e8c080d6 100644 --- a/tests/baselines/reference/taggedTemplateUntypedTagCall01.types +++ b/tests/baselines/reference/taggedTemplateUntypedTagCall01.types @@ -6,5 +6,5 @@ var tag: Function; tag `Hello world!`; >tag `Hello world!` : any >tag : Function ->`Hello world!` : string +>`Hello world!` : "Hello world!" diff --git a/tests/baselines/reference/templateStringControlCharacterEscapes01.types b/tests/baselines/reference/templateStringControlCharacterEscapes01.types index 7bd2e89839c22..3fe51d1d1b15d 100644 --- a/tests/baselines/reference/templateStringControlCharacterEscapes01.types +++ b/tests/baselines/reference/templateStringControlCharacterEscapes01.types @@ -1,5 +1,5 @@ === tests/cases/conformance/es6/templates/templateStringControlCharacterEscapes01.ts === var x = `\0\x00\u0000 0 00 0000`; >x : string ->`\0\x00\u0000 0 00 0000` : string +>`\0\x00\u0000 0 00 0000` : "\0\0\0 0 00 0000" diff --git a/tests/baselines/reference/templateStringControlCharacterEscapes01_ES6.types b/tests/baselines/reference/templateStringControlCharacterEscapes01_ES6.types index 80962ecdd6a7c..2d1a609200feb 100644 --- a/tests/baselines/reference/templateStringControlCharacterEscapes01_ES6.types +++ b/tests/baselines/reference/templateStringControlCharacterEscapes01_ES6.types @@ -1,5 +1,5 @@ === tests/cases/conformance/es6/templates/templateStringControlCharacterEscapes01_ES6.ts === var x = `\0\x00\u0000 0 00 0000`; >x : string ->`\0\x00\u0000 0 00 0000` : string +>`\0\x00\u0000 0 00 0000` : "\0\0\0 0 00 0000" diff --git a/tests/baselines/reference/templateStringControlCharacterEscapes02.types b/tests/baselines/reference/templateStringControlCharacterEscapes02.types index 4656be748ec77..451d1f0dcd8ca 100644 --- a/tests/baselines/reference/templateStringControlCharacterEscapes02.types +++ b/tests/baselines/reference/templateStringControlCharacterEscapes02.types @@ -1,5 +1,5 @@ === tests/cases/conformance/es6/templates/templateStringControlCharacterEscapes02.ts === var x = `\x19\u0019 19`; >x : string ->`\x19\u0019 19` : string +>`\x19\u0019 19` : "\u0019\u0019 19" diff --git a/tests/baselines/reference/templateStringControlCharacterEscapes02_ES6.types b/tests/baselines/reference/templateStringControlCharacterEscapes02_ES6.types index d50196f59136d..b1bb248ffce77 100644 --- a/tests/baselines/reference/templateStringControlCharacterEscapes02_ES6.types +++ b/tests/baselines/reference/templateStringControlCharacterEscapes02_ES6.types @@ -1,5 +1,5 @@ === tests/cases/conformance/es6/templates/templateStringControlCharacterEscapes02_ES6.ts === var x = `\x19\u0019 19`; >x : string ->`\x19\u0019 19` : string +>`\x19\u0019 19` : "\u0019\u0019 19" diff --git a/tests/baselines/reference/templateStringControlCharacterEscapes03.types b/tests/baselines/reference/templateStringControlCharacterEscapes03.types index b509b2ccd6cd6..f65ef32da4482 100644 --- a/tests/baselines/reference/templateStringControlCharacterEscapes03.types +++ b/tests/baselines/reference/templateStringControlCharacterEscapes03.types @@ -1,5 +1,5 @@ === tests/cases/conformance/es6/templates/templateStringControlCharacterEscapes03.ts === var x = `\x1F\u001f 1F 1f`; >x : string ->`\x1F\u001f 1F 1f` : string +>`\x1F\u001f 1F 1f` : "\u001F\u001F 1F 1f" diff --git a/tests/baselines/reference/templateStringControlCharacterEscapes03_ES6.types b/tests/baselines/reference/templateStringControlCharacterEscapes03_ES6.types index 4d35fe85c41e0..d6e79953a5fe2 100644 --- a/tests/baselines/reference/templateStringControlCharacterEscapes03_ES6.types +++ b/tests/baselines/reference/templateStringControlCharacterEscapes03_ES6.types @@ -1,5 +1,5 @@ === tests/cases/conformance/es6/templates/templateStringControlCharacterEscapes03_ES6.ts === var x = `\x1F\u001f 1F 1f`; >x : string ->`\x1F\u001f 1F 1f` : string +>`\x1F\u001f 1F 1f` : "\u001F\u001F 1F 1f" diff --git a/tests/baselines/reference/templateStringControlCharacterEscapes04.types b/tests/baselines/reference/templateStringControlCharacterEscapes04.types index ca72e253d562b..c13ddcf113c14 100644 --- a/tests/baselines/reference/templateStringControlCharacterEscapes04.types +++ b/tests/baselines/reference/templateStringControlCharacterEscapes04.types @@ -1,5 +1,5 @@ === tests/cases/conformance/es6/templates/templateStringControlCharacterEscapes04.ts === var x = `\x20\u0020 20`; >x : string ->`\x20\u0020 20` : string +>`\x20\u0020 20` : " 20" diff --git a/tests/baselines/reference/templateStringControlCharacterEscapes04_ES6.types b/tests/baselines/reference/templateStringControlCharacterEscapes04_ES6.types index 01b3f35ba9abe..5edabb6971e66 100644 --- a/tests/baselines/reference/templateStringControlCharacterEscapes04_ES6.types +++ b/tests/baselines/reference/templateStringControlCharacterEscapes04_ES6.types @@ -1,5 +1,5 @@ === tests/cases/conformance/es6/templates/templateStringControlCharacterEscapes04_ES6.ts === var x = `\x20\u0020 20`; >x : string ->`\x20\u0020 20` : string +>`\x20\u0020 20` : " 20" diff --git a/tests/baselines/reference/templateStringInEqualityChecks.types b/tests/baselines/reference/templateStringInEqualityChecks.types index dd78aa131d4be..cddc533a23947 100644 --- a/tests/baselines/reference/templateStringInEqualityChecks.types +++ b/tests/baselines/reference/templateStringInEqualityChecks.types @@ -5,13 +5,13 @@ var x = `abc${0}abc` === `abc` || >`abc${0}abc` === `abc` : boolean >`abc${0}abc` : string >0 : 0 ->`abc` : string +>`abc` : "abc" `abc` !== `abc${0}abc` && >`abc` !== `abc${0}abc` && `abc${0}abc` == "abc0abc" && "abc0abc" !== `abc${0}abc` : boolean >`abc` !== `abc${0}abc` && `abc${0}abc` == "abc0abc" : boolean >`abc` !== `abc${0}abc` : boolean ->`abc` : string +>`abc` : "abc" >`abc${0}abc` : string >0 : 0 diff --git a/tests/baselines/reference/templateStringInEqualityChecksES6.types b/tests/baselines/reference/templateStringInEqualityChecksES6.types index b3ef2b8972041..58a243007256e 100644 --- a/tests/baselines/reference/templateStringInEqualityChecksES6.types +++ b/tests/baselines/reference/templateStringInEqualityChecksES6.types @@ -5,13 +5,13 @@ var x = `abc${0}abc` === `abc` || >`abc${0}abc` === `abc` : boolean >`abc${0}abc` : string >0 : 0 ->`abc` : string +>`abc` : "abc" `abc` !== `abc${0}abc` && >`abc` !== `abc${0}abc` && `abc${0}abc` == "abc0abc" && "abc0abc" !== `abc${0}abc` : boolean >`abc` !== `abc${0}abc` && `abc${0}abc` == "abc0abc" : boolean >`abc` !== `abc${0}abc` : boolean ->`abc` : string +>`abc` : "abc" >`abc${0}abc` : string >0 : 0 diff --git a/tests/baselines/reference/templateStringInIndexExpression.types b/tests/baselines/reference/templateStringInIndexExpression.types index b453c37f4c5f2..f0faac5f45c03 100644 --- a/tests/baselines/reference/templateStringInIndexExpression.types +++ b/tests/baselines/reference/templateStringInIndexExpression.types @@ -3,5 +3,5 @@ >`abc${0}abc`[`0`] : any >`abc${0}abc` : string >0 : 0 ->`0` : string +>`0` : "0" diff --git a/tests/baselines/reference/templateStringInIndexExpressionES6.types b/tests/baselines/reference/templateStringInIndexExpressionES6.types index b7be602e89336..eabc71c9facbc 100644 --- a/tests/baselines/reference/templateStringInIndexExpressionES6.types +++ b/tests/baselines/reference/templateStringInIndexExpressionES6.types @@ -3,5 +3,5 @@ >`abc${0}abc`[`0`] : any >`abc${0}abc` : string >0 : 0 ->`0` : string +>`0` : "0" diff --git a/tests/baselines/reference/templateStringInSwitchAndCase.types b/tests/baselines/reference/templateStringInSwitchAndCase.types index a0f8602167a21..d54891ff05159 100644 --- a/tests/baselines/reference/templateStringInSwitchAndCase.types +++ b/tests/baselines/reference/templateStringInSwitchAndCase.types @@ -4,10 +4,10 @@ switch (`abc${0}abc`) { >0 : 0 case `abc`: ->`abc` : string +>`abc` : "abc" case `123`: ->`123` : string +>`123` : "123" case `abc${0}abc`: >`abc${0}abc` : string diff --git a/tests/baselines/reference/templateStringInSwitchAndCaseES6.types b/tests/baselines/reference/templateStringInSwitchAndCaseES6.types index 0cde7e5875676..8c7c4fee2c1b0 100644 --- a/tests/baselines/reference/templateStringInSwitchAndCaseES6.types +++ b/tests/baselines/reference/templateStringInSwitchAndCaseES6.types @@ -4,10 +4,10 @@ switch (`abc${0}abc`) { >0 : 0 case `abc`: ->`abc` : string +>`abc` : "abc" case `123`: ->`123` : string +>`123` : "123" case `abc${0}abc`: >`abc${0}abc` : string diff --git a/tests/baselines/reference/templateStringMultiline1.types b/tests/baselines/reference/templateStringMultiline1.types index f66dd89a7bc19..daccdf56d8253 100644 --- a/tests/baselines/reference/templateStringMultiline1.types +++ b/tests/baselines/reference/templateStringMultiline1.types @@ -1,7 +1,7 @@ === tests/cases/conformance/es6/templates/templateStringMultiline1.ts === // newlines are ` ->`\` : string +>`\` : "\n" \ ` diff --git a/tests/baselines/reference/templateStringMultiline1_ES6.types b/tests/baselines/reference/templateStringMultiline1_ES6.types index 71e82a2e5c54b..a5b08120fc4a5 100644 --- a/tests/baselines/reference/templateStringMultiline1_ES6.types +++ b/tests/baselines/reference/templateStringMultiline1_ES6.types @@ -1,7 +1,7 @@ === tests/cases/conformance/es6/templates/templateStringMultiline1_ES6.ts === // newlines are ` ->`\` : string +>`\` : "\n" \ ` diff --git a/tests/baselines/reference/templateStringMultiline2.types b/tests/baselines/reference/templateStringMultiline2.types index 6184cb098b6a2..96518853b286d 100644 --- a/tests/baselines/reference/templateStringMultiline2.types +++ b/tests/baselines/reference/templateStringMultiline2.types @@ -1,7 +1,7 @@ === tests/cases/conformance/es6/templates/templateStringMultiline2.ts === // newlines are ` ->`\` : string +>`\` : "\n" \ ` diff --git a/tests/baselines/reference/templateStringMultiline2_ES6.types b/tests/baselines/reference/templateStringMultiline2_ES6.types index 3d123975330b6..be555557874d1 100644 --- a/tests/baselines/reference/templateStringMultiline2_ES6.types +++ b/tests/baselines/reference/templateStringMultiline2_ES6.types @@ -1,7 +1,7 @@ === tests/cases/conformance/es6/templates/templateStringMultiline2_ES6.ts === // newlines are ` ->`\` : string +>`\` : "\n" \ ` diff --git a/tests/baselines/reference/templateStringMultiline3.types b/tests/baselines/reference/templateStringMultiline3.types index 1d77fca9c5656..2908dd936ea8d 100644 --- a/tests/baselines/reference/templateStringMultiline3.types +++ b/tests/baselines/reference/templateStringMultiline3.types @@ -1,7 +1,7 @@ === tests/cases/conformance/es6/templates/templateStringMultiline3.ts === // newlines are ` ->`\` : string +>`\` : "\n" \ ` diff --git a/tests/baselines/reference/templateStringMultiline3_ES6.types b/tests/baselines/reference/templateStringMultiline3_ES6.types index a1a696ebcfdc8..24d523c5bc2bd 100644 --- a/tests/baselines/reference/templateStringMultiline3_ES6.types +++ b/tests/baselines/reference/templateStringMultiline3_ES6.types @@ -1,7 +1,7 @@ === tests/cases/conformance/es6/templates/templateStringMultiline3_ES6.ts === // newlines are ` ->`\` : string +>`\` : "\n" \ ` diff --git a/tests/baselines/reference/templateStringPlainCharactersThatArePartsOfEscapes01.types b/tests/baselines/reference/templateStringPlainCharactersThatArePartsOfEscapes01.types index acdf7898b7122..4a3f79a9928b3 100644 --- a/tests/baselines/reference/templateStringPlainCharactersThatArePartsOfEscapes01.types +++ b/tests/baselines/reference/templateStringPlainCharactersThatArePartsOfEscapes01.types @@ -1,4 +1,4 @@ === tests/cases/conformance/es6/templates/templateStringPlainCharactersThatArePartsOfEscapes01.ts === `0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 2028 2029 0085 t v f b r n` ->`0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 2028 2029 0085 t v f b r n` : string +>`0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 2028 2029 0085 t v f b r n` : "0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 2028 2029 0085 t v f b r n" diff --git a/tests/baselines/reference/templateStringPlainCharactersThatArePartsOfEscapes01_ES6.types b/tests/baselines/reference/templateStringPlainCharactersThatArePartsOfEscapes01_ES6.types index 110676b704b65..5ff16707e363d 100644 --- a/tests/baselines/reference/templateStringPlainCharactersThatArePartsOfEscapes01_ES6.types +++ b/tests/baselines/reference/templateStringPlainCharactersThatArePartsOfEscapes01_ES6.types @@ -1,4 +1,4 @@ === tests/cases/conformance/es6/templates/templateStringPlainCharactersThatArePartsOfEscapes01_ES6.ts === `0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 2028 2029 0085 t v f b r n` ->`0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 2028 2029 0085 t v f b r n` : string +>`0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 2028 2029 0085 t v f b r n` : "0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 2028 2029 0085 t v f b r n" diff --git a/tests/baselines/reference/templateStringTermination1.types b/tests/baselines/reference/templateStringTermination1.types index fa40007c96a22..e92463d6d809b 100644 --- a/tests/baselines/reference/templateStringTermination1.types +++ b/tests/baselines/reference/templateStringTermination1.types @@ -1,4 +1,4 @@ === tests/cases/conformance/es6/templates/templateStringTermination1.ts === `` ->`` : string +>`` : "" diff --git a/tests/baselines/reference/templateStringTermination1_ES6.types b/tests/baselines/reference/templateStringTermination1_ES6.types index 9aa852a576a7e..1a873bf8304b2 100644 --- a/tests/baselines/reference/templateStringTermination1_ES6.types +++ b/tests/baselines/reference/templateStringTermination1_ES6.types @@ -1,4 +1,4 @@ === tests/cases/conformance/es6/templates/templateStringTermination1_ES6.ts === `` ->`` : string +>`` : "" diff --git a/tests/baselines/reference/templateStringTermination2.types b/tests/baselines/reference/templateStringTermination2.types index 205cb1e620a1e..fe7ab32c9f7bb 100644 --- a/tests/baselines/reference/templateStringTermination2.types +++ b/tests/baselines/reference/templateStringTermination2.types @@ -1,4 +1,4 @@ === tests/cases/conformance/es6/templates/templateStringTermination2.ts === `\\` ->`\\` : string +>`\\` : "\\" diff --git a/tests/baselines/reference/templateStringTermination2_ES6.types b/tests/baselines/reference/templateStringTermination2_ES6.types index bd8859a493fa3..364a684fd57fa 100644 --- a/tests/baselines/reference/templateStringTermination2_ES6.types +++ b/tests/baselines/reference/templateStringTermination2_ES6.types @@ -1,4 +1,4 @@ === tests/cases/conformance/es6/templates/templateStringTermination2_ES6.ts === `\\` ->`\\` : string +>`\\` : "\\" diff --git a/tests/baselines/reference/templateStringTermination3.types b/tests/baselines/reference/templateStringTermination3.types index bdb09e00dc3a5..7a1cb752a5a99 100644 --- a/tests/baselines/reference/templateStringTermination3.types +++ b/tests/baselines/reference/templateStringTermination3.types @@ -1,4 +1,4 @@ === tests/cases/conformance/es6/templates/templateStringTermination3.ts === `\`` ->`\`` : string +>`\`` : "`" diff --git a/tests/baselines/reference/templateStringTermination3_ES6.types b/tests/baselines/reference/templateStringTermination3_ES6.types index 86ed6373bab7d..c30f77c60b985 100644 --- a/tests/baselines/reference/templateStringTermination3_ES6.types +++ b/tests/baselines/reference/templateStringTermination3_ES6.types @@ -1,4 +1,4 @@ === tests/cases/conformance/es6/templates/templateStringTermination3_ES6.ts === `\`` ->`\`` : string +>`\`` : "`" diff --git a/tests/baselines/reference/templateStringTermination4.types b/tests/baselines/reference/templateStringTermination4.types index 35a330148587e..a700c1e473f6e 100644 --- a/tests/baselines/reference/templateStringTermination4.types +++ b/tests/baselines/reference/templateStringTermination4.types @@ -1,4 +1,4 @@ === tests/cases/conformance/es6/templates/templateStringTermination4.ts === `\\\\` ->`\\\\` : string +>`\\\\` : "\\\\" diff --git a/tests/baselines/reference/templateStringTermination4_ES6.types b/tests/baselines/reference/templateStringTermination4_ES6.types index 92c07f768a4e6..6f10132ac7254 100644 --- a/tests/baselines/reference/templateStringTermination4_ES6.types +++ b/tests/baselines/reference/templateStringTermination4_ES6.types @@ -1,4 +1,4 @@ === tests/cases/conformance/es6/templates/templateStringTermination4_ES6.ts === `\\\\` ->`\\\\` : string +>`\\\\` : "\\\\" diff --git a/tests/baselines/reference/templateStringTermination5.types b/tests/baselines/reference/templateStringTermination5.types index 34c6cf9fb82e2..5f4a464b89e48 100644 --- a/tests/baselines/reference/templateStringTermination5.types +++ b/tests/baselines/reference/templateStringTermination5.types @@ -1,4 +1,4 @@ === tests/cases/conformance/es6/templates/templateStringTermination5.ts === `\\\\\\` ->`\\\\\\` : string +>`\\\\\\` : "\\\\\\" diff --git a/tests/baselines/reference/templateStringTermination5_ES6.types b/tests/baselines/reference/templateStringTermination5_ES6.types index 193608250d985..685b2c1011aa2 100644 --- a/tests/baselines/reference/templateStringTermination5_ES6.types +++ b/tests/baselines/reference/templateStringTermination5_ES6.types @@ -1,4 +1,4 @@ === tests/cases/conformance/es6/templates/templateStringTermination5_ES6.ts === `\\\\\\` ->`\\\\\\` : string +>`\\\\\\` : "\\\\\\" diff --git a/tests/baselines/reference/templateStringWhitespaceEscapes1.types b/tests/baselines/reference/templateStringWhitespaceEscapes1.types index e554f45685b09..e99205aebfe95 100644 --- a/tests/baselines/reference/templateStringWhitespaceEscapes1.types +++ b/tests/baselines/reference/templateStringWhitespaceEscapes1.types @@ -1,4 +1,4 @@ === tests/cases/conformance/es6/templates/templateStringWhitespaceEscapes1.ts === `\t\n\v\f\r`; ->`\t\n\v\f\r` : string +>`\t\n\v\f\r` : "\t\n\v\f\r" diff --git a/tests/baselines/reference/templateStringWhitespaceEscapes1_ES6.types b/tests/baselines/reference/templateStringWhitespaceEscapes1_ES6.types index 3888c1be0684c..219c7c926dccd 100644 --- a/tests/baselines/reference/templateStringWhitespaceEscapes1_ES6.types +++ b/tests/baselines/reference/templateStringWhitespaceEscapes1_ES6.types @@ -1,4 +1,4 @@ === tests/cases/conformance/es6/templates/templateStringWhitespaceEscapes1_ES6.ts === `\t\n\v\f\r`; ->`\t\n\v\f\r` : string +>`\t\n\v\f\r` : "\t\n\v\f\r" diff --git a/tests/baselines/reference/templateStringWhitespaceEscapes2.types b/tests/baselines/reference/templateStringWhitespaceEscapes2.types index 3a43fe5e5a2a0..e78cdaa2bc59c 100644 --- a/tests/baselines/reference/templateStringWhitespaceEscapes2.types +++ b/tests/baselines/reference/templateStringWhitespaceEscapes2.types @@ -1,5 +1,5 @@ === tests/cases/conformance/es6/templates/templateStringWhitespaceEscapes2.ts === // , , , , , `\u0009\u000B\u000C\u0020\u00A0\uFEFF`; ->`\u0009\u000B\u000C\u0020\u00A0\uFEFF` : string +>`\u0009\u000B\u000C\u0020\u00A0\uFEFF` : "\t\v\f  " diff --git a/tests/baselines/reference/templateStringWhitespaceEscapes2_ES6.types b/tests/baselines/reference/templateStringWhitespaceEscapes2_ES6.types index 1627945e1c4f6..a8239149ce4bd 100644 --- a/tests/baselines/reference/templateStringWhitespaceEscapes2_ES6.types +++ b/tests/baselines/reference/templateStringWhitespaceEscapes2_ES6.types @@ -1,5 +1,5 @@ === tests/cases/conformance/es6/templates/templateStringWhitespaceEscapes2_ES6.ts === // , , , , , `\u0009\u000B\u000C\u0020\u00A0\uFEFF`; ->`\u0009\u000B\u000C\u0020\u00A0\uFEFF` : string +>`\u0009\u000B\u000C\u0020\u00A0\uFEFF` : "\t\v\f  " diff --git a/tests/baselines/reference/templateStringWithBackslashEscapes01.types b/tests/baselines/reference/templateStringWithBackslashEscapes01.types index e65c751b9d4f9..49bffce32f9d7 100644 --- a/tests/baselines/reference/templateStringWithBackslashEscapes01.types +++ b/tests/baselines/reference/templateStringWithBackslashEscapes01.types @@ -1,17 +1,17 @@ === tests/cases/conformance/es6/templates/templateStringWithBackslashEscapes01.ts === var a = `hello\world`; >a : string ->`hello\world` : string +>`hello\world` : "helloworld" var b = `hello\\world`; >b : string ->`hello\\world` : string +>`hello\\world` : "hello\\world" var c = `hello\\\world`; >c : string ->`hello\\\world` : string +>`hello\\\world` : "hello\\world" var d = `hello\\\\world`; >d : string ->`hello\\\\world` : string +>`hello\\\\world` : "hello\\\\world" diff --git a/tests/baselines/reference/templateStringWithBackslashEscapes01_ES6.types b/tests/baselines/reference/templateStringWithBackslashEscapes01_ES6.types index 9d1622609beb2..7482ed4850187 100644 --- a/tests/baselines/reference/templateStringWithBackslashEscapes01_ES6.types +++ b/tests/baselines/reference/templateStringWithBackslashEscapes01_ES6.types @@ -1,17 +1,17 @@ === tests/cases/conformance/es6/templates/templateStringWithBackslashEscapes01_ES6.ts === var a = `hello\world`; >a : string ->`hello\world` : string +>`hello\world` : "helloworld" var b = `hello\\world`; >b : string ->`hello\\world` : string +>`hello\\world` : "hello\\world" var c = `hello\\\world`; >c : string ->`hello\\\world` : string +>`hello\\\world` : "hello\\world" var d = `hello\\\\world`; >d : string ->`hello\\\\world` : string +>`hello\\\\world` : "hello\\\\world" diff --git a/tests/baselines/reference/templateStringWithEmptyLiteralPortions.types b/tests/baselines/reference/templateStringWithEmptyLiteralPortions.types index f20ab1552e3b8..efc2723c270d2 100644 --- a/tests/baselines/reference/templateStringWithEmptyLiteralPortions.types +++ b/tests/baselines/reference/templateStringWithEmptyLiteralPortions.types @@ -1,7 +1,7 @@ === tests/cases/conformance/es6/templates/templateStringWithEmptyLiteralPortions.ts === var a = ``; >a : string ->`` : string +>`` : "" var b = `${ 0 }`; >b : string diff --git a/tests/baselines/reference/templateStringWithEmptyLiteralPortionsES6.types b/tests/baselines/reference/templateStringWithEmptyLiteralPortionsES6.types index 73eeeaae04529..aad4f1eb09518 100644 --- a/tests/baselines/reference/templateStringWithEmptyLiteralPortionsES6.types +++ b/tests/baselines/reference/templateStringWithEmptyLiteralPortionsES6.types @@ -1,7 +1,7 @@ === tests/cases/conformance/es6/templates/templateStringWithEmptyLiteralPortionsES6.ts === var a = ``; >a : string ->`` : string +>`` : "" var b = `${ 0 }`; >b : string diff --git a/tests/baselines/reference/templateStringWithPropertyAccess.types b/tests/baselines/reference/templateStringWithPropertyAccess.types index 21749c848da58..faa2fda38889e 100644 --- a/tests/baselines/reference/templateStringWithPropertyAccess.types +++ b/tests/baselines/reference/templateStringWithPropertyAccess.types @@ -5,5 +5,5 @@ >`abc${0}abc` : string >0 : 0 >indexOf : (searchString: string, position?: number) => number ->`abc` : string +>`abc` : "abc" diff --git a/tests/baselines/reference/templateStringWithPropertyAccessES6.types b/tests/baselines/reference/templateStringWithPropertyAccessES6.types index 3e297e6bf07d1..36a84452808e9 100644 --- a/tests/baselines/reference/templateStringWithPropertyAccessES6.types +++ b/tests/baselines/reference/templateStringWithPropertyAccessES6.types @@ -5,5 +5,5 @@ >`abc${0}abc` : string >0 : 0 >indexOf : (searchString: string, position?: number) => number ->`abc` : string +>`abc` : "abc" diff --git a/tests/baselines/reference/typeGuardIntersectionTypes.types b/tests/baselines/reference/typeGuardIntersectionTypes.types index b8ba6b318d8ef..98a8388f21eff 100644 --- a/tests/baselines/reference/typeGuardIntersectionTypes.types +++ b/tests/baselines/reference/typeGuardIntersectionTypes.types @@ -210,7 +210,7 @@ function identifyBeast(beast: Beast) { log(`pegasus - 4 legs, wings`); >log(`pegasus - 4 legs, wings`) : void >log : (s: string) => void ->`pegasus - 4 legs, wings` : string +>`pegasus - 4 legs, wings` : "pegasus - 4 legs, wings" } else if (beast.legs === 2) { >beast.legs === 2 : boolean @@ -222,7 +222,7 @@ function identifyBeast(beast: Beast) { log(`bird - 2 legs, wings`); >log(`bird - 2 legs, wings`) : void >log : (s: string) => void ->`bird - 2 legs, wings` : string +>`bird - 2 legs, wings` : "bird - 2 legs, wings" } else { log(`unknown - ${beast.legs} legs, wings`); @@ -257,13 +257,13 @@ function identifyBeast(beast: Beast) { log(`quetzalcoatl - no legs, wings`) >log(`quetzalcoatl - no legs, wings`) : void >log : (s: string) => void ->`quetzalcoatl - no legs, wings` : string +>`quetzalcoatl - no legs, wings` : "quetzalcoatl - no legs, wings" } else { log(`snake - no legs, no wings`) >log(`snake - no legs, no wings`) : void >log : (s: string) => void ->`snake - no legs, no wings` : string +>`snake - no legs, no wings` : "snake - no legs, no wings" } } } diff --git a/tests/baselines/reference/unicodeExtendedEscapesInTemplates01_ES5.types b/tests/baselines/reference/unicodeExtendedEscapesInTemplates01_ES5.types index 427287812c11e..983c1054cd81c 100644 --- a/tests/baselines/reference/unicodeExtendedEscapesInTemplates01_ES5.types +++ b/tests/baselines/reference/unicodeExtendedEscapesInTemplates01_ES5.types @@ -1,5 +1,5 @@ === tests/cases/conformance/es6/unicodeExtendedEscapes/unicodeExtendedEscapesInTemplates01_ES5.ts === var x = `\u{0}`; >x : string ->`\u{0}` : string +>`\u{0}` : "\0" diff --git a/tests/baselines/reference/unicodeExtendedEscapesInTemplates01_ES6.types b/tests/baselines/reference/unicodeExtendedEscapesInTemplates01_ES6.types index 482a6d5feab13..9b28d3c69b0d3 100644 --- a/tests/baselines/reference/unicodeExtendedEscapesInTemplates01_ES6.types +++ b/tests/baselines/reference/unicodeExtendedEscapesInTemplates01_ES6.types @@ -1,5 +1,5 @@ === tests/cases/conformance/es6/unicodeExtendedEscapes/unicodeExtendedEscapesInTemplates01_ES6.ts === var x = `\u{0}`; >x : string ->`\u{0}` : string +>`\u{0}` : "\0" diff --git a/tests/baselines/reference/unicodeExtendedEscapesInTemplates02_ES5.types b/tests/baselines/reference/unicodeExtendedEscapesInTemplates02_ES5.types index a6ff5ebdeb994..644df97b3d74e 100644 --- a/tests/baselines/reference/unicodeExtendedEscapesInTemplates02_ES5.types +++ b/tests/baselines/reference/unicodeExtendedEscapesInTemplates02_ES5.types @@ -1,5 +1,5 @@ === tests/cases/conformance/es6/unicodeExtendedEscapes/unicodeExtendedEscapesInTemplates02_ES5.ts === var x = `\u{00}`; >x : string ->`\u{00}` : string +>`\u{00}` : "\0" diff --git a/tests/baselines/reference/unicodeExtendedEscapesInTemplates02_ES6.types b/tests/baselines/reference/unicodeExtendedEscapesInTemplates02_ES6.types index badf78449a747..47ca4916deb67 100644 --- a/tests/baselines/reference/unicodeExtendedEscapesInTemplates02_ES6.types +++ b/tests/baselines/reference/unicodeExtendedEscapesInTemplates02_ES6.types @@ -1,5 +1,5 @@ === tests/cases/conformance/es6/unicodeExtendedEscapes/unicodeExtendedEscapesInTemplates02_ES6.ts === var x = `\u{00}`; >x : string ->`\u{00}` : string +>`\u{00}` : "\0" diff --git a/tests/baselines/reference/unicodeExtendedEscapesInTemplates03_ES5.types b/tests/baselines/reference/unicodeExtendedEscapesInTemplates03_ES5.types index ebd0ada182515..95444cd2a2321 100644 --- a/tests/baselines/reference/unicodeExtendedEscapesInTemplates03_ES5.types +++ b/tests/baselines/reference/unicodeExtendedEscapesInTemplates03_ES5.types @@ -1,5 +1,5 @@ === tests/cases/conformance/es6/unicodeExtendedEscapes/unicodeExtendedEscapesInTemplates03_ES5.ts === var x = `\u{0000}`; >x : string ->`\u{0000}` : string +>`\u{0000}` : "\0" diff --git a/tests/baselines/reference/unicodeExtendedEscapesInTemplates03_ES6.types b/tests/baselines/reference/unicodeExtendedEscapesInTemplates03_ES6.types index 8370399d2a4ce..05290b9abc2df 100644 --- a/tests/baselines/reference/unicodeExtendedEscapesInTemplates03_ES6.types +++ b/tests/baselines/reference/unicodeExtendedEscapesInTemplates03_ES6.types @@ -1,5 +1,5 @@ === tests/cases/conformance/es6/unicodeExtendedEscapes/unicodeExtendedEscapesInTemplates03_ES6.ts === var x = `\u{0000}`; >x : string ->`\u{0000}` : string +>`\u{0000}` : "\0" diff --git a/tests/baselines/reference/unicodeExtendedEscapesInTemplates04_ES5.types b/tests/baselines/reference/unicodeExtendedEscapesInTemplates04_ES5.types index 0cefe0224e08c..4cae06cae303e 100644 --- a/tests/baselines/reference/unicodeExtendedEscapesInTemplates04_ES5.types +++ b/tests/baselines/reference/unicodeExtendedEscapesInTemplates04_ES5.types @@ -1,5 +1,5 @@ === tests/cases/conformance/es6/unicodeExtendedEscapes/unicodeExtendedEscapesInTemplates04_ES5.ts === var x = `\u{00000000}`; >x : string ->`\u{00000000}` : string +>`\u{00000000}` : "\0" diff --git a/tests/baselines/reference/unicodeExtendedEscapesInTemplates04_ES6.types b/tests/baselines/reference/unicodeExtendedEscapesInTemplates04_ES6.types index b3e9768be6d95..cbe80b6df574d 100644 --- a/tests/baselines/reference/unicodeExtendedEscapesInTemplates04_ES6.types +++ b/tests/baselines/reference/unicodeExtendedEscapesInTemplates04_ES6.types @@ -1,5 +1,5 @@ === tests/cases/conformance/es6/unicodeExtendedEscapes/unicodeExtendedEscapesInTemplates04_ES6.ts === var x = `\u{00000000}`; >x : string ->`\u{00000000}` : string +>`\u{00000000}` : "\0" diff --git a/tests/baselines/reference/unicodeExtendedEscapesInTemplates05_ES5.types b/tests/baselines/reference/unicodeExtendedEscapesInTemplates05_ES5.types index f7e0d4b9f1074..cde2db429c836 100644 --- a/tests/baselines/reference/unicodeExtendedEscapesInTemplates05_ES5.types +++ b/tests/baselines/reference/unicodeExtendedEscapesInTemplates05_ES5.types @@ -1,5 +1,5 @@ === tests/cases/conformance/es6/unicodeExtendedEscapes/unicodeExtendedEscapesInTemplates05_ES5.ts === var x = `\u{48}\u{65}\u{6c}\u{6c}\u{6f}\u{20}\u{77}\u{6f}\u{72}\u{6c}\u{64}`; >x : string ->`\u{48}\u{65}\u{6c}\u{6c}\u{6f}\u{20}\u{77}\u{6f}\u{72}\u{6c}\u{64}` : string +>`\u{48}\u{65}\u{6c}\u{6c}\u{6f}\u{20}\u{77}\u{6f}\u{72}\u{6c}\u{64}` : "Hello world" diff --git a/tests/baselines/reference/unicodeExtendedEscapesInTemplates05_ES6.types b/tests/baselines/reference/unicodeExtendedEscapesInTemplates05_ES6.types index 4fddcde17d11c..70ad36cd515aa 100644 --- a/tests/baselines/reference/unicodeExtendedEscapesInTemplates05_ES6.types +++ b/tests/baselines/reference/unicodeExtendedEscapesInTemplates05_ES6.types @@ -1,5 +1,5 @@ === tests/cases/conformance/es6/unicodeExtendedEscapes/unicodeExtendedEscapesInTemplates05_ES6.ts === var x = `\u{48}\u{65}\u{6c}\u{6c}\u{6f}\u{20}\u{77}\u{6f}\u{72}\u{6c}\u{64}`; >x : string ->`\u{48}\u{65}\u{6c}\u{6c}\u{6f}\u{20}\u{77}\u{6f}\u{72}\u{6c}\u{64}` : string +>`\u{48}\u{65}\u{6c}\u{6c}\u{6f}\u{20}\u{77}\u{6f}\u{72}\u{6c}\u{64}` : "Hello world" diff --git a/tests/baselines/reference/unicodeExtendedEscapesInTemplates06_ES5.types b/tests/baselines/reference/unicodeExtendedEscapesInTemplates06_ES5.types index 4b3326b138417..05faa73bcdf98 100644 --- a/tests/baselines/reference/unicodeExtendedEscapesInTemplates06_ES5.types +++ b/tests/baselines/reference/unicodeExtendedEscapesInTemplates06_ES5.types @@ -3,5 +3,5 @@ // 1. Assert: 0 ≤ cp ≤ 0x10FFFF. var x = `\u{10FFFF}`; >x : string ->`\u{10FFFF}` : string +>`\u{10FFFF}` : "􏿿" diff --git a/tests/baselines/reference/unicodeExtendedEscapesInTemplates06_ES6.types b/tests/baselines/reference/unicodeExtendedEscapesInTemplates06_ES6.types index 3a073b8b8f046..4bd9eeb279f5b 100644 --- a/tests/baselines/reference/unicodeExtendedEscapesInTemplates06_ES6.types +++ b/tests/baselines/reference/unicodeExtendedEscapesInTemplates06_ES6.types @@ -3,5 +3,5 @@ // 1. Assert: 0 ≤ cp ≤ 0x10FFFF. var x = `\u{10FFFF}`; >x : string ->`\u{10FFFF}` : string +>`\u{10FFFF}` : "􏿿" diff --git a/tests/baselines/reference/unicodeExtendedEscapesInTemplates08_ES5.types b/tests/baselines/reference/unicodeExtendedEscapesInTemplates08_ES5.types index ed0e43e61819d..b3932c26b794a 100644 --- a/tests/baselines/reference/unicodeExtendedEscapesInTemplates08_ES5.types +++ b/tests/baselines/reference/unicodeExtendedEscapesInTemplates08_ES5.types @@ -4,5 +4,5 @@ // (FFFF == 65535) var x = `\u{FFFF}`; >x : string ->`\u{FFFF}` : string +>`\u{FFFF}` : "￿" diff --git a/tests/baselines/reference/unicodeExtendedEscapesInTemplates08_ES6.types b/tests/baselines/reference/unicodeExtendedEscapesInTemplates08_ES6.types index b2cb3e2df4378..fdb9537597c4d 100644 --- a/tests/baselines/reference/unicodeExtendedEscapesInTemplates08_ES6.types +++ b/tests/baselines/reference/unicodeExtendedEscapesInTemplates08_ES6.types @@ -4,5 +4,5 @@ // (FFFF == 65535) var x = `\u{FFFF}`; >x : string ->`\u{FFFF}` : string +>`\u{FFFF}` : "￿" diff --git a/tests/baselines/reference/unicodeExtendedEscapesInTemplates09_ES5.types b/tests/baselines/reference/unicodeExtendedEscapesInTemplates09_ES5.types index d0b79aa8431df..5a44659ab4410 100644 --- a/tests/baselines/reference/unicodeExtendedEscapesInTemplates09_ES5.types +++ b/tests/baselines/reference/unicodeExtendedEscapesInTemplates09_ES5.types @@ -4,5 +4,5 @@ // (10000 == 65536) var x = `\u{10000}`; >x : string ->`\u{10000}` : string +>`\u{10000}` : "𐀀" diff --git a/tests/baselines/reference/unicodeExtendedEscapesInTemplates09_ES6.types b/tests/baselines/reference/unicodeExtendedEscapesInTemplates09_ES6.types index 552ac1d367ef0..2d85454045a21 100644 --- a/tests/baselines/reference/unicodeExtendedEscapesInTemplates09_ES6.types +++ b/tests/baselines/reference/unicodeExtendedEscapesInTemplates09_ES6.types @@ -4,5 +4,5 @@ // (10000 == 65536) var x = `\u{10000}`; >x : string ->`\u{10000}` : string +>`\u{10000}` : "𐀀" diff --git a/tests/baselines/reference/unicodeExtendedEscapesInTemplates10_ES5.types b/tests/baselines/reference/unicodeExtendedEscapesInTemplates10_ES5.types index dfb2048084943..dce17fdb4e09e 100644 --- a/tests/baselines/reference/unicodeExtendedEscapesInTemplates10_ES5.types +++ b/tests/baselines/reference/unicodeExtendedEscapesInTemplates10_ES5.types @@ -5,5 +5,5 @@ // this is a useful edge-case test. var x = `\u{D800}`; >x : string ->`\u{D800}` : string +>`\u{D800}` : "�" diff --git a/tests/baselines/reference/unicodeExtendedEscapesInTemplates10_ES6.types b/tests/baselines/reference/unicodeExtendedEscapesInTemplates10_ES6.types index 8fccf89a6ed3c..80e564effa5d6 100644 --- a/tests/baselines/reference/unicodeExtendedEscapesInTemplates10_ES6.types +++ b/tests/baselines/reference/unicodeExtendedEscapesInTemplates10_ES6.types @@ -5,5 +5,5 @@ // this is a useful edge-case test. var x = `\u{D800}`; >x : string ->`\u{D800}` : string +>`\u{D800}` : "�" diff --git a/tests/baselines/reference/unicodeExtendedEscapesInTemplates11_ES5.types b/tests/baselines/reference/unicodeExtendedEscapesInTemplates11_ES5.types index cf9540d7613dd..85ded8bf56e6b 100644 --- a/tests/baselines/reference/unicodeExtendedEscapesInTemplates11_ES5.types +++ b/tests/baselines/reference/unicodeExtendedEscapesInTemplates11_ES5.types @@ -5,5 +5,5 @@ // this is a useful edge-case test. var x = `\u{DC00}`; >x : string ->`\u{DC00}` : string +>`\u{DC00}` : "�" diff --git a/tests/baselines/reference/unicodeExtendedEscapesInTemplates11_ES6.types b/tests/baselines/reference/unicodeExtendedEscapesInTemplates11_ES6.types index 94512a38cb704..52a8fb383cf62 100644 --- a/tests/baselines/reference/unicodeExtendedEscapesInTemplates11_ES6.types +++ b/tests/baselines/reference/unicodeExtendedEscapesInTemplates11_ES6.types @@ -5,5 +5,5 @@ // this is a useful edge-case test. var x = `\u{DC00}`; >x : string ->`\u{DC00}` : string +>`\u{DC00}` : "�" diff --git a/tests/baselines/reference/unicodeExtendedEscapesInTemplates13_ES5.types b/tests/baselines/reference/unicodeExtendedEscapesInTemplates13_ES5.types index 9178f005bb6cd..22f123d0ff2f5 100644 --- a/tests/baselines/reference/unicodeExtendedEscapesInTemplates13_ES5.types +++ b/tests/baselines/reference/unicodeExtendedEscapesInTemplates13_ES5.types @@ -1,5 +1,5 @@ === tests/cases/conformance/es6/unicodeExtendedEscapes/unicodeExtendedEscapesInTemplates13_ES5.ts === var x = `\u{DDDDD}`; >x : string ->`\u{DDDDD}` : string +>`\u{DDDDD}` : "󝷝" diff --git a/tests/baselines/reference/unicodeExtendedEscapesInTemplates13_ES6.types b/tests/baselines/reference/unicodeExtendedEscapesInTemplates13_ES6.types index bbcd9ba8ae4d9..afd5dc995ae03 100644 --- a/tests/baselines/reference/unicodeExtendedEscapesInTemplates13_ES6.types +++ b/tests/baselines/reference/unicodeExtendedEscapesInTemplates13_ES6.types @@ -1,5 +1,5 @@ === tests/cases/conformance/es6/unicodeExtendedEscapes/unicodeExtendedEscapesInTemplates13_ES6.ts === var x = `\u{DDDDD}`; >x : string ->`\u{DDDDD}` : string +>`\u{DDDDD}` : "󝷝" diff --git a/tests/baselines/reference/unicodeExtendedEscapesInTemplates15_ES5.types b/tests/baselines/reference/unicodeExtendedEscapesInTemplates15_ES5.types index f38e8e6f30e30..5e96bc878a684 100644 --- a/tests/baselines/reference/unicodeExtendedEscapesInTemplates15_ES5.types +++ b/tests/baselines/reference/unicodeExtendedEscapesInTemplates15_ES5.types @@ -1,5 +1,5 @@ === tests/cases/conformance/es6/unicodeExtendedEscapes/unicodeExtendedEscapesInTemplates15_ES5.ts === var x = `\u{abcd}\u{ef12}\u{3456}\u{7890}`; >x : string ->`\u{abcd}\u{ef12}\u{3456}\u{7890}` : string +>`\u{abcd}\u{ef12}\u{3456}\u{7890}` : "ꯍ㑖碐" diff --git a/tests/baselines/reference/unicodeExtendedEscapesInTemplates15_ES6.types b/tests/baselines/reference/unicodeExtendedEscapesInTemplates15_ES6.types index 53e7fb1e47043..467a6271b8ee5 100644 --- a/tests/baselines/reference/unicodeExtendedEscapesInTemplates15_ES6.types +++ b/tests/baselines/reference/unicodeExtendedEscapesInTemplates15_ES6.types @@ -1,5 +1,5 @@ === tests/cases/conformance/es6/unicodeExtendedEscapes/unicodeExtendedEscapesInTemplates15_ES6.ts === var x = `\u{abcd}\u{ef12}\u{3456}\u{7890}`; >x : string ->`\u{abcd}\u{ef12}\u{3456}\u{7890}` : string +>`\u{abcd}\u{ef12}\u{3456}\u{7890}` : "ꯍ㑖碐" diff --git a/tests/baselines/reference/unicodeExtendedEscapesInTemplates16_ES5.types b/tests/baselines/reference/unicodeExtendedEscapesInTemplates16_ES5.types index be9f781bb9bd5..d145447e8de34 100644 --- a/tests/baselines/reference/unicodeExtendedEscapesInTemplates16_ES5.types +++ b/tests/baselines/reference/unicodeExtendedEscapesInTemplates16_ES5.types @@ -1,5 +1,5 @@ === tests/cases/conformance/es6/unicodeExtendedEscapes/unicodeExtendedEscapesInTemplates16_ES5.ts === var x = `\u{ABCD}\u{EF12}\u{3456}\u{7890}`; >x : string ->`\u{ABCD}\u{EF12}\u{3456}\u{7890}` : string +>`\u{ABCD}\u{EF12}\u{3456}\u{7890}` : "ꯍ㑖碐" diff --git a/tests/baselines/reference/unicodeExtendedEscapesInTemplates16_ES6.types b/tests/baselines/reference/unicodeExtendedEscapesInTemplates16_ES6.types index e33e97ed07cf0..eedcf8823c489 100644 --- a/tests/baselines/reference/unicodeExtendedEscapesInTemplates16_ES6.types +++ b/tests/baselines/reference/unicodeExtendedEscapesInTemplates16_ES6.types @@ -1,5 +1,5 @@ === tests/cases/conformance/es6/unicodeExtendedEscapes/unicodeExtendedEscapesInTemplates16_ES6.ts === var x = `\u{ABCD}\u{EF12}\u{3456}\u{7890}`; >x : string ->`\u{ABCD}\u{EF12}\u{3456}\u{7890}` : string +>`\u{ABCD}\u{EF12}\u{3456}\u{7890}` : "ꯍ㑖碐" diff --git a/tests/baselines/reference/unicodeExtendedEscapesInTemplates18_ES5.types b/tests/baselines/reference/unicodeExtendedEscapesInTemplates18_ES5.types index 16250ea16dc68..c3e26e19b88ed 100644 --- a/tests/baselines/reference/unicodeExtendedEscapesInTemplates18_ES5.types +++ b/tests/baselines/reference/unicodeExtendedEscapesInTemplates18_ES5.types @@ -1,5 +1,5 @@ === tests/cases/conformance/es6/unicodeExtendedEscapes/unicodeExtendedEscapesInTemplates18_ES5.ts === var x = `\u{65}\u{65}`; >x : string ->`\u{65}\u{65}` : string +>`\u{65}\u{65}` : "ee" diff --git a/tests/baselines/reference/unicodeExtendedEscapesInTemplates18_ES6.types b/tests/baselines/reference/unicodeExtendedEscapesInTemplates18_ES6.types index fe818fdf47fd1..f7c1e53d0c7da 100644 --- a/tests/baselines/reference/unicodeExtendedEscapesInTemplates18_ES6.types +++ b/tests/baselines/reference/unicodeExtendedEscapesInTemplates18_ES6.types @@ -1,5 +1,5 @@ === tests/cases/conformance/es6/unicodeExtendedEscapes/unicodeExtendedEscapesInTemplates18_ES6.ts === var x = `\u{65}\u{65}`; >x : string ->`\u{65}\u{65}` : string +>`\u{65}\u{65}` : "ee" diff --git a/tests/baselines/reference/unicodeExtendedEscapesInTemplates20_ES5.types b/tests/baselines/reference/unicodeExtendedEscapesInTemplates20_ES5.types index 9117e3be130cc..ddb24f5de937a 100644 --- a/tests/baselines/reference/unicodeExtendedEscapesInTemplates20_ES5.types +++ b/tests/baselines/reference/unicodeExtendedEscapesInTemplates20_ES5.types @@ -2,5 +2,5 @@ var x = `\u{48}\u{65}\u{6c}\u{6c}\u{6f}${`\u{20}\u{020}\u{0020}\u{000020}`}\u{77}\u{6f}\u{72}\u{6c}\u{64}`; >x : string >`\u{48}\u{65}\u{6c}\u{6c}\u{6f}${`\u{20}\u{020}\u{0020}\u{000020}`}\u{77}\u{6f}\u{72}\u{6c}\u{64}` : string ->`\u{20}\u{020}\u{0020}\u{000020}` : string +>`\u{20}\u{020}\u{0020}\u{000020}` : " " diff --git a/tests/baselines/reference/unicodeExtendedEscapesInTemplates20_ES6.types b/tests/baselines/reference/unicodeExtendedEscapesInTemplates20_ES6.types index 6ff269e28061b..8244bc5b7fd71 100644 --- a/tests/baselines/reference/unicodeExtendedEscapesInTemplates20_ES6.types +++ b/tests/baselines/reference/unicodeExtendedEscapesInTemplates20_ES6.types @@ -2,5 +2,5 @@ var x = `\u{48}\u{65}\u{6c}\u{6c}\u{6f}${`\u{20}\u{020}\u{0020}\u{000020}`}\u{77}\u{6f}\u{72}\u{6c}\u{64}`; >x : string >`\u{48}\u{65}\u{6c}\u{6c}\u{6f}${`\u{20}\u{020}\u{0020}\u{000020}`}\u{77}\u{6f}\u{72}\u{6c}\u{64}` : string ->`\u{20}\u{020}\u{0020}\u{000020}` : string +>`\u{20}\u{020}\u{0020}\u{000020}` : " " From fe3a05e89afd783f8cb550a7886e26c4244c5b13 Mon Sep 17 00:00:00 2001 From: Andy Date: Thu, 10 Aug 2017 07:08:24 -0700 Subject: [PATCH 098/237] A function should be context-sensitive if its return expression is (#17697) * A function should be context-sensitive if its return expression is * Remove outdated comment * Fix typo --- src/compiler/checker.ts | 19 ++++++++-------- ...textualTypingFunctionReturningFunction2.js | 9 ++++++++ ...alTypingFunctionReturningFunction2.symbols | 15 +++++++++++++ ...tualTypingFunctionReturningFunction2.types | 18 +++++++++++++++ ...lTypingWithFixedTypeParameters1.errors.txt | 10 ++++----- ...ontextualTypingWithFixedTypeParameters1.js | 4 ++-- ...ntextualTypingFunctionReturningFunction.ts | 22 +++++++++---------- ...textualTypingFunctionReturningFunction2.ts | 4 ++++ ...ontextualTypingWithFixedTypeParameters1.ts | 2 +- 9 files changed, 75 insertions(+), 28 deletions(-) create mode 100644 tests/baselines/reference/contextualTypingFunctionReturningFunction2.js create mode 100644 tests/baselines/reference/contextualTypingFunctionReturningFunction2.symbols create mode 100644 tests/baselines/reference/contextualTypingFunctionReturningFunction2.types create mode 100644 tests/cases/compiler/contextualTypingFunctionReturningFunction2.ts diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 25004df71e0d7..a6736ac7c3848 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -8405,16 +8405,17 @@ namespace ts { if (forEach(node.parameters, p => !getEffectiveTypeAnnotationNode(p))) { return true; } - // For arrow functions we now know we're not context sensitive. - if (node.kind === SyntaxKind.ArrowFunction) { - return false; + if (node.kind !== SyntaxKind.ArrowFunction) { + // If the first parameter is not an explicit 'this' parameter, then the function has + // an implicit 'this' parameter which is subject to contextual typing. + const parameter = firstOrUndefined(node.parameters); + if (!(parameter && parameterIsThisKeyword(parameter))) { + return true; + } } - // If the first parameter is not an explicit 'this' parameter, then the function has - // an implicit 'this' parameter which is subject to contextual typing. Otherwise we - // know that all parameters (including 'this') have type annotations and nothing is - // subject to contextual typing. - const parameter = firstOrUndefined(node.parameters); - return !(parameter && parameterIsThisKeyword(parameter)); + + // TODO(anhans): A block should be context-sensitive if it has a context-sensitive return value. + return node.body.kind === SyntaxKind.Block ? false : isContextSensitive(node.body); } function isContextSensitiveFunctionOrObjectLiteralMethod(func: Node): func is FunctionExpression | ArrowFunction | MethodDeclaration { diff --git a/tests/baselines/reference/contextualTypingFunctionReturningFunction2.js b/tests/baselines/reference/contextualTypingFunctionReturningFunction2.js new file mode 100644 index 0000000000000..88308dbe2e60d --- /dev/null +++ b/tests/baselines/reference/contextualTypingFunctionReturningFunction2.js @@ -0,0 +1,9 @@ +//// [contextualTypingFunctionReturningFunction2.ts] +declare function f(n: number): void; +declare function f(cb: () => (n: number) => number): void; + +f(() => n => n); + + +//// [contextualTypingFunctionReturningFunction2.js] +f(function () { return function (n) { return n; }; }); diff --git a/tests/baselines/reference/contextualTypingFunctionReturningFunction2.symbols b/tests/baselines/reference/contextualTypingFunctionReturningFunction2.symbols new file mode 100644 index 0000000000000..9071bfc23d857 --- /dev/null +++ b/tests/baselines/reference/contextualTypingFunctionReturningFunction2.symbols @@ -0,0 +1,15 @@ +=== tests/cases/compiler/contextualTypingFunctionReturningFunction2.ts === +declare function f(n: number): void; +>f : Symbol(f, Decl(contextualTypingFunctionReturningFunction2.ts, 0, 0), Decl(contextualTypingFunctionReturningFunction2.ts, 0, 36)) +>n : Symbol(n, Decl(contextualTypingFunctionReturningFunction2.ts, 0, 19)) + +declare function f(cb: () => (n: number) => number): void; +>f : Symbol(f, Decl(contextualTypingFunctionReturningFunction2.ts, 0, 0), Decl(contextualTypingFunctionReturningFunction2.ts, 0, 36)) +>cb : Symbol(cb, Decl(contextualTypingFunctionReturningFunction2.ts, 1, 19)) +>n : Symbol(n, Decl(contextualTypingFunctionReturningFunction2.ts, 1, 30)) + +f(() => n => n); +>f : Symbol(f, Decl(contextualTypingFunctionReturningFunction2.ts, 0, 0), Decl(contextualTypingFunctionReturningFunction2.ts, 0, 36)) +>n : Symbol(n, Decl(contextualTypingFunctionReturningFunction2.ts, 3, 7)) +>n : Symbol(n, Decl(contextualTypingFunctionReturningFunction2.ts, 3, 7)) + diff --git a/tests/baselines/reference/contextualTypingFunctionReturningFunction2.types b/tests/baselines/reference/contextualTypingFunctionReturningFunction2.types new file mode 100644 index 0000000000000..14126a0e0cdd8 --- /dev/null +++ b/tests/baselines/reference/contextualTypingFunctionReturningFunction2.types @@ -0,0 +1,18 @@ +=== tests/cases/compiler/contextualTypingFunctionReturningFunction2.ts === +declare function f(n: number): void; +>f : { (n: number): void; (cb: () => (n: number) => number): void; } +>n : number + +declare function f(cb: () => (n: number) => number): void; +>f : { (n: number): void; (cb: () => (n: number) => number): void; } +>cb : () => (n: number) => number +>n : number + +f(() => n => n); +>f(() => n => n) : void +>f : { (n: number): void; (cb: () => (n: number) => number): void; } +>() => n => n : () => (n: number) => number +>n => n : (n: number) => number +>n : number +>n : number + diff --git a/tests/baselines/reference/contextualTypingWithFixedTypeParameters1.errors.txt b/tests/baselines/reference/contextualTypingWithFixedTypeParameters1.errors.txt index 95b3c66c264a9..0fe1e69d0799c 100644 --- a/tests/baselines/reference/contextualTypingWithFixedTypeParameters1.errors.txt +++ b/tests/baselines/reference/contextualTypingWithFixedTypeParameters1.errors.txt @@ -1,15 +1,15 @@ tests/cases/compiler/contextualTypingWithFixedTypeParameters1.ts(2,22): error TS2339: Property 'foo' does not exist on type 'string'. -tests/cases/compiler/contextualTypingWithFixedTypeParameters1.ts(3,32): error TS2339: Property 'foo' does not exist on type 'string'. -tests/cases/compiler/contextualTypingWithFixedTypeParameters1.ts(3,38): error TS2345: Argument of type '1' is not assignable to parameter of type 'string'. +tests/cases/compiler/contextualTypingWithFixedTypeParameters1.ts(3,32): error TS2339: Property 'foo' does not exist on type '""'. +tests/cases/compiler/contextualTypingWithFixedTypeParameters1.ts(3,38): error TS2345: Argument of type '1' is not assignable to parameter of type '""'. ==== tests/cases/compiler/contextualTypingWithFixedTypeParameters1.ts (3 errors) ==== var f10: (x: T, b: () => (a: T) => void, y: T) => T; - f10('', () => a => a.foo, ''); // a is string + f10('', () => a => a.foo, ''); // a is "" ~~~ !!! error TS2339: Property 'foo' does not exist on type 'string'. var r9 = f10('', () => (a => a.foo), 1); // error ~~~ -!!! error TS2339: Property 'foo' does not exist on type 'string'. +!!! error TS2339: Property 'foo' does not exist on type '""'. ~ -!!! error TS2345: Argument of type '1' is not assignable to parameter of type 'string'. \ No newline at end of file +!!! error TS2345: Argument of type '1' is not assignable to parameter of type '""'. \ No newline at end of file diff --git a/tests/baselines/reference/contextualTypingWithFixedTypeParameters1.js b/tests/baselines/reference/contextualTypingWithFixedTypeParameters1.js index 55f7580b3f880..b60a7c986abc9 100644 --- a/tests/baselines/reference/contextualTypingWithFixedTypeParameters1.js +++ b/tests/baselines/reference/contextualTypingWithFixedTypeParameters1.js @@ -1,9 +1,9 @@ //// [contextualTypingWithFixedTypeParameters1.ts] var f10: (x: T, b: () => (a: T) => void, y: T) => T; -f10('', () => a => a.foo, ''); // a is string +f10('', () => a => a.foo, ''); // a is "" var r9 = f10('', () => (a => a.foo), 1); // error //// [contextualTypingWithFixedTypeParameters1.js] var f10; -f10('', function () { return function (a) { return a.foo; }; }, ''); // a is string +f10('', function () { return function (a) { return a.foo; }; }, ''); // a is "" var r9 = f10('', function () { return (function (a) { return a.foo; }); }, 1); // error diff --git a/tests/cases/compiler/contextualTypingFunctionReturningFunction.ts b/tests/cases/compiler/contextualTypingFunctionReturningFunction.ts index 2b371937f5cb4..556f42f7eb505 100644 --- a/tests/cases/compiler/contextualTypingFunctionReturningFunction.ts +++ b/tests/cases/compiler/contextualTypingFunctionReturningFunction.ts @@ -1,11 +1,11 @@ -interface I { - a(s: string): void; - b(): (n: number) => void; -} - -declare function f(i: I): void; - -f({ - a: s => {}, - b: () => n => {}, -}); +interface I { + a(s: string): void; + b(): (n: number) => void; +} + +declare function f(i: I): void; + +f({ + a: s => {}, + b: () => n => {}, +}); diff --git a/tests/cases/compiler/contextualTypingFunctionReturningFunction2.ts b/tests/cases/compiler/contextualTypingFunctionReturningFunction2.ts new file mode 100644 index 0000000000000..9bcd34e4c0f0f --- /dev/null +++ b/tests/cases/compiler/contextualTypingFunctionReturningFunction2.ts @@ -0,0 +1,4 @@ +declare function f(n: number): void; +declare function f(cb: () => (n: number) => number): void; + +f(() => n => n); diff --git a/tests/cases/compiler/contextualTypingWithFixedTypeParameters1.ts b/tests/cases/compiler/contextualTypingWithFixedTypeParameters1.ts index 1ea001057a98f..451e67092bb7a 100644 --- a/tests/cases/compiler/contextualTypingWithFixedTypeParameters1.ts +++ b/tests/cases/compiler/contextualTypingWithFixedTypeParameters1.ts @@ -1,3 +1,3 @@ var f10: (x: T, b: () => (a: T) => void, y: T) => T; -f10('', () => a => a.foo, ''); // a is string +f10('', () => a => a.foo, ''); // a is "" var r9 = f10('', () => (a => a.foo), 1); // error \ No newline at end of file From 6ef27a4e1e2d7daf77c21bdd2148ee4459be1420 Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Thu, 10 Aug 2017 08:28:25 -0700 Subject: [PATCH 099/237] Added test for class/namespace merging with an ESNext target. --- src/harness/unittests/transform.ts | 43 ++++++++++++++++++++---------- 1 file changed, 29 insertions(+), 14 deletions(-) diff --git a/src/harness/unittests/transform.ts b/src/harness/unittests/transform.ts index 74b92f7c5a73c..dc90638afd130 100644 --- a/src/harness/unittests/transform.ts +++ b/src/harness/unittests/transform.ts @@ -78,28 +78,43 @@ namespace ts { testBaseline("synthesizedNamespace", () => { return ts.transpileModule(`namespace Reflect { const x = 1; }`, { transformers: { - before: [forceSyntheticModuleDeclaration], + before: [forceNamespaceRewrite], }, compilerOptions: { newLine: NewLineKind.CarriageReturnLineFeed, } }).outputText; + }); - function forceSyntheticModuleDeclaration(context: ts.TransformationContext) { - return (sourceFile: ts.SourceFile): ts.SourceFile => { - return visitNode(sourceFile); + testBaseline("synthesizedNamespaceFollowingClass", () => { + return ts.transpileModule(` + class C { foo = 10; static bar = 20 } + namespace C { export let x = 10; } + `, { + transformers: { + before: [forceNamespaceRewrite], + }, + compilerOptions: { + target: ts.ScriptTarget.ESNext, + newLine: NewLineKind.CarriageReturnLineFeed, + } + }).outputText; + }); + + function forceNamespaceRewrite(context: ts.TransformationContext) { + return (sourceFile: ts.SourceFile): ts.SourceFile => { + return visitNode(sourceFile); - function visitNode(node: T): T { - if (node.kind === ts.SyntaxKind.ModuleBlock) { - const block = node as T & ts.ModuleBlock; - const statements = ts.createNodeArray([...block.statements]); - return ts.updateModuleBlock(block, statements) as typeof block; - } - return ts.visitEachChild(node, visitNode, context); + function visitNode(node: T): T { + if (node.kind === ts.SyntaxKind.ModuleBlock) { + const block = node as T & ts.ModuleBlock; + const statements = ts.createNodeArray([...block.statements]); + return ts.updateModuleBlock(block, statements) as typeof block; } - }; - } - }); + return ts.visitEachChild(node, visitNode, context); + } + }; + } }); } From 66e2a0bb943538f3496e41f55a80899f0cfd78e1 Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Thu, 10 Aug 2017 08:28:43 -0700 Subject: [PATCH 100/237] Accepted baselines. --- ...ormsCorrectly.synthesizedNamespaceFollowingClass.js | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 tests/baselines/reference/transformApi/transformsCorrectly.synthesizedNamespaceFollowingClass.js diff --git a/tests/baselines/reference/transformApi/transformsCorrectly.synthesizedNamespaceFollowingClass.js b/tests/baselines/reference/transformApi/transformsCorrectly.synthesizedNamespaceFollowingClass.js new file mode 100644 index 0000000000000..9dedde29f8b78 --- /dev/null +++ b/tests/baselines/reference/transformApi/transformsCorrectly.synthesizedNamespaceFollowingClass.js @@ -0,0 +1,10 @@ +class C { + constructor() { + this.foo = 10; + } +} +C.bar = 20; +var C; +(function (C) { + C.x = 10; +})(C || (C = {})); From de92e98770384e5e6023e10fce0609bbb0d029d8 Mon Sep 17 00:00:00 2001 From: Arthur Ozga Date: Thu, 10 Aug 2017 10:01:42 -0700 Subject: [PATCH 101/237] fix end-of-file assert failure --- src/services/services.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/services/services.ts b/src/services/services.ts index 648cc6c8320a1..24e85a2a0190d 100644 --- a/src/services/services.ts +++ b/src/services/services.ts @@ -107,12 +107,14 @@ namespace ts { scanner.setTextPos(pos); while (pos < end) { const token = scanner.scan(); - Debug.assert(token !== SyntaxKind.EndOfFileToken); // Else it would infinitely loop const textPos = scanner.getTextPos(); if (textPos <= end) { nodes.push(createNode(token, pos, textPos, this)); } pos = textPos; + if (token === SyntaxKind.EndOfFileToken) { + return pos; + } } return pos; } From 08fbcd8b80a63d7ad59bdeff8fdf47dcf0838d1c Mon Sep 17 00:00:00 2001 From: Andy Date: Thu, 10 Aug 2017 12:52:15 -0700 Subject: [PATCH 102/237] Fix many no-object-literal-type-assertion lint errors (#17278) * Fix many no-object-literal-type-assertion lint errors * Simple fixes * Use a union for FlowNode * PR feedback and remove remaining `id()` uses * Use a union for CodeBlock * Discriminate CodeBlock by CodeBlockKind --- src/compiler/binder.ts | 27 +----- src/compiler/checker.ts | 10 +- src/compiler/emitter.ts | 4 +- src/compiler/factory.ts | 4 +- src/compiler/parser.ts | 2 +- src/compiler/transformers/generators.ts | 94 +++++++++---------- src/compiler/types.ts | 20 ++-- src/harness/harness.ts | 2 +- src/harness/projectsRunner.ts | 4 +- src/harness/unittests/compileOnSave.ts | 14 +-- .../convertCompilerOptionsFromJson.ts | 42 ++++----- src/harness/unittests/matchFiles.ts | 20 ++-- src/harness/unittests/session.ts | 5 +- src/harness/unittests/typingsInstaller.ts | 14 +-- src/server/editorServices.ts | 15 +-- src/server/session.ts | 6 +- .../typingsInstaller/typingsInstaller.ts | 5 +- 17 files changed, 140 insertions(+), 148 deletions(-) diff --git a/src/compiler/binder.ts b/src/compiler/binder.ts index 45880f855fd7e..6ca2f402ac289 100644 --- a/src/compiler/binder.ts +++ b/src/compiler/binder.ts @@ -806,11 +806,7 @@ namespace ts { return antecedent; } setFlowNodeReferenced(antecedent); - return { - flags, - expression, - antecedent - }; + return { flags, expression, antecedent }; } function createFlowSwitchClause(antecedent: FlowNode, switchStatement: SwitchStatement, clauseStart: number, clauseEnd: number): FlowNode { @@ -818,31 +814,18 @@ namespace ts { return antecedent; } setFlowNodeReferenced(antecedent); - return { - flags: FlowFlags.SwitchClause, - switchStatement, - clauseStart, - clauseEnd, - antecedent - }; + return { flags: FlowFlags.SwitchClause, switchStatement, clauseStart, clauseEnd, antecedent }; } function createFlowAssignment(antecedent: FlowNode, node: Expression | VariableDeclaration | BindingElement): FlowNode { setFlowNodeReferenced(antecedent); - return { - flags: FlowFlags.Assignment, - antecedent, - node - }; + return { flags: FlowFlags.Assignment, antecedent, node }; } function createFlowArrayMutation(antecedent: FlowNode, node: CallExpression | BinaryExpression): FlowNode { setFlowNodeReferenced(antecedent); - return { - flags: FlowFlags.ArrayMutation, - antecedent, - node - }; + const res: FlowArrayMutation = { flags: FlowFlags.ArrayMutation, antecedent, node }; + return res; } function finishFlowLabel(flow: FlowLabel): FlowNode { diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index a6736ac7c3848..07c94bd746e0f 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -2172,7 +2172,7 @@ namespace ts { if (accessibleSymbolChain) { const hasAccessibleDeclarations = hasVisibleDeclarations(accessibleSymbolChain[0], shouldComputeAliasesToMakeVisible); if (!hasAccessibleDeclarations) { - return { + return { accessibility: SymbolAccessibility.NotAccessible, errorSymbolName: symbolToString(initialSymbol, enclosingDeclaration, meaning), errorModuleName: symbol !== initialSymbol ? symbolToString(symbol, enclosingDeclaration, SymbolFlags.Namespace) : undefined, @@ -2294,7 +2294,7 @@ namespace ts { const symbol = resolveName(enclosingDeclaration, firstIdentifier.escapedText, meaning, /*nodeNotFoundErrorMessage*/ undefined, /*nameArg*/ undefined); // Verify if the symbol is accessible - return (symbol && hasVisibleDeclarations(symbol, /*shouldComputeAliasToMakeVisible*/ true)) || { + return (symbol && hasVisibleDeclarations(symbol, /*shouldComputeAliasToMakeVisible*/ true)) || { accessibility: SymbolAccessibility.NotAccessible, errorSymbolName: getTextOfNode(firstIdentifier), errorNode: firstIdentifier @@ -6300,7 +6300,7 @@ namespace ts { return { kind: TypePredicateKind.This, type: getTypeFromTypeNode(node.type) - } as ThisTypePredicate; + }; } } @@ -8109,13 +8109,13 @@ namespace ts { parameterName: predicate.parameterName, parameterIndex: predicate.parameterIndex, type: instantiateType(predicate.type, mapper) - } as IdentifierTypePredicate; + }; } else { return { kind: TypePredicateKind.This, type: instantiateType(predicate.type, mapper) - } as ThisTypePredicate; + }; } } diff --git a/src/compiler/emitter.ts b/src/compiler/emitter.ts index d51f7ada3dec3..5444c618353bd 100644 --- a/src/compiler/emitter.ts +++ b/src/compiler/emitter.ts @@ -1195,7 +1195,9 @@ namespace ts { if (!(getEmitFlags(node) & EmitFlags.NoIndentation)) { const dotRangeStart = node.expression.end; const dotRangeEnd = skipTrivia(currentSourceFile.text, node.expression.end) + 1; - const dotToken = { kind: SyntaxKind.DotToken, pos: dotRangeStart, end: dotRangeEnd }; + const dotToken = createToken(SyntaxKind.DotToken); + dotToken.pos = dotRangeStart; + dotToken.end = dotRangeEnd; indentBeforeDot = needsIndentation(node, node.expression, dotToken); indentAfterDot = needsIndentation(node, dotToken, node.name); } diff --git a/src/compiler/factory.ts b/src/compiler/factory.ts index 47df0a9bdc27a..daec1bce1e8b5 100644 --- a/src/compiler/factory.ts +++ b/src/compiler/factory.ts @@ -2586,7 +2586,7 @@ namespace ts { } export function addSyntheticLeadingComment(node: T, kind: SyntaxKind.SingleLineCommentTrivia | SyntaxKind.MultiLineCommentTrivia, text: string, hasTrailingNewLine?: boolean) { - return setSyntheticLeadingComments(node, append(getSyntheticLeadingComments(node), { kind, pos: -1, end: -1, hasTrailingNewLine, text })); + return setSyntheticLeadingComments(node, append(getSyntheticLeadingComments(node), { kind, pos: -1, end: -1, hasTrailingNewLine, text })); } export function getSyntheticTrailingComments(node: Node): SynthesizedComment[] | undefined { @@ -2600,7 +2600,7 @@ namespace ts { } export function addSyntheticTrailingComment(node: T, kind: SyntaxKind.SingleLineCommentTrivia | SyntaxKind.MultiLineCommentTrivia, text: string, hasTrailingNewLine?: boolean) { - return setSyntheticTrailingComments(node, append(getSyntheticTrailingComments(node), { kind, pos: -1, end: -1, hasTrailingNewLine, text })); + return setSyntheticTrailingComments(node, append(getSyntheticTrailingComments(node), { kind, pos: -1, end: -1, hasTrailingNewLine, text })); } /** diff --git a/src/compiler/parser.ts b/src/compiler/parser.ts index ee47771d61915..3ec652b215e50 100644 --- a/src/compiler/parser.ts +++ b/src/compiler/parser.ts @@ -6169,7 +6169,7 @@ namespace ts { export function parseIsolatedJSDocComment(content: string, start: number, length: number): { jsDoc: JSDoc, diagnostics: Diagnostic[] } | undefined { initializeState(content, ScriptTarget.Latest, /*_syntaxCursor:*/ undefined, ScriptKind.JS); - sourceFile = { languageVariant: LanguageVariant.Standard, text: content }; + sourceFile = { languageVariant: LanguageVariant.Standard, text: content }; // tslint:disable-line no-object-literal-type-assertion const jsDoc = parseJSDocCommentWorker(start, length); const diagnostics = parseDiagnostics; clearState(); diff --git a/src/compiler/transformers/generators.ts b/src/compiler/transformers/generators.ts index 5e2016ab59064..f45147b526c70 100644 --- a/src/compiler/transformers/generators.ts +++ b/src/compiler/transformers/generators.ts @@ -164,12 +164,11 @@ namespace ts { } // A generated code block - interface CodeBlock { - kind: CodeBlockKind; - } + type CodeBlock = | ExceptionBlock | LabeledBlock | SwitchBlock | LoopBlock | WithBlock; // a generated exception block, used for 'try' statements - interface ExceptionBlock extends CodeBlock { + interface ExceptionBlock { + kind: CodeBlockKind.Exception; state: ExceptionBlockState; startLabel: Label; catchVariable?: Identifier; @@ -179,27 +178,31 @@ namespace ts { } // A generated code that tracks the target for 'break' statements in a LabeledStatement. - interface LabeledBlock extends CodeBlock { + interface LabeledBlock { + kind: CodeBlockKind.Labeled; labelText: string; isScript: boolean; breakLabel: Label; } // a generated block that tracks the target for 'break' statements in a 'switch' statement - interface SwitchBlock extends CodeBlock { + interface SwitchBlock { + kind: CodeBlockKind.Switch; isScript: boolean; breakLabel: Label; } // a generated block that tracks the targets for 'break' and 'continue' statements, used for iteration statements - interface LoopBlock extends CodeBlock { + interface LoopBlock { + kind: CodeBlockKind.Loop; continueLabel: Label; isScript: boolean; breakLabel: Label; } // a generated block associated with a 'with' statement - interface WithBlock extends CodeBlock { + interface WithBlock { + kind: CodeBlockKind.With; expression: Identifier; startLabel: Label; endLabel: Label; @@ -2070,7 +2073,7 @@ namespace ts { const startLabel = defineLabel(); const endLabel = defineLabel(); markLabel(startLabel); - beginBlock({ + beginBlock({ kind: CodeBlockKind.With, expression, startLabel, @@ -2087,10 +2090,6 @@ namespace ts { markLabel(block.endLabel); } - function isWithBlock(block: CodeBlock): block is WithBlock { - return block.kind === CodeBlockKind.With; - } - /** * Begins a code block for a generated `try` statement. */ @@ -2098,7 +2097,7 @@ namespace ts { const startLabel = defineLabel(); const endLabel = defineLabel(); markLabel(startLabel); - beginBlock({ + beginBlock({ kind: CodeBlockKind.Exception, state: ExceptionBlockState.Try, startLabel, @@ -2188,10 +2187,6 @@ namespace ts { exception.state = ExceptionBlockState.Done; } - function isExceptionBlock(block: CodeBlock): block is ExceptionBlock { - return block.kind === CodeBlockKind.Exception; - } - /** * Begins a code block that supports `break` or `continue` statements that are defined in * the source tree and not from generated code. @@ -2199,7 +2194,7 @@ namespace ts { * @param labelText Names from containing labeled statements. */ function beginScriptLoopBlock(): void { - beginBlock({ + beginBlock({ kind: CodeBlockKind.Loop, isScript: true, breakLabel: -1, @@ -2217,7 +2212,7 @@ namespace ts { */ function beginLoopBlock(continueLabel: Label): Label { const breakLabel = defineLabel(); - beginBlock({ + beginBlock({ kind: CodeBlockKind.Loop, isScript: false, breakLabel, @@ -2245,7 +2240,7 @@ namespace ts { * */ function beginScriptSwitchBlock(): void { - beginBlock({ + beginBlock({ kind: CodeBlockKind.Switch, isScript: true, breakLabel: -1 @@ -2259,7 +2254,7 @@ namespace ts { */ function beginSwitchBlock(): Label { const breakLabel = defineLabel(); - beginBlock({ + beginBlock({ kind: CodeBlockKind.Switch, isScript: false, breakLabel, @@ -2280,7 +2275,7 @@ namespace ts { } function beginScriptLabeledBlock(labelText: string) { - beginBlock({ + beginBlock({ kind: CodeBlockKind.Labeled, isScript: true, labelText, @@ -2290,7 +2285,7 @@ namespace ts { function beginLabeledBlock(labelText: string) { const breakLabel = defineLabel(); - beginBlock({ + beginBlock({ kind: CodeBlockKind.Labeled, isScript: false, labelText, @@ -2878,34 +2873,37 @@ namespace ts { for (; blockIndex < blockActions.length && blockOffsets[blockIndex] <= operationIndex; blockIndex++) { const block = blocks[blockIndex]; const blockAction = blockActions[blockIndex]; - if (isExceptionBlock(block)) { - if (blockAction === BlockAction.Open) { - if (!exceptionBlockStack) { - exceptionBlockStack = []; - } + switch (block.kind) { + case CodeBlockKind.Exception: + if (blockAction === BlockAction.Open) { + if (!exceptionBlockStack) { + exceptionBlockStack = []; + } - if (!statements) { - statements = []; - } + if (!statements) { + statements = []; + } - exceptionBlockStack.push(currentExceptionBlock); - currentExceptionBlock = block; - } - else if (blockAction === BlockAction.Close) { - currentExceptionBlock = exceptionBlockStack.pop(); - } - } - else if (isWithBlock(block)) { - if (blockAction === BlockAction.Open) { - if (!withBlockStack) { - withBlockStack = []; + exceptionBlockStack.push(currentExceptionBlock); + currentExceptionBlock = block; } + else if (blockAction === BlockAction.Close) { + currentExceptionBlock = exceptionBlockStack.pop(); + } + break; + case CodeBlockKind.With: + if (blockAction === BlockAction.Open) { + if (!withBlockStack) { + withBlockStack = []; + } - withBlockStack.push(block); - } - else if (blockAction === BlockAction.Close) { - withBlockStack.pop(); - } + withBlockStack.push(block); + } + else if (blockAction === BlockAction.Close) { + withBlockStack.pop(); + } + break; + // default: do nothing } } } diff --git a/src/compiler/types.ts b/src/compiler/types.ts index 76c0b640f4570..8989f5784b8f8 100644 --- a/src/compiler/types.ts +++ b/src/compiler/types.ts @@ -2176,16 +2176,18 @@ namespace ts { locked?: boolean; } - export interface AfterFinallyFlow extends FlowNode, FlowLock { + export interface AfterFinallyFlow extends FlowNodeBase, FlowLock { antecedent: FlowNode; } - export interface PreFinallyFlow extends FlowNode { + export interface PreFinallyFlow extends FlowNodeBase { antecedent: FlowNode; lock: FlowLock; } - export interface FlowNode { + export type FlowNode = + | AfterFinallyFlow | PreFinallyFlow | FlowStart | FlowLabel | FlowAssignment | FlowCondition | FlowSwitchClause | FlowArrayMutation; + export interface FlowNodeBase { flags: FlowFlags; id?: number; // Node id used by flow type cache in checker } @@ -2193,30 +2195,30 @@ namespace ts { // FlowStart represents the start of a control flow. For a function expression or arrow // function, the container property references the function (which in turn has a flowNode // property for the containing control flow). - export interface FlowStart extends FlowNode { + export interface FlowStart extends FlowNodeBase { container?: FunctionExpression | ArrowFunction | MethodDeclaration; } // FlowLabel represents a junction with multiple possible preceding control flows. - export interface FlowLabel extends FlowNode { + export interface FlowLabel extends FlowNodeBase { antecedents: FlowNode[]; } // FlowAssignment represents a node that assigns a value to a narrowable reference, // i.e. an identifier or a dotted name that starts with an identifier or 'this'. - export interface FlowAssignment extends FlowNode { + export interface FlowAssignment extends FlowNodeBase { node: Expression | VariableDeclaration | BindingElement; antecedent: FlowNode; } // FlowCondition represents a condition that is known to be true or false at the // node's location in the control flow. - export interface FlowCondition extends FlowNode { + export interface FlowCondition extends FlowNodeBase { expression: Expression; antecedent: FlowNode; } - export interface FlowSwitchClause extends FlowNode { + export interface FlowSwitchClause extends FlowNodeBase { switchStatement: SwitchStatement; clauseStart: number; // Start index of case/default clause range clauseEnd: number; // End index of case/default clause range @@ -2225,7 +2227,7 @@ namespace ts { // FlowArrayMutation represents a node potentially mutates an array, i.e. an // operation of the form 'x.push(value)', 'x.unshift(value)' or 'x[n] = value'. - export interface FlowArrayMutation extends FlowNode { + export interface FlowArrayMutation extends FlowNodeBase { node: CallExpression | BinaryExpression; antecedent: FlowNode; } diff --git a/src/harness/harness.ts b/src/harness/harness.ts index 4e42dc41fd8b8..6c5b3ba47784f 100644 --- a/src/harness/harness.ts +++ b/src/harness/harness.ts @@ -564,7 +564,7 @@ namespace Harness { } export let listFiles: typeof IO.listFiles = (path, spec?, options?) => { - options = options || <{ recursive?: boolean; }>{}; + options = options || {}; function filesInFolder(folder: string): string[] { let paths: string[] = []; diff --git a/src/harness/projectsRunner.ts b/src/harness/projectsRunner.ts index 7344c432b97ff..752767d970688 100644 --- a/src/harness/projectsRunner.ts +++ b/src/harness/projectsRunner.ts @@ -426,12 +426,12 @@ class ProjectRunner extends RunnerBase { compilerResult.program ? ts.filter(compilerResult.program.getSourceFiles(), sourceFile => !Harness.isDefaultLibraryFile(sourceFile.fileName)) : []), - sourceFile => { + (sourceFile): Harness.Compiler.TestFile => ({ unitName: ts.isRootedDiskPath(sourceFile.fileName) ? RunnerBase.removeFullPaths(sourceFile.fileName) : sourceFile.fileName, content: sourceFile.text - }); + })); return Harness.Compiler.getErrorBaseline(inputFiles, compilerResult.errors); } diff --git a/src/harness/unittests/compileOnSave.ts b/src/harness/unittests/compileOnSave.ts index 79e1f921dcb82..31a882b19d69d 100644 --- a/src/harness/unittests/compileOnSave.ts +++ b/src/harness/unittests/compileOnSave.ts @@ -518,18 +518,20 @@ namespace ts.projectSystem { }; const host = createServerHost([f], { newLine }); const session = createSession(host); - session.executeCommand({ + const openRequest: server.protocol.OpenRequest = { seq: 1, type: "request", - command: "open", + command: server.protocol.CommandTypes.Open, arguments: { file: f.path } - }); - session.executeCommand({ + }; + session.executeCommand(openRequest); + const emitFileRequest: server.protocol.CompileOnSaveEmitFileRequest = { seq: 2, type: "request", - command: "compileOnSaveEmitFile", + command: server.protocol.CommandTypes.CompileOnSaveEmitFile, arguments: { file: f.path } - }); + }; + session.executeCommand(emitFileRequest); const emitOutput = host.readFile(path + ts.Extension.Js); assert.equal(emitOutput, f.content + newLine, "content of emit output should be identical with the input + newline"); } diff --git a/src/harness/unittests/convertCompilerOptionsFromJson.ts b/src/harness/unittests/convertCompilerOptionsFromJson.ts index 4b2fad32d7b55..14c0cb7347db3 100644 --- a/src/harness/unittests/convertCompilerOptionsFromJson.ts +++ b/src/harness/unittests/convertCompilerOptionsFromJson.ts @@ -67,14 +67,14 @@ namespace ts { } }, "tsconfig.json", { - compilerOptions: { + compilerOptions: { module: ModuleKind.CommonJS, target: ScriptTarget.ES5, noImplicitAny: false, sourceMap: false, lib: ["lib.es5.d.ts", "lib.es2015.core.d.ts", "lib.es2015.symbol.d.ts"] }, - errors: [] + errors: [] } ); }); @@ -92,7 +92,7 @@ namespace ts { } }, "tsconfig.json", { - compilerOptions: { + compilerOptions: { module: ModuleKind.CommonJS, target: ScriptTarget.ES5, noImplicitAny: false, @@ -100,7 +100,7 @@ namespace ts { allowJs: false, lib: ["lib.es5.d.ts", "lib.es2015.core.d.ts", "lib.es2015.symbol.d.ts"] }, - errors: [] + errors: [] } ); }); @@ -117,7 +117,7 @@ namespace ts { } }, "tsconfig.json", { - compilerOptions: { + compilerOptions: { module: ModuleKind.CommonJS, target: ScriptTarget.ES5, noImplicitAny: false, @@ -146,7 +146,7 @@ namespace ts { } }, "tsconfig.json", { - compilerOptions: { + compilerOptions: { target: ScriptTarget.ES5, noImplicitAny: false, sourceMap: false, @@ -174,7 +174,7 @@ namespace ts { } }, "tsconfig.json", { - compilerOptions: { + compilerOptions: { target: ScriptTarget.ES5, noImplicitAny: false, sourceMap: false, @@ -201,7 +201,7 @@ namespace ts { } }, "tsconfig.json", { - compilerOptions: { + compilerOptions: { noImplicitAny: false, sourceMap: false, }, @@ -227,7 +227,7 @@ namespace ts { } }, "tsconfig.json", { - compilerOptions: { + compilerOptions: { noImplicitAny: false, sourceMap: false, }, @@ -255,7 +255,7 @@ namespace ts { } }, "tsconfig.json", { - compilerOptions: { + compilerOptions: { module: ModuleKind.CommonJS, target: ScriptTarget.ES5, noImplicitAny: false, @@ -286,7 +286,7 @@ namespace ts { } }, "tsconfig.json", { - compilerOptions: { + compilerOptions: { module: ModuleKind.CommonJS, target: ScriptTarget.ES5, noImplicitAny: false, @@ -317,7 +317,7 @@ namespace ts { } }, "tsconfig.json", { - compilerOptions: { + compilerOptions: { module: ModuleKind.CommonJS, target: ScriptTarget.ES5, noImplicitAny: false, @@ -348,7 +348,7 @@ namespace ts { } }, "tsconfig.json", { - compilerOptions: { + compilerOptions: { module: ModuleKind.CommonJS, target: ScriptTarget.ES5, noImplicitAny: false, @@ -379,7 +379,7 @@ namespace ts { } }, "tsconfig.json", { - compilerOptions: { + compilerOptions: { module: ModuleKind.CommonJS, target: ScriptTarget.ES5, noImplicitAny: false, @@ -415,8 +415,8 @@ namespace ts { it("Convert default tsconfig.json to compiler-options ", () => { assertCompilerOptions({}, "tsconfig.json", { - compilerOptions: {} as CompilerOptions, - errors: [] + compilerOptions: {}, + errors: [] } ); }); @@ -434,7 +434,7 @@ namespace ts { } }, "jsconfig.json", { - compilerOptions: { + compilerOptions: { allowJs: true, maxNodeModuleJsDepth: 2, allowSyntheticDefaultImports: true, @@ -445,7 +445,7 @@ namespace ts { sourceMap: false, lib: ["lib.es5.d.ts", "lib.es2015.core.d.ts", "lib.es2015.symbol.d.ts"] }, - errors: [] + errors: [] } ); }); @@ -463,7 +463,7 @@ namespace ts { } }, "jsconfig.json", { - compilerOptions: { + compilerOptions: { allowJs: false, maxNodeModuleJsDepth: 2, allowSyntheticDefaultImports: true, @@ -474,7 +474,7 @@ namespace ts { sourceMap: false, lib: ["lib.es5.d.ts", "lib.es2015.core.d.ts", "lib.es2015.symbol.d.ts"] }, - errors: [] + errors: [] } ); }); @@ -516,7 +516,7 @@ namespace ts { allowSyntheticDefaultImports: true, skipLibCheck: true }, - errors: [] + errors: [] } ); }); diff --git a/src/harness/unittests/matchFiles.ts b/src/harness/unittests/matchFiles.ts index 9e2a5883754d9..f2c2369ef37f4 100644 --- a/src/harness/unittests/matchFiles.ts +++ b/src/harness/unittests/matchFiles.ts @@ -110,23 +110,21 @@ namespace ts { } { const actual = ts.parseJsonConfigFileContent(json, host, basePath, existingOptions, configFileName, resolutionStack); - expected.errors = map(expected.errors, error => { - return { - category: error.category, - code: error.code, - file: undefined, - length: undefined, - messageText: error.messageText, - start: undefined, - }; - }); + expected.errors = expected.errors.map(error => ({ + category: error.category, + code: error.code, + file: undefined, + length: undefined, + messageText: error.messageText, + start: undefined, + })); assertParsed(actual, expected); } } function createDiagnosticForConfigFile(json: any, start: number, length: number, diagnosticMessage: DiagnosticMessage, arg0: string) { const text = JSON.stringify(json); - const file = { + const file = { // tslint:disable-line no-object-literal-type-assertion fileName: caseInsensitiveTsconfigPath, kind: SyntaxKind.SourceFile, text diff --git a/src/harness/unittests/session.ts b/src/harness/unittests/session.ts index 1ce5792a81bec..1f79213bee83e 100644 --- a/src/harness/unittests/session.ts +++ b/src/harness/unittests/session.ts @@ -81,14 +81,15 @@ namespace ts.server { session.executeCommand(req); - expect(lastSent).to.deep.equal({ + const expected: protocol.Response = { command: CommandNames.Unknown, type: "response", seq: 0, message: "Unrecognized JSON command: foobar", request_seq: 0, success: false - }); + }; + expect(lastSent).to.deep.equal(expected); }); it("should return a tuple containing the response and if a response is required on success", () => { const req: protocol.ConfigureRequest = { diff --git a/src/harness/unittests/typingsInstaller.ts b/src/harness/unittests/typingsInstaller.ts index 92ecd5e31b85f..6a6978254c12d 100644 --- a/src/harness/unittests/typingsInstaller.ts +++ b/src/harness/unittests/typingsInstaller.ts @@ -935,25 +935,26 @@ namespace ts.projectSystem { import * as cmd from "commander ` }; - session.executeCommand({ + const openRequest: server.protocol.OpenRequest = { seq: 1, type: "request", - command: "open", + command: server.protocol.CommandTypes.Open, arguments: { file: f.path, fileContent: f.content } - }); + }; + session.executeCommand(openRequest); const projectService = session.getProjectService(); checkNumberOfProjects(projectService, { inferredProjects: 1 }); const proj = projectService.inferredProjects[0]; const version1 = proj.getCachedUnresolvedImportsPerFile_TestOnly().getVersion(); // make a change that should not affect the structure of the program - session.executeCommand({ + const changeRequest: server.protocol.ChangeRequest = { seq: 2, type: "request", - command: "change", + command: server.protocol.CommandTypes.Change, arguments: { file: f.path, insertString: "\nlet x = 1;", @@ -962,7 +963,8 @@ namespace ts.projectSystem { endLine: 2, endOffset: 0 } - }); + }; + session.executeCommand(changeRequest); host.checkTimeoutQueueLength(1); host.runQueuedTimeoutCallbacks(); const version2 = proj.getCachedUnresolvedImportsPerFile_TestOnly().getVersion(); diff --git a/src/server/editorServices.ts b/src/server/editorServices.ts index a17ce1d578768..b03959d12a371 100644 --- a/src/server/editorServices.ts +++ b/src/server/editorServices.ts @@ -441,10 +441,11 @@ namespace ts.server { if (!this.eventHandler) { return; } - this.eventHandler({ + const event: ProjectLanguageServiceStateEvent = { eventName: ProjectLanguageServiceStateEvent, data: { project, languageServiceEnabled } - }); + }; + this.eventHandler(event); } updateTypingsForProject(response: SetTypings | InvalidateCachedTypings): void { @@ -602,10 +603,11 @@ namespace ts.server { } for (const openFile of this.openFiles) { - this.eventHandler({ + const event: ContextEvent = { eventName: ContextEvent, data: { project: openFile.getDefaultProject(), fileName: openFile.fileName } - }); + }; + this.eventHandler(event); } } @@ -1105,10 +1107,11 @@ namespace ts.server { return; } - this.eventHandler({ + const event: ConfigFileDiagEvent = { eventName: ConfigFileDiagEvent, data: { configFileName, diagnostics: diagnostics || emptyArray, triggerFile } - }); + }; + this.eventHandler(event); } private createAndAddConfiguredProject(configFileName: NormalizedPath, projectOptions: ProjectOptions, configFileErrors: ReadonlyArray, clientFileName?: string) { diff --git a/src/server/session.ts b/src/server/session.ts index 0b746e4090a57..a797ffc36daba 100644 --- a/src/server/session.ts +++ b/src/server/session.ts @@ -540,7 +540,7 @@ namespace ts.server { } private convertToDiagnosticsWithLinePositionFromDiagnosticFile(diagnostics: ReadonlyArray): protocol.DiagnosticWithLinePosition[] { - return diagnostics.map(d => { + return diagnostics.map(d => ({ message: flattenDiagnosticMessageText(d.messageText, this.host.newLine), start: d.start, length: d.length, @@ -548,7 +548,7 @@ namespace ts.server { code: d.code, startLocation: d.file && convertToLocation(getLineAndCharacterOfPosition(d.file, d.start)), endLocation: d.file && convertToLocation(getLineAndCharacterOfPosition(d.file, d.start + d.length)) - }); + })); } private getCompilerOptionsDiagnostics(args: protocol.CompilerOptionsDiagnosticsRequestArgs) { @@ -829,7 +829,7 @@ namespace ts.server { return renameLocations.map(location => { const locationScriptInfo = project.getScriptInfo(location.fileName); - return { + return { file: location.fileName, start: locationScriptInfo.positionToLineOffset(location.textSpan.start), end: locationScriptInfo.positionToLineOffset(textSpanEnd(location.textSpan)), diff --git a/src/server/typingsInstaller/typingsInstaller.ts b/src/server/typingsInstaller/typingsInstaller.ts index 8a3840fd98430..df2b6916e4bc0 100644 --- a/src/server/typingsInstaller/typingsInstaller.ts +++ b/src/server/typingsInstaller/typingsInstaller.ts @@ -356,14 +356,15 @@ namespace ts.server.typingsInstaller { this.sendResponse(this.createSetTypings(req, currentlyCachedTypings.concat(installedTypingFiles))); } finally { - this.sendResponse({ + const response: EndInstallTypes = { kind: EventEndInstallTypes, eventId: requestId, projectName: req.projectName, packagesToInstall: scopedTypings, installSuccess: ok, typingsInstallerVersion: ts.version // qualified explicitly to prevent occasional shadowing - }); + }; + this.sendResponse(response); } }); } From 12403d9f70d06787f53020a878725f36f92f95fc Mon Sep 17 00:00:00 2001 From: Ryan Cavanaugh Date: Thu, 10 Aug 2017 13:07:42 -0700 Subject: [PATCH 103/237] Various fixes --- src/services/refactors/extractMethod.ts | 26 ++++++++--------------- src/services/textChanges.ts | 4 +--- tests/cases/fourslash/extract-method25.ts | 19 +++++++++++++++++ 3 files changed, 29 insertions(+), 20 deletions(-) create mode 100644 tests/cases/fourslash/extract-method25.ts diff --git a/src/services/refactors/extractMethod.ts b/src/services/refactors/extractMethod.ts index 65e29138e9597..0f58da4ef1d13 100644 --- a/src/services/refactors/extractMethod.ts +++ b/src/services/refactors/extractMethod.ts @@ -235,7 +235,7 @@ namespace ts.refactor.extractMethod { return { errors }; } - // If our selection is the expression in an ExrpessionStatement, expand + // If our selection is the expression in an ExpressionStatement, expand // the selection to include the enclosing Statement (this stops us // from trying to care about the return value of the extracted function // and eliminates double semicolon insertion in certain scenarios) @@ -458,9 +458,9 @@ namespace ts.refactor.extractMethod { } } - function isValidExtractionTarget(node: Node) { + function isValidExtractionTarget(node: Node): node is Scope { // Note that we don't use isFunctionLike because we don't want to put the extracted closure *inside* a method - return (node.kind === SyntaxKind.FunctionDeclaration) || (node.kind === SyntaxKind.Constructor) || isSourceFile(node) || isModuleBlock(node) || isClassLike(node); + return (node.kind === SyntaxKind.FunctionDeclaration) || isSourceFile(node) || isModuleBlock(node) || isClassLike(node); } /** @@ -488,7 +488,7 @@ namespace ts.refactor.extractMethod { // * Class declaration or expression // * Module/namespace or source file if (current !== start && isValidExtractionTarget(current)) { - (scopes = scopes || []).push(current as FunctionLikeDeclaration); + (scopes = scopes || []).push(current); } // A function parameter's initializer is actually in the outer scope, not the function declaration @@ -613,16 +613,8 @@ namespace ts.refactor.extractMethod { const checker = context.program.getTypeChecker(); // Make a unique name for the extracted function - let functionNameText: __String; - if (isClassLike(scope)) { - const type = range.facts & RangeFacts.InStaticRegion ? checker.getTypeOfSymbolAtLocation(scope.symbol, scope) : checker.getDeclaredTypeOfSymbol(scope.symbol); - const props = checker.getPropertiesOfType(type); - functionNameText = getUniqueName(n => props.every(p => p.name !== n)); - } - else { - const file = scope.getSourceFile(); - functionNameText = getUniqueName(n => !file.identifiers.has(n as string)); - } + const file = scope.getSourceFile(); + const functionNameText: __String = getUniqueName(n => !file.identifiers.has(n as string)); const isJS = isInJavaScriptFile(scope); const functionName = createIdentifier(functionNameText as string); @@ -669,12 +661,12 @@ namespace ts.refactor.extractMethod { if (isClassLike(scope)) { // always create private method in TypeScript files const modifiers: Modifier[] = isJS ? [] : [createToken(SyntaxKind.PrivateKeyword)]; - if (range.facts & RangeFacts.IsAsyncFunction) { - modifiers.push(createToken(SyntaxKind.AsyncKeyword)); - } if (range.facts & RangeFacts.InStaticRegion) { modifiers.push(createToken(SyntaxKind.StaticKeyword)); } + if (range.facts & RangeFacts.IsAsyncFunction) { + modifiers.push(createToken(SyntaxKind.AsyncKeyword)); + } newFunction = createMethod( /*decorators*/ undefined, modifiers, diff --git a/src/services/textChanges.ts b/src/services/textChanges.ts index 5480c8f34a5fe..bddfc205db4c4 100644 --- a/src/services/textChanges.ts +++ b/src/services/textChanges.ts @@ -153,13 +153,11 @@ namespace ts.textChanges { } export function getAdjustedEndPosition(sourceFile: SourceFile, node: Node, options: ConfigurableEnd) { - if (options.useNonAdjustedEndPosition) { + if (options.useNonAdjustedEndPosition || isExpression(node)) { return node.getEnd(); } const end = node.getEnd(); const newEnd = skipTrivia(sourceFile.text, end, /*stopAfterLineBreak*/ true); - // check if last character before newPos is linebreak - // if yes - considered all skipped trivia to be trailing trivia of the node return newEnd !== end && isLineBreak(sourceFile.text.charCodeAt(newEnd - 1)) ? newEnd : end; diff --git a/tests/cases/fourslash/extract-method25.ts b/tests/cases/fourslash/extract-method25.ts new file mode 100644 index 0000000000000..ac7e7a2300497 --- /dev/null +++ b/tests/cases/fourslash/extract-method25.ts @@ -0,0 +1,19 @@ +/// + +// Preserve newlines correctly when semicolons aren't present + +//// function fn() { +//// var q = /*a*/[0]/*b*/ +//// q[0]++ +//// } + +goTo.select('a', 'b') +edit.applyRefactor('Extract Method', 'scope_0'); +verify.currentFileContentIs(`function fn() { + var q = newFunction() + q[0]++ + + function newFunction() { + return [0]; + } +}`); From 1ad411e13e4031e50fe34ccfa0ffc35d37470ee6 Mon Sep 17 00:00:00 2001 From: Ryan Cavanaugh Date: Thu, 10 Aug 2017 13:13:18 -0700 Subject: [PATCH 104/237] Various fixes --- src/compiler/checker.ts | 2 +- src/compiler/utilities.ts | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 68546b7ff9f41..d595cee8d0953 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -224,7 +224,7 @@ namespace ts { getSuggestionForNonexistentSymbol: (location, name, meaning) => unescapeLeadingUnderscores(getSuggestionForNonexistentSymbol(location, escapeLeadingUnderscores(name), meaning)), getBaseConstraintOfType, resolveName(name, location, meaning) { - return resolveName(location, name as __String, meaning, /*nameNotFoundMessage*/ undefined, /*nameArg*/ undefined); + return resolveName(location, escapeLeadingUnderscores(name), meaning, /*nameNotFoundMessage*/ undefined, /*nameArg*/ undefined); }, getJsxNamespace: () => unescapeLeadingUnderscores(getJsxNamespace()), }; diff --git a/src/compiler/utilities.ts b/src/compiler/utilities.ts index 619966725a7cb..336b6b8da0afb 100644 --- a/src/compiler/utilities.ts +++ b/src/compiler/utilities.ts @@ -693,7 +693,7 @@ namespace ts { // At this point, node is either a qualified name or an identifier Debug.assert(node.kind === SyntaxKind.Identifier || node.kind === SyntaxKind.QualifiedName || node.kind === SyntaxKind.PropertyAccessExpression, "'node' was expected to be a qualified name, identifier or property access in 'isPartOfTypeNode'."); - // falls through + // falls through case SyntaxKind.QualifiedName: case SyntaxKind.PropertyAccessExpression: case SyntaxKind.ThisKeyword: @@ -968,7 +968,7 @@ namespace ts { if (!includeArrowFunctions) { continue; } - // falls through + // falls through case SyntaxKind.FunctionDeclaration: case SyntaxKind.FunctionExpression: case SyntaxKind.ModuleDeclaration: @@ -1027,7 +1027,7 @@ namespace ts { if (!stopOnFunctions) { continue; } - // falls through + // falls through case SyntaxKind.PropertyDeclaration: case SyntaxKind.PropertySignature: case SyntaxKind.MethodDeclaration: @@ -1211,7 +1211,7 @@ namespace ts { if (node.parent.kind === SyntaxKind.TypeQuery || isJSXTagName(node)) { return true; } - // falls through + // falls through case SyntaxKind.NumericLiteral: case SyntaxKind.StringLiteral: case SyntaxKind.ThisKeyword: @@ -1907,7 +1907,7 @@ namespace ts { if (node.asteriskToken) { flags |= FunctionFlags.Generator; } - // falls through + // falls through case SyntaxKind.ArrowFunction: if (hasModifier(node, ModifierFlags.Async)) { flags |= FunctionFlags.Async; From c7d691dc15550b69cfec59bcb10c8e261e7dd7db Mon Sep 17 00:00:00 2001 From: uniqueiniquity Date: Thu, 10 Aug 2017 13:27:24 -0700 Subject: [PATCH 105/237] Generalize to nested arrays and refactor --- src/services/outliningElementsCollector.ts | 40 +++++++------------ .../getOutliningForObjectsInArray.ts | 19 +++++++++ 2 files changed, 33 insertions(+), 26 deletions(-) diff --git a/src/services/outliningElementsCollector.ts b/src/services/outliningElementsCollector.ts index 0958892c1e61a..edebf98a24bc4 100644 --- a/src/services/outliningElementsCollector.ts +++ b/src/services/outliningElementsCollector.ts @@ -4,25 +4,13 @@ namespace ts.OutliningElementsCollector { const elements: OutliningSpan[] = []; const collapseText = "..."; - function addOutliningSpan(hintSpanNode: Node, startElement: Node, endElement: Node, autoCollapse: boolean) { + function addOutliningSpan(hintSpanNode: Node, startElement: Node, endElement: Node, autoCollapse: boolean, fullStart: boolean) { if (hintSpanNode && startElement && endElement) { const span: OutliningSpan = { - textSpan: createTextSpanFromBounds(startElement.pos, endElement.end), - hintSpan: createTextSpanFromNode(hintSpanNode, sourceFile), - bannerText: collapseText, - autoCollapse, - }; - elements.push(span); - } - } - - function addOutliningForObjectLiteralsInArray(startElement: Node, endElement: Node, autoCollapse: boolean) { - if (startElement && endElement) { - const span: OutliningSpan = { - textSpan: createTextSpanFromBounds(startElement.getStart(), endElement.end), + textSpan: createTextSpanFromBounds(fullStart ? startElement.pos : startElement.getStart(), endElement.end), hintSpan: createTextSpanFromBounds(startElement.getStart(), endElement.end), bannerText: collapseText, - autoCollapse + autoCollapse, }; elements.push(span); } @@ -125,7 +113,7 @@ namespace ts.OutliningElementsCollector { parent.kind === SyntaxKind.WithStatement || parent.kind === SyntaxKind.CatchClause) { - addOutliningSpan(parent, openBrace, closeBrace, autoCollapse(n)); + addOutliningSpan(parent, openBrace, closeBrace, autoCollapse(n), /* fullStart */ true); break; } @@ -133,13 +121,13 @@ namespace ts.OutliningElementsCollector { // Could be the try-block, or the finally-block. const tryStatement = parent; if (tryStatement.tryBlock === n) { - addOutliningSpan(parent, openBrace, closeBrace, autoCollapse(n)); + addOutliningSpan(parent, openBrace, closeBrace, autoCollapse(n), /* fullStart */ true); break; } else if (tryStatement.finallyBlock === n) { const finallyKeyword = findChildOfKind(tryStatement, SyntaxKind.FinallyKeyword, sourceFile); if (finallyKeyword) { - addOutliningSpan(finallyKeyword, openBrace, closeBrace, autoCollapse(n)); + addOutliningSpan(finallyKeyword, openBrace, closeBrace, autoCollapse(n), /* fullStart */ true); break; } } @@ -163,27 +151,27 @@ namespace ts.OutliningElementsCollector { case SyntaxKind.ModuleBlock: { const openBrace = findChildOfKind(n, SyntaxKind.OpenBraceToken, sourceFile); const closeBrace = findChildOfKind(n, SyntaxKind.CloseBraceToken, sourceFile); - addOutliningSpan(n.parent, openBrace, closeBrace, autoCollapse(n)); + addOutliningSpan(n.parent, openBrace, closeBrace, autoCollapse(n), /* fullStart */ true); break; } case SyntaxKind.ClassDeclaration: case SyntaxKind.InterfaceDeclaration: case SyntaxKind.EnumDeclaration: - case SyntaxKind.ObjectLiteralExpression: case SyntaxKind.CaseBlock: { const openBrace = findChildOfKind(n, SyntaxKind.OpenBraceToken, sourceFile); const closeBrace = findChildOfKind(n, SyntaxKind.CloseBraceToken, sourceFile); - if (n.kind === SyntaxKind.ObjectLiteralExpression && n.parent.kind === SyntaxKind.ArrayLiteralExpression) { - addOutliningForObjectLiteralsInArray(openBrace, closeBrace, autoCollapse(n)); - break; - } - addOutliningSpan(n, openBrace, closeBrace, autoCollapse(n)); + addOutliningSpan(n, openBrace, closeBrace, autoCollapse(n), /* fullStart */ true); break; } + case SyntaxKind.ObjectLiteralExpression: + const openBrace = findChildOfKind(n, SyntaxKind.OpenBraceToken, sourceFile); + const closeBrace = findChildOfKind(n, SyntaxKind.CloseBraceToken, sourceFile); + addOutliningSpan(n, openBrace, closeBrace, autoCollapse(n), /* fullStart */ n.parent.kind !== SyntaxKind.ArrayLiteralExpression); + break; case SyntaxKind.ArrayLiteralExpression: const openBracket = findChildOfKind(n, SyntaxKind.OpenBracketToken, sourceFile); const closeBracket = findChildOfKind(n, SyntaxKind.CloseBracketToken, sourceFile); - addOutliningSpan(n, openBracket, closeBracket, autoCollapse(n)); + addOutliningSpan(n, openBracket, closeBracket, autoCollapse(n), /* fullStart */ n.parent.kind !== SyntaxKind.ArrayLiteralExpression); break; } depth++; diff --git a/tests/cases/fourslash/getOutliningForObjectsInArray.ts b/tests/cases/fourslash/getOutliningForObjectsInArray.ts index 87d2bc96e2e2f..207da1997b4c9 100644 --- a/tests/cases/fourslash/getOutliningForObjectsInArray.ts +++ b/tests/cases/fourslash/getOutliningForObjectsInArray.ts @@ -19,5 +19,24 @@ //// c: 2 //// }|] //// ]|]; +//// +////// same behavior for nested arrays +//// const w =[| [ +//// [|[ a: 0 ]|], +//// [|[ b: 1 ]|], +//// [|[ c: 2 ]|] +//// ]|]; +//// +//// const z =[| [ +//// [|[ +//// a: 0 +//// ]|], +//// [|[ +//// b: 1 +//// ]|], +//// [|[ +//// c: 2 +//// ]|] +//// ]|]; verify.outliningSpansInCurrentFile(test.ranges()); \ No newline at end of file From a6a27ab66132087d889ded64373d42174e85f2fe Mon Sep 17 00:00:00 2001 From: Wesley Wigham Date: Thu, 10 Aug 2017 14:34:04 -0700 Subject: [PATCH 106/237] Do not inline sourcemaps in jake - source-map-support can't handle it (#17732) * Do not inline sourcemaps - sourcemap support cant handle it * Run gulp silently --- Jakefile.js | 26 +++++--------------------- 1 file changed, 5 insertions(+), 21 deletions(-) diff --git a/Jakefile.js b/Jakefile.js index e6ff364e58bd4..6c3a1596d3d65 100644 --- a/Jakefile.js +++ b/Jakefile.js @@ -533,7 +533,6 @@ var tscFile = path.join(builtLocalDirectory, compilerFilename); compileFile(tscFile, compilerSources, [builtLocalDirectory, copyright].concat(compilerSources), [copyright], /*useBuiltCompiler:*/ false); var servicesFile = path.join(builtLocalDirectory, "typescriptServices.js"); -var servicesFileInBrowserTest = path.join(builtLocalDirectory, "typescriptServicesInBrowserTest.js"); var standaloneDefinitionsFile = path.join(builtLocalDirectory, "typescriptServices.d.ts"); var nodePackageFile = path.join(builtLocalDirectory, "typescript.js"); var nodeDefinitionsFile = path.join(builtLocalDirectory, "typescript.d.ts"); @@ -572,22 +571,6 @@ compileFile(servicesFile, servicesSources, [builtLocalDirectory, copyright].conc fs.writeFileSync(nodeStandaloneDefinitionsFile, nodeStandaloneDefinitionsFileContents); }); -compileFile( - servicesFileInBrowserTest, - servicesSources, - [builtLocalDirectory, copyright].concat(servicesSources), - /*prefixes*/[copyright], - /*useBuiltCompiler*/ true, - { - noOutFile: false, - generateDeclarations: true, - preserveConstEnums: true, - keepComments: true, - noResolve: false, - stripInternal: true, - inlineSourceMap: true - }); - file(typescriptServicesDts, [servicesFile]); var cancellationTokenFile = path.join(builtLocalDirectory, "cancellationToken.js"); @@ -725,7 +708,7 @@ compileFile( /*prereqs*/[builtLocalDirectory, tscFile].concat(libraryTargets).concat(servicesSources).concat(harnessSources), /*prefixes*/[], /*useBuiltCompiler:*/ true, - /*opts*/ { inlineSourceMap: true, types: ["node", "mocha", "chai"], lib: "es6" }); + /*opts*/ { types: ["node", "mocha", "chai"], lib: "es6" }); var internalTests = "internal/"; @@ -961,13 +944,14 @@ var nodeServerInFile = "tests/webTestServer.ts"; compileFile(nodeServerOutFile, [nodeServerInFile], [builtLocalDirectory, tscFile], [], /*useBuiltCompiler:*/ true, { noOutFile: true, lib: "es6" }); desc("Runs browserify on run.js to produce a file suitable for running tests in the browser"); -task("browserify", ["tests", run, builtLocalDirectory, nodeServerOutFile], function() { - var cmd = 'browserify built/local/run.js -t ./scripts/browserify-optional -d -o built/local/bundle.js'; +task("browserify", [], function() { + // Shell out to `gulp`, since we do the work to handle sourcemaps correctly w/o inline maps there + var cmd = 'gulp browserify --silent'; exec(cmd); }, { async: true }); desc("Runs the tests using the built run.js file like 'jake runtests'. Syntax is jake runtests-browser. Additional optional parameters tests=[regex], browser=[chrome|IE]"); -task("runtests-browser", ["tests", "browserify", builtLocalDirectory, servicesFileInBrowserTest], function () { +task("runtests-browser", ["browserify", nodeServerOutFile], function () { cleanTestDirs(); host = "node"; browser = process.env.browser || process.env.b || (os.platform() === "linux" ? "chrome" : "IE"); From f957429efd68bfe5089348b361c30663bac6e65b Mon Sep 17 00:00:00 2001 From: Ryan Cavanaugh Date: Thu, 10 Aug 2017 16:23:17 -0700 Subject: [PATCH 107/237] Style fixups --- src/compiler/transformers/es2015.ts | 2 +- src/compiler/utilities.ts | 8 --- src/harness/fourslash.ts | 2 +- src/harness/unittests/extractMethods.ts | 4 +- src/services/refactors/extractMethod.ts | 93 +++++++++++++------------ 5 files changed, 51 insertions(+), 58 deletions(-) diff --git a/src/compiler/transformers/es2015.ts b/src/compiler/transformers/es2015.ts index da827d7b63e9d..6c8f0a75bdb3c 100644 --- a/src/compiler/transformers/es2015.ts +++ b/src/compiler/transformers/es2015.ts @@ -394,7 +394,7 @@ namespace ts { function shouldVisitNode(node: Node): boolean { return (node.transformFlags & TransformFlags.ContainsES2015) !== 0 || convertedLoopState !== undefined - || (hierarchyFacts & HierarchyFacts.ConstructorWithCapturedSuper && isStatementOrBlock(node)) + || (hierarchyFacts & HierarchyFacts.ConstructorWithCapturedSuper && (isStatement(node) || (node.kind === SyntaxKind.Block))) || (isIterationStatement(node, /*lookInLabeledStatements*/ false) && shouldConvertIterationStatementBody(node)) || isTypeScriptClassWrapper(node); } diff --git a/src/compiler/utilities.ts b/src/compiler/utilities.ts index 336b6b8da0afb..78d7dfa729084 100644 --- a/src/compiler/utilities.ts +++ b/src/compiler/utilities.ts @@ -5353,14 +5353,6 @@ namespace ts { || isBlockStatement(node); } - /* @internal */ - export function isStatementOrBlock(node: Node): node is Statement { - const kind = node.kind; - return isStatementKindButNotDeclarationKind(kind) - || isDeclarationStatementKind(kind) - || node.kind === SyntaxKind.Block; - } - function isBlockStatement(node: Node): node is Block { if (node.kind !== SyntaxKind.Block) return false; if (node.parent !== undefined) { diff --git a/src/harness/fourslash.ts b/src/harness/fourslash.ts index 7f8ded3e2599b..784c354b13b90 100644 --- a/src/harness/fourslash.ts +++ b/src/harness/fourslash.ts @@ -2766,7 +2766,7 @@ namespace FourSlash { const isAvailable = refactors.length > 0; if (negative && isAvailable) { - this.raiseError(`verifyApplicableRefactorAvailableForRange failed - expected no refactor but found some.`); + this.raiseError(`verifyApplicableRefactorAvailableForRange failed - expected no refactor but found some: ${refactors.map(r => r.name).join(", ")}`); } else if (!negative && !isAvailable) { this.raiseError(`verifyApplicableRefactorAvailableForRange failed - expected a refactor but found none.`); diff --git a/src/harness/unittests/extractMethods.ts b/src/harness/unittests/extractMethods.ts index 4b5d1911b4914..d096cd3d375d9 100644 --- a/src/harness/unittests/extractMethods.ts +++ b/src/harness/unittests/extractMethods.ts @@ -575,12 +575,12 @@ namespace A { }; const result = refactor.extractMethod.getRangeToExtract(sourceFile, createTextSpanFromBounds(selectionRange.start, selectionRange.end)); assert.equal(result.errors, undefined, "expect no errors"); - const results = refactor.extractMethod.extractRange(result.targetRange, context); + const results = refactor.extractMethod.getPossibleExtractions(result.targetRange, context); const data: string[] = []; data.push(`==ORIGINAL==`); data.push(sourceFile.text); for (const r of results) { - const changes = refactor.extractMethod.extractRange(result.targetRange, context, results.indexOf(r))[0].changes; + const changes = refactor.extractMethod.getPossibleExtractions(result.targetRange, context, results.indexOf(r))[0].changes; data.push(`==SCOPE::${r.scopeDescription}==`); data.push(textChanges.applyChanges(sourceFile.text, changes[0].textChanges)); } diff --git a/src/services/refactors/extractMethod.ts b/src/services/refactors/extractMethod.ts index 0f58da4ef1d13..4315092e192d9 100644 --- a/src/services/refactors/extractMethod.ts +++ b/src/services/refactors/extractMethod.ts @@ -21,7 +21,7 @@ namespace ts.refactor.extractMethod { return undefined; } - const extractions = extractRange(targetRange, context); + const extractions = getPossibleExtractions(targetRange, context); if (extractions === undefined) { // No extractions possible return undefined; @@ -37,15 +37,19 @@ namespace ts.refactor.extractMethod { continue; } - // Don't issue refactorings with duplicated names + // Don't issue refactorings with duplicated names. + // Scopes come back in "innermost first" order, so extractions will + // preferentially go into nearer scopes const description = formatStringFromArgs(Diagnostics.Extract_function_into_0.message, [extr.scopeDescription]); - if (!usedNames.get(description)) { + if (!usedNames.has(description)) { usedNames.set(description, true); actions.push({ description, name: `scope_${i}` }); } + // *do* increment i anyway because we'll look for the i-th scope + // later when actually doing the refactoring if the user requests it i++; } @@ -66,21 +70,14 @@ namespace ts.refactor.extractMethod { const rangeToExtract = getRangeToExtract(context.file, { start: context.startPosition, length }); const targetRange: TargetRange = rangeToExtract.targetRange; - const parsedIndexMatch = /scope_(\d+)/.exec(actionName); - if (!parsedIndexMatch) { - throw new Error("Expected to match the regexp"); - } + const parsedIndexMatch = /^scope_(\d+)$/.exec(actionName); + Debug.assert(!!parsedIndexMatch, "Scope name should have matched the regexp"); const index = +parsedIndexMatch[1]; - if (!isFinite(index)) { - throw new Error("Expected to parse a number from the scope index"); - } + Debug.assert(isFinite(index), "Expected to parse a finite number from the scope index"); - const extractions = extractRange(targetRange, context, index); - if (extractions === undefined) { - // Scope is no longer valid from when the user issued the refactor - // return undefined; - return undefined; - } + const extractions = getPossibleExtractions(targetRange, context, index); + // Scope is no longer valid from when the user issued the refactor (??) + Debug.assert(extractions !== undefined, "The extraction went missing? How?"); return ({ edits: extractions[0].changes }); } @@ -229,7 +226,7 @@ namespace ts.refactor.extractMethod { return { targetRange: { range: statements, facts: rangeFacts, declarations } }; } else { - // We have a single expression (start) + // We have a single node (start) const errors = checkRootNode(start) || checkNode(start); if (errors) { return { errors }; @@ -243,7 +240,7 @@ namespace ts.refactor.extractMethod { ? [start] : start.parent && start.parent.kind === SyntaxKind.ExpressionStatement ? [start.parent as Statement] - : start; + : start as Expression; return { targetRange: { range, facts: rangeFacts, declarations } }; } @@ -259,6 +256,31 @@ namespace ts.refactor.extractMethod { return undefined; } + function checkForStaticContext(nodeToCheck: Node, containingClass: Node) { + let current: Node = nodeToCheck; + while (current !== containingClass) { + if (current.kind === SyntaxKind.PropertyDeclaration) { + if (hasModifier(current, ModifierFlags.Static)) { + rangeFacts |= RangeFacts.InStaticRegion; + } + break; + } + else if (current.kind === SyntaxKind.Parameter) { + const ctorOrMethod = getContainingFunction(current); + if (ctorOrMethod.kind === SyntaxKind.Constructor) { + rangeFacts |= RangeFacts.InStaticRegion; + } + break; + } + else if (current.kind === SyntaxKind.MethodDeclaration) { + if (hasModifier(current, ModifierFlags.Static)) { + rangeFacts |= RangeFacts.InStaticRegion; + } + } + current = current.parent; + } + } + // Verifies whether we can actually extract this node or not. function checkNode(nodeToCheck: Node): Diagnostic[] | undefined { const enum PermittedJumps { @@ -275,31 +297,10 @@ namespace ts.refactor.extractMethod { return [createDiagnosticForNode(nodeToCheck, Messages.CannotExtractAmbientBlock)]; } - // If we're in a class, see if we're in a static region (static property initializer, static method, class constructor parameter default) or not - const stoppingPoint: Node = getContainingClass(nodeToCheck); - if (stoppingPoint) { - let current: Node = nodeToCheck; - while (current !== stoppingPoint) { - if (current.kind === SyntaxKind.PropertyDeclaration) { - if (hasModifier(current, ModifierFlags.Static)) { - rangeFacts |= RangeFacts.InStaticRegion; - } - break; - } - else if (current.kind === SyntaxKind.Parameter) { - const ctorOrMethod = getContainingFunction(current); - if (ctorOrMethod.kind === SyntaxKind.Constructor) { - rangeFacts |= RangeFacts.InStaticRegion; - } - break; - } - else if (current.kind === SyntaxKind.MethodDeclaration) { - if (hasModifier(current, ModifierFlags.Static)) { - rangeFacts |= RangeFacts.InStaticRegion; - } - } - current = current.parent; - } + // If we're in a class, see whether we're in a static region (static property initializer, static method, class constructor parameter default) + const containingClass: Node = getContainingClass(nodeToCheck); + if (containingClass) { + checkForStaticContext(nodeToCheck, containingClass); } let errors: Diagnostic[]; @@ -319,7 +320,7 @@ namespace ts.refactor.extractMethod { if (isDeclaration(node)) { const declaringNode = (node.kind === SyntaxKind.VariableDeclaration) ? node.parent.parent : node; if (hasModifier(declaringNode, ModifierFlags.Export)) { - (errors || (errors = []).push(createDiagnosticForNode(node, Messages.CannotExtractExportedEntity))); + (errors || (errors = [])).push(createDiagnosticForNode(node, Messages.CannotExtractExportedEntity)); return true; } declarations.push(node.symbol); @@ -494,7 +495,7 @@ namespace ts.refactor.extractMethod { // A function parameter's initializer is actually in the outer scope, not the function declaration if (current && current.parent && current.parent.kind === SyntaxKind.Parameter) { // Skip all the way to the outer scope of the function that declared this parameter - current = current.parent.parent.parent; + current = findAncestor(current, parent => isFunctionLike(parent)).parent; } else { current = current.parent; @@ -509,7 +510,7 @@ namespace ts.refactor.extractMethod { * Each returned ExtractResultForScope corresponds to a possible target scope and is either a set of changes * or an error explaining why we can't extract into that scope. */ - export function extractRange(targetRange: TargetRange, context: RefactorContext, requestedChangesIndex: number = undefined): ReadonlyArray | undefined { + export function getPossibleExtractions(targetRange: TargetRange, context: RefactorContext, requestedChangesIndex: number = undefined): ReadonlyArray | undefined { const { file: sourceFile } = context; if (targetRange === undefined) { From a04633c22ca8fad86c8e946c59519271111b3787 Mon Sep 17 00:00:00 2001 From: Ryan Cavanaugh Date: Thu, 10 Aug 2017 16:35:32 -0700 Subject: [PATCH 108/237] Style fixes --- src/services/refactors/extractMethod.ts | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/src/services/refactors/extractMethod.ts b/src/services/refactors/extractMethod.ts index 4315092e192d9..893cc87596308 100644 --- a/src/services/refactors/extractMethod.ts +++ b/src/services/refactors/extractMethod.ts @@ -289,7 +289,7 @@ namespace ts.refactor.extractMethod { Continue = 1 << 1, Return = 1 << 2 } - if (!isStatement(nodeToCheck) && !(isExpression(nodeToCheck) && isLegalExpressionExtraction(nodeToCheck))) { + if (!isStatement(nodeToCheck) && !(isExpression(nodeToCheck) && isExtractableExpression(nodeToCheck))) { return [createDiagnosticForNode(nodeToCheck, Messages.StatementOrExpressionExpected)]; } @@ -592,13 +592,13 @@ namespace ts.refactor.extractMethod { } } - function getUniqueName(isNameOkay: (name: __String) => boolean) { - let functionNameText = "newFunction" as __String; + function getUniqueName(isNameOkay: (name: string) => boolean) { + let functionNameText = "newFunction"; if (isNameOkay(functionNameText)) { return functionNameText; } let i = 1; - while (!isNameOkay(functionNameText = `newFunction_${i}` as __String)) { + while (!isNameOkay(functionNameText = `newFunction_${i}`)) { i++; } return functionNameText; @@ -615,7 +615,7 @@ namespace ts.refactor.extractMethod { // Make a unique name for the extracted function const file = scope.getSourceFile(); - const functionNameText: __String = getUniqueName(n => !file.identifiers.has(n as string)); + const functionNameText: string = getUniqueName(n => !file.identifiers.has(n)); const isJS = isInJavaScriptFile(scope); const functionName = createIdentifier(functionNameText as string); @@ -937,7 +937,6 @@ namespace ts.refactor.extractMethod { valueUsage = Usage.Write; collectUsages(node.left); valueUsage = savedValueUsage; - collectUsages(node.right); } else if (isUnaryExpressionWithWrite(node)) { @@ -1086,10 +1085,9 @@ namespace ts.refactor.extractMethod { } function getParentNodeInSpan(node: Node, file: SourceFile, span: TextSpan): Node { - while (node) { - if (!node.parent) { - return undefined; - } + if (!node) return undefined; + + while (node.parent) { if (isSourceFile(node.parent) || !spanContainsNode(span, node.parent, file)) { return node; } @@ -1110,7 +1108,7 @@ namespace ts.refactor.extractMethod { * such as `import x from 'y'` -- the 'y' is a StringLiteral but is *not* an expression * in the sense of something that you could extract on */ - function isLegalExpressionExtraction(node: Node): boolean { + function isExtractableExpression(node: Node): boolean { switch (node.parent.kind) { case SyntaxKind.EnumMember: return false; @@ -1128,7 +1126,8 @@ namespace ts.refactor.extractMethod { case SyntaxKind.Identifier: return node.parent.kind !== SyntaxKind.BindingElement && - node.parent.kind !== SyntaxKind.ImportSpecifier; + node.parent.kind !== SyntaxKind.ImportSpecifier && + node.parent.kind !== SyntaxKind.ExportSpecifier; } return true; } From db37cea0b6d3235ec9db63391e5e78f64627f560 Mon Sep 17 00:00:00 2001 From: Ryan Cavanaugh Date: Thu, 10 Aug 2017 16:38:24 -0700 Subject: [PATCH 109/237] Use the function stack! --- src/services/refactors/extractMethod.ts | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/src/services/refactors/extractMethod.ts b/src/services/refactors/extractMethod.ts index 893cc87596308..93a7c2e34106d 100644 --- a/src/services/refactors/extractMethod.ts +++ b/src/services/refactors/extractMethod.ts @@ -890,7 +890,6 @@ namespace ts.refactor.extractMethod { errorsPerScope.push([]); } const seenUsages = createMap(); - let valueUsage = Usage.Read; const target = isReadonlyArray(targetRange.range) ? createBlock(targetRange.range) : targetRange.range; const containingLexicalScopeOfExtraction = isBlockScope(scopes[0], scopes[0].parent) ? scopes[0] : getEnclosingBlockScopeContainer(scopes[0]); @@ -926,31 +925,22 @@ namespace ts.refactor.extractMethod { return { target, usagesPerScope, errorsPerScope }; - function collectUsages(node: Node) { + function collectUsages(node: Node, valueUsage = Usage.Read) { if (isDeclaration(node) && node.symbol) { visibleDeclarationsInExtractedRange.push(node.symbol); } if (isAssignmentExpression(node)) { - const savedValueUsage = valueUsage; // use 'write' as default usage for values - valueUsage = Usage.Write; - collectUsages(node.left); - valueUsage = savedValueUsage; + collectUsages(node.left, Usage.Write); collectUsages(node.right); } else if (isUnaryExpressionWithWrite(node)) { - const savedValueUsage = valueUsage; - valueUsage = Usage.Write; - collectUsages(node.operand); - valueUsage = savedValueUsage; + collectUsages(node.operand, Usage.Write); } else if (isPropertyAccessExpression(node) || isElementAccessExpression(node)) { - const savedValueUsage = valueUsage; // use 'write' as default usage for values - valueUsage = Usage.Read; forEachChild(node, collectUsages); - valueUsage = savedValueUsage; } else if (isIdentifier(node)) { if (!node.parent) { From 24de14a9bef52108c54d0f375ec2f915945fde8e Mon Sep 17 00:00:00 2001 From: Ryan Cavanaugh Date: Thu, 10 Aug 2017 16:40:08 -0700 Subject: [PATCH 110/237] Use isReadonlyArray --- src/services/refactors/extractMethod.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/services/refactors/extractMethod.ts b/src/services/refactors/extractMethod.ts index 93a7c2e34106d..f0f85ee6e8167 100644 --- a/src/services/refactors/extractMethod.ts +++ b/src/services/refactors/extractMethod.ts @@ -470,7 +470,7 @@ namespace ts.refactor.extractMethod { * depending on what's in the extracted body. */ export function collectEnclosingScopes(range: TargetRange): Scope[] | undefined { - let current: Node = isArray(range.range) ? firstOrUndefined(range.range) : range.range; + let current: Node = isReadonlyArray(range.range) ? firstOrUndefined(range.range) : range.range; if (range.facts & RangeFacts.UsesThis) { // if range uses this as keyword or as type inside the class then it can only be extracted to a method of the containing class const containingClass = getContainingClass(current); @@ -747,7 +747,7 @@ namespace ts.refactor.extractMethod { if (range.facts & RangeFacts.HasReturn) { newNodes.push(createReturn(call)); } - else if (isArray(range.range)) { + else if (isReadonlyArray(range.range)) { newNodes.push(createStatement(call)); } else { @@ -755,7 +755,7 @@ namespace ts.refactor.extractMethod { } } - if (isArray(range.range)) { + if (isReadonlyArray(range.range)) { changeTracker.replaceNodesWithNodes(context.file, range.range, newNodes, { nodeSeparator: context.newLineCharacter, suffix: context.newLineCharacter // insert newline only when replacing statements @@ -909,7 +909,7 @@ namespace ts.refactor.extractMethod { } }); - if (hasWrite && !isArray(targetRange.range) && isExpression(targetRange.range)) { + if (hasWrite && !isReadonlyArray(targetRange.range) && isExpression(targetRange.range)) { errorsPerScope[i].push(createDiagnosticForNode(targetRange.range, Messages.CannotCombineWritesAndReturns)); } else if (readonlyClassPropertyWrite && i > 0) { @@ -1042,7 +1042,7 @@ namespace ts.refactor.extractMethod { function checkForUsedDeclarations(node: Node) { // If this node is entirely within the original extraction range, we don't need to do anything. - if (node === targetRange.range || (isArray(targetRange.range) && targetRange.range.indexOf(node as Statement) >= 0)) { + if (node === targetRange.range || (isReadonlyArray(targetRange.range) && targetRange.range.indexOf(node as Statement) >= 0)) { return; } From 8a923151719a1092134ef318ae37d795dd60b5e7 Mon Sep 17 00:00:00 2001 From: Ryan Cavanaugh Date: Thu, 10 Aug 2017 17:05:45 -0700 Subject: [PATCH 111/237] Merge --- src/compiler/utilities.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/compiler/utilities.ts b/src/compiler/utilities.ts index a71decb3c89c7..8bb09e9238a49 100644 --- a/src/compiler/utilities.ts +++ b/src/compiler/utilities.ts @@ -443,7 +443,8 @@ namespace ts { return isExternalModule(node) || compilerOptions.isolatedModules; } - function isBlockScope(node: Node, parentNode: Node) { + /* @internal */ + export function isBlockScope(node: Node, parentNode: Node) { switch (node.kind) { case SyntaxKind.SourceFile: case SyntaxKind.CaseBlock: From b0317775667b440c31b040459639b55a0d1afd7b Mon Sep 17 00:00:00 2001 From: Ron Buckton Date: Thu, 10 Aug 2017 17:43:22 -0700 Subject: [PATCH 112/237] PR Feedback --- .../unittests/tsserverProjectSystem.ts | 2 +- src/server/editorServices.ts | 20 +++++++++++++------ 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/src/harness/unittests/tsserverProjectSystem.ts b/src/harness/unittests/tsserverProjectSystem.ts index 362bd847d6af2..2b1d0dd172e22 100644 --- a/src/harness/unittests/tsserverProjectSystem.ts +++ b/src/harness/unittests/tsserverProjectSystem.ts @@ -190,7 +190,7 @@ namespace ts.projectSystem { if (opts.typingsInstaller === undefined) { opts.typingsInstaller = new TestTypingsInstaller("/a/data/", /*throttleLimit*/ 5, host); } - + if (opts.eventHandler !== undefined) { opts.canUseEvents = true; } diff --git a/src/server/editorServices.ts b/src/server/editorServices.ts index 6084b38bf839e..e6da7afc3f465 100644 --- a/src/server/editorServices.ts +++ b/src/server/editorServices.ts @@ -484,8 +484,16 @@ namespace ts.server { const updatedProjects: Project[] = []; for (const project of this.inferredProjects) { - if (projectRootPath ? - project.projectRootPath === projectRootPath : + // Only update compiler options in the following cases: + // - Inferred projects without a projectRootPath, if the new options do not apply to + // a workspace root + // - Inferred projects with a projectRootPath, if the new options do not apply to a + // workspace root and there is no more specific set of options for that project's + // root path + // - Inferred projects with a projectRootPath, if the new options apply to that + // project root path. + if (projectRootPath ? + project.projectRootPath === projectRootPath : !project.projectRootPath || !this.compilerOptionsForInferredProjectsPerProjectRoot.has(project.projectRootPath)) { project.setCompilerOptions(compilerOptions); project.compileOnSaveEnabled = compilerOptions.compileOnSave; @@ -1320,7 +1328,7 @@ namespace ts.server { return this.createInferredProject(/*isSingleInferredProject*/ false, projectRootPath); } - // we don't have an explicit root path, so we should try to find an inferred project + // we don't have an explicit root path, so we should try to find an inferred project // that more closely contains the file. let bestMatch: InferredProject; for (const project of this.inferredProjects) { @@ -1342,11 +1350,11 @@ namespace ts.server { return undefined; } - // If `useInferredProjectPerProjectRoot` is not enabled, then there will only be one - // inferred project for all files. If `useInferredProjectPerProjectRoot` is enabled + // If `useInferredProjectPerProjectRoot` is not enabled, then there will only be one + // inferred project for all files. If `useInferredProjectPerProjectRoot` is enabled // then we want to put all files that are not opened with a `projectRootPath` into // the same inferred project. - // + // // To avoid the cost of searching through the array and to optimize for the case where // `useInferredProjectPerProjectRoot` is not enabled, we will always put the inferred // project for non-rooted files at the front of the array. From b3f3f336ad1c68ebfceb9d0d0aff905f1b4f2a23 Mon Sep 17 00:00:00 2001 From: Andy Date: Fri, 11 Aug 2017 07:15:15 -0700 Subject: [PATCH 113/237] Use `hasModifier` and `hasModifiers` helper functions (#17724) --- src/compiler/binder.ts | 9 +-- src/compiler/checker.ts | 126 +++++++++++++++++++------------------- src/compiler/parser.ts | 6 +- src/compiler/utilities.ts | 8 ++- 4 files changed, 76 insertions(+), 73 deletions(-) diff --git a/src/compiler/binder.ts b/src/compiler/binder.ts index 6ca2f402ac289..a7e94da09d995 100644 --- a/src/compiler/binder.ts +++ b/src/compiler/binder.ts @@ -2767,7 +2767,6 @@ namespace ts { function computeParameter(node: ParameterDeclaration, subtreeFlags: TransformFlags) { let transformFlags = subtreeFlags; - const modifierFlags = getModifierFlags(node); const name = node.name; const initializer = node.initializer; const dotDotDotToken = node.dotDotDotToken; @@ -2782,7 +2781,7 @@ namespace ts { } // If a parameter has an accessibility modifier, then it is TypeScript syntax. - if (modifierFlags & ModifierFlags.ParameterPropertyModifier) { + if (hasModifier(node, ModifierFlags.ParameterPropertyModifier)) { transformFlags |= TransformFlags.AssertTypeScript | TransformFlags.ContainsParameterPropertyAssignments; } @@ -2827,9 +2826,8 @@ namespace ts { function computeClassDeclaration(node: ClassDeclaration, subtreeFlags: TransformFlags) { let transformFlags: TransformFlags; - const modifierFlags = getModifierFlags(node); - if (modifierFlags & ModifierFlags.Ambient) { + if (hasModifier(node, ModifierFlags.Ambient)) { // An ambient declaration is TypeScript syntax. transformFlags = TransformFlags.AssertTypeScript; } @@ -3173,11 +3171,10 @@ namespace ts { function computeVariableStatement(node: VariableStatement, subtreeFlags: TransformFlags) { let transformFlags: TransformFlags; - const modifierFlags = getModifierFlags(node); const declarationListTransformFlags = node.declarationList.transformFlags; // An ambient declaration is TypeScript syntax. - if (modifierFlags & ModifierFlags.Ambient) { + if (hasModifier(node, ModifierFlags.Ambient)) { transformFlags = TransformFlags.AssertTypeScript; } else { diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 07c94bd746e0f..22efe31930f8d 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -835,13 +835,13 @@ namespace ts { (current.parent).initializer === current; if (initializerOfProperty) { - if (getModifierFlags(current.parent) & ModifierFlags.Static) { + if (hasModifier(current.parent, ModifierFlags.Static)) { if (declaration.kind === SyntaxKind.MethodDeclaration) { return true; } } else { - const isDeclarationInstanceProperty = declaration.kind === SyntaxKind.PropertyDeclaration && !(getModifierFlags(declaration) & ModifierFlags.Static); + const isDeclarationInstanceProperty = declaration.kind === SyntaxKind.PropertyDeclaration && !hasModifier(declaration, ModifierFlags.Static); if (!isDeclarationInstanceProperty || getContainingClass(usage) !== getContainingClass(declaration)) { return true; } @@ -978,7 +978,7 @@ namespace ts { // local variables of the constructor. This effectively means that entities from outer scopes // by the same name as a constructor parameter or local variable are inaccessible // in initializer expressions for instance member variables. - if (isClassLike(location.parent) && !(getModifierFlags(location) & ModifierFlags.Static)) { + if (isClassLike(location.parent) && !hasModifier(location, ModifierFlags.Static)) { const ctor = findConstructorDeclaration(location.parent); if (ctor && ctor.locals) { if (lookup(ctor.locals, name, meaning & SymbolFlags.Value)) { @@ -997,7 +997,7 @@ namespace ts { result = undefined; break; } - if (lastLocation && getModifierFlags(lastLocation) & ModifierFlags.Static) { + if (lastLocation && hasModifier(lastLocation, ModifierFlags.Static)) { // TypeScript 1.0 spec (April 2014): 3.4.1 // The scope of a type parameter extends over the entire declaration with which the type // parameter list is associated, with the exception of static member declarations in classes. @@ -1200,7 +1200,7 @@ namespace ts { // No static member is present. // Check if we're in an instance method and look for a relevant instance member. - if (location === container && !(getModifierFlags(location) & ModifierFlags.Static)) { + if (location === container && !hasModifier(location, ModifierFlags.Static)) { const instanceType = (getDeclaredTypeOfSymbol(classSymbol)).thisType; if (getPropertyOfType(instanceType, name)) { error(errorLocation, Diagnostics.Cannot_find_name_0_Did_you_mean_the_instance_member_this_0, diagnosticName(nameArg)); @@ -2245,7 +2245,7 @@ namespace ts { const anyImportSyntax = getAnyImportSyntax(declaration); if (anyImportSyntax && - !(getModifierFlags(anyImportSyntax) & ModifierFlags.Export) && // import clause without export + !hasModifier(anyImportSyntax, ModifierFlags.Export) && // import clause without export isDeclarationVisible(anyImportSyntax.parent)) { // In function "buildTypeDisplay" where we decide whether to write type-alias or serialize types, // we want to just check if type- alias is accessible or not but we don't care about emitting those alias at that time @@ -2572,8 +2572,8 @@ namespace ts { } function shouldWriteTypeOfFunctionSymbol() { - const isStaticMethodSymbol = !!(symbol.flags & SymbolFlags.Method && // typeof static method - forEach(symbol.declarations, declaration => getModifierFlags(declaration) & ModifierFlags.Static)); + const isStaticMethodSymbol = !!(symbol.flags & SymbolFlags.Method) && // typeof static method + some(symbol.declarations, declaration => hasModifier(declaration, ModifierFlags.Static)); const isNonLocalFunctionSymbol = !!(symbol.flags & SymbolFlags.Function) && (symbol.parent || // is exported function symbol forEach(symbol.declarations, declaration => @@ -3437,16 +3437,16 @@ namespace ts { } function shouldWriteTypeOfFunctionSymbol() { - const isStaticMethodSymbol = !!(symbol.flags & SymbolFlags.Method && // typeof static method - forEach(symbol.declarations, declaration => getModifierFlags(declaration) & ModifierFlags.Static)); + const isStaticMethodSymbol = !!(symbol.flags & SymbolFlags.Method) && // typeof static method + some(symbol.declarations, declaration => hasModifier(declaration, ModifierFlags.Static)); const isNonLocalFunctionSymbol = !!(symbol.flags & SymbolFlags.Function) && (symbol.parent || // is exported function symbol - forEach(symbol.declarations, declaration => + some(symbol.declarations, declaration => declaration.parent.kind === SyntaxKind.SourceFile || declaration.parent.kind === SyntaxKind.ModuleBlock)); if (isStaticMethodSymbol || isNonLocalFunctionSymbol) { // typeof is allowed only for static/non local functions return !!(flags & TypeFormatFlags.UseTypeOfFunction) || // use typeof if format flags specify it - (contains(symbolStack, symbol)); // it is type of the symbol uses itself recursively + contains(symbolStack, symbol); // it is type of the symbol uses itself recursively } } } @@ -3892,7 +3892,7 @@ namespace ts { case SyntaxKind.SetAccessor: case SyntaxKind.MethodDeclaration: case SyntaxKind.MethodSignature: - if (getModifierFlags(node) & (ModifierFlags.Private | ModifierFlags.Protected)) { + if (hasModifier(node, ModifierFlags.Private | ModifierFlags.Protected)) { // Private/protected properties/methods are not visible return false; } @@ -6657,7 +6657,7 @@ namespace ts { const declaration = getIndexDeclarationOfSymbol(symbol, kind); if (declaration) { return createIndexInfo(declaration.type ? getTypeFromTypeNode(declaration.type) : anyType, - (getModifierFlags(declaration) & ModifierFlags.Readonly) !== 0, declaration); + hasModifier(declaration, ModifierFlags.Readonly), declaration); } return undefined; } @@ -7909,7 +7909,7 @@ namespace ts { const container = getThisContainer(node, /*includeArrowFunctions*/ false); const parent = container && container.parent; if (parent && (isClassLike(parent) || parent.kind === SyntaxKind.InterfaceDeclaration)) { - if (!(getModifierFlags(container) & ModifierFlags.Static) && + if (!hasModifier(container, ModifierFlags.Static) && (container.kind !== SyntaxKind.Constructor || isNodeDescendantOf(node, (container).body))) { return getDeclaredTypeOfClassOrInterface(getSymbolOfNode(parent)).thisType; } @@ -9729,8 +9729,8 @@ namespace ts { return true; } - const sourceAccessibility = getModifierFlags(sourceSignature.declaration) & ModifierFlags.NonPublicAccessibilityModifier; - const targetAccessibility = getModifierFlags(targetSignature.declaration) & ModifierFlags.NonPublicAccessibilityModifier; + const sourceAccessibility = getSelectedModifierFlags(sourceSignature.declaration, ModifierFlags.NonPublicAccessibilityModifier); + const targetAccessibility = getSelectedModifierFlags(targetSignature.declaration, ModifierFlags.NonPublicAccessibilityModifier); // A public, protected and private signature is assignable to a private signature. if (targetAccessibility === ModifierFlags.Private) { @@ -9804,7 +9804,7 @@ namespace ts { const symbol = type.symbol; if (symbol && symbol.flags & SymbolFlags.Class) { const declaration = getClassLikeDeclarationOfSymbol(symbol); - if (declaration && getModifierFlags(declaration) & ModifierFlags.Abstract) { + if (declaration && hasModifier(declaration, ModifierFlags.Abstract)) { return true; } } @@ -12471,7 +12471,7 @@ namespace ts { break; case SyntaxKind.PropertyDeclaration: case SyntaxKind.PropertySignature: - if (getModifierFlags(container) & ModifierFlags.Static) { + if (hasModifier(container, ModifierFlags.Static)) { error(node, Diagnostics.this_cannot_be_referenced_in_a_static_property_initializer); // do not return here so in case if lexical this is captured - it will be reflected in flags on NodeLinks } @@ -12589,7 +12589,7 @@ namespace ts { checkThisBeforeSuper(node, container, Diagnostics.super_must_be_called_before_accessing_a_property_of_super_in_the_constructor_of_a_derived_class); } - if ((getModifierFlags(container) & ModifierFlags.Static) || isCallExpression) { + if (hasModifier(container, ModifierFlags.Static) || isCallExpression) { nodeCheckFlag = NodeCheckFlags.SuperStatic; } else { @@ -12654,7 +12654,7 @@ namespace ts { // This helper creates an object with a "value" property that wraps the `super` property or indexed access for both get and set. // This is required for destructuring assignments, as a call expression cannot be used as the target of a destructuring assignment // while a property access can. - if (container.kind === SyntaxKind.MethodDeclaration && getModifierFlags(container) & ModifierFlags.Async) { + if (container.kind === SyntaxKind.MethodDeclaration && hasModifier(container, ModifierFlags.Async)) { if (isSuperProperty(node.parent) && isAssignmentTarget(node.parent)) { getNodeLinks(container).flags |= NodeCheckFlags.AsyncMethodWithSuperBinding; } @@ -12720,7 +12720,7 @@ namespace ts { // topmost container must be something that is directly nested in the class declaration\object literal expression if (isClassLike(container.parent) || container.parent.kind === SyntaxKind.ObjectLiteralExpression) { - if (getModifierFlags(container) & ModifierFlags.Static) { + if (hasModifier(container, ModifierFlags.Static)) { return container.kind === SyntaxKind.MethodDeclaration || container.kind === SyntaxKind.MethodSignature || container.kind === SyntaxKind.GetAccessor || @@ -14765,7 +14765,7 @@ namespace ts { if (prop && noUnusedIdentifiers && (prop.flags & SymbolFlags.ClassMember) && - prop.valueDeclaration && (getModifierFlags(prop.valueDeclaration) & ModifierFlags.Private)) { + prop.valueDeclaration && hasModifier(prop.valueDeclaration, ModifierFlags.Private)) { if (getCheckFlags(prop) & CheckFlags.Instantiated) { getSymbolLinks(prop).target.isReferenced = true; } @@ -16058,7 +16058,7 @@ namespace ts { // In the case of a merged class-module or class-interface declaration, // only the class declaration node will have the Abstract flag set. const valueDecl = expressionType.symbol && getClassLikeDeclarationOfSymbol(expressionType.symbol); - if (valueDecl && getModifierFlags(valueDecl) & ModifierFlags.Abstract) { + if (valueDecl && hasModifier(valueDecl, ModifierFlags.Abstract)) { error(node, Diagnostics.Cannot_create_an_instance_of_the_abstract_class_0, declarationNameToString(getNameOfDeclaration(valueDecl))); return resolveErrorCall(node); } @@ -16111,10 +16111,10 @@ namespace ts { } const declaration = signature.declaration; - const modifiers = getModifierFlags(declaration); + const modifiers = getSelectedModifierFlags(declaration, ModifierFlags.NonPublicAccessibilityModifier); // Public constructor is accessible. - if (!(modifiers & ModifierFlags.NonPublicAccessibilityModifier)) { + if (!modifiers) { return true; } @@ -18095,7 +18095,7 @@ namespace ts { checkVariableLikeDeclaration(node); let func = getContainingFunction(node); - if (getModifierFlags(node) & ModifierFlags.ParameterPropertyModifier) { + if (hasModifier(node, ModifierFlags.ParameterPropertyModifier)) { func = getContainingFunction(node); if (!(func.kind === SyntaxKind.Constructor && nodeIsPresent(func.body))) { error(node, Diagnostics.A_parameter_property_is_only_allowed_in_a_constructor_implementation); @@ -18330,7 +18330,7 @@ namespace ts { } } else { - const isStatic = getModifierFlags(member) & ModifierFlags.Static; + const isStatic = hasModifier(member, ModifierFlags.Static); const names = isStatic ? staticNames : instanceNames; const memberName = member.name && getPropertyNameForPropertyNameNode(member.name); @@ -18391,7 +18391,7 @@ namespace ts { function checkClassForStaticPropertyNameConflicts(node: ClassLikeDeclaration) { for (const member of node.members) { const memberNameNode = member.name; - const isStatic = getModifierFlags(member) & ModifierFlags.Static; + const isStatic = hasModifier(member, ModifierFlags.Static); if (isStatic && memberNameNode) { const memberName = getPropertyNameForPropertyNameNode(memberNameNode); switch (memberName) { @@ -18496,7 +18496,7 @@ namespace ts { // Abstract methods cannot have an implementation. // Extra checks are to avoid reporting multiple errors relating to the "abstractness" of the node. - if (getModifierFlags(node) & ModifierFlags.Abstract && node.body) { + if (hasModifier(node, ModifierFlags.Abstract) && node.body) { error(node, Diagnostics.Method_0_cannot_have_an_implementation_because_it_is_marked_abstract, declarationNameToString(node.name)); } } @@ -18547,7 +18547,7 @@ namespace ts { function isInstancePropertyWithInitializer(n: Node): boolean { return n.kind === SyntaxKind.PropertyDeclaration && - !(getModifierFlags(n) & ModifierFlags.Static) && + !hasModifier(n, ModifierFlags.Static) && !!(n).initializer; } @@ -18570,8 +18570,8 @@ namespace ts { // - The constructor declares parameter properties // or the containing class declares instance member variables with initializers. const superCallShouldBeFirst = - forEach((node.parent).members, isInstancePropertyWithInitializer) || - forEach(node.parameters, p => getModifierFlags(p) & ModifierFlags.ParameterPropertyModifier); + some((node.parent).members, isInstancePropertyWithInitializer) || + some(node.parameters, p => hasModifier(p, ModifierFlags.ParameterPropertyModifier)); // Skip past any prologue directives to find the first statement // to ensure that it was a super call. @@ -18625,10 +18625,12 @@ namespace ts { const otherKind = node.kind === SyntaxKind.GetAccessor ? SyntaxKind.SetAccessor : SyntaxKind.GetAccessor; const otherAccessor = getDeclarationOfKind(node.symbol, otherKind); if (otherAccessor) { - if ((getModifierFlags(node) & ModifierFlags.AccessibilityModifier) !== (getModifierFlags(otherAccessor) & ModifierFlags.AccessibilityModifier)) { + const nodeFlags = getModifierFlags(node); + const otherFlags = getModifierFlags(otherAccessor); + if ((nodeFlags & ModifierFlags.AccessibilityModifier) !== (otherFlags & ModifierFlags.AccessibilityModifier)) { error(node.name, Diagnostics.Getter_and_setter_accessors_do_not_agree_in_visibility); } - if (hasModifier(node, ModifierFlags.Abstract) !== hasModifier(otherAccessor, ModifierFlags.Abstract)) { + if ((nodeFlags & ModifierFlags.Abstract) !== (otherFlags & ModifierFlags.Abstract)) { error(node.name, Diagnostics.Accessors_must_both_be_abstract_or_non_abstract); } @@ -18784,7 +18786,7 @@ namespace ts { } function isPrivateWithinAmbient(node: Node): boolean { - return (getModifierFlags(node) & ModifierFlags.Private) && isInAmbientContext(node); + return hasModifier(node, ModifierFlags.Private) && isInAmbientContext(node); } function getEffectiveDeclarationFlags(n: Node, flagsToCheck: ModifierFlags): ModifierFlags { @@ -18897,13 +18899,13 @@ namespace ts { !isComputedPropertyName(node.name) && !isComputedPropertyName(subsequentName) && getEscapedTextOfIdentifierOrLiteral(node.name) === getEscapedTextOfIdentifierOrLiteral(subsequentName))) { const reportError = (node.kind === SyntaxKind.MethodDeclaration || node.kind === SyntaxKind.MethodSignature) && - (getModifierFlags(node) & ModifierFlags.Static) !== (getModifierFlags(subsequentNode) & ModifierFlags.Static); + hasModifier(node, ModifierFlags.Static) !== hasModifier(subsequentNode, ModifierFlags.Static); // we can get here in two cases // 1. mixed static and instance class members // 2. something with the same name was defined before the set of overloads that prevents them from merging // here we'll report error only for the first case since for second we should already report error in binder if (reportError) { - const diagnostic = getModifierFlags(node) & ModifierFlags.Static ? Diagnostics.Function_overload_must_be_static : Diagnostics.Function_overload_must_not_be_static; + const diagnostic = hasModifier(node, ModifierFlags.Static) ? Diagnostics.Function_overload_must_be_static : Diagnostics.Function_overload_must_not_be_static; error(errorNode, diagnostic); } return; @@ -18921,7 +18923,7 @@ namespace ts { else { // Report different errors regarding non-consecutive blocks of declarations depending on whether // the node in question is abstract. - if (getModifierFlags(node) & ModifierFlags.Abstract) { + if (hasModifier(node, ModifierFlags.Abstract)) { error(errorNode, Diagnostics.All_declarations_of_an_abstract_method_must_be_consecutive); } else { @@ -18997,7 +18999,7 @@ namespace ts { // Abstract methods can't have an implementation -- in particular, they don't need one. if (lastSeenNonAmbientDeclaration && !lastSeenNonAmbientDeclaration.body && - !(getModifierFlags(lastSeenNonAmbientDeclaration) & ModifierFlags.Abstract) && !lastSeenNonAmbientDeclaration.questionToken) { + !hasModifier(lastSeenNonAmbientDeclaration, ModifierFlags.Abstract) && !lastSeenNonAmbientDeclaration.questionToken) { reportImplementationExpectedError(lastSeenNonAmbientDeclaration); } @@ -19800,13 +19802,13 @@ namespace ts { if (node.members) { for (const member of node.members) { if (member.kind === SyntaxKind.MethodDeclaration || member.kind === SyntaxKind.PropertyDeclaration) { - if (!member.symbol.isReferenced && getModifierFlags(member) & ModifierFlags.Private) { + if (!member.symbol.isReferenced && hasModifier(member, ModifierFlags.Private)) { error(member.name, Diagnostics._0_is_declared_but_never_used, unescapeLeadingUnderscores(member.symbol.escapedName)); } } else if (member.kind === SyntaxKind.Constructor) { for (const parameter of (member).parameters) { - if (!parameter.symbol.isReferenced && getModifierFlags(parameter) & ModifierFlags.Private) { + if (!parameter.symbol.isReferenced && hasModifier(parameter, ModifierFlags.Private)) { error(parameter.name, Diagnostics.Property_0_is_declared_but_never_used, unescapeLeadingUnderscores(parameter.symbol.escapedName)); } } @@ -20276,7 +20278,7 @@ namespace ts { ModifierFlags.Readonly | ModifierFlags.Static; - return (getModifierFlags(left) & interestingFlags) === (getModifierFlags(right) & interestingFlags); + return getSelectedModifierFlags(left, interestingFlags) === getSelectedModifierFlags(right, interestingFlags); } function checkVariableDeclaration(node: VariableDeclaration) { @@ -21029,7 +21031,7 @@ namespace ts { // Only process instance properties with computed names here. // Static properties cannot be in conflict with indexers, // and properties with literal names were already checked. - if (!(getModifierFlags(member) & ModifierFlags.Static) && hasDynamicName(member)) { + if (!hasModifier(member, ModifierFlags.Static) && hasDynamicName(member)) { const propType = getTypeOfSymbol(member.symbol); checkIndexConstraintForProperty(member.symbol, propType, type, declaredStringIndexer, stringIndexType, IndexKind.String); checkIndexConstraintForProperty(member.symbol, propType, type, declaredNumberIndexer, numberIndexType, IndexKind.Number); @@ -21224,7 +21226,7 @@ namespace ts { } function checkClassDeclaration(node: ClassDeclaration) { - if (!node.name && !(getModifierFlags(node) & ModifierFlags.Default)) { + if (!node.name && !hasModifier(node, ModifierFlags.Default)) { grammarErrorOnFirstToken(node, Diagnostics.A_class_declaration_without_the_default_modifier_must_have_a_name); } checkClassLikeDeclaration(node); @@ -21330,7 +21332,7 @@ namespace ts { const signatures = getSignaturesOfType(type, SignatureKind.Construct); if (signatures.length) { const declaration = signatures[0].declaration; - if (declaration && getModifierFlags(declaration) & ModifierFlags.Private) { + if (declaration && hasModifier(declaration, ModifierFlags.Private)) { const typeClassDeclaration = getClassLikeDeclarationOfSymbol(type.symbol); if (!isNodeWithinClass(node, typeClassDeclaration)) { error(node, Diagnostics.Cannot_extend_a_class_0_Class_constructor_is_marked_as_private, getFullyQualifiedName(type.symbol)); @@ -21396,7 +21398,7 @@ namespace ts { // It is an error to inherit an abstract member without implementing it or being declared abstract. // If there is no declaration for the derived class (as in the case of class expressions), // then the class cannot be declared abstract. - if (baseDeclarationFlags & ModifierFlags.Abstract && (!derivedClassDecl || !(getModifierFlags(derivedClassDecl) & ModifierFlags.Abstract))) { + if (baseDeclarationFlags & ModifierFlags.Abstract && (!derivedClassDecl || !hasModifier(derivedClassDecl, ModifierFlags.Abstract))) { if (derivedClassDecl.kind === SyntaxKind.ClassExpression) { error(derivedClassDecl, Diagnostics.Non_abstract_class_expression_does_not_implement_inherited_abstract_member_0_from_class_1, symbolToString(baseProperty), typeToString(baseType)); @@ -22019,7 +22021,7 @@ namespace ts { // If we hit an import declaration in an illegal context, just bail out to avoid cascading errors. return; } - if (!checkGrammarDecorators(node) && !checkGrammarModifiers(node) && getModifierFlags(node) !== 0) { + if (!checkGrammarDecorators(node) && !checkGrammarModifiers(node) && hasModifiers(node)) { grammarErrorOnFirstToken(node, Diagnostics.An_import_declaration_cannot_have_modifiers); } if (checkExternalImportOrExportDeclaration(node)) { @@ -22049,7 +22051,7 @@ namespace ts { checkGrammarDecorators(node) || checkGrammarModifiers(node); if (isInternalModuleImportEqualsDeclaration(node) || checkExternalImportOrExportDeclaration(node)) { checkImportBinding(node); - if (getModifierFlags(node) & ModifierFlags.Export) { + if (hasModifier(node, ModifierFlags.Export)) { markExportAsReferenced(node); } if (isInternalModuleImportEqualsDeclaration(node)) { @@ -22082,7 +22084,7 @@ namespace ts { return; } - if (!checkGrammarDecorators(node) && !checkGrammarModifiers(node) && getModifierFlags(node) !== 0) { + if (!checkGrammarDecorators(node) && !checkGrammarModifiers(node) && hasModifiers(node)) { grammarErrorOnFirstToken(node, Diagnostics.An_export_declaration_cannot_have_modifiers); } @@ -22155,7 +22157,7 @@ namespace ts { return; } // Grammar checking - if (!checkGrammarDecorators(node) && !checkGrammarModifiers(node) && getModifierFlags(node) !== 0) { + if (!checkGrammarDecorators(node) && !checkGrammarModifiers(node) && hasModifiers(node)) { grammarErrorOnFirstToken(node, Diagnostics.An_export_assignment_cannot_have_modifiers); } if (node.expression.kind === SyntaxKind.Identifier) { @@ -22553,7 +22555,7 @@ namespace ts { } const symbols = createSymbolTable(); - let memberFlags: ModifierFlags = ModifierFlags.None; + let isStatic = false; populateSymbols(); @@ -22586,7 +22588,7 @@ namespace ts { // add the type parameters into the symbol table // (type parameters of classDeclaration/classExpression and interface are in member property of the symbol. // Note: that the memberFlags come from previous iteration. - if (!(memberFlags & ModifierFlags.Static)) { + if (!isStatic) { copySymbols(getSymbolOfNode(location).members, meaning & SymbolFlags.Type); } break; @@ -22602,7 +22604,7 @@ namespace ts { copySymbol(argumentsSymbol, meaning); } - memberFlags = getModifierFlags(location); + isStatic = hasModifier(location, ModifierFlags.Static); location = location.parent; } @@ -23063,7 +23065,7 @@ namespace ts { */ function getParentTypeOfClassElement(node: ClassElement) { const classSymbol = getSymbolOfNode(node.parent); - return getModifierFlags(node) & ModifierFlags.Static + return hasModifier(node, ModifierFlags.Static) ? getTypeOfSymbol(classSymbol) : getDeclaredTypeOfSymbol(classSymbol); } @@ -23375,14 +23377,14 @@ namespace ts { return strictNullChecks && !isOptionalParameter(parameter) && parameter.initializer && - !(getModifierFlags(parameter) & ModifierFlags.ParameterPropertyModifier); + !hasModifier(parameter, ModifierFlags.ParameterPropertyModifier); } function isOptionalUninitializedParameterProperty(parameter: ParameterDeclaration) { return strictNullChecks && isOptionalParameter(parameter) && !parameter.initializer && - !!(getModifierFlags(parameter) & ModifierFlags.ParameterPropertyModifier); + hasModifier(parameter, ModifierFlags.ParameterPropertyModifier); } function getNodeCheckFlags(node: Node): NodeCheckFlags { @@ -23997,7 +23999,7 @@ namespace ts { node.kind !== SyntaxKind.SetAccessor) { return grammarErrorOnNode(modifier, Diagnostics.abstract_modifier_can_only_appear_on_a_class_method_or_property_declaration); } - if (!(node.parent.kind === SyntaxKind.ClassDeclaration && getModifierFlags(node.parent) & ModifierFlags.Abstract)) { + if (!(node.parent.kind === SyntaxKind.ClassDeclaration && hasModifier(node.parent, ModifierFlags.Abstract))) { return grammarErrorOnNode(modifier, Diagnostics.Abstract_methods_can_only_appear_within_an_abstract_class); } if (flags & ModifierFlags.Static) { @@ -24217,7 +24219,7 @@ namespace ts { if (parameter.dotDotDotToken) { return grammarErrorOnNode(parameter.dotDotDotToken, Diagnostics.An_index_signature_cannot_have_a_rest_parameter); } - if (getModifierFlags(parameter) !== 0) { + if (hasModifiers(parameter)) { return grammarErrorOnNode(parameter.name, Diagnostics.An_index_signature_parameter_cannot_have_an_accessibility_modifier); } if (parameter.questionToken) { @@ -24556,10 +24558,10 @@ namespace ts { else if (isInAmbientContext(accessor)) { return grammarErrorOnNode(accessor.name, Diagnostics.An_accessor_cannot_be_declared_in_an_ambient_context); } - else if (accessor.body === undefined && !(getModifierFlags(accessor) & ModifierFlags.Abstract)) { + else if (accessor.body === undefined && !hasModifier(accessor, ModifierFlags.Abstract)) { return grammarErrorAtPos(getSourceFileOfNode(accessor), accessor.end - 1, ";".length, Diagnostics._0_expected, "{"); } - else if (accessor.body && getModifierFlags(accessor) & ModifierFlags.Abstract) { + else if (accessor.body && hasModifier(accessor, ModifierFlags.Abstract)) { return grammarErrorOnNode(accessor, Diagnostics.An_abstract_accessor_cannot_have_an_implementation); } else if (accessor.typeParameters) { @@ -24942,7 +24944,7 @@ namespace ts { node.kind === SyntaxKind.ExportDeclaration || node.kind === SyntaxKind.ExportAssignment || node.kind === SyntaxKind.NamespaceExportDeclaration || - getModifierFlags(node) & (ModifierFlags.Ambient | ModifierFlags.Export | ModifierFlags.Default)) { + hasModifier(node, ModifierFlags.Ambient | ModifierFlags.Export | ModifierFlags.Default)) { return false; } diff --git a/src/compiler/parser.ts b/src/compiler/parser.ts index 3ec652b215e50..a2fe752ad18e9 100644 --- a/src/compiler/parser.ts +++ b/src/compiler/parser.ts @@ -3202,7 +3202,7 @@ namespace ts { return undefined; } - const isAsync = !!(getModifierFlags(arrowFunction) & ModifierFlags.Async); + const isAsync = hasModifier(arrowFunction, ModifierFlags.Async); // If we have an arrow, then try to parse the body. Even if not, try to parse if we // have an opening brace, just in case we're in an error state. @@ -3382,7 +3382,7 @@ namespace ts { function parseParenthesizedArrowFunctionExpressionHead(allowAmbiguity: boolean): ArrowFunction { const node = createNode(SyntaxKind.ArrowFunction); node.modifiers = parseModifiersForArrowFunction(); - const isAsync = (getModifierFlags(node) & ModifierFlags.Async) ? SignatureFlags.Await : SignatureFlags.None; + const isAsync = hasModifier(node, ModifierFlags.Async) ? SignatureFlags.Await : SignatureFlags.None; // Arrow functions are never generators. // @@ -4515,7 +4515,7 @@ namespace ts { node.asteriskToken = parseOptionalToken(SyntaxKind.AsteriskToken); const isGenerator = node.asteriskToken ? SignatureFlags.Yield : SignatureFlags.None; - const isAsync = (getModifierFlags(node) & ModifierFlags.Async) ? SignatureFlags.Await : SignatureFlags.None; + const isAsync = hasModifier(node, ModifierFlags.Async) ? SignatureFlags.Await : SignatureFlags.None; node.name = isGenerator && isAsync ? doInYieldAndAwaitContext(parseOptionalIdentifier) : isGenerator ? doInYieldContext(parseOptionalIdentifier) : diff --git a/src/compiler/utilities.ts b/src/compiler/utilities.ts index 769b2ce3a93de..ddcf6f90a0d7b 100644 --- a/src/compiler/utilities.ts +++ b/src/compiler/utilities.ts @@ -2975,8 +2975,12 @@ namespace ts { return getModifierFlags(node) !== ModifierFlags.None; } - export function hasModifier(node: Node, flags: ModifierFlags) { - return (getModifierFlags(node) & flags) !== 0; + export function hasModifier(node: Node, flags: ModifierFlags): boolean { + return !!getSelectedModifierFlags(node, flags); + } + + export function getSelectedModifierFlags(node: Node, flags: ModifierFlags): ModifierFlags { + return getModifierFlags(node) & flags; } export function getModifierFlags(node: Node): ModifierFlags { From f64b8ad90208712315861adda714430ff752cdf1 Mon Sep 17 00:00:00 2001 From: Andy Date: Fri, 11 Aug 2017 10:03:21 -0700 Subject: [PATCH 114/237] Add "preserveSymlinks" option (#16661) * Add "preserveSymlinks" option * Respond to PR comments --- src/compiler/commandLineParser.ts | 7 ++- src/compiler/diagnosticMessages.json | 4 ++ src/compiler/moduleNameResolver.ts | 13 ++++- src/compiler/types.ts | 5 ++ src/harness/unittests/moduleResolution.ts | 34 ++++++++++-- src/server/protocol.ts | 1 + ...onWithSymlinks_preserveSymlinks.errors.txt | 25 +++++++++ ...ResolutionWithSymlinks_preserveSymlinks.js | 31 +++++++++++ ...onWithSymlinks_preserveSymlinks.trace.json | 55 +++++++++++++++++++ .../tsconfig.json | 1 + .../tsconfig.json | 1 + .../tsconfig.json | 1 + .../tsconfig.json | 1 + .../tsconfig.json | 1 + .../tsconfig.json | 1 + .../tsconfig.json | 1 + .../tsconfig.json | 1 + ...ResolutionWithSymlinks_preserveSymlinks.ts | 24 ++++++++ 18 files changed, 200 insertions(+), 7 deletions(-) create mode 100644 tests/baselines/reference/moduleResolutionWithSymlinks_preserveSymlinks.errors.txt create mode 100644 tests/baselines/reference/moduleResolutionWithSymlinks_preserveSymlinks.js create mode 100644 tests/baselines/reference/moduleResolutionWithSymlinks_preserveSymlinks.trace.json create mode 100644 tests/cases/compiler/moduleResolutionWithSymlinks_preserveSymlinks.ts diff --git a/src/compiler/commandLineParser.ts b/src/compiler/commandLineParser.ts index e82e70dc764b4..4dd6d8f6170b6 100644 --- a/src/compiler/commandLineParser.ts +++ b/src/compiler/commandLineParser.ts @@ -340,7 +340,6 @@ namespace ts { isTSConfigOnly: true, category: Diagnostics.Module_Resolution_Options, description: Diagnostics.A_series_of_entries_which_re_map_imports_to_lookup_locations_relative_to_the_baseUrl - }, { // this option can only be specified in tsconfig.json @@ -384,6 +383,12 @@ namespace ts { category: Diagnostics.Module_Resolution_Options, description: Diagnostics.Allow_default_imports_from_modules_with_no_default_export_This_does_not_affect_code_emit_just_typechecking }, + { + name: "preserveSymlinks", + type: "boolean", + category: Diagnostics.Module_Resolution_Options, + description: Diagnostics.Do_not_resolve_the_real_path_of_symlinks, + }, // Source Maps { diff --git a/src/compiler/diagnosticMessages.json b/src/compiler/diagnosticMessages.json index 03164c54ffd48..00e0164b815fc 100644 --- a/src/compiler/diagnosticMessages.json +++ b/src/compiler/diagnosticMessages.json @@ -2662,6 +2662,10 @@ "category": "Message", "code": 6012 }, + "Do not resolve the real path of symlinks.": { + "category": "Message", + "code": 6013 + }, "Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', or 'ESNEXT'.": { "category": "Message", "code": 6015 diff --git a/src/compiler/moduleNameResolver.ts b/src/compiler/moduleNameResolver.ts index 2b3974e5287f9..a374e866195c0 100644 --- a/src/compiler/moduleNameResolver.ts +++ b/src/compiler/moduleNameResolver.ts @@ -200,7 +200,10 @@ namespace ts { let resolvedTypeReferenceDirective: ResolvedTypeReferenceDirective | undefined; if (resolved) { - resolved = realpath(resolved, host, traceEnabled); + if (!options.preserveSymlinks) { + resolved = realpath(resolved, host, traceEnabled); + } + if (traceEnabled) { trace(host, Diagnostics.Type_reference_directive_0_was_successfully_resolved_to_1_primary_Colon_2, typeReferenceDirectiveName, resolved, primary); } @@ -734,8 +737,14 @@ namespace ts { trace(host, Diagnostics.Loading_module_0_from_node_modules_folder_target_file_type_1, moduleName, Extensions[extensions]); } const resolved = loadModuleFromNodeModules(extensions, moduleName, containingDirectory, failedLookupLocations, state, cache); + if (!resolved) return undefined; + + let resolvedValue = resolved.value; + if (!compilerOptions.preserveSymlinks) { + resolvedValue = resolvedValue && { ...resolved.value, path: realpath(resolved.value.path, host, traceEnabled), extension: resolved.value.extension }; + } // For node_modules lookups, get the real path so that multiple accesses to an `npm link`-ed module do not create duplicate files. - return resolved && { value: resolved.value && { resolved: { ...resolved.value, path: realpath(resolved.value.path, host, traceEnabled) }, isExternalLibraryImport: true } }; + return { value: resolvedValue && { resolved: resolvedValue, isExternalLibraryImport: true } }; } else { const candidate = normalizePath(combinePaths(containingDirectory, moduleName)); diff --git a/src/compiler/types.ts b/src/compiler/types.ts index 8989f5784b8f8..bf6354ae217d7 100644 --- a/src/compiler/types.ts +++ b/src/compiler/types.ts @@ -3608,6 +3608,7 @@ namespace ts { paths?: MapLike; /*@internal*/ plugins?: PluginImport[]; preserveConstEnums?: boolean; + preserveSymlinks?: boolean; project?: string; /* @internal */ pretty?: DiagnosticStyle; reactNamespace?: string; @@ -3923,6 +3924,10 @@ namespace ts { readFile(fileName: string): string | undefined; trace?(s: string): void; directoryExists?(directoryName: string): boolean; + /** + * Resolve a symbolic link. + * @see https://nodejs.org/api/fs.html#fs_fs_realpathsync_path_options + */ realpath?(path: string): string; getCurrentDirectory?(): string; getDirectories?(path: string): string[]; diff --git a/src/harness/unittests/moduleResolution.ts b/src/harness/unittests/moduleResolution.ts index ffae1b5f4a932..79aafb4986d83 100644 --- a/src/harness/unittests/moduleResolution.ts +++ b/src/harness/unittests/moduleResolution.ts @@ -26,10 +26,19 @@ namespace ts { interface File { name: string; content?: string; + symlinks?: string[]; } function createModuleResolutionHost(hasDirectoryExists: boolean, ...files: File[]): ModuleResolutionHost { - const map = arrayToMap(files, f => f.name); + const map = createMap(); + for (const file of files) { + map.set(file.name, file); + if (file.symlinks) { + for (const symlink of file.symlinks) { + map.set(symlink, file); + } + } + } if (hasDirectoryExists) { const directories = createMap(); @@ -46,6 +55,7 @@ namespace ts { } return { readFile, + realpath, directoryExists: path => directories.has(path), fileExists: path => { assert.isTrue(directories.has(getDirectoryPath(path)), `'fileExists' '${path}' request in non-existing directory`); @@ -54,12 +64,15 @@ namespace ts { }; } else { - return { readFile, fileExists: path => map.has(path) }; + return { readFile, realpath, fileExists: path => map.has(path) }; } function readFile(path: string): string | undefined { const file = map.get(path); return file && file.content; } + function realpath(path: string): string { + return map.get(path).name; + } } describe("Node module resolution - relative paths", () => { @@ -233,8 +246,8 @@ namespace ts { test(/*hasDirectoryExists*/ true); function test(hasDirectoryExists: boolean) { - const containingFile = { name: "/a/node_modules/b/c/node_modules/d/e.ts" }; - const moduleFile = { name: "/a/node_modules/foo/index.d.ts" }; + const containingFile: File = { name: "/a/node_modules/b/c/node_modules/d/e.ts" }; + const moduleFile: File = { name: "/a/node_modules/foo/index.d.ts" }; const resolution = nodeModuleNameResolver("foo", containingFile.name, {}, createModuleResolutionHost(hasDirectoryExists, containingFile, moduleFile)); checkResolvedModuleWithFailedLookupLocations(resolution, createResolvedModule(moduleFile.name, /*isExternalLibraryImport*/ true), [ "/a/node_modules/b/c/node_modules/d/node_modules/foo.ts", @@ -289,6 +302,19 @@ namespace ts { ]); } }); + + testPreserveSymlinks(/*preserveSymlinks*/ false); + testPreserveSymlinks(/*preserveSymlinks*/ true); + function testPreserveSymlinks(preserveSymlinks: boolean) { + it(`preserveSymlinks: ${preserveSymlinks}`, () => { + const realFileName = "/linked/index.d.ts"; + const symlinkFileName = "/app/node_modulex/linked/index.d.ts"; + const host = createModuleResolutionHost(/*hasDirectoryExists*/ true, { name: realFileName, symlinks: [symlinkFileName] }); + const resolution = nodeModuleNameResolver("linked", "/app/app.ts", { preserveSymlinks }, host); + const resolvedFileName = preserveSymlinks ? symlinkFileName : realFileName; + checkResolvedModule(resolution.resolvedModule, { resolvedFileName, isExternalLibraryImport: true, extension: Extension.Dts }); + }); + } }); describe("Module resolution - relative imports", () => { diff --git a/src/server/protocol.ts b/src/server/protocol.ts index a75c04764c036..e8ce8611a549e 100644 --- a/src/server/protocol.ts +++ b/src/server/protocol.ts @@ -2429,6 +2429,7 @@ namespace ts.server.protocol { paths?: MapLike; plugins?: PluginImport[]; preserveConstEnums?: boolean; + preserveSymlinks?: boolean; project?: string; reactNamespace?: string; removeComments?: boolean; diff --git a/tests/baselines/reference/moduleResolutionWithSymlinks_preserveSymlinks.errors.txt b/tests/baselines/reference/moduleResolutionWithSymlinks_preserveSymlinks.errors.txt new file mode 100644 index 0000000000000..229fec978ebc0 --- /dev/null +++ b/tests/baselines/reference/moduleResolutionWithSymlinks_preserveSymlinks.errors.txt @@ -0,0 +1,25 @@ +/app/app.ts(9,1): error TS90010: Type 'C' is not assignable to type 'C'. Two different types with this name exist, but they are unrelated. + Types have separate declarations of a private property 'x'. + + +==== /app/app.ts (1 errors) ==== + // We shouldn't resolve symlinks for references either. See the trace. + /// + + import { C as C1 } from "linked"; + import { C as C2 } from "linked2"; + + let x = new C1(); + // Should fail. We no longer resolve any symlinks. + x = new C2(); + ~ +!!! error TS90010: Type 'C' is not assignable to type 'C'. Two different types with this name exist, but they are unrelated. +!!! error TS90010: Types have separate declarations of a private property 'x'. + +==== /linked/index.d.ts (0 errors) ==== + export { real } from "real"; + export class C { private x; } + +==== /app/node_modules/real/index.d.ts (0 errors) ==== + export const real: string; + \ No newline at end of file diff --git a/tests/baselines/reference/moduleResolutionWithSymlinks_preserveSymlinks.js b/tests/baselines/reference/moduleResolutionWithSymlinks_preserveSymlinks.js new file mode 100644 index 0000000000000..ca740146c0f2c --- /dev/null +++ b/tests/baselines/reference/moduleResolutionWithSymlinks_preserveSymlinks.js @@ -0,0 +1,31 @@ +//// [tests/cases/compiler/moduleResolutionWithSymlinks_preserveSymlinks.ts] //// + +//// [index.d.ts] +export { real } from "real"; +export class C { private x; } + +//// [index.d.ts] +export const real: string; + +//// [app.ts] +// We shouldn't resolve symlinks for references either. See the trace. +/// + +import { C as C1 } from "linked"; +import { C as C2 } from "linked2"; + +let x = new C1(); +// Should fail. We no longer resolve any symlinks. +x = new C2(); + + +//// [app.js] +"use strict"; +// We shouldn't resolve symlinks for references either. See the trace. +/// +exports.__esModule = true; +var linked_1 = require("linked"); +var linked2_1 = require("linked2"); +var x = new linked_1.C(); +// Should fail. We no longer resolve any symlinks. +x = new linked2_1.C(); diff --git a/tests/baselines/reference/moduleResolutionWithSymlinks_preserveSymlinks.trace.json b/tests/baselines/reference/moduleResolutionWithSymlinks_preserveSymlinks.trace.json new file mode 100644 index 0000000000000..837b740ffee72 --- /dev/null +++ b/tests/baselines/reference/moduleResolutionWithSymlinks_preserveSymlinks.trace.json @@ -0,0 +1,55 @@ +[ + "======== Resolving type reference directive 'linked', containing file '/app/app.ts', root directory not set. ========", + "Root directory cannot be determined, skipping primary search paths.", + "Looking up in 'node_modules' folder, initial location '/app'.", + "File '/app/node_modules/linked.d.ts' does not exist.", + "File '/app/node_modules/linked/package.json' does not exist.", + "File '/app/node_modules/linked/index.d.ts' exist - use it as a name resolution result.", + "======== Type reference directive 'linked' was successfully resolved to '/app/node_modules/linked/index.d.ts', primary: false. ========", + "======== Resolving module 'real' from '/app/node_modules/linked/index.d.ts'. ========", + "Explicitly specified module resolution kind: 'NodeJs'.", + "Loading module 'real' from 'node_modules' folder, target file type 'TypeScript'.", + "Directory '/app/node_modules/linked/node_modules' does not exist, skipping all lookups in it.", + "File '/app/node_modules/real.ts' does not exist.", + "File '/app/node_modules/real.tsx' does not exist.", + "File '/app/node_modules/real.d.ts' does not exist.", + "File '/app/node_modules/real/package.json' does not exist.", + "File '/app/node_modules/real/index.ts' does not exist.", + "File '/app/node_modules/real/index.tsx' does not exist.", + "File '/app/node_modules/real/index.d.ts' exist - use it as a name resolution result.", + "======== Module name 'real' was successfully resolved to '/app/node_modules/real/index.d.ts'. ========", + "======== Resolving module 'linked' from '/app/app.ts'. ========", + "Explicitly specified module resolution kind: 'NodeJs'.", + "Loading module 'linked' from 'node_modules' folder, target file type 'TypeScript'.", + "File '/app/node_modules/linked.ts' does not exist.", + "File '/app/node_modules/linked.tsx' does not exist.", + "File '/app/node_modules/linked.d.ts' does not exist.", + "File '/app/node_modules/linked/package.json' does not exist.", + "File '/app/node_modules/linked/index.ts' does not exist.", + "File '/app/node_modules/linked/index.tsx' does not exist.", + "File '/app/node_modules/linked/index.d.ts' exist - use it as a name resolution result.", + "======== Module name 'linked' was successfully resolved to '/app/node_modules/linked/index.d.ts'. ========", + "======== Resolving module 'linked2' from '/app/app.ts'. ========", + "Explicitly specified module resolution kind: 'NodeJs'.", + "Loading module 'linked2' from 'node_modules' folder, target file type 'TypeScript'.", + "File '/app/node_modules/linked2.ts' does not exist.", + "File '/app/node_modules/linked2.tsx' does not exist.", + "File '/app/node_modules/linked2.d.ts' does not exist.", + "File '/app/node_modules/linked2/package.json' does not exist.", + "File '/app/node_modules/linked2/index.ts' does not exist.", + "File '/app/node_modules/linked2/index.tsx' does not exist.", + "File '/app/node_modules/linked2/index.d.ts' exist - use it as a name resolution result.", + "======== Module name 'linked2' was successfully resolved to '/app/node_modules/linked2/index.d.ts'. ========", + "======== Resolving module 'real' from '/app/node_modules/linked2/index.d.ts'. ========", + "Explicitly specified module resolution kind: 'NodeJs'.", + "Loading module 'real' from 'node_modules' folder, target file type 'TypeScript'.", + "Directory '/app/node_modules/linked2/node_modules' does not exist, skipping all lookups in it.", + "File '/app/node_modules/real.ts' does not exist.", + "File '/app/node_modules/real.tsx' does not exist.", + "File '/app/node_modules/real.d.ts' does not exist.", + "File '/app/node_modules/real/package.json' does not exist.", + "File '/app/node_modules/real/index.ts' does not exist.", + "File '/app/node_modules/real/index.tsx' does not exist.", + "File '/app/node_modules/real/index.d.ts' exist - use it as a name resolution result.", + "======== Module name 'real' was successfully resolved to '/app/node_modules/real/index.d.ts'. ========" +] \ No newline at end of file diff --git a/tests/baselines/reference/tsConfig/Default initialized TSConfig/tsconfig.json b/tests/baselines/reference/tsConfig/Default initialized TSConfig/tsconfig.json index b79b4f0f1817c..0f5b23784683f 100644 --- a/tests/baselines/reference/tsConfig/Default initialized TSConfig/tsconfig.json +++ b/tests/baselines/reference/tsConfig/Default initialized TSConfig/tsconfig.json @@ -39,6 +39,7 @@ // "typeRoots": [], /* List of folders to include type definitions from. */ // "types": [], /* Type declaration files to be included in compilation. */ // "allowSyntheticDefaultImports": true, /* Allow default imports from modules with no default export. This does not affect code emit, just typechecking. */ + // "preserveSymlinks": true, /* Do not resolve the real path of symlinks. */ /* Source Map Options */ // "sourceRoot": "./", /* Specify the location where debugger should locate TypeScript files instead of source locations. */ diff --git a/tests/baselines/reference/tsConfig/Initialized TSConfig with boolean value compiler options/tsconfig.json b/tests/baselines/reference/tsConfig/Initialized TSConfig with boolean value compiler options/tsconfig.json index ecbaaf9d961f6..a545124a72397 100644 --- a/tests/baselines/reference/tsConfig/Initialized TSConfig with boolean value compiler options/tsconfig.json +++ b/tests/baselines/reference/tsConfig/Initialized TSConfig with boolean value compiler options/tsconfig.json @@ -39,6 +39,7 @@ // "typeRoots": [], /* List of folders to include type definitions from. */ // "types": [], /* Type declaration files to be included in compilation. */ // "allowSyntheticDefaultImports": true, /* Allow default imports from modules with no default export. This does not affect code emit, just typechecking. */ + // "preserveSymlinks": true, /* Do not resolve the real path of symlinks. */ /* Source Map Options */ // "sourceRoot": "./", /* Specify the location where debugger should locate TypeScript files instead of source locations. */ diff --git a/tests/baselines/reference/tsConfig/Initialized TSConfig with enum value compiler options/tsconfig.json b/tests/baselines/reference/tsConfig/Initialized TSConfig with enum value compiler options/tsconfig.json index 321547908d932..b53ac2d8552d8 100644 --- a/tests/baselines/reference/tsConfig/Initialized TSConfig with enum value compiler options/tsconfig.json +++ b/tests/baselines/reference/tsConfig/Initialized TSConfig with enum value compiler options/tsconfig.json @@ -39,6 +39,7 @@ // "typeRoots": [], /* List of folders to include type definitions from. */ // "types": [], /* Type declaration files to be included in compilation. */ // "allowSyntheticDefaultImports": true, /* Allow default imports from modules with no default export. This does not affect code emit, just typechecking. */ + // "preserveSymlinks": true, /* Do not resolve the real path of symlinks. */ /* Source Map Options */ // "sourceRoot": "./", /* Specify the location where debugger should locate TypeScript files instead of source locations. */ diff --git a/tests/baselines/reference/tsConfig/Initialized TSConfig with files options/tsconfig.json b/tests/baselines/reference/tsConfig/Initialized TSConfig with files options/tsconfig.json index ec0ac6e4c32fd..4e06e06d159a4 100644 --- a/tests/baselines/reference/tsConfig/Initialized TSConfig with files options/tsconfig.json +++ b/tests/baselines/reference/tsConfig/Initialized TSConfig with files options/tsconfig.json @@ -39,6 +39,7 @@ // "typeRoots": [], /* List of folders to include type definitions from. */ // "types": [], /* Type declaration files to be included in compilation. */ // "allowSyntheticDefaultImports": true, /* Allow default imports from modules with no default export. This does not affect code emit, just typechecking. */ + // "preserveSymlinks": true, /* Do not resolve the real path of symlinks. */ /* Source Map Options */ // "sourceRoot": "./", /* Specify the location where debugger should locate TypeScript files instead of source locations. */ diff --git a/tests/baselines/reference/tsConfig/Initialized TSConfig with incorrect compiler option value/tsconfig.json b/tests/baselines/reference/tsConfig/Initialized TSConfig with incorrect compiler option value/tsconfig.json index 655ece4d6d0a8..94808d89ed05d 100644 --- a/tests/baselines/reference/tsConfig/Initialized TSConfig with incorrect compiler option value/tsconfig.json +++ b/tests/baselines/reference/tsConfig/Initialized TSConfig with incorrect compiler option value/tsconfig.json @@ -39,6 +39,7 @@ // "typeRoots": [], /* List of folders to include type definitions from. */ // "types": [], /* Type declaration files to be included in compilation. */ // "allowSyntheticDefaultImports": true, /* Allow default imports from modules with no default export. This does not affect code emit, just typechecking. */ + // "preserveSymlinks": true, /* Do not resolve the real path of symlinks. */ /* Source Map Options */ // "sourceRoot": "./", /* Specify the location where debugger should locate TypeScript files instead of source locations. */ diff --git a/tests/baselines/reference/tsConfig/Initialized TSConfig with incorrect compiler option/tsconfig.json b/tests/baselines/reference/tsConfig/Initialized TSConfig with incorrect compiler option/tsconfig.json index b79b4f0f1817c..0f5b23784683f 100644 --- a/tests/baselines/reference/tsConfig/Initialized TSConfig with incorrect compiler option/tsconfig.json +++ b/tests/baselines/reference/tsConfig/Initialized TSConfig with incorrect compiler option/tsconfig.json @@ -39,6 +39,7 @@ // "typeRoots": [], /* List of folders to include type definitions from. */ // "types": [], /* Type declaration files to be included in compilation. */ // "allowSyntheticDefaultImports": true, /* Allow default imports from modules with no default export. This does not affect code emit, just typechecking. */ + // "preserveSymlinks": true, /* Do not resolve the real path of symlinks. */ /* Source Map Options */ // "sourceRoot": "./", /* Specify the location where debugger should locate TypeScript files instead of source locations. */ diff --git a/tests/baselines/reference/tsConfig/Initialized TSConfig with list compiler options with enum value/tsconfig.json b/tests/baselines/reference/tsConfig/Initialized TSConfig with list compiler options with enum value/tsconfig.json index 81b1636b8cbfe..d165b0f277541 100644 --- a/tests/baselines/reference/tsConfig/Initialized TSConfig with list compiler options with enum value/tsconfig.json +++ b/tests/baselines/reference/tsConfig/Initialized TSConfig with list compiler options with enum value/tsconfig.json @@ -39,6 +39,7 @@ // "typeRoots": [], /* List of folders to include type definitions from. */ // "types": [], /* Type declaration files to be included in compilation. */ // "allowSyntheticDefaultImports": true, /* Allow default imports from modules with no default export. This does not affect code emit, just typechecking. */ + // "preserveSymlinks": true, /* Do not resolve the real path of symlinks. */ /* Source Map Options */ // "sourceRoot": "./", /* Specify the location where debugger should locate TypeScript files instead of source locations. */ diff --git a/tests/baselines/reference/tsConfig/Initialized TSConfig with list compiler options/tsconfig.json b/tests/baselines/reference/tsConfig/Initialized TSConfig with list compiler options/tsconfig.json index 66acf6df04528..2a169b3aaafa1 100644 --- a/tests/baselines/reference/tsConfig/Initialized TSConfig with list compiler options/tsconfig.json +++ b/tests/baselines/reference/tsConfig/Initialized TSConfig with list compiler options/tsconfig.json @@ -39,6 +39,7 @@ // "typeRoots": [], /* List of folders to include type definitions from. */ "types": ["jquery","mocha"] /* Type declaration files to be included in compilation. */ // "allowSyntheticDefaultImports": true, /* Allow default imports from modules with no default export. This does not affect code emit, just typechecking. */ + // "preserveSymlinks": true, /* Do not resolve the real path of symlinks. */ /* Source Map Options */ // "sourceRoot": "./", /* Specify the location where debugger should locate TypeScript files instead of source locations. */ diff --git a/tests/cases/compiler/moduleResolutionWithSymlinks_preserveSymlinks.ts b/tests/cases/compiler/moduleResolutionWithSymlinks_preserveSymlinks.ts new file mode 100644 index 0000000000000..d5509eb5e2005 --- /dev/null +++ b/tests/cases/compiler/moduleResolutionWithSymlinks_preserveSymlinks.ts @@ -0,0 +1,24 @@ +// @noImplicitReferences: true + +// @traceResolution: true +// @preserveSymlinks: true +// @moduleResolution: node + +// @filename: /linked/index.d.ts +// @symlink: /app/node_modules/linked/index.d.ts,/app/node_modules/linked2/index.d.ts +export { real } from "real"; +export class C { private x; } + +// @filename: /app/node_modules/real/index.d.ts +export const real: string; + +// @filename: /app/app.ts +// We shouldn't resolve symlinks for references either. See the trace. +/// + +import { C as C1 } from "linked"; +import { C as C2 } from "linked2"; + +let x = new C1(); +// Should fail. We no longer resolve any symlinks. +x = new C2(); From c92deef6ec52947cbf0c3716c7c8ceb2d9233b4a Mon Sep 17 00:00:00 2001 From: Wesley Wigham Date: Fri, 11 Aug 2017 10:58:38 -0700 Subject: [PATCH 115/237] Fix runtests-browser with latest node (#17735) * Fixes for running tests in the browser with the latest node * Make memoize safe * Integrate PR feedback, require key func on memoize --- package.json | 1 - src/harness/harness.ts | 43 +++++++++++++++++++++--------------------- tests/webTestServer.ts | 2 +- 3 files changed, 23 insertions(+), 23 deletions(-) diff --git a/package.json b/package.json index a114ac68a2d80..2c5f8f929a793 100644 --- a/package.json +++ b/package.json @@ -90,7 +90,6 @@ "setup-hooks": "node scripts/link-hooks.js" }, "browser": { - "buffer": false, "fs": false, "os": false, "path": false diff --git a/src/harness/harness.ts b/src/harness/harness.ts index 6c5b3ba47784f..bf5cde2bc4832 100644 --- a/src/harness/harness.ts +++ b/src/harness/harness.ts @@ -67,17 +67,16 @@ namespace Utils { export let currentExecutionEnvironment = getExecutionEnvironment(); - const Buffer: typeof global.Buffer = currentExecutionEnvironment !== ExecutionEnvironment.Browser - ? require("buffer").Buffer - : undefined; + // Thanks to browserify, Buffer is always available nowadays + const Buffer: typeof global.Buffer = require("buffer").Buffer; export function encodeString(s: string): string { - return Buffer ? (new Buffer(s)).toString("utf8") : s; + return Buffer.from(s).toString("utf8"); } export function byteLength(s: string, encoding?: string): number { // stub implementation if Buffer is not available (in-browser case) - return Buffer ? Buffer.byteLength(s, encoding) : s.length; + return Buffer.byteLength(s, encoding); } export function evalFile(fileContents: string, fileName: string, nodeContext?: any) { @@ -133,17 +132,18 @@ namespace Utils { return content; } - export function memoize(f: T): T { - const cache: { [idx: string]: any } = {}; + export function memoize(f: T, memoKey: (...anything: any[]) => string): T { + const cache = ts.createMap(); - return (function(this: any) { - const key = Array.prototype.join.call(arguments); - const cachedResult = cache[key]; - if (cachedResult) { - return cachedResult; + return (function(this: any, ...args: any[]) { + const key = memoKey(...args); + if (cache.has(key)) { + return cache.get(key); } else { - return cache[key] = f.apply(this, arguments); + const value = f.apply(this, args); + cache.set(key, value); + return value; } }); } @@ -686,7 +686,7 @@ namespace Harness { return dirPath; } - export let directoryName: typeof IO.directoryName = Utils.memoize(directoryNameImpl); + export let directoryName: typeof IO.directoryName = Utils.memoize(directoryNameImpl, path => path); export function resolvePath(path: string) { const response = Http.getFileFromServerSync(serverRoot + path + "?resolve=true"); @@ -703,21 +703,22 @@ namespace Harness { return response.status === 200; } - export let listFiles = Utils.memoize((path: string, spec?: RegExp): string[] => { + export const listFiles = Utils.memoize((path: string, spec?: RegExp, options?: { recursive?: boolean }): string[] => { const response = Http.getFileFromServerSync(serverRoot + path); if (response.status === 200) { - const results = response.responseText.split(","); + let results = response.responseText.split(","); if (spec) { - return results.filter(file => spec.test(file)); + results = results.filter(file => spec.test(file)); } - else { - return results; + if (options && !options.recursive) { + results = results.filter(file => (ts.getDirectoryPath(ts.normalizeSlashes(file)) === path)); } + return results; } else { return [""]; } - }); + }, (path: string, spec?: RegExp, options?: { recursive?: boolean }) => `${path}|${spec}|${options ? options.recursive : undefined}`); export function readFile(file: string): string | undefined { const response = Http.getFileFromServerSync(serverRoot + file); @@ -1989,7 +1990,7 @@ namespace Harness { IO.writeFile(actualFileName + ".delete", ""); } else { - IO.writeFile(actualFileName, actual); + IO.writeFile(actualFileName, encoded_actual); } throw new Error(`The baseline file ${relativeFileName} has changed.`); } diff --git a/tests/webTestServer.ts b/tests/webTestServer.ts index 20228f9a7412c..5a3b4cc504896 100644 --- a/tests/webTestServer.ts +++ b/tests/webTestServer.ts @@ -288,7 +288,7 @@ console.log(`Static file server running at\n => http://localhost:${port}/\nCTRL http.createServer((req: http.ServerRequest, res: http.ServerResponse) => { log(`${req.method} ${req.url}`); - const uri = url.parse(req.url).pathname; + const uri = decodeURIComponent(url.parse(req.url).pathname); const reqPath = path.join(process.cwd(), uri); const operation = getRequestOperation(req); handleRequestOperation(req, res, operation, reqPath); From d352e3b03fcfd29721c621a258beb7916e9aa867 Mon Sep 17 00:00:00 2001 From: Yui Date: Fri, 11 Aug 2017 11:14:59 -0700 Subject: [PATCH 116/237] [Master] fix 16407 - LS in binding element of object binding pattern (#16534) * wip-try get symbol of bindingelement in objectBindingPattern first * Add fourslash tests * Update .types baselines * Update .symbols baselines * Revert checker changes * Actually lookup type for binding property name definition * More succinct check, clarify yui's comment --- src/services/goToDefinition.ts | 22 +++++++++++++++++++ src/services/services.ts | 15 ++++++++----- .../findAllReferencesDynamicImport3.ts | 13 +++++++++++ .../fourslash/goToDefinitionDynamicImport3.ts | 8 +++++++ .../fourslash/goToDefinitionDynamicImport4.ts | 8 +++++++ .../gotoDefinitionInObjectBindingPattern1.ts | 12 ++++++++++ .../gotoDefinitionInObjectBindingPattern2.ts | 8 +++++++ 7 files changed, 81 insertions(+), 5 deletions(-) create mode 100644 tests/cases/fourslash/findAllReferencesDynamicImport3.ts create mode 100644 tests/cases/fourslash/goToDefinitionDynamicImport3.ts create mode 100644 tests/cases/fourslash/goToDefinitionDynamicImport4.ts create mode 100644 tests/cases/fourslash/gotoDefinitionInObjectBindingPattern1.ts create mode 100644 tests/cases/fourslash/gotoDefinitionInObjectBindingPattern2.ts diff --git a/src/services/goToDefinition.ts b/src/services/goToDefinition.ts index 3c4adcb68dfde..f60349e4ea56b 100644 --- a/src/services/goToDefinition.ts +++ b/src/services/goToDefinition.ts @@ -76,6 +76,28 @@ namespace ts.GoToDefinition { declaration => createDefinitionInfo(declaration, shorthandSymbolKind, shorthandSymbolName, shorthandContainerName)); } + // If the node is the name of a BindingElement within an ObjectBindingPattern instead of just returning the + // declaration the symbol (which is itself), we should try to get to the original type of the ObjectBindingPattern + // and return the property declaration for the referenced property. + // For example: + // import('./foo').then(({ b/*goto*/ar }) => undefined); => should get use to the declaration in file "./foo" + // + // function bar(onfulfilled: (value: T) => void) { //....} + // interface Test { + // pr/*destination*/op1: number + // } + // bar(({pr/*goto*/op1})=>{}); + if (isPropertyName(node) && isBindingElement(node.parent) && isObjectBindingPattern(node.parent.parent) && + (node === (node.parent.propertyName || node.parent.name))) { + const type = typeChecker.getTypeAtLocation(node.parent.parent); + if (type) { + const propSymbols = getPropertySymbolsFromType(type, node); + if (propSymbols) { + return flatMap(propSymbols, propSymbol => getDefinitionFromSymbol(typeChecker, propSymbol, node)); + } + } + } + // If the current location we want to find its definition is in an object literal, try to get the contextual type for the // object literal, lookup the property symbol in the contextual type, and use this for goto-definition. // For example diff --git a/src/services/services.ts b/src/services/services.ts index 874c2feb107f1..ed9732cc9cf5c 100644 --- a/src/services/services.ts +++ b/src/services/services.ts @@ -2138,12 +2138,17 @@ namespace ts { export function getPropertySymbolsFromContextualType(typeChecker: TypeChecker, node: ObjectLiteralElement): Symbol[] { const objectLiteral = node.parent; const contextualType = typeChecker.getContextualType(objectLiteral); - const name = unescapeLeadingUnderscores(getTextOfPropertyName(node.name)); - if (name && contextualType) { + return getPropertySymbolsFromType(contextualType, node.name); + } + + /* @internal */ + export function getPropertySymbolsFromType(type: Type, propName: PropertyName) { + const name = unescapeLeadingUnderscores(getTextOfPropertyName(propName)); + if (name && type) { const result: Symbol[] = []; - const symbol = contextualType.getProperty(name); - if (contextualType.flags & TypeFlags.Union) { - forEach((contextualType).types, t => { + const symbol = type.getProperty(name); + if (type.flags & TypeFlags.Union) { + forEach((type).types, t => { const symbol = t.getProperty(name); if (symbol) { result.push(symbol); diff --git a/tests/cases/fourslash/findAllReferencesDynamicImport3.ts b/tests/cases/fourslash/findAllReferencesDynamicImport3.ts new file mode 100644 index 0000000000000..21d2e1097db90 --- /dev/null +++ b/tests/cases/fourslash/findAllReferencesDynamicImport3.ts @@ -0,0 +1,13 @@ +/// + +// @Filename: foo.ts +//// export function [|bar|]() { return "bar"; } + +//// import('./foo').then(({ [|bar|] }) => undefined); + +const [r0, r1] = test.ranges(); +// This is because bindingElement at r1 are both name and value +verify.referencesOf(r0, [r1, r0, r1, r0]); +verify.referencesOf(r1, [r0, r1, r1, r0]); +verify.renameLocations(r0, [r0, r1]); +verify.renameLocations(r1, [r1, r0, r0, r1]); \ No newline at end of file diff --git a/tests/cases/fourslash/goToDefinitionDynamicImport3.ts b/tests/cases/fourslash/goToDefinitionDynamicImport3.ts new file mode 100644 index 0000000000000..f8c5962f9847e --- /dev/null +++ b/tests/cases/fourslash/goToDefinitionDynamicImport3.ts @@ -0,0 +1,8 @@ +/// + +// @Filename: foo.ts +//// export function /*Destination*/bar() { return "bar"; } + +//// import('./foo').then(({ ba/*1*/r }) => undefined); + +verify.goToDefinition("1", "Destination"); \ No newline at end of file diff --git a/tests/cases/fourslash/goToDefinitionDynamicImport4.ts b/tests/cases/fourslash/goToDefinitionDynamicImport4.ts new file mode 100644 index 0000000000000..f8c5962f9847e --- /dev/null +++ b/tests/cases/fourslash/goToDefinitionDynamicImport4.ts @@ -0,0 +1,8 @@ +/// + +// @Filename: foo.ts +//// export function /*Destination*/bar() { return "bar"; } + +//// import('./foo').then(({ ba/*1*/r }) => undefined); + +verify.goToDefinition("1", "Destination"); \ No newline at end of file diff --git a/tests/cases/fourslash/gotoDefinitionInObjectBindingPattern1.ts b/tests/cases/fourslash/gotoDefinitionInObjectBindingPattern1.ts new file mode 100644 index 0000000000000..98c06c06d7be4 --- /dev/null +++ b/tests/cases/fourslash/gotoDefinitionInObjectBindingPattern1.ts @@ -0,0 +1,12 @@ +/// + +//// function bar(onfulfilled: (value: T) => void) { +//// return undefined; +//// } + +//// interface Test { +//// /*destination*/prop2: number +//// } +//// bar(({pr/*goto*/op2})=>{}); + +verify.goToDefinition("goto", "destination"); \ No newline at end of file diff --git a/tests/cases/fourslash/gotoDefinitionInObjectBindingPattern2.ts b/tests/cases/fourslash/gotoDefinitionInObjectBindingPattern2.ts new file mode 100644 index 0000000000000..9e41f646c4635 --- /dev/null +++ b/tests/cases/fourslash/gotoDefinitionInObjectBindingPattern2.ts @@ -0,0 +1,8 @@ +/// + +//// var p0 = ({a/*1*/a}) => {console.log(aa)}; +//// function f2({ a/*a1*/1, b/*b1*/1 }: { /*a1_dest*/a1: number, /*b1_dest*/b1: number } = { a1: 0, b1: 0 }) {} + +verify.goToDefinition("1", []); +verify.goToDefinition("a1", "a1_dest"); +verify.goToDefinition("b1", "b1_dest"); \ No newline at end of file From d6ccee67661987373949af9c97bf3c636a22d496 Mon Sep 17 00:00:00 2001 From: uniqueiniquity Date: Fri, 11 Aug 2017 13:42:14 -0700 Subject: [PATCH 117/237] Cleans up and adds nested case to test --- .../getOutliningForObjectsInArray.ts | 26 ++++++++++++++----- 1 file changed, 20 insertions(+), 6 deletions(-) diff --git a/tests/cases/fourslash/getOutliningForObjectsInArray.ts b/tests/cases/fourslash/getOutliningForObjectsInArray.ts index 207da1997b4c9..2d57d3335bdf1 100644 --- a/tests/cases/fourslash/getOutliningForObjectsInArray.ts +++ b/tests/cases/fourslash/getOutliningForObjectsInArray.ts @@ -22,20 +22,34 @@ //// ////// same behavior for nested arrays //// const w =[| [ -//// [|[ a: 0 ]|], -//// [|[ b: 1 ]|], -//// [|[ c: 2 ]|] +//// [|[ 0 ]|], +//// [|[ 1 ]|], +//// [|[ 2 ]|] //// ]|]; //// //// const z =[| [ //// [|[ -//// a: 0 +//// 0 //// ]|], //// [|[ -//// b: 1 +//// 1 //// ]|], //// [|[ -//// c: 2 +//// 2 +//// ]|] +//// ]|]; +//// +////// multiple levels of nesting work as expected +//// const z =[| [ +//// [|[ +//// [|{ hello: 0 }|] +//// ]|], +//// [|[ +//// [|{ hello: 3 }|] +//// ]|], +//// [|[ +//// [|{ hello: 5 }|], +//// [|{ hello: 7 }|] //// ]|] //// ]|]; From e3b6df64b37826bd2f669be0c62647ddd803e94c Mon Sep 17 00:00:00 2001 From: Ron Buckton Date: Fri, 11 Aug 2017 14:26:25 -0700 Subject: [PATCH 118/237] Add support to infer the quote style for import quick fixes --- src/compiler/types.ts | 1 + src/compiler/utilities.ts | 32 +++++++++++++------ src/services/codefixes/importFixes.ts | 21 +++++++++++- .../importNameCodeFixNewImportFile6.ts | 19 +++++++++++ 4 files changed, 62 insertions(+), 11 deletions(-) create mode 100644 tests/cases/fourslash/importNameCodeFixNewImportFile6.ts diff --git a/src/compiler/types.ts b/src/compiler/types.ts index 1f4b47f982d38..0a09bb5b6ecba 100644 --- a/src/compiler/types.ts +++ b/src/compiler/types.ts @@ -999,6 +999,7 @@ namespace ts { export interface StringLiteral extends LiteralExpression { kind: SyntaxKind.StringLiteral; /* @internal */ textSourceNode?: Identifier | StringLiteral | NumericLiteral; // Allows a StringLiteral to get its text from another node (used by transforms). + /* @internal */ singleQuote?: boolean; } // Note: 'brands' in our syntax nodes serve to give us a small amount of nominal typing. diff --git a/src/compiler/utilities.ts b/src/compiler/utilities.ts index 7a382b7b5750a..c77d267471a06 100644 --- a/src/compiler/utilities.ts +++ b/src/compiler/utilities.ts @@ -344,15 +344,20 @@ namespace ts { // or a (possibly escaped) quoted form of the original text if it's string-like. switch (node.kind) { case SyntaxKind.StringLiteral: - return '"' + escapeText(node.text) + '"'; + if ((node).singleQuote) { + return "'" + escapeText(node.text, CharacterCodes.singleQuote) + "'"; + } + else { + return '"' + escapeText(node.text, CharacterCodes.doubleQuote) + '"'; + } case SyntaxKind.NoSubstitutionTemplateLiteral: - return "`" + escapeText(node.text) + "`"; + return "`" + escapeText(node.text, CharacterCodes.backtick) + "`"; case SyntaxKind.TemplateHead: - return "`" + escapeText(node.text) + "${"; + return "`" + escapeText(node.text, CharacterCodes.backtick) + "${"; case SyntaxKind.TemplateMiddle: - return "}" + escapeText(node.text) + "${"; + return "}" + escapeText(node.text, CharacterCodes.backtick) + "${"; case SyntaxKind.TemplateTail: - return "}" + escapeText(node.text) + "`"; + return "}" + escapeText(node.text, CharacterCodes.backtick) + "`"; case SyntaxKind.NumericLiteral: return node.text; } @@ -2356,7 +2361,9 @@ namespace ts { // the language service. These characters should be escaped when printing, and if any characters are added, // the map below must be updated. Note that this regexp *does not* include the 'delete' character. // There is no reason for this other than that JSON.stringify does not handle it either. - const escapedCharsRegExp = /[\\\"\u0000-\u001f\t\v\f\b\r\n\u2028\u2029\u0085]/g; + const doubleQuoteEscapedCharsRegExp = /[\\\"\u0000-\u001f\t\v\f\b\r\n\u2028\u2029\u0085]/g; + const singleQuoteEscapedCharsRegExp = /[\\\'\u0000-\u001f\t\v\f\b\r\n\u2028\u2029\u0085]/g; + const backtickQuoteEscapedCharsRegExp = /[\\\`\u0000-\u001f\t\v\f\b\r\n\u2028\u2029\u0085]/g; const escapedCharsMap = createMapFromTemplate({ "\0": "\\0", "\t": "\\t", @@ -2367,18 +2374,23 @@ namespace ts { "\n": "\\n", "\\": "\\\\", "\"": "\\\"", + "\'": "\\\'", + "\`": "\\\`", "\u2028": "\\u2028", // lineSeparator "\u2029": "\\u2029", // paragraphSeparator "\u0085": "\\u0085" // nextLine }); - /** * Based heavily on the abstract 'Quote'/'QuoteJSONString' operation from ECMA-262 (24.3.2.2), * but augmented for a few select characters (e.g. lineSeparator, paragraphSeparator, nextLine) * Note that this doesn't actually wrap the input in double quotes. */ - export function escapeString(s: string): string { + export function escapeString(s: string, quoteChar?: CharacterCodes.doubleQuote | CharacterCodes.singleQuote | CharacterCodes.backtick): string { + const escapedCharsRegExp = + quoteChar === CharacterCodes.backtick ? backtickQuoteEscapedCharsRegExp : + quoteChar === CharacterCodes.singleQuote ? singleQuoteEscapedCharsRegExp : + doubleQuoteEscapedCharsRegExp; return s.replace(escapedCharsRegExp, getReplacement); } @@ -2400,8 +2412,8 @@ namespace ts { } const nonAsciiCharacters = /[^\u0000-\u007F]/g; - export function escapeNonAsciiString(s: string): string { - s = escapeString(s); + export function escapeNonAsciiString(s: string, quoteChar?: CharacterCodes.doubleQuote | CharacterCodes.singleQuote | CharacterCodes.backtick): string { + s = escapeString(s, quoteChar); // Replace non-ASCII characters with '\uNNNN' escapes if any exist. // Otherwise just return the original string. return nonAsciiCharacters.test(s) ? diff --git a/src/services/codefixes/importFixes.ts b/src/services/codefixes/importFixes.ts index fcd02664eff74..59355e2bec81b 100644 --- a/src/services/codefixes/importFixes.ts +++ b/src/services/codefixes/importFixes.ts @@ -394,7 +394,9 @@ namespace ts.codefix { : isNamespaceImport ? createImportClause(/*name*/ undefined, createNamespaceImport(createIdentifier(symbolName))) : createImportClause(/*name*/ undefined, createNamedImports([createImportSpecifier(/*propertyName*/ undefined, createIdentifier(symbolName))])); - const importDecl = createImportDeclaration(/*decorators*/ undefined, /*modifiers*/ undefined, importClause, createLiteral(moduleSpecifierWithoutQuotes)); + const moduleSpecifierLiteral = createLiteral(moduleSpecifierWithoutQuotes); + moduleSpecifierLiteral.singleQuote = getSingleQuoteStyleFromExistingImports(); + const importDecl = createImportDeclaration(/*decorators*/ undefined, /*modifiers*/ undefined, importClause, moduleSpecifierLiteral); if (!lastImportDeclaration) { changeTracker.insertNodeAt(sourceFile, getSourceFileImportLocation(sourceFile), importDecl, { suffix: `${context.newLineCharacter}${context.newLineCharacter}` }); } @@ -435,6 +437,23 @@ namespace ts.codefix { return position; } + function getSingleQuoteStyleFromExistingImports() { + const firstModuleSpecifier = forEach(sourceFile.statements, node => { + switch (node.kind) { + case SyntaxKind.ImportDeclaration: + return (node).moduleSpecifier; + case SyntaxKind.ImportEqualsDeclaration: + const moduleReference = (node).moduleReference; + return moduleReference.kind === SyntaxKind.ExternalModuleReference ? moduleReference.expression : undefined; + case SyntaxKind.ExportDeclaration: + return (node).moduleSpecifier; + } + }); + if (firstModuleSpecifier && isStringLiteral(firstModuleSpecifier)) { + return sourceFile.text.charCodeAt(skipTrivia(sourceFile.text, firstModuleSpecifier.pos)) === CharacterCodes.singleQuote; + } + } + function getModuleSpecifierForNewImport() { const fileName = sourceFile.fileName; const moduleFileName = moduleSymbol.valueDeclaration.getSourceFile().fileName; diff --git a/tests/cases/fourslash/importNameCodeFixNewImportFile6.ts b/tests/cases/fourslash/importNameCodeFixNewImportFile6.ts new file mode 100644 index 0000000000000..421161e656325 --- /dev/null +++ b/tests/cases/fourslash/importNameCodeFixNewImportFile6.ts @@ -0,0 +1,19 @@ +/// + +//// [|import { v2 } from './module2'; +//// +//// f1/*0*/();|] + +// @Filename: module.ts +//// export function f1() {} +//// export var v1 = 5; + +// @Filename: module2.ts +//// export var v2 = 6; + +verify.importFixAtPosition([ +`import { v2 } from './module2'; +import { f1 } from './module'; + +f1();` +]); From 09487b8a1dab2e625af8cf22b44ac97c4285dfab Mon Sep 17 00:00:00 2001 From: Ron Buckton Date: Fri, 11 Aug 2017 15:31:09 -0700 Subject: [PATCH 119/237] Added tests, pr feedback --- src/services/codefixes/importFixes.ts | 21 +++++++++-------- ...ortNameCodeFixNewImportFileQuoteStyle0.ts} | 5 ++-- ...portNameCodeFixNewImportFileQuoteStyle1.ts | 18 +++++++++++++++ ...portNameCodeFixNewImportFileQuoteStyle2.ts | 18 +++++++++++++++ ...portNameCodeFixNewImportFileQuoteStyle3.ts | 19 +++++++++++++++ ...ameCodeFixNewImportFileQuoteStyleMixed0.ts | 23 +++++++++++++++++++ ...ameCodeFixNewImportFileQuoteStyleMixed1.ts | 23 +++++++++++++++++++ 7 files changed, 114 insertions(+), 13 deletions(-) rename tests/cases/fourslash/{importNameCodeFixNewImportFile6.ts => importNameCodeFixNewImportFileQuoteStyle0.ts} (72%) create mode 100644 tests/cases/fourslash/importNameCodeFixNewImportFileQuoteStyle1.ts create mode 100644 tests/cases/fourslash/importNameCodeFixNewImportFileQuoteStyle2.ts create mode 100644 tests/cases/fourslash/importNameCodeFixNewImportFileQuoteStyle3.ts create mode 100644 tests/cases/fourslash/importNameCodeFixNewImportFileQuoteStyleMixed0.ts create mode 100644 tests/cases/fourslash/importNameCodeFixNewImportFileQuoteStyleMixed1.ts diff --git a/src/services/codefixes/importFixes.ts b/src/services/codefixes/importFixes.ts index 59355e2bec81b..d0b52184031ef 100644 --- a/src/services/codefixes/importFixes.ts +++ b/src/services/codefixes/importFixes.ts @@ -439,18 +439,19 @@ namespace ts.codefix { function getSingleQuoteStyleFromExistingImports() { const firstModuleSpecifier = forEach(sourceFile.statements, node => { - switch (node.kind) { - case SyntaxKind.ImportDeclaration: - return (node).moduleSpecifier; - case SyntaxKind.ImportEqualsDeclaration: - const moduleReference = (node).moduleReference; - return moduleReference.kind === SyntaxKind.ExternalModuleReference ? moduleReference.expression : undefined; - case SyntaxKind.ExportDeclaration: - return (node).moduleSpecifier; + if (isImportDeclaration(node) || isExportDeclaration(node)) { + if (node.moduleSpecifier && isStringLiteral(node.moduleSpecifier)) { + return node.moduleSpecifier; + } + } + else if (isImportEqualsDeclaration(node)) { + if (isExternalModuleReference(node.moduleReference) && isStringLiteral(node.moduleReference.expression)) { + return node.moduleReference.expression; + } } }); - if (firstModuleSpecifier && isStringLiteral(firstModuleSpecifier)) { - return sourceFile.text.charCodeAt(skipTrivia(sourceFile.text, firstModuleSpecifier.pos)) === CharacterCodes.singleQuote; + if (firstModuleSpecifier) { + return sourceFile.text.charCodeAt(firstModuleSpecifier.getStart()) === CharacterCodes.singleQuote; } } diff --git a/tests/cases/fourslash/importNameCodeFixNewImportFile6.ts b/tests/cases/fourslash/importNameCodeFixNewImportFileQuoteStyle0.ts similarity index 72% rename from tests/cases/fourslash/importNameCodeFixNewImportFile6.ts rename to tests/cases/fourslash/importNameCodeFixNewImportFileQuoteStyle0.ts index 421161e656325..6b5ef958e0546 100644 --- a/tests/cases/fourslash/importNameCodeFixNewImportFile6.ts +++ b/tests/cases/fourslash/importNameCodeFixNewImportFileQuoteStyle0.ts @@ -4,16 +4,15 @@ //// //// f1/*0*/();|] -// @Filename: module.ts +// @Filename: module1.ts //// export function f1() {} -//// export var v1 = 5; // @Filename: module2.ts //// export var v2 = 6; verify.importFixAtPosition([ `import { v2 } from './module2'; -import { f1 } from './module'; +import { f1 } from './module1'; f1();` ]); diff --git a/tests/cases/fourslash/importNameCodeFixNewImportFileQuoteStyle1.ts b/tests/cases/fourslash/importNameCodeFixNewImportFileQuoteStyle1.ts new file mode 100644 index 0000000000000..a9a12c419582e --- /dev/null +++ b/tests/cases/fourslash/importNameCodeFixNewImportFileQuoteStyle1.ts @@ -0,0 +1,18 @@ +/// + +//// [|import { v2 } from "./module2"; +//// +//// f1/*0*/();|] + +// @Filename: module1.ts +//// export function f1() {} + +// @Filename: module2.ts +//// export var v2 = 6; + +verify.importFixAtPosition([ +`import { v2 } from "./module2"; +import { f1 } from "./module1"; + +f1();` +]); diff --git a/tests/cases/fourslash/importNameCodeFixNewImportFileQuoteStyle2.ts b/tests/cases/fourslash/importNameCodeFixNewImportFileQuoteStyle2.ts new file mode 100644 index 0000000000000..c356e239ee86a --- /dev/null +++ b/tests/cases/fourslash/importNameCodeFixNewImportFileQuoteStyle2.ts @@ -0,0 +1,18 @@ +/// + +//// [|import m2 = require('./module2'); +//// +//// f1/*0*/();|] + +// @Filename: module1.ts +//// export function f1() {} + +// @Filename: module2.ts +//// export var v2 = 6; + +verify.importFixAtPosition([ +`import m2 = require('./module2'); +import { f1 } from './module1'; + +f1();` +]); diff --git a/tests/cases/fourslash/importNameCodeFixNewImportFileQuoteStyle3.ts b/tests/cases/fourslash/importNameCodeFixNewImportFileQuoteStyle3.ts new file mode 100644 index 0000000000000..5fa9f6e2c9a18 --- /dev/null +++ b/tests/cases/fourslash/importNameCodeFixNewImportFileQuoteStyle3.ts @@ -0,0 +1,19 @@ +/// + +//// [|export { v2 } from './module2'; +//// +//// f1/*0*/();|] + +// @Filename: module1.ts +//// export function f1() {} + +// @Filename: module2.ts +//// export var v2 = 6; + +verify.importFixAtPosition([ +`import { f1 } from './module1'; + +export { v2 } from './module2'; + +f1();` +]); diff --git a/tests/cases/fourslash/importNameCodeFixNewImportFileQuoteStyleMixed0.ts b/tests/cases/fourslash/importNameCodeFixNewImportFileQuoteStyleMixed0.ts new file mode 100644 index 0000000000000..2f17780df7ff6 --- /dev/null +++ b/tests/cases/fourslash/importNameCodeFixNewImportFileQuoteStyleMixed0.ts @@ -0,0 +1,23 @@ +/// + +//// [|import { v2 } from "./module2"; +//// import { v3 } from './module3'; +//// +//// f1/*0*/();|] + +// @Filename: module1.ts +//// export function f1() {} + +// @Filename: module2.ts +//// export var v2 = 6; + +// @Filename: module3.ts +//// export var v3 = 6; + +verify.importFixAtPosition([ +`import { v2 } from "./module2"; +import { v3 } from './module3'; +import { f1 } from "./module1"; + +f1();` +]); diff --git a/tests/cases/fourslash/importNameCodeFixNewImportFileQuoteStyleMixed1.ts b/tests/cases/fourslash/importNameCodeFixNewImportFileQuoteStyleMixed1.ts new file mode 100644 index 0000000000000..ec68b3be0d844 --- /dev/null +++ b/tests/cases/fourslash/importNameCodeFixNewImportFileQuoteStyleMixed1.ts @@ -0,0 +1,23 @@ +/// + +//// [|import { v2 } from './module2'; +//// import { v3 } from "./module3"; +//// +//// f1/*0*/();|] + +// @Filename: module1.ts +//// export function f1() {} + +// @Filename: module2.ts +//// export var v2 = 6; + +// @Filename: module3.ts +//// export var v3 = 6; + +verify.importFixAtPosition([ +`import { v2 } from './module2'; +import { v3 } from "./module3"; +import { f1 } from './module1'; + +f1();` +]); From 18cced9abd97005b5c139bd97ac41e892f0c3b9d Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Fri, 11 Aug 2017 18:35:31 -0400 Subject: [PATCH 120/237] Added test. --- src/harness/unittests/transform.ts | 27 +++++++++++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) diff --git a/src/harness/unittests/transform.ts b/src/harness/unittests/transform.ts index dc90638afd130..6edd174da23d4 100644 --- a/src/harness/unittests/transform.ts +++ b/src/harness/unittests/transform.ts @@ -75,7 +75,7 @@ namespace ts { }).outputText; }); - testBaseline("synthesizedNamespace", () => { + testBaseline("rewrittenNamespace", () => { return ts.transpileModule(`namespace Reflect { const x = 1; }`, { transformers: { before: [forceNamespaceRewrite], @@ -86,7 +86,7 @@ namespace ts { }).outputText; }); - testBaseline("synthesizedNamespaceFollowingClass", () => { + testBaseline("rewrittenNamespaceFollowingClass", () => { return ts.transpileModule(` class C { foo = 10; static bar = 20 } namespace C { export let x = 10; } @@ -101,6 +101,29 @@ namespace ts { }).outputText; }); + testBaseline("synthesizedClassAndNamespaceCombination", () => { + return ts.transpileModule("", { + transformers: { + before: [replaceWithClassAndNamespace], + }, + compilerOptions: { + target: ts.ScriptTarget.ESNext, + newLine: NewLineKind.CarriageReturnLineFeed, + } + }).outputText; + + function replaceWithClassAndNamespace() { + return (sourceFile: ts.SourceFile) => { + const result = getMutableClone(sourceFile); + result.statements = ts.createNodeArray([ + ts.createClassDeclaration(undefined, undefined, "Foo", undefined, undefined, undefined), + ts.createModuleDeclaration(undefined, undefined, createIdentifier("Foo"), createModuleBlock([createEmptyStatement()])) + ]); + return result; + } + } + }); + function forceNamespaceRewrite(context: ts.TransformationContext) { return (sourceFile: ts.SourceFile): ts.SourceFile => { return visitNode(sourceFile); From 33a036b6799f297fcf7b913c3a56385e47026cd6 Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Fri, 11 Aug 2017 18:47:21 -0400 Subject: [PATCH 121/237] Accepted baselines. --- ...mespace.js => transformsCorrectly.rewrittenNamespace.js} | 0 ...transformsCorrectly.rewrittenNamespaceFollowingClass.js} | 0 ...ormsCorrectly.synthesizedClassAndNamespaceCombination.js | 6 ++++++ 3 files changed, 6 insertions(+) rename tests/baselines/reference/transformApi/{transformsCorrectly.synthesizedNamespace.js => transformsCorrectly.rewrittenNamespace.js} (100%) rename tests/baselines/reference/transformApi/{transformsCorrectly.synthesizedNamespaceFollowingClass.js => transformsCorrectly.rewrittenNamespaceFollowingClass.js} (100%) create mode 100644 tests/baselines/reference/transformApi/transformsCorrectly.synthesizedClassAndNamespaceCombination.js diff --git a/tests/baselines/reference/transformApi/transformsCorrectly.synthesizedNamespace.js b/tests/baselines/reference/transformApi/transformsCorrectly.rewrittenNamespace.js similarity index 100% rename from tests/baselines/reference/transformApi/transformsCorrectly.synthesizedNamespace.js rename to tests/baselines/reference/transformApi/transformsCorrectly.rewrittenNamespace.js diff --git a/tests/baselines/reference/transformApi/transformsCorrectly.synthesizedNamespaceFollowingClass.js b/tests/baselines/reference/transformApi/transformsCorrectly.rewrittenNamespaceFollowingClass.js similarity index 100% rename from tests/baselines/reference/transformApi/transformsCorrectly.synthesizedNamespaceFollowingClass.js rename to tests/baselines/reference/transformApi/transformsCorrectly.rewrittenNamespaceFollowingClass.js diff --git a/tests/baselines/reference/transformApi/transformsCorrectly.synthesizedClassAndNamespaceCombination.js b/tests/baselines/reference/transformApi/transformsCorrectly.synthesizedClassAndNamespaceCombination.js new file mode 100644 index 0000000000000..ad11068a5127c --- /dev/null +++ b/tests/baselines/reference/transformApi/transformsCorrectly.synthesizedClassAndNamespaceCombination.js @@ -0,0 +1,6 @@ +class Foo { +} +var Foo; +(function (Foo) { + ; +})(Foo || (Foo = {})); From c272c3c5cd153499ca7d80f5ef114f47f9d938ee Mon Sep 17 00:00:00 2001 From: Ron Buckton Date: Fri, 11 Aug 2017 16:06:24 -0700 Subject: [PATCH 122/237] Comment update --- src/server/protocol.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/server/protocol.ts b/src/server/protocol.ts index c0760dbfd3898..746d9791968be 100644 --- a/src/server/protocol.ts +++ b/src/server/protocol.ts @@ -1306,9 +1306,9 @@ namespace ts.server.protocol { options: ExternalProjectCompilerOptions; /** - * Specifies the project root path used to scope commpiler options. - * This message is ignored if this property has been specified and the server is not - * configured to create an inferred project per project root. + * Specifies the project root path used to scope compiler options. + * It is an error to provide this property if the server has not been started with + * `useInferredProjectPerProjectRoot` enabled. */ projectRootPath?: string; } From 8ca66d318061f6b95d90293413fea98189d84e4d Mon Sep 17 00:00:00 2001 From: Ron Buckton Date: Fri, 11 Aug 2017 16:15:28 -0700 Subject: [PATCH 123/237] PR feedback --- src/compiler/checker.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 29b0420201e73..e0ef3ca82bab2 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -16090,7 +16090,7 @@ namespace ts { } function getJavaScriptClassType(symbol: Symbol): Type | undefined { - if (symbol && isDeclarationOfFunctionOrClassExpression(symbol)) { + if (isDeclarationOfFunctionOrClassExpression(symbol)) { symbol = getSymbolOfNode((symbol.valueDeclaration).initializer); } if (isJavaScriptConstructor(symbol.valueDeclaration)) { From d03d1074eef7981099ad8c21f435123d562b80a9 Mon Sep 17 00:00:00 2001 From: Wesley Wigham Date: Fri, 11 Aug 2017 19:59:43 -0700 Subject: [PATCH 124/237] Make compiler options which map to a flag case-insensitive again (#17755) --- src/compiler/commandLineParser.ts | 4 +-- .../tsconfigMapOptionsAreCaseInsensitive.js | 25 +++++++++++++++++++ ...configMapOptionsAreCaseInsensitive.symbols | 16 ++++++++++++ ...tsconfigMapOptionsAreCaseInsensitive.types | 18 +++++++++++++ .../tsconfigMapOptionsAreCaseInsensitive.ts | 16 ++++++++++++ 5 files changed, 77 insertions(+), 2 deletions(-) create mode 100644 tests/baselines/reference/tsconfigMapOptionsAreCaseInsensitive.js create mode 100644 tests/baselines/reference/tsconfigMapOptionsAreCaseInsensitive.symbols create mode 100644 tests/baselines/reference/tsconfigMapOptionsAreCaseInsensitive.types create mode 100644 tests/cases/compiler/tsconfigMapOptionsAreCaseInsensitive.ts diff --git a/src/compiler/commandLineParser.ts b/src/compiler/commandLineParser.ts index 4dd6d8f6170b6..c92d147f9a93a 100644 --- a/src/compiler/commandLineParser.ts +++ b/src/compiler/commandLineParser.ts @@ -1116,7 +1116,7 @@ namespace ts { if (option && typeof option.type !== "string") { const customOption = option; // Validate custom option type - if (!customOption.type.has(text)) { + if (!customOption.type.has(text.toLowerCase())) { errors.push( createDiagnosticForInvalidCustomType( customOption, @@ -1811,7 +1811,7 @@ namespace ts { return value; } else if (typeof option.type !== "string") { - return option.type.get(value); + return option.type.get(typeof value === "string" ? value.toLowerCase() : value); } return normalizeNonListOptionValue(option, basePath, value); } diff --git a/tests/baselines/reference/tsconfigMapOptionsAreCaseInsensitive.js b/tests/baselines/reference/tsconfigMapOptionsAreCaseInsensitive.js new file mode 100644 index 0000000000000..be1f2323a13b6 --- /dev/null +++ b/tests/baselines/reference/tsconfigMapOptionsAreCaseInsensitive.js @@ -0,0 +1,25 @@ +//// [tests/cases/compiler/tsconfigMapOptionsAreCaseInsensitive.ts] //// + +//// [other.ts] +export default 42; + +//// [index.ts] +import Answer from "./other.js"; +const x = 10 + Answer; +export { + x +}; + +//// [other.js] +define(["require", "exports"], function (require, exports) { + "use strict"; + exports.__esModule = true; + exports["default"] = 42; +}); +//// [index.js] +define(["require", "exports", "./other.js"], function (require, exports, other_js_1) { + "use strict"; + exports.__esModule = true; + var x = 10 + other_js_1["default"]; + exports.x = x; +}); diff --git a/tests/baselines/reference/tsconfigMapOptionsAreCaseInsensitive.symbols b/tests/baselines/reference/tsconfigMapOptionsAreCaseInsensitive.symbols new file mode 100644 index 0000000000000..73a5bad9e56d4 --- /dev/null +++ b/tests/baselines/reference/tsconfigMapOptionsAreCaseInsensitive.symbols @@ -0,0 +1,16 @@ +=== tests/cases/compiler/other.ts === +export default 42; +No type information for this code. +No type information for this code.=== tests/cases/compiler/index.ts === +import Answer from "./other.js"; +>Answer : Symbol(Answer, Decl(index.ts, 0, 6)) + +const x = 10 + Answer; +>x : Symbol(x, Decl(index.ts, 1, 5)) +>Answer : Symbol(Answer, Decl(index.ts, 0, 6)) + +export { + x +>x : Symbol(x, Decl(index.ts, 2, 8)) + +}; diff --git a/tests/baselines/reference/tsconfigMapOptionsAreCaseInsensitive.types b/tests/baselines/reference/tsconfigMapOptionsAreCaseInsensitive.types new file mode 100644 index 0000000000000..d82a1e42e95a8 --- /dev/null +++ b/tests/baselines/reference/tsconfigMapOptionsAreCaseInsensitive.types @@ -0,0 +1,18 @@ +=== tests/cases/compiler/other.ts === +export default 42; +No type information for this code. +No type information for this code.=== tests/cases/compiler/index.ts === +import Answer from "./other.js"; +>Answer : 42 + +const x = 10 + Answer; +>x : number +>10 + Answer : number +>10 : 10 +>Answer : 42 + +export { + x +>x : number + +}; diff --git a/tests/cases/compiler/tsconfigMapOptionsAreCaseInsensitive.ts b/tests/cases/compiler/tsconfigMapOptionsAreCaseInsensitive.ts new file mode 100644 index 0000000000000..d825d6e7425e8 --- /dev/null +++ b/tests/cases/compiler/tsconfigMapOptionsAreCaseInsensitive.ts @@ -0,0 +1,16 @@ +// @filename: tsconfig.json +{ + "compilerOptions": { + "module": "AmD" + } +} + +// @filename: other.ts +export default 42; + +// @filename: index.ts +import Answer from "./other.js"; +const x = 10 + Answer; +export { + x +}; \ No newline at end of file From 903d137cea1dc25556bf2e90fda21f4d416eb72c Mon Sep 17 00:00:00 2001 From: Jan Melcher Date: Tue, 27 Jun 2017 17:22:39 +0200 Subject: [PATCH 125/237] Add missing visitNode call to object literal members Object literal elements that are neither spread elements, nor property assignments would not have visitNode called on them. Therefore, the esnext transformer would not be called on them and their children. Fixes #16765. --- src/compiler/transformers/esnext.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/compiler/transformers/esnext.ts b/src/compiler/transformers/esnext.ts index 8d71016b0519c..3bdcc9e9ee722 100644 --- a/src/compiler/transformers/esnext.ts +++ b/src/compiler/transformers/esnext.ts @@ -158,8 +158,8 @@ namespace ts { return visitEachChild(node, visitor, context); } - function chunkObjectLiteralElements(elements: ReadonlyArray): Expression[] { - let chunkObject: (ShorthandPropertyAssignment | PropertyAssignment)[]; + function chunkObjectLiteralElements(elements: ReadonlyArray): Expression[] { + let chunkObject: ObjectLiteralElementLike[]; const objects: Expression[] = []; for (const e of elements) { if (e.kind === SyntaxKind.SpreadAssignment) { @@ -179,7 +179,7 @@ namespace ts { chunkObject.push(createPropertyAssignment(p.name, visitNode(p.initializer, visitor, isExpression))); } else { - chunkObject.push(e as ShorthandPropertyAssignment); + chunkObject.push(visitNode(e, visitor, isObjectLiteralElementLike)); } } } From 8b4db9875d6eb60a243dc7e20fc51c7c04ab569d Mon Sep 17 00:00:00 2001 From: Jan Melcher Date: Tue, 27 Jun 2017 18:03:16 +0200 Subject: [PATCH 126/237] Add test case for nested object spread / methods See #16765. --- ...preadWithinMethodWithinObjectWithSpread.js | 26 +++++++++++++++++ ...WithinMethodWithinObjectWithSpread.symbols | 24 +++++++++++++++ ...adWithinMethodWithinObjectWithSpread.types | 29 +++++++++++++++++++ ...preadWithinMethodWithinObjectWithSpread.ts | 10 +++++++ 4 files changed, 89 insertions(+) create mode 100644 tests/baselines/reference/objectSpreadWithinMethodWithinObjectWithSpread.js create mode 100644 tests/baselines/reference/objectSpreadWithinMethodWithinObjectWithSpread.symbols create mode 100644 tests/baselines/reference/objectSpreadWithinMethodWithinObjectWithSpread.types create mode 100644 tests/cases/compiler/objectSpreadWithinMethodWithinObjectWithSpread.ts diff --git a/tests/baselines/reference/objectSpreadWithinMethodWithinObjectWithSpread.js b/tests/baselines/reference/objectSpreadWithinMethodWithinObjectWithSpread.js new file mode 100644 index 0000000000000..e16695b655efa --- /dev/null +++ b/tests/baselines/reference/objectSpreadWithinMethodWithinObjectWithSpread.js @@ -0,0 +1,26 @@ +//// [objectSpreadWithinMethodWithinObjectWithSpread.ts] +const obj = {}; +const a = { + ...obj, + prop() { + return { + ...obj, + metadata: 213 + }; + } +}; + + +//// [objectSpreadWithinMethodWithinObjectWithSpread.js] +var __assign = (this && this.__assign) || Object.assign || function(t) { + for (var s, i = 1, n = arguments.length; i < n; i++) { + s = arguments[i]; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) + t[p] = s[p]; + } + return t; +}; +var obj = {}; +var a = __assign({}, obj, { prop: function () { + return __assign({}, obj, { metadata: 213 }); + } }); diff --git a/tests/baselines/reference/objectSpreadWithinMethodWithinObjectWithSpread.symbols b/tests/baselines/reference/objectSpreadWithinMethodWithinObjectWithSpread.symbols new file mode 100644 index 0000000000000..181cacd5e07ef --- /dev/null +++ b/tests/baselines/reference/objectSpreadWithinMethodWithinObjectWithSpread.symbols @@ -0,0 +1,24 @@ +=== tests/cases/compiler/objectSpreadWithinMethodWithinObjectWithSpread.ts === +const obj = {}; +>obj : Symbol(obj, Decl(objectSpreadWithinMethodWithinObjectWithSpread.ts, 0, 5)) + +const a = { +>a : Symbol(a, Decl(objectSpreadWithinMethodWithinObjectWithSpread.ts, 1, 5)) + + ...obj, +>obj : Symbol(obj, Decl(objectSpreadWithinMethodWithinObjectWithSpread.ts, 0, 5)) + + prop() { +>prop : Symbol(prop, Decl(objectSpreadWithinMethodWithinObjectWithSpread.ts, 2, 11)) + + return { + ...obj, +>obj : Symbol(obj, Decl(objectSpreadWithinMethodWithinObjectWithSpread.ts, 0, 5)) + + metadata: 213 +>metadata : Symbol(metadata, Decl(objectSpreadWithinMethodWithinObjectWithSpread.ts, 5, 19)) + + }; + } +}; + diff --git a/tests/baselines/reference/objectSpreadWithinMethodWithinObjectWithSpread.types b/tests/baselines/reference/objectSpreadWithinMethodWithinObjectWithSpread.types new file mode 100644 index 0000000000000..351aa0c374b1a --- /dev/null +++ b/tests/baselines/reference/objectSpreadWithinMethodWithinObjectWithSpread.types @@ -0,0 +1,29 @@ +=== tests/cases/compiler/objectSpreadWithinMethodWithinObjectWithSpread.ts === +const obj = {}; +>obj : {} +>{} : {} + +const a = { +>a : { prop(): { metadata: number; }; } +>{ ...obj, prop() { return { ...obj, metadata: 213 }; }} : { prop(): { metadata: number; }; } + + ...obj, +>obj : {} + + prop() { +>prop : () => { metadata: number; } + + return { +>{ ...obj, metadata: 213 } : { metadata: number; } + + ...obj, +>obj : {} + + metadata: 213 +>metadata : number +>213 : 213 + + }; + } +}; + diff --git a/tests/cases/compiler/objectSpreadWithinMethodWithinObjectWithSpread.ts b/tests/cases/compiler/objectSpreadWithinMethodWithinObjectWithSpread.ts new file mode 100644 index 0000000000000..4d1663bb4568b --- /dev/null +++ b/tests/cases/compiler/objectSpreadWithinMethodWithinObjectWithSpread.ts @@ -0,0 +1,10 @@ +const obj = {}; +const a = { + ...obj, + prop() { + return { + ...obj, + metadata: 213 + }; + } +}; From 1d6863ab0b1f5530828be32240e31787282cd39f Mon Sep 17 00:00:00 2001 From: Tycho Grouwstra Date: Sun, 13 Aug 2017 14:57:23 +0800 Subject: [PATCH 127/237] loosen number index check, fixes #15768 --- src/compiler/checker.ts | 13 ++++++------- tests/baselines/reference/genericNumberIndex.js | 5 +++++ .../baselines/reference/genericNumberIndex.symbols | 6 ++++++ tests/baselines/reference/genericNumberIndex.types | 6 ++++++ tests/cases/compiler/genericNumberIndex.ts | 1 + 5 files changed, 24 insertions(+), 7 deletions(-) create mode 100644 tests/baselines/reference/genericNumberIndex.js create mode 100644 tests/baselines/reference/genericNumberIndex.symbols create mode 100644 tests/baselines/reference/genericNumberIndex.types create mode 100644 tests/cases/compiler/genericNumberIndex.ts diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 903287707503c..a85332d3ded80 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -18758,13 +18758,12 @@ namespace ts { if (isTypeAssignableTo(indexType, getIndexType(objectType))) { return type; } - // Check if we're indexing with a numeric type and the object type is a generic - // type with a constraint that has a numeric index signature. - if (maybeTypeOfKind(objectType, TypeFlags.TypeVariable) && isTypeAssignableToKind(indexType, TypeFlags.NumberLike)) { - const constraint = getBaseConstraintOfType(objectType); - if (constraint && getIndexInfoOfType(constraint, IndexKind.Number)) { - return type; - } + // Check if we're indexing with a numeric type and if either object or index types + // is a generic type with a constraint that has a numeric index signature. + const typeOrConstraint = (tp: Type) => maybeTypeOfKind(tp, TypeFlags.TypeVariable) ? getBaseConstraintOfType(tp) || tp : tp; + if (isTypeAssignableToKind(typeOrConstraint(indexType), TypeFlags.NumberLike) && + getIndexInfoOfType(typeOrConstraint(objectType), IndexKind.Number)) { + return type; } error(accessNode, Diagnostics.Type_0_cannot_be_used_to_index_type_1, typeToString(indexType), typeToString(objectType)); return type; diff --git a/tests/baselines/reference/genericNumberIndex.js b/tests/baselines/reference/genericNumberIndex.js new file mode 100644 index 0000000000000..c332d47001f87 --- /dev/null +++ b/tests/baselines/reference/genericNumberIndex.js @@ -0,0 +1,5 @@ +//// [genericNumberIndex.ts] +type X = ['a'][I]; + + +//// [genericNumberIndex.js] diff --git a/tests/baselines/reference/genericNumberIndex.symbols b/tests/baselines/reference/genericNumberIndex.symbols new file mode 100644 index 0000000000000..88a7f453390f1 --- /dev/null +++ b/tests/baselines/reference/genericNumberIndex.symbols @@ -0,0 +1,6 @@ +=== tests/cases/compiler/genericNumberIndex.ts === +type X = ['a'][I]; +>X : Symbol(X, Decl(genericNumberIndex.ts, 0, 0)) +>I : Symbol(I, Decl(genericNumberIndex.ts, 0, 7)) +>I : Symbol(I, Decl(genericNumberIndex.ts, 0, 7)) + diff --git a/tests/baselines/reference/genericNumberIndex.types b/tests/baselines/reference/genericNumberIndex.types new file mode 100644 index 0000000000000..36e9657a4c921 --- /dev/null +++ b/tests/baselines/reference/genericNumberIndex.types @@ -0,0 +1,6 @@ +=== tests/cases/compiler/genericNumberIndex.ts === +type X = ['a'][I]; +>X : ["a"][I] +>I : I +>I : I + diff --git a/tests/cases/compiler/genericNumberIndex.ts b/tests/cases/compiler/genericNumberIndex.ts new file mode 100644 index 0000000000000..c5aed2d474ec6 --- /dev/null +++ b/tests/cases/compiler/genericNumberIndex.ts @@ -0,0 +1 @@ +type X = ['a'][I]; From dacc851434af9bbf2388a6db1438acabc2d886ef Mon Sep 17 00:00:00 2001 From: Anders Hejlsberg Date: Mon, 14 Aug 2017 09:01:50 +0200 Subject: [PATCH 128/237] No contextual return type when type is circular --- src/compiler/checker.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 07c94bd746e0f..1ba33f8c82bd6 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -6576,6 +6576,10 @@ namespace ts { return signature.resolvedReturnType; } + function isResolvingReturnTypeOfSignature(signature: Signature) { + return !signature.resolvedReturnType && findResolutionCycleStartIndex(signature, TypeSystemPropertyName.ResolvedReturnType) >= 0; + } + function getRestTypeOfSignature(signature: Signature): Type { if (signature.hasRestParameter) { const type = getTypeOfSymbol(lastOrUndefined(signature.parameters)); @@ -12949,7 +12953,7 @@ namespace ts { // Otherwise, if the containing function is contextually typed by a function type with exactly one call signature // and that call signature is non-generic, return statements are contextually typed by the return type of the signature const signature = getContextualSignatureForFunctionLikeDeclaration(functionDecl); - if (signature) { + if (signature && !isResolvingReturnTypeOfSignature(signature)) { return getReturnTypeOfSignature(signature); } From 57705fc4e098cca776f5ee09f92c93f650baa76a Mon Sep 17 00:00:00 2001 From: Anders Hejlsberg Date: Mon, 14 Aug 2017 09:08:11 +0200 Subject: [PATCH 129/237] Add regression test --- .../reference/circularContextualReturnType.js | 18 +++++++++++++++ .../circularContextualReturnType.symbols | 19 +++++++++++++++ .../circularContextualReturnType.types | 23 +++++++++++++++++++ .../compiler/circularContextualReturnType.ts | 9 ++++++++ 4 files changed, 69 insertions(+) create mode 100644 tests/baselines/reference/circularContextualReturnType.js create mode 100644 tests/baselines/reference/circularContextualReturnType.symbols create mode 100644 tests/baselines/reference/circularContextualReturnType.types create mode 100644 tests/cases/compiler/circularContextualReturnType.ts diff --git a/tests/baselines/reference/circularContextualReturnType.js b/tests/baselines/reference/circularContextualReturnType.js new file mode 100644 index 0000000000000..d68f25494a89c --- /dev/null +++ b/tests/baselines/reference/circularContextualReturnType.js @@ -0,0 +1,18 @@ +//// [circularContextualReturnType.ts] +// Repro from #17711 + +Object.freeze({ + foo() { + return Object.freeze('a'); + }, +}); + + +//// [circularContextualReturnType.js] +"use strict"; +// Repro from #17711 +Object.freeze({ + foo: function () { + return Object.freeze('a'); + } +}); diff --git a/tests/baselines/reference/circularContextualReturnType.symbols b/tests/baselines/reference/circularContextualReturnType.symbols new file mode 100644 index 0000000000000..d0e81a6b33d35 --- /dev/null +++ b/tests/baselines/reference/circularContextualReturnType.symbols @@ -0,0 +1,19 @@ +=== tests/cases/compiler/circularContextualReturnType.ts === +// Repro from #17711 + +Object.freeze({ +>Object.freeze : Symbol(ObjectConstructor.freeze, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Object : Symbol(Object, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>freeze : Symbol(ObjectConstructor.freeze, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) + + foo() { +>foo : Symbol(foo, Decl(circularContextualReturnType.ts, 2, 15)) + + return Object.freeze('a'); +>Object.freeze : Symbol(ObjectConstructor.freeze, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Object : Symbol(Object, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>freeze : Symbol(ObjectConstructor.freeze, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) + + }, +}); + diff --git a/tests/baselines/reference/circularContextualReturnType.types b/tests/baselines/reference/circularContextualReturnType.types new file mode 100644 index 0000000000000..d32640d2cd970 --- /dev/null +++ b/tests/baselines/reference/circularContextualReturnType.types @@ -0,0 +1,23 @@ +=== tests/cases/compiler/circularContextualReturnType.ts === +// Repro from #17711 + +Object.freeze({ +>Object.freeze({ foo() { return Object.freeze('a'); },}) : Readonly<{ foo(): string; }> +>Object.freeze : { (a: T[]): ReadonlyArray; (f: T): T; (o: T): Readonly; } +>Object : ObjectConstructor +>freeze : { (a: T[]): ReadonlyArray; (f: T): T; (o: T): Readonly; } +>{ foo() { return Object.freeze('a'); },} : { foo(): string; } + + foo() { +>foo : () => string + + return Object.freeze('a'); +>Object.freeze('a') : string +>Object.freeze : { (a: T[]): ReadonlyArray; (f: T): T; (o: T): Readonly; } +>Object : ObjectConstructor +>freeze : { (a: T[]): ReadonlyArray; (f: T): T; (o: T): Readonly; } +>'a' : "a" + + }, +}); + diff --git a/tests/cases/compiler/circularContextualReturnType.ts b/tests/cases/compiler/circularContextualReturnType.ts new file mode 100644 index 0000000000000..1b356aff160de --- /dev/null +++ b/tests/cases/compiler/circularContextualReturnType.ts @@ -0,0 +1,9 @@ +// @strict: true + +// Repro from #17711 + +Object.freeze({ + foo() { + return Object.freeze('a'); + }, +}); From 4268e13cde69c1d8a48788ef91d3b16669076522 Mon Sep 17 00:00:00 2001 From: Tycho Grouwstra Date: Mon, 14 Aug 2017 17:45:18 +0800 Subject: [PATCH 130/237] simplify fix as suggested by @ahejlsberg --- src/compiler/checker.ts | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index a85332d3ded80..9b274c469567a 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -18760,9 +18760,7 @@ namespace ts { } // Check if we're indexing with a numeric type and if either object or index types // is a generic type with a constraint that has a numeric index signature. - const typeOrConstraint = (tp: Type) => maybeTypeOfKind(tp, TypeFlags.TypeVariable) ? getBaseConstraintOfType(tp) || tp : tp; - if (isTypeAssignableToKind(typeOrConstraint(indexType), TypeFlags.NumberLike) && - getIndexInfoOfType(typeOrConstraint(objectType), IndexKind.Number)) { + if (getIndexInfoOfType(getApparentType(objectType), IndexKind.Number) && isTypeAssignableToKind(indexType, TypeFlags.NumberLike)) { return type; } error(accessNode, Diagnostics.Type_0_cannot_be_used_to_index_type_1, typeToString(indexType), typeToString(objectType)); From 543e0affff2c844a7e4596f55f7a396e6694dfaf Mon Sep 17 00:00:00 2001 From: Andy Date: Mon, 14 Aug 2017 09:20:48 -0700 Subject: [PATCH 131/237] Make exportSymbol public (#17457) * Make exportSymbol public * Add a `getExportSymbolOfSymbol` method * Use own implementation instead of delegating to `getExportSymbolOfValueSymbolIfExported` --- src/compiler/checker.ts | 3 +++ src/compiler/types.ts | 9 +++++++++ 2 files changed, 12 insertions(+) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 903287707503c..402674908b5ed 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -138,6 +138,9 @@ namespace ts { node = getParseTreeNode(node, isExportSpecifier); return node ? getExportSpecifierLocalTargetSymbol(node) : undefined; }, + getExportSymbolOfSymbol(symbol) { + return getMergedSymbol(symbol.exportSymbol || symbol); + }, getTypeAtLocation: node => { node = getParseTreeNode(node); return node ? getTypeOfNode(node) : unknownType; diff --git a/src/compiler/types.ts b/src/compiler/types.ts index 0a09bb5b6ecba..2b3e5ab36df79 100644 --- a/src/compiler/types.ts +++ b/src/compiler/types.ts @@ -2568,6 +2568,15 @@ namespace ts { getSymbolsOfParameterPropertyDeclaration(parameter: ParameterDeclaration, parameterName: string): Symbol[]; getShorthandAssignmentValueSymbol(location: Node): Symbol | undefined; getExportSpecifierLocalTargetSymbol(location: ExportSpecifier): Symbol | undefined; + /** + * If a symbol is a local symbol with an associated exported symbol, returns the exported symbol. + * Otherwise returns its input. + * For example, at `export type T = number;`: + * - `getSymbolAtLocation` at the location `T` will return the exported symbol for `T`. + * - But the result of `getSymbolsInScope` will contain the *local* symbol for `T`, not the exported symbol. + * - Calling `getExportSymbolOfSymbol` on that local symbol will return the exported symbol. + */ + getExportSymbolOfSymbol(symbol: Symbol): Symbol; getPropertySymbolOfDestructuringAssignment(location: Identifier): Symbol | undefined; getTypeAtLocation(node: Node): Type; getTypeFromTypeNode(node: TypeNode): Type; From 760812f7143ccc311746e0c3eac191d2905722c9 Mon Sep 17 00:00:00 2001 From: uniqueiniquity Date: Mon, 14 Aug 2017 09:27:45 -0700 Subject: [PATCH 132/237] Add explanatory comments, consolidate main body --- src/services/outliningElementsCollector.ts | 18 +++++++++++------- .../fourslash/getOutliningForObjectsInArray.ts | 8 ++++---- 2 files changed, 15 insertions(+), 11 deletions(-) diff --git a/src/services/outliningElementsCollector.ts b/src/services/outliningElementsCollector.ts index edebf98a24bc4..cdeba21b32bc4 100644 --- a/src/services/outliningElementsCollector.ts +++ b/src/services/outliningElementsCollector.ts @@ -3,11 +3,17 @@ namespace ts.OutliningElementsCollector { export function collectElements(sourceFile: SourceFile, cancellationToken: CancellationToken): OutliningSpan[] { const elements: OutliningSpan[] = []; const collapseText = "..."; + let depth = 0; + const maxDepth = 20; + + walk(sourceFile); + return elements; - function addOutliningSpan(hintSpanNode: Node, startElement: Node, endElement: Node, autoCollapse: boolean, fullStart: boolean) { + // If useFullStart is true, then the collapsing span includes leading whitespace, including linebreaks. + function addOutliningSpan(hintSpanNode: Node, startElement: Node, endElement: Node, autoCollapse: boolean, useFullStart: boolean) { if (hintSpanNode && startElement && endElement) { const span: OutliningSpan = { - textSpan: createTextSpanFromBounds(fullStart ? startElement.pos : startElement.getStart(), endElement.end), + textSpan: createTextSpanFromBounds(useFullStart ? startElement.pos : startElement.getStart(), endElement.end), hintSpan: createTextSpanFromBounds(startElement.getStart(), endElement.end), bannerText: collapseText, autoCollapse, @@ -82,8 +88,6 @@ namespace ts.OutliningElementsCollector { return isFunctionBlock(node) && node.parent.kind !== SyntaxKind.ArrowFunction; } - let depth = 0; - const maxDepth = 20; function walk(n: Node): void { cancellationToken.throwIfCancellationRequested(); if (depth > maxDepth) { @@ -163,6 +167,9 @@ namespace ts.OutliningElementsCollector { addOutliningSpan(n, openBrace, closeBrace, autoCollapse(n), /* fullStart */ true); break; } + // If the block has no leading keywords and is a member of an array literal, + // we again want to only collapse the span of the block. + // Otherwise, the collapsed section will include the end of the previous line. case SyntaxKind.ObjectLiteralExpression: const openBrace = findChildOfKind(n, SyntaxKind.OpenBraceToken, sourceFile); const closeBrace = findChildOfKind(n, SyntaxKind.CloseBraceToken, sourceFile); @@ -178,8 +185,5 @@ namespace ts.OutliningElementsCollector { forEachChild(n, walk); depth--; } - - walk(sourceFile); - return elements; } } \ No newline at end of file diff --git a/tests/cases/fourslash/getOutliningForObjectsInArray.ts b/tests/cases/fourslash/getOutliningForObjectsInArray.ts index 2d57d3335bdf1..896342248328a 100644 --- a/tests/cases/fourslash/getOutliningForObjectsInArray.ts +++ b/tests/cases/fourslash/getOutliningForObjectsInArray.ts @@ -1,13 +1,13 @@ /// -////// objects in x should generate outlining spans that do not render in VS +// objects in x should generate outlining spans that do not render in VS //// const x =[| [ //// [|{ a: 0 }|], //// [|{ b: 1 }|], //// [|{ c: 2 }|] //// ]|]; //// -////// objects in y should generate outlining spans that render as expected +// objects in y should generate outlining spans that render as expected //// const y =[| [ //// [|{ //// a: 0 @@ -20,7 +20,7 @@ //// }|] //// ]|]; //// -////// same behavior for nested arrays +// same behavior for nested arrays //// const w =[| [ //// [|[ 0 ]|], //// [|[ 1 ]|], @@ -39,7 +39,7 @@ //// ]|] //// ]|]; //// -////// multiple levels of nesting work as expected +// multiple levels of nesting work as expected //// const z =[| [ //// [|[ //// [|{ hello: 0 }|] From e2f35eceadcc62b75114e3fcc0dbf3dc23d37b25 Mon Sep 17 00:00:00 2001 From: Wesley Wigham Date: Mon, 14 Aug 2017 10:11:49 -0700 Subject: [PATCH 133/237] Accept missing baseline updates for #13721 --- .../reference/errorForUsingPropertyOfTypeAsType01.js | 2 +- .../baselines/reference/exportDefaultClassInNamespace.js | 4 ++-- .../baselines/reference/expressionTypeNodeShouldError.js | 6 +++--- .../reference/importCallExpressionAsyncES3AMD.js | 4 ++-- .../reference/importCallExpressionAsyncES3CJS.js | 4 ++-- .../reference/importCallExpressionAsyncES3System.js | 4 ++-- .../reference/importCallExpressionAsyncES3UMD.js | 4 ++-- .../reference/importCallExpressionAsyncES5AMD.js | 4 ++-- .../reference/importCallExpressionAsyncES5CJS.js | 4 ++-- .../reference/importCallExpressionAsyncES5System.js | 4 ++-- .../reference/importCallExpressionAsyncES5UMD.js | 4 ++-- tests/baselines/reference/importCallExpressionES5AMD.js | 4 ++-- tests/baselines/reference/importCallExpressionES5CJS.js | 4 ++-- .../baselines/reference/importCallExpressionES5System.js | 4 ++-- tests/baselines/reference/importCallExpressionES5UMD.js | 4 ++-- tests/baselines/reference/jsdocTypeTagCast.js | 6 +++--- tests/baselines/reference/mappedTypePartialConstraints.js | 4 ++-- tests/baselines/reference/mergedDeclarationExports.js | 2 +- tests/baselines/reference/mixingApparentTypeOverrides.js | 8 ++++---- tests/baselines/reference/noUnusedLocals_selfReference.js | 6 +++--- tests/baselines/reference/promiseDefinitionTest.js | 2 +- .../signatureInstantiationWithRecursiveConstraints.js | 4 ++-- 22 files changed, 46 insertions(+), 46 deletions(-) diff --git a/tests/baselines/reference/errorForUsingPropertyOfTypeAsType01.js b/tests/baselines/reference/errorForUsingPropertyOfTypeAsType01.js index 26903a97989da..78e65bca40007 100644 --- a/tests/baselines/reference/errorForUsingPropertyOfTypeAsType01.js +++ b/tests/baselines/reference/errorForUsingPropertyOfTypeAsType01.js @@ -52,7 +52,7 @@ var Test1; })(Test1 || (Test1 = {})); var Test2; (function (Test2) { - var Foo = (function () { + var Foo = /** @class */ (function () { function Foo() { } return Foo; diff --git a/tests/baselines/reference/exportDefaultClassInNamespace.js b/tests/baselines/reference/exportDefaultClassInNamespace.js index 641e5ed61a513..47ecf64a303df 100644 --- a/tests/baselines/reference/exportDefaultClassInNamespace.js +++ b/tests/baselines/reference/exportDefaultClassInNamespace.js @@ -11,7 +11,7 @@ namespace ns_abstract_class { //// [exportDefaultClassInNamespace.js] var ns_class; (function (ns_class) { - var default_1 = (function () { + var default_1 = /** @class */ (function () { function default_1() { } return default_1; @@ -20,7 +20,7 @@ var ns_class; })(ns_class || (ns_class = {})); var ns_abstract_class; (function (ns_abstract_class) { - var default_2 = (function () { + var default_2 = /** @class */ (function () { function default_2() { } return default_2; diff --git a/tests/baselines/reference/expressionTypeNodeShouldError.js b/tests/baselines/reference/expressionTypeNodeShouldError.js index 80f9f82145af1..73850a6a6c6ba 100644 --- a/tests/baselines/reference/expressionTypeNodeShouldError.js +++ b/tests/baselines/reference/expressionTypeNodeShouldError.js @@ -48,7 +48,7 @@ type ItemType3 = true.typeof(nodes.item(0)); //// [string.js] -var C = (function () { +var C = /** @class */ (function () { function C() { } C.prototype.foo = function () { @@ -60,7 +60,7 @@ var C = (function () { var nodes = document.getElementsByTagName("li"); typeof (nodes.item(0)); //// [number.js] -var C2 = (function () { +var C2 = /** @class */ (function () { function C2() { } C2.prototype.foo = function () { @@ -72,7 +72,7 @@ var C2 = (function () { var nodes2 = document.getElementsByTagName("li"); typeof (nodes.item(0)); //// [boolean.js] -var C3 = (function () { +var C3 = /** @class */ (function () { function C3() { } C3.prototype.foo = function () { diff --git a/tests/baselines/reference/importCallExpressionAsyncES3AMD.js b/tests/baselines/reference/importCallExpressionAsyncES3AMD.js index f0246f4ce5e86..90465c0e6e483 100644 --- a/tests/baselines/reference/importCallExpressionAsyncES3AMD.js +++ b/tests/baselines/reference/importCallExpressionAsyncES3AMD.js @@ -83,7 +83,7 @@ define(["require", "exports"], function (require, exports) { }); } exports.fn = fn; - var cl1 = (function () { + var cl1 = /** @class */ (function () { function cl1() { } cl1.prototype.m = function () { @@ -117,7 +117,7 @@ define(["require", "exports"], function (require, exports) { }); }); } }; - var cl2 = (function () { + var cl2 = /** @class */ (function () { function cl2() { var _this = this; this.p = { diff --git a/tests/baselines/reference/importCallExpressionAsyncES3CJS.js b/tests/baselines/reference/importCallExpressionAsyncES3CJS.js index 6b4006e05be0a..8c3c0d1da6fc4 100644 --- a/tests/baselines/reference/importCallExpressionAsyncES3CJS.js +++ b/tests/baselines/reference/importCallExpressionAsyncES3CJS.js @@ -82,7 +82,7 @@ function fn() { }); } exports.fn = fn; -var cl1 = (function () { +var cl1 = /** @class */ (function () { function cl1() { } cl1.prototype.m = function () { @@ -116,7 +116,7 @@ exports.obj = { }); }); } }; -var cl2 = (function () { +var cl2 = /** @class */ (function () { function cl2() { var _this = this; this.p = { diff --git a/tests/baselines/reference/importCallExpressionAsyncES3System.js b/tests/baselines/reference/importCallExpressionAsyncES3System.js index 542ce1080396f..c55d8788c982e 100644 --- a/tests/baselines/reference/importCallExpressionAsyncES3System.js +++ b/tests/baselines/reference/importCallExpressionAsyncES3System.js @@ -87,7 +87,7 @@ System.register([], function (exports_1, context_1) { return { setters: [], execute: function () { - cl1 = (function () { + cl1 = /** @class */ (function () { function cl1() { } cl1.prototype.m = function () { @@ -121,7 +121,7 @@ System.register([], function (exports_1, context_1) { }); }); } }); - cl2 = (function () { + cl2 = /** @class */ (function () { function cl2() { var _this = this; this.p = { diff --git a/tests/baselines/reference/importCallExpressionAsyncES3UMD.js b/tests/baselines/reference/importCallExpressionAsyncES3UMD.js index 4404cad5937a2..fce2af411e035 100644 --- a/tests/baselines/reference/importCallExpressionAsyncES3UMD.js +++ b/tests/baselines/reference/importCallExpressionAsyncES3UMD.js @@ -92,7 +92,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) { }); } exports.fn = fn; - var cl1 = (function () { + var cl1 = /** @class */ (function () { function cl1() { } cl1.prototype.m = function () { @@ -126,7 +126,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) { }); }); } }; - var cl2 = (function () { + var cl2 = /** @class */ (function () { function cl2() { var _this = this; this.p = { diff --git a/tests/baselines/reference/importCallExpressionAsyncES5AMD.js b/tests/baselines/reference/importCallExpressionAsyncES5AMD.js index 8e7b2005e787b..3bad6ffa1f551 100644 --- a/tests/baselines/reference/importCallExpressionAsyncES5AMD.js +++ b/tests/baselines/reference/importCallExpressionAsyncES5AMD.js @@ -83,7 +83,7 @@ define(["require", "exports"], function (require, exports) { }); } exports.fn = fn; - var cl1 = (function () { + var cl1 = /** @class */ (function () { function cl1() { } cl1.prototype.m = function () { @@ -117,7 +117,7 @@ define(["require", "exports"], function (require, exports) { }); }); } }; - var cl2 = (function () { + var cl2 = /** @class */ (function () { function cl2() { var _this = this; this.p = { diff --git a/tests/baselines/reference/importCallExpressionAsyncES5CJS.js b/tests/baselines/reference/importCallExpressionAsyncES5CJS.js index 2e04783fa89d6..87499670f3a27 100644 --- a/tests/baselines/reference/importCallExpressionAsyncES5CJS.js +++ b/tests/baselines/reference/importCallExpressionAsyncES5CJS.js @@ -82,7 +82,7 @@ function fn() { }); } exports.fn = fn; -var cl1 = (function () { +var cl1 = /** @class */ (function () { function cl1() { } cl1.prototype.m = function () { @@ -116,7 +116,7 @@ exports.obj = { }); }); } }; -var cl2 = (function () { +var cl2 = /** @class */ (function () { function cl2() { var _this = this; this.p = { diff --git a/tests/baselines/reference/importCallExpressionAsyncES5System.js b/tests/baselines/reference/importCallExpressionAsyncES5System.js index b7d89d158b178..b9fad57455000 100644 --- a/tests/baselines/reference/importCallExpressionAsyncES5System.js +++ b/tests/baselines/reference/importCallExpressionAsyncES5System.js @@ -87,7 +87,7 @@ System.register([], function (exports_1, context_1) { return { setters: [], execute: function () { - cl1 = (function () { + cl1 = /** @class */ (function () { function cl1() { } cl1.prototype.m = function () { @@ -121,7 +121,7 @@ System.register([], function (exports_1, context_1) { }); }); } }); - cl2 = (function () { + cl2 = /** @class */ (function () { function cl2() { var _this = this; this.p = { diff --git a/tests/baselines/reference/importCallExpressionAsyncES5UMD.js b/tests/baselines/reference/importCallExpressionAsyncES5UMD.js index 102d78cfa0592..a3b3e74db6bb4 100644 --- a/tests/baselines/reference/importCallExpressionAsyncES5UMD.js +++ b/tests/baselines/reference/importCallExpressionAsyncES5UMD.js @@ -92,7 +92,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) { }); } exports.fn = fn; - var cl1 = (function () { + var cl1 = /** @class */ (function () { function cl1() { } cl1.prototype.m = function () { @@ -126,7 +126,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) { }); }); } }; - var cl2 = (function () { + var cl2 = /** @class */ (function () { function cl2() { var _this = this; this.p = { diff --git a/tests/baselines/reference/importCallExpressionES5AMD.js b/tests/baselines/reference/importCallExpressionES5AMD.js index 8fa22d81dc9ae..eec2f378ac095 100644 --- a/tests/baselines/reference/importCallExpressionES5AMD.js +++ b/tests/baselines/reference/importCallExpressionES5AMD.js @@ -48,7 +48,7 @@ define(["require", "exports"], function (require, exports) { function foo() { var p2 = new Promise(function (resolve_4, reject_4) { require(["./0"], resolve_4, reject_4); }); } - var C = (function () { + var C = /** @class */ (function () { function C() { } C.prototype.method = function () { @@ -56,7 +56,7 @@ define(["require", "exports"], function (require, exports) { }; return C; }()); - var D = (function () { + var D = /** @class */ (function () { function D() { } D.prototype.method = function () { diff --git a/tests/baselines/reference/importCallExpressionES5CJS.js b/tests/baselines/reference/importCallExpressionES5CJS.js index 2cf5d3157e21b..521044a10ceb7 100644 --- a/tests/baselines/reference/importCallExpressionES5CJS.js +++ b/tests/baselines/reference/importCallExpressionES5CJS.js @@ -45,7 +45,7 @@ exports.p2 = Promise.resolve().then(function () { return require("./0"); }); function foo() { var p2 = Promise.resolve().then(function () { return require("./0"); }); } -var C = (function () { +var C = /** @class */ (function () { function C() { } C.prototype.method = function () { @@ -53,7 +53,7 @@ var C = (function () { }; return C; }()); -var D = (function () { +var D = /** @class */ (function () { function D() { } D.prototype.method = function () { diff --git a/tests/baselines/reference/importCallExpressionES5System.js b/tests/baselines/reference/importCallExpressionES5System.js index 3dabfce80c9ab..def99752bb1b1 100644 --- a/tests/baselines/reference/importCallExpressionES5System.js +++ b/tests/baselines/reference/importCallExpressionES5System.js @@ -57,7 +57,7 @@ System.register([], function (exports_1, context_1) { return zero.foo(); }); exports_1("p2", p2 = context_1.import("./0")); - C = (function () { + C = /** @class */ (function () { function C() { } C.prototype.method = function () { @@ -65,7 +65,7 @@ System.register([], function (exports_1, context_1) { }; return C; }()); - D = (function () { + D = /** @class */ (function () { function D() { } D.prototype.method = function () { diff --git a/tests/baselines/reference/importCallExpressionES5UMD.js b/tests/baselines/reference/importCallExpressionES5UMD.js index 5727744aa7129..0ca61909ddc0c 100644 --- a/tests/baselines/reference/importCallExpressionES5UMD.js +++ b/tests/baselines/reference/importCallExpressionES5UMD.js @@ -65,7 +65,7 @@ export class D { function foo() { var p2 = __syncRequire ? Promise.resolve().then(function () { return require("./0"); }) : new Promise(function (resolve_4, reject_4) { require(["./0"], resolve_4, reject_4); }); } - var C = (function () { + var C = /** @class */ (function () { function C() { } C.prototype.method = function () { @@ -73,7 +73,7 @@ export class D { }; return C; }()); - var D = (function () { + var D = /** @class */ (function () { function D() { } D.prototype.method = function () { diff --git a/tests/baselines/reference/jsdocTypeTagCast.js b/tests/baselines/reference/jsdocTypeTagCast.js index efada5ee4dc88..65e46c97757c9 100644 --- a/tests/baselines/reference/jsdocTypeTagCast.js +++ b/tests/baselines/reference/jsdocTypeTagCast.js @@ -98,13 +98,13 @@ var a; var s; var a = ("" + 4); var s = "" + /** @type {*} */ (4); -var SomeBase = (function () { +var SomeBase = /** @class */ (function () { function SomeBase() { this.p = 42; } return SomeBase; }()); -var SomeDerived = (function (_super) { +var SomeDerived = /** @class */ (function (_super) { __extends(SomeDerived, _super); function SomeDerived() { var _this = _super.call(this) || this; @@ -113,7 +113,7 @@ var SomeDerived = (function (_super) { } return SomeDerived; }(SomeBase)); -var SomeOther = (function () { +var SomeOther = /** @class */ (function () { function SomeOther() { this.q = 42; } diff --git a/tests/baselines/reference/mappedTypePartialConstraints.js b/tests/baselines/reference/mappedTypePartialConstraints.js index 1c83e2506dd0c..505a4eff9cbe0 100644 --- a/tests/baselines/reference/mappedTypePartialConstraints.js +++ b/tests/baselines/reference/mappedTypePartialConstraints.js @@ -28,13 +28,13 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -var MyClass = (function () { +var MyClass = /** @class */ (function () { function MyClass() { } MyClass.prototype.doIt = function (data) { }; return MyClass; }()); -var MySubClass = (function (_super) { +var MySubClass = /** @class */ (function (_super) { __extends(MySubClass, _super); function MySubClass() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/mergedDeclarationExports.js b/tests/baselines/reference/mergedDeclarationExports.js index 068f7b683c349..aefdc6728c520 100644 --- a/tests/baselines/reference/mergedDeclarationExports.js +++ b/tests/baselines/reference/mergedDeclarationExports.js @@ -28,7 +28,7 @@ export namespace N {} exports.__esModule = true; exports.b = 1; exports.t = 0; -var d = (function () { +var d = /** @class */ (function () { function d() { } return d; diff --git a/tests/baselines/reference/mixingApparentTypeOverrides.js b/tests/baselines/reference/mixingApparentTypeOverrides.js index 20db894abb8d1..160a2ba3f0b1b 100644 --- a/tests/baselines/reference/mixingApparentTypeOverrides.js +++ b/tests/baselines/reference/mixingApparentTypeOverrides.js @@ -40,7 +40,7 @@ var __extends = (this && this.__extends) || (function () { }; })(); function Tagged(Base) { - return (function (_super) { + return /** @class */ (function (_super) { __extends(class_1, _super); function class_1() { var args = []; @@ -54,7 +54,7 @@ function Tagged(Base) { return class_1; }(Base)); } -var A = (function () { +var A = /** @class */ (function () { function A() { } A.prototype.toString = function () { @@ -62,7 +62,7 @@ var A = (function () { }; return A; }()); -var B = (function (_super) { +var B = /** @class */ (function (_super) { __extends(B, _super); function B() { return _super !== null && _super.apply(this, arguments) || this; @@ -72,7 +72,7 @@ var B = (function (_super) { }; return B; }(Tagged(A))); -var C = (function (_super) { +var C = /** @class */ (function (_super) { __extends(C, _super); function C() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/tests/baselines/reference/noUnusedLocals_selfReference.js b/tests/baselines/reference/noUnusedLocals_selfReference.js index 74a39923d574f..5f206fbc3dc46 100644 --- a/tests/baselines/reference/noUnusedLocals_selfReference.js +++ b/tests/baselines/reference/noUnusedLocals_selfReference.js @@ -20,7 +20,7 @@ P; "use strict"; exports.__esModule = true; function f() { f; } -var C = (function () { +var C = /** @class */ (function () { function C() { } C.prototype.m = function () { C; }; @@ -33,14 +33,14 @@ var E; })(E || (E = {})); // Does not detect mutual recursion. function g() { D; } -var D = (function () { +var D = /** @class */ (function () { function D() { } D.prototype.m = function () { g; }; return D; }()); // Does not work on private methods. -var P = (function () { +var P = /** @class */ (function () { function P() { } P.prototype.m = function () { this.m; }; diff --git a/tests/baselines/reference/promiseDefinitionTest.js b/tests/baselines/reference/promiseDefinitionTest.js index 317e15c99caeb..892e3c6487efe 100644 --- a/tests/baselines/reference/promiseDefinitionTest.js +++ b/tests/baselines/reference/promiseDefinitionTest.js @@ -40,7 +40,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) { if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; } }; -var Promise = (function () { +var Promise = /** @class */ (function () { function Promise() { } return Promise; diff --git a/tests/baselines/reference/signatureInstantiationWithRecursiveConstraints.js b/tests/baselines/reference/signatureInstantiationWithRecursiveConstraints.js index 0be7fa1444d00..358376ce76cdc 100644 --- a/tests/baselines/reference/signatureInstantiationWithRecursiveConstraints.js +++ b/tests/baselines/reference/signatureInstantiationWithRecursiveConstraints.js @@ -15,13 +15,13 @@ const myVar: Foo = new Bar(); //// [signatureInstantiationWithRecursiveConstraints.js] "use strict"; // Repro from #17148 -var Foo = (function () { +var Foo = /** @class */ (function () { function Foo() { } Foo.prototype.myFunc = function (arg) { }; return Foo; }()); -var Bar = (function () { +var Bar = /** @class */ (function () { function Bar() { } Bar.prototype.myFunc = function (arg) { }; From 80a7ed9a426d4afe8f806770339c2e87e785f4a9 Mon Sep 17 00:00:00 2001 From: Andy Date: Mon, 14 Aug 2017 13:42:15 -0700 Subject: [PATCH 134/237] Fixes to session's handling of empty results (#17728) * Fixes to session's handling of empty results * Fix emptyArray -> undefined --- src/server/session.ts | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/src/server/session.ts b/src/server/session.ts index 80909362989a9..4122408cfa6bb 100644 --- a/src/server/session.ts +++ b/src/server/session.ts @@ -626,7 +626,7 @@ namespace ts.server { const definitions = project.getLanguageService().getTypeDefinitionAtPosition(file, position); if (!definitions) { - return undefined; + return emptyArray; } return definitions.map(def => { @@ -716,7 +716,7 @@ namespace ts.server { const documentHighlights = project.getLanguageService().getDocumentHighlights(file, position, args.filesToSearch); if (!documentHighlights) { - return undefined; + return emptyArray; } if (simplifiedResult) { @@ -903,7 +903,7 @@ namespace ts.server { } } - private getReferences(args: protocol.FileLocationRequestArgs, simplifiedResult: boolean): protocol.ReferencesResponseBody | ReadonlyArray { + private getReferences(args: protocol.FileLocationRequestArgs, simplifiedResult: boolean): protocol.ReferencesResponseBody | undefined | ReadonlyArray { const file = toNormalizedPath(args.file); const projects = this.getProjects(args); @@ -913,7 +913,7 @@ namespace ts.server { if (simplifiedResult) { const nameInfo = defaultProject.getLanguageService().getQuickInfoAtPosition(file, position); if (!nameInfo) { - return emptyArray; + return undefined; } const displayString = displayPartsToString(nameInfo.displayParts); @@ -1167,7 +1167,7 @@ namespace ts.server { }); } - private getCompletions(args: protocol.CompletionsRequestArgs, simplifiedResult: boolean): ReadonlyArray | CompletionInfo { + private getCompletions(args: protocol.CompletionsRequestArgs, simplifiedResult: boolean): ReadonlyArray | CompletionInfo | undefined { const prefix = args.prefix || ""; const { file, project } = this.getFileAndProject(args); @@ -1175,11 +1175,8 @@ namespace ts.server { const position = this.getPosition(args, scriptInfo); const completions = project.getLanguageService().getCompletionsAtPosition(file, position); - if (!completions) { - return emptyArray; - } if (simplifiedResult) { - return mapDefined(completions.entries, entry => { + return mapDefined(completions && completions.entries, entry => { if (completions.isMemberCompletion || (entry.name.toLowerCase().indexOf(prefix.toLowerCase()) === 0)) { const { name, kind, kindModifiers, sortText, replacementSpan } = entry; const convertedSpan = replacementSpan ? this.decorateSpan(replacementSpan, scriptInfo) : undefined; From a51397e339c35cf8466460ee014c7100ea266c95 Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Mon, 14 Aug 2017 21:24:30 -0400 Subject: [PATCH 135/237] Just track the local names of identifiers instead of ever using symbols. --- src/compiler/transformers/ts.ts | 47 +++++++++++++++++++++------------ src/compiler/types.ts | 2 +- 2 files changed, 31 insertions(+), 18 deletions(-) diff --git a/src/compiler/transformers/ts.ts b/src/compiler/transformers/ts.ts index 89693c0d22ab8..df07082766743 100644 --- a/src/compiler/transformers/ts.ts +++ b/src/compiler/transformers/ts.ts @@ -151,7 +151,17 @@ namespace ts { break; } - recordEmittedDeclarationInScope(node); + // Record these declarations provided that they have a name. + if ((node as ClassDeclaration | FunctionDeclaration).name) { + recordEmittedDeclarationInScope(node as ClassDeclaration | FunctionDeclaration); + } + else { + // These nodes should always have names unless they are default-exports; + // however, class declaration parsing allows for undefined names, so syntactically invalid + // programs may also have an undefined name. + Debug.assert(node.kind === SyntaxKind.ClassDeclaration || hasModifier(node, ModifierFlags.Default)); + } + break; } } @@ -2640,16 +2650,14 @@ namespace ts { * Records that a declaration was emitted in the current scope, if it was the first * declaration for the provided symbol. */ - function recordEmittedDeclarationInScope(node: Node) { - const name = node.symbol && node.symbol.escapedName; - if (name) { - if (!currentScopeFirstDeclarationsOfName) { - currentScopeFirstDeclarationsOfName = createUnderscoreEscapedMap(); - } + function recordEmittedDeclarationInScope(node: FunctionDeclaration | ClassDeclaration | ModuleDeclaration | EnumDeclaration) { + if (!currentScopeFirstDeclarationsOfName) { + currentScopeFirstDeclarationsOfName = createUnderscoreEscapedMap(); + } - if (!currentScopeFirstDeclarationsOfName.has(name)) { - currentScopeFirstDeclarationsOfName.set(name, node); - } + const name = declaredNameInScope(node); + if (!currentScopeFirstDeclarationsOfName.has(name)) { + currentScopeFirstDeclarationsOfName.set(name, node); } } @@ -2658,20 +2666,25 @@ namespace ts { * the same name emitted in the current scope. Only returns false if we are absolutely * certain a previous declaration has been emitted. */ - function isPotentiallyFirstEmittedDeclarationInScope(node: Node) { + function isFirstEmittedDeclarationInScope(node: ModuleDeclaration | EnumDeclaration) { // If the node has a named symbol, then we have enough knowledge to determine // whether a prior declaration has been emitted. if (currentScopeFirstDeclarationsOfName) { - const name = node.symbol && node.symbol.escapedName; - if (name) { - return currentScopeFirstDeclarationsOfName.get(name) === node; - } + const name = declaredNameInScope(node); + return currentScopeFirstDeclarationsOfName.get(name) === node; } // Otherwise, we can't be sure. For example, this node could be synthetic. return true; } + function declaredNameInScope(node: FunctionDeclaration | ClassDeclaration | ModuleDeclaration | EnumDeclaration): __String { + if (node.name.kind !== SyntaxKind.Identifier) { + Debug.fail(formatSyntaxKind(node.kind) + " should have an identifier name."); + } + return (node.name as Identifier).escapedText; + } + /** * Adds a leading VariableStatement for a enum or module declaration. */ @@ -2691,7 +2704,7 @@ namespace ts { setOriginalNode(statement, node); recordEmittedDeclarationInScope(node); - if (isPotentiallyFirstEmittedDeclarationInScope(node)) { + if (isFirstEmittedDeclarationInScope(node)) { // Adjust the source map emit to match the old emitter. if (node.kind === SyntaxKind.EnumDeclaration) { setSourceMapRange(statement.declarationList, node); @@ -2747,7 +2760,7 @@ namespace ts { return createNotEmittedStatement(node); } - Debug.assert(isIdentifier(node.name), "TypeScript module should have an Identifier name."); + Debug.assert(isIdentifier(node.name), "A TypeScript namespace should have an Identifier name."); enableSubstitutionForNamespaceExports(); const statements: Statement[] = []; diff --git a/src/compiler/types.ts b/src/compiler/types.ts index 09f1b5cfcc53c..b0580956a4b44 100644 --- a/src/compiler/types.ts +++ b/src/compiler/types.ts @@ -2896,7 +2896,7 @@ namespace ts { export interface Symbol { flags: SymbolFlags; // Symbol flags - escapedName: __String; // Name of symbol + escapedName: __String; // Name of symbol declarations?: Declaration[]; // Declarations associated with this symbol valueDeclaration?: Declaration; // First value declaration of the symbol members?: SymbolTable; // Class, interface or literal instance members From 6e60a017bbc187d10c76ca7c392623f8b4060dd9 Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Mon, 14 Aug 2017 21:24:51 -0400 Subject: [PATCH 136/237] Accepted baselines. --- tests/baselines/reference/defaultExportsCannotMerge01.js | 1 - tests/baselines/reference/defaultExportsCannotMerge04.js | 1 - tests/baselines/reference/reservedWords2.js | 1 - .../transformsCorrectly.rewrittenNamespaceFollowingClass.js | 1 - ...ransformsCorrectly.synthesizedClassAndNamespaceCombination.js | 1 - 5 files changed, 5 deletions(-) diff --git a/tests/baselines/reference/defaultExportsCannotMerge01.js b/tests/baselines/reference/defaultExportsCannotMerge01.js index c7091371d3612..9c433ce3a2b11 100644 --- a/tests/baselines/reference/defaultExportsCannotMerge01.js +++ b/tests/baselines/reference/defaultExportsCannotMerge01.js @@ -36,7 +36,6 @@ function Decl() { return 0; } exports.default = Decl; -var Decl; (function (Decl) { Decl.x = 10; Decl.y = 20; diff --git a/tests/baselines/reference/defaultExportsCannotMerge04.js b/tests/baselines/reference/defaultExportsCannotMerge04.js index de32618d8cce7..f8f375377ebdb 100644 --- a/tests/baselines/reference/defaultExportsCannotMerge04.js +++ b/tests/baselines/reference/defaultExportsCannotMerge04.js @@ -18,6 +18,5 @@ Object.defineProperty(exports, "__esModule", { value: true }); function Foo() { } exports.default = Foo; -var Foo; (function (Foo) { })(Foo || (Foo = {})); diff --git a/tests/baselines/reference/reservedWords2.js b/tests/baselines/reference/reservedWords2.js index da6a35bba82b3..f172f37d05396 100644 --- a/tests/baselines/reference/reservedWords2.js +++ b/tests/baselines/reference/reservedWords2.js @@ -35,7 +35,6 @@ debugger; if () ; [1, 2]; -var ; (function () { })( || ( = {})); void {}; diff --git a/tests/baselines/reference/transformApi/transformsCorrectly.rewrittenNamespaceFollowingClass.js b/tests/baselines/reference/transformApi/transformsCorrectly.rewrittenNamespaceFollowingClass.js index 9dedde29f8b78..3f2dd6cdb56fb 100644 --- a/tests/baselines/reference/transformApi/transformsCorrectly.rewrittenNamespaceFollowingClass.js +++ b/tests/baselines/reference/transformApi/transformsCorrectly.rewrittenNamespaceFollowingClass.js @@ -4,7 +4,6 @@ class C { } } C.bar = 20; -var C; (function (C) { C.x = 10; })(C || (C = {})); diff --git a/tests/baselines/reference/transformApi/transformsCorrectly.synthesizedClassAndNamespaceCombination.js b/tests/baselines/reference/transformApi/transformsCorrectly.synthesizedClassAndNamespaceCombination.js index ad11068a5127c..ababb49d717a5 100644 --- a/tests/baselines/reference/transformApi/transformsCorrectly.synthesizedClassAndNamespaceCombination.js +++ b/tests/baselines/reference/transformApi/transformsCorrectly.synthesizedClassAndNamespaceCombination.js @@ -1,6 +1,5 @@ class Foo { } -var Foo; (function (Foo) { ; })(Foo || (Foo = {})); From e7ddaa7d49849659f4a393a7ec713dc3fc2f8744 Mon Sep 17 00:00:00 2001 From: Basarat Ali Syed Date: Tue, 15 Aug 2017 15:17:19 +1000 Subject: [PATCH 137/237] =?UTF-8?q?export=20ScopeUsages=20=F0=9F=8C=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/services/refactors/extractMethod.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/services/refactors/extractMethod.ts b/src/services/refactors/extractMethod.ts index f0f85ee6e8167..de163d0771772 100644 --- a/src/services/refactors/extractMethod.ts +++ b/src/services/refactors/extractMethod.ts @@ -866,7 +866,7 @@ namespace ts.refactor.extractMethod { readonly node: Node; } - interface ScopeUsages { + export interface ScopeUsages { usages: Map; substitutions: Map; } From c4dd820564659e0880dd9b6826e538e96948a822 Mon Sep 17 00:00:00 2001 From: Basarat Ali Syed Date: Tue, 15 Aug 2017 15:19:40 +1000 Subject: [PATCH 138/237] =?UTF-8?q?export=20interfaces=20used=20by=20expor?= =?UTF-8?q?ted=20functions=20=F0=9F=8C=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/services/textChanges.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/services/textChanges.ts b/src/services/textChanges.ts index bddfc205db4c4..6462b64e22670 100644 --- a/src/services/textChanges.ts +++ b/src/services/textChanges.ts @@ -64,7 +64,7 @@ namespace ts.textChanges { */ export type ConfigurableStartEnd = ConfigurableStart & ConfigurableEnd; - interface InsertNodeOptions { + export interface InsertNodeOptions { /** * Text to be inserted before the new node */ @@ -96,7 +96,7 @@ namespace ts.textChanges { readonly range: TextRange; } - interface ChangeNodeOptions extends ConfigurableStartEnd, InsertNodeOptions { + export interface ChangeNodeOptions extends ConfigurableStartEnd, InsertNodeOptions { readonly useIndentationFromFile?: boolean; } interface ReplaceWithSingleNode extends BaseChange { @@ -111,7 +111,7 @@ namespace ts.textChanges { readonly options?: never; } - interface ChangeMultipleNodesOptions extends ChangeNodeOptions { + export interface ChangeMultipleNodesOptions extends ChangeNodeOptions { nodeSeparator: string; } interface ReplaceWithMultipleNodes extends BaseChange { From 10c8d5effada1ef938d8897cd5f132325942b7cf Mon Sep 17 00:00:00 2001 From: Andy Date: Tue, 15 Aug 2017 10:23:45 -0700 Subject: [PATCH 139/237] In services, show the aliasSymbol for a type even if it's not accessible in the current scope (#17433) * In services, show the aliasSymbol for a type even if it's not accessible in the current scope * Rename flag --- src/compiler/checker.ts | 10 +++++++--- src/compiler/types.ts | 2 ++ src/services/utilities.ts | 1 + .../quickInfoTypeAliasDefinedInDifferentFile.ts | 11 +++++++++++ 4 files changed, 21 insertions(+), 3 deletions(-) create mode 100644 tests/cases/fourslash/quickInfoTypeAliasDefinedInDifferentFile.ts diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 1c41be84ba741..456f7bd07bb5d 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -2156,6 +2156,11 @@ namespace ts { return false; } + function isTypeSymbolAccessible(typeSymbol: Symbol, enclosingDeclaration: Node): boolean { + const access = isSymbolAccessible(typeSymbol, enclosingDeclaration, SymbolFlags.Type, /*shouldComputeAliasesToMakeVisible*/ false); + return access.accessibility === SymbolAccessibility.Accessible; + } + /** * Check if the given symbol in given enclosing declaration is accessible and mark all associated alias to be visible if requested * @@ -2486,8 +2491,7 @@ namespace ts { // Ignore constraint/default when creating a usage (as opposed to declaration) of a type parameter. return createTypeReferenceNode(name, /*typeArguments*/ undefined); } - if (!inTypeAlias && type.aliasSymbol && - isSymbolAccessible(type.aliasSymbol, context.enclosingDeclaration, SymbolFlags.Type, /*shouldComputeAliasesToMakeVisible*/ false).accessibility === SymbolAccessibility.Accessible) { + if (!inTypeAlias && type.aliasSymbol && isTypeSymbolAccessible(type.aliasSymbol, context.enclosingDeclaration)) { const name = symbolToTypeReferenceName(type.aliasSymbol); const typeArgumentNodes = mapToTypeNodes(type.aliasTypeArguments, context); return createTypeReferenceNode(name, typeArgumentNodes); @@ -3254,7 +3258,7 @@ namespace ts { buildSymbolDisplay(type.symbol, writer, enclosingDeclaration, SymbolFlags.Type, SymbolFormatFlags.None, nextFlags); } else if (!(flags & TypeFormatFlags.InTypeAlias) && type.aliasSymbol && - isSymbolAccessible(type.aliasSymbol, enclosingDeclaration, SymbolFlags.Type, /*shouldComputeAliasesToMakeVisible*/ false).accessibility === SymbolAccessibility.Accessible) { + ((flags & TypeFormatFlags.UseAliasDefinedOutsideCurrentScope) || isTypeSymbolAccessible(type.aliasSymbol, enclosingDeclaration))) { const typeArguments = type.aliasTypeArguments; writeSymbolTypeReference(type.aliasSymbol, typeArguments, 0, length(typeArguments), nextFlags); } diff --git a/src/compiler/types.ts b/src/compiler/types.ts index 2b3e5ab36df79..f0db341d99be0 100644 --- a/src/compiler/types.ts +++ b/src/compiler/types.ts @@ -2722,6 +2722,8 @@ namespace ts { AddUndefined = 1 << 13, // Add undefined to types of initialized, non-optional parameters WriteClassExpressionAsTypeLiteral = 1 << 14, // Write a type literal instead of (Anonymous class) InArrayType = 1 << 15, // Writing an array element type + UseAliasDefinedOutsideCurrentScope = 1 << 16, // For a `type T = ... ` defined in a different file, write `T` instead of its value, + // even though `T` can't be accessed in the current scope. } export const enum SymbolFormatFlags { diff --git a/src/services/utilities.ts b/src/services/utilities.ts index a5b035154beae..27215190db3fd 100644 --- a/src/services/utilities.ts +++ b/src/services/utilities.ts @@ -1261,6 +1261,7 @@ namespace ts { } export function signatureToDisplayParts(typechecker: TypeChecker, signature: Signature, enclosingDeclaration?: Node, flags?: TypeFormatFlags): SymbolDisplayPart[] { + flags |= TypeFormatFlags.UseAliasDefinedOutsideCurrentScope; return mapToDisplayParts(writer => { typechecker.getSymbolDisplayBuilder().buildSignatureDisplay(signature, writer, enclosingDeclaration, flags); }); diff --git a/tests/cases/fourslash/quickInfoTypeAliasDefinedInDifferentFile.ts b/tests/cases/fourslash/quickInfoTypeAliasDefinedInDifferentFile.ts new file mode 100644 index 0000000000000..2597b5e888d3e --- /dev/null +++ b/tests/cases/fourslash/quickInfoTypeAliasDefinedInDifferentFile.ts @@ -0,0 +1,11 @@ +/// + +// @Filename: /a.ts +////export type X = { x: number }; +////export function f(x: X): void {} + +// @Filename: /b.ts +////import { f } from "./a"; +/////**/f({ x: 1 }); + +verify.quickInfoAt("", "(alias) f(x: X): void\nimport f"); From 7409648416b2eff6173c24ab530948f002c42c96 Mon Sep 17 00:00:00 2001 From: Andy Date: Tue, 15 Aug 2017 10:24:15 -0700 Subject: [PATCH 140/237] Remove unused `UseTypeAliasValue` flag (#17779) --- src/compiler/declarationEmitter.ts | 5 ++--- src/compiler/types.ts | 1 - 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/src/compiler/declarationEmitter.ts b/src/compiler/declarationEmitter.ts index 2c4be2ae7c3d2..47a3be6efeaf3 100644 --- a/src/compiler/declarationEmitter.ts +++ b/src/compiler/declarationEmitter.ts @@ -349,7 +349,6 @@ namespace ts { errorNameNode = declaration.name; const format = TypeFormatFlags.UseTypeOfFunction | TypeFormatFlags.WriteClassExpressionAsTypeLiteral | - TypeFormatFlags.UseTypeAliasValue | (shouldUseResolverType ? TypeFormatFlags.AddUndefined : 0); resolver.writeTypeOfDeclaration(declaration, enclosingDeclaration, format, writer); errorNameNode = undefined; @@ -368,7 +367,7 @@ namespace ts { resolver.writeReturnTypeOfSignatureDeclaration( signature, enclosingDeclaration, - TypeFormatFlags.UseTypeOfFunction | TypeFormatFlags.UseTypeAliasValue | TypeFormatFlags.WriteClassExpressionAsTypeLiteral, + TypeFormatFlags.UseTypeOfFunction | TypeFormatFlags.WriteClassExpressionAsTypeLiteral, writer); errorNameNode = undefined; } @@ -633,7 +632,7 @@ namespace ts { resolver.writeTypeOfExpression( expr, enclosingDeclaration, - TypeFormatFlags.UseTypeOfFunction | TypeFormatFlags.UseTypeAliasValue | TypeFormatFlags.WriteClassExpressionAsTypeLiteral, + TypeFormatFlags.UseTypeOfFunction | TypeFormatFlags.WriteClassExpressionAsTypeLiteral, writer); write(";"); writeLine(); diff --git a/src/compiler/types.ts b/src/compiler/types.ts index f0db341d99be0..faaed7799558a 100644 --- a/src/compiler/types.ts +++ b/src/compiler/types.ts @@ -2717,7 +2717,6 @@ namespace ts { UseFullyQualifiedType = 1 << 8, // Write out the fully qualified type name (eg. Module.Type, instead of Type) InFirstTypeArgument = 1 << 9, // Writing first type argument of the instantiated type InTypeAlias = 1 << 10, // Writing type in type alias declaration - UseTypeAliasValue = 1 << 11, // Serialize the type instead of using type-alias. This is needed when we emit declaration file. SuppressAnyReturnType = 1 << 12, // If the return type is any-like, don't offer a return type. AddUndefined = 1 << 13, // Add undefined to types of initialized, non-optional parameters WriteClassExpressionAsTypeLiteral = 1 << 14, // Write a type literal instead of (Anonymous class) From b2188ad66c03e575c5bfd13314add12677e26ad3 Mon Sep 17 00:00:00 2001 From: Arthur Ozga Date: Mon, 14 Aug 2017 16:43:20 -0700 Subject: [PATCH 141/237] cleanup --- src/services/formatting/formatting.ts | 31 +++++++++++++++++++++------ 1 file changed, 24 insertions(+), 7 deletions(-) diff --git a/src/services/formatting/formatting.ts b/src/services/formatting/formatting.ts index fbda42d3840d7..13a7f466f4650 100644 --- a/src/services/formatting/formatting.ts +++ b/src/services/formatting/formatting.ts @@ -1164,10 +1164,15 @@ namespace ts.formatting { const { column, character } = SmartIndenter.findFirstNonWhitespaceCharacterAndColumn(commentLineStart, commentStart, sourceFile, options); return column + /*length after whitespace ends*/ range.pos - (commentLineStart + character); } - return undefined; + return -1; } - export function getRangeOfEnclosingComment(sourceFile: SourceFile, position: number, onlyMultiLine: boolean): CommentRange | undefined { + export function getRangeOfEnclosingComment( + sourceFile: SourceFile, + position: number, + onlyMultiLine: boolean, + tokenAtPosition = getTokenAtPosition(sourceFile, position, /*includeJsDocComment*/ false), + predicate?: (c: CommentRange) => boolean): CommentRange | undefined { // Considering a fixed position, // - trailing comments are those following and on the same line as the position. // - leading comments are those in the range [position, start of next non-trivia token) @@ -1178,16 +1183,28 @@ namespace ts.formatting { // tokens contain all comments in a sourcefile disjointly. const precedingToken = findPrecedingToken(position, sourceFile); const trailingRangesOfPreviousToken = precedingToken && getTrailingCommentRanges(sourceFile.text, precedingToken.end); - const leadingCommentRangesOfNextToken = getLeadingCommentRangesOfNode(getTokenAtPosition(sourceFile, position, /*includeJsDocComment*/ false), sourceFile); + const leadingCommentRangesOfNextToken = getLeadingCommentRangesOfNode(tokenAtPosition, sourceFile); const commentRanges = trailingRangesOfPreviousToken && leadingCommentRangesOfNextToken ? trailingRangesOfPreviousToken.concat(leadingCommentRangesOfNextToken) : trailingRangesOfPreviousToken || leadingCommentRangesOfNextToken; if (commentRanges) { for (const range of commentRanges) { - // We need to extend the range when in an unclosed multi-line comment. - if (range.pos < position && position < range.end || - position === range.end && (range.kind === SyntaxKind.SingleLineCommentTrivia || position === sourceFile.getFullWidth())) { - return onlyMultiLine && range.kind !== SyntaxKind.MultiLineCommentTrivia ? undefined : range; + // The end marker of a single-line comment does not include the newline character. + // With caret at `^`, in the following case, we are inside a comment (^ denotes the cursor position): + // + // // asdf ^\n + // + // But for closed multi-line comments, we don't want to be inside the comment in the following case: + // + // /* asdf */^ + // + // However, unterminated multi-line comments *do* contain their end. + // + // Internally, we represent the end of the comment at the newline and closing '/', respectively. + // + if ((range.pos < position && position < range.end || + position === range.end && (range.kind === SyntaxKind.SingleLineCommentTrivia || position === sourceFile.getFullWidth()))) { + return (range.kind === SyntaxKind.MultiLineCommentTrivia || !onlyMultiLine) && (!predicate || predicate(range)) ? range : undefined; } } } From 472ad9d3131c2738c4400e22f8696bad1522f342 Mon Sep 17 00:00:00 2001 From: Arthur Ozga Date: Mon, 14 Aug 2017 16:43:31 -0700 Subject: [PATCH 142/237] findPrevious changes --- src/services/utilities.ts | 64 +++++++++++---------------------------- 1 file changed, 18 insertions(+), 46 deletions(-) diff --git a/src/services/utilities.ts b/src/services/utilities.ts index a5b035154beae..c5b2a2b4f90b9 100644 --- a/src/services/utilities.ts +++ b/src/services/utilities.ts @@ -742,18 +742,18 @@ namespace ts { const children = n.getChildren(); for (let i = 0; i < children.length; i++) { const child = children[i]; - // condition 'position < child.end' checks if child node end after the position - // in the example below this condition will be false for 'aaaa' and 'bbbb' and true for 'ccc' - // aaaa___bbbb___$__ccc - // after we found child node with end after the position we check if start of the node is after the position. - // if yes - then position is in the trivia and we need to look into the previous child to find the token in question. - // if no - position is in the node itself so we should recurse in it. - // NOTE: JsxText is a weird kind of node that can contain only whitespaces (since they are not counted as trivia). - // if this is the case - then we should assume that token in question is located in previous child. - if (position < child.end && (nodeHasTokens(child) || child.kind === SyntaxKind.JsxText)) { + // Note that the span of a node's tokens is [node.getStart(...), node.end). + // Given that `position < child.end` and child has constiutent tokens*, we distinguish these cases: + // 1) `position` precedes `child`'s tokens or `child` has no tokens (ie: in a comment or whitespace preceding `child`): + // we need to find the last token in a previous child. + // 2) `position` is within the same span: we recurse on `child`. + // * JsxText is exceptional in that its tokens are (non-trivia) whitespace, which we do not want to return. + // TODO(arozga): shouldn't `findRightmost...` need to handle JsxText? + if (position < child.end) { const start = child.getStart(sourceFile, includeJsDoc); const lookInPreviousChild = (start >= position) || // cursor in the leading trivia + nodeHasTokens(child) || (child.kind === SyntaxKind.JsxText && start === child.end); // whitespace only JsxText if (lookInPreviousChild) { @@ -768,7 +768,7 @@ namespace ts { } } - Debug.assert(startNode !== undefined || n.kind === SyntaxKind.SourceFile || isJSDocCommentContainingNode(n)); + Debug.assert(startNode !== undefined || n.kind === SyntaxKind.SourceFile || isJSDocCommentContainingNode(n) || n.kind === SyntaxKind.JsxSelfClosingElement); // Here we know that none of child token nodes embrace the position, // the only known case is when position is at the end of the file. @@ -780,7 +780,9 @@ namespace ts { } } - /// finds last node that is considered as candidate for search (isCandidate(node) === true) starting from 'exclusiveStartPosition' + /** + * Finds the rightmost child to the left of `children[exclusiveStartPosition]` which has constituent tokens. + */ function findRightmostChildNodeWithTokens(children: Node[], exclusiveStartPosition: number): Node { for (let i = exclusiveStartPosition - 1; i >= 0; i--) { if (nodeHasTokens(children[i])) { @@ -863,41 +865,11 @@ namespace ts { * @param predicate Additional predicate to test on the comment range. */ export function isInComment( - sourceFile: SourceFile, - position: number, - tokenAtPosition = getTokenAtPosition(sourceFile, position, /*includeJsDocComment*/ false), - predicate?: (c: CommentRange) => boolean): boolean { - return position <= tokenAtPosition.getStart(sourceFile) && - (isInCommentRange(getLeadingCommentRanges(sourceFile.text, tokenAtPosition.pos)) || - isInCommentRange(getTrailingCommentRanges(sourceFile.text, tokenAtPosition.pos))); - - function isInCommentRange(commentRanges: CommentRange[]): boolean { - return forEach(commentRanges, c => isPositionInCommentRange(c, position, sourceFile.text) && (!predicate || predicate(c))); - } - } - - function isPositionInCommentRange({ pos, end, kind }: ts.CommentRange, position: number, text: string): boolean { - if (pos < position && position < end) { - return true; - } - else if (position === end) { - // The end marker of a single-line comment does not include the newline character. - // In the following case, we are inside a comment (^ denotes the cursor position): - // - // // asdf ^\n - // - // But for multi-line comments, we don't want to be inside the comment in the following case: - // - // /* asdf */^ - // - // Internally, we represent the end of the comment at the newline and closing '/', respectively. - return kind === SyntaxKind.SingleLineCommentTrivia || - // true for unterminated multi-line comment - !(text.charCodeAt(end - 1) === CharacterCodes.slash && text.charCodeAt(end - 2) === CharacterCodes.asterisk); - } - else { - return false; - } + sourceFile: SourceFile, + position: number, + tokenAtPosition = getTokenAtPosition(sourceFile, position, /*includeJsDocComment*/ false), + predicate?: (c: CommentRange) => boolean): boolean { + return !!formatting.getRangeOfEnclosingComment(sourceFile, position, /*onlyMultiLine*/ false, tokenAtPosition, predicate); } export function hasDocComment(sourceFile: SourceFile, position: number) { From f3e0cbbd526b4975c342a936cfb328a19dccd6a2 Mon Sep 17 00:00:00 2001 From: Arthur Ozga Date: Tue, 15 Aug 2017 11:26:47 -0700 Subject: [PATCH 143/237] `findPrecedingToken` handles EOF child more gracefully --- src/services/services.ts | 2 +- src/services/utilities.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/services/services.ts b/src/services/services.ts index 24e85a2a0190d..c623fe15b02be 100644 --- a/src/services/services.ts +++ b/src/services/services.ts @@ -113,7 +113,7 @@ namespace ts { } pos = textPos; if (token === SyntaxKind.EndOfFileToken) { - return pos; + break; } } return pos; diff --git a/src/services/utilities.ts b/src/services/utilities.ts index c5b2a2b4f90b9..5336d47c1f394 100644 --- a/src/services/utilities.ts +++ b/src/services/utilities.ts @@ -753,7 +753,7 @@ namespace ts { const start = child.getStart(sourceFile, includeJsDoc); const lookInPreviousChild = (start >= position) || // cursor in the leading trivia - nodeHasTokens(child) || + !nodeHasTokens(child) || (child.kind === SyntaxKind.JsxText && start === child.end); // whitespace only JsxText if (lookInPreviousChild) { From a209db7bb62b8ab99675d0a7a2047d1a2915f436 Mon Sep 17 00:00:00 2001 From: Arthur Ozga Date: Tue, 15 Aug 2017 12:00:15 -0700 Subject: [PATCH 144/237] dont compute preceding token twice --- src/services/formatting/formatting.ts | 11 ++++++++--- src/services/formatting/smartIndenter.ts | 4 ++-- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/src/services/formatting/formatting.ts b/src/services/formatting/formatting.ts index 13a7f466f4650..c34585c5bca45 100644 --- a/src/services/formatting/formatting.ts +++ b/src/services/formatting/formatting.ts @@ -1155,9 +1155,11 @@ namespace ts.formatting { /** * Gets the indentation level of the multi-line comment enclosing position, * and a negative value if the position is not in a multi-line comment. + * + * @param precedingToken Must be the result of `findPrecedingToken(position, sourceFile)`. */ - export function getIndentationOfEnclosingMultiLineComment(sourceFile: SourceFile, position: number, options: EditorSettings): number { - const range = getRangeOfEnclosingComment(sourceFile, position, /*onlyMultiLine*/ true); + export function getIndentationOfEnclosingMultiLineComment(sourceFile: SourceFile, position: number, precedingToken: Node | undefined, options: EditorSettings): number { + const range = getRangeOfEnclosingComment(sourceFile, position, /*onlyMultiLine*/ true, precedingToken || null); // tslint:disable-line:no-null-keyword if (range) { const commentStart = range.pos; const commentLineStart = getLineStartPositionForPosition(commentStart, sourceFile); @@ -1167,10 +1169,14 @@ namespace ts.formatting { return -1; } + /** + * @param precedingToken pass `null` if preceding token was already computed and result was `undefined`. + */ export function getRangeOfEnclosingComment( sourceFile: SourceFile, position: number, onlyMultiLine: boolean, + precedingToken: Node | null | undefined = findPrecedingToken(position, sourceFile), // tslint:disable-line:no-null-keyword tokenAtPosition = getTokenAtPosition(sourceFile, position, /*includeJsDocComment*/ false), predicate?: (c: CommentRange) => boolean): CommentRange | undefined { // Considering a fixed position, @@ -1181,7 +1187,6 @@ namespace ts.formatting { // Note, `node.start` is the start-position of the first comment following the previous // token that is not a trailing comment, so the leading and trailing comments of all // tokens contain all comments in a sourcefile disjointly. - const precedingToken = findPrecedingToken(position, sourceFile); const trailingRangesOfPreviousToken = precedingToken && getTrailingCommentRanges(sourceFile.text, precedingToken.end); const leadingCommentRangesOfNextToken = getLeadingCommentRangesOfNode(tokenAtPosition, sourceFile); const commentRanges = trailingRangesOfPreviousToken && leadingCommentRangesOfNextToken ? diff --git a/src/services/formatting/smartIndenter.ts b/src/services/formatting/smartIndenter.ts index b0d58ddad1226..c868ce048473c 100644 --- a/src/services/formatting/smartIndenter.ts +++ b/src/services/formatting/smartIndenter.ts @@ -31,12 +31,12 @@ namespace ts.formatting { return 0; } - const indentationOfEnclosingMultiLineComment = getIndentationOfEnclosingMultiLineComment(sourceFile, position, options); + const precedingToken = findPrecedingToken(position, sourceFile); + const indentationOfEnclosingMultiLineComment = getIndentationOfEnclosingMultiLineComment(sourceFile, position, precedingToken, options); if (indentationOfEnclosingMultiLineComment >= 0) { return indentationOfEnclosingMultiLineComment; } - const precedingToken = findPrecedingToken(position, sourceFile); if (!precedingToken) { return getBaseIndentation(options); } From a08d18af579b0c492e98dd2d9c16358c1c3b2d67 Mon Sep 17 00:00:00 2001 From: Arthur Ozga Date: Tue, 15 Aug 2017 12:01:43 -0700 Subject: [PATCH 145/237] consolidate isInComment and getRangeOfEnclosingComment --- src/services/utilities.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/services/utilities.ts b/src/services/utilities.ts index 5336d47c1f394..160ef6db4512e 100644 --- a/src/services/utilities.ts +++ b/src/services/utilities.ts @@ -867,9 +867,9 @@ namespace ts { export function isInComment( sourceFile: SourceFile, position: number, - tokenAtPosition = getTokenAtPosition(sourceFile, position, /*includeJsDocComment*/ false), + tokenAtPosition?: Node, predicate?: (c: CommentRange) => boolean): boolean { - return !!formatting.getRangeOfEnclosingComment(sourceFile, position, /*onlyMultiLine*/ false, tokenAtPosition, predicate); + return !!formatting.getRangeOfEnclosingComment(sourceFile, position, /*onlyMultiLine*/ false, /*precedingToken*/ undefined, tokenAtPosition, predicate); } export function hasDocComment(sourceFile: SourceFile, position: number) { From 281d821fe812f171ae94fa77503514ec0edb8521 Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Tue, 15 Aug 2017 12:16:54 -0700 Subject: [PATCH 146/237] Fix lint errors. --- src/harness/unittests/transform.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/harness/unittests/transform.ts b/src/harness/unittests/transform.ts index 6edd174da23d4..27e41a96dfcfa 100644 --- a/src/harness/unittests/transform.ts +++ b/src/harness/unittests/transform.ts @@ -116,11 +116,11 @@ namespace ts { return (sourceFile: ts.SourceFile) => { const result = getMutableClone(sourceFile); result.statements = ts.createNodeArray([ - ts.createClassDeclaration(undefined, undefined, "Foo", undefined, undefined, undefined), - ts.createModuleDeclaration(undefined, undefined, createIdentifier("Foo"), createModuleBlock([createEmptyStatement()])) + ts.createClassDeclaration(/*decorators*/ undefined, /*modifiers*/ undefined, "Foo", /*typeParameters*/ undefined, /*heritageClauses*/ undefined, /*members*/ undefined), + ts.createModuleDeclaration(/*decorators*/ undefined, /*modifiers*/ undefined, createIdentifier("Foo"), createModuleBlock([createEmptyStatement()])) ]); return result; - } + }; } }); From 93abebc04af5d443a930ad84258cf2d6101d8513 Mon Sep 17 00:00:00 2001 From: Andy Date: Tue, 15 Aug 2017 12:26:00 -0700 Subject: [PATCH 147/237] Change function name to camelCase (#17751) --- src/compiler/moduleNameResolver.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/compiler/moduleNameResolver.ts b/src/compiler/moduleNameResolver.ts index a374e866195c0..1593e630b6d00 100644 --- a/src/compiler/moduleNameResolver.ts +++ b/src/compiler/moduleNameResolver.ts @@ -201,7 +201,7 @@ namespace ts { let resolvedTypeReferenceDirective: ResolvedTypeReferenceDirective | undefined; if (resolved) { if (!options.preserveSymlinks) { - resolved = realpath(resolved, host, traceEnabled); + resolved = realPath(resolved, host, traceEnabled); } if (traceEnabled) { @@ -741,7 +741,7 @@ namespace ts { let resolvedValue = resolved.value; if (!compilerOptions.preserveSymlinks) { - resolvedValue = resolvedValue && { ...resolved.value, path: realpath(resolved.value.path, host, traceEnabled), extension: resolved.value.extension }; + resolvedValue = resolvedValue && { ...resolved.value, path: realPath(resolved.value.path, host, traceEnabled), extension: resolved.value.extension }; } // For node_modules lookups, get the real path so that multiple accesses to an `npm link`-ed module do not create duplicate files. return { value: resolvedValue && { resolved: resolvedValue, isExternalLibraryImport: true } }; @@ -754,7 +754,7 @@ namespace ts { } } - function realpath(path: string, host: ModuleResolutionHost, traceEnabled: boolean): string { + function realPath(path: string, host: ModuleResolutionHost, traceEnabled: boolean): string { if (!host.realpath) { return path; } From ad9c29b9281baed9d736adca0ffbf3d9634e2ccf Mon Sep 17 00:00:00 2001 From: Arthur Ozga Date: Tue, 15 Aug 2017 12:39:40 -0700 Subject: [PATCH 148/237] add test --- tests/cases/fourslash/formatOnEnterInComment.ts | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 tests/cases/fourslash/formatOnEnterInComment.ts diff --git a/tests/cases/fourslash/formatOnEnterInComment.ts b/tests/cases/fourslash/formatOnEnterInComment.ts new file mode 100644 index 0000000000000..489eb6ac6ce87 --- /dev/null +++ b/tests/cases/fourslash/formatOnEnterInComment.ts @@ -0,0 +1,14 @@ +/// + +//// /** +//// * /*1*/ +//// */ + +goTo.marker("1"); +edit.insertLine(""); +verify.currentFileContentIs( +` /** + * + + */` +); \ No newline at end of file From 34a55899bee19dcbb434754035080172e6c9ab52 Mon Sep 17 00:00:00 2001 From: Andy Date: Wed, 16 Aug 2017 10:04:51 -0700 Subject: [PATCH 149/237] Remove unnecessary call to `getApparentType` (#17788) --- src/compiler/checker.ts | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 4481531b5982d..47a5c6950d2d8 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -22918,10 +22918,7 @@ namespace ts { // index access if (node.parent.kind === SyntaxKind.ElementAccessExpression && (node.parent).argumentExpression === node) { const objectType = getTypeOfExpression((node.parent).expression); - if (objectType === unknownType) return undefined; - const apparentType = getApparentType(objectType); - if (apparentType === unknownType) return undefined; - return getPropertyOfType(apparentType, (node).text as __String); + return getPropertyOfType(objectType, (node).text as __String); } break; } From 7809398ad48f2e573fe22670e1a133448337e00e Mon Sep 17 00:00:00 2001 From: Nathan Shively-Sanders Date: Wed, 16 Aug 2017 10:06:01 -0700 Subject: [PATCH 150/237] Indexed-assignment readonly err is not unknownType Now, in an assignment to an indexed access of a readonly property, the resulting type is still the property's type. Previously it was unknownType. This improves error reporting slightly by reporting some errors that were previously missed. --- src/compiler/checker.ts | 7 ++--- .../decrementOperatorWithEnumType.errors.txt | 8 ++++-- .../decrementOperatorWithEnumType.js | 3 +- .../mappedTypeRelationships.errors.txt | 28 ++++++++++++++++++- .../reference/objectFreeze.errors.txt | 5 +++- .../decrementOperatorWithEnumType.ts | 2 +- 6 files changed, 43 insertions(+), 10 deletions(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 5b1d4d77bf74b..a8971e9e09d0b 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -7566,7 +7566,6 @@ namespace ts { if (indexInfo) { if (accessExpression && indexInfo.isReadonly && (isAssignmentTarget(accessExpression) || isDeleteTarget(accessExpression))) { error(accessExpression, Diagnostics.Index_signature_in_type_0_only_permits_reading, typeToString(objectType)); - return unknownType; } return indexInfo.type; } @@ -7607,7 +7606,6 @@ namespace ts { } if (accessNode.kind === SyntaxKind.ElementAccessExpression && isAssignmentTarget(accessNode) && type.declaration.readonlyToken) { error(accessNode, Diagnostics.Index_signature_in_type_0_only_permits_reading, typeToString(type)); - return unknownType; } } const mapper = createTypeMapper([getTypeParameterFromMappedType(type)], [indexType]); @@ -14603,7 +14601,6 @@ namespace ts { if (indexInfo && indexInfo.type) { if (indexInfo.isReadonly && (isAssignmentTarget(node) || isDeleteTarget(node))) { error(node, Diagnostics.Index_signature_in_type_0_only_permits_reading, typeToString(apparentType)); - return unknownType; } return indexInfo.type; } @@ -17125,7 +17122,9 @@ namespace ts { if (operandType === silentNeverType) { return silentNeverType; } - const ok = checkArithmeticOperandType(node.operand, checkNonNullType(operandType, node.operand), + const ok = checkArithmeticOperandType( + node.operand, + checkNonNullType(operandType, node.operand), Diagnostics.An_arithmetic_operand_must_be_of_type_any_number_or_an_enum_type); if (ok) { // run check only if former checks succeeded to avoid reporting cascading errors diff --git a/tests/baselines/reference/decrementOperatorWithEnumType.errors.txt b/tests/baselines/reference/decrementOperatorWithEnumType.errors.txt index aae28d5e417b2..284e15c5193d8 100644 --- a/tests/baselines/reference/decrementOperatorWithEnumType.errors.txt +++ b/tests/baselines/reference/decrementOperatorWithEnumType.errors.txt @@ -1,11 +1,12 @@ tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithEnumType.ts(6,31): error TS2540: Cannot assign to 'A' because it is a constant or a read-only property. tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithEnumType.ts(7,29): error TS2540: Cannot assign to 'A' because it is a constant or a read-only property. tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithEnumType.ts(10,9): error TS2540: Cannot assign to 'A' because it is a constant or a read-only property. +tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithEnumType.ts(12,1): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithEnumType.ts(12,1): error TS2542: Index signature in type 'typeof ENUM1' only permits reading. tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithEnumType.ts(12,7): error TS2304: Cannot find name 'A'. -==== tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithEnumType.ts (5 errors) ==== +==== tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithEnumType.ts (6 errors) ==== // -- operator on enum type enum ENUM1 { A, B, "" }; @@ -25,6 +26,9 @@ tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOp ENUM1[A]--; ~~~~~~~~ +!!! error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. + ~~~~~~~~ !!! error TS2542: Index signature in type 'typeof ENUM1' only permits reading. ~ -!!! error TS2304: Cannot find name 'A'. \ No newline at end of file +!!! error TS2304: Cannot find name 'A'. + \ No newline at end of file diff --git a/tests/baselines/reference/decrementOperatorWithEnumType.js b/tests/baselines/reference/decrementOperatorWithEnumType.js index 27cb376cc05d9..306482faf3199 100644 --- a/tests/baselines/reference/decrementOperatorWithEnumType.js +++ b/tests/baselines/reference/decrementOperatorWithEnumType.js @@ -10,7 +10,8 @@ var ResultIsNumber2 = ENUM1.A--; // miss assignment operator --ENUM1["A"]; -ENUM1[A]--; +ENUM1[A]--; + //// [decrementOperatorWithEnumType.js] // -- operator on enum type diff --git a/tests/baselines/reference/mappedTypeRelationships.errors.txt b/tests/baselines/reference/mappedTypeRelationships.errors.txt index bc0aa32b14916..a1e1455b419f0 100644 --- a/tests/baselines/reference/mappedTypeRelationships.errors.txt +++ b/tests/baselines/reference/mappedTypeRelationships.errors.txt @@ -58,7 +58,19 @@ tests/cases/conformance/types/mapped/mappedTypeRelationships.ts(46,5): error TS2 Type 'T' is not assignable to type 'U'. tests/cases/conformance/types/mapped/mappedTypeRelationships.ts(51,5): error TS2542: Index signature in type 'Readonly' only permits reading. tests/cases/conformance/types/mapped/mappedTypeRelationships.ts(56,5): error TS2542: Index signature in type 'Readonly' only permits reading. +tests/cases/conformance/types/mapped/mappedTypeRelationships.ts(61,5): error TS2322: Type 'T[keyof T]' is not assignable to type 'U[keyof T]'. + Type 'T[string]' is not assignable to type 'U[keyof T]'. + Type 'T[string]' is not assignable to type 'U[string]'. + Type 'T[keyof T]' is not assignable to type 'U[string]'. + Type 'T[string]' is not assignable to type 'U[string]'. + Type 'T' is not assignable to type 'U'. tests/cases/conformance/types/mapped/mappedTypeRelationships.ts(61,5): error TS2542: Index signature in type 'Readonly' only permits reading. +tests/cases/conformance/types/mapped/mappedTypeRelationships.ts(66,5): error TS2322: Type 'T[K]' is not assignable to type 'U[K]'. + Type 'T[string]' is not assignable to type 'U[K]'. + Type 'T[string]' is not assignable to type 'U[string]'. + Type 'T[K]' is not assignable to type 'U[string]'. + Type 'T[string]' is not assignable to type 'U[string]'. + Type 'T' is not assignable to type 'U'. tests/cases/conformance/types/mapped/mappedTypeRelationships.ts(66,5): error TS2542: Index signature in type 'Readonly' only permits reading. tests/cases/conformance/types/mapped/mappedTypeRelationships.ts(72,5): error TS2322: Type 'Partial' is not assignable to type 'T'. tests/cases/conformance/types/mapped/mappedTypeRelationships.ts(78,5): error TS2322: Type 'Partial' is not assignable to type 'Partial'. @@ -88,7 +100,7 @@ tests/cases/conformance/types/mapped/mappedTypeRelationships.ts(168,5): error TS Type 'T' is not assignable to type 'U'. -==== tests/cases/conformance/types/mapped/mappedTypeRelationships.ts (28 errors) ==== +==== tests/cases/conformance/types/mapped/mappedTypeRelationships.ts (30 errors) ==== function f1(x: T, k: keyof T) { return x[k]; } @@ -227,6 +239,13 @@ tests/cases/conformance/types/mapped/mappedTypeRelationships.ts(168,5): error TS x[k] = y[k]; y[k] = x[k]; // Error ~~~~ +!!! error TS2322: Type 'T[keyof T]' is not assignable to type 'U[keyof T]'. +!!! error TS2322: Type 'T[string]' is not assignable to type 'U[keyof T]'. +!!! error TS2322: Type 'T[string]' is not assignable to type 'U[string]'. +!!! error TS2322: Type 'T[keyof T]' is not assignable to type 'U[string]'. +!!! error TS2322: Type 'T[string]' is not assignable to type 'U[string]'. +!!! error TS2322: Type 'T' is not assignable to type 'U'. + ~~~~ !!! error TS2542: Index signature in type 'Readonly' only permits reading. } @@ -234,6 +253,13 @@ tests/cases/conformance/types/mapped/mappedTypeRelationships.ts(168,5): error TS x[k] = y[k]; y[k] = x[k]; // Error ~~~~ +!!! error TS2322: Type 'T[K]' is not assignable to type 'U[K]'. +!!! error TS2322: Type 'T[string]' is not assignable to type 'U[K]'. +!!! error TS2322: Type 'T[string]' is not assignable to type 'U[string]'. +!!! error TS2322: Type 'T[K]' is not assignable to type 'U[string]'. +!!! error TS2322: Type 'T[string]' is not assignable to type 'U[string]'. +!!! error TS2322: Type 'T' is not assignable to type 'U'. + ~~~~ !!! error TS2542: Index signature in type 'Readonly' only permits reading. } diff --git a/tests/baselines/reference/objectFreeze.errors.txt b/tests/baselines/reference/objectFreeze.errors.txt index 9c28c62f5346b..48f41143d6151 100644 --- a/tests/baselines/reference/objectFreeze.errors.txt +++ b/tests/baselines/reference/objectFreeze.errors.txt @@ -1,8 +1,9 @@ +tests/cases/compiler/objectFreeze.ts(9,1): error TS2322: Type 'string' is not assignable to type 'number'. tests/cases/compiler/objectFreeze.ts(9,1): error TS2542: Index signature in type 'ReadonlyArray' only permits reading. tests/cases/compiler/objectFreeze.ts(12,3): error TS2540: Cannot assign to 'b' because it is a constant or a read-only property. -==== tests/cases/compiler/objectFreeze.ts (2 errors) ==== +==== tests/cases/compiler/objectFreeze.ts (3 errors) ==== const f = Object.freeze(function foo(a: number, b: string) { return false; }); f(1, "") === false; @@ -13,6 +14,8 @@ tests/cases/compiler/objectFreeze.ts(12,3): error TS2540: Cannot assign to 'b' b const a = Object.freeze([1, 2, 3]); a[0] = a[2].toString(); ~~~~ +!!! error TS2322: Type 'string' is not assignable to type 'number'. + ~~~~ !!! error TS2542: Index signature in type 'ReadonlyArray' only permits reading. const o = Object.freeze({ a: 1, b: "string" }); diff --git a/tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithEnumType.ts b/tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithEnumType.ts index 022ed405a0bf9..4caa1e1a68199 100644 --- a/tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithEnumType.ts +++ b/tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithEnumType.ts @@ -9,4 +9,4 @@ var ResultIsNumber2 = ENUM1.A--; // miss assignment operator --ENUM1["A"]; -ENUM1[A]--; \ No newline at end of file +ENUM1[A]--; From afdd77f1f6703c9974f5e65cfbca1700e391e59e Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Wed, 16 Aug 2017 10:41:49 -0700 Subject: [PATCH 151/237] Bump version to 2.6.0. --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index a114ac68a2d80..66d22594377f7 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "typescript", "author": "Microsoft Corp.", "homepage": "http://typescriptlang.org/", - "version": "2.5.0", + "version": "2.6.0", "license": "Apache-2.0", "description": "TypeScript is a language for application scale JavaScript development", "keywords": [ From 76fb6545a5c732e53470e9367498c3fd599b14b9 Mon Sep 17 00:00:00 2001 From: Tycho Grouwstra Date: Wed, 16 Aug 2017 11:49:24 -0700 Subject: [PATCH 152/237] fix some copy-pasting error (#17766) * fix some copy-pasting error * update to reflect @ahejlsberg's feedback --- src/compiler/types.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/compiler/types.ts b/src/compiler/types.ts index faaed7799558a..efcf747e88c4c 100644 --- a/src/compiler/types.ts +++ b/src/compiler/types.ts @@ -3136,7 +3136,7 @@ namespace ts { /* @internal */ ContainsObjectLiteral = 1 << 22, // Type is or contains object literal type /* @internal */ - ContainsAnyFunctionType = 1 << 23, // Type is or contains object literal type + ContainsAnyFunctionType = 1 << 23, // Type is or contains the anyFunctionType NonPrimitive = 1 << 24, // intrinsic object type /* @internal */ JsxAttributes = 1 << 25, // Jsx attributes type From af68a61ba7204d767bb09d450d90f080c755bbcb Mon Sep 17 00:00:00 2001 From: Ryan Cavanaugh Date: Wed, 16 Aug 2017 11:50:00 -0700 Subject: [PATCH 153/237] Ignore scripts for types packages --- src/server/typingsInstaller/nodeTypingsInstaller.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/server/typingsInstaller/nodeTypingsInstaller.ts b/src/server/typingsInstaller/nodeTypingsInstaller.ts index de23b2649a6b6..f80b7a70df608 100644 --- a/src/server/typingsInstaller/nodeTypingsInstaller.ts +++ b/src/server/typingsInstaller/nodeTypingsInstaller.ts @@ -102,7 +102,7 @@ namespace ts.server.typingsInstaller { if (this.log.isEnabled()) { this.log.writeLine(`Updating ${TypesRegistryPackageName} npm package...`); } - this.execSync(`${this.npmPath} install ${TypesRegistryPackageName}`, { cwd: globalTypingsCacheLocation, stdio: "ignore" }); + this.execSync(`${this.npmPath} install --ignore-scripts ${TypesRegistryPackageName}`, { cwd: globalTypingsCacheLocation, stdio: "ignore" }); if (this.log.isEnabled()) { this.log.writeLine(`Updated ${TypesRegistryPackageName} npm package`); } @@ -152,7 +152,7 @@ namespace ts.server.typingsInstaller { if (this.log.isEnabled()) { this.log.writeLine(`#${requestId} with arguments'${JSON.stringify(args)}'.`); } - const command = `${this.npmPath} install ${args.join(" ")} --save-dev --user-agent="typesInstaller/${version}"`; + const command = `${this.npmPath} install --ignore-scripts ${args.join(" ")} --save-dev --user-agent="typesInstaller/${version}"`; const start = Date.now(); let stdout: Buffer; let stderr: Buffer; From 54af8aa945f60dcf42fda1b94c3b637a3251c9af Mon Sep 17 00:00:00 2001 From: Andy Date: Wed, 16 Aug 2017 14:32:14 -0700 Subject: [PATCH 154/237] Array arguments to `concat` should be `ReadonlyArray`s (#17806) --- src/lib/es5.d.ts | 8 ++++---- tests/baselines/reference/arrayConcat2.types | 12 +++++------ .../baselines/reference/arrayConcatMap.types | 4 ++-- ...typeIsAssignableToReadonlyArray.errors.txt | 8 ++++---- tests/baselines/reference/concatError.types | 8 ++++---- tests/baselines/reference/concatTuples.types | 4 ++-- .../emitSkipsThisWithRestParameter.types | 4 ++-- .../iteratorSpreadInArray6.errors.txt | 20 +++++++++++++------ .../reference/iteratorSpreadInArray7.types | 4 ++-- ...ymousTypeNotReferencingTypeParameter.types | 4 ++-- 10 files changed, 42 insertions(+), 34 deletions(-) diff --git a/src/lib/es5.d.ts b/src/lib/es5.d.ts index d42b9140a8f1e..32fb2f55b4def 100644 --- a/src/lib/es5.d.ts +++ b/src/lib/es5.d.ts @@ -980,12 +980,12 @@ interface ReadonlyArray { * Combines two or more arrays. * @param items Additional items to add to the end of array1. */ - concat(...items: T[][]): T[]; + concat(...items: ReadonlyArray[]): T[]; /** * Combines two or more arrays. * @param items Additional items to add to the end of array1. */ - concat(...items: (T | T[])[]): T[]; + concat(...items: (T | ReadonlyArray)[]): T[]; /** * Adds all the elements of an array separated by the specified separator string. * @param separator A string used to separate one element of an array from the next in the resulting String. If omitted, the array elements are separated with a comma. @@ -1099,12 +1099,12 @@ interface Array { * Combines two or more arrays. * @param items Additional items to add to the end of array1. */ - concat(...items: T[][]): T[]; + concat(...items: ReadonlyArray[]): T[]; /** * Combines two or more arrays. * @param items Additional items to add to the end of array1. */ - concat(...items: (T | T[])[]): T[]; + concat(...items: (T | ReadonlyArray)[]): T[]; /** * Adds all the elements of an array separated by the specified separator string. * @param separator A string used to separate one element of an array from the next in the resulting String. If omitted, the array elements are separated with a comma. diff --git a/tests/baselines/reference/arrayConcat2.types b/tests/baselines/reference/arrayConcat2.types index 7687c5ed8fe7b..b63f33eb7b117 100644 --- a/tests/baselines/reference/arrayConcat2.types +++ b/tests/baselines/reference/arrayConcat2.types @@ -5,17 +5,17 @@ var a: string[] = []; a.concat("hello", 'world'); >a.concat("hello", 'world') : string[] ->a.concat : { (...items: string[][]): string[]; (...items: (string | string[])[]): string[]; } +>a.concat : { (...items: ReadonlyArray[]): string[]; (...items: (string | ReadonlyArray)[]): string[]; } >a : string[] ->concat : { (...items: string[][]): string[]; (...items: (string | string[])[]): string[]; } +>concat : { (...items: ReadonlyArray[]): string[]; (...items: (string | ReadonlyArray)[]): string[]; } >"hello" : "hello" >'world' : "world" a.concat('Hello'); >a.concat('Hello') : string[] ->a.concat : { (...items: string[][]): string[]; (...items: (string | string[])[]): string[]; } +>a.concat : { (...items: ReadonlyArray[]): string[]; (...items: (string | ReadonlyArray)[]): string[]; } >a : string[] ->concat : { (...items: string[][]): string[]; (...items: (string | string[])[]): string[]; } +>concat : { (...items: ReadonlyArray[]): string[]; (...items: (string | ReadonlyArray)[]): string[]; } >'Hello' : "Hello" var b = new Array(); @@ -25,8 +25,8 @@ var b = new Array(); b.concat('hello'); >b.concat('hello') : string[] ->b.concat : { (...items: string[][]): string[]; (...items: (string | string[])[]): string[]; } +>b.concat : { (...items: ReadonlyArray[]): string[]; (...items: (string | ReadonlyArray)[]): string[]; } >b : string[] ->concat : { (...items: string[][]): string[]; (...items: (string | string[])[]): string[]; } +>concat : { (...items: ReadonlyArray[]): string[]; (...items: (string | ReadonlyArray)[]): string[]; } >'hello' : "hello" diff --git a/tests/baselines/reference/arrayConcatMap.types b/tests/baselines/reference/arrayConcatMap.types index 89289e58d4e18..db5b3774db0b2 100644 --- a/tests/baselines/reference/arrayConcatMap.types +++ b/tests/baselines/reference/arrayConcatMap.types @@ -4,9 +4,9 @@ var x = [].concat([{ a: 1 }], [{ a: 2 }]) >[].concat([{ a: 1 }], [{ a: 2 }]) .map(b => b.a) : any[] >[].concat([{ a: 1 }], [{ a: 2 }]) .map : (callbackfn: (value: any, index: number, array: any[]) => U, thisArg?: any) => U[] >[].concat([{ a: 1 }], [{ a: 2 }]) : any[] ->[].concat : { (...items: any[][]): any[]; (...items: any[]): any[]; } +>[].concat : { (...items: ReadonlyArray[]): any[]; (...items: any[]): any[]; } >[] : undefined[] ->concat : { (...items: any[][]): any[]; (...items: any[]): any[]; } +>concat : { (...items: ReadonlyArray[]): any[]; (...items: any[]): any[]; } >[{ a: 1 }] : { a: number; }[] >{ a: 1 } : { a: number; } >a : number diff --git a/tests/baselines/reference/arrayOfSubtypeIsAssignableToReadonlyArray.errors.txt b/tests/baselines/reference/arrayOfSubtypeIsAssignableToReadonlyArray.errors.txt index df24be3a020df..7ffe8317d4228 100644 --- a/tests/baselines/reference/arrayOfSubtypeIsAssignableToReadonlyArray.errors.txt +++ b/tests/baselines/reference/arrayOfSubtypeIsAssignableToReadonlyArray.errors.txt @@ -1,12 +1,12 @@ tests/cases/compiler/arrayOfSubtypeIsAssignableToReadonlyArray.ts(13,1): error TS2322: Type 'A[]' is not assignable to type 'ReadonlyArray'. Types of property 'concat' are incompatible. - Type '{ (...items: A[][]): A[]; (...items: (A | A[])[]): A[]; }' is not assignable to type '{ (...items: B[][]): B[]; (...items: (B | B[])[]): B[]; }'. + Type '{ (...items: ReadonlyArray[]): A[]; (...items: (A | ReadonlyArray)[]): A[]; }' is not assignable to type '{ (...items: ReadonlyArray[]): B[]; (...items: (B | ReadonlyArray)[]): B[]; }'. Type 'A[]' is not assignable to type 'B[]'. Type 'A' is not assignable to type 'B'. Property 'b' is missing in type 'A'. tests/cases/compiler/arrayOfSubtypeIsAssignableToReadonlyArray.ts(18,1): error TS2322: Type 'C' is not assignable to type 'ReadonlyArray'. Types of property 'concat' are incompatible. - Type '{ (...items: A[][]): A[]; (...items: (A | A[])[]): A[]; }' is not assignable to type '{ (...items: B[][]): B[]; (...items: (B | B[])[]): B[]; }'. + Type '{ (...items: ReadonlyArray[]): A[]; (...items: (A | ReadonlyArray)[]): A[]; }' is not assignable to type '{ (...items: ReadonlyArray[]): B[]; (...items: (B | ReadonlyArray)[]): B[]; }'. Type 'A[]' is not assignable to type 'B[]'. @@ -27,7 +27,7 @@ tests/cases/compiler/arrayOfSubtypeIsAssignableToReadonlyArray.ts(18,1): error T ~~~ !!! error TS2322: Type 'A[]' is not assignable to type 'ReadonlyArray'. !!! error TS2322: Types of property 'concat' are incompatible. -!!! error TS2322: Type '{ (...items: A[][]): A[]; (...items: (A | A[])[]): A[]; }' is not assignable to type '{ (...items: B[][]): B[]; (...items: (B | B[])[]): B[]; }'. +!!! error TS2322: Type '{ (...items: ReadonlyArray[]): A[]; (...items: (A | ReadonlyArray)[]): A[]; }' is not assignable to type '{ (...items: ReadonlyArray[]): B[]; (...items: (B | ReadonlyArray)[]): B[]; }'. !!! error TS2322: Type 'A[]' is not assignable to type 'B[]'. !!! error TS2322: Type 'A' is not assignable to type 'B'. !!! error TS2322: Property 'b' is missing in type 'A'. @@ -39,6 +39,6 @@ tests/cases/compiler/arrayOfSubtypeIsAssignableToReadonlyArray.ts(18,1): error T ~~~ !!! error TS2322: Type 'C' is not assignable to type 'ReadonlyArray'. !!! error TS2322: Types of property 'concat' are incompatible. -!!! error TS2322: Type '{ (...items: A[][]): A[]; (...items: (A | A[])[]): A[]; }' is not assignable to type '{ (...items: B[][]): B[]; (...items: (B | B[])[]): B[]; }'. +!!! error TS2322: Type '{ (...items: ReadonlyArray[]): A[]; (...items: (A | ReadonlyArray)[]): A[]; }' is not assignable to type '{ (...items: ReadonlyArray[]): B[]; (...items: (B | ReadonlyArray)[]): B[]; }'. !!! error TS2322: Type 'A[]' is not assignable to type 'B[]'. \ No newline at end of file diff --git a/tests/baselines/reference/concatError.types b/tests/baselines/reference/concatError.types index f97018cd3b9d9..729704789074a 100644 --- a/tests/baselines/reference/concatError.types +++ b/tests/baselines/reference/concatError.types @@ -15,9 +15,9 @@ fa = fa.concat([0]); >fa = fa.concat([0]) : number[] >fa : number[] >fa.concat([0]) : number[] ->fa.concat : { (...items: number[][]): number[]; (...items: (number | number[])[]): number[]; } +>fa.concat : { (...items: ReadonlyArray[]): number[]; (...items: (number | ReadonlyArray)[]): number[]; } >fa : number[] ->concat : { (...items: number[][]): number[]; (...items: (number | number[])[]): number[]; } +>concat : { (...items: ReadonlyArray[]): number[]; (...items: (number | ReadonlyArray)[]): number[]; } >[0] : number[] >0 : 0 @@ -25,9 +25,9 @@ fa = fa.concat(0); >fa = fa.concat(0) : number[] >fa : number[] >fa.concat(0) : number[] ->fa.concat : { (...items: number[][]): number[]; (...items: (number | number[])[]): number[]; } +>fa.concat : { (...items: ReadonlyArray[]): number[]; (...items: (number | ReadonlyArray)[]): number[]; } >fa : number[] ->concat : { (...items: number[][]): number[]; (...items: (number | number[])[]): number[]; } +>concat : { (...items: ReadonlyArray[]): number[]; (...items: (number | ReadonlyArray)[]): number[]; } >0 : 0 diff --git a/tests/baselines/reference/concatTuples.types b/tests/baselines/reference/concatTuples.types index fbb3ce96a5743..147d76efd0436 100644 --- a/tests/baselines/reference/concatTuples.types +++ b/tests/baselines/reference/concatTuples.types @@ -10,9 +10,9 @@ ijs = ijs.concat([[3, 4], [5, 6]]); >ijs = ijs.concat([[3, 4], [5, 6]]) : [number, number][] >ijs : [number, number][] >ijs.concat([[3, 4], [5, 6]]) : [number, number][] ->ijs.concat : { (...items: [number, number][][]): [number, number][]; (...items: ([number, number] | [number, number][])[]): [number, number][]; } +>ijs.concat : { (...items: ReadonlyArray<[number, number]>[]): [number, number][]; (...items: ([number, number] | ReadonlyArray<[number, number]>)[]): [number, number][]; } >ijs : [number, number][] ->concat : { (...items: [number, number][][]): [number, number][]; (...items: ([number, number] | [number, number][])[]): [number, number][]; } +>concat : { (...items: ReadonlyArray<[number, number]>[]): [number, number][]; (...items: ([number, number] | ReadonlyArray<[number, number]>)[]): [number, number][]; } >[[3, 4], [5, 6]] : [number, number][] >[3, 4] : [number, number] >3 : 3 diff --git a/tests/baselines/reference/emitSkipsThisWithRestParameter.types b/tests/baselines/reference/emitSkipsThisWithRestParameter.types index ff6f1e6f73a9a..f8a538acdc2dc 100644 --- a/tests/baselines/reference/emitSkipsThisWithRestParameter.types +++ b/tests/baselines/reference/emitSkipsThisWithRestParameter.types @@ -18,10 +18,10 @@ function rebase(fn: (base: any, ...args: any[]) => any): (...args: any[]) => any >apply : (this: Function, thisArg: any, argArray?: any) => any >this : any >[ this ].concat(args) : any[] ->[ this ].concat : { (...items: any[][]): any[]; (...items: any[]): any[]; } +>[ this ].concat : { (...items: ReadonlyArray[]): any[]; (...items: any[]): any[]; } >[ this ] : any[] >this : any ->concat : { (...items: any[][]): any[]; (...items: any[]): any[]; } +>concat : { (...items: ReadonlyArray[]): any[]; (...items: any[]): any[]; } >args : any[] }; diff --git a/tests/baselines/reference/iteratorSpreadInArray6.errors.txt b/tests/baselines/reference/iteratorSpreadInArray6.errors.txt index e9b6954e6e343..bb64374aaaed0 100644 --- a/tests/baselines/reference/iteratorSpreadInArray6.errors.txt +++ b/tests/baselines/reference/iteratorSpreadInArray6.errors.txt @@ -1,6 +1,10 @@ -tests/cases/conformance/es6/spread/iteratorSpreadInArray6.ts(15,14): error TS2345: Argument of type 'symbol[]' is not assignable to parameter of type 'number | number[]'. - Type 'symbol[]' is not assignable to type 'number[]'. - Type 'symbol' is not assignable to type 'number'. +tests/cases/conformance/es6/spread/iteratorSpreadInArray6.ts(15,14): error TS2345: Argument of type 'symbol[]' is not assignable to parameter of type 'number | ReadonlyArray'. + Type 'symbol[]' is not assignable to type 'ReadonlyArray'. + Types of property 'concat' are incompatible. + Type '{ (...items: ReadonlyArray[]): symbol[]; (...items: (symbol | ReadonlyArray)[]): symbol[]; }' is not assignable to type '{ (...items: ReadonlyArray[]): number[]; (...items: (number | ReadonlyArray)[]): number[]; }'. + Types of parameters 'items' and 'items' are incompatible. + Type 'ReadonlyArray' is not assignable to type 'ReadonlyArray'. + Type 'number' is not assignable to type 'symbol'. ==== tests/cases/conformance/es6/spread/iteratorSpreadInArray6.ts (1 errors) ==== @@ -20,6 +24,10 @@ tests/cases/conformance/es6/spread/iteratorSpreadInArray6.ts(15,14): error TS234 var array: number[] = [0, 1]; array.concat([...new SymbolIterator]); ~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2345: Argument of type 'symbol[]' is not assignable to parameter of type 'number | number[]'. -!!! error TS2345: Type 'symbol[]' is not assignable to type 'number[]'. -!!! error TS2345: Type 'symbol' is not assignable to type 'number'. \ No newline at end of file +!!! error TS2345: Argument of type 'symbol[]' is not assignable to parameter of type 'number | ReadonlyArray'. +!!! error TS2345: Type 'symbol[]' is not assignable to type 'ReadonlyArray'. +!!! error TS2345: Types of property 'concat' are incompatible. +!!! error TS2345: Type '{ (...items: ReadonlyArray[]): symbol[]; (...items: (symbol | ReadonlyArray)[]): symbol[]; }' is not assignable to type '{ (...items: ReadonlyArray[]): number[]; (...items: (number | ReadonlyArray)[]): number[]; }'. +!!! error TS2345: Types of parameters 'items' and 'items' are incompatible. +!!! error TS2345: Type 'ReadonlyArray' is not assignable to type 'ReadonlyArray'. +!!! error TS2345: Type 'number' is not assignable to type 'symbol'. \ No newline at end of file diff --git a/tests/baselines/reference/iteratorSpreadInArray7.types b/tests/baselines/reference/iteratorSpreadInArray7.types index b102c72486b53..3711fc9fed3d7 100644 --- a/tests/baselines/reference/iteratorSpreadInArray7.types +++ b/tests/baselines/reference/iteratorSpreadInArray7.types @@ -35,9 +35,9 @@ var array: symbol[]; array.concat([...new SymbolIterator]); >array.concat([...new SymbolIterator]) : symbol[] ->array.concat : { (...items: symbol[][]): symbol[]; (...items: (symbol | symbol[])[]): symbol[]; } +>array.concat : { (...items: ReadonlyArray[]): symbol[]; (...items: (symbol | ReadonlyArray)[]): symbol[]; } >array : symbol[] ->concat : { (...items: symbol[][]): symbol[]; (...items: (symbol | symbol[])[]): symbol[]; } +>concat : { (...items: ReadonlyArray[]): symbol[]; (...items: (symbol | ReadonlyArray)[]): symbol[]; } >[...new SymbolIterator] : symbol[] >...new SymbolIterator : symbol >new SymbolIterator : SymbolIterator diff --git a/tests/baselines/reference/staticAnonymousTypeNotReferencingTypeParameter.types b/tests/baselines/reference/staticAnonymousTypeNotReferencingTypeParameter.types index 127a8d930c59b..9cd8571bf6129 100644 --- a/tests/baselines/reference/staticAnonymousTypeNotReferencingTypeParameter.types +++ b/tests/baselines/reference/staticAnonymousTypeNotReferencingTypeParameter.types @@ -348,9 +348,9 @@ class ListWrapper { >a : any[] >b : any[] >a.concat(b) : any[] ->a.concat : { (...items: any[][]): any[]; (...items: any[]): any[]; } +>a.concat : { (...items: ReadonlyArray[]): any[]; (...items: any[]): any[]; } >a : any[] ->concat : { (...items: any[][]): any[]; (...items: any[]): any[]; } +>concat : { (...items: ReadonlyArray[]): any[]; (...items: any[]): any[]; } >b : any[] static insert(dit: typeof ListWrapper, list: T[], index: number, value: T) { list.splice(index, 0, value); } From 9bcbc97e14bc343414f432f0e5f0d82192837197 Mon Sep 17 00:00:00 2001 From: Andy Date: Wed, 16 Aug 2017 14:48:46 -0700 Subject: [PATCH 155/237] Replace 'isSourceFileJavaScript(getSourceFileOfNode())' with 'NodeFlags.JavaScriptFile' (#17835) --- src/compiler/checker.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 6778bacd05a9f..ef480099b4d2a 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -19655,7 +19655,7 @@ namespace ts { // checkFunctionOrConstructorSymbol wouldn't be called if we didnt ignore javascript function. const firstDeclaration = find(localSymbol.declarations, // Get first non javascript function declaration - declaration => declaration.kind === node.kind && !isSourceFileJavaScript(getSourceFileOfNode(declaration))); + declaration => declaration.kind === node.kind && !(declaration.flags & NodeFlags.JavaScriptFile)); // Only type check the symbol once if (node === firstDeclaration) { From d4fecd4e46812f06eca7bdf301db8e239dfc7513 Mon Sep 17 00:00:00 2001 From: Andy Date: Wed, 16 Aug 2017 14:48:58 -0700 Subject: [PATCH 156/237] Have `grammarErrorAtPos` take the source file of its argument (#17834) --- src/compiler/checker.ts | 40 ++++++++++++++++++---------------------- 1 file changed, 18 insertions(+), 22 deletions(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index ef480099b4d2a..ce5f5a4f1c522 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -16363,7 +16363,7 @@ namespace ts { */ function checkCallExpression(node: CallExpression | NewExpression): Type { // Grammar checking; stop grammar-checking if checkGrammarTypeArguments return true - checkGrammarTypeArguments(node, node.typeArguments) || checkGrammarArguments(node, node.arguments); + checkGrammarTypeArguments(node, node.typeArguments) || checkGrammarArguments(node.arguments); const signature = getResolvedSignature(node); @@ -16411,7 +16411,7 @@ namespace ts { function checkImportCallExpression(node: ImportCall): Type { // Check grammar of dynamic import - checkGrammarArguments(node, node.arguments) || checkGrammarImportCallExpression(node); + checkGrammarArguments(node.arguments) || checkGrammarImportCallExpression(node); if (node.arguments.length === 0) { return createPromiseReturnType(node, anyType); @@ -18700,7 +18700,7 @@ namespace ts { function checkTypeReferenceNode(node: TypeReferenceNode | ExpressionWithTypeArguments) { checkGrammarTypeArguments(node, node.typeArguments); if (node.kind === SyntaxKind.TypeReference && node.typeName.jsdocDotPos !== undefined && !isInJavaScriptFile(node) && !isInJSDoc(node)) { - grammarErrorAtPos(getSourceFileOfNode(node), node.typeName.jsdocDotPos, 1, Diagnostics.JSDoc_types_can_only_be_used_inside_documentation_comments); + grammarErrorAtPos(node, node.typeName.jsdocDotPos, 1, Diagnostics.JSDoc_types_can_only_be_used_inside_documentation_comments); } const type = getTypeFromTypeReference(node); @@ -24136,8 +24136,7 @@ namespace ts { if (list && list.hasTrailingComma) { const start = list.end - ",".length; const end = list.end; - const sourceFile = getSourceFileOfNode(list[0]); - return grammarErrorAtPos(sourceFile, start, end - start, Diagnostics.Trailing_comma_not_allowed); + return grammarErrorAtPos(list[0], start, end - start, Diagnostics.Trailing_comma_not_allowed); } } @@ -24265,19 +24264,18 @@ namespace ts { checkGrammarForAtLeastOneTypeArgument(node, typeArguments); } - function checkGrammarForOmittedArgument(node: CallExpression | NewExpression, args: NodeArray): boolean { + function checkGrammarForOmittedArgument(args: NodeArray): boolean { if (args) { - const sourceFile = getSourceFileOfNode(node); for (const arg of args) { if (arg.kind === SyntaxKind.OmittedExpression) { - return grammarErrorAtPos(sourceFile, arg.pos, 0, Diagnostics.Argument_expression_expected); + return grammarErrorAtPos(arg, arg.pos, 0, Diagnostics.Argument_expression_expected); } } } } - function checkGrammarArguments(node: CallExpression | NewExpression, args: NodeArray): boolean { - return checkGrammarForOmittedArgument(node, args); + function checkGrammarArguments(args: NodeArray): boolean { + return checkGrammarForOmittedArgument(args); } function checkGrammarHeritageClause(node: HeritageClause): boolean { @@ -24287,8 +24285,7 @@ namespace ts { } if (types && types.length === 0) { const listType = tokenToString(node.token); - const sourceFile = getSourceFileOfNode(node); - return grammarErrorAtPos(sourceFile, types.pos, 0, Diagnostics._0_list_cannot_be_empty, listType); + return grammarErrorAtPos(node, types.pos, 0, Diagnostics._0_list_cannot_be_empty, listType); } return forEach(types, checkGrammarExpressionWithTypeArguments); } @@ -24566,7 +24563,7 @@ namespace ts { return grammarErrorOnNode(accessor.name, Diagnostics.An_accessor_cannot_be_declared_in_an_ambient_context); } else if (accessor.body === undefined && !hasModifier(accessor, ModifierFlags.Abstract)) { - return grammarErrorAtPos(getSourceFileOfNode(accessor), accessor.end - 1, ";".length, Diagnostics._0_expected, "{"); + return grammarErrorAtPos(accessor, accessor.end - 1, ";".length, Diagnostics._0_expected, "{"); } else if (accessor.body && hasModifier(accessor, ModifierFlags.Abstract)) { return grammarErrorOnNode(accessor, Diagnostics.An_abstract_accessor_cannot_have_an_implementation); @@ -24631,7 +24628,7 @@ namespace ts { return true; } else if (node.body === undefined) { - return grammarErrorAtPos(getSourceFileOfNode(node), node.end - 1, ";".length, Diagnostics._0_expected, "{"); + return grammarErrorAtPos(node, node.end - 1, ";".length, Diagnostics._0_expected, "{"); } } @@ -24723,7 +24720,7 @@ namespace ts { if (node.initializer) { // Error on equals token which immediately precedes the initializer - return grammarErrorAtPos(getSourceFileOfNode(node), node.initializer.pos - 1, 1, Diagnostics.A_rest_element_cannot_have_an_initializer); + return grammarErrorAtPos(node, node.initializer.pos - 1, 1, Diagnostics.A_rest_element_cannot_have_an_initializer); } } } @@ -24746,15 +24743,13 @@ namespace ts { else { // Error on equals token which immediate precedes the initializer const equalsTokenLength = "=".length; - return grammarErrorAtPos(getSourceFileOfNode(node), node.initializer.pos - equalsTokenLength, - equalsTokenLength, Diagnostics.Initializers_are_not_allowed_in_ambient_contexts); + return grammarErrorAtPos(node, node.initializer.pos - equalsTokenLength, equalsTokenLength, Diagnostics.Initializers_are_not_allowed_in_ambient_contexts); } } if (node.initializer && !(isConst(node) && isStringOrNumberLiteralExpression(node.initializer))) { // Error on equals token which immediate precedes the initializer const equalsTokenLength = "=".length; - return grammarErrorAtPos(getSourceFileOfNode(node), node.initializer.pos - equalsTokenLength, - equalsTokenLength, Diagnostics.Initializers_are_not_allowed_in_ambient_contexts); + return grammarErrorAtPos(node, node.initializer.pos - equalsTokenLength, equalsTokenLength, Diagnostics.Initializers_are_not_allowed_in_ambient_contexts); } } else if (!node.initializer) { @@ -24823,7 +24818,7 @@ namespace ts { } if (!declarationList.declarations.length) { - return grammarErrorAtPos(getSourceFileOfNode(declarationList), declarations.pos, declarations.end - declarations.pos, Diagnostics.Variable_declaration_list_cannot_be_empty); + return grammarErrorAtPos(declarationList, declarations.pos, declarations.end - declarations.pos, Diagnostics.Variable_declaration_list_cannot_be_empty); } } @@ -24876,7 +24871,8 @@ namespace ts { } } - function grammarErrorAtPos(sourceFile: SourceFile, start: number, length: number, message: DiagnosticMessage, arg0?: any, arg1?: any, arg2?: any): boolean { + function grammarErrorAtPos(nodeForSourceFile: Node, start: number, length: number, message: DiagnosticMessage, arg0?: any, arg1?: any, arg2?: any): boolean { + const sourceFile = getSourceFileOfNode(nodeForSourceFile); if (!hasParseDiagnostics(sourceFile)) { diagnostics.add(createFileDiagnostic(sourceFile, start, length, message, arg0, arg1, arg2)); return true; @@ -24893,7 +24889,7 @@ namespace ts { function checkGrammarConstructorTypeParameters(node: ConstructorDeclaration) { if (node.typeParameters) { - return grammarErrorAtPos(getSourceFileOfNode(node), node.typeParameters.pos, node.typeParameters.end - node.typeParameters.pos, Diagnostics.Type_parameters_cannot_appear_on_a_constructor_declaration); + return grammarErrorAtPos(node, node.typeParameters.pos, node.typeParameters.end - node.typeParameters.pos, Diagnostics.Type_parameters_cannot_appear_on_a_constructor_declaration); } } From 3f50f20d0aeeb08fb38b9357c6b97dd29807f3fd Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Wed, 16 Aug 2017 14:49:44 -0700 Subject: [PATCH 157/237] Updated version in 'src' as well. --- src/compiler/core.ts | 2 +- src/services/shims.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/compiler/core.ts b/src/compiler/core.ts index 728fb433c049b..b55cbb1613306 100644 --- a/src/compiler/core.ts +++ b/src/compiler/core.ts @@ -4,7 +4,7 @@ namespace ts { // WARNING: The script `configureNightly.ts` uses a regexp to parse out these values. // If changing the text in this section, be sure to test `configureNightly` too. - export const versionMajorMinor = "2.5"; + export const versionMajorMinor = "2.6"; /** The version of the TypeScript compiler release */ export const version = `${versionMajorMinor}.0`; } diff --git a/src/services/shims.ts b/src/services/shims.ts index b7c85d2ce82d4..4bfe35900827e 100644 --- a/src/services/shims.ts +++ b/src/services/shims.ts @@ -1222,4 +1222,4 @@ namespace TypeScript.Services { // TODO: it should be moved into a namespace though. /* @internal */ -const toolsVersion = "2.5"; +const toolsVersion = "2.6"; From b7020628c14284dfcb1df8525ac61a22f945c0ab Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Wed, 16 Aug 2017 15:06:51 -0700 Subject: [PATCH 158/237] Addressed code review feedback. --- src/compiler/transformers/ts.ts | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/src/compiler/transformers/ts.ts b/src/compiler/transformers/ts.ts index df07082766743..4c679ea1eee84 100644 --- a/src/compiler/transformers/ts.ts +++ b/src/compiler/transformers/ts.ts @@ -2662,26 +2662,19 @@ namespace ts { } /** - * Determines whether a declaration is *could* be the first declaration with - * the same name emitted in the current scope. Only returns false if we are absolutely - * certain a previous declaration has been emitted. + * Determines whether a declaration is the first declaration with + * the same name emitted in the current scope. */ function isFirstEmittedDeclarationInScope(node: ModuleDeclaration | EnumDeclaration) { - // If the node has a named symbol, then we have enough knowledge to determine - // whether a prior declaration has been emitted. if (currentScopeFirstDeclarationsOfName) { const name = declaredNameInScope(node); return currentScopeFirstDeclarationsOfName.get(name) === node; } - - // Otherwise, we can't be sure. For example, this node could be synthetic. return true; } function declaredNameInScope(node: FunctionDeclaration | ClassDeclaration | ModuleDeclaration | EnumDeclaration): __String { - if (node.name.kind !== SyntaxKind.Identifier) { - Debug.fail(formatSyntaxKind(node.kind) + " should have an identifier name."); - } + Debug.assertNode(node.name, isIdentifier); return (node.name as Identifier).escapedText; } @@ -2760,7 +2753,7 @@ namespace ts { return createNotEmittedStatement(node); } - Debug.assert(isIdentifier(node.name), "A TypeScript namespace should have an Identifier name."); + Debug.assertNode(node.name, isIdentifier, "A TypeScript namespace should have an Identifier name."); enableSubstitutionForNamespaceExports(); const statements: Statement[] = []; From 153b94aeb4931437802d02e193be88f5240a1978 Mon Sep 17 00:00:00 2001 From: Arthur Ozga Date: Wed, 16 Aug 2017 15:28:47 -0700 Subject: [PATCH 159/237] `JsxText` has no leading comments --- src/compiler/utilities.ts | 2 +- .../fourslash/isInMultiLineCommentJsxText.ts | 27 +++++++++++++++++++ 2 files changed, 28 insertions(+), 1 deletion(-) create mode 100644 tests/cases/fourslash/isInMultiLineCommentJsxText.ts diff --git a/src/compiler/utilities.ts b/src/compiler/utilities.ts index 76d242e8b08d8..8c82b9d26dfe0 100644 --- a/src/compiler/utilities.ts +++ b/src/compiler/utilities.ts @@ -635,7 +635,7 @@ namespace ts { } export function getLeadingCommentRangesOfNode(node: Node, sourceFileOfNode: SourceFile) { - return getLeadingCommentRanges(sourceFileOfNode.text, node.pos); + return node.kind !== SyntaxKind.JsxText ? getLeadingCommentRanges(sourceFileOfNode.text, node.pos) : undefined; } export function getLeadingCommentRangesOfNodeFromText(node: Node, text: string) { diff --git a/tests/cases/fourslash/isInMultiLineCommentJsxText.ts b/tests/cases/fourslash/isInMultiLineCommentJsxText.ts new file mode 100644 index 0000000000000..db88f6b9a5580 --- /dev/null +++ b/tests/cases/fourslash/isInMultiLineCommentJsxText.ts @@ -0,0 +1,27 @@ +/// + +// @Filename: file.jsx +////
+//// // /*0*/ +//// /* /*1*/ */ +//// /** +//// * /*2*/ +//// */ +//// foo() /* /*3*/ */ +//// // /*4*/ +//// /* /*5*/ */ +//// /** +//// * /*6*/ +//// */ +////
+////
+//// // /*7*/ +//// /* /*8*/ */ +//// /** +//// * /*9*/ +//// */ + +for (let i = 0; i < 10; ++i) { + goTo.marker(i.toString()); + verify.not.isInCommentAtPosition(/*onlyMultiLine*/ false); +} From 70e4f346bb12ce773173a1d0edad2e3ca6632748 Mon Sep 17 00:00:00 2001 From: Arthur Ozga Date: Wed, 16 Aug 2017 17:35:14 -0700 Subject: [PATCH 160/237] update test --- .../fourslash/indentionsOfCommentBlockAfterFormatting.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/cases/fourslash/indentionsOfCommentBlockAfterFormatting.ts b/tests/cases/fourslash/indentionsOfCommentBlockAfterFormatting.ts index 3b686285b9990..b965b314234fe 100644 --- a/tests/cases/fourslash/indentionsOfCommentBlockAfterFormatting.ts +++ b/tests/cases/fourslash/indentionsOfCommentBlockAfterFormatting.ts @@ -27,13 +27,13 @@ verify.indentationIs(4); goTo.marker("2"); verify.indentationIs(4); goTo.marker("3"); -verify.indentationIs(4); +verify.indentationIs(3); goTo.marker("4"); -verify.indentationIs(4); +verify.indentationIs(3); // Putting a marker in line "*" would bring some error when parsing code in automation. // So move right by 1 offset from marker 4 to locate the caret in this line. edit.moveRight(1); -verify.indentationIs(4); +verify.indentationIs(3); // Putting a marker in line " */" would bring some error when parsing code in automation. // So move left by 1 offset from marker 5 to locate the caret in this line. goTo.marker("5"); From 4b9f5a0f8fa7b1ef9bac8fc12b40479044ab9676 Mon Sep 17 00:00:00 2001 From: Arthur Ozga Date: Wed, 16 Aug 2017 17:36:39 -0700 Subject: [PATCH 161/237] rename tests --- ...rFormatting.ts => indentationInBlockCommentAfterFormatting.ts} | 0 ...ultiLineCommentJsxText.ts => isInMultiLineCommentInJsxText.ts} | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename tests/cases/fourslash/{indentionsOfCommentBlockAfterFormatting.ts => indentationInBlockCommentAfterFormatting.ts} (100%) rename tests/cases/fourslash/{isInMultiLineCommentJsxText.ts => isInMultiLineCommentInJsxText.ts} (100%) diff --git a/tests/cases/fourslash/indentionsOfCommentBlockAfterFormatting.ts b/tests/cases/fourslash/indentationInBlockCommentAfterFormatting.ts similarity index 100% rename from tests/cases/fourslash/indentionsOfCommentBlockAfterFormatting.ts rename to tests/cases/fourslash/indentationInBlockCommentAfterFormatting.ts diff --git a/tests/cases/fourslash/isInMultiLineCommentJsxText.ts b/tests/cases/fourslash/isInMultiLineCommentInJsxText.ts similarity index 100% rename from tests/cases/fourslash/isInMultiLineCommentJsxText.ts rename to tests/cases/fourslash/isInMultiLineCommentInJsxText.ts From 62f16bee557f2cb604a4399c67dea623fc455afe Mon Sep 17 00:00:00 2001 From: Arthur Ozga Date: Wed, 16 Aug 2017 17:36:50 -0700 Subject: [PATCH 162/237] add tests --- .../cases/fourslash/indentationInComments.ts | 32 ++++++++++++++++ .../isInMultiLineCommentInTemplateLiteral.ts | 27 +++++++++++++ .../isInMultiLineCommentOnlyTrivia.ts | 38 +++++++++++++++++++ 3 files changed, 97 insertions(+) create mode 100644 tests/cases/fourslash/indentationInComments.ts create mode 100644 tests/cases/fourslash/isInMultiLineCommentInTemplateLiteral.ts create mode 100644 tests/cases/fourslash/isInMultiLineCommentOnlyTrivia.ts diff --git a/tests/cases/fourslash/indentationInComments.ts b/tests/cases/fourslash/indentationInComments.ts new file mode 100644 index 0000000000000..d54ec9daacb93 --- /dev/null +++ b/tests/cases/fourslash/indentationInComments.ts @@ -0,0 +1,32 @@ +/// + +//// // /*0_0*/ +//// /* /*0_1*/ +//// some text /*0_2*/ +//// some text /*1_0*/ +//// * some text /*0_3*/ +//// /*0_4*/ +//// */ +//// function foo() { +//// // /*4_0*/ +//// /** /*4_1*/ +//// * /*4_2*/ +//// * /*4_3*/ +//// /*7_0*/ +//// */ +//// /* /*4_4*/ */ +//// } + +for (let i = 0; i < 5; ++i) { + goTo.marker(`0_${i}`); + verify.indentationIs(0); + + goTo.marker(`4_${i}`); + verify.indentationIs(4); +} + +goTo.marker(`1_0`); +verify.indentationIs(1); + +goTo.marker(`7_0`); +verify.indentationIs(7); diff --git a/tests/cases/fourslash/isInMultiLineCommentInTemplateLiteral.ts b/tests/cases/fourslash/isInMultiLineCommentInTemplateLiteral.ts new file mode 100644 index 0000000000000..ca6f11499da04 --- /dev/null +++ b/tests/cases/fourslash/isInMultiLineCommentInTemplateLiteral.ts @@ -0,0 +1,27 @@ +/// + +// @Filename: file.jsx +//// ` +//// // /*0*/ +//// /* /*1*/ */ +//// /** +//// * /*2*/ +//// */ +//// foo() +//// // /*3*/ +//// /* /*4*/ */ +//// /** +//// * /*5*/ +//// */ +//// ` +//// ` +//// // /*6*/ +//// /* /*7*/ */ +//// /** +//// * /*8*/ +//// */ + +for (let i = 0; i < 9; ++i) { + goTo.marker(i.toString()); + verify.not.isInCommentAtPosition(/*onlyMultiLine*/ false); +} \ No newline at end of file diff --git a/tests/cases/fourslash/isInMultiLineCommentOnlyTrivia.ts b/tests/cases/fourslash/isInMultiLineCommentOnlyTrivia.ts new file mode 100644 index 0000000000000..e279af476992d --- /dev/null +++ b/tests/cases/fourslash/isInMultiLineCommentOnlyTrivia.ts @@ -0,0 +1,38 @@ +/// + +//// /* x */ +//// /** +//// * @param this doesn't make sense here. +//// */ +//// // x + +const firstCommentStart = 0; +const firstCommentEnd = 7; +goTo.position(firstCommentStart); +verify.not.isInCommentAtPosition(/*onlyMultiLine*/ true); + +goTo.position(firstCommentStart + 1); +verify.isInCommentAtPosition(/*onlyMultiLine*/ true); +goTo.position(firstCommentEnd - 1); +verify.isInCommentAtPosition(/*onlyMultiLine*/ true); + +goTo.position(firstCommentEnd); +verify.not.isInCommentAtPosition(/*onlyMultiLine*/ true); + +const multilineJsDocStart = firstCommentEnd + 1; +const multilineJsDocEnd = multilineJsDocStart + 49; + +goTo.position(multilineJsDocStart); +verify.not.isInCommentAtPosition(/*onlyMultiLine*/ true); +goTo.position(multilineJsDocStart + 1); +verify.isInCommentAtPosition(/*onlyMultiLine*/ true); +goTo.position(multilineJsDocEnd - 1); +verify.isInCommentAtPosition(/*onlyMultiLine*/ true); +goTo.position(multilineJsDocEnd); +verify.not.isInCommentAtPosition(/*onlyMultiLine*/ true); + +const singleLineCommentStart = multilineJsDocEnd + 1; + +goTo.position(singleLineCommentStart + 1); +verify.not.isInCommentAtPosition(/*onlyMultiLine*/ true); +verify.isInCommentAtPosition(/*onlyMultiLine*/ false); \ No newline at end of file From 23ca368020548d4a9b6d56e6719c5eb86cdcd68f Mon Sep 17 00:00:00 2001 From: Arthur Ozga Date: Wed, 16 Aug 2017 17:51:29 -0700 Subject: [PATCH 163/237] Use simpler indentation for comments * When in a multi-line comment, we would have liked to use the start of the comment as a reference point for the indentation inside the comment, but determining the number of columns shifted for the comment start woudl require determining the length w/r/t graphemes, which we do not currently implement. We would like to avoid taking on a runtime dependency on a grapheme-parsing library. Instead, we look at the indentation level on the previoud line or start of the comment as a reference point, and correct shift for lines starting with an asterisk. --- src/services/formatting/formatting.ts | 17 ---------------- src/services/formatting/smartIndenter.ts | 25 +++++++++++++++++++++--- 2 files changed, 22 insertions(+), 20 deletions(-) diff --git a/src/services/formatting/formatting.ts b/src/services/formatting/formatting.ts index c34585c5bca45..22602d6031cdf 100644 --- a/src/services/formatting/formatting.ts +++ b/src/services/formatting/formatting.ts @@ -1152,23 +1152,6 @@ namespace ts.formatting { } } - /** - * Gets the indentation level of the multi-line comment enclosing position, - * and a negative value if the position is not in a multi-line comment. - * - * @param precedingToken Must be the result of `findPrecedingToken(position, sourceFile)`. - */ - export function getIndentationOfEnclosingMultiLineComment(sourceFile: SourceFile, position: number, precedingToken: Node | undefined, options: EditorSettings): number { - const range = getRangeOfEnclosingComment(sourceFile, position, /*onlyMultiLine*/ true, precedingToken || null); // tslint:disable-line:no-null-keyword - if (range) { - const commentStart = range.pos; - const commentLineStart = getLineStartPositionForPosition(commentStart, sourceFile); - const { column, character } = SmartIndenter.findFirstNonWhitespaceCharacterAndColumn(commentLineStart, commentStart, sourceFile, options); - return column + /*length after whitespace ends*/ range.pos - (commentLineStart + character); - } - return -1; - } - /** * @param precedingToken pass `null` if preceding token was already computed and result was `undefined`. */ diff --git a/src/services/formatting/smartIndenter.ts b/src/services/formatting/smartIndenter.ts index c868ce048473c..5af93bc025f9f 100644 --- a/src/services/formatting/smartIndenter.ts +++ b/src/services/formatting/smartIndenter.ts @@ -32,9 +32,28 @@ namespace ts.formatting { } const precedingToken = findPrecedingToken(position, sourceFile); - const indentationOfEnclosingMultiLineComment = getIndentationOfEnclosingMultiLineComment(sourceFile, position, precedingToken, options); - if (indentationOfEnclosingMultiLineComment >= 0) { - return indentationOfEnclosingMultiLineComment; + + const enclosingCommentRange = getRangeOfEnclosingComment(sourceFile, position, /*onlyMultiLine*/ true, precedingToken || null); // tslint:disable-line:no-null-keyword + if (enclosingCommentRange) { + const previousLine = getLineAndCharacterOfPosition(sourceFile, position).line - 1; + const commentStartLine = getLineAndCharacterOfPosition(sourceFile, enclosingCommentRange.pos).line; + + Debug.assert(commentStartLine >= 0); + + if (previousLine <= commentStartLine) { + return findFirstNonWhitespaceColumn(getStartPositionOfLine(commentStartLine, sourceFile), position, sourceFile, options); + } + + // get first character of previous line -- if it is '*', move back one more character (or stay at 0) + const startPostionOfLine = getStartPositionOfLine(previousLine, sourceFile); + const { column, character } = findFirstNonWhitespaceCharacterAndColumn(startPostionOfLine, position, sourceFile, options); + + if (column === 0) { + return column; + } + + const firstNonWhitespaceCharacterCode = sourceFile.text.charCodeAt(startPostionOfLine + character); + return firstNonWhitespaceCharacterCode === CharacterCodes.asterisk ? column - 1 : column; } if (!precedingToken) { From b7bc7d889ec432cea7c9a681ed284eb6162f3baf Mon Sep 17 00:00:00 2001 From: Arthur Ozga Date: Wed, 16 Aug 2017 17:56:20 -0700 Subject: [PATCH 164/237] clarify `JsxText` handling --- src/services/utilities.ts | 32 +++++++++++++++++++++++--------- 1 file changed, 23 insertions(+), 9 deletions(-) diff --git a/src/services/utilities.ts b/src/services/utilities.ts index 160ef6db4512e..2ee46c28ca953 100644 --- a/src/services/utilities.ts +++ b/src/services/utilities.ts @@ -720,8 +720,14 @@ namespace ts { } } - export function findPrecedingToken(position: number, sourceFile: SourceFile, startNode?: Node, includeJsDoc?: boolean): Node { - return find(startNode || sourceFile); + /** + * Finds the rightmost token satisfying `token.end <= position`, + * excluding `JsxText` tokens containing only whitespace. + */ + export function findPrecedingToken(position: number, sourceFile: SourceFile, startNode?: Node, includeJsDoc?: boolean): Node | undefined { + const result = find(startNode || sourceFile); + Debug.assert(!(result && isWhiteSpaceOnlyJsxText(result))); + return result; function findRightmostToken(n: Node): Node { if (isToken(n)) { @@ -743,18 +749,16 @@ namespace ts { for (let i = 0; i < children.length; i++) { const child = children[i]; // Note that the span of a node's tokens is [node.getStart(...), node.end). - // Given that `position < child.end` and child has constiutent tokens*, we distinguish these cases: + // Given that `position < child.end` and child has constituent tokens, we distinguish these cases: // 1) `position` precedes `child`'s tokens or `child` has no tokens (ie: in a comment or whitespace preceding `child`): // we need to find the last token in a previous child. // 2) `position` is within the same span: we recurse on `child`. - // * JsxText is exceptional in that its tokens are (non-trivia) whitespace, which we do not want to return. - // TODO(arozga): shouldn't `findRightmost...` need to handle JsxText? if (position < child.end) { const start = child.getStart(sourceFile, includeJsDoc); const lookInPreviousChild = (start >= position) || // cursor in the leading trivia !nodeHasTokens(child) || - (child.kind === SyntaxKind.JsxText && start === child.end); // whitespace only JsxText + isWhiteSpaceOnlyJsxText(child); if (lookInPreviousChild) { // actual start of the node is past the position - previous token should be at the end of previous child @@ -781,11 +785,16 @@ namespace ts { } /** - * Finds the rightmost child to the left of `children[exclusiveStartPosition]` which has constituent tokens. + * Finds the rightmost child to the left of `children[exclusiveStartPosition]` which is a non-all-whitespace token or has constituent tokens. */ function findRightmostChildNodeWithTokens(children: Node[], exclusiveStartPosition: number): Node { for (let i = exclusiveStartPosition - 1; i >= 0; i--) { - if (nodeHasTokens(children[i])) { + const child = children[i]; + + if (isWhiteSpaceOnlyJsxText(child)) { + Debug.assert(i > 0, "`JsxText` tokens should not be the first child of `JsxElement | JsxSelfClosingElement`"); + } + else if (nodeHasTokens(children[i])) { return children[i]; } } @@ -853,6 +862,11 @@ namespace ts { return false; } + export function isWhiteSpaceOnlyJsxText(node: Node): node is JsxText { + return isJsxText(node) && node.containsOnlyWhiteSpaces; + } + + export function isInTemplateString(sourceFile: SourceFile, position: number) { const token = getTokenAtPosition(sourceFile, position, /*includeJsDocComment*/ false); return isTemplateLiteralKind(token.kind) && position > token.getStart(sourceFile); @@ -888,7 +902,7 @@ namespace ts { function nodeHasTokens(n: Node): boolean { // If we have a token or node that has a non-zero width, it must have tokens. - // Note, that getWidth() does not take trivia into account. + // Note: getWidth() does not take trivia into account. return n.getWidth() !== 0; } From 6029b5cce80fe2172273c9a253e230c5813dde09 Mon Sep 17 00:00:00 2001 From: Arthur Ozga Date: Wed, 16 Aug 2017 18:12:28 -0700 Subject: [PATCH 165/237] cleanup --- src/services/formatting/smartIndenter.ts | 1 - src/services/utilities.ts | 3 +-- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/src/services/formatting/smartIndenter.ts b/src/services/formatting/smartIndenter.ts index 5af93bc025f9f..4de2e5765e51f 100644 --- a/src/services/formatting/smartIndenter.ts +++ b/src/services/formatting/smartIndenter.ts @@ -44,7 +44,6 @@ namespace ts.formatting { return findFirstNonWhitespaceColumn(getStartPositionOfLine(commentStartLine, sourceFile), position, sourceFile, options); } - // get first character of previous line -- if it is '*', move back one more character (or stay at 0) const startPostionOfLine = getStartPositionOfLine(previousLine, sourceFile); const { column, character } = findFirstNonWhitespaceCharacterAndColumn(startPostionOfLine, position, sourceFile, options); diff --git a/src/services/utilities.ts b/src/services/utilities.ts index ee099a50a73f2..e8f01bb078549 100644 --- a/src/services/utilities.ts +++ b/src/services/utilities.ts @@ -772,7 +772,7 @@ namespace ts { } } - Debug.assert(startNode !== undefined || n.kind === SyntaxKind.SourceFile || isJSDocCommentContainingNode(n) || n.kind === SyntaxKind.JsxSelfClosingElement); + Debug.assert(startNode !== undefined || n.kind === SyntaxKind.SourceFile || isJSDocCommentContainingNode(n)); // Here we know that none of child token nodes embrace the position, // the only known case is when position is at the end of the file. @@ -866,7 +866,6 @@ namespace ts { return isJsxText(node) && node.containsOnlyWhiteSpaces; } - export function isInTemplateString(sourceFile: SourceFile, position: number) { const token = getTokenAtPosition(sourceFile, position, /*includeJsDocComment*/ false); return isTemplateLiteralKind(token.kind) && position > token.getStart(sourceFile); From 760ef44c36e3dc6e4a88800fd094f925882ec94b Mon Sep 17 00:00:00 2001 From: Arthur Ozga Date: Wed, 16 Aug 2017 18:48:27 -0700 Subject: [PATCH 166/237] test if `onlyMultiLine` flag changes answer --- src/harness/fourslash.ts | 15 +++++++----- tests/cases/fourslash/fourslash.ts | 2 +- tests/cases/fourslash/isInMultiLineComment.ts | 23 +++++++++---------- .../isInMultiLineCommentInJsxText.ts | 2 +- .../isInMultiLineCommentInTemplateLiteral.ts | 2 +- .../isInMultiLineCommentOnlyTrivia.ts | 19 ++++++++------- 6 files changed, 32 insertions(+), 31 deletions(-) diff --git a/src/harness/fourslash.ts b/src/harness/fourslash.ts index f50ebcc3a1474..32c9fb67da0d0 100644 --- a/src/harness/fourslash.ts +++ b/src/harness/fourslash.ts @@ -2508,16 +2508,19 @@ namespace FourSlash { } } - public verifySpanOfEnclosingComment(negative: boolean, onlyMultiLine: boolean) { + public verifySpanOfEnclosingComment(negative: boolean, onlyMultiLineDiverges?: boolean) { const expected = !negative; const position = this.currentCaretPosition; const fileName = this.activeFile.fileName; - const actual = !!this.languageService.getSpanOfEnclosingComment(fileName, position, /*onlyMultiLine*/ onlyMultiLine); - if (expected !== actual) { + const actual = !!this.languageService.getSpanOfEnclosingComment(fileName, position, /*onlyMultiLine*/ false); + const actualOnlyMultiLine = !!this.languageService.getSpanOfEnclosingComment(fileName, position, /*onlyMultiLine*/ true); + if (expected !== actual || onlyMultiLineDiverges === (actual === actualOnlyMultiLine)) { this.raiseError(`verifySpanOfEnclosingComment failed: position: '${position}' fileName: '${fileName}' - onlyMultiLine: '${onlyMultiLine}' + onlyMultiLineDiverges: '${onlyMultiLineDiverges}' + actual: '${actual}' + actualOnlyMultiLine: '${actualOnlyMultiLine}' expected: '${expected}'.`); } } @@ -3662,8 +3665,8 @@ namespace FourSlashInterface { this.state.verifyBraceCompletionAtPosition(this.negative, openingBrace); } - public isInCommentAtPosition(onlyMultiLine: boolean) { - this.state.verifySpanOfEnclosingComment(this.negative, onlyMultiLine); + public isInCommentAtPosition(onlyMultiLineDiverges?: boolean) { + this.state.verifySpanOfEnclosingComment(this.negative, onlyMultiLineDiverges); } public codeFixAvailable() { diff --git a/tests/cases/fourslash/fourslash.ts b/tests/cases/fourslash/fourslash.ts index 088cbfaa49071..87e11ae4262d8 100644 --- a/tests/cases/fourslash/fourslash.ts +++ b/tests/cases/fourslash/fourslash.ts @@ -153,7 +153,7 @@ declare namespace FourSlashInterface { typeDefinitionCountIs(expectedCount: number): void; implementationListIsEmpty(): void; isValidBraceCompletionAtPosition(openingBrace?: string): void; - isInCommentAtPosition(onlyMultiLine: boolean): void; + isInCommentAtPosition(onlyMultiLineDiverges?: boolean): void; codeFixAvailable(): void; applicableRefactorAvailableAtMarker(markerName: string): void; codeFixDiagnosticsAvailableAtMarkers(markerNames: string[], diagnosticCode?: number): void; diff --git a/tests/cases/fourslash/isInMultiLineComment.ts b/tests/cases/fourslash/isInMultiLineComment.ts index 3dc8a6e15d138..96da4f0021f8f 100644 --- a/tests/cases/fourslash/isInMultiLineComment.ts +++ b/tests/cases/fourslash/isInMultiLineComment.ts @@ -11,37 +11,36 @@ const firstCommentStart = 0; const firstCommentEnd = 7; goTo.position(firstCommentStart); -verify.not.isInCommentAtPosition(/*onlyMultiLine*/ true); +verify.not.isInCommentAtPosition(); goTo.position(firstCommentStart + 1); -verify.isInCommentAtPosition(/*onlyMultiLine*/ true); +verify.isInCommentAtPosition(); goTo.position(firstCommentEnd - 1); -verify.isInCommentAtPosition(/*onlyMultiLine*/ true); +verify.isInCommentAtPosition(); goTo.position(firstCommentEnd); -verify.not.isInCommentAtPosition(/*onlyMultiLine*/ true); +verify.not.isInCommentAtPosition(); const multilineJsDocStart = firstCommentEnd + 1; const multilineJsDocEnd = multilineJsDocStart + 49; goTo.position(multilineJsDocStart); -verify.not.isInCommentAtPosition(/*onlyMultiLine*/ true); +verify.not.isInCommentAtPosition(); goTo.position(multilineJsDocStart + 1); -verify.isInCommentAtPosition(/*onlyMultiLine*/ true); +verify.isInCommentAtPosition(); goTo.position(multilineJsDocEnd - 1); -verify.isInCommentAtPosition(/*onlyMultiLine*/ true); +verify.isInCommentAtPosition(); goTo.position(multilineJsDocEnd); -verify.not.isInCommentAtPosition(/*onlyMultiLine*/ true); +verify.not.isInCommentAtPosition(); const singleLineCommentStart = multilineJsDocEnd + 1; goTo.position(singleLineCommentStart + 1); -verify.not.isInCommentAtPosition(/*onlyMultiLine*/ true); -verify.isInCommentAtPosition(/*onlyMultiLine*/ false); +verify.isInCommentAtPosition(/*onlyMultiLineDiverges*/ true); const postNodeCommentStart = singleLineCommentStart + 16; goTo.position(postNodeCommentStart); -verify.not.isInCommentAtPosition(/*onlyMultiLine*/ true); +verify.not.isInCommentAtPosition(); goTo.position(postNodeCommentStart + 1); -verify.isInCommentAtPosition(/*onlyMultiLine*/ true); +verify.isInCommentAtPosition(); diff --git a/tests/cases/fourslash/isInMultiLineCommentInJsxText.ts b/tests/cases/fourslash/isInMultiLineCommentInJsxText.ts index db88f6b9a5580..1664ca0cd1bcd 100644 --- a/tests/cases/fourslash/isInMultiLineCommentInJsxText.ts +++ b/tests/cases/fourslash/isInMultiLineCommentInJsxText.ts @@ -23,5 +23,5 @@ for (let i = 0; i < 10; ++i) { goTo.marker(i.toString()); - verify.not.isInCommentAtPosition(/*onlyMultiLine*/ false); + verify.not.isInCommentAtPosition(); } diff --git a/tests/cases/fourslash/isInMultiLineCommentInTemplateLiteral.ts b/tests/cases/fourslash/isInMultiLineCommentInTemplateLiteral.ts index ca6f11499da04..c3e2ae92e8ace 100644 --- a/tests/cases/fourslash/isInMultiLineCommentInTemplateLiteral.ts +++ b/tests/cases/fourslash/isInMultiLineCommentInTemplateLiteral.ts @@ -23,5 +23,5 @@ for (let i = 0; i < 9; ++i) { goTo.marker(i.toString()); - verify.not.isInCommentAtPosition(/*onlyMultiLine*/ false); + verify.not.isInCommentAtPosition(); } \ No newline at end of file diff --git a/tests/cases/fourslash/isInMultiLineCommentOnlyTrivia.ts b/tests/cases/fourslash/isInMultiLineCommentOnlyTrivia.ts index e279af476992d..41c9bbadfd8eb 100644 --- a/tests/cases/fourslash/isInMultiLineCommentOnlyTrivia.ts +++ b/tests/cases/fourslash/isInMultiLineCommentOnlyTrivia.ts @@ -9,30 +9,29 @@ const firstCommentStart = 0; const firstCommentEnd = 7; goTo.position(firstCommentStart); -verify.not.isInCommentAtPosition(/*onlyMultiLine*/ true); +verify.not.isInCommentAtPosition(); goTo.position(firstCommentStart + 1); -verify.isInCommentAtPosition(/*onlyMultiLine*/ true); +verify.isInCommentAtPosition(); goTo.position(firstCommentEnd - 1); -verify.isInCommentAtPosition(/*onlyMultiLine*/ true); +verify.isInCommentAtPosition(); goTo.position(firstCommentEnd); -verify.not.isInCommentAtPosition(/*onlyMultiLine*/ true); +verify.not.isInCommentAtPosition(); const multilineJsDocStart = firstCommentEnd + 1; const multilineJsDocEnd = multilineJsDocStart + 49; goTo.position(multilineJsDocStart); -verify.not.isInCommentAtPosition(/*onlyMultiLine*/ true); +verify.not.isInCommentAtPosition(); goTo.position(multilineJsDocStart + 1); -verify.isInCommentAtPosition(/*onlyMultiLine*/ true); +verify.isInCommentAtPosition(); goTo.position(multilineJsDocEnd - 1); -verify.isInCommentAtPosition(/*onlyMultiLine*/ true); +verify.isInCommentAtPosition(); goTo.position(multilineJsDocEnd); -verify.not.isInCommentAtPosition(/*onlyMultiLine*/ true); +verify.not.isInCommentAtPosition(); const singleLineCommentStart = multilineJsDocEnd + 1; goTo.position(singleLineCommentStart + 1); -verify.not.isInCommentAtPosition(/*onlyMultiLine*/ true); -verify.isInCommentAtPosition(/*onlyMultiLine*/ false); \ No newline at end of file +verify.isInCommentAtPosition(/*onlyMultiLineDiverges*/ true); \ No newline at end of file From babb88a0aa4f240baee1264f68e77f1a5be67bfb Mon Sep 17 00:00:00 2001 From: Andy Date: Thu, 17 Aug 2017 06:52:15 -0700 Subject: [PATCH 167/237] Remove duplicate function (#17807) --- src/services/refactors/extractMethod.ts | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/services/refactors/extractMethod.ts b/src/services/refactors/extractMethod.ts index de163d0771772..cf58ede99bdb3 100644 --- a/src/services/refactors/extractMethod.ts +++ b/src/services/refactors/extractMethod.ts @@ -830,10 +830,6 @@ namespace ts.refactor.extractMethod { } } - function isModuleBlock(n: Node): n is ModuleBlock { - return n.kind === SyntaxKind.ModuleBlock; - } - function isReadonlyArray(v: any): v is ReadonlyArray { return isArray(v); } From b8e0dedac03c0049e7e8500a93f99b8f383c75d4 Mon Sep 17 00:00:00 2001 From: Nathan Shively-Sanders Date: Thu, 17 Aug 2017 12:40:10 -0700 Subject: [PATCH 168/237] Fix #17069 and #15371 1. `T[K]` now correctly produces `number` when `K extends string, T extends Record`. 2. `T[K]` no longer allows any type to be assigned to it when `T extends object, K extends keyof T`. Previously both of these cases failed in getConstraintOfIndexedAccessType because both bases followed `K`'s base constraint to `string` and then incorrectly produced `any` for types (like `object`) with no string index signature. In (1), this produced an error in checkBinaryLikeExpression`. In (2), this failed to produce an error in `checkTypeRelatedTo`. --- src/compiler/checker.ts | 15 +++++++++++---- src/compiler/core.ts | 2 +- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 6778bacd05a9f..ff3111776299a 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -5912,7 +5912,13 @@ namespace ts { return transformed; } const baseObjectType = getBaseConstraintOfType(type.objectType); - const baseIndexType = getBaseConstraintOfType(type.indexType); + const keepTypeParameterForMappedType = baseObjectType && getObjectFlags(baseObjectType) & ObjectFlags.Mapped && type.indexType.flags & TypeFlags.TypeParameter; + const baseIndexType = !keepTypeParameterForMappedType && getBaseConstraintOfType(type.indexType); + if (baseObjectType && baseIndexType === stringType && !getIndexInfoOfType(baseObjectType, IndexKind.String)) { + // getIndexedAccessType returns `any` for X[string] where X doesn't have an index signature. + // instead, return undefined so that the indexed access check fails + return undefined; + } return baseObjectType || baseIndexType ? getIndexedAccessType(baseObjectType || type.objectType, baseIndexType || type.indexType) : undefined; } @@ -5962,8 +5968,9 @@ namespace ts { function computeBaseConstraint(t: Type): Type { if (t.flags & TypeFlags.TypeParameter) { const constraint = getConstraintFromTypeParameter(t); - return (t).isThisType ? constraint : - constraint ? getBaseConstraint(constraint) : undefined; + return ((t as TypeParameter).isThisType || !constraint || getObjectFlags(constraint) & ObjectFlags.Mapped) ? + constraint : + getBaseConstraint(constraint); } if (t.flags & TypeFlags.UnionOrIntersection) { const types = (t).types; @@ -9290,7 +9297,7 @@ namespace ts { } else if (target.flags & TypeFlags.IndexedAccess) { // A type S is related to a type T[K] if S is related to A[K], where K is string-like and - // A is the apparent type of S. + // A is the apparent type of T. const constraint = getConstraintOfType(target); if (constraint) { if (result = isRelatedTo(source, constraint, reportErrors)) { diff --git a/src/compiler/core.ts b/src/compiler/core.ts index 85514987b3b03..6649bb21fe562 100644 --- a/src/compiler/core.ts +++ b/src/compiler/core.ts @@ -718,7 +718,7 @@ namespace ts { export function sum, K extends string>(array: T[], prop: K): number { let result = 0; for (const v of array) { - // Note: we need the following type assertion because of GH #17069 + // TODO: Remove the following type assertion once the fix for #17069 is merged result += v[prop] as number; } return result; From 1b4f90705fb042ecf7773c00a6f366a716fa7aa4 Mon Sep 17 00:00:00 2001 From: Nathan Shively-Sanders Date: Thu, 17 Aug 2017 12:45:20 -0700 Subject: [PATCH 169/237] Test getConstraintOfIndexedAccess fixes and update baselines --- ...ionOperatorWithConstrainedTypeParameter.js | 27 ++++++++ ...eratorWithConstrainedTypeParameter.symbols | 54 +++++++++++++++ ...OperatorWithConstrainedTypeParameter.types | 64 ++++++++++++++++++ ...tiveConstraintOfIndexAccessType.errors.txt | 67 +++++++++++++++++++ ...nonPrimitiveConstraintOfIndexAccessType.js | 67 +++++++++++++++++++ ...ionOperatorWithConstrainedTypeParameter.ts | 11 +++ ...nonPrimitiveConstraintOfIndexAccessType.ts | 32 +++++++++ 7 files changed, 322 insertions(+) create mode 100644 tests/baselines/reference/additionOperatorWithConstrainedTypeParameter.js create mode 100644 tests/baselines/reference/additionOperatorWithConstrainedTypeParameter.symbols create mode 100644 tests/baselines/reference/additionOperatorWithConstrainedTypeParameter.types create mode 100644 tests/baselines/reference/nonPrimitiveConstraintOfIndexAccessType.errors.txt create mode 100644 tests/baselines/reference/nonPrimitiveConstraintOfIndexAccessType.js create mode 100644 tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithConstrainedTypeParameter.ts create mode 100644 tests/cases/conformance/types/nonPrimitive/nonPrimitiveConstraintOfIndexAccessType.ts diff --git a/tests/baselines/reference/additionOperatorWithConstrainedTypeParameter.js b/tests/baselines/reference/additionOperatorWithConstrainedTypeParameter.js new file mode 100644 index 0000000000000..1366e242182e4 --- /dev/null +++ b/tests/baselines/reference/additionOperatorWithConstrainedTypeParameter.js @@ -0,0 +1,27 @@ +//// [additionOperatorWithConstrainedTypeParameter.ts] +// test for #17069 +function sum, K extends string>(n: number, v: T, k: K) { + n = n + v[k]; + n += v[k]; // += should work the same way +} +function realSum, K extends string>(n: number, vs: T[], k: K) { + for (const v of vs) { + n = n + v[k]; + n += v[k]; + } +} + + +//// [additionOperatorWithConstrainedTypeParameter.js] +// test for #17069 +function sum(n, v, k) { + n = n + v[k]; + n += v[k]; // += should work the same way +} +function realSum(n, vs, k) { + for (var _i = 0, vs_1 = vs; _i < vs_1.length; _i++) { + var v = vs_1[_i]; + n = n + v[k]; + n += v[k]; + } +} diff --git a/tests/baselines/reference/additionOperatorWithConstrainedTypeParameter.symbols b/tests/baselines/reference/additionOperatorWithConstrainedTypeParameter.symbols new file mode 100644 index 0000000000000..e7055c1e38f8d --- /dev/null +++ b/tests/baselines/reference/additionOperatorWithConstrainedTypeParameter.symbols @@ -0,0 +1,54 @@ +=== tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithConstrainedTypeParameter.ts === +// test for #17069 +function sum, K extends string>(n: number, v: T, k: K) { +>sum : Symbol(sum, Decl(additionOperatorWithConstrainedTypeParameter.ts, 0, 0)) +>T : Symbol(T, Decl(additionOperatorWithConstrainedTypeParameter.ts, 1, 13)) +>Record : Symbol(Record, Decl(lib.d.ts, --, --)) +>K : Symbol(K, Decl(additionOperatorWithConstrainedTypeParameter.ts, 1, 41)) +>K : Symbol(K, Decl(additionOperatorWithConstrainedTypeParameter.ts, 1, 41)) +>n : Symbol(n, Decl(additionOperatorWithConstrainedTypeParameter.ts, 1, 60)) +>v : Symbol(v, Decl(additionOperatorWithConstrainedTypeParameter.ts, 1, 70)) +>T : Symbol(T, Decl(additionOperatorWithConstrainedTypeParameter.ts, 1, 13)) +>k : Symbol(k, Decl(additionOperatorWithConstrainedTypeParameter.ts, 1, 76)) +>K : Symbol(K, Decl(additionOperatorWithConstrainedTypeParameter.ts, 1, 41)) + + n = n + v[k]; +>n : Symbol(n, Decl(additionOperatorWithConstrainedTypeParameter.ts, 1, 60)) +>n : Symbol(n, Decl(additionOperatorWithConstrainedTypeParameter.ts, 1, 60)) +>v : Symbol(v, Decl(additionOperatorWithConstrainedTypeParameter.ts, 1, 70)) +>k : Symbol(k, Decl(additionOperatorWithConstrainedTypeParameter.ts, 1, 76)) + + n += v[k]; // += should work the same way +>n : Symbol(n, Decl(additionOperatorWithConstrainedTypeParameter.ts, 1, 60)) +>v : Symbol(v, Decl(additionOperatorWithConstrainedTypeParameter.ts, 1, 70)) +>k : Symbol(k, Decl(additionOperatorWithConstrainedTypeParameter.ts, 1, 76)) +} +function realSum, K extends string>(n: number, vs: T[], k: K) { +>realSum : Symbol(realSum, Decl(additionOperatorWithConstrainedTypeParameter.ts, 4, 1)) +>T : Symbol(T, Decl(additionOperatorWithConstrainedTypeParameter.ts, 5, 17)) +>Record : Symbol(Record, Decl(lib.d.ts, --, --)) +>K : Symbol(K, Decl(additionOperatorWithConstrainedTypeParameter.ts, 5, 45)) +>K : Symbol(K, Decl(additionOperatorWithConstrainedTypeParameter.ts, 5, 45)) +>n : Symbol(n, Decl(additionOperatorWithConstrainedTypeParameter.ts, 5, 64)) +>vs : Symbol(vs, Decl(additionOperatorWithConstrainedTypeParameter.ts, 5, 74)) +>T : Symbol(T, Decl(additionOperatorWithConstrainedTypeParameter.ts, 5, 17)) +>k : Symbol(k, Decl(additionOperatorWithConstrainedTypeParameter.ts, 5, 83)) +>K : Symbol(K, Decl(additionOperatorWithConstrainedTypeParameter.ts, 5, 45)) + + for (const v of vs) { +>v : Symbol(v, Decl(additionOperatorWithConstrainedTypeParameter.ts, 6, 14)) +>vs : Symbol(vs, Decl(additionOperatorWithConstrainedTypeParameter.ts, 5, 74)) + + n = n + v[k]; +>n : Symbol(n, Decl(additionOperatorWithConstrainedTypeParameter.ts, 5, 64)) +>n : Symbol(n, Decl(additionOperatorWithConstrainedTypeParameter.ts, 5, 64)) +>v : Symbol(v, Decl(additionOperatorWithConstrainedTypeParameter.ts, 6, 14)) +>k : Symbol(k, Decl(additionOperatorWithConstrainedTypeParameter.ts, 5, 83)) + + n += v[k]; +>n : Symbol(n, Decl(additionOperatorWithConstrainedTypeParameter.ts, 5, 64)) +>v : Symbol(v, Decl(additionOperatorWithConstrainedTypeParameter.ts, 6, 14)) +>k : Symbol(k, Decl(additionOperatorWithConstrainedTypeParameter.ts, 5, 83)) + } +} + diff --git a/tests/baselines/reference/additionOperatorWithConstrainedTypeParameter.types b/tests/baselines/reference/additionOperatorWithConstrainedTypeParameter.types new file mode 100644 index 0000000000000..d52c77a94fd69 --- /dev/null +++ b/tests/baselines/reference/additionOperatorWithConstrainedTypeParameter.types @@ -0,0 +1,64 @@ +=== tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithConstrainedTypeParameter.ts === +// test for #17069 +function sum, K extends string>(n: number, v: T, k: K) { +>sum : , K extends string>(n: number, v: T, k: K) => void +>T : T +>Record : Record +>K : K +>K : K +>n : number +>v : T +>T : T +>k : K +>K : K + + n = n + v[k]; +>n = n + v[k] : number +>n : number +>n + v[k] : number +>n : number +>v[k] : T[K] +>v : T +>k : K + + n += v[k]; // += should work the same way +>n += v[k] : number +>n : number +>v[k] : T[K] +>v : T +>k : K +} +function realSum, K extends string>(n: number, vs: T[], k: K) { +>realSum : , K extends string>(n: number, vs: T[], k: K) => void +>T : T +>Record : Record +>K : K +>K : K +>n : number +>vs : T[] +>T : T +>k : K +>K : K + + for (const v of vs) { +>v : T +>vs : T[] + + n = n + v[k]; +>n = n + v[k] : number +>n : number +>n + v[k] : number +>n : number +>v[k] : T[K] +>v : T +>k : K + + n += v[k]; +>n += v[k] : number +>n : number +>v[k] : T[K] +>v : T +>k : K + } +} + diff --git a/tests/baselines/reference/nonPrimitiveConstraintOfIndexAccessType.errors.txt b/tests/baselines/reference/nonPrimitiveConstraintOfIndexAccessType.errors.txt new file mode 100644 index 0000000000000..56781157131a4 --- /dev/null +++ b/tests/baselines/reference/nonPrimitiveConstraintOfIndexAccessType.errors.txt @@ -0,0 +1,67 @@ +tests/cases/conformance/types/nonPrimitive/nonPrimitiveConstraintOfIndexAccessType.ts(3,5): error TS2322: Type 'string' is not assignable to type 'T[P]'. +tests/cases/conformance/types/nonPrimitive/nonPrimitiveConstraintOfIndexAccessType.ts(6,5): error TS2322: Type 'string' is not assignable to type 'T[P]'. +tests/cases/conformance/types/nonPrimitive/nonPrimitiveConstraintOfIndexAccessType.ts(9,5): error TS2322: Type 'string' is not assignable to type 'T[P]'. +tests/cases/conformance/types/nonPrimitive/nonPrimitiveConstraintOfIndexAccessType.ts(12,5): error TS2322: Type 'string' is not assignable to type 'T[P]'. +tests/cases/conformance/types/nonPrimitive/nonPrimitiveConstraintOfIndexAccessType.ts(15,5): error TS2322: Type 'string' is not assignable to type 'T[P]'. +tests/cases/conformance/types/nonPrimitive/nonPrimitiveConstraintOfIndexAccessType.ts(18,5): error TS2322: Type 'string' is not assignable to type 'T[P]'. +tests/cases/conformance/types/nonPrimitive/nonPrimitiveConstraintOfIndexAccessType.ts(21,5): error TS2322: Type 'string' is not assignable to type 'T[P]'. +tests/cases/conformance/types/nonPrimitive/nonPrimitiveConstraintOfIndexAccessType.ts(24,5): error TS2322: Type 'string' is not assignable to type 'T[P]'. +tests/cases/conformance/types/nonPrimitive/nonPrimitiveConstraintOfIndexAccessType.ts(27,5): error TS2322: Type 'string' is not assignable to type 'T[P]'. +tests/cases/conformance/types/nonPrimitive/nonPrimitiveConstraintOfIndexAccessType.ts(30,5): error TS2322: Type 'string' is not assignable to type 'T[P]'. + Type 'string' is not assignable to type 'number'. + + +==== tests/cases/conformance/types/nonPrimitive/nonPrimitiveConstraintOfIndexAccessType.ts (10 errors) ==== + // test for #15371 + function f(s: string, tp: T[P]): void { + tp = s; + ~~ +!!! error TS2322: Type 'string' is not assignable to type 'T[P]'. + } + function g(s: string, tp: T[P]): void { + tp = s; + ~~ +!!! error TS2322: Type 'string' is not assignable to type 'T[P]'. + } + function h(s: string, tp: T[P]): void { + tp = s; + ~~ +!!! error TS2322: Type 'string' is not assignable to type 'T[P]'. + } + function i(s: string, tp: T[P]): void { + tp = s; + ~~ +!!! error TS2322: Type 'string' is not assignable to type 'T[P]'. + } + function j(s: string, tp: T[P]): void { + tp = s; + ~~ +!!! error TS2322: Type 'string' is not assignable to type 'T[P]'. + } + function k(s: string, tp: T[P]): void { + tp = s; + ~~ +!!! error TS2322: Type 'string' is not assignable to type 'T[P]'. + } + function o(s: string, tp: T[P]): void { + tp = s; + ~~ +!!! error TS2322: Type 'string' is not assignable to type 'T[P]'. + } + function l(s: string, tp: T[P]): void { + tp = s; + ~~ +!!! error TS2322: Type 'string' is not assignable to type 'T[P]'. + } + function m(s: string, tp: T[P]): void { + tp = s; + ~~ +!!! error TS2322: Type 'string' is not assignable to type 'T[P]'. + } + function n(s: string, tp: T[P]): void { + tp = s; + ~~ +!!! error TS2322: Type 'string' is not assignable to type 'T[P]'. +!!! error TS2322: Type 'string' is not assignable to type 'number'. + } + \ No newline at end of file diff --git a/tests/baselines/reference/nonPrimitiveConstraintOfIndexAccessType.js b/tests/baselines/reference/nonPrimitiveConstraintOfIndexAccessType.js new file mode 100644 index 0000000000000..7a24345a94b11 --- /dev/null +++ b/tests/baselines/reference/nonPrimitiveConstraintOfIndexAccessType.js @@ -0,0 +1,67 @@ +//// [nonPrimitiveConstraintOfIndexAccessType.ts] +// test for #15371 +function f(s: string, tp: T[P]): void { + tp = s; +} +function g(s: string, tp: T[P]): void { + tp = s; +} +function h(s: string, tp: T[P]): void { + tp = s; +} +function i(s: string, tp: T[P]): void { + tp = s; +} +function j(s: string, tp: T[P]): void { + tp = s; +} +function k(s: string, tp: T[P]): void { + tp = s; +} +function o(s: string, tp: T[P]): void { + tp = s; +} +function l(s: string, tp: T[P]): void { + tp = s; +} +function m(s: string, tp: T[P]): void { + tp = s; +} +function n(s: string, tp: T[P]): void { + tp = s; +} + + +//// [nonPrimitiveConstraintOfIndexAccessType.js] +"use strict"; +// test for #15371 +function f(s, tp) { + tp = s; +} +function g(s, tp) { + tp = s; +} +function h(s, tp) { + tp = s; +} +function i(s, tp) { + tp = s; +} +function j(s, tp) { + tp = s; +} +function k(s, tp) { + tp = s; +} +function o(s, tp) { + tp = s; +} +function l(s, tp) { + tp = s; +} +function m(s, tp) { + tp = s; +} +function n(s, tp) { + tp = s; +} diff --git a/tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithConstrainedTypeParameter.ts b/tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithConstrainedTypeParameter.ts new file mode 100644 index 0000000000000..2303bb33944ad --- /dev/null +++ b/tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithConstrainedTypeParameter.ts @@ -0,0 +1,11 @@ +// test for #17069 +function sum, K extends string>(n: number, v: T, k: K) { + n = n + v[k]; + n += v[k]; // += should work the same way +} +function realSum, K extends string>(n: number, vs: T[], k: K) { + for (const v of vs) { + n = n + v[k]; + n += v[k]; + } +} diff --git a/tests/cases/conformance/types/nonPrimitive/nonPrimitiveConstraintOfIndexAccessType.ts b/tests/cases/conformance/types/nonPrimitive/nonPrimitiveConstraintOfIndexAccessType.ts new file mode 100644 index 0000000000000..1e852f12f928e --- /dev/null +++ b/tests/cases/conformance/types/nonPrimitive/nonPrimitiveConstraintOfIndexAccessType.ts @@ -0,0 +1,32 @@ +// @strict: true +// test for #15371 +function f(s: string, tp: T[P]): void { + tp = s; +} +function g(s: string, tp: T[P]): void { + tp = s; +} +function h(s: string, tp: T[P]): void { + tp = s; +} +function i(s: string, tp: T[P]): void { + tp = s; +} +function j(s: string, tp: T[P]): void { + tp = s; +} +function k(s: string, tp: T[P]): void { + tp = s; +} +function o(s: string, tp: T[P]): void { + tp = s; +} +function l(s: string, tp: T[P]): void { + tp = s; +} +function m(s: string, tp: T[P]): void { + tp = s; +} +function n(s: string, tp: T[P]): void { + tp = s; +} From a187b17e97fece8012bc8529ea3b1a9ebe4804e9 Mon Sep 17 00:00:00 2001 From: Nathan Shively-Sanders Date: Thu, 17 Aug 2017 13:09:21 -0700 Subject: [PATCH 170/237] Simplify mapped-type handling in computeBaseConstraint --- src/compiler/checker.ts | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index ff3111776299a..b3e7b01123d04 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -5968,7 +5968,7 @@ namespace ts { function computeBaseConstraint(t: Type): Type { if (t.flags & TypeFlags.TypeParameter) { const constraint = getConstraintFromTypeParameter(t); - return ((t as TypeParameter).isThisType || !constraint || getObjectFlags(constraint) & ObjectFlags.Mapped) ? + return (t as TypeParameter).isThisType || !constraint ? constraint : getBaseConstraint(constraint); } @@ -5998,9 +5998,6 @@ namespace ts { const baseIndexedAccess = baseObjectType && baseIndexType ? getIndexedAccessType(baseObjectType, baseIndexType) : undefined; return baseIndexedAccess && baseIndexedAccess !== unknownType ? getBaseConstraint(baseIndexedAccess) : undefined; } - if (isGenericMappedType(t)) { - return emptyObjectType; - } return t; } } From eef7d8bd3d974528464c7968deab78b747568c06 Mon Sep 17 00:00:00 2001 From: Andy Date: Thu, 17 Aug 2017 13:26:38 -0700 Subject: [PATCH 171/237] Treat explicit imports from `node_modules` as external library imports (#16364) * Treat explicit imports from `node_modules` as external library imports * Update baselines --- src/compiler/checker.ts | 3 +-- src/compiler/core.ts | 14 +++++++++----- src/compiler/moduleNameResolver.ts | 5 +++-- src/compiler/types.ts | 7 +------ .../moduleResolution_explicitNodeModulesImport.js | 12 ++++++++++++ ...uleResolution_explicitNodeModulesImport.symbols | 9 +++++++++ ...oduleResolution_explicitNodeModulesImport.types | 12 ++++++++++++ ...lution_explicitNodeModulesImport_implicitAny.js | 12 ++++++++++++ ...n_explicitNodeModulesImport_implicitAny.symbols | 4 ++++ ...ion_explicitNodeModulesImport_implicitAny.types | 4 ++++ .../amd/nodeModulesMaxDepthExceeded.errors.txt | 6 +++--- .../amd/nodeModulesMaxDepthExceeded.json | 8 ++++---- .../node/nodeModulesMaxDepthExceeded.errors.txt | 6 +++--- .../node/nodeModulesMaxDepthExceeded.json | 8 ++++---- .../moduleResolution_explicitNodeModulesImport.ts | 9 +++++++++ ...lution_explicitNodeModulesImport_implicitAny.ts | 9 +++++++++ 16 files changed, 99 insertions(+), 29 deletions(-) create mode 100644 tests/baselines/reference/moduleResolution_explicitNodeModulesImport.js create mode 100644 tests/baselines/reference/moduleResolution_explicitNodeModulesImport.symbols create mode 100644 tests/baselines/reference/moduleResolution_explicitNodeModulesImport.types create mode 100644 tests/baselines/reference/moduleResolution_explicitNodeModulesImport_implicitAny.js create mode 100644 tests/baselines/reference/moduleResolution_explicitNodeModulesImport_implicitAny.symbols create mode 100644 tests/baselines/reference/moduleResolution_explicitNodeModulesImport_implicitAny.types create mode 100644 tests/cases/compiler/moduleResolution_explicitNodeModulesImport.ts create mode 100644 tests/cases/compiler/moduleResolution_explicitNodeModulesImport_implicitAny.ts diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index ce5f5a4f1c522..6df6b1f9ce1b9 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -1694,7 +1694,6 @@ namespace ts { if (ambientModule) { return ambientModule; } - const isRelative = isExternalModuleNameRelative(moduleReference); const resolvedModule = getResolvedModule(getSourceFileOfNode(location), moduleReference); const resolutionDiagnostic = resolvedModule && getResolutionDiagnostic(compilerOptions, resolvedModule); const sourceFile = resolvedModule && !resolutionDiagnostic && host.getSourceFile(resolvedModule.resolvedFileName); @@ -1718,7 +1717,7 @@ namespace ts { } // May be an untyped module. If so, ignore resolutionDiagnostic. - if (!isRelative && resolvedModule && !extensionIsTypeScript(resolvedModule.extension)) { + if (resolvedModule && resolvedModule.isExternalLibraryImport && !extensionIsTypeScript(resolvedModule.extension)) { if (isForAugmentation) { const diag = Diagnostics.Invalid_module_name_in_augmentation_Module_0_resolves_to_an_untyped_module_at_1_which_cannot_be_augmented; error(errorNode, diag, moduleReference, resolvedModule.resolvedFileName); diff --git a/src/compiler/core.ts b/src/compiler/core.ts index b2d0528d89a5a..8cab1b4115502 100644 --- a/src/compiler/core.ts +++ b/src/compiler/core.ts @@ -1543,16 +1543,20 @@ namespace ts { } export function normalizePath(path: string): string { + return normalizePathAndParts(path).path; + } + + export function normalizePathAndParts(path: string): { path: string, parts: string[] } { path = normalizeSlashes(path); const rootLength = getRootLength(path); const root = path.substr(0, rootLength); - const normalized = getNormalizedParts(path, rootLength); - if (normalized.length) { - const joinedParts = root + normalized.join(directorySeparator); - return pathEndsWithDirectorySeparator(path) ? joinedParts + directorySeparator : joinedParts; + const parts = getNormalizedParts(path, rootLength); + if (parts.length) { + const joinedParts = root + parts.join(directorySeparator); + return { path: pathEndsWithDirectorySeparator(path) ? joinedParts + directorySeparator : joinedParts, parts }; } else { - return root; + return { path: root, parts }; } } diff --git a/src/compiler/moduleNameResolver.ts b/src/compiler/moduleNameResolver.ts index 1593e630b6d00..5fdac5048966d 100644 --- a/src/compiler/moduleNameResolver.ts +++ b/src/compiler/moduleNameResolver.ts @@ -747,9 +747,10 @@ namespace ts { return { value: resolvedValue && { resolved: resolvedValue, isExternalLibraryImport: true } }; } else { - const candidate = normalizePath(combinePaths(containingDirectory, moduleName)); + const { path: candidate, parts } = normalizePathAndParts(combinePaths(containingDirectory, moduleName)); const resolved = nodeLoadModuleByRelativeName(extensions, candidate, failedLookupLocations, /*onlyRecordFailures*/ false, state, /*considerPackageJson*/ true); - return resolved && toSearchResult({ resolved, isExternalLibraryImport: false }); + // Treat explicit "node_modules" import as an external library import. + return resolved && toSearchResult({ resolved, isExternalLibraryImport: contains(parts, "node_modules") }); } } } diff --git a/src/compiler/types.ts b/src/compiler/types.ts index d274f560e21bb..608bc779042df 100644 --- a/src/compiler/types.ts +++ b/src/compiler/types.ts @@ -3953,12 +3953,7 @@ namespace ts { export interface ResolvedModule { /** Path of the file the module was resolved to. */ resolvedFileName: string; - /** - * Denotes if 'resolvedFileName' is isExternalLibraryImport and thus should be a proper external module: - * - be a .d.ts file - * - use top level imports\exports - * - don't use tripleslash references - */ + /** True if `resolvedFileName` comes from `node_modules`. */ isExternalLibraryImport?: boolean; } diff --git a/tests/baselines/reference/moduleResolution_explicitNodeModulesImport.js b/tests/baselines/reference/moduleResolution_explicitNodeModulesImport.js new file mode 100644 index 0000000000000..93a083da53af6 --- /dev/null +++ b/tests/baselines/reference/moduleResolution_explicitNodeModulesImport.js @@ -0,0 +1,12 @@ +//// [tests/cases/compiler/moduleResolution_explicitNodeModulesImport.ts] //// + +//// [index.js] +exports.x = 0; + +//// [index.ts] +import { x } from "../node_modules/foo"; + + +//// [index.js] +"use strict"; +exports.__esModule = true; diff --git a/tests/baselines/reference/moduleResolution_explicitNodeModulesImport.symbols b/tests/baselines/reference/moduleResolution_explicitNodeModulesImport.symbols new file mode 100644 index 0000000000000..b635ba2c7c7c6 --- /dev/null +++ b/tests/baselines/reference/moduleResolution_explicitNodeModulesImport.symbols @@ -0,0 +1,9 @@ +=== /src/index.ts === +import { x } from "../node_modules/foo"; +>x : Symbol(x, Decl(index.ts, 0, 8)) + +=== /node_modules/foo/index.js === +exports.x = 0; +>exports : Symbol(x, Decl(index.js, 0, 0)) +>x : Symbol(x, Decl(index.js, 0, 0)) + diff --git a/tests/baselines/reference/moduleResolution_explicitNodeModulesImport.types b/tests/baselines/reference/moduleResolution_explicitNodeModulesImport.types new file mode 100644 index 0000000000000..ca7541d21404a --- /dev/null +++ b/tests/baselines/reference/moduleResolution_explicitNodeModulesImport.types @@ -0,0 +1,12 @@ +=== /src/index.ts === +import { x } from "../node_modules/foo"; +>x : number + +=== /node_modules/foo/index.js === +exports.x = 0; +>exports.x = 0 : 0 +>exports.x : any +>exports : any +>x : any +>0 : 0 + diff --git a/tests/baselines/reference/moduleResolution_explicitNodeModulesImport_implicitAny.js b/tests/baselines/reference/moduleResolution_explicitNodeModulesImport_implicitAny.js new file mode 100644 index 0000000000000..1b5b469570de2 --- /dev/null +++ b/tests/baselines/reference/moduleResolution_explicitNodeModulesImport_implicitAny.js @@ -0,0 +1,12 @@ +//// [tests/cases/compiler/moduleResolution_explicitNodeModulesImport_implicitAny.ts] //// + +//// [index.js] +exports.x = 0; + +//// [index.ts] +import { y } from "../node_modules/foo"; + + +//// [index.js] +"use strict"; +exports.__esModule = true; diff --git a/tests/baselines/reference/moduleResolution_explicitNodeModulesImport_implicitAny.symbols b/tests/baselines/reference/moduleResolution_explicitNodeModulesImport_implicitAny.symbols new file mode 100644 index 0000000000000..e320d4d18e151 --- /dev/null +++ b/tests/baselines/reference/moduleResolution_explicitNodeModulesImport_implicitAny.symbols @@ -0,0 +1,4 @@ +=== /src/index.ts === +import { y } from "../node_modules/foo"; +>y : Symbol(y, Decl(index.ts, 0, 8)) + diff --git a/tests/baselines/reference/moduleResolution_explicitNodeModulesImport_implicitAny.types b/tests/baselines/reference/moduleResolution_explicitNodeModulesImport_implicitAny.types new file mode 100644 index 0000000000000..a22e0be7a663c --- /dev/null +++ b/tests/baselines/reference/moduleResolution_explicitNodeModulesImport_implicitAny.types @@ -0,0 +1,4 @@ +=== /src/index.ts === +import { y } from "../node_modules/foo"; +>y : any + diff --git a/tests/baselines/reference/project/nodeModulesMaxDepthExceeded/amd/nodeModulesMaxDepthExceeded.errors.txt b/tests/baselines/reference/project/nodeModulesMaxDepthExceeded/amd/nodeModulesMaxDepthExceeded.errors.txt index bd2dd6231f38f..e878d0fd54f75 100644 --- a/tests/baselines/reference/project/nodeModulesMaxDepthExceeded/amd/nodeModulesMaxDepthExceeded.errors.txt +++ b/tests/baselines/reference/project/nodeModulesMaxDepthExceeded/amd/nodeModulesMaxDepthExceeded.errors.txt @@ -13,9 +13,6 @@ maxDepthExceeded/root.ts(4,4): error TS2540: Cannot assign to 'rel' because it i "exclude": ["node_modules/m2/**/*"] } -==== relative.js (0 errors) ==== - exports.relativeProp = true; - ==== index.js (0 errors) ==== var m2 = require('m2'); var rel = require('./relative'); @@ -51,4 +48,7 @@ maxDepthExceeded/root.ts(4,4): error TS2540: Cannot assign to 'rel' because it i "b": "hello, world", "person": m3.person }; + +==== relative.js (0 errors) ==== + exports.relativeProp = true; \ No newline at end of file diff --git a/tests/baselines/reference/project/nodeModulesMaxDepthExceeded/amd/nodeModulesMaxDepthExceeded.json b/tests/baselines/reference/project/nodeModulesMaxDepthExceeded/amd/nodeModulesMaxDepthExceeded.json index 9efa0e936acf5..4a9b23468547a 100644 --- a/tests/baselines/reference/project/nodeModulesMaxDepthExceeded/amd/nodeModulesMaxDepthExceeded.json +++ b/tests/baselines/reference/project/nodeModulesMaxDepthExceeded/amd/nodeModulesMaxDepthExceeded.json @@ -7,14 +7,14 @@ "project": "maxDepthExceeded", "resolvedInputFiles": [ "lib.d.ts", - "maxDepthExceeded/node_modules/m1/relative.js", "maxDepthExceeded/node_modules/m1/index.js", "maxDepthExceeded/root.ts", - "maxDepthExceeded/node_modules/m2/entry.js" + "maxDepthExceeded/node_modules/m2/entry.js", + "maxDepthExceeded/node_modules/m1/relative.js" ], "emittedFiles": [ - "maxDepthExceeded/built/node_modules/m1/relative.js", "maxDepthExceeded/built/node_modules/m1/index.js", - "maxDepthExceeded/built/root.js" + "maxDepthExceeded/built/root.js", + "maxDepthExceeded/built/node_modules/m1/relative.js" ] } \ No newline at end of file diff --git a/tests/baselines/reference/project/nodeModulesMaxDepthExceeded/node/nodeModulesMaxDepthExceeded.errors.txt b/tests/baselines/reference/project/nodeModulesMaxDepthExceeded/node/nodeModulesMaxDepthExceeded.errors.txt index bd2dd6231f38f..e878d0fd54f75 100644 --- a/tests/baselines/reference/project/nodeModulesMaxDepthExceeded/node/nodeModulesMaxDepthExceeded.errors.txt +++ b/tests/baselines/reference/project/nodeModulesMaxDepthExceeded/node/nodeModulesMaxDepthExceeded.errors.txt @@ -13,9 +13,6 @@ maxDepthExceeded/root.ts(4,4): error TS2540: Cannot assign to 'rel' because it i "exclude": ["node_modules/m2/**/*"] } -==== relative.js (0 errors) ==== - exports.relativeProp = true; - ==== index.js (0 errors) ==== var m2 = require('m2'); var rel = require('./relative'); @@ -51,4 +48,7 @@ maxDepthExceeded/root.ts(4,4): error TS2540: Cannot assign to 'rel' because it i "b": "hello, world", "person": m3.person }; + +==== relative.js (0 errors) ==== + exports.relativeProp = true; \ No newline at end of file diff --git a/tests/baselines/reference/project/nodeModulesMaxDepthExceeded/node/nodeModulesMaxDepthExceeded.json b/tests/baselines/reference/project/nodeModulesMaxDepthExceeded/node/nodeModulesMaxDepthExceeded.json index 9efa0e936acf5..4a9b23468547a 100644 --- a/tests/baselines/reference/project/nodeModulesMaxDepthExceeded/node/nodeModulesMaxDepthExceeded.json +++ b/tests/baselines/reference/project/nodeModulesMaxDepthExceeded/node/nodeModulesMaxDepthExceeded.json @@ -7,14 +7,14 @@ "project": "maxDepthExceeded", "resolvedInputFiles": [ "lib.d.ts", - "maxDepthExceeded/node_modules/m1/relative.js", "maxDepthExceeded/node_modules/m1/index.js", "maxDepthExceeded/root.ts", - "maxDepthExceeded/node_modules/m2/entry.js" + "maxDepthExceeded/node_modules/m2/entry.js", + "maxDepthExceeded/node_modules/m1/relative.js" ], "emittedFiles": [ - "maxDepthExceeded/built/node_modules/m1/relative.js", "maxDepthExceeded/built/node_modules/m1/index.js", - "maxDepthExceeded/built/root.js" + "maxDepthExceeded/built/root.js", + "maxDepthExceeded/built/node_modules/m1/relative.js" ] } \ No newline at end of file diff --git a/tests/cases/compiler/moduleResolution_explicitNodeModulesImport.ts b/tests/cases/compiler/moduleResolution_explicitNodeModulesImport.ts new file mode 100644 index 0000000000000..76c1d14197628 --- /dev/null +++ b/tests/cases/compiler/moduleResolution_explicitNodeModulesImport.ts @@ -0,0 +1,9 @@ +// @allowJs: true +// @noImplicitReferences: true +// @maxNodeModuleJsDepth: 1 + +// @Filename: /node_modules/foo/index.js +exports.x = 0; + +// @Filename: /src/index.ts +import { x } from "../node_modules/foo"; diff --git a/tests/cases/compiler/moduleResolution_explicitNodeModulesImport_implicitAny.ts b/tests/cases/compiler/moduleResolution_explicitNodeModulesImport_implicitAny.ts new file mode 100644 index 0000000000000..97320be01377d --- /dev/null +++ b/tests/cases/compiler/moduleResolution_explicitNodeModulesImport_implicitAny.ts @@ -0,0 +1,9 @@ +// @allowJs: true +// @noImplicitReferences: true +// @maxNodeModuleJsDepth: 0 + +// @Filename: /node_modules/foo/index.js +exports.x = 0; + +// @Filename: /src/index.ts +import { y } from "../node_modules/foo"; From fad97e369a24cd5df3ad1c491cf23bb9378d76cb Mon Sep 17 00:00:00 2001 From: Ron Buckton Date: Thu, 17 Aug 2017 17:32:06 -0700 Subject: [PATCH 172/237] Remove debug assertions due to invalid syntax in generators transform --- src/compiler/transformers/generators.ts | 76 +++++++++++-------- ...invalidContinueInDownlevelAsync.errors.txt | 17 +++++ .../invalidContinueInDownlevelAsync.js | 63 +++++++++++++++ .../invalidContinueInDownlevelAsync.ts | 8 ++ 4 files changed, 131 insertions(+), 33 deletions(-) create mode 100644 tests/baselines/reference/invalidContinueInDownlevelAsync.errors.txt create mode 100644 tests/baselines/reference/invalidContinueInDownlevelAsync.js create mode 100644 tests/cases/compiler/invalidContinueInDownlevelAsync.ts diff --git a/src/compiler/transformers/generators.ts b/src/compiler/transformers/generators.ts index f45147b526c70..20195adeef47b 100644 --- a/src/compiler/transformers/generators.ts +++ b/src/compiler/transformers/generators.ts @@ -1639,8 +1639,13 @@ namespace ts { function transformAndEmitContinueStatement(node: ContinueStatement): void { const label = findContinueTarget(node.label ? unescapeLeadingUnderscores(node.label.escapedText) : undefined); - Debug.assert(label > 0, "Expected continue statment to point to a valid Label."); - emitBreak(label, /*location*/ node); + if (label > 0) { + emitBreak(label, /*location*/ node); + } + else { + // invalid continue without a containing loop. Leave the node as is, per #17875. + emitStatement(node); + } } function visitContinueStatement(node: ContinueStatement): Statement { @@ -1656,8 +1661,13 @@ namespace ts { function transformAndEmitBreakStatement(node: BreakStatement): void { const label = findBreakTarget(node.label ? unescapeLeadingUnderscores(node.label.escapedText) : undefined); - Debug.assert(label > 0, "Expected break statment to point to a valid Label."); - emitBreak(label, /*location*/ node); + if (label > 0) { + emitBreak(label, /*location*/ node); + } + else { + // invalid break without a containing loop, switch, or labeled statement. Leave the node as is, per #17875. + emitStatement(node); + } } function visitBreakStatement(node: BreakStatement): Statement { @@ -2351,27 +2361,27 @@ namespace ts { * @param labelText An optional name of a containing labeled statement. */ function findBreakTarget(labelText?: string): Label { - Debug.assert(blocks !== undefined); - if (labelText) { - for (let i = blockStack.length - 1; i >= 0; i--) { - const block = blockStack[i]; - if (supportsLabeledBreakOrContinue(block) && block.labelText === labelText) { - return block.breakLabel; - } - else if (supportsUnlabeledBreak(block) && hasImmediateContainingLabeledBlock(labelText, i - 1)) { - return block.breakLabel; + if (blockStack) { + if (labelText) { + for (let i = blockStack.length - 1; i >= 0; i--) { + const block = blockStack[i]; + if (supportsLabeledBreakOrContinue(block) && block.labelText === labelText) { + return block.breakLabel; + } + else if (supportsUnlabeledBreak(block) && hasImmediateContainingLabeledBlock(labelText, i - 1)) { + return block.breakLabel; + } } } - } - else { - for (let i = blockStack.length - 1; i >= 0; i--) { - const block = blockStack[i]; - if (supportsUnlabeledBreak(block)) { - return block.breakLabel; + else { + for (let i = blockStack.length - 1; i >= 0; i--) { + const block = blockStack[i]; + if (supportsUnlabeledBreak(block)) { + return block.breakLabel; + } } } } - return 0; } @@ -2381,24 +2391,24 @@ namespace ts { * @param labelText An optional name of a containing labeled statement. */ function findContinueTarget(labelText?: string): Label { - Debug.assert(blocks !== undefined); - if (labelText) { - for (let i = blockStack.length - 1; i >= 0; i--) { - const block = blockStack[i]; - if (supportsUnlabeledContinue(block) && hasImmediateContainingLabeledBlock(labelText, i - 1)) { - return block.continueLabel; + if (blockStack) { + if (labelText) { + for (let i = blockStack.length - 1; i >= 0; i--) { + const block = blockStack[i]; + if (supportsUnlabeledContinue(block) && hasImmediateContainingLabeledBlock(labelText, i - 1)) { + return block.continueLabel; + } } } - } - else { - for (let i = blockStack.length - 1; i >= 0; i--) { - const block = blockStack[i]; - if (supportsUnlabeledContinue(block)) { - return block.continueLabel; + else { + for (let i = blockStack.length - 1; i >= 0; i--) { + const block = blockStack[i]; + if (supportsUnlabeledContinue(block)) { + return block.continueLabel; + } } } } - return 0; } diff --git a/tests/baselines/reference/invalidContinueInDownlevelAsync.errors.txt b/tests/baselines/reference/invalidContinueInDownlevelAsync.errors.txt new file mode 100644 index 0000000000000..ffdfee20090d5 --- /dev/null +++ b/tests/baselines/reference/invalidContinueInDownlevelAsync.errors.txt @@ -0,0 +1,17 @@ +tests/cases/compiler/invalidContinueInDownlevelAsync.ts(3,9): error TS1107: Jump target cannot cross function boundary. +tests/cases/compiler/invalidContinueInDownlevelAsync.ts(6,9): error TS7027: Unreachable code detected. + + +==== tests/cases/compiler/invalidContinueInDownlevelAsync.ts (2 errors) ==== + async function func() { + if (true) { + continue; + ~~~~~~~~~ +!!! error TS1107: Jump target cannot cross function boundary. + } + else { + await 1; + ~~~~~ +!!! error TS7027: Unreachable code detected. + } + } \ No newline at end of file diff --git a/tests/baselines/reference/invalidContinueInDownlevelAsync.js b/tests/baselines/reference/invalidContinueInDownlevelAsync.js new file mode 100644 index 0000000000000..69e5e76e442e7 --- /dev/null +++ b/tests/baselines/reference/invalidContinueInDownlevelAsync.js @@ -0,0 +1,63 @@ +//// [invalidContinueInDownlevelAsync.ts] +async function func() { + if (true) { + continue; + } + else { + await 1; + } +} + +//// [invalidContinueInDownlevelAsync.js] +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); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +var __generator = (this && this.__generator) || function (thisArg, body) { + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; + return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + function verb(n) { return function (v) { return step([n, v]); }; } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (_) try { + if (f = 1, y && (t = y[op[0] & 2 ? "return" : op[0] ? "throw" : "next"]) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [0, t.value]; + switch (op[0]) { + case 0: case 1: t = op; break; + case 4: _.label++; return { value: op[1], done: false }; + case 5: _.label++; y = op[1]; op = [0]; continue; + case 7: op = _.ops.pop(); _.trys.pop(); continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } + if (t[2]) _.ops.pop(); + _.trys.pop(); continue; + } + op = body.call(thisArg, _); + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + } +}; +function func() { + return __awaiter(this, void 0, void 0, function () { + return __generator(this, function (_a) { + switch (_a.label) { + case 0: + if (!true) return [3 /*break*/, 1]; + continue; + return [3 /*break*/, 3]; + case 1: return [4 /*yield*/, 1]; + case 2: + _a.sent(); + _a.label = 3; + case 3: return [2 /*return*/]; + } + }); + }); +} diff --git a/tests/cases/compiler/invalidContinueInDownlevelAsync.ts b/tests/cases/compiler/invalidContinueInDownlevelAsync.ts new file mode 100644 index 0000000000000..bdf476c80338e --- /dev/null +++ b/tests/cases/compiler/invalidContinueInDownlevelAsync.ts @@ -0,0 +1,8 @@ +async function func() { + if (true) { + continue; + } + else { + await 1; + } +} \ No newline at end of file From e7d2af0d72cbd0981174f76b3b66259e9a591ae5 Mon Sep 17 00:00:00 2001 From: Arthur Ozga Date: Thu, 17 Aug 2017 20:06:34 -0700 Subject: [PATCH 173/237] remove duplicate verify --- .../cases/fourslash/completionListAndMemberListOnCommentedDot.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/cases/fourslash/completionListAndMemberListOnCommentedDot.ts b/tests/cases/fourslash/completionListAndMemberListOnCommentedDot.ts index d0517d87279b9..b57e7b84b5354 100644 --- a/tests/cases/fourslash/completionListAndMemberListOnCommentedDot.ts +++ b/tests/cases/fourslash/completionListAndMemberListOnCommentedDot.ts @@ -14,5 +14,4 @@ //////c./**/ goTo.marker(); -verify.completionListIsEmpty(); verify.completionListIsEmpty(); \ No newline at end of file From e4e969a210325190097c963cc3e4023682125c4a Mon Sep 17 00:00:00 2001 From: Arthur Ozga Date: Thu, 17 Aug 2017 20:06:46 -0700 Subject: [PATCH 174/237] respond to comments --- src/services/formatting/formatting.ts | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/src/services/formatting/formatting.ts b/src/services/formatting/formatting.ts index 22602d6031cdf..85cab12655953 100644 --- a/src/services/formatting/formatting.ts +++ b/src/services/formatting/formatting.ts @@ -1159,17 +1159,20 @@ namespace ts.formatting { sourceFile: SourceFile, position: number, onlyMultiLine: boolean, - precedingToken: Node | null | undefined = findPrecedingToken(position, sourceFile), // tslint:disable-line:no-null-keyword + precedingToken?: Node | null, // tslint:disable-line:no-null-keyword tokenAtPosition = getTokenAtPosition(sourceFile, position, /*includeJsDocComment*/ false), predicate?: (c: CommentRange) => boolean): CommentRange | undefined { - // Considering a fixed position, - // - trailing comments are those following and on the same line as the position. - // - leading comments are those in the range [position, start of next non-trivia token) - // that are not trailing comments of that position. - // - // Note, `node.start` is the start-position of the first comment following the previous - // token that is not a trailing comment, so the leading and trailing comments of all - // tokens contain all comments in a sourcefile disjointly. + const tokenStart = tokenAtPosition.getStart(sourceFile); + if (tokenStart <= position && position < tokenAtPosition.getEnd()) { + return undefined; + } + + if (precedingToken === undefined) { + precedingToken = findPrecedingToken(position, sourceFile); + } + + // Between two consecutive tokens, all comments are either trailing on the former + // or leading on the latter (and none are in both lists). const trailingRangesOfPreviousToken = precedingToken && getTrailingCommentRanges(sourceFile.text, precedingToken.end); const leadingCommentRangesOfNextToken = getLeadingCommentRangesOfNode(tokenAtPosition, sourceFile); const commentRanges = trailingRangesOfPreviousToken && leadingCommentRangesOfNextToken ? From fa6773e685e2c1f19d6e35cb12f06edfa9c31ad5 Mon Sep 17 00:00:00 2001 From: Anders Hejlsberg Date: Fri, 18 Aug 2017 11:00:46 +0200 Subject: [PATCH 175/237] Type parameters from class should not be in scope in base class expression --- src/compiler/checker.ts | 12 +++++++++++- src/compiler/diagnosticMessages.json | 4 ++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 1c41be84ba741..d5518eee3da49 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -1016,7 +1016,17 @@ namespace ts { } } break; - + case SyntaxKind.ExpressionWithTypeArguments: + if (lastLocation === (location).expression && (location.parent).token === SyntaxKind.ExtendsKeyword) { + const container = location.parent.parent; + if (isClassLike(container) && (result = lookup(getSymbolOfNode(container).members, name, meaning & SymbolFlags.Type))) { + if (nameNotFoundMessage) { + error(errorLocation, Diagnostics.Base_class_expressions_cannot_reference_class_type_parameters); + } + return undefined; + } + } + break; // It is not legal to reference a class's own type parameters from a computed property name that // belongs to the class. For example: // diff --git a/src/compiler/diagnosticMessages.json b/src/compiler/diagnosticMessages.json index 77e7f7e7b6246..049483fdb8f3f 100644 --- a/src/compiler/diagnosticMessages.json +++ b/src/compiler/diagnosticMessages.json @@ -1912,6 +1912,10 @@ "category": "Error", "code": 2560 }, + "Base class expressions cannot reference class type parameters.": { + "category": "Error", + "code": 2561 + }, "JSX element attributes type '{0}' may not be a union type.": { "category": "Error", "code": 2600 From ade3b565ae9a5d483fcb85400ca183a90041c66f Mon Sep 17 00:00:00 2001 From: Andy Date: Fri, 18 Aug 2017 11:20:07 -0700 Subject: [PATCH 176/237] Revert public API changes to logger (#17899) --- src/harness/harnessLanguageService.ts | 5 +-- .../unittests/tsserverProjectSystem.ts | 5 +-- src/server/editorServices.ts | 32 +++++++++---------- src/server/server.ts | 28 ++++++++-------- src/server/session.ts | 4 +-- src/server/utilities.ts | 17 +++++++--- 6 files changed, 52 insertions(+), 39 deletions(-) diff --git a/src/harness/harnessLanguageService.ts b/src/harness/harnessLanguageService.ts index 5e8d6e76716e8..58df0d9a5e207 100644 --- a/src/harness/harnessLanguageService.ts +++ b/src/harness/harnessLanguageService.ts @@ -686,7 +686,7 @@ namespace Harness.LanguageService { this.host.log(message); } - err(message: string): void { + msg(message: string): void { this.host.log(message); } @@ -702,7 +702,8 @@ namespace Harness.LanguageService { return false; } - group() { throw ts.notImplemented(); } + startGroup() { throw ts.notImplemented(); } + endGroup() { throw ts.notImplemented(); } perftrc(message: string): void { return this.host.log(message); diff --git a/src/harness/unittests/tsserverProjectSystem.ts b/src/harness/unittests/tsserverProjectSystem.ts index 596e080430ca9..6e548231c9140 100644 --- a/src/harness/unittests/tsserverProjectSystem.ts +++ b/src/harness/unittests/tsserverProjectSystem.ts @@ -39,8 +39,9 @@ namespace ts.projectSystem { loggingEnabled: () => false, perftrc: noop, info: noop, - err: noop, - group: noop, + msg: noop, + startGroup: noop, + endGroup: noop, getLogFileName: (): string => undefined }; diff --git a/src/server/editorServices.ts b/src/server/editorServices.ts index fe7946fc0f7cc..cb497ff774f1c 100644 --- a/src/server/editorServices.ts +++ b/src/server/editorServices.ts @@ -958,28 +958,28 @@ namespace ts.server { return; } - this.logger.group(info => { - let counter = 0; - counter = printProjects(this.externalProjects, info, counter); - counter = printProjects(this.configuredProjects, info, counter); - printProjects(this.inferredProjects, info, counter); - - info("Open files: "); - for (const rootFile of this.openFiles) { - info(`\t${rootFile.fileName}`); - } - }); - - function printProjects(projects: Project[], info: (msg: string) => void, counter: number): number { + this.logger.startGroup(); + let counter = 0; + const printProjects = (projects: Project[], counter: number): number => { for (const project of projects) { project.updateGraph(); - info(`Project '${project.getProjectName()}' (${ProjectKind[project.projectKind]}) ${counter}`); - info(project.filesToString()); - info("-----------------------------------------------"); + this.logger.info(`Project '${project.getProjectName()}' (${ProjectKind[project.projectKind]}) ${counter}`); + this.logger.info(project.filesToString()); + this.logger.info("-----------------------------------------------"); counter++; } return counter; + }; + counter = printProjects(this.externalProjects, counter); + counter = printProjects(this.configuredProjects, counter); + printProjects(this.inferredProjects, counter); + + this.logger.info("Open files: "); + for (const rootFile of this.openFiles) { + this.logger.info(`\t${rootFile.fileName}`); } + + this.logger.endGroup(); } private findConfiguredProjectByProjectName(configFileName: NormalizedPath) { diff --git a/src/server/server.ts b/src/server/server.ts index 66467fd46ae32..0fe37dd8ba0d5 100644 --- a/src/server/server.ts +++ b/src/server/server.ts @@ -140,6 +140,8 @@ namespace ts.server { class Logger implements server.Logger { private fd = -1; private seq = 0; + private inGroup = false; + private firstInGroup = true; constructor(private readonly logFilename: string, private readonly traceToConsole: boolean, @@ -169,24 +171,24 @@ namespace ts.server { } perftrc(s: string) { - this.msg(s, "Perf"); + this.msg(s, Msg.Perf); } info(s: string) { - this.msg(s, "Info"); + this.msg(s, Msg.Info); } err(s: string) { - this.msg(s, "Err"); + this.msg(s, Msg.Err); } - group(logGroupEntries: (log: (msg: string) => void) => void) { - let firstInGroup = false; - logGroupEntries(s => { - this.msg(s, "Info", /*inGroup*/ true, firstInGroup); - firstInGroup = false; - }); - this.seq++; + startGroup() { + this.inGroup = true; + this.firstInGroup = true; + } + + endGroup() { + this.inGroup = false; } loggingEnabled() { @@ -197,16 +199,16 @@ namespace ts.server { return this.loggingEnabled() && this.level >= level; } - private msg(s: string, type: string, inGroup = false, firstInGroup = false) { + msg(s: string, type: Msg.Types = Msg.Err) { if (!this.canWrite) return; s = `[${nowString()}] ${s}\n`; - if (!inGroup || firstInGroup) { + if (!this.inGroup || this.firstInGroup) { const prefix = Logger.padStringRight(type + " " + this.seq.toString(), " "); s = prefix + s; } this.write(s); - if (!inGroup) { + if (!this.inGroup) { this.seq++; } } diff --git a/src/server/session.ts b/src/server/session.ts index 4122408cfa6bb..6eb0413f6d8d1 100644 --- a/src/server/session.ts +++ b/src/server/session.ts @@ -368,7 +368,7 @@ namespace ts.server { msg += "\n" + (err).stack; } } - this.logger.err(msg); + this.logger.msg(msg, Msg.Err); } public send(msg: protocol.Message) { @@ -1947,7 +1947,7 @@ namespace ts.server { return this.executeWithRequestId(request.seq, () => handler(request)); } else { - this.logger.err(`Unrecognized JSON command: ${JSON.stringify(request)}`); + this.logger.msg(`Unrecognized JSON command: ${JSON.stringify(request)}`, Msg.Err); this.output(undefined, CommandNames.Unknown, request.seq, `Unrecognized JSON command: ${request.command}`); return { responseRequired: false }; } diff --git a/src/server/utilities.ts b/src/server/utilities.ts index 0d4bc101ff63a..e2e2a67eaf12d 100644 --- a/src/server/utilities.ts +++ b/src/server/utilities.ts @@ -17,11 +17,22 @@ namespace ts.server { loggingEnabled(): boolean; perftrc(s: string): void; info(s: string): void; - err(s: string): void; - group(logGroupEntries: (log: (msg: string) => void) => void): void; + startGroup(): void; + endGroup(): void; + msg(s: string, type?: Msg.Types): void; getLogFileName(): string; } + export namespace Msg { + export type Err = "Err"; + export const Err: Err = "Err"; + export type Info = "Info"; + export const Info: Info = "Info"; + export type Perf = "Perf"; + export const Perf: Perf = "Perf"; + export type Types = Err | Info | Perf; + } + function getProjectRootPath(project: Project): Path { switch (project.projectKind) { case ProjectKind.Configured: @@ -115,9 +126,7 @@ namespace ts.server { } export function createNormalizedPathMap(): NormalizedPathMap { -/* tslint:disable:no-null-keyword */ const map = createMap(); -/* tslint:enable:no-null-keyword */ return { get(path) { return map.get(path); From 6b68da1185d80a04a910240493dd7a8b5852bc93 Mon Sep 17 00:00:00 2001 From: Arthur Ozga Date: Fri, 18 Aug 2017 11:32:53 -0700 Subject: [PATCH 177/237] Revert "Fix getConstraintOfIndexedAccess" --- src/compiler/checker.ts | 18 ++--- src/compiler/core.ts | 2 +- ...ionOperatorWithConstrainedTypeParameter.js | 27 -------- ...eratorWithConstrainedTypeParameter.symbols | 54 --------------- ...OperatorWithConstrainedTypeParameter.types | 64 ------------------ ...tiveConstraintOfIndexAccessType.errors.txt | 67 ------------------- ...nonPrimitiveConstraintOfIndexAccessType.js | 67 ------------------- ...ionOperatorWithConstrainedTypeParameter.ts | 11 --- ...nonPrimitiveConstraintOfIndexAccessType.ts | 32 --------- 9 files changed, 8 insertions(+), 334 deletions(-) delete mode 100644 tests/baselines/reference/additionOperatorWithConstrainedTypeParameter.js delete mode 100644 tests/baselines/reference/additionOperatorWithConstrainedTypeParameter.symbols delete mode 100644 tests/baselines/reference/additionOperatorWithConstrainedTypeParameter.types delete mode 100644 tests/baselines/reference/nonPrimitiveConstraintOfIndexAccessType.errors.txt delete mode 100644 tests/baselines/reference/nonPrimitiveConstraintOfIndexAccessType.js delete mode 100644 tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithConstrainedTypeParameter.ts delete mode 100644 tests/cases/conformance/types/nonPrimitive/nonPrimitiveConstraintOfIndexAccessType.ts diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 41921e3c7892f..6df6b1f9ce1b9 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -5911,13 +5911,7 @@ namespace ts { return transformed; } const baseObjectType = getBaseConstraintOfType(type.objectType); - const keepTypeParameterForMappedType = baseObjectType && getObjectFlags(baseObjectType) & ObjectFlags.Mapped && type.indexType.flags & TypeFlags.TypeParameter; - const baseIndexType = !keepTypeParameterForMappedType && getBaseConstraintOfType(type.indexType); - if (baseObjectType && baseIndexType === stringType && !getIndexInfoOfType(baseObjectType, IndexKind.String)) { - // getIndexedAccessType returns `any` for X[string] where X doesn't have an index signature. - // instead, return undefined so that the indexed access check fails - return undefined; - } + const baseIndexType = getBaseConstraintOfType(type.indexType); return baseObjectType || baseIndexType ? getIndexedAccessType(baseObjectType || type.objectType, baseIndexType || type.indexType) : undefined; } @@ -5967,9 +5961,8 @@ namespace ts { function computeBaseConstraint(t: Type): Type { if (t.flags & TypeFlags.TypeParameter) { const constraint = getConstraintFromTypeParameter(t); - return (t as TypeParameter).isThisType || !constraint ? - constraint : - getBaseConstraint(constraint); + return (t).isThisType ? constraint : + constraint ? getBaseConstraint(constraint) : undefined; } if (t.flags & TypeFlags.UnionOrIntersection) { const types = (t).types; @@ -5997,6 +5990,9 @@ namespace ts { const baseIndexedAccess = baseObjectType && baseIndexType ? getIndexedAccessType(baseObjectType, baseIndexType) : undefined; return baseIndexedAccess && baseIndexedAccess !== unknownType ? getBaseConstraint(baseIndexedAccess) : undefined; } + if (isGenericMappedType(t)) { + return emptyObjectType; + } return t; } } @@ -9293,7 +9289,7 @@ namespace ts { } else if (target.flags & TypeFlags.IndexedAccess) { // A type S is related to a type T[K] if S is related to A[K], where K is string-like and - // A is the apparent type of T. + // A is the apparent type of S. const constraint = getConstraintOfType(target); if (constraint) { if (result = isRelatedTo(source, constraint, reportErrors)) { diff --git a/src/compiler/core.ts b/src/compiler/core.ts index 422df2ead0504..8cab1b4115502 100644 --- a/src/compiler/core.ts +++ b/src/compiler/core.ts @@ -718,7 +718,7 @@ namespace ts { export function sum, K extends string>(array: T[], prop: K): number { let result = 0; for (const v of array) { - // TODO: Remove the following type assertion once the fix for #17069 is merged + // Note: we need the following type assertion because of GH #17069 result += v[prop] as number; } return result; diff --git a/tests/baselines/reference/additionOperatorWithConstrainedTypeParameter.js b/tests/baselines/reference/additionOperatorWithConstrainedTypeParameter.js deleted file mode 100644 index 1366e242182e4..0000000000000 --- a/tests/baselines/reference/additionOperatorWithConstrainedTypeParameter.js +++ /dev/null @@ -1,27 +0,0 @@ -//// [additionOperatorWithConstrainedTypeParameter.ts] -// test for #17069 -function sum, K extends string>(n: number, v: T, k: K) { - n = n + v[k]; - n += v[k]; // += should work the same way -} -function realSum, K extends string>(n: number, vs: T[], k: K) { - for (const v of vs) { - n = n + v[k]; - n += v[k]; - } -} - - -//// [additionOperatorWithConstrainedTypeParameter.js] -// test for #17069 -function sum(n, v, k) { - n = n + v[k]; - n += v[k]; // += should work the same way -} -function realSum(n, vs, k) { - for (var _i = 0, vs_1 = vs; _i < vs_1.length; _i++) { - var v = vs_1[_i]; - n = n + v[k]; - n += v[k]; - } -} diff --git a/tests/baselines/reference/additionOperatorWithConstrainedTypeParameter.symbols b/tests/baselines/reference/additionOperatorWithConstrainedTypeParameter.symbols deleted file mode 100644 index e7055c1e38f8d..0000000000000 --- a/tests/baselines/reference/additionOperatorWithConstrainedTypeParameter.symbols +++ /dev/null @@ -1,54 +0,0 @@ -=== tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithConstrainedTypeParameter.ts === -// test for #17069 -function sum, K extends string>(n: number, v: T, k: K) { ->sum : Symbol(sum, Decl(additionOperatorWithConstrainedTypeParameter.ts, 0, 0)) ->T : Symbol(T, Decl(additionOperatorWithConstrainedTypeParameter.ts, 1, 13)) ->Record : Symbol(Record, Decl(lib.d.ts, --, --)) ->K : Symbol(K, Decl(additionOperatorWithConstrainedTypeParameter.ts, 1, 41)) ->K : Symbol(K, Decl(additionOperatorWithConstrainedTypeParameter.ts, 1, 41)) ->n : Symbol(n, Decl(additionOperatorWithConstrainedTypeParameter.ts, 1, 60)) ->v : Symbol(v, Decl(additionOperatorWithConstrainedTypeParameter.ts, 1, 70)) ->T : Symbol(T, Decl(additionOperatorWithConstrainedTypeParameter.ts, 1, 13)) ->k : Symbol(k, Decl(additionOperatorWithConstrainedTypeParameter.ts, 1, 76)) ->K : Symbol(K, Decl(additionOperatorWithConstrainedTypeParameter.ts, 1, 41)) - - n = n + v[k]; ->n : Symbol(n, Decl(additionOperatorWithConstrainedTypeParameter.ts, 1, 60)) ->n : Symbol(n, Decl(additionOperatorWithConstrainedTypeParameter.ts, 1, 60)) ->v : Symbol(v, Decl(additionOperatorWithConstrainedTypeParameter.ts, 1, 70)) ->k : Symbol(k, Decl(additionOperatorWithConstrainedTypeParameter.ts, 1, 76)) - - n += v[k]; // += should work the same way ->n : Symbol(n, Decl(additionOperatorWithConstrainedTypeParameter.ts, 1, 60)) ->v : Symbol(v, Decl(additionOperatorWithConstrainedTypeParameter.ts, 1, 70)) ->k : Symbol(k, Decl(additionOperatorWithConstrainedTypeParameter.ts, 1, 76)) -} -function realSum, K extends string>(n: number, vs: T[], k: K) { ->realSum : Symbol(realSum, Decl(additionOperatorWithConstrainedTypeParameter.ts, 4, 1)) ->T : Symbol(T, Decl(additionOperatorWithConstrainedTypeParameter.ts, 5, 17)) ->Record : Symbol(Record, Decl(lib.d.ts, --, --)) ->K : Symbol(K, Decl(additionOperatorWithConstrainedTypeParameter.ts, 5, 45)) ->K : Symbol(K, Decl(additionOperatorWithConstrainedTypeParameter.ts, 5, 45)) ->n : Symbol(n, Decl(additionOperatorWithConstrainedTypeParameter.ts, 5, 64)) ->vs : Symbol(vs, Decl(additionOperatorWithConstrainedTypeParameter.ts, 5, 74)) ->T : Symbol(T, Decl(additionOperatorWithConstrainedTypeParameter.ts, 5, 17)) ->k : Symbol(k, Decl(additionOperatorWithConstrainedTypeParameter.ts, 5, 83)) ->K : Symbol(K, Decl(additionOperatorWithConstrainedTypeParameter.ts, 5, 45)) - - for (const v of vs) { ->v : Symbol(v, Decl(additionOperatorWithConstrainedTypeParameter.ts, 6, 14)) ->vs : Symbol(vs, Decl(additionOperatorWithConstrainedTypeParameter.ts, 5, 74)) - - n = n + v[k]; ->n : Symbol(n, Decl(additionOperatorWithConstrainedTypeParameter.ts, 5, 64)) ->n : Symbol(n, Decl(additionOperatorWithConstrainedTypeParameter.ts, 5, 64)) ->v : Symbol(v, Decl(additionOperatorWithConstrainedTypeParameter.ts, 6, 14)) ->k : Symbol(k, Decl(additionOperatorWithConstrainedTypeParameter.ts, 5, 83)) - - n += v[k]; ->n : Symbol(n, Decl(additionOperatorWithConstrainedTypeParameter.ts, 5, 64)) ->v : Symbol(v, Decl(additionOperatorWithConstrainedTypeParameter.ts, 6, 14)) ->k : Symbol(k, Decl(additionOperatorWithConstrainedTypeParameter.ts, 5, 83)) - } -} - diff --git a/tests/baselines/reference/additionOperatorWithConstrainedTypeParameter.types b/tests/baselines/reference/additionOperatorWithConstrainedTypeParameter.types deleted file mode 100644 index d52c77a94fd69..0000000000000 --- a/tests/baselines/reference/additionOperatorWithConstrainedTypeParameter.types +++ /dev/null @@ -1,64 +0,0 @@ -=== tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithConstrainedTypeParameter.ts === -// test for #17069 -function sum, K extends string>(n: number, v: T, k: K) { ->sum : , K extends string>(n: number, v: T, k: K) => void ->T : T ->Record : Record ->K : K ->K : K ->n : number ->v : T ->T : T ->k : K ->K : K - - n = n + v[k]; ->n = n + v[k] : number ->n : number ->n + v[k] : number ->n : number ->v[k] : T[K] ->v : T ->k : K - - n += v[k]; // += should work the same way ->n += v[k] : number ->n : number ->v[k] : T[K] ->v : T ->k : K -} -function realSum, K extends string>(n: number, vs: T[], k: K) { ->realSum : , K extends string>(n: number, vs: T[], k: K) => void ->T : T ->Record : Record ->K : K ->K : K ->n : number ->vs : T[] ->T : T ->k : K ->K : K - - for (const v of vs) { ->v : T ->vs : T[] - - n = n + v[k]; ->n = n + v[k] : number ->n : number ->n + v[k] : number ->n : number ->v[k] : T[K] ->v : T ->k : K - - n += v[k]; ->n += v[k] : number ->n : number ->v[k] : T[K] ->v : T ->k : K - } -} - diff --git a/tests/baselines/reference/nonPrimitiveConstraintOfIndexAccessType.errors.txt b/tests/baselines/reference/nonPrimitiveConstraintOfIndexAccessType.errors.txt deleted file mode 100644 index 56781157131a4..0000000000000 --- a/tests/baselines/reference/nonPrimitiveConstraintOfIndexAccessType.errors.txt +++ /dev/null @@ -1,67 +0,0 @@ -tests/cases/conformance/types/nonPrimitive/nonPrimitiveConstraintOfIndexAccessType.ts(3,5): error TS2322: Type 'string' is not assignable to type 'T[P]'. -tests/cases/conformance/types/nonPrimitive/nonPrimitiveConstraintOfIndexAccessType.ts(6,5): error TS2322: Type 'string' is not assignable to type 'T[P]'. -tests/cases/conformance/types/nonPrimitive/nonPrimitiveConstraintOfIndexAccessType.ts(9,5): error TS2322: Type 'string' is not assignable to type 'T[P]'. -tests/cases/conformance/types/nonPrimitive/nonPrimitiveConstraintOfIndexAccessType.ts(12,5): error TS2322: Type 'string' is not assignable to type 'T[P]'. -tests/cases/conformance/types/nonPrimitive/nonPrimitiveConstraintOfIndexAccessType.ts(15,5): error TS2322: Type 'string' is not assignable to type 'T[P]'. -tests/cases/conformance/types/nonPrimitive/nonPrimitiveConstraintOfIndexAccessType.ts(18,5): error TS2322: Type 'string' is not assignable to type 'T[P]'. -tests/cases/conformance/types/nonPrimitive/nonPrimitiveConstraintOfIndexAccessType.ts(21,5): error TS2322: Type 'string' is not assignable to type 'T[P]'. -tests/cases/conformance/types/nonPrimitive/nonPrimitiveConstraintOfIndexAccessType.ts(24,5): error TS2322: Type 'string' is not assignable to type 'T[P]'. -tests/cases/conformance/types/nonPrimitive/nonPrimitiveConstraintOfIndexAccessType.ts(27,5): error TS2322: Type 'string' is not assignable to type 'T[P]'. -tests/cases/conformance/types/nonPrimitive/nonPrimitiveConstraintOfIndexAccessType.ts(30,5): error TS2322: Type 'string' is not assignable to type 'T[P]'. - Type 'string' is not assignable to type 'number'. - - -==== tests/cases/conformance/types/nonPrimitive/nonPrimitiveConstraintOfIndexAccessType.ts (10 errors) ==== - // test for #15371 - function f(s: string, tp: T[P]): void { - tp = s; - ~~ -!!! error TS2322: Type 'string' is not assignable to type 'T[P]'. - } - function g(s: string, tp: T[P]): void { - tp = s; - ~~ -!!! error TS2322: Type 'string' is not assignable to type 'T[P]'. - } - function h(s: string, tp: T[P]): void { - tp = s; - ~~ -!!! error TS2322: Type 'string' is not assignable to type 'T[P]'. - } - function i(s: string, tp: T[P]): void { - tp = s; - ~~ -!!! error TS2322: Type 'string' is not assignable to type 'T[P]'. - } - function j(s: string, tp: T[P]): void { - tp = s; - ~~ -!!! error TS2322: Type 'string' is not assignable to type 'T[P]'. - } - function k(s: string, tp: T[P]): void { - tp = s; - ~~ -!!! error TS2322: Type 'string' is not assignable to type 'T[P]'. - } - function o(s: string, tp: T[P]): void { - tp = s; - ~~ -!!! error TS2322: Type 'string' is not assignable to type 'T[P]'. - } - function l(s: string, tp: T[P]): void { - tp = s; - ~~ -!!! error TS2322: Type 'string' is not assignable to type 'T[P]'. - } - function m(s: string, tp: T[P]): void { - tp = s; - ~~ -!!! error TS2322: Type 'string' is not assignable to type 'T[P]'. - } - function n(s: string, tp: T[P]): void { - tp = s; - ~~ -!!! error TS2322: Type 'string' is not assignable to type 'T[P]'. -!!! error TS2322: Type 'string' is not assignable to type 'number'. - } - \ No newline at end of file diff --git a/tests/baselines/reference/nonPrimitiveConstraintOfIndexAccessType.js b/tests/baselines/reference/nonPrimitiveConstraintOfIndexAccessType.js deleted file mode 100644 index 7a24345a94b11..0000000000000 --- a/tests/baselines/reference/nonPrimitiveConstraintOfIndexAccessType.js +++ /dev/null @@ -1,67 +0,0 @@ -//// [nonPrimitiveConstraintOfIndexAccessType.ts] -// test for #15371 -function f(s: string, tp: T[P]): void { - tp = s; -} -function g(s: string, tp: T[P]): void { - tp = s; -} -function h(s: string, tp: T[P]): void { - tp = s; -} -function i(s: string, tp: T[P]): void { - tp = s; -} -function j(s: string, tp: T[P]): void { - tp = s; -} -function k(s: string, tp: T[P]): void { - tp = s; -} -function o(s: string, tp: T[P]): void { - tp = s; -} -function l(s: string, tp: T[P]): void { - tp = s; -} -function m(s: string, tp: T[P]): void { - tp = s; -} -function n(s: string, tp: T[P]): void { - tp = s; -} - - -//// [nonPrimitiveConstraintOfIndexAccessType.js] -"use strict"; -// test for #15371 -function f(s, tp) { - tp = s; -} -function g(s, tp) { - tp = s; -} -function h(s, tp) { - tp = s; -} -function i(s, tp) { - tp = s; -} -function j(s, tp) { - tp = s; -} -function k(s, tp) { - tp = s; -} -function o(s, tp) { - tp = s; -} -function l(s, tp) { - tp = s; -} -function m(s, tp) { - tp = s; -} -function n(s, tp) { - tp = s; -} diff --git a/tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithConstrainedTypeParameter.ts b/tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithConstrainedTypeParameter.ts deleted file mode 100644 index 2303bb33944ad..0000000000000 --- a/tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithConstrainedTypeParameter.ts +++ /dev/null @@ -1,11 +0,0 @@ -// test for #17069 -function sum, K extends string>(n: number, v: T, k: K) { - n = n + v[k]; - n += v[k]; // += should work the same way -} -function realSum, K extends string>(n: number, vs: T[], k: K) { - for (const v of vs) { - n = n + v[k]; - n += v[k]; - } -} diff --git a/tests/cases/conformance/types/nonPrimitive/nonPrimitiveConstraintOfIndexAccessType.ts b/tests/cases/conformance/types/nonPrimitive/nonPrimitiveConstraintOfIndexAccessType.ts deleted file mode 100644 index 1e852f12f928e..0000000000000 --- a/tests/cases/conformance/types/nonPrimitive/nonPrimitiveConstraintOfIndexAccessType.ts +++ /dev/null @@ -1,32 +0,0 @@ -// @strict: true -// test for #15371 -function f(s: string, tp: T[P]): void { - tp = s; -} -function g(s: string, tp: T[P]): void { - tp = s; -} -function h(s: string, tp: T[P]): void { - tp = s; -} -function i(s: string, tp: T[P]): void { - tp = s; -} -function j(s: string, tp: T[P]): void { - tp = s; -} -function k(s: string, tp: T[P]): void { - tp = s; -} -function o(s: string, tp: T[P]): void { - tp = s; -} -function l(s: string, tp: T[P]): void { - tp = s; -} -function m(s: string, tp: T[P]): void { - tp = s; -} -function n(s: string, tp: T[P]): void { - tp = s; -} From ecd2ae8dac34ab8cc9f41d054824b1fc9cfa73ff Mon Sep 17 00:00:00 2001 From: Wesley Wigham Date: Fri, 18 Aug 2017 11:44:36 -0700 Subject: [PATCH 178/237] Deduplicate inputfiles before running RWC tests (#17877) * Deduplicate inputfiles before running RWC tests We deduplicate in the compiler, but we don't in the harness - this causes tests where the same file is listed multiple times in the arguments to not have the expected errors written, because we write out the same file multiple times when we should not. * Don't completely omit both copied of duplicates * Remove trailing whitespace * Maintain list order while filtering duplicates * Merge adjacent loops --- src/harness/rwcRunner.ts | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/harness/rwcRunner.ts b/src/harness/rwcRunner.ts index a1dc50349e42c..cddb9b19d4a4b 100644 --- a/src/harness/rwcRunner.ts +++ b/src/harness/rwcRunner.ts @@ -90,9 +90,16 @@ namespace RWC { ts.setConfigFileInOptions(opts.options, configParseResult.options.configFile); } - // Load the files + // Deduplicate files so they are only printed once in baselines (they are deduplicated within the compiler already) + const uniqueNames = ts.createMap(); for (const fileName of fileNames) { - inputFiles.push(getHarnessCompilerInputUnit(fileName)); + // Must maintain order, build result list while checking map + const normalized = ts.normalizeSlashes(fileName); + if (!uniqueNames.has(normalized)) { + uniqueNames.set(normalized, true); + // Load the file + inputFiles.push(getHarnessCompilerInputUnit(fileName)); + } } // Add files to compilation From 4983e11b67af07c4d0c737249f22a51e2f614f5a Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Fri, 18 Aug 2017 11:04:53 -0700 Subject: [PATCH 179/237] Added test for leading underscore property name suggestions. --- .../spellingSuggestionLeadingUnderscores01.ts | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 tests/cases/compiler/spellingSuggestionLeadingUnderscores01.ts diff --git a/tests/cases/compiler/spellingSuggestionLeadingUnderscores01.ts b/tests/cases/compiler/spellingSuggestionLeadingUnderscores01.ts new file mode 100644 index 0000000000000..99c9644b09509 --- /dev/null +++ b/tests/cases/compiler/spellingSuggestionLeadingUnderscores01.ts @@ -0,0 +1,17 @@ +// @module: commonjs +// @filename abc.ts +export declare let a: { + __foo: 10, +} + +a.___foo + +// @filename def.ts +export let b: { + __foo: number +} + +b = { + __foo: 100, +} + From 4ac9091ea14665a42cfd397113b9f04a4e8abd7c Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Fri, 18 Aug 2017 11:46:51 -0700 Subject: [PATCH 180/237] Accepted baselines. --- ...gSuggestionLeadingUnderscores01.errors.txt | 23 ++++++++++++++++ .../spellingSuggestionLeadingUnderscores01.js | 26 +++++++++++++++++++ 2 files changed, 49 insertions(+) create mode 100644 tests/baselines/reference/spellingSuggestionLeadingUnderscores01.errors.txt create mode 100644 tests/baselines/reference/spellingSuggestionLeadingUnderscores01.js diff --git a/tests/baselines/reference/spellingSuggestionLeadingUnderscores01.errors.txt b/tests/baselines/reference/spellingSuggestionLeadingUnderscores01.errors.txt new file mode 100644 index 0000000000000..a265dfc1fb6ac --- /dev/null +++ b/tests/baselines/reference/spellingSuggestionLeadingUnderscores01.errors.txt @@ -0,0 +1,23 @@ +tests/cases/compiler/spellingSuggestionLeadingUnderscores01.ts(6,3): error TS2551: Property '___foo' does not exist on type '{ __foo: 10; }'. Did you mean '___foo'? + + +==== tests/cases/compiler/spellingSuggestionLeadingUnderscores01.ts (1 errors) ==== + // @filename abc.ts + export declare let a: { + __foo: 10, + } + + a.___foo + ~~~~~~ +!!! error TS2551: Property '___foo' does not exist on type '{ __foo: 10; }'. Did you mean '___foo'? + + // @filename def.ts + export let b: { + __foo: number + } + + b = { + __foo: 100, + } + + \ No newline at end of file diff --git a/tests/baselines/reference/spellingSuggestionLeadingUnderscores01.js b/tests/baselines/reference/spellingSuggestionLeadingUnderscores01.js new file mode 100644 index 0000000000000..fbcc3dc1cad2c --- /dev/null +++ b/tests/baselines/reference/spellingSuggestionLeadingUnderscores01.js @@ -0,0 +1,26 @@ +//// [spellingSuggestionLeadingUnderscores01.ts] +// @filename abc.ts +export declare let a: { + __foo: 10, +} + +a.___foo + +// @filename def.ts +export let b: { + __foo: number +} + +b = { + __foo: 100, +} + + + +//// [spellingSuggestionLeadingUnderscores01.js] +"use strict"; +exports.__esModule = true; +exports.a.___foo; +exports.b = { + __foo: 100 +}; From 70ad2bdb3134139ec21c6682c42e523aa4a1784c Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Fri, 18 Aug 2017 12:54:35 -0700 Subject: [PATCH 181/237] Ensure that property suggestions are correctly escaped. --- src/compiler/checker.ts | 4 ++-- src/compiler/core.ts | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 6df6b1f9ce1b9..54388d09e7df9 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -14676,8 +14676,8 @@ namespace ts { } } const suggestion = getSuggestionForNonexistentProperty(propNode, containingType); - if (suggestion) { - errorInfo = chainDiagnosticMessages(errorInfo, Diagnostics.Property_0_does_not_exist_on_type_1_Did_you_mean_2, declarationNameToString(propNode), typeToString(containingType), suggestion); + if (suggestion !== undefined) { + errorInfo = chainDiagnosticMessages(errorInfo, Diagnostics.Property_0_does_not_exist_on_type_1_Did_you_mean_2, declarationNameToString(propNode), typeToString(containingType), unescapeLeadingUnderscores(suggestion)); } else { errorInfo = chainDiagnosticMessages(errorInfo, Diagnostics.Property_0_does_not_exist_on_type_1, declarationNameToString(propNode), typeToString(containingType)); diff --git a/src/compiler/core.ts b/src/compiler/core.ts index 8cab1b4115502..eae2e5ee33648 100644 --- a/src/compiler/core.ts +++ b/src/compiler/core.ts @@ -1359,7 +1359,7 @@ namespace ts { }; } - export function chainDiagnosticMessages(details: DiagnosticMessageChain, message: DiagnosticMessage, ...args: any[]): DiagnosticMessageChain; + export function chainDiagnosticMessages(details: DiagnosticMessageChain, message: DiagnosticMessage, ...args: string[]): DiagnosticMessageChain; export function chainDiagnosticMessages(details: DiagnosticMessageChain, message: DiagnosticMessage): DiagnosticMessageChain { let text = getLocaleSpecificMessage(message); From 50671c374c51383d80360963f8635c5a9af97eed Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Fri, 18 Aug 2017 12:55:35 -0700 Subject: [PATCH 182/237] Try to provide a spelling suggestion when object literals have excess properties. --- src/compiler/checker.ts | 21 ++++++++++++++++++--- src/compiler/diagnosticMessages.json | 4 ++++ 2 files changed, 22 insertions(+), 3 deletions(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 54388d09e7df9..d2b51867217e8 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -9067,11 +9067,26 @@ namespace ts { else { // use the property's value declaration if the property is assigned inside the literal itself const objectLiteralDeclaration = source.symbol && firstOrUndefined(source.symbol.declarations); + let suggestion; if (prop.valueDeclaration && findAncestor(prop.valueDeclaration, d => d === objectLiteralDeclaration)) { - errorNode = prop.valueDeclaration; + const propDeclaration = prop.valueDeclaration as ObjectLiteralElementLike; + Debug.assertNode(propDeclaration, isObjectLiteralElementLike); + + errorNode = propDeclaration; + + const propNameNode = propDeclaration.name as Identifier; + Debug.assertNode(propNameNode, isIdentifier); + suggestion = getSuggestionForNonexistentProperty(propNameNode, target); + } + + if (suggestion !== undefined) { + reportError(Diagnostics.Object_literal_may_only_specify_known_properties_but_0_does_not_exist_in_type_1_Did_you_mean_to_write_2, + symbolToString(prop), typeToString(target), unescapeLeadingUnderscores(suggestion)); + } + else { + reportError(Diagnostics.Object_literal_may_only_specify_known_properties_and_0_does_not_exist_in_type_1, + symbolToString(prop), typeToString(target)); } - reportError(Diagnostics.Object_literal_may_only_specify_known_properties_and_0_does_not_exist_in_type_1, - symbolToString(prop), typeToString(target)); } } return true; diff --git a/src/compiler/diagnosticMessages.json b/src/compiler/diagnosticMessages.json index 77e7f7e7b6246..e7d292d57d198 100644 --- a/src/compiler/diagnosticMessages.json +++ b/src/compiler/diagnosticMessages.json @@ -1912,6 +1912,10 @@ "category": "Error", "code": 2560 }, + "Object literal may only specify known properties, but '{0}' does not exist in type '{1}'. Did you mean to write '{2}'?": { + "category": "Error", + "code": 2561 + }, "JSX element attributes type '{0}' may not be a union type.": { "category": "Error", "code": 2600 From 8b10ea4c1d3a4376e18a70a8be7d0e0af780ceed Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Fri, 18 Aug 2017 12:55:54 -0700 Subject: [PATCH 183/237] Accepted baselines. --- .../reference/nestedFreshLiteral.errors.txt | 4 ++-- .../objectLiteralExcessProperties.errors.txt | 16 ++++++++-------- ...lingSuggestionLeadingUnderscores01.errors.txt | 4 ++-- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/tests/baselines/reference/nestedFreshLiteral.errors.txt b/tests/baselines/reference/nestedFreshLiteral.errors.txt index 6aff94ac0a6a4..d68b398449d53 100644 --- a/tests/baselines/reference/nestedFreshLiteral.errors.txt +++ b/tests/baselines/reference/nestedFreshLiteral.errors.txt @@ -4,7 +4,7 @@ tests/cases/compiler/nestedFreshLiteral.ts(12,21): error TS2322: Type '{ nested: Type '{ prop: { colour: string; }; }' is not assignable to type 'NestedSelector'. Types of property 'prop' are incompatible. Type '{ colour: string; }' is not assignable to type 'CSSProps'. - Object literal may only specify known properties, and 'colour' does not exist in type 'CSSProps'. + Object literal may only specify known properties, but 'colour' does not exist in type 'CSSProps'. Did you mean to write 'color'? ==== tests/cases/compiler/nestedFreshLiteral.ts (1 errors) ==== @@ -27,5 +27,5 @@ tests/cases/compiler/nestedFreshLiteral.ts(12,21): error TS2322: Type '{ nested: !!! error TS2322: Type '{ prop: { colour: string; }; }' is not assignable to type 'NestedSelector'. !!! error TS2322: Types of property 'prop' are incompatible. !!! error TS2322: Type '{ colour: string; }' is not assignable to type 'CSSProps'. -!!! error TS2322: Object literal may only specify known properties, and 'colour' does not exist in type 'CSSProps'. +!!! error TS2322: Object literal may only specify known properties, but 'colour' does not exist in type 'CSSProps'. Did you mean to write 'color'? } \ No newline at end of file diff --git a/tests/baselines/reference/objectLiteralExcessProperties.errors.txt b/tests/baselines/reference/objectLiteralExcessProperties.errors.txt index 98f2e30287c76..0c5909dc4ed45 100644 --- a/tests/baselines/reference/objectLiteralExcessProperties.errors.txt +++ b/tests/baselines/reference/objectLiteralExcessProperties.errors.txt @@ -1,5 +1,5 @@ tests/cases/compiler/objectLiteralExcessProperties.ts(9,18): error TS2322: Type '{ forword: string; }' is not assignable to type 'Book'. - Object literal may only specify known properties, and 'forword' does not exist in type 'Book'. + Object literal may only specify known properties, but 'forword' does not exist in type 'Book'. Did you mean to write 'foreword'? tests/cases/compiler/objectLiteralExcessProperties.ts(11,27): error TS2322: Type '{ foreward: string; }' is not assignable to type 'string | Book'. Object literal may only specify known properties, and 'foreward' does not exist in type 'string | Book'. tests/cases/compiler/objectLiteralExcessProperties.ts(13,53): error TS2322: Type '({ foreword: string; } | { forwards: string; })[]' is not assignable to type 'Book | Book[]'. @@ -8,9 +8,9 @@ tests/cases/compiler/objectLiteralExcessProperties.ts(13,53): error TS2322: Type Type '{ forwards: string; }' is not assignable to type 'Book'. Object literal may only specify known properties, and 'forwards' does not exist in type 'Book'. tests/cases/compiler/objectLiteralExcessProperties.ts(15,42): error TS2322: Type '{ foreword: string; colour: string; }' is not assignable to type 'Book & Cover'. - Object literal may only specify known properties, and 'colour' does not exist in type 'Book & Cover'. + Object literal may only specify known properties, but 'colour' does not exist in type 'Book & Cover'. Did you mean to write 'color'? tests/cases/compiler/objectLiteralExcessProperties.ts(17,26): error TS2322: Type '{ foreward: string; color: string; }' is not assignable to type 'Book & Cover'. - Object literal may only specify known properties, and 'foreward' does not exist in type 'Book & Cover'. + Object literal may only specify known properties, but 'foreward' does not exist in type 'Book & Cover'. Did you mean to write 'foreword'? tests/cases/compiler/objectLiteralExcessProperties.ts(19,57): error TS2322: Type '{ foreword: string; color: string; price: number; }' is not assignable to type 'Book & Cover'. Object literal may only specify known properties, and 'price' does not exist in type 'Book & Cover'. tests/cases/compiler/objectLiteralExcessProperties.ts(21,43): error TS2322: Type '{ foreword: string; price: number; }' is not assignable to type 'Book & number'. @@ -22,7 +22,7 @@ tests/cases/compiler/objectLiteralExcessProperties.ts(25,27): error TS2322: Type tests/cases/compiler/objectLiteralExcessProperties.ts(33,27): error TS2322: Type '{ 0: { colour: string; }; }' is not assignable to type 'Indexed'. Property '0' is incompatible with index signature. Type '{ colour: string; }' is not assignable to type 'Cover'. - Object literal may only specify known properties, and 'colour' does not exist in type 'Cover'. + Object literal may only specify known properties, but 'colour' does not exist in type 'Cover'. Did you mean to write 'color'? ==== tests/cases/compiler/objectLiteralExcessProperties.ts (10 errors) ==== @@ -37,7 +37,7 @@ tests/cases/compiler/objectLiteralExcessProperties.ts(33,27): error TS2322: Type var b1: Book = { forword: "oops" }; ~~~~~~~~~~~~~~~ !!! error TS2322: Type '{ forword: string; }' is not assignable to type 'Book'. -!!! error TS2322: Object literal may only specify known properties, and 'forword' does not exist in type 'Book'. +!!! error TS2322: Object literal may only specify known properties, but 'forword' does not exist in type 'Book'. Did you mean to write 'foreword'? var b2: Book | string = { foreward: "nope" }; ~~~~~~~~~~~~~~~~ @@ -55,12 +55,12 @@ tests/cases/compiler/objectLiteralExcessProperties.ts(33,27): error TS2322: Type var b4: Book & Cover = { foreword: "hi", colour: "blue" }; ~~~~~~~~~~~~~~ !!! error TS2322: Type '{ foreword: string; colour: string; }' is not assignable to type 'Book & Cover'. -!!! error TS2322: Object literal may only specify known properties, and 'colour' does not exist in type 'Book & Cover'. +!!! error TS2322: Object literal may only specify known properties, but 'colour' does not exist in type 'Book & Cover'. Did you mean to write 'color'? var b5: Book & Cover = { foreward: "hi", color: "blue" }; ~~~~~~~~~~~~~~ !!! error TS2322: Type '{ foreward: string; color: string; }' is not assignable to type 'Book & Cover'. -!!! error TS2322: Object literal may only specify known properties, and 'foreward' does not exist in type 'Book & Cover'. +!!! error TS2322: Object literal may only specify known properties, but 'foreward' does not exist in type 'Book & Cover'. Did you mean to write 'foreword'? var b6: Book & Cover = { foreword: "hi", color: "blue", price: 10.99 }; ~~~~~~~~~~~~ @@ -93,5 +93,5 @@ tests/cases/compiler/objectLiteralExcessProperties.ts(33,27): error TS2322: Type !!! error TS2322: Type '{ 0: { colour: string; }; }' is not assignable to type 'Indexed'. !!! error TS2322: Property '0' is incompatible with index signature. !!! error TS2322: Type '{ colour: string; }' is not assignable to type 'Cover'. -!!! error TS2322: Object literal may only specify known properties, and 'colour' does not exist in type 'Cover'. +!!! error TS2322: Object literal may only specify known properties, but 'colour' does not exist in type 'Cover'. Did you mean to write 'color'? \ No newline at end of file diff --git a/tests/baselines/reference/spellingSuggestionLeadingUnderscores01.errors.txt b/tests/baselines/reference/spellingSuggestionLeadingUnderscores01.errors.txt index a265dfc1fb6ac..af0a647f87e7a 100644 --- a/tests/baselines/reference/spellingSuggestionLeadingUnderscores01.errors.txt +++ b/tests/baselines/reference/spellingSuggestionLeadingUnderscores01.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/spellingSuggestionLeadingUnderscores01.ts(6,3): error TS2551: Property '___foo' does not exist on type '{ __foo: 10; }'. Did you mean '___foo'? +tests/cases/compiler/spellingSuggestionLeadingUnderscores01.ts(6,3): error TS2551: Property '___foo' does not exist on type '{ __foo: 10; }'. Did you mean '__foo'? ==== tests/cases/compiler/spellingSuggestionLeadingUnderscores01.ts (1 errors) ==== @@ -9,7 +9,7 @@ tests/cases/compiler/spellingSuggestionLeadingUnderscores01.ts(6,3): error TS255 a.___foo ~~~~~~ -!!! error TS2551: Property '___foo' does not exist on type '{ __foo: 10; }'. Did you mean '___foo'? +!!! error TS2551: Property '___foo' does not exist on type '{ __foo: 10; }'. Did you mean '__foo'? // @filename def.ts export let b: { From 8e5e6c626b24253a55e048c698c9283b25dce5b2 Mon Sep 17 00:00:00 2001 From: Mohamed Hegazy Date: Fri, 18 Aug 2017 13:00:29 -0700 Subject: [PATCH 184/237] Update .npmignore (#17905) --- .npmignore | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.npmignore b/.npmignore index d3c27afeff45a..50ae145423aa5 100644 --- a/.npmignore +++ b/.npmignore @@ -16,4 +16,5 @@ Jakefile.js .gitattributes .settings/ .travis.yml -.vscode/ \ No newline at end of file +.vscode/ +test.config \ No newline at end of file From a14aaf47721bd1728897c1b527a1326a3ca7fbb0 Mon Sep 17 00:00:00 2001 From: Mohamed Hegazy Date: Fri, 18 Aug 2017 15:58:21 -0700 Subject: [PATCH 185/237] Add release-2.5 to covered branches --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index 4a99aaf2237fd..27b14739d8b10 100644 --- a/.travis.yml +++ b/.travis.yml @@ -16,6 +16,7 @@ matrix: branches: only: - master + - release-2.5 install: - npm uninstall typescript --no-save From 7cc6bfc98572c2812088dddffaede3df3d36a904 Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Fri, 18 Aug 2017 15:58:31 -0700 Subject: [PATCH 186/237] Only give suggestions when the name is an identifier. --- src/compiler/checker.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index d2b51867217e8..d128eb29d9594 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -9074,9 +9074,9 @@ namespace ts { errorNode = propDeclaration; - const propNameNode = propDeclaration.name as Identifier; - Debug.assertNode(propNameNode, isIdentifier); - suggestion = getSuggestionForNonexistentProperty(propNameNode, target); + if (isIdentifier(propDeclaration.name)) { + suggestion = getSuggestionForNonexistentProperty(propDeclaration.name, target); + } } if (suggestion !== undefined) { From e6c1afb4a0b8f04f6202a7dd1f39d7cdffeaf096 Mon Sep 17 00:00:00 2001 From: uniqueiniquity Date: Fri, 18 Aug 2017 15:59:22 -0700 Subject: [PATCH 187/237] Style changes and cleanup --- src/services/outliningElementsCollector.ts | 29 +++++++++++----------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/src/services/outliningElementsCollector.ts b/src/services/outliningElementsCollector.ts index cdeba21b32bc4..e0d99d1d27165 100644 --- a/src/services/outliningElementsCollector.ts +++ b/src/services/outliningElementsCollector.ts @@ -1,20 +1,21 @@ /* @internal */ namespace ts.OutliningElementsCollector { + const collapseText = "..."; + const maxDepth = 20; + export function collectElements(sourceFile: SourceFile, cancellationToken: CancellationToken): OutliningSpan[] { const elements: OutliningSpan[] = []; - const collapseText = "..."; let depth = 0; - const maxDepth = 20; walk(sourceFile); return elements; - // If useFullStart is true, then the collapsing span includes leading whitespace, including linebreaks. + /** If useFullStart is true, then the collapsing span includes leading whitespace, including linebreaks. */ function addOutliningSpan(hintSpanNode: Node, startElement: Node, endElement: Node, autoCollapse: boolean, useFullStart: boolean) { if (hintSpanNode && startElement && endElement) { const span: OutliningSpan = { - textSpan: createTextSpanFromBounds(useFullStart ? startElement.pos : startElement.getStart(), endElement.end), - hintSpan: createTextSpanFromBounds(startElement.getStart(), endElement.end), + textSpan: createTextSpanFromBounds(useFullStart ? startElement.getFullStart() : startElement.getStart(), endElement.getEnd()), + hintSpan: createTextSpanFromNode(hintSpanNode, sourceFile), bannerText: collapseText, autoCollapse, }; @@ -117,7 +118,7 @@ namespace ts.OutliningElementsCollector { parent.kind === SyntaxKind.WithStatement || parent.kind === SyntaxKind.CatchClause) { - addOutliningSpan(parent, openBrace, closeBrace, autoCollapse(n), /* fullStart */ true); + addOutliningSpan(parent, openBrace, closeBrace, autoCollapse(n), /*useFullStart*/ true); break; } @@ -125,13 +126,13 @@ namespace ts.OutliningElementsCollector { // Could be the try-block, or the finally-block. const tryStatement = parent; if (tryStatement.tryBlock === n) { - addOutliningSpan(parent, openBrace, closeBrace, autoCollapse(n), /* fullStart */ true); + addOutliningSpan(parent, openBrace, closeBrace, autoCollapse(n), /*useFullStart*/ true); break; } else if (tryStatement.finallyBlock === n) { const finallyKeyword = findChildOfKind(tryStatement, SyntaxKind.FinallyKeyword, sourceFile); if (finallyKeyword) { - addOutliningSpan(finallyKeyword, openBrace, closeBrace, autoCollapse(n), /* fullStart */ true); + addOutliningSpan(finallyKeyword, openBrace, closeBrace, autoCollapse(n), /*useFullStart*/ true); break; } } @@ -155,7 +156,7 @@ namespace ts.OutliningElementsCollector { case SyntaxKind.ModuleBlock: { const openBrace = findChildOfKind(n, SyntaxKind.OpenBraceToken, sourceFile); const closeBrace = findChildOfKind(n, SyntaxKind.CloseBraceToken, sourceFile); - addOutliningSpan(n.parent, openBrace, closeBrace, autoCollapse(n), /* fullStart */ true); + addOutliningSpan(n.parent, openBrace, closeBrace, autoCollapse(n), /*useFullStart*/ true); break; } case SyntaxKind.ClassDeclaration: @@ -164,21 +165,21 @@ namespace ts.OutliningElementsCollector { case SyntaxKind.CaseBlock: { const openBrace = findChildOfKind(n, SyntaxKind.OpenBraceToken, sourceFile); const closeBrace = findChildOfKind(n, SyntaxKind.CloseBraceToken, sourceFile); - addOutliningSpan(n, openBrace, closeBrace, autoCollapse(n), /* fullStart */ true); + addOutliningSpan(n, openBrace, closeBrace, autoCollapse(n), /*useFullStart*/ true); break; } - // If the block has no leading keywords and is a member of an array literal, - // we again want to only collapse the span of the block. + // If the block has no leading keywords and is inside an array literal, + // we only want to collapse the span of the block. // Otherwise, the collapsed section will include the end of the previous line. case SyntaxKind.ObjectLiteralExpression: const openBrace = findChildOfKind(n, SyntaxKind.OpenBraceToken, sourceFile); const closeBrace = findChildOfKind(n, SyntaxKind.CloseBraceToken, sourceFile); - addOutliningSpan(n, openBrace, closeBrace, autoCollapse(n), /* fullStart */ n.parent.kind !== SyntaxKind.ArrayLiteralExpression); + addOutliningSpan(n, openBrace, closeBrace, autoCollapse(n), /*useFullStart*/ !isArrayLiteralExpression(n.parent)); break; case SyntaxKind.ArrayLiteralExpression: const openBracket = findChildOfKind(n, SyntaxKind.OpenBracketToken, sourceFile); const closeBracket = findChildOfKind(n, SyntaxKind.CloseBracketToken, sourceFile); - addOutliningSpan(n, openBracket, closeBracket, autoCollapse(n), /* fullStart */ n.parent.kind !== SyntaxKind.ArrayLiteralExpression); + addOutliningSpan(n, openBracket, closeBracket, autoCollapse(n), /*useFullStart*/ !isArrayLiteralExpression(n.parent)); break; } depth++; From a136f554a708f8caf2fe4b9060207e7d9869a7d2 Mon Sep 17 00:00:00 2001 From: Wesley Wigham Date: Fri, 18 Aug 2017 17:20:57 -0700 Subject: [PATCH 188/237] Fix stack overflow when resolving default construct signatures (#17878) * Fix stack overflow when resolving default construct signatures * No need for || emptyArray --- src/compiler/checker.ts | 16 ++++--- .../reference/cloduleGenericOnSelfMember.js | 42 +++++++++++++++++++ .../cloduleGenericOnSelfMember.symbols | 30 +++++++++++++ .../cloduleGenericOnSelfMember.types | 33 +++++++++++++++ .../compiler/cloduleGenericOnSelfMember.ts | 11 +++++ 5 files changed, 126 insertions(+), 6 deletions(-) create mode 100644 tests/baselines/reference/cloduleGenericOnSelfMember.js create mode 100644 tests/baselines/reference/cloduleGenericOnSelfMember.symbols create mode 100644 tests/baselines/reference/cloduleGenericOnSelfMember.types create mode 100644 tests/cases/compiler/cloduleGenericOnSelfMember.ts diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 6df6b1f9ce1b9..6febaf0052d96 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -5657,17 +5657,12 @@ namespace ts { else { // Combinations of function, class, enum and module let members = emptySymbols; - let constructSignatures: Signature[] = emptyArray; let stringIndexInfo: IndexInfo = undefined; if (symbol.exports) { members = getExportsOfSymbol(symbol); } if (symbol.flags & SymbolFlags.Class) { const classType = getDeclaredTypeOfClassOrInterface(symbol); - constructSignatures = getSignaturesOfSymbol(symbol.members.get(InternalSymbolName.Constructor)); - if (!constructSignatures.length) { - constructSignatures = getDefaultConstructSignatures(classType); - } const baseConstructorType = getBaseConstructorTypeOfClass(classType); if (baseConstructorType.flags & (TypeFlags.Object | TypeFlags.Intersection | TypeFlags.TypeVariable)) { members = createSymbolTable(getNamedMembers(members)); @@ -5678,7 +5673,7 @@ namespace ts { } } const numberIndexInfo = symbol.flags & SymbolFlags.Enum ? enumNumberIndexInfo : undefined; - setStructuredTypeMembers(type, members, emptyArray, constructSignatures, stringIndexInfo, numberIndexInfo); + setStructuredTypeMembers(type, members, emptyArray, emptyArray, stringIndexInfo, numberIndexInfo); // We resolve the members before computing the signatures because a signature may use // typeof with a qualified name expression that circularly references the type we are // in the process of resolving (see issue #6072). The temporarily empty signature list @@ -5686,6 +5681,15 @@ namespace ts { if (symbol.flags & (SymbolFlags.Function | SymbolFlags.Method)) { (type).callSignatures = getSignaturesOfSymbol(symbol); } + // And likewise for construct signatures for classes + if (symbol.flags & SymbolFlags.Class) { + const classType = getDeclaredTypeOfClassOrInterface(symbol); + let constructSignatures = getSignaturesOfSymbol(symbol.members.get(InternalSymbolName.Constructor)); + if (!constructSignatures.length) { + constructSignatures = getDefaultConstructSignatures(classType); + } + (type).constructSignatures = constructSignatures; + } } } diff --git a/tests/baselines/reference/cloduleGenericOnSelfMember.js b/tests/baselines/reference/cloduleGenericOnSelfMember.js new file mode 100644 index 0000000000000..972651f104579 --- /dev/null +++ b/tests/baselines/reference/cloduleGenericOnSelfMember.js @@ -0,0 +1,42 @@ +//// [cloduleGenericOnSelfMember.ts] +class ServiceBase { + field: T; +} +class Service extends ServiceBase { +} +namespace Service { + export const Base = { + name: "1", + value: 5 + }; +} + +//// [cloduleGenericOnSelfMember.js] +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +var ServiceBase = /** @class */ (function () { + function ServiceBase() { + } + return ServiceBase; +}()); +var Service = /** @class */ (function (_super) { + __extends(Service, _super); + function Service() { + return _super !== null && _super.apply(this, arguments) || this; + } + return Service; +}(ServiceBase)); +(function (Service) { + Service.Base = { + name: "1", + value: 5 + }; +})(Service || (Service = {})); diff --git a/tests/baselines/reference/cloduleGenericOnSelfMember.symbols b/tests/baselines/reference/cloduleGenericOnSelfMember.symbols new file mode 100644 index 0000000000000..c7e0126fa7abd --- /dev/null +++ b/tests/baselines/reference/cloduleGenericOnSelfMember.symbols @@ -0,0 +1,30 @@ +=== tests/cases/compiler/cloduleGenericOnSelfMember.ts === +class ServiceBase { +>ServiceBase : Symbol(ServiceBase, Decl(cloduleGenericOnSelfMember.ts, 0, 0)) +>T : Symbol(T, Decl(cloduleGenericOnSelfMember.ts, 0, 18)) + + field: T; +>field : Symbol(ServiceBase.field, Decl(cloduleGenericOnSelfMember.ts, 0, 22)) +>T : Symbol(T, Decl(cloduleGenericOnSelfMember.ts, 0, 18)) +} +class Service extends ServiceBase { +>Service : Symbol(Service, Decl(cloduleGenericOnSelfMember.ts, 2, 1), Decl(cloduleGenericOnSelfMember.ts, 4, 1)) +>ServiceBase : Symbol(ServiceBase, Decl(cloduleGenericOnSelfMember.ts, 0, 0)) +>Service.Base : Symbol(Service.Base, Decl(cloduleGenericOnSelfMember.ts, 6, 16)) +>Service : Symbol(Service, Decl(cloduleGenericOnSelfMember.ts, 2, 1), Decl(cloduleGenericOnSelfMember.ts, 4, 1)) +>Base : Symbol(Service.Base, Decl(cloduleGenericOnSelfMember.ts, 6, 16)) +} +namespace Service { +>Service : Symbol(Service, Decl(cloduleGenericOnSelfMember.ts, 2, 1), Decl(cloduleGenericOnSelfMember.ts, 4, 1)) + + export const Base = { +>Base : Symbol(Base, Decl(cloduleGenericOnSelfMember.ts, 6, 16)) + + name: "1", +>name : Symbol(name, Decl(cloduleGenericOnSelfMember.ts, 6, 25)) + + value: 5 +>value : Symbol(value, Decl(cloduleGenericOnSelfMember.ts, 7, 18)) + + }; +} diff --git a/tests/baselines/reference/cloduleGenericOnSelfMember.types b/tests/baselines/reference/cloduleGenericOnSelfMember.types new file mode 100644 index 0000000000000..87590745c6fdf --- /dev/null +++ b/tests/baselines/reference/cloduleGenericOnSelfMember.types @@ -0,0 +1,33 @@ +=== tests/cases/compiler/cloduleGenericOnSelfMember.ts === +class ServiceBase { +>ServiceBase : ServiceBase +>T : T + + field: T; +>field : T +>T : T +} +class Service extends ServiceBase { +>Service : Service +>ServiceBase : ServiceBase<{ name: string; value: number; }> +>Service.Base : { name: string; value: number; } +>Service : typeof Service +>Base : { name: string; value: number; } +} +namespace Service { +>Service : typeof Service + + export const Base = { +>Base : { name: string; value: number; } +>{ name: "1", value: 5 } : { name: string; value: number; } + + name: "1", +>name : string +>"1" : "1" + + value: 5 +>value : number +>5 : 5 + + }; +} diff --git a/tests/cases/compiler/cloduleGenericOnSelfMember.ts b/tests/cases/compiler/cloduleGenericOnSelfMember.ts new file mode 100644 index 0000000000000..23f0e6af1b67d --- /dev/null +++ b/tests/cases/compiler/cloduleGenericOnSelfMember.ts @@ -0,0 +1,11 @@ +class ServiceBase { + field: T; +} +class Service extends ServiceBase { +} +namespace Service { + export const Base = { + name: "1", + value: 5 + }; +} \ No newline at end of file From 5e8e735db55e82ff0cf4bddaf4f0fe6d8a4d39f7 Mon Sep 17 00:00:00 2001 From: Andy Date: Fri, 18 Aug 2017 17:21:25 -0700 Subject: [PATCH 189/237] quickInfo: Don't check for `type === undefined`, check for `any` (#17815) * quickInfo: Don't check for `type === undefined`, check for `any` * Fixes: * We still want to do some work even if type is `any` * Second test for `if (type)` is necessary because it might not have been assigned. --- src/services/symbolDisplay.ts | 201 ++++++++++---------- tests/cases/fourslash/quickInfoTypeError.ts | 10 + 2 files changed, 111 insertions(+), 100 deletions(-) create mode 100644 tests/cases/fourslash/quickInfoTypeError.ts diff --git a/src/services/symbolDisplay.ts b/src/services/symbolDisplay.ts index 303bb8395eee6..05c451cc3f3ac 100644 --- a/src/services/symbolDisplay.ts +++ b/src/services/symbolDisplay.ts @@ -111,124 +111,123 @@ namespace ts.SymbolDisplay { let signature: Signature; type = isThisExpression ? typeChecker.getTypeAtLocation(location) : typeChecker.getTypeOfSymbolAtLocation(symbol.exportSymbol || symbol, location); - if (type) { - if (location.parent && location.parent.kind === SyntaxKind.PropertyAccessExpression) { - const right = (location.parent).name; - // Either the location is on the right of a property access, or on the left and the right is missing - if (right === location || (right && right.getFullWidth() === 0)) { - location = location.parent; - } - } - // try get the call/construct signature from the type if it matches - let callExpressionLike: CallExpression | NewExpression | JsxOpeningLikeElement; - if (isCallOrNewExpression(location)) { - callExpressionLike = location; - } - else if (isCallExpressionTarget(location) || isNewExpressionTarget(location)) { - callExpressionLike = location.parent; + if (location.parent && location.parent.kind === SyntaxKind.PropertyAccessExpression) { + const right = (location.parent).name; + // Either the location is on the right of a property access, or on the left and the right is missing + if (right === location || (right && right.getFullWidth() === 0)) { + location = location.parent; } - else if (location.parent && isJsxOpeningLikeElement(location.parent) && isFunctionLike(symbol.valueDeclaration)) { - callExpressionLike = location.parent; + } + + // try get the call/construct signature from the type if it matches + let callExpressionLike: CallExpression | NewExpression | JsxOpeningLikeElement; + if (isCallOrNewExpression(location)) { + callExpressionLike = location; + } + else if (isCallExpressionTarget(location) || isNewExpressionTarget(location)) { + callExpressionLike = location.parent; + } + else if (location.parent && isJsxOpeningLikeElement(location.parent) && isFunctionLike(symbol.valueDeclaration)) { + callExpressionLike = location.parent; + } + + if (callExpressionLike) { + const candidateSignatures: Signature[] = []; + signature = typeChecker.getResolvedSignature(callExpressionLike, candidateSignatures); + if (!signature && candidateSignatures.length) { + // Use the first candidate: + signature = candidateSignatures[0]; } - if (callExpressionLike) { - const candidateSignatures: Signature[] = []; - signature = typeChecker.getResolvedSignature(callExpressionLike, candidateSignatures); - if (!signature && candidateSignatures.length) { - // Use the first candidate: - signature = candidateSignatures[0]; - } + const useConstructSignatures = callExpressionLike.kind === SyntaxKind.NewExpression || (isCallExpression(callExpressionLike) && callExpressionLike.expression.kind === SyntaxKind.SuperKeyword); - const useConstructSignatures = callExpressionLike.kind === SyntaxKind.NewExpression || (isCallExpression(callExpressionLike) && callExpressionLike.expression.kind === SyntaxKind.SuperKeyword); + const allSignatures = useConstructSignatures ? type.getConstructSignatures() : type.getCallSignatures(); - const allSignatures = useConstructSignatures ? type.getConstructSignatures() : type.getCallSignatures(); + if (!contains(allSignatures, signature.target) && !contains(allSignatures, signature)) { + // Get the first signature if there is one -- allSignatures may contain + // either the original signature or its target, so check for either + signature = allSignatures.length ? allSignatures[0] : undefined; + } - if (!contains(allSignatures, signature.target) && !contains(allSignatures, signature)) { - // Get the first signature if there is one -- allSignatures may contain - // either the original signature or its target, so check for either - signature = allSignatures.length ? allSignatures[0] : undefined; + if (signature) { + if (useConstructSignatures && (symbolFlags & SymbolFlags.Class)) { + // Constructor + symbolKind = ScriptElementKind.constructorImplementationElement; + addPrefixForAnyFunctionOrVar(type.symbol, symbolKind); } - - if (signature) { - if (useConstructSignatures && (symbolFlags & SymbolFlags.Class)) { - // Constructor - symbolKind = ScriptElementKind.constructorImplementationElement; - addPrefixForAnyFunctionOrVar(type.symbol, symbolKind); + else if (symbolFlags & SymbolFlags.Alias) { + symbolKind = ScriptElementKind.alias; + pushTypePart(symbolKind); + displayParts.push(spacePart()); + if (useConstructSignatures) { + displayParts.push(keywordPart(SyntaxKind.NewKeyword)); + displayParts.push(spacePart()); } - else if (symbolFlags & SymbolFlags.Alias) { - symbolKind = ScriptElementKind.alias; - pushTypePart(symbolKind); + addFullSymbolName(symbol); + } + else { + addPrefixForAnyFunctionOrVar(symbol, symbolKind); + } + + switch (symbolKind) { + case ScriptElementKind.jsxAttribute: + case ScriptElementKind.memberVariableElement: + case ScriptElementKind.variableElement: + case ScriptElementKind.constElement: + case ScriptElementKind.letElement: + case ScriptElementKind.parameterElement: + case ScriptElementKind.localVariableElement: + // If it is call or construct signature of lambda's write type name + displayParts.push(punctuationPart(SyntaxKind.ColonToken)); displayParts.push(spacePart()); if (useConstructSignatures) { displayParts.push(keywordPart(SyntaxKind.NewKeyword)); displayParts.push(spacePart()); } - addFullSymbolName(symbol); - } - else { - addPrefixForAnyFunctionOrVar(symbol, symbolKind); - } + if (!(type.flags & TypeFlags.Object && (type).objectFlags & ObjectFlags.Anonymous) && type.symbol) { + addRange(displayParts, symbolToDisplayParts(typeChecker, type.symbol, enclosingDeclaration, /*meaning*/ undefined, SymbolFormatFlags.WriteTypeParametersOrArguments)); + } + addSignatureDisplayParts(signature, allSignatures, TypeFormatFlags.WriteArrowStyleSignature); + break; - switch (symbolKind) { - case ScriptElementKind.jsxAttribute: - case ScriptElementKind.memberVariableElement: - case ScriptElementKind.variableElement: - case ScriptElementKind.constElement: - case ScriptElementKind.letElement: - case ScriptElementKind.parameterElement: - case ScriptElementKind.localVariableElement: - // If it is call or construct signature of lambda's write type name - displayParts.push(punctuationPart(SyntaxKind.ColonToken)); - displayParts.push(spacePart()); - if (useConstructSignatures) { - displayParts.push(keywordPart(SyntaxKind.NewKeyword)); - displayParts.push(spacePart()); - } - if (!(type.flags & TypeFlags.Object && (type).objectFlags & ObjectFlags.Anonymous) && type.symbol) { - addRange(displayParts, symbolToDisplayParts(typeChecker, type.symbol, enclosingDeclaration, /*meaning*/ undefined, SymbolFormatFlags.WriteTypeParametersOrArguments)); - } - addSignatureDisplayParts(signature, allSignatures, TypeFormatFlags.WriteArrowStyleSignature); - break; - - default: - // Just signature - addSignatureDisplayParts(signature, allSignatures); - } - hasAddedSymbolInfo = true; + default: + // Just signature + addSignatureDisplayParts(signature, allSignatures); } + hasAddedSymbolInfo = true; } - else if ((isNameOfFunctionDeclaration(location) && !(symbolFlags & SymbolFlags.Accessor)) || // name of function declaration - (location.kind === SyntaxKind.ConstructorKeyword && location.parent.kind === SyntaxKind.Constructor)) { // At constructor keyword of constructor declaration - // get the signature from the declaration and write it - const functionDeclaration = location.parent; - // Use function declaration to write the signatures only if the symbol corresponding to this declaration - const locationIsSymbolDeclaration = find(symbol.declarations, declaration => - declaration === (location.kind === SyntaxKind.ConstructorKeyword ? functionDeclaration.parent : functionDeclaration)); - - if (locationIsSymbolDeclaration) { - const allSignatures = functionDeclaration.kind === SyntaxKind.Constructor ? type.getNonNullableType().getConstructSignatures() : type.getNonNullableType().getCallSignatures(); - if (!typeChecker.isImplementationOfOverload(functionDeclaration)) { - signature = typeChecker.getSignatureFromDeclaration(functionDeclaration); - } - else { - signature = allSignatures[0]; - } - - if (functionDeclaration.kind === SyntaxKind.Constructor) { - // show (constructor) Type(...) signature - symbolKind = ScriptElementKind.constructorImplementationElement; - addPrefixForAnyFunctionOrVar(type.symbol, symbolKind); - } - else { - // (function/method) symbol(..signature) - addPrefixForAnyFunctionOrVar(functionDeclaration.kind === SyntaxKind.CallSignature && - !(type.symbol.flags & SymbolFlags.TypeLiteral || type.symbol.flags & SymbolFlags.ObjectLiteral) ? type.symbol : symbol, symbolKind); - } + } + else if ((isNameOfFunctionDeclaration(location) && !(symbolFlags & SymbolFlags.Accessor)) || // name of function declaration + (location.kind === SyntaxKind.ConstructorKeyword && location.parent.kind === SyntaxKind.Constructor)) { // At constructor keyword of constructor declaration + // get the signature from the declaration and write it + const functionDeclaration = location.parent; + // Use function declaration to write the signatures only if the symbol corresponding to this declaration + const locationIsSymbolDeclaration = find(symbol.declarations, declaration => + declaration === (location.kind === SyntaxKind.ConstructorKeyword ? functionDeclaration.parent : functionDeclaration)); + + if (locationIsSymbolDeclaration) { + const allSignatures = functionDeclaration.kind === SyntaxKind.Constructor ? type.getNonNullableType().getConstructSignatures() : type.getNonNullableType().getCallSignatures(); + if (!typeChecker.isImplementationOfOverload(functionDeclaration)) { + signature = typeChecker.getSignatureFromDeclaration(functionDeclaration); + } + else { + signature = allSignatures[0]; + } - addSignatureDisplayParts(signature, allSignatures); - hasAddedSymbolInfo = true; + if (functionDeclaration.kind === SyntaxKind.Constructor) { + // show (constructor) Type(...) signature + symbolKind = ScriptElementKind.constructorImplementationElement; + addPrefixForAnyFunctionOrVar(type.symbol, symbolKind); + } + else { + // (function/method) symbol(..signature) + addPrefixForAnyFunctionOrVar(functionDeclaration.kind === SyntaxKind.CallSignature && + !(type.symbol.flags & SymbolFlags.TypeLiteral || type.symbol.flags & SymbolFlags.ObjectLiteral) ? type.symbol : symbol, symbolKind); } + + addSignatureDisplayParts(signature, allSignatures); + hasAddedSymbolInfo = true; } } } @@ -417,7 +416,9 @@ namespace ts.SymbolDisplay { symbolFlags & SymbolFlags.Accessor || symbolKind === ScriptElementKind.memberFunctionElement) { const allSignatures = type.getNonNullableType().getCallSignatures(); - addSignatureDisplayParts(allSignatures[0], allSignatures); + if (allSignatures.length) { + addSignatureDisplayParts(allSignatures[0], allSignatures); + } } } } diff --git a/tests/cases/fourslash/quickInfoTypeError.ts b/tests/cases/fourslash/quickInfoTypeError.ts new file mode 100644 index 0000000000000..7e0c9b203038a --- /dev/null +++ b/tests/cases/fourslash/quickInfoTypeError.ts @@ -0,0 +1,10 @@ +/// + +////foo({ +//// /**/f: function() {}, +//// f() {} +////}); + +// The symbol indicates that this is a funciton, but the type is `any`. +// Regression test that we don't crash (by trying to get signatures from `any`). +verify.quickInfoAt("", "(method) f"); From 7739a1cea01236ced5990d77bec2d6e4d40963e4 Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Sat, 19 Aug 2017 00:03:35 -0700 Subject: [PATCH 190/237] Actually misspell the property name. --- tests/cases/compiler/spellingSuggestionLeadingUnderscores01.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/cases/compiler/spellingSuggestionLeadingUnderscores01.ts b/tests/cases/compiler/spellingSuggestionLeadingUnderscores01.ts index 99c9644b09509..cf60136f5ebb2 100644 --- a/tests/cases/compiler/spellingSuggestionLeadingUnderscores01.ts +++ b/tests/cases/compiler/spellingSuggestionLeadingUnderscores01.ts @@ -12,6 +12,6 @@ export let b: { } b = { - __foo: 100, + ___foo: 100, } From a1ad389d247d0e5960fd5616867b7d03fb6d0564 Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Sat, 19 Aug 2017 00:08:25 -0700 Subject: [PATCH 191/237] Accepted baselines. --- .../spellingSuggestionLeadingUnderscores01.errors.txt | 9 +++++++-- .../reference/spellingSuggestionLeadingUnderscores01.js | 4 ++-- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/tests/baselines/reference/spellingSuggestionLeadingUnderscores01.errors.txt b/tests/baselines/reference/spellingSuggestionLeadingUnderscores01.errors.txt index af0a647f87e7a..39a4901da98b8 100644 --- a/tests/baselines/reference/spellingSuggestionLeadingUnderscores01.errors.txt +++ b/tests/baselines/reference/spellingSuggestionLeadingUnderscores01.errors.txt @@ -1,7 +1,9 @@ tests/cases/compiler/spellingSuggestionLeadingUnderscores01.ts(6,3): error TS2551: Property '___foo' does not exist on type '{ __foo: 10; }'. Did you mean '__foo'? +tests/cases/compiler/spellingSuggestionLeadingUnderscores01.ts(14,5): error TS2322: Type '{ ___foo: number; }' is not assignable to type '{ __foo: number; }'. + Object literal may only specify known properties, but '___foo' does not exist in type '{ __foo: number; }'. Did you mean to write '__foo'? -==== tests/cases/compiler/spellingSuggestionLeadingUnderscores01.ts (1 errors) ==== +==== tests/cases/compiler/spellingSuggestionLeadingUnderscores01.ts (2 errors) ==== // @filename abc.ts export declare let a: { __foo: 10, @@ -17,7 +19,10 @@ tests/cases/compiler/spellingSuggestionLeadingUnderscores01.ts(6,3): error TS255 } b = { - __foo: 100, + ___foo: 100, + ~~~~~~~~~~~ +!!! error TS2322: Type '{ ___foo: number; }' is not assignable to type '{ __foo: number; }'. +!!! error TS2322: Object literal may only specify known properties, but '___foo' does not exist in type '{ __foo: number; }'. Did you mean to write '__foo'? } \ No newline at end of file diff --git a/tests/baselines/reference/spellingSuggestionLeadingUnderscores01.js b/tests/baselines/reference/spellingSuggestionLeadingUnderscores01.js index fbcc3dc1cad2c..6a84749b1539d 100644 --- a/tests/baselines/reference/spellingSuggestionLeadingUnderscores01.js +++ b/tests/baselines/reference/spellingSuggestionLeadingUnderscores01.js @@ -12,7 +12,7 @@ export let b: { } b = { - __foo: 100, + ___foo: 100, } @@ -22,5 +22,5 @@ b = { exports.__esModule = true; exports.a.___foo; exports.b = { - __foo: 100 + ___foo: 100 }; From 35addce79ede5c2f439623401a0fcc2d58943215 Mon Sep 17 00:00:00 2001 From: Anders Hejlsberg Date: Sat, 19 Aug 2017 09:46:02 +0200 Subject: [PATCH 192/237] Add comment --- src/compiler/checker.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index d5518eee3da49..3c1ed9a94921e 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -1017,6 +1017,7 @@ namespace ts { } break; case SyntaxKind.ExpressionWithTypeArguments: + // The type parameters of a class are not in scope in the base class expression. if (lastLocation === (location).expression && (location.parent).token === SyntaxKind.ExtendsKeyword) { const container = location.parent.parent; if (isClassLike(container) && (result = lookup(getSymbolOfNode(container).members, name, meaning & SymbolFlags.Type))) { From 049b33693633b5dc5970db230b28fff492efcce0 Mon Sep 17 00:00:00 2001 From: Anders Hejlsberg Date: Sat, 19 Aug 2017 09:46:09 +0200 Subject: [PATCH 193/237] Accept new baselines --- .../reference/inheritFromGenericTypeParameter.errors.txt | 4 ++-- .../reference/typeParameterAsBaseClass.errors.txt | 4 ++-- .../reference/typeParameterAsBaseType.errors.txt | 8 ++++---- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/tests/baselines/reference/inheritFromGenericTypeParameter.errors.txt b/tests/baselines/reference/inheritFromGenericTypeParameter.errors.txt index 08d138f2e5ddc..c043e37575c9a 100644 --- a/tests/baselines/reference/inheritFromGenericTypeParameter.errors.txt +++ b/tests/baselines/reference/inheritFromGenericTypeParameter.errors.txt @@ -1,11 +1,11 @@ -tests/cases/compiler/inheritFromGenericTypeParameter.ts(1,20): error TS2693: 'T' only refers to a type, but is being used as a value here. +tests/cases/compiler/inheritFromGenericTypeParameter.ts(1,20): error TS2304: Cannot find name 'T'. tests/cases/compiler/inheritFromGenericTypeParameter.ts(2,24): error TS2312: An interface may only extend a class or another interface. ==== tests/cases/compiler/inheritFromGenericTypeParameter.ts (2 errors) ==== class C extends T { } ~ -!!! error TS2693: 'T' only refers to a type, but is being used as a value here. +!!! error TS2304: Cannot find name 'T'. interface I extends T { } ~ !!! error TS2312: An interface may only extend a class or another interface. \ No newline at end of file diff --git a/tests/baselines/reference/typeParameterAsBaseClass.errors.txt b/tests/baselines/reference/typeParameterAsBaseClass.errors.txt index e633a6dd39669..dec7f7f2a4a24 100644 --- a/tests/baselines/reference/typeParameterAsBaseClass.errors.txt +++ b/tests/baselines/reference/typeParameterAsBaseClass.errors.txt @@ -1,11 +1,11 @@ -tests/cases/compiler/typeParameterAsBaseClass.ts(1,20): error TS2693: 'T' only refers to a type, but is being used as a value here. +tests/cases/compiler/typeParameterAsBaseClass.ts(1,20): error TS2304: Cannot find name 'T'. tests/cases/compiler/typeParameterAsBaseClass.ts(2,24): error TS2422: A class may only implement another class or interface. ==== tests/cases/compiler/typeParameterAsBaseClass.ts (2 errors) ==== class C extends T {} ~ -!!! error TS2693: 'T' only refers to a type, but is being used as a value here. +!!! error TS2304: Cannot find name 'T'. class C2 implements T {} ~ !!! error TS2422: A class may only implement another class or interface. \ No newline at end of file diff --git a/tests/baselines/reference/typeParameterAsBaseType.errors.txt b/tests/baselines/reference/typeParameterAsBaseType.errors.txt index c16b16d0b1a45..835b236994867 100644 --- a/tests/baselines/reference/typeParameterAsBaseType.errors.txt +++ b/tests/baselines/reference/typeParameterAsBaseType.errors.txt @@ -1,5 +1,5 @@ -tests/cases/conformance/types/typeParameters/typeParameterAsBaseType.ts(4,20): error TS2693: 'T' only refers to a type, but is being used as a value here. -tests/cases/conformance/types/typeParameters/typeParameterAsBaseType.ts(5,24): error TS2693: 'U' only refers to a type, but is being used as a value here. +tests/cases/conformance/types/typeParameters/typeParameterAsBaseType.ts(4,20): error TS2304: Cannot find name 'T'. +tests/cases/conformance/types/typeParameters/typeParameterAsBaseType.ts(5,24): error TS2304: Cannot find name 'U'. tests/cases/conformance/types/typeParameters/typeParameterAsBaseType.ts(7,24): error TS2312: An interface may only extend a class or another interface. tests/cases/conformance/types/typeParameters/typeParameterAsBaseType.ts(8,28): error TS2312: An interface may only extend a class or another interface. @@ -10,10 +10,10 @@ tests/cases/conformance/types/typeParameters/typeParameterAsBaseType.ts(8,28): e class C extends T { } ~ -!!! error TS2693: 'T' only refers to a type, but is being used as a value here. +!!! error TS2304: Cannot find name 'T'. class C2 extends U { } ~ -!!! error TS2693: 'U' only refers to a type, but is being used as a value here. +!!! error TS2304: Cannot find name 'U'. interface I extends T { } ~ From 914d428ff12a7c7c8a7c2fc778a83810b852bd5f Mon Sep 17 00:00:00 2001 From: Anders Hejlsberg Date: Sat, 19 Aug 2017 09:53:46 +0200 Subject: [PATCH 194/237] Add regression test --- .../baseExpressionTypeParameters.errors.txt | 19 +++++++ .../reference/baseExpressionTypeParameters.js | 50 +++++++++++++++++++ .../compiler/baseExpressionTypeParameters.ts | 13 +++++ 3 files changed, 82 insertions(+) create mode 100644 tests/baselines/reference/baseExpressionTypeParameters.errors.txt create mode 100644 tests/baselines/reference/baseExpressionTypeParameters.js create mode 100644 tests/cases/compiler/baseExpressionTypeParameters.ts diff --git a/tests/baselines/reference/baseExpressionTypeParameters.errors.txt b/tests/baselines/reference/baseExpressionTypeParameters.errors.txt new file mode 100644 index 0000000000000..4fa8f2f6d3dbb --- /dev/null +++ b/tests/baselines/reference/baseExpressionTypeParameters.errors.txt @@ -0,0 +1,19 @@ +tests/cases/compiler/baseExpressionTypeParameters.ts(10,27): error TS2561: Base class expressions cannot reference class type parameters. + + +==== tests/cases/compiler/baseExpressionTypeParameters.ts (1 errors) ==== + // Repro from #17829 + + function base() { + class Base { + static prop: T; + } + return Base; + } + + class Gen extends base() {} // Error, T not in scope + ~ +!!! error TS2561: Base class expressions cannot reference class type parameters. + class Spec extends Gen {} + + Spec.prop; \ No newline at end of file diff --git a/tests/baselines/reference/baseExpressionTypeParameters.js b/tests/baselines/reference/baseExpressionTypeParameters.js new file mode 100644 index 0000000000000..a3a77cbc6e347 --- /dev/null +++ b/tests/baselines/reference/baseExpressionTypeParameters.js @@ -0,0 +1,50 @@ +//// [baseExpressionTypeParameters.ts] +// Repro from #17829 + +function base() { + class Base { + static prop: T; + } + return Base; +} + +class Gen extends base() {} // Error, T not in scope +class Spec extends Gen {} + +Spec.prop; + +//// [baseExpressionTypeParameters.js] +// Repro from #17829 +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +function base() { + var Base = /** @class */ (function () { + function Base() { + } + return Base; + }()); + return Base; +} +var Gen = /** @class */ (function (_super) { + __extends(Gen, _super); + function Gen() { + return _super !== null && _super.apply(this, arguments) || this; + } + return Gen; +}(base())); // Error, T not in scope +var Spec = /** @class */ (function (_super) { + __extends(Spec, _super); + function Spec() { + return _super !== null && _super.apply(this, arguments) || this; + } + return Spec; +}(Gen)); +Spec.prop; diff --git a/tests/cases/compiler/baseExpressionTypeParameters.ts b/tests/cases/compiler/baseExpressionTypeParameters.ts new file mode 100644 index 0000000000000..ca864f9a7f00f --- /dev/null +++ b/tests/cases/compiler/baseExpressionTypeParameters.ts @@ -0,0 +1,13 @@ +// Repro from #17829 + +function base() { + class Base { + static prop: T; + } + return Base; +} + +class Gen extends base() {} // Error, T not in scope +class Spec extends Gen {} + +Spec.prop; \ No newline at end of file From 07e1d3b13d66e82f901ba8ceb02e6eb90de797ef Mon Sep 17 00:00:00 2001 From: Mohamed Hegazy Date: Mon, 21 Aug 2017 09:44:03 -0700 Subject: [PATCH 195/237] Ensure string enums are generated in protocol.d.ts (#17914) --- scripts/buildProtocol.ts | 14 +++++++++----- src/server/protocol.ts | 4 ++++ 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/scripts/buildProtocol.ts b/scripts/buildProtocol.ts index e03338bf60ddd..c2ac33c83fc19 100644 --- a/scripts/buildProtocol.ts +++ b/scripts/buildProtocol.ts @@ -7,11 +7,15 @@ function endsWith(s: string, suffix: string) { return s.lastIndexOf(suffix, s.length - suffix.length) !== -1; } +function isStringEnum(declaration: ts.EnumDeclaration) { + return declaration.members.length && declaration.members.every(m => m.initializer && m.initializer.kind === ts.SyntaxKind.StringLiteral); +} + class DeclarationsWalker { private visitedTypes: ts.Type[] = []; private text = ""; private removedTypes: ts.Type[] = []; - + private constructor(private typeChecker: ts.TypeChecker, private protocolFile: ts.SourceFile) { } @@ -19,7 +23,7 @@ class DeclarationsWalker { let text = "declare namespace ts.server.protocol {\n"; var walker = new DeclarationsWalker(typeChecker, protocolFile); walker.visitTypeNodes(protocolFile); - text = walker.text + text = walker.text ? `declare namespace ts.server.protocol {\n${walker.text}}` : ""; if (walker.removedTypes) { @@ -52,7 +56,7 @@ class DeclarationsWalker { if (sourceFile === this.protocolFile || path.basename(sourceFile.fileName) === "lib.d.ts") { return; } - if (decl.kind === ts.SyntaxKind.EnumDeclaration) { + if (decl.kind === ts.SyntaxKind.EnumDeclaration && !isStringEnum(decl as ts.EnumDeclaration)) { this.removedTypes.push(type); return; } @@ -91,7 +95,7 @@ class DeclarationsWalker { for (const type of heritageClauses[0].types) { this.processTypeOfNode(type); } - } + } break; } } @@ -110,7 +114,7 @@ class DeclarationsWalker { this.processType(type); } } - } + } } function writeProtocolFile(outputFile: string, protocolTs: string, typeScriptServicesDts: string) { diff --git a/src/server/protocol.ts b/src/server/protocol.ts index f50c873112671..37bf79837c9d7 100644 --- a/src/server/protocol.ts +++ b/src/server/protocol.ts @@ -2489,6 +2489,7 @@ namespace ts.server.protocol { System = "System", ES6 = "ES6", ES2015 = "ES2015", + ESNext = "ESNext" } export const enum ModuleResolutionKind { @@ -2506,5 +2507,8 @@ namespace ts.server.protocol { ES5 = "ES5", ES6 = "ES6", ES2015 = "ES2015", + ES2016 = "ES2016", + ES2017 = "ES2017", + ESNext = "ESNext" } } From 2b28916e5ee9f3f02f780b448ac8a58d31b84628 Mon Sep 17 00:00:00 2001 From: Andy Date: Mon, 21 Aug 2017 11:34:53 -0700 Subject: [PATCH 196/237] Simplify resolveBaseTypesOfClass (#17918) --- src/compiler/checker.ts | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 6febaf0052d96..f792118156899 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -4929,7 +4929,7 @@ namespace ts { } function resolveBaseTypesOfClass(type: InterfaceType): void { - type.resolvedBaseTypes = type.resolvedBaseTypes || emptyArray; + type.resolvedBaseTypes = emptyArray; const baseConstructorType = getApparentType(getBaseConstructorTypeOfClass(type)); if (!(baseConstructorType.flags & (TypeFlags.Object | TypeFlags.Intersection | TypeFlags.Any))) { return; @@ -4976,17 +4976,12 @@ namespace ts { error(baseTypeNode.expression, Diagnostics.Base_constructor_return_type_0_is_not_a_class_or_interface_type, typeToString(baseType)); return; } - if (type === baseType || hasBaseType(baseType, type)) { + if (type === baseType || hasBaseType(baseType, type)) { error(valueDecl, Diagnostics.Type_0_recursively_references_itself_as_a_base_type, typeToString(type, /*enclosingDeclaration*/ undefined, TypeFormatFlags.WriteArrayAsGenericType)); return; } - if (type.resolvedBaseTypes === emptyArray) { - type.resolvedBaseTypes = [baseType]; - } - else { - type.resolvedBaseTypes.push(baseType); - } + type.resolvedBaseTypes = [baseType]; } function areAllOuterTypeParametersApplied(type: Type): boolean { @@ -5003,7 +4998,7 @@ namespace ts { // A valid base type is `any`, any non-generic object type or intersection of non-generic // object types. - function isValidBaseType(type: Type): boolean { + function isValidBaseType(type: Type): type is BaseType { return type.flags & (TypeFlags.Object | TypeFlags.NonPrimitive | TypeFlags.Any) && !isGenericMappedType(type) || type.flags & TypeFlags.Intersection && !forEach((type).types, t => !isValidBaseType(t)); } @@ -5016,12 +5011,12 @@ namespace ts { const baseType = getTypeFromTypeNode(node); if (baseType !== unknownType) { if (isValidBaseType(baseType)) { - if (type !== baseType && !hasBaseType(baseType, type)) { + if (type !== baseType && !hasBaseType(baseType, type)) { if (type.resolvedBaseTypes === emptyArray) { type.resolvedBaseTypes = [baseType]; } else { - type.resolvedBaseTypes.push(baseType); + type.resolvedBaseTypes.push(baseType); } } else { From ac098535cbd0db5f7f401d7e391f54274fd44639 Mon Sep 17 00:00:00 2001 From: Basarat Ali Syed Date: Tue, 22 Aug 2017 09:55:40 +1000 Subject: [PATCH 197/237] =?UTF-8?q?export=20UsageEntry=20used=20by=20alrea?= =?UTF-8?q?dy=20exported=20functions=20=F0=9F=8C=B9=20(#17853)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/services/refactors/extractMethod.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/services/refactors/extractMethod.ts b/src/services/refactors/extractMethod.ts index cf58ede99bdb3..90e3304169576 100644 --- a/src/services/refactors/extractMethod.ts +++ b/src/services/refactors/extractMethod.ts @@ -856,7 +856,7 @@ namespace ts.refactor.extractMethod { Write = 2 } - interface UsageEntry { + export interface UsageEntry { readonly usage: Usage; readonly symbol: Symbol; readonly node: Node; From a3a2ff5f1286649043d51d4dd416ede5acc7ee83 Mon Sep 17 00:00:00 2001 From: Anders Hejlsberg Date: Tue, 22 Aug 2017 10:13:08 +0100 Subject: [PATCH 198/237] Optimize relations for type references with unconstrained type arguments --- src/compiler/checker.ts | 44 ++++++++++++++++++++++++++++++++++++++--- 1 file changed, 41 insertions(+), 3 deletions(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index d2d3697f175c6..b179231736c3e 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -8805,8 +8805,7 @@ namespace ts { return true; } if (source.flags & TypeFlags.Object && target.flags & TypeFlags.Object) { - const id = relation !== identityRelation || source.id < target.id ? source.id + "," + target.id : target.id + "," + source.id; - const related = relation.get(id); + const related = relation.get(getRelationKey(source, target, relation)); if (related !== undefined) { return related === RelationComparisonResult.Succeeded; } @@ -9207,7 +9206,7 @@ namespace ts { if (overflow) { return Ternary.False; } - const id = relation !== identityRelation || source.id < target.id ? source.id + "," + target.id : target.id + "," + source.id; + const id = getRelationKey(source, target, relation); const related = relation.get(id); if (related !== undefined) { if (reportErrors && related === RelationComparisonResult.Failed) { @@ -9772,6 +9771,45 @@ namespace ts { } } + function isUnconstrainedTypeParameter(type: Type) { + return type.flags & TypeFlags.TypeParameter && !getConstraintFromTypeParameter(type); + } + + function isTypeReferenceWithGenericArguments(type: Type) { + return getObjectFlags(type) & ObjectFlags.Reference && some((type).typeArguments, isUnconstrainedTypeParameter); + } + + function getTypeReferenceId(type: TypeReference, typeParameters: Type[]) { + let result = "" + type.id; + for (const t of type.typeArguments) { + if (isUnconstrainedTypeParameter(t)) { + let index = indexOf(typeParameters, t); + if (index < 0) { + index = typeParameters.length; + typeParameters.push(t); + } + result += "=" + index; + } + else { + result += "-" + t.id; + } + } + return result; + } + + function getRelationKey(source: Type, target: Type, relation: Map) { + if (relation === identityRelation && source.id > target.id) { + const temp = source; + source = target; + target = temp; + } + if (isTypeReferenceWithGenericArguments(source) && isTypeReferenceWithGenericArguments(target)) { + const typeParameters: Type[] = []; + return getTypeReferenceId(source, typeParameters) + "," + getTypeReferenceId(target, typeParameters); + } + return source.id + "," + target.id; + } + // Invoke the callback for each underlying property symbol of the given symbol and return the first // value that isn't undefined. function forEachProperty(prop: Symbol, callback: (p: Symbol) => T): T { From 11c4c4cd61cbc2f0a42f7bd81e55bbf9b4c7a70f Mon Sep 17 00:00:00 2001 From: Anders Hejlsberg Date: Tue, 22 Aug 2017 17:41:07 +0100 Subject: [PATCH 199/237] Fix to use correct target type ID --- src/compiler/checker.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index b179231736c3e..3accf1637386e 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -9780,7 +9780,7 @@ namespace ts { } function getTypeReferenceId(type: TypeReference, typeParameters: Type[]) { - let result = "" + type.id; + let result = "" + type.target.id; for (const t of type.typeArguments) { if (isUnconstrainedTypeParameter(t)) { let index = indexOf(typeParameters, t); From 6678d961aabdaea865308a81000d0b5cdf48e6d3 Mon Sep 17 00:00:00 2001 From: Matt Mitchell Date: Tue, 22 Aug 2017 09:47:29 -0700 Subject: [PATCH 200/237] Update imaged with Java 8 and other patches (#17965) Updated image, java 8 required --- netci.groovy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/netci.groovy b/netci.groovy index bc512f6b2451f..c60957730c4f0 100644 --- a/netci.groovy +++ b/netci.groovy @@ -17,6 +17,6 @@ nodeVersions.each { nodeVer -> } Utilities.standardJobSetup(newJob, project, true, "*/${branch}") - Utilities.setMachineAffinity(newJob, 'Ubuntu', '20161020') + Utilities.setMachineAffinity(newJob, 'Ubuntu14.04', '20170821-1') Utilities.addGithubPRTriggerForBranch(newJob, branch, "TypeScript Test Run ${newJobName}") } From 053b91506103cf185d852d816f4010e162e3729e Mon Sep 17 00:00:00 2001 From: Wesley Wigham Date: Wed, 20 Jul 2016 14:58:46 -0700 Subject: [PATCH 201/237] Rebase SymbolWalker change onto master From PR #9847. --- Jakefile.js | 1 + src/compiler/checker.ts | 2 + src/compiler/symbolWalker.ts | 163 ++++++++++++++++++++++++++ src/compiler/tsconfig.json | 1 + src/compiler/types.ts | 8 ++ src/harness/tsconfig.json | 2 + src/harness/unittests/symbolWalker.ts | 53 +++++++++ src/services/tsconfig.json | 1 + 8 files changed, 231 insertions(+) create mode 100644 src/compiler/symbolWalker.ts create mode 100644 src/harness/unittests/symbolWalker.ts diff --git a/Jakefile.js b/Jakefile.js index 15fe40141f653..46573e701ff21 100644 --- a/Jakefile.js +++ b/Jakefile.js @@ -140,6 +140,7 @@ var harnessSources = harnessCoreSources.concat([ "transform.ts", "customTransforms.ts", "programMissingFiles.ts", + "symbolWalker.ts", ].map(function (f) { return path.join(unittestsDirectory, f); })).concat([ diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index d2d3697f175c6..d69c6cdebdadc 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -1,5 +1,6 @@ /// /// +/// /* @internal */ namespace ts { @@ -204,6 +205,7 @@ namespace ts { getEmitResolver, getExportsOfModule: getExportsOfModuleAsArray, getExportsAndPropertiesOfModule, + getSymbolWalker: createGetSymbolWalker(getRestTypeOfSignature, getReturnTypeOfSignature, getBaseTypes, resolveStructuredTypeMembers, getTypeOfSymbol, getResolvedSymbol, getIndexTypeOfStructuredType), getAmbientModules, getAllAttributesTypeFromJsxOpeningLikeElement: node => { node = getParseTreeNode(node, isJsxOpeningLikeElement); diff --git a/src/compiler/symbolWalker.ts b/src/compiler/symbolWalker.ts new file mode 100644 index 0000000000000..c85661df29a1a --- /dev/null +++ b/src/compiler/symbolWalker.ts @@ -0,0 +1,163 @@ +namespace ts { + export function createGetSymbolWalker( + getRestTypeOfSignature: (sig: Signature) => Type, + getReturnTypeOfSignature: (sig: Signature) => Type, + getBaseTypes: (type: Type) => Type[], + resolveStructuredTypeMembers: (type: ObjectType) => ResolvedType, + getTypeOfSymbol: (sym: Symbol) => Type, + getResolvedSymbol: (node: Node) => Symbol, + getIndexTypeOfStructuredType: (type: Type, kind: IndexKind) => Type) { + + return getSymbolWalker; + + function getSymbolWalker(accept: (symbol: Symbol) => boolean = () => true): SymbolWalker { + let visited: Type[] = []; + let visitedSymbols: Symbol[] = []; + + return { + visitType, + visitSymbol, + reset: (newCallback: (symbol: Symbol) => boolean = () => true) => { + accept = newCallback; + visited = []; + visitedSymbols = []; + } + }; + + function visitType(type: Type): void { + if (!type) { + return; + } + if (contains(visited, type)) { + return; + } + visited.push(type); + + // Reuse visitSymbol to visit the type's symbol, + // but be sure to bail on recuring into the type if accept declines the symbol. + const shouldBail = visitSymbol(type.symbol); + if (shouldBail) return; + + // Visit the type's related types, if any + if (type.flags & TypeFlags.Object) { + const objectType = type as ObjectType; + const objectFlags = objectType.objectFlags; + if (objectFlags & ObjectFlags.Reference) { + visitTypeReference(type as TypeReference); + } + if (objectFlags & (ObjectFlags.Class | ObjectFlags.Interface)) { + visitInterfaceType(type as InterfaceType); + } + if (objectFlags & (ObjectFlags.Tuple | ObjectFlags.Anonymous)) { + visitObjectType(objectType); + } + } + if (type.flags & TypeFlags.TypeParameter) { + visitTypeParameter(type as TypeParameter); + } + if (type.flags & TypeFlags.UnionOrIntersection) { + visitUnionOrIntersectionType(type as UnionOrIntersectionType); + } + } + + function visitTypeList(types: Type[]): void { + if (!types) { + return; + } + for (let i = 0; i < types.length; i++) { + visitType(types[i]); + } + } + + function visitTypeReference(type: TypeReference): void { + visitType(type.target); + visitTypeList(type.typeArguments); + } + + function visitTypeParameter(type: TypeParameter): void { + visitType(type.constraint); + } + + function visitUnionOrIntersectionType(type: UnionOrIntersectionType): void { + visitTypeList(type.types); + } + + function visitSignature(signature: Signature): void { + if (signature.typePredicate) { + visitType(signature.typePredicate.type); + } + visitTypeList(signature.typeParameters); + + for (const parameter of signature.parameters){ + visitSymbol(parameter); + } + visitType(getRestTypeOfSignature(signature)); + visitType(getReturnTypeOfSignature(signature)); + } + + function visitInterfaceType(interfaceT: InterfaceType): void { + visitObjectType(interfaceT); + visitTypeList(interfaceT.typeParameters); + visitTypeList(getBaseTypes(interfaceT)); + visitType(interfaceT.thisType); + } + + function visitObjectType(type: ObjectType): void { + const stringIndexType = getIndexTypeOfStructuredType(type, IndexKind.String); + visitType(stringIndexType); + const numberIndexType = getIndexTypeOfStructuredType(type, IndexKind.String); + visitType(numberIndexType); + + // The two checks above *should* have already resolved the type (if needed), so this should be cached + const resolved = resolveStructuredTypeMembers(type); + for (const signature of resolved.callSignatures) { + visitSignature(signature); + } + for (const signature of resolved.constructSignatures) { + visitSignature(signature); + } + for (const p of resolved.properties) { + visitSymbol(p); + } + } + + function visitSymbol(symbol: Symbol): boolean { + if (!symbol) { + return; + } + if (contains(visitedSymbols, symbol)) { + return; + } + visitedSymbols.push(symbol); + if (!accept(symbol)) { + return true; + } + const t = getTypeOfSymbol(symbol); + visitType(t); // Should handle members on classes and such + if (symbol.flags & SymbolFlags.HasExports) { + symbol.exports.forEach(visitSymbol); + } + forEach(symbol.declarations, d => { + // Type queries are too far resolved when we just visit the symbol's type + // (their type resolved directly to the member deeply referenced) + // So to get the intervening symbols, we need to check if there's a type + // query node on any of the symbol's declarations and get symbols there + if ((d as any).type && (d as any).type.kind === SyntaxKind.TypeQuery) { + const query = (d as any).type as TypeQueryNode; + const entity = leftmostSymbol(query.exprName); + visitSymbol(entity); + } + }); + } + } + + function leftmostSymbol(expr: QualifiedName | Identifier): Symbol { + if (expr.kind === SyntaxKind.Identifier) { + return getResolvedSymbol(expr as Identifier); + } + else { + return leftmostSymbol((expr as QualifiedName).left); + } + } + } +} \ No newline at end of file diff --git a/src/compiler/tsconfig.json b/src/compiler/tsconfig.json index 3709d65b7fd23..c048359fcb7a4 100644 --- a/src/compiler/tsconfig.json +++ b/src/compiler/tsconfig.json @@ -14,6 +14,7 @@ "parser.ts", "utilities.ts", "binder.ts", + "symbolWalker.ts", "checker.ts", "factory.ts", "visitor.ts", diff --git a/src/compiler/types.ts b/src/compiler/types.ts index 608bc779042df..7bce522d5bac7 100644 --- a/src/compiler/types.ts +++ b/src/compiler/types.ts @@ -2625,6 +2625,8 @@ namespace ts { /* @internal */ tryFindAmbientModuleWithoutAugmentations(moduleName: string): Symbol | undefined; + getSymbolWalker(accept?: (symbol: Symbol) => boolean): SymbolWalker; + // Should not be called directly. Should only be accessed through the Program instance. /* @internal */ getDiagnostics(sourceFile?: SourceFile, cancellationToken?: CancellationToken): Diagnostic[]; /* @internal */ getGlobalDiagnostics(): Diagnostic[]; @@ -2669,6 +2671,12 @@ namespace ts { InTypeAlias = 1 << 23, // Writing type in type alias declaration } + export interface SymbolWalker { + visitType(type: Type): void; + visitSymbol(symbol: Symbol): void; + reset(accept?: (symbol: Symbol) => boolean): void; + } + export interface SymbolDisplayBuilder { buildTypeDisplay(type: Type, writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags): void; buildSymbolDisplay(symbol: Symbol, writer: SymbolWriter, enclosingDeclaration?: Node, meaning?: SymbolFlags, flags?: SymbolFormatFlags): void; diff --git a/src/harness/tsconfig.json b/src/harness/tsconfig.json index 66ca2fc3f4837..9165e59cb0a1a 100644 --- a/src/harness/tsconfig.json +++ b/src/harness/tsconfig.json @@ -21,6 +21,7 @@ "../compiler/parser.ts", "../compiler/utilities.ts", "../compiler/binder.ts", + "../compiler/symbolWalker.ts", "../compiler/checker.ts", "../compiler/factory.ts", "../compiler/visitor.ts", @@ -103,6 +104,7 @@ "./unittests/services/preProcessFile.ts", "./unittests/services/patternMatcher.ts", "./unittests/session.ts", + "./unittests/symbolWalker.ts", "./unittests/versionCache.ts", "./unittests/convertToBase64.ts", "./unittests/transpile.ts", diff --git a/src/harness/unittests/symbolWalker.ts b/src/harness/unittests/symbolWalker.ts new file mode 100644 index 0000000000000..275c37d41f673 --- /dev/null +++ b/src/harness/unittests/symbolWalker.ts @@ -0,0 +1,53 @@ +/// + +namespace ts { + describe("Symbol Walker", () => { + function test(description: string, source: string, verifier: (file: SourceFile, checker: TypeChecker, walker: SymbolWalker) => void) { + it(description, () => { + let {result} = Harness.Compiler.compileFiles([{ + unitName: "main.ts", + content: source + }], [], {}, {}, "/"); + let file = result.program.getSourceFile("main.ts"); + let checker = result.program.getTypeChecker(); + let walker = checker.getSymbolWalker(); + verifier(file, checker, walker); + + result = undefined; + file = undefined; + checker = undefined; + walker = undefined; + }); + } + + test("can be created", ` +interface Bar { + x: number; + y: number; + history: Bar[]; +} +export default function foo(a: number, b: Bar): void {}`, (file, checker, walker) => { + let foundCount = 0; + let stdLibRefSymbols = 0; + const expectedSymbols = ["default", "a", "b", "Bar", "x", "y", "history"]; + walker.reset(symbol => { + const isStdLibSymbol = forEach(symbol.declarations, d => { + return getSourceFileOfNode(d).hasNoDefaultLib; + }); + if (isStdLibSymbol) { + stdLibRefSymbols++; + return false; // Don't traverse into the stdlib. That's unnecessary for this test. + } + assert.equal(symbol.name, expectedSymbols[foundCount]); + foundCount++; + return true; + }); + const symbols = checker.getExportsOfModule(file.symbol); + for (const symbol of symbols) { + walker.visitSymbol(symbol); + } + assert.equal(foundCount, expectedSymbols.length); + assert.equal(stdLibRefSymbols, 1); // Expect 1 stdlib entry symbol - the implicit Array referenced by Bar.history + }); + }); +} \ No newline at end of file diff --git a/src/services/tsconfig.json b/src/services/tsconfig.json index f4ca2a7f130f5..d73014a93a24a 100644 --- a/src/services/tsconfig.json +++ b/src/services/tsconfig.json @@ -14,6 +14,7 @@ "../compiler/parser.ts", "../compiler/utilities.ts", "../compiler/binder.ts", + "../compiler/symbolWalker.ts", "../compiler/checker.ts", "../compiler/factory.ts", "../compiler/visitor.ts", From 2c8a5c40b835d01c0edb2b5c4ae419f2763ff65f Mon Sep 17 00:00:00 2001 From: Wesley Wigham Date: Tue, 26 Jul 2016 10:35:49 -0700 Subject: [PATCH 202/237] Make SymbolWalker internal ...until required by an external consumer. --- src/compiler/symbolWalker.ts | 2 ++ src/compiler/types.ts | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/compiler/symbolWalker.ts b/src/compiler/symbolWalker.ts index c85661df29a1a..0ae1e32ea9a15 100644 --- a/src/compiler/symbolWalker.ts +++ b/src/compiler/symbolWalker.ts @@ -1,4 +1,6 @@ +/** @internal */ namespace ts { + /** @internal */ export function createGetSymbolWalker( getRestTypeOfSignature: (sig: Signature) => Type, getReturnTypeOfSignature: (sig: Signature) => Type, diff --git a/src/compiler/types.ts b/src/compiler/types.ts index 7bce522d5bac7..76922ab98e6ef 100644 --- a/src/compiler/types.ts +++ b/src/compiler/types.ts @@ -2625,7 +2625,7 @@ namespace ts { /* @internal */ tryFindAmbientModuleWithoutAugmentations(moduleName: string): Symbol | undefined; - getSymbolWalker(accept?: (symbol: Symbol) => boolean): SymbolWalker; + /* @internal */ getSymbolWalker(accept?: (symbol: Symbol) => boolean): SymbolWalker; // Should not be called directly. Should only be accessed through the Program instance. /* @internal */ getDiagnostics(sourceFile?: SourceFile, cancellationToken?: CancellationToken): Diagnostic[]; @@ -2671,6 +2671,7 @@ namespace ts { InTypeAlias = 1 << 23, // Writing type in type alias declaration } + /* @internal */ export interface SymbolWalker { visitType(type: Type): void; visitSymbol(symbol: Symbol): void; From 801c1f70a2cc6aecac3f5bdbf872adf469726243 Mon Sep 17 00:00:00 2001 From: Andrew Casey Date: Tue, 15 Aug 2017 13:09:24 -0700 Subject: [PATCH 203/237] Reshape SymbolWalker API 1. Expose visited types and symbols 2. Automatically reset before each walk --- src/compiler/symbolWalker.ts | 25 ++++++++++++++++--------- src/compiler/types.ts | 5 ++--- 2 files changed, 18 insertions(+), 12 deletions(-) diff --git a/src/compiler/symbolWalker.ts b/src/compiler/symbolWalker.ts index 0ae1e32ea9a15..784ee84036308 100644 --- a/src/compiler/symbolWalker.ts +++ b/src/compiler/symbolWalker.ts @@ -13,27 +13,34 @@ namespace ts { return getSymbolWalker; function getSymbolWalker(accept: (symbol: Symbol) => boolean = () => true): SymbolWalker { - let visited: Type[] = []; + let visitedTypes: Type[] = []; let visitedSymbols: Symbol[] = []; return { - visitType, - visitSymbol, - reset: (newCallback: (symbol: Symbol) => boolean = () => true) => { - accept = newCallback; - visited = []; + walkType: type => + { + visitedTypes = []; visitedSymbols = []; - } + visitType(type); + return { visitedTypes, visitedSymbols }; + }, + walkSymbol: symbol => + { + visitedTypes = []; + visitedSymbols = []; + visitSymbol(symbol); + return { visitedTypes, visitedSymbols }; + }, }; function visitType(type: Type): void { if (!type) { return; } - if (contains(visited, type)) { + if (contains(visitedTypes, type)) { return; } - visited.push(type); + visitedTypes.push(type); // Reuse visitSymbol to visit the type's symbol, // but be sure to bail on recuring into the type if accept declines the symbol. diff --git a/src/compiler/types.ts b/src/compiler/types.ts index 76922ab98e6ef..34ae124d636d3 100644 --- a/src/compiler/types.ts +++ b/src/compiler/types.ts @@ -2673,9 +2673,8 @@ namespace ts { /* @internal */ export interface SymbolWalker { - visitType(type: Type): void; - visitSymbol(symbol: Symbol): void; - reset(accept?: (symbol: Symbol) => boolean): void; + walkType(root: Type) : { visitedTypes: Type[], visitedSymbols: Symbol[] }; + walkSymbol(root: Symbol) : { visitedTypes: Type[], visitedSymbols: Symbol[] }; } export interface SymbolDisplayBuilder { From f2eacc6395c1847da2425e761d03a852a79dc85b Mon Sep 17 00:00:00 2001 From: Andrew Casey Date: Tue, 15 Aug 2017 14:45:36 -0700 Subject: [PATCH 204/237] Use Maps to store visited types and symbols --- src/compiler/symbolWalker.ts | 27 +++++++++++++++------------ src/compiler/types.ts | 6 ++++-- 2 files changed, 19 insertions(+), 14 deletions(-) diff --git a/src/compiler/symbolWalker.ts b/src/compiler/symbolWalker.ts index 784ee84036308..fda1febfb0467 100644 --- a/src/compiler/symbolWalker.ts +++ b/src/compiler/symbolWalker.ts @@ -13,23 +13,23 @@ namespace ts { return getSymbolWalker; function getSymbolWalker(accept: (symbol: Symbol) => boolean = () => true): SymbolWalker { - let visitedTypes: Type[] = []; - let visitedSymbols: Symbol[] = []; + let visitedTypes = createMap(); // Key is id as string + let visitedSymbols = createMap(); // Key is id as string return { walkType: type => { - visitedTypes = []; - visitedSymbols = []; + visitedTypes.clear(); + visitedSymbols.clear(); visitType(type); - return { visitedTypes, visitedSymbols }; + return { visitedTypes: arrayFrom(visitedTypes.values()), visitedSymbols: arrayFrom(visitedSymbols.values()) }; }, walkSymbol: symbol => { - visitedTypes = []; - visitedSymbols = []; + visitedTypes.clear(); + visitedSymbols.clear(); visitSymbol(symbol); - return { visitedTypes, visitedSymbols }; + return { visitedTypes: arrayFrom(visitedTypes.values()), visitedSymbols: arrayFrom(visitedSymbols.values()) }; }, }; @@ -37,10 +37,12 @@ namespace ts { if (!type) { return; } - if (contains(visitedTypes, type)) { + + const typeIdString = type.id.toString(); + if (visitedTypes.has(typeIdString)) { return; } - visitedTypes.push(type); + visitedTypes.set(typeIdString, type); // Reuse visitSymbol to visit the type's symbol, // but be sure to bail on recuring into the type if accept declines the symbol. @@ -134,10 +136,11 @@ namespace ts { if (!symbol) { return; } - if (contains(visitedSymbols, symbol)) { + const symbolIdString = getSymbolId(symbol).toString(); + if (visitedSymbols.has(symbolIdString)) { return; } - visitedSymbols.push(symbol); + visitedSymbols.set(symbolIdString, symbol); if (!accept(symbol)) { return true; } diff --git a/src/compiler/types.ts b/src/compiler/types.ts index 34ae124d636d3..2182f02afe0cd 100644 --- a/src/compiler/types.ts +++ b/src/compiler/types.ts @@ -2673,8 +2673,10 @@ namespace ts { /* @internal */ export interface SymbolWalker { - walkType(root: Type) : { visitedTypes: Type[], visitedSymbols: Symbol[] }; - walkSymbol(root: Symbol) : { visitedTypes: Type[], visitedSymbols: Symbol[] }; + /** Note: Return values are not ordered. */ + walkType(root: Type) : { visitedTypes: ReadonlyArray, visitedSymbols: ReadonlyArray }; + /** Note: Return values are not ordered. */ + walkSymbol(root: Symbol) : { visitedTypes: ReadonlyArray, visitedSymbols: ReadonlyArray }; } export interface SymbolDisplayBuilder { From 129ace5047d787ab55396680fe23746e78074eaa Mon Sep 17 00:00:00 2001 From: Andrew Casey Date: Tue, 15 Aug 2017 16:06:54 -0700 Subject: [PATCH 205/237] Update SymbolWalker tests ...to consume revised API. --- src/harness/unittests/symbolWalker.ts | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/src/harness/unittests/symbolWalker.ts b/src/harness/unittests/symbolWalker.ts index 275c37d41f673..8857fb66e0e96 100644 --- a/src/harness/unittests/symbolWalker.ts +++ b/src/harness/unittests/symbolWalker.ts @@ -2,7 +2,7 @@ namespace ts { describe("Symbol Walker", () => { - function test(description: string, source: string, verifier: (file: SourceFile, checker: TypeChecker, walker: SymbolWalker) => void) { + function test(description: string, source: string, verifier: (file: SourceFile, checker: TypeChecker) => void) { it(description, () => { let {result} = Harness.Compiler.compileFiles([{ unitName: "main.ts", @@ -10,13 +10,11 @@ namespace ts { }], [], {}, {}, "/"); let file = result.program.getSourceFile("main.ts"); let checker = result.program.getTypeChecker(); - let walker = checker.getSymbolWalker(); - verifier(file, checker, walker); + verifier(file, checker); result = undefined; file = undefined; checker = undefined; - walker = undefined; }); } @@ -26,11 +24,11 @@ interface Bar { y: number; history: Bar[]; } -export default function foo(a: number, b: Bar): void {}`, (file, checker, walker) => { +export default function foo(a: number, b: Bar): void {}`, (file, checker) => { let foundCount = 0; let stdLibRefSymbols = 0; const expectedSymbols = ["default", "a", "b", "Bar", "x", "y", "history"]; - walker.reset(symbol => { + let walker = checker.getSymbolWalker(symbol => { const isStdLibSymbol = forEach(symbol.declarations, d => { return getSourceFileOfNode(d).hasNoDefaultLib; }); @@ -44,7 +42,7 @@ export default function foo(a: number, b: Bar): void {}`, (file, checker, walker }); const symbols = checker.getExportsOfModule(file.symbol); for (const symbol of symbols) { - walker.visitSymbol(symbol); + walker.walkSymbol(symbol); } assert.equal(foundCount, expectedSymbols.length); assert.equal(stdLibRefSymbols, 1); // Expect 1 stdlib entry symbol - the implicit Array referenced by Bar.history From 8cbf42cff534682a4a5f5ec2182152eafb338f76 Mon Sep 17 00:00:00 2001 From: Andrew Casey Date: Wed, 16 Aug 2017 14:54:59 -0700 Subject: [PATCH 206/237] Fix lint errors --- src/compiler/symbolWalker.ts | 10 ++++------ src/compiler/types.ts | 4 ++-- src/harness/unittests/symbolWalker.ts | 2 +- 3 files changed, 7 insertions(+), 9 deletions(-) diff --git a/src/compiler/symbolWalker.ts b/src/compiler/symbolWalker.ts index fda1febfb0467..ade9e12d03950 100644 --- a/src/compiler/symbolWalker.ts +++ b/src/compiler/symbolWalker.ts @@ -13,19 +13,17 @@ namespace ts { return getSymbolWalker; function getSymbolWalker(accept: (symbol: Symbol) => boolean = () => true): SymbolWalker { - let visitedTypes = createMap(); // Key is id as string - let visitedSymbols = createMap(); // Key is id as string + const visitedTypes = createMap(); // Key is id as string + const visitedSymbols = createMap(); // Key is id as string return { - walkType: type => - { + walkType: type => { visitedTypes.clear(); visitedSymbols.clear(); visitType(type); return { visitedTypes: arrayFrom(visitedTypes.values()), visitedSymbols: arrayFrom(visitedSymbols.values()) }; }, - walkSymbol: symbol => - { + walkSymbol: symbol => { visitedTypes.clear(); visitedSymbols.clear(); visitSymbol(symbol); diff --git a/src/compiler/types.ts b/src/compiler/types.ts index 2182f02afe0cd..37e12cc9d294c 100644 --- a/src/compiler/types.ts +++ b/src/compiler/types.ts @@ -2674,9 +2674,9 @@ namespace ts { /* @internal */ export interface SymbolWalker { /** Note: Return values are not ordered. */ - walkType(root: Type) : { visitedTypes: ReadonlyArray, visitedSymbols: ReadonlyArray }; + walkType(root: Type): { visitedTypes: ReadonlyArray, visitedSymbols: ReadonlyArray }; /** Note: Return values are not ordered. */ - walkSymbol(root: Symbol) : { visitedTypes: ReadonlyArray, visitedSymbols: ReadonlyArray }; + walkSymbol(root: Symbol): { visitedTypes: ReadonlyArray, visitedSymbols: ReadonlyArray }; } export interface SymbolDisplayBuilder { diff --git a/src/harness/unittests/symbolWalker.ts b/src/harness/unittests/symbolWalker.ts index 8857fb66e0e96..6d38fbb5198c9 100644 --- a/src/harness/unittests/symbolWalker.ts +++ b/src/harness/unittests/symbolWalker.ts @@ -28,7 +28,7 @@ export default function foo(a: number, b: Bar): void {}`, (file, checker) => { let foundCount = 0; let stdLibRefSymbols = 0; const expectedSymbols = ["default", "a", "b", "Bar", "x", "y", "history"]; - let walker = checker.getSymbolWalker(symbol => { + const walker = checker.getSymbolWalker(symbol => { const isStdLibSymbol = forEach(symbol.declarations, d => { return getSourceFileOfNode(d).hasNoDefaultLib; }); From d7ace2086fc9a2e46d5381444c421e861ff105b3 Mon Sep 17 00:00:00 2001 From: Andrew Casey Date: Thu, 17 Aug 2017 13:17:51 -0700 Subject: [PATCH 207/237] Fix copy-paste error --- src/compiler/symbolWalker.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/compiler/symbolWalker.ts b/src/compiler/symbolWalker.ts index ade9e12d03950..39f7f131c37bc 100644 --- a/src/compiler/symbolWalker.ts +++ b/src/compiler/symbolWalker.ts @@ -1,6 +1,5 @@ /** @internal */ namespace ts { - /** @internal */ export function createGetSymbolWalker( getRestTypeOfSignature: (sig: Signature) => Type, getReturnTypeOfSignature: (sig: Signature) => Type, @@ -114,7 +113,7 @@ namespace ts { function visitObjectType(type: ObjectType): void { const stringIndexType = getIndexTypeOfStructuredType(type, IndexKind.String); visitType(stringIndexType); - const numberIndexType = getIndexTypeOfStructuredType(type, IndexKind.String); + const numberIndexType = getIndexTypeOfStructuredType(type, IndexKind.Number); visitType(numberIndexType); // The two checks above *should* have already resolved the type (if needed), so this should be cached From 1a20b6a7c337d62a42d22e9e050bf64dc78f6679 Mon Sep 17 00:00:00 2001 From: Andrew Casey Date: Thu, 17 Aug 2017 13:23:11 -0700 Subject: [PATCH 208/237] Add support for walking IndexTypes, IndexedAccessTypes, and MappedTypes. --- src/compiler/symbolWalker.ts | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/src/compiler/symbolWalker.ts b/src/compiler/symbolWalker.ts index 39f7f131c37bc..7f1745b8742e9 100644 --- a/src/compiler/symbolWalker.ts +++ b/src/compiler/symbolWalker.ts @@ -53,6 +53,9 @@ namespace ts { if (objectFlags & ObjectFlags.Reference) { visitTypeReference(type as TypeReference); } + if (objectFlags & ObjectFlags.Mapped) { + visitMappedType(type as MappedType); + } if (objectFlags & (ObjectFlags.Class | ObjectFlags.Interface)) { visitInterfaceType(type as InterfaceType); } @@ -66,6 +69,12 @@ namespace ts { if (type.flags & TypeFlags.UnionOrIntersection) { visitUnionOrIntersectionType(type as UnionOrIntersectionType); } + if (type.flags & TypeFlags.Index) { + visitIndexType(type as IndexType); + } + if (type.flags & TypeFlags.IndexedAccess) { + visitIndexedAccessType(type as IndexedAccessType); + } } function visitTypeList(types: Type[]): void { @@ -90,6 +99,23 @@ namespace ts { visitTypeList(type.types); } + function visitIndexType(type: IndexType): void { + visitType(type.type); + } + + function visitIndexedAccessType(type: IndexedAccessType): void { + visitType(type.objectType); + visitType(type.indexType); + visitType(type.constraint); + } + + function visitMappedType(type: MappedType): void { + visitType(type.typeParameter); + visitType(type.constraintType); + visitType(type.templateType); + visitType(type.modifiersType); + } + function visitSignature(signature: Signature): void { if (signature.typePredicate) { visitType(signature.typePredicate.type); From e02da343db817b148d2b533f6ec392b69f297a1b Mon Sep 17 00:00:00 2001 From: Andrew Casey Date: Thu, 17 Aug 2017 15:44:06 -0700 Subject: [PATCH 209/237] Retrieve type parameter constraint using getConstraintFromTypeParameter --- src/compiler/checker.ts | 2 +- src/compiler/symbolWalker.ts | 5 +++-- src/compiler/types.ts | 1 + 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index d69c6cdebdadc..4781f4bc18386 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -205,7 +205,7 @@ namespace ts { getEmitResolver, getExportsOfModule: getExportsOfModuleAsArray, getExportsAndPropertiesOfModule, - getSymbolWalker: createGetSymbolWalker(getRestTypeOfSignature, getReturnTypeOfSignature, getBaseTypes, resolveStructuredTypeMembers, getTypeOfSymbol, getResolvedSymbol, getIndexTypeOfStructuredType), + getSymbolWalker: createGetSymbolWalker(getRestTypeOfSignature, getReturnTypeOfSignature, getBaseTypes, resolveStructuredTypeMembers, getTypeOfSymbol, getResolvedSymbol, getIndexTypeOfStructuredType, getConstraintFromTypeParameter), getAmbientModules, getAllAttributesTypeFromJsxOpeningLikeElement: node => { node = getParseTreeNode(node, isJsxOpeningLikeElement); diff --git a/src/compiler/symbolWalker.ts b/src/compiler/symbolWalker.ts index 7f1745b8742e9..6567870c961d4 100644 --- a/src/compiler/symbolWalker.ts +++ b/src/compiler/symbolWalker.ts @@ -7,7 +7,8 @@ namespace ts { resolveStructuredTypeMembers: (type: ObjectType) => ResolvedType, getTypeOfSymbol: (sym: Symbol) => Type, getResolvedSymbol: (node: Node) => Symbol, - getIndexTypeOfStructuredType: (type: Type, kind: IndexKind) => Type) { + getIndexTypeOfStructuredType: (type: Type, kind: IndexKind) => Type, + getConstraintFromTypeParameter: (typeParameter: TypeParameter) => Type) { return getSymbolWalker; @@ -92,7 +93,7 @@ namespace ts { } function visitTypeParameter(type: TypeParameter): void { - visitType(type.constraint); + visitType(getConstraintFromTypeParameter(type)); } function visitUnionOrIntersectionType(type: UnionOrIntersectionType): void { diff --git a/src/compiler/types.ts b/src/compiler/types.ts index 37e12cc9d294c..26bf5e1a91f85 100644 --- a/src/compiler/types.ts +++ b/src/compiler/types.ts @@ -3377,6 +3377,7 @@ namespace ts { // Type parameters (TypeFlags.TypeParameter) export interface TypeParameter extends TypeVariable { + /** Retrieve using getConstraintFromTypeParameter */ constraint: Type; // Constraint default?: Type; /* @internal */ From 89447748d500e66846f9f4068ada12424da0ce74 Mon Sep 17 00:00:00 2001 From: Andrew Casey Date: Tue, 22 Aug 2017 10:47:37 -0700 Subject: [PATCH 210/237] Reuse exiting getFirstIdentifier function --- src/compiler/checker.ts | 2 +- src/compiler/symbolWalker.ts | 14 +++----------- 2 files changed, 4 insertions(+), 12 deletions(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 4781f4bc18386..cff540c3f066e 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -205,7 +205,7 @@ namespace ts { getEmitResolver, getExportsOfModule: getExportsOfModuleAsArray, getExportsAndPropertiesOfModule, - getSymbolWalker: createGetSymbolWalker(getRestTypeOfSignature, getReturnTypeOfSignature, getBaseTypes, resolveStructuredTypeMembers, getTypeOfSymbol, getResolvedSymbol, getIndexTypeOfStructuredType, getConstraintFromTypeParameter), + getSymbolWalker: createGetSymbolWalker(getRestTypeOfSignature, getReturnTypeOfSignature, getBaseTypes, resolveStructuredTypeMembers, getTypeOfSymbol, getResolvedSymbol, getIndexTypeOfStructuredType, getConstraintFromTypeParameter, getFirstIdentifier), getAmbientModules, getAllAttributesTypeFromJsxOpeningLikeElement: node => { node = getParseTreeNode(node, isJsxOpeningLikeElement); diff --git a/src/compiler/symbolWalker.ts b/src/compiler/symbolWalker.ts index 6567870c961d4..e20ef9f9d9877 100644 --- a/src/compiler/symbolWalker.ts +++ b/src/compiler/symbolWalker.ts @@ -8,7 +8,8 @@ namespace ts { getTypeOfSymbol: (sym: Symbol) => Type, getResolvedSymbol: (node: Node) => Symbol, getIndexTypeOfStructuredType: (type: Type, kind: IndexKind) => Type, - getConstraintFromTypeParameter: (typeParameter: TypeParameter) => Type) { + getConstraintFromTypeParameter: (typeParameter: TypeParameter) => Type, + getFirstIdentifier: (node: EntityNameOrEntityNameExpression) => Identifier) { return getSymbolWalker; @@ -180,20 +181,11 @@ namespace ts { // query node on any of the symbol's declarations and get symbols there if ((d as any).type && (d as any).type.kind === SyntaxKind.TypeQuery) { const query = (d as any).type as TypeQueryNode; - const entity = leftmostSymbol(query.exprName); + const entity = getResolvedSymbol(getFirstIdentifier(query.exprName)); visitSymbol(entity); } }); } } - - function leftmostSymbol(expr: QualifiedName | Identifier): Symbol { - if (expr.kind === SyntaxKind.Identifier) { - return getResolvedSymbol(expr as Identifier); - } - else { - return leftmostSymbol((expr as QualifiedName).left); - } - } } } \ No newline at end of file From bdc2aa8afb7b423e23ee2f1ed6507c0deb1c4e33 Mon Sep 17 00:00:00 2001 From: Wesley Wigham Date: Tue, 22 Aug 2017 13:47:53 -0700 Subject: [PATCH 211/237] Allow use before declaration for export= assignments (#17967) --- src/compiler/checker.ts | 7 ++++++- .../exportAssignmentOfGenericType1.errors.txt | 17 --------------- .../reference/exportImport.errors.txt | 21 ------------------- ...eExportAssignmentOfGenericClass.errors.txt | 20 ------------------ 4 files changed, 6 insertions(+), 59 deletions(-) delete mode 100644 tests/baselines/reference/exportAssignmentOfGenericType1.errors.txt delete mode 100644 tests/baselines/reference/exportImport.errors.txt delete mode 100644 tests/baselines/reference/privacyCheckExternalModuleExportAssignmentOfGenericClass.errors.txt diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index d2d3697f175c6..82521698fa9b3 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -794,12 +794,17 @@ namespace ts { // 2. inside a function // 3. inside an instance property initializer, a reference to a non-instance property // 4. inside a static property initializer, a reference to a static method in the same class + // 5. inside a TS export= declaration (since we will move the export statement during emit to avoid TDZ) // or if usage is in a type context: // 1. inside a type query (typeof in type position) - if (usage.parent.kind === SyntaxKind.ExportSpecifier) { + if (usage.parent.kind === SyntaxKind.ExportSpecifier || (usage.parent.kind === SyntaxKind.ExportAssignment && (usage.parent as ExportAssignment).isExportEquals)) { // export specifiers do not use the variable, they only make it available for use return true; } + // When resolving symbols for exports, the `usage` location passed in can be the export site directly + if (usage.kind === SyntaxKind.ExportAssignment && (usage as ExportAssignment).isExportEquals) { + return true; + } const container = getEnclosingBlockScopeContainer(declaration); return isInTypeQuery(usage) || isUsedInFunctionOrInstanceProperty(usage, declaration, container); diff --git a/tests/baselines/reference/exportAssignmentOfGenericType1.errors.txt b/tests/baselines/reference/exportAssignmentOfGenericType1.errors.txt deleted file mode 100644 index e484d4096bb78..0000000000000 --- a/tests/baselines/reference/exportAssignmentOfGenericType1.errors.txt +++ /dev/null @@ -1,17 +0,0 @@ -tests/cases/compiler/exportAssignmentOfGenericType1_0.ts(1,10): error TS2449: Class 'T' used before its declaration. - - -==== tests/cases/compiler/exportAssignmentOfGenericType1_1.ts (0 errors) ==== - /// - import q = require("exportAssignmentOfGenericType1_0"); - - class M extends q { } - var m: M; - var r: string = m.foo; - -==== tests/cases/compiler/exportAssignmentOfGenericType1_0.ts (1 errors) ==== - export = T; - ~ -!!! error TS2449: Class 'T' used before its declaration. - class T { foo: X; } - \ No newline at end of file diff --git a/tests/baselines/reference/exportImport.errors.txt b/tests/baselines/reference/exportImport.errors.txt deleted file mode 100644 index 4f397d54a557d..0000000000000 --- a/tests/baselines/reference/exportImport.errors.txt +++ /dev/null @@ -1,21 +0,0 @@ -tests/cases/compiler/w1.ts(1,1): error TS2449: Class 'Widget1' used before its declaration. -tests/cases/compiler/w1.ts(1,10): error TS2449: Class 'Widget1' used before its declaration. - - -==== tests/cases/compiler/consumer.ts (0 errors) ==== - import e = require('./exporter'); - - export function w(): e.w { // Should be OK - return new e.w(); - } -==== tests/cases/compiler/w1.ts (2 errors) ==== - export = Widget1 - ~~~~~~~~~~~~~~~~ -!!! error TS2449: Class 'Widget1' used before its declaration. - ~~~~~~~ -!!! error TS2449: Class 'Widget1' used before its declaration. - class Widget1 { name = 'one'; } - -==== tests/cases/compiler/exporter.ts (0 errors) ==== - export import w = require('./w1'); - \ No newline at end of file diff --git a/tests/baselines/reference/privacyCheckExternalModuleExportAssignmentOfGenericClass.errors.txt b/tests/baselines/reference/privacyCheckExternalModuleExportAssignmentOfGenericClass.errors.txt deleted file mode 100644 index 2945950068a42..0000000000000 --- a/tests/baselines/reference/privacyCheckExternalModuleExportAssignmentOfGenericClass.errors.txt +++ /dev/null @@ -1,20 +0,0 @@ -tests/cases/compiler/privacyCheckExternalModuleExportAssignmentOfGenericClass_0.ts(1,1): error TS2449: Class 'Foo' used before its declaration. -tests/cases/compiler/privacyCheckExternalModuleExportAssignmentOfGenericClass_0.ts(1,10): error TS2449: Class 'Foo' used before its declaration. - - -==== tests/cases/compiler/privacyCheckExternalModuleExportAssignmentOfGenericClass_1.ts (0 errors) ==== - import Foo = require("./privacyCheckExternalModuleExportAssignmentOfGenericClass_0"); - export = Bar; - interface Bar { - foo: Foo; - } -==== tests/cases/compiler/privacyCheckExternalModuleExportAssignmentOfGenericClass_0.ts (2 errors) ==== - export = Foo; - ~~~~~~~~~~~~~ -!!! error TS2449: Class 'Foo' used before its declaration. - ~~~ -!!! error TS2449: Class 'Foo' used before its declaration. - class Foo { - constructor(public a: A) { } - } - \ No newline at end of file From 009d9b4f22b32d6cb3c1da4d8836c0972316e5c0 Mon Sep 17 00:00:00 2001 From: Wesley Wigham Date: Tue, 22 Aug 2017 14:13:56 -0700 Subject: [PATCH 212/237] For JSX Attributes, map over unions of props for contextual types (#17790) * For JSX Attributes, allow attributes to fulfill the member of any union member; rather than all of them * Use cached way of getting partial union members * Reuse methodology used for object literals for jsx attributes * Inline assignment * Rename type --- src/compiler/checker.ts | 6 +- .../tsxInferenceShouldNotYieldAnyOnUnions.js | 40 ++++++ ...InferenceShouldNotYieldAnyOnUnions.symbols | 90 +++++++++++++ ...sxInferenceShouldNotYieldAnyOnUnions.types | 118 ++++++++++++++++++ .../tsxInferenceShouldNotYieldAnyOnUnions.tsx | 29 +++++ 5 files changed, 280 insertions(+), 3 deletions(-) create mode 100644 tests/baselines/reference/tsxInferenceShouldNotYieldAnyOnUnions.js create mode 100644 tests/baselines/reference/tsxInferenceShouldNotYieldAnyOnUnions.symbols create mode 100644 tests/baselines/reference/tsxInferenceShouldNotYieldAnyOnUnions.types create mode 100644 tests/cases/compiler/tsxInferenceShouldNotYieldAnyOnUnions.tsx diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 82521698fa9b3..3fdee5e9a1012 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -13121,12 +13121,12 @@ namespace ts { if (isJsxAttribute(node.parent)) { // JSX expression is in JSX attribute - return getTypeOfPropertyOfType(attributesType, node.parent.name.escapedText); + return getTypeOfPropertyOfContextualType(attributesType, node.parent.name.escapedText); } else if (node.parent.kind === SyntaxKind.JsxElement) { // JSX expression is in children of JSX Element, we will look for an "children" atttribute (we get the name from JSX.ElementAttributesProperty) const jsxChildrenPropertyName = getJsxElementChildrenPropertyname(); - return jsxChildrenPropertyName && jsxChildrenPropertyName !== "" ? getTypeOfPropertyOfType(attributesType, jsxChildrenPropertyName) : anyType; + return jsxChildrenPropertyName && jsxChildrenPropertyName !== "" ? getTypeOfPropertyOfContextualType(attributesType, jsxChildrenPropertyName) : anyType; } else { // JSX expression is in JSX spread attribute @@ -13144,7 +13144,7 @@ namespace ts { if (!attributesType || isTypeAny(attributesType)) { return undefined; } - return getTypeOfPropertyOfType(attributesType, attribute.name.escapedText); + return getTypeOfPropertyOfContextualType(attributesType, attribute.name.escapedText); } else { return attributesType; diff --git a/tests/baselines/reference/tsxInferenceShouldNotYieldAnyOnUnions.js b/tests/baselines/reference/tsxInferenceShouldNotYieldAnyOnUnions.js new file mode 100644 index 0000000000000..0459b56d87447 --- /dev/null +++ b/tests/baselines/reference/tsxInferenceShouldNotYieldAnyOnUnions.js @@ -0,0 +1,40 @@ +//// [index.tsx] +namespace JSX { + export interface Element {} +} + +type Props = PropsBase | PropsWithConvert; + +interface PropsBase { + data: T; +} + +interface PropsWithConvert extends PropsBase { + convert: (t: T) => string; +} + +function ShouldInferFromData(props: Props): JSX.Element { + return
; +} + +// Sanity check: function call equivalent versions work fine +ShouldInferFromData({ data: "1" }); +ShouldInferFromData({ data: "1", convert: n => "" + n }); +ShouldInferFromData({ data: 2, convert: n => "" + n }); + + +const f1 = ; +const f2 = "" + n} />; +const f3 = "" + n} />; + +//// [index.jsx] +function ShouldInferFromData(props) { + return
; +} +// Sanity check: function call equivalent versions work fine +ShouldInferFromData({ data: "1" }); +ShouldInferFromData({ data: "1", convert: function (n) { return "" + n; } }); +ShouldInferFromData({ data: 2, convert: function (n) { return "" + n; } }); +var f1 = ; +var f2 = ; +var f3 = ; diff --git a/tests/baselines/reference/tsxInferenceShouldNotYieldAnyOnUnions.symbols b/tests/baselines/reference/tsxInferenceShouldNotYieldAnyOnUnions.symbols new file mode 100644 index 0000000000000..b6163a36df641 --- /dev/null +++ b/tests/baselines/reference/tsxInferenceShouldNotYieldAnyOnUnions.symbols @@ -0,0 +1,90 @@ +=== tests/cases/compiler/index.tsx === +namespace JSX { +>JSX : Symbol(JSX, Decl(index.tsx, 0, 0)) + + export interface Element {} +>Element : Symbol(Element, Decl(index.tsx, 0, 15)) +} + +type Props = PropsBase | PropsWithConvert; +>Props : Symbol(Props, Decl(index.tsx, 2, 1)) +>T : Symbol(T, Decl(index.tsx, 4, 11)) +>PropsBase : Symbol(PropsBase, Decl(index.tsx, 4, 56)) +>PropsWithConvert : Symbol(PropsWithConvert, Decl(index.tsx, 8, 1)) +>T : Symbol(T, Decl(index.tsx, 4, 11)) + +interface PropsBase { +>PropsBase : Symbol(PropsBase, Decl(index.tsx, 4, 56)) +>T : Symbol(T, Decl(index.tsx, 6, 20)) + + data: T; +>data : Symbol(PropsBase.data, Decl(index.tsx, 6, 24)) +>T : Symbol(T, Decl(index.tsx, 6, 20)) +} + +interface PropsWithConvert extends PropsBase { +>PropsWithConvert : Symbol(PropsWithConvert, Decl(index.tsx, 8, 1)) +>T : Symbol(T, Decl(index.tsx, 10, 27)) +>PropsBase : Symbol(PropsBase, Decl(index.tsx, 4, 56)) +>T : Symbol(T, Decl(index.tsx, 10, 27)) + + convert: (t: T) => string; +>convert : Symbol(PropsWithConvert.convert, Decl(index.tsx, 10, 52)) +>t : Symbol(t, Decl(index.tsx, 11, 14)) +>T : Symbol(T, Decl(index.tsx, 10, 27)) +} + +function ShouldInferFromData(props: Props): JSX.Element { +>ShouldInferFromData : Symbol(ShouldInferFromData, Decl(index.tsx, 12, 1)) +>T : Symbol(T, Decl(index.tsx, 14, 29)) +>props : Symbol(props, Decl(index.tsx, 14, 32)) +>Props : Symbol(Props, Decl(index.tsx, 2, 1)) +>T : Symbol(T, Decl(index.tsx, 14, 29)) +>JSX : Symbol(JSX, Decl(index.tsx, 0, 0)) +>Element : Symbol(JSX.Element, Decl(index.tsx, 0, 15)) + + return
; +>div : Symbol(unknown) +} + +// Sanity check: function call equivalent versions work fine +ShouldInferFromData({ data: "1" }); +>ShouldInferFromData : Symbol(ShouldInferFromData, Decl(index.tsx, 12, 1)) +>data : Symbol(data, Decl(index.tsx, 19, 21)) + +ShouldInferFromData({ data: "1", convert: n => "" + n }); +>ShouldInferFromData : Symbol(ShouldInferFromData, Decl(index.tsx, 12, 1)) +>data : Symbol(data, Decl(index.tsx, 20, 21)) +>convert : Symbol(convert, Decl(index.tsx, 20, 32)) +>n : Symbol(n, Decl(index.tsx, 20, 41)) +>n : Symbol(n, Decl(index.tsx, 20, 41)) + +ShouldInferFromData({ data: 2, convert: n => "" + n }); +>ShouldInferFromData : Symbol(ShouldInferFromData, Decl(index.tsx, 12, 1)) +>data : Symbol(data, Decl(index.tsx, 21, 21)) +>convert : Symbol(convert, Decl(index.tsx, 21, 30)) +>n : Symbol(n, Decl(index.tsx, 21, 39)) +>n : Symbol(n, Decl(index.tsx, 21, 39)) + + +const f1 = ; +>f1 : Symbol(f1, Decl(index.tsx, 24, 5)) +>ShouldInferFromData : Symbol(ShouldInferFromData, Decl(index.tsx, 12, 1)) +>data : Symbol(data, Decl(index.tsx, 24, 31)) + +const f2 = "" + n} />; +>f2 : Symbol(f2, Decl(index.tsx, 25, 5)) +>ShouldInferFromData : Symbol(ShouldInferFromData, Decl(index.tsx, 12, 1)) +>data : Symbol(data, Decl(index.tsx, 25, 31)) +>convert : Symbol(convert, Decl(index.tsx, 25, 42)) +>n : Symbol(n, Decl(index.tsx, 25, 52)) +>n : Symbol(n, Decl(index.tsx, 25, 52)) + +const f3 = "" + n} />; +>f3 : Symbol(f3, Decl(index.tsx, 26, 5)) +>ShouldInferFromData : Symbol(ShouldInferFromData, Decl(index.tsx, 12, 1)) +>data : Symbol(data, Decl(index.tsx, 26, 31)) +>convert : Symbol(convert, Decl(index.tsx, 26, 40)) +>n : Symbol(n, Decl(index.tsx, 26, 50)) +>n : Symbol(n, Decl(index.tsx, 26, 50)) + diff --git a/tests/baselines/reference/tsxInferenceShouldNotYieldAnyOnUnions.types b/tests/baselines/reference/tsxInferenceShouldNotYieldAnyOnUnions.types new file mode 100644 index 0000000000000..68ad55854a797 --- /dev/null +++ b/tests/baselines/reference/tsxInferenceShouldNotYieldAnyOnUnions.types @@ -0,0 +1,118 @@ +=== tests/cases/compiler/index.tsx === +namespace JSX { +>JSX : any + + export interface Element {} +>Element : Element +} + +type Props = PropsBase | PropsWithConvert; +>Props : Props +>T : T +>PropsBase : PropsBase +>PropsWithConvert : PropsWithConvert +>T : T + +interface PropsBase { +>PropsBase : PropsBase +>T : T + + data: T; +>data : T +>T : T +} + +interface PropsWithConvert extends PropsBase { +>PropsWithConvert : PropsWithConvert +>T : T +>PropsBase : PropsBase +>T : T + + convert: (t: T) => string; +>convert : (t: T) => string +>t : T +>T : T +} + +function ShouldInferFromData(props: Props): JSX.Element { +>ShouldInferFromData : (props: Props) => JSX.Element +>T : T +>props : Props +>Props : Props +>T : T +>JSX : any +>Element : JSX.Element + + return
; +>
: JSX.Element +>div : any +} + +// Sanity check: function call equivalent versions work fine +ShouldInferFromData({ data: "1" }); +>ShouldInferFromData({ data: "1" }) : JSX.Element +>ShouldInferFromData : (props: Props) => JSX.Element +>{ data: "1" } : { data: string; } +>data : string +>"1" : "1" + +ShouldInferFromData({ data: "1", convert: n => "" + n }); +>ShouldInferFromData({ data: "1", convert: n => "" + n }) : JSX.Element +>ShouldInferFromData : (props: Props) => JSX.Element +>{ data: "1", convert: n => "" + n } : { data: string; convert: (n: string) => string; } +>data : string +>"1" : "1" +>convert : (n: string) => string +>n => "" + n : (n: string) => string +>n : string +>"" + n : string +>"" : "" +>n : string + +ShouldInferFromData({ data: 2, convert: n => "" + n }); +>ShouldInferFromData({ data: 2, convert: n => "" + n }) : JSX.Element +>ShouldInferFromData : (props: Props) => JSX.Element +>{ data: 2, convert: n => "" + n } : { data: number; convert: (n: number) => string; } +>data : number +>2 : 2 +>convert : (n: number) => string +>n => "" + n : (n: number) => string +>n : number +>"" + n : string +>"" : "" +>n : number + + +const f1 = ; +>f1 : JSX.Element +> : JSX.Element +>ShouldInferFromData : (props: Props) => JSX.Element +>data : string +>"1" : "1" + +const f2 = "" + n} />; +>f2 : JSX.Element +> "" + n} /> : JSX.Element +>ShouldInferFromData : (props: Props) => JSX.Element +>data : string +>"1" : "1" +>convert : (n: "1") => string +>n => "" + n : (n: "1") => string +>n : "1" +>"" + n : string +>"" : "" +>n : "1" + +const f3 = "" + n} />; +>f3 : JSX.Element +> "" + n} /> : JSX.Element +>ShouldInferFromData : (props: Props) => JSX.Element +>data : number +>2 : 2 +>convert : (n: 2) => string +>n => "" + n : (n: 2) => string +>n : 2 +>"" + n : string +>"" : "" +>n : 2 + diff --git a/tests/cases/compiler/tsxInferenceShouldNotYieldAnyOnUnions.tsx b/tests/cases/compiler/tsxInferenceShouldNotYieldAnyOnUnions.tsx new file mode 100644 index 0000000000000..a0d4f5984e47a --- /dev/null +++ b/tests/cases/compiler/tsxInferenceShouldNotYieldAnyOnUnions.tsx @@ -0,0 +1,29 @@ +// @jsx: preserve +// @filename: index.tsx +namespace JSX { + export interface Element {} +} + +type Props = PropsBase | PropsWithConvert; + +interface PropsBase { + data: T; +} + +interface PropsWithConvert extends PropsBase { + convert: (t: T) => string; +} + +function ShouldInferFromData(props: Props): JSX.Element { + return
; +} + +// Sanity check: function call equivalent versions work fine +ShouldInferFromData({ data: "1" }); +ShouldInferFromData({ data: "1", convert: n => "" + n }); +ShouldInferFromData({ data: 2, convert: n => "" + n }); + + +const f1 = ; +const f2 = "" + n} />; +const f3 = "" + n} />; \ No newline at end of file From 8d44e48dd0f63a2f48bd5045d4833e709c299a3b Mon Sep 17 00:00:00 2001 From: Wesley Wigham Date: Tue, 22 Aug 2017 15:39:10 -0700 Subject: [PATCH 213/237] Fix instrumenter target + deprecation warning (#17973) --- Gulpfile.ts | 6 +++--- Jakefile.js | 2 +- src/harness/instrumenter.ts | 8 +++++--- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/Gulpfile.ts b/Gulpfile.ts index 645443370eb36..4a03557270f89 100644 --- a/Gulpfile.ts +++ b/Gulpfile.ts @@ -978,7 +978,7 @@ const instrumenterPath = path.join(harnessDirectory, "instrumenter.ts"); const instrumenterJsPath = path.join(builtLocalDirectory, "instrumenter.js"); gulp.task(instrumenterJsPath, /*help*/ false, [servicesFile], () => { const settings: tsc.Settings = getCompilerSettings({ - outFile: instrumenterJsPath, + module: "commonjs", target: "es5", lib: [ "es6", @@ -990,8 +990,8 @@ gulp.task(instrumenterJsPath, /*help*/ false, [servicesFile], () => { .pipe(newer(instrumenterJsPath)) .pipe(sourcemaps.init()) .pipe(tsc(settings)) - .pipe(sourcemaps.write(".")) - .pipe(gulp.dest(".")); + .pipe(sourcemaps.write(builtLocalDirectory)) + .pipe(gulp.dest(builtLocalDirectory)); }); gulp.task("tsc-instrumented", "Builds an instrumented tsc.js", ["local", loggedIOJsPath, instrumenterJsPath, servicesFile], (done) => { diff --git a/Jakefile.js b/Jakefile.js index 546727db4e00a..5ae887ee2385e 100644 --- a/Jakefile.js +++ b/Jakefile.js @@ -1098,7 +1098,7 @@ file(loggedIOJsPath, [builtLocalDirectory, loggedIOpath], function () { var instrumenterPath = harnessDirectory + 'instrumenter.ts'; var instrumenterJsPath = builtLocalDirectory + 'instrumenter.js'; -compileFile(instrumenterJsPath, [instrumenterPath], [tscFile, instrumenterPath].concat(libraryTargets), [], /*useBuiltCompiler*/ true, { lib: "es6", types: ["node"] }); +compileFile(instrumenterJsPath, [instrumenterPath], [tscFile, instrumenterPath].concat(libraryTargets), [], /*useBuiltCompiler*/ true, { lib: "es6", types: ["node"], noOutFile: true, outDir: builtLocalDirectory }); desc("Builds an instrumented tsc.js"); task('tsc-instrumented', [loggedIOJsPath, instrumenterJsPath, tscFile], function () { diff --git a/src/harness/instrumenter.ts b/src/harness/instrumenter.ts index 02aba0e766172..cb11be5c7452b 100644 --- a/src/harness/instrumenter.ts +++ b/src/harness/instrumenter.ts @@ -1,5 +1,5 @@ -const fs: any = require("fs"); -const path: any = require("path"); +import fs = require("fs"); +import path = require("path"); function instrumentForRecording(fn: string, tscPath: string) { instrument(tscPath, ` @@ -38,7 +38,9 @@ function instrument(tscPath: string, prepareCode: string, cleanupCode = "") { const index2 = index1 + invocationLine.length; const newContent = tscContent.substr(0, index1) + loggerContent + prepareCode + invocationLine + cleanupCode + tscContent.substr(index2) + "\r\n"; - fs.writeFile(tscPath, newContent); + fs.writeFile(tscPath, newContent, err => { + if (err) throw err; + }); }); }); }); From f8e8afec1b45b5d7d8ae6ba95ecbea37fcb7936b Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Tue, 22 Aug 2017 21:18:25 -0700 Subject: [PATCH 214/237] Accepted baselines. --- .../reference/baseExpressionTypeParameters.errors.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/baselines/reference/baseExpressionTypeParameters.errors.txt b/tests/baselines/reference/baseExpressionTypeParameters.errors.txt index 4fa8f2f6d3dbb..cb259e49dd26e 100644 --- a/tests/baselines/reference/baseExpressionTypeParameters.errors.txt +++ b/tests/baselines/reference/baseExpressionTypeParameters.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/baseExpressionTypeParameters.ts(10,27): error TS2561: Base class expressions cannot reference class type parameters. +tests/cases/compiler/baseExpressionTypeParameters.ts(10,27): error TS2562: Base class expressions cannot reference class type parameters. ==== tests/cases/compiler/baseExpressionTypeParameters.ts (1 errors) ==== @@ -13,7 +13,7 @@ tests/cases/compiler/baseExpressionTypeParameters.ts(10,27): error TS2561: Base class Gen extends base() {} // Error, T not in scope ~ -!!! error TS2561: Base class expressions cannot reference class type parameters. +!!! error TS2562: Base class expressions cannot reference class type parameters. class Spec extends Gen {} Spec.prop; \ No newline at end of file From e3abc12209cb0cecc53ba530fef10f8fc1f74520 Mon Sep 17 00:00:00 2001 From: Matt Mitchell Date: Wed, 23 Aug 2017 11:03:05 -0700 Subject: [PATCH 215/237] Revert image label change (#17981) * Revert image label change I decided to avoid doing the image update change, reverting. * Use full OS name --- netci.groovy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/netci.groovy b/netci.groovy index c60957730c4f0..fc6d00e4e7fd7 100644 --- a/netci.groovy +++ b/netci.groovy @@ -17,6 +17,6 @@ nodeVersions.each { nodeVer -> } Utilities.standardJobSetup(newJob, project, true, "*/${branch}") - Utilities.setMachineAffinity(newJob, 'Ubuntu14.04', '20170821-1') + Utilities.setMachineAffinity(newJob, 'Ubuntu14.04', '20161020') Utilities.addGithubPRTriggerForBranch(newJob, branch, "TypeScript Test Run ${newJobName}") } From e27d0917c9d0a9d364f0cbbc67bf880f32fd8808 Mon Sep 17 00:00:00 2001 From: Nathan Shively-Sanders Date: Mon, 21 Aug 2017 10:09:21 -0700 Subject: [PATCH 216/237] Test performance improvement:nested reference skip --- .../complexRecursiveCollections.errors.txt | 847 ++++++++++++++++++ .../compiler/complexRecursiveCollections.ts | 532 +++++++++++ 2 files changed, 1379 insertions(+) create mode 100644 tests/baselines/reference/complexRecursiveCollections.errors.txt create mode 100644 tests/cases/compiler/complexRecursiveCollections.ts diff --git a/tests/baselines/reference/complexRecursiveCollections.errors.txt b/tests/baselines/reference/complexRecursiveCollections.errors.txt new file mode 100644 index 0000000000000..38f66b7456a7f --- /dev/null +++ b/tests/baselines/reference/complexRecursiveCollections.errors.txt @@ -0,0 +1,847 @@ +tests/cases/compiler/immutable.d.ts(25,39): error TS2304: Cannot find name 'Iterable'. +tests/cases/compiler/immutable.d.ts(46,20): error TS2304: Cannot find name 'Iterable'. +tests/cases/compiler/immutable.d.ts(47,23): error TS2304: Cannot find name 'Iterable'. +tests/cases/compiler/immutable.d.ts(48,23): error TS2304: Cannot find name 'Iterable'. +tests/cases/compiler/immutable.d.ts(49,23): error TS2304: Cannot find name 'Iterable'. +tests/cases/compiler/immutable.d.ts(50,23): error TS2304: Cannot find name 'Iterable'. +tests/cases/compiler/immutable.d.ts(51,22): error TS2304: Cannot find name 'Iterable'. +tests/cases/compiler/immutable.d.ts(52,26): error TS2304: Cannot find name 'Iterable'. +tests/cases/compiler/immutable.d.ts(58,45): error TS2304: Cannot find name 'Iterable'. +tests/cases/compiler/immutable.d.ts(60,63): error TS2304: Cannot find name 'Iterable'. +tests/cases/compiler/immutable.d.ts(68,41): error TS2304: Cannot find name 'Iterable'. +tests/cases/compiler/immutable.d.ts(69,38): error TS2304: Cannot find name 'Iterable'. +tests/cases/compiler/immutable.d.ts(69,47): error TS2304: Cannot find name 'Iterable'. +tests/cases/compiler/immutable.d.ts(78,21): error TS2304: Cannot find name 'Iterable'. +tests/cases/compiler/immutable.d.ts(79,21): error TS2304: Cannot find name 'Iterable'. +tests/cases/compiler/immutable.d.ts(89,20): error TS2304: Cannot find name 'Iterable'. +tests/cases/compiler/immutable.d.ts(90,23): error TS2304: Cannot find name 'Iterable'. +tests/cases/compiler/immutable.d.ts(91,23): error TS2304: Cannot find name 'Iterable'. +tests/cases/compiler/immutable.d.ts(92,23): error TS2304: Cannot find name 'Iterable'. +tests/cases/compiler/immutable.d.ts(93,23): error TS2304: Cannot find name 'Iterable'. +tests/cases/compiler/immutable.d.ts(94,22): error TS2304: Cannot find name 'Iterable'. +tests/cases/compiler/immutable.d.ts(95,26): error TS2304: Cannot find name 'Iterable'. +tests/cases/compiler/immutable.d.ts(101,42): error TS2304: Cannot find name 'Iterable'. +tests/cases/compiler/immutable.d.ts(106,58): error TS2304: Cannot find name 'Iterable'. +tests/cases/compiler/immutable.d.ts(113,48): error TS2304: Cannot find name 'Iterable'. +tests/cases/compiler/immutable.d.ts(114,45): error TS2304: Cannot find name 'Iterable'. +tests/cases/compiler/immutable.d.ts(114,54): error TS2304: Cannot find name 'Iterable'. +tests/cases/compiler/immutable.d.ts(120,42): error TS2304: Cannot find name 'Iterable'. +tests/cases/compiler/immutable.d.ts(125,58): error TS2304: Cannot find name 'Iterable'. +tests/cases/compiler/immutable.d.ts(134,33): error TS2304: Cannot find name 'Iterable'. +tests/cases/compiler/immutable.d.ts(134,42): error TS2304: Cannot find name 'Iterable'. +tests/cases/compiler/immutable.d.ts(135,29): error TS2304: Cannot find name 'Iterable'. +tests/cases/compiler/immutable.d.ts(135,38): error TS2304: Cannot find name 'Iterable'. +tests/cases/compiler/immutable.d.ts(139,38): error TS2304: Cannot find name 'Iterable'. +tests/cases/compiler/immutable.d.ts(155,45): error TS2304: Cannot find name 'Iterable'. +tests/cases/compiler/immutable.d.ts(157,62): error TS2304: Cannot find name 'Iterable'. +tests/cases/compiler/immutable.d.ts(169,45): error TS2304: Cannot find name 'Iterable'. +tests/cases/compiler/immutable.d.ts(172,45): error TS2304: Cannot find name 'Iterable'. +tests/cases/compiler/immutable.d.ts(174,62): error TS2304: Cannot find name 'Iterable'. +tests/cases/compiler/immutable.d.ts(188,40): error TS2304: Cannot find name 'Iterable'. +tests/cases/compiler/immutable.d.ts(195,22): error TS2304: Cannot find name 'Iterable'. +tests/cases/compiler/immutable.d.ts(198,19): error TS2304: Cannot find name 'Iterable'. +tests/cases/compiler/immutable.d.ts(205,45): error TS2304: Cannot find name 'Iterable'. +tests/cases/compiler/immutable.d.ts(207,63): error TS2304: Cannot find name 'Iterable'. +tests/cases/compiler/immutable.d.ts(217,30): error TS2304: Cannot find name 'Iterable'. +tests/cases/compiler/immutable.d.ts(218,34): error TS2304: Cannot find name 'Iterable'. +tests/cases/compiler/immutable.d.ts(226,22): error TS2304: Cannot find name 'Iterable'. +tests/cases/compiler/immutable.d.ts(227,22): error TS2304: Cannot find name 'Iterable'. +tests/cases/compiler/immutable.d.ts(234,48): error TS2304: Cannot find name 'Iterable'. +tests/cases/compiler/immutable.d.ts(235,52): error TS2304: Cannot find name 'Iterable'. +tests/cases/compiler/immutable.d.ts(236,109): error TS2304: Cannot find name 'Iterable'. +tests/cases/compiler/immutable.d.ts(237,109): error TS2304: Cannot find name 'Iterable'. +tests/cases/compiler/immutable.d.ts(242,22): error TS2304: Cannot find name 'Iterable'. +tests/cases/compiler/immutable.d.ts(243,25): error TS2304: Cannot find name 'Iterable'. +tests/cases/compiler/immutable.d.ts(244,24): error TS2304: Cannot find name 'Iterable'. +tests/cases/compiler/immutable.d.ts(245,28): error TS2304: Cannot find name 'Iterable'. +tests/cases/compiler/immutable.d.ts(246,25): error TS2304: Cannot find name 'Iterable'. +tests/cases/compiler/immutable.d.ts(247,25): error TS2304: Cannot find name 'Iterable'. +tests/cases/compiler/immutable.d.ts(258,8): error TS2304: Cannot find name 'Symbol'. +tests/cases/compiler/immutable.d.ts(258,28): error TS2304: Cannot find name 'IterableIterator'. +tests/cases/compiler/immutable.d.ts(266,45): error TS2304: Cannot find name 'Iterable'. +tests/cases/compiler/immutable.d.ts(274,44): error TS2304: Cannot find name 'Iterable'. +tests/cases/compiler/immutable.d.ts(279,60): error TS2304: Cannot find name 'Iterable'. +tests/cases/compiler/immutable.d.ts(288,44): error TS2304: Cannot find name 'Iterable'. +tests/cases/compiler/immutable.d.ts(293,47): error TS2304: Cannot find name 'Iterable'. +tests/cases/compiler/immutable.d.ts(295,65): error TS2304: Cannot find name 'Iterable'. +tests/cases/compiler/immutable.d.ts(304,40): error TS2304: Cannot find name 'Iterable'. +tests/cases/compiler/immutable.d.ts(309,47): error TS2304: Cannot find name 'Iterable'. +tests/cases/compiler/immutable.d.ts(311,64): error TS2304: Cannot find name 'Iterable'. +tests/cases/compiler/immutable.d.ts(320,38): error TS2304: Cannot find name 'Iterable'. +tests/cases/compiler/immutable.d.ts(329,58): error TS2304: Cannot find name 'Iterable'. +tests/cases/compiler/immutable.d.ts(339,45): error TS2304: Cannot find name 'Iterable'. +tests/cases/compiler/immutable.d.ts(341,22): error TS2430: Interface 'Keyed' incorrectly extends interface 'Collection'. + Types of property 'toSeq' are incompatible. + Type '() => Keyed' is not assignable to type '() => this'. + Type 'Keyed' is not assignable to type 'this'. +tests/cases/compiler/immutable.d.ts(347,44): error TS2304: Cannot find name 'Iterable'. +tests/cases/compiler/immutable.d.ts(352,60): error TS2304: Cannot find name 'Iterable'. +tests/cases/compiler/immutable.d.ts(355,8): error TS2304: Cannot find name 'Symbol'. +tests/cases/compiler/immutable.d.ts(355,28): error TS2304: Cannot find name 'IterableIterator'. +tests/cases/compiler/immutable.d.ts(358,44): error TS2304: Cannot find name 'Iterable'. +tests/cases/compiler/immutable.d.ts(359,22): error TS2430: Interface 'Indexed' incorrectly extends interface 'Collection'. + Types of property 'toSeq' are incompatible. + Type '() => Indexed' is not assignable to type '() => this'. + Type 'Indexed' is not assignable to type 'this'. +tests/cases/compiler/immutable.d.ts(382,47): error TS2304: Cannot find name 'Iterable'. +tests/cases/compiler/immutable.d.ts(384,65): error TS2304: Cannot find name 'Iterable'. +tests/cases/compiler/immutable.d.ts(387,8): error TS2304: Cannot find name 'Symbol'. +tests/cases/compiler/immutable.d.ts(387,28): error TS2304: Cannot find name 'IterableIterator'. +tests/cases/compiler/immutable.d.ts(390,40): error TS2304: Cannot find name 'Iterable'. +tests/cases/compiler/immutable.d.ts(391,22): error TS2430: Interface 'Set' incorrectly extends interface 'Collection'. + Types of property 'toSeq' are incompatible. + Type '() => Set' is not assignable to type '() => this'. + Type 'Set' is not assignable to type 'this'. +tests/cases/compiler/immutable.d.ts(396,47): error TS2304: Cannot find name 'Iterable'. +tests/cases/compiler/immutable.d.ts(398,64): error TS2304: Cannot find name 'Iterable'. +tests/cases/compiler/immutable.d.ts(401,8): error TS2304: Cannot find name 'Symbol'. +tests/cases/compiler/immutable.d.ts(401,28): error TS2304: Cannot find name 'IterableIterator'. +tests/cases/compiler/immutable.d.ts(405,45): error TS2304: Cannot find name 'Iterable'. +tests/cases/compiler/immutable.d.ts(420,26): error TS2304: Cannot find name 'Iterable'. +tests/cases/compiler/immutable.d.ts(421,26): error TS2304: Cannot find name 'Iterable'. +tests/cases/compiler/immutable.d.ts(442,13): error TS2304: Cannot find name 'IterableIterator'. +tests/cases/compiler/immutable.d.ts(443,15): error TS2304: Cannot find name 'IterableIterator'. +tests/cases/compiler/immutable.d.ts(444,16): error TS2304: Cannot find name 'IterableIterator'. +tests/cases/compiler/immutable.d.ts(476,58): error TS2304: Cannot find name 'Iterable'. +tests/cases/compiler/immutable.d.ts(503,20): error TS2304: Cannot find name 'Iterable'. +tests/cases/compiler/immutable.d.ts(504,22): error TS2304: Cannot find name 'Iterable'. + + +==== tests/cases/compiler/complex.d.ts (0 errors) ==== + interface Ara { t: T } + interface Collection { + map(mapper: (value: V, key: K, iter: this) => M): Collection; + flatMap(mapper: (value: V, key: K, iter: this) => Ara, context?: any): Collection; + // these seem necessary to push it over the top for memory usage + reduce(reducer: (reduction: R, value: V, key: K, iter: this) => R, initialReduction: R, context?: any): R; + reduce(reducer: (reduction: V | R, value: V, key: K, iter: this) => R): R; + toSeq(): Seq; + } + interface Seq extends Collection { + } + interface N1 extends Collection { + map(mapper: (value: T, key: void, iter: this) => M): N1; + flatMap(mapper: (value: T, key: void, iter: this) => Ara, context?: any): N1; + } + interface N2 extends N1 { + map(mapper: (value: T, key: void, iter: this) => M): N2; + flatMap(mapper: (value: T, key: void, iter: this) => Ara, context?: any): N2; + toSeq(): N2; + } +==== tests/cases/compiler/immutable.d.ts (98 errors) ==== + // Test that complex recursive collections can pass the `extends` assignability check without + // running out of memory. This bug was exposed in Typescript 2.4 when more generic signatures + // started being checked. + declare module Immutable { + export function fromJS(jsValue: any, reviver?: (key: string | number, sequence: Collection.Keyed | Collection.Indexed, path?: Array) => any): any; + export function is(first: any, second: any): boolean; + export function hash(value: any): number; + export function isImmutable(maybeImmutable: any): maybeImmutable is Collection; + export function isCollection(maybeCollection: any): maybeCollection is Collection; + export function isKeyed(maybeKeyed: any): maybeKeyed is Collection.Keyed; + export function isIndexed(maybeIndexed: any): maybeIndexed is Collection.Indexed; + export function isAssociative(maybeAssociative: any): maybeAssociative is Collection.Keyed | Collection.Indexed; + export function isOrdered(maybeOrdered: any): boolean; + export function isValueObject(maybeValue: any): maybeValue is ValueObject; + export interface ValueObject { + equals(other: any): boolean; + hashCode(): number; + } + export module List { + function isList(maybeList: any): maybeList is List; + function of(...values: Array): List; + } + export function List(): List; + export function List(): List; + export function List(collection: Iterable): List; + ~~~~~~~~ +!!! error TS2304: Cannot find name 'Iterable'. + export interface List extends Collection.Indexed { + // Persistent changes + set(index: number, value: T): List; + delete(index: number): List; + remove(index: number): List; + insert(index: number, value: T): List; + clear(): List; + push(...values: Array): List; + pop(): List; + unshift(...values: Array): List; + shift(): List; + update(index: number, notSetValue: T, updater: (value: T) => T): this; + update(index: number, updater: (value: T) => T): this; + update(updater: (value: this) => R): R; + merge(...collections: Array | Array>): this; + mergeWith(merger: (oldVal: T, newVal: T, key: number) => T, ...collections: Array | Array>): this; + mergeDeep(...collections: Array | Array>): this; + mergeDeepWith(merger: (oldVal: T, newVal: T, key: number) => T, ...collections: Array | Array>): this; + setSize(size: number): List; + // Deep persistent changes + setIn(keyPath: Iterable, value: any): this; + ~~~~~~~~ +!!! error TS2304: Cannot find name 'Iterable'. + deleteIn(keyPath: Iterable): this; + ~~~~~~~~ +!!! error TS2304: Cannot find name 'Iterable'. + removeIn(keyPath: Iterable): this; + ~~~~~~~~ +!!! error TS2304: Cannot find name 'Iterable'. + updateIn(keyPath: Iterable, notSetValue: any, updater: (value: any) => any): this; + ~~~~~~~~ +!!! error TS2304: Cannot find name 'Iterable'. + updateIn(keyPath: Iterable, updater: (value: any) => any): this; + ~~~~~~~~ +!!! error TS2304: Cannot find name 'Iterable'. + mergeIn(keyPath: Iterable, ...collections: Array): this; + ~~~~~~~~ +!!! error TS2304: Cannot find name 'Iterable'. + mergeDeepIn(keyPath: Iterable, ...collections: Array): this; + ~~~~~~~~ +!!! error TS2304: Cannot find name 'Iterable'. + // Transient changes + withMutations(mutator: (mutable: this) => any): this; + asMutable(): this; + asImmutable(): this; + // Sequence algorithms + concat(...valuesOrCollections: Array | C>): List; + ~~~~~~~~ +!!! error TS2304: Cannot find name 'Iterable'. + map(mapper: (value: T, key: number, iter: this) => M, context?: any): List; + flatMap(mapper: (value: T, key: number, iter: this) => Iterable, context?: any): List; + ~~~~~~~~ +!!! error TS2304: Cannot find name 'Iterable'. + filter(predicate: (value: T, index: number, iter: this) => value is F, context?: any): List; + filter(predicate: (value: T, index: number, iter: this) => any, context?: any): this; + } + export module Map { + function isMap(maybeMap: any): maybeMap is Map; + function of(...keyValues: Array): Map; + } + export function Map(collection: Iterable<[K, V]>): Map; + ~~~~~~~~ +!!! error TS2304: Cannot find name 'Iterable'. + export function Map(collection: Iterable>): Map; + ~~~~~~~~ +!!! error TS2304: Cannot find name 'Iterable'. + ~~~~~~~~ +!!! error TS2304: Cannot find name 'Iterable'. + export function Map(obj: {[key: string]: V}): Map; + export function Map(): Map; + export function Map(): Map; + export interface Map extends Collection.Keyed { + // Persistent changes + set(key: K, value: V): this; + delete(key: K): this; + remove(key: K): this; + deleteAll(keys: Iterable): this; + ~~~~~~~~ +!!! error TS2304: Cannot find name 'Iterable'. + removeAll(keys: Iterable): this; + ~~~~~~~~ +!!! error TS2304: Cannot find name 'Iterable'. + clear(): this; + update(key: K, notSetValue: V, updater: (value: V) => V): this; + update(key: K, updater: (value: V) => V): this; + update(updater: (value: this) => R): R; + merge(...collections: Array | {[key: string]: V}>): this; + mergeWith(merger: (oldVal: V, newVal: V, key: K) => V, ...collections: Array | {[key: string]: V}>): this; + mergeDeep(...collections: Array | {[key: string]: V}>): this; + mergeDeepWith(merger: (oldVal: V, newVal: V, key: K) => V, ...collections: Array | {[key: string]: V}>): this; + // Deep persistent changes + setIn(keyPath: Iterable, value: any): this; + ~~~~~~~~ +!!! error TS2304: Cannot find name 'Iterable'. + deleteIn(keyPath: Iterable): this; + ~~~~~~~~ +!!! error TS2304: Cannot find name 'Iterable'. + removeIn(keyPath: Iterable): this; + ~~~~~~~~ +!!! error TS2304: Cannot find name 'Iterable'. + updateIn(keyPath: Iterable, notSetValue: any, updater: (value: any) => any): this; + ~~~~~~~~ +!!! error TS2304: Cannot find name 'Iterable'. + updateIn(keyPath: Iterable, updater: (value: any) => any): this; + ~~~~~~~~ +!!! error TS2304: Cannot find name 'Iterable'. + mergeIn(keyPath: Iterable, ...collections: Array): this; + ~~~~~~~~ +!!! error TS2304: Cannot find name 'Iterable'. + mergeDeepIn(keyPath: Iterable, ...collections: Array): this; + ~~~~~~~~ +!!! error TS2304: Cannot find name 'Iterable'. + // Transient changes + withMutations(mutator: (mutable: this) => any): this; + asMutable(): this; + asImmutable(): this; + // Sequence algorithms + concat(...collections: Array>): Map; + ~~~~~~~~ +!!! error TS2304: Cannot find name 'Iterable'. + concat(...collections: Array<{[key: string]: C}>): Map; + map(mapper: (value: V, key: K, iter: this) => M, context?: any): Map; + mapKeys(mapper: (key: K, value: V, iter: this) => M, context?: any): Map; + mapEntries(mapper: (entry: [K, V], index: number, iter: this) => [KM, VM], context?: any): Map; + flatMap(mapper: (value: V, key: K, iter: this) => Iterable, context?: any): Map; + ~~~~~~~~ +!!! error TS2304: Cannot find name 'Iterable'. + filter(predicate: (value: V, key: K, iter: this) => value is F, context?: any): Map; + filter(predicate: (value: V, key: K, iter: this) => any, context?: any): this; + } + export module OrderedMap { + function isOrderedMap(maybeOrderedMap: any): maybeOrderedMap is OrderedMap; + } + export function OrderedMap(collection: Iterable<[K, V]>): OrderedMap; + ~~~~~~~~ +!!! error TS2304: Cannot find name 'Iterable'. + export function OrderedMap(collection: Iterable>): OrderedMap; + ~~~~~~~~ +!!! error TS2304: Cannot find name 'Iterable'. + ~~~~~~~~ +!!! error TS2304: Cannot find name 'Iterable'. + export function OrderedMap(obj: {[key: string]: V}): OrderedMap; + export function OrderedMap(): OrderedMap; + export function OrderedMap(): OrderedMap; + export interface OrderedMap extends Map { + // Sequence algorithms + concat(...collections: Array>): OrderedMap; + ~~~~~~~~ +!!! error TS2304: Cannot find name 'Iterable'. + concat(...collections: Array<{[key: string]: C}>): OrderedMap; + map(mapper: (value: V, key: K, iter: this) => M, context?: any): OrderedMap; + mapKeys(mapper: (key: K, value: V, iter: this) => M, context?: any): OrderedMap; + mapEntries(mapper: (entry: [K, V], index: number, iter: this) => [KM, VM], context?: any): OrderedMap; + flatMap(mapper: (value: V, key: K, iter: this) => Iterable, context?: any): OrderedMap; + ~~~~~~~~ +!!! error TS2304: Cannot find name 'Iterable'. + filter(predicate: (value: V, key: K, iter: this) => value is F, context?: any): OrderedMap; + filter(predicate: (value: V, key: K, iter: this) => any, context?: any): this; + } + export module Set { + function isSet(maybeSet: any): maybeSet is Set; + function of(...values: Array): Set; + function fromKeys(iter: Collection): Set; + function fromKeys(obj: {[key: string]: any}): Set; + function intersect(sets: Iterable>): Set; + ~~~~~~~~ +!!! error TS2304: Cannot find name 'Iterable'. + ~~~~~~~~ +!!! error TS2304: Cannot find name 'Iterable'. + function union(sets: Iterable>): Set; + ~~~~~~~~ +!!! error TS2304: Cannot find name 'Iterable'. + ~~~~~~~~ +!!! error TS2304: Cannot find name 'Iterable'. + } + export function Set(): Set; + export function Set(): Set; + export function Set(collection: Iterable): Set; + ~~~~~~~~ +!!! error TS2304: Cannot find name 'Iterable'. + export interface Set extends Collection.Set { + // Persistent changes + add(value: T): this; + delete(value: T): this; + remove(value: T): this; + clear(): this; + union(...collections: Array | Array>): this; + merge(...collections: Array | Array>): this; + intersect(...collections: Array | Array>): this; + subtract(...collections: Array | Array>): this; + // Transient changes + withMutations(mutator: (mutable: this) => any): this; + asMutable(): this; + asImmutable(): this; + // Sequence algorithms + concat(...valuesOrCollections: Array | C>): Set; + ~~~~~~~~ +!!! error TS2304: Cannot find name 'Iterable'. + map(mapper: (value: T, key: never, iter: this) => M, context?: any): Set; + flatMap(mapper: (value: T, key: never, iter: this) => Iterable, context?: any): Set; + ~~~~~~~~ +!!! error TS2304: Cannot find name 'Iterable'. + filter(predicate: (value: T, key: never, iter: this) => value is F, context?: any): Set; + filter(predicate: (value: T, key: never, iter: this) => any, context?: any): this; + } + export module OrderedSet { + function isOrderedSet(maybeOrderedSet: any): boolean; + function of(...values: Array): OrderedSet; + function fromKeys(iter: Collection): OrderedSet; + function fromKeys(obj: {[key: string]: any}): OrderedSet; + } + export function OrderedSet(): OrderedSet; + export function OrderedSet(): OrderedSet; + export function OrderedSet(collection: Iterable): OrderedSet; + ~~~~~~~~ +!!! error TS2304: Cannot find name 'Iterable'. + export interface OrderedSet extends Set { + // Sequence algorithms + concat(...valuesOrCollections: Array | C>): OrderedSet; + ~~~~~~~~ +!!! error TS2304: Cannot find name 'Iterable'. + map(mapper: (value: T, key: never, iter: this) => M, context?: any): OrderedSet; + flatMap(mapper: (value: T, key: never, iter: this) => Iterable, context?: any): OrderedSet; + ~~~~~~~~ +!!! error TS2304: Cannot find name 'Iterable'. + filter(predicate: (value: T, key: never, iter: this) => value is F, context?: any): OrderedSet; + filter(predicate: (value: T, key: never, iter: this) => any, context?: any): this; + zip(...collections: Array>): OrderedSet; + zipWith(zipper: (value: T, otherValue: U) => Z, otherCollection: Collection): OrderedSet; + zipWith(zipper: (value: T, otherValue: U, thirdValue: V) => Z, otherCollection: Collection, thirdCollection: Collection): OrderedSet; + zipWith(zipper: (...any: Array) => Z, ...collections: Array>): OrderedSet; + } + export module Stack { + function isStack(maybeStack: any): maybeStack is Stack; + function of(...values: Array): Stack; + } + export function Stack(): Stack; + export function Stack(): Stack; + export function Stack(collection: Iterable): Stack; + ~~~~~~~~ +!!! error TS2304: Cannot find name 'Iterable'. + export interface Stack extends Collection.Indexed { + // Reading values + peek(): T | undefined; + // Persistent changes + clear(): Stack; + unshift(...values: Array): Stack; + unshiftAll(iter: Iterable): Stack; + ~~~~~~~~ +!!! error TS2304: Cannot find name 'Iterable'. + shift(): Stack; + push(...values: Array): Stack; + pushAll(iter: Iterable): Stack; + ~~~~~~~~ +!!! error TS2304: Cannot find name 'Iterable'. + pop(): Stack; + // Transient changes + withMutations(mutator: (mutable: this) => any): this; + asMutable(): this; + asImmutable(): this; + // Sequence algorithms + concat(...valuesOrCollections: Array | C>): Stack; + ~~~~~~~~ +!!! error TS2304: Cannot find name 'Iterable'. + map(mapper: (value: T, key: number, iter: this) => M, context?: any): Stack; + flatMap(mapper: (value: T, key: number, iter: this) => Iterable, context?: any): Stack; + ~~~~~~~~ +!!! error TS2304: Cannot find name 'Iterable'. + filter(predicate: (value: T, index: number, iter: this) => value is F, context?: any): Set; + filter(predicate: (value: T, index: number, iter: this) => any, context?: any): this; + } + export function Range(start?: number, end?: number, step?: number): Seq.Indexed; + export function Repeat(value: T, times?: number): Seq.Indexed; + export module Record { + export function isRecord(maybeRecord: any): maybeRecord is Record.Instance; + export function getDescriptiveName(record: Instance): string; + export interface Class { + (values?: Partial | Iterable<[string, any]>): Instance & Readonly; + ~~~~~~~~ +!!! error TS2304: Cannot find name 'Iterable'. + new (values?: Partial | Iterable<[string, any]>): Instance & Readonly; + ~~~~~~~~ +!!! error TS2304: Cannot find name 'Iterable'. + } + export interface Instance { + readonly size: number; + // Reading values + has(key: string): boolean; + get(key: K): T[K]; + // Reading deep values + hasIn(keyPath: Iterable): boolean; + ~~~~~~~~ +!!! error TS2304: Cannot find name 'Iterable'. + getIn(keyPath: Iterable): any; + ~~~~~~~~ +!!! error TS2304: Cannot find name 'Iterable'. + // Value equality + equals(other: any): boolean; + hashCode(): number; + // Persistent changes + set(key: K, value: T[K]): this; + update(key: K, updater: (value: T[K]) => T[K]): this; + merge(...collections: Array | Iterable<[string, any]>>): this; + ~~~~~~~~ +!!! error TS2304: Cannot find name 'Iterable'. + mergeDeep(...collections: Array | Iterable<[string, any]>>): this; + ~~~~~~~~ +!!! error TS2304: Cannot find name 'Iterable'. + mergeWith(merger: (oldVal: any, newVal: any, key: keyof T) => any, ...collections: Array | Iterable<[string, any]>>): this; + ~~~~~~~~ +!!! error TS2304: Cannot find name 'Iterable'. + mergeDeepWith(merger: (oldVal: any, newVal: any, key: any) => any, ...collections: Array | Iterable<[string, any]>>): this; + ~~~~~~~~ +!!! error TS2304: Cannot find name 'Iterable'. + delete(key: K): this; + remove(key: K): this; + clear(): this; + // Deep persistent changes + setIn(keyPath: Iterable, value: any): this; + ~~~~~~~~ +!!! error TS2304: Cannot find name 'Iterable'. + updateIn(keyPath: Iterable, updater: (value: any) => any): this; + ~~~~~~~~ +!!! error TS2304: Cannot find name 'Iterable'. + mergeIn(keyPath: Iterable, ...collections: Array): this; + ~~~~~~~~ +!!! error TS2304: Cannot find name 'Iterable'. + mergeDeepIn(keyPath: Iterable, ...collections: Array): this; + ~~~~~~~~ +!!! error TS2304: Cannot find name 'Iterable'. + deleteIn(keyPath: Iterable): this; + ~~~~~~~~ +!!! error TS2304: Cannot find name 'Iterable'. + removeIn(keyPath: Iterable): this; + ~~~~~~~~ +!!! error TS2304: Cannot find name 'Iterable'. + // Conversion to JavaScript types + toJS(): { [K in keyof T]: any }; + toJSON(): T; + toObject(): T; + // Transient changes + withMutations(mutator: (mutable: this) => any): this; + asMutable(): this; + asImmutable(): this; + // Sequence algorithms + toSeq(): Seq.Keyed; + [Symbol.iterator](): IterableIterator<[keyof T, T[keyof T]]>; + ~~~~~~ +!!! error TS2304: Cannot find name 'Symbol'. + ~~~~~~~~~~~~~~~~ +!!! error TS2304: Cannot find name 'IterableIterator'. + } + } + export function Record(defaultValues: T, name?: string): Record.Class; + export module Seq { + function isSeq(maybeSeq: any): maybeSeq is Seq.Indexed | Seq.Keyed; + function of(...values: Array): Seq.Indexed; + export module Keyed {} + export function Keyed(collection: Iterable<[K, V]>): Seq.Keyed; + ~~~~~~~~ +!!! error TS2304: Cannot find name 'Iterable'. + export function Keyed(obj: {[key: string]: V}): Seq.Keyed; + export function Keyed(): Seq.Keyed; + export function Keyed(): Seq.Keyed; + export interface Keyed extends Seq, Collection.Keyed { + toJS(): Object; + toJSON(): { [key: string]: V }; + toSeq(): this; + concat(...collections: Array>): Seq.Keyed; + ~~~~~~~~ +!!! error TS2304: Cannot find name 'Iterable'. + concat(...collections: Array<{[key: string]: C}>): Seq.Keyed; + map(mapper: (value: V, key: K, iter: this) => M, context?: any): Seq.Keyed; + mapKeys(mapper: (key: K, value: V, iter: this) => M, context?: any): Seq.Keyed; + mapEntries(mapper: (entry: [K, V], index: number, iter: this) => [KM, VM], context?: any): Seq.Keyed; + flatMap(mapper: (value: V, key: K, iter: this) => Iterable, context?: any): Seq.Keyed; + ~~~~~~~~ +!!! error TS2304: Cannot find name 'Iterable'. + filter(predicate: (value: V, key: K, iter: this) => value is F, context?: any): Seq.Keyed; + filter(predicate: (value: V, key: K, iter: this) => any, context?: any): this; + } + module Indexed { + function of(...values: Array): Seq.Indexed; + } + export function Indexed(): Seq.Indexed; + export function Indexed(): Seq.Indexed; + export function Indexed(collection: Iterable): Seq.Indexed; + ~~~~~~~~ +!!! error TS2304: Cannot find name 'Iterable'. + export interface Indexed extends Seq, Collection.Indexed { + toJS(): Array; + toJSON(): Array; + toSeq(): this; + concat(...valuesOrCollections: Array | C>): Seq.Indexed; + ~~~~~~~~ +!!! error TS2304: Cannot find name 'Iterable'. + map(mapper: (value: T, key: number, iter: this) => M, context?: any): Seq.Indexed; + flatMap(mapper: (value: T, key: number, iter: this) => Iterable, context?: any): Seq.Indexed; + ~~~~~~~~ +!!! error TS2304: Cannot find name 'Iterable'. + filter(predicate: (value: T, index: number, iter: this) => value is F, context?: any): Seq.Indexed; + filter(predicate: (value: T, index: number, iter: this) => any, context?: any): this; + } + export module Set { + function of(...values: Array): Seq.Set; + } + export function Set(): Seq.Set; + export function Set(): Seq.Set; + export function Set(collection: Iterable): Seq.Set; + ~~~~~~~~ +!!! error TS2304: Cannot find name 'Iterable'. + export interface Set extends Seq, Collection.Set { + toJS(): Array; + toJSON(): Array; + toSeq(): this; + concat(...valuesOrCollections: Array | C>): Seq.Set; + ~~~~~~~~ +!!! error TS2304: Cannot find name 'Iterable'. + map(mapper: (value: T, key: never, iter: this) => M, context?: any): Seq.Set; + flatMap(mapper: (value: T, key: never, iter: this) => Iterable, context?: any): Seq.Set; + ~~~~~~~~ +!!! error TS2304: Cannot find name 'Iterable'. + filter(predicate: (value: T, key: never, iter: this) => value is F, context?: any): Seq.Set; + filter(predicate: (value: T, key: never, iter: this) => any, context?: any): this; + } + } + export function Seq>(seq: S): S; + export function Seq(collection: Collection.Keyed): Seq.Keyed; + export function Seq(collection: Collection.Indexed): Seq.Indexed; + export function Seq(collection: Collection.Set): Seq.Set; + export function Seq(collection: Iterable): Seq.Indexed; + ~~~~~~~~ +!!! error TS2304: Cannot find name 'Iterable'. + export function Seq(obj: {[key: string]: V}): Seq.Keyed; + export function Seq(): Seq; + export interface Seq extends Collection { + readonly size: number | undefined; + // Force evaluation + cacheResult(): this; + // Sequence algorithms + map(mapper: (value: V, key: K, iter: this) => M, context?: any): Seq; + flatMap(mapper: (value: V, key: K, iter: this) => Iterable, context?: any): Seq; + ~~~~~~~~ +!!! error TS2304: Cannot find name 'Iterable'. + filter(predicate: (value: V, key: K, iter: this) => value is F, context?: any): Seq; + filter(predicate: (value: V, key: K, iter: this) => any, context?: any): this; + } + export module Collection { + function isKeyed(maybeKeyed: any): maybeKeyed is Collection.Keyed; + function isIndexed(maybeIndexed: any): maybeIndexed is Collection.Indexed; + function isAssociative(maybeAssociative: any): maybeAssociative is Collection.Keyed | Collection.Indexed; + function isOrdered(maybeOrdered: any): boolean; + export module Keyed {} + export function Keyed(collection: Iterable<[K, V]>): Collection.Keyed; + ~~~~~~~~ +!!! error TS2304: Cannot find name 'Iterable'. + export function Keyed(obj: {[key: string]: V}): Collection.Keyed; + export interface Keyed extends Collection { + ~~~~~ +!!! error TS2430: Interface 'Keyed' incorrectly extends interface 'Collection'. +!!! error TS2430: Types of property 'toSeq' are incompatible. +!!! error TS2430: Type '() => Keyed' is not assignable to type '() => this'. +!!! error TS2430: Type 'Keyed' is not assignable to type 'this'. + toJS(): Object; + toJSON(): { [key: string]: V }; + toSeq(): Seq.Keyed; + // Sequence functions + flip(): this; + concat(...collections: Array>): Collection.Keyed; + ~~~~~~~~ +!!! error TS2304: Cannot find name 'Iterable'. + concat(...collections: Array<{[key: string]: C}>): Collection.Keyed; + map(mapper: (value: V, key: K, iter: this) => M, context?: any): Collection.Keyed; + mapKeys(mapper: (key: K, value: V, iter: this) => M, context?: any): Collection.Keyed; + mapEntries(mapper: (entry: [K, V], index: number, iter: this) => [KM, VM], context?: any): Collection.Keyed; + flatMap(mapper: (value: V, key: K, iter: this) => Iterable, context?: any): Collection.Keyed; + ~~~~~~~~ +!!! error TS2304: Cannot find name 'Iterable'. + filter(predicate: (value: V, key: K, iter: this) => value is F, context?: any): Collection.Keyed; + filter(predicate: (value: V, key: K, iter: this) => any, context?: any): this; + [Symbol.iterator](): IterableIterator<[K, V]>; + ~~~~~~ +!!! error TS2304: Cannot find name 'Symbol'. + ~~~~~~~~~~~~~~~~ +!!! error TS2304: Cannot find name 'IterableIterator'. + } + export module Indexed {} + export function Indexed(collection: Iterable): Collection.Indexed; + ~~~~~~~~ +!!! error TS2304: Cannot find name 'Iterable'. + export interface Indexed extends Collection { + ~~~~~~~ +!!! error TS2430: Interface 'Indexed' incorrectly extends interface 'Collection'. +!!! error TS2430: Types of property 'toSeq' are incompatible. +!!! error TS2430: Type '() => Indexed' is not assignable to type '() => this'. +!!! error TS2430: Type 'Indexed' is not assignable to type 'this'. + toJS(): Array; + toJSON(): Array; + // Reading values + get(index: number, notSetValue: NSV): T | NSV; + get(index: number): T | undefined; + // Conversion to Seq + toSeq(): Seq.Indexed; + fromEntrySeq(): Seq.Keyed; + // Combination + interpose(separator: T): this; + interleave(...collections: Array>): this; + splice(index: number, removeNum: number, ...values: Array): this; + zip(...collections: Array>): Collection.Indexed; + zipWith(zipper: (value: T, otherValue: U) => Z, otherCollection: Collection): Collection.Indexed; + zipWith(zipper: (value: T, otherValue: U, thirdValue: V) => Z, otherCollection: Collection, thirdCollection: Collection): Collection.Indexed; + zipWith(zipper: (...any: Array) => Z, ...collections: Array>): Collection.Indexed; + // Search for value + indexOf(searchValue: T): number; + lastIndexOf(searchValue: T): number; + findIndex(predicate: (value: T, index: number, iter: this) => boolean, context?: any): number; + findLastIndex(predicate: (value: T, index: number, iter: this) => boolean, context?: any): number; + // Sequence algorithms + concat(...valuesOrCollections: Array | C>): Collection.Indexed; + ~~~~~~~~ +!!! error TS2304: Cannot find name 'Iterable'. + map(mapper: (value: T, key: number, iter: this) => M, context?: any): Collection.Indexed; + flatMap(mapper: (value: T, key: number, iter: this) => Iterable, context?: any): Collection.Indexed; + ~~~~~~~~ +!!! error TS2304: Cannot find name 'Iterable'. + filter(predicate: (value: T, index: number, iter: this) => value is F, context?: any): Collection.Indexed; + filter(predicate: (value: T, index: number, iter: this) => any, context?: any): this; + [Symbol.iterator](): IterableIterator; + ~~~~~~ +!!! error TS2304: Cannot find name 'Symbol'. + ~~~~~~~~~~~~~~~~ +!!! error TS2304: Cannot find name 'IterableIterator'. + } + export module Set {} + export function Set(collection: Iterable): Collection.Set; + ~~~~~~~~ +!!! error TS2304: Cannot find name 'Iterable'. + export interface Set extends Collection { + ~~~ +!!! error TS2430: Interface 'Set' incorrectly extends interface 'Collection'. +!!! error TS2430: Types of property 'toSeq' are incompatible. +!!! error TS2430: Type '() => Set' is not assignable to type '() => this'. +!!! error TS2430: Type 'Set' is not assignable to type 'this'. + toJS(): Array; + toJSON(): Array; + toSeq(): Seq.Set; + // Sequence algorithms + concat(...valuesOrCollections: Array | C>): Collection.Set; + ~~~~~~~~ +!!! error TS2304: Cannot find name 'Iterable'. + map(mapper: (value: T, key: never, iter: this) => M, context?: any): Collection.Set; + flatMap(mapper: (value: T, key: never, iter: this) => Iterable, context?: any): Collection.Set; + ~~~~~~~~ +!!! error TS2304: Cannot find name 'Iterable'. + filter(predicate: (value: T, key: never, iter: this) => value is F, context?: any): Collection.Set; + filter(predicate: (value: T, key: never, iter: this) => any, context?: any): this; + [Symbol.iterator](): IterableIterator; + ~~~~~~ +!!! error TS2304: Cannot find name 'Symbol'. + ~~~~~~~~~~~~~~~~ +!!! error TS2304: Cannot find name 'IterableIterator'. + } + } + export function Collection>(collection: I): I; + export function Collection(collection: Iterable): Collection.Indexed; + ~~~~~~~~ +!!! error TS2304: Cannot find name 'Iterable'. + export function Collection(obj: {[key: string]: V}): Collection.Keyed; + export interface Collection extends ValueObject { + // Value equality + equals(other: any): boolean; + hashCode(): number; + // Reading values + get(key: K, notSetValue: NSV): V | NSV; + get(key: K): V | undefined; + has(key: K): boolean; + includes(value: V): boolean; + contains(value: V): boolean; + first(): V | undefined; + last(): V | undefined; + // Reading deep values + getIn(searchKeyPath: Iterable, notSetValue?: any): any; + ~~~~~~~~ +!!! error TS2304: Cannot find name 'Iterable'. + hasIn(searchKeyPath: Iterable): boolean; + ~~~~~~~~ +!!! error TS2304: Cannot find name 'Iterable'. + // Persistent changes + update(updater: (value: this) => R): R; + // Conversion to JavaScript types + toJS(): Array | { [key: string]: any }; + toJSON(): Array | { [key: string]: V }; + toArray(): Array; + toObject(): { [key: string]: V }; + // Conversion to Collections + toMap(): Map; + toOrderedMap(): OrderedMap; + toSet(): Set; + toOrderedSet(): OrderedSet; + toList(): List; + toStack(): Stack; + // Conversion to Seq + toSeq(): this; + toKeyedSeq(): Seq.Keyed; + toIndexedSeq(): Seq.Indexed; + toSetSeq(): Seq.Set; + // Iterators + keys(): IterableIterator; + ~~~~~~~~~~~~~~~~ +!!! error TS2304: Cannot find name 'IterableIterator'. + values(): IterableIterator; + ~~~~~~~~~~~~~~~~ +!!! error TS2304: Cannot find name 'IterableIterator'. + entries(): IterableIterator<[K, V]>; + ~~~~~~~~~~~~~~~~ +!!! error TS2304: Cannot find name 'IterableIterator'. + // Collections (Seq) + keySeq(): Seq.Indexed; + valueSeq(): Seq.Indexed; + entrySeq(): Seq.Indexed<[K, V]>; + // Sequence algorithms + map(mapper: (value: V, key: K, iter: this) => M, context?: any): Collection; + filter(predicate: (value: V, key: K, iter: this) => value is F, context?: any): Collection; + filter(predicate: (value: V, key: K, iter: this) => any, context?: any): this; + filterNot(predicate: (value: V, key: K, iter: this) => boolean, context?: any): this; + reverse(): this; + sort(comparator?: (valueA: V, valueB: V) => number): this; + sortBy(comparatorValueMapper: (value: V, key: K, iter: this) => C, comparator?: (valueA: C, valueB: C) => number): this; + groupBy(grouper: (value: V, key: K, iter: this) => G, context?: any): /*Map*/Seq.Keyed>; + // Side effects + forEach(sideEffect: (value: V, key: K, iter: this) => any, context?: any): number; + // Creating subsets + slice(begin?: number, end?: number): this; + rest(): this; + butLast(): this; + skip(amount: number): this; + skipLast(amount: number): this; + skipWhile(predicate: (value: V, key: K, iter: this) => boolean, context?: any): this; + skipUntil(predicate: (value: V, key: K, iter: this) => boolean, context?: any): this; + take(amount: number): this; + takeLast(amount: number): this; + takeWhile(predicate: (value: V, key: K, iter: this) => boolean, context?: any): this; + takeUntil(predicate: (value: V, key: K, iter: this) => boolean, context?: any): this; + // Combination + concat(...valuesOrCollections: Array): Collection; + flatten(depth?: number): Collection; + flatten(shallow?: boolean): Collection; + flatMap(mapper: (value: V, key: K, iter: this) => Iterable, context?: any): Collection; + ~~~~~~~~ +!!! error TS2304: Cannot find name 'Iterable'. + // Reducing a value + reduce(reducer: (reduction: R, value: V, key: K, iter: this) => R, initialReduction: R, context?: any): R; + reduce(reducer: (reduction: V | R, value: V, key: K, iter: this) => R): R; + reduceRight(reducer: (reduction: R, value: V, key: K, iter: this) => R, initialReduction: R, context?: any): R; + reduceRight(reducer: (reduction: V | R, value: V, key: K, iter: this) => R): R; + every(predicate: (value: V, key: K, iter: this) => boolean, context?: any): boolean; + some(predicate: (value: V, key: K, iter: this) => boolean, context?: any): boolean; + join(separator?: string): string; + isEmpty(): boolean; + count(): number; + count(predicate: (value: V, key: K, iter: this) => boolean, context?: any): number; + countBy(grouper: (value: V, key: K, iter: this) => G, context?: any): Map; + // Search for value + find(predicate: (value: V, key: K, iter: this) => boolean, context?: any, notSetValue?: V): V | undefined; + findLast(predicate: (value: V, key: K, iter: this) => boolean, context?: any, notSetValue?: V): V | undefined; + findEntry(predicate: (value: V, key: K, iter: this) => boolean, context?: any, notSetValue?: V): [K, V] | undefined; + findLastEntry(predicate: (value: V, key: K, iter: this) => boolean, context?: any, notSetValue?: V): [K, V] | undefined; + findKey(predicate: (value: V, key: K, iter: this) => boolean, context?: any): K | undefined; + findLastKey(predicate: (value: V, key: K, iter: this) => boolean, context?: any): K | undefined; + keyOf(searchValue: V): K | undefined; + lastKeyOf(searchValue: V): K | undefined; + max(comparator?: (valueA: V, valueB: V) => number): V | undefined; + maxBy(comparatorValueMapper: (value: V, key: K, iter: this) => C, comparator?: (valueA: C, valueB: C) => number): V | undefined; + min(comparator?: (valueA: V, valueB: V) => number): V | undefined; + minBy(comparatorValueMapper: (value: V, key: K, iter: this) => C, comparator?: (valueA: C, valueB: C) => number): V | undefined; + // Comparison + isSubset(iter: Iterable): boolean; + ~~~~~~~~ +!!! error TS2304: Cannot find name 'Iterable'. + isSuperset(iter: Iterable): boolean; + ~~~~~~~~ +!!! error TS2304: Cannot find name 'Iterable'. + readonly size: number; + } + } + declare module "immutable" { + export = Immutable + } + \ No newline at end of file diff --git a/tests/cases/compiler/complexRecursiveCollections.ts b/tests/cases/compiler/complexRecursiveCollections.ts new file mode 100644 index 0000000000000..a79b429f20435 --- /dev/null +++ b/tests/cases/compiler/complexRecursiveCollections.ts @@ -0,0 +1,532 @@ +// @Filename: complex.d.ts +interface Ara { t: T } +interface Collection { + map(mapper: (value: V, key: K, iter: this) => M): Collection; + flatMap(mapper: (value: V, key: K, iter: this) => Ara, context?: any): Collection; + // these seem necessary to push it over the top for memory usage + reduce(reducer: (reduction: R, value: V, key: K, iter: this) => R, initialReduction: R, context?: any): R; + reduce(reducer: (reduction: V | R, value: V, key: K, iter: this) => R): R; + toSeq(): Seq; +} +interface Seq extends Collection { +} +interface N1 extends Collection { + map(mapper: (value: T, key: void, iter: this) => M): N1; + flatMap(mapper: (value: T, key: void, iter: this) => Ara, context?: any): N1; +} +interface N2 extends N1 { + map(mapper: (value: T, key: void, iter: this) => M): N2; + flatMap(mapper: (value: T, key: void, iter: this) => Ara, context?: any): N2; + toSeq(): N2; +} +// @Filename: immutable.d.ts +// Test that complex recursive collections can pass the `extends` assignability check without +// running out of memory. This bug was exposed in Typescript 2.4 when more generic signatures +// started being checked. +declare module Immutable { + export function fromJS(jsValue: any, reviver?: (key: string | number, sequence: Collection.Keyed | Collection.Indexed, path?: Array) => any): any; + export function is(first: any, second: any): boolean; + export function hash(value: any): number; + export function isImmutable(maybeImmutable: any): maybeImmutable is Collection; + export function isCollection(maybeCollection: any): maybeCollection is Collection; + export function isKeyed(maybeKeyed: any): maybeKeyed is Collection.Keyed; + export function isIndexed(maybeIndexed: any): maybeIndexed is Collection.Indexed; + export function isAssociative(maybeAssociative: any): maybeAssociative is Collection.Keyed | Collection.Indexed; + export function isOrdered(maybeOrdered: any): boolean; + export function isValueObject(maybeValue: any): maybeValue is ValueObject; + export interface ValueObject { + equals(other: any): boolean; + hashCode(): number; + } + export module List { + function isList(maybeList: any): maybeList is List; + function of(...values: Array): List; + } + export function List(): List; + export function List(): List; + export function List(collection: Iterable): List; + export interface List extends Collection.Indexed { + // Persistent changes + set(index: number, value: T): List; + delete(index: number): List; + remove(index: number): List; + insert(index: number, value: T): List; + clear(): List; + push(...values: Array): List; + pop(): List; + unshift(...values: Array): List; + shift(): List; + update(index: number, notSetValue: T, updater: (value: T) => T): this; + update(index: number, updater: (value: T) => T): this; + update(updater: (value: this) => R): R; + merge(...collections: Array | Array>): this; + mergeWith(merger: (oldVal: T, newVal: T, key: number) => T, ...collections: Array | Array>): this; + mergeDeep(...collections: Array | Array>): this; + mergeDeepWith(merger: (oldVal: T, newVal: T, key: number) => T, ...collections: Array | Array>): this; + setSize(size: number): List; + // Deep persistent changes + setIn(keyPath: Iterable, value: any): this; + deleteIn(keyPath: Iterable): this; + removeIn(keyPath: Iterable): this; + updateIn(keyPath: Iterable, notSetValue: any, updater: (value: any) => any): this; + updateIn(keyPath: Iterable, updater: (value: any) => any): this; + mergeIn(keyPath: Iterable, ...collections: Array): this; + mergeDeepIn(keyPath: Iterable, ...collections: Array): this; + // Transient changes + withMutations(mutator: (mutable: this) => any): this; + asMutable(): this; + asImmutable(): this; + // Sequence algorithms + concat(...valuesOrCollections: Array | C>): List; + map(mapper: (value: T, key: number, iter: this) => M, context?: any): List; + flatMap(mapper: (value: T, key: number, iter: this) => Iterable, context?: any): List; + filter(predicate: (value: T, index: number, iter: this) => value is F, context?: any): List; + filter(predicate: (value: T, index: number, iter: this) => any, context?: any): this; + } + export module Map { + function isMap(maybeMap: any): maybeMap is Map; + function of(...keyValues: Array): Map; + } + export function Map(collection: Iterable<[K, V]>): Map; + export function Map(collection: Iterable>): Map; + export function Map(obj: {[key: string]: V}): Map; + export function Map(): Map; + export function Map(): Map; + export interface Map extends Collection.Keyed { + // Persistent changes + set(key: K, value: V): this; + delete(key: K): this; + remove(key: K): this; + deleteAll(keys: Iterable): this; + removeAll(keys: Iterable): this; + clear(): this; + update(key: K, notSetValue: V, updater: (value: V) => V): this; + update(key: K, updater: (value: V) => V): this; + update(updater: (value: this) => R): R; + merge(...collections: Array | {[key: string]: V}>): this; + mergeWith(merger: (oldVal: V, newVal: V, key: K) => V, ...collections: Array | {[key: string]: V}>): this; + mergeDeep(...collections: Array | {[key: string]: V}>): this; + mergeDeepWith(merger: (oldVal: V, newVal: V, key: K) => V, ...collections: Array | {[key: string]: V}>): this; + // Deep persistent changes + setIn(keyPath: Iterable, value: any): this; + deleteIn(keyPath: Iterable): this; + removeIn(keyPath: Iterable): this; + updateIn(keyPath: Iterable, notSetValue: any, updater: (value: any) => any): this; + updateIn(keyPath: Iterable, updater: (value: any) => any): this; + mergeIn(keyPath: Iterable, ...collections: Array): this; + mergeDeepIn(keyPath: Iterable, ...collections: Array): this; + // Transient changes + withMutations(mutator: (mutable: this) => any): this; + asMutable(): this; + asImmutable(): this; + // Sequence algorithms + concat(...collections: Array>): Map; + concat(...collections: Array<{[key: string]: C}>): Map; + map(mapper: (value: V, key: K, iter: this) => M, context?: any): Map; + mapKeys(mapper: (key: K, value: V, iter: this) => M, context?: any): Map; + mapEntries(mapper: (entry: [K, V], index: number, iter: this) => [KM, VM], context?: any): Map; + flatMap(mapper: (value: V, key: K, iter: this) => Iterable, context?: any): Map; + filter(predicate: (value: V, key: K, iter: this) => value is F, context?: any): Map; + filter(predicate: (value: V, key: K, iter: this) => any, context?: any): this; + } + export module OrderedMap { + function isOrderedMap(maybeOrderedMap: any): maybeOrderedMap is OrderedMap; + } + export function OrderedMap(collection: Iterable<[K, V]>): OrderedMap; + export function OrderedMap(collection: Iterable>): OrderedMap; + export function OrderedMap(obj: {[key: string]: V}): OrderedMap; + export function OrderedMap(): OrderedMap; + export function OrderedMap(): OrderedMap; + export interface OrderedMap extends Map { + // Sequence algorithms + concat(...collections: Array>): OrderedMap; + concat(...collections: Array<{[key: string]: C}>): OrderedMap; + map(mapper: (value: V, key: K, iter: this) => M, context?: any): OrderedMap; + mapKeys(mapper: (key: K, value: V, iter: this) => M, context?: any): OrderedMap; + mapEntries(mapper: (entry: [K, V], index: number, iter: this) => [KM, VM], context?: any): OrderedMap; + flatMap(mapper: (value: V, key: K, iter: this) => Iterable, context?: any): OrderedMap; + filter(predicate: (value: V, key: K, iter: this) => value is F, context?: any): OrderedMap; + filter(predicate: (value: V, key: K, iter: this) => any, context?: any): this; + } + export module Set { + function isSet(maybeSet: any): maybeSet is Set; + function of(...values: Array): Set; + function fromKeys(iter: Collection): Set; + function fromKeys(obj: {[key: string]: any}): Set; + function intersect(sets: Iterable>): Set; + function union(sets: Iterable>): Set; + } + export function Set(): Set; + export function Set(): Set; + export function Set(collection: Iterable): Set; + export interface Set extends Collection.Set { + // Persistent changes + add(value: T): this; + delete(value: T): this; + remove(value: T): this; + clear(): this; + union(...collections: Array | Array>): this; + merge(...collections: Array | Array>): this; + intersect(...collections: Array | Array>): this; + subtract(...collections: Array | Array>): this; + // Transient changes + withMutations(mutator: (mutable: this) => any): this; + asMutable(): this; + asImmutable(): this; + // Sequence algorithms + concat(...valuesOrCollections: Array | C>): Set; + map(mapper: (value: T, key: never, iter: this) => M, context?: any): Set; + flatMap(mapper: (value: T, key: never, iter: this) => Iterable, context?: any): Set; + filter(predicate: (value: T, key: never, iter: this) => value is F, context?: any): Set; + filter(predicate: (value: T, key: never, iter: this) => any, context?: any): this; + } + export module OrderedSet { + function isOrderedSet(maybeOrderedSet: any): boolean; + function of(...values: Array): OrderedSet; + function fromKeys(iter: Collection): OrderedSet; + function fromKeys(obj: {[key: string]: any}): OrderedSet; + } + export function OrderedSet(): OrderedSet; + export function OrderedSet(): OrderedSet; + export function OrderedSet(collection: Iterable): OrderedSet; + export interface OrderedSet extends Set { + // Sequence algorithms + concat(...valuesOrCollections: Array | C>): OrderedSet; + map(mapper: (value: T, key: never, iter: this) => M, context?: any): OrderedSet; + flatMap(mapper: (value: T, key: never, iter: this) => Iterable, context?: any): OrderedSet; + filter(predicate: (value: T, key: never, iter: this) => value is F, context?: any): OrderedSet; + filter(predicate: (value: T, key: never, iter: this) => any, context?: any): this; + zip(...collections: Array>): OrderedSet; + zipWith(zipper: (value: T, otherValue: U) => Z, otherCollection: Collection): OrderedSet; + zipWith(zipper: (value: T, otherValue: U, thirdValue: V) => Z, otherCollection: Collection, thirdCollection: Collection): OrderedSet; + zipWith(zipper: (...any: Array) => Z, ...collections: Array>): OrderedSet; + } + export module Stack { + function isStack(maybeStack: any): maybeStack is Stack; + function of(...values: Array): Stack; + } + export function Stack(): Stack; + export function Stack(): Stack; + export function Stack(collection: Iterable): Stack; + export interface Stack extends Collection.Indexed { + // Reading values + peek(): T | undefined; + // Persistent changes + clear(): Stack; + unshift(...values: Array): Stack; + unshiftAll(iter: Iterable): Stack; + shift(): Stack; + push(...values: Array): Stack; + pushAll(iter: Iterable): Stack; + pop(): Stack; + // Transient changes + withMutations(mutator: (mutable: this) => any): this; + asMutable(): this; + asImmutable(): this; + // Sequence algorithms + concat(...valuesOrCollections: Array | C>): Stack; + map(mapper: (value: T, key: number, iter: this) => M, context?: any): Stack; + flatMap(mapper: (value: T, key: number, iter: this) => Iterable, context?: any): Stack; + filter(predicate: (value: T, index: number, iter: this) => value is F, context?: any): Set; + filter(predicate: (value: T, index: number, iter: this) => any, context?: any): this; + } + export function Range(start?: number, end?: number, step?: number): Seq.Indexed; + export function Repeat(value: T, times?: number): Seq.Indexed; + export module Record { + export function isRecord(maybeRecord: any): maybeRecord is Record.Instance; + export function getDescriptiveName(record: Instance): string; + export interface Class { + (values?: Partial | Iterable<[string, any]>): Instance & Readonly; + new (values?: Partial | Iterable<[string, any]>): Instance & Readonly; + } + export interface Instance { + readonly size: number; + // Reading values + has(key: string): boolean; + get(key: K): T[K]; + // Reading deep values + hasIn(keyPath: Iterable): boolean; + getIn(keyPath: Iterable): any; + // Value equality + equals(other: any): boolean; + hashCode(): number; + // Persistent changes + set(key: K, value: T[K]): this; + update(key: K, updater: (value: T[K]) => T[K]): this; + merge(...collections: Array | Iterable<[string, any]>>): this; + mergeDeep(...collections: Array | Iterable<[string, any]>>): this; + mergeWith(merger: (oldVal: any, newVal: any, key: keyof T) => any, ...collections: Array | Iterable<[string, any]>>): this; + mergeDeepWith(merger: (oldVal: any, newVal: any, key: any) => any, ...collections: Array | Iterable<[string, any]>>): this; + delete(key: K): this; + remove(key: K): this; + clear(): this; + // Deep persistent changes + setIn(keyPath: Iterable, value: any): this; + updateIn(keyPath: Iterable, updater: (value: any) => any): this; + mergeIn(keyPath: Iterable, ...collections: Array): this; + mergeDeepIn(keyPath: Iterable, ...collections: Array): this; + deleteIn(keyPath: Iterable): this; + removeIn(keyPath: Iterable): this; + // Conversion to JavaScript types + toJS(): { [K in keyof T]: any }; + toJSON(): T; + toObject(): T; + // Transient changes + withMutations(mutator: (mutable: this) => any): this; + asMutable(): this; + asImmutable(): this; + // Sequence algorithms + toSeq(): Seq.Keyed; + [Symbol.iterator](): IterableIterator<[keyof T, T[keyof T]]>; + } + } + export function Record(defaultValues: T, name?: string): Record.Class; + export module Seq { + function isSeq(maybeSeq: any): maybeSeq is Seq.Indexed | Seq.Keyed; + function of(...values: Array): Seq.Indexed; + export module Keyed {} + export function Keyed(collection: Iterable<[K, V]>): Seq.Keyed; + export function Keyed(obj: {[key: string]: V}): Seq.Keyed; + export function Keyed(): Seq.Keyed; + export function Keyed(): Seq.Keyed; + export interface Keyed extends Seq, Collection.Keyed { + toJS(): Object; + toJSON(): { [key: string]: V }; + toSeq(): this; + concat(...collections: Array>): Seq.Keyed; + concat(...collections: Array<{[key: string]: C}>): Seq.Keyed; + map(mapper: (value: V, key: K, iter: this) => M, context?: any): Seq.Keyed; + mapKeys(mapper: (key: K, value: V, iter: this) => M, context?: any): Seq.Keyed; + mapEntries(mapper: (entry: [K, V], index: number, iter: this) => [KM, VM], context?: any): Seq.Keyed; + flatMap(mapper: (value: V, key: K, iter: this) => Iterable, context?: any): Seq.Keyed; + filter(predicate: (value: V, key: K, iter: this) => value is F, context?: any): Seq.Keyed; + filter(predicate: (value: V, key: K, iter: this) => any, context?: any): this; + } + module Indexed { + function of(...values: Array): Seq.Indexed; + } + export function Indexed(): Seq.Indexed; + export function Indexed(): Seq.Indexed; + export function Indexed(collection: Iterable): Seq.Indexed; + export interface Indexed extends Seq, Collection.Indexed { + toJS(): Array; + toJSON(): Array; + toSeq(): this; + concat(...valuesOrCollections: Array | C>): Seq.Indexed; + map(mapper: (value: T, key: number, iter: this) => M, context?: any): Seq.Indexed; + flatMap(mapper: (value: T, key: number, iter: this) => Iterable, context?: any): Seq.Indexed; + filter(predicate: (value: T, index: number, iter: this) => value is F, context?: any): Seq.Indexed; + filter(predicate: (value: T, index: number, iter: this) => any, context?: any): this; + } + export module Set { + function of(...values: Array): Seq.Set; + } + export function Set(): Seq.Set; + export function Set(): Seq.Set; + export function Set(collection: Iterable): Seq.Set; + export interface Set extends Seq, Collection.Set { + toJS(): Array; + toJSON(): Array; + toSeq(): this; + concat(...valuesOrCollections: Array | C>): Seq.Set; + map(mapper: (value: T, key: never, iter: this) => M, context?: any): Seq.Set; + flatMap(mapper: (value: T, key: never, iter: this) => Iterable, context?: any): Seq.Set; + filter(predicate: (value: T, key: never, iter: this) => value is F, context?: any): Seq.Set; + filter(predicate: (value: T, key: never, iter: this) => any, context?: any): this; + } + } + export function Seq>(seq: S): S; + export function Seq(collection: Collection.Keyed): Seq.Keyed; + export function Seq(collection: Collection.Indexed): Seq.Indexed; + export function Seq(collection: Collection.Set): Seq.Set; + export function Seq(collection: Iterable): Seq.Indexed; + export function Seq(obj: {[key: string]: V}): Seq.Keyed; + export function Seq(): Seq; + export interface Seq extends Collection { + readonly size: number | undefined; + // Force evaluation + cacheResult(): this; + // Sequence algorithms + map(mapper: (value: V, key: K, iter: this) => M, context?: any): Seq; + flatMap(mapper: (value: V, key: K, iter: this) => Iterable, context?: any): Seq; + filter(predicate: (value: V, key: K, iter: this) => value is F, context?: any): Seq; + filter(predicate: (value: V, key: K, iter: this) => any, context?: any): this; + } + export module Collection { + function isKeyed(maybeKeyed: any): maybeKeyed is Collection.Keyed; + function isIndexed(maybeIndexed: any): maybeIndexed is Collection.Indexed; + function isAssociative(maybeAssociative: any): maybeAssociative is Collection.Keyed | Collection.Indexed; + function isOrdered(maybeOrdered: any): boolean; + export module Keyed {} + export function Keyed(collection: Iterable<[K, V]>): Collection.Keyed; + export function Keyed(obj: {[key: string]: V}): Collection.Keyed; + export interface Keyed extends Collection { + toJS(): Object; + toJSON(): { [key: string]: V }; + toSeq(): Seq.Keyed; + // Sequence functions + flip(): this; + concat(...collections: Array>): Collection.Keyed; + concat(...collections: Array<{[key: string]: C}>): Collection.Keyed; + map(mapper: (value: V, key: K, iter: this) => M, context?: any): Collection.Keyed; + mapKeys(mapper: (key: K, value: V, iter: this) => M, context?: any): Collection.Keyed; + mapEntries(mapper: (entry: [K, V], index: number, iter: this) => [KM, VM], context?: any): Collection.Keyed; + flatMap(mapper: (value: V, key: K, iter: this) => Iterable, context?: any): Collection.Keyed; + filter(predicate: (value: V, key: K, iter: this) => value is F, context?: any): Collection.Keyed; + filter(predicate: (value: V, key: K, iter: this) => any, context?: any): this; + [Symbol.iterator](): IterableIterator<[K, V]>; + } + export module Indexed {} + export function Indexed(collection: Iterable): Collection.Indexed; + export interface Indexed extends Collection { + toJS(): Array; + toJSON(): Array; + // Reading values + get(index: number, notSetValue: NSV): T | NSV; + get(index: number): T | undefined; + // Conversion to Seq + toSeq(): Seq.Indexed; + fromEntrySeq(): Seq.Keyed; + // Combination + interpose(separator: T): this; + interleave(...collections: Array>): this; + splice(index: number, removeNum: number, ...values: Array): this; + zip(...collections: Array>): Collection.Indexed; + zipWith(zipper: (value: T, otherValue: U) => Z, otherCollection: Collection): Collection.Indexed; + zipWith(zipper: (value: T, otherValue: U, thirdValue: V) => Z, otherCollection: Collection, thirdCollection: Collection): Collection.Indexed; + zipWith(zipper: (...any: Array) => Z, ...collections: Array>): Collection.Indexed; + // Search for value + indexOf(searchValue: T): number; + lastIndexOf(searchValue: T): number; + findIndex(predicate: (value: T, index: number, iter: this) => boolean, context?: any): number; + findLastIndex(predicate: (value: T, index: number, iter: this) => boolean, context?: any): number; + // Sequence algorithms + concat(...valuesOrCollections: Array | C>): Collection.Indexed; + map(mapper: (value: T, key: number, iter: this) => M, context?: any): Collection.Indexed; + flatMap(mapper: (value: T, key: number, iter: this) => Iterable, context?: any): Collection.Indexed; + filter(predicate: (value: T, index: number, iter: this) => value is F, context?: any): Collection.Indexed; + filter(predicate: (value: T, index: number, iter: this) => any, context?: any): this; + [Symbol.iterator](): IterableIterator; + } + export module Set {} + export function Set(collection: Iterable): Collection.Set; + export interface Set extends Collection { + toJS(): Array; + toJSON(): Array; + toSeq(): Seq.Set; + // Sequence algorithms + concat(...valuesOrCollections: Array | C>): Collection.Set; + map(mapper: (value: T, key: never, iter: this) => M, context?: any): Collection.Set; + flatMap(mapper: (value: T, key: never, iter: this) => Iterable, context?: any): Collection.Set; + filter(predicate: (value: T, key: never, iter: this) => value is F, context?: any): Collection.Set; + filter(predicate: (value: T, key: never, iter: this) => any, context?: any): this; + [Symbol.iterator](): IterableIterator; + } + } + export function Collection>(collection: I): I; + export function Collection(collection: Iterable): Collection.Indexed; + export function Collection(obj: {[key: string]: V}): Collection.Keyed; + export interface Collection extends ValueObject { + // Value equality + equals(other: any): boolean; + hashCode(): number; + // Reading values + get(key: K, notSetValue: NSV): V | NSV; + get(key: K): V | undefined; + has(key: K): boolean; + includes(value: V): boolean; + contains(value: V): boolean; + first(): V | undefined; + last(): V | undefined; + // Reading deep values + getIn(searchKeyPath: Iterable, notSetValue?: any): any; + hasIn(searchKeyPath: Iterable): boolean; + // Persistent changes + update(updater: (value: this) => R): R; + // Conversion to JavaScript types + toJS(): Array | { [key: string]: any }; + toJSON(): Array | { [key: string]: V }; + toArray(): Array; + toObject(): { [key: string]: V }; + // Conversion to Collections + toMap(): Map; + toOrderedMap(): OrderedMap; + toSet(): Set; + toOrderedSet(): OrderedSet; + toList(): List; + toStack(): Stack; + // Conversion to Seq + toSeq(): this; + toKeyedSeq(): Seq.Keyed; + toIndexedSeq(): Seq.Indexed; + toSetSeq(): Seq.Set; + // Iterators + keys(): IterableIterator; + values(): IterableIterator; + entries(): IterableIterator<[K, V]>; + // Collections (Seq) + keySeq(): Seq.Indexed; + valueSeq(): Seq.Indexed; + entrySeq(): Seq.Indexed<[K, V]>; + // Sequence algorithms + map(mapper: (value: V, key: K, iter: this) => M, context?: any): Collection; + filter(predicate: (value: V, key: K, iter: this) => value is F, context?: any): Collection; + filter(predicate: (value: V, key: K, iter: this) => any, context?: any): this; + filterNot(predicate: (value: V, key: K, iter: this) => boolean, context?: any): this; + reverse(): this; + sort(comparator?: (valueA: V, valueB: V) => number): this; + sortBy(comparatorValueMapper: (value: V, key: K, iter: this) => C, comparator?: (valueA: C, valueB: C) => number): this; + groupBy(grouper: (value: V, key: K, iter: this) => G, context?: any): /*Map*/Seq.Keyed>; + // Side effects + forEach(sideEffect: (value: V, key: K, iter: this) => any, context?: any): number; + // Creating subsets + slice(begin?: number, end?: number): this; + rest(): this; + butLast(): this; + skip(amount: number): this; + skipLast(amount: number): this; + skipWhile(predicate: (value: V, key: K, iter: this) => boolean, context?: any): this; + skipUntil(predicate: (value: V, key: K, iter: this) => boolean, context?: any): this; + take(amount: number): this; + takeLast(amount: number): this; + takeWhile(predicate: (value: V, key: K, iter: this) => boolean, context?: any): this; + takeUntil(predicate: (value: V, key: K, iter: this) => boolean, context?: any): this; + // Combination + concat(...valuesOrCollections: Array): Collection; + flatten(depth?: number): Collection; + flatten(shallow?: boolean): Collection; + flatMap(mapper: (value: V, key: K, iter: this) => Iterable, context?: any): Collection; + // Reducing a value + reduce(reducer: (reduction: R, value: V, key: K, iter: this) => R, initialReduction: R, context?: any): R; + reduce(reducer: (reduction: V | R, value: V, key: K, iter: this) => R): R; + reduceRight(reducer: (reduction: R, value: V, key: K, iter: this) => R, initialReduction: R, context?: any): R; + reduceRight(reducer: (reduction: V | R, value: V, key: K, iter: this) => R): R; + every(predicate: (value: V, key: K, iter: this) => boolean, context?: any): boolean; + some(predicate: (value: V, key: K, iter: this) => boolean, context?: any): boolean; + join(separator?: string): string; + isEmpty(): boolean; + count(): number; + count(predicate: (value: V, key: K, iter: this) => boolean, context?: any): number; + countBy(grouper: (value: V, key: K, iter: this) => G, context?: any): Map; + // Search for value + find(predicate: (value: V, key: K, iter: this) => boolean, context?: any, notSetValue?: V): V | undefined; + findLast(predicate: (value: V, key: K, iter: this) => boolean, context?: any, notSetValue?: V): V | undefined; + findEntry(predicate: (value: V, key: K, iter: this) => boolean, context?: any, notSetValue?: V): [K, V] | undefined; + findLastEntry(predicate: (value: V, key: K, iter: this) => boolean, context?: any, notSetValue?: V): [K, V] | undefined; + findKey(predicate: (value: V, key: K, iter: this) => boolean, context?: any): K | undefined; + findLastKey(predicate: (value: V, key: K, iter: this) => boolean, context?: any): K | undefined; + keyOf(searchValue: V): K | undefined; + lastKeyOf(searchValue: V): K | undefined; + max(comparator?: (valueA: V, valueB: V) => number): V | undefined; + maxBy(comparatorValueMapper: (value: V, key: K, iter: this) => C, comparator?: (valueA: C, valueB: C) => number): V | undefined; + min(comparator?: (valueA: V, valueB: V) => number): V | undefined; + minBy(comparatorValueMapper: (value: V, key: K, iter: this) => C, comparator?: (valueA: C, valueB: C) => number): V | undefined; + // Comparison + isSubset(iter: Iterable): boolean; + isSuperset(iter: Iterable): boolean; + readonly size: number; + } +} +declare module "immutable" { + export = Immutable +} From 7a9491384c24f02757d23751da16bf647abd8b49 Mon Sep 17 00:00:00 2001 From: Nathan Shively-Sanders Date: Wed, 23 Aug 2017 11:49:24 -0700 Subject: [PATCH 217/237] Update baselines --- .../reference/typeParameterAssignmentCompat1.errors.txt | 6 ------ 1 file changed, 6 deletions(-) diff --git a/tests/baselines/reference/typeParameterAssignmentCompat1.errors.txt b/tests/baselines/reference/typeParameterAssignmentCompat1.errors.txt index 9665ef017c02e..2ca4299c7f8d6 100644 --- a/tests/baselines/reference/typeParameterAssignmentCompat1.errors.txt +++ b/tests/baselines/reference/typeParameterAssignmentCompat1.errors.txt @@ -1,11 +1,8 @@ tests/cases/compiler/typeParameterAssignmentCompat1.ts(8,5): error TS2322: Type 'Foo' is not assignable to type 'Foo'. Type 'U' is not assignable to type 'T'. tests/cases/compiler/typeParameterAssignmentCompat1.ts(9,5): error TS2322: Type 'Foo' is not assignable to type 'Foo'. - Type 'T' is not assignable to type 'U'. tests/cases/compiler/typeParameterAssignmentCompat1.ts(16,9): error TS2322: Type 'Foo' is not assignable to type 'Foo'. - Type 'U' is not assignable to type 'T'. tests/cases/compiler/typeParameterAssignmentCompat1.ts(17,9): error TS2322: Type 'Foo' is not assignable to type 'Foo'. - Type 'T' is not assignable to type 'U'. ==== tests/cases/compiler/typeParameterAssignmentCompat1.ts (4 errors) ==== @@ -23,7 +20,6 @@ tests/cases/compiler/typeParameterAssignmentCompat1.ts(17,9): error TS2322: Type return x; ~~~~~~~~~ !!! error TS2322: Type 'Foo' is not assignable to type 'Foo'. -!!! error TS2322: Type 'T' is not assignable to type 'U'. } class C { @@ -33,10 +29,8 @@ tests/cases/compiler/typeParameterAssignmentCompat1.ts(17,9): error TS2322: Type x = y; // should be an error ~ !!! error TS2322: Type 'Foo' is not assignable to type 'Foo'. -!!! error TS2322: Type 'U' is not assignable to type 'T'. return x; ~~~~~~~~~ !!! error TS2322: Type 'Foo' is not assignable to type 'Foo'. -!!! error TS2322: Type 'T' is not assignable to type 'U'. } } \ No newline at end of file From f30931cddd606a34143b10049255185b8810a30c Mon Sep 17 00:00:00 2001 From: Nathan Shively-Sanders Date: Wed, 23 Aug 2017 11:57:06 -0700 Subject: [PATCH 218/237] Comment getTypeReferenceId and getRelationKey --- src/compiler/checker.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 3accf1637386e..4124fefbe95bd 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -9779,6 +9779,10 @@ namespace ts { return getObjectFlags(type) & ObjectFlags.Reference && some((type).typeArguments, isUnconstrainedTypeParameter); } + /** + * getTypeReferenceId(A) returns "111=0-12=1" + * where A.id=111 and number.id=12 + */ function getTypeReferenceId(type: TypeReference, typeParameters: Type[]) { let result = "" + type.target.id; for (const t of type.typeArguments) { @@ -9797,6 +9801,10 @@ namespace ts { return result; } + /** + * To improve caching, the relation key for two generic types uses the target's id plus ids of the type parameters. + * For other cases, the types ids are used. + */ function getRelationKey(source: Type, target: Type, relation: Map) { if (relation === identityRelation && source.id > target.id) { const temp = source; From deaddb559544399fc670a88b5ab2624e534703f1 Mon Sep 17 00:00:00 2001 From: Mohamed Hegazy Date: Wed, 23 Aug 2017 13:01:14 -0700 Subject: [PATCH 219/237] Ports #17983 (#17986) * Bind logger function before using * Use lambda isntead of bind --- src/server/typingsInstaller/typingsInstaller.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/server/typingsInstaller/typingsInstaller.ts b/src/server/typingsInstaller/typingsInstaller.ts index 2b941c4214179..c6423bc3c7b50 100644 --- a/src/server/typingsInstaller/typingsInstaller.ts +++ b/src/server/typingsInstaller/typingsInstaller.ts @@ -150,7 +150,7 @@ namespace ts.server.typingsInstaller { } const discoverTypingsResult = JsTyping.discoverTypings( this.installTypingHost, - this.log.isEnabled() ? this.log.writeLine : undefined, + this.log.isEnabled() ? (s => this.log.writeLine(s)) : undefined, req.fileNames, req.projectRootPath, this.safeList, From 8d13314056b084cf9fb97df3ffa168059ed2af5f Mon Sep 17 00:00:00 2001 From: Klaus Meinhardt Date: Wed, 23 Aug 2017 23:33:53 +0200 Subject: [PATCH 220/237] Expose isSourceFileFromExternalLibrary (#16112) --- src/compiler/types.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/compiler/types.ts b/src/compiler/types.ts index 26bf5e1a91f85..8fe602ea6f94f 100644 --- a/src/compiler/types.ts +++ b/src/compiler/types.ts @@ -2431,7 +2431,7 @@ namespace ts { getDeclarationDiagnostics(sourceFile?: SourceFile, cancellationToken?: CancellationToken): Diagnostic[]; /** - * Gets a type checker that can be used to semantically analyze source fils in the program. + * Gets a type checker that can be used to semantically analyze source files in the program. */ getTypeChecker(): TypeChecker; @@ -2451,7 +2451,7 @@ namespace ts { /* @internal */ getFileProcessingDiagnostics(): DiagnosticCollection; /* @internal */ getResolvedTypeReferenceDirectives(): Map; - /* @internal */ isSourceFileFromExternalLibrary(file: SourceFile): boolean; + isSourceFileFromExternalLibrary(file: SourceFile): boolean; // For testing purposes only. /* @internal */ structureIsReused?: StructureIsReused; From 71c5b1b3548dcb3dc380d343c3b828a8df73b68d Mon Sep 17 00:00:00 2001 From: Nathan Shively-Sanders Date: Wed, 23 Aug 2017 15:00:12 -0700 Subject: [PATCH 221/237] Parsing:Allow QuestionToken as start of type --- src/compiler/parser.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/compiler/parser.ts b/src/compiler/parser.ts index a2fe752ad18e9..7486c7541bed4 100644 --- a/src/compiler/parser.ts +++ b/src/compiler/parser.ts @@ -2721,6 +2721,7 @@ namespace ts { case SyntaxKind.FalseKeyword: case SyntaxKind.ObjectKeyword: case SyntaxKind.AsteriskToken: + case SyntaxKind.QuestionToken: return true; case SyntaxKind.MinusToken: return lookAhead(nextTokenIsNumericLiteral); From ca86dc4deb15f1fe16ee0e1d797af4d92975cced Mon Sep 17 00:00:00 2001 From: Nathan Shively-Sanders Date: Wed, 23 Aug 2017 15:00:40 -0700 Subject: [PATCH 222/237] Test:jsdoc nullable syntax legal in type arguments And update baselines --- .../reference/checkJsdocTypeTag3.errors.txt | 21 ---------------- .../baselines/reference/checkJsdocTypeTag3.js | 24 ------------------- .../reference/checkJsdocTypeTag3.symbols | 5 ++++ .../reference/checkJsdocTypeTag3.types | 5 ++++ .../thisTypeInFunctionsNegative.errors.txt | 5 +--- .../reference/thisTypeInFunctionsNegative.js | 2 +- .../conformance/jsdoc/checkJsdocTypeTag3.ts | 6 +++++ 7 files changed, 18 insertions(+), 50 deletions(-) delete mode 100644 tests/baselines/reference/checkJsdocTypeTag3.errors.txt delete mode 100644 tests/baselines/reference/checkJsdocTypeTag3.js create mode 100644 tests/baselines/reference/checkJsdocTypeTag3.symbols create mode 100644 tests/baselines/reference/checkJsdocTypeTag3.types create mode 100644 tests/cases/conformance/jsdoc/checkJsdocTypeTag3.ts diff --git a/tests/baselines/reference/checkJsdocTypeTag3.errors.txt b/tests/baselines/reference/checkJsdocTypeTag3.errors.txt deleted file mode 100644 index d53c0972fa3e8..0000000000000 --- a/tests/baselines/reference/checkJsdocTypeTag3.errors.txt +++ /dev/null @@ -1,21 +0,0 @@ -tests/cases/conformance/jsdoc/0.js(5,4): error TS2345: Argument of type '"string"' is not assignable to parameter of type 'number'. -tests/cases/conformance/jsdoc/0.js(12,1): error TS2322: Type 'number' is not assignable to type 'string'. - - -==== tests/cases/conformance/jsdoc/0.js (2 errors) ==== - // @ts-check - - /** @type {function (number)} */ - const x1 = (a) => a + 1; - x1("string"); - ~~~~~~~~ -!!! error TS2345: Argument of type '"string"' is not assignable to parameter of type 'number'. - - /** @type {function (number): number} */ - const x2 = (a) => a + 1; - - /** @type {string} */ - var a; - a = x2(0); - ~ -!!! error TS2322: Type 'number' is not assignable to type 'string'. \ No newline at end of file diff --git a/tests/baselines/reference/checkJsdocTypeTag3.js b/tests/baselines/reference/checkJsdocTypeTag3.js deleted file mode 100644 index 2eb50223ba2c2..0000000000000 --- a/tests/baselines/reference/checkJsdocTypeTag3.js +++ /dev/null @@ -1,24 +0,0 @@ -//// [0.js] -// @ts-check - -/** @type {function (number)} */ -const x1 = (a) => a + 1; -x1("string"); - -/** @type {function (number): number} */ -const x2 = (a) => a + 1; - -/** @type {string} */ -var a; -a = x2(0); - -//// [0.js] -// @ts-check -/** @type {function (number)} */ -var x1 = function (a) { return a + 1; }; -x1("string"); -/** @type {function (number): number} */ -var x2 = function (a) { return a + 1; }; -/** @type {string} */ -var a; -a = x2(0); diff --git a/tests/baselines/reference/checkJsdocTypeTag3.symbols b/tests/baselines/reference/checkJsdocTypeTag3.symbols new file mode 100644 index 0000000000000..4e731fbdc8748 --- /dev/null +++ b/tests/baselines/reference/checkJsdocTypeTag3.symbols @@ -0,0 +1,5 @@ +=== tests/cases/conformance/jsdoc/test.js === +/** @type {Array} */ +var nns; +>nns : Symbol(nns, Decl(test.js, 1, 3)) + diff --git a/tests/baselines/reference/checkJsdocTypeTag3.types b/tests/baselines/reference/checkJsdocTypeTag3.types new file mode 100644 index 0000000000000..94d953e0b441d --- /dev/null +++ b/tests/baselines/reference/checkJsdocTypeTag3.types @@ -0,0 +1,5 @@ +=== tests/cases/conformance/jsdoc/test.js === +/** @type {Array} */ +var nns; +>nns : number[] + diff --git a/tests/baselines/reference/thisTypeInFunctionsNegative.errors.txt b/tests/baselines/reference/thisTypeInFunctionsNegative.errors.txt index 4f566c1a7ae55..b813c08705b55 100644 --- a/tests/baselines/reference/thisTypeInFunctionsNegative.errors.txt +++ b/tests/baselines/reference/thisTypeInFunctionsNegative.errors.txt @@ -84,7 +84,6 @@ tests/cases/conformance/types/thisType/thisTypeInFunctionsNegative.ts(169,20): e tests/cases/conformance/types/thisType/thisTypeInFunctionsNegative.ts(169,23): error TS1003: Identifier expected. tests/cases/conformance/types/thisType/thisTypeInFunctionsNegative.ts(169,27): error TS1005: ',' expected. tests/cases/conformance/types/thisType/thisTypeInFunctionsNegative.ts(170,23): error TS1005: ',' expected. -tests/cases/conformance/types/thisType/thisTypeInFunctionsNegative.ts(170,24): error TS1138: Parameter declaration expected. tests/cases/conformance/types/thisType/thisTypeInFunctionsNegative.ts(171,28): error TS1003: Identifier expected. tests/cases/conformance/types/thisType/thisTypeInFunctionsNegative.ts(171,32): error TS1005: ',' expected. tests/cases/conformance/types/thisType/thisTypeInFunctionsNegative.ts(172,30): error TS1005: ',' expected. @@ -94,7 +93,7 @@ tests/cases/conformance/types/thisType/thisTypeInFunctionsNegative.ts(175,32): e tests/cases/conformance/types/thisType/thisTypeInFunctionsNegative.ts(175,35): error TS2304: Cannot find name 'm'. -==== tests/cases/conformance/types/thisType/thisTypeInFunctionsNegative.ts (60 errors) ==== +==== tests/cases/conformance/types/thisType/thisTypeInFunctionsNegative.ts (59 errors) ==== class C { n: number; explicitThis(this: this, m: number): number { @@ -403,8 +402,6 @@ tests/cases/conformance/types/thisType/thisTypeInFunctionsNegative.ts(175,35): e function optional(this?: C): number { return this.n; } ~ !!! error TS1005: ',' expected. - ~ -!!! error TS1138: Parameter declaration expected. function decorated(@deco() this: C): number { return this.n; } ~~~~ !!! error TS1003: Identifier expected. diff --git a/tests/baselines/reference/thisTypeInFunctionsNegative.js b/tests/baselines/reference/thisTypeInFunctionsNegative.js index c0a6ecb1deeb6..94a0565e23733 100644 --- a/tests/baselines/reference/thisTypeInFunctionsNegative.js +++ b/tests/baselines/reference/thisTypeInFunctionsNegative.js @@ -345,7 +345,7 @@ function modifiers(, C) { return this.n; } function restParam(C) { return this.n; } -function optional(C) { return this.n; } +function optional() { return this.n; } function decorated(, C) { if ( === void 0) { = this; } return this.n; diff --git a/tests/cases/conformance/jsdoc/checkJsdocTypeTag3.ts b/tests/cases/conformance/jsdoc/checkJsdocTypeTag3.ts new file mode 100644 index 0000000000000..0051e1029f97f --- /dev/null +++ b/tests/cases/conformance/jsdoc/checkJsdocTypeTag3.ts @@ -0,0 +1,6 @@ +// @Filename:test.js +// @checkJs: true +// @allowJs: true +// @noEmit: true +/** @type {Array} */ +var nns; From 1bae5f2c69177251794462eee3c16efc17ce8de3 Mon Sep 17 00:00:00 2001 From: Mohamed Hegazy Date: Wed, 23 Aug 2017 17:08:25 -0700 Subject: [PATCH 223/237] Update generated files (#17995) --- src/lib/dom.generated.d.ts | 279 +++++++++++++++++++------------ src/lib/webworker.generated.d.ts | 72 +++++--- 2 files changed, 216 insertions(+), 135 deletions(-) diff --git a/src/lib/dom.generated.d.ts b/src/lib/dom.generated.d.ts index da81bba5d78d3..feb38887ab9df 100644 --- a/src/lib/dom.generated.d.ts +++ b/src/lib/dom.generated.d.ts @@ -4,11 +4,11 @@ ///////////////////////////// interface Account { - displayName?: string; - id?: string; + displayName: string; + id: string; imageURL?: string; name?: string; - rpDisplayName?: string; + rpDisplayName: string; } interface Algorithm { @@ -35,11 +35,11 @@ interface CacheQueryOptions { } interface ClientData { - challenge?: string; + challenge: string; extensions?: WebAuthnExtensions; - hashAlg?: string | Algorithm; - origin?: string; - rpId?: string; + hashAlg: string | Algorithm; + origin: string; + rpId: string; tokenBinding?: string; } @@ -87,9 +87,9 @@ interface CustomEventInit extends EventInit { } interface DeviceAccelerationDict { - x?: number; - y?: number; - z?: number; + x?: number | null; + y?: number | null; + z?: number | null; } interface DeviceLightEventInit extends EventInit { @@ -97,30 +97,30 @@ interface DeviceLightEventInit extends EventInit { } interface DeviceMotionEventInit extends EventInit { - acceleration?: DeviceAccelerationDict; - accelerationIncludingGravity?: DeviceAccelerationDict; - interval?: number; - rotationRate?: DeviceRotationRateDict; + acceleration?: DeviceAccelerationDict | null; + accelerationIncludingGravity?: DeviceAccelerationDict | null; + interval?: number | null; + rotationRate?: DeviceRotationRateDict | null; } interface DeviceOrientationEventInit extends EventInit { absolute?: boolean; - alpha?: number; - beta?: number; - gamma?: number; + alpha?: number | null; + beta?: number | null; + gamma?: number | null; } interface DeviceRotationRateDict { - alpha?: number; - beta?: number; - gamma?: number; + alpha?: number | null; + beta?: number | null; + gamma?: number | null; } interface DOMRectInit { - height?: any; - width?: any; - x?: any; - y?: any; + height?: number; + width?: number; + x?: number; + y?: number; } interface DoubleRange { @@ -161,15 +161,15 @@ interface EventModifierInit extends UIEventInit { } interface ExceptionInformation { - domain?: string; + domain?: string | null; } interface FocusEventInit extends UIEventInit { - relatedTarget?: EventTarget; + relatedTarget?: EventTarget | null; } interface FocusNavigationEventInit extends EventInit { - navigationReason?: string; + navigationReason?: string | null; originHeight?: number; originLeft?: number; originTop?: number; @@ -184,7 +184,7 @@ interface FocusNavigationOrigin { } interface GamepadEventInit extends EventInit { - gamepad?: Gamepad; + gamepad?: Gamepad | null; } interface GetNotificationOptions { @@ -192,8 +192,8 @@ interface GetNotificationOptions { } interface HashChangeEventInit extends EventInit { - newURL?: string; - oldURL?: string; + newURL?: string | null; + oldURL?: string | null; } interface IDBIndexParameters { @@ -203,19 +203,20 @@ interface IDBIndexParameters { interface IDBObjectStoreParameters { autoIncrement?: boolean; - keyPath?: IDBKeyPath; + keyPath?: IDBKeyPath | null; } interface IntersectionObserverEntryInit { - boundingClientRect?: DOMRectInit; - intersectionRect?: DOMRectInit; - rootBounds?: DOMRectInit; - target?: Element; - time?: number; + isIntersecting: boolean; + boundingClientRect: DOMRectInit; + intersectionRect: DOMRectInit; + rootBounds: DOMRectInit; + target: Element; + time: number; } interface IntersectionObserverInit { - root?: Element; + root?: Element | null; rootMargin?: string; threshold?: number | number[]; } @@ -237,12 +238,12 @@ interface LongRange { } interface MediaEncryptedEventInit extends EventInit { - initData?: ArrayBuffer; + initData?: ArrayBuffer | null; initDataType?: string; } interface MediaKeyMessageEventInit extends EventInit { - message?: ArrayBuffer; + message?: ArrayBuffer | null; messageType?: MediaKeyMessageType; } @@ -265,7 +266,7 @@ interface MediaStreamConstraints { } interface MediaStreamErrorEventInit extends EventInit { - error?: MediaStreamError; + error?: MediaStreamError | null; } interface MediaStreamEventInit extends EventInit { @@ -273,7 +274,7 @@ interface MediaStreamEventInit extends EventInit { } interface MediaStreamTrackEventInit extends EventInit { - track?: MediaStreamTrack; + track?: MediaStreamTrack | null; } interface MediaTrackCapabilities { @@ -350,7 +351,7 @@ interface MouseEventInit extends EventModifierInit { buttons?: number; clientX?: number; clientY?: number; - relatedTarget?: EventTarget; + relatedTarget?: EventTarget | null; screenX?: number; screenY?: number; } @@ -358,8 +359,8 @@ interface MouseEventInit extends EventModifierInit { interface MSAccountInfo { accountImageUri?: string; accountName?: string; - rpDisplayName?: string; - userDisplayName?: string; + rpDisplayName: string; + userDisplayName: string; userId?: string; } @@ -442,7 +443,7 @@ interface MSCredentialParameters { interface MSCredentialSpec { id?: string; - type?: MSCredentialType; + type: MSCredentialType; } interface MSDelay { @@ -652,8 +653,8 @@ interface MsZoomToOptions { contentX?: number; contentY?: number; scaleFactor?: number; - viewportX?: string; - viewportY?: string; + viewportX?: string | null; + viewportY?: string | null; } interface MutationObserverInit { @@ -679,9 +680,9 @@ interface ObjectURLOptions { } interface PaymentCurrencyAmount { - currency?: string; + currency: string; currencySystem?: string; - value?: string; + value: string; } interface PaymentDetails { @@ -695,19 +696,19 @@ interface PaymentDetails { interface PaymentDetailsModifier { additionalDisplayItems?: PaymentItem[]; data?: any; - supportedMethods?: string[]; + supportedMethods: string[]; total?: PaymentItem; } interface PaymentItem { - amount?: PaymentCurrencyAmount; - label?: string; + amount: PaymentCurrencyAmount; + label: string; pending?: boolean; } interface PaymentMethodData { data?: any; - supportedMethods?: string[]; + supportedMethods: string[]; } interface PaymentOptions { @@ -722,9 +723,9 @@ interface PaymentRequestUpdateEventInit extends EventInit { } interface PaymentShippingOption { - amount?: PaymentCurrencyAmount; - id?: string; - label?: string; + amount: PaymentCurrencyAmount; + id: string; + label: string; selected?: boolean; } @@ -772,7 +773,7 @@ interface RequestInit { body?: any; cache?: RequestCache; credentials?: RequestCredentials; - headers?: any; + headers?: Headers | string[][]; integrity?: string; keepalive?: boolean; method?: string; @@ -784,7 +785,7 @@ interface RequestInit { } interface ResponseInit { - headers?: any; + headers?: Headers | string[][]; status?: number; statusText?: string; } @@ -869,15 +870,15 @@ interface RTCIceGatherOptions { } interface RTCIceParameters { - iceLite?: boolean; + iceLite?: boolean | null; password?: string; usernameFragment?: string; } interface RTCIceServer { - credential?: string; + credential?: string | null; urls?: any; - username?: string; + username?: string | null; } interface RTCInboundRTPStreamStats extends RTCRTPStreamStats { @@ -1087,9 +1088,9 @@ interface RTCTransportStats extends RTCStats { } interface ScopedCredentialDescriptor { - id?: any; + id: any; transports?: Transport[]; - type?: ScopedCredentialType; + type: ScopedCredentialType; } interface ScopedCredentialOptions { @@ -1100,29 +1101,29 @@ interface ScopedCredentialOptions { } interface ScopedCredentialParameters { - algorithm?: string | Algorithm; - type?: ScopedCredentialType; + algorithm: string | Algorithm; + type: ScopedCredentialType; } interface ServiceWorkerMessageEventInit extends EventInit { data?: any; lastEventId?: string; origin?: string; - ports?: MessagePort[]; - source?: ServiceWorker | MessagePort; + ports?: MessagePort[] | null; + source?: ServiceWorker | MessagePort | null; } interface SpeechSynthesisEventInit extends EventInit { charIndex?: number; elapsedTime?: number; name?: string; - utterance?: SpeechSynthesisUtterance; + utterance?: SpeechSynthesisUtterance | null; } interface StoreExceptionsInformation extends ExceptionInformation { - detailURI?: string; - explanationString?: string; - siteName?: string; + detailURI?: string | null; + explanationString?: string | null; + siteName?: string | null; } interface StoreSiteSpecificExceptionsInformation extends StoreExceptionsInformation { @@ -1130,7 +1131,7 @@ interface StoreSiteSpecificExceptionsInformation extends StoreExceptionsInformat } interface TrackEventInit extends EventInit { - track?: VideoTrack | AudioTrack | TextTrack; + track?: VideoTrack | AudioTrack | TextTrack | null; } interface TransitionEventInit extends EventInit { @@ -1140,7 +1141,7 @@ interface TransitionEventInit extends EventInit { interface UIEventInit extends EventInit { detail?: number; - view?: Window; + view?: Window | null; } interface WebAuthnExtensions { @@ -1520,9 +1521,9 @@ interface Cache { add(request: RequestInfo): Promise; addAll(requests: RequestInfo[]): Promise; delete(request: RequestInfo, options?: CacheQueryOptions): Promise; - keys(request?: RequestInfo, options?: CacheQueryOptions): any; + keys(request?: RequestInfo, options?: CacheQueryOptions): Promise; match(request: RequestInfo, options?: CacheQueryOptions): Promise; - matchAll(request?: RequestInfo, options?: CacheQueryOptions): any; + matchAll(request?: RequestInfo, options?: CacheQueryOptions): Promise; put(request: RequestInfo, response: Response): Promise; } @@ -1534,7 +1535,7 @@ declare var Cache: { interface CacheStorage { delete(cacheName: string): Promise; has(cacheName: string): Promise; - keys(): any; + keys(): Promise; match(request: RequestInfo, options?: CacheQueryOptions): Promise; open(cacheName: string): Promise; } @@ -2639,7 +2640,7 @@ interface Document extends Node, GlobalEventHandlers, NodeSelector, DocumentEven */ readonly compatMode: string; cookie: string; - readonly currentScript: HTMLScriptElement | SVGScriptElement; + readonly currentScript: HTMLScriptElement | SVGScriptElement | null; readonly defaultView: Window; /** * Sets or gets a value that indicates whether the document can be edited. @@ -3378,7 +3379,7 @@ interface DOMException { declare var DOMException: { prototype: DOMException; - new(): DOMException; + new(message?: string, name?: string): DOMException; readonly ABORT_ERR: number; readonly DATA_CLONE_ERR: number; readonly DOMSTRING_SIZE_ERR: number; @@ -3884,7 +3885,7 @@ interface Headers { declare var Headers: { prototype: Headers; - new(init?: any): Headers; + new(init?: Headers | string[][]): Headers; }; interface History { @@ -4044,7 +4045,7 @@ interface HTMLAppletElement extends HTMLElement { * Sets or retrieves a character string that can be used to implement your own declare functionality for the object. */ declare: boolean; - readonly form: HTMLFormElement; + readonly form: HTMLFormElement | null; /** * Sets or retrieves the height of the object. */ @@ -4282,7 +4283,7 @@ interface HTMLButtonElement extends HTMLElement { /** * Retrieves a reference to the form that the object is embedded in. */ - readonly form: HTMLFormElement; + readonly form: HTMLFormElement | null; /** * Overrides the action attribute (where the data on a form is sent) on the parent form element. */ @@ -4715,7 +4716,7 @@ interface HTMLFieldSetElement extends HTMLElement { /** * Retrieves a reference to the form that the object is embedded in. */ - readonly form: HTMLFormElement; + readonly form: HTMLFormElement | null; name: string; /** * Returns the error message that would be displayed if the user submits the form, or an empty string if no error message. It also triggers the standard error message, such as "this is a required field". The result is that the user sees validation messages without actually submitting. @@ -5294,7 +5295,7 @@ interface HTMLInputElement extends HTMLElement { /** * Retrieves a reference to the form that the object is embedded in. */ - readonly form: HTMLFormElement; + readonly form: HTMLFormElement | null; /** * Overrides the action attribute (where the data on a form is sent) on the parent form element. */ @@ -5461,7 +5462,7 @@ interface HTMLLabelElement extends HTMLElement { /** * Retrieves a reference to the form that the object is embedded in. */ - readonly form: HTMLFormElement; + readonly form: HTMLFormElement | null; /** * Sets or retrieves the object to which the given label object is assigned. */ @@ -5483,7 +5484,7 @@ interface HTMLLegendElement extends HTMLElement { /** * Retrieves a reference to the form that the object is embedded in. */ - readonly form: HTMLFormElement; + readonly form: HTMLFormElement | null; addEventListener(type: K, listener: (this: HTMLLegendElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void; addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; } @@ -5917,7 +5918,7 @@ interface HTMLObjectElement extends HTMLElement, GetSVGDocument { /** * Retrieves a reference to the form that the object is embedded in. */ - readonly form: HTMLFormElement; + readonly form: HTMLFormElement | null; /** * Sets or retrieves the height of the object. */ @@ -6016,7 +6017,7 @@ interface HTMLOptGroupElement extends HTMLElement { /** * Retrieves a reference to the form that the object is embedded in. */ - readonly form: HTMLFormElement; + readonly form: HTMLFormElement | null; /** * Sets or retrieves the ordinal position of an option in a list box. */ @@ -6055,7 +6056,7 @@ interface HTMLOptionElement extends HTMLElement { /** * Retrieves a reference to the form that the object is embedded in. */ - readonly form: HTMLFormElement; + readonly form: HTMLFormElement | null; /** * Sets or retrieves the ordinal position of an option in a list box. */ @@ -6099,7 +6100,7 @@ declare var HTMLOptionsCollection: { interface HTMLOutputElement extends HTMLElement { defaultValue: string; - readonly form: HTMLFormElement; + readonly form: HTMLFormElement | null; readonly htmlFor: DOMSettableTokenList; name: string; readonly type: string; @@ -6188,7 +6189,7 @@ interface HTMLProgressElement extends HTMLElement { /** * Retrieves a reference to the form that the object is embedded in. */ - readonly form: HTMLFormElement; + readonly form: HTMLFormElement | null; /** * Defines the maximum, or "done" value for a progress element. */ @@ -6274,7 +6275,7 @@ interface HTMLSelectElement extends HTMLElement { /** * Retrieves a reference to the form that the object is embedded in. */ - readonly form: HTMLFormElement; + readonly form: HTMLFormElement | null; /** * Sets or retrieves the number of objects in a collection. */ @@ -6745,7 +6746,7 @@ interface HTMLTextAreaElement extends HTMLElement { /** * Retrieves a reference to the form that the object is embedded in. */ - readonly form: HTMLFormElement; + readonly form: HTMLFormElement | null; /** * Sets or retrieves the maximum number of characters that the user can enter in a text control. */ @@ -7211,6 +7212,7 @@ interface IntersectionObserverEntry { readonly rootBounds: ClientRect; readonly target: Element; readonly time: number; + readonly isIntersecting: boolean; } declare var IntersectionObserverEntry: { @@ -7312,7 +7314,7 @@ interface MediaDevicesEventMap { interface MediaDevices extends EventTarget { ondevicechange: (this: MediaDevices, ev: Event) => any; - enumerateDevices(): any; + enumerateDevices(): Promise; getSupportedConstraints(): MediaTrackSupportedConstraints; getUserMedia(constraints: MediaStreamConstraints): Promise; addEventListener(type: K, listener: (this: MediaDevices, ev: MediaDevicesEventMap[K]) => any, useCapture?: boolean): void; @@ -9058,6 +9060,7 @@ interface Response extends Object, Body { readonly statusText: string; readonly type: ResponseType; readonly url: string; + readonly redirected: boolean; clone(): Response; } @@ -9512,7 +9515,7 @@ interface ServiceWorkerContainer extends EventTarget { onmessage: (this: ServiceWorkerContainer, ev: ServiceWorkerMessageEvent) => any; readonly ready: Promise; getRegistration(clientURL?: USVString): Promise; - getRegistrations(): any; + getRegistrations(): Promise; register(scriptURL: USVString, options?: RegistrationOptions): Promise; addEventListener(type: K, listener: (this: ServiceWorkerContainer, ev: ServiceWorkerContainerEventMap[K]) => any, useCapture?: boolean): void; addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; @@ -9548,7 +9551,7 @@ interface ServiceWorkerRegistration extends EventTarget { readonly scope: USVString; readonly sync: SyncManager; readonly waiting: ServiceWorker | null; - getNotifications(filter?: GetNotificationOptions): any; + getNotifications(filter?: GetNotificationOptions): Promise; showNotification(title: string, options?: NotificationOptions): Promise; unregister(): Promise; update(): Promise; @@ -11573,7 +11576,7 @@ declare var SVGZoomEvent: { }; interface SyncManager { - getTags(): any; + getTags(): Promise; register(tag: string): Promise; } @@ -11881,6 +11884,7 @@ interface ValidityState { readonly typeMismatch: boolean; readonly valid: boolean; readonly valueMissing: boolean; + readonly tooShort: boolean; } declare var ValidityState: { @@ -13742,13 +13746,13 @@ interface NavigatorUserMedia { interface NodeSelector { querySelector(selectors: K): ElementTagNameMap[K] | null; - querySelector(selectors: string): Element | null; + querySelector(selectors: string): E | null; querySelectorAll(selectors: K): ElementListTagNameMap[K]; - querySelectorAll(selectors: string): NodeListOf; + querySelectorAll(selectors: string): NodeListOf; } interface RandomSource { - getRandomValues(array: ArrayBufferView): ArrayBufferView; + getRandomValues(array: T): T; } interface SVGAnimatedPoints { @@ -13823,17 +13827,37 @@ interface XMLHttpRequestEventTargetEventMap { } interface XMLHttpRequestEventTarget { - onabort: (this: XMLHttpRequestEventTarget, ev: Event) => any; - onerror: (this: XMLHttpRequestEventTarget, ev: ErrorEvent) => any; - onload: (this: XMLHttpRequestEventTarget, ev: Event) => any; - onloadend: (this: XMLHttpRequestEventTarget, ev: ProgressEvent) => any; - onloadstart: (this: XMLHttpRequestEventTarget, ev: Event) => any; - onprogress: (this: XMLHttpRequestEventTarget, ev: ProgressEvent) => any; - ontimeout: (this: XMLHttpRequestEventTarget, ev: ProgressEvent) => any; + onabort: (this: XMLHttpRequest, ev: Event) => any; + onerror: (this: XMLHttpRequest, ev: ErrorEvent) => any; + onload: (this: XMLHttpRequest, ev: Event) => any; + onloadend: (this: XMLHttpRequest, ev: ProgressEvent) => any; + onloadstart: (this: XMLHttpRequest, ev: Event) => any; + onprogress: (this: XMLHttpRequest, ev: ProgressEvent) => any; + ontimeout: (this: XMLHttpRequest, ev: ProgressEvent) => any; addEventListener(type: K, listener: (this: XMLHttpRequestEventTarget, ev: XMLHttpRequestEventTargetEventMap[K]) => any, useCapture?: boolean): void; addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; } +interface BroadcastChannel extends EventTarget { + readonly name: string; + onmessage: (ev: MessageEvent) => any; + onmessageerror: (ev: MessageEvent) => any; + close(): void; + postMessage(message: any): void; + addEventListener(type: K, listener: (this: BroadcastChannel, ev: BroadcastChannelEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var BroadcastChannel: { + prototype: BroadcastChannel; + new(name: string): BroadcastChannel; +}; + +interface BroadcastChannelEventMap { + message: MessageEvent; + messageerror: MessageEvent; +} + interface ErrorEventInit { message?: string; filename?: string; @@ -13924,8 +13948,7 @@ interface BlobPropertyBag { endings?: string; } -interface FilePropertyBag { - type?: string; +interface FilePropertyBag extends BlobPropertyBag { lastModified?: number; } @@ -14201,6 +14224,44 @@ interface TouchEventInit extends EventModifierInit { changedTouches?: Touch[]; } +interface HTMLDialogElement extends HTMLElement { + open: boolean; + returnValue: string; + close(returnValue?: string): void; + show(): void; + showModal(): void; +} + +declare var HTMLDialogElement: { + prototype: HTMLDialogElement; + new(): HTMLDialogElement; +}; + +interface HTMLMainElement extends HTMLElement { +} + +declare var HTMLMainElement: { + prototype: HTMLMainElement; + new(): HTMLMainElement; +}; + +interface HTMLDetailsElement extends HTMLElement { + open: boolean; +} + +declare var HTMLDetailsElement: { + prototype: HTMLDetailsElement; + new(): HTMLDetailsElement; +}; + +interface HTMLSummaryElement extends HTMLElement { +} + +declare var HTMLSummaryElement: { + prototype: HTMLSummaryElement; + new(): HTMLSummaryElement; +}; + declare type EventListenerOrEventListenerObject = EventListener | EventListenerObject; interface DecodeErrorCallback { @@ -14690,7 +14751,7 @@ type GLsizeiptr = number; type GLubyte = number; type GLuint = number; type GLushort = number; -type HeadersInit = any; +type HeadersInit = Headers | string[][]; type IDBKeyPath = string; type KeyFormat = string; type KeyType = string; diff --git a/src/lib/webworker.generated.d.ts b/src/lib/webworker.generated.d.ts index ba358d6402b20..38c0cfeefff02 100644 --- a/src/lib/webworker.generated.d.ts +++ b/src/lib/webworker.generated.d.ts @@ -37,7 +37,7 @@ interface IDBIndexParameters { interface IDBObjectStoreParameters { autoIncrement?: boolean; - keyPath?: IDBKeyPath; + keyPath?: IDBKeyPath | null; } interface KeyAlgorithm { @@ -74,7 +74,7 @@ interface RequestInit { body?: any; cache?: RequestCache; credentials?: RequestCredentials; - headers?: any; + headers?: Headers | string[][]; integrity?: string; keepalive?: boolean; method?: string; @@ -86,7 +86,7 @@ interface RequestInit { } interface ResponseInit { - headers?: any; + headers?: Headers | string[][]; status?: number; statusText?: string; } @@ -103,18 +103,18 @@ interface ExtendableMessageEventInit extends ExtendableEventInit { data?: any; origin?: string; lastEventId?: string; - source?: Client | ServiceWorker | MessagePort; - ports?: MessagePort[]; + source?: Client | ServiceWorker | MessagePort | null; + ports?: MessagePort[] | null; } interface FetchEventInit extends ExtendableEventInit { - request?: Request; - clientId?: string; + request: Request; + clientId?: string | null; isReload?: boolean; } interface NotificationEventInit extends ExtendableEventInit { - notification?: Notification; + notification: Notification; action?: string; } @@ -123,7 +123,7 @@ interface PushEventInit extends ExtendableEventInit { } interface SyncEventInit extends ExtendableEventInit { - tag?: string; + tag: string; lastChance?: boolean; } @@ -175,9 +175,9 @@ interface Cache { add(request: RequestInfo): Promise; addAll(requests: RequestInfo[]): Promise; delete(request: RequestInfo, options?: CacheQueryOptions): Promise; - keys(request?: RequestInfo, options?: CacheQueryOptions): any; + keys(request?: RequestInfo, options?: CacheQueryOptions): Promise; match(request: RequestInfo, options?: CacheQueryOptions): Promise; - matchAll(request?: RequestInfo, options?: CacheQueryOptions): any; + matchAll(request?: RequestInfo, options?: CacheQueryOptions): Promise; put(request: RequestInfo, response: Response): Promise; } @@ -189,7 +189,7 @@ declare var Cache: { interface CacheStorage { delete(cacheName: string): Promise; has(cacheName: string): Promise; - keys(): any; + keys(): Promise; match(request: RequestInfo, options?: CacheQueryOptions): Promise; open(cacheName: string): Promise; } @@ -314,7 +314,7 @@ interface DOMException { declare var DOMException: { prototype: DOMException; - new(): DOMException; + new(message?: string, name?: string): DOMException; readonly ABORT_ERR: number; readonly DATA_CLONE_ERR: number; readonly DOMSTRING_SIZE_ERR: number; @@ -470,7 +470,7 @@ interface Headers { declare var Headers: { prototype: Headers; - new(init?: any): Headers; + new(init?: Headers | string[][]): Headers; }; interface IDBCursor { @@ -960,6 +960,7 @@ interface Response extends Object, Body { readonly statusText: string; readonly type: ResponseType; readonly url: string; + readonly redirected: boolean; clone(): Response; } @@ -1000,7 +1001,7 @@ interface ServiceWorkerRegistration extends EventTarget { readonly scope: USVString; readonly sync: SyncManager; readonly waiting: ServiceWorker | null; - getNotifications(filter?: GetNotificationOptions): any; + getNotifications(filter?: GetNotificationOptions): Promise; showNotification(title: string, options?: NotificationOptions): Promise; unregister(): Promise; update(): Promise; @@ -1014,7 +1015,7 @@ declare var ServiceWorkerRegistration: { }; interface SyncManager { - getTags(): any; + getTags(): Promise; register(tag: string): Promise; } @@ -1248,13 +1249,13 @@ interface XMLHttpRequestEventTargetEventMap { } interface XMLHttpRequestEventTarget { - onabort: (this: XMLHttpRequestEventTarget, ev: Event) => any; - onerror: (this: XMLHttpRequestEventTarget, ev: ErrorEvent) => any; - onload: (this: XMLHttpRequestEventTarget, ev: Event) => any; - onloadend: (this: XMLHttpRequestEventTarget, ev: ProgressEvent) => any; - onloadstart: (this: XMLHttpRequestEventTarget, ev: Event) => any; - onprogress: (this: XMLHttpRequestEventTarget, ev: ProgressEvent) => any; - ontimeout: (this: XMLHttpRequestEventTarget, ev: ProgressEvent) => any; + onabort: (this: XMLHttpRequest, ev: Event) => any; + onerror: (this: XMLHttpRequest, ev: ErrorEvent) => any; + onload: (this: XMLHttpRequest, ev: Event) => any; + onloadend: (this: XMLHttpRequest, ev: ProgressEvent) => any; + onloadstart: (this: XMLHttpRequest, ev: Event) => any; + onprogress: (this: XMLHttpRequest, ev: ProgressEvent) => any; + ontimeout: (this: XMLHttpRequest, ev: ProgressEvent) => any; addEventListener(type: K, listener: (this: XMLHttpRequestEventTarget, ev: XMLHttpRequestEventTargetEventMap[K]) => any, useCapture?: boolean): void; addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; } @@ -1274,7 +1275,7 @@ declare var Client: { interface Clients { claim(): Promise; get(id: string): Promise; - matchAll(options?: ClientQueryOptions): any; + matchAll(options?: ClientQueryOptions): Promise; openWindow(url: USVString): Promise; } @@ -1499,6 +1500,26 @@ interface WorkerUtils extends Object, WindowBase64 { setTimeout(handler: any, timeout?: any, ...args: any[]): number; } +interface BroadcastChannel extends EventTarget { + readonly name: string; + onmessage: (ev: MessageEvent) => any; + onmessageerror: (ev: MessageEvent) => any; + close(): void; + postMessage(message: any): void; + addEventListener(type: K, listener: (this: BroadcastChannel, ev: BroadcastChannelEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var BroadcastChannel: { + prototype: BroadcastChannel; + new(name: string): BroadcastChannel; +}; + +interface BroadcastChannelEventMap { + message: MessageEvent; + messageerror: MessageEvent; +} + interface ErrorEventInit { message?: string; filename?: string; @@ -1562,8 +1583,7 @@ interface BlobPropertyBag { endings?: string; } -interface FilePropertyBag { - type?: string; +interface FilePropertyBag extends BlobPropertyBag { lastModified?: number; } From 26a02860b0e99699e5851b62ff4f3d761bb7780a Mon Sep 17 00:00:00 2001 From: Ron Buckton Date: Wed, 23 Aug 2017 17:09:47 -0700 Subject: [PATCH 224/237] Fix crash when exporting class without name --- src/compiler/transformers/module/module.ts | 2 +- src/compiler/transformers/utilities.ts | 2 +- .../reference/exportClassWithoutName.errors.txt | 8 ++++++++ tests/baselines/reference/exportClassWithoutName.js | 10 ++++++++++ tests/cases/compiler/exportClassWithoutName.ts | 4 ++++ 5 files changed, 24 insertions(+), 2 deletions(-) create mode 100644 tests/baselines/reference/exportClassWithoutName.errors.txt create mode 100644 tests/baselines/reference/exportClassWithoutName.js create mode 100644 tests/cases/compiler/exportClassWithoutName.ts diff --git a/src/compiler/transformers/module/module.ts b/src/compiler/transformers/module/module.ts index 2c3133de6f565..a0f593e511138 100644 --- a/src/compiler/transformers/module/module.ts +++ b/src/compiler/transformers/module/module.ts @@ -1204,7 +1204,7 @@ namespace ts { } if (hasModifier(decl, ModifierFlags.Export)) { - const exportName = hasModifier(decl, ModifierFlags.Default) ? createIdentifier("default") : decl.name; + const exportName = hasModifier(decl, ModifierFlags.Default) ? createIdentifier("default") : getDeclarationName(decl); statements = appendExportStatement(statements, exportName, getLocalName(decl), /*location*/ decl); } diff --git a/src/compiler/transformers/utilities.ts b/src/compiler/transformers/utilities.ts index be99df62b67a7..f641ee49faf67 100644 --- a/src/compiler/transformers/utilities.ts +++ b/src/compiler/transformers/utilities.ts @@ -124,7 +124,7 @@ namespace ts { else { // export class x { } const name = (node).name; - if (!uniqueExports.get(unescapeLeadingUnderscores(name.escapedText))) { + if (name && !uniqueExports.get(unescapeLeadingUnderscores(name.escapedText))) { multiMapSparseArrayAdd(exportedBindings, getOriginalNodeId(node), name); uniqueExports.set(unescapeLeadingUnderscores(name.escapedText), true); exportedNames = append(exportedNames, name); diff --git a/tests/baselines/reference/exportClassWithoutName.errors.txt b/tests/baselines/reference/exportClassWithoutName.errors.txt new file mode 100644 index 0000000000000..448a1b2bb03d1 --- /dev/null +++ b/tests/baselines/reference/exportClassWithoutName.errors.txt @@ -0,0 +1,8 @@ +tests/cases/compiler/exportClassWithoutName.ts(1,1): error TS1211: A class declaration without the 'default' modifier must have a name. + + +==== tests/cases/compiler/exportClassWithoutName.ts (1 errors) ==== + export class { + ~~~~~~ +!!! error TS1211: A class declaration without the 'default' modifier must have a name. + } \ No newline at end of file diff --git a/tests/baselines/reference/exportClassWithoutName.js b/tests/baselines/reference/exportClassWithoutName.js new file mode 100644 index 0000000000000..45b4301a81232 --- /dev/null +++ b/tests/baselines/reference/exportClassWithoutName.js @@ -0,0 +1,10 @@ +//// [exportClassWithoutName.ts] +export class { +} + +//// [exportClassWithoutName.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +class default_1 { +} +exports.default_1 = default_1; diff --git a/tests/cases/compiler/exportClassWithoutName.ts b/tests/cases/compiler/exportClassWithoutName.ts new file mode 100644 index 0000000000000..a83ca9758c7ca --- /dev/null +++ b/tests/cases/compiler/exportClassWithoutName.ts @@ -0,0 +1,4 @@ +//@module: commonjs +//@target: es2015 +export class { +} \ No newline at end of file From cd2ea9a12f2bf42fcd4747782b34543a6c36c08c Mon Sep 17 00:00:00 2001 From: Andy Date: Wed, 23 Aug 2017 17:48:01 -0700 Subject: [PATCH 225/237] Update LKG (#17993) --- lib/cancellationToken.js | 2 + lib/lib.d.ts | 10 +- lib/lib.es2015.symbol.wellknown.d.ts | 2 +- lib/lib.es2016.full.d.ts | 1824 +++++++++ lib/lib.es2017.full.d.ts | 1824 +++++++++ lib/lib.es5.d.ts | 10 +- lib/lib.es6.d.ts | 12 +- lib/lib.esnext.full.d.ts | 1824 +++++++++ lib/tsc.js | 3403 +++++++++++++---- lib/tsserver.js | 4401 +++++++++++++++------- lib/tsserverlibrary.d.ts | 315 +- lib/tsserverlibrary.js | 5081 +++++++++++++++++--------- lib/typescript.d.ts | 85 +- lib/typescript.js | 4430 +++++++++++++++------- lib/typescriptServices.d.ts | 85 +- lib/typescriptServices.js | 4430 +++++++++++++++------- lib/typingsInstaller.js | 1815 +++++++-- 17 files changed, 22294 insertions(+), 7259 deletions(-) diff --git a/lib/cancellationToken.js b/lib/cancellationToken.js index 0e37b0689e02f..ec9453bb00c99 100644 --- a/lib/cancellationToken.js +++ b/lib/cancellationToken.js @@ -69,3 +69,5 @@ function createCancellationToken(args) { } } module.exports = createCancellationToken; + +//# sourceMappingURL=cancellationToken.js.map diff --git a/lib/lib.d.ts b/lib/lib.d.ts index 1a8b1d728333f..c99bf56ef4362 100644 --- a/lib/lib.d.ts +++ b/lib/lib.d.ts @@ -236,7 +236,7 @@ interface ObjectConstructor { * Returns the names of the enumerable properties and methods of an object. * @param o Object that contains the properties and methods. This can be an object that you created or an existing Document Object Model (DOM) object. */ - keys(o: any): string[]; + keys(o: {}): string[]; } /** @@ -1000,12 +1000,12 @@ interface ReadonlyArray { * Combines two or more arrays. * @param items Additional items to add to the end of array1. */ - concat(...items: T[][]): T[]; + concat(...items: ReadonlyArray[]): T[]; /** * Combines two or more arrays. * @param items Additional items to add to the end of array1. */ - concat(...items: (T | T[])[]): T[]; + concat(...items: (T | ReadonlyArray)[]): T[]; /** * Adds all the elements of an array separated by the specified separator string. * @param separator A string used to separate one element of an array from the next in the resulting String. If omitted, the array elements are separated with a comma. @@ -1119,12 +1119,12 @@ interface Array { * Combines two or more arrays. * @param items Additional items to add to the end of array1. */ - concat(...items: T[][]): T[]; + concat(...items: ReadonlyArray[]): T[]; /** * Combines two or more arrays. * @param items Additional items to add to the end of array1. */ - concat(...items: (T | T[])[]): T[]; + concat(...items: (T | ReadonlyArray)[]): T[]; /** * Adds all the elements of an array separated by the specified separator string. * @param separator A string used to separate one element of an array from the next in the resulting String. If omitted, the array elements are separated with a comma. diff --git a/lib/lib.es2015.symbol.wellknown.d.ts b/lib/lib.es2015.symbol.wellknown.d.ts index 1d17534723a98..f323260bf896d 100644 --- a/lib/lib.es2015.symbol.wellknown.d.ts +++ b/lib/lib.es2015.symbol.wellknown.d.ts @@ -130,7 +130,7 @@ interface Map { readonly [Symbol.toStringTag]: "Map"; } -interface WeakMap{ +interface WeakMap { readonly [Symbol.toStringTag]: "WeakMap"; } diff --git a/lib/lib.es2016.full.d.ts b/lib/lib.es2016.full.d.ts index 09220599d5f97..07c6a3e8283e6 100644 --- a/lib/lib.es2016.full.d.ts +++ b/lib/lib.es2016.full.d.ts @@ -21,6 +21,1830 @@ and limitations under the License. /// /// +declare type PropertyKey = string | number | symbol; + +interface Array { + /** + * Returns the value of the first element in the array where predicate is true, and undefined + * otherwise. + * @param predicate find calls predicate once for each element of the array, in ascending + * order, until it finds one where predicate returns true. If such an element is found, find + * immediately returns that element value. Otherwise, find returns undefined. + * @param thisArg If provided, it will be used as the this value for each invocation of + * predicate. If it is not provided, undefined is used instead. + */ + find(predicate: (this: void, value: T, index: number, obj: Array) => boolean): T | undefined; + find(predicate: (this: void, value: T, index: number, obj: Array) => boolean, thisArg: undefined): T | undefined; + find(predicate: (this: Z, value: T, index: number, obj: Array) => boolean, thisArg: Z): T | undefined; + + /** + * Returns the index of the first element in the array where predicate is true, and -1 + * otherwise. + * @param predicate find calls predicate once for each element of the array, in ascending + * order, until it finds one where predicate returns true. If such an element is found, + * findIndex immediately returns that element index. Otherwise, findIndex returns -1. + * @param thisArg If provided, it will be used as the this value for each invocation of + * predicate. If it is not provided, undefined is used instead. + */ + findIndex(predicate: (this: void, value: T, index: number, obj: Array) => boolean): number; + findIndex(predicate: (this: void, value: T, index: number, obj: Array) => boolean, thisArg: undefined): number; + findIndex(predicate: (this: Z, value: T, index: number, obj: Array) => boolean, thisArg: Z): number; + + /** + * Returns the this object after filling the section identified by start and end with value + * @param value value to fill array section with + * @param start index to start filling the array at. If start is negative, it is treated as + * length+start where length is the length of the array. + * @param end index to stop filling the array at. If end is negative, it is treated as + * length+end. + */ + fill(value: T, start?: number, end?: number): this; + + /** + * Returns the this object after copying a section of the array identified by start and end + * to the same array starting at position target + * @param target If target is negative, it is treated as length+target where length is the + * length of the array. + * @param start If start is negative, it is treated as length+start. If end is negative, it + * is treated as length+end. + * @param end If not specified, length of the this object is used as its default value. + */ + copyWithin(target: number, start: number, end?: number): this; +} + +interface ArrayConstructor { + /** + * Creates an array from an array-like object. + * @param arrayLike An array-like object to convert to an array. + * @param mapfn A mapping function to call on every element of the array. + * @param thisArg Value of 'this' used to invoke the mapfn. + */ + from(arrayLike: ArrayLike, mapfn: (this: void, v: T, k: number) => U): Array; + from(arrayLike: ArrayLike, mapfn: (this: void, v: T, k: number) => U, thisArg: undefined): Array; + from(arrayLike: ArrayLike, mapfn: (this: Z, v: T, k: number) => U, thisArg: Z): Array; + + + /** + * Creates an array from an array-like object. + * @param arrayLike An array-like object to convert to an array. + */ + from(arrayLike: ArrayLike): Array; + + /** + * Returns a new array from a set of elements. + * @param items A set of elements to include in the new array object. + */ + of(...items: T[]): Array; +} + +interface DateConstructor { + new (value: Date): Date; +} + +interface Function { + /** + * Returns the name of the function. Function names are read-only and can not be changed. + */ + readonly name: string; +} + +interface Math { + /** + * Returns the number of leading zero bits in the 32-bit binary representation of a number. + * @param x A numeric expression. + */ + clz32(x: number): number; + + /** + * Returns the result of 32-bit multiplication of two numbers. + * @param x First number + * @param y Second number + */ + imul(x: number, y: number): number; + + /** + * Returns the sign of the x, indicating whether x is positive, negative or zero. + * @param x The numeric expression to test + */ + sign(x: number): number; + + /** + * Returns the base 10 logarithm of a number. + * @param x A numeric expression. + */ + log10(x: number): number; + + /** + * Returns the base 2 logarithm of a number. + * @param x A numeric expression. + */ + log2(x: number): number; + + /** + * Returns the natural logarithm of 1 + x. + * @param x A numeric expression. + */ + log1p(x: number): number; + + /** + * Returns the result of (e^x - 1) of x (e raised to the power of x, where e is the base of + * the natural logarithms). + * @param x A numeric expression. + */ + expm1(x: number): number; + + /** + * Returns the hyperbolic cosine of a number. + * @param x A numeric expression that contains an angle measured in radians. + */ + cosh(x: number): number; + + /** + * Returns the hyperbolic sine of a number. + * @param x A numeric expression that contains an angle measured in radians. + */ + sinh(x: number): number; + + /** + * Returns the hyperbolic tangent of a number. + * @param x A numeric expression that contains an angle measured in radians. + */ + tanh(x: number): number; + + /** + * Returns the inverse hyperbolic cosine of a number. + * @param x A numeric expression that contains an angle measured in radians. + */ + acosh(x: number): number; + + /** + * Returns the inverse hyperbolic sine of a number. + * @param x A numeric expression that contains an angle measured in radians. + */ + asinh(x: number): number; + + /** + * Returns the inverse hyperbolic tangent of a number. + * @param x A numeric expression that contains an angle measured in radians. + */ + atanh(x: number): number; + + /** + * Returns the square root of the sum of squares of its arguments. + * @param values Values to compute the square root for. + * If no arguments are passed, the result is +0. + * If there is only one argument, the result is the absolute value. + * If any argument is +Infinity or -Infinity, the result is +Infinity. + * If any argument is NaN, the result is NaN. + * If all arguments are either +0 or −0, the result is +0. + */ + hypot(...values: number[] ): number; + + /** + * Returns the integral part of the a numeric expression, x, removing any fractional digits. + * If x is already an integer, the result is x. + * @param x A numeric expression. + */ + trunc(x: number): number; + + /** + * Returns the nearest single precision float representation of a number. + * @param x A numeric expression. + */ + fround(x: number): number; + + /** + * Returns an implementation-dependent approximation to the cube root of number. + * @param x A numeric expression. + */ + cbrt(x: number): number; +} + +interface NumberConstructor { + /** + * The value of Number.EPSILON is the difference between 1 and the smallest value greater than 1 + * that is representable as a Number value, which is approximately: + * 2.2204460492503130808472633361816 x 10‍−‍16. + */ + readonly EPSILON: number; + + /** + * Returns true if passed value is finite. + * Unlike the global isFinite, Number.isFinite doesn't forcibly convert the parameter to a + * number. Only finite values of the type number, result in true. + * @param number A numeric value. + */ + isFinite(number: number): boolean; + + /** + * Returns true if the value passed is an integer, false otherwise. + * @param number A numeric value. + */ + isInteger(number: number): boolean; + + /** + * Returns a Boolean value that indicates whether a value is the reserved value NaN (not a + * number). Unlike the global isNaN(), Number.isNaN() doesn't forcefully convert the parameter + * to a number. Only values of the type number, that are also NaN, result in true. + * @param number A numeric value. + */ + isNaN(number: number): boolean; + + /** + * Returns true if the value passed is a safe integer. + * @param number A numeric value. + */ + isSafeInteger(number: number): boolean; + + /** + * The value of the largest integer n such that n and n + 1 are both exactly representable as + * a Number value. + * The value of Number.MAX_SAFE_INTEGER is 9007199254740991 2^53 − 1. + */ + readonly MAX_SAFE_INTEGER: number; + + /** + * The value of the smallest integer n such that n and n − 1 are both exactly representable as + * a Number value. + * The value of Number.MIN_SAFE_INTEGER is −9007199254740991 (−(2^53 − 1)). + */ + readonly MIN_SAFE_INTEGER: number; + + /** + * Converts a string to a floating-point number. + * @param string A string that contains a floating-point number. + */ + parseFloat(string: string): number; + + /** + * Converts A string to an integer. + * @param s A string to convert into a number. + * @param radix A value between 2 and 36 that specifies the base of the number in numString. + * If this argument is not supplied, strings with a prefix of '0x' are considered hexadecimal. + * All other strings are considered decimal. + */ + parseInt(string: string, radix?: number): number; +} + +interface Object { + /** + * Determines whether an object has a property with the specified name. + * @param v A property name. + */ + hasOwnProperty(v: PropertyKey): boolean; + + /** + * Determines whether a specified property is enumerable. + * @param v A property name. + */ + propertyIsEnumerable(v: PropertyKey): boolean; +} + +interface ObjectConstructor { + /** + * Copy the values of all of the enumerable own properties from one or more source objects to a + * target object. Returns the target object. + * @param target The target object to copy to. + * @param source The source object from which to copy properties. + */ + assign(target: T, source: U): T & U; + + /** + * Copy the values of all of the enumerable own properties from one or more source objects to a + * target object. Returns the target object. + * @param target The target object to copy to. + * @param source1 The first source object from which to copy properties. + * @param source2 The second source object from which to copy properties. + */ + assign(target: T, source1: U, source2: V): T & U & V; + + /** + * Copy the values of all of the enumerable own properties from one or more source objects to a + * target object. Returns the target object. + * @param target The target object to copy to. + * @param source1 The first source object from which to copy properties. + * @param source2 The second source object from which to copy properties. + * @param source3 The third source object from which to copy properties. + */ + assign(target: T, source1: U, source2: V, source3: W): T & U & V & W; + + /** + * Copy the values of all of the enumerable own properties from one or more source objects to a + * target object. Returns the target object. + * @param target The target object to copy to. + * @param sources One or more source objects from which to copy properties + */ + assign(target: object, ...sources: any[]): any; + + /** + * Returns an array of all symbol properties found directly on object o. + * @param o Object to retrieve the symbols from. + */ + getOwnPropertySymbols(o: any): symbol[]; + + /** + * Returns true if the values are the same value, false otherwise. + * @param value1 The first value. + * @param value2 The second value. + */ + is(value1: any, value2: any): boolean; + + /** + * Sets the prototype of a specified object o to object proto or null. Returns the object o. + * @param o The object to change its prototype. + * @param proto The value of the new prototype or null. + */ + setPrototypeOf(o: any, proto: object | null): any; + + /** + * Gets the own property descriptor of the specified object. + * An own property descriptor is one that is defined directly on the object and is not + * inherited from the object's prototype. + * @param o Object that contains the property. + * @param p Name of the property. + */ + getOwnPropertyDescriptor(o: any, propertyKey: PropertyKey): PropertyDescriptor; + + /** + * Adds a property to an object, or modifies attributes of an existing property. + * @param o Object on which to add or modify the property. This can be a native JavaScript + * object (that is, a user-defined object or a built in object) or a DOM object. + * @param p The property name. + * @param attributes Descriptor for the property. It can be for a data property or an accessor + * property. + */ + defineProperty(o: any, propertyKey: PropertyKey, attributes: PropertyDescriptor): any; +} + +interface ReadonlyArray { + /** + * Returns the value of the first element in the array where predicate is true, and undefined + * otherwise. + * @param predicate find calls predicate once for each element of the array, in ascending + * order, until it finds one where predicate returns true. If such an element is found, find + * immediately returns that element value. Otherwise, find returns undefined. + * @param thisArg If provided, it will be used as the this value for each invocation of + * predicate. If it is not provided, undefined is used instead. + */ + find(predicate: (this: void, value: T, index: number, obj: ReadonlyArray) => boolean): T | undefined; + find(predicate: (this: void, value: T, index: number, obj: ReadonlyArray) => boolean, thisArg: undefined): T | undefined; + find(predicate: (this: Z, value: T, index: number, obj: ReadonlyArray) => boolean, thisArg: Z): T | undefined; + + /** + * Returns the index of the first element in the array where predicate is true, and -1 + * otherwise. + * @param predicate find calls predicate once for each element of the array, in ascending + * order, until it finds one where predicate returns true. If such an element is found, + * findIndex immediately returns that element index. Otherwise, findIndex returns -1. + * @param thisArg If provided, it will be used as the this value for each invocation of + * predicate. If it is not provided, undefined is used instead. + */ + findIndex(predicate: (this: void, value: T, index: number, obj: Array) => boolean): number; + findIndex(predicate: (this: void, value: T, index: number, obj: Array) => boolean, thisArg: undefined): number; + findIndex(predicate: (this: Z, value: T, index: number, obj: Array) => boolean, thisArg: Z): number; +} + +interface RegExp { + /** + * Returns a string indicating the flags of the regular expression in question. This field is read-only. + * The characters in this string are sequenced and concatenated in the following order: + * + * - "g" for global + * - "i" for ignoreCase + * - "m" for multiline + * - "u" for unicode + * - "y" for sticky + * + * If no flags are set, the value is the empty string. + */ + readonly flags: string; + + /** + * Returns a Boolean value indicating the state of the sticky flag (y) used with a regular + * expression. Default is false. Read-only. + */ + readonly sticky: boolean; + + /** + * Returns a Boolean value indicating the state of the Unicode flag (u) used with a regular + * expression. Default is false. Read-only. + */ + readonly unicode: boolean; +} + +interface RegExpConstructor { + new (pattern: RegExp, flags?: string): RegExp; + (pattern: RegExp, flags?: string): RegExp; +} + +interface String { + /** + * Returns a nonnegative integer Number less than 1114112 (0x110000) that is the code point + * value of the UTF-16 encoded code point starting at the string element at position pos in + * the String resulting from converting this object to a String. + * If there is no element at that position, the result is undefined. + * If a valid UTF-16 surrogate pair does not begin at pos, the result is the code unit at pos. + */ + codePointAt(pos: number): number | undefined; + + /** + * Returns true if searchString appears as a substring of the result of converting this + * object to a String, at one or more positions that are + * greater than or equal to position; otherwise, returns false. + * @param searchString search string + * @param position If position is undefined, 0 is assumed, so as to search all of the String. + */ + includes(searchString: string, position?: number): boolean; + + /** + * Returns true if the sequence of elements of searchString converted to a String is the + * same as the corresponding elements of this object (converted to a String) starting at + * endPosition – length(this). Otherwise returns false. + */ + endsWith(searchString: string, endPosition?: number): boolean; + + /** + * Returns the String value result of normalizing the string into the normalization form + * named by form as specified in Unicode Standard Annex #15, Unicode Normalization Forms. + * @param form Applicable values: "NFC", "NFD", "NFKC", or "NFKD", If not specified default + * is "NFC" + */ + normalize(form: "NFC" | "NFD" | "NFKC" | "NFKD"): string; + + /** + * Returns the String value result of normalizing the string into the normalization form + * named by form as specified in Unicode Standard Annex #15, Unicode Normalization Forms. + * @param form Applicable values: "NFC", "NFD", "NFKC", or "NFKD", If not specified default + * is "NFC" + */ + normalize(form?: string): string; + + /** + * Returns a String value that is made from count copies appended together. If count is 0, + * T is the empty String is returned. + * @param count number of copies to append + */ + repeat(count: number): string; + + /** + * Returns true if the sequence of elements of searchString converted to a String is the + * same as the corresponding elements of this object (converted to a String) starting at + * position. Otherwise returns false. + */ + startsWith(searchString: string, position?: number): boolean; + + /** + * Returns an HTML anchor element and sets the name attribute to the text value + * @param name + */ + anchor(name: string): string; + + /** Returns a HTML element */ + big(): string; + + /** Returns a HTML element */ + blink(): string; + + /** Returns a HTML element */ + bold(): string; + + /** Returns a HTML element */ + fixed(): string; + + /** Returns a HTML element and sets the color attribute value */ + fontcolor(color: string): string; + + /** Returns a HTML element and sets the size attribute value */ + fontsize(size: number): string; + + /** Returns a HTML element and sets the size attribute value */ + fontsize(size: string): string; + + /** Returns an HTML element */ + italics(): string; + + /** Returns an HTML element and sets the href attribute value */ + link(url: string): string; + + /** Returns a HTML element */ + small(): string; + + /** Returns a HTML element */ + strike(): string; + + /** Returns a HTML element */ + sub(): string; + + /** Returns a HTML element */ + sup(): string; +} + +interface StringConstructor { + /** + * Return the String value whose elements are, in order, the elements in the List elements. + * If length is 0, the empty string is returned. + */ + fromCodePoint(...codePoints: number[]): string; + + /** + * String.raw is intended for use as a tag function of a Tagged Template String. When called + * as such the first argument will be a well formed template call site object and the rest + * parameter will contain the substitution values. + * @param template A well-formed template string call site representation. + * @param substitutions A set of substitution values. + */ + raw(template: TemplateStringsArray, ...substitutions: any[]): string; +} + + +interface Map { + clear(): void; + delete(key: K): boolean; + forEach(callbackfn: (value: V, key: K, map: Map) => void, thisArg?: any): void; + get(key: K): V | undefined; + has(key: K): boolean; + set(key: K, value: V): this; + readonly size: number; +} + +interface MapConstructor { + new (): Map; + new (entries?: [K, V][]): Map; + readonly prototype: Map; +} +declare var Map: MapConstructor; + +interface ReadonlyMap { + forEach(callbackfn: (value: V, key: K, map: ReadonlyMap) => void, thisArg?: any): void; + get(key: K): V | undefined; + has(key: K): boolean; + readonly size: number; +} + +interface WeakMap { + delete(key: K): boolean; + get(key: K): V | undefined; + has(key: K): boolean; + set(key: K, value: V): this; +} + +interface WeakMapConstructor { + new (): WeakMap; + new (entries?: [K, V][]): WeakMap; + readonly prototype: WeakMap; +} +declare var WeakMap: WeakMapConstructor; + +interface Set { + add(value: T): this; + clear(): void; + delete(value: T): boolean; + forEach(callbackfn: (value: T, value2: T, set: Set) => void, thisArg?: any): void; + has(value: T): boolean; + readonly size: number; +} + +interface SetConstructor { + new (): Set; + new (values?: T[]): Set; + readonly prototype: Set; +} +declare var Set: SetConstructor; + +interface ReadonlySet { + forEach(callbackfn: (value: T, value2: T, set: ReadonlySet) => void, thisArg?: any): void; + has(value: T): boolean; + readonly size: number; +} + +interface WeakSet { + add(value: T): this; + delete(value: T): boolean; + has(value: T): boolean; +} + +interface WeakSetConstructor { + new (): WeakSet; + new (values?: T[]): WeakSet; + readonly prototype: WeakSet; +} +declare var WeakSet: WeakSetConstructor; + + +interface Generator extends Iterator { } + +interface GeneratorFunction { + /** + * Creates a new Generator object. + * @param args A list of arguments the function accepts. + */ + new (...args: any[]): Generator; + /** + * Creates a new Generator object. + * @param args A list of arguments the function accepts. + */ + (...args: any[]): Generator; + /** + * The length of the arguments. + */ + readonly length: number; + /** + * Returns the name of the function. + */ + readonly name: string; + /** + * A reference to the prototype. + */ + readonly prototype: Generator; +} + +interface GeneratorFunctionConstructor { + /** + * Creates a new Generator function. + * @param args A list of arguments the function accepts. + */ + new (...args: string[]): GeneratorFunction; + /** + * Creates a new Generator function. + * @param args A list of arguments the function accepts. + */ + (...args: string[]): GeneratorFunction; + /** + * The length of the arguments. + */ + readonly length: number; + /** + * Returns the name of the function. + */ + readonly name: string; + /** + * A reference to the prototype. + */ + readonly prototype: GeneratorFunction; +} +declare var GeneratorFunction: GeneratorFunctionConstructor; + + +/// + +interface SymbolConstructor { + /** + * A method that returns the default iterator for an object. Called by the semantics of the + * for-of statement. + */ + readonly iterator: symbol; +} + +interface IteratorResult { + done: boolean; + value: T; +} + +interface Iterator { + next(value?: any): IteratorResult; + return?(value?: any): IteratorResult; + throw?(e?: any): IteratorResult; +} + +interface Iterable { + [Symbol.iterator](): Iterator; +} + +interface IterableIterator extends Iterator { + [Symbol.iterator](): IterableIterator; +} + +interface Array { + /** Iterator */ + [Symbol.iterator](): IterableIterator; + + /** + * Returns an iterable of key, value pairs for every entry in the array + */ + entries(): IterableIterator<[number, T]>; + + /** + * Returns an iterable of keys in the array + */ + keys(): IterableIterator; + + /** + * Returns an iterable of values in the array + */ + values(): IterableIterator; +} + +interface ArrayConstructor { + /** + * Creates an array from an iterable object. + * @param iterable An iterable object to convert to an array. + * @param mapfn A mapping function to call on every element of the array. + * @param thisArg Value of 'this' used to invoke the mapfn. + */ + from(iterable: Iterable, mapfn: (this: void, v: T, k: number) => U): Array; + from(iterable: Iterable, mapfn: (this: void, v: T, k: number) => U, thisArg: undefined): Array; + from(iterable: Iterable, mapfn: (this: Z, v: T, k: number) => U, thisArg: Z): Array; + + /** + * Creates an array from an iterable object. + * @param iterable An iterable object to convert to an array. + */ + from(iterable: Iterable): Array; +} + +interface ReadonlyArray { + /** Iterator of values in the array. */ + [Symbol.iterator](): IterableIterator; + + /** + * Returns an iterable of key, value pairs for every entry in the array + */ + entries(): IterableIterator<[number, T]>; + + /** + * Returns an iterable of keys in the array + */ + keys(): IterableIterator; + + /** + * Returns an iterable of values in the array + */ + values(): IterableIterator; +} + +interface IArguments { + /** Iterator */ + [Symbol.iterator](): IterableIterator; +} + +interface Map { + /** Returns an iterable of entries in the map. */ + [Symbol.iterator](): IterableIterator<[K, V]>; + + /** + * Returns an iterable of key, value pairs for every entry in the map. + */ + entries(): IterableIterator<[K, V]>; + + /** + * Returns an iterable of keys in the map + */ + keys(): IterableIterator; + + /** + * Returns an iterable of values in the map + */ + values(): IterableIterator; +} + +interface ReadonlyMap { + /** Returns an iterable of entries in the map. */ + [Symbol.iterator](): IterableIterator<[K, V]>; + + /** + * Returns an iterable of key, value pairs for every entry in the map. + */ + entries(): IterableIterator<[K, V]>; + + /** + * Returns an iterable of keys in the map + */ + keys(): IterableIterator; + + /** + * Returns an iterable of values in the map + */ + values(): IterableIterator; +} + +interface MapConstructor { + new (iterable: Iterable<[K, V]>): Map; +} + +interface WeakMap { } + +interface WeakMapConstructor { + new (iterable: Iterable<[K, V]>): WeakMap; +} + +interface Set { + /** Iterates over values in the set. */ + [Symbol.iterator](): IterableIterator; + /** + * Returns an iterable of [v,v] pairs for every value `v` in the set. + */ + entries(): IterableIterator<[T, T]>; + /** + * Despite its name, returns an iterable of the values in the set, + */ + keys(): IterableIterator; + + /** + * Returns an iterable of values in the set. + */ + values(): IterableIterator; +} + +interface ReadonlySet { + /** Iterates over values in the set. */ + [Symbol.iterator](): IterableIterator; + + /** + * Returns an iterable of [v,v] pairs for every value `v` in the set. + */ + entries(): IterableIterator<[T, T]>; + + /** + * Despite its name, returns an iterable of the values in the set, + */ + keys(): IterableIterator; + + /** + * Returns an iterable of values in the set. + */ + values(): IterableIterator; +} + +interface SetConstructor { + new (iterable: Iterable): Set; +} + +interface WeakSet { } + +interface WeakSetConstructor { + new (iterable: Iterable): WeakSet; +} + +interface Promise { } + +interface PromiseConstructor { + /** + * Creates a Promise that is resolved with an array of results when all of the provided Promises + * resolve, or rejected when any Promise is rejected. + * @param values An array of Promises. + * @returns A new Promise. + */ + all(values: Iterable>): Promise; + + /** + * Creates a Promise that is resolved or rejected when any of the provided Promises are resolved + * or rejected. + * @param values An array of Promises. + * @returns A new Promise. + */ + race(values: Iterable>): Promise; +} + +declare namespace Reflect { + function enumerate(target: object): IterableIterator; +} + +interface String { + /** Iterator */ + [Symbol.iterator](): IterableIterator; +} + +/** + * A typed array of 8-bit integer values. The contents are initialized to 0. If the requested + * number of bytes could not be allocated an exception is raised. + */ +interface Int8Array { + [Symbol.iterator](): IterableIterator; + /** + * Returns an array of key, value pairs for every entry in the array + */ + entries(): IterableIterator<[number, number]>; + /** + * Returns an list of keys in the array + */ + keys(): IterableIterator; + /** + * Returns an list of values in the array + */ + values(): IterableIterator; +} + +interface Int8ArrayConstructor { + new (elements: Iterable): Int8Array; + + /** + * Creates an array from an array-like or iterable object. + * @param arrayLike An array-like or iterable object to convert to an array. + * @param mapfn A mapping function to call on every element of the array. + * @param thisArg Value of 'this' used to invoke the mapfn. + */ + from(arrayLike: Iterable, mapfn: (this: void, v: number, k: number) => number): Int8Array; + from(arrayLike: Iterable, mapfn: (this: void, v: number, k: number) => number, thisArg: undefined): Int8Array; + from(arrayLike: Iterable, mapfn: (this: Z, v: number, k: number) => number, thisArg: Z): Int8Array; + + from(arrayLike: Iterable): Int8Array; +} + +/** + * A typed array of 8-bit unsigned integer values. The contents are initialized to 0. If the + * requested number of bytes could not be allocated an exception is raised. + */ +interface Uint8Array { + [Symbol.iterator](): IterableIterator; + /** + * Returns an array of key, value pairs for every entry in the array + */ + entries(): IterableIterator<[number, number]>; + /** + * Returns an list of keys in the array + */ + keys(): IterableIterator; + /** + * Returns an list of values in the array + */ + values(): IterableIterator; +} + +interface Uint8ArrayConstructor { + new (elements: Iterable): Uint8Array; + + /** + * Creates an array from an array-like or iterable object. + * @param arrayLike An array-like or iterable object to convert to an array. + * @param mapfn A mapping function to call on every element of the array. + * @param thisArg Value of 'this' used to invoke the mapfn. + */ + from(arrayLike: Iterable, mapfn: (this: void, v: number, k: number) => number): Uint8Array; + from(arrayLike: Iterable, mapfn: (this: void, v: number, k: number) => number, thisArg: undefined): Uint8Array; + from(arrayLike: Iterable, mapfn: (this: Z, v: number, k: number) => number, thisArg: Z): Uint8Array; + + from(arrayLike: Iterable): Uint8Array; +} + +/** + * A typed array of 8-bit unsigned integer (clamped) values. The contents are initialized to 0. + * If the requested number of bytes could not be allocated an exception is raised. + */ +interface Uint8ClampedArray { + [Symbol.iterator](): IterableIterator; + /** + * Returns an array of key, value pairs for every entry in the array + */ + entries(): IterableIterator<[number, number]>; + + /** + * Returns an list of keys in the array + */ + keys(): IterableIterator; + + /** + * Returns an list of values in the array + */ + values(): IterableIterator; +} + +interface Uint8ClampedArrayConstructor { + new (elements: Iterable): Uint8ClampedArray; + + + /** + * Creates an array from an array-like or iterable object. + * @param arrayLike An array-like or iterable object to convert to an array. + * @param mapfn A mapping function to call on every element of the array. + * @param thisArg Value of 'this' used to invoke the mapfn. + */ + from(arrayLike: Iterable, mapfn: (this: void, v: number, k: number) => number): Uint8ClampedArray; + from(arrayLike: Iterable, mapfn: (this: void, v: number, k: number) => number, thisArg: undefined): Uint8ClampedArray; + from(arrayLike: Iterable, mapfn: (this: Z, v: number, k: number) => number, thisArg: Z): Uint8ClampedArray; + + from(arrayLike: Iterable): Uint8ClampedArray; +} + +/** + * A typed array of 16-bit signed integer values. The contents are initialized to 0. If the + * requested number of bytes could not be allocated an exception is raised. + */ +interface Int16Array { + [Symbol.iterator](): IterableIterator; + /** + * Returns an array of key, value pairs for every entry in the array + */ + entries(): IterableIterator<[number, number]>; + + /** + * Returns an list of keys in the array + */ + keys(): IterableIterator; + + /** + * Returns an list of values in the array + */ + values(): IterableIterator; +} + +interface Int16ArrayConstructor { + new (elements: Iterable): Int16Array; + + /** + * Creates an array from an array-like or iterable object. + * @param arrayLike An array-like or iterable object to convert to an array. + * @param mapfn A mapping function to call on every element of the array. + * @param thisArg Value of 'this' used to invoke the mapfn. + */ + from(arrayLike: Iterable, mapfn: (this: void, v: number, k: number) => number): Int16Array; + from(arrayLike: Iterable, mapfn: (this: void, v: number, k: number) => number, thisArg: undefined): Int16Array; + from(arrayLike: Iterable, mapfn: (this: Z, v: number, k: number) => number, thisArg: Z): Int16Array; + + from(arrayLike: Iterable): Int16Array; +} + +/** + * A typed array of 16-bit unsigned integer values. The contents are initialized to 0. If the + * requested number of bytes could not be allocated an exception is raised. + */ +interface Uint16Array { + [Symbol.iterator](): IterableIterator; + /** + * Returns an array of key, value pairs for every entry in the array + */ + entries(): IterableIterator<[number, number]>; + /** + * Returns an list of keys in the array + */ + keys(): IterableIterator; + /** + * Returns an list of values in the array + */ + values(): IterableIterator; +} + +interface Uint16ArrayConstructor { + new (elements: Iterable): Uint16Array; + + /** + * Creates an array from an array-like or iterable object. + * @param arrayLike An array-like or iterable object to convert to an array. + * @param mapfn A mapping function to call on every element of the array. + * @param thisArg Value of 'this' used to invoke the mapfn. + */ + from(arrayLike: Iterable, mapfn: (this: void, v: number, k: number) => number): Uint16Array; + from(arrayLike: Iterable, mapfn: (this: void, v: number, k: number) => number, thisArg: undefined): Uint16Array; + from(arrayLike: Iterable, mapfn: (this: Z, v: number, k: number) => number, thisArg: Z): Uint16Array; + + from(arrayLike: Iterable): Uint16Array; +} + +/** + * A typed array of 32-bit signed integer values. The contents are initialized to 0. If the + * requested number of bytes could not be allocated an exception is raised. + */ +interface Int32Array { + [Symbol.iterator](): IterableIterator; + /** + * Returns an array of key, value pairs for every entry in the array + */ + entries(): IterableIterator<[number, number]>; + /** + * Returns an list of keys in the array + */ + keys(): IterableIterator; + /** + * Returns an list of values in the array + */ + values(): IterableIterator; +} + +interface Int32ArrayConstructor { + new (elements: Iterable): Int32Array; + + /** + * Creates an array from an array-like or iterable object. + * @param arrayLike An array-like or iterable object to convert to an array. + * @param mapfn A mapping function to call on every element of the array. + * @param thisArg Value of 'this' used to invoke the mapfn. + */ + from(arrayLike: Iterable, mapfn: (this: void, v: number, k: number) => number): Int32Array; + from(arrayLike: Iterable, mapfn: (this: void, v: number, k: number) => number, thisArg: undefined): Int32Array; + from(arrayLike: Iterable, mapfn: (this: Z, v: number, k: number) => number, thisArg: Z): Int32Array; + + from(arrayLike: Iterable): Int32Array; +} + +/** + * A typed array of 32-bit unsigned integer values. The contents are initialized to 0. If the + * requested number of bytes could not be allocated an exception is raised. + */ +interface Uint32Array { + [Symbol.iterator](): IterableIterator; + /** + * Returns an array of key, value pairs for every entry in the array + */ + entries(): IterableIterator<[number, number]>; + /** + * Returns an list of keys in the array + */ + keys(): IterableIterator; + /** + * Returns an list of values in the array + */ + values(): IterableIterator; +} + +interface Uint32ArrayConstructor { + new (elements: Iterable): Uint32Array; + + /** + * Creates an array from an array-like or iterable object. + * @param arrayLike An array-like or iterable object to convert to an array. + * @param mapfn A mapping function to call on every element of the array. + * @param thisArg Value of 'this' used to invoke the mapfn. + */ + from(arrayLike: Iterable, mapfn: (this: void, v: number, k: number) => number): Uint32Array; + from(arrayLike: Iterable, mapfn: (this: void, v: number, k: number) => number, thisArg: undefined): Uint32Array; + from(arrayLike: Iterable, mapfn: (this: Z, v: number, k: number) => number, thisArg: Z): Uint32Array; + + from(arrayLike: Iterable): Uint32Array; +} + +/** + * A typed array of 32-bit float values. The contents are initialized to 0. If the requested number + * of bytes could not be allocated an exception is raised. + */ +interface Float32Array { + [Symbol.iterator](): IterableIterator; + /** + * Returns an array of key, value pairs for every entry in the array + */ + entries(): IterableIterator<[number, number]>; + /** + * Returns an list of keys in the array + */ + keys(): IterableIterator; + /** + * Returns an list of values in the array + */ + values(): IterableIterator; +} + +interface Float32ArrayConstructor { + new (elements: Iterable): Float32Array; + + /** + * Creates an array from an array-like or iterable object. + * @param arrayLike An array-like or iterable object to convert to an array. + * @param mapfn A mapping function to call on every element of the array. + * @param thisArg Value of 'this' used to invoke the mapfn. + */ + from(arrayLike: Iterable, mapfn: (this: void, v: number, k: number) => number): Float32Array; + from(arrayLike: Iterable, mapfn: (this: void, v: number, k: number) => number, thisArg: undefined): Float32Array; + from(arrayLike: Iterable, mapfn: (this: Z, v: number, k: number) => number, thisArg: Z): Float32Array; + + from(arrayLike: Iterable): Float32Array; +} + +/** + * A typed array of 64-bit float values. The contents are initialized to 0. If the requested + * number of bytes could not be allocated an exception is raised. + */ +interface Float64Array { + [Symbol.iterator](): IterableIterator; + /** + * Returns an array of key, value pairs for every entry in the array + */ + entries(): IterableIterator<[number, number]>; + /** + * Returns an list of keys in the array + */ + keys(): IterableIterator; + /** + * Returns an list of values in the array + */ + values(): IterableIterator; +} + +interface Float64ArrayConstructor { + new (elements: Iterable): Float64Array; + + /** + * Creates an array from an array-like or iterable object. + * @param arrayLike An array-like or iterable object to convert to an array. + * @param mapfn A mapping function to call on every element of the array. + * @param thisArg Value of 'this' used to invoke the mapfn. + */ + from(arrayLike: Iterable, mapfn: (this: void, v: number, k: number) => number): Float64Array; + from(arrayLike: Iterable, mapfn: (this: void, v: number, k: number) => number, thisArg: undefined): Float64Array; + from(arrayLike: Iterable, mapfn: (this: Z, v: number, k: number) => number, thisArg: Z): Float64Array; + + from(arrayLike: Iterable): Float64Array; +} + + +interface PromiseConstructor { + /** + * A reference to the prototype. + */ + readonly prototype: Promise; + + /** + * Creates a new Promise. + * @param executor A callback used to initialize the promise. This callback is passed two arguments: + * a resolve callback used resolve the promise with a value or the result of another promise, + * and a reject callback used to reject the promise with a provided reason or error. + */ + new (executor: (resolve: (value?: T | PromiseLike) => void, reject: (reason?: any) => void) => void): Promise; + + /** + * Creates a Promise that is resolved with an array of results when all of the provided Promises + * resolve, or rejected when any Promise is rejected. + * @param values An array of Promises. + * @returns A new Promise. + */ + all(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike , T5 | PromiseLike, T6 | PromiseLike, T7 | PromiseLike, T8 | PromiseLike, T9 | PromiseLike, T10 | PromiseLike]): Promise<[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10]>; + + /** + * Creates a Promise that is resolved with an array of results when all of the provided Promises + * resolve, or rejected when any Promise is rejected. + * @param values An array of Promises. + * @returns A new Promise. + */ + all(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike , T5 | PromiseLike, T6 | PromiseLike, T7 | PromiseLike, T8 | PromiseLike, T9 | PromiseLike]): Promise<[T1, T2, T3, T4, T5, T6, T7, T8, T9]>; + + /** + * Creates a Promise that is resolved with an array of results when all of the provided Promises + * resolve, or rejected when any Promise is rejected. + * @param values An array of Promises. + * @returns A new Promise. + */ + all(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike , T5 | PromiseLike, T6 | PromiseLike, T7 | PromiseLike, T8 | PromiseLike]): Promise<[T1, T2, T3, T4, T5, T6, T7, T8]>; + + /** + * Creates a Promise that is resolved with an array of results when all of the provided Promises + * resolve, or rejected when any Promise is rejected. + * @param values An array of Promises. + * @returns A new Promise. + */ + all(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike , T5 | PromiseLike, T6 | PromiseLike, T7 | PromiseLike]): Promise<[T1, T2, T3, T4, T5, T6, T7]>; + + /** + * Creates a Promise that is resolved with an array of results when all of the provided Promises + * resolve, or rejected when any Promise is rejected. + * @param values An array of Promises. + * @returns A new Promise. + */ + all(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike , T5 | PromiseLike, T6 | PromiseLike]): Promise<[T1, T2, T3, T4, T5, T6]>; + + /** + * Creates a Promise that is resolved with an array of results when all of the provided Promises + * resolve, or rejected when any Promise is rejected. + * @param values An array of Promises. + * @returns A new Promise. + */ + all(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike , T5 | PromiseLike]): Promise<[T1, T2, T3, T4, T5]>; + + /** + * Creates a Promise that is resolved with an array of results when all of the provided Promises + * resolve, or rejected when any Promise is rejected. + * @param values An array of Promises. + * @returns A new Promise. + */ + all(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike ]): Promise<[T1, T2, T3, T4]>; + + /** + * Creates a Promise that is resolved with an array of results when all of the provided Promises + * resolve, or rejected when any Promise is rejected. + * @param values An array of Promises. + * @returns A new Promise. + */ + all(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike]): Promise<[T1, T2, T3]>; + + /** + * Creates a Promise that is resolved with an array of results when all of the provided Promises + * resolve, or rejected when any Promise is rejected. + * @param values An array of Promises. + * @returns A new Promise. + */ + all(values: [T1 | PromiseLike, T2 | PromiseLike]): Promise<[T1, T2]>; + + /** + * Creates a Promise that is resolved with an array of results when all of the provided Promises + * resolve, or rejected when any Promise is rejected. + * @param values An array of Promises. + * @returns A new Promise. + */ + all(values: (T | PromiseLike)[]): Promise; + + /** + * Creates a Promise that is resolved or rejected when any of the provided Promises are resolved + * or rejected. + * @param values An array of Promises. + * @returns A new Promise. + */ + race(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike, T5 | PromiseLike, T6 | PromiseLike, T7 | PromiseLike, T8 | PromiseLike, T9 | PromiseLike, T10 | PromiseLike]): Promise; + + /** + * Creates a Promise that is resolved or rejected when any of the provided Promises are resolved + * or rejected. + * @param values An array of Promises. + * @returns A new Promise. + */ + race(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike, T5 | PromiseLike, T6 | PromiseLike, T7 | PromiseLike, T8 | PromiseLike, T9 | PromiseLike]): Promise; + + /** + * Creates a Promise that is resolved or rejected when any of the provided Promises are resolved + * or rejected. + * @param values An array of Promises. + * @returns A new Promise. + */ + race(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike, T5 | PromiseLike, T6 | PromiseLike, T7 | PromiseLike, T8 | PromiseLike]): Promise; + + /** + * Creates a Promise that is resolved or rejected when any of the provided Promises are resolved + * or rejected. + * @param values An array of Promises. + * @returns A new Promise. + */ + race(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike, T5 | PromiseLike, T6 | PromiseLike, T7 | PromiseLike]): Promise; + + /** + * Creates a Promise that is resolved or rejected when any of the provided Promises are resolved + * or rejected. + * @param values An array of Promises. + * @returns A new Promise. + */ + race(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike, T5 | PromiseLike, T6 | PromiseLike]): Promise; + + /** + * Creates a Promise that is resolved or rejected when any of the provided Promises are resolved + * or rejected. + * @param values An array of Promises. + * @returns A new Promise. + */ + race(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike, T5 | PromiseLike]): Promise; + + /** + * Creates a Promise that is resolved or rejected when any of the provided Promises are resolved + * or rejected. + * @param values An array of Promises. + * @returns A new Promise. + */ + race(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike]): Promise; + + /** + * Creates a Promise that is resolved or rejected when any of the provided Promises are resolved + * or rejected. + * @param values An array of Promises. + * @returns A new Promise. + */ + race(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike]): Promise; + + /** + * Creates a Promise that is resolved or rejected when any of the provided Promises are resolved + * or rejected. + * @param values An array of Promises. + * @returns A new Promise. + */ + race(values: [T1 | PromiseLike, T2 | PromiseLike]): Promise; + + /** + * Creates a Promise that is resolved or rejected when any of the provided Promises are resolved + * or rejected. + * @param values An array of Promises. + * @returns A new Promise. + */ + race(values: (T | PromiseLike)[]): Promise; + + /** + * Creates a new rejected promise for the provided reason. + * @param reason The reason the promise was rejected. + * @returns A new rejected Promise. + */ + reject(reason: any): Promise; + + /** + * Creates a new rejected promise for the provided reason. + * @param reason The reason the promise was rejected. + * @returns A new rejected Promise. + */ + reject(reason: any): Promise; + + /** + * Creates a new resolved promise for the provided value. + * @param value A promise. + * @returns A promise whose internal state matches the provided promise. + */ + resolve(value: T | PromiseLike): Promise; + + /** + * Creates a new resolved promise . + * @returns A resolved promise. + */ + resolve(): Promise; +} + +declare var Promise: PromiseConstructor; + +interface ProxyHandler { + getPrototypeOf? (target: T): object | null; + setPrototypeOf? (target: T, v: any): boolean; + isExtensible? (target: T): boolean; + preventExtensions? (target: T): boolean; + getOwnPropertyDescriptor? (target: T, p: PropertyKey): PropertyDescriptor | undefined; + has? (target: T, p: PropertyKey): boolean; + get? (target: T, p: PropertyKey, receiver: any): any; + set? (target: T, p: PropertyKey, value: any, receiver: any): boolean; + deleteProperty? (target: T, p: PropertyKey): boolean; + defineProperty? (target: T, p: PropertyKey, attributes: PropertyDescriptor): boolean; + enumerate? (target: T): PropertyKey[]; + ownKeys? (target: T): PropertyKey[]; + apply? (target: T, thisArg: any, argArray?: any): any; + construct? (target: T, argArray: any, newTarget?: any): object; +} + +interface ProxyConstructor { + revocable(target: T, handler: ProxyHandler): { proxy: T; revoke: () => void; }; + new (target: T, handler: ProxyHandler): T; +} +declare var Proxy: ProxyConstructor; + + +declare namespace Reflect { + function apply(target: Function, thisArgument: any, argumentsList: ArrayLike): any; + function construct(target: Function, argumentsList: ArrayLike, newTarget?: any): any; + function defineProperty(target: object, propertyKey: PropertyKey, attributes: PropertyDescriptor): boolean; + function deleteProperty(target: object, propertyKey: PropertyKey): boolean; + function get(target: object, propertyKey: PropertyKey, receiver?: any): any; + function getOwnPropertyDescriptor(target: object, propertyKey: PropertyKey): PropertyDescriptor; + function getPrototypeOf(target: object): object; + function has(target: object, propertyKey: PropertyKey): boolean; + function isExtensible(target: object): boolean; + function ownKeys(target: object): Array; + function preventExtensions(target: object): boolean; + function set(target: object, propertyKey: PropertyKey, value: any, receiver?: any): boolean; + function setPrototypeOf(target: object, proto: any): boolean; +} + + +interface Symbol { + /** Returns a string representation of an object. */ + toString(): string; + + /** Returns the primitive value of the specified object. */ + valueOf(): symbol; +} + +interface SymbolConstructor { + /** + * A reference to the prototype. + */ + readonly prototype: Symbol; + + /** + * Returns a new unique Symbol value. + * @param description Description of the new Symbol object. + */ + (description?: string | number): symbol; + + /** + * Returns a Symbol object from the global symbol registry matching the given key if found. + * Otherwise, returns a new symbol with this key. + * @param key key to search for. + */ + for(key: string): symbol; + + /** + * Returns a key from the global symbol registry matching the given Symbol if found. + * Otherwise, returns a undefined. + * @param sym Symbol to find the key for. + */ + keyFor(sym: symbol): string | undefined; +} + +declare var Symbol: SymbolConstructor; + +/// + +interface SymbolConstructor { + /** + * A method that determines if a constructor object recognizes an object as one of the + * constructor’s instances. Called by the semantics of the instanceof operator. + */ + readonly hasInstance: symbol; + + /** + * A Boolean value that if true indicates that an object should flatten to its array elements + * by Array.prototype.concat. + */ + readonly isConcatSpreadable: symbol; + + /** + * A regular expression method that matches the regular expression against a string. Called + * by the String.prototype.match method. + */ + readonly match: symbol; + + /** + * A regular expression method that replaces matched substrings of a string. Called by the + * String.prototype.replace method. + */ + readonly replace: symbol; + + /** + * A regular expression method that returns the index within a string that matches the + * regular expression. Called by the String.prototype.search method. + */ + readonly search: symbol; + + /** + * A function valued property that is the constructor function that is used to create + * derived objects. + */ + readonly species: symbol; + + /** + * A regular expression method that splits a string at the indices that match the regular + * expression. Called by the String.prototype.split method. + */ + readonly split: symbol; + + /** + * A method that converts an object to a corresponding primitive value. + * Called by the ToPrimitive abstract operation. + */ + readonly toPrimitive: symbol; + + /** + * A String value that is used in the creation of the default string description of an object. + * Called by the built-in method Object.prototype.toString. + */ + readonly toStringTag: symbol; + + /** + * An Object whose own property names are property names that are excluded from the 'with' + * environment bindings of the associated objects. + */ + readonly unscopables: symbol; +} + +interface Symbol { + readonly [Symbol.toStringTag]: "Symbol"; +} + +interface Array { + /** + * Returns an object whose properties have the value 'true' + * when they will be absent when used in a 'with' statement. + */ + [Symbol.unscopables](): { + copyWithin: boolean; + entries: boolean; + fill: boolean; + find: boolean; + findIndex: boolean; + keys: boolean; + values: boolean; + }; +} + +interface Date { + /** + * Converts a Date object to a string. + */ + [Symbol.toPrimitive](hint: "default"): string; + /** + * Converts a Date object to a string. + */ + [Symbol.toPrimitive](hint: "string"): string; + /** + * Converts a Date object to a number. + */ + [Symbol.toPrimitive](hint: "number"): number; + /** + * Converts a Date object to a string or number. + * + * @param hint The strings "number", "string", or "default" to specify what primitive to return. + * + * @throws {TypeError} If 'hint' was given something other than "number", "string", or "default". + * @returns A number if 'hint' was "number", a string if 'hint' was "string" or "default". + */ + [Symbol.toPrimitive](hint: string): string | number; +} + +interface Map { + readonly [Symbol.toStringTag]: "Map"; +} + +interface WeakMap { + readonly [Symbol.toStringTag]: "WeakMap"; +} + +interface Set { + readonly [Symbol.toStringTag]: "Set"; +} + +interface WeakSet { + readonly [Symbol.toStringTag]: "WeakSet"; +} + +interface JSON { + readonly [Symbol.toStringTag]: "JSON"; +} + +interface Function { + /** + * Determines whether the given value inherits from this function if this function was used + * as a constructor function. + * + * A constructor function can control which objects are recognized as its instances by + * 'instanceof' by overriding this method. + */ + [Symbol.hasInstance](value: any): boolean; +} + +interface GeneratorFunction { + readonly [Symbol.toStringTag]: "GeneratorFunction"; +} + +interface Math { + readonly [Symbol.toStringTag]: "Math"; +} + +interface Promise { + readonly [Symbol.toStringTag]: "Promise"; +} + +interface PromiseConstructor { + readonly [Symbol.species]: Function; +} + +interface RegExp { + /** + * Matches a string with this regular expression, and returns an array containing the results of + * that search. + * @param string A string to search within. + */ + [Symbol.match](string: string): RegExpMatchArray | null; + + /** + * Replaces text in a string, using this regular expression. + * @param string A String object or string literal whose contents matching against + * this regular expression will be replaced + * @param replaceValue A String object or string literal containing the text to replace for every + * successful match of this regular expression. + */ + [Symbol.replace](string: string, replaceValue: string): string; + + /** + * Replaces text in a string, using this regular expression. + * @param string A String object or string literal whose contents matching against + * this regular expression will be replaced + * @param replacer A function that returns the replacement text. + */ + [Symbol.replace](string: string, replacer: (substring: string, ...args: any[]) => string): string; + + /** + * Finds the position beginning first substring match in a regular expression search + * using this regular expression. + * + * @param string The string to search within. + */ + [Symbol.search](string: string): number; + + /** + * Returns an array of substrings that were delimited by strings in the original input that + * match against this regular expression. + * + * If the regular expression contains capturing parentheses, then each time this + * regular expression matches, the results (including any undefined results) of the + * capturing parentheses are spliced. + * + * @param string string value to split + * @param limit if not undefined, the output array is truncated so that it contains no more + * than 'limit' elements. + */ + [Symbol.split](string: string, limit?: number): string[]; +} + +interface RegExpConstructor { + [Symbol.species](): RegExpConstructor; +} + +interface String { + /** + * Matches a string an object that supports being matched against, and returns an array containing the results of that search. + * @param matcher An object that supports being matched against. + */ + match(matcher: { [Symbol.match](string: string): RegExpMatchArray | null; }): RegExpMatchArray | null; + + /** + * Replaces text in a string, using an object that supports replacement within a string. + * @param searchValue A object can search for and replace matches within a string. + * @param replaceValue A string containing the text to replace for every successful match of searchValue in this string. + */ + replace(searchValue: { [Symbol.replace](string: string, replaceValue: string): string; }, replaceValue: string): string; + + /** + * Replaces text in a string, using an object that supports replacement within a string. + * @param searchValue A object can search for and replace matches within a string. + * @param replacer A function that returns the replacement text. + */ + replace(searchValue: { [Symbol.replace](string: string, replacer: (substring: string, ...args: any[]) => string): string; }, replacer: (substring: string, ...args: any[]) => string): string; + + /** + * Finds the first substring match in a regular expression search. + * @param searcher An object which supports searching within a string. + */ + search(searcher: { [Symbol.search](string: string): number; }): number; + + /** + * Split a string into substrings using the specified separator and return them as an array. + * @param splitter An object that can split a string. + * @param limit A value used to limit the number of elements returned in the array. + */ + split(splitter: { [Symbol.split](string: string, limit?: number): string[]; }, limit?: number): string[]; +} + +/** + * Represents a raw buffer of binary data, which is used to store data for the + * different typed arrays. ArrayBuffers cannot be read from or written to directly, + * but can be passed to a typed array or DataView Object to interpret the raw + * buffer as needed. + */ +interface ArrayBuffer { + readonly [Symbol.toStringTag]: "ArrayBuffer"; +} + +interface DataView { + readonly [Symbol.toStringTag]: "DataView"; +} + +/** + * A typed array of 8-bit integer values. The contents are initialized to 0. If the requested + * number of bytes could not be allocated an exception is raised. + */ +interface Int8Array { + readonly [Symbol.toStringTag]: "Int8Array"; +} + +/** + * A typed array of 8-bit unsigned integer values. The contents are initialized to 0. If the + * requested number of bytes could not be allocated an exception is raised. + */ +interface Uint8Array { + readonly [Symbol.toStringTag]: "UInt8Array"; +} + +/** + * A typed array of 8-bit unsigned integer (clamped) values. The contents are initialized to 0. + * If the requested number of bytes could not be allocated an exception is raised. + */ +interface Uint8ClampedArray { + readonly [Symbol.toStringTag]: "Uint8ClampedArray"; +} + +/** + * A typed array of 16-bit signed integer values. The contents are initialized to 0. If the + * requested number of bytes could not be allocated an exception is raised. + */ +interface Int16Array { + readonly [Symbol.toStringTag]: "Int16Array"; +} + +/** + * A typed array of 16-bit unsigned integer values. The contents are initialized to 0. If the + * requested number of bytes could not be allocated an exception is raised. + */ +interface Uint16Array { + readonly [Symbol.toStringTag]: "Uint16Array"; +} + +/** + * A typed array of 32-bit signed integer values. The contents are initialized to 0. If the + * requested number of bytes could not be allocated an exception is raised. + */ +interface Int32Array { + readonly [Symbol.toStringTag]: "Int32Array"; +} + +/** + * A typed array of 32-bit unsigned integer values. The contents are initialized to 0. If the + * requested number of bytes could not be allocated an exception is raised. + */ +interface Uint32Array { + readonly [Symbol.toStringTag]: "Uint32Array"; +} + +/** + * A typed array of 32-bit float values. The contents are initialized to 0. If the requested number + * of bytes could not be allocated an exception is raised. + */ +interface Float32Array { + readonly [Symbol.toStringTag]: "Float32Array"; +} + +/** + * A typed array of 64-bit float values. The contents are initialized to 0. If the requested + * number of bytes could not be allocated an exception is raised. + */ +interface Float64Array { + readonly [Symbol.toStringTag]: "Float64Array"; +} + + ///////////////////////////// /// DOM APIs diff --git a/lib/lib.es2017.full.d.ts b/lib/lib.es2017.full.d.ts index 6c2f260664026..331f822c6fe12 100644 --- a/lib/lib.es2017.full.d.ts +++ b/lib/lib.es2017.full.d.ts @@ -25,6 +25,1830 @@ and limitations under the License. /// +declare type PropertyKey = string | number | symbol; + +interface Array { + /** + * Returns the value of the first element in the array where predicate is true, and undefined + * otherwise. + * @param predicate find calls predicate once for each element of the array, in ascending + * order, until it finds one where predicate returns true. If such an element is found, find + * immediately returns that element value. Otherwise, find returns undefined. + * @param thisArg If provided, it will be used as the this value for each invocation of + * predicate. If it is not provided, undefined is used instead. + */ + find(predicate: (this: void, value: T, index: number, obj: Array) => boolean): T | undefined; + find(predicate: (this: void, value: T, index: number, obj: Array) => boolean, thisArg: undefined): T | undefined; + find(predicate: (this: Z, value: T, index: number, obj: Array) => boolean, thisArg: Z): T | undefined; + + /** + * Returns the index of the first element in the array where predicate is true, and -1 + * otherwise. + * @param predicate find calls predicate once for each element of the array, in ascending + * order, until it finds one where predicate returns true. If such an element is found, + * findIndex immediately returns that element index. Otherwise, findIndex returns -1. + * @param thisArg If provided, it will be used as the this value for each invocation of + * predicate. If it is not provided, undefined is used instead. + */ + findIndex(predicate: (this: void, value: T, index: number, obj: Array) => boolean): number; + findIndex(predicate: (this: void, value: T, index: number, obj: Array) => boolean, thisArg: undefined): number; + findIndex(predicate: (this: Z, value: T, index: number, obj: Array) => boolean, thisArg: Z): number; + + /** + * Returns the this object after filling the section identified by start and end with value + * @param value value to fill array section with + * @param start index to start filling the array at. If start is negative, it is treated as + * length+start where length is the length of the array. + * @param end index to stop filling the array at. If end is negative, it is treated as + * length+end. + */ + fill(value: T, start?: number, end?: number): this; + + /** + * Returns the this object after copying a section of the array identified by start and end + * to the same array starting at position target + * @param target If target is negative, it is treated as length+target where length is the + * length of the array. + * @param start If start is negative, it is treated as length+start. If end is negative, it + * is treated as length+end. + * @param end If not specified, length of the this object is used as its default value. + */ + copyWithin(target: number, start: number, end?: number): this; +} + +interface ArrayConstructor { + /** + * Creates an array from an array-like object. + * @param arrayLike An array-like object to convert to an array. + * @param mapfn A mapping function to call on every element of the array. + * @param thisArg Value of 'this' used to invoke the mapfn. + */ + from(arrayLike: ArrayLike, mapfn: (this: void, v: T, k: number) => U): Array; + from(arrayLike: ArrayLike, mapfn: (this: void, v: T, k: number) => U, thisArg: undefined): Array; + from(arrayLike: ArrayLike, mapfn: (this: Z, v: T, k: number) => U, thisArg: Z): Array; + + + /** + * Creates an array from an array-like object. + * @param arrayLike An array-like object to convert to an array. + */ + from(arrayLike: ArrayLike): Array; + + /** + * Returns a new array from a set of elements. + * @param items A set of elements to include in the new array object. + */ + of(...items: T[]): Array; +} + +interface DateConstructor { + new (value: Date): Date; +} + +interface Function { + /** + * Returns the name of the function. Function names are read-only and can not be changed. + */ + readonly name: string; +} + +interface Math { + /** + * Returns the number of leading zero bits in the 32-bit binary representation of a number. + * @param x A numeric expression. + */ + clz32(x: number): number; + + /** + * Returns the result of 32-bit multiplication of two numbers. + * @param x First number + * @param y Second number + */ + imul(x: number, y: number): number; + + /** + * Returns the sign of the x, indicating whether x is positive, negative or zero. + * @param x The numeric expression to test + */ + sign(x: number): number; + + /** + * Returns the base 10 logarithm of a number. + * @param x A numeric expression. + */ + log10(x: number): number; + + /** + * Returns the base 2 logarithm of a number. + * @param x A numeric expression. + */ + log2(x: number): number; + + /** + * Returns the natural logarithm of 1 + x. + * @param x A numeric expression. + */ + log1p(x: number): number; + + /** + * Returns the result of (e^x - 1) of x (e raised to the power of x, where e is the base of + * the natural logarithms). + * @param x A numeric expression. + */ + expm1(x: number): number; + + /** + * Returns the hyperbolic cosine of a number. + * @param x A numeric expression that contains an angle measured in radians. + */ + cosh(x: number): number; + + /** + * Returns the hyperbolic sine of a number. + * @param x A numeric expression that contains an angle measured in radians. + */ + sinh(x: number): number; + + /** + * Returns the hyperbolic tangent of a number. + * @param x A numeric expression that contains an angle measured in radians. + */ + tanh(x: number): number; + + /** + * Returns the inverse hyperbolic cosine of a number. + * @param x A numeric expression that contains an angle measured in radians. + */ + acosh(x: number): number; + + /** + * Returns the inverse hyperbolic sine of a number. + * @param x A numeric expression that contains an angle measured in radians. + */ + asinh(x: number): number; + + /** + * Returns the inverse hyperbolic tangent of a number. + * @param x A numeric expression that contains an angle measured in radians. + */ + atanh(x: number): number; + + /** + * Returns the square root of the sum of squares of its arguments. + * @param values Values to compute the square root for. + * If no arguments are passed, the result is +0. + * If there is only one argument, the result is the absolute value. + * If any argument is +Infinity or -Infinity, the result is +Infinity. + * If any argument is NaN, the result is NaN. + * If all arguments are either +0 or −0, the result is +0. + */ + hypot(...values: number[] ): number; + + /** + * Returns the integral part of the a numeric expression, x, removing any fractional digits. + * If x is already an integer, the result is x. + * @param x A numeric expression. + */ + trunc(x: number): number; + + /** + * Returns the nearest single precision float representation of a number. + * @param x A numeric expression. + */ + fround(x: number): number; + + /** + * Returns an implementation-dependent approximation to the cube root of number. + * @param x A numeric expression. + */ + cbrt(x: number): number; +} + +interface NumberConstructor { + /** + * The value of Number.EPSILON is the difference between 1 and the smallest value greater than 1 + * that is representable as a Number value, which is approximately: + * 2.2204460492503130808472633361816 x 10‍−‍16. + */ + readonly EPSILON: number; + + /** + * Returns true if passed value is finite. + * Unlike the global isFinite, Number.isFinite doesn't forcibly convert the parameter to a + * number. Only finite values of the type number, result in true. + * @param number A numeric value. + */ + isFinite(number: number): boolean; + + /** + * Returns true if the value passed is an integer, false otherwise. + * @param number A numeric value. + */ + isInteger(number: number): boolean; + + /** + * Returns a Boolean value that indicates whether a value is the reserved value NaN (not a + * number). Unlike the global isNaN(), Number.isNaN() doesn't forcefully convert the parameter + * to a number. Only values of the type number, that are also NaN, result in true. + * @param number A numeric value. + */ + isNaN(number: number): boolean; + + /** + * Returns true if the value passed is a safe integer. + * @param number A numeric value. + */ + isSafeInteger(number: number): boolean; + + /** + * The value of the largest integer n such that n and n + 1 are both exactly representable as + * a Number value. + * The value of Number.MAX_SAFE_INTEGER is 9007199254740991 2^53 − 1. + */ + readonly MAX_SAFE_INTEGER: number; + + /** + * The value of the smallest integer n such that n and n − 1 are both exactly representable as + * a Number value. + * The value of Number.MIN_SAFE_INTEGER is −9007199254740991 (−(2^53 − 1)). + */ + readonly MIN_SAFE_INTEGER: number; + + /** + * Converts a string to a floating-point number. + * @param string A string that contains a floating-point number. + */ + parseFloat(string: string): number; + + /** + * Converts A string to an integer. + * @param s A string to convert into a number. + * @param radix A value between 2 and 36 that specifies the base of the number in numString. + * If this argument is not supplied, strings with a prefix of '0x' are considered hexadecimal. + * All other strings are considered decimal. + */ + parseInt(string: string, radix?: number): number; +} + +interface Object { + /** + * Determines whether an object has a property with the specified name. + * @param v A property name. + */ + hasOwnProperty(v: PropertyKey): boolean; + + /** + * Determines whether a specified property is enumerable. + * @param v A property name. + */ + propertyIsEnumerable(v: PropertyKey): boolean; +} + +interface ObjectConstructor { + /** + * Copy the values of all of the enumerable own properties from one or more source objects to a + * target object. Returns the target object. + * @param target The target object to copy to. + * @param source The source object from which to copy properties. + */ + assign(target: T, source: U): T & U; + + /** + * Copy the values of all of the enumerable own properties from one or more source objects to a + * target object. Returns the target object. + * @param target The target object to copy to. + * @param source1 The first source object from which to copy properties. + * @param source2 The second source object from which to copy properties. + */ + assign(target: T, source1: U, source2: V): T & U & V; + + /** + * Copy the values of all of the enumerable own properties from one or more source objects to a + * target object. Returns the target object. + * @param target The target object to copy to. + * @param source1 The first source object from which to copy properties. + * @param source2 The second source object from which to copy properties. + * @param source3 The third source object from which to copy properties. + */ + assign(target: T, source1: U, source2: V, source3: W): T & U & V & W; + + /** + * Copy the values of all of the enumerable own properties from one or more source objects to a + * target object. Returns the target object. + * @param target The target object to copy to. + * @param sources One or more source objects from which to copy properties + */ + assign(target: object, ...sources: any[]): any; + + /** + * Returns an array of all symbol properties found directly on object o. + * @param o Object to retrieve the symbols from. + */ + getOwnPropertySymbols(o: any): symbol[]; + + /** + * Returns true if the values are the same value, false otherwise. + * @param value1 The first value. + * @param value2 The second value. + */ + is(value1: any, value2: any): boolean; + + /** + * Sets the prototype of a specified object o to object proto or null. Returns the object o. + * @param o The object to change its prototype. + * @param proto The value of the new prototype or null. + */ + setPrototypeOf(o: any, proto: object | null): any; + + /** + * Gets the own property descriptor of the specified object. + * An own property descriptor is one that is defined directly on the object and is not + * inherited from the object's prototype. + * @param o Object that contains the property. + * @param p Name of the property. + */ + getOwnPropertyDescriptor(o: any, propertyKey: PropertyKey): PropertyDescriptor; + + /** + * Adds a property to an object, or modifies attributes of an existing property. + * @param o Object on which to add or modify the property. This can be a native JavaScript + * object (that is, a user-defined object or a built in object) or a DOM object. + * @param p The property name. + * @param attributes Descriptor for the property. It can be for a data property or an accessor + * property. + */ + defineProperty(o: any, propertyKey: PropertyKey, attributes: PropertyDescriptor): any; +} + +interface ReadonlyArray { + /** + * Returns the value of the first element in the array where predicate is true, and undefined + * otherwise. + * @param predicate find calls predicate once for each element of the array, in ascending + * order, until it finds one where predicate returns true. If such an element is found, find + * immediately returns that element value. Otherwise, find returns undefined. + * @param thisArg If provided, it will be used as the this value for each invocation of + * predicate. If it is not provided, undefined is used instead. + */ + find(predicate: (this: void, value: T, index: number, obj: ReadonlyArray) => boolean): T | undefined; + find(predicate: (this: void, value: T, index: number, obj: ReadonlyArray) => boolean, thisArg: undefined): T | undefined; + find(predicate: (this: Z, value: T, index: number, obj: ReadonlyArray) => boolean, thisArg: Z): T | undefined; + + /** + * Returns the index of the first element in the array where predicate is true, and -1 + * otherwise. + * @param predicate find calls predicate once for each element of the array, in ascending + * order, until it finds one where predicate returns true. If such an element is found, + * findIndex immediately returns that element index. Otherwise, findIndex returns -1. + * @param thisArg If provided, it will be used as the this value for each invocation of + * predicate. If it is not provided, undefined is used instead. + */ + findIndex(predicate: (this: void, value: T, index: number, obj: Array) => boolean): number; + findIndex(predicate: (this: void, value: T, index: number, obj: Array) => boolean, thisArg: undefined): number; + findIndex(predicate: (this: Z, value: T, index: number, obj: Array) => boolean, thisArg: Z): number; +} + +interface RegExp { + /** + * Returns a string indicating the flags of the regular expression in question. This field is read-only. + * The characters in this string are sequenced and concatenated in the following order: + * + * - "g" for global + * - "i" for ignoreCase + * - "m" for multiline + * - "u" for unicode + * - "y" for sticky + * + * If no flags are set, the value is the empty string. + */ + readonly flags: string; + + /** + * Returns a Boolean value indicating the state of the sticky flag (y) used with a regular + * expression. Default is false. Read-only. + */ + readonly sticky: boolean; + + /** + * Returns a Boolean value indicating the state of the Unicode flag (u) used with a regular + * expression. Default is false. Read-only. + */ + readonly unicode: boolean; +} + +interface RegExpConstructor { + new (pattern: RegExp, flags?: string): RegExp; + (pattern: RegExp, flags?: string): RegExp; +} + +interface String { + /** + * Returns a nonnegative integer Number less than 1114112 (0x110000) that is the code point + * value of the UTF-16 encoded code point starting at the string element at position pos in + * the String resulting from converting this object to a String. + * If there is no element at that position, the result is undefined. + * If a valid UTF-16 surrogate pair does not begin at pos, the result is the code unit at pos. + */ + codePointAt(pos: number): number | undefined; + + /** + * Returns true if searchString appears as a substring of the result of converting this + * object to a String, at one or more positions that are + * greater than or equal to position; otherwise, returns false. + * @param searchString search string + * @param position If position is undefined, 0 is assumed, so as to search all of the String. + */ + includes(searchString: string, position?: number): boolean; + + /** + * Returns true if the sequence of elements of searchString converted to a String is the + * same as the corresponding elements of this object (converted to a String) starting at + * endPosition – length(this). Otherwise returns false. + */ + endsWith(searchString: string, endPosition?: number): boolean; + + /** + * Returns the String value result of normalizing the string into the normalization form + * named by form as specified in Unicode Standard Annex #15, Unicode Normalization Forms. + * @param form Applicable values: "NFC", "NFD", "NFKC", or "NFKD", If not specified default + * is "NFC" + */ + normalize(form: "NFC" | "NFD" | "NFKC" | "NFKD"): string; + + /** + * Returns the String value result of normalizing the string into the normalization form + * named by form as specified in Unicode Standard Annex #15, Unicode Normalization Forms. + * @param form Applicable values: "NFC", "NFD", "NFKC", or "NFKD", If not specified default + * is "NFC" + */ + normalize(form?: string): string; + + /** + * Returns a String value that is made from count copies appended together. If count is 0, + * T is the empty String is returned. + * @param count number of copies to append + */ + repeat(count: number): string; + + /** + * Returns true if the sequence of elements of searchString converted to a String is the + * same as the corresponding elements of this object (converted to a String) starting at + * position. Otherwise returns false. + */ + startsWith(searchString: string, position?: number): boolean; + + /** + * Returns an HTML anchor element and sets the name attribute to the text value + * @param name + */ + anchor(name: string): string; + + /** Returns a HTML element */ + big(): string; + + /** Returns a HTML element */ + blink(): string; + + /** Returns a HTML element */ + bold(): string; + + /** Returns a HTML element */ + fixed(): string; + + /** Returns a HTML element and sets the color attribute value */ + fontcolor(color: string): string; + + /** Returns a HTML element and sets the size attribute value */ + fontsize(size: number): string; + + /** Returns a HTML element and sets the size attribute value */ + fontsize(size: string): string; + + /** Returns an HTML element */ + italics(): string; + + /** Returns an HTML element and sets the href attribute value */ + link(url: string): string; + + /** Returns a HTML element */ + small(): string; + + /** Returns a HTML element */ + strike(): string; + + /** Returns a HTML element */ + sub(): string; + + /** Returns a HTML element */ + sup(): string; +} + +interface StringConstructor { + /** + * Return the String value whose elements are, in order, the elements in the List elements. + * If length is 0, the empty string is returned. + */ + fromCodePoint(...codePoints: number[]): string; + + /** + * String.raw is intended for use as a tag function of a Tagged Template String. When called + * as such the first argument will be a well formed template call site object and the rest + * parameter will contain the substitution values. + * @param template A well-formed template string call site representation. + * @param substitutions A set of substitution values. + */ + raw(template: TemplateStringsArray, ...substitutions: any[]): string; +} + + +interface Map { + clear(): void; + delete(key: K): boolean; + forEach(callbackfn: (value: V, key: K, map: Map) => void, thisArg?: any): void; + get(key: K): V | undefined; + has(key: K): boolean; + set(key: K, value: V): this; + readonly size: number; +} + +interface MapConstructor { + new (): Map; + new (entries?: [K, V][]): Map; + readonly prototype: Map; +} +declare var Map: MapConstructor; + +interface ReadonlyMap { + forEach(callbackfn: (value: V, key: K, map: ReadonlyMap) => void, thisArg?: any): void; + get(key: K): V | undefined; + has(key: K): boolean; + readonly size: number; +} + +interface WeakMap { + delete(key: K): boolean; + get(key: K): V | undefined; + has(key: K): boolean; + set(key: K, value: V): this; +} + +interface WeakMapConstructor { + new (): WeakMap; + new (entries?: [K, V][]): WeakMap; + readonly prototype: WeakMap; +} +declare var WeakMap: WeakMapConstructor; + +interface Set { + add(value: T): this; + clear(): void; + delete(value: T): boolean; + forEach(callbackfn: (value: T, value2: T, set: Set) => void, thisArg?: any): void; + has(value: T): boolean; + readonly size: number; +} + +interface SetConstructor { + new (): Set; + new (values?: T[]): Set; + readonly prototype: Set; +} +declare var Set: SetConstructor; + +interface ReadonlySet { + forEach(callbackfn: (value: T, value2: T, set: ReadonlySet) => void, thisArg?: any): void; + has(value: T): boolean; + readonly size: number; +} + +interface WeakSet { + add(value: T): this; + delete(value: T): boolean; + has(value: T): boolean; +} + +interface WeakSetConstructor { + new (): WeakSet; + new (values?: T[]): WeakSet; + readonly prototype: WeakSet; +} +declare var WeakSet: WeakSetConstructor; + + +interface Generator extends Iterator { } + +interface GeneratorFunction { + /** + * Creates a new Generator object. + * @param args A list of arguments the function accepts. + */ + new (...args: any[]): Generator; + /** + * Creates a new Generator object. + * @param args A list of arguments the function accepts. + */ + (...args: any[]): Generator; + /** + * The length of the arguments. + */ + readonly length: number; + /** + * Returns the name of the function. + */ + readonly name: string; + /** + * A reference to the prototype. + */ + readonly prototype: Generator; +} + +interface GeneratorFunctionConstructor { + /** + * Creates a new Generator function. + * @param args A list of arguments the function accepts. + */ + new (...args: string[]): GeneratorFunction; + /** + * Creates a new Generator function. + * @param args A list of arguments the function accepts. + */ + (...args: string[]): GeneratorFunction; + /** + * The length of the arguments. + */ + readonly length: number; + /** + * Returns the name of the function. + */ + readonly name: string; + /** + * A reference to the prototype. + */ + readonly prototype: GeneratorFunction; +} +declare var GeneratorFunction: GeneratorFunctionConstructor; + + +/// + +interface SymbolConstructor { + /** + * A method that returns the default iterator for an object. Called by the semantics of the + * for-of statement. + */ + readonly iterator: symbol; +} + +interface IteratorResult { + done: boolean; + value: T; +} + +interface Iterator { + next(value?: any): IteratorResult; + return?(value?: any): IteratorResult; + throw?(e?: any): IteratorResult; +} + +interface Iterable { + [Symbol.iterator](): Iterator; +} + +interface IterableIterator extends Iterator { + [Symbol.iterator](): IterableIterator; +} + +interface Array { + /** Iterator */ + [Symbol.iterator](): IterableIterator; + + /** + * Returns an iterable of key, value pairs for every entry in the array + */ + entries(): IterableIterator<[number, T]>; + + /** + * Returns an iterable of keys in the array + */ + keys(): IterableIterator; + + /** + * Returns an iterable of values in the array + */ + values(): IterableIterator; +} + +interface ArrayConstructor { + /** + * Creates an array from an iterable object. + * @param iterable An iterable object to convert to an array. + * @param mapfn A mapping function to call on every element of the array. + * @param thisArg Value of 'this' used to invoke the mapfn. + */ + from(iterable: Iterable, mapfn: (this: void, v: T, k: number) => U): Array; + from(iterable: Iterable, mapfn: (this: void, v: T, k: number) => U, thisArg: undefined): Array; + from(iterable: Iterable, mapfn: (this: Z, v: T, k: number) => U, thisArg: Z): Array; + + /** + * Creates an array from an iterable object. + * @param iterable An iterable object to convert to an array. + */ + from(iterable: Iterable): Array; +} + +interface ReadonlyArray { + /** Iterator of values in the array. */ + [Symbol.iterator](): IterableIterator; + + /** + * Returns an iterable of key, value pairs for every entry in the array + */ + entries(): IterableIterator<[number, T]>; + + /** + * Returns an iterable of keys in the array + */ + keys(): IterableIterator; + + /** + * Returns an iterable of values in the array + */ + values(): IterableIterator; +} + +interface IArguments { + /** Iterator */ + [Symbol.iterator](): IterableIterator; +} + +interface Map { + /** Returns an iterable of entries in the map. */ + [Symbol.iterator](): IterableIterator<[K, V]>; + + /** + * Returns an iterable of key, value pairs for every entry in the map. + */ + entries(): IterableIterator<[K, V]>; + + /** + * Returns an iterable of keys in the map + */ + keys(): IterableIterator; + + /** + * Returns an iterable of values in the map + */ + values(): IterableIterator; +} + +interface ReadonlyMap { + /** Returns an iterable of entries in the map. */ + [Symbol.iterator](): IterableIterator<[K, V]>; + + /** + * Returns an iterable of key, value pairs for every entry in the map. + */ + entries(): IterableIterator<[K, V]>; + + /** + * Returns an iterable of keys in the map + */ + keys(): IterableIterator; + + /** + * Returns an iterable of values in the map + */ + values(): IterableIterator; +} + +interface MapConstructor { + new (iterable: Iterable<[K, V]>): Map; +} + +interface WeakMap { } + +interface WeakMapConstructor { + new (iterable: Iterable<[K, V]>): WeakMap; +} + +interface Set { + /** Iterates over values in the set. */ + [Symbol.iterator](): IterableIterator; + /** + * Returns an iterable of [v,v] pairs for every value `v` in the set. + */ + entries(): IterableIterator<[T, T]>; + /** + * Despite its name, returns an iterable of the values in the set, + */ + keys(): IterableIterator; + + /** + * Returns an iterable of values in the set. + */ + values(): IterableIterator; +} + +interface ReadonlySet { + /** Iterates over values in the set. */ + [Symbol.iterator](): IterableIterator; + + /** + * Returns an iterable of [v,v] pairs for every value `v` in the set. + */ + entries(): IterableIterator<[T, T]>; + + /** + * Despite its name, returns an iterable of the values in the set, + */ + keys(): IterableIterator; + + /** + * Returns an iterable of values in the set. + */ + values(): IterableIterator; +} + +interface SetConstructor { + new (iterable: Iterable): Set; +} + +interface WeakSet { } + +interface WeakSetConstructor { + new (iterable: Iterable): WeakSet; +} + +interface Promise { } + +interface PromiseConstructor { + /** + * Creates a Promise that is resolved with an array of results when all of the provided Promises + * resolve, or rejected when any Promise is rejected. + * @param values An array of Promises. + * @returns A new Promise. + */ + all(values: Iterable>): Promise; + + /** + * Creates a Promise that is resolved or rejected when any of the provided Promises are resolved + * or rejected. + * @param values An array of Promises. + * @returns A new Promise. + */ + race(values: Iterable>): Promise; +} + +declare namespace Reflect { + function enumerate(target: object): IterableIterator; +} + +interface String { + /** Iterator */ + [Symbol.iterator](): IterableIterator; +} + +/** + * A typed array of 8-bit integer values. The contents are initialized to 0. If the requested + * number of bytes could not be allocated an exception is raised. + */ +interface Int8Array { + [Symbol.iterator](): IterableIterator; + /** + * Returns an array of key, value pairs for every entry in the array + */ + entries(): IterableIterator<[number, number]>; + /** + * Returns an list of keys in the array + */ + keys(): IterableIterator; + /** + * Returns an list of values in the array + */ + values(): IterableIterator; +} + +interface Int8ArrayConstructor { + new (elements: Iterable): Int8Array; + + /** + * Creates an array from an array-like or iterable object. + * @param arrayLike An array-like or iterable object to convert to an array. + * @param mapfn A mapping function to call on every element of the array. + * @param thisArg Value of 'this' used to invoke the mapfn. + */ + from(arrayLike: Iterable, mapfn: (this: void, v: number, k: number) => number): Int8Array; + from(arrayLike: Iterable, mapfn: (this: void, v: number, k: number) => number, thisArg: undefined): Int8Array; + from(arrayLike: Iterable, mapfn: (this: Z, v: number, k: number) => number, thisArg: Z): Int8Array; + + from(arrayLike: Iterable): Int8Array; +} + +/** + * A typed array of 8-bit unsigned integer values. The contents are initialized to 0. If the + * requested number of bytes could not be allocated an exception is raised. + */ +interface Uint8Array { + [Symbol.iterator](): IterableIterator; + /** + * Returns an array of key, value pairs for every entry in the array + */ + entries(): IterableIterator<[number, number]>; + /** + * Returns an list of keys in the array + */ + keys(): IterableIterator; + /** + * Returns an list of values in the array + */ + values(): IterableIterator; +} + +interface Uint8ArrayConstructor { + new (elements: Iterable): Uint8Array; + + /** + * Creates an array from an array-like or iterable object. + * @param arrayLike An array-like or iterable object to convert to an array. + * @param mapfn A mapping function to call on every element of the array. + * @param thisArg Value of 'this' used to invoke the mapfn. + */ + from(arrayLike: Iterable, mapfn: (this: void, v: number, k: number) => number): Uint8Array; + from(arrayLike: Iterable, mapfn: (this: void, v: number, k: number) => number, thisArg: undefined): Uint8Array; + from(arrayLike: Iterable, mapfn: (this: Z, v: number, k: number) => number, thisArg: Z): Uint8Array; + + from(arrayLike: Iterable): Uint8Array; +} + +/** + * A typed array of 8-bit unsigned integer (clamped) values. The contents are initialized to 0. + * If the requested number of bytes could not be allocated an exception is raised. + */ +interface Uint8ClampedArray { + [Symbol.iterator](): IterableIterator; + /** + * Returns an array of key, value pairs for every entry in the array + */ + entries(): IterableIterator<[number, number]>; + + /** + * Returns an list of keys in the array + */ + keys(): IterableIterator; + + /** + * Returns an list of values in the array + */ + values(): IterableIterator; +} + +interface Uint8ClampedArrayConstructor { + new (elements: Iterable): Uint8ClampedArray; + + + /** + * Creates an array from an array-like or iterable object. + * @param arrayLike An array-like or iterable object to convert to an array. + * @param mapfn A mapping function to call on every element of the array. + * @param thisArg Value of 'this' used to invoke the mapfn. + */ + from(arrayLike: Iterable, mapfn: (this: void, v: number, k: number) => number): Uint8ClampedArray; + from(arrayLike: Iterable, mapfn: (this: void, v: number, k: number) => number, thisArg: undefined): Uint8ClampedArray; + from(arrayLike: Iterable, mapfn: (this: Z, v: number, k: number) => number, thisArg: Z): Uint8ClampedArray; + + from(arrayLike: Iterable): Uint8ClampedArray; +} + +/** + * A typed array of 16-bit signed integer values. The contents are initialized to 0. If the + * requested number of bytes could not be allocated an exception is raised. + */ +interface Int16Array { + [Symbol.iterator](): IterableIterator; + /** + * Returns an array of key, value pairs for every entry in the array + */ + entries(): IterableIterator<[number, number]>; + + /** + * Returns an list of keys in the array + */ + keys(): IterableIterator; + + /** + * Returns an list of values in the array + */ + values(): IterableIterator; +} + +interface Int16ArrayConstructor { + new (elements: Iterable): Int16Array; + + /** + * Creates an array from an array-like or iterable object. + * @param arrayLike An array-like or iterable object to convert to an array. + * @param mapfn A mapping function to call on every element of the array. + * @param thisArg Value of 'this' used to invoke the mapfn. + */ + from(arrayLike: Iterable, mapfn: (this: void, v: number, k: number) => number): Int16Array; + from(arrayLike: Iterable, mapfn: (this: void, v: number, k: number) => number, thisArg: undefined): Int16Array; + from(arrayLike: Iterable, mapfn: (this: Z, v: number, k: number) => number, thisArg: Z): Int16Array; + + from(arrayLike: Iterable): Int16Array; +} + +/** + * A typed array of 16-bit unsigned integer values. The contents are initialized to 0. If the + * requested number of bytes could not be allocated an exception is raised. + */ +interface Uint16Array { + [Symbol.iterator](): IterableIterator; + /** + * Returns an array of key, value pairs for every entry in the array + */ + entries(): IterableIterator<[number, number]>; + /** + * Returns an list of keys in the array + */ + keys(): IterableIterator; + /** + * Returns an list of values in the array + */ + values(): IterableIterator; +} + +interface Uint16ArrayConstructor { + new (elements: Iterable): Uint16Array; + + /** + * Creates an array from an array-like or iterable object. + * @param arrayLike An array-like or iterable object to convert to an array. + * @param mapfn A mapping function to call on every element of the array. + * @param thisArg Value of 'this' used to invoke the mapfn. + */ + from(arrayLike: Iterable, mapfn: (this: void, v: number, k: number) => number): Uint16Array; + from(arrayLike: Iterable, mapfn: (this: void, v: number, k: number) => number, thisArg: undefined): Uint16Array; + from(arrayLike: Iterable, mapfn: (this: Z, v: number, k: number) => number, thisArg: Z): Uint16Array; + + from(arrayLike: Iterable): Uint16Array; +} + +/** + * A typed array of 32-bit signed integer values. The contents are initialized to 0. If the + * requested number of bytes could not be allocated an exception is raised. + */ +interface Int32Array { + [Symbol.iterator](): IterableIterator; + /** + * Returns an array of key, value pairs for every entry in the array + */ + entries(): IterableIterator<[number, number]>; + /** + * Returns an list of keys in the array + */ + keys(): IterableIterator; + /** + * Returns an list of values in the array + */ + values(): IterableIterator; +} + +interface Int32ArrayConstructor { + new (elements: Iterable): Int32Array; + + /** + * Creates an array from an array-like or iterable object. + * @param arrayLike An array-like or iterable object to convert to an array. + * @param mapfn A mapping function to call on every element of the array. + * @param thisArg Value of 'this' used to invoke the mapfn. + */ + from(arrayLike: Iterable, mapfn: (this: void, v: number, k: number) => number): Int32Array; + from(arrayLike: Iterable, mapfn: (this: void, v: number, k: number) => number, thisArg: undefined): Int32Array; + from(arrayLike: Iterable, mapfn: (this: Z, v: number, k: number) => number, thisArg: Z): Int32Array; + + from(arrayLike: Iterable): Int32Array; +} + +/** + * A typed array of 32-bit unsigned integer values. The contents are initialized to 0. If the + * requested number of bytes could not be allocated an exception is raised. + */ +interface Uint32Array { + [Symbol.iterator](): IterableIterator; + /** + * Returns an array of key, value pairs for every entry in the array + */ + entries(): IterableIterator<[number, number]>; + /** + * Returns an list of keys in the array + */ + keys(): IterableIterator; + /** + * Returns an list of values in the array + */ + values(): IterableIterator; +} + +interface Uint32ArrayConstructor { + new (elements: Iterable): Uint32Array; + + /** + * Creates an array from an array-like or iterable object. + * @param arrayLike An array-like or iterable object to convert to an array. + * @param mapfn A mapping function to call on every element of the array. + * @param thisArg Value of 'this' used to invoke the mapfn. + */ + from(arrayLike: Iterable, mapfn: (this: void, v: number, k: number) => number): Uint32Array; + from(arrayLike: Iterable, mapfn: (this: void, v: number, k: number) => number, thisArg: undefined): Uint32Array; + from(arrayLike: Iterable, mapfn: (this: Z, v: number, k: number) => number, thisArg: Z): Uint32Array; + + from(arrayLike: Iterable): Uint32Array; +} + +/** + * A typed array of 32-bit float values. The contents are initialized to 0. If the requested number + * of bytes could not be allocated an exception is raised. + */ +interface Float32Array { + [Symbol.iterator](): IterableIterator; + /** + * Returns an array of key, value pairs for every entry in the array + */ + entries(): IterableIterator<[number, number]>; + /** + * Returns an list of keys in the array + */ + keys(): IterableIterator; + /** + * Returns an list of values in the array + */ + values(): IterableIterator; +} + +interface Float32ArrayConstructor { + new (elements: Iterable): Float32Array; + + /** + * Creates an array from an array-like or iterable object. + * @param arrayLike An array-like or iterable object to convert to an array. + * @param mapfn A mapping function to call on every element of the array. + * @param thisArg Value of 'this' used to invoke the mapfn. + */ + from(arrayLike: Iterable, mapfn: (this: void, v: number, k: number) => number): Float32Array; + from(arrayLike: Iterable, mapfn: (this: void, v: number, k: number) => number, thisArg: undefined): Float32Array; + from(arrayLike: Iterable, mapfn: (this: Z, v: number, k: number) => number, thisArg: Z): Float32Array; + + from(arrayLike: Iterable): Float32Array; +} + +/** + * A typed array of 64-bit float values. The contents are initialized to 0. If the requested + * number of bytes could not be allocated an exception is raised. + */ +interface Float64Array { + [Symbol.iterator](): IterableIterator; + /** + * Returns an array of key, value pairs for every entry in the array + */ + entries(): IterableIterator<[number, number]>; + /** + * Returns an list of keys in the array + */ + keys(): IterableIterator; + /** + * Returns an list of values in the array + */ + values(): IterableIterator; +} + +interface Float64ArrayConstructor { + new (elements: Iterable): Float64Array; + + /** + * Creates an array from an array-like or iterable object. + * @param arrayLike An array-like or iterable object to convert to an array. + * @param mapfn A mapping function to call on every element of the array. + * @param thisArg Value of 'this' used to invoke the mapfn. + */ + from(arrayLike: Iterable, mapfn: (this: void, v: number, k: number) => number): Float64Array; + from(arrayLike: Iterable, mapfn: (this: void, v: number, k: number) => number, thisArg: undefined): Float64Array; + from(arrayLike: Iterable, mapfn: (this: Z, v: number, k: number) => number, thisArg: Z): Float64Array; + + from(arrayLike: Iterable): Float64Array; +} + + +interface PromiseConstructor { + /** + * A reference to the prototype. + */ + readonly prototype: Promise; + + /** + * Creates a new Promise. + * @param executor A callback used to initialize the promise. This callback is passed two arguments: + * a resolve callback used resolve the promise with a value or the result of another promise, + * and a reject callback used to reject the promise with a provided reason or error. + */ + new (executor: (resolve: (value?: T | PromiseLike) => void, reject: (reason?: any) => void) => void): Promise; + + /** + * Creates a Promise that is resolved with an array of results when all of the provided Promises + * resolve, or rejected when any Promise is rejected. + * @param values An array of Promises. + * @returns A new Promise. + */ + all(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike , T5 | PromiseLike, T6 | PromiseLike, T7 | PromiseLike, T8 | PromiseLike, T9 | PromiseLike, T10 | PromiseLike]): Promise<[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10]>; + + /** + * Creates a Promise that is resolved with an array of results when all of the provided Promises + * resolve, or rejected when any Promise is rejected. + * @param values An array of Promises. + * @returns A new Promise. + */ + all(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike , T5 | PromiseLike, T6 | PromiseLike, T7 | PromiseLike, T8 | PromiseLike, T9 | PromiseLike]): Promise<[T1, T2, T3, T4, T5, T6, T7, T8, T9]>; + + /** + * Creates a Promise that is resolved with an array of results when all of the provided Promises + * resolve, or rejected when any Promise is rejected. + * @param values An array of Promises. + * @returns A new Promise. + */ + all(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike , T5 | PromiseLike, T6 | PromiseLike, T7 | PromiseLike, T8 | PromiseLike]): Promise<[T1, T2, T3, T4, T5, T6, T7, T8]>; + + /** + * Creates a Promise that is resolved with an array of results when all of the provided Promises + * resolve, or rejected when any Promise is rejected. + * @param values An array of Promises. + * @returns A new Promise. + */ + all(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike , T5 | PromiseLike, T6 | PromiseLike, T7 | PromiseLike]): Promise<[T1, T2, T3, T4, T5, T6, T7]>; + + /** + * Creates a Promise that is resolved with an array of results when all of the provided Promises + * resolve, or rejected when any Promise is rejected. + * @param values An array of Promises. + * @returns A new Promise. + */ + all(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike , T5 | PromiseLike, T6 | PromiseLike]): Promise<[T1, T2, T3, T4, T5, T6]>; + + /** + * Creates a Promise that is resolved with an array of results when all of the provided Promises + * resolve, or rejected when any Promise is rejected. + * @param values An array of Promises. + * @returns A new Promise. + */ + all(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike , T5 | PromiseLike]): Promise<[T1, T2, T3, T4, T5]>; + + /** + * Creates a Promise that is resolved with an array of results when all of the provided Promises + * resolve, or rejected when any Promise is rejected. + * @param values An array of Promises. + * @returns A new Promise. + */ + all(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike ]): Promise<[T1, T2, T3, T4]>; + + /** + * Creates a Promise that is resolved with an array of results when all of the provided Promises + * resolve, or rejected when any Promise is rejected. + * @param values An array of Promises. + * @returns A new Promise. + */ + all(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike]): Promise<[T1, T2, T3]>; + + /** + * Creates a Promise that is resolved with an array of results when all of the provided Promises + * resolve, or rejected when any Promise is rejected. + * @param values An array of Promises. + * @returns A new Promise. + */ + all(values: [T1 | PromiseLike, T2 | PromiseLike]): Promise<[T1, T2]>; + + /** + * Creates a Promise that is resolved with an array of results when all of the provided Promises + * resolve, or rejected when any Promise is rejected. + * @param values An array of Promises. + * @returns A new Promise. + */ + all(values: (T | PromiseLike)[]): Promise; + + /** + * Creates a Promise that is resolved or rejected when any of the provided Promises are resolved + * or rejected. + * @param values An array of Promises. + * @returns A new Promise. + */ + race(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike, T5 | PromiseLike, T6 | PromiseLike, T7 | PromiseLike, T8 | PromiseLike, T9 | PromiseLike, T10 | PromiseLike]): Promise; + + /** + * Creates a Promise that is resolved or rejected when any of the provided Promises are resolved + * or rejected. + * @param values An array of Promises. + * @returns A new Promise. + */ + race(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike, T5 | PromiseLike, T6 | PromiseLike, T7 | PromiseLike, T8 | PromiseLike, T9 | PromiseLike]): Promise; + + /** + * Creates a Promise that is resolved or rejected when any of the provided Promises are resolved + * or rejected. + * @param values An array of Promises. + * @returns A new Promise. + */ + race(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike, T5 | PromiseLike, T6 | PromiseLike, T7 | PromiseLike, T8 | PromiseLike]): Promise; + + /** + * Creates a Promise that is resolved or rejected when any of the provided Promises are resolved + * or rejected. + * @param values An array of Promises. + * @returns A new Promise. + */ + race(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike, T5 | PromiseLike, T6 | PromiseLike, T7 | PromiseLike]): Promise; + + /** + * Creates a Promise that is resolved or rejected when any of the provided Promises are resolved + * or rejected. + * @param values An array of Promises. + * @returns A new Promise. + */ + race(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike, T5 | PromiseLike, T6 | PromiseLike]): Promise; + + /** + * Creates a Promise that is resolved or rejected when any of the provided Promises are resolved + * or rejected. + * @param values An array of Promises. + * @returns A new Promise. + */ + race(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike, T5 | PromiseLike]): Promise; + + /** + * Creates a Promise that is resolved or rejected when any of the provided Promises are resolved + * or rejected. + * @param values An array of Promises. + * @returns A new Promise. + */ + race(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike]): Promise; + + /** + * Creates a Promise that is resolved or rejected when any of the provided Promises are resolved + * or rejected. + * @param values An array of Promises. + * @returns A new Promise. + */ + race(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike]): Promise; + + /** + * Creates a Promise that is resolved or rejected when any of the provided Promises are resolved + * or rejected. + * @param values An array of Promises. + * @returns A new Promise. + */ + race(values: [T1 | PromiseLike, T2 | PromiseLike]): Promise; + + /** + * Creates a Promise that is resolved or rejected when any of the provided Promises are resolved + * or rejected. + * @param values An array of Promises. + * @returns A new Promise. + */ + race(values: (T | PromiseLike)[]): Promise; + + /** + * Creates a new rejected promise for the provided reason. + * @param reason The reason the promise was rejected. + * @returns A new rejected Promise. + */ + reject(reason: any): Promise; + + /** + * Creates a new rejected promise for the provided reason. + * @param reason The reason the promise was rejected. + * @returns A new rejected Promise. + */ + reject(reason: any): Promise; + + /** + * Creates a new resolved promise for the provided value. + * @param value A promise. + * @returns A promise whose internal state matches the provided promise. + */ + resolve(value: T | PromiseLike): Promise; + + /** + * Creates a new resolved promise . + * @returns A resolved promise. + */ + resolve(): Promise; +} + +declare var Promise: PromiseConstructor; + +interface ProxyHandler { + getPrototypeOf? (target: T): object | null; + setPrototypeOf? (target: T, v: any): boolean; + isExtensible? (target: T): boolean; + preventExtensions? (target: T): boolean; + getOwnPropertyDescriptor? (target: T, p: PropertyKey): PropertyDescriptor | undefined; + has? (target: T, p: PropertyKey): boolean; + get? (target: T, p: PropertyKey, receiver: any): any; + set? (target: T, p: PropertyKey, value: any, receiver: any): boolean; + deleteProperty? (target: T, p: PropertyKey): boolean; + defineProperty? (target: T, p: PropertyKey, attributes: PropertyDescriptor): boolean; + enumerate? (target: T): PropertyKey[]; + ownKeys? (target: T): PropertyKey[]; + apply? (target: T, thisArg: any, argArray?: any): any; + construct? (target: T, argArray: any, newTarget?: any): object; +} + +interface ProxyConstructor { + revocable(target: T, handler: ProxyHandler): { proxy: T; revoke: () => void; }; + new (target: T, handler: ProxyHandler): T; +} +declare var Proxy: ProxyConstructor; + + +declare namespace Reflect { + function apply(target: Function, thisArgument: any, argumentsList: ArrayLike): any; + function construct(target: Function, argumentsList: ArrayLike, newTarget?: any): any; + function defineProperty(target: object, propertyKey: PropertyKey, attributes: PropertyDescriptor): boolean; + function deleteProperty(target: object, propertyKey: PropertyKey): boolean; + function get(target: object, propertyKey: PropertyKey, receiver?: any): any; + function getOwnPropertyDescriptor(target: object, propertyKey: PropertyKey): PropertyDescriptor; + function getPrototypeOf(target: object): object; + function has(target: object, propertyKey: PropertyKey): boolean; + function isExtensible(target: object): boolean; + function ownKeys(target: object): Array; + function preventExtensions(target: object): boolean; + function set(target: object, propertyKey: PropertyKey, value: any, receiver?: any): boolean; + function setPrototypeOf(target: object, proto: any): boolean; +} + + +interface Symbol { + /** Returns a string representation of an object. */ + toString(): string; + + /** Returns the primitive value of the specified object. */ + valueOf(): symbol; +} + +interface SymbolConstructor { + /** + * A reference to the prototype. + */ + readonly prototype: Symbol; + + /** + * Returns a new unique Symbol value. + * @param description Description of the new Symbol object. + */ + (description?: string | number): symbol; + + /** + * Returns a Symbol object from the global symbol registry matching the given key if found. + * Otherwise, returns a new symbol with this key. + * @param key key to search for. + */ + for(key: string): symbol; + + /** + * Returns a key from the global symbol registry matching the given Symbol if found. + * Otherwise, returns a undefined. + * @param sym Symbol to find the key for. + */ + keyFor(sym: symbol): string | undefined; +} + +declare var Symbol: SymbolConstructor; + +/// + +interface SymbolConstructor { + /** + * A method that determines if a constructor object recognizes an object as one of the + * constructor’s instances. Called by the semantics of the instanceof operator. + */ + readonly hasInstance: symbol; + + /** + * A Boolean value that if true indicates that an object should flatten to its array elements + * by Array.prototype.concat. + */ + readonly isConcatSpreadable: symbol; + + /** + * A regular expression method that matches the regular expression against a string. Called + * by the String.prototype.match method. + */ + readonly match: symbol; + + /** + * A regular expression method that replaces matched substrings of a string. Called by the + * String.prototype.replace method. + */ + readonly replace: symbol; + + /** + * A regular expression method that returns the index within a string that matches the + * regular expression. Called by the String.prototype.search method. + */ + readonly search: symbol; + + /** + * A function valued property that is the constructor function that is used to create + * derived objects. + */ + readonly species: symbol; + + /** + * A regular expression method that splits a string at the indices that match the regular + * expression. Called by the String.prototype.split method. + */ + readonly split: symbol; + + /** + * A method that converts an object to a corresponding primitive value. + * Called by the ToPrimitive abstract operation. + */ + readonly toPrimitive: symbol; + + /** + * A String value that is used in the creation of the default string description of an object. + * Called by the built-in method Object.prototype.toString. + */ + readonly toStringTag: symbol; + + /** + * An Object whose own property names are property names that are excluded from the 'with' + * environment bindings of the associated objects. + */ + readonly unscopables: symbol; +} + +interface Symbol { + readonly [Symbol.toStringTag]: "Symbol"; +} + +interface Array { + /** + * Returns an object whose properties have the value 'true' + * when they will be absent when used in a 'with' statement. + */ + [Symbol.unscopables](): { + copyWithin: boolean; + entries: boolean; + fill: boolean; + find: boolean; + findIndex: boolean; + keys: boolean; + values: boolean; + }; +} + +interface Date { + /** + * Converts a Date object to a string. + */ + [Symbol.toPrimitive](hint: "default"): string; + /** + * Converts a Date object to a string. + */ + [Symbol.toPrimitive](hint: "string"): string; + /** + * Converts a Date object to a number. + */ + [Symbol.toPrimitive](hint: "number"): number; + /** + * Converts a Date object to a string or number. + * + * @param hint The strings "number", "string", or "default" to specify what primitive to return. + * + * @throws {TypeError} If 'hint' was given something other than "number", "string", or "default". + * @returns A number if 'hint' was "number", a string if 'hint' was "string" or "default". + */ + [Symbol.toPrimitive](hint: string): string | number; +} + +interface Map { + readonly [Symbol.toStringTag]: "Map"; +} + +interface WeakMap { + readonly [Symbol.toStringTag]: "WeakMap"; +} + +interface Set { + readonly [Symbol.toStringTag]: "Set"; +} + +interface WeakSet { + readonly [Symbol.toStringTag]: "WeakSet"; +} + +interface JSON { + readonly [Symbol.toStringTag]: "JSON"; +} + +interface Function { + /** + * Determines whether the given value inherits from this function if this function was used + * as a constructor function. + * + * A constructor function can control which objects are recognized as its instances by + * 'instanceof' by overriding this method. + */ + [Symbol.hasInstance](value: any): boolean; +} + +interface GeneratorFunction { + readonly [Symbol.toStringTag]: "GeneratorFunction"; +} + +interface Math { + readonly [Symbol.toStringTag]: "Math"; +} + +interface Promise { + readonly [Symbol.toStringTag]: "Promise"; +} + +interface PromiseConstructor { + readonly [Symbol.species]: Function; +} + +interface RegExp { + /** + * Matches a string with this regular expression, and returns an array containing the results of + * that search. + * @param string A string to search within. + */ + [Symbol.match](string: string): RegExpMatchArray | null; + + /** + * Replaces text in a string, using this regular expression. + * @param string A String object or string literal whose contents matching against + * this regular expression will be replaced + * @param replaceValue A String object or string literal containing the text to replace for every + * successful match of this regular expression. + */ + [Symbol.replace](string: string, replaceValue: string): string; + + /** + * Replaces text in a string, using this regular expression. + * @param string A String object or string literal whose contents matching against + * this regular expression will be replaced + * @param replacer A function that returns the replacement text. + */ + [Symbol.replace](string: string, replacer: (substring: string, ...args: any[]) => string): string; + + /** + * Finds the position beginning first substring match in a regular expression search + * using this regular expression. + * + * @param string The string to search within. + */ + [Symbol.search](string: string): number; + + /** + * Returns an array of substrings that were delimited by strings in the original input that + * match against this regular expression. + * + * If the regular expression contains capturing parentheses, then each time this + * regular expression matches, the results (including any undefined results) of the + * capturing parentheses are spliced. + * + * @param string string value to split + * @param limit if not undefined, the output array is truncated so that it contains no more + * than 'limit' elements. + */ + [Symbol.split](string: string, limit?: number): string[]; +} + +interface RegExpConstructor { + [Symbol.species](): RegExpConstructor; +} + +interface String { + /** + * Matches a string an object that supports being matched against, and returns an array containing the results of that search. + * @param matcher An object that supports being matched against. + */ + match(matcher: { [Symbol.match](string: string): RegExpMatchArray | null; }): RegExpMatchArray | null; + + /** + * Replaces text in a string, using an object that supports replacement within a string. + * @param searchValue A object can search for and replace matches within a string. + * @param replaceValue A string containing the text to replace for every successful match of searchValue in this string. + */ + replace(searchValue: { [Symbol.replace](string: string, replaceValue: string): string; }, replaceValue: string): string; + + /** + * Replaces text in a string, using an object that supports replacement within a string. + * @param searchValue A object can search for and replace matches within a string. + * @param replacer A function that returns the replacement text. + */ + replace(searchValue: { [Symbol.replace](string: string, replacer: (substring: string, ...args: any[]) => string): string; }, replacer: (substring: string, ...args: any[]) => string): string; + + /** + * Finds the first substring match in a regular expression search. + * @param searcher An object which supports searching within a string. + */ + search(searcher: { [Symbol.search](string: string): number; }): number; + + /** + * Split a string into substrings using the specified separator and return them as an array. + * @param splitter An object that can split a string. + * @param limit A value used to limit the number of elements returned in the array. + */ + split(splitter: { [Symbol.split](string: string, limit?: number): string[]; }, limit?: number): string[]; +} + +/** + * Represents a raw buffer of binary data, which is used to store data for the + * different typed arrays. ArrayBuffers cannot be read from or written to directly, + * but can be passed to a typed array or DataView Object to interpret the raw + * buffer as needed. + */ +interface ArrayBuffer { + readonly [Symbol.toStringTag]: "ArrayBuffer"; +} + +interface DataView { + readonly [Symbol.toStringTag]: "DataView"; +} + +/** + * A typed array of 8-bit integer values. The contents are initialized to 0. If the requested + * number of bytes could not be allocated an exception is raised. + */ +interface Int8Array { + readonly [Symbol.toStringTag]: "Int8Array"; +} + +/** + * A typed array of 8-bit unsigned integer values. The contents are initialized to 0. If the + * requested number of bytes could not be allocated an exception is raised. + */ +interface Uint8Array { + readonly [Symbol.toStringTag]: "UInt8Array"; +} + +/** + * A typed array of 8-bit unsigned integer (clamped) values. The contents are initialized to 0. + * If the requested number of bytes could not be allocated an exception is raised. + */ +interface Uint8ClampedArray { + readonly [Symbol.toStringTag]: "Uint8ClampedArray"; +} + +/** + * A typed array of 16-bit signed integer values. The contents are initialized to 0. If the + * requested number of bytes could not be allocated an exception is raised. + */ +interface Int16Array { + readonly [Symbol.toStringTag]: "Int16Array"; +} + +/** + * A typed array of 16-bit unsigned integer values. The contents are initialized to 0. If the + * requested number of bytes could not be allocated an exception is raised. + */ +interface Uint16Array { + readonly [Symbol.toStringTag]: "Uint16Array"; +} + +/** + * A typed array of 32-bit signed integer values. The contents are initialized to 0. If the + * requested number of bytes could not be allocated an exception is raised. + */ +interface Int32Array { + readonly [Symbol.toStringTag]: "Int32Array"; +} + +/** + * A typed array of 32-bit unsigned integer values. The contents are initialized to 0. If the + * requested number of bytes could not be allocated an exception is raised. + */ +interface Uint32Array { + readonly [Symbol.toStringTag]: "Uint32Array"; +} + +/** + * A typed array of 32-bit float values. The contents are initialized to 0. If the requested number + * of bytes could not be allocated an exception is raised. + */ +interface Float32Array { + readonly [Symbol.toStringTag]: "Float32Array"; +} + +/** + * A typed array of 64-bit float values. The contents are initialized to 0. If the requested + * number of bytes could not be allocated an exception is raised. + */ +interface Float64Array { + readonly [Symbol.toStringTag]: "Float64Array"; +} + + ///////////////////////////// /// DOM APIs diff --git a/lib/lib.es5.d.ts b/lib/lib.es5.d.ts index f628dc4fe84c1..8353dc1500f69 100644 --- a/lib/lib.es5.d.ts +++ b/lib/lib.es5.d.ts @@ -236,7 +236,7 @@ interface ObjectConstructor { * Returns the names of the enumerable properties and methods of an object. * @param o Object that contains the properties and methods. This can be an object that you created or an existing Document Object Model (DOM) object. */ - keys(o: any): string[]; + keys(o: {}): string[]; } /** @@ -1000,12 +1000,12 @@ interface ReadonlyArray { * Combines two or more arrays. * @param items Additional items to add to the end of array1. */ - concat(...items: T[][]): T[]; + concat(...items: ReadonlyArray[]): T[]; /** * Combines two or more arrays. * @param items Additional items to add to the end of array1. */ - concat(...items: (T | T[])[]): T[]; + concat(...items: (T | ReadonlyArray)[]): T[]; /** * Adds all the elements of an array separated by the specified separator string. * @param separator A string used to separate one element of an array from the next in the resulting String. If omitted, the array elements are separated with a comma. @@ -1119,12 +1119,12 @@ interface Array { * Combines two or more arrays. * @param items Additional items to add to the end of array1. */ - concat(...items: T[][]): T[]; + concat(...items: ReadonlyArray[]): T[]; /** * Combines two or more arrays. * @param items Additional items to add to the end of array1. */ - concat(...items: (T | T[])[]): T[]; + concat(...items: (T | ReadonlyArray)[]): T[]; /** * Adds all the elements of an array separated by the specified separator string. * @param separator A string used to separate one element of an array from the next in the resulting String. If omitted, the array elements are separated with a comma. diff --git a/lib/lib.es6.d.ts b/lib/lib.es6.d.ts index 588c609a16467..b44acacc87259 100644 --- a/lib/lib.es6.d.ts +++ b/lib/lib.es6.d.ts @@ -236,7 +236,7 @@ interface ObjectConstructor { * Returns the names of the enumerable properties and methods of an object. * @param o Object that contains the properties and methods. This can be an object that you created or an existing Document Object Model (DOM) object. */ - keys(o: any): string[]; + keys(o: {}): string[]; } /** @@ -1000,12 +1000,12 @@ interface ReadonlyArray { * Combines two or more arrays. * @param items Additional items to add to the end of array1. */ - concat(...items: T[][]): T[]; + concat(...items: ReadonlyArray[]): T[]; /** * Combines two or more arrays. * @param items Additional items to add to the end of array1. */ - concat(...items: (T | T[])[]): T[]; + concat(...items: (T | ReadonlyArray)[]): T[]; /** * Adds all the elements of an array separated by the specified separator string. * @param separator A string used to separate one element of an array from the next in the resulting String. If omitted, the array elements are separated with a comma. @@ -1119,12 +1119,12 @@ interface Array { * Combines two or more arrays. * @param items Additional items to add to the end of array1. */ - concat(...items: T[][]): T[]; + concat(...items: ReadonlyArray[]): T[]; /** * Combines two or more arrays. * @param items Additional items to add to the end of array1. */ - concat(...items: (T | T[])[]): T[]; + concat(...items: (T | ReadonlyArray)[]): T[]; /** * Adds all the elements of an array separated by the specified separator string. * @param separator A string used to separate one element of an array from the next in the resulting String. If omitted, the array elements are separated with a comma. @@ -5689,7 +5689,7 @@ interface Map { readonly [Symbol.toStringTag]: "Map"; } -interface WeakMap{ +interface WeakMap { readonly [Symbol.toStringTag]: "WeakMap"; } diff --git a/lib/lib.esnext.full.d.ts b/lib/lib.esnext.full.d.ts index 4d06a07f65eab..f7b59da300237 100644 --- a/lib/lib.esnext.full.d.ts +++ b/lib/lib.esnext.full.d.ts @@ -22,6 +22,1830 @@ and limitations under the License. /// +declare type PropertyKey = string | number | symbol; + +interface Array { + /** + * Returns the value of the first element in the array where predicate is true, and undefined + * otherwise. + * @param predicate find calls predicate once for each element of the array, in ascending + * order, until it finds one where predicate returns true. If such an element is found, find + * immediately returns that element value. Otherwise, find returns undefined. + * @param thisArg If provided, it will be used as the this value for each invocation of + * predicate. If it is not provided, undefined is used instead. + */ + find(predicate: (this: void, value: T, index: number, obj: Array) => boolean): T | undefined; + find(predicate: (this: void, value: T, index: number, obj: Array) => boolean, thisArg: undefined): T | undefined; + find(predicate: (this: Z, value: T, index: number, obj: Array) => boolean, thisArg: Z): T | undefined; + + /** + * Returns the index of the first element in the array where predicate is true, and -1 + * otherwise. + * @param predicate find calls predicate once for each element of the array, in ascending + * order, until it finds one where predicate returns true. If such an element is found, + * findIndex immediately returns that element index. Otherwise, findIndex returns -1. + * @param thisArg If provided, it will be used as the this value for each invocation of + * predicate. If it is not provided, undefined is used instead. + */ + findIndex(predicate: (this: void, value: T, index: number, obj: Array) => boolean): number; + findIndex(predicate: (this: void, value: T, index: number, obj: Array) => boolean, thisArg: undefined): number; + findIndex(predicate: (this: Z, value: T, index: number, obj: Array) => boolean, thisArg: Z): number; + + /** + * Returns the this object after filling the section identified by start and end with value + * @param value value to fill array section with + * @param start index to start filling the array at. If start is negative, it is treated as + * length+start where length is the length of the array. + * @param end index to stop filling the array at. If end is negative, it is treated as + * length+end. + */ + fill(value: T, start?: number, end?: number): this; + + /** + * Returns the this object after copying a section of the array identified by start and end + * to the same array starting at position target + * @param target If target is negative, it is treated as length+target where length is the + * length of the array. + * @param start If start is negative, it is treated as length+start. If end is negative, it + * is treated as length+end. + * @param end If not specified, length of the this object is used as its default value. + */ + copyWithin(target: number, start: number, end?: number): this; +} + +interface ArrayConstructor { + /** + * Creates an array from an array-like object. + * @param arrayLike An array-like object to convert to an array. + * @param mapfn A mapping function to call on every element of the array. + * @param thisArg Value of 'this' used to invoke the mapfn. + */ + from(arrayLike: ArrayLike, mapfn: (this: void, v: T, k: number) => U): Array; + from(arrayLike: ArrayLike, mapfn: (this: void, v: T, k: number) => U, thisArg: undefined): Array; + from(arrayLike: ArrayLike, mapfn: (this: Z, v: T, k: number) => U, thisArg: Z): Array; + + + /** + * Creates an array from an array-like object. + * @param arrayLike An array-like object to convert to an array. + */ + from(arrayLike: ArrayLike): Array; + + /** + * Returns a new array from a set of elements. + * @param items A set of elements to include in the new array object. + */ + of(...items: T[]): Array; +} + +interface DateConstructor { + new (value: Date): Date; +} + +interface Function { + /** + * Returns the name of the function. Function names are read-only and can not be changed. + */ + readonly name: string; +} + +interface Math { + /** + * Returns the number of leading zero bits in the 32-bit binary representation of a number. + * @param x A numeric expression. + */ + clz32(x: number): number; + + /** + * Returns the result of 32-bit multiplication of two numbers. + * @param x First number + * @param y Second number + */ + imul(x: number, y: number): number; + + /** + * Returns the sign of the x, indicating whether x is positive, negative or zero. + * @param x The numeric expression to test + */ + sign(x: number): number; + + /** + * Returns the base 10 logarithm of a number. + * @param x A numeric expression. + */ + log10(x: number): number; + + /** + * Returns the base 2 logarithm of a number. + * @param x A numeric expression. + */ + log2(x: number): number; + + /** + * Returns the natural logarithm of 1 + x. + * @param x A numeric expression. + */ + log1p(x: number): number; + + /** + * Returns the result of (e^x - 1) of x (e raised to the power of x, where e is the base of + * the natural logarithms). + * @param x A numeric expression. + */ + expm1(x: number): number; + + /** + * Returns the hyperbolic cosine of a number. + * @param x A numeric expression that contains an angle measured in radians. + */ + cosh(x: number): number; + + /** + * Returns the hyperbolic sine of a number. + * @param x A numeric expression that contains an angle measured in radians. + */ + sinh(x: number): number; + + /** + * Returns the hyperbolic tangent of a number. + * @param x A numeric expression that contains an angle measured in radians. + */ + tanh(x: number): number; + + /** + * Returns the inverse hyperbolic cosine of a number. + * @param x A numeric expression that contains an angle measured in radians. + */ + acosh(x: number): number; + + /** + * Returns the inverse hyperbolic sine of a number. + * @param x A numeric expression that contains an angle measured in radians. + */ + asinh(x: number): number; + + /** + * Returns the inverse hyperbolic tangent of a number. + * @param x A numeric expression that contains an angle measured in radians. + */ + atanh(x: number): number; + + /** + * Returns the square root of the sum of squares of its arguments. + * @param values Values to compute the square root for. + * If no arguments are passed, the result is +0. + * If there is only one argument, the result is the absolute value. + * If any argument is +Infinity or -Infinity, the result is +Infinity. + * If any argument is NaN, the result is NaN. + * If all arguments are either +0 or −0, the result is +0. + */ + hypot(...values: number[] ): number; + + /** + * Returns the integral part of the a numeric expression, x, removing any fractional digits. + * If x is already an integer, the result is x. + * @param x A numeric expression. + */ + trunc(x: number): number; + + /** + * Returns the nearest single precision float representation of a number. + * @param x A numeric expression. + */ + fround(x: number): number; + + /** + * Returns an implementation-dependent approximation to the cube root of number. + * @param x A numeric expression. + */ + cbrt(x: number): number; +} + +interface NumberConstructor { + /** + * The value of Number.EPSILON is the difference between 1 and the smallest value greater than 1 + * that is representable as a Number value, which is approximately: + * 2.2204460492503130808472633361816 x 10‍−‍16. + */ + readonly EPSILON: number; + + /** + * Returns true if passed value is finite. + * Unlike the global isFinite, Number.isFinite doesn't forcibly convert the parameter to a + * number. Only finite values of the type number, result in true. + * @param number A numeric value. + */ + isFinite(number: number): boolean; + + /** + * Returns true if the value passed is an integer, false otherwise. + * @param number A numeric value. + */ + isInteger(number: number): boolean; + + /** + * Returns a Boolean value that indicates whether a value is the reserved value NaN (not a + * number). Unlike the global isNaN(), Number.isNaN() doesn't forcefully convert the parameter + * to a number. Only values of the type number, that are also NaN, result in true. + * @param number A numeric value. + */ + isNaN(number: number): boolean; + + /** + * Returns true if the value passed is a safe integer. + * @param number A numeric value. + */ + isSafeInteger(number: number): boolean; + + /** + * The value of the largest integer n such that n and n + 1 are both exactly representable as + * a Number value. + * The value of Number.MAX_SAFE_INTEGER is 9007199254740991 2^53 − 1. + */ + readonly MAX_SAFE_INTEGER: number; + + /** + * The value of the smallest integer n such that n and n − 1 are both exactly representable as + * a Number value. + * The value of Number.MIN_SAFE_INTEGER is −9007199254740991 (−(2^53 − 1)). + */ + readonly MIN_SAFE_INTEGER: number; + + /** + * Converts a string to a floating-point number. + * @param string A string that contains a floating-point number. + */ + parseFloat(string: string): number; + + /** + * Converts A string to an integer. + * @param s A string to convert into a number. + * @param radix A value between 2 and 36 that specifies the base of the number in numString. + * If this argument is not supplied, strings with a prefix of '0x' are considered hexadecimal. + * All other strings are considered decimal. + */ + parseInt(string: string, radix?: number): number; +} + +interface Object { + /** + * Determines whether an object has a property with the specified name. + * @param v A property name. + */ + hasOwnProperty(v: PropertyKey): boolean; + + /** + * Determines whether a specified property is enumerable. + * @param v A property name. + */ + propertyIsEnumerable(v: PropertyKey): boolean; +} + +interface ObjectConstructor { + /** + * Copy the values of all of the enumerable own properties from one or more source objects to a + * target object. Returns the target object. + * @param target The target object to copy to. + * @param source The source object from which to copy properties. + */ + assign(target: T, source: U): T & U; + + /** + * Copy the values of all of the enumerable own properties from one or more source objects to a + * target object. Returns the target object. + * @param target The target object to copy to. + * @param source1 The first source object from which to copy properties. + * @param source2 The second source object from which to copy properties. + */ + assign(target: T, source1: U, source2: V): T & U & V; + + /** + * Copy the values of all of the enumerable own properties from one or more source objects to a + * target object. Returns the target object. + * @param target The target object to copy to. + * @param source1 The first source object from which to copy properties. + * @param source2 The second source object from which to copy properties. + * @param source3 The third source object from which to copy properties. + */ + assign(target: T, source1: U, source2: V, source3: W): T & U & V & W; + + /** + * Copy the values of all of the enumerable own properties from one or more source objects to a + * target object. Returns the target object. + * @param target The target object to copy to. + * @param sources One or more source objects from which to copy properties + */ + assign(target: object, ...sources: any[]): any; + + /** + * Returns an array of all symbol properties found directly on object o. + * @param o Object to retrieve the symbols from. + */ + getOwnPropertySymbols(o: any): symbol[]; + + /** + * Returns true if the values are the same value, false otherwise. + * @param value1 The first value. + * @param value2 The second value. + */ + is(value1: any, value2: any): boolean; + + /** + * Sets the prototype of a specified object o to object proto or null. Returns the object o. + * @param o The object to change its prototype. + * @param proto The value of the new prototype or null. + */ + setPrototypeOf(o: any, proto: object | null): any; + + /** + * Gets the own property descriptor of the specified object. + * An own property descriptor is one that is defined directly on the object and is not + * inherited from the object's prototype. + * @param o Object that contains the property. + * @param p Name of the property. + */ + getOwnPropertyDescriptor(o: any, propertyKey: PropertyKey): PropertyDescriptor; + + /** + * Adds a property to an object, or modifies attributes of an existing property. + * @param o Object on which to add or modify the property. This can be a native JavaScript + * object (that is, a user-defined object or a built in object) or a DOM object. + * @param p The property name. + * @param attributes Descriptor for the property. It can be for a data property or an accessor + * property. + */ + defineProperty(o: any, propertyKey: PropertyKey, attributes: PropertyDescriptor): any; +} + +interface ReadonlyArray { + /** + * Returns the value of the first element in the array where predicate is true, and undefined + * otherwise. + * @param predicate find calls predicate once for each element of the array, in ascending + * order, until it finds one where predicate returns true. If such an element is found, find + * immediately returns that element value. Otherwise, find returns undefined. + * @param thisArg If provided, it will be used as the this value for each invocation of + * predicate. If it is not provided, undefined is used instead. + */ + find(predicate: (this: void, value: T, index: number, obj: ReadonlyArray) => boolean): T | undefined; + find(predicate: (this: void, value: T, index: number, obj: ReadonlyArray) => boolean, thisArg: undefined): T | undefined; + find(predicate: (this: Z, value: T, index: number, obj: ReadonlyArray) => boolean, thisArg: Z): T | undefined; + + /** + * Returns the index of the first element in the array where predicate is true, and -1 + * otherwise. + * @param predicate find calls predicate once for each element of the array, in ascending + * order, until it finds one where predicate returns true. If such an element is found, + * findIndex immediately returns that element index. Otherwise, findIndex returns -1. + * @param thisArg If provided, it will be used as the this value for each invocation of + * predicate. If it is not provided, undefined is used instead. + */ + findIndex(predicate: (this: void, value: T, index: number, obj: Array) => boolean): number; + findIndex(predicate: (this: void, value: T, index: number, obj: Array) => boolean, thisArg: undefined): number; + findIndex(predicate: (this: Z, value: T, index: number, obj: Array) => boolean, thisArg: Z): number; +} + +interface RegExp { + /** + * Returns a string indicating the flags of the regular expression in question. This field is read-only. + * The characters in this string are sequenced and concatenated in the following order: + * + * - "g" for global + * - "i" for ignoreCase + * - "m" for multiline + * - "u" for unicode + * - "y" for sticky + * + * If no flags are set, the value is the empty string. + */ + readonly flags: string; + + /** + * Returns a Boolean value indicating the state of the sticky flag (y) used with a regular + * expression. Default is false. Read-only. + */ + readonly sticky: boolean; + + /** + * Returns a Boolean value indicating the state of the Unicode flag (u) used with a regular + * expression. Default is false. Read-only. + */ + readonly unicode: boolean; +} + +interface RegExpConstructor { + new (pattern: RegExp, flags?: string): RegExp; + (pattern: RegExp, flags?: string): RegExp; +} + +interface String { + /** + * Returns a nonnegative integer Number less than 1114112 (0x110000) that is the code point + * value of the UTF-16 encoded code point starting at the string element at position pos in + * the String resulting from converting this object to a String. + * If there is no element at that position, the result is undefined. + * If a valid UTF-16 surrogate pair does not begin at pos, the result is the code unit at pos. + */ + codePointAt(pos: number): number | undefined; + + /** + * Returns true if searchString appears as a substring of the result of converting this + * object to a String, at one or more positions that are + * greater than or equal to position; otherwise, returns false. + * @param searchString search string + * @param position If position is undefined, 0 is assumed, so as to search all of the String. + */ + includes(searchString: string, position?: number): boolean; + + /** + * Returns true if the sequence of elements of searchString converted to a String is the + * same as the corresponding elements of this object (converted to a String) starting at + * endPosition – length(this). Otherwise returns false. + */ + endsWith(searchString: string, endPosition?: number): boolean; + + /** + * Returns the String value result of normalizing the string into the normalization form + * named by form as specified in Unicode Standard Annex #15, Unicode Normalization Forms. + * @param form Applicable values: "NFC", "NFD", "NFKC", or "NFKD", If not specified default + * is "NFC" + */ + normalize(form: "NFC" | "NFD" | "NFKC" | "NFKD"): string; + + /** + * Returns the String value result of normalizing the string into the normalization form + * named by form as specified in Unicode Standard Annex #15, Unicode Normalization Forms. + * @param form Applicable values: "NFC", "NFD", "NFKC", or "NFKD", If not specified default + * is "NFC" + */ + normalize(form?: string): string; + + /** + * Returns a String value that is made from count copies appended together. If count is 0, + * T is the empty String is returned. + * @param count number of copies to append + */ + repeat(count: number): string; + + /** + * Returns true if the sequence of elements of searchString converted to a String is the + * same as the corresponding elements of this object (converted to a String) starting at + * position. Otherwise returns false. + */ + startsWith(searchString: string, position?: number): boolean; + + /** + * Returns an HTML anchor element and sets the name attribute to the text value + * @param name + */ + anchor(name: string): string; + + /** Returns a HTML element */ + big(): string; + + /** Returns a HTML element */ + blink(): string; + + /** Returns a HTML element */ + bold(): string; + + /** Returns a HTML element */ + fixed(): string; + + /** Returns a HTML element and sets the color attribute value */ + fontcolor(color: string): string; + + /** Returns a HTML element and sets the size attribute value */ + fontsize(size: number): string; + + /** Returns a HTML element and sets the size attribute value */ + fontsize(size: string): string; + + /** Returns an HTML element */ + italics(): string; + + /** Returns an HTML element and sets the href attribute value */ + link(url: string): string; + + /** Returns a HTML element */ + small(): string; + + /** Returns a HTML element */ + strike(): string; + + /** Returns a HTML element */ + sub(): string; + + /** Returns a HTML element */ + sup(): string; +} + +interface StringConstructor { + /** + * Return the String value whose elements are, in order, the elements in the List elements. + * If length is 0, the empty string is returned. + */ + fromCodePoint(...codePoints: number[]): string; + + /** + * String.raw is intended for use as a tag function of a Tagged Template String. When called + * as such the first argument will be a well formed template call site object and the rest + * parameter will contain the substitution values. + * @param template A well-formed template string call site representation. + * @param substitutions A set of substitution values. + */ + raw(template: TemplateStringsArray, ...substitutions: any[]): string; +} + + +interface Map { + clear(): void; + delete(key: K): boolean; + forEach(callbackfn: (value: V, key: K, map: Map) => void, thisArg?: any): void; + get(key: K): V | undefined; + has(key: K): boolean; + set(key: K, value: V): this; + readonly size: number; +} + +interface MapConstructor { + new (): Map; + new (entries?: [K, V][]): Map; + readonly prototype: Map; +} +declare var Map: MapConstructor; + +interface ReadonlyMap { + forEach(callbackfn: (value: V, key: K, map: ReadonlyMap) => void, thisArg?: any): void; + get(key: K): V | undefined; + has(key: K): boolean; + readonly size: number; +} + +interface WeakMap { + delete(key: K): boolean; + get(key: K): V | undefined; + has(key: K): boolean; + set(key: K, value: V): this; +} + +interface WeakMapConstructor { + new (): WeakMap; + new (entries?: [K, V][]): WeakMap; + readonly prototype: WeakMap; +} +declare var WeakMap: WeakMapConstructor; + +interface Set { + add(value: T): this; + clear(): void; + delete(value: T): boolean; + forEach(callbackfn: (value: T, value2: T, set: Set) => void, thisArg?: any): void; + has(value: T): boolean; + readonly size: number; +} + +interface SetConstructor { + new (): Set; + new (values?: T[]): Set; + readonly prototype: Set; +} +declare var Set: SetConstructor; + +interface ReadonlySet { + forEach(callbackfn: (value: T, value2: T, set: ReadonlySet) => void, thisArg?: any): void; + has(value: T): boolean; + readonly size: number; +} + +interface WeakSet { + add(value: T): this; + delete(value: T): boolean; + has(value: T): boolean; +} + +interface WeakSetConstructor { + new (): WeakSet; + new (values?: T[]): WeakSet; + readonly prototype: WeakSet; +} +declare var WeakSet: WeakSetConstructor; + + +interface Generator extends Iterator { } + +interface GeneratorFunction { + /** + * Creates a new Generator object. + * @param args A list of arguments the function accepts. + */ + new (...args: any[]): Generator; + /** + * Creates a new Generator object. + * @param args A list of arguments the function accepts. + */ + (...args: any[]): Generator; + /** + * The length of the arguments. + */ + readonly length: number; + /** + * Returns the name of the function. + */ + readonly name: string; + /** + * A reference to the prototype. + */ + readonly prototype: Generator; +} + +interface GeneratorFunctionConstructor { + /** + * Creates a new Generator function. + * @param args A list of arguments the function accepts. + */ + new (...args: string[]): GeneratorFunction; + /** + * Creates a new Generator function. + * @param args A list of arguments the function accepts. + */ + (...args: string[]): GeneratorFunction; + /** + * The length of the arguments. + */ + readonly length: number; + /** + * Returns the name of the function. + */ + readonly name: string; + /** + * A reference to the prototype. + */ + readonly prototype: GeneratorFunction; +} +declare var GeneratorFunction: GeneratorFunctionConstructor; + + +/// + +interface SymbolConstructor { + /** + * A method that returns the default iterator for an object. Called by the semantics of the + * for-of statement. + */ + readonly iterator: symbol; +} + +interface IteratorResult { + done: boolean; + value: T; +} + +interface Iterator { + next(value?: any): IteratorResult; + return?(value?: any): IteratorResult; + throw?(e?: any): IteratorResult; +} + +interface Iterable { + [Symbol.iterator](): Iterator; +} + +interface IterableIterator extends Iterator { + [Symbol.iterator](): IterableIterator; +} + +interface Array { + /** Iterator */ + [Symbol.iterator](): IterableIterator; + + /** + * Returns an iterable of key, value pairs for every entry in the array + */ + entries(): IterableIterator<[number, T]>; + + /** + * Returns an iterable of keys in the array + */ + keys(): IterableIterator; + + /** + * Returns an iterable of values in the array + */ + values(): IterableIterator; +} + +interface ArrayConstructor { + /** + * Creates an array from an iterable object. + * @param iterable An iterable object to convert to an array. + * @param mapfn A mapping function to call on every element of the array. + * @param thisArg Value of 'this' used to invoke the mapfn. + */ + from(iterable: Iterable, mapfn: (this: void, v: T, k: number) => U): Array; + from(iterable: Iterable, mapfn: (this: void, v: T, k: number) => U, thisArg: undefined): Array; + from(iterable: Iterable, mapfn: (this: Z, v: T, k: number) => U, thisArg: Z): Array; + + /** + * Creates an array from an iterable object. + * @param iterable An iterable object to convert to an array. + */ + from(iterable: Iterable): Array; +} + +interface ReadonlyArray { + /** Iterator of values in the array. */ + [Symbol.iterator](): IterableIterator; + + /** + * Returns an iterable of key, value pairs for every entry in the array + */ + entries(): IterableIterator<[number, T]>; + + /** + * Returns an iterable of keys in the array + */ + keys(): IterableIterator; + + /** + * Returns an iterable of values in the array + */ + values(): IterableIterator; +} + +interface IArguments { + /** Iterator */ + [Symbol.iterator](): IterableIterator; +} + +interface Map { + /** Returns an iterable of entries in the map. */ + [Symbol.iterator](): IterableIterator<[K, V]>; + + /** + * Returns an iterable of key, value pairs for every entry in the map. + */ + entries(): IterableIterator<[K, V]>; + + /** + * Returns an iterable of keys in the map + */ + keys(): IterableIterator; + + /** + * Returns an iterable of values in the map + */ + values(): IterableIterator; +} + +interface ReadonlyMap { + /** Returns an iterable of entries in the map. */ + [Symbol.iterator](): IterableIterator<[K, V]>; + + /** + * Returns an iterable of key, value pairs for every entry in the map. + */ + entries(): IterableIterator<[K, V]>; + + /** + * Returns an iterable of keys in the map + */ + keys(): IterableIterator; + + /** + * Returns an iterable of values in the map + */ + values(): IterableIterator; +} + +interface MapConstructor { + new (iterable: Iterable<[K, V]>): Map; +} + +interface WeakMap { } + +interface WeakMapConstructor { + new (iterable: Iterable<[K, V]>): WeakMap; +} + +interface Set { + /** Iterates over values in the set. */ + [Symbol.iterator](): IterableIterator; + /** + * Returns an iterable of [v,v] pairs for every value `v` in the set. + */ + entries(): IterableIterator<[T, T]>; + /** + * Despite its name, returns an iterable of the values in the set, + */ + keys(): IterableIterator; + + /** + * Returns an iterable of values in the set. + */ + values(): IterableIterator; +} + +interface ReadonlySet { + /** Iterates over values in the set. */ + [Symbol.iterator](): IterableIterator; + + /** + * Returns an iterable of [v,v] pairs for every value `v` in the set. + */ + entries(): IterableIterator<[T, T]>; + + /** + * Despite its name, returns an iterable of the values in the set, + */ + keys(): IterableIterator; + + /** + * Returns an iterable of values in the set. + */ + values(): IterableIterator; +} + +interface SetConstructor { + new (iterable: Iterable): Set; +} + +interface WeakSet { } + +interface WeakSetConstructor { + new (iterable: Iterable): WeakSet; +} + +interface Promise { } + +interface PromiseConstructor { + /** + * Creates a Promise that is resolved with an array of results when all of the provided Promises + * resolve, or rejected when any Promise is rejected. + * @param values An array of Promises. + * @returns A new Promise. + */ + all(values: Iterable>): Promise; + + /** + * Creates a Promise that is resolved or rejected when any of the provided Promises are resolved + * or rejected. + * @param values An array of Promises. + * @returns A new Promise. + */ + race(values: Iterable>): Promise; +} + +declare namespace Reflect { + function enumerate(target: object): IterableIterator; +} + +interface String { + /** Iterator */ + [Symbol.iterator](): IterableIterator; +} + +/** + * A typed array of 8-bit integer values. The contents are initialized to 0. If the requested + * number of bytes could not be allocated an exception is raised. + */ +interface Int8Array { + [Symbol.iterator](): IterableIterator; + /** + * Returns an array of key, value pairs for every entry in the array + */ + entries(): IterableIterator<[number, number]>; + /** + * Returns an list of keys in the array + */ + keys(): IterableIterator; + /** + * Returns an list of values in the array + */ + values(): IterableIterator; +} + +interface Int8ArrayConstructor { + new (elements: Iterable): Int8Array; + + /** + * Creates an array from an array-like or iterable object. + * @param arrayLike An array-like or iterable object to convert to an array. + * @param mapfn A mapping function to call on every element of the array. + * @param thisArg Value of 'this' used to invoke the mapfn. + */ + from(arrayLike: Iterable, mapfn: (this: void, v: number, k: number) => number): Int8Array; + from(arrayLike: Iterable, mapfn: (this: void, v: number, k: number) => number, thisArg: undefined): Int8Array; + from(arrayLike: Iterable, mapfn: (this: Z, v: number, k: number) => number, thisArg: Z): Int8Array; + + from(arrayLike: Iterable): Int8Array; +} + +/** + * A typed array of 8-bit unsigned integer values. The contents are initialized to 0. If the + * requested number of bytes could not be allocated an exception is raised. + */ +interface Uint8Array { + [Symbol.iterator](): IterableIterator; + /** + * Returns an array of key, value pairs for every entry in the array + */ + entries(): IterableIterator<[number, number]>; + /** + * Returns an list of keys in the array + */ + keys(): IterableIterator; + /** + * Returns an list of values in the array + */ + values(): IterableIterator; +} + +interface Uint8ArrayConstructor { + new (elements: Iterable): Uint8Array; + + /** + * Creates an array from an array-like or iterable object. + * @param arrayLike An array-like or iterable object to convert to an array. + * @param mapfn A mapping function to call on every element of the array. + * @param thisArg Value of 'this' used to invoke the mapfn. + */ + from(arrayLike: Iterable, mapfn: (this: void, v: number, k: number) => number): Uint8Array; + from(arrayLike: Iterable, mapfn: (this: void, v: number, k: number) => number, thisArg: undefined): Uint8Array; + from(arrayLike: Iterable, mapfn: (this: Z, v: number, k: number) => number, thisArg: Z): Uint8Array; + + from(arrayLike: Iterable): Uint8Array; +} + +/** + * A typed array of 8-bit unsigned integer (clamped) values. The contents are initialized to 0. + * If the requested number of bytes could not be allocated an exception is raised. + */ +interface Uint8ClampedArray { + [Symbol.iterator](): IterableIterator; + /** + * Returns an array of key, value pairs for every entry in the array + */ + entries(): IterableIterator<[number, number]>; + + /** + * Returns an list of keys in the array + */ + keys(): IterableIterator; + + /** + * Returns an list of values in the array + */ + values(): IterableIterator; +} + +interface Uint8ClampedArrayConstructor { + new (elements: Iterable): Uint8ClampedArray; + + + /** + * Creates an array from an array-like or iterable object. + * @param arrayLike An array-like or iterable object to convert to an array. + * @param mapfn A mapping function to call on every element of the array. + * @param thisArg Value of 'this' used to invoke the mapfn. + */ + from(arrayLike: Iterable, mapfn: (this: void, v: number, k: number) => number): Uint8ClampedArray; + from(arrayLike: Iterable, mapfn: (this: void, v: number, k: number) => number, thisArg: undefined): Uint8ClampedArray; + from(arrayLike: Iterable, mapfn: (this: Z, v: number, k: number) => number, thisArg: Z): Uint8ClampedArray; + + from(arrayLike: Iterable): Uint8ClampedArray; +} + +/** + * A typed array of 16-bit signed integer values. The contents are initialized to 0. If the + * requested number of bytes could not be allocated an exception is raised. + */ +interface Int16Array { + [Symbol.iterator](): IterableIterator; + /** + * Returns an array of key, value pairs for every entry in the array + */ + entries(): IterableIterator<[number, number]>; + + /** + * Returns an list of keys in the array + */ + keys(): IterableIterator; + + /** + * Returns an list of values in the array + */ + values(): IterableIterator; +} + +interface Int16ArrayConstructor { + new (elements: Iterable): Int16Array; + + /** + * Creates an array from an array-like or iterable object. + * @param arrayLike An array-like or iterable object to convert to an array. + * @param mapfn A mapping function to call on every element of the array. + * @param thisArg Value of 'this' used to invoke the mapfn. + */ + from(arrayLike: Iterable, mapfn: (this: void, v: number, k: number) => number): Int16Array; + from(arrayLike: Iterable, mapfn: (this: void, v: number, k: number) => number, thisArg: undefined): Int16Array; + from(arrayLike: Iterable, mapfn: (this: Z, v: number, k: number) => number, thisArg: Z): Int16Array; + + from(arrayLike: Iterable): Int16Array; +} + +/** + * A typed array of 16-bit unsigned integer values. The contents are initialized to 0. If the + * requested number of bytes could not be allocated an exception is raised. + */ +interface Uint16Array { + [Symbol.iterator](): IterableIterator; + /** + * Returns an array of key, value pairs for every entry in the array + */ + entries(): IterableIterator<[number, number]>; + /** + * Returns an list of keys in the array + */ + keys(): IterableIterator; + /** + * Returns an list of values in the array + */ + values(): IterableIterator; +} + +interface Uint16ArrayConstructor { + new (elements: Iterable): Uint16Array; + + /** + * Creates an array from an array-like or iterable object. + * @param arrayLike An array-like or iterable object to convert to an array. + * @param mapfn A mapping function to call on every element of the array. + * @param thisArg Value of 'this' used to invoke the mapfn. + */ + from(arrayLike: Iterable, mapfn: (this: void, v: number, k: number) => number): Uint16Array; + from(arrayLike: Iterable, mapfn: (this: void, v: number, k: number) => number, thisArg: undefined): Uint16Array; + from(arrayLike: Iterable, mapfn: (this: Z, v: number, k: number) => number, thisArg: Z): Uint16Array; + + from(arrayLike: Iterable): Uint16Array; +} + +/** + * A typed array of 32-bit signed integer values. The contents are initialized to 0. If the + * requested number of bytes could not be allocated an exception is raised. + */ +interface Int32Array { + [Symbol.iterator](): IterableIterator; + /** + * Returns an array of key, value pairs for every entry in the array + */ + entries(): IterableIterator<[number, number]>; + /** + * Returns an list of keys in the array + */ + keys(): IterableIterator; + /** + * Returns an list of values in the array + */ + values(): IterableIterator; +} + +interface Int32ArrayConstructor { + new (elements: Iterable): Int32Array; + + /** + * Creates an array from an array-like or iterable object. + * @param arrayLike An array-like or iterable object to convert to an array. + * @param mapfn A mapping function to call on every element of the array. + * @param thisArg Value of 'this' used to invoke the mapfn. + */ + from(arrayLike: Iterable, mapfn: (this: void, v: number, k: number) => number): Int32Array; + from(arrayLike: Iterable, mapfn: (this: void, v: number, k: number) => number, thisArg: undefined): Int32Array; + from(arrayLike: Iterable, mapfn: (this: Z, v: number, k: number) => number, thisArg: Z): Int32Array; + + from(arrayLike: Iterable): Int32Array; +} + +/** + * A typed array of 32-bit unsigned integer values. The contents are initialized to 0. If the + * requested number of bytes could not be allocated an exception is raised. + */ +interface Uint32Array { + [Symbol.iterator](): IterableIterator; + /** + * Returns an array of key, value pairs for every entry in the array + */ + entries(): IterableIterator<[number, number]>; + /** + * Returns an list of keys in the array + */ + keys(): IterableIterator; + /** + * Returns an list of values in the array + */ + values(): IterableIterator; +} + +interface Uint32ArrayConstructor { + new (elements: Iterable): Uint32Array; + + /** + * Creates an array from an array-like or iterable object. + * @param arrayLike An array-like or iterable object to convert to an array. + * @param mapfn A mapping function to call on every element of the array. + * @param thisArg Value of 'this' used to invoke the mapfn. + */ + from(arrayLike: Iterable, mapfn: (this: void, v: number, k: number) => number): Uint32Array; + from(arrayLike: Iterable, mapfn: (this: void, v: number, k: number) => number, thisArg: undefined): Uint32Array; + from(arrayLike: Iterable, mapfn: (this: Z, v: number, k: number) => number, thisArg: Z): Uint32Array; + + from(arrayLike: Iterable): Uint32Array; +} + +/** + * A typed array of 32-bit float values. The contents are initialized to 0. If the requested number + * of bytes could not be allocated an exception is raised. + */ +interface Float32Array { + [Symbol.iterator](): IterableIterator; + /** + * Returns an array of key, value pairs for every entry in the array + */ + entries(): IterableIterator<[number, number]>; + /** + * Returns an list of keys in the array + */ + keys(): IterableIterator; + /** + * Returns an list of values in the array + */ + values(): IterableIterator; +} + +interface Float32ArrayConstructor { + new (elements: Iterable): Float32Array; + + /** + * Creates an array from an array-like or iterable object. + * @param arrayLike An array-like or iterable object to convert to an array. + * @param mapfn A mapping function to call on every element of the array. + * @param thisArg Value of 'this' used to invoke the mapfn. + */ + from(arrayLike: Iterable, mapfn: (this: void, v: number, k: number) => number): Float32Array; + from(arrayLike: Iterable, mapfn: (this: void, v: number, k: number) => number, thisArg: undefined): Float32Array; + from(arrayLike: Iterable, mapfn: (this: Z, v: number, k: number) => number, thisArg: Z): Float32Array; + + from(arrayLike: Iterable): Float32Array; +} + +/** + * A typed array of 64-bit float values. The contents are initialized to 0. If the requested + * number of bytes could not be allocated an exception is raised. + */ +interface Float64Array { + [Symbol.iterator](): IterableIterator; + /** + * Returns an array of key, value pairs for every entry in the array + */ + entries(): IterableIterator<[number, number]>; + /** + * Returns an list of keys in the array + */ + keys(): IterableIterator; + /** + * Returns an list of values in the array + */ + values(): IterableIterator; +} + +interface Float64ArrayConstructor { + new (elements: Iterable): Float64Array; + + /** + * Creates an array from an array-like or iterable object. + * @param arrayLike An array-like or iterable object to convert to an array. + * @param mapfn A mapping function to call on every element of the array. + * @param thisArg Value of 'this' used to invoke the mapfn. + */ + from(arrayLike: Iterable, mapfn: (this: void, v: number, k: number) => number): Float64Array; + from(arrayLike: Iterable, mapfn: (this: void, v: number, k: number) => number, thisArg: undefined): Float64Array; + from(arrayLike: Iterable, mapfn: (this: Z, v: number, k: number) => number, thisArg: Z): Float64Array; + + from(arrayLike: Iterable): Float64Array; +} + + +interface PromiseConstructor { + /** + * A reference to the prototype. + */ + readonly prototype: Promise; + + /** + * Creates a new Promise. + * @param executor A callback used to initialize the promise. This callback is passed two arguments: + * a resolve callback used resolve the promise with a value or the result of another promise, + * and a reject callback used to reject the promise with a provided reason or error. + */ + new (executor: (resolve: (value?: T | PromiseLike) => void, reject: (reason?: any) => void) => void): Promise; + + /** + * Creates a Promise that is resolved with an array of results when all of the provided Promises + * resolve, or rejected when any Promise is rejected. + * @param values An array of Promises. + * @returns A new Promise. + */ + all(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike , T5 | PromiseLike, T6 | PromiseLike, T7 | PromiseLike, T8 | PromiseLike, T9 | PromiseLike, T10 | PromiseLike]): Promise<[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10]>; + + /** + * Creates a Promise that is resolved with an array of results when all of the provided Promises + * resolve, or rejected when any Promise is rejected. + * @param values An array of Promises. + * @returns A new Promise. + */ + all(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike , T5 | PromiseLike, T6 | PromiseLike, T7 | PromiseLike, T8 | PromiseLike, T9 | PromiseLike]): Promise<[T1, T2, T3, T4, T5, T6, T7, T8, T9]>; + + /** + * Creates a Promise that is resolved with an array of results when all of the provided Promises + * resolve, or rejected when any Promise is rejected. + * @param values An array of Promises. + * @returns A new Promise. + */ + all(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike , T5 | PromiseLike, T6 | PromiseLike, T7 | PromiseLike, T8 | PromiseLike]): Promise<[T1, T2, T3, T4, T5, T6, T7, T8]>; + + /** + * Creates a Promise that is resolved with an array of results when all of the provided Promises + * resolve, or rejected when any Promise is rejected. + * @param values An array of Promises. + * @returns A new Promise. + */ + all(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike , T5 | PromiseLike, T6 | PromiseLike, T7 | PromiseLike]): Promise<[T1, T2, T3, T4, T5, T6, T7]>; + + /** + * Creates a Promise that is resolved with an array of results when all of the provided Promises + * resolve, or rejected when any Promise is rejected. + * @param values An array of Promises. + * @returns A new Promise. + */ + all(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike , T5 | PromiseLike, T6 | PromiseLike]): Promise<[T1, T2, T3, T4, T5, T6]>; + + /** + * Creates a Promise that is resolved with an array of results when all of the provided Promises + * resolve, or rejected when any Promise is rejected. + * @param values An array of Promises. + * @returns A new Promise. + */ + all(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike , T5 | PromiseLike]): Promise<[T1, T2, T3, T4, T5]>; + + /** + * Creates a Promise that is resolved with an array of results when all of the provided Promises + * resolve, or rejected when any Promise is rejected. + * @param values An array of Promises. + * @returns A new Promise. + */ + all(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike ]): Promise<[T1, T2, T3, T4]>; + + /** + * Creates a Promise that is resolved with an array of results when all of the provided Promises + * resolve, or rejected when any Promise is rejected. + * @param values An array of Promises. + * @returns A new Promise. + */ + all(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike]): Promise<[T1, T2, T3]>; + + /** + * Creates a Promise that is resolved with an array of results when all of the provided Promises + * resolve, or rejected when any Promise is rejected. + * @param values An array of Promises. + * @returns A new Promise. + */ + all(values: [T1 | PromiseLike, T2 | PromiseLike]): Promise<[T1, T2]>; + + /** + * Creates a Promise that is resolved with an array of results when all of the provided Promises + * resolve, or rejected when any Promise is rejected. + * @param values An array of Promises. + * @returns A new Promise. + */ + all(values: (T | PromiseLike)[]): Promise; + + /** + * Creates a Promise that is resolved or rejected when any of the provided Promises are resolved + * or rejected. + * @param values An array of Promises. + * @returns A new Promise. + */ + race(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike, T5 | PromiseLike, T6 | PromiseLike, T7 | PromiseLike, T8 | PromiseLike, T9 | PromiseLike, T10 | PromiseLike]): Promise; + + /** + * Creates a Promise that is resolved or rejected when any of the provided Promises are resolved + * or rejected. + * @param values An array of Promises. + * @returns A new Promise. + */ + race(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike, T5 | PromiseLike, T6 | PromiseLike, T7 | PromiseLike, T8 | PromiseLike, T9 | PromiseLike]): Promise; + + /** + * Creates a Promise that is resolved or rejected when any of the provided Promises are resolved + * or rejected. + * @param values An array of Promises. + * @returns A new Promise. + */ + race(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike, T5 | PromiseLike, T6 | PromiseLike, T7 | PromiseLike, T8 | PromiseLike]): Promise; + + /** + * Creates a Promise that is resolved or rejected when any of the provided Promises are resolved + * or rejected. + * @param values An array of Promises. + * @returns A new Promise. + */ + race(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike, T5 | PromiseLike, T6 | PromiseLike, T7 | PromiseLike]): Promise; + + /** + * Creates a Promise that is resolved or rejected when any of the provided Promises are resolved + * or rejected. + * @param values An array of Promises. + * @returns A new Promise. + */ + race(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike, T5 | PromiseLike, T6 | PromiseLike]): Promise; + + /** + * Creates a Promise that is resolved or rejected when any of the provided Promises are resolved + * or rejected. + * @param values An array of Promises. + * @returns A new Promise. + */ + race(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike, T5 | PromiseLike]): Promise; + + /** + * Creates a Promise that is resolved or rejected when any of the provided Promises are resolved + * or rejected. + * @param values An array of Promises. + * @returns A new Promise. + */ + race(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike]): Promise; + + /** + * Creates a Promise that is resolved or rejected when any of the provided Promises are resolved + * or rejected. + * @param values An array of Promises. + * @returns A new Promise. + */ + race(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike]): Promise; + + /** + * Creates a Promise that is resolved or rejected when any of the provided Promises are resolved + * or rejected. + * @param values An array of Promises. + * @returns A new Promise. + */ + race(values: [T1 | PromiseLike, T2 | PromiseLike]): Promise; + + /** + * Creates a Promise that is resolved or rejected when any of the provided Promises are resolved + * or rejected. + * @param values An array of Promises. + * @returns A new Promise. + */ + race(values: (T | PromiseLike)[]): Promise; + + /** + * Creates a new rejected promise for the provided reason. + * @param reason The reason the promise was rejected. + * @returns A new rejected Promise. + */ + reject(reason: any): Promise; + + /** + * Creates a new rejected promise for the provided reason. + * @param reason The reason the promise was rejected. + * @returns A new rejected Promise. + */ + reject(reason: any): Promise; + + /** + * Creates a new resolved promise for the provided value. + * @param value A promise. + * @returns A promise whose internal state matches the provided promise. + */ + resolve(value: T | PromiseLike): Promise; + + /** + * Creates a new resolved promise . + * @returns A resolved promise. + */ + resolve(): Promise; +} + +declare var Promise: PromiseConstructor; + +interface ProxyHandler { + getPrototypeOf? (target: T): object | null; + setPrototypeOf? (target: T, v: any): boolean; + isExtensible? (target: T): boolean; + preventExtensions? (target: T): boolean; + getOwnPropertyDescriptor? (target: T, p: PropertyKey): PropertyDescriptor | undefined; + has? (target: T, p: PropertyKey): boolean; + get? (target: T, p: PropertyKey, receiver: any): any; + set? (target: T, p: PropertyKey, value: any, receiver: any): boolean; + deleteProperty? (target: T, p: PropertyKey): boolean; + defineProperty? (target: T, p: PropertyKey, attributes: PropertyDescriptor): boolean; + enumerate? (target: T): PropertyKey[]; + ownKeys? (target: T): PropertyKey[]; + apply? (target: T, thisArg: any, argArray?: any): any; + construct? (target: T, argArray: any, newTarget?: any): object; +} + +interface ProxyConstructor { + revocable(target: T, handler: ProxyHandler): { proxy: T; revoke: () => void; }; + new (target: T, handler: ProxyHandler): T; +} +declare var Proxy: ProxyConstructor; + + +declare namespace Reflect { + function apply(target: Function, thisArgument: any, argumentsList: ArrayLike): any; + function construct(target: Function, argumentsList: ArrayLike, newTarget?: any): any; + function defineProperty(target: object, propertyKey: PropertyKey, attributes: PropertyDescriptor): boolean; + function deleteProperty(target: object, propertyKey: PropertyKey): boolean; + function get(target: object, propertyKey: PropertyKey, receiver?: any): any; + function getOwnPropertyDescriptor(target: object, propertyKey: PropertyKey): PropertyDescriptor; + function getPrototypeOf(target: object): object; + function has(target: object, propertyKey: PropertyKey): boolean; + function isExtensible(target: object): boolean; + function ownKeys(target: object): Array; + function preventExtensions(target: object): boolean; + function set(target: object, propertyKey: PropertyKey, value: any, receiver?: any): boolean; + function setPrototypeOf(target: object, proto: any): boolean; +} + + +interface Symbol { + /** Returns a string representation of an object. */ + toString(): string; + + /** Returns the primitive value of the specified object. */ + valueOf(): symbol; +} + +interface SymbolConstructor { + /** + * A reference to the prototype. + */ + readonly prototype: Symbol; + + /** + * Returns a new unique Symbol value. + * @param description Description of the new Symbol object. + */ + (description?: string | number): symbol; + + /** + * Returns a Symbol object from the global symbol registry matching the given key if found. + * Otherwise, returns a new symbol with this key. + * @param key key to search for. + */ + for(key: string): symbol; + + /** + * Returns a key from the global symbol registry matching the given Symbol if found. + * Otherwise, returns a undefined. + * @param sym Symbol to find the key for. + */ + keyFor(sym: symbol): string | undefined; +} + +declare var Symbol: SymbolConstructor; + +/// + +interface SymbolConstructor { + /** + * A method that determines if a constructor object recognizes an object as one of the + * constructor’s instances. Called by the semantics of the instanceof operator. + */ + readonly hasInstance: symbol; + + /** + * A Boolean value that if true indicates that an object should flatten to its array elements + * by Array.prototype.concat. + */ + readonly isConcatSpreadable: symbol; + + /** + * A regular expression method that matches the regular expression against a string. Called + * by the String.prototype.match method. + */ + readonly match: symbol; + + /** + * A regular expression method that replaces matched substrings of a string. Called by the + * String.prototype.replace method. + */ + readonly replace: symbol; + + /** + * A regular expression method that returns the index within a string that matches the + * regular expression. Called by the String.prototype.search method. + */ + readonly search: symbol; + + /** + * A function valued property that is the constructor function that is used to create + * derived objects. + */ + readonly species: symbol; + + /** + * A regular expression method that splits a string at the indices that match the regular + * expression. Called by the String.prototype.split method. + */ + readonly split: symbol; + + /** + * A method that converts an object to a corresponding primitive value. + * Called by the ToPrimitive abstract operation. + */ + readonly toPrimitive: symbol; + + /** + * A String value that is used in the creation of the default string description of an object. + * Called by the built-in method Object.prototype.toString. + */ + readonly toStringTag: symbol; + + /** + * An Object whose own property names are property names that are excluded from the 'with' + * environment bindings of the associated objects. + */ + readonly unscopables: symbol; +} + +interface Symbol { + readonly [Symbol.toStringTag]: "Symbol"; +} + +interface Array { + /** + * Returns an object whose properties have the value 'true' + * when they will be absent when used in a 'with' statement. + */ + [Symbol.unscopables](): { + copyWithin: boolean; + entries: boolean; + fill: boolean; + find: boolean; + findIndex: boolean; + keys: boolean; + values: boolean; + }; +} + +interface Date { + /** + * Converts a Date object to a string. + */ + [Symbol.toPrimitive](hint: "default"): string; + /** + * Converts a Date object to a string. + */ + [Symbol.toPrimitive](hint: "string"): string; + /** + * Converts a Date object to a number. + */ + [Symbol.toPrimitive](hint: "number"): number; + /** + * Converts a Date object to a string or number. + * + * @param hint The strings "number", "string", or "default" to specify what primitive to return. + * + * @throws {TypeError} If 'hint' was given something other than "number", "string", or "default". + * @returns A number if 'hint' was "number", a string if 'hint' was "string" or "default". + */ + [Symbol.toPrimitive](hint: string): string | number; +} + +interface Map { + readonly [Symbol.toStringTag]: "Map"; +} + +interface WeakMap { + readonly [Symbol.toStringTag]: "WeakMap"; +} + +interface Set { + readonly [Symbol.toStringTag]: "Set"; +} + +interface WeakSet { + readonly [Symbol.toStringTag]: "WeakSet"; +} + +interface JSON { + readonly [Symbol.toStringTag]: "JSON"; +} + +interface Function { + /** + * Determines whether the given value inherits from this function if this function was used + * as a constructor function. + * + * A constructor function can control which objects are recognized as its instances by + * 'instanceof' by overriding this method. + */ + [Symbol.hasInstance](value: any): boolean; +} + +interface GeneratorFunction { + readonly [Symbol.toStringTag]: "GeneratorFunction"; +} + +interface Math { + readonly [Symbol.toStringTag]: "Math"; +} + +interface Promise { + readonly [Symbol.toStringTag]: "Promise"; +} + +interface PromiseConstructor { + readonly [Symbol.species]: Function; +} + +interface RegExp { + /** + * Matches a string with this regular expression, and returns an array containing the results of + * that search. + * @param string A string to search within. + */ + [Symbol.match](string: string): RegExpMatchArray | null; + + /** + * Replaces text in a string, using this regular expression. + * @param string A String object or string literal whose contents matching against + * this regular expression will be replaced + * @param replaceValue A String object or string literal containing the text to replace for every + * successful match of this regular expression. + */ + [Symbol.replace](string: string, replaceValue: string): string; + + /** + * Replaces text in a string, using this regular expression. + * @param string A String object or string literal whose contents matching against + * this regular expression will be replaced + * @param replacer A function that returns the replacement text. + */ + [Symbol.replace](string: string, replacer: (substring: string, ...args: any[]) => string): string; + + /** + * Finds the position beginning first substring match in a regular expression search + * using this regular expression. + * + * @param string The string to search within. + */ + [Symbol.search](string: string): number; + + /** + * Returns an array of substrings that were delimited by strings in the original input that + * match against this regular expression. + * + * If the regular expression contains capturing parentheses, then each time this + * regular expression matches, the results (including any undefined results) of the + * capturing parentheses are spliced. + * + * @param string string value to split + * @param limit if not undefined, the output array is truncated so that it contains no more + * than 'limit' elements. + */ + [Symbol.split](string: string, limit?: number): string[]; +} + +interface RegExpConstructor { + [Symbol.species](): RegExpConstructor; +} + +interface String { + /** + * Matches a string an object that supports being matched against, and returns an array containing the results of that search. + * @param matcher An object that supports being matched against. + */ + match(matcher: { [Symbol.match](string: string): RegExpMatchArray | null; }): RegExpMatchArray | null; + + /** + * Replaces text in a string, using an object that supports replacement within a string. + * @param searchValue A object can search for and replace matches within a string. + * @param replaceValue A string containing the text to replace for every successful match of searchValue in this string. + */ + replace(searchValue: { [Symbol.replace](string: string, replaceValue: string): string; }, replaceValue: string): string; + + /** + * Replaces text in a string, using an object that supports replacement within a string. + * @param searchValue A object can search for and replace matches within a string. + * @param replacer A function that returns the replacement text. + */ + replace(searchValue: { [Symbol.replace](string: string, replacer: (substring: string, ...args: any[]) => string): string; }, replacer: (substring: string, ...args: any[]) => string): string; + + /** + * Finds the first substring match in a regular expression search. + * @param searcher An object which supports searching within a string. + */ + search(searcher: { [Symbol.search](string: string): number; }): number; + + /** + * Split a string into substrings using the specified separator and return them as an array. + * @param splitter An object that can split a string. + * @param limit A value used to limit the number of elements returned in the array. + */ + split(splitter: { [Symbol.split](string: string, limit?: number): string[]; }, limit?: number): string[]; +} + +/** + * Represents a raw buffer of binary data, which is used to store data for the + * different typed arrays. ArrayBuffers cannot be read from or written to directly, + * but can be passed to a typed array or DataView Object to interpret the raw + * buffer as needed. + */ +interface ArrayBuffer { + readonly [Symbol.toStringTag]: "ArrayBuffer"; +} + +interface DataView { + readonly [Symbol.toStringTag]: "DataView"; +} + +/** + * A typed array of 8-bit integer values. The contents are initialized to 0. If the requested + * number of bytes could not be allocated an exception is raised. + */ +interface Int8Array { + readonly [Symbol.toStringTag]: "Int8Array"; +} + +/** + * A typed array of 8-bit unsigned integer values. The contents are initialized to 0. If the + * requested number of bytes could not be allocated an exception is raised. + */ +interface Uint8Array { + readonly [Symbol.toStringTag]: "UInt8Array"; +} + +/** + * A typed array of 8-bit unsigned integer (clamped) values. The contents are initialized to 0. + * If the requested number of bytes could not be allocated an exception is raised. + */ +interface Uint8ClampedArray { + readonly [Symbol.toStringTag]: "Uint8ClampedArray"; +} + +/** + * A typed array of 16-bit signed integer values. The contents are initialized to 0. If the + * requested number of bytes could not be allocated an exception is raised. + */ +interface Int16Array { + readonly [Symbol.toStringTag]: "Int16Array"; +} + +/** + * A typed array of 16-bit unsigned integer values. The contents are initialized to 0. If the + * requested number of bytes could not be allocated an exception is raised. + */ +interface Uint16Array { + readonly [Symbol.toStringTag]: "Uint16Array"; +} + +/** + * A typed array of 32-bit signed integer values. The contents are initialized to 0. If the + * requested number of bytes could not be allocated an exception is raised. + */ +interface Int32Array { + readonly [Symbol.toStringTag]: "Int32Array"; +} + +/** + * A typed array of 32-bit unsigned integer values. The contents are initialized to 0. If the + * requested number of bytes could not be allocated an exception is raised. + */ +interface Uint32Array { + readonly [Symbol.toStringTag]: "Uint32Array"; +} + +/** + * A typed array of 32-bit float values. The contents are initialized to 0. If the requested number + * of bytes could not be allocated an exception is raised. + */ +interface Float32Array { + readonly [Symbol.toStringTag]: "Float32Array"; +} + +/** + * A typed array of 64-bit float values. The contents are initialized to 0. If the requested + * number of bytes could not be allocated an exception is raised. + */ +interface Float64Array { + readonly [Symbol.toStringTag]: "Float64Array"; +} + + ///////////////////////////// /// DOM APIs diff --git a/lib/tsc.js b/lib/tsc.js index 9ad790d1385ad..cf9717975cf9e 100644 --- a/lib/tsc.js +++ b/lib/tsc.js @@ -14,14 +14,453 @@ and limitations under the License. ***************************************************************************** */ "use strict"; +var __assign = (this && this.__assign) || Object.assign || function(t) { + for (var s, i = 1, n = arguments.length; i < n; i++) { + s = arguments[i]; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) + t[p] = s[p]; + } + return t; +}; var ts; (function (ts) { + var SyntaxKind; + (function (SyntaxKind) { + SyntaxKind[SyntaxKind["Unknown"] = 0] = "Unknown"; + SyntaxKind[SyntaxKind["EndOfFileToken"] = 1] = "EndOfFileToken"; + SyntaxKind[SyntaxKind["SingleLineCommentTrivia"] = 2] = "SingleLineCommentTrivia"; + SyntaxKind[SyntaxKind["MultiLineCommentTrivia"] = 3] = "MultiLineCommentTrivia"; + SyntaxKind[SyntaxKind["NewLineTrivia"] = 4] = "NewLineTrivia"; + SyntaxKind[SyntaxKind["WhitespaceTrivia"] = 5] = "WhitespaceTrivia"; + SyntaxKind[SyntaxKind["ShebangTrivia"] = 6] = "ShebangTrivia"; + SyntaxKind[SyntaxKind["ConflictMarkerTrivia"] = 7] = "ConflictMarkerTrivia"; + SyntaxKind[SyntaxKind["NumericLiteral"] = 8] = "NumericLiteral"; + SyntaxKind[SyntaxKind["StringLiteral"] = 9] = "StringLiteral"; + SyntaxKind[SyntaxKind["JsxText"] = 10] = "JsxText"; + SyntaxKind[SyntaxKind["JsxTextAllWhiteSpaces"] = 11] = "JsxTextAllWhiteSpaces"; + SyntaxKind[SyntaxKind["RegularExpressionLiteral"] = 12] = "RegularExpressionLiteral"; + SyntaxKind[SyntaxKind["NoSubstitutionTemplateLiteral"] = 13] = "NoSubstitutionTemplateLiteral"; + SyntaxKind[SyntaxKind["TemplateHead"] = 14] = "TemplateHead"; + SyntaxKind[SyntaxKind["TemplateMiddle"] = 15] = "TemplateMiddle"; + SyntaxKind[SyntaxKind["TemplateTail"] = 16] = "TemplateTail"; + SyntaxKind[SyntaxKind["OpenBraceToken"] = 17] = "OpenBraceToken"; + SyntaxKind[SyntaxKind["CloseBraceToken"] = 18] = "CloseBraceToken"; + SyntaxKind[SyntaxKind["OpenParenToken"] = 19] = "OpenParenToken"; + SyntaxKind[SyntaxKind["CloseParenToken"] = 20] = "CloseParenToken"; + SyntaxKind[SyntaxKind["OpenBracketToken"] = 21] = "OpenBracketToken"; + SyntaxKind[SyntaxKind["CloseBracketToken"] = 22] = "CloseBracketToken"; + SyntaxKind[SyntaxKind["DotToken"] = 23] = "DotToken"; + SyntaxKind[SyntaxKind["DotDotDotToken"] = 24] = "DotDotDotToken"; + SyntaxKind[SyntaxKind["SemicolonToken"] = 25] = "SemicolonToken"; + SyntaxKind[SyntaxKind["CommaToken"] = 26] = "CommaToken"; + SyntaxKind[SyntaxKind["LessThanToken"] = 27] = "LessThanToken"; + SyntaxKind[SyntaxKind["LessThanSlashToken"] = 28] = "LessThanSlashToken"; + SyntaxKind[SyntaxKind["GreaterThanToken"] = 29] = "GreaterThanToken"; + SyntaxKind[SyntaxKind["LessThanEqualsToken"] = 30] = "LessThanEqualsToken"; + SyntaxKind[SyntaxKind["GreaterThanEqualsToken"] = 31] = "GreaterThanEqualsToken"; + SyntaxKind[SyntaxKind["EqualsEqualsToken"] = 32] = "EqualsEqualsToken"; + SyntaxKind[SyntaxKind["ExclamationEqualsToken"] = 33] = "ExclamationEqualsToken"; + SyntaxKind[SyntaxKind["EqualsEqualsEqualsToken"] = 34] = "EqualsEqualsEqualsToken"; + SyntaxKind[SyntaxKind["ExclamationEqualsEqualsToken"] = 35] = "ExclamationEqualsEqualsToken"; + SyntaxKind[SyntaxKind["EqualsGreaterThanToken"] = 36] = "EqualsGreaterThanToken"; + SyntaxKind[SyntaxKind["PlusToken"] = 37] = "PlusToken"; + SyntaxKind[SyntaxKind["MinusToken"] = 38] = "MinusToken"; + SyntaxKind[SyntaxKind["AsteriskToken"] = 39] = "AsteriskToken"; + SyntaxKind[SyntaxKind["AsteriskAsteriskToken"] = 40] = "AsteriskAsteriskToken"; + SyntaxKind[SyntaxKind["SlashToken"] = 41] = "SlashToken"; + SyntaxKind[SyntaxKind["PercentToken"] = 42] = "PercentToken"; + SyntaxKind[SyntaxKind["PlusPlusToken"] = 43] = "PlusPlusToken"; + SyntaxKind[SyntaxKind["MinusMinusToken"] = 44] = "MinusMinusToken"; + SyntaxKind[SyntaxKind["LessThanLessThanToken"] = 45] = "LessThanLessThanToken"; + SyntaxKind[SyntaxKind["GreaterThanGreaterThanToken"] = 46] = "GreaterThanGreaterThanToken"; + SyntaxKind[SyntaxKind["GreaterThanGreaterThanGreaterThanToken"] = 47] = "GreaterThanGreaterThanGreaterThanToken"; + SyntaxKind[SyntaxKind["AmpersandToken"] = 48] = "AmpersandToken"; + SyntaxKind[SyntaxKind["BarToken"] = 49] = "BarToken"; + SyntaxKind[SyntaxKind["CaretToken"] = 50] = "CaretToken"; + SyntaxKind[SyntaxKind["ExclamationToken"] = 51] = "ExclamationToken"; + SyntaxKind[SyntaxKind["TildeToken"] = 52] = "TildeToken"; + SyntaxKind[SyntaxKind["AmpersandAmpersandToken"] = 53] = "AmpersandAmpersandToken"; + SyntaxKind[SyntaxKind["BarBarToken"] = 54] = "BarBarToken"; + SyntaxKind[SyntaxKind["QuestionToken"] = 55] = "QuestionToken"; + SyntaxKind[SyntaxKind["ColonToken"] = 56] = "ColonToken"; + SyntaxKind[SyntaxKind["AtToken"] = 57] = "AtToken"; + SyntaxKind[SyntaxKind["EqualsToken"] = 58] = "EqualsToken"; + SyntaxKind[SyntaxKind["PlusEqualsToken"] = 59] = "PlusEqualsToken"; + SyntaxKind[SyntaxKind["MinusEqualsToken"] = 60] = "MinusEqualsToken"; + SyntaxKind[SyntaxKind["AsteriskEqualsToken"] = 61] = "AsteriskEqualsToken"; + SyntaxKind[SyntaxKind["AsteriskAsteriskEqualsToken"] = 62] = "AsteriskAsteriskEqualsToken"; + SyntaxKind[SyntaxKind["SlashEqualsToken"] = 63] = "SlashEqualsToken"; + SyntaxKind[SyntaxKind["PercentEqualsToken"] = 64] = "PercentEqualsToken"; + SyntaxKind[SyntaxKind["LessThanLessThanEqualsToken"] = 65] = "LessThanLessThanEqualsToken"; + SyntaxKind[SyntaxKind["GreaterThanGreaterThanEqualsToken"] = 66] = "GreaterThanGreaterThanEqualsToken"; + SyntaxKind[SyntaxKind["GreaterThanGreaterThanGreaterThanEqualsToken"] = 67] = "GreaterThanGreaterThanGreaterThanEqualsToken"; + SyntaxKind[SyntaxKind["AmpersandEqualsToken"] = 68] = "AmpersandEqualsToken"; + SyntaxKind[SyntaxKind["BarEqualsToken"] = 69] = "BarEqualsToken"; + SyntaxKind[SyntaxKind["CaretEqualsToken"] = 70] = "CaretEqualsToken"; + SyntaxKind[SyntaxKind["Identifier"] = 71] = "Identifier"; + SyntaxKind[SyntaxKind["BreakKeyword"] = 72] = "BreakKeyword"; + SyntaxKind[SyntaxKind["CaseKeyword"] = 73] = "CaseKeyword"; + SyntaxKind[SyntaxKind["CatchKeyword"] = 74] = "CatchKeyword"; + SyntaxKind[SyntaxKind["ClassKeyword"] = 75] = "ClassKeyword"; + SyntaxKind[SyntaxKind["ConstKeyword"] = 76] = "ConstKeyword"; + SyntaxKind[SyntaxKind["ContinueKeyword"] = 77] = "ContinueKeyword"; + SyntaxKind[SyntaxKind["DebuggerKeyword"] = 78] = "DebuggerKeyword"; + SyntaxKind[SyntaxKind["DefaultKeyword"] = 79] = "DefaultKeyword"; + SyntaxKind[SyntaxKind["DeleteKeyword"] = 80] = "DeleteKeyword"; + SyntaxKind[SyntaxKind["DoKeyword"] = 81] = "DoKeyword"; + SyntaxKind[SyntaxKind["ElseKeyword"] = 82] = "ElseKeyword"; + SyntaxKind[SyntaxKind["EnumKeyword"] = 83] = "EnumKeyword"; + SyntaxKind[SyntaxKind["ExportKeyword"] = 84] = "ExportKeyword"; + SyntaxKind[SyntaxKind["ExtendsKeyword"] = 85] = "ExtendsKeyword"; + SyntaxKind[SyntaxKind["FalseKeyword"] = 86] = "FalseKeyword"; + SyntaxKind[SyntaxKind["FinallyKeyword"] = 87] = "FinallyKeyword"; + SyntaxKind[SyntaxKind["ForKeyword"] = 88] = "ForKeyword"; + SyntaxKind[SyntaxKind["FunctionKeyword"] = 89] = "FunctionKeyword"; + SyntaxKind[SyntaxKind["IfKeyword"] = 90] = "IfKeyword"; + SyntaxKind[SyntaxKind["ImportKeyword"] = 91] = "ImportKeyword"; + SyntaxKind[SyntaxKind["InKeyword"] = 92] = "InKeyword"; + SyntaxKind[SyntaxKind["InstanceOfKeyword"] = 93] = "InstanceOfKeyword"; + SyntaxKind[SyntaxKind["NewKeyword"] = 94] = "NewKeyword"; + SyntaxKind[SyntaxKind["NullKeyword"] = 95] = "NullKeyword"; + SyntaxKind[SyntaxKind["ReturnKeyword"] = 96] = "ReturnKeyword"; + SyntaxKind[SyntaxKind["SuperKeyword"] = 97] = "SuperKeyword"; + SyntaxKind[SyntaxKind["SwitchKeyword"] = 98] = "SwitchKeyword"; + SyntaxKind[SyntaxKind["ThisKeyword"] = 99] = "ThisKeyword"; + SyntaxKind[SyntaxKind["ThrowKeyword"] = 100] = "ThrowKeyword"; + SyntaxKind[SyntaxKind["TrueKeyword"] = 101] = "TrueKeyword"; + SyntaxKind[SyntaxKind["TryKeyword"] = 102] = "TryKeyword"; + SyntaxKind[SyntaxKind["TypeOfKeyword"] = 103] = "TypeOfKeyword"; + SyntaxKind[SyntaxKind["VarKeyword"] = 104] = "VarKeyword"; + SyntaxKind[SyntaxKind["VoidKeyword"] = 105] = "VoidKeyword"; + SyntaxKind[SyntaxKind["WhileKeyword"] = 106] = "WhileKeyword"; + SyntaxKind[SyntaxKind["WithKeyword"] = 107] = "WithKeyword"; + SyntaxKind[SyntaxKind["ImplementsKeyword"] = 108] = "ImplementsKeyword"; + SyntaxKind[SyntaxKind["InterfaceKeyword"] = 109] = "InterfaceKeyword"; + SyntaxKind[SyntaxKind["LetKeyword"] = 110] = "LetKeyword"; + SyntaxKind[SyntaxKind["PackageKeyword"] = 111] = "PackageKeyword"; + SyntaxKind[SyntaxKind["PrivateKeyword"] = 112] = "PrivateKeyword"; + SyntaxKind[SyntaxKind["ProtectedKeyword"] = 113] = "ProtectedKeyword"; + SyntaxKind[SyntaxKind["PublicKeyword"] = 114] = "PublicKeyword"; + SyntaxKind[SyntaxKind["StaticKeyword"] = 115] = "StaticKeyword"; + SyntaxKind[SyntaxKind["YieldKeyword"] = 116] = "YieldKeyword"; + SyntaxKind[SyntaxKind["AbstractKeyword"] = 117] = "AbstractKeyword"; + SyntaxKind[SyntaxKind["AsKeyword"] = 118] = "AsKeyword"; + SyntaxKind[SyntaxKind["AnyKeyword"] = 119] = "AnyKeyword"; + SyntaxKind[SyntaxKind["AsyncKeyword"] = 120] = "AsyncKeyword"; + SyntaxKind[SyntaxKind["AwaitKeyword"] = 121] = "AwaitKeyword"; + SyntaxKind[SyntaxKind["BooleanKeyword"] = 122] = "BooleanKeyword"; + SyntaxKind[SyntaxKind["ConstructorKeyword"] = 123] = "ConstructorKeyword"; + SyntaxKind[SyntaxKind["DeclareKeyword"] = 124] = "DeclareKeyword"; + SyntaxKind[SyntaxKind["GetKeyword"] = 125] = "GetKeyword"; + SyntaxKind[SyntaxKind["IsKeyword"] = 126] = "IsKeyword"; + SyntaxKind[SyntaxKind["KeyOfKeyword"] = 127] = "KeyOfKeyword"; + SyntaxKind[SyntaxKind["ModuleKeyword"] = 128] = "ModuleKeyword"; + SyntaxKind[SyntaxKind["NamespaceKeyword"] = 129] = "NamespaceKeyword"; + SyntaxKind[SyntaxKind["NeverKeyword"] = 130] = "NeverKeyword"; + SyntaxKind[SyntaxKind["ReadonlyKeyword"] = 131] = "ReadonlyKeyword"; + SyntaxKind[SyntaxKind["RequireKeyword"] = 132] = "RequireKeyword"; + SyntaxKind[SyntaxKind["NumberKeyword"] = 133] = "NumberKeyword"; + SyntaxKind[SyntaxKind["ObjectKeyword"] = 134] = "ObjectKeyword"; + SyntaxKind[SyntaxKind["SetKeyword"] = 135] = "SetKeyword"; + SyntaxKind[SyntaxKind["StringKeyword"] = 136] = "StringKeyword"; + SyntaxKind[SyntaxKind["SymbolKeyword"] = 137] = "SymbolKeyword"; + SyntaxKind[SyntaxKind["TypeKeyword"] = 138] = "TypeKeyword"; + SyntaxKind[SyntaxKind["UndefinedKeyword"] = 139] = "UndefinedKeyword"; + SyntaxKind[SyntaxKind["FromKeyword"] = 140] = "FromKeyword"; + SyntaxKind[SyntaxKind["GlobalKeyword"] = 141] = "GlobalKeyword"; + SyntaxKind[SyntaxKind["OfKeyword"] = 142] = "OfKeyword"; + SyntaxKind[SyntaxKind["QualifiedName"] = 143] = "QualifiedName"; + SyntaxKind[SyntaxKind["ComputedPropertyName"] = 144] = "ComputedPropertyName"; + SyntaxKind[SyntaxKind["TypeParameter"] = 145] = "TypeParameter"; + SyntaxKind[SyntaxKind["Parameter"] = 146] = "Parameter"; + SyntaxKind[SyntaxKind["Decorator"] = 147] = "Decorator"; + SyntaxKind[SyntaxKind["PropertySignature"] = 148] = "PropertySignature"; + SyntaxKind[SyntaxKind["PropertyDeclaration"] = 149] = "PropertyDeclaration"; + SyntaxKind[SyntaxKind["MethodSignature"] = 150] = "MethodSignature"; + SyntaxKind[SyntaxKind["MethodDeclaration"] = 151] = "MethodDeclaration"; + SyntaxKind[SyntaxKind["Constructor"] = 152] = "Constructor"; + SyntaxKind[SyntaxKind["GetAccessor"] = 153] = "GetAccessor"; + SyntaxKind[SyntaxKind["SetAccessor"] = 154] = "SetAccessor"; + SyntaxKind[SyntaxKind["CallSignature"] = 155] = "CallSignature"; + SyntaxKind[SyntaxKind["ConstructSignature"] = 156] = "ConstructSignature"; + SyntaxKind[SyntaxKind["IndexSignature"] = 157] = "IndexSignature"; + SyntaxKind[SyntaxKind["TypePredicate"] = 158] = "TypePredicate"; + SyntaxKind[SyntaxKind["TypeReference"] = 159] = "TypeReference"; + SyntaxKind[SyntaxKind["FunctionType"] = 160] = "FunctionType"; + SyntaxKind[SyntaxKind["ConstructorType"] = 161] = "ConstructorType"; + SyntaxKind[SyntaxKind["TypeQuery"] = 162] = "TypeQuery"; + SyntaxKind[SyntaxKind["TypeLiteral"] = 163] = "TypeLiteral"; + SyntaxKind[SyntaxKind["ArrayType"] = 164] = "ArrayType"; + SyntaxKind[SyntaxKind["TupleType"] = 165] = "TupleType"; + SyntaxKind[SyntaxKind["UnionType"] = 166] = "UnionType"; + SyntaxKind[SyntaxKind["IntersectionType"] = 167] = "IntersectionType"; + SyntaxKind[SyntaxKind["ParenthesizedType"] = 168] = "ParenthesizedType"; + SyntaxKind[SyntaxKind["ThisType"] = 169] = "ThisType"; + SyntaxKind[SyntaxKind["TypeOperator"] = 170] = "TypeOperator"; + SyntaxKind[SyntaxKind["IndexedAccessType"] = 171] = "IndexedAccessType"; + SyntaxKind[SyntaxKind["MappedType"] = 172] = "MappedType"; + SyntaxKind[SyntaxKind["LiteralType"] = 173] = "LiteralType"; + SyntaxKind[SyntaxKind["ObjectBindingPattern"] = 174] = "ObjectBindingPattern"; + SyntaxKind[SyntaxKind["ArrayBindingPattern"] = 175] = "ArrayBindingPattern"; + SyntaxKind[SyntaxKind["BindingElement"] = 176] = "BindingElement"; + SyntaxKind[SyntaxKind["ArrayLiteralExpression"] = 177] = "ArrayLiteralExpression"; + SyntaxKind[SyntaxKind["ObjectLiteralExpression"] = 178] = "ObjectLiteralExpression"; + SyntaxKind[SyntaxKind["PropertyAccessExpression"] = 179] = "PropertyAccessExpression"; + SyntaxKind[SyntaxKind["ElementAccessExpression"] = 180] = "ElementAccessExpression"; + SyntaxKind[SyntaxKind["CallExpression"] = 181] = "CallExpression"; + SyntaxKind[SyntaxKind["NewExpression"] = 182] = "NewExpression"; + SyntaxKind[SyntaxKind["TaggedTemplateExpression"] = 183] = "TaggedTemplateExpression"; + SyntaxKind[SyntaxKind["TypeAssertionExpression"] = 184] = "TypeAssertionExpression"; + SyntaxKind[SyntaxKind["ParenthesizedExpression"] = 185] = "ParenthesizedExpression"; + SyntaxKind[SyntaxKind["FunctionExpression"] = 186] = "FunctionExpression"; + SyntaxKind[SyntaxKind["ArrowFunction"] = 187] = "ArrowFunction"; + SyntaxKind[SyntaxKind["DeleteExpression"] = 188] = "DeleteExpression"; + SyntaxKind[SyntaxKind["TypeOfExpression"] = 189] = "TypeOfExpression"; + SyntaxKind[SyntaxKind["VoidExpression"] = 190] = "VoidExpression"; + SyntaxKind[SyntaxKind["AwaitExpression"] = 191] = "AwaitExpression"; + SyntaxKind[SyntaxKind["PrefixUnaryExpression"] = 192] = "PrefixUnaryExpression"; + SyntaxKind[SyntaxKind["PostfixUnaryExpression"] = 193] = "PostfixUnaryExpression"; + SyntaxKind[SyntaxKind["BinaryExpression"] = 194] = "BinaryExpression"; + SyntaxKind[SyntaxKind["ConditionalExpression"] = 195] = "ConditionalExpression"; + SyntaxKind[SyntaxKind["TemplateExpression"] = 196] = "TemplateExpression"; + SyntaxKind[SyntaxKind["YieldExpression"] = 197] = "YieldExpression"; + SyntaxKind[SyntaxKind["SpreadElement"] = 198] = "SpreadElement"; + SyntaxKind[SyntaxKind["ClassExpression"] = 199] = "ClassExpression"; + SyntaxKind[SyntaxKind["OmittedExpression"] = 200] = "OmittedExpression"; + SyntaxKind[SyntaxKind["ExpressionWithTypeArguments"] = 201] = "ExpressionWithTypeArguments"; + SyntaxKind[SyntaxKind["AsExpression"] = 202] = "AsExpression"; + SyntaxKind[SyntaxKind["NonNullExpression"] = 203] = "NonNullExpression"; + SyntaxKind[SyntaxKind["MetaProperty"] = 204] = "MetaProperty"; + SyntaxKind[SyntaxKind["TemplateSpan"] = 205] = "TemplateSpan"; + SyntaxKind[SyntaxKind["SemicolonClassElement"] = 206] = "SemicolonClassElement"; + SyntaxKind[SyntaxKind["Block"] = 207] = "Block"; + SyntaxKind[SyntaxKind["VariableStatement"] = 208] = "VariableStatement"; + SyntaxKind[SyntaxKind["EmptyStatement"] = 209] = "EmptyStatement"; + SyntaxKind[SyntaxKind["ExpressionStatement"] = 210] = "ExpressionStatement"; + SyntaxKind[SyntaxKind["IfStatement"] = 211] = "IfStatement"; + SyntaxKind[SyntaxKind["DoStatement"] = 212] = "DoStatement"; + SyntaxKind[SyntaxKind["WhileStatement"] = 213] = "WhileStatement"; + SyntaxKind[SyntaxKind["ForStatement"] = 214] = "ForStatement"; + SyntaxKind[SyntaxKind["ForInStatement"] = 215] = "ForInStatement"; + SyntaxKind[SyntaxKind["ForOfStatement"] = 216] = "ForOfStatement"; + SyntaxKind[SyntaxKind["ContinueStatement"] = 217] = "ContinueStatement"; + SyntaxKind[SyntaxKind["BreakStatement"] = 218] = "BreakStatement"; + SyntaxKind[SyntaxKind["ReturnStatement"] = 219] = "ReturnStatement"; + SyntaxKind[SyntaxKind["WithStatement"] = 220] = "WithStatement"; + SyntaxKind[SyntaxKind["SwitchStatement"] = 221] = "SwitchStatement"; + SyntaxKind[SyntaxKind["LabeledStatement"] = 222] = "LabeledStatement"; + SyntaxKind[SyntaxKind["ThrowStatement"] = 223] = "ThrowStatement"; + SyntaxKind[SyntaxKind["TryStatement"] = 224] = "TryStatement"; + SyntaxKind[SyntaxKind["DebuggerStatement"] = 225] = "DebuggerStatement"; + SyntaxKind[SyntaxKind["VariableDeclaration"] = 226] = "VariableDeclaration"; + SyntaxKind[SyntaxKind["VariableDeclarationList"] = 227] = "VariableDeclarationList"; + SyntaxKind[SyntaxKind["FunctionDeclaration"] = 228] = "FunctionDeclaration"; + SyntaxKind[SyntaxKind["ClassDeclaration"] = 229] = "ClassDeclaration"; + SyntaxKind[SyntaxKind["InterfaceDeclaration"] = 230] = "InterfaceDeclaration"; + SyntaxKind[SyntaxKind["TypeAliasDeclaration"] = 231] = "TypeAliasDeclaration"; + SyntaxKind[SyntaxKind["EnumDeclaration"] = 232] = "EnumDeclaration"; + SyntaxKind[SyntaxKind["ModuleDeclaration"] = 233] = "ModuleDeclaration"; + SyntaxKind[SyntaxKind["ModuleBlock"] = 234] = "ModuleBlock"; + SyntaxKind[SyntaxKind["CaseBlock"] = 235] = "CaseBlock"; + SyntaxKind[SyntaxKind["NamespaceExportDeclaration"] = 236] = "NamespaceExportDeclaration"; + SyntaxKind[SyntaxKind["ImportEqualsDeclaration"] = 237] = "ImportEqualsDeclaration"; + SyntaxKind[SyntaxKind["ImportDeclaration"] = 238] = "ImportDeclaration"; + SyntaxKind[SyntaxKind["ImportClause"] = 239] = "ImportClause"; + SyntaxKind[SyntaxKind["NamespaceImport"] = 240] = "NamespaceImport"; + SyntaxKind[SyntaxKind["NamedImports"] = 241] = "NamedImports"; + SyntaxKind[SyntaxKind["ImportSpecifier"] = 242] = "ImportSpecifier"; + SyntaxKind[SyntaxKind["ExportAssignment"] = 243] = "ExportAssignment"; + SyntaxKind[SyntaxKind["ExportDeclaration"] = 244] = "ExportDeclaration"; + SyntaxKind[SyntaxKind["NamedExports"] = 245] = "NamedExports"; + SyntaxKind[SyntaxKind["ExportSpecifier"] = 246] = "ExportSpecifier"; + SyntaxKind[SyntaxKind["MissingDeclaration"] = 247] = "MissingDeclaration"; + SyntaxKind[SyntaxKind["ExternalModuleReference"] = 248] = "ExternalModuleReference"; + SyntaxKind[SyntaxKind["JsxElement"] = 249] = "JsxElement"; + SyntaxKind[SyntaxKind["JsxSelfClosingElement"] = 250] = "JsxSelfClosingElement"; + SyntaxKind[SyntaxKind["JsxOpeningElement"] = 251] = "JsxOpeningElement"; + SyntaxKind[SyntaxKind["JsxClosingElement"] = 252] = "JsxClosingElement"; + SyntaxKind[SyntaxKind["JsxAttribute"] = 253] = "JsxAttribute"; + SyntaxKind[SyntaxKind["JsxAttributes"] = 254] = "JsxAttributes"; + SyntaxKind[SyntaxKind["JsxSpreadAttribute"] = 255] = "JsxSpreadAttribute"; + SyntaxKind[SyntaxKind["JsxExpression"] = 256] = "JsxExpression"; + SyntaxKind[SyntaxKind["CaseClause"] = 257] = "CaseClause"; + SyntaxKind[SyntaxKind["DefaultClause"] = 258] = "DefaultClause"; + SyntaxKind[SyntaxKind["HeritageClause"] = 259] = "HeritageClause"; + SyntaxKind[SyntaxKind["CatchClause"] = 260] = "CatchClause"; + SyntaxKind[SyntaxKind["PropertyAssignment"] = 261] = "PropertyAssignment"; + SyntaxKind[SyntaxKind["ShorthandPropertyAssignment"] = 262] = "ShorthandPropertyAssignment"; + SyntaxKind[SyntaxKind["SpreadAssignment"] = 263] = "SpreadAssignment"; + SyntaxKind[SyntaxKind["EnumMember"] = 264] = "EnumMember"; + SyntaxKind[SyntaxKind["SourceFile"] = 265] = "SourceFile"; + SyntaxKind[SyntaxKind["Bundle"] = 266] = "Bundle"; + SyntaxKind[SyntaxKind["JSDocTypeExpression"] = 267] = "JSDocTypeExpression"; + SyntaxKind[SyntaxKind["JSDocAllType"] = 268] = "JSDocAllType"; + SyntaxKind[SyntaxKind["JSDocUnknownType"] = 269] = "JSDocUnknownType"; + SyntaxKind[SyntaxKind["JSDocNullableType"] = 270] = "JSDocNullableType"; + SyntaxKind[SyntaxKind["JSDocNonNullableType"] = 271] = "JSDocNonNullableType"; + SyntaxKind[SyntaxKind["JSDocOptionalType"] = 272] = "JSDocOptionalType"; + SyntaxKind[SyntaxKind["JSDocFunctionType"] = 273] = "JSDocFunctionType"; + SyntaxKind[SyntaxKind["JSDocVariadicType"] = 274] = "JSDocVariadicType"; + SyntaxKind[SyntaxKind["JSDocComment"] = 275] = "JSDocComment"; + SyntaxKind[SyntaxKind["JSDocTag"] = 276] = "JSDocTag"; + SyntaxKind[SyntaxKind["JSDocAugmentsTag"] = 277] = "JSDocAugmentsTag"; + SyntaxKind[SyntaxKind["JSDocClassTag"] = 278] = "JSDocClassTag"; + SyntaxKind[SyntaxKind["JSDocParameterTag"] = 279] = "JSDocParameterTag"; + SyntaxKind[SyntaxKind["JSDocReturnTag"] = 280] = "JSDocReturnTag"; + SyntaxKind[SyntaxKind["JSDocTypeTag"] = 281] = "JSDocTypeTag"; + SyntaxKind[SyntaxKind["JSDocTemplateTag"] = 282] = "JSDocTemplateTag"; + SyntaxKind[SyntaxKind["JSDocTypedefTag"] = 283] = "JSDocTypedefTag"; + SyntaxKind[SyntaxKind["JSDocPropertyTag"] = 284] = "JSDocPropertyTag"; + SyntaxKind[SyntaxKind["JSDocTypeLiteral"] = 285] = "JSDocTypeLiteral"; + SyntaxKind[SyntaxKind["SyntaxList"] = 286] = "SyntaxList"; + SyntaxKind[SyntaxKind["NotEmittedStatement"] = 287] = "NotEmittedStatement"; + SyntaxKind[SyntaxKind["PartiallyEmittedExpression"] = 288] = "PartiallyEmittedExpression"; + SyntaxKind[SyntaxKind["CommaListExpression"] = 289] = "CommaListExpression"; + SyntaxKind[SyntaxKind["MergeDeclarationMarker"] = 290] = "MergeDeclarationMarker"; + SyntaxKind[SyntaxKind["EndOfDeclarationMarker"] = 291] = "EndOfDeclarationMarker"; + SyntaxKind[SyntaxKind["Count"] = 292] = "Count"; + SyntaxKind[SyntaxKind["FirstAssignment"] = 58] = "FirstAssignment"; + SyntaxKind[SyntaxKind["LastAssignment"] = 70] = "LastAssignment"; + SyntaxKind[SyntaxKind["FirstCompoundAssignment"] = 59] = "FirstCompoundAssignment"; + SyntaxKind[SyntaxKind["LastCompoundAssignment"] = 70] = "LastCompoundAssignment"; + SyntaxKind[SyntaxKind["FirstReservedWord"] = 72] = "FirstReservedWord"; + SyntaxKind[SyntaxKind["LastReservedWord"] = 107] = "LastReservedWord"; + SyntaxKind[SyntaxKind["FirstKeyword"] = 72] = "FirstKeyword"; + SyntaxKind[SyntaxKind["LastKeyword"] = 142] = "LastKeyword"; + SyntaxKind[SyntaxKind["FirstFutureReservedWord"] = 108] = "FirstFutureReservedWord"; + SyntaxKind[SyntaxKind["LastFutureReservedWord"] = 116] = "LastFutureReservedWord"; + SyntaxKind[SyntaxKind["FirstTypeNode"] = 158] = "FirstTypeNode"; + SyntaxKind[SyntaxKind["LastTypeNode"] = 173] = "LastTypeNode"; + SyntaxKind[SyntaxKind["FirstPunctuation"] = 17] = "FirstPunctuation"; + SyntaxKind[SyntaxKind["LastPunctuation"] = 70] = "LastPunctuation"; + SyntaxKind[SyntaxKind["FirstToken"] = 0] = "FirstToken"; + SyntaxKind[SyntaxKind["LastToken"] = 142] = "LastToken"; + SyntaxKind[SyntaxKind["FirstTriviaToken"] = 2] = "FirstTriviaToken"; + SyntaxKind[SyntaxKind["LastTriviaToken"] = 7] = "LastTriviaToken"; + SyntaxKind[SyntaxKind["FirstLiteralToken"] = 8] = "FirstLiteralToken"; + SyntaxKind[SyntaxKind["LastLiteralToken"] = 13] = "LastLiteralToken"; + SyntaxKind[SyntaxKind["FirstTemplateToken"] = 13] = "FirstTemplateToken"; + SyntaxKind[SyntaxKind["LastTemplateToken"] = 16] = "LastTemplateToken"; + SyntaxKind[SyntaxKind["FirstBinaryOperator"] = 27] = "FirstBinaryOperator"; + SyntaxKind[SyntaxKind["LastBinaryOperator"] = 70] = "LastBinaryOperator"; + SyntaxKind[SyntaxKind["FirstNode"] = 143] = "FirstNode"; + SyntaxKind[SyntaxKind["FirstJSDocNode"] = 267] = "FirstJSDocNode"; + SyntaxKind[SyntaxKind["LastJSDocNode"] = 285] = "LastJSDocNode"; + SyntaxKind[SyntaxKind["FirstJSDocTagNode"] = 276] = "FirstJSDocTagNode"; + SyntaxKind[SyntaxKind["LastJSDocTagNode"] = 285] = "LastJSDocTagNode"; + })(SyntaxKind = ts.SyntaxKind || (ts.SyntaxKind = {})); + var NodeFlags; + (function (NodeFlags) { + NodeFlags[NodeFlags["None"] = 0] = "None"; + NodeFlags[NodeFlags["Let"] = 1] = "Let"; + NodeFlags[NodeFlags["Const"] = 2] = "Const"; + NodeFlags[NodeFlags["NestedNamespace"] = 4] = "NestedNamespace"; + NodeFlags[NodeFlags["Synthesized"] = 8] = "Synthesized"; + NodeFlags[NodeFlags["Namespace"] = 16] = "Namespace"; + NodeFlags[NodeFlags["ExportContext"] = 32] = "ExportContext"; + NodeFlags[NodeFlags["ContainsThis"] = 64] = "ContainsThis"; + NodeFlags[NodeFlags["HasImplicitReturn"] = 128] = "HasImplicitReturn"; + NodeFlags[NodeFlags["HasExplicitReturn"] = 256] = "HasExplicitReturn"; + NodeFlags[NodeFlags["GlobalAugmentation"] = 512] = "GlobalAugmentation"; + NodeFlags[NodeFlags["HasAsyncFunctions"] = 1024] = "HasAsyncFunctions"; + NodeFlags[NodeFlags["DisallowInContext"] = 2048] = "DisallowInContext"; + NodeFlags[NodeFlags["YieldContext"] = 4096] = "YieldContext"; + NodeFlags[NodeFlags["DecoratorContext"] = 8192] = "DecoratorContext"; + NodeFlags[NodeFlags["AwaitContext"] = 16384] = "AwaitContext"; + NodeFlags[NodeFlags["ThisNodeHasError"] = 32768] = "ThisNodeHasError"; + NodeFlags[NodeFlags["JavaScriptFile"] = 65536] = "JavaScriptFile"; + NodeFlags[NodeFlags["ThisNodeOrAnySubNodesHasError"] = 131072] = "ThisNodeOrAnySubNodesHasError"; + NodeFlags[NodeFlags["HasAggregatedChildData"] = 262144] = "HasAggregatedChildData"; + NodeFlags[NodeFlags["PossiblyContainsDynamicImport"] = 524288] = "PossiblyContainsDynamicImport"; + NodeFlags[NodeFlags["JSDoc"] = 1048576] = "JSDoc"; + NodeFlags[NodeFlags["BlockScoped"] = 3] = "BlockScoped"; + NodeFlags[NodeFlags["ReachabilityCheckFlags"] = 384] = "ReachabilityCheckFlags"; + NodeFlags[NodeFlags["ReachabilityAndEmitFlags"] = 1408] = "ReachabilityAndEmitFlags"; + NodeFlags[NodeFlags["ContextFlags"] = 96256] = "ContextFlags"; + NodeFlags[NodeFlags["TypeExcludesFlags"] = 20480] = "TypeExcludesFlags"; + })(NodeFlags = ts.NodeFlags || (ts.NodeFlags = {})); + var ModifierFlags; + (function (ModifierFlags) { + ModifierFlags[ModifierFlags["None"] = 0] = "None"; + ModifierFlags[ModifierFlags["Export"] = 1] = "Export"; + ModifierFlags[ModifierFlags["Ambient"] = 2] = "Ambient"; + ModifierFlags[ModifierFlags["Public"] = 4] = "Public"; + ModifierFlags[ModifierFlags["Private"] = 8] = "Private"; + ModifierFlags[ModifierFlags["Protected"] = 16] = "Protected"; + ModifierFlags[ModifierFlags["Static"] = 32] = "Static"; + ModifierFlags[ModifierFlags["Readonly"] = 64] = "Readonly"; + ModifierFlags[ModifierFlags["Abstract"] = 128] = "Abstract"; + ModifierFlags[ModifierFlags["Async"] = 256] = "Async"; + ModifierFlags[ModifierFlags["Default"] = 512] = "Default"; + ModifierFlags[ModifierFlags["Const"] = 2048] = "Const"; + ModifierFlags[ModifierFlags["HasComputedFlags"] = 536870912] = "HasComputedFlags"; + ModifierFlags[ModifierFlags["AccessibilityModifier"] = 28] = "AccessibilityModifier"; + ModifierFlags[ModifierFlags["ParameterPropertyModifier"] = 92] = "ParameterPropertyModifier"; + ModifierFlags[ModifierFlags["NonPublicAccessibilityModifier"] = 24] = "NonPublicAccessibilityModifier"; + ModifierFlags[ModifierFlags["TypeScriptModifier"] = 2270] = "TypeScriptModifier"; + ModifierFlags[ModifierFlags["ExportDefault"] = 513] = "ExportDefault"; + })(ModifierFlags = ts.ModifierFlags || (ts.ModifierFlags = {})); + var JsxFlags; + (function (JsxFlags) { + JsxFlags[JsxFlags["None"] = 0] = "None"; + JsxFlags[JsxFlags["IntrinsicNamedElement"] = 1] = "IntrinsicNamedElement"; + JsxFlags[JsxFlags["IntrinsicIndexedElement"] = 2] = "IntrinsicIndexedElement"; + JsxFlags[JsxFlags["IntrinsicElement"] = 3] = "IntrinsicElement"; + })(JsxFlags = ts.JsxFlags || (ts.JsxFlags = {})); + var RelationComparisonResult; + (function (RelationComparisonResult) { + RelationComparisonResult[RelationComparisonResult["Succeeded"] = 1] = "Succeeded"; + RelationComparisonResult[RelationComparisonResult["Failed"] = 2] = "Failed"; + RelationComparisonResult[RelationComparisonResult["FailedAndReported"] = 3] = "FailedAndReported"; + })(RelationComparisonResult = ts.RelationComparisonResult || (ts.RelationComparisonResult = {})); + var GeneratedIdentifierKind; + (function (GeneratedIdentifierKind) { + GeneratedIdentifierKind[GeneratedIdentifierKind["None"] = 0] = "None"; + GeneratedIdentifierKind[GeneratedIdentifierKind["Auto"] = 1] = "Auto"; + GeneratedIdentifierKind[GeneratedIdentifierKind["Loop"] = 2] = "Loop"; + GeneratedIdentifierKind[GeneratedIdentifierKind["Unique"] = 3] = "Unique"; + GeneratedIdentifierKind[GeneratedIdentifierKind["Node"] = 4] = "Node"; + })(GeneratedIdentifierKind = ts.GeneratedIdentifierKind || (ts.GeneratedIdentifierKind = {})); + var NumericLiteralFlags; + (function (NumericLiteralFlags) { + NumericLiteralFlags[NumericLiteralFlags["None"] = 0] = "None"; + NumericLiteralFlags[NumericLiteralFlags["Scientific"] = 2] = "Scientific"; + NumericLiteralFlags[NumericLiteralFlags["Octal"] = 4] = "Octal"; + NumericLiteralFlags[NumericLiteralFlags["HexSpecifier"] = 8] = "HexSpecifier"; + NumericLiteralFlags[NumericLiteralFlags["BinarySpecifier"] = 16] = "BinarySpecifier"; + NumericLiteralFlags[NumericLiteralFlags["OctalSpecifier"] = 32] = "OctalSpecifier"; + NumericLiteralFlags[NumericLiteralFlags["BinaryOrOctalSpecifier"] = 48] = "BinaryOrOctalSpecifier"; + })(NumericLiteralFlags = ts.NumericLiteralFlags || (ts.NumericLiteralFlags = {})); + var FlowFlags; + (function (FlowFlags) { + FlowFlags[FlowFlags["Unreachable"] = 1] = "Unreachable"; + FlowFlags[FlowFlags["Start"] = 2] = "Start"; + FlowFlags[FlowFlags["BranchLabel"] = 4] = "BranchLabel"; + FlowFlags[FlowFlags["LoopLabel"] = 8] = "LoopLabel"; + FlowFlags[FlowFlags["Assignment"] = 16] = "Assignment"; + FlowFlags[FlowFlags["TrueCondition"] = 32] = "TrueCondition"; + FlowFlags[FlowFlags["FalseCondition"] = 64] = "FalseCondition"; + FlowFlags[FlowFlags["SwitchClause"] = 128] = "SwitchClause"; + FlowFlags[FlowFlags["ArrayMutation"] = 256] = "ArrayMutation"; + FlowFlags[FlowFlags["Referenced"] = 512] = "Referenced"; + FlowFlags[FlowFlags["Shared"] = 1024] = "Shared"; + FlowFlags[FlowFlags["PreFinally"] = 2048] = "PreFinally"; + FlowFlags[FlowFlags["AfterFinally"] = 4096] = "AfterFinally"; + FlowFlags[FlowFlags["Label"] = 12] = "Label"; + FlowFlags[FlowFlags["Condition"] = 96] = "Condition"; + })(FlowFlags = ts.FlowFlags || (ts.FlowFlags = {})); var OperationCanceledException = (function () { function OperationCanceledException() { } return OperationCanceledException; }()); ts.OperationCanceledException = OperationCanceledException; + var StructureIsReused; + (function (StructureIsReused) { + StructureIsReused[StructureIsReused["Not"] = 0] = "Not"; + StructureIsReused[StructureIsReused["SafeModules"] = 1] = "SafeModules"; + StructureIsReused[StructureIsReused["Completely"] = 2] = "Completely"; + })(StructureIsReused = ts.StructureIsReused || (ts.StructureIsReused = {})); var ExitStatus; (function (ExitStatus) { ExitStatus[ExitStatus["Success"] = 0] = "Success"; @@ -46,6 +485,47 @@ var ts; NodeBuilderFlags[NodeBuilderFlags["InObjectTypeLiteral"] = 1048576] = "InObjectTypeLiteral"; NodeBuilderFlags[NodeBuilderFlags["InTypeAlias"] = 8388608] = "InTypeAlias"; })(NodeBuilderFlags = ts.NodeBuilderFlags || (ts.NodeBuilderFlags = {})); + var TypeFormatFlags; + (function (TypeFormatFlags) { + TypeFormatFlags[TypeFormatFlags["None"] = 0] = "None"; + TypeFormatFlags[TypeFormatFlags["WriteArrayAsGenericType"] = 1] = "WriteArrayAsGenericType"; + TypeFormatFlags[TypeFormatFlags["UseTypeOfFunction"] = 4] = "UseTypeOfFunction"; + TypeFormatFlags[TypeFormatFlags["NoTruncation"] = 8] = "NoTruncation"; + TypeFormatFlags[TypeFormatFlags["WriteArrowStyleSignature"] = 16] = "WriteArrowStyleSignature"; + TypeFormatFlags[TypeFormatFlags["WriteOwnNameForAnyLike"] = 32] = "WriteOwnNameForAnyLike"; + TypeFormatFlags[TypeFormatFlags["WriteTypeArgumentsOfSignature"] = 64] = "WriteTypeArgumentsOfSignature"; + TypeFormatFlags[TypeFormatFlags["InElementType"] = 128] = "InElementType"; + TypeFormatFlags[TypeFormatFlags["UseFullyQualifiedType"] = 256] = "UseFullyQualifiedType"; + TypeFormatFlags[TypeFormatFlags["InFirstTypeArgument"] = 512] = "InFirstTypeArgument"; + TypeFormatFlags[TypeFormatFlags["InTypeAlias"] = 1024] = "InTypeAlias"; + TypeFormatFlags[TypeFormatFlags["SuppressAnyReturnType"] = 4096] = "SuppressAnyReturnType"; + TypeFormatFlags[TypeFormatFlags["AddUndefined"] = 8192] = "AddUndefined"; + TypeFormatFlags[TypeFormatFlags["WriteClassExpressionAsTypeLiteral"] = 16384] = "WriteClassExpressionAsTypeLiteral"; + TypeFormatFlags[TypeFormatFlags["InArrayType"] = 32768] = "InArrayType"; + TypeFormatFlags[TypeFormatFlags["UseAliasDefinedOutsideCurrentScope"] = 65536] = "UseAliasDefinedOutsideCurrentScope"; + })(TypeFormatFlags = ts.TypeFormatFlags || (ts.TypeFormatFlags = {})); + var SymbolFormatFlags; + (function (SymbolFormatFlags) { + SymbolFormatFlags[SymbolFormatFlags["None"] = 0] = "None"; + SymbolFormatFlags[SymbolFormatFlags["WriteTypeParametersOrArguments"] = 1] = "WriteTypeParametersOrArguments"; + SymbolFormatFlags[SymbolFormatFlags["UseOnlyExternalAliasing"] = 2] = "UseOnlyExternalAliasing"; + })(SymbolFormatFlags = ts.SymbolFormatFlags || (ts.SymbolFormatFlags = {})); + var SymbolAccessibility; + (function (SymbolAccessibility) { + SymbolAccessibility[SymbolAccessibility["Accessible"] = 0] = "Accessible"; + SymbolAccessibility[SymbolAccessibility["NotAccessible"] = 1] = "NotAccessible"; + SymbolAccessibility[SymbolAccessibility["CannotBeNamed"] = 2] = "CannotBeNamed"; + })(SymbolAccessibility = ts.SymbolAccessibility || (ts.SymbolAccessibility = {})); + var SyntheticSymbolKind; + (function (SyntheticSymbolKind) { + SyntheticSymbolKind[SyntheticSymbolKind["UnionOrIntersection"] = 0] = "UnionOrIntersection"; + SyntheticSymbolKind[SyntheticSymbolKind["Spread"] = 1] = "Spread"; + })(SyntheticSymbolKind = ts.SyntheticSymbolKind || (ts.SyntheticSymbolKind = {})); + var TypePredicateKind; + (function (TypePredicateKind) { + TypePredicateKind[TypePredicateKind["This"] = 0] = "This"; + TypePredicateKind[TypePredicateKind["Identifier"] = 1] = "Identifier"; + })(TypePredicateKind = ts.TypePredicateKind || (ts.TypePredicateKind = {})); var TypeReferenceSerializationKind; (function (TypeReferenceSerializationKind) { TypeReferenceSerializationKind[TypeReferenceSerializationKind["Unknown"] = 0] = "Unknown"; @@ -60,6 +540,230 @@ var ts; TypeReferenceSerializationKind[TypeReferenceSerializationKind["TypeWithCallSignature"] = 9] = "TypeWithCallSignature"; TypeReferenceSerializationKind[TypeReferenceSerializationKind["ObjectType"] = 10] = "ObjectType"; })(TypeReferenceSerializationKind = ts.TypeReferenceSerializationKind || (ts.TypeReferenceSerializationKind = {})); + var SymbolFlags; + (function (SymbolFlags) { + SymbolFlags[SymbolFlags["None"] = 0] = "None"; + SymbolFlags[SymbolFlags["FunctionScopedVariable"] = 1] = "FunctionScopedVariable"; + SymbolFlags[SymbolFlags["BlockScopedVariable"] = 2] = "BlockScopedVariable"; + SymbolFlags[SymbolFlags["Property"] = 4] = "Property"; + SymbolFlags[SymbolFlags["EnumMember"] = 8] = "EnumMember"; + SymbolFlags[SymbolFlags["Function"] = 16] = "Function"; + SymbolFlags[SymbolFlags["Class"] = 32] = "Class"; + SymbolFlags[SymbolFlags["Interface"] = 64] = "Interface"; + SymbolFlags[SymbolFlags["ConstEnum"] = 128] = "ConstEnum"; + SymbolFlags[SymbolFlags["RegularEnum"] = 256] = "RegularEnum"; + SymbolFlags[SymbolFlags["ValueModule"] = 512] = "ValueModule"; + SymbolFlags[SymbolFlags["NamespaceModule"] = 1024] = "NamespaceModule"; + SymbolFlags[SymbolFlags["TypeLiteral"] = 2048] = "TypeLiteral"; + SymbolFlags[SymbolFlags["ObjectLiteral"] = 4096] = "ObjectLiteral"; + SymbolFlags[SymbolFlags["Method"] = 8192] = "Method"; + SymbolFlags[SymbolFlags["Constructor"] = 16384] = "Constructor"; + SymbolFlags[SymbolFlags["GetAccessor"] = 32768] = "GetAccessor"; + SymbolFlags[SymbolFlags["SetAccessor"] = 65536] = "SetAccessor"; + SymbolFlags[SymbolFlags["Signature"] = 131072] = "Signature"; + SymbolFlags[SymbolFlags["TypeParameter"] = 262144] = "TypeParameter"; + SymbolFlags[SymbolFlags["TypeAlias"] = 524288] = "TypeAlias"; + SymbolFlags[SymbolFlags["ExportValue"] = 1048576] = "ExportValue"; + SymbolFlags[SymbolFlags["Alias"] = 2097152] = "Alias"; + SymbolFlags[SymbolFlags["Prototype"] = 4194304] = "Prototype"; + SymbolFlags[SymbolFlags["ExportStar"] = 8388608] = "ExportStar"; + SymbolFlags[SymbolFlags["Optional"] = 16777216] = "Optional"; + SymbolFlags[SymbolFlags["Transient"] = 33554432] = "Transient"; + SymbolFlags[SymbolFlags["Enum"] = 384] = "Enum"; + SymbolFlags[SymbolFlags["Variable"] = 3] = "Variable"; + SymbolFlags[SymbolFlags["Value"] = 107455] = "Value"; + SymbolFlags[SymbolFlags["Type"] = 793064] = "Type"; + SymbolFlags[SymbolFlags["Namespace"] = 1920] = "Namespace"; + SymbolFlags[SymbolFlags["Module"] = 1536] = "Module"; + SymbolFlags[SymbolFlags["Accessor"] = 98304] = "Accessor"; + SymbolFlags[SymbolFlags["FunctionScopedVariableExcludes"] = 107454] = "FunctionScopedVariableExcludes"; + SymbolFlags[SymbolFlags["BlockScopedVariableExcludes"] = 107455] = "BlockScopedVariableExcludes"; + SymbolFlags[SymbolFlags["ParameterExcludes"] = 107455] = "ParameterExcludes"; + SymbolFlags[SymbolFlags["PropertyExcludes"] = 0] = "PropertyExcludes"; + SymbolFlags[SymbolFlags["EnumMemberExcludes"] = 900095] = "EnumMemberExcludes"; + SymbolFlags[SymbolFlags["FunctionExcludes"] = 106927] = "FunctionExcludes"; + SymbolFlags[SymbolFlags["ClassExcludes"] = 899519] = "ClassExcludes"; + SymbolFlags[SymbolFlags["InterfaceExcludes"] = 792968] = "InterfaceExcludes"; + SymbolFlags[SymbolFlags["RegularEnumExcludes"] = 899327] = "RegularEnumExcludes"; + SymbolFlags[SymbolFlags["ConstEnumExcludes"] = 899967] = "ConstEnumExcludes"; + SymbolFlags[SymbolFlags["ValueModuleExcludes"] = 106639] = "ValueModuleExcludes"; + SymbolFlags[SymbolFlags["NamespaceModuleExcludes"] = 0] = "NamespaceModuleExcludes"; + SymbolFlags[SymbolFlags["MethodExcludes"] = 99263] = "MethodExcludes"; + SymbolFlags[SymbolFlags["GetAccessorExcludes"] = 41919] = "GetAccessorExcludes"; + SymbolFlags[SymbolFlags["SetAccessorExcludes"] = 74687] = "SetAccessorExcludes"; + SymbolFlags[SymbolFlags["TypeParameterExcludes"] = 530920] = "TypeParameterExcludes"; + SymbolFlags[SymbolFlags["TypeAliasExcludes"] = 793064] = "TypeAliasExcludes"; + SymbolFlags[SymbolFlags["AliasExcludes"] = 2097152] = "AliasExcludes"; + SymbolFlags[SymbolFlags["ModuleMember"] = 2623475] = "ModuleMember"; + SymbolFlags[SymbolFlags["ExportHasLocal"] = 944] = "ExportHasLocal"; + SymbolFlags[SymbolFlags["HasExports"] = 1952] = "HasExports"; + SymbolFlags[SymbolFlags["HasMembers"] = 6240] = "HasMembers"; + SymbolFlags[SymbolFlags["BlockScoped"] = 418] = "BlockScoped"; + SymbolFlags[SymbolFlags["PropertyOrAccessor"] = 98308] = "PropertyOrAccessor"; + SymbolFlags[SymbolFlags["ClassMember"] = 106500] = "ClassMember"; + SymbolFlags[SymbolFlags["Classifiable"] = 788448] = "Classifiable"; + })(SymbolFlags = ts.SymbolFlags || (ts.SymbolFlags = {})); + var EnumKind; + (function (EnumKind) { + EnumKind[EnumKind["Numeric"] = 0] = "Numeric"; + EnumKind[EnumKind["Literal"] = 1] = "Literal"; + })(EnumKind = ts.EnumKind || (ts.EnumKind = {})); + var CheckFlags; + (function (CheckFlags) { + CheckFlags[CheckFlags["Instantiated"] = 1] = "Instantiated"; + CheckFlags[CheckFlags["SyntheticProperty"] = 2] = "SyntheticProperty"; + CheckFlags[CheckFlags["SyntheticMethod"] = 4] = "SyntheticMethod"; + CheckFlags[CheckFlags["Readonly"] = 8] = "Readonly"; + CheckFlags[CheckFlags["Partial"] = 16] = "Partial"; + CheckFlags[CheckFlags["HasNonUniformType"] = 32] = "HasNonUniformType"; + CheckFlags[CheckFlags["ContainsPublic"] = 64] = "ContainsPublic"; + CheckFlags[CheckFlags["ContainsProtected"] = 128] = "ContainsProtected"; + CheckFlags[CheckFlags["ContainsPrivate"] = 256] = "ContainsPrivate"; + CheckFlags[CheckFlags["ContainsStatic"] = 512] = "ContainsStatic"; + CheckFlags[CheckFlags["Synthetic"] = 6] = "Synthetic"; + })(CheckFlags = ts.CheckFlags || (ts.CheckFlags = {})); + var InternalSymbolName; + (function (InternalSymbolName) { + InternalSymbolName["Call"] = "__call"; + InternalSymbolName["Constructor"] = "__constructor"; + InternalSymbolName["New"] = "__new"; + InternalSymbolName["Index"] = "__index"; + InternalSymbolName["ExportStar"] = "__export"; + InternalSymbolName["Global"] = "__global"; + InternalSymbolName["Missing"] = "__missing"; + InternalSymbolName["Type"] = "__type"; + InternalSymbolName["Object"] = "__object"; + InternalSymbolName["JSXAttributes"] = "__jsxAttributes"; + InternalSymbolName["Class"] = "__class"; + InternalSymbolName["Function"] = "__function"; + InternalSymbolName["Computed"] = "__computed"; + InternalSymbolName["Resolving"] = "__resolving__"; + InternalSymbolName["ExportEquals"] = "export="; + InternalSymbolName["Default"] = "default"; + })(InternalSymbolName = ts.InternalSymbolName || (ts.InternalSymbolName = {})); + var NodeCheckFlags; + (function (NodeCheckFlags) { + NodeCheckFlags[NodeCheckFlags["TypeChecked"] = 1] = "TypeChecked"; + NodeCheckFlags[NodeCheckFlags["LexicalThis"] = 2] = "LexicalThis"; + NodeCheckFlags[NodeCheckFlags["CaptureThis"] = 4] = "CaptureThis"; + NodeCheckFlags[NodeCheckFlags["CaptureNewTarget"] = 8] = "CaptureNewTarget"; + NodeCheckFlags[NodeCheckFlags["SuperInstance"] = 256] = "SuperInstance"; + NodeCheckFlags[NodeCheckFlags["SuperStatic"] = 512] = "SuperStatic"; + NodeCheckFlags[NodeCheckFlags["ContextChecked"] = 1024] = "ContextChecked"; + NodeCheckFlags[NodeCheckFlags["AsyncMethodWithSuper"] = 2048] = "AsyncMethodWithSuper"; + NodeCheckFlags[NodeCheckFlags["AsyncMethodWithSuperBinding"] = 4096] = "AsyncMethodWithSuperBinding"; + NodeCheckFlags[NodeCheckFlags["CaptureArguments"] = 8192] = "CaptureArguments"; + NodeCheckFlags[NodeCheckFlags["EnumValuesComputed"] = 16384] = "EnumValuesComputed"; + NodeCheckFlags[NodeCheckFlags["LexicalModuleMergesWithClass"] = 32768] = "LexicalModuleMergesWithClass"; + NodeCheckFlags[NodeCheckFlags["LoopWithCapturedBlockScopedBinding"] = 65536] = "LoopWithCapturedBlockScopedBinding"; + NodeCheckFlags[NodeCheckFlags["CapturedBlockScopedBinding"] = 131072] = "CapturedBlockScopedBinding"; + NodeCheckFlags[NodeCheckFlags["BlockScopedBindingInLoop"] = 262144] = "BlockScopedBindingInLoop"; + NodeCheckFlags[NodeCheckFlags["ClassWithBodyScopedClassBinding"] = 524288] = "ClassWithBodyScopedClassBinding"; + NodeCheckFlags[NodeCheckFlags["BodyScopedClassBinding"] = 1048576] = "BodyScopedClassBinding"; + NodeCheckFlags[NodeCheckFlags["NeedsLoopOutParameter"] = 2097152] = "NeedsLoopOutParameter"; + NodeCheckFlags[NodeCheckFlags["AssignmentsMarked"] = 4194304] = "AssignmentsMarked"; + NodeCheckFlags[NodeCheckFlags["ClassWithConstructorReference"] = 8388608] = "ClassWithConstructorReference"; + NodeCheckFlags[NodeCheckFlags["ConstructorReferenceInClass"] = 16777216] = "ConstructorReferenceInClass"; + })(NodeCheckFlags = ts.NodeCheckFlags || (ts.NodeCheckFlags = {})); + var TypeFlags; + (function (TypeFlags) { + TypeFlags[TypeFlags["Any"] = 1] = "Any"; + TypeFlags[TypeFlags["String"] = 2] = "String"; + TypeFlags[TypeFlags["Number"] = 4] = "Number"; + TypeFlags[TypeFlags["Boolean"] = 8] = "Boolean"; + TypeFlags[TypeFlags["Enum"] = 16] = "Enum"; + TypeFlags[TypeFlags["StringLiteral"] = 32] = "StringLiteral"; + TypeFlags[TypeFlags["NumberLiteral"] = 64] = "NumberLiteral"; + TypeFlags[TypeFlags["BooleanLiteral"] = 128] = "BooleanLiteral"; + TypeFlags[TypeFlags["EnumLiteral"] = 256] = "EnumLiteral"; + TypeFlags[TypeFlags["ESSymbol"] = 512] = "ESSymbol"; + TypeFlags[TypeFlags["Void"] = 1024] = "Void"; + TypeFlags[TypeFlags["Undefined"] = 2048] = "Undefined"; + TypeFlags[TypeFlags["Null"] = 4096] = "Null"; + TypeFlags[TypeFlags["Never"] = 8192] = "Never"; + TypeFlags[TypeFlags["TypeParameter"] = 16384] = "TypeParameter"; + TypeFlags[TypeFlags["Object"] = 32768] = "Object"; + TypeFlags[TypeFlags["Union"] = 65536] = "Union"; + TypeFlags[TypeFlags["Intersection"] = 131072] = "Intersection"; + TypeFlags[TypeFlags["Index"] = 262144] = "Index"; + TypeFlags[TypeFlags["IndexedAccess"] = 524288] = "IndexedAccess"; + TypeFlags[TypeFlags["FreshLiteral"] = 1048576] = "FreshLiteral"; + TypeFlags[TypeFlags["ContainsWideningType"] = 2097152] = "ContainsWideningType"; + TypeFlags[TypeFlags["ContainsObjectLiteral"] = 4194304] = "ContainsObjectLiteral"; + TypeFlags[TypeFlags["ContainsAnyFunctionType"] = 8388608] = "ContainsAnyFunctionType"; + TypeFlags[TypeFlags["NonPrimitive"] = 16777216] = "NonPrimitive"; + TypeFlags[TypeFlags["JsxAttributes"] = 33554432] = "JsxAttributes"; + TypeFlags[TypeFlags["Nullable"] = 6144] = "Nullable"; + TypeFlags[TypeFlags["Literal"] = 224] = "Literal"; + TypeFlags[TypeFlags["StringOrNumberLiteral"] = 96] = "StringOrNumberLiteral"; + TypeFlags[TypeFlags["DefinitelyFalsy"] = 7392] = "DefinitelyFalsy"; + TypeFlags[TypeFlags["PossiblyFalsy"] = 7406] = "PossiblyFalsy"; + TypeFlags[TypeFlags["Intrinsic"] = 16793231] = "Intrinsic"; + TypeFlags[TypeFlags["Primitive"] = 8190] = "Primitive"; + TypeFlags[TypeFlags["StringLike"] = 262178] = "StringLike"; + TypeFlags[TypeFlags["NumberLike"] = 84] = "NumberLike"; + TypeFlags[TypeFlags["BooleanLike"] = 136] = "BooleanLike"; + TypeFlags[TypeFlags["EnumLike"] = 272] = "EnumLike"; + TypeFlags[TypeFlags["UnionOrIntersection"] = 196608] = "UnionOrIntersection"; + TypeFlags[TypeFlags["StructuredType"] = 229376] = "StructuredType"; + TypeFlags[TypeFlags["StructuredOrTypeVariable"] = 1032192] = "StructuredOrTypeVariable"; + TypeFlags[TypeFlags["TypeVariable"] = 540672] = "TypeVariable"; + TypeFlags[TypeFlags["Narrowable"] = 17810175] = "Narrowable"; + TypeFlags[TypeFlags["NotUnionOrUnit"] = 16810497] = "NotUnionOrUnit"; + TypeFlags[TypeFlags["RequiresWidening"] = 6291456] = "RequiresWidening"; + TypeFlags[TypeFlags["PropagatingFlags"] = 14680064] = "PropagatingFlags"; + })(TypeFlags = ts.TypeFlags || (ts.TypeFlags = {})); + var ObjectFlags; + (function (ObjectFlags) { + ObjectFlags[ObjectFlags["Class"] = 1] = "Class"; + ObjectFlags[ObjectFlags["Interface"] = 2] = "Interface"; + ObjectFlags[ObjectFlags["Reference"] = 4] = "Reference"; + ObjectFlags[ObjectFlags["Tuple"] = 8] = "Tuple"; + ObjectFlags[ObjectFlags["Anonymous"] = 16] = "Anonymous"; + ObjectFlags[ObjectFlags["Mapped"] = 32] = "Mapped"; + ObjectFlags[ObjectFlags["Instantiated"] = 64] = "Instantiated"; + ObjectFlags[ObjectFlags["ObjectLiteral"] = 128] = "ObjectLiteral"; + ObjectFlags[ObjectFlags["EvolvingArray"] = 256] = "EvolvingArray"; + ObjectFlags[ObjectFlags["ObjectLiteralPatternWithComputedProperties"] = 512] = "ObjectLiteralPatternWithComputedProperties"; + ObjectFlags[ObjectFlags["ClassOrInterface"] = 3] = "ClassOrInterface"; + })(ObjectFlags = ts.ObjectFlags || (ts.ObjectFlags = {})); + var SignatureKind; + (function (SignatureKind) { + SignatureKind[SignatureKind["Call"] = 0] = "Call"; + SignatureKind[SignatureKind["Construct"] = 1] = "Construct"; + })(SignatureKind = ts.SignatureKind || (ts.SignatureKind = {})); + var IndexKind; + (function (IndexKind) { + IndexKind[IndexKind["String"] = 0] = "String"; + IndexKind[IndexKind["Number"] = 1] = "Number"; + })(IndexKind = ts.IndexKind || (ts.IndexKind = {})); + var InferencePriority; + (function (InferencePriority) { + InferencePriority[InferencePriority["NakedTypeVariable"] = 1] = "NakedTypeVariable"; + InferencePriority[InferencePriority["MappedType"] = 2] = "MappedType"; + InferencePriority[InferencePriority["ReturnType"] = 4] = "ReturnType"; + })(InferencePriority = ts.InferencePriority || (ts.InferencePriority = {})); + var InferenceFlags; + (function (InferenceFlags) { + InferenceFlags[InferenceFlags["InferUnionTypes"] = 1] = "InferUnionTypes"; + InferenceFlags[InferenceFlags["NoDefault"] = 2] = "NoDefault"; + InferenceFlags[InferenceFlags["AnyDefault"] = 4] = "AnyDefault"; + })(InferenceFlags = ts.InferenceFlags || (ts.InferenceFlags = {})); + var Ternary; + (function (Ternary) { + Ternary[Ternary["False"] = 0] = "False"; + Ternary[Ternary["Maybe"] = 1] = "Maybe"; + Ternary[Ternary["True"] = -1] = "True"; + })(Ternary = ts.Ternary || (ts.Ternary = {})); + var SpecialPropertyAssignmentKind; + (function (SpecialPropertyAssignmentKind) { + SpecialPropertyAssignmentKind[SpecialPropertyAssignmentKind["None"] = 0] = "None"; + SpecialPropertyAssignmentKind[SpecialPropertyAssignmentKind["ExportsProperty"] = 1] = "ExportsProperty"; + SpecialPropertyAssignmentKind[SpecialPropertyAssignmentKind["ModuleExports"] = 2] = "ModuleExports"; + SpecialPropertyAssignmentKind[SpecialPropertyAssignmentKind["PrototypeProperty"] = 3] = "PrototypeProperty"; + SpecialPropertyAssignmentKind[SpecialPropertyAssignmentKind["ThisProperty"] = 4] = "ThisProperty"; + SpecialPropertyAssignmentKind[SpecialPropertyAssignmentKind["Property"] = 5] = "Property"; + })(SpecialPropertyAssignmentKind = ts.SpecialPropertyAssignmentKind || (ts.SpecialPropertyAssignmentKind = {})); var DiagnosticCategory; (function (DiagnosticCategory) { DiagnosticCategory[DiagnosticCategory["Warning"] = 0] = "Warning"; @@ -81,6 +785,310 @@ var ts; ModuleKind[ModuleKind["ES2015"] = 5] = "ES2015"; ModuleKind[ModuleKind["ESNext"] = 6] = "ESNext"; })(ModuleKind = ts.ModuleKind || (ts.ModuleKind = {})); + var JsxEmit; + (function (JsxEmit) { + JsxEmit[JsxEmit["None"] = 0] = "None"; + JsxEmit[JsxEmit["Preserve"] = 1] = "Preserve"; + JsxEmit[JsxEmit["React"] = 2] = "React"; + JsxEmit[JsxEmit["ReactNative"] = 3] = "ReactNative"; + })(JsxEmit = ts.JsxEmit || (ts.JsxEmit = {})); + var NewLineKind; + (function (NewLineKind) { + NewLineKind[NewLineKind["CarriageReturnLineFeed"] = 0] = "CarriageReturnLineFeed"; + NewLineKind[NewLineKind["LineFeed"] = 1] = "LineFeed"; + })(NewLineKind = ts.NewLineKind || (ts.NewLineKind = {})); + var ScriptKind; + (function (ScriptKind) { + ScriptKind[ScriptKind["Unknown"] = 0] = "Unknown"; + ScriptKind[ScriptKind["JS"] = 1] = "JS"; + ScriptKind[ScriptKind["JSX"] = 2] = "JSX"; + ScriptKind[ScriptKind["TS"] = 3] = "TS"; + ScriptKind[ScriptKind["TSX"] = 4] = "TSX"; + ScriptKind[ScriptKind["External"] = 5] = "External"; + ScriptKind[ScriptKind["JSON"] = 6] = "JSON"; + })(ScriptKind = ts.ScriptKind || (ts.ScriptKind = {})); + var ScriptTarget; + (function (ScriptTarget) { + ScriptTarget[ScriptTarget["ES3"] = 0] = "ES3"; + ScriptTarget[ScriptTarget["ES5"] = 1] = "ES5"; + ScriptTarget[ScriptTarget["ES2015"] = 2] = "ES2015"; + ScriptTarget[ScriptTarget["ES2016"] = 3] = "ES2016"; + ScriptTarget[ScriptTarget["ES2017"] = 4] = "ES2017"; + ScriptTarget[ScriptTarget["ESNext"] = 5] = "ESNext"; + ScriptTarget[ScriptTarget["Latest"] = 5] = "Latest"; + })(ScriptTarget = ts.ScriptTarget || (ts.ScriptTarget = {})); + var LanguageVariant; + (function (LanguageVariant) { + LanguageVariant[LanguageVariant["Standard"] = 0] = "Standard"; + LanguageVariant[LanguageVariant["JSX"] = 1] = "JSX"; + })(LanguageVariant = ts.LanguageVariant || (ts.LanguageVariant = {})); + var DiagnosticStyle; + (function (DiagnosticStyle) { + DiagnosticStyle[DiagnosticStyle["Simple"] = 0] = "Simple"; + DiagnosticStyle[DiagnosticStyle["Pretty"] = 1] = "Pretty"; + })(DiagnosticStyle = ts.DiagnosticStyle || (ts.DiagnosticStyle = {})); + var WatchDirectoryFlags; + (function (WatchDirectoryFlags) { + WatchDirectoryFlags[WatchDirectoryFlags["None"] = 0] = "None"; + WatchDirectoryFlags[WatchDirectoryFlags["Recursive"] = 1] = "Recursive"; + })(WatchDirectoryFlags = ts.WatchDirectoryFlags || (ts.WatchDirectoryFlags = {})); + var CharacterCodes; + (function (CharacterCodes) { + CharacterCodes[CharacterCodes["nullCharacter"] = 0] = "nullCharacter"; + CharacterCodes[CharacterCodes["maxAsciiCharacter"] = 127] = "maxAsciiCharacter"; + CharacterCodes[CharacterCodes["lineFeed"] = 10] = "lineFeed"; + CharacterCodes[CharacterCodes["carriageReturn"] = 13] = "carriageReturn"; + CharacterCodes[CharacterCodes["lineSeparator"] = 8232] = "lineSeparator"; + CharacterCodes[CharacterCodes["paragraphSeparator"] = 8233] = "paragraphSeparator"; + CharacterCodes[CharacterCodes["nextLine"] = 133] = "nextLine"; + CharacterCodes[CharacterCodes["space"] = 32] = "space"; + CharacterCodes[CharacterCodes["nonBreakingSpace"] = 160] = "nonBreakingSpace"; + CharacterCodes[CharacterCodes["enQuad"] = 8192] = "enQuad"; + CharacterCodes[CharacterCodes["emQuad"] = 8193] = "emQuad"; + CharacterCodes[CharacterCodes["enSpace"] = 8194] = "enSpace"; + CharacterCodes[CharacterCodes["emSpace"] = 8195] = "emSpace"; + CharacterCodes[CharacterCodes["threePerEmSpace"] = 8196] = "threePerEmSpace"; + CharacterCodes[CharacterCodes["fourPerEmSpace"] = 8197] = "fourPerEmSpace"; + CharacterCodes[CharacterCodes["sixPerEmSpace"] = 8198] = "sixPerEmSpace"; + CharacterCodes[CharacterCodes["figureSpace"] = 8199] = "figureSpace"; + CharacterCodes[CharacterCodes["punctuationSpace"] = 8200] = "punctuationSpace"; + CharacterCodes[CharacterCodes["thinSpace"] = 8201] = "thinSpace"; + CharacterCodes[CharacterCodes["hairSpace"] = 8202] = "hairSpace"; + CharacterCodes[CharacterCodes["zeroWidthSpace"] = 8203] = "zeroWidthSpace"; + CharacterCodes[CharacterCodes["narrowNoBreakSpace"] = 8239] = "narrowNoBreakSpace"; + CharacterCodes[CharacterCodes["ideographicSpace"] = 12288] = "ideographicSpace"; + CharacterCodes[CharacterCodes["mathematicalSpace"] = 8287] = "mathematicalSpace"; + CharacterCodes[CharacterCodes["ogham"] = 5760] = "ogham"; + CharacterCodes[CharacterCodes["_"] = 95] = "_"; + CharacterCodes[CharacterCodes["$"] = 36] = "$"; + CharacterCodes[CharacterCodes["_0"] = 48] = "_0"; + CharacterCodes[CharacterCodes["_1"] = 49] = "_1"; + CharacterCodes[CharacterCodes["_2"] = 50] = "_2"; + CharacterCodes[CharacterCodes["_3"] = 51] = "_3"; + CharacterCodes[CharacterCodes["_4"] = 52] = "_4"; + CharacterCodes[CharacterCodes["_5"] = 53] = "_5"; + CharacterCodes[CharacterCodes["_6"] = 54] = "_6"; + CharacterCodes[CharacterCodes["_7"] = 55] = "_7"; + CharacterCodes[CharacterCodes["_8"] = 56] = "_8"; + CharacterCodes[CharacterCodes["_9"] = 57] = "_9"; + CharacterCodes[CharacterCodes["a"] = 97] = "a"; + CharacterCodes[CharacterCodes["b"] = 98] = "b"; + CharacterCodes[CharacterCodes["c"] = 99] = "c"; + CharacterCodes[CharacterCodes["d"] = 100] = "d"; + CharacterCodes[CharacterCodes["e"] = 101] = "e"; + CharacterCodes[CharacterCodes["f"] = 102] = "f"; + CharacterCodes[CharacterCodes["g"] = 103] = "g"; + CharacterCodes[CharacterCodes["h"] = 104] = "h"; + CharacterCodes[CharacterCodes["i"] = 105] = "i"; + CharacterCodes[CharacterCodes["j"] = 106] = "j"; + CharacterCodes[CharacterCodes["k"] = 107] = "k"; + CharacterCodes[CharacterCodes["l"] = 108] = "l"; + CharacterCodes[CharacterCodes["m"] = 109] = "m"; + CharacterCodes[CharacterCodes["n"] = 110] = "n"; + CharacterCodes[CharacterCodes["o"] = 111] = "o"; + CharacterCodes[CharacterCodes["p"] = 112] = "p"; + CharacterCodes[CharacterCodes["q"] = 113] = "q"; + CharacterCodes[CharacterCodes["r"] = 114] = "r"; + CharacterCodes[CharacterCodes["s"] = 115] = "s"; + CharacterCodes[CharacterCodes["t"] = 116] = "t"; + CharacterCodes[CharacterCodes["u"] = 117] = "u"; + CharacterCodes[CharacterCodes["v"] = 118] = "v"; + CharacterCodes[CharacterCodes["w"] = 119] = "w"; + CharacterCodes[CharacterCodes["x"] = 120] = "x"; + CharacterCodes[CharacterCodes["y"] = 121] = "y"; + CharacterCodes[CharacterCodes["z"] = 122] = "z"; + CharacterCodes[CharacterCodes["A"] = 65] = "A"; + CharacterCodes[CharacterCodes["B"] = 66] = "B"; + CharacterCodes[CharacterCodes["C"] = 67] = "C"; + CharacterCodes[CharacterCodes["D"] = 68] = "D"; + CharacterCodes[CharacterCodes["E"] = 69] = "E"; + CharacterCodes[CharacterCodes["F"] = 70] = "F"; + CharacterCodes[CharacterCodes["G"] = 71] = "G"; + CharacterCodes[CharacterCodes["H"] = 72] = "H"; + CharacterCodes[CharacterCodes["I"] = 73] = "I"; + CharacterCodes[CharacterCodes["J"] = 74] = "J"; + CharacterCodes[CharacterCodes["K"] = 75] = "K"; + CharacterCodes[CharacterCodes["L"] = 76] = "L"; + CharacterCodes[CharacterCodes["M"] = 77] = "M"; + CharacterCodes[CharacterCodes["N"] = 78] = "N"; + CharacterCodes[CharacterCodes["O"] = 79] = "O"; + CharacterCodes[CharacterCodes["P"] = 80] = "P"; + CharacterCodes[CharacterCodes["Q"] = 81] = "Q"; + CharacterCodes[CharacterCodes["R"] = 82] = "R"; + CharacterCodes[CharacterCodes["S"] = 83] = "S"; + CharacterCodes[CharacterCodes["T"] = 84] = "T"; + CharacterCodes[CharacterCodes["U"] = 85] = "U"; + CharacterCodes[CharacterCodes["V"] = 86] = "V"; + CharacterCodes[CharacterCodes["W"] = 87] = "W"; + CharacterCodes[CharacterCodes["X"] = 88] = "X"; + CharacterCodes[CharacterCodes["Y"] = 89] = "Y"; + CharacterCodes[CharacterCodes["Z"] = 90] = "Z"; + CharacterCodes[CharacterCodes["ampersand"] = 38] = "ampersand"; + CharacterCodes[CharacterCodes["asterisk"] = 42] = "asterisk"; + CharacterCodes[CharacterCodes["at"] = 64] = "at"; + CharacterCodes[CharacterCodes["backslash"] = 92] = "backslash"; + CharacterCodes[CharacterCodes["backtick"] = 96] = "backtick"; + CharacterCodes[CharacterCodes["bar"] = 124] = "bar"; + CharacterCodes[CharacterCodes["caret"] = 94] = "caret"; + CharacterCodes[CharacterCodes["closeBrace"] = 125] = "closeBrace"; + CharacterCodes[CharacterCodes["closeBracket"] = 93] = "closeBracket"; + CharacterCodes[CharacterCodes["closeParen"] = 41] = "closeParen"; + CharacterCodes[CharacterCodes["colon"] = 58] = "colon"; + CharacterCodes[CharacterCodes["comma"] = 44] = "comma"; + CharacterCodes[CharacterCodes["dot"] = 46] = "dot"; + CharacterCodes[CharacterCodes["doubleQuote"] = 34] = "doubleQuote"; + CharacterCodes[CharacterCodes["equals"] = 61] = "equals"; + CharacterCodes[CharacterCodes["exclamation"] = 33] = "exclamation"; + CharacterCodes[CharacterCodes["greaterThan"] = 62] = "greaterThan"; + CharacterCodes[CharacterCodes["hash"] = 35] = "hash"; + CharacterCodes[CharacterCodes["lessThan"] = 60] = "lessThan"; + CharacterCodes[CharacterCodes["minus"] = 45] = "minus"; + CharacterCodes[CharacterCodes["openBrace"] = 123] = "openBrace"; + CharacterCodes[CharacterCodes["openBracket"] = 91] = "openBracket"; + CharacterCodes[CharacterCodes["openParen"] = 40] = "openParen"; + CharacterCodes[CharacterCodes["percent"] = 37] = "percent"; + CharacterCodes[CharacterCodes["plus"] = 43] = "plus"; + CharacterCodes[CharacterCodes["question"] = 63] = "question"; + CharacterCodes[CharacterCodes["semicolon"] = 59] = "semicolon"; + CharacterCodes[CharacterCodes["singleQuote"] = 39] = "singleQuote"; + CharacterCodes[CharacterCodes["slash"] = 47] = "slash"; + CharacterCodes[CharacterCodes["tilde"] = 126] = "tilde"; + CharacterCodes[CharacterCodes["backspace"] = 8] = "backspace"; + CharacterCodes[CharacterCodes["formFeed"] = 12] = "formFeed"; + CharacterCodes[CharacterCodes["byteOrderMark"] = 65279] = "byteOrderMark"; + CharacterCodes[CharacterCodes["tab"] = 9] = "tab"; + CharacterCodes[CharacterCodes["verticalTab"] = 11] = "verticalTab"; + })(CharacterCodes = ts.CharacterCodes || (ts.CharacterCodes = {})); + var Extension; + (function (Extension) { + Extension["Ts"] = ".ts"; + Extension["Tsx"] = ".tsx"; + Extension["Dts"] = ".d.ts"; + Extension["Js"] = ".js"; + Extension["Jsx"] = ".jsx"; + })(Extension = ts.Extension || (ts.Extension = {})); + var TransformFlags; + (function (TransformFlags) { + TransformFlags[TransformFlags["None"] = 0] = "None"; + TransformFlags[TransformFlags["TypeScript"] = 1] = "TypeScript"; + TransformFlags[TransformFlags["ContainsTypeScript"] = 2] = "ContainsTypeScript"; + TransformFlags[TransformFlags["ContainsJsx"] = 4] = "ContainsJsx"; + TransformFlags[TransformFlags["ContainsESNext"] = 8] = "ContainsESNext"; + TransformFlags[TransformFlags["ContainsES2017"] = 16] = "ContainsES2017"; + TransformFlags[TransformFlags["ContainsES2016"] = 32] = "ContainsES2016"; + TransformFlags[TransformFlags["ES2015"] = 64] = "ES2015"; + TransformFlags[TransformFlags["ContainsES2015"] = 128] = "ContainsES2015"; + TransformFlags[TransformFlags["Generator"] = 256] = "Generator"; + TransformFlags[TransformFlags["ContainsGenerator"] = 512] = "ContainsGenerator"; + TransformFlags[TransformFlags["DestructuringAssignment"] = 1024] = "DestructuringAssignment"; + TransformFlags[TransformFlags["ContainsDestructuringAssignment"] = 2048] = "ContainsDestructuringAssignment"; + TransformFlags[TransformFlags["ContainsDecorators"] = 4096] = "ContainsDecorators"; + TransformFlags[TransformFlags["ContainsPropertyInitializer"] = 8192] = "ContainsPropertyInitializer"; + TransformFlags[TransformFlags["ContainsLexicalThis"] = 16384] = "ContainsLexicalThis"; + TransformFlags[TransformFlags["ContainsCapturedLexicalThis"] = 32768] = "ContainsCapturedLexicalThis"; + TransformFlags[TransformFlags["ContainsLexicalThisInComputedPropertyName"] = 65536] = "ContainsLexicalThisInComputedPropertyName"; + TransformFlags[TransformFlags["ContainsDefaultValueAssignments"] = 131072] = "ContainsDefaultValueAssignments"; + TransformFlags[TransformFlags["ContainsParameterPropertyAssignments"] = 262144] = "ContainsParameterPropertyAssignments"; + TransformFlags[TransformFlags["ContainsSpread"] = 524288] = "ContainsSpread"; + TransformFlags[TransformFlags["ContainsObjectSpread"] = 1048576] = "ContainsObjectSpread"; + TransformFlags[TransformFlags["ContainsRest"] = 524288] = "ContainsRest"; + TransformFlags[TransformFlags["ContainsObjectRest"] = 1048576] = "ContainsObjectRest"; + TransformFlags[TransformFlags["ContainsComputedPropertyName"] = 2097152] = "ContainsComputedPropertyName"; + TransformFlags[TransformFlags["ContainsBlockScopedBinding"] = 4194304] = "ContainsBlockScopedBinding"; + TransformFlags[TransformFlags["ContainsBindingPattern"] = 8388608] = "ContainsBindingPattern"; + TransformFlags[TransformFlags["ContainsYield"] = 16777216] = "ContainsYield"; + TransformFlags[TransformFlags["ContainsHoistedDeclarationOrCompletion"] = 33554432] = "ContainsHoistedDeclarationOrCompletion"; + TransformFlags[TransformFlags["ContainsDynamicImport"] = 67108864] = "ContainsDynamicImport"; + TransformFlags[TransformFlags["HasComputedFlags"] = 536870912] = "HasComputedFlags"; + TransformFlags[TransformFlags["AssertTypeScript"] = 3] = "AssertTypeScript"; + TransformFlags[TransformFlags["AssertJsx"] = 4] = "AssertJsx"; + TransformFlags[TransformFlags["AssertESNext"] = 8] = "AssertESNext"; + TransformFlags[TransformFlags["AssertES2017"] = 16] = "AssertES2017"; + TransformFlags[TransformFlags["AssertES2016"] = 32] = "AssertES2016"; + TransformFlags[TransformFlags["AssertES2015"] = 192] = "AssertES2015"; + TransformFlags[TransformFlags["AssertGenerator"] = 768] = "AssertGenerator"; + TransformFlags[TransformFlags["AssertDestructuringAssignment"] = 3072] = "AssertDestructuringAssignment"; + TransformFlags[TransformFlags["NodeExcludes"] = 536872257] = "NodeExcludes"; + TransformFlags[TransformFlags["ArrowFunctionExcludes"] = 601249089] = "ArrowFunctionExcludes"; + TransformFlags[TransformFlags["FunctionExcludes"] = 601281857] = "FunctionExcludes"; + TransformFlags[TransformFlags["ConstructorExcludes"] = 601015617] = "ConstructorExcludes"; + TransformFlags[TransformFlags["MethodOrAccessorExcludes"] = 601015617] = "MethodOrAccessorExcludes"; + TransformFlags[TransformFlags["ClassExcludes"] = 539358529] = "ClassExcludes"; + TransformFlags[TransformFlags["ModuleExcludes"] = 574674241] = "ModuleExcludes"; + TransformFlags[TransformFlags["TypeExcludes"] = -3] = "TypeExcludes"; + TransformFlags[TransformFlags["ObjectLiteralExcludes"] = 540087617] = "ObjectLiteralExcludes"; + TransformFlags[TransformFlags["ArrayLiteralOrCallOrNewExcludes"] = 537396545] = "ArrayLiteralOrCallOrNewExcludes"; + TransformFlags[TransformFlags["VariableDeclarationListExcludes"] = 546309441] = "VariableDeclarationListExcludes"; + TransformFlags[TransformFlags["ParameterExcludes"] = 536872257] = "ParameterExcludes"; + TransformFlags[TransformFlags["CatchClauseExcludes"] = 537920833] = "CatchClauseExcludes"; + TransformFlags[TransformFlags["BindingPatternExcludes"] = 537396545] = "BindingPatternExcludes"; + TransformFlags[TransformFlags["TypeScriptClassSyntaxMask"] = 274432] = "TypeScriptClassSyntaxMask"; + TransformFlags[TransformFlags["ES2015FunctionSyntaxMask"] = 163840] = "ES2015FunctionSyntaxMask"; + })(TransformFlags = ts.TransformFlags || (ts.TransformFlags = {})); + var EmitFlags; + (function (EmitFlags) { + EmitFlags[EmitFlags["SingleLine"] = 1] = "SingleLine"; + EmitFlags[EmitFlags["AdviseOnEmitNode"] = 2] = "AdviseOnEmitNode"; + EmitFlags[EmitFlags["NoSubstitution"] = 4] = "NoSubstitution"; + EmitFlags[EmitFlags["CapturesThis"] = 8] = "CapturesThis"; + EmitFlags[EmitFlags["NoLeadingSourceMap"] = 16] = "NoLeadingSourceMap"; + EmitFlags[EmitFlags["NoTrailingSourceMap"] = 32] = "NoTrailingSourceMap"; + EmitFlags[EmitFlags["NoSourceMap"] = 48] = "NoSourceMap"; + EmitFlags[EmitFlags["NoNestedSourceMaps"] = 64] = "NoNestedSourceMaps"; + EmitFlags[EmitFlags["NoTokenLeadingSourceMaps"] = 128] = "NoTokenLeadingSourceMaps"; + EmitFlags[EmitFlags["NoTokenTrailingSourceMaps"] = 256] = "NoTokenTrailingSourceMaps"; + EmitFlags[EmitFlags["NoTokenSourceMaps"] = 384] = "NoTokenSourceMaps"; + EmitFlags[EmitFlags["NoLeadingComments"] = 512] = "NoLeadingComments"; + EmitFlags[EmitFlags["NoTrailingComments"] = 1024] = "NoTrailingComments"; + EmitFlags[EmitFlags["NoComments"] = 1536] = "NoComments"; + EmitFlags[EmitFlags["NoNestedComments"] = 2048] = "NoNestedComments"; + EmitFlags[EmitFlags["HelperName"] = 4096] = "HelperName"; + EmitFlags[EmitFlags["ExportName"] = 8192] = "ExportName"; + EmitFlags[EmitFlags["LocalName"] = 16384] = "LocalName"; + EmitFlags[EmitFlags["InternalName"] = 32768] = "InternalName"; + EmitFlags[EmitFlags["Indented"] = 65536] = "Indented"; + EmitFlags[EmitFlags["NoIndentation"] = 131072] = "NoIndentation"; + EmitFlags[EmitFlags["AsyncFunctionBody"] = 262144] = "AsyncFunctionBody"; + EmitFlags[EmitFlags["ReuseTempVariableScope"] = 524288] = "ReuseTempVariableScope"; + EmitFlags[EmitFlags["CustomPrologue"] = 1048576] = "CustomPrologue"; + EmitFlags[EmitFlags["NoHoisting"] = 2097152] = "NoHoisting"; + EmitFlags[EmitFlags["HasEndOfDeclarationMarker"] = 4194304] = "HasEndOfDeclarationMarker"; + EmitFlags[EmitFlags["Iterator"] = 8388608] = "Iterator"; + EmitFlags[EmitFlags["NoAsciiEscaping"] = 16777216] = "NoAsciiEscaping"; + })(EmitFlags = ts.EmitFlags || (ts.EmitFlags = {})); + var ExternalEmitHelpers; + (function (ExternalEmitHelpers) { + ExternalEmitHelpers[ExternalEmitHelpers["Extends"] = 1] = "Extends"; + ExternalEmitHelpers[ExternalEmitHelpers["Assign"] = 2] = "Assign"; + ExternalEmitHelpers[ExternalEmitHelpers["Rest"] = 4] = "Rest"; + ExternalEmitHelpers[ExternalEmitHelpers["Decorate"] = 8] = "Decorate"; + ExternalEmitHelpers[ExternalEmitHelpers["Metadata"] = 16] = "Metadata"; + ExternalEmitHelpers[ExternalEmitHelpers["Param"] = 32] = "Param"; + ExternalEmitHelpers[ExternalEmitHelpers["Awaiter"] = 64] = "Awaiter"; + ExternalEmitHelpers[ExternalEmitHelpers["Generator"] = 128] = "Generator"; + ExternalEmitHelpers[ExternalEmitHelpers["Values"] = 256] = "Values"; + ExternalEmitHelpers[ExternalEmitHelpers["Read"] = 512] = "Read"; + ExternalEmitHelpers[ExternalEmitHelpers["Spread"] = 1024] = "Spread"; + ExternalEmitHelpers[ExternalEmitHelpers["Await"] = 2048] = "Await"; + ExternalEmitHelpers[ExternalEmitHelpers["AsyncGenerator"] = 4096] = "AsyncGenerator"; + ExternalEmitHelpers[ExternalEmitHelpers["AsyncDelegator"] = 8192] = "AsyncDelegator"; + ExternalEmitHelpers[ExternalEmitHelpers["AsyncValues"] = 16384] = "AsyncValues"; + ExternalEmitHelpers[ExternalEmitHelpers["ExportStar"] = 32768] = "ExportStar"; + ExternalEmitHelpers[ExternalEmitHelpers["ForOfIncludes"] = 256] = "ForOfIncludes"; + ExternalEmitHelpers[ExternalEmitHelpers["ForAwaitOfIncludes"] = 16384] = "ForAwaitOfIncludes"; + ExternalEmitHelpers[ExternalEmitHelpers["AsyncGeneratorIncludes"] = 6144] = "AsyncGeneratorIncludes"; + ExternalEmitHelpers[ExternalEmitHelpers["AsyncDelegatorIncludes"] = 26624] = "AsyncDelegatorIncludes"; + ExternalEmitHelpers[ExternalEmitHelpers["SpreadIncludes"] = 1536] = "SpreadIncludes"; + ExternalEmitHelpers[ExternalEmitHelpers["FirstEmitHelper"] = 1] = "FirstEmitHelper"; + ExternalEmitHelpers[ExternalEmitHelpers["LastEmitHelper"] = 32768] = "LastEmitHelper"; + })(ExternalEmitHelpers = ts.ExternalEmitHelpers || (ts.ExternalEmitHelpers = {})); + var EmitHint; + (function (EmitHint) { + EmitHint[EmitHint["SourceFile"] = 0] = "SourceFile"; + EmitHint[EmitHint["Expression"] = 1] = "Expression"; + EmitHint[EmitHint["IdentifierName"] = 2] = "IdentifierName"; + EmitHint[EmitHint["Unspecified"] = 3] = "Unspecified"; + })(EmitHint = ts.EmitHint || (ts.EmitHint = {})); })(ts || (ts = {})); var ts; (function (ts) { @@ -143,7 +1151,7 @@ var ts; })(ts || (ts = {})); var ts; (function (ts) { - ts.versionMajorMinor = "2.5"; + ts.versionMajorMinor = "2.6"; ts.version = ts.versionMajorMinor + ".0"; })(ts || (ts = {})); (function (ts) { @@ -257,6 +1265,12 @@ var ts; return getCanonicalFileName(nonCanonicalizedPath); } ts.toPath = toPath; + var Comparison; + (function (Comparison) { + Comparison[Comparison["LessThan"] = -1] = "LessThan"; + Comparison[Comparison["EqualTo"] = 0] = "EqualTo"; + Comparison[Comparison["GreaterThan"] = 1] = "GreaterThan"; + })(Comparison = ts.Comparison || (ts.Comparison = {})); function length(array) { return array ? array.length : 0; } @@ -428,10 +1442,9 @@ var ts; ts.removeWhere = removeWhere; function filterMutate(array, f) { var outIndex = 0; - for (var _i = 0, array_3 = array; _i < array_3.length; _i++) { - var item = array_3[_i]; - if (f(item)) { - array[outIndex] = item; + for (var i = 0; i < array.length; i++) { + if (f(array[i], i, array)) { + array[outIndex] = array[i]; outIndex++; } } @@ -477,8 +1490,8 @@ var ts; var result; if (array) { result = []; - for (var _i = 0, array_4 = array; _i < array_4.length; _i++) { - var v = array_4[_i]; + for (var _i = 0, array_3 = array; _i < array_3.length; _i++) { + var v = array_3[_i]; if (v) { if (isArray(v)) { addRange(result, v); @@ -548,11 +1561,13 @@ var ts; ts.sameFlatMap = sameFlatMap; function mapDefined(array, mapFn) { var result = []; - for (var i = 0; i < array.length; i++) { - var item = array[i]; - var mapped = mapFn(item, i); - if (mapped !== undefined) { - result.push(mapped); + if (array) { + for (var i = 0; i < array.length; i++) { + var item = array[i]; + var mapped = mapFn(item, i); + if (mapped !== undefined) { + result.push(mapped); + } } } return result; @@ -620,8 +1635,8 @@ var ts; function some(array, predicate) { if (array) { if (predicate) { - for (var _i = 0, array_5 = array; _i < array_5.length; _i++) { - var v = array_5[_i]; + for (var _i = 0, array_4 = array; _i < array_4.length; _i++) { + var v = array_4[_i]; if (predicate(v)) { return true; } @@ -646,8 +1661,8 @@ var ts; var result; if (array) { result = []; - loop: for (var _i = 0, array_6 = array; _i < array_6.length; _i++) { - var item = array_6[_i]; + loop: for (var _i = 0, array_5 = array; _i < array_5.length; _i++) { + var item = array_5[_i]; for (var _a = 0, result_1 = result; _a < result_1.length; _a++) { var res = result_1[_a]; if (areEqual ? areEqual(res, item) : res === item) { @@ -735,8 +1750,8 @@ var ts; ts.relativeComplement = relativeComplement; function sum(array, prop) { var result = 0; - for (var _i = 0, array_7 = array; _i < array_7.length; _i++) { - var v = array_7[_i]; + for (var _i = 0, array_6 = array; _i < array_6.length; _i++) { + var v = array_6[_i]; result += v[prop]; } return result; @@ -996,8 +2011,8 @@ var ts; ts.equalOwnProperties = equalOwnProperties; function arrayToMap(array, makeKey, makeValue) { var result = createMap(); - for (var _i = 0, array_8 = array; _i < array_8.length; _i++) { - var value = array_8[_i]; + for (var _i = 0, array_7 = array; _i < array_7.length; _i++) { + var value = array_7[_i]; result.set(makeKey(value), makeValue ? makeValue(value) : value); } return result; @@ -1157,11 +2172,11 @@ var ts; ts.getLocaleSpecificMessage = getLocaleSpecificMessage; function createFileDiagnostic(file, start, length, message) { var end = start + length; - Debug.assert(start >= 0, "start must be non-negative, is " + start); - Debug.assert(length >= 0, "length must be non-negative, is " + length); + Debug.assertGreaterThanOrEqual(start, 0); + Debug.assertGreaterThanOrEqual(length, 0); if (file) { - Debug.assert(start <= file.text.length, "start must be within the bounds of the file. " + start + " > " + file.text.length); - Debug.assert(end <= file.text.length, "end must be the bounds of the file. " + end + " > " + file.text.length); + Debug.assertLessThanOrEqual(start, file.text.length); + Debug.assertLessThanOrEqual(end, file.text.length); } var text = getLocaleSpecificMessage(message); if (arguments.length > 4) { @@ -1370,19 +2385,23 @@ var ts; return normalized; } function normalizePath(path) { + return normalizePathAndParts(path).path; + } + ts.normalizePath = normalizePath; + function normalizePathAndParts(path) { path = normalizeSlashes(path); var rootLength = getRootLength(path); var root = path.substr(0, rootLength); - var normalized = getNormalizedParts(path, rootLength); - if (normalized.length) { - var joinedParts = root + normalized.join(ts.directorySeparator); - return pathEndsWithDirectorySeparator(path) ? joinedParts + ts.directorySeparator : joinedParts; + var parts = getNormalizedParts(path, rootLength); + if (parts.length) { + var joinedParts = root + parts.join(ts.directorySeparator); + return { path: pathEndsWithDirectorySeparator(path) ? joinedParts + ts.directorySeparator : joinedParts, parts: parts }; } else { - return root; + return { path: root, parts: parts }; } } - ts.normalizePath = normalizePath; + ts.normalizePathAndParts = normalizePathAndParts; function pathEndsWithDirectorySeparator(path) { return path.charCodeAt(path.length - 1) === directorySeparatorCharCode; } @@ -1645,8 +2664,28 @@ var ts; ts.fileExtensionIsOneOf = fileExtensionIsOneOf; var reservedCharacterPattern = /[^\w\s\/]/g; var wildcardCharCodes = [42, 63]; - var singleAsteriskRegexFragmentFiles = "([^./]|(\\.(?!min\\.js$))?)*"; - var singleAsteriskRegexFragmentOther = "[^/]*"; + ts.commonPackageFolders = ["node_modules", "bower_components", "jspm_packages"]; + var implicitExcludePathRegexPattern = "(?!(" + ts.commonPackageFolders.join("|") + ")(/|$))"; + var filesMatcher = { + singleAsteriskRegexFragment: "([^./]|(\\.(?!min\\.js$))?)*", + doubleAsteriskRegexFragment: "(/" + implicitExcludePathRegexPattern + "[^/.][^/]*)*?", + replaceWildcardCharacter: function (match) { return replaceWildcardCharacter(match, filesMatcher.singleAsteriskRegexFragment); } + }; + var directoriesMatcher = { + singleAsteriskRegexFragment: "[^/]*", + doubleAsteriskRegexFragment: "(/" + implicitExcludePathRegexPattern + "[^/.][^/]*)*?", + replaceWildcardCharacter: function (match) { return replaceWildcardCharacter(match, directoriesMatcher.singleAsteriskRegexFragment); } + }; + var excludeMatcher = { + singleAsteriskRegexFragment: "[^/]*", + doubleAsteriskRegexFragment: "(/.+?)?", + replaceWildcardCharacter: function (match) { return replaceWildcardCharacter(match, excludeMatcher.singleAsteriskRegexFragment); } + }; + var wildcardMatchers = { + files: filesMatcher, + directories: directoriesMatcher, + exclude: excludeMatcher + }; function getRegularExpressionForWildcard(specs, basePath, usage) { var patterns = getRegularExpressionsForWildcards(specs, basePath, usage); if (!patterns || !patterns.length) { @@ -1661,18 +2700,16 @@ var ts; if (specs === undefined || specs.length === 0) { return undefined; } - var replaceWildcardCharacter = usage === "files" ? replaceWildCardCharacterFiles : replaceWildCardCharacterOther; - var singleAsteriskRegexFragment = usage === "files" ? singleAsteriskRegexFragmentFiles : singleAsteriskRegexFragmentOther; - var doubleAsteriskRegexFragment = usage === "exclude" ? "(/.+?)?" : "(/[^/.][^/]*)*?"; return flatMap(specs, function (spec) { - return spec && getSubPatternFromSpec(spec, basePath, usage, singleAsteriskRegexFragment, doubleAsteriskRegexFragment, replaceWildcardCharacter); + return spec && getSubPatternFromSpec(spec, basePath, usage, wildcardMatchers[usage]); }); } function isImplicitGlob(lastPathComponent) { return !/[.*?]/.test(lastPathComponent); } ts.isImplicitGlob = isImplicitGlob; - function getSubPatternFromSpec(spec, basePath, usage, singleAsteriskRegexFragment, doubleAsteriskRegexFragment, replaceWildcardCharacter) { + function getSubPatternFromSpec(spec, basePath, usage, _a) { + var singleAsteriskRegexFragment = _a.singleAsteriskRegexFragment, doubleAsteriskRegexFragment = _a.doubleAsteriskRegexFragment, replaceWildcardCharacter = _a.replaceWildcardCharacter; var subpattern = ""; var hasRecursiveDirectoryWildcard = false; var hasWrittenComponent = false; @@ -1704,16 +2741,24 @@ var ts; subpattern += ts.directorySeparator; } if (usage !== "exclude") { + var componentPattern = ""; if (component.charCodeAt(0) === 42) { - subpattern += "([^./]" + singleAsteriskRegexFragment + ")?"; + componentPattern += "([^./]" + singleAsteriskRegexFragment + ")?"; component = component.substr(1); } else if (component.charCodeAt(0) === 63) { - subpattern += "[^./]"; + componentPattern += "[^./]"; component = component.substr(1); } + componentPattern += component.replace(reservedCharacterPattern, replaceWildcardCharacter); + if (componentPattern !== component) { + subpattern += implicitExcludePathRegexPattern; + } + subpattern += componentPattern; + } + else { + subpattern += component.replace(reservedCharacterPattern, replaceWildcardCharacter); } - subpattern += component.replace(reservedCharacterPattern, replaceWildcardCharacter); } hasWrittenComponent = true; } @@ -1723,12 +2768,6 @@ var ts; } return subpattern; } - function replaceWildCardCharacterFiles(match) { - return replaceWildcardCharacter(match, singleAsteriskRegexFragmentFiles); - } - function replaceWildCardCharacterOther(match) { - return replaceWildcardCharacter(match, singleAsteriskRegexFragmentOther); - } function replaceWildcardCharacter(match, singleAsteriskRegexFragment) { return match === "*" ? singleAsteriskRegexFragment : match === "?" ? "[^/]" : "\\" + match; } @@ -1865,14 +2904,7 @@ var ts; if (!extraFileExtensions || extraFileExtensions.length === 0 || !needAllExtensions) { return needAllExtensions ? allSupportedExtensions : ts.supportedTypeScriptExtensions; } - var extensions = allSupportedExtensions.slice(0); - for (var _i = 0, extraFileExtensions_1 = extraFileExtensions; _i < extraFileExtensions_1.length; _i++) { - var extInfo = extraFileExtensions_1[_i]; - if (extensions.indexOf(extInfo.extension) === -1) { - extensions.push(extInfo.extension); - } - } - return extensions; + return deduplicate(allSupportedExtensions.concat(extraFileExtensions.map(function (e) { return e.extension; }))); } ts.getSupportedExtensions = getSupportedExtensions; function hasJavaScriptFileExtension(fileName) { @@ -1896,6 +2928,13 @@ var ts; return false; } ts.isSupportedSourceFileName = isSupportedSourceFileName; + var ExtensionPriority; + (function (ExtensionPriority) { + ExtensionPriority[ExtensionPriority["TypeScriptFiles"] = 0] = "TypeScriptFiles"; + ExtensionPriority[ExtensionPriority["DeclarationAndJavaScriptFiles"] = 2] = "DeclarationAndJavaScriptFiles"; + ExtensionPriority[ExtensionPriority["Highest"] = 0] = "Highest"; + ExtensionPriority[ExtensionPriority["Lowest"] = 2] = "Lowest"; + })(ExtensionPriority = ts.ExtensionPriority || (ts.ExtensionPriority = {})); function getExtensionPriority(path, supportedExtensions) { for (var i = supportedExtensions.length - 1; i >= 0; i--) { if (fileExtensionIs(path, supportedExtensions[i])) { @@ -1989,6 +3028,13 @@ var ts; getSignatureConstructor: function () { return Signature; }, getSourceMapSourceConstructor: function () { return SourceMapSource; }, }; + var AssertionLevel; + (function (AssertionLevel) { + AssertionLevel[AssertionLevel["None"] = 0] = "None"; + AssertionLevel[AssertionLevel["Normal"] = 1] = "Normal"; + AssertionLevel[AssertionLevel["Aggressive"] = 2] = "Aggressive"; + AssertionLevel[AssertionLevel["VeryAggressive"] = 3] = "VeryAggressive"; + })(AssertionLevel = ts.AssertionLevel || (ts.AssertionLevel = {})); var Debug; (function (Debug) { Debug.currentAssertionLevel = 0; @@ -2000,12 +3046,37 @@ var ts; function assert(expression, message, verboseDebugInfo, stackCrawlMark) { if (!expression) { if (verboseDebugInfo) { - message += "\r\nVerbose Debug Information: " + verboseDebugInfo(); + message += "\r\nVerbose Debug Information: " + (typeof verboseDebugInfo === "string" ? verboseDebugInfo : verboseDebugInfo()); } fail(message ? "False expression: " + message : "False expression.", stackCrawlMark || assert); } } Debug.assert = assert; + function assertEqual(a, b, msg, msg2) { + if (a !== b) { + var message = msg ? msg2 ? msg + " " + msg2 : msg : ""; + fail("Expected " + a + " === " + b + ". " + message); + } + } + Debug.assertEqual = assertEqual; + function assertLessThan(a, b, msg) { + if (a >= b) { + fail("Expected " + a + " < " + b + ". " + (msg || "")); + } + } + Debug.assertLessThan = assertLessThan; + function assertLessThanOrEqual(a, b) { + if (a > b) { + fail("Expected " + a + " <= " + b); + } + } + Debug.assertLessThanOrEqual = assertLessThanOrEqual; + function assertGreaterThanOrEqual(a, b) { + if (a < b) { + fail("Expected " + a + " >= " + b); + } + } + Debug.assertGreaterThanOrEqual = assertGreaterThanOrEqual; function fail(message, stackCrawlMark) { debugger; var e = new Error(message ? "Debug Failure. " + message : "Debug Failure."); @@ -2140,6 +3211,10 @@ var ts; Debug.fail("File " + path + " has unknown extension."); } ts.extensionFromPath = extensionFromPath; + function isAnySupportedFileExtension(path) { + return tryGetExtensionFromPath(path) !== undefined; + } + ts.isAnySupportedFileExtension = isAnySupportedFileExtension; function tryGetExtensionFromPath(path) { return find(ts.supportedTypescriptExtensionsForExtractExtension, function (e) { return fileExtensionIs(path, e); }) || find(ts.supportedJavascriptExtensions, function (e) { return fileExtensionIs(path, e); }); } @@ -2151,6 +3226,12 @@ var ts; })(ts || (ts = {})); var ts; (function (ts) { + function setStackTraceLimit() { + if (Error.stackTraceLimit < 100) { + Error.stackTraceLimit = 100; + } + } + ts.setStackTraceLimit = setStackTraceLimit; var FileWatcherEventKind; (function (FileWatcherEventKind) { FileWatcherEventKind[FileWatcherEventKind["Created"] = 0] = "Created"; @@ -2200,7 +3281,7 @@ var ts; watcher.referenceCount += 1; return; } - watcher = _fs.watch(dirPath, { persistent: true }, function (eventName, relativeFileName) { return fileEventHandler(eventName, relativeFileName, dirPath); }); + watcher = _fs.watch(dirPath || ".", { persistent: true }, function (eventName, relativeFileName) { return fileEventHandler(eventName, relativeFileName, dirPath); }); watcher.referenceCount = 1; dirWatchers.set(dirPath, watcher); return; @@ -2324,6 +3405,11 @@ var ts; function readDirectory(path, extensions, excludes, includes, depth) { return ts.matchFiles(path, extensions, excludes, includes, useCaseSensitiveFileNames, process.cwd(), depth, getAccessibleFileSystemEntries); } + var FileSystemEntryKind; + (function (FileSystemEntryKind) { + FileSystemEntryKind[FileSystemEntryKind["File"] = 0] = "File"; + FileSystemEntryKind[FileSystemEntryKind["Directory"] = 1] = "Directory"; + })(FileSystemEntryKind || (FileSystemEntryKind = {})); function fileSystemEntryExists(path, entryKind) { try { var stat = _fs.statSync(path); @@ -3021,6 +4107,8 @@ var ts; Expected_at_least_0_arguments_but_got_a_minimum_of_1: diag(2557, ts.DiagnosticCategory.Error, "Expected_at_least_0_arguments_but_got_a_minimum_of_1_2557", "Expected at least {0} arguments, but got a minimum of {1}."), Expected_0_type_arguments_but_got_1: diag(2558, ts.DiagnosticCategory.Error, "Expected_0_type_arguments_but_got_1_2558", "Expected {0} type arguments, but got {1}."), Type_0_has_no_properties_in_common_with_type_1: diag(2559, ts.DiagnosticCategory.Error, "Type_0_has_no_properties_in_common_with_type_1_2559", "Type '{0}' has no properties in common with type '{1}'."), + Value_of_type_0_has_no_properties_in_common_with_type_1_Did_you_mean_to_call_it: diag(2560, ts.DiagnosticCategory.Error, "Value_of_type_0_has_no_properties_in_common_with_type_1_Did_you_mean_to_call_it_2560", "Value of type '{0}' has no properties in common with type '{1}'. Did you mean to call it?"), + Base_class_expressions_cannot_reference_class_type_parameters: diag(2561, ts.DiagnosticCategory.Error, "Base_class_expressions_cannot_reference_class_type_parameters_2561", "Base class expressions cannot reference class type parameters."), JSX_element_attributes_type_0_may_not_be_a_union_type: diag(2600, ts.DiagnosticCategory.Error, "JSX_element_attributes_type_0_may_not_be_a_union_type_2600", "JSX element attributes type '{0}' may not be a union type."), The_return_type_of_a_JSX_element_constructor_must_return_an_object_type: diag(2601, ts.DiagnosticCategory.Error, "The_return_type_of_a_JSX_element_constructor_must_return_an_object_type_2601", "The return type of a JSX element constructor must return an object type."), JSX_element_implicitly_has_type_any_because_the_global_type_JSX_Element_does_not_exist: diag(2602, ts.DiagnosticCategory.Error, "JSX_element_implicitly_has_type_any_because_the_global_type_JSX_Element_does_not_exist_2602", "JSX element implicitly has type 'any' because the global type 'JSX.Element' does not exist."), @@ -3208,6 +4296,7 @@ var ts; Do_not_emit_outputs: diag(6010, ts.DiagnosticCategory.Message, "Do_not_emit_outputs_6010", "Do not emit outputs."), Allow_default_imports_from_modules_with_no_default_export_This_does_not_affect_code_emit_just_typechecking: diag(6011, ts.DiagnosticCategory.Message, "Allow_default_imports_from_modules_with_no_default_export_This_does_not_affect_code_emit_just_typech_6011", "Allow default imports from modules with no default export. This does not affect code emit, just typechecking."), Skip_type_checking_of_declaration_files: diag(6012, ts.DiagnosticCategory.Message, "Skip_type_checking_of_declaration_files_6012", "Skip type checking of declaration files."), + Do_not_resolve_the_real_path_of_symlinks: diag(6013, ts.DiagnosticCategory.Message, "Do_not_resolve_the_real_path_of_symlinks_6013", "Do not resolve the real path of symlinks."), Specify_ECMAScript_target_version_Colon_ES3_default_ES5_ES2015_ES2016_ES2017_or_ESNEXT: diag(6015, ts.DiagnosticCategory.Message, "Specify_ECMAScript_target_version_Colon_ES3_default_ES5_ES2015_ES2016_ES2017_or_ESNEXT_6015", "Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', or 'ESNEXT'."), Specify_module_code_generation_Colon_none_commonjs_amd_system_umd_es2015_or_ESNext: diag(6016, ts.DiagnosticCategory.Message, "Specify_module_code_generation_Colon_none_commonjs_amd_system_umd_es2015_or_ESNext_6016", "Specify module code generation: 'none', commonjs', 'amd', 'system', 'umd', 'es2015', or 'ESNext'."), Print_this_message: diag(6017, ts.DiagnosticCategory.Message, "Print_this_message_6017", "Print this message."), @@ -3461,6 +4550,8 @@ var ts; Rewrite_as_the_indexed_access_type_0: diag(90026, ts.DiagnosticCategory.Message, "Rewrite_as_the_indexed_access_type_0_90026", "Rewrite as the indexed access type '{0}'."), Convert_function_to_an_ES2015_class: diag(95001, ts.DiagnosticCategory.Message, "Convert_function_to_an_ES2015_class_95001", "Convert function to an ES2015 class"), Convert_function_0_to_class: diag(95002, ts.DiagnosticCategory.Message, "Convert_function_0_to_class_95002", "Convert function '{0}' to class"), + Extract_function: diag(95003, ts.DiagnosticCategory.Message, "Extract_function_95003", "Extract function"), + Extract_function_into_0: diag(95004, ts.DiagnosticCategory.Message, "Extract_function_into_0_95004", "Extract function into '{0}'"), }; })(ts || (ts = {})); var ts; @@ -5077,19 +6168,6 @@ var ts; return undefined; } ts.getDeclarationOfKind = getDeclarationOfKind; - function findDeclaration(symbol, predicate) { - var declarations = symbol.declarations; - if (declarations) { - for (var _i = 0, declarations_2 = declarations; _i < declarations_2.length; _i++) { - var declaration = declarations_2[_i]; - if (predicate(declaration)) { - return declaration; - } - } - } - return undefined; - } - ts.findDeclaration = findDeclaration; var stringWriter = createSingleLineStringWriter(); var stringWriterAcquired = false; function createSingleLineStringWriter() { @@ -5152,9 +6230,13 @@ var ts; function moduleResolutionIsEqualTo(oldResolution, newResolution) { return oldResolution.isExternalLibraryImport === newResolution.isExternalLibraryImport && oldResolution.extension === newResolution.extension && - oldResolution.resolvedFileName === newResolution.resolvedFileName; + oldResolution.resolvedFileName === newResolution.resolvedFileName && + packageIdIsEqual(oldResolution.packageId, newResolution.packageId); } ts.moduleResolutionIsEqualTo = moduleResolutionIsEqualTo; + function packageIdIsEqual(a, b) { + return a === b || a && b && a.name === b.name && a.version === b.version; + } function typeDirectiveIsEqualTo(oldResolution, newResolution) { return oldResolution.resolvedFileName === newResolution.resolvedFileName && oldResolution.primary === newResolution.primary; } @@ -5219,14 +6301,6 @@ var ts; return file.fileName + "(" + (loc.line + 1) + "," + (loc.character + 1) + ")"; } ts.nodePosToString = nodePosToString; - function getStartPosOfNode(node) { - return node.pos; - } - ts.getStartPosOfNode = getStartPosOfNode; - function isDefined(value) { - return value !== undefined; - } - ts.isDefined = isDefined; function getEndLinePosition(line, sourceFile) { ts.Debug.assert(line >= 0); var lineStarts = ts.getLineStarts(sourceFile); @@ -5257,6 +6331,25 @@ var ts; return !nodeIsMissing(node); } ts.nodeIsPresent = nodeIsPresent; + function isRecognizedTripleSlashComment(text, commentPos, commentEnd) { + if (text.charCodeAt(commentPos + 1) === 47 && + commentPos + 2 < commentEnd && + text.charCodeAt(commentPos + 2) === 47) { + var textSubStr = text.substring(commentPos, commentEnd); + return textSubStr.match(ts.fullTripleSlashReferencePathRegEx) || + textSubStr.match(ts.fullTripleSlashAMDReferencePathRegEx) || + textSubStr.match(fullTripleSlashReferenceTypeReferenceDirectiveRegEx) || + textSubStr.match(defaultLibReferenceRegEx) ? + true : false; + } + return false; + } + ts.isRecognizedTripleSlashComment = isRecognizedTripleSlashComment; + function isPinnedComment(text, comment) { + return text.charCodeAt(comment.pos + 1) === 42 && + text.charCodeAt(comment.pos + 2) === 33; + } + ts.isPinnedComment = isPinnedComment; function getTokenPosOfNode(node, sourceFile, includeJsDoc) { if (nodeIsMissing(node)) { return node.pos; @@ -5313,15 +6406,20 @@ var ts; var escapeText = getEmitFlags(node) & 16777216 ? escapeString : escapeNonAsciiString; switch (node.kind) { case 9: - return '"' + escapeText(node.text) + '"'; + if (node.singleQuote) { + return "'" + escapeText(node.text, 39) + "'"; + } + else { + return '"' + escapeText(node.text, 34) + '"'; + } case 13: - return "`" + escapeText(node.text) + "`"; + return "`" + escapeText(node.text, 96) + "`"; case 14: - return "`" + escapeText(node.text) + "${"; + return "`" + escapeText(node.text, 96) + "${"; case 15: - return "}" + escapeText(node.text) + "${"; + return "}" + escapeText(node.text, 96) + "${"; case 16: - return "}" + escapeText(node.text) + "`"; + return "}" + escapeText(node.text, 96) + "`"; case 8: return node.text; } @@ -5573,13 +6671,9 @@ var ts; } ts.isPrologueDirective = isPrologueDirective; function getLeadingCommentRangesOfNode(node, sourceFileOfNode) { - return ts.getLeadingCommentRanges(sourceFileOfNode.text, node.pos); + return node.kind !== 10 ? ts.getLeadingCommentRanges(sourceFileOfNode.text, node.pos) : undefined; } ts.getLeadingCommentRangesOfNode = getLeadingCommentRangesOfNode; - function getLeadingCommentRangesOfNodeFromText(node, text) { - return ts.getLeadingCommentRanges(text, node.pos); - } - ts.getLeadingCommentRangesOfNodeFromText = getLeadingCommentRangesOfNodeFromText; function getJSDocCommentRanges(node, text) { var commentRanges = (node.kind === 146 || node.kind === 145 || @@ -5587,7 +6681,7 @@ var ts; node.kind === 187 || node.kind === 185) ? ts.concatenate(ts.getTrailingCommentRanges(text, node.pos), ts.getLeadingCommentRanges(text, node.pos)) : - getLeadingCommentRangesOfNodeFromText(node, text); + ts.getLeadingCommentRanges(text, node.pos); return ts.filter(commentRanges, function (comment) { return text.charCodeAt(comment.pos + 1) === 42 && text.charCodeAt(comment.pos + 2) === 42 && @@ -5596,8 +6690,9 @@ var ts; } ts.getJSDocCommentRanges = getJSDocCommentRanges; ts.fullTripleSlashReferencePathRegEx = /^(\/\/\/\s*/; - ts.fullTripleSlashReferenceTypeReferenceDirectiveRegEx = /^(\/\/\/\s*/; + var fullTripleSlashReferenceTypeReferenceDirectiveRegEx = /^(\/\/\/\s*/; ts.fullTripleSlashAMDReferencePathRegEx = /^(\/\/\/\s*/; + var defaultLibReferenceRegEx = /^(\/\/\/\s*/; function isPartOfTypeNode(node) { if (158 <= node.kind && node.kind <= 173) { return true; @@ -5824,21 +6919,11 @@ var ts; } ts.getPropertyAssignment = getPropertyAssignment; function getContainingFunction(node) { - while (true) { - node = node.parent; - if (!node || ts.isFunctionLike(node)) { - return node; - } - } + return ts.findAncestor(node.parent, ts.isFunctionLike); } ts.getContainingFunction = getContainingFunction; function getContainingClass(node) { - while (true) { - node = node.parent; - if (!node || ts.isClassLike(node)) { - return node; - } - } + return ts.findAncestor(node.parent, ts.isClassLike); } ts.getContainingClass = getContainingClass; function getThisContainer(node, includeArrowFunctions) { @@ -6445,6 +7530,12 @@ var ts; return node && node.dotDotDotToken !== undefined; } ts.isDeclaredRestParam = isDeclaredRestParam; + var AssignmentKind; + (function (AssignmentKind) { + AssignmentKind[AssignmentKind["None"] = 0] = "None"; + AssignmentKind[AssignmentKind["Definite"] = 1] = "Definite"; + AssignmentKind[AssignmentKind["Compound"] = 2] = "Compound"; + })(AssignmentKind = ts.AssignmentKind || (ts.AssignmentKind = {})); function getAssignmentTargetKind(node) { var parent = node.parent; while (true) { @@ -6642,14 +7733,14 @@ var ts; ts.getAncestor = getAncestor; function getFileReferenceFromReferencePath(comment, commentRange) { var simpleReferenceRegEx = /^\/\/\/\s*/gim; + var isNoDefaultLibRegEx = new RegExp(defaultLibReferenceRegEx.source, "gim"); if (simpleReferenceRegEx.test(comment)) { if (isNoDefaultLibRegEx.test(comment)) { return { isNoDefaultLib: true }; } else { var refMatchResult = ts.fullTripleSlashReferencePathRegEx.exec(comment); - var refLibResult = !refMatchResult && ts.fullTripleSlashReferenceTypeReferenceDirectiveRegEx.exec(comment); + var refLibResult = !refMatchResult && fullTripleSlashReferenceTypeReferenceDirectiveRegEx.exec(comment); var match = refMatchResult || refLibResult; if (match) { var pos = commentRange.pos + match[1].length + match[2].length; @@ -6680,6 +7771,14 @@ var ts; return 2 <= token && token <= 7; } ts.isTrivia = isTrivia; + var FunctionFlags; + (function (FunctionFlags) { + FunctionFlags[FunctionFlags["Normal"] = 0] = "Normal"; + FunctionFlags[FunctionFlags["Generator"] = 1] = "Generator"; + FunctionFlags[FunctionFlags["Async"] = 2] = "Async"; + FunctionFlags[FunctionFlags["Invalid"] = 4] = "Invalid"; + FunctionFlags[FunctionFlags["AsyncGenerator"] = 3] = "AsyncGenerator"; + })(FunctionFlags = ts.FunctionFlags || (ts.FunctionFlags = {})); function getFunctionFlags(node) { if (!node) { return 4; @@ -6830,10 +7929,11 @@ var ts; return ts.getParseTreeNode(sourceFile, ts.isSourceFile) || sourceFile; } ts.getOriginalSourceFile = getOriginalSourceFile; - function getOriginalSourceFiles(sourceFiles) { - return ts.sameMap(sourceFiles, getOriginalSourceFile); - } - ts.getOriginalSourceFiles = getOriginalSourceFiles; + var Associativity; + (function (Associativity) { + Associativity[Associativity["Left"] = 0] = "Left"; + Associativity[Associativity["Right"] = 1] = "Right"; + })(Associativity = ts.Associativity || (ts.Associativity = {})); function getExpressionAssociativity(expression) { var operator = getOperator(expression); var hasArguments = expression.kind === 182 && expression.arguments !== undefined; @@ -7067,7 +8167,9 @@ var ts; } } ts.createDiagnosticCollection = createDiagnosticCollection; - var escapedCharsRegExp = /[\\\"\u0000-\u001f\t\v\f\b\r\n\u2028\u2029\u0085]/g; + var doubleQuoteEscapedCharsRegExp = /[\\\"\u0000-\u001f\t\v\f\b\r\n\u2028\u2029\u0085]/g; + var singleQuoteEscapedCharsRegExp = /[\\\'\u0000-\u001f\t\v\f\b\r\n\u2028\u2029\u0085]/g; + var backtickQuoteEscapedCharsRegExp = /[\\\`\u0000-\u001f\t\v\f\b\r\n\u2028\u2029\u0085]/g; var escapedCharsMap = ts.createMapFromTemplate({ "\0": "\\0", "\t": "\\t", @@ -7078,11 +8180,16 @@ var ts; "\n": "\\n", "\\": "\\\\", "\"": "\\\"", + "\'": "\\\'", + "\`": "\\\`", "\u2028": "\\u2028", "\u2029": "\\u2029", "\u0085": "\\u0085" }); - function escapeString(s) { + function escapeString(s, quoteChar) { + var escapedCharsRegExp = quoteChar === 96 ? backtickQuoteEscapedCharsRegExp : + quoteChar === 39 ? singleQuoteEscapedCharsRegExp : + doubleQuoteEscapedCharsRegExp; return s.replace(escapedCharsRegExp, getReplacement); } ts.escapeString = escapeString; @@ -7100,8 +8207,8 @@ var ts; return "\\u" + paddedHexCode; } var nonAsciiCharacters = /[^\u0000-\u007F]/g; - function escapeNonAsciiString(s) { - s = escapeString(s); + function escapeNonAsciiString(s, quoteChar) { + s = escapeString(s, quoteChar); return nonAsciiCharacters.test(s) ? s.replace(nonAsciiCharacters, function (c) { return get16BitUnicodeEscapeSequence(c.charCodeAt(0)); }) : s; @@ -7442,7 +8549,7 @@ var ts; var currentDetachedCommentInfo; if (removeComments) { if (node.pos === 0) { - leadingComments = ts.filter(ts.getLeadingCommentRanges(text, node.pos), isPinnedComment); + leadingComments = ts.filter(ts.getLeadingCommentRanges(text, node.pos), isPinnedCommentLocal); } } else { @@ -7474,9 +8581,8 @@ var ts; } } return currentDetachedCommentInfo; - function isPinnedComment(comment) { - return text.charCodeAt(comment.pos + 1) === 42 && - text.charCodeAt(comment.pos + 2) === 33; + function isPinnedCommentLocal(comment) { + return isPinnedComment(text, comment); } } ts.emitDetachedComments = emitDetachedComments; @@ -7547,9 +8653,13 @@ var ts; } ts.hasModifiers = hasModifiers; function hasModifier(node, flags) { - return (getModifierFlags(node) & flags) !== 0; + return !!getSelectedModifierFlags(node, flags); } ts.hasModifier = hasModifier; + function getSelectedModifierFlags(node, flags) { + return getModifierFlags(node) & flags; + } + ts.getSelectedModifierFlags = getSelectedModifierFlags; function getModifierFlags(node) { if (node.modifierFlagsCache & 536870912) { return node.modifierFlagsCache & ~536870912; @@ -7625,21 +8735,6 @@ var ts; return false; } ts.isDestructuringAssignment = isDestructuringAssignment; - function isSupportedExpressionWithTypeArguments(node) { - return isSupportedExpressionWithTypeArgumentsRest(node.expression); - } - ts.isSupportedExpressionWithTypeArguments = isSupportedExpressionWithTypeArguments; - function isSupportedExpressionWithTypeArgumentsRest(node) { - if (node.kind === 71) { - return true; - } - else if (ts.isPropertyAccessExpression(node)) { - return isSupportedExpressionWithTypeArgumentsRest(node.expression); - } - else { - return false; - } - } function isExpressionWithTypeArgumentsInClassExtendsClause(node) { return tryGetClassExtendingExpressionWithTypeArguments(node) !== undefined; } @@ -7752,72 +8847,6 @@ var ts; return carriageReturnLineFeed; } ts.getNewLineCharacter = getNewLineCharacter; - function isSimpleExpression(node) { - return isSimpleExpressionWorker(node, 0); - } - ts.isSimpleExpression = isSimpleExpression; - function isSimpleExpressionWorker(node, depth) { - if (depth <= 5) { - var kind = node.kind; - if (kind === 9 - || kind === 8 - || kind === 12 - || kind === 13 - || kind === 71 - || kind === 99 - || kind === 97 - || kind === 101 - || kind === 86 - || kind === 95) { - return true; - } - else if (kind === 179) { - return isSimpleExpressionWorker(node.expression, depth + 1); - } - else if (kind === 180) { - return isSimpleExpressionWorker(node.expression, depth + 1) - && isSimpleExpressionWorker(node.argumentExpression, depth + 1); - } - else if (kind === 192 - || kind === 193) { - return isSimpleExpressionWorker(node.operand, depth + 1); - } - else if (kind === 194) { - return node.operatorToken.kind !== 40 - && isSimpleExpressionWorker(node.left, depth + 1) - && isSimpleExpressionWorker(node.right, depth + 1); - } - else if (kind === 195) { - return isSimpleExpressionWorker(node.condition, depth + 1) - && isSimpleExpressionWorker(node.whenTrue, depth + 1) - && isSimpleExpressionWorker(node.whenFalse, depth + 1); - } - else if (kind === 190 - || kind === 189 - || kind === 188) { - return isSimpleExpressionWorker(node.expression, depth + 1); - } - else if (kind === 177) { - return node.elements.length === 0; - } - else if (kind === 178) { - return node.properties.length === 0; - } - else if (kind === 181) { - if (!isSimpleExpressionWorker(node.expression, depth + 1)) { - return false; - } - for (var _i = 0, _a = node.arguments; _i < _a.length; _i++) { - var argument = _a[_i]; - if (!isSimpleExpressionWorker(argument, depth + 1)) { - return false; - } - } - return true; - } - } - return false; - } function formatEnum(value, enumObject, isFlags) { if (value === void 0) { value = 0; } var members = getEnumMembers(enumObject); @@ -7886,18 +8915,6 @@ var ts; return formatEnum(flags, ts.ObjectFlags, true); } ts.formatObjectFlags = formatObjectFlags; - function getRangePos(range) { - return range ? range.pos : -1; - } - ts.getRangePos = getRangePos; - function getRangeEnd(range) { - return range ? range.end : -1; - } - ts.getRangeEnd = getRangeEnd; - function movePos(pos, value) { - return ts.positionIsSynthesized(pos) ? -1 : pos + value; - } - ts.movePos = movePos; function createRange(pos, end) { return { pos: pos, end: end }; } @@ -7926,14 +8943,6 @@ var ts; return range.pos === range.end; } ts.isCollapsedRange = isCollapsedRange; - function collapseRangeToStart(range) { - return isCollapsedRange(range) ? range : moveRangeEnd(range, range.pos); - } - ts.collapseRangeToStart = collapseRangeToStart; - function collapseRangeToEnd(range) { - return isCollapsedRange(range) ? range : moveRangePos(range, range.end); - } - ts.collapseRangeToEnd = collapseRangeToEnd; function createTokenRange(pos, token) { return createRange(pos, pos + ts.tokenToString(token).length); } @@ -7986,22 +8995,6 @@ var ts; function isInitializedVariable(node) { return node.initializer !== undefined; } - function isMergedWithClass(node) { - if (node.symbol) { - for (var _i = 0, _a = node.symbol.declarations; _i < _a.length; _i++) { - var declaration = _a[_i]; - if (declaration.kind === 229 && declaration !== node) { - return true; - } - } - } - return false; - } - ts.isMergedWithClass = isMergedWithClass; - function isFirstDeclarationOfKind(node, kind) { - return node.symbol && getDeclarationOfKind(node.symbol, kind) === node; - } - ts.isFirstDeclarationOfKind = isFirstDeclarationOfKind; function isWatchSet(options) { return options.watch && options.hasOwnProperty("watch"); } @@ -8202,6 +9195,20 @@ var ts; return ts.hasModifier(node, 92) && node.parent.kind === 152 && ts.isClassLike(node.parent.parent); } ts.isParameterPropertyDeclaration = isParameterPropertyDeclaration; + function isEmptyBindingPattern(node) { + if (ts.isBindingPattern(node)) { + return ts.every(node.elements, isEmptyBindingElement); + } + return false; + } + ts.isEmptyBindingPattern = isEmptyBindingPattern; + function isEmptyBindingElement(node) { + if (ts.isOmittedExpression(node)) { + return true; + } + return isEmptyBindingPattern(node.name); + } + ts.isEmptyBindingElement = isEmptyBindingElement; function walkUpBindingElementsAndPatterns(node) { while (node && (node.kind === 176 || ts.isBindingPattern(node))) { node = node.parent; @@ -9282,6 +10289,18 @@ var ts; return isUnaryExpressionKind(ts.skipPartiallyEmittedExpressions(node).kind); } ts.isUnaryExpression = isUnaryExpression; + function isUnaryExpressionWithWrite(expr) { + switch (expr.kind) { + case 193: + return true; + case 192: + return expr.operator === 43 || + expr.operator === 44; + default: + return false; + } + } + ts.isUnaryExpressionWithWrite = isUnaryExpressionWithWrite; function isExpressionKind(kind) { return kind === 195 || kind === 197 @@ -9466,9 +10485,19 @@ var ts; var kind = node.kind; return isStatementKindButNotDeclarationKind(kind) || isDeclarationStatementKind(kind) - || kind === 207; + || isBlockStatement(node); } ts.isStatement = isStatement; + function isBlockStatement(node) { + if (node.kind !== 207) + return false; + if (node.parent !== undefined) { + if (node.parent.kind === 224 || node.parent.kind === 260) { + return false; + } + } + return !ts.isFunctionBlock(node); + } function isModuleReference(node) { var kind = node.kind; return kind === 248 @@ -9530,6 +10559,16 @@ var ts; })(ts || (ts = {})); var ts; (function (ts) { + var SignatureFlags; + (function (SignatureFlags) { + SignatureFlags[SignatureFlags["None"] = 0] = "None"; + SignatureFlags[SignatureFlags["Yield"] = 1] = "Yield"; + SignatureFlags[SignatureFlags["Await"] = 2] = "Await"; + SignatureFlags[SignatureFlags["Type"] = 4] = "Type"; + SignatureFlags[SignatureFlags["RequireCompleteParameterList"] = 8] = "RequireCompleteParameterList"; + SignatureFlags[SignatureFlags["IgnoreMissingOpenBrace"] = 16] = "IgnoreMissingOpenBrace"; + SignatureFlags[SignatureFlags["JSDoc"] = 32] = "JSDoc"; + })(SignatureFlags || (SignatureFlags = {})); var NodeConstructor; var TokenConstructor; var IdentifierConstructor; @@ -11367,11 +12406,31 @@ var ts; var node = parseTokenNode(); return token() === 23 ? undefined : node; } - function parseLiteralTypeNode() { + function parseLiteralTypeNode(negative) { var node = createNode(173); - node.literal = parseSimpleUnaryExpression(); - finishNode(node); - return node; + var unaryMinusExpression; + if (negative) { + unaryMinusExpression = createNode(192); + unaryMinusExpression.operator = 38; + nextToken(); + } + var expression; + switch (token()) { + case 9: + case 8: + expression = parseLiteralLikeNode(token()); + break; + case 101: + case 86: + expression = parseTokenNode(); + } + if (negative) { + unaryMinusExpression.operand = expression; + finishNode(unaryMinusExpression); + expression = unaryMinusExpression; + } + node.literal = expression; + return finishNode(node); } function nextTokenIsNumericLiteral() { return nextToken() === 8; @@ -11403,7 +12462,7 @@ var ts; case 86: return parseLiteralTypeNode(); case 38: - return lookAhead(nextTokenIsNumericLiteral) ? parseLiteralTypeNode() : parseTypeReference(); + return lookAhead(nextTokenIsNumericLiteral) ? parseLiteralTypeNode(true) : parseTypeReference(); case 105: case 95: return parseTokenNode(); @@ -11452,6 +12511,7 @@ var ts; case 101: case 86: case 134: + case 39: return true; case 38: return lookAhead(nextTokenIsNumericLiteral); @@ -11770,7 +12830,7 @@ var ts; if (!arrowFunction) { return undefined; } - var isAsync = !!(ts.getModifierFlags(arrowFunction) & 256); + var isAsync = ts.hasModifier(arrowFunction, 256); var lastToken = token(); arrowFunction.equalsGreaterThanToken = parseExpectedToken(36, false, ts.Diagnostics._0_expected, "=>"); arrowFunction.body = (lastToken === 36 || lastToken === 17) @@ -11886,7 +12946,7 @@ var ts; function parseParenthesizedArrowFunctionExpressionHead(allowAmbiguity) { var node = createNode(187); node.modifiers = parseModifiersForArrowFunction(); - var isAsync = (ts.getModifierFlags(node) & 256) ? 2 : 0; + var isAsync = ts.hasModifier(node, 256) ? 2 : 0; fillSignature(56, isAsync | (allowAmbiguity ? 0 : 8), node); if (!node.parameters) { return undefined; @@ -12619,7 +13679,7 @@ var ts; parseExpected(89); node.asteriskToken = parseOptionalToken(39); var isGenerator = node.asteriskToken ? 1 : 0; - var isAsync = (ts.getModifierFlags(node) & 256) ? 2 : 0; + var isAsync = ts.hasModifier(node, 256) ? 2 : 0; node.name = isGenerator && isAsync ? doInYieldAndAwaitContext(parseOptionalIdentifier) : isGenerator ? doInYieldContext(parseOptionalIdentifier) : @@ -12844,10 +13904,13 @@ var ts; function parseCatchClause() { var result = createNode(260); parseExpected(74); - if (parseExpected(19)) { + if (parseOptional(19)) { result.variableDeclaration = parseVariableDeclaration(); + parseExpected(20); + } + else { + result.variableDeclaration = undefined; } - parseExpected(20); result.block = parseBlock(false); return finishNode(result); } @@ -13851,6 +14914,39 @@ var ts; : undefined; }); } + var ParsingContext; + (function (ParsingContext) { + ParsingContext[ParsingContext["SourceElements"] = 0] = "SourceElements"; + ParsingContext[ParsingContext["BlockStatements"] = 1] = "BlockStatements"; + ParsingContext[ParsingContext["SwitchClauses"] = 2] = "SwitchClauses"; + ParsingContext[ParsingContext["SwitchClauseStatements"] = 3] = "SwitchClauseStatements"; + ParsingContext[ParsingContext["TypeMembers"] = 4] = "TypeMembers"; + ParsingContext[ParsingContext["ClassMembers"] = 5] = "ClassMembers"; + ParsingContext[ParsingContext["EnumMembers"] = 6] = "EnumMembers"; + ParsingContext[ParsingContext["HeritageClauseElement"] = 7] = "HeritageClauseElement"; + ParsingContext[ParsingContext["VariableDeclarations"] = 8] = "VariableDeclarations"; + ParsingContext[ParsingContext["ObjectBindingElements"] = 9] = "ObjectBindingElements"; + ParsingContext[ParsingContext["ArrayBindingElements"] = 10] = "ArrayBindingElements"; + ParsingContext[ParsingContext["ArgumentExpressions"] = 11] = "ArgumentExpressions"; + ParsingContext[ParsingContext["ObjectLiteralMembers"] = 12] = "ObjectLiteralMembers"; + ParsingContext[ParsingContext["JsxAttributes"] = 13] = "JsxAttributes"; + ParsingContext[ParsingContext["JsxChildren"] = 14] = "JsxChildren"; + ParsingContext[ParsingContext["ArrayLiteralMembers"] = 15] = "ArrayLiteralMembers"; + ParsingContext[ParsingContext["Parameters"] = 16] = "Parameters"; + ParsingContext[ParsingContext["RestProperties"] = 17] = "RestProperties"; + ParsingContext[ParsingContext["TypeParameters"] = 18] = "TypeParameters"; + ParsingContext[ParsingContext["TypeArguments"] = 19] = "TypeArguments"; + ParsingContext[ParsingContext["TupleElementTypes"] = 20] = "TupleElementTypes"; + ParsingContext[ParsingContext["HeritageClauses"] = 21] = "HeritageClauses"; + ParsingContext[ParsingContext["ImportOrExportSpecifiers"] = 22] = "ImportOrExportSpecifiers"; + ParsingContext[ParsingContext["Count"] = 23] = "Count"; + })(ParsingContext || (ParsingContext = {})); + var Tristate; + (function (Tristate) { + Tristate[Tristate["False"] = 0] = "False"; + Tristate[Tristate["True"] = 1] = "True"; + Tristate[Tristate["Unknown"] = 2] = "Unknown"; + })(Tristate || (Tristate = {})); var JSDocParser; (function (JSDocParser) { function parseJSDocTypeExpressionForTests(content, start, length) { @@ -13903,6 +14999,17 @@ var ts; var _a; } JSDocParser.parseJSDocComment = parseJSDocComment; + var JSDocState; + (function (JSDocState) { + JSDocState[JSDocState["BeginningOfLine"] = 0] = "BeginningOfLine"; + JSDocState[JSDocState["SawAsterisk"] = 1] = "SawAsterisk"; + JSDocState[JSDocState["SavingComments"] = 2] = "SavingComments"; + })(JSDocState || (JSDocState = {})); + var PropertyLikeParse; + (function (PropertyLikeParse) { + PropertyLikeParse[PropertyLikeParse["Property"] = 0] = "Property"; + PropertyLikeParse[PropertyLikeParse["Parameter"] = 1] = "Parameter"; + })(PropertyLikeParse || (PropertyLikeParse = {})); function parseJSDocCommentWorker(start, length) { var content = sourceText; start = start || 0; @@ -14535,8 +15642,8 @@ var ts; array._children = undefined; array.pos += delta; array.end += delta; - for (var _i = 0, array_9 = array; _i < array_9.length; _i++) { - var node = array_9[_i]; + for (var _i = 0, array_8 = array; _i < array_8.length; _i++) { + var node = array_8[_i]; visitNode(node); } } @@ -14608,8 +15715,8 @@ var ts; array.intersectsChange = true; array._children = undefined; adjustIntersectingElement(array, changeStart, changeRangeOldEnd, changeRangeNewEnd, delta); - for (var _i = 0, array_10 = array; _i < array_10.length; _i++) { - var node = array_10[_i]; + for (var _i = 0, array_9 = array; _i < array_9.length; _i++) { + var node = array_9[_i]; visitNode(node); } return; @@ -14757,10 +15864,20 @@ var ts; } } } + var InvalidPosition; + (function (InvalidPosition) { + InvalidPosition[InvalidPosition["Value"] = -1] = "Value"; + })(InvalidPosition || (InvalidPosition = {})); })(IncrementalParser || (IncrementalParser = {})); })(ts || (ts = {})); var ts; (function (ts) { + var ModuleInstanceState; + (function (ModuleInstanceState) { + ModuleInstanceState[ModuleInstanceState["NonInstantiated"] = 0] = "NonInstantiated"; + ModuleInstanceState[ModuleInstanceState["Instantiated"] = 1] = "Instantiated"; + ModuleInstanceState[ModuleInstanceState["ConstEnumOnly"] = 2] = "ConstEnumOnly"; + })(ModuleInstanceState = ts.ModuleInstanceState || (ts.ModuleInstanceState = {})); function getModuleInstanceState(node) { if (node.kind === 230 || node.kind === 231) { return 0; @@ -14799,6 +15916,18 @@ var ts; } } ts.getModuleInstanceState = getModuleInstanceState; + var ContainerFlags; + (function (ContainerFlags) { + ContainerFlags[ContainerFlags["None"] = 0] = "None"; + ContainerFlags[ContainerFlags["IsContainer"] = 1] = "IsContainer"; + ContainerFlags[ContainerFlags["IsBlockScopedContainer"] = 2] = "IsBlockScopedContainer"; + ContainerFlags[ContainerFlags["IsControlFlowContainer"] = 4] = "IsControlFlowContainer"; + ContainerFlags[ContainerFlags["IsFunctionLike"] = 8] = "IsFunctionLike"; + ContainerFlags[ContainerFlags["IsFunctionExpression"] = 16] = "IsFunctionExpression"; + ContainerFlags[ContainerFlags["HasLocals"] = 32] = "HasLocals"; + ContainerFlags[ContainerFlags["IsInterface"] = 64] = "IsInterface"; + ContainerFlags[ContainerFlags["IsObjectLiteralOrClassExpressionMethod"] = 128] = "IsObjectLiteralOrClassExpressionMethod"; + })(ContainerFlags || (ContainerFlags = {})); var binder = createBinder(); function bindSourceFile(file, options) { ts.performance.mark("beforeBind"); @@ -15359,40 +16488,23 @@ var ts; return antecedent; } setFlowNodeReferenced(antecedent); - return { - flags: flags, - expression: expression, - antecedent: antecedent - }; + return { flags: flags, expression: expression, antecedent: antecedent }; } function createFlowSwitchClause(antecedent, switchStatement, clauseStart, clauseEnd) { if (!isNarrowingExpression(switchStatement.expression)) { return antecedent; } setFlowNodeReferenced(antecedent); - return { - flags: 128, - switchStatement: switchStatement, - clauseStart: clauseStart, - clauseEnd: clauseEnd, - antecedent: antecedent - }; + return { flags: 128, switchStatement: switchStatement, clauseStart: clauseStart, clauseEnd: clauseEnd, antecedent: antecedent }; } function createFlowAssignment(antecedent, node) { setFlowNodeReferenced(antecedent); - return { - flags: 16, - antecedent: antecedent, - node: node - }; + return { flags: 16, antecedent: antecedent, node: node }; } function createFlowArrayMutation(antecedent, node) { setFlowNodeReferenced(antecedent); - return { - flags: 256, - antecedent: antecedent, - node: node - }; + var res = { flags: 256, antecedent: antecedent, node: node }; + return res; } function finishFlowLabel(flow) { var antecedents = flow.antecedents; @@ -16045,6 +17157,11 @@ var ts; typeLiteralSymbol.members.set(symbol.escapedName, symbol); } function bindObjectLiteralExpression(node) { + var ElementKind; + (function (ElementKind) { + ElementKind[ElementKind["Property"] = 1] = "Property"; + ElementKind[ElementKind["Accessor"] = 2] = "Accessor"; + })(ElementKind || (ElementKind = {})); if (inStrictMode) { var seen = ts.createUnderscoreEscapedMap(); for (var _i = 0, _a = node.properties; _i < _a.length; _i++) { @@ -16855,7 +17972,6 @@ var ts; } function computeParameter(node, subtreeFlags) { var transformFlags = subtreeFlags; - var modifierFlags = ts.getModifierFlags(node); var name = node.name; var initializer = node.initializer; var dotDotDotToken = node.dotDotDotToken; @@ -16865,7 +17981,7 @@ var ts; || ts.isThisIdentifier(name)) { transformFlags |= 3; } - if (modifierFlags & 92) { + if (ts.hasModifier(node, 92)) { transformFlags |= 3 | 262144; } if (subtreeFlags & 1048576) { @@ -16894,8 +18010,7 @@ var ts; } function computeClassDeclaration(node, subtreeFlags) { var transformFlags; - var modifierFlags = ts.getModifierFlags(node); - if (modifierFlags & 2) { + if (ts.hasModifier(node, 2)) { transformFlags = 3; } else { @@ -16941,7 +18056,10 @@ var ts; } function computeCatchClause(node, subtreeFlags) { var transformFlags = subtreeFlags; - if (node.variableDeclaration && ts.isBindingPattern(node.variableDeclaration.name)) { + if (!node.variableDeclaration) { + transformFlags |= 8; + } + else if (ts.isBindingPattern(node.variableDeclaration.name)) { transformFlags |= 192; } node.transformFlags = transformFlags | 536870912; @@ -17105,9 +18223,8 @@ var ts; } function computeVariableStatement(node, subtreeFlags) { var transformFlags; - var modifierFlags = ts.getModifierFlags(node); var declarationListTransformFlags = node.declarationList.transformFlags; - if (modifierFlags & 2) { + if (ts.hasModifier(node, 2)) { transformFlags = 3; } else { @@ -17406,6 +18523,167 @@ var ts; } })(ts || (ts = {})); var ts; +(function (ts) { + function createGetSymbolWalker(getRestTypeOfSignature, getReturnTypeOfSignature, getBaseTypes, resolveStructuredTypeMembers, getTypeOfSymbol, getResolvedSymbol, getIndexTypeOfStructuredType, getConstraintFromTypeParameter, getFirstIdentifier) { + return getSymbolWalker; + function getSymbolWalker(accept) { + if (accept === void 0) { accept = function () { return true; }; } + var visitedTypes = ts.createMap(); + var visitedSymbols = ts.createMap(); + return { + walkType: function (type) { + visitedTypes.clear(); + visitedSymbols.clear(); + visitType(type); + return { visitedTypes: ts.arrayFrom(visitedTypes.values()), visitedSymbols: ts.arrayFrom(visitedSymbols.values()) }; + }, + walkSymbol: function (symbol) { + visitedTypes.clear(); + visitedSymbols.clear(); + visitSymbol(symbol); + return { visitedTypes: ts.arrayFrom(visitedTypes.values()), visitedSymbols: ts.arrayFrom(visitedSymbols.values()) }; + }, + }; + function visitType(type) { + if (!type) { + return; + } + var typeIdString = type.id.toString(); + if (visitedTypes.has(typeIdString)) { + return; + } + visitedTypes.set(typeIdString, type); + var shouldBail = visitSymbol(type.symbol); + if (shouldBail) + return; + if (type.flags & 32768) { + var objectType = type; + var objectFlags = objectType.objectFlags; + if (objectFlags & 4) { + visitTypeReference(type); + } + if (objectFlags & 32) { + visitMappedType(type); + } + if (objectFlags & (1 | 2)) { + visitInterfaceType(type); + } + if (objectFlags & (8 | 16)) { + visitObjectType(objectType); + } + } + if (type.flags & 16384) { + visitTypeParameter(type); + } + if (type.flags & 196608) { + visitUnionOrIntersectionType(type); + } + if (type.flags & 262144) { + visitIndexType(type); + } + if (type.flags & 524288) { + visitIndexedAccessType(type); + } + } + function visitTypeList(types) { + if (!types) { + return; + } + for (var i = 0; i < types.length; i++) { + visitType(types[i]); + } + } + function visitTypeReference(type) { + visitType(type.target); + visitTypeList(type.typeArguments); + } + function visitTypeParameter(type) { + visitType(getConstraintFromTypeParameter(type)); + } + function visitUnionOrIntersectionType(type) { + visitTypeList(type.types); + } + function visitIndexType(type) { + visitType(type.type); + } + function visitIndexedAccessType(type) { + visitType(type.objectType); + visitType(type.indexType); + visitType(type.constraint); + } + function visitMappedType(type) { + visitType(type.typeParameter); + visitType(type.constraintType); + visitType(type.templateType); + visitType(type.modifiersType); + } + function visitSignature(signature) { + if (signature.typePredicate) { + visitType(signature.typePredicate.type); + } + visitTypeList(signature.typeParameters); + for (var _i = 0, _a = signature.parameters; _i < _a.length; _i++) { + var parameter = _a[_i]; + visitSymbol(parameter); + } + visitType(getRestTypeOfSignature(signature)); + visitType(getReturnTypeOfSignature(signature)); + } + function visitInterfaceType(interfaceT) { + visitObjectType(interfaceT); + visitTypeList(interfaceT.typeParameters); + visitTypeList(getBaseTypes(interfaceT)); + visitType(interfaceT.thisType); + } + function visitObjectType(type) { + var stringIndexType = getIndexTypeOfStructuredType(type, 0); + visitType(stringIndexType); + var numberIndexType = getIndexTypeOfStructuredType(type, 1); + visitType(numberIndexType); + var resolved = resolveStructuredTypeMembers(type); + for (var _i = 0, _a = resolved.callSignatures; _i < _a.length; _i++) { + var signature = _a[_i]; + visitSignature(signature); + } + for (var _b = 0, _c = resolved.constructSignatures; _b < _c.length; _b++) { + var signature = _c[_b]; + visitSignature(signature); + } + for (var _d = 0, _e = resolved.properties; _d < _e.length; _d++) { + var p = _e[_d]; + visitSymbol(p); + } + } + function visitSymbol(symbol) { + if (!symbol) { + return; + } + var symbolIdString = ts.getSymbolId(symbol).toString(); + if (visitedSymbols.has(symbolIdString)) { + return; + } + visitedSymbols.set(symbolIdString, symbol); + if (!accept(symbol)) { + return true; + } + var t = getTypeOfSymbol(symbol); + visitType(t); + if (symbol.flags & 1952) { + symbol.exports.forEach(visitSymbol); + } + ts.forEach(symbol.declarations, function (d) { + if (d.type && d.type.kind === 162) { + var query = d.type; + var entity = getResolvedSymbol(getFirstIdentifier(query.exprName)); + visitSymbol(entity); + } + }); + } + } + } + ts.createGetSymbolWalker = createGetSymbolWalker; +})(ts || (ts = {})); +var ts; (function (ts) { function trace(host) { host.trace(ts.formatMessage.apply(undefined, arguments)); @@ -17415,6 +18693,12 @@ var ts; return compilerOptions.traceResolution && host.trace !== undefined; } ts.isTraceEnabled = isTraceEnabled; + function withPackageId(packageId, r) { + return r && { path: r.path, extension: r.ext, packageId: packageId }; + } + function noPackageId(r) { + return withPackageId(undefined, r); + } var Extensions; (function (Extensions) { Extensions[Extensions["TypeScript"] = 0] = "TypeScript"; @@ -17430,12 +18714,11 @@ var ts; } function createResolvedModuleWithFailedLookupLocations(resolved, isExternalLibraryImport, failedLookupLocations) { return { - resolvedModule: resolved && { resolvedFileName: resolved.path, extension: resolved.extension, isExternalLibraryImport: isExternalLibraryImport }, + resolvedModule: resolved && { resolvedFileName: resolved.path, extension: resolved.extension, isExternalLibraryImport: isExternalLibraryImport, packageId: resolved.packageId }, failedLookupLocations: failedLookupLocations }; } - function tryReadPackageJsonFields(readTypes, packageJsonPath, baseDirectory, state) { - var jsonContent = readJson(packageJsonPath, state.host); + function tryReadPackageJsonFields(readTypes, jsonContent, baseDirectory, state) { return readTypes ? tryReadFromField("typings") || tryReadFromField("types") : tryReadFromField("main"); function tryReadFromField(fieldName) { if (!ts.hasProperty(jsonContent, fieldName)) { @@ -17529,7 +18812,9 @@ var ts; } var resolvedTypeReferenceDirective; if (resolved) { - resolved = realpath(resolved, host, traceEnabled); + if (!options.preserveSymlinks) { + resolved = realPath(resolved, host, traceEnabled); + } if (traceEnabled) { trace(host, ts.Diagnostics.Type_reference_directive_0_was_successfully_resolved_to_1_primary_Colon_2, typeReferenceDirectiveName, resolved, primary); } @@ -17830,7 +19115,7 @@ var ts; if (extension !== undefined) { var path_1 = tryFile(candidate, failedLookupLocations, false, state); if (path_1 !== undefined) { - return { path: path_1, extension: extension }; + return { path: path_1, extension: extension, packageId: undefined }; } } return loader(extensions, candidate, failedLookupLocations, !directoryProbablyExists(ts.getDirectoryPath(candidate), state.host), state); @@ -17851,7 +19136,7 @@ var ts; function resolveJavaScriptModule(moduleName, initialDir, host) { var _a = nodeModuleNameResolverWorker(moduleName, initialDir, { moduleResolution: ts.ModuleResolutionKind.NodeJs, allowJs: true }, host, undefined, true), resolvedModule = _a.resolvedModule, failedLookupLocations = _a.failedLookupLocations; if (!resolvedModule) { - throw new Error("Could not resolve JS module " + moduleName + " starting at " + initialDir + ". Looked in: " + failedLookupLocations.join(", ")); + throw new Error("Could not resolve JS module '" + moduleName + "' starting at '" + initialDir + "'. Looked in: " + failedLookupLocations.join(", ")); } return resolvedModule.resolvedFileName; } @@ -17877,16 +19162,22 @@ var ts; trace(host, ts.Diagnostics.Loading_module_0_from_node_modules_folder_target_file_type_1, moduleName, Extensions[extensions]); } var resolved_1 = loadModuleFromNodeModules(extensions, moduleName, containingDirectory, failedLookupLocations, state, cache); - return resolved_1 && { value: resolved_1.value && { resolved: { path: realpath(resolved_1.value.path, host, traceEnabled), extension: resolved_1.value.extension }, isExternalLibraryImport: true } }; + if (!resolved_1) + return undefined; + var resolvedValue = resolved_1.value; + if (!compilerOptions.preserveSymlinks) { + resolvedValue = resolvedValue && __assign({}, resolved_1.value, { path: realPath(resolved_1.value.path, host, traceEnabled), extension: resolved_1.value.extension }); + } + return { value: resolvedValue && { resolved: resolvedValue, isExternalLibraryImport: true } }; } else { - var candidate = ts.normalizePath(ts.combinePaths(containingDirectory, moduleName)); + var _a = ts.normalizePathAndParts(ts.combinePaths(containingDirectory, moduleName)), candidate = _a.path, parts = _a.parts; var resolved_2 = nodeLoadModuleByRelativeName(extensions, candidate, failedLookupLocations, false, state, true); - return resolved_2 && toSearchResult({ resolved: resolved_2, isExternalLibraryImport: false }); + return resolved_2 && toSearchResult({ resolved: resolved_2, isExternalLibraryImport: ts.contains(parts, "node_modules") }); } } } - function realpath(path, host, traceEnabled) { + function realPath(path, host, traceEnabled) { if (!host.realpath) { return path; } @@ -17912,7 +19203,7 @@ var ts; } var resolvedFromFile = loadModuleFromFile(extensions, candidate, failedLookupLocations, onlyRecordFailures, state); if (resolvedFromFile) { - return resolvedFromFile; + return noPackageId(resolvedFromFile); } } if (!onlyRecordFailures) { @@ -17930,6 +19221,9 @@ var ts; return !host.directoryExists || host.directoryExists(directoryName); } ts.directoryProbablyExists = directoryProbablyExists; + function loadModuleFromFileNoPackageId(extensions, candidate, failedLookupLocations, onlyRecordFailures, state) { + return noPackageId(loadModuleFromFile(extensions, candidate, failedLookupLocations, onlyRecordFailures, state)); + } function loadModuleFromFile(extensions, candidate, failedLookupLocations, onlyRecordFailures, state) { var resolvedByAddingExtension = tryAddingExtensions(candidate, extensions, failedLookupLocations, onlyRecordFailures, state); if (resolvedByAddingExtension) { @@ -17959,9 +19253,9 @@ var ts; case Extensions.JavaScript: return tryExtension(".js") || tryExtension(".jsx"); } - function tryExtension(extension) { - var path = tryFile(candidate + extension, failedLookupLocations, onlyRecordFailures, state); - return path && { path: path, extension: extension }; + function tryExtension(ext) { + var path = tryFile(candidate + ext, failedLookupLocations, onlyRecordFailures, state); + return path && { path: path, ext: ext }; } } function tryFile(fileName, failedLookupLocations, onlyRecordFailures, state) { @@ -17984,12 +19278,20 @@ var ts; function loadNodeModuleFromDirectory(extensions, candidate, failedLookupLocations, onlyRecordFailures, state, considerPackageJson) { if (considerPackageJson === void 0) { considerPackageJson = true; } var directoryExists = !onlyRecordFailures && directoryProbablyExists(candidate, state.host); + var packageId; if (considerPackageJson) { var packageJsonPath = pathToPackageJson(candidate); if (directoryExists && state.host.fileExists(packageJsonPath)) { - var fromPackageJson = loadModuleFromPackageJson(packageJsonPath, extensions, candidate, failedLookupLocations, state); + if (state.traceEnabled) { + trace(state.host, ts.Diagnostics.Found_package_json_at_0, packageJsonPath); + } + var jsonContent = readJson(packageJsonPath, state.host); + if (typeof jsonContent.name === "string" && typeof jsonContent.version === "string") { + packageId = { name: jsonContent.name, version: jsonContent.version }; + } + var fromPackageJson = loadModuleFromPackageJson(jsonContent, extensions, candidate, failedLookupLocations, state); if (fromPackageJson) { - return fromPackageJson; + return withPackageId(packageId, fromPackageJson); } } else { @@ -17999,13 +19301,10 @@ var ts; failedLookupLocations.push(packageJsonPath); } } - return loadModuleFromFile(extensions, ts.combinePaths(candidate, "index"), failedLookupLocations, !directoryExists, state); + return withPackageId(packageId, loadModuleFromFile(extensions, ts.combinePaths(candidate, "index"), failedLookupLocations, !directoryExists, state)); } - function loadModuleFromPackageJson(packageJsonPath, extensions, candidate, failedLookupLocations, state) { - if (state.traceEnabled) { - trace(state.host, ts.Diagnostics.Found_package_json_at_0, packageJsonPath); - } - var file = tryReadPackageJsonFields(extensions !== Extensions.JavaScript, packageJsonPath, candidate, state); + function loadModuleFromPackageJson(jsonContent, extensions, candidate, failedLookupLocations, state) { + var file = tryReadPackageJsonFields(extensions !== Extensions.JavaScript, jsonContent, candidate, state); if (!file) { return undefined; } @@ -18021,11 +19320,15 @@ var ts; } } var nextExtensions = extensions === Extensions.DtsOnly ? Extensions.TypeScript : extensions; - return nodeLoadModuleByRelativeName(nextExtensions, file, failedLookupLocations, onlyRecordFailures, state, false); + var result = nodeLoadModuleByRelativeName(nextExtensions, file, failedLookupLocations, onlyRecordFailures, state, false); + if (result) { + ts.Debug.assert(result.packageId === undefined); + return { path: result.path, ext: result.extension }; + } } function resolvedIfExtensionMatches(extensions, path) { - var extension = ts.tryGetExtensionFromPath(path); - return extension !== undefined && extensionIsOk(extensions, extension) ? { path: path, extension: extension } : undefined; + var ext = ts.tryGetExtensionFromPath(path); + return ext !== undefined && extensionIsOk(extensions, ext) ? { path: path, ext: ext } : undefined; } function extensionIsOk(extensions, extension) { switch (extensions) { @@ -18042,7 +19345,7 @@ var ts; } function loadModuleFromNodeModulesFolder(extensions, moduleName, nodeModulesFolder, nodeModulesFolderExists, failedLookupLocations, state) { var candidate = ts.normalizePath(ts.combinePaths(nodeModulesFolder, moduleName)); - return loadModuleFromFile(extensions, candidate, failedLookupLocations, !nodeModulesFolderExists, state) || + return loadModuleFromFileNoPackageId(extensions, candidate, failedLookupLocations, !nodeModulesFolderExists, state) || loadNodeModuleFromDirectory(extensions, candidate, failedLookupLocations, !nodeModulesFolderExists, state); } function loadModuleFromNodeModules(extensions, moduleName, directory, failedLookupLocations, state, cache) { @@ -18116,7 +19419,7 @@ var ts; if (traceEnabled) { trace(host, ts.Diagnostics.Resolution_for_module_0_was_found_in_cache, moduleName); } - return { value: result.resolvedModule && { path: result.resolvedModule.resolvedFileName, extension: result.resolvedModule.extension } }; + return { value: result.resolvedModule && { path: result.resolvedModule.resolvedFileName, extension: result.resolvedModule.extension, packageId: result.resolvedModule.packageId } }; } } function classicNameResolver(moduleName, containingFile, compilerOptions, host, cache) { @@ -18127,7 +19430,7 @@ var ts; var resolved = tryResolve(Extensions.TypeScript) || tryResolve(Extensions.JavaScript); return createResolvedModuleWithFailedLookupLocations(resolved && resolved.value, false, failedLookupLocations); function tryResolve(extensions) { - var resolvedUsingSettings = tryLoadModuleUsingOptionalResolutionSettings(extensions, moduleName, containingDirectory, loadModuleFromFile, failedLookupLocations, state); + var resolvedUsingSettings = tryLoadModuleUsingOptionalResolutionSettings(extensions, moduleName, containingDirectory, loadModuleFromFileNoPackageId, failedLookupLocations, state); if (resolvedUsingSettings) { return { value: resolvedUsingSettings }; } @@ -18139,7 +19442,7 @@ var ts; return resolutionFromCache; } var searchName = ts.normalizePath(ts.combinePaths(directory, moduleName)); - return toSearchResult(loadModuleFromFile(extensions, searchName, failedLookupLocations, false, state)); + return toSearchResult(loadModuleFromFileNoPackageId(extensions, searchName, failedLookupLocations, false, state)); }); if (resolved_3) { return resolved_3; @@ -18150,7 +19453,7 @@ var ts; } else { var candidate = ts.normalizePath(ts.combinePaths(containingDirectory, moduleName)); - return toSearchResult(loadModuleFromFile(extensions, candidate, failedLookupLocations, false, state)); + return toSearchResult(loadModuleFromFileNoPackageId(extensions, candidate, failedLookupLocations, false, state)); } } } @@ -18294,6 +19597,9 @@ var ts; node = ts.getParseTreeNode(node, ts.isExportSpecifier); return node ? getExportSpecifierLocalTargetSymbol(node) : undefined; }, + getExportSymbolOfSymbol: function (symbol) { + return getMergedSymbol(symbol.exportSymbol || symbol); + }, getTypeAtLocation: function (node) { node = ts.getParseTreeNode(node); return node ? getTypeOfNode(node) : unknownType; @@ -18356,6 +19662,7 @@ var ts; getEmitResolver: getEmitResolver, getExportsOfModule: getExportsOfModuleAsArray, getExportsAndPropertiesOfModule: getExportsAndPropertiesOfModule, + getSymbolWalker: ts.createGetSymbolWalker(getRestTypeOfSignature, getReturnTypeOfSignature, getBaseTypes, resolveStructuredTypeMembers, getTypeOfSymbol, getResolvedSymbol, getIndexTypeOfStructuredType, getConstraintFromTypeParameter, getFirstIdentifier), getAmbientModules: getAmbientModules, getAllAttributesTypeFromJsxOpeningLikeElement: function (node) { node = ts.getParseTreeNode(node, ts.isJsxOpeningLikeElement); @@ -18376,11 +19683,10 @@ var ts; getSuggestionForNonexistentProperty: function (node, type) { return ts.unescapeLeadingUnderscores(getSuggestionForNonexistentProperty(node, type)); }, getSuggestionForNonexistentSymbol: function (location, name, meaning) { return ts.unescapeLeadingUnderscores(getSuggestionForNonexistentSymbol(location, ts.escapeLeadingUnderscores(name), meaning)); }, getBaseConstraintOfType: getBaseConstraintOfType, - getJsxNamespace: function () { return ts.unescapeLeadingUnderscores(getJsxNamespace()); }, - resolveNameAtLocation: function (location, name, meaning) { - location = ts.getParseTreeNode(location); - return resolveName(location, ts.escapeLeadingUnderscores(name), meaning, undefined, ts.escapeLeadingUnderscores(name)); + resolveName: function (name, location, meaning) { + return resolveName(location, ts.escapeLeadingUnderscores(name), meaning, undefined, undefined); }, + getJsxNamespace: function () { return ts.unescapeLeadingUnderscores(getJsxNamespace()); }, }; var tupleTypes = []; var unionTypes = ts.createMap(); @@ -18478,6 +19784,66 @@ var ts; var potentialNewTargetCollisions = []; var awaitedTypeStack = []; var diagnostics = ts.createDiagnosticCollection(); + var TypeFacts; + (function (TypeFacts) { + TypeFacts[TypeFacts["None"] = 0] = "None"; + TypeFacts[TypeFacts["TypeofEQString"] = 1] = "TypeofEQString"; + TypeFacts[TypeFacts["TypeofEQNumber"] = 2] = "TypeofEQNumber"; + TypeFacts[TypeFacts["TypeofEQBoolean"] = 4] = "TypeofEQBoolean"; + TypeFacts[TypeFacts["TypeofEQSymbol"] = 8] = "TypeofEQSymbol"; + TypeFacts[TypeFacts["TypeofEQObject"] = 16] = "TypeofEQObject"; + TypeFacts[TypeFacts["TypeofEQFunction"] = 32] = "TypeofEQFunction"; + TypeFacts[TypeFacts["TypeofEQHostObject"] = 64] = "TypeofEQHostObject"; + TypeFacts[TypeFacts["TypeofNEString"] = 128] = "TypeofNEString"; + TypeFacts[TypeFacts["TypeofNENumber"] = 256] = "TypeofNENumber"; + TypeFacts[TypeFacts["TypeofNEBoolean"] = 512] = "TypeofNEBoolean"; + TypeFacts[TypeFacts["TypeofNESymbol"] = 1024] = "TypeofNESymbol"; + TypeFacts[TypeFacts["TypeofNEObject"] = 2048] = "TypeofNEObject"; + TypeFacts[TypeFacts["TypeofNEFunction"] = 4096] = "TypeofNEFunction"; + TypeFacts[TypeFacts["TypeofNEHostObject"] = 8192] = "TypeofNEHostObject"; + TypeFacts[TypeFacts["EQUndefined"] = 16384] = "EQUndefined"; + TypeFacts[TypeFacts["EQNull"] = 32768] = "EQNull"; + TypeFacts[TypeFacts["EQUndefinedOrNull"] = 65536] = "EQUndefinedOrNull"; + TypeFacts[TypeFacts["NEUndefined"] = 131072] = "NEUndefined"; + TypeFacts[TypeFacts["NENull"] = 262144] = "NENull"; + TypeFacts[TypeFacts["NEUndefinedOrNull"] = 524288] = "NEUndefinedOrNull"; + TypeFacts[TypeFacts["Truthy"] = 1048576] = "Truthy"; + TypeFacts[TypeFacts["Falsy"] = 2097152] = "Falsy"; + TypeFacts[TypeFacts["Discriminatable"] = 4194304] = "Discriminatable"; + TypeFacts[TypeFacts["All"] = 8388607] = "All"; + TypeFacts[TypeFacts["BaseStringStrictFacts"] = 933633] = "BaseStringStrictFacts"; + TypeFacts[TypeFacts["BaseStringFacts"] = 3145473] = "BaseStringFacts"; + TypeFacts[TypeFacts["StringStrictFacts"] = 4079361] = "StringStrictFacts"; + TypeFacts[TypeFacts["StringFacts"] = 4194049] = "StringFacts"; + TypeFacts[TypeFacts["EmptyStringStrictFacts"] = 3030785] = "EmptyStringStrictFacts"; + TypeFacts[TypeFacts["EmptyStringFacts"] = 3145473] = "EmptyStringFacts"; + TypeFacts[TypeFacts["NonEmptyStringStrictFacts"] = 1982209] = "NonEmptyStringStrictFacts"; + TypeFacts[TypeFacts["NonEmptyStringFacts"] = 4194049] = "NonEmptyStringFacts"; + TypeFacts[TypeFacts["BaseNumberStrictFacts"] = 933506] = "BaseNumberStrictFacts"; + TypeFacts[TypeFacts["BaseNumberFacts"] = 3145346] = "BaseNumberFacts"; + TypeFacts[TypeFacts["NumberStrictFacts"] = 4079234] = "NumberStrictFacts"; + TypeFacts[TypeFacts["NumberFacts"] = 4193922] = "NumberFacts"; + TypeFacts[TypeFacts["ZeroStrictFacts"] = 3030658] = "ZeroStrictFacts"; + TypeFacts[TypeFacts["ZeroFacts"] = 3145346] = "ZeroFacts"; + TypeFacts[TypeFacts["NonZeroStrictFacts"] = 1982082] = "NonZeroStrictFacts"; + TypeFacts[TypeFacts["NonZeroFacts"] = 4193922] = "NonZeroFacts"; + TypeFacts[TypeFacts["BaseBooleanStrictFacts"] = 933252] = "BaseBooleanStrictFacts"; + TypeFacts[TypeFacts["BaseBooleanFacts"] = 3145092] = "BaseBooleanFacts"; + TypeFacts[TypeFacts["BooleanStrictFacts"] = 4078980] = "BooleanStrictFacts"; + TypeFacts[TypeFacts["BooleanFacts"] = 4193668] = "BooleanFacts"; + TypeFacts[TypeFacts["FalseStrictFacts"] = 3030404] = "FalseStrictFacts"; + TypeFacts[TypeFacts["FalseFacts"] = 3145092] = "FalseFacts"; + TypeFacts[TypeFacts["TrueStrictFacts"] = 1981828] = "TrueStrictFacts"; + TypeFacts[TypeFacts["TrueFacts"] = 4193668] = "TrueFacts"; + TypeFacts[TypeFacts["SymbolStrictFacts"] = 1981320] = "SymbolStrictFacts"; + TypeFacts[TypeFacts["SymbolFacts"] = 4193160] = "SymbolFacts"; + TypeFacts[TypeFacts["ObjectStrictFacts"] = 6166480] = "ObjectStrictFacts"; + TypeFacts[TypeFacts["ObjectFacts"] = 8378320] = "ObjectFacts"; + TypeFacts[TypeFacts["FunctionStrictFacts"] = 6164448] = "FunctionStrictFacts"; + TypeFacts[TypeFacts["FunctionFacts"] = 8376288] = "FunctionFacts"; + TypeFacts[TypeFacts["UndefinedFacts"] = 2457472] = "UndefinedFacts"; + TypeFacts[TypeFacts["NullFacts"] = 2340752] = "NullFacts"; + })(TypeFacts || (TypeFacts = {})); var typeofEQFacts = ts.createMapFromTemplate({ "string": 1, "number": 2, @@ -18527,6 +19893,19 @@ var ts; var identityRelation = ts.createMap(); var enumRelation = ts.createMap(); var _displayBuilder; + var TypeSystemPropertyName; + (function (TypeSystemPropertyName) { + TypeSystemPropertyName[TypeSystemPropertyName["Type"] = 0] = "Type"; + TypeSystemPropertyName[TypeSystemPropertyName["ResolvedBaseConstructorType"] = 1] = "ResolvedBaseConstructorType"; + TypeSystemPropertyName[TypeSystemPropertyName["DeclaredType"] = 2] = "DeclaredType"; + TypeSystemPropertyName[TypeSystemPropertyName["ResolvedReturnType"] = 3] = "ResolvedReturnType"; + })(TypeSystemPropertyName || (TypeSystemPropertyName = {})); + var CheckMode; + (function (CheckMode) { + CheckMode[CheckMode["Normal"] = 0] = "Normal"; + CheckMode[CheckMode["SkipContextSensitive"] = 1] = "SkipContextSensitive"; + CheckMode[CheckMode["Inferential"] = 2] = "Inferential"; + })(CheckMode || (CheckMode = {})); var builtinGlobals = ts.createSymbolTable(); builtinGlobals.set(undefinedSymbol.escapedName, undefinedSymbol); initializeTypeChecker(); @@ -18790,7 +20169,10 @@ var ts; } return true; } - if (usage.parent.kind === 246) { + if (usage.parent.kind === 246 || (usage.parent.kind === 243 && usage.parent.isExportEquals)) { + return true; + } + if (usage.kind === 243 && usage.isExportEquals) { return true; } var container = ts.getEnclosingBlockScopeContainer(declaration); @@ -18820,13 +20202,13 @@ var ts; current.parent.kind === 149 && current.parent.initializer === current; if (initializerOfProperty) { - if (ts.getModifierFlags(current.parent) & 32) { + if (ts.hasModifier(current.parent, 32)) { if (declaration.kind === 151) { return true; } } else { - var isDeclarationInstanceProperty = declaration.kind === 149 && !(ts.getModifierFlags(declaration) & 32); + var isDeclarationInstanceProperty = declaration.kind === 149 && !ts.hasModifier(declaration, 32); if (!isDeclarationInstanceProperty || ts.getContainingClass(usage) !== ts.getContainingClass(declaration)) { return true; } @@ -18906,7 +20288,7 @@ var ts; break; case 149: case 148: - if (ts.isClassLike(location.parent) && !(ts.getModifierFlags(location) & 32)) { + if (ts.isClassLike(location.parent) && !ts.hasModifier(location, 32)) { var ctor = findConstructorDeclaration(location.parent); if (ctor && ctor.locals) { if (lookup(ctor.locals, name, meaning & 107455)) { @@ -18923,7 +20305,7 @@ var ts; result = undefined; break; } - if (lastLocation && ts.getModifierFlags(lastLocation) & 32) { + if (lastLocation && ts.hasModifier(lastLocation, 32)) { error(errorLocation, ts.Diagnostics.Static_members_cannot_reference_class_type_parameters); return undefined; } @@ -18937,6 +20319,17 @@ var ts; } } break; + case 201: + if (lastLocation === location.expression && location.parent.token === 85) { + var container = location.parent.parent; + if (ts.isClassLike(container) && (result = lookup(getSymbolOfNode(container).members, name, meaning & 793064))) { + if (nameNotFoundMessage) { + error(errorLocation, ts.Diagnostics.Base_class_expressions_cannot_reference_class_type_parameters); + } + return undefined; + } + } + break; case 144: grandparent = location.parent.parent; if (ts.isClassLike(grandparent) || grandparent.kind === 230) { @@ -18983,7 +20376,7 @@ var ts; lastLocation = location; location = location.parent; } - if (result && nameNotFoundMessage && noUnusedIdentifiers) { + if (result && nameNotFoundMessage && noUnusedIdentifiers && result !== lastLocation.symbol) { result.isReferenced = true; } if (!result) { @@ -19064,7 +20457,7 @@ var ts; error(errorLocation, ts.Diagnostics.Cannot_find_name_0_Did_you_mean_the_static_member_1_0, diagnosticName(nameArg), symbolToString(classSymbol)); return true; } - if (location === container && !(ts.getModifierFlags(location) & 32)) { + if (location === container && !ts.hasModifier(location, 32)) { var instanceType = getDeclaredTypeOfSymbol(classSymbol).thisType; if (getPropertyOfType(instanceType, name)) { error(errorLocation, ts.Diagnostics.Cannot_find_name_0_Did_you_mean_the_instance_member_this_0, diagnosticName(nameArg)); @@ -19450,7 +20843,6 @@ var ts; if (ambientModule) { return ambientModule; } - var isRelative = ts.isExternalModuleNameRelative(moduleReference); var resolvedModule = ts.getResolvedModule(ts.getSourceFileOfNode(location), moduleReference); var resolutionDiagnostic = resolvedModule && ts.getResolutionDiagnostic(compilerOptions, resolvedModule); var sourceFile = resolvedModule && !resolutionDiagnostic && host.getSourceFile(resolvedModule.resolvedFileName); @@ -19469,7 +20861,7 @@ var ts; return getMergedSymbol(pattern.symbol); } } - if (!isRelative && resolvedModule && !ts.extensionIsTypeScript(resolvedModule.extension)) { + if (resolvedModule && resolvedModule.isExternalLibraryImport && !ts.extensionIsTypeScript(resolvedModule.extension)) { if (isForAugmentation) { var diag = ts.Diagnostics.Invalid_module_name_in_augmentation_Module_0_resolves_to_an_untyped_module_at_1_which_cannot_be_augmented; error(errorNode, diag, moduleReference, resolvedModule.resolvedFileName); @@ -19804,6 +21196,10 @@ var ts; } return false; } + function isTypeSymbolAccessible(typeSymbol, enclosingDeclaration) { + var access = isSymbolAccessible(typeSymbol, enclosingDeclaration, 793064, false); + return access.accessibility === 0; + } function isSymbolAccessible(symbol, enclosingDeclaration, meaning, shouldComputeAliasesToMakeVisible) { if (symbol && enclosingDeclaration && !(symbol.flags & 262144)) { var initialSymbol = symbol; @@ -19859,7 +21255,7 @@ var ts; if (!isDeclarationVisible(declaration)) { var anyImportSyntax = getAnyImportSyntax(declaration); if (anyImportSyntax && - !(ts.getModifierFlags(anyImportSyntax) & 1) && + !ts.hasModifier(anyImportSyntax, 1) && isDeclarationVisible(anyImportSyntax.parent)) { if (shouldComputeAliasToMakeVisible) { getNodeLinks(declaration).isVisible = true; @@ -20057,8 +21453,7 @@ var ts; var name = symbolToName(type.symbol, context, 793064, false); return ts.createTypeReferenceNode(name, undefined); } - if (!inTypeAlias && type.aliasSymbol && - isSymbolAccessible(type.aliasSymbol, context.enclosingDeclaration, 793064, false).accessibility === 0) { + if (!inTypeAlias && type.aliasSymbol && isTypeSymbolAccessible(type.aliasSymbol, context.enclosingDeclaration)) { var name = symbolToTypeReferenceName(type.aliasSymbol); var typeArgumentNodes = mapToTypeNodes(type.aliasTypeArguments, context); return ts.createTypeReferenceNode(name, typeArgumentNodes); @@ -20133,8 +21528,8 @@ var ts; return createTypeNodeFromObjectType(type); } function shouldWriteTypeOfFunctionSymbol() { - var isStaticMethodSymbol = !!(symbol.flags & 8192 && - ts.forEach(symbol.declarations, function (declaration) { return ts.getModifierFlags(declaration) & 32; })); + var isStaticMethodSymbol = !!(symbol.flags & 8192) && + ts.some(symbol.declarations, function (declaration) { return ts.hasModifier(declaration, 32); }); var isNonLocalFunctionSymbol = !!(symbol.flags & 16) && (symbol.parent || ts.forEach(symbol.declarations, function (declaration) { @@ -20146,10 +21541,8 @@ var ts; } } function createTypeNodeFromObjectType(type) { - if (type.objectFlags & 32) { - if (getConstraintTypeFromMappedType(type).flags & (16384 | 262144)) { - return createMappedTypeNodeFromType(type); - } + if (isGenericMappedType(type)) { + return createMappedTypeNodeFromType(type); } var resolved = resolveStructuredTypeMembers(type); if (!resolved.properties.length && !resolved.stringIndexInfo && !resolved.numberIndexInfo) { @@ -20677,7 +22070,7 @@ var ts; buildSymbolDisplay(type.symbol, writer, enclosingDeclaration, 793064, 0, nextFlags); } else if (!(flags & 1024) && type.aliasSymbol && - isSymbolAccessible(type.aliasSymbol, enclosingDeclaration, 793064, false).accessibility === 0) { + ((flags & 65536) || isTypeSymbolAccessible(type.aliasSymbol, enclosingDeclaration))) { var typeArguments = type.aliasTypeArguments; writeSymbolTypeReference(type.aliasSymbol, typeArguments, 0, ts.length(typeArguments), nextFlags); } @@ -20821,9 +22214,7 @@ var ts; if (!symbolStack) { symbolStack = []; } - var isConstructorObject = type.flags & 32768 && - getObjectFlags(type) & 16 && - type.symbol && type.symbol.flags & 32; + var isConstructorObject = type.objectFlags & 16 && type.symbol && type.symbol.flags & 32; if (isConstructorObject) { writeLiteralType(type, flags); } @@ -20838,16 +22229,16 @@ var ts; writeLiteralType(type, flags); } function shouldWriteTypeOfFunctionSymbol() { - var isStaticMethodSymbol = !!(symbol.flags & 8192 && - ts.forEach(symbol.declarations, function (declaration) { return ts.getModifierFlags(declaration) & 32; })); + var isStaticMethodSymbol = !!(symbol.flags & 8192) && + ts.some(symbol.declarations, function (declaration) { return ts.hasModifier(declaration, 32); }); var isNonLocalFunctionSymbol = !!(symbol.flags & 16) && (symbol.parent || - ts.forEach(symbol.declarations, function (declaration) { + ts.some(symbol.declarations, function (declaration) { return declaration.parent.kind === 265 || declaration.parent.kind === 234; })); if (isStaticMethodSymbol || isNonLocalFunctionSymbol) { return !!(flags & 4) || - (ts.contains(symbolStack, symbol)); + ts.contains(symbolStack, symbol); } } } @@ -20884,11 +22275,9 @@ var ts; return false; } function writeLiteralType(type, flags) { - if (type.objectFlags & 32) { - if (getConstraintTypeFromMappedType(type).flags & (16384 | 262144)) { - writeMappedType(type); - return; - } + if (isGenericMappedType(type)) { + writeMappedType(type); + return; } var resolved = resolveStructuredTypeMembers(type); if (!resolved.properties.length && !resolved.stringIndexInfo && !resolved.numberIndexInfo) { @@ -21256,7 +22645,7 @@ var ts; case 154: case 151: case 150: - if (ts.getModifierFlags(node) & (8 | 16)) { + if (ts.hasModifier(node, 8 | 16)) { return false; } case 152: @@ -21933,8 +23322,8 @@ var ts; } } function appendTypeParameters(typeParameters, declarations) { - for (var _i = 0, declarations_3 = declarations; _i < declarations_3.length; _i++) { - var declaration = declarations_3[_i]; + for (var _i = 0, declarations_2 = declarations; _i < declarations_2.length; _i++) { + var declaration = declarations_2[_i]; var tp = getDeclaredTypeOfTypeParameter(getSymbolOfNode(declaration)); if (!typeParameters) { typeParameters = [tp]; @@ -22058,7 +23447,7 @@ var ts; return type.resolvedBaseTypes; } function resolveBaseTypesOfClass(type) { - type.resolvedBaseTypes = type.resolvedBaseTypes || ts.emptyArray; + type.resolvedBaseTypes = ts.emptyArray; var baseConstructorType = getApparentType(getBaseConstructorTypeOfClass(type)); if (!(baseConstructorType.flags & (32768 | 131072 | 1))) { return; @@ -22100,12 +23489,7 @@ var ts; error(valueDecl, ts.Diagnostics.Type_0_recursively_references_itself_as_a_base_type, typeToString(type, undefined, 1)); return; } - if (type.resolvedBaseTypes === ts.emptyArray) { - type.resolvedBaseTypes = [baseType]; - } - else { - type.resolvedBaseTypes.push(baseType); - } + type.resolvedBaseTypes = [baseType]; } function areAllOuterTypeParametersApplied(type) { var outerTypeParameters = type.outerTypeParameters; @@ -22203,7 +23587,9 @@ var ts; if (!pushTypeResolution(symbol, 2)) { return unknownType; } - var declaration = ts.findDeclaration(symbol, function (d) { return d.kind === 283 || d.kind === 231; }); + var declaration = ts.find(symbol.declarations, function (d) { + return d.kind === 283 || d.kind === 231; + }); var type = getTypeFromTypeNode(declaration.kind === 283 ? declaration.typeExpression : declaration.type); if (popTypeResolution()) { var typeParameters = getLocalTypeParametersOfClassOrInterfaceOrTypeAlias(symbol); @@ -22695,17 +24081,12 @@ var ts; } else { var members = emptySymbols; - var constructSignatures = ts.emptyArray; var stringIndexInfo = undefined; if (symbol.exports) { members = getExportsOfSymbol(symbol); } if (symbol.flags & 32) { var classType = getDeclaredTypeOfClassOrInterface(symbol); - constructSignatures = getSignaturesOfSymbol(symbol.members.get("__constructor")); - if (!constructSignatures.length) { - constructSignatures = getDefaultConstructSignatures(classType); - } var baseConstructorType = getBaseConstructorTypeOfClass(classType); if (baseConstructorType.flags & (32768 | 131072 | 540672)) { members = ts.createSymbolTable(getNamedMembers(members)); @@ -22716,10 +24097,18 @@ var ts; } } var numberIndexInfo = symbol.flags & 384 ? enumNumberIndexInfo : undefined; - setStructuredTypeMembers(type, members, ts.emptyArray, constructSignatures, stringIndexInfo, numberIndexInfo); + setStructuredTypeMembers(type, members, ts.emptyArray, ts.emptyArray, stringIndexInfo, numberIndexInfo); if (symbol.flags & (16 | 8192)) { type.callSignatures = getSignaturesOfSymbol(symbol); } + if (symbol.flags & 32) { + var classType = getDeclaredTypeOfClassOrInterface(symbol); + var constructSignatures = getSignaturesOfSymbol(symbol.members.get("__constructor")); + if (!constructSignatures.length) { + constructSignatures = getDefaultConstructSignatures(classType); + } + type.constructSignatures = constructSignatures; + } } } function resolveMappedTypeMembers(type) { @@ -22802,8 +24191,7 @@ var ts; return getObjectFlags(type) & 32 && !!type.declaration.questionToken; } function isGenericMappedType(type) { - return getObjectFlags(type) & 32 && - maybeTypeOfKind(getConstraintTypeFromMappedType(type), 540672 | 262144); + return getObjectFlags(type) & 32 && isGenericIndexType(getConstraintTypeFromMappedType(type)); } function resolveStructuredTypeMembers(type) { if (!type.members) { @@ -22903,6 +24291,10 @@ var ts; return hasNonCircularBaseConstraint(typeParameter) ? getConstraintFromTypeParameter(typeParameter) : undefined; } function getConstraintOfIndexedAccess(type) { + var transformed = getTransformedIndexedAccessType(type); + if (transformed) { + return transformed; + } var baseObjectType = getBaseConstraintOfType(type.objectType); var baseIndexType = getBaseConstraintOfType(type.indexType); return baseObjectType || baseIndexType ? getIndexedAccessType(baseObjectType || type.objectType, baseIndexType || type.indexType) : undefined; @@ -22965,11 +24357,18 @@ var ts; return stringType; } if (t.flags & 524288) { + var transformed = getTransformedIndexedAccessType(t); + if (transformed) { + return getBaseConstraint(transformed); + } var baseObjectType = getBaseConstraint(t.objectType); var baseIndexType = getBaseConstraint(t.indexType); var baseIndexedAccess = baseObjectType && baseIndexType ? getIndexedAccessType(baseObjectType, baseIndexType) : undefined; return baseIndexedAccess && baseIndexedAccess !== unknownType ? getBaseConstraint(baseIndexedAccess) : undefined; } + if (isGenericMappedType(t)) { + return emptyObjectType; + } return t; } } @@ -23449,6 +24848,9 @@ var ts; } return signature.resolvedReturnType; } + function isResolvingReturnTypeOfSignature(signature) { + return !signature.resolvedReturnType && findResolutionCycleStartIndex(signature, 3) >= 0; + } function getRestTypeOfSignature(signature) { if (signature.hasRestParameter) { var type = getTypeOfSymbol(ts.lastOrUndefined(signature.parameters)); @@ -23517,7 +24919,7 @@ var ts; function getIndexInfoOfSymbol(symbol, kind) { var declaration = getIndexDeclarationOfSymbol(symbol, kind); if (declaration) { - return createIndexInfo(declaration.type ? getTypeFromTypeNode(declaration.type) : anyType, (ts.getModifierFlags(declaration) & 64) !== 0, declaration); + return createIndexInfo(declaration.type ? getTypeFromTypeNode(declaration.type) : anyType, ts.hasModifier(declaration, 64), declaration); } return undefined; } @@ -23785,8 +25187,8 @@ var ts; function getTypeOfGlobalSymbol(symbol, arity) { function getTypeDeclaration(symbol) { var declarations = symbol.declarations; - for (var _i = 0, declarations_4 = declarations; _i < declarations_4.length; _i++) { - var declaration = declarations_4[_i]; + for (var _i = 0, declarations_3 = declarations; _i < declarations_3.length; _i++) { + var declaration = declarations_3[_i]; switch (declaration.kind) { case 229: case 230: @@ -24243,17 +25645,16 @@ var ts; return getTypeOfSymbol(prop); } } - if (isTypeAnyOrAllConstituentTypesHaveKind(indexType, 262178 | 84 | 512)) { + if (!(indexType.flags & 6144) && isTypeAssignableToKind(indexType, 262178 | 84 | 512)) { if (isTypeAny(objectType)) { return anyType; } - var indexInfo = isTypeAnyOrAllConstituentTypesHaveKind(indexType, 84) && getIndexInfoOfType(objectType, 1) || + var indexInfo = isTypeAssignableToKind(indexType, 84) && getIndexInfoOfType(objectType, 1) || getIndexInfoOfType(objectType, 0) || undefined; if (indexInfo) { if (accessExpression && indexInfo.isReadonly && (ts.isAssignmentTarget(accessExpression) || ts.isDeleteTarget(accessExpression))) { error(accessExpression, ts.Diagnostics.Index_signature_in_type_0_only_permits_reading, typeToString(objectType)); - return unknownType; } return indexInfo.type; } @@ -24285,25 +25686,68 @@ var ts; return anyType; } function getIndexedAccessForMappedType(type, indexType, accessNode) { - var accessExpression = accessNode && accessNode.kind === 180 ? accessNode : undefined; - if (accessExpression && ts.isAssignmentTarget(accessExpression) && type.declaration.readonlyToken) { - error(accessExpression, ts.Diagnostics.Index_signature_in_type_0_only_permits_reading, typeToString(type)); - return unknownType; + if (accessNode) { + if (!isTypeAssignableTo(indexType, getIndexType(type))) { + error(accessNode, ts.Diagnostics.Type_0_cannot_be_used_to_index_type_1, typeToString(indexType), typeToString(type)); + return unknownType; + } + if (accessNode.kind === 180 && ts.isAssignmentTarget(accessNode) && type.declaration.readonlyToken) { + error(accessNode, ts.Diagnostics.Index_signature_in_type_0_only_permits_reading, typeToString(type)); + } } var mapper = createTypeMapper([getTypeParameterFromMappedType(type)], [indexType]); var templateMapper = type.mapper ? combineTypeMappers(type.mapper, mapper) : mapper; return instantiateType(getTemplateTypeFromMappedType(type), templateMapper); } + function isGenericObjectType(type) { + return type.flags & 540672 ? true : + getObjectFlags(type) & 32 ? isGenericIndexType(getConstraintTypeFromMappedType(type)) : + type.flags & 196608 ? ts.forEach(type.types, isGenericObjectType) : + false; + } + function isGenericIndexType(type) { + return type.flags & (540672 | 262144) ? true : + type.flags & 196608 ? ts.forEach(type.types, isGenericIndexType) : + false; + } + function isStringIndexOnlyType(type) { + if (type.flags & 32768 && !isGenericMappedType(type)) { + var t = resolveStructuredTypeMembers(type); + return t.properties.length === 0 && + t.callSignatures.length === 0 && t.constructSignatures.length === 0 && + t.stringIndexInfo && !t.numberIndexInfo; + } + return false; + } + function getTransformedIndexedAccessType(type) { + var objectType = type.objectType; + if (objectType.flags & 131072 && isGenericObjectType(objectType) && ts.some(objectType.types, isStringIndexOnlyType)) { + var regularTypes = []; + var stringIndexTypes = []; + for (var _i = 0, _a = objectType.types; _i < _a.length; _i++) { + var t = _a[_i]; + if (isStringIndexOnlyType(t)) { + stringIndexTypes.push(getIndexTypeOfType(t, 0)); + } + else { + regularTypes.push(t); + } + } + return getUnionType([ + getIndexedAccessType(getIntersectionType(regularTypes), type.indexType), + getIntersectionType(stringIndexTypes) + ]); + } + return undefined; + } function getIndexedAccessType(objectType, indexType, accessNode) { - if (maybeTypeOfKind(indexType, 540672 | 262144) || - maybeTypeOfKind(objectType, 540672) && !(accessNode && accessNode.kind === 180) || - isGenericMappedType(objectType)) { + if (isGenericMappedType(objectType)) { + return getIndexedAccessForMappedType(objectType, indexType, accessNode); + } + if (isGenericIndexType(indexType) || !(accessNode && accessNode.kind === 180) && isGenericObjectType(objectType)) { if (objectType.flags & 1) { return objectType; } - if (isGenericMappedType(objectType)) { - return getIndexedAccessForMappedType(objectType, indexType, accessNode); - } var id = objectType.id + "," + indexType.id; var type = indexedAccessTypes.get(id); if (!type) { @@ -24502,7 +25946,7 @@ var ts; var container = ts.getThisContainer(node, false); var parent = container && container.parent; if (parent && (ts.isClassLike(parent) || parent.kind === 230)) { - if (!(ts.getModifierFlags(container) & 32) && + if (!ts.hasModifier(container, 32) && (container.kind !== 152 || ts.isNodeDescendantOf(node, container.body))) { return getDeclaredTypeOfClassOrInterface(getSymbolOfNode(parent)).thisType; } @@ -24649,7 +26093,7 @@ var ts; } function cloneTypeMapper(mapper) { return mapper && isInferenceContext(mapper) ? - createInferenceContext(mapper.signature, mapper.flags | 2, mapper.inferences) : + createInferenceContext(mapper.signature, mapper.flags | 2, mapper.compareTypes, mapper.inferences) : mapper; } function identityMapper(type) { @@ -24913,11 +26357,13 @@ var ts; if (ts.forEach(node.parameters, function (p) { return !ts.getEffectiveTypeAnnotationNode(p); })) { return true; } - if (node.kind === 187) { - return false; + if (node.kind !== 187) { + var parameter = ts.firstOrUndefined(node.parameters); + if (!(parameter && ts.parameterIsThisKeyword(parameter))) { + return true; + } } - var parameter = ts.firstOrUndefined(node.parameters); - return !(parameter && ts.parameterIsThisKeyword(parameter)); + return node.body.kind === 207 ? false : isContextSensitive(node.body); } function isContextSensitiveFunctionOrObjectLiteralMethod(func) { return (isFunctionExpressionOrArrowFunction(func) || ts.isObjectLiteralMethod(func)) && isContextSensitiveFunctionLikeDeclaration(func); @@ -24980,7 +26426,7 @@ var ts; return 0; } if (source.typeParameters) { - source = instantiateSignatureInContextOf(source, target); + source = instantiateSignatureInContextOf(source, target, undefined, compareTypes); } var result = -1; var sourceThisType = getThisTypeOfSignature(source); @@ -25029,7 +26475,7 @@ var ts; var sourceReturnType = getReturnTypeOfSignature(source); if (target.typePredicate) { if (source.typePredicate) { - result &= compareTypePredicateRelatedTo(source.typePredicate, target.typePredicate, reportErrors, errorReporter, compareTypes); + result &= compareTypePredicateRelatedTo(source.typePredicate, target.typePredicate, source.declaration, target.declaration, reportErrors, errorReporter, compareTypes); } else if (ts.isIdentifierTypePredicate(target.typePredicate)) { if (reportErrors) { @@ -25045,7 +26491,7 @@ var ts; } return result; } - function compareTypePredicateRelatedTo(source, target, reportErrors, errorReporter, compareTypes) { + function compareTypePredicateRelatedTo(source, target, sourceDeclaration, targetDeclaration, reportErrors, errorReporter, compareTypes) { if (source.kind !== target.kind) { if (reportErrors) { errorReporter(ts.Diagnostics.A_this_based_type_guard_is_not_compatible_with_a_parameter_based_type_guard); @@ -25054,11 +26500,13 @@ var ts; return 0; } if (source.kind === 1) { - var sourceIdentifierPredicate = source; - var targetIdentifierPredicate = target; - if (sourceIdentifierPredicate.parameterIndex !== targetIdentifierPredicate.parameterIndex) { + var sourcePredicate = source; + var targetPredicate = target; + var sourceIndex = sourcePredicate.parameterIndex - (ts.getThisParameter(sourceDeclaration) ? 1 : 0); + var targetIndex = targetPredicate.parameterIndex - (ts.getThisParameter(targetDeclaration) ? 1 : 0); + if (sourceIndex !== targetIndex) { if (reportErrors) { - errorReporter(ts.Diagnostics.Parameter_0_is_not_in_the_same_position_as_parameter_1, sourceIdentifierPredicate.parameterName, targetIdentifierPredicate.parameterName); + errorReporter(ts.Diagnostics.Parameter_0_is_not_in_the_same_position_as_parameter_1, sourcePredicate.parameterName, targetPredicate.parameterName); errorReporter(ts.Diagnostics.Type_predicate_0_is_not_assignable_to_1, typePredicateToString(source), typePredicateToString(target)); } return 0; @@ -25203,8 +26651,7 @@ var ts; return true; } if (source.flags & 32768 && target.flags & 32768) { - var id = relation !== identityRelation || source.id < target.id ? source.id + "," + target.id : target.id + "," + source.id; - var related = relation.get(id); + var related = relation.get(getRelationKey(source, target, relation)); if (related !== undefined) { return related === 1; } @@ -25317,11 +26764,21 @@ var ts; !(target.flags & 65536) && !isIntersectionConstituent && source !== globalObjectType && - getPropertiesOfType(source).length > 0 && + (getPropertiesOfType(source).length > 0 || + getSignaturesOfType(source, 0).length > 0 || + getSignaturesOfType(source, 1).length > 0) && isWeakType(target) && !hasCommonProperties(source, target)) { if (reportErrors) { - reportError(ts.Diagnostics.Type_0_has_no_properties_in_common_with_type_1, typeToString(source), typeToString(target)); + var calls = getSignaturesOfType(source, 0); + var constructs = getSignaturesOfType(source, 1); + if (calls.length > 0 && isRelatedTo(getReturnTypeOfSignature(calls[0]), target, false) || + constructs.length > 0 && isRelatedTo(getReturnTypeOfSignature(constructs[0]), target, false)) { + reportError(ts.Diagnostics.Value_of_type_0_has_no_properties_in_common_with_type_1_Did_you_mean_to_call_it, typeToString(source), typeToString(target)); + } + else { + reportError(ts.Diagnostics.Type_0_has_no_properties_in_common_with_type_1, typeToString(source), typeToString(target)); + } } return 0; } @@ -25522,7 +26979,7 @@ var ts; if (overflow) { return 0; } - var id = relation !== identityRelation || source.id < target.id ? source.id + "," + target.id : target.id + "," + source.id; + var id = getRelationKey(source, target, relation); var related = relation.get(id); if (related !== undefined) { if (reportErrors && related === 2) { @@ -25942,6 +27399,9 @@ var ts; if (sourceInfo) { return indexInfoRelatedTo(sourceInfo, targetInfo, reportErrors); } + if (isGenericMappedType(source)) { + return kind === 0 && isRelatedTo(getTemplateTypeFromMappedType(source), targetInfo.type, reportErrors); + } if (isObjectLiteralType(source)) { var related = -1; if (kind === 0) { @@ -25975,8 +27435,8 @@ var ts; if (!sourceSignature.declaration || !targetSignature.declaration) { return true; } - var sourceAccessibility = ts.getModifierFlags(sourceSignature.declaration) & 24; - var targetAccessibility = ts.getModifierFlags(targetSignature.declaration) & 24; + var sourceAccessibility = ts.getSelectedModifierFlags(sourceSignature.declaration, 24); + var targetAccessibility = ts.getSelectedModifierFlags(targetSignature.declaration, 24); if (targetAccessibility === 8) { return true; } @@ -25992,6 +27452,42 @@ var ts; return false; } } + function isUnconstrainedTypeParameter(type) { + return type.flags & 16384 && !getConstraintFromTypeParameter(type); + } + function isTypeReferenceWithGenericArguments(type) { + return getObjectFlags(type) & 4 && ts.some(type.typeArguments, isUnconstrainedTypeParameter); + } + function getTypeReferenceId(type, typeParameters) { + var result = "" + type.target.id; + for (var _i = 0, _a = type.typeArguments; _i < _a.length; _i++) { + var t = _a[_i]; + if (isUnconstrainedTypeParameter(t)) { + var index = ts.indexOf(typeParameters, t); + if (index < 0) { + index = typeParameters.length; + typeParameters.push(t); + } + result += "=" + index; + } + else { + result += "-" + t.id; + } + } + return result; + } + function getRelationKey(source, target, relation) { + if (relation === identityRelation && source.id > target.id) { + var temp = source; + source = target; + target = temp; + } + if (isTypeReferenceWithGenericArguments(source) && isTypeReferenceWithGenericArguments(target)) { + var typeParameters = []; + return getTypeReferenceId(source, typeParameters) + "," + getTypeReferenceId(target, typeParameters); + } + return source.id + "," + target.id; + } function forEachProperty(prop, callback) { if (ts.getCheckFlags(prop) & 6) { for (var _i = 0, _a = prop.containingType.types; _i < _a.length; _i++) { @@ -26028,7 +27524,7 @@ var ts; var symbol = type.symbol; if (symbol && symbol.flags & 32) { var declaration = getClassLikeDeclarationOfSymbol(symbol); - if (declaration && ts.getModifierFlags(declaration) & 128) { + if (declaration && ts.hasModifier(declaration, 128)) { return true; } } @@ -26414,13 +27910,14 @@ var ts; callback(getTypeAtPosition(source, i), getTypeAtPosition(target, i)); } } - function createInferenceContext(signature, flags, baseInferences) { + function createInferenceContext(signature, flags, compareTypes, baseInferences) { var inferences = baseInferences ? ts.map(baseInferences, cloneInferenceInfo) : ts.map(signature.typeParameters, createInferenceInfo); var context = mapper; context.mappedTypes = signature.typeParameters; context.signature = signature; context.inferences = inferences; context.flags = flags; + context.compareTypes = compareTypes || compareTypesAssignable; return context; function mapper(t) { for (var i = 0; i < inferences.length; i++) { @@ -26508,6 +28005,19 @@ var ts; return inference.candidates && getUnionType(inference.candidates, true); } } + function isPossiblyAssignableTo(source, target) { + var properties = getPropertiesOfObjectType(target); + for (var _i = 0, properties_5 = properties; _i < properties_5.length; _i++) { + var targetProp = properties_5[_i]; + if (!(targetProp.flags & (16777216 | 4194304))) { + var sourceProp = getPropertyOfObjectType(source, targetProp.escapedName); + if (!sourceProp) { + return false; + } + } + } + return true; + } function inferTypes(inferences, originalSource, originalTarget, priority) { if (priority === void 0) { priority = 0; } var symbolStack; @@ -26668,15 +28178,17 @@ var ts; return; } } - inferFromProperties(source, target); - inferFromSignatures(source, target, 0); - inferFromSignatures(source, target, 1); - inferFromIndexTypes(source, target); + if (isPossiblyAssignableTo(source, target) || isPossiblyAssignableTo(target, source)) { + inferFromProperties(source, target); + inferFromSignatures(source, target, 0); + inferFromSignatures(source, target, 1); + inferFromIndexTypes(source, target); + } } function inferFromProperties(source, target) { var properties = getPropertiesOfObjectType(target); - for (var _i = 0, properties_5 = properties; _i < properties_5.length; _i++) { - var targetProp = properties_5[_i]; + for (var _i = 0, properties_6 = properties; _i < properties_6.length; _i++) { + var targetProp = properties_6[_i]; var sourceProp = getPropertyOfObjectType(source, targetProp.escapedName); if (sourceProp) { inferFromTypes(getTypeOfSymbol(sourceProp), getTypeOfSymbol(targetProp)); @@ -26775,7 +28287,7 @@ var ts; var constraint = getConstraintOfTypeParameter(context.signature.typeParameters[index]); if (constraint) { var instantiatedConstraint = instantiateType(constraint, context); - if (!isTypeAssignableTo(inferredType, getTypeWithThisArgument(instantiatedConstraint, inferredType))) { + if (!context.compareTypes(inferredType, getTypeWithThisArgument(instantiatedConstraint, inferredType))) { inference.inferredType = inferredType = instantiatedConstraint; } } @@ -26823,16 +28335,6 @@ var ts; } return undefined; } - function getLeftmostIdentifierOrThis(node) { - switch (node.kind) { - case 71: - case 99: - return node; - case 179: - return getLeftmostIdentifierOrThis(node.expression); - } - return undefined; - } function getBindingElementNameText(element) { if (element.parent.kind === 174) { var name = element.propertyName || element.name; @@ -27324,7 +28826,7 @@ var ts; parent.parent.operatorToken.kind === 58 && parent.parent.left === parent && !ts.isAssignmentTarget(parent.parent) && - isTypeAnyOrAllConstituentTypesHaveKind(getTypeOfExpression(parent.argumentExpression), 84 | 2048); + isTypeAssignableToKind(getTypeOfExpression(parent.argumentExpression), 84); return isLengthPushOrUnshift || isElementAssignment; } function maybeTypePredicateCall(node) { @@ -27470,7 +28972,7 @@ var ts; } else { var indexType = getTypeOfExpression(node.left.argumentExpression); - if (isTypeAnyOrAllConstituentTypesHaveKind(indexType, 84 | 2048)) { + if (isTypeAssignableToKind(indexType, 84)) { evolvedType_1 = addEvolvingArrayElementType(evolvedType_1, node.right); } } @@ -28156,7 +29658,7 @@ var ts; break; case 149: case 148: - if (ts.getModifierFlags(container) & 32) { + if (ts.hasModifier(container, 32)) { error(node, ts.Diagnostics.this_cannot_be_referenced_in_a_static_property_initializer); } break; @@ -28247,14 +29749,14 @@ var ts; if (!isCallExpression && container.kind === 152) { checkThisBeforeSuper(node, container, ts.Diagnostics.super_must_be_called_before_accessing_a_property_of_super_in_the_constructor_of_a_derived_class); } - if ((ts.getModifierFlags(container) & 32) || isCallExpression) { + if (ts.hasModifier(container, 32) || isCallExpression) { nodeCheckFlag = 512; } else { nodeCheckFlag = 256; } getNodeLinks(node).flags |= nodeCheckFlag; - if (container.kind === 151 && ts.getModifierFlags(container) & 256) { + if (container.kind === 151 && ts.hasModifier(container, 256)) { if (ts.isSuperProperty(node.parent) && ts.isAssignmentTarget(node.parent)) { getNodeLinks(container).flags |= 4096; } @@ -28299,7 +29801,7 @@ var ts; } else { if (ts.isClassLike(container.parent) || container.parent.kind === 178) { - if (ts.getModifierFlags(container) & 32) { + if (ts.hasModifier(container, 32)) { return container.kind === 151 || container.kind === 150 || container.kind === 153 || @@ -28489,7 +29991,7 @@ var ts; return getReturnTypeOfSignature(getSignatureFromDeclaration(functionDecl)); } var signature = getContextualSignatureForFunctionLikeDeclaration(functionDecl); - if (signature) { + if (signature && !isResolvingReturnTypeOfSignature(signature)) { return getReturnTypeOfSignature(signature); } return undefined; @@ -28593,11 +30095,11 @@ var ts; return undefined; } if (ts.isJsxAttribute(node.parent)) { - return getTypeOfPropertyOfType(attributesType, node.parent.name.escapedText); + return getTypeOfPropertyOfContextualType(attributesType, node.parent.name.escapedText); } else if (node.parent.kind === 249) { var jsxChildrenPropertyName = getJsxElementChildrenPropertyname(); - return jsxChildrenPropertyName && jsxChildrenPropertyName !== "" ? getTypeOfPropertyOfType(attributesType, jsxChildrenPropertyName) : anyType; + return jsxChildrenPropertyName && jsxChildrenPropertyName !== "" ? getTypeOfPropertyOfContextualType(attributesType, jsxChildrenPropertyName) : anyType; } else { return attributesType; @@ -28609,7 +30111,7 @@ var ts; if (!attributesType || isTypeAny(attributesType)) { return undefined; } - return getTypeOfPropertyOfType(attributesType, attribute.name.escapedText); + return getTypeOfPropertyOfContextualType(attributesType, attribute.name.escapedText); } else { return attributesType; @@ -28825,10 +30327,7 @@ var ts; } } function isNumericComputedName(name) { - return isTypeAnyOrAllConstituentTypesHaveKind(checkComputedPropertyName(name), 84); - } - function isTypeAnyOrAllConstituentTypesHaveKind(type, kind) { - return isTypeAny(type) || isTypeOfKind(type, kind); + return isTypeAssignableToKind(checkComputedPropertyName(name), 84); } function isInfinityOrNaNString(name) { return name === "Infinity" || name === "-Infinity" || name === "NaN"; @@ -28840,7 +30339,9 @@ var ts; var links = getNodeLinks(node.expression); if (!links.resolvedType) { links.resolvedType = checkExpression(node.expression); - if (!isTypeAnyOrAllConstituentTypesHaveKind(links.resolvedType, 84 | 262178 | 512)) { + if (links.resolvedType.flags & 6144 || + !isTypeAssignableToKind(links.resolvedType, 262178 | 84 | 512) && + !isTypeAssignableTo(links.resolvedType, getUnionType([stringType, numberType, esSymbolType]))) { error(node, ts.Diagnostics.A_computed_property_name_must_be_of_type_string_number_symbol_or_any); } else { @@ -29325,9 +30826,7 @@ var ts; return undefined; } function resolveCustomJsxElementAttributesType(openingLikeElement, shouldIncludeAllStatelessAttributesType, elementType, elementClassType) { - if (!elementType) { - elementType = checkExpression(openingLikeElement.tagName); - } + if (elementType === void 0) { elementType = checkExpression(openingLikeElement.tagName); } if (elementType.flags & 65536) { var types = elementType.types; return getUnionType(types.map(function (type) { @@ -29422,11 +30921,12 @@ var ts; } function getCustomJsxElementAttributesType(node, shouldIncludeAllStatelessAttributesType) { var links = getNodeLinks(node); - if (!links.resolvedJsxElementAttributesType) { + var linkLocation = shouldIncludeAllStatelessAttributesType ? "resolvedJsxElementAllAttributesType" : "resolvedJsxElementAttributesType"; + if (!links[linkLocation]) { var elemClassType = getJsxGlobalElementClassType(); - return links.resolvedJsxElementAttributesType = resolveCustomJsxElementAttributesType(node, shouldIncludeAllStatelessAttributesType, undefined, elemClassType); + return links[linkLocation] = resolveCustomJsxElementAttributesType(node, shouldIncludeAllStatelessAttributesType, undefined, elemClassType); } - return links.resolvedJsxElementAttributesType; + return links[linkLocation]; } function getAllAttributesTypeFromJsxOpeningLikeElement(node) { if (isJsxIntrinsicIdentifier(node.tagName)) { @@ -29653,9 +31153,12 @@ var ts; } var prop = getPropertyOfType(apparentType, right.escapedText); if (!prop) { - var stringIndexType = getIndexTypeOfType(apparentType, 0); - if (stringIndexType) { - return stringIndexType; + var indexInfo = getIndexInfoOfType(apparentType, 0); + if (indexInfo && indexInfo.type) { + if (indexInfo.isReadonly && (ts.isAssignmentTarget(node) || ts.isDeleteTarget(node))) { + error(node, ts.Diagnostics.Index_signature_in_type_0_only_permits_reading, typeToString(apparentType)); + } + return indexInfo.type; } if (right.escapedText && !checkAndReportErrorForExtendingInterface(node)) { reportNonexistentProperty(right, type.flags & 16384 && type.isThisType ? apparentType : type); @@ -29782,7 +31285,7 @@ var ts; if (prop && noUnusedIdentifiers && (prop.flags & 106500) && - prop.valueDeclaration && (ts.getModifierFlags(prop.valueDeclaration) & 8)) { + prop.valueDeclaration && ts.hasModifier(prop.valueDeclaration, 8)) { if (ts.getCheckFlags(prop) & 1) { getSymbolLinks(prop).target.isReferenced = true; } @@ -30053,8 +31556,8 @@ var ts; } return undefined; } - function instantiateSignatureInContextOf(signature, contextualSignature, contextualMapper) { - var context = createInferenceContext(signature, 1); + function instantiateSignatureInContextOf(signature, contextualSignature, contextualMapper, compareTypes) { + var context = createInferenceContext(signature, 1, compareTypes); forEachMatchingParameterType(contextualSignature, signature, function (source, target) { inferTypes(context.inferences, instantiateType(source, contextualMapper || identityMapper), target); }); @@ -30284,7 +31787,7 @@ var ts; return getLiteralType(element.name.text); case 144: var nameType = checkComputedPropertyName(element.name); - if (isTypeOfKind(nameType, 512)) { + if (isTypeAssignableToKind(nameType, 512)) { return nameType; } else { @@ -30377,9 +31880,10 @@ var ts; return resolveErrorCall(node); } var args = getEffectiveCallArguments(node); + var isSingleNonGenericCandidate = candidates.length === 1 && !candidates[0].typeParameters; var excludeArgument; var excludeCount = 0; - if (!isDecorator) { + if (!isDecorator && !isSingleNonGenericCandidate) { for (var i = isTaggedTemplate ? 1 : 0; i < args.length; i++) { if (isContextSensitive(args[i])) { if (!excludeArgument) { @@ -30471,6 +31975,17 @@ var ts; if (signatureHelpTrailingComma === void 0) { signatureHelpTrailingComma = false; } candidateForArgumentError = undefined; candidateForTypeArgumentError = undefined; + if (isSingleNonGenericCandidate) { + var candidate = candidates[0]; + if (!hasCorrectArity(node, args, candidate, signatureHelpTrailingComma)) { + return undefined; + } + if (!checkApplicableSignature(node, args, candidate, relation, excludeArgument, false)) { + candidateForArgumentError = candidate; + return undefined; + } + return candidate; + } for (var candidateIndex = 0; candidateIndex < candidates.length; candidateIndex++) { var originalCandidate = candidates[candidateIndex]; if (!hasCorrectArity(node, args, originalCandidate, signatureHelpTrailingComma)) { @@ -30601,7 +32116,7 @@ var ts; return resolveErrorCall(node); } var valueDecl = expressionType.symbol && getClassLikeDeclarationOfSymbol(expressionType.symbol); - if (valueDecl && ts.getModifierFlags(valueDecl) & 128) { + if (valueDecl && ts.hasModifier(valueDecl, 128)) { error(node, ts.Diagnostics.Cannot_create_an_instance_of_the_abstract_class_0, ts.declarationNameToString(ts.getNameOfDeclaration(valueDecl))); return resolveErrorCall(node); } @@ -30637,8 +32152,8 @@ var ts; return true; } var declaration = signature.declaration; - var modifiers = ts.getModifierFlags(declaration); - if (!(modifiers & 24)) { + var modifiers = ts.getSelectedModifierFlags(declaration, 24); + if (!modifiers) { return true; } var declaringClassDeclaration = getClassLikeDeclarationOfSymbol(declaration.parent.symbol); @@ -30792,7 +32307,7 @@ var ts; && getSymbolLinks(type.symbol).inferredClassType === type; } function checkCallExpression(node) { - checkGrammarTypeArguments(node, node.typeArguments) || checkGrammarArguments(node, node.arguments); + checkGrammarTypeArguments(node, node.typeArguments) || checkGrammarArguments(node.arguments); var signature = getResolvedSignature(node); if (node.expression.kind === 97) { return voidType; @@ -30825,7 +32340,7 @@ var ts; return getReturnTypeOfSignature(signature); } function checkImportCallExpression(node) { - checkGrammarArguments(node, node.arguments) || checkGrammarImportCallExpression(node); + checkGrammarArguments(node.arguments) || checkGrammarImportCallExpression(node); if (node.arguments.length === 0) { return createPromiseReturnType(node, anyType); } @@ -30841,11 +32356,33 @@ var ts; if (moduleSymbol) { var esModuleSymbol = resolveESModuleSymbol(moduleSymbol, specifier, true); if (esModuleSymbol) { - return createPromiseReturnType(node, getTypeOfSymbol(esModuleSymbol)); + return createPromiseReturnType(node, getTypeWithSyntheticDefaultImportType(getTypeOfSymbol(esModuleSymbol), esModuleSymbol)); } } return createPromiseReturnType(node, anyType); } + function getTypeWithSyntheticDefaultImportType(type, symbol) { + if (allowSyntheticDefaultImports && type && type !== unknownType) { + var synthType = type; + if (!synthType.syntheticType) { + if (!getPropertyOfType(type, "default")) { + var memberTable = ts.createSymbolTable(); + var newSymbol = createSymbol(2097152, "default"); + newSymbol.target = resolveSymbol(symbol); + memberTable.set("default", newSymbol); + var anonymousSymbol = createSymbol(2048, "__type"); + var defaultContainingObject = createAnonymousType(anonymousSymbol, memberTable, ts.emptyArray, ts.emptyArray, undefined, undefined); + anonymousSymbol.type = defaultContainingObject; + synthType.syntheticType = getIntersectionType([type, defaultContainingObject]); + } + else { + synthType.syntheticType = type; + } + } + return synthType.syntheticType; + } + return type; + } function isCommonJsRequire(node) { if (!ts.isRequireCall(node, true)) { return false; @@ -30964,15 +32501,15 @@ var ts; } } } - function assignBindingElementTypes(node) { - if (ts.isBindingPattern(node.name)) { - for (var _i = 0, _a = node.name.elements; _i < _a.length; _i++) { - var element = _a[_i]; - if (!ts.isOmittedExpression(element)) { - if (element.name.kind === 71) { - getSymbolLinks(getSymbolOfNode(element)).type = getTypeForBindingElement(element); - } - assignBindingElementTypes(element); + function assignBindingElementTypes(pattern) { + for (var _i = 0, _a = pattern.elements; _i < _a.length; _i++) { + var element = _a[_i]; + if (!ts.isOmittedExpression(element)) { + if (element.name.kind === 71) { + getSymbolLinks(getSymbolOfNode(element)).type = getTypeForBindingElement(element); + } + else { + assignBindingElementTypes(element.name); } } } @@ -30981,12 +32518,13 @@ var ts; var links = getSymbolLinks(parameter); if (!links.type) { links.type = contextualType; - var name = ts.getNameOfDeclaration(parameter.valueDeclaration); - if (links.type === emptyObjectType && - (name.kind === 174 || name.kind === 175)) { - links.type = getTypeFromBindingPattern(name); + var decl = parameter.valueDeclaration; + if (decl.name.kind !== 71) { + if (links.type === emptyObjectType) { + links.type = getTypeFromBindingPattern(decl.name); + } + assignBindingElementTypes(decl.name); } - assignBindingElementTypes(parameter.valueDeclaration); } } function createPromiseType(promisedType) { @@ -31187,14 +32725,14 @@ var ts; } function checkFunctionExpressionOrObjectLiteralMethod(node, checkMode) { ts.Debug.assert(node.kind !== 151 || ts.isObjectLiteralMethod(node)); - var hasGrammarError = checkGrammarFunctionLikeDeclaration(node); - if (!hasGrammarError && node.kind === 186) { - checkGrammarForGenerator(node); - } if (checkMode === 1 && isContextSensitive(node)) { checkNodeDeferred(node); return anyFunctionType; } + var hasGrammarError = checkGrammarFunctionLikeDeclaration(node); + if (!hasGrammarError && node.kind === 186) { + checkGrammarForGenerator(node); + } var links = getNodeLinks(node); var type = getTypeOfSymbol(node.symbol); if (!(links.flags & 1024)) { @@ -31264,7 +32802,7 @@ var ts; } } function checkArithmeticOperandType(operand, type, diagnostic) { - if (!isTypeAnyOrAllConstituentTypesHaveKind(type, 84)) { + if (!isTypeAssignableToKind(type, 84)) { error(operand, diagnostic); return false; } @@ -31352,8 +32890,13 @@ var ts; if (operandType === silentNeverType) { return silentNeverType; } - if (node.operator === 38 && node.operand.kind === 8) { - return getFreshTypeOfLiteralType(getLiteralType(-node.operand.text)); + if (node.operand.kind === 8) { + if (node.operator === 38) { + return getFreshTypeOfLiteralType(getLiteralType(-node.operand.text)); + } + else if (node.operator === 37) { + return getFreshTypeOfLiteralType(getLiteralType(+node.operand.text)); + } } switch (node.operator) { case 37: @@ -31405,30 +32948,22 @@ var ts; } return false; } - function isTypeOfKind(type, kind) { - if (type.flags & kind) { - return true; - } - if (type.flags & 65536) { - var types = type.types; - for (var _i = 0, types_18 = types; _i < types_18.length; _i++) { - var t = types_18[_i]; - if (!isTypeOfKind(t, kind)) { - return false; - } - } + function isTypeAssignableToKind(source, kind, strict) { + if (source.flags & kind) { return true; } - if (type.flags & 131072) { - var types = type.types; - for (var _a = 0, types_19 = types; _a < types_19.length; _a++) { - var t = types_19[_a]; - if (isTypeOfKind(t, kind)) { - return true; - } - } + if (strict && source.flags & (1 | 1024 | 2048 | 4096)) { + return false; } - return false; + return (kind & 84 && isTypeAssignableTo(source, numberType)) || + (kind & 262178 && isTypeAssignableTo(source, stringType)) || + (kind & 136 && isTypeAssignableTo(source, booleanType)) || + (kind & 1024 && isTypeAssignableTo(source, voidType)) || + (kind & 8192 && isTypeAssignableTo(source, neverType)) || + (kind & 4096 && isTypeAssignableTo(source, nullType)) || + (kind & 2048 && isTypeAssignableTo(source, undefinedType)) || + (kind & 512 && isTypeAssignableTo(source, esSymbolType)) || + (kind & 16777216 && isTypeAssignableTo(source, nonPrimitiveType)); } function isConstEnumObjectType(type) { return getObjectFlags(type) & 16 && type.symbol && isConstEnumSymbol(type.symbol); @@ -31440,7 +32975,7 @@ var ts; if (leftType === silentNeverType || rightType === silentNeverType) { return silentNeverType; } - if (isTypeOfKind(leftType, 8190)) { + if (!isTypeAny(leftType) && isTypeAssignableToKind(leftType, 8190)) { error(left, ts.Diagnostics.The_left_hand_side_of_an_instanceof_expression_must_be_of_type_any_an_object_type_or_a_type_parameter); } if (!(isTypeAny(rightType) || @@ -31457,18 +32992,18 @@ var ts; } leftType = checkNonNullType(leftType, left); rightType = checkNonNullType(rightType, right); - if (!(isTypeComparableTo(leftType, stringType) || isTypeOfKind(leftType, 84 | 512))) { + if (!(isTypeComparableTo(leftType, stringType) || isTypeAssignableToKind(leftType, 84 | 512))) { error(left, ts.Diagnostics.The_left_hand_side_of_an_in_expression_must_be_of_type_any_string_number_or_symbol); } - if (!isTypeAnyOrAllConstituentTypesHaveKind(rightType, 32768 | 540672 | 16777216)) { + if (!isTypeAssignableToKind(rightType, 16777216 | 540672)) { error(right, ts.Diagnostics.The_right_hand_side_of_an_in_expression_must_be_of_type_any_an_object_type_or_a_type_parameter); } return booleanType; } function checkObjectLiteralAssignment(node, sourceType) { var properties = node.properties; - for (var _i = 0, properties_6 = properties; _i < properties_6.length; _i++) { - var p = properties_6[_i]; + for (var _i = 0, properties_7 = properties; _i < properties_7.length; _i++) { + var p = properties_7[_i]; checkObjectLiteralDestructuringPropertyAssignment(sourceType, p, properties); } return sourceType; @@ -31724,24 +33259,22 @@ var ts; if (leftType === silentNeverType || rightType === silentNeverType) { return silentNeverType; } - if (!isTypeOfKind(leftType, 1 | 262178) && !isTypeOfKind(rightType, 1 | 262178)) { + if (!isTypeAssignableToKind(leftType, 262178) && !isTypeAssignableToKind(rightType, 262178)) { leftType = checkNonNullType(leftType, left); rightType = checkNonNullType(rightType, right); } var resultType = void 0; - if (isTypeOfKind(leftType, 84) && isTypeOfKind(rightType, 84)) { + if (isTypeAssignableToKind(leftType, 84, true) && isTypeAssignableToKind(rightType, 84, true)) { resultType = numberType; } - else { - if (isTypeOfKind(leftType, 262178) || isTypeOfKind(rightType, 262178)) { - resultType = stringType; - } - else if (isTypeAny(leftType) || isTypeAny(rightType)) { - resultType = leftType === unknownType || rightType === unknownType ? unknownType : anyType; - } - if (resultType && !checkForDisallowedESSymbolOperand(operator)) { - return resultType; - } + else if (isTypeAssignableToKind(leftType, 262178, true) || isTypeAssignableToKind(rightType, 262178, true)) { + resultType = stringType; + } + else if (isTypeAny(leftType) || isTypeAny(rightType)) { + resultType = leftType === unknownType || rightType === unknownType ? unknownType : anyType; + } + if (resultType && !checkForDisallowedESSymbolOperand(operator)) { + return resultType; } if (!resultType) { reportOperatorError(); @@ -31906,13 +33439,12 @@ var ts; return getBestChoiceType(type1, type2); } function checkLiteralExpression(node) { - if (node.kind === 8) { - checkGrammarNumericLiteral(node); - } switch (node.kind) { + case 13: case 9: return getFreshTypeOfLiteralType(getLiteralType(node.text)); case 8: + checkGrammarNumericLiteral(node); return getFreshTypeOfLiteralType(getLiteralType(+node.text)); case 101: return trueType; @@ -32060,6 +33592,7 @@ var ts; return checkSuperExpression(node); case 95: return nullWideningType; + case 13: case 9: case 8: case 101: @@ -32067,8 +33600,6 @@ var ts; return checkLiteralExpression(node); case 196: return checkTemplateExpression(node); - case 13: - return stringType; case 12: return globalRegExpType; case 177: @@ -32159,7 +33690,7 @@ var ts; checkGrammarDecorators(node) || checkGrammarModifiers(node); checkVariableLikeDeclaration(node); var func = ts.getContainingFunction(node); - if (ts.getModifierFlags(node) & 92) { + if (ts.hasModifier(node, 92)) { func = ts.getContainingFunction(node); if (!(func.kind === 152 && ts.nodeIsPresent(func.body))) { error(node, ts.Diagnostics.A_parameter_property_is_only_allowed_in_a_constructor_implementation); @@ -32329,6 +33860,13 @@ var ts; } } function checkClassForDuplicateDeclarations(node) { + var Declaration; + (function (Declaration) { + Declaration[Declaration["Getter"] = 1] = "Getter"; + Declaration[Declaration["Setter"] = 2] = "Setter"; + Declaration[Declaration["Method"] = 4] = "Method"; + Declaration[Declaration["Property"] = 3] = "Property"; + })(Declaration || (Declaration = {})); var instanceNames = ts.createUnderscoreEscapedMap(); var staticNames = ts.createUnderscoreEscapedMap(); for (var _i = 0, _a = node.members; _i < _a.length; _i++) { @@ -32342,7 +33880,7 @@ var ts; } } else { - var isStatic = ts.getModifierFlags(member) & 32; + var isStatic = ts.hasModifier(member, 32); var names = isStatic ? staticNames : instanceNames; var memberName = member.name && ts.getPropertyNameForPropertyNameNode(member.name); if (memberName) { @@ -32387,7 +33925,7 @@ var ts; for (var _i = 0, _a = node.members; _i < _a.length; _i++) { var member = _a[_i]; var memberNameNode = member.name; - var isStatic = ts.getModifierFlags(member) & 32; + var isStatic = ts.hasModifier(member, 32); if (isStatic && memberNameNode) { var memberName = ts.getPropertyNameForPropertyNameNode(memberNameNode); switch (memberName) { @@ -32475,7 +34013,7 @@ var ts; function checkMethodDeclaration(node) { checkGrammarMethod(node) || checkGrammarComputedPropertyName(node.name); checkFunctionOrMethodDeclaration(node); - if (ts.getModifierFlags(node) & 128 && node.body) { + if (ts.hasModifier(node, 128) && node.body) { error(node, ts.Diagnostics.Method_0_cannot_have_an_implementation_because_it_is_marked_abstract, ts.declarationNameToString(node.name)); } } @@ -32511,17 +34049,9 @@ var ts; } return ts.forEachChild(n, containsSuperCall); } - function markThisReferencesAsErrors(n) { - if (n.kind === 99) { - error(n, ts.Diagnostics.this_cannot_be_referenced_in_current_location); - } - else if (n.kind !== 186 && n.kind !== 228) { - ts.forEachChild(n, markThisReferencesAsErrors); - } - } function isInstancePropertyWithInitializer(n) { return n.kind === 149 && - !(ts.getModifierFlags(n) & 32) && + !ts.hasModifier(n, 32) && !!n.initializer; } var containingClassDecl = node.parent; @@ -32533,8 +34063,8 @@ var ts; if (classExtendsNull) { error(superCall, ts.Diagnostics.A_constructor_cannot_contain_a_super_call_when_its_class_extends_null); } - var superCallShouldBeFirst = ts.forEach(node.parent.members, isInstancePropertyWithInitializer) || - ts.forEach(node.parameters, function (p) { return ts.getModifierFlags(p) & 92; }); + var superCallShouldBeFirst = ts.some(node.parent.members, isInstancePropertyWithInitializer) || + ts.some(node.parameters, function (p) { return ts.hasModifier(p, 92); }); if (superCallShouldBeFirst) { var statements = node.body.statements; var superCallStatement = void 0; @@ -32577,10 +34107,12 @@ var ts; var otherKind = node.kind === 153 ? 154 : 153; var otherAccessor = ts.getDeclarationOfKind(node.symbol, otherKind); if (otherAccessor) { - if ((ts.getModifierFlags(node) & 28) !== (ts.getModifierFlags(otherAccessor) & 28)) { + var nodeFlags = ts.getModifierFlags(node); + var otherFlags = ts.getModifierFlags(otherAccessor); + if ((nodeFlags & 28) !== (otherFlags & 28)) { error(node.name, ts.Diagnostics.Getter_and_setter_accessors_do_not_agree_in_visibility); } - if (ts.hasModifier(node, 128) !== ts.hasModifier(otherAccessor, 128)) { + if ((nodeFlags & 128) !== (otherFlags & 128)) { error(node.name, ts.Diagnostics.Accessors_must_both_be_abstract_or_non_abstract); } checkAccessorDeclarationTypesIdentical(node, otherAccessor, getAnnotatedAccessorType, ts.Diagnostics.get_and_set_accessor_must_have_the_same_type); @@ -32626,7 +34158,7 @@ var ts; function checkTypeReferenceNode(node) { checkGrammarTypeArguments(node, node.typeArguments); if (node.kind === 159 && node.typeName.jsdocDotPos !== undefined && !ts.isInJavaScriptFile(node) && !ts.isInJSDoc(node)) { - grammarErrorAtPos(ts.getSourceFileOfNode(node), node.typeName.jsdocDotPos, 1, ts.Diagnostics.JSDoc_types_can_only_be_used_inside_documentation_comments); + grammarErrorAtPos(node, node.typeName.jsdocDotPos, 1, ts.Diagnostics.JSDoc_types_can_only_be_used_inside_documentation_comments); } var type = getTypeFromTypeReference(node); if (type !== unknownType) { @@ -32634,7 +34166,14 @@ var ts; ts.forEach(node.typeArguments, checkSourceElement); if (produceDiagnostics) { var symbol = getNodeLinks(node).resolvedSymbol; - var typeParameters = symbol.flags & 524288 ? getSymbolLinks(symbol).typeParameters : type.target.localTypeParameters; + if (!symbol) { + error(node, ts.Diagnostics.Type_0_is_not_generic, typeToString(type)); + return; + } + var typeParameters = symbol.flags & 524288 && getSymbolLinks(symbol).typeParameters; + if (!typeParameters && getObjectFlags(type) & 4) { + typeParameters = type.target.localTypeParameters; + } checkTypeArgumentConstraints(typeParameters, node.typeArguments); } } @@ -32677,16 +34216,15 @@ var ts; if (isTypeAssignableTo(indexType, getIndexType(objectType))) { return type; } - if (maybeTypeOfKind(objectType, 540672) && isTypeOfKind(indexType, 84)) { - var constraint = getBaseConstraintOfType(objectType); - if (constraint && getIndexInfoOfType(constraint, 1)) { - return type; - } + if (getIndexInfoOfType(getApparentType(objectType), 1) && isTypeAssignableToKind(indexType, 84)) { + return type; } error(accessNode, ts.Diagnostics.Type_0_cannot_be_used_to_index_type_1, typeToString(indexType), typeToString(objectType)); return type; } function checkIndexedAccessType(node) { + checkSourceElement(node.objectType); + checkSourceElement(node.indexType); checkIndexedAccessIndexType(getTypeFromIndexedAccessTypeNode(node), node); } function checkMappedType(node) { @@ -32697,7 +34235,7 @@ var ts; checkTypeAssignableTo(constraintType, stringType, node.typeParameter.constraint); } function isPrivateWithinAmbient(node) { - return (ts.getModifierFlags(node) & 8) && ts.isInAmbientContext(node); + return ts.hasModifier(node, 8) && ts.isInAmbientContext(node); } function getEffectiveDeclarationFlags(n, flagsToCheck) { var flags = ts.getCombinedModifierFlags(n); @@ -32784,9 +34322,9 @@ var ts; (ts.isComputedPropertyName(node.name) && ts.isComputedPropertyName(subsequentName) || !ts.isComputedPropertyName(node.name) && !ts.isComputedPropertyName(subsequentName) && ts.getEscapedTextOfIdentifierOrLiteral(node.name) === ts.getEscapedTextOfIdentifierOrLiteral(subsequentName))) { var reportError = (node.kind === 151 || node.kind === 150) && - (ts.getModifierFlags(node) & 32) !== (ts.getModifierFlags(subsequentNode) & 32); + ts.hasModifier(node, 32) !== ts.hasModifier(subsequentNode, 32); if (reportError) { - var diagnostic = ts.getModifierFlags(node) & 32 ? ts.Diagnostics.Function_overload_must_be_static : ts.Diagnostics.Function_overload_must_not_be_static; + var diagnostic = ts.hasModifier(node, 32) ? ts.Diagnostics.Function_overload_must_be_static : ts.Diagnostics.Function_overload_must_not_be_static; error(errorNode_1, diagnostic); } return; @@ -32802,7 +34340,7 @@ var ts; error(errorNode, ts.Diagnostics.Constructor_implementation_is_missing); } else { - if (ts.getModifierFlags(node) & 128) { + if (ts.hasModifier(node, 128)) { error(errorNode, ts.Diagnostics.All_declarations_of_an_abstract_method_must_be_consecutive); } else { @@ -32812,8 +34350,8 @@ var ts; } var duplicateFunctionDeclaration = false; var multipleConstructorImplementation = false; - for (var _i = 0, declarations_5 = declarations; _i < declarations_5.length; _i++) { - var current = declarations_5[_i]; + for (var _i = 0, declarations_4 = declarations; _i < declarations_4.length; _i++) { + var current = declarations_4[_i]; var node = current; var inAmbientContext = ts.isInAmbientContext(node); var inAmbientContextOrInterface = node.parent.kind === 230 || node.parent.kind === 163 || inAmbientContext; @@ -32862,7 +34400,7 @@ var ts; }); } if (lastSeenNonAmbientDeclaration && !lastSeenNonAmbientDeclaration.body && - !(ts.getModifierFlags(lastSeenNonAmbientDeclaration) & 128) && !lastSeenNonAmbientDeclaration.questionToken) { + !ts.hasModifier(lastSeenNonAmbientDeclaration, 128) && !lastSeenNonAmbientDeclaration.questionToken) { reportImplementationExpectedError(lastSeenNonAmbientDeclaration); } if (hasOverloads) { @@ -32930,6 +34468,13 @@ var ts; } } } + var DeclarationSpaces; + (function (DeclarationSpaces) { + DeclarationSpaces[DeclarationSpaces["None"] = 0] = "None"; + DeclarationSpaces[DeclarationSpaces["ExportValue"] = 1] = "ExportValue"; + DeclarationSpaces[DeclarationSpaces["ExportType"] = 2] = "ExportType"; + DeclarationSpaces[DeclarationSpaces["ExportNamespace"] = 4] = "ExportNamespace"; + })(DeclarationSpaces || (DeclarationSpaces = {})); function getDeclarationSpaces(d) { switch (d.kind) { case 230: @@ -33264,7 +34809,7 @@ var ts; if (!ts.hasDynamicName(node)) { var symbol = getSymbolOfNode(node); var localSymbol = node.localSymbol || symbol; - var firstDeclaration = ts.find(localSymbol.declarations, function (declaration) { return declaration.kind === node.kind && !ts.isSourceFileJavaScript(ts.getSourceFileOfNode(declaration)); }); + var firstDeclaration = ts.find(localSymbol.declarations, function (declaration) { return declaration.kind === node.kind && !(declaration.flags & 65536); }); if (node === firstDeclaration) { checkFunctionOrConstructorSymbol(localSymbol); } @@ -33399,14 +34944,14 @@ var ts; for (var _i = 0, _a = node.members; _i < _a.length; _i++) { var member = _a[_i]; if (member.kind === 151 || member.kind === 149) { - if (!member.symbol.isReferenced && ts.getModifierFlags(member) & 8) { + if (!member.symbol.isReferenced && ts.hasModifier(member, 8)) { error(member.name, ts.Diagnostics._0_is_declared_but_never_used, ts.unescapeLeadingUnderscores(member.symbol.escapedName)); } } else if (member.kind === 152) { for (var _b = 0, _c = member.parameters; _b < _c.length; _b++) { var parameter = _c[_b]; - if (!parameter.symbol.isReferenced && ts.getModifierFlags(parameter) & 8) { + if (!parameter.symbol.isReferenced && ts.hasModifier(parameter, 8)) { error(parameter.name, ts.Diagnostics.Property_0_is_declared_but_never_used, ts.unescapeLeadingUnderscores(parameter.symbol.escapedName)); } } @@ -33746,7 +35291,7 @@ var ts; 128 | 64 | 32; - return (ts.getModifierFlags(left) & interestingFlags) === (ts.getModifierFlags(right) & interestingFlags); + return ts.getSelectedModifierFlags(left, interestingFlags) === ts.getSelectedModifierFlags(right, interestingFlags); } function checkVariableDeclaration(node) { checkGrammarVariableDeclaration(node); @@ -33876,7 +35421,7 @@ var ts; checkReferenceExpression(varExpr, ts.Diagnostics.The_left_hand_side_of_a_for_in_statement_must_be_a_variable_or_a_property_access); } } - if (!isTypeAnyOrAllConstituentTypesHaveKind(rightType, 32768 | 540672 | 16777216)) { + if (!isTypeAssignableToKind(rightType, 16777216 | 540672)) { error(node.expression, ts.Diagnostics.The_right_hand_side_of_a_for_in_statement_must_be_of_type_any_an_object_type_or_a_type_parameter); } checkSourceElement(node.statement); @@ -34248,7 +35793,7 @@ var ts; var classDeclaration = type.symbol.valueDeclaration; for (var _i = 0, _a = classDeclaration.members; _i < _a.length; _i++) { var member = _a[_i]; - if (!(ts.getModifierFlags(member) & 32) && ts.hasDynamicName(member)) { + if (!ts.hasModifier(member, 32) && ts.hasDynamicName(member)) { var propType = getTypeOfSymbol(member.symbol); checkIndexConstraintForProperty(member.symbol, propType, type, declaredStringIndexer, stringIndexType, 0); checkIndexConstraintForProperty(member.symbol, propType, type, declaredNumberIndexer, numberIndexType, 1); @@ -34345,8 +35890,8 @@ var ts; var type = getDeclaredTypeOfSymbol(symbol); if (!areTypeParametersIdentical(declarations, type.localTypeParameters)) { var name = symbolToString(symbol); - for (var _i = 0, declarations_6 = declarations; _i < declarations_6.length; _i++) { - var declaration = declarations_6[_i]; + for (var _i = 0, declarations_5 = declarations; _i < declarations_5.length; _i++) { + var declaration = declarations_5[_i]; error(declaration.name, ts.Diagnostics.All_declarations_of_0_must_have_identical_type_parameters, name); } } @@ -34355,8 +35900,8 @@ var ts; function areTypeParametersIdentical(declarations, typeParameters) { var maxTypeArgumentCount = ts.length(typeParameters); var minTypeArgumentCount = getMinTypeArgumentCount(typeParameters); - for (var _i = 0, declarations_7 = declarations; _i < declarations_7.length; _i++) { - var declaration = declarations_7[_i]; + for (var _i = 0, declarations_6 = declarations; _i < declarations_6.length; _i++) { + var declaration = declarations_6[_i]; var numTypeParameters = ts.length(declaration.typeParameters); if (numTypeParameters < minTypeArgumentCount || numTypeParameters > maxTypeArgumentCount) { return false; @@ -34392,7 +35937,7 @@ var ts; registerForUnusedIdentifiersCheck(node); } function checkClassDeclaration(node) { - if (!node.name && !(ts.getModifierFlags(node) & 512)) { + if (!node.name && !ts.hasModifier(node, 512)) { grammarErrorOnFirstToken(node, ts.Diagnostics.A_class_declaration_without_the_default_modifier_must_have_a_name); } checkClassLikeDeclaration(node); @@ -34485,7 +36030,7 @@ var ts; var signatures = getSignaturesOfType(type, 1); if (signatures.length) { var declaration = signatures[0].declaration; - if (declaration && ts.getModifierFlags(declaration) & 8) { + if (declaration && ts.hasModifier(declaration, 8)) { var typeClassDeclaration = getClassLikeDeclarationOfSymbol(type.symbol); if (!isNodeWithinClass(node, typeClassDeclaration)) { error(node, ts.Diagnostics.Cannot_extend_a_class_0_Class_constructor_is_marked_as_private, getFullyQualifiedName(type.symbol)); @@ -34518,7 +36063,7 @@ var ts; if (derived) { if (derived === base) { var derivedClassDecl = getClassLikeDeclarationOfSymbol(type.symbol); - if (baseDeclarationFlags & 128 && (!derivedClassDecl || !(ts.getModifierFlags(derivedClassDecl) & 128))) { + if (baseDeclarationFlags & 128 && (!derivedClassDecl || !ts.hasModifier(derivedClassDecl, 128))) { if (derivedClassDecl.kind === 199) { error(derivedClassDecl, ts.Diagnostics.Non_abstract_class_expression_does_not_implement_inherited_abstract_member_0_from_class_1, symbolToString(baseProperty), typeToString(baseType)); } @@ -34566,8 +36111,8 @@ var ts; for (var _i = 0, baseTypes_2 = baseTypes; _i < baseTypes_2.length; _i++) { var base = baseTypes_2[_i]; var properties = getPropertiesOfType(getTypeWithThisArgument(base, type.thisType)); - for (var _a = 0, properties_7 = properties; _a < properties_7.length; _a++) { - var prop = properties_7[_a]; + for (var _a = 0, properties_8 = properties; _a < properties_8.length; _a++) { + var prop = properties_8[_a]; var existing = seen.get(prop.escapedName); if (!existing) { seen.set(prop.escapedName, { prop: prop, containingType: base }); @@ -34821,8 +36366,8 @@ var ts; } function getFirstNonAmbientClassOrFunctionDeclaration(symbol) { var declarations = symbol.declarations; - for (var _i = 0, declarations_8 = declarations; _i < declarations_8.length; _i++) { - var declaration = declarations_8[_i]; + for (var _i = 0, declarations_7 = declarations; _i < declarations_7.length; _i++) { + var declaration = declarations_7[_i]; if ((declaration.kind === 229 || (declaration.kind === 228 && ts.nodeIsPresent(declaration.body))) && !ts.isInAmbientContext(declaration)) { @@ -35037,7 +36582,7 @@ var ts; if (checkGrammarModuleElementContext(node, ts.Diagnostics.An_import_declaration_can_only_be_used_in_a_namespace_or_module)) { return; } - if (!checkGrammarDecorators(node) && !checkGrammarModifiers(node) && ts.getModifierFlags(node) !== 0) { + if (!checkGrammarDecorators(node) && !checkGrammarModifiers(node) && ts.hasModifiers(node)) { grammarErrorOnFirstToken(node, ts.Diagnostics.An_import_declaration_cannot_have_modifiers); } if (checkExternalImportOrExportDeclaration(node)) { @@ -35064,7 +36609,7 @@ var ts; checkGrammarDecorators(node) || checkGrammarModifiers(node); if (ts.isInternalModuleImportEqualsDeclaration(node) || checkExternalImportOrExportDeclaration(node)) { checkImportBinding(node); - if (ts.getModifierFlags(node) & 1) { + if (ts.hasModifier(node, 1)) { markExportAsReferenced(node); } if (ts.isInternalModuleImportEqualsDeclaration(node)) { @@ -35092,7 +36637,7 @@ var ts; if (checkGrammarModuleElementContext(node, ts.Diagnostics.An_export_declaration_can_only_be_used_in_a_module)) { return; } - if (!checkGrammarDecorators(node) && !checkGrammarModifiers(node) && ts.getModifierFlags(node) !== 0) { + if (!checkGrammarDecorators(node) && !checkGrammarModifiers(node) && ts.hasModifiers(node)) { grammarErrorOnFirstToken(node, ts.Diagnostics.An_export_declaration_cannot_have_modifiers); } if (!node.moduleSpecifier || checkExternalImportOrExportDeclaration(node)) { @@ -35150,7 +36695,7 @@ var ts; } return; } - if (!checkGrammarDecorators(node) && !checkGrammarModifiers(node) && ts.getModifierFlags(node) !== 0) { + if (!checkGrammarDecorators(node) && !checkGrammarModifiers(node) && ts.hasModifiers(node)) { grammarErrorOnFirstToken(node, ts.Diagnostics.An_export_assignment_cannot_have_modifiers); } if (node.expression.kind === 71) { @@ -35197,8 +36742,8 @@ var ts; return; } if (exportedDeclarationsCount > 1) { - for (var _i = 0, declarations_9 = declarations; _i < declarations_9.length; _i++) { - var declaration = declarations_9[_i]; + for (var _i = 0, declarations_8 = declarations; _i < declarations_8.length; _i++) { + var declaration = declarations_8[_i]; if (isNotOverload(declaration)) { diagnostics.add(ts.createDiagnosticForNode(declaration, ts.Diagnostics.Cannot_redeclare_exported_variable_0, ts.unescapeLeadingUnderscores(id))); } @@ -35476,7 +37021,7 @@ var ts; return []; } var symbols = ts.createSymbolTable(); - var memberFlags = 0; + var isStatic = false; populateSymbols(); return symbolsToArray(symbols); function populateSymbols() { @@ -35498,7 +37043,7 @@ var ts; } case 229: case 230: - if (!(memberFlags & 32)) { + if (!isStatic) { copySymbols(getSymbolOfNode(location).members, meaning & 793064); } break; @@ -35512,7 +37057,7 @@ var ts; if (ts.introducesArgumentsExoticObject(location)) { copySymbol(argumentsSymbol, meaning); } - memberFlags = ts.getModifierFlags(location); + isStatic = ts.hasModifier(location, 32); location = location.parent; } copySymbols(globals, meaning); @@ -35747,12 +37292,7 @@ var ts; case 8: if (node.parent.kind === 180 && node.parent.argumentExpression === node) { var objectType = getTypeOfExpression(node.parent.expression); - if (objectType === unknownType) - return undefined; - var apparentType = getApparentType(objectType); - if (apparentType === unknownType) - return undefined; - return getPropertyOfType(apparentType, node.text); + return getPropertyOfType(objectType, node.text); } break; } @@ -35848,7 +37388,7 @@ var ts; } function getParentTypeOfClassElement(node) { var classSymbol = getSymbolOfNode(node.parent); - return ts.getModifierFlags(node) & 32 + return ts.hasModifier(node, 32) ? getTypeOfSymbol(classSymbol) : getDeclaredTypeOfSymbol(classSymbol); } @@ -36073,13 +37613,13 @@ var ts; return strictNullChecks && !isOptionalParameter(parameter) && parameter.initializer && - !(ts.getModifierFlags(parameter) & 92); + !ts.hasModifier(parameter, 92); } function isOptionalUninitializedParameterProperty(parameter) { return strictNullChecks && isOptionalParameter(parameter) && !parameter.initializer && - !!(ts.getModifierFlags(parameter) & 92); + ts.hasModifier(parameter, 92); } function getNodeCheckFlags(node) { return getNodeLinks(node).flags; @@ -36135,22 +37675,22 @@ var ts; else if (type.flags & 1) { return ts.TypeReferenceSerializationKind.ObjectType; } - else if (isTypeOfKind(type, 1024 | 6144 | 8192)) { + else if (isTypeAssignableToKind(type, 1024 | 6144 | 8192)) { return ts.TypeReferenceSerializationKind.VoidNullableOrNeverType; } - else if (isTypeOfKind(type, 136)) { + else if (isTypeAssignableToKind(type, 136)) { return ts.TypeReferenceSerializationKind.BooleanType; } - else if (isTypeOfKind(type, 84)) { + else if (isTypeAssignableToKind(type, 84)) { return ts.TypeReferenceSerializationKind.NumberLikeType; } - else if (isTypeOfKind(type, 262178)) { + else if (isTypeAssignableToKind(type, 262178)) { return ts.TypeReferenceSerializationKind.StringLikeType; } else if (isTupleType(type)) { return ts.TypeReferenceSerializationKind.ArrayLikeType; } - else if (isTypeOfKind(type, 512)) { + else if (isTypeAssignableToKind(type, 512)) { return ts.TypeReferenceSerializationKind.ESSymbolType; } else if (isFunctionType(type)) { @@ -36615,7 +38155,7 @@ var ts; node.kind !== 154) { return grammarErrorOnNode(modifier, ts.Diagnostics.abstract_modifier_can_only_appear_on_a_class_method_or_property_declaration); } - if (!(node.parent.kind === 229 && ts.getModifierFlags(node.parent) & 128)) { + if (!(node.parent.kind === 229 && ts.hasModifier(node.parent, 128))) { return grammarErrorOnNode(modifier, ts.Diagnostics.Abstract_methods_can_only_appear_within_an_abstract_class); } if (flags & 32) { @@ -36734,8 +38274,7 @@ var ts; if (list && list.hasTrailingComma) { var start = list.end - ",".length; var end = list.end; - var sourceFile = ts.getSourceFileOfNode(list[0]); - return grammarErrorAtPos(sourceFile, start, end - start, ts.Diagnostics.Trailing_comma_not_allowed); + return grammarErrorAtPos(list[0], start, end - start, ts.Diagnostics.Trailing_comma_not_allowed); } } function checkGrammarTypeParameterList(typeParameters, file) { @@ -36811,7 +38350,7 @@ var ts; if (parameter.dotDotDotToken) { return grammarErrorOnNode(parameter.dotDotDotToken, ts.Diagnostics.An_index_signature_cannot_have_a_rest_parameter); } - if (ts.getModifierFlags(parameter) !== 0) { + if (ts.hasModifiers(parameter)) { return grammarErrorOnNode(parameter.name, ts.Diagnostics.An_index_signature_parameter_cannot_have_an_accessibility_modifier); } if (parameter.questionToken) { @@ -36845,19 +38384,18 @@ var ts; return checkGrammarForDisallowedTrailingComma(typeArguments) || checkGrammarForAtLeastOneTypeArgument(node, typeArguments); } - function checkGrammarForOmittedArgument(node, args) { + function checkGrammarForOmittedArgument(args) { if (args) { - var sourceFile = ts.getSourceFileOfNode(node); for (var _i = 0, args_5 = args; _i < args_5.length; _i++) { var arg = args_5[_i]; if (arg.kind === 200) { - return grammarErrorAtPos(sourceFile, arg.pos, 0, ts.Diagnostics.Argument_expression_expected); + return grammarErrorAtPos(arg, arg.pos, 0, ts.Diagnostics.Argument_expression_expected); } } } } - function checkGrammarArguments(node, args) { - return checkGrammarForOmittedArgument(node, args); + function checkGrammarArguments(args) { + return checkGrammarForOmittedArgument(args); } function checkGrammarHeritageClause(node) { var types = node.types; @@ -36866,8 +38404,7 @@ var ts; } if (types && types.length === 0) { var listType = ts.tokenToString(node.token); - var sourceFile = ts.getSourceFileOfNode(node); - return grammarErrorAtPos(sourceFile, types.pos, 0, ts.Diagnostics._0_list_cannot_be_empty, listType); + return grammarErrorAtPos(node, types.pos, 0, ts.Diagnostics._0_list_cannot_be_empty, listType); } return ts.forEach(types, checkGrammarExpressionWithTypeArguments); } @@ -37090,10 +38627,10 @@ var ts; else if (ts.isInAmbientContext(accessor)) { return grammarErrorOnNode(accessor.name, ts.Diagnostics.An_accessor_cannot_be_declared_in_an_ambient_context); } - else if (accessor.body === undefined && !(ts.getModifierFlags(accessor) & 128)) { - return grammarErrorAtPos(ts.getSourceFileOfNode(accessor), accessor.end - 1, ";".length, ts.Diagnostics._0_expected, "{"); + else if (accessor.body === undefined && !ts.hasModifier(accessor, 128)) { + return grammarErrorAtPos(accessor, accessor.end - 1, ";".length, ts.Diagnostics._0_expected, "{"); } - else if (accessor.body && ts.getModifierFlags(accessor) & 128) { + else if (accessor.body && ts.hasModifier(accessor, 128)) { return grammarErrorOnNode(accessor, ts.Diagnostics.An_abstract_accessor_cannot_have_an_implementation); } else if (accessor.typeParameters) { @@ -37146,7 +38683,7 @@ var ts; return true; } else if (node.body === undefined) { - return grammarErrorAtPos(ts.getSourceFileOfNode(node), node.end - 1, ";".length, ts.Diagnostics._0_expected, "{"); + return grammarErrorAtPos(node, node.end - 1, ";".length, ts.Diagnostics._0_expected, "{"); } } if (ts.isClassLike(node.parent)) { @@ -37217,7 +38754,7 @@ var ts; return grammarErrorOnNode(node.name, ts.Diagnostics.A_rest_element_cannot_contain_a_binding_pattern); } if (node.initializer) { - return grammarErrorAtPos(ts.getSourceFileOfNode(node), node.initializer.pos - 1, 1, ts.Diagnostics.A_rest_element_cannot_have_an_initializer); + return grammarErrorAtPos(node, node.initializer.pos - 1, 1, ts.Diagnostics.A_rest_element_cannot_have_an_initializer); } } } @@ -37237,12 +38774,12 @@ var ts; } else { var equalsTokenLength = "=".length; - return grammarErrorAtPos(ts.getSourceFileOfNode(node), node.initializer.pos - equalsTokenLength, equalsTokenLength, ts.Diagnostics.Initializers_are_not_allowed_in_ambient_contexts); + return grammarErrorAtPos(node, node.initializer.pos - equalsTokenLength, equalsTokenLength, ts.Diagnostics.Initializers_are_not_allowed_in_ambient_contexts); } } if (node.initializer && !(ts.isConst(node) && isStringOrNumberLiteralExpression(node.initializer))) { var equalsTokenLength = "=".length; - return grammarErrorAtPos(ts.getSourceFileOfNode(node), node.initializer.pos - equalsTokenLength, equalsTokenLength, ts.Diagnostics.Initializers_are_not_allowed_in_ambient_contexts); + return grammarErrorAtPos(node, node.initializer.pos - equalsTokenLength, equalsTokenLength, ts.Diagnostics.Initializers_are_not_allowed_in_ambient_contexts); } } else if (!node.initializer) { @@ -37299,7 +38836,7 @@ var ts; return true; } if (!declarationList.declarations.length) { - return grammarErrorAtPos(ts.getSourceFileOfNode(declarationList), declarations.pos, declarations.end - declarations.pos, ts.Diagnostics.Variable_declaration_list_cannot_be_empty); + return grammarErrorAtPos(declarationList, declarations.pos, declarations.end - declarations.pos, ts.Diagnostics.Variable_declaration_list_cannot_be_empty); } } function allowLetAndConstDeclarations(parent) { @@ -37345,7 +38882,8 @@ var ts; return true; } } - function grammarErrorAtPos(sourceFile, start, length, message, arg0, arg1, arg2) { + function grammarErrorAtPos(nodeForSourceFile, start, length, message, arg0, arg1, arg2) { + var sourceFile = ts.getSourceFileOfNode(nodeForSourceFile); if (!hasParseDiagnostics(sourceFile)) { diagnostics.add(ts.createFileDiagnostic(sourceFile, start, length, message, arg0, arg1, arg2)); return true; @@ -37360,7 +38898,7 @@ var ts; } function checkGrammarConstructorTypeParameters(node) { if (node.typeParameters) { - return grammarErrorAtPos(ts.getSourceFileOfNode(node), node.typeParameters.pos, node.typeParameters.end - node.typeParameters.pos, ts.Diagnostics.Type_parameters_cannot_appear_on_a_constructor_declaration); + return grammarErrorAtPos(node, node.typeParameters.pos, node.typeParameters.end - node.typeParameters.pos, ts.Diagnostics.Type_parameters_cannot_appear_on_a_constructor_declaration); } } function checkGrammarConstructorTypeAnnotation(node) { @@ -37402,7 +38940,7 @@ var ts; node.kind === 244 || node.kind === 243 || node.kind === 236 || - ts.getModifierFlags(node) & (2 | 1 | 512)) { + ts.hasModifier(node, 2 | 1 | 512)) { return false; } return grammarErrorOnFirstToken(node, ts.Diagnostics.A_declare_modifier_is_required_for_a_top_level_declaration_in_a_d_ts_file); @@ -40171,27 +41709,27 @@ var ts; function createExpressionForAccessorDeclaration(properties, property, receiver, multiLine) { var _a = ts.getAllAccessorDeclarations(properties, property), firstAccessor = _a.firstAccessor, getAccessor = _a.getAccessor, setAccessor = _a.setAccessor; if (property === firstAccessor) { - var properties_8 = []; + var properties_9 = []; if (getAccessor) { var getterFunction = ts.createFunctionExpression(getAccessor.modifiers, undefined, undefined, undefined, getAccessor.parameters, undefined, getAccessor.body); ts.setTextRange(getterFunction, getAccessor); ts.setOriginalNode(getterFunction, getAccessor); var getter = ts.createPropertyAssignment("get", getterFunction); - properties_8.push(getter); + properties_9.push(getter); } if (setAccessor) { var setterFunction = ts.createFunctionExpression(setAccessor.modifiers, undefined, undefined, undefined, setAccessor.parameters, undefined, setAccessor.body); ts.setTextRange(setterFunction, setAccessor); ts.setOriginalNode(setterFunction, setAccessor); var setter = ts.createPropertyAssignment("set", setterFunction); - properties_8.push(setter); + properties_9.push(setter); } - properties_8.push(ts.createPropertyAssignment("enumerable", ts.createTrue())); - properties_8.push(ts.createPropertyAssignment("configurable", ts.createTrue())); + properties_9.push(ts.createPropertyAssignment("enumerable", ts.createTrue())); + properties_9.push(ts.createPropertyAssignment("configurable", ts.createTrue())); var expression = ts.setTextRange(ts.createCall(ts.createPropertyAccess(ts.createIdentifier("Object"), "defineProperty"), undefined, [ receiver, createExpressionForPropertyName(property.name), - ts.createObjectLiteral(properties_8, multiLine) + ts.createObjectLiteral(properties_9, multiLine) ]), firstAccessor); return ts.aggregateTransformFlags(expression); } @@ -40597,6 +42135,13 @@ var ts; return body; } ts.parenthesizeConciseBody = parenthesizeConciseBody; + var OuterExpressionKinds; + (function (OuterExpressionKinds) { + OuterExpressionKinds[OuterExpressionKinds["Parentheses"] = 1] = "Parentheses"; + OuterExpressionKinds[OuterExpressionKinds["Assertions"] = 2] = "Assertions"; + OuterExpressionKinds[OuterExpressionKinds["PartiallyEmittedExpressions"] = 4] = "PartiallyEmittedExpressions"; + OuterExpressionKinds[OuterExpressionKinds["All"] = 7] = "All"; + })(OuterExpressionKinds = ts.OuterExpressionKinds || (ts.OuterExpressionKinds = {})); function isOuterExpression(node, kinds) { if (kinds === void 0) { kinds = 7; } switch (node.kind) { @@ -41929,6 +43474,11 @@ var ts; })(ts || (ts = {})); var ts; (function (ts) { + var FlattenLevel; + (function (FlattenLevel) { + FlattenLevel[FlattenLevel["All"] = 0] = "All"; + FlattenLevel[FlattenLevel["ObjectRest"] = 1] = "ObjectRest"; + })(FlattenLevel = ts.FlattenLevel || (ts.FlattenLevel = {})); function flattenDestructuringAssignment(node, visitor, context, level, needsValue, createAssignmentCallback) { var location = node; var value; @@ -42119,7 +43669,8 @@ var ts; ? undefined : numElements, location), false, location); } - else if (numElements !== 1 && (flattenContext.level < 1 || numElements === 0)) { + else if (numElements !== 1 && (flattenContext.level < 1 || numElements === 0) + || ts.every(elements, ts.isOmittedExpression)) { var reuseIdentifierExpressions = !ts.isDeclarationBindingElement(parent) || numElements !== 0; value = ensureIdentifier(flattenContext, value, reuseIdentifierExpressions, location); } @@ -42248,6 +43799,28 @@ var ts; var ts; (function (ts) { var USE_NEW_TYPE_METADATA_FORMAT = false; + var TypeScriptSubstitutionFlags; + (function (TypeScriptSubstitutionFlags) { + TypeScriptSubstitutionFlags[TypeScriptSubstitutionFlags["ClassAliases"] = 1] = "ClassAliases"; + TypeScriptSubstitutionFlags[TypeScriptSubstitutionFlags["NamespaceExports"] = 2] = "NamespaceExports"; + TypeScriptSubstitutionFlags[TypeScriptSubstitutionFlags["NonQualifiedEnumMembers"] = 8] = "NonQualifiedEnumMembers"; + })(TypeScriptSubstitutionFlags || (TypeScriptSubstitutionFlags = {})); + var ClassFacts; + (function (ClassFacts) { + ClassFacts[ClassFacts["None"] = 0] = "None"; + ClassFacts[ClassFacts["HasStaticInitializedProperties"] = 1] = "HasStaticInitializedProperties"; + ClassFacts[ClassFacts["HasConstructorDecorators"] = 2] = "HasConstructorDecorators"; + ClassFacts[ClassFacts["HasMemberDecorators"] = 4] = "HasMemberDecorators"; + ClassFacts[ClassFacts["IsExportOfNamespace"] = 8] = "IsExportOfNamespace"; + ClassFacts[ClassFacts["IsNamedExternalExport"] = 16] = "IsNamedExternalExport"; + ClassFacts[ClassFacts["IsDefaultExternalExport"] = 32] = "IsDefaultExternalExport"; + ClassFacts[ClassFacts["HasExtendsClause"] = 64] = "HasExtendsClause"; + ClassFacts[ClassFacts["UseImmediatelyInvokedFunctionExpression"] = 128] = "UseImmediatelyInvokedFunctionExpression"; + ClassFacts[ClassFacts["HasAnyDecorators"] = 6] = "HasAnyDecorators"; + ClassFacts[ClassFacts["NeedsName"] = 5] = "NeedsName"; + ClassFacts[ClassFacts["MayNeedImmediatelyInvokedFunctionExpression"] = 7] = "MayNeedImmediatelyInvokedFunctionExpression"; + ClassFacts[ClassFacts["IsExported"] = 56] = "IsExported"; + })(ClassFacts || (ClassFacts = {})); function transformTypeScript(context) { var startLexicalEnvironment = context.startLexicalEnvironment, resumeLexicalEnvironment = context.resumeLexicalEnvironment, endLexicalEnvironment = context.endLexicalEnvironment, hoistVariableDeclaration = context.hoistVariableDeclaration; var resolver = context.getEmitResolver(); @@ -42304,7 +43877,12 @@ var ts; if (ts.hasModifier(node, 2)) { break; } - recordEmittedDeclarationInScope(node); + if (node.name) { + recordEmittedDeclarationInScope(node); + } + else { + ts.Debug.assert(node.kind === 229 || ts.hasModifier(node, 512)); + } break; } } @@ -42718,8 +44296,8 @@ var ts; && member.initializer !== undefined; } function addInitializedPropertyStatements(statements, properties, receiver) { - for (var _i = 0, properties_9 = properties; _i < properties_9.length; _i++) { - var property = properties_9[_i]; + for (var _i = 0, properties_10 = properties; _i < properties_10.length; _i++) { + var property = properties_10[_i]; var statement = ts.createStatement(transformInitializedProperty(property, receiver)); ts.setSourceMapRange(statement, ts.moveRangePastModifiers(property)); ts.setCommentRange(statement, property); @@ -42728,8 +44306,8 @@ var ts; } function generateInitializedPropertyExpressions(properties, receiver) { var expressions = []; - for (var _i = 0, properties_10 = properties; _i < properties_10.length; _i++) { - var property = properties_10[_i]; + for (var _i = 0, properties_11 = properties; _i < properties_11.length; _i++) { + var property = properties_11[_i]; var expression = transformInitializedProperty(property, receiver); expression.startsOnNewLine = true; ts.setSourceMapRange(expression, ts.moveRangePastModifiers(property)); @@ -43424,24 +45002,24 @@ var ts; && moduleKind !== ts.ModuleKind.System); } function recordEmittedDeclarationInScope(node) { - var name = node.symbol && node.symbol.escapedName; - if (name) { - if (!currentScopeFirstDeclarationsOfName) { - currentScopeFirstDeclarationsOfName = ts.createUnderscoreEscapedMap(); - } - if (!currentScopeFirstDeclarationsOfName.has(name)) { - currentScopeFirstDeclarationsOfName.set(name, node); - } + if (!currentScopeFirstDeclarationsOfName) { + currentScopeFirstDeclarationsOfName = ts.createUnderscoreEscapedMap(); + } + var name = declaredNameInScope(node); + if (!currentScopeFirstDeclarationsOfName.has(name)) { + currentScopeFirstDeclarationsOfName.set(name, node); } } function isFirstEmittedDeclarationInScope(node) { if (currentScopeFirstDeclarationsOfName) { - var name = node.symbol && node.symbol.escapedName; - if (name) { - return currentScopeFirstDeclarationsOfName.get(name) === node; - } + var name = declaredNameInScope(node); + return currentScopeFirstDeclarationsOfName.get(name) === node; } - return false; + return true; + } + function declaredNameInScope(node) { + ts.Debug.assertNode(node.name, ts.isIdentifier); + return node.name.escapedText; } function addVarForEnumOrModuleDeclaration(statements, node) { var statement = ts.createVariableStatement(ts.visitNodes(node.modifiers, modifierVisitor, ts.isModifier), ts.createVariableDeclarationList([ @@ -43472,7 +45050,7 @@ var ts; if (!shouldEmitModuleDeclaration(node)) { return ts.createNotEmittedStatement(node); } - ts.Debug.assert(ts.isIdentifier(node.name), "TypeScript module should have an Identifier name."); + ts.Debug.assertNode(node.name, ts.isIdentifier, "A TypeScript namespace should have an Identifier name."); enableSubstitutionForNamespaceExports(); var statements = []; var emitFlags = 2; @@ -43871,6 +45449,10 @@ var ts; })(ts || (ts = {})); var ts; (function (ts) { + var ES2017SubstitutionFlags; + (function (ES2017SubstitutionFlags) { + ES2017SubstitutionFlags[ES2017SubstitutionFlags["AsyncMethodsWithSuper"] = 1] = "AsyncMethodsWithSuper"; + })(ES2017SubstitutionFlags || (ES2017SubstitutionFlags = {})); function transformES2017(context) { var startLexicalEnvironment = context.startLexicalEnvironment, resumeLexicalEnvironment = context.resumeLexicalEnvironment, endLexicalEnvironment = context.endLexicalEnvironment; var resolver = context.getEmitResolver(); @@ -44112,6 +45694,10 @@ var ts; })(ts || (ts = {})); var ts; (function (ts) { + var ESNextSubstitutionFlags; + (function (ESNextSubstitutionFlags) { + ESNextSubstitutionFlags[ESNextSubstitutionFlags["AsyncMethodsWithSuper"] = 1] = "AsyncMethodsWithSuper"; + })(ESNextSubstitutionFlags || (ESNextSubstitutionFlags = {})); function transformESNext(context) { var resumeLexicalEnvironment = context.resumeLexicalEnvironment, endLexicalEnvironment = context.endLexicalEnvironment, hoistVariableDeclaration = context.hoistVariableDeclaration; var resolver = context.getEmitResolver(); @@ -44188,6 +45774,8 @@ var ts; return visitExpressionStatement(node); case 185: return visitParenthesizedExpression(node, noDestructuringValue); + case 260: + return visitCatchClause(node); default: return ts.visitEachChild(node, visitor, context); } @@ -44262,6 +45850,12 @@ var ts; function visitParenthesizedExpression(node, noDestructuringValue) { return ts.visitEachChild(node, noDestructuringValue ? visitorNoDestructuringValue : visitor, context); } + function visitCatchClause(node) { + if (!node.variableDeclaration) { + return ts.updateCatchClause(node, ts.createVariableDeclaration(ts.createTempVariable(undefined)), ts.visitNode(node.block, visitor, ts.isBlock)); + } + return ts.visitEachChild(node, visitor, context); + } function visitBinaryExpression(node, noDestructuringValue) { if (ts.isDestructuringAssignment(node) && node.left.transformFlags & 1048576) { return ts.flattenDestructuringAssignment(node, visitor, context, 1, !noDestructuringValue); @@ -44708,7 +46302,7 @@ var ts; objectProperties = ts.createAssignHelper(context, segments); } } - var element = ts.createExpressionForJsxElement(context.getEmitResolver().getJsxFactoryEntity(), compilerOptions.reactNamespace, tagName, objectProperties, ts.filter(ts.map(children, transformJsxChildToExpression), ts.isDefined), node, location); + var element = ts.createExpressionForJsxElement(context.getEmitResolver().getJsxFactoryEntity(), compilerOptions.reactNamespace, tagName, objectProperties, ts.mapDefined(children, transformJsxChildToExpression), node, location); if (isChild) { ts.startOnNewLine(element); } @@ -45137,6 +46731,75 @@ var ts; })(ts || (ts = {})); var ts; (function (ts) { + var ES2015SubstitutionFlags; + (function (ES2015SubstitutionFlags) { + ES2015SubstitutionFlags[ES2015SubstitutionFlags["CapturedThis"] = 1] = "CapturedThis"; + ES2015SubstitutionFlags[ES2015SubstitutionFlags["BlockScopedBindings"] = 2] = "BlockScopedBindings"; + })(ES2015SubstitutionFlags || (ES2015SubstitutionFlags = {})); + var CopyDirection; + (function (CopyDirection) { + CopyDirection[CopyDirection["ToOriginal"] = 0] = "ToOriginal"; + CopyDirection[CopyDirection["ToOutParameter"] = 1] = "ToOutParameter"; + })(CopyDirection || (CopyDirection = {})); + var Jump; + (function (Jump) { + Jump[Jump["Break"] = 2] = "Break"; + Jump[Jump["Continue"] = 4] = "Continue"; + Jump[Jump["Return"] = 8] = "Return"; + })(Jump || (Jump = {})); + var SuperCaptureResult; + (function (SuperCaptureResult) { + SuperCaptureResult[SuperCaptureResult["NoReplacement"] = 0] = "NoReplacement"; + SuperCaptureResult[SuperCaptureResult["ReplaceSuperCapture"] = 1] = "ReplaceSuperCapture"; + SuperCaptureResult[SuperCaptureResult["ReplaceWithReturn"] = 2] = "ReplaceWithReturn"; + })(SuperCaptureResult || (SuperCaptureResult = {})); + var HierarchyFacts; + (function (HierarchyFacts) { + HierarchyFacts[HierarchyFacts["None"] = 0] = "None"; + HierarchyFacts[HierarchyFacts["Function"] = 1] = "Function"; + HierarchyFacts[HierarchyFacts["ArrowFunction"] = 2] = "ArrowFunction"; + HierarchyFacts[HierarchyFacts["AsyncFunctionBody"] = 4] = "AsyncFunctionBody"; + HierarchyFacts[HierarchyFacts["NonStaticClassElement"] = 8] = "NonStaticClassElement"; + HierarchyFacts[HierarchyFacts["CapturesThis"] = 16] = "CapturesThis"; + HierarchyFacts[HierarchyFacts["ExportedVariableStatement"] = 32] = "ExportedVariableStatement"; + HierarchyFacts[HierarchyFacts["TopLevel"] = 64] = "TopLevel"; + HierarchyFacts[HierarchyFacts["Block"] = 128] = "Block"; + HierarchyFacts[HierarchyFacts["IterationStatement"] = 256] = "IterationStatement"; + HierarchyFacts[HierarchyFacts["IterationStatementBlock"] = 512] = "IterationStatementBlock"; + HierarchyFacts[HierarchyFacts["ForStatement"] = 1024] = "ForStatement"; + HierarchyFacts[HierarchyFacts["ForInOrForOfStatement"] = 2048] = "ForInOrForOfStatement"; + HierarchyFacts[HierarchyFacts["ConstructorWithCapturedSuper"] = 4096] = "ConstructorWithCapturedSuper"; + HierarchyFacts[HierarchyFacts["ComputedPropertyName"] = 8192] = "ComputedPropertyName"; + HierarchyFacts[HierarchyFacts["AncestorFactsMask"] = 16383] = "AncestorFactsMask"; + HierarchyFacts[HierarchyFacts["BlockScopeIncludes"] = 0] = "BlockScopeIncludes"; + HierarchyFacts[HierarchyFacts["BlockScopeExcludes"] = 4032] = "BlockScopeExcludes"; + HierarchyFacts[HierarchyFacts["SourceFileIncludes"] = 64] = "SourceFileIncludes"; + HierarchyFacts[HierarchyFacts["SourceFileExcludes"] = 3968] = "SourceFileExcludes"; + HierarchyFacts[HierarchyFacts["FunctionIncludes"] = 65] = "FunctionIncludes"; + HierarchyFacts[HierarchyFacts["FunctionExcludes"] = 16286] = "FunctionExcludes"; + HierarchyFacts[HierarchyFacts["AsyncFunctionBodyIncludes"] = 69] = "AsyncFunctionBodyIncludes"; + HierarchyFacts[HierarchyFacts["AsyncFunctionBodyExcludes"] = 16278] = "AsyncFunctionBodyExcludes"; + HierarchyFacts[HierarchyFacts["ArrowFunctionIncludes"] = 66] = "ArrowFunctionIncludes"; + HierarchyFacts[HierarchyFacts["ArrowFunctionExcludes"] = 16256] = "ArrowFunctionExcludes"; + HierarchyFacts[HierarchyFacts["ConstructorIncludes"] = 73] = "ConstructorIncludes"; + HierarchyFacts[HierarchyFacts["ConstructorExcludes"] = 16278] = "ConstructorExcludes"; + HierarchyFacts[HierarchyFacts["DoOrWhileStatementIncludes"] = 256] = "DoOrWhileStatementIncludes"; + HierarchyFacts[HierarchyFacts["DoOrWhileStatementExcludes"] = 0] = "DoOrWhileStatementExcludes"; + HierarchyFacts[HierarchyFacts["ForStatementIncludes"] = 1280] = "ForStatementIncludes"; + HierarchyFacts[HierarchyFacts["ForStatementExcludes"] = 3008] = "ForStatementExcludes"; + HierarchyFacts[HierarchyFacts["ForInOrForOfStatementIncludes"] = 2304] = "ForInOrForOfStatementIncludes"; + HierarchyFacts[HierarchyFacts["ForInOrForOfStatementExcludes"] = 1984] = "ForInOrForOfStatementExcludes"; + HierarchyFacts[HierarchyFacts["BlockIncludes"] = 128] = "BlockIncludes"; + HierarchyFacts[HierarchyFacts["BlockExcludes"] = 3904] = "BlockExcludes"; + HierarchyFacts[HierarchyFacts["IterationStatementBlockIncludes"] = 512] = "IterationStatementBlockIncludes"; + HierarchyFacts[HierarchyFacts["IterationStatementBlockExcludes"] = 4032] = "IterationStatementBlockExcludes"; + HierarchyFacts[HierarchyFacts["ComputedPropertyNameIncludes"] = 8192] = "ComputedPropertyNameIncludes"; + HierarchyFacts[HierarchyFacts["ComputedPropertyNameExcludes"] = 0] = "ComputedPropertyNameExcludes"; + HierarchyFacts[HierarchyFacts["NewTarget"] = 16384] = "NewTarget"; + HierarchyFacts[HierarchyFacts["NewTargetInComputedPropertyName"] = 32768] = "NewTargetInComputedPropertyName"; + HierarchyFacts[HierarchyFacts["SubtreeFactsMask"] = -16384] = "SubtreeFactsMask"; + HierarchyFacts[HierarchyFacts["PropagateNewTargetMask"] = 49152] = "PropagateNewTargetMask"; + })(HierarchyFacts || (HierarchyFacts = {})); function transformES2015(context) { var startLexicalEnvironment = context.startLexicalEnvironment, resumeLexicalEnvironment = context.resumeLexicalEnvironment, endLexicalEnvironment = context.endLexicalEnvironment, hoistVariableDeclaration = context.hoistVariableDeclaration; var compilerOptions = context.getCompilerOptions(); @@ -45226,7 +46889,7 @@ var ts; function shouldVisitNode(node) { return (node.transformFlags & 128) !== 0 || convertedLoopState !== undefined - || (hierarchyFacts & 4096 && ts.isStatement(node)) + || (hierarchyFacts & 4096 && (ts.isStatement(node) || (node.kind === 207))) || (ts.isIterationStatement(node, false) && shouldConvertIterationStatementBody(node)) || isTypeScriptClassWrapper(node); } @@ -45506,9 +47169,11 @@ var ts; var outer = ts.createPartiallyEmittedExpression(inner); outer.end = ts.skipTrivia(currentText, node.pos); ts.setEmitFlags(outer, 1536); - return ts.createParen(ts.createCall(outer, undefined, extendsClauseElement + var result = ts.createParen(ts.createCall(outer, undefined, extendsClauseElement ? [ts.visitNode(extendsClauseElement.expression, visitor, ts.isExpression)] : [])); + ts.addSyntheticLeadingComment(result, 3, "* @class "); + return result; } function transformClassBody(node, extendsClauseElement) { var statements = []; @@ -46093,11 +47758,12 @@ var ts; ts.setTextRange(declarationList, node); ts.setCommentRange(declarationList, node); if (node.transformFlags & 8388608 - && (ts.isBindingPattern(node.declarations[0].name) - || ts.isBindingPattern(ts.lastOrUndefined(node.declarations).name))) { + && (ts.isBindingPattern(node.declarations[0].name) || ts.isBindingPattern(ts.lastOrUndefined(node.declarations).name))) { var firstDeclaration = ts.firstOrUndefined(declarations); - var lastDeclaration = ts.lastOrUndefined(declarations); - ts.setSourceMapRange(declarationList, ts.createRange(firstDeclaration.pos, lastDeclaration.end)); + if (firstDeclaration) { + var lastDeclaration = ts.lastOrUndefined(declarations); + ts.setSourceMapRange(declarationList, ts.createRange(firstDeclaration.pos, lastDeclaration.end)); + } } return declarationList; } @@ -46636,6 +48302,7 @@ var ts; function visitCatchClause(node) { var ancestorFacts = enterSubtree(4032, 0); var updated; + ts.Debug.assert(!!node.variableDeclaration, "Catch clause variable should always be present when downleveling ES2015."); if (ts.isBindingPattern(node.variableDeclaration.name)) { var temp = ts.createTempVariable(undefined); var newVariableDeclaration = ts.createVariableDeclaration(temp); @@ -47142,6 +48809,51 @@ var ts; })(ts || (ts = {})); var ts; (function (ts) { + var OpCode; + (function (OpCode) { + OpCode[OpCode["Nop"] = 0] = "Nop"; + OpCode[OpCode["Statement"] = 1] = "Statement"; + OpCode[OpCode["Assign"] = 2] = "Assign"; + OpCode[OpCode["Break"] = 3] = "Break"; + OpCode[OpCode["BreakWhenTrue"] = 4] = "BreakWhenTrue"; + OpCode[OpCode["BreakWhenFalse"] = 5] = "BreakWhenFalse"; + OpCode[OpCode["Yield"] = 6] = "Yield"; + OpCode[OpCode["YieldStar"] = 7] = "YieldStar"; + OpCode[OpCode["Return"] = 8] = "Return"; + OpCode[OpCode["Throw"] = 9] = "Throw"; + OpCode[OpCode["Endfinally"] = 10] = "Endfinally"; + })(OpCode || (OpCode = {})); + var BlockAction; + (function (BlockAction) { + BlockAction[BlockAction["Open"] = 0] = "Open"; + BlockAction[BlockAction["Close"] = 1] = "Close"; + })(BlockAction || (BlockAction = {})); + var CodeBlockKind; + (function (CodeBlockKind) { + CodeBlockKind[CodeBlockKind["Exception"] = 0] = "Exception"; + CodeBlockKind[CodeBlockKind["With"] = 1] = "With"; + CodeBlockKind[CodeBlockKind["Switch"] = 2] = "Switch"; + CodeBlockKind[CodeBlockKind["Loop"] = 3] = "Loop"; + CodeBlockKind[CodeBlockKind["Labeled"] = 4] = "Labeled"; + })(CodeBlockKind || (CodeBlockKind = {})); + var ExceptionBlockState; + (function (ExceptionBlockState) { + ExceptionBlockState[ExceptionBlockState["Try"] = 0] = "Try"; + ExceptionBlockState[ExceptionBlockState["Catch"] = 1] = "Catch"; + ExceptionBlockState[ExceptionBlockState["Finally"] = 2] = "Finally"; + ExceptionBlockState[ExceptionBlockState["Done"] = 3] = "Done"; + })(ExceptionBlockState || (ExceptionBlockState = {})); + var Instruction; + (function (Instruction) { + Instruction[Instruction["Next"] = 0] = "Next"; + Instruction[Instruction["Throw"] = 1] = "Throw"; + Instruction[Instruction["Return"] = 2] = "Return"; + Instruction[Instruction["Break"] = 3] = "Break"; + Instruction[Instruction["Yield"] = 4] = "Yield"; + Instruction[Instruction["YieldStar"] = 5] = "YieldStar"; + Instruction[Instruction["Catch"] = 6] = "Catch"; + Instruction[Instruction["Endfinally"] = 7] = "Endfinally"; + })(Instruction || (Instruction = {})); function getInstructionName(instruction) { switch (instruction) { case 2: return "return"; @@ -47908,8 +49620,12 @@ var ts; } function transformAndEmitContinueStatement(node) { var label = findContinueTarget(node.label ? ts.unescapeLeadingUnderscores(node.label.escapedText) : undefined); - ts.Debug.assert(label > 0, "Expected continue statment to point to a valid Label."); - emitBreak(label, node); + if (label > 0) { + emitBreak(label, node); + } + else { + emitStatement(node); + } } function visitContinueStatement(node) { if (inStatementContainingYield) { @@ -47922,8 +49638,12 @@ var ts; } function transformAndEmitBreakStatement(node) { var label = findBreakTarget(node.label ? ts.unescapeLeadingUnderscores(node.label.escapedText) : undefined); - ts.Debug.assert(label > 0, "Expected break statment to point to a valid Label."); - emitBreak(label, node); + if (label > 0) { + emitBreak(label, node); + } + else { + emitStatement(node); + } } function visitBreakStatement(node) { if (inStatementContainingYield) { @@ -48180,9 +49900,6 @@ var ts; var block = endBlock(); markLabel(block.endLabel); } - function isWithBlock(block) { - return block.kind === 1; - } function beginExceptionBlock() { var startLabel = defineLabel(); var endLabel = defineLabel(); @@ -48251,9 +49968,6 @@ var ts; emitNop(); exception.state = 3; } - function isExceptionBlock(block) { - return block.kind === 0; - } function beginScriptLoopBlock() { beginBlock({ kind: 3, @@ -48353,43 +50067,45 @@ var ts; return false; } function findBreakTarget(labelText) { - ts.Debug.assert(blocks !== undefined); - if (labelText) { - for (var i = blockStack.length - 1; i >= 0; i--) { - var block = blockStack[i]; - if (supportsLabeledBreakOrContinue(block) && block.labelText === labelText) { - return block.breakLabel; - } - else if (supportsUnlabeledBreak(block) && hasImmediateContainingLabeledBlock(labelText, i - 1)) { - return block.breakLabel; + if (blockStack) { + if (labelText) { + for (var i = blockStack.length - 1; i >= 0; i--) { + var block = blockStack[i]; + if (supportsLabeledBreakOrContinue(block) && block.labelText === labelText) { + return block.breakLabel; + } + else if (supportsUnlabeledBreak(block) && hasImmediateContainingLabeledBlock(labelText, i - 1)) { + return block.breakLabel; + } } } - } - else { - for (var i = blockStack.length - 1; i >= 0; i--) { - var block = blockStack[i]; - if (supportsUnlabeledBreak(block)) { - return block.breakLabel; + else { + for (var i = blockStack.length - 1; i >= 0; i--) { + var block = blockStack[i]; + if (supportsUnlabeledBreak(block)) { + return block.breakLabel; + } } } } return 0; } function findContinueTarget(labelText) { - ts.Debug.assert(blocks !== undefined); - if (labelText) { - for (var i = blockStack.length - 1; i >= 0; i--) { - var block = blockStack[i]; - if (supportsUnlabeledContinue(block) && hasImmediateContainingLabeledBlock(labelText, i - 1)) { - return block.continueLabel; + if (blockStack) { + if (labelText) { + for (var i = blockStack.length - 1; i >= 0; i--) { + var block = blockStack[i]; + if (supportsUnlabeledContinue(block) && hasImmediateContainingLabeledBlock(labelText, i - 1)) { + return block.continueLabel; + } } } - } - else { - for (var i = blockStack.length - 1; i >= 0; i--) { - var block = blockStack[i]; - if (supportsUnlabeledContinue(block)) { - return block.continueLabel; + else { + for (var i = blockStack.length - 1; i >= 0; i--) { + var block = blockStack[i]; + if (supportsUnlabeledContinue(block)) { + return block.continueLabel; + } } } } @@ -48417,7 +50133,7 @@ var ts; return literal; } function createInlineBreak(label, location) { - ts.Debug.assert(label > 0, "Invalid label: " + label); + ts.Debug.assertLessThan(0, label, "Invalid label"); return ts.setTextRange(ts.createReturn(ts.createArrayLiteral([ createInstruction(3), createLabel(label) @@ -48625,31 +50341,33 @@ var ts; for (; blockIndex < blockActions.length && blockOffsets[blockIndex] <= operationIndex; blockIndex++) { var block = blocks[blockIndex]; var blockAction = blockActions[blockIndex]; - if (isExceptionBlock(block)) { - if (blockAction === 0) { - if (!exceptionBlockStack) { - exceptionBlockStack = []; + switch (block.kind) { + case 0: + if (blockAction === 0) { + if (!exceptionBlockStack) { + exceptionBlockStack = []; + } + if (!statements) { + statements = []; + } + exceptionBlockStack.push(currentExceptionBlock); + currentExceptionBlock = block; } - if (!statements) { - statements = []; + else if (blockAction === 1) { + currentExceptionBlock = exceptionBlockStack.pop(); } - exceptionBlockStack.push(currentExceptionBlock); - currentExceptionBlock = block; - } - else if (blockAction === 1) { - currentExceptionBlock = exceptionBlockStack.pop(); - } - } - else if (isWithBlock(block)) { - if (blockAction === 0) { - if (!withBlockStack) { - withBlockStack = []; + break; + case 1: + if (blockAction === 0) { + if (!withBlockStack) { + withBlockStack = []; + } + withBlockStack.push(block); } - withBlockStack.push(block); - } - else if (blockAction === 1) { - withBlockStack.pop(); - } + else if (blockAction === 1) { + withBlockStack.pop(); + } + break; } } } @@ -50403,6 +52121,18 @@ var ts; return ts.transformModule; } } + var TransformationState; + (function (TransformationState) { + TransformationState[TransformationState["Uninitialized"] = 0] = "Uninitialized"; + TransformationState[TransformationState["Initialized"] = 1] = "Initialized"; + TransformationState[TransformationState["Completed"] = 2] = "Completed"; + TransformationState[TransformationState["Disposed"] = 3] = "Disposed"; + })(TransformationState || (TransformationState = {})); + var SyntaxKindFeatureFlags; + (function (SyntaxKindFeatureFlags) { + SyntaxKindFeatureFlags[SyntaxKindFeatureFlags["Substitution"] = 1] = "Substitution"; + SyntaxKindFeatureFlags[SyntaxKindFeatureFlags["EmitNotifications"] = 2] = "EmitNotifications"; + })(SyntaxKindFeatureFlags || (SyntaxKindFeatureFlags = {})); function getTransformers(compilerOptions, customTransformers) { var jsx = compilerOptions.jsx; var languageVersion = ts.getEmitScriptTarget(compilerOptions); @@ -51150,14 +52880,14 @@ var ts; writer.writeLine(); } } - function emitTrailingCommentsOfPosition(pos) { + function emitTrailingCommentsOfPosition(pos, prefixSpace) { if (disabled) { return; } if (extendedDiagnostics) { ts.performance.mark("beforeEmitTrailingCommentsOfPosition"); } - forEachTrailingCommentToEmit(pos, emitTrailingCommentOfPosition); + forEachTrailingCommentToEmit(pos, prefixSpace ? emitTrailingComment : emitTrailingCommentOfPosition); if (extendedDiagnostics) { ts.performance.measure("commentTime", "beforeEmitTrailingCommentsOfPosition"); } @@ -51237,15 +52967,7 @@ var ts; emitPos(commentEnd); } function isTripleSlashComment(commentPos, commentEnd) { - if (currentText.charCodeAt(commentPos + 1) === 47 && - commentPos + 2 < commentEnd && - currentText.charCodeAt(commentPos + 2) === 47) { - var textSubStr = currentText.substring(commentPos, commentEnd); - return textSubStr.match(ts.fullTripleSlashReferencePathRegEx) || - textSubStr.match(ts.fullTripleSlashAMDReferencePathRegEx) ? - true : false; - } - return false; + return ts.isRecognizedTripleSlashComment(currentText, commentPos, commentEnd); } } ts.createCommentWriter = createCommentWriter; @@ -51498,7 +53220,6 @@ var ts; errorNameNode = declaration.name; var format = 4 | 16384 | - 2048 | (shouldUseResolverType ? 8192 : 0); resolver.writeTypeOfDeclaration(declaration, enclosingDeclaration, format, writer); errorNameNode = undefined; @@ -51512,7 +53233,7 @@ var ts; } else { errorNameNode = signature.name; - resolver.writeReturnTypeOfSignatureDeclaration(signature, enclosingDeclaration, 4 | 2048 | 16384, writer); + resolver.writeReturnTypeOfSignatureDeclaration(signature, enclosingDeclaration, 4 | 16384, writer); errorNameNode = undefined; } } @@ -51742,7 +53463,7 @@ var ts; write(tempVarName); write(": "); writer.getSymbolAccessibilityDiagnostic = function () { return diagnostic; }; - resolver.writeTypeOfExpression(expr, enclosingDeclaration, 4 | 2048 | 16384, writer); + resolver.writeTypeOfExpression(expr, enclosingDeclaration, 4 | 16384, writer); write(";"); writeLine(); return tempVarName; @@ -52379,6 +54100,9 @@ var ts; return ts.forEach(node.declarationList.declarations, function (varDeclaration) { return resolver.isDeclarationVisible(varDeclaration); }); } function writeVariableStatement(node) { + if (ts.every(node.declarationList && node.declarationList.declarations, function (decl) { return decl.name && ts.isEmptyBindingPattern(decl.name); })) { + return; + } emitJsDocComments(node); emitModuleElementDeclarationFlags(node); if (ts.isLet(node.declarationList)) { @@ -53757,7 +55481,9 @@ var ts; if (!(ts.getEmitFlags(node) & 131072)) { var dotRangeStart = node.expression.end; var dotRangeEnd = ts.skipTrivia(currentSourceFile.text, node.expression.end) + 1; - var dotToken = { kind: 23, pos: dotRangeStart, end: dotRangeEnd }; + var dotToken = ts.createToken(23); + dotToken.pos = dotRangeStart; + dotToken.end = dotRangeEnd; indentBeforeDot = needsIndentation(node, node.expression, dotToken); indentAfterDot = needsIndentation(node, dotToken, node.name); } @@ -53869,7 +55595,9 @@ var ts; var indentAfterOperator = needsIndentation(node, node.operatorToken, node.right); emitExpression(node.left); increaseIndentIf(indentBeforeOperator, isCommaOperator ? " " : undefined); + emitLeadingCommentsOfPosition(node.operatorToken.pos); writeTokenNode(node.operatorToken); + emitTrailingCommentsOfPosition(node.operatorToken.end, true); increaseIndentIf(indentAfterOperator, " "); emitExpression(node.right); decreaseIndentIf(indentBeforeOperator, indentAfterOperator); @@ -54056,8 +55784,19 @@ var ts; emitWithPrefix(" ", node.label); write(";"); } + function emitTokenWithComment(token, pos, contextNode) { + var node = contextNode && ts.getParseTreeNode(contextNode); + if (node && node.kind === contextNode.kind) { + pos = ts.skipTrivia(currentSourceFile.text, pos); + } + pos = writeToken(token, pos, contextNode); + if (node && node.kind === contextNode.kind) { + emitTrailingCommentsOfPosition(pos, true); + } + return pos; + } function emitReturnStatement(node) { - writeToken(96, node.pos, node); + emitTokenWithComment(96, node.pos, node); emitExpressionWithPrefix(" ", node.expression); write(";"); } @@ -54498,10 +56237,12 @@ var ts; function emitCatchClause(node) { var openParenPos = writeToken(74, node.pos); write(" "); - writeToken(19, openParenPos); - emit(node.variableDeclaration); - writeToken(20, node.variableDeclaration ? node.variableDeclaration.end : openParenPos); - write(" "); + if (node.variableDeclaration) { + writeToken(19, openParenPos); + emit(node.variableDeclaration); + writeToken(20, node.variableDeclaration.end); + write(" "); + } emit(node.block); } function emitPropertyAssignment(node) { @@ -55187,6 +56928,76 @@ var ts; function getClosingBracket(format) { return brackets[format & 7680][1]; } + var TempFlags; + (function (TempFlags) { + TempFlags[TempFlags["Auto"] = 0] = "Auto"; + TempFlags[TempFlags["CountMask"] = 268435455] = "CountMask"; + TempFlags[TempFlags["_i"] = 268435456] = "_i"; + })(TempFlags || (TempFlags = {})); + var ListFormat; + (function (ListFormat) { + ListFormat[ListFormat["None"] = 0] = "None"; + ListFormat[ListFormat["SingleLine"] = 0] = "SingleLine"; + ListFormat[ListFormat["MultiLine"] = 1] = "MultiLine"; + ListFormat[ListFormat["PreserveLines"] = 2] = "PreserveLines"; + ListFormat[ListFormat["LinesMask"] = 3] = "LinesMask"; + ListFormat[ListFormat["NotDelimited"] = 0] = "NotDelimited"; + ListFormat[ListFormat["BarDelimited"] = 4] = "BarDelimited"; + ListFormat[ListFormat["AmpersandDelimited"] = 8] = "AmpersandDelimited"; + ListFormat[ListFormat["CommaDelimited"] = 16] = "CommaDelimited"; + ListFormat[ListFormat["DelimitersMask"] = 28] = "DelimitersMask"; + ListFormat[ListFormat["AllowTrailingComma"] = 32] = "AllowTrailingComma"; + ListFormat[ListFormat["Indented"] = 64] = "Indented"; + ListFormat[ListFormat["SpaceBetweenBraces"] = 128] = "SpaceBetweenBraces"; + ListFormat[ListFormat["SpaceBetweenSiblings"] = 256] = "SpaceBetweenSiblings"; + ListFormat[ListFormat["Braces"] = 512] = "Braces"; + ListFormat[ListFormat["Parenthesis"] = 1024] = "Parenthesis"; + ListFormat[ListFormat["AngleBrackets"] = 2048] = "AngleBrackets"; + ListFormat[ListFormat["SquareBrackets"] = 4096] = "SquareBrackets"; + ListFormat[ListFormat["BracketsMask"] = 7680] = "BracketsMask"; + ListFormat[ListFormat["OptionalIfUndefined"] = 8192] = "OptionalIfUndefined"; + ListFormat[ListFormat["OptionalIfEmpty"] = 16384] = "OptionalIfEmpty"; + ListFormat[ListFormat["Optional"] = 24576] = "Optional"; + ListFormat[ListFormat["PreferNewLine"] = 32768] = "PreferNewLine"; + ListFormat[ListFormat["NoTrailingNewLine"] = 65536] = "NoTrailingNewLine"; + ListFormat[ListFormat["NoInterveningComments"] = 131072] = "NoInterveningComments"; + ListFormat[ListFormat["Modifiers"] = 131328] = "Modifiers"; + ListFormat[ListFormat["HeritageClauses"] = 256] = "HeritageClauses"; + ListFormat[ListFormat["SingleLineTypeLiteralMembers"] = 448] = "SingleLineTypeLiteralMembers"; + ListFormat[ListFormat["MultiLineTypeLiteralMembers"] = 65] = "MultiLineTypeLiteralMembers"; + ListFormat[ListFormat["TupleTypeElements"] = 336] = "TupleTypeElements"; + ListFormat[ListFormat["UnionTypeConstituents"] = 260] = "UnionTypeConstituents"; + ListFormat[ListFormat["IntersectionTypeConstituents"] = 264] = "IntersectionTypeConstituents"; + ListFormat[ListFormat["ObjectBindingPatternElements"] = 432] = "ObjectBindingPatternElements"; + ListFormat[ListFormat["ArrayBindingPatternElements"] = 304] = "ArrayBindingPatternElements"; + ListFormat[ListFormat["ObjectLiteralExpressionProperties"] = 978] = "ObjectLiteralExpressionProperties"; + ListFormat[ListFormat["ArrayLiteralExpressionElements"] = 4466] = "ArrayLiteralExpressionElements"; + ListFormat[ListFormat["CommaListElements"] = 272] = "CommaListElements"; + ListFormat[ListFormat["CallExpressionArguments"] = 1296] = "CallExpressionArguments"; + ListFormat[ListFormat["NewExpressionArguments"] = 9488] = "NewExpressionArguments"; + ListFormat[ListFormat["TemplateExpressionSpans"] = 131072] = "TemplateExpressionSpans"; + ListFormat[ListFormat["SingleLineBlockStatements"] = 384] = "SingleLineBlockStatements"; + ListFormat[ListFormat["MultiLineBlockStatements"] = 65] = "MultiLineBlockStatements"; + ListFormat[ListFormat["VariableDeclarationList"] = 272] = "VariableDeclarationList"; + ListFormat[ListFormat["SingleLineFunctionBodyStatements"] = 384] = "SingleLineFunctionBodyStatements"; + ListFormat[ListFormat["MultiLineFunctionBodyStatements"] = 1] = "MultiLineFunctionBodyStatements"; + ListFormat[ListFormat["ClassHeritageClauses"] = 256] = "ClassHeritageClauses"; + ListFormat[ListFormat["ClassMembers"] = 65] = "ClassMembers"; + ListFormat[ListFormat["InterfaceMembers"] = 65] = "InterfaceMembers"; + ListFormat[ListFormat["EnumMembers"] = 81] = "EnumMembers"; + ListFormat[ListFormat["CaseBlockClauses"] = 65] = "CaseBlockClauses"; + ListFormat[ListFormat["NamedImportsOrExportsElements"] = 432] = "NamedImportsOrExportsElements"; + ListFormat[ListFormat["JsxElementChildren"] = 131072] = "JsxElementChildren"; + ListFormat[ListFormat["JsxElementAttributes"] = 131328] = "JsxElementAttributes"; + ListFormat[ListFormat["CaseOrDefaultClauseStatements"] = 81985] = "CaseOrDefaultClauseStatements"; + ListFormat[ListFormat["HeritageClauseTypes"] = 272] = "HeritageClauseTypes"; + ListFormat[ListFormat["SourceFileStatements"] = 65537] = "SourceFileStatements"; + ListFormat[ListFormat["Decorators"] = 24577] = "Decorators"; + ListFormat[ListFormat["TypeArguments"] = 26960] = "TypeArguments"; + ListFormat[ListFormat["TypeParameters"] = 26960] = "TypeParameters"; + ListFormat[ListFormat["Parameters"] = 1360] = "Parameters"; + ListFormat[ListFormat["IndexSignatureParameters"] = 4432] = "IndexSignatureParameters"; + })(ListFormat || (ListFormat = {})); })(ts || (ts = {})); var ts; (function (ts) { @@ -55543,6 +57354,9 @@ var ts; var loader_2 = function (typesRef, containingFile) { return ts.resolveTypeReferenceDirective(typesRef, containingFile, options, host).resolvedTypeReferenceDirective; }; resolveTypeReferenceDirectiveNamesWorker = function (typeReferenceDirectiveNames, containingFile) { return loadWithLocalCache(checkAllDefined(typeReferenceDirectiveNames), containingFile, loader_2); }; } + var packageIdToSourceFile = ts.createMap(); + var sourceFileToPackageName = ts.createMap(); + var redirectTargetsSet = ts.createMap(); var filesByName = ts.createMap(); var filesByNameIgnoreCase = host.useCaseSensitiveFileNames() ? ts.createMap() : undefined; var structuralIsReused = tryReuseStructureFromOldProgram(); @@ -55599,6 +57413,8 @@ var ts; isSourceFileFromExternalLibrary: isSourceFileFromExternalLibrary, dropDiagnosticsProducingTypeChecker: dropDiagnosticsProducingTypeChecker, getSourceFileFromReference: getSourceFileFromReference, + sourceFileToPackageName: sourceFileToPackageName, + redirectTargetsSet: redirectTargetsSet, }; verifyCompilerOptions(); ts.performance.mark("afterProgram"); @@ -55742,17 +57558,51 @@ var ts; var filePaths = []; var modifiedSourceFiles = []; oldProgram.structureIsReused = 2; - for (var _i = 0, _a = oldProgram.getSourceFiles(); _i < _a.length; _i++) { - var oldSourceFile = _a[_i]; + var oldSourceFiles = oldProgram.getSourceFiles(); + var SeenPackageName; + (function (SeenPackageName) { + SeenPackageName[SeenPackageName["Exists"] = 0] = "Exists"; + SeenPackageName[SeenPackageName["Modified"] = 1] = "Modified"; + })(SeenPackageName || (SeenPackageName = {})); + var seenPackageNames = ts.createMap(); + for (var _i = 0, oldSourceFiles_1 = oldSourceFiles; _i < oldSourceFiles_1.length; _i++) { + var oldSourceFile = oldSourceFiles_1[_i]; var newSourceFile = host.getSourceFileByPath ? host.getSourceFileByPath(oldSourceFile.fileName, oldSourceFile.path, options.target) : host.getSourceFile(oldSourceFile.fileName, options.target); if (!newSourceFile) { return oldProgram.structureIsReused = 0; } + ts.Debug.assert(!newSourceFile.redirectInfo, "Host should not return a redirect source file from `getSourceFile`"); + var fileChanged = void 0; + if (oldSourceFile.redirectInfo) { + if (newSourceFile !== oldSourceFile.redirectInfo.unredirected) { + return oldProgram.structureIsReused = 0; + } + fileChanged = false; + newSourceFile = oldSourceFile; + } + else if (oldProgram.redirectTargetsSet.has(oldSourceFile.path)) { + if (newSourceFile !== oldSourceFile) { + return oldProgram.structureIsReused = 0; + } + fileChanged = false; + } + else { + fileChanged = newSourceFile !== oldSourceFile; + } newSourceFile.path = oldSourceFile.path; filePaths.push(newSourceFile.path); - if (oldSourceFile !== newSourceFile) { + var packageName = oldProgram.sourceFileToPackageName.get(oldSourceFile.path); + if (packageName !== undefined) { + var prevKind = seenPackageNames.get(packageName); + var newKind = fileChanged ? 1 : 0; + if ((prevKind !== undefined && newKind === 1) || prevKind === 1) { + return oldProgram.structureIsReused = 0; + } + seenPackageNames.set(packageName, newKind); + } + if (fileChanged) { if (oldSourceFile.hasNoDefaultLib !== newSourceFile.hasNoDefaultLib) { oldProgram.structureIsReused = 1; } @@ -55780,8 +57630,8 @@ var ts; return oldProgram.structureIsReused; } modifiedFilePaths = modifiedSourceFiles.map(function (f) { return f.newFile.path; }); - for (var _b = 0, modifiedSourceFiles_1 = modifiedSourceFiles; _b < modifiedSourceFiles_1.length; _b++) { - var _c = modifiedSourceFiles_1[_b], oldSourceFile = _c.oldFile, newSourceFile = _c.newFile; + for (var _a = 0, modifiedSourceFiles_1 = modifiedSourceFiles; _a < modifiedSourceFiles_1.length; _a++) { + var _b = modifiedSourceFiles_1[_a], oldSourceFile = _b.oldFile, newSourceFile = _b.newFile; var newSourceFilePath = ts.getNormalizedAbsolutePath(newSourceFile.fileName, currentDirectory); if (resolveModuleNamesWorker) { var moduleNames = ts.map(ts.concatenate(newSourceFile.imports, newSourceFile.moduleAugmentations), getTextOfLiteral); @@ -55815,8 +57665,8 @@ var ts; if (oldProgram.getMissingFilePaths().some(function (missingFilePath) { return host.fileExists(missingFilePath); })) { return oldProgram.structureIsReused = 1; } - for (var _d = 0, _e = oldProgram.getMissingFilePaths(); _d < _e.length; _d++) { - var p = _e[_d]; + for (var _c = 0, _d = oldProgram.getMissingFilePaths(); _c < _d.length; _c++) { + var p = _d[_c]; filesByName.set(p, undefined); } for (var i = 0; i < newSourceFiles.length; i++) { @@ -55824,11 +57674,13 @@ var ts; } files = newSourceFiles; fileProcessingDiagnostics = oldProgram.getFileProcessingDiagnostics(); - for (var _f = 0, modifiedSourceFiles_2 = modifiedSourceFiles; _f < modifiedSourceFiles_2.length; _f++) { - var modifiedFile = modifiedSourceFiles_2[_f]; + for (var _e = 0, modifiedSourceFiles_2 = modifiedSourceFiles; _e < modifiedSourceFiles_2.length; _e++) { + var modifiedFile = modifiedSourceFiles_2[_e]; fileProcessingDiagnostics.reattachFileDiagnostics(modifiedFile.newFile); } resolvedTypeReferenceDirectives = oldProgram.getResolvedTypeReferenceDirectives(); + sourceFileToPackageName = oldProgram.sourceFileToPackageName; + redirectTargetsSet = oldProgram.redirectTargetsSet; return oldProgram.structureIsReused = 2; } function getEmitHost(writeFileCallback) { @@ -56307,7 +58159,7 @@ var ts; } } function processSourceFile(fileName, isDefaultLib, refFile, refPos, refEnd) { - getSourceFileFromReferenceWorker(fileName, function (fileName) { return findSourceFile(fileName, toPath(fileName), isDefaultLib, refFile, refPos, refEnd); }, function (diagnostic) { + getSourceFileFromReferenceWorker(fileName, function (fileName) { return findSourceFile(fileName, toPath(fileName), isDefaultLib, refFile, refPos, refEnd, undefined); }, function (diagnostic) { var args = []; for (var _i = 1; _i < arguments.length; _i++) { args[_i - 1] = arguments[_i]; @@ -56324,7 +58176,24 @@ var ts; fileProcessingDiagnostics.add(ts.createCompilerDiagnostic(ts.Diagnostics.File_name_0_differs_from_already_included_file_name_1_only_in_casing, fileName, existingFileName)); } } - function findSourceFile(fileName, path, isDefaultLib, refFile, refPos, refEnd) { + function createRedirectSourceFile(redirectTarget, unredirected, fileName, path) { + var redirect = Object.create(redirectTarget); + redirect.fileName = fileName; + redirect.path = path; + redirect.redirectInfo = { redirectTarget: redirectTarget, unredirected: unredirected }; + Object.defineProperties(redirect, { + id: { + get: function () { return this.redirectInfo.redirectTarget.id; }, + set: function (value) { this.redirectInfo.redirectTarget.id = value; }, + }, + symbol: { + get: function () { return this.redirectInfo.redirectTarget.symbol; }, + set: function (value) { this.redirectInfo.redirectTarget.symbol = value; }, + }, + }); + return redirect; + } + function findSourceFile(fileName, path, isDefaultLib, refFile, refPos, refEnd, packageId) { if (filesByName.has(path)) { var file_1 = filesByName.get(path); if (file_1 && options.forceConsistentCasingInFileNames && ts.getNormalizedAbsolutePath(file_1.fileName, currentDirectory) !== ts.getNormalizedAbsolutePath(fileName, currentDirectory)) { @@ -56355,6 +58224,22 @@ var ts; fileProcessingDiagnostics.add(ts.createCompilerDiagnostic(ts.Diagnostics.Cannot_read_file_0_Colon_1, fileName, hostErrorMessage)); } }); + if (packageId) { + var packageIdKey = packageId.name + "@" + packageId.version; + var fileFromPackageId = packageIdToSourceFile.get(packageIdKey); + if (fileFromPackageId) { + var dupFile = createRedirectSourceFile(fileFromPackageId, file, fileName, path); + redirectTargetsSet.set(fileFromPackageId.path, true); + filesByName.set(path, dupFile); + sourceFileToPackageName.set(path, packageId.name); + files.push(dupFile); + return dupFile; + } + else if (file) { + packageIdToSourceFile.set(packageIdKey, file); + sourceFileToPackageName.set(path, packageId.name); + } + } filesByName.set(path, file); if (file) { sourceFilesFoundSearchingNodeModules.set(path, currentNodeModulesDepth > 0); @@ -56476,7 +58361,7 @@ var ts; else if (shouldAddFile) { var path = toPath(resolvedFileName); var pos = ts.skipTrivia(file.text, file.imports[i].pos); - findSourceFile(resolvedFileName, path, false, file, pos, file.imports[i].end); + findSourceFile(resolvedFileName, path, false, file, pos, file.imports[i].end, resolution.packageId); } if (isFromNodeModulesSearch) { currentNodeModulesDepth--; @@ -57155,6 +59040,12 @@ var ts; category: ts.Diagnostics.Module_Resolution_Options, description: ts.Diagnostics.Allow_default_imports_from_modules_with_no_default_export_This_does_not_affect_code_emit_just_typechecking }, + { + name: "preserveSymlinks", + type: "boolean", + category: ts.Diagnostics.Module_Resolution_Options, + description: ts.Diagnostics.Do_not_resolve_the_real_path_of_symlinks, + }, { name: "sourceRoot", type: "string", @@ -57766,7 +59657,7 @@ var ts; var text = valueExpression.text; if (option && typeof option.type !== "string") { var customOption = option; - if (!customOption.type.has(text)) { + if (!customOption.type.has(text.toLowerCase())) { errors.push(createDiagnosticForInvalidCustomType(customOption, function (message, arg0, arg1) { return ts.createDiagnosticForNodeInSourceFile(sourceFile, valueExpression, message, arg0, arg1); })); } } @@ -58017,12 +59908,10 @@ var ts; } } else { - var specs = includeSpecs ? [] : ["node_modules", "bower_components", "jspm_packages"]; var outDir = raw["compilerOptions"] && raw["compilerOptions"]["outDir"]; if (outDir) { - specs.push(outDir); + excludeSpecs = [outDir]; } - excludeSpecs = specs; } if (fileNames === undefined && includeSpecs === undefined) { includeSpecs = ["**/*"]; @@ -58273,7 +60162,7 @@ var ts; return value; } else if (typeof option.type !== "string") { - return option.type.get(value); + return option.type.get(typeof value === "string" ? value.toLowerCase() : value); } return normalizeNonListOptionValue(option, basePath, value); } @@ -58348,23 +60237,13 @@ var ts; }; } function validateSpecs(specs, errors, allowTrailingRecursion, jsonSourceFile, specKey) { - var validSpecs = []; - for (var _i = 0, specs_1 = specs; _i < specs_1.length; _i++) { - var spec = specs_1[_i]; - if (!allowTrailingRecursion && invalidTrailingRecursionPattern.test(spec)) { - errors.push(createDiagnostic(ts.Diagnostics.File_specification_cannot_end_in_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0, spec)); - } - else if (invalidMultipleRecursionPatterns.test(spec)) { - errors.push(createDiagnostic(ts.Diagnostics.File_specification_cannot_contain_multiple_recursive_directory_wildcards_Asterisk_Asterisk_Colon_0, spec)); - } - else if (invalidDotDotAfterRecursiveWildcardPattern.test(spec)) { - errors.push(createDiagnostic(ts.Diagnostics.File_specification_cannot_contain_a_parent_directory_that_appears_after_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0, spec)); - } - else { - validSpecs.push(spec); + return specs.filter(function (spec) { + var diag = specToDiagnostic(spec, allowTrailingRecursion); + if (diag !== undefined) { + errors.push(createDiagnostic(diag, spec)); } - } - return validSpecs; + return diag === undefined; + }); function createDiagnostic(message, spec) { if (jsonSourceFile && jsonSourceFile.jsonObject) { for (var _i = 0, _a = ts.getPropertyAssignment(jsonSourceFile.jsonObject, specKey); _i < _a.length; _i++) { @@ -58382,6 +60261,17 @@ var ts; return ts.createCompilerDiagnostic(message, spec); } } + function specToDiagnostic(spec, allowTrailingRecursion) { + if (!allowTrailingRecursion && invalidTrailingRecursionPattern.test(spec)) { + return ts.Diagnostics.File_specification_cannot_end_in_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0; + } + else if (invalidMultipleRecursionPatterns.test(spec)) { + return ts.Diagnostics.File_specification_cannot_contain_multiple_recursive_directory_wildcards_Asterisk_Asterisk_Colon_0; + } + else if (invalidDotDotAfterRecursiveWildcardPattern.test(spec)) { + return ts.Diagnostics.File_specification_cannot_contain_a_parent_directory_that_appears_after_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0; + } + } function getWildcardDirectories(include, exclude, path, useCaseSensitiveFileNames) { var rawExcludeRegex = ts.getRegularExpressionForWildcard(exclude, path, "exclude"); var excludeRegex = rawExcludeRegex && new RegExp(rawExcludeRegex, useCaseSensitiveFileNames ? "" : "i"); @@ -59004,6 +60894,7 @@ var ts; return; } })(ts || (ts = {})); +ts.setStackTraceLimit(); if (ts.Debug.isDebugging) { ts.Debug.enableDebugInfo(); } @@ -59011,3 +60902,5 @@ if (ts.sys.tryEnableSourceMapsForHost && /^development$/i.test(ts.sys.getEnviron ts.sys.tryEnableSourceMapsForHost(); } ts.executeCommandLine(ts.sys.args); + +//# sourceMappingURL=tsc.js.map diff --git a/lib/tsserver.js b/lib/tsserver.js index e5ab892428567..c18f6507caa22 100644 --- a/lib/tsserver.js +++ b/lib/tsserver.js @@ -508,11 +508,11 @@ var ts; TypeFormatFlags[TypeFormatFlags["UseFullyQualifiedType"] = 256] = "UseFullyQualifiedType"; TypeFormatFlags[TypeFormatFlags["InFirstTypeArgument"] = 512] = "InFirstTypeArgument"; TypeFormatFlags[TypeFormatFlags["InTypeAlias"] = 1024] = "InTypeAlias"; - TypeFormatFlags[TypeFormatFlags["UseTypeAliasValue"] = 2048] = "UseTypeAliasValue"; TypeFormatFlags[TypeFormatFlags["SuppressAnyReturnType"] = 4096] = "SuppressAnyReturnType"; TypeFormatFlags[TypeFormatFlags["AddUndefined"] = 8192] = "AddUndefined"; TypeFormatFlags[TypeFormatFlags["WriteClassExpressionAsTypeLiteral"] = 16384] = "WriteClassExpressionAsTypeLiteral"; TypeFormatFlags[TypeFormatFlags["InArrayType"] = 32768] = "InArrayType"; + TypeFormatFlags[TypeFormatFlags["UseAliasDefinedOutsideCurrentScope"] = 65536] = "UseAliasDefinedOutsideCurrentScope"; })(TypeFormatFlags = ts.TypeFormatFlags || (ts.TypeFormatFlags = {})); var SymbolFormatFlags; (function (SymbolFormatFlags) { @@ -759,6 +759,12 @@ var ts; InferenceFlags[InferenceFlags["NoDefault"] = 2] = "NoDefault"; InferenceFlags[InferenceFlags["AnyDefault"] = 4] = "AnyDefault"; })(InferenceFlags = ts.InferenceFlags || (ts.InferenceFlags = {})); + var Ternary; + (function (Ternary) { + Ternary[Ternary["False"] = 0] = "False"; + Ternary[Ternary["Maybe"] = 1] = "Maybe"; + Ternary[Ternary["True"] = -1] = "True"; + })(Ternary = ts.Ternary || (ts.Ternary = {})); var SpecialPropertyAssignmentKind; (function (SpecialPropertyAssignmentKind) { SpecialPropertyAssignmentKind[SpecialPropertyAssignmentKind["None"] = 0] = "None"; @@ -1155,16 +1161,10 @@ var ts; })(ts || (ts = {})); var ts; (function (ts) { - ts.versionMajorMinor = "2.5"; + ts.versionMajorMinor = "2.6"; ts.version = ts.versionMajorMinor + ".0"; })(ts || (ts = {})); (function (ts) { - var Ternary; - (function (Ternary) { - Ternary[Ternary["False"] = 0] = "False"; - Ternary[Ternary["Maybe"] = 1] = "Maybe"; - Ternary[Ternary["True"] = -1] = "True"; - })(Ternary = ts.Ternary || (ts.Ternary = {})); ts.collator = typeof Intl === "object" && typeof Intl.Collator === "function" ? new Intl.Collator(undefined, { usage: "sort", sensitivity: "accent" }) : undefined; ts.localeCompareIsCorrect = ts.collator && ts.collator.compare("a", "B") < 0; function createDictionaryObject() { @@ -1452,10 +1452,9 @@ var ts; ts.removeWhere = removeWhere; function filterMutate(array, f) { var outIndex = 0; - for (var _i = 0, array_3 = array; _i < array_3.length; _i++) { - var item = array_3[_i]; - if (f(item)) { - array[outIndex] = item; + for (var i = 0; i < array.length; i++) { + if (f(array[i], i, array)) { + array[outIndex] = array[i]; outIndex++; } } @@ -1501,8 +1500,8 @@ var ts; var result; if (array) { result = []; - for (var _i = 0, array_4 = array; _i < array_4.length; _i++) { - var v = array_4[_i]; + for (var _i = 0, array_3 = array; _i < array_3.length; _i++) { + var v = array_3[_i]; if (v) { if (isArray(v)) { addRange(result, v); @@ -1572,11 +1571,13 @@ var ts; ts.sameFlatMap = sameFlatMap; function mapDefined(array, mapFn) { var result = []; - for (var i = 0; i < array.length; i++) { - var item = array[i]; - var mapped = mapFn(item, i); - if (mapped !== undefined) { - result.push(mapped); + if (array) { + for (var i = 0; i < array.length; i++) { + var item = array[i]; + var mapped = mapFn(item, i); + if (mapped !== undefined) { + result.push(mapped); + } } } return result; @@ -1644,8 +1645,8 @@ var ts; function some(array, predicate) { if (array) { if (predicate) { - for (var _i = 0, array_5 = array; _i < array_5.length; _i++) { - var v = array_5[_i]; + for (var _i = 0, array_4 = array; _i < array_4.length; _i++) { + var v = array_4[_i]; if (predicate(v)) { return true; } @@ -1670,8 +1671,8 @@ var ts; var result; if (array) { result = []; - loop: for (var _i = 0, array_6 = array; _i < array_6.length; _i++) { - var item = array_6[_i]; + loop: for (var _i = 0, array_5 = array; _i < array_5.length; _i++) { + var item = array_5[_i]; for (var _a = 0, result_1 = result; _a < result_1.length; _a++) { var res = result_1[_a]; if (areEqual ? areEqual(res, item) : res === item) { @@ -1759,8 +1760,8 @@ var ts; ts.relativeComplement = relativeComplement; function sum(array, prop) { var result = 0; - for (var _i = 0, array_7 = array; _i < array_7.length; _i++) { - var v = array_7[_i]; + for (var _i = 0, array_6 = array; _i < array_6.length; _i++) { + var v = array_6[_i]; result += v[prop]; } return result; @@ -2020,8 +2021,8 @@ var ts; ts.equalOwnProperties = equalOwnProperties; function arrayToMap(array, makeKey, makeValue) { var result = createMap(); - for (var _i = 0, array_8 = array; _i < array_8.length; _i++) { - var value = array_8[_i]; + for (var _i = 0, array_7 = array; _i < array_7.length; _i++) { + var value = array_7[_i]; result.set(makeKey(value), makeValue ? makeValue(value) : value); } return result; @@ -2181,11 +2182,11 @@ var ts; ts.getLocaleSpecificMessage = getLocaleSpecificMessage; function createFileDiagnostic(file, start, length, message) { var end = start + length; - Debug.assert(start >= 0, "start must be non-negative, is " + start); - Debug.assert(length >= 0, "length must be non-negative, is " + length); + Debug.assertGreaterThanOrEqual(start, 0); + Debug.assertGreaterThanOrEqual(length, 0); if (file) { - Debug.assert(start <= file.text.length, "start must be within the bounds of the file. " + start + " > " + file.text.length); - Debug.assert(end <= file.text.length, "end must be the bounds of the file. " + end + " > " + file.text.length); + Debug.assertLessThanOrEqual(start, file.text.length); + Debug.assertLessThanOrEqual(end, file.text.length); } var text = getLocaleSpecificMessage(message); if (arguments.length > 4) { @@ -2394,19 +2395,23 @@ var ts; return normalized; } function normalizePath(path) { + return normalizePathAndParts(path).path; + } + ts.normalizePath = normalizePath; + function normalizePathAndParts(path) { path = normalizeSlashes(path); var rootLength = getRootLength(path); var root = path.substr(0, rootLength); - var normalized = getNormalizedParts(path, rootLength); - if (normalized.length) { - var joinedParts = root + normalized.join(ts.directorySeparator); - return pathEndsWithDirectorySeparator(path) ? joinedParts + ts.directorySeparator : joinedParts; + var parts = getNormalizedParts(path, rootLength); + if (parts.length) { + var joinedParts = root + parts.join(ts.directorySeparator); + return { path: pathEndsWithDirectorySeparator(path) ? joinedParts + ts.directorySeparator : joinedParts, parts: parts }; } else { - return root; + return { path: root, parts: parts }; } } - ts.normalizePath = normalizePath; + ts.normalizePathAndParts = normalizePathAndParts; function pathEndsWithDirectorySeparator(path) { return path.charCodeAt(path.length - 1) === directorySeparatorCharCode; } @@ -2669,8 +2674,28 @@ var ts; ts.fileExtensionIsOneOf = fileExtensionIsOneOf; var reservedCharacterPattern = /[^\w\s\/]/g; var wildcardCharCodes = [42, 63]; - var singleAsteriskRegexFragmentFiles = "([^./]|(\\.(?!min\\.js$))?)*"; - var singleAsteriskRegexFragmentOther = "[^/]*"; + ts.commonPackageFolders = ["node_modules", "bower_components", "jspm_packages"]; + var implicitExcludePathRegexPattern = "(?!(" + ts.commonPackageFolders.join("|") + ")(/|$))"; + var filesMatcher = { + singleAsteriskRegexFragment: "([^./]|(\\.(?!min\\.js$))?)*", + doubleAsteriskRegexFragment: "(/" + implicitExcludePathRegexPattern + "[^/.][^/]*)*?", + replaceWildcardCharacter: function (match) { return replaceWildcardCharacter(match, filesMatcher.singleAsteriskRegexFragment); } + }; + var directoriesMatcher = { + singleAsteriskRegexFragment: "[^/]*", + doubleAsteriskRegexFragment: "(/" + implicitExcludePathRegexPattern + "[^/.][^/]*)*?", + replaceWildcardCharacter: function (match) { return replaceWildcardCharacter(match, directoriesMatcher.singleAsteriskRegexFragment); } + }; + var excludeMatcher = { + singleAsteriskRegexFragment: "[^/]*", + doubleAsteriskRegexFragment: "(/.+?)?", + replaceWildcardCharacter: function (match) { return replaceWildcardCharacter(match, excludeMatcher.singleAsteriskRegexFragment); } + }; + var wildcardMatchers = { + files: filesMatcher, + directories: directoriesMatcher, + exclude: excludeMatcher + }; function getRegularExpressionForWildcard(specs, basePath, usage) { var patterns = getRegularExpressionsForWildcards(specs, basePath, usage); if (!patterns || !patterns.length) { @@ -2685,18 +2710,16 @@ var ts; if (specs === undefined || specs.length === 0) { return undefined; } - var replaceWildcardCharacter = usage === "files" ? replaceWildCardCharacterFiles : replaceWildCardCharacterOther; - var singleAsteriskRegexFragment = usage === "files" ? singleAsteriskRegexFragmentFiles : singleAsteriskRegexFragmentOther; - var doubleAsteriskRegexFragment = usage === "exclude" ? "(/.+?)?" : "(/[^/.][^/]*)*?"; return flatMap(specs, function (spec) { - return spec && getSubPatternFromSpec(spec, basePath, usage, singleAsteriskRegexFragment, doubleAsteriskRegexFragment, replaceWildcardCharacter); + return spec && getSubPatternFromSpec(spec, basePath, usage, wildcardMatchers[usage]); }); } function isImplicitGlob(lastPathComponent) { return !/[.*?]/.test(lastPathComponent); } ts.isImplicitGlob = isImplicitGlob; - function getSubPatternFromSpec(spec, basePath, usage, singleAsteriskRegexFragment, doubleAsteriskRegexFragment, replaceWildcardCharacter) { + function getSubPatternFromSpec(spec, basePath, usage, _a) { + var singleAsteriskRegexFragment = _a.singleAsteriskRegexFragment, doubleAsteriskRegexFragment = _a.doubleAsteriskRegexFragment, replaceWildcardCharacter = _a.replaceWildcardCharacter; var subpattern = ""; var hasRecursiveDirectoryWildcard = false; var hasWrittenComponent = false; @@ -2728,16 +2751,24 @@ var ts; subpattern += ts.directorySeparator; } if (usage !== "exclude") { + var componentPattern = ""; if (component.charCodeAt(0) === 42) { - subpattern += "([^./]" + singleAsteriskRegexFragment + ")?"; + componentPattern += "([^./]" + singleAsteriskRegexFragment + ")?"; component = component.substr(1); } else if (component.charCodeAt(0) === 63) { - subpattern += "[^./]"; + componentPattern += "[^./]"; component = component.substr(1); } + componentPattern += component.replace(reservedCharacterPattern, replaceWildcardCharacter); + if (componentPattern !== component) { + subpattern += implicitExcludePathRegexPattern; + } + subpattern += componentPattern; + } + else { + subpattern += component.replace(reservedCharacterPattern, replaceWildcardCharacter); } - subpattern += component.replace(reservedCharacterPattern, replaceWildcardCharacter); } hasWrittenComponent = true; } @@ -2747,12 +2778,6 @@ var ts; } return subpattern; } - function replaceWildCardCharacterFiles(match) { - return replaceWildcardCharacter(match, singleAsteriskRegexFragmentFiles); - } - function replaceWildCardCharacterOther(match) { - return replaceWildcardCharacter(match, singleAsteriskRegexFragmentOther); - } function replaceWildcardCharacter(match, singleAsteriskRegexFragment) { return match === "*" ? singleAsteriskRegexFragment : match === "?" ? "[^/]" : "\\" + match; } @@ -2889,14 +2914,7 @@ var ts; if (!extraFileExtensions || extraFileExtensions.length === 0 || !needAllExtensions) { return needAllExtensions ? allSupportedExtensions : ts.supportedTypeScriptExtensions; } - var extensions = allSupportedExtensions.slice(0); - for (var _i = 0, extraFileExtensions_1 = extraFileExtensions; _i < extraFileExtensions_1.length; _i++) { - var extInfo = extraFileExtensions_1[_i]; - if (extensions.indexOf(extInfo.extension) === -1) { - extensions.push(extInfo.extension); - } - } - return extensions; + return deduplicate(allSupportedExtensions.concat(extraFileExtensions.map(function (e) { return e.extension; }))); } ts.getSupportedExtensions = getSupportedExtensions; function hasJavaScriptFileExtension(fileName) { @@ -3038,12 +3056,37 @@ var ts; function assert(expression, message, verboseDebugInfo, stackCrawlMark) { if (!expression) { if (verboseDebugInfo) { - message += "\r\nVerbose Debug Information: " + verboseDebugInfo(); + message += "\r\nVerbose Debug Information: " + (typeof verboseDebugInfo === "string" ? verboseDebugInfo : verboseDebugInfo()); } fail(message ? "False expression: " + message : "False expression.", stackCrawlMark || assert); } } Debug.assert = assert; + function assertEqual(a, b, msg, msg2) { + if (a !== b) { + var message = msg ? msg2 ? msg + " " + msg2 : msg : ""; + fail("Expected " + a + " === " + b + ". " + message); + } + } + Debug.assertEqual = assertEqual; + function assertLessThan(a, b, msg) { + if (a >= b) { + fail("Expected " + a + " < " + b + ". " + (msg || "")); + } + } + Debug.assertLessThan = assertLessThan; + function assertLessThanOrEqual(a, b) { + if (a > b) { + fail("Expected " + a + " <= " + b); + } + } + Debug.assertLessThanOrEqual = assertLessThanOrEqual; + function assertGreaterThanOrEqual(a, b) { + if (a < b) { + fail("Expected " + a + " >= " + b); + } + } + Debug.assertGreaterThanOrEqual = assertGreaterThanOrEqual; function fail(message, stackCrawlMark) { debugger; var e = new Error(message ? "Debug Failure. " + message : "Debug Failure."); @@ -3178,6 +3221,10 @@ var ts; Debug.fail("File " + path + " has unknown extension."); } ts.extensionFromPath = extensionFromPath; + function isAnySupportedFileExtension(path) { + return tryGetExtensionFromPath(path) !== undefined; + } + ts.isAnySupportedFileExtension = isAnySupportedFileExtension; function tryGetExtensionFromPath(path) { return find(ts.supportedTypescriptExtensionsForExtractExtension, function (e) { return fileExtensionIs(path, e); }) || find(ts.supportedJavascriptExtensions, function (e) { return fileExtensionIs(path, e); }); } @@ -3189,6 +3236,12 @@ var ts; })(ts || (ts = {})); var ts; (function (ts) { + function setStackTraceLimit() { + if (Error.stackTraceLimit < 100) { + Error.stackTraceLimit = 100; + } + } + ts.setStackTraceLimit = setStackTraceLimit; var FileWatcherEventKind; (function (FileWatcherEventKind) { FileWatcherEventKind[FileWatcherEventKind["Created"] = 0] = "Created"; @@ -3238,7 +3291,7 @@ var ts; watcher.referenceCount += 1; return; } - watcher = _fs.watch(dirPath, { persistent: true }, function (eventName, relativeFileName) { return fileEventHandler(eventName, relativeFileName, dirPath); }); + watcher = _fs.watch(dirPath || ".", { persistent: true }, function (eventName, relativeFileName) { return fileEventHandler(eventName, relativeFileName, dirPath); }); watcher.referenceCount = 1; dirWatchers.set(dirPath, watcher); return; @@ -4064,6 +4117,8 @@ var ts; Expected_at_least_0_arguments_but_got_a_minimum_of_1: diag(2557, ts.DiagnosticCategory.Error, "Expected_at_least_0_arguments_but_got_a_minimum_of_1_2557", "Expected at least {0} arguments, but got a minimum of {1}."), Expected_0_type_arguments_but_got_1: diag(2558, ts.DiagnosticCategory.Error, "Expected_0_type_arguments_but_got_1_2558", "Expected {0} type arguments, but got {1}."), Type_0_has_no_properties_in_common_with_type_1: diag(2559, ts.DiagnosticCategory.Error, "Type_0_has_no_properties_in_common_with_type_1_2559", "Type '{0}' has no properties in common with type '{1}'."), + Value_of_type_0_has_no_properties_in_common_with_type_1_Did_you_mean_to_call_it: diag(2560, ts.DiagnosticCategory.Error, "Value_of_type_0_has_no_properties_in_common_with_type_1_Did_you_mean_to_call_it_2560", "Value of type '{0}' has no properties in common with type '{1}'. Did you mean to call it?"), + Base_class_expressions_cannot_reference_class_type_parameters: diag(2561, ts.DiagnosticCategory.Error, "Base_class_expressions_cannot_reference_class_type_parameters_2561", "Base class expressions cannot reference class type parameters."), JSX_element_attributes_type_0_may_not_be_a_union_type: diag(2600, ts.DiagnosticCategory.Error, "JSX_element_attributes_type_0_may_not_be_a_union_type_2600", "JSX element attributes type '{0}' may not be a union type."), The_return_type_of_a_JSX_element_constructor_must_return_an_object_type: diag(2601, ts.DiagnosticCategory.Error, "The_return_type_of_a_JSX_element_constructor_must_return_an_object_type_2601", "The return type of a JSX element constructor must return an object type."), JSX_element_implicitly_has_type_any_because_the_global_type_JSX_Element_does_not_exist: diag(2602, ts.DiagnosticCategory.Error, "JSX_element_implicitly_has_type_any_because_the_global_type_JSX_Element_does_not_exist_2602", "JSX element implicitly has type 'any' because the global type 'JSX.Element' does not exist."), @@ -4251,6 +4306,7 @@ var ts; Do_not_emit_outputs: diag(6010, ts.DiagnosticCategory.Message, "Do_not_emit_outputs_6010", "Do not emit outputs."), Allow_default_imports_from_modules_with_no_default_export_This_does_not_affect_code_emit_just_typechecking: diag(6011, ts.DiagnosticCategory.Message, "Allow_default_imports_from_modules_with_no_default_export_This_does_not_affect_code_emit_just_typech_6011", "Allow default imports from modules with no default export. This does not affect code emit, just typechecking."), Skip_type_checking_of_declaration_files: diag(6012, ts.DiagnosticCategory.Message, "Skip_type_checking_of_declaration_files_6012", "Skip type checking of declaration files."), + Do_not_resolve_the_real_path_of_symlinks: diag(6013, ts.DiagnosticCategory.Message, "Do_not_resolve_the_real_path_of_symlinks_6013", "Do not resolve the real path of symlinks."), Specify_ECMAScript_target_version_Colon_ES3_default_ES5_ES2015_ES2016_ES2017_or_ESNEXT: diag(6015, ts.DiagnosticCategory.Message, "Specify_ECMAScript_target_version_Colon_ES3_default_ES5_ES2015_ES2016_ES2017_or_ESNEXT_6015", "Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', or 'ESNEXT'."), Specify_module_code_generation_Colon_none_commonjs_amd_system_umd_es2015_or_ESNext: diag(6016, ts.DiagnosticCategory.Message, "Specify_module_code_generation_Colon_none_commonjs_amd_system_umd_es2015_or_ESNext_6016", "Specify module code generation: 'none', commonjs', 'amd', 'system', 'umd', 'es2015', or 'ESNext'."), Print_this_message: diag(6017, ts.DiagnosticCategory.Message, "Print_this_message_6017", "Print this message."), @@ -4504,6 +4560,8 @@ var ts; Rewrite_as_the_indexed_access_type_0: diag(90026, ts.DiagnosticCategory.Message, "Rewrite_as_the_indexed_access_type_0_90026", "Rewrite as the indexed access type '{0}'."), Convert_function_to_an_ES2015_class: diag(95001, ts.DiagnosticCategory.Message, "Convert_function_to_an_ES2015_class_95001", "Convert function to an ES2015 class"), Convert_function_0_to_class: diag(95002, ts.DiagnosticCategory.Message, "Convert_function_0_to_class_95002", "Convert function '{0}' to class"), + Extract_function: diag(95003, ts.DiagnosticCategory.Message, "Extract_function_95003", "Extract function"), + Extract_function_into_0: diag(95004, ts.DiagnosticCategory.Message, "Extract_function_into_0_95004", "Extract function into '{0}'"), }; })(ts || (ts = {})); var ts; @@ -4516,6 +4574,12 @@ var ts; return compilerOptions.traceResolution && host.trace !== undefined; } ts.isTraceEnabled = isTraceEnabled; + function withPackageId(packageId, r) { + return r && { path: r.path, extension: r.ext, packageId: packageId }; + } + function noPackageId(r) { + return withPackageId(undefined, r); + } var Extensions; (function (Extensions) { Extensions[Extensions["TypeScript"] = 0] = "TypeScript"; @@ -4531,12 +4595,11 @@ var ts; } function createResolvedModuleWithFailedLookupLocations(resolved, isExternalLibraryImport, failedLookupLocations) { return { - resolvedModule: resolved && { resolvedFileName: resolved.path, extension: resolved.extension, isExternalLibraryImport: isExternalLibraryImport }, + resolvedModule: resolved && { resolvedFileName: resolved.path, extension: resolved.extension, isExternalLibraryImport: isExternalLibraryImport, packageId: resolved.packageId }, failedLookupLocations: failedLookupLocations }; } - function tryReadPackageJsonFields(readTypes, packageJsonPath, baseDirectory, state) { - var jsonContent = readJson(packageJsonPath, state.host); + function tryReadPackageJsonFields(readTypes, jsonContent, baseDirectory, state) { return readTypes ? tryReadFromField("typings") || tryReadFromField("types") : tryReadFromField("main"); function tryReadFromField(fieldName) { if (!ts.hasProperty(jsonContent, fieldName)) { @@ -4630,7 +4693,9 @@ var ts; } var resolvedTypeReferenceDirective; if (resolved) { - resolved = realpath(resolved, host, traceEnabled); + if (!options.preserveSymlinks) { + resolved = realPath(resolved, host, traceEnabled); + } if (traceEnabled) { trace(host, ts.Diagnostics.Type_reference_directive_0_was_successfully_resolved_to_1_primary_Colon_2, typeReferenceDirectiveName, resolved, primary); } @@ -4931,7 +4996,7 @@ var ts; if (extension !== undefined) { var path_1 = tryFile(candidate, failedLookupLocations, false, state); if (path_1 !== undefined) { - return { path: path_1, extension: extension }; + return { path: path_1, extension: extension, packageId: undefined }; } } return loader(extensions, candidate, failedLookupLocations, !directoryProbablyExists(ts.getDirectoryPath(candidate), state.host), state); @@ -4952,7 +5017,7 @@ var ts; function resolveJavaScriptModule(moduleName, initialDir, host) { var _a = nodeModuleNameResolverWorker(moduleName, initialDir, { moduleResolution: ts.ModuleResolutionKind.NodeJs, allowJs: true }, host, undefined, true), resolvedModule = _a.resolvedModule, failedLookupLocations = _a.failedLookupLocations; if (!resolvedModule) { - throw new Error("Could not resolve JS module " + moduleName + " starting at " + initialDir + ". Looked in: " + failedLookupLocations.join(", ")); + throw new Error("Could not resolve JS module '" + moduleName + "' starting at '" + initialDir + "'. Looked in: " + failedLookupLocations.join(", ")); } return resolvedModule.resolvedFileName; } @@ -4978,16 +5043,22 @@ var ts; trace(host, ts.Diagnostics.Loading_module_0_from_node_modules_folder_target_file_type_1, moduleName, Extensions[extensions]); } var resolved_1 = loadModuleFromNodeModules(extensions, moduleName, containingDirectory, failedLookupLocations, state, cache); - return resolved_1 && { value: resolved_1.value && { resolved: { path: realpath(resolved_1.value.path, host, traceEnabled), extension: resolved_1.value.extension }, isExternalLibraryImport: true } }; + if (!resolved_1) + return undefined; + var resolvedValue = resolved_1.value; + if (!compilerOptions.preserveSymlinks) { + resolvedValue = resolvedValue && __assign({}, resolved_1.value, { path: realPath(resolved_1.value.path, host, traceEnabled), extension: resolved_1.value.extension }); + } + return { value: resolvedValue && { resolved: resolvedValue, isExternalLibraryImport: true } }; } else { - var candidate = ts.normalizePath(ts.combinePaths(containingDirectory, moduleName)); + var _a = ts.normalizePathAndParts(ts.combinePaths(containingDirectory, moduleName)), candidate = _a.path, parts = _a.parts; var resolved_2 = nodeLoadModuleByRelativeName(extensions, candidate, failedLookupLocations, false, state, true); - return resolved_2 && toSearchResult({ resolved: resolved_2, isExternalLibraryImport: false }); + return resolved_2 && toSearchResult({ resolved: resolved_2, isExternalLibraryImport: ts.contains(parts, "node_modules") }); } } } - function realpath(path, host, traceEnabled) { + function realPath(path, host, traceEnabled) { if (!host.realpath) { return path; } @@ -5013,7 +5084,7 @@ var ts; } var resolvedFromFile = loadModuleFromFile(extensions, candidate, failedLookupLocations, onlyRecordFailures, state); if (resolvedFromFile) { - return resolvedFromFile; + return noPackageId(resolvedFromFile); } } if (!onlyRecordFailures) { @@ -5031,6 +5102,9 @@ var ts; return !host.directoryExists || host.directoryExists(directoryName); } ts.directoryProbablyExists = directoryProbablyExists; + function loadModuleFromFileNoPackageId(extensions, candidate, failedLookupLocations, onlyRecordFailures, state) { + return noPackageId(loadModuleFromFile(extensions, candidate, failedLookupLocations, onlyRecordFailures, state)); + } function loadModuleFromFile(extensions, candidate, failedLookupLocations, onlyRecordFailures, state) { var resolvedByAddingExtension = tryAddingExtensions(candidate, extensions, failedLookupLocations, onlyRecordFailures, state); if (resolvedByAddingExtension) { @@ -5060,9 +5134,9 @@ var ts; case Extensions.JavaScript: return tryExtension(".js") || tryExtension(".jsx"); } - function tryExtension(extension) { - var path = tryFile(candidate + extension, failedLookupLocations, onlyRecordFailures, state); - return path && { path: path, extension: extension }; + function tryExtension(ext) { + var path = tryFile(candidate + ext, failedLookupLocations, onlyRecordFailures, state); + return path && { path: path, ext: ext }; } } function tryFile(fileName, failedLookupLocations, onlyRecordFailures, state) { @@ -5085,12 +5159,20 @@ var ts; function loadNodeModuleFromDirectory(extensions, candidate, failedLookupLocations, onlyRecordFailures, state, considerPackageJson) { if (considerPackageJson === void 0) { considerPackageJson = true; } var directoryExists = !onlyRecordFailures && directoryProbablyExists(candidate, state.host); + var packageId; if (considerPackageJson) { var packageJsonPath = pathToPackageJson(candidate); if (directoryExists && state.host.fileExists(packageJsonPath)) { - var fromPackageJson = loadModuleFromPackageJson(packageJsonPath, extensions, candidate, failedLookupLocations, state); + if (state.traceEnabled) { + trace(state.host, ts.Diagnostics.Found_package_json_at_0, packageJsonPath); + } + var jsonContent = readJson(packageJsonPath, state.host); + if (typeof jsonContent.name === "string" && typeof jsonContent.version === "string") { + packageId = { name: jsonContent.name, version: jsonContent.version }; + } + var fromPackageJson = loadModuleFromPackageJson(jsonContent, extensions, candidate, failedLookupLocations, state); if (fromPackageJson) { - return fromPackageJson; + return withPackageId(packageId, fromPackageJson); } } else { @@ -5100,13 +5182,10 @@ var ts; failedLookupLocations.push(packageJsonPath); } } - return loadModuleFromFile(extensions, ts.combinePaths(candidate, "index"), failedLookupLocations, !directoryExists, state); + return withPackageId(packageId, loadModuleFromFile(extensions, ts.combinePaths(candidate, "index"), failedLookupLocations, !directoryExists, state)); } - function loadModuleFromPackageJson(packageJsonPath, extensions, candidate, failedLookupLocations, state) { - if (state.traceEnabled) { - trace(state.host, ts.Diagnostics.Found_package_json_at_0, packageJsonPath); - } - var file = tryReadPackageJsonFields(extensions !== Extensions.JavaScript, packageJsonPath, candidate, state); + function loadModuleFromPackageJson(jsonContent, extensions, candidate, failedLookupLocations, state) { + var file = tryReadPackageJsonFields(extensions !== Extensions.JavaScript, jsonContent, candidate, state); if (!file) { return undefined; } @@ -5122,11 +5201,15 @@ var ts; } } var nextExtensions = extensions === Extensions.DtsOnly ? Extensions.TypeScript : extensions; - return nodeLoadModuleByRelativeName(nextExtensions, file, failedLookupLocations, onlyRecordFailures, state, false); + var result = nodeLoadModuleByRelativeName(nextExtensions, file, failedLookupLocations, onlyRecordFailures, state, false); + if (result) { + ts.Debug.assert(result.packageId === undefined); + return { path: result.path, ext: result.extension }; + } } function resolvedIfExtensionMatches(extensions, path) { - var extension = ts.tryGetExtensionFromPath(path); - return extension !== undefined && extensionIsOk(extensions, extension) ? { path: path, extension: extension } : undefined; + var ext = ts.tryGetExtensionFromPath(path); + return ext !== undefined && extensionIsOk(extensions, ext) ? { path: path, ext: ext } : undefined; } function extensionIsOk(extensions, extension) { switch (extensions) { @@ -5143,7 +5226,7 @@ var ts; } function loadModuleFromNodeModulesFolder(extensions, moduleName, nodeModulesFolder, nodeModulesFolderExists, failedLookupLocations, state) { var candidate = ts.normalizePath(ts.combinePaths(nodeModulesFolder, moduleName)); - return loadModuleFromFile(extensions, candidate, failedLookupLocations, !nodeModulesFolderExists, state) || + return loadModuleFromFileNoPackageId(extensions, candidate, failedLookupLocations, !nodeModulesFolderExists, state) || loadNodeModuleFromDirectory(extensions, candidate, failedLookupLocations, !nodeModulesFolderExists, state); } function loadModuleFromNodeModules(extensions, moduleName, directory, failedLookupLocations, state, cache) { @@ -5217,7 +5300,7 @@ var ts; if (traceEnabled) { trace(host, ts.Diagnostics.Resolution_for_module_0_was_found_in_cache, moduleName); } - return { value: result.resolvedModule && { path: result.resolvedModule.resolvedFileName, extension: result.resolvedModule.extension } }; + return { value: result.resolvedModule && { path: result.resolvedModule.resolvedFileName, extension: result.resolvedModule.extension, packageId: result.resolvedModule.packageId } }; } } function classicNameResolver(moduleName, containingFile, compilerOptions, host, cache) { @@ -5228,7 +5311,7 @@ var ts; var resolved = tryResolve(Extensions.TypeScript) || tryResolve(Extensions.JavaScript); return createResolvedModuleWithFailedLookupLocations(resolved && resolved.value, false, failedLookupLocations); function tryResolve(extensions) { - var resolvedUsingSettings = tryLoadModuleUsingOptionalResolutionSettings(extensions, moduleName, containingDirectory, loadModuleFromFile, failedLookupLocations, state); + var resolvedUsingSettings = tryLoadModuleUsingOptionalResolutionSettings(extensions, moduleName, containingDirectory, loadModuleFromFileNoPackageId, failedLookupLocations, state); if (resolvedUsingSettings) { return { value: resolvedUsingSettings }; } @@ -5240,7 +5323,7 @@ var ts; return resolutionFromCache; } var searchName = ts.normalizePath(ts.combinePaths(directory, moduleName)); - return toSearchResult(loadModuleFromFile(extensions, searchName, failedLookupLocations, false, state)); + return toSearchResult(loadModuleFromFileNoPackageId(extensions, searchName, failedLookupLocations, false, state)); }); if (resolved_3) { return resolved_3; @@ -5251,7 +5334,7 @@ var ts; } else { var candidate = ts.normalizePath(ts.combinePaths(containingDirectory, moduleName)); - return toSearchResult(loadModuleFromFile(extensions, candidate, failedLookupLocations, false, state)); + return toSearchResult(loadModuleFromFileNoPackageId(extensions, candidate, failedLookupLocations, false, state)); } } } @@ -5302,19 +5385,6 @@ var ts; return undefined; } ts.getDeclarationOfKind = getDeclarationOfKind; - function findDeclaration(symbol, predicate) { - var declarations = symbol.declarations; - if (declarations) { - for (var _i = 0, declarations_2 = declarations; _i < declarations_2.length; _i++) { - var declaration = declarations_2[_i]; - if (predicate(declaration)) { - return declaration; - } - } - } - return undefined; - } - ts.findDeclaration = findDeclaration; var stringWriter = createSingleLineStringWriter(); var stringWriterAcquired = false; function createSingleLineStringWriter() { @@ -5377,9 +5447,13 @@ var ts; function moduleResolutionIsEqualTo(oldResolution, newResolution) { return oldResolution.isExternalLibraryImport === newResolution.isExternalLibraryImport && oldResolution.extension === newResolution.extension && - oldResolution.resolvedFileName === newResolution.resolvedFileName; + oldResolution.resolvedFileName === newResolution.resolvedFileName && + packageIdIsEqual(oldResolution.packageId, newResolution.packageId); } ts.moduleResolutionIsEqualTo = moduleResolutionIsEqualTo; + function packageIdIsEqual(a, b) { + return a === b || a && b && a.name === b.name && a.version === b.version; + } function typeDirectiveIsEqualTo(oldResolution, newResolution) { return oldResolution.resolvedFileName === newResolution.resolvedFileName && oldResolution.primary === newResolution.primary; } @@ -5444,14 +5518,6 @@ var ts; return file.fileName + "(" + (loc.line + 1) + "," + (loc.character + 1) + ")"; } ts.nodePosToString = nodePosToString; - function getStartPosOfNode(node) { - return node.pos; - } - ts.getStartPosOfNode = getStartPosOfNode; - function isDefined(value) { - return value !== undefined; - } - ts.isDefined = isDefined; function getEndLinePosition(line, sourceFile) { ts.Debug.assert(line >= 0); var lineStarts = ts.getLineStarts(sourceFile); @@ -5482,6 +5548,25 @@ var ts; return !nodeIsMissing(node); } ts.nodeIsPresent = nodeIsPresent; + function isRecognizedTripleSlashComment(text, commentPos, commentEnd) { + if (text.charCodeAt(commentPos + 1) === 47 && + commentPos + 2 < commentEnd && + text.charCodeAt(commentPos + 2) === 47) { + var textSubStr = text.substring(commentPos, commentEnd); + return textSubStr.match(ts.fullTripleSlashReferencePathRegEx) || + textSubStr.match(ts.fullTripleSlashAMDReferencePathRegEx) || + textSubStr.match(fullTripleSlashReferenceTypeReferenceDirectiveRegEx) || + textSubStr.match(defaultLibReferenceRegEx) ? + true : false; + } + return false; + } + ts.isRecognizedTripleSlashComment = isRecognizedTripleSlashComment; + function isPinnedComment(text, comment) { + return text.charCodeAt(comment.pos + 1) === 42 && + text.charCodeAt(comment.pos + 2) === 33; + } + ts.isPinnedComment = isPinnedComment; function getTokenPosOfNode(node, sourceFile, includeJsDoc) { if (nodeIsMissing(node)) { return node.pos; @@ -5538,15 +5623,20 @@ var ts; var escapeText = getEmitFlags(node) & 16777216 ? escapeString : escapeNonAsciiString; switch (node.kind) { case 9: - return '"' + escapeText(node.text) + '"'; + if (node.singleQuote) { + return "'" + escapeText(node.text, 39) + "'"; + } + else { + return '"' + escapeText(node.text, 34) + '"'; + } case 13: - return "`" + escapeText(node.text) + "`"; + return "`" + escapeText(node.text, 96) + "`"; case 14: - return "`" + escapeText(node.text) + "${"; + return "`" + escapeText(node.text, 96) + "${"; case 15: - return "}" + escapeText(node.text) + "${"; + return "}" + escapeText(node.text, 96) + "${"; case 16: - return "}" + escapeText(node.text) + "`"; + return "}" + escapeText(node.text, 96) + "`"; case 8: return node.text; } @@ -5798,13 +5888,9 @@ var ts; } ts.isPrologueDirective = isPrologueDirective; function getLeadingCommentRangesOfNode(node, sourceFileOfNode) { - return ts.getLeadingCommentRanges(sourceFileOfNode.text, node.pos); + return node.kind !== 10 ? ts.getLeadingCommentRanges(sourceFileOfNode.text, node.pos) : undefined; } ts.getLeadingCommentRangesOfNode = getLeadingCommentRangesOfNode; - function getLeadingCommentRangesOfNodeFromText(node, text) { - return ts.getLeadingCommentRanges(text, node.pos); - } - ts.getLeadingCommentRangesOfNodeFromText = getLeadingCommentRangesOfNodeFromText; function getJSDocCommentRanges(node, text) { var commentRanges = (node.kind === 146 || node.kind === 145 || @@ -5812,7 +5898,7 @@ var ts; node.kind === 187 || node.kind === 185) ? ts.concatenate(ts.getTrailingCommentRanges(text, node.pos), ts.getLeadingCommentRanges(text, node.pos)) : - getLeadingCommentRangesOfNodeFromText(node, text); + ts.getLeadingCommentRanges(text, node.pos); return ts.filter(commentRanges, function (comment) { return text.charCodeAt(comment.pos + 1) === 42 && text.charCodeAt(comment.pos + 2) === 42 && @@ -5821,8 +5907,9 @@ var ts; } ts.getJSDocCommentRanges = getJSDocCommentRanges; ts.fullTripleSlashReferencePathRegEx = /^(\/\/\/\s*/; - ts.fullTripleSlashReferenceTypeReferenceDirectiveRegEx = /^(\/\/\/\s*/; + var fullTripleSlashReferenceTypeReferenceDirectiveRegEx = /^(\/\/\/\s*/; ts.fullTripleSlashAMDReferencePathRegEx = /^(\/\/\/\s*/; + var defaultLibReferenceRegEx = /^(\/\/\/\s*/; function isPartOfTypeNode(node) { if (158 <= node.kind && node.kind <= 173) { return true; @@ -6049,21 +6136,11 @@ var ts; } ts.getPropertyAssignment = getPropertyAssignment; function getContainingFunction(node) { - while (true) { - node = node.parent; - if (!node || ts.isFunctionLike(node)) { - return node; - } - } + return ts.findAncestor(node.parent, ts.isFunctionLike); } ts.getContainingFunction = getContainingFunction; function getContainingClass(node) { - while (true) { - node = node.parent; - if (!node || ts.isClassLike(node)) { - return node; - } - } + return ts.findAncestor(node.parent, ts.isClassLike); } ts.getContainingClass = getContainingClass; function getThisContainer(node, includeArrowFunctions) { @@ -6873,14 +6950,14 @@ var ts; ts.getAncestor = getAncestor; function getFileReferenceFromReferencePath(comment, commentRange) { var simpleReferenceRegEx = /^\/\/\/\s*/gim; + var isNoDefaultLibRegEx = new RegExp(defaultLibReferenceRegEx.source, "gim"); if (simpleReferenceRegEx.test(comment)) { if (isNoDefaultLibRegEx.test(comment)) { return { isNoDefaultLib: true }; } else { var refMatchResult = ts.fullTripleSlashReferencePathRegEx.exec(comment); - var refLibResult = !refMatchResult && ts.fullTripleSlashReferenceTypeReferenceDirectiveRegEx.exec(comment); + var refLibResult = !refMatchResult && fullTripleSlashReferenceTypeReferenceDirectiveRegEx.exec(comment); var match = refMatchResult || refLibResult; if (match) { var pos = commentRange.pos + match[1].length + match[2].length; @@ -7069,10 +7146,6 @@ var ts; return ts.getParseTreeNode(sourceFile, ts.isSourceFile) || sourceFile; } ts.getOriginalSourceFile = getOriginalSourceFile; - function getOriginalSourceFiles(sourceFiles) { - return ts.sameMap(sourceFiles, getOriginalSourceFile); - } - ts.getOriginalSourceFiles = getOriginalSourceFiles; var Associativity; (function (Associativity) { Associativity[Associativity["Left"] = 0] = "Left"; @@ -7311,7 +7384,9 @@ var ts; } } ts.createDiagnosticCollection = createDiagnosticCollection; - var escapedCharsRegExp = /[\\\"\u0000-\u001f\t\v\f\b\r\n\u2028\u2029\u0085]/g; + var doubleQuoteEscapedCharsRegExp = /[\\\"\u0000-\u001f\t\v\f\b\r\n\u2028\u2029\u0085]/g; + var singleQuoteEscapedCharsRegExp = /[\\\'\u0000-\u001f\t\v\f\b\r\n\u2028\u2029\u0085]/g; + var backtickQuoteEscapedCharsRegExp = /[\\\`\u0000-\u001f\t\v\f\b\r\n\u2028\u2029\u0085]/g; var escapedCharsMap = ts.createMapFromTemplate({ "\0": "\\0", "\t": "\\t", @@ -7322,11 +7397,16 @@ var ts; "\n": "\\n", "\\": "\\\\", "\"": "\\\"", + "\'": "\\\'", + "\`": "\\\`", "\u2028": "\\u2028", "\u2029": "\\u2029", "\u0085": "\\u0085" }); - function escapeString(s) { + function escapeString(s, quoteChar) { + var escapedCharsRegExp = quoteChar === 96 ? backtickQuoteEscapedCharsRegExp : + quoteChar === 39 ? singleQuoteEscapedCharsRegExp : + doubleQuoteEscapedCharsRegExp; return s.replace(escapedCharsRegExp, getReplacement); } ts.escapeString = escapeString; @@ -7344,8 +7424,8 @@ var ts; return "\\u" + paddedHexCode; } var nonAsciiCharacters = /[^\u0000-\u007F]/g; - function escapeNonAsciiString(s) { - s = escapeString(s); + function escapeNonAsciiString(s, quoteChar) { + s = escapeString(s, quoteChar); return nonAsciiCharacters.test(s) ? s.replace(nonAsciiCharacters, function (c) { return get16BitUnicodeEscapeSequence(c.charCodeAt(0)); }) : s; @@ -7686,7 +7766,7 @@ var ts; var currentDetachedCommentInfo; if (removeComments) { if (node.pos === 0) { - leadingComments = ts.filter(ts.getLeadingCommentRanges(text, node.pos), isPinnedComment); + leadingComments = ts.filter(ts.getLeadingCommentRanges(text, node.pos), isPinnedCommentLocal); } } else { @@ -7718,9 +7798,8 @@ var ts; } } return currentDetachedCommentInfo; - function isPinnedComment(comment) { - return text.charCodeAt(comment.pos + 1) === 42 && - text.charCodeAt(comment.pos + 2) === 33; + function isPinnedCommentLocal(comment) { + return isPinnedComment(text, comment); } } ts.emitDetachedComments = emitDetachedComments; @@ -7791,9 +7870,13 @@ var ts; } ts.hasModifiers = hasModifiers; function hasModifier(node, flags) { - return (getModifierFlags(node) & flags) !== 0; + return !!getSelectedModifierFlags(node, flags); } ts.hasModifier = hasModifier; + function getSelectedModifierFlags(node, flags) { + return getModifierFlags(node) & flags; + } + ts.getSelectedModifierFlags = getSelectedModifierFlags; function getModifierFlags(node) { if (node.modifierFlagsCache & 536870912) { return node.modifierFlagsCache & ~536870912; @@ -7869,21 +7952,6 @@ var ts; return false; } ts.isDestructuringAssignment = isDestructuringAssignment; - function isSupportedExpressionWithTypeArguments(node) { - return isSupportedExpressionWithTypeArgumentsRest(node.expression); - } - ts.isSupportedExpressionWithTypeArguments = isSupportedExpressionWithTypeArguments; - function isSupportedExpressionWithTypeArgumentsRest(node) { - if (node.kind === 71) { - return true; - } - else if (ts.isPropertyAccessExpression(node)) { - return isSupportedExpressionWithTypeArgumentsRest(node.expression); - } - else { - return false; - } - } function isExpressionWithTypeArgumentsInClassExtendsClause(node) { return tryGetClassExtendingExpressionWithTypeArguments(node) !== undefined; } @@ -7996,72 +8064,6 @@ var ts; return carriageReturnLineFeed; } ts.getNewLineCharacter = getNewLineCharacter; - function isSimpleExpression(node) { - return isSimpleExpressionWorker(node, 0); - } - ts.isSimpleExpression = isSimpleExpression; - function isSimpleExpressionWorker(node, depth) { - if (depth <= 5) { - var kind = node.kind; - if (kind === 9 - || kind === 8 - || kind === 12 - || kind === 13 - || kind === 71 - || kind === 99 - || kind === 97 - || kind === 101 - || kind === 86 - || kind === 95) { - return true; - } - else if (kind === 179) { - return isSimpleExpressionWorker(node.expression, depth + 1); - } - else if (kind === 180) { - return isSimpleExpressionWorker(node.expression, depth + 1) - && isSimpleExpressionWorker(node.argumentExpression, depth + 1); - } - else if (kind === 192 - || kind === 193) { - return isSimpleExpressionWorker(node.operand, depth + 1); - } - else if (kind === 194) { - return node.operatorToken.kind !== 40 - && isSimpleExpressionWorker(node.left, depth + 1) - && isSimpleExpressionWorker(node.right, depth + 1); - } - else if (kind === 195) { - return isSimpleExpressionWorker(node.condition, depth + 1) - && isSimpleExpressionWorker(node.whenTrue, depth + 1) - && isSimpleExpressionWorker(node.whenFalse, depth + 1); - } - else if (kind === 190 - || kind === 189 - || kind === 188) { - return isSimpleExpressionWorker(node.expression, depth + 1); - } - else if (kind === 177) { - return node.elements.length === 0; - } - else if (kind === 178) { - return node.properties.length === 0; - } - else if (kind === 181) { - if (!isSimpleExpressionWorker(node.expression, depth + 1)) { - return false; - } - for (var _i = 0, _a = node.arguments; _i < _a.length; _i++) { - var argument = _a[_i]; - if (!isSimpleExpressionWorker(argument, depth + 1)) { - return false; - } - } - return true; - } - } - return false; - } function formatEnum(value, enumObject, isFlags) { if (value === void 0) { value = 0; } var members = getEnumMembers(enumObject); @@ -8130,18 +8132,6 @@ var ts; return formatEnum(flags, ts.ObjectFlags, true); } ts.formatObjectFlags = formatObjectFlags; - function getRangePos(range) { - return range ? range.pos : -1; - } - ts.getRangePos = getRangePos; - function getRangeEnd(range) { - return range ? range.end : -1; - } - ts.getRangeEnd = getRangeEnd; - function movePos(pos, value) { - return ts.positionIsSynthesized(pos) ? -1 : pos + value; - } - ts.movePos = movePos; function createRange(pos, end) { return { pos: pos, end: end }; } @@ -8170,14 +8160,6 @@ var ts; return range.pos === range.end; } ts.isCollapsedRange = isCollapsedRange; - function collapseRangeToStart(range) { - return isCollapsedRange(range) ? range : moveRangeEnd(range, range.pos); - } - ts.collapseRangeToStart = collapseRangeToStart; - function collapseRangeToEnd(range) { - return isCollapsedRange(range) ? range : moveRangePos(range, range.end); - } - ts.collapseRangeToEnd = collapseRangeToEnd; function createTokenRange(pos, token) { return createRange(pos, pos + ts.tokenToString(token).length); } @@ -8230,22 +8212,6 @@ var ts; function isInitializedVariable(node) { return node.initializer !== undefined; } - function isMergedWithClass(node) { - if (node.symbol) { - for (var _i = 0, _a = node.symbol.declarations; _i < _a.length; _i++) { - var declaration = _a[_i]; - if (declaration.kind === 229 && declaration !== node) { - return true; - } - } - } - return false; - } - ts.isMergedWithClass = isMergedWithClass; - function isFirstDeclarationOfKind(node, kind) { - return node.symbol && getDeclarationOfKind(node.symbol, kind) === node; - } - ts.isFirstDeclarationOfKind = isFirstDeclarationOfKind; function isWatchSet(options) { return options.watch && options.hasOwnProperty("watch"); } @@ -8446,6 +8412,20 @@ var ts; return ts.hasModifier(node, 92) && node.parent.kind === 152 && ts.isClassLike(node.parent.parent); } ts.isParameterPropertyDeclaration = isParameterPropertyDeclaration; + function isEmptyBindingPattern(node) { + if (ts.isBindingPattern(node)) { + return ts.every(node.elements, isEmptyBindingElement); + } + return false; + } + ts.isEmptyBindingPattern = isEmptyBindingPattern; + function isEmptyBindingElement(node) { + if (ts.isOmittedExpression(node)) { + return true; + } + return isEmptyBindingPattern(node.name); + } + ts.isEmptyBindingElement = isEmptyBindingElement; function walkUpBindingElementsAndPatterns(node) { while (node && (node.kind === 176 || ts.isBindingPattern(node))) { node = node.parent; @@ -9526,6 +9506,18 @@ var ts; return isUnaryExpressionKind(ts.skipPartiallyEmittedExpressions(node).kind); } ts.isUnaryExpression = isUnaryExpression; + function isUnaryExpressionWithWrite(expr) { + switch (expr.kind) { + case 193: + return true; + case 192: + return expr.operator === 43 || + expr.operator === 44; + default: + return false; + } + } + ts.isUnaryExpressionWithWrite = isUnaryExpressionWithWrite; function isExpressionKind(kind) { return kind === 195 || kind === 197 @@ -9710,9 +9702,19 @@ var ts; var kind = node.kind; return isStatementKindButNotDeclarationKind(kind) || isDeclarationStatementKind(kind) - || kind === 207; + || isBlockStatement(node); } ts.isStatement = isStatement; + function isBlockStatement(node) { + if (node.kind !== 207) + return false; + if (node.parent !== undefined) { + if (node.parent.kind === 224 || node.parent.kind === 260) { + return false; + } + } + return !ts.isFunctionBlock(node); + } function isModuleReference(node) { var kind = node.kind; return kind === 248 @@ -13217,11 +13219,31 @@ var ts; var node = parseTokenNode(); return token() === 23 ? undefined : node; } - function parseLiteralTypeNode() { + function parseLiteralTypeNode(negative) { var node = createNode(173); - node.literal = parseSimpleUnaryExpression(); - finishNode(node); - return node; + var unaryMinusExpression; + if (negative) { + unaryMinusExpression = createNode(192); + unaryMinusExpression.operator = 38; + nextToken(); + } + var expression; + switch (token()) { + case 9: + case 8: + expression = parseLiteralLikeNode(token()); + break; + case 101: + case 86: + expression = parseTokenNode(); + } + if (negative) { + unaryMinusExpression.operand = expression; + finishNode(unaryMinusExpression); + expression = unaryMinusExpression; + } + node.literal = expression; + return finishNode(node); } function nextTokenIsNumericLiteral() { return nextToken() === 8; @@ -13253,7 +13275,7 @@ var ts; case 86: return parseLiteralTypeNode(); case 38: - return lookAhead(nextTokenIsNumericLiteral) ? parseLiteralTypeNode() : parseTypeReference(); + return lookAhead(nextTokenIsNumericLiteral) ? parseLiteralTypeNode(true) : parseTypeReference(); case 105: case 95: return parseTokenNode(); @@ -13302,6 +13324,7 @@ var ts; case 101: case 86: case 134: + case 39: return true; case 38: return lookAhead(nextTokenIsNumericLiteral); @@ -13620,7 +13643,7 @@ var ts; if (!arrowFunction) { return undefined; } - var isAsync = !!(ts.getModifierFlags(arrowFunction) & 256); + var isAsync = ts.hasModifier(arrowFunction, 256); var lastToken = token(); arrowFunction.equalsGreaterThanToken = parseExpectedToken(36, false, ts.Diagnostics._0_expected, "=>"); arrowFunction.body = (lastToken === 36 || lastToken === 17) @@ -13736,7 +13759,7 @@ var ts; function parseParenthesizedArrowFunctionExpressionHead(allowAmbiguity) { var node = createNode(187); node.modifiers = parseModifiersForArrowFunction(); - var isAsync = (ts.getModifierFlags(node) & 256) ? 2 : 0; + var isAsync = ts.hasModifier(node, 256) ? 2 : 0; fillSignature(56, isAsync | (allowAmbiguity ? 0 : 8), node); if (!node.parameters) { return undefined; @@ -14469,7 +14492,7 @@ var ts; parseExpected(89); node.asteriskToken = parseOptionalToken(39); var isGenerator = node.asteriskToken ? 1 : 0; - var isAsync = (ts.getModifierFlags(node) & 256) ? 2 : 0; + var isAsync = ts.hasModifier(node, 256) ? 2 : 0; node.name = isGenerator && isAsync ? doInYieldAndAwaitContext(parseOptionalIdentifier) : isGenerator ? doInYieldContext(parseOptionalIdentifier) : @@ -14694,10 +14717,13 @@ var ts; function parseCatchClause() { var result = createNode(260); parseExpected(74); - if (parseExpected(19)) { + if (parseOptional(19)) { result.variableDeclaration = parseVariableDeclaration(); + parseExpected(20); + } + else { + result.variableDeclaration = undefined; } - parseExpected(20); result.block = parseBlock(false); return finishNode(result); } @@ -16429,8 +16455,8 @@ var ts; array._children = undefined; array.pos += delta; array.end += delta; - for (var _i = 0, array_9 = array; _i < array_9.length; _i++) { - var node = array_9[_i]; + for (var _i = 0, array_8 = array; _i < array_8.length; _i++) { + var node = array_8[_i]; visitNode(node); } } @@ -16502,8 +16528,8 @@ var ts; array.intersectsChange = true; array._children = undefined; adjustIntersectingElement(array, changeStart, changeRangeOldEnd, changeRangeNewEnd, delta); - for (var _i = 0, array_10 = array; _i < array_10.length; _i++) { - var node = array_10[_i]; + for (var _i = 0, array_9 = array; _i < array_9.length; _i++) { + var node = array_9[_i]; visitNode(node); } return; @@ -17275,40 +17301,23 @@ var ts; return antecedent; } setFlowNodeReferenced(antecedent); - return { - flags: flags, - expression: expression, - antecedent: antecedent - }; + return { flags: flags, expression: expression, antecedent: antecedent }; } function createFlowSwitchClause(antecedent, switchStatement, clauseStart, clauseEnd) { if (!isNarrowingExpression(switchStatement.expression)) { return antecedent; } setFlowNodeReferenced(antecedent); - return { - flags: 128, - switchStatement: switchStatement, - clauseStart: clauseStart, - clauseEnd: clauseEnd, - antecedent: antecedent - }; + return { flags: 128, switchStatement: switchStatement, clauseStart: clauseStart, clauseEnd: clauseEnd, antecedent: antecedent }; } function createFlowAssignment(antecedent, node) { setFlowNodeReferenced(antecedent); - return { - flags: 16, - antecedent: antecedent, - node: node - }; + return { flags: 16, antecedent: antecedent, node: node }; } function createFlowArrayMutation(antecedent, node) { setFlowNodeReferenced(antecedent); - return { - flags: 256, - antecedent: antecedent, - node: node - }; + var res = { flags: 256, antecedent: antecedent, node: node }; + return res; } function finishFlowLabel(flow) { var antecedents = flow.antecedents; @@ -18776,7 +18785,6 @@ var ts; } function computeParameter(node, subtreeFlags) { var transformFlags = subtreeFlags; - var modifierFlags = ts.getModifierFlags(node); var name = node.name; var initializer = node.initializer; var dotDotDotToken = node.dotDotDotToken; @@ -18786,7 +18794,7 @@ var ts; || ts.isThisIdentifier(name)) { transformFlags |= 3; } - if (modifierFlags & 92) { + if (ts.hasModifier(node, 92)) { transformFlags |= 3 | 262144; } if (subtreeFlags & 1048576) { @@ -18815,8 +18823,7 @@ var ts; } function computeClassDeclaration(node, subtreeFlags) { var transformFlags; - var modifierFlags = ts.getModifierFlags(node); - if (modifierFlags & 2) { + if (ts.hasModifier(node, 2)) { transformFlags = 3; } else { @@ -18862,7 +18869,10 @@ var ts; } function computeCatchClause(node, subtreeFlags) { var transformFlags = subtreeFlags; - if (node.variableDeclaration && ts.isBindingPattern(node.variableDeclaration.name)) { + if (!node.variableDeclaration) { + transformFlags |= 8; + } + else if (ts.isBindingPattern(node.variableDeclaration.name)) { transformFlags |= 192; } node.transformFlags = transformFlags | 536870912; @@ -19026,9 +19036,8 @@ var ts; } function computeVariableStatement(node, subtreeFlags) { var transformFlags; - var modifierFlags = ts.getModifierFlags(node); var declarationListTransformFlags = node.declarationList.transformFlags; - if (modifierFlags & 2) { + if (ts.hasModifier(node, 2)) { transformFlags = 3; } else { @@ -19327,6 +19336,167 @@ var ts; } })(ts || (ts = {})); var ts; +(function (ts) { + function createGetSymbolWalker(getRestTypeOfSignature, getReturnTypeOfSignature, getBaseTypes, resolveStructuredTypeMembers, getTypeOfSymbol, getResolvedSymbol, getIndexTypeOfStructuredType, getConstraintFromTypeParameter, getFirstIdentifier) { + return getSymbolWalker; + function getSymbolWalker(accept) { + if (accept === void 0) { accept = function () { return true; }; } + var visitedTypes = ts.createMap(); + var visitedSymbols = ts.createMap(); + return { + walkType: function (type) { + visitedTypes.clear(); + visitedSymbols.clear(); + visitType(type); + return { visitedTypes: ts.arrayFrom(visitedTypes.values()), visitedSymbols: ts.arrayFrom(visitedSymbols.values()) }; + }, + walkSymbol: function (symbol) { + visitedTypes.clear(); + visitedSymbols.clear(); + visitSymbol(symbol); + return { visitedTypes: ts.arrayFrom(visitedTypes.values()), visitedSymbols: ts.arrayFrom(visitedSymbols.values()) }; + }, + }; + function visitType(type) { + if (!type) { + return; + } + var typeIdString = type.id.toString(); + if (visitedTypes.has(typeIdString)) { + return; + } + visitedTypes.set(typeIdString, type); + var shouldBail = visitSymbol(type.symbol); + if (shouldBail) + return; + if (type.flags & 32768) { + var objectType = type; + var objectFlags = objectType.objectFlags; + if (objectFlags & 4) { + visitTypeReference(type); + } + if (objectFlags & 32) { + visitMappedType(type); + } + if (objectFlags & (1 | 2)) { + visitInterfaceType(type); + } + if (objectFlags & (8 | 16)) { + visitObjectType(objectType); + } + } + if (type.flags & 16384) { + visitTypeParameter(type); + } + if (type.flags & 196608) { + visitUnionOrIntersectionType(type); + } + if (type.flags & 262144) { + visitIndexType(type); + } + if (type.flags & 524288) { + visitIndexedAccessType(type); + } + } + function visitTypeList(types) { + if (!types) { + return; + } + for (var i = 0; i < types.length; i++) { + visitType(types[i]); + } + } + function visitTypeReference(type) { + visitType(type.target); + visitTypeList(type.typeArguments); + } + function visitTypeParameter(type) { + visitType(getConstraintFromTypeParameter(type)); + } + function visitUnionOrIntersectionType(type) { + visitTypeList(type.types); + } + function visitIndexType(type) { + visitType(type.type); + } + function visitIndexedAccessType(type) { + visitType(type.objectType); + visitType(type.indexType); + visitType(type.constraint); + } + function visitMappedType(type) { + visitType(type.typeParameter); + visitType(type.constraintType); + visitType(type.templateType); + visitType(type.modifiersType); + } + function visitSignature(signature) { + if (signature.typePredicate) { + visitType(signature.typePredicate.type); + } + visitTypeList(signature.typeParameters); + for (var _i = 0, _a = signature.parameters; _i < _a.length; _i++) { + var parameter = _a[_i]; + visitSymbol(parameter); + } + visitType(getRestTypeOfSignature(signature)); + visitType(getReturnTypeOfSignature(signature)); + } + function visitInterfaceType(interfaceT) { + visitObjectType(interfaceT); + visitTypeList(interfaceT.typeParameters); + visitTypeList(getBaseTypes(interfaceT)); + visitType(interfaceT.thisType); + } + function visitObjectType(type) { + var stringIndexType = getIndexTypeOfStructuredType(type, 0); + visitType(stringIndexType); + var numberIndexType = getIndexTypeOfStructuredType(type, 1); + visitType(numberIndexType); + var resolved = resolveStructuredTypeMembers(type); + for (var _i = 0, _a = resolved.callSignatures; _i < _a.length; _i++) { + var signature = _a[_i]; + visitSignature(signature); + } + for (var _b = 0, _c = resolved.constructSignatures; _b < _c.length; _b++) { + var signature = _c[_b]; + visitSignature(signature); + } + for (var _d = 0, _e = resolved.properties; _d < _e.length; _d++) { + var p = _e[_d]; + visitSymbol(p); + } + } + function visitSymbol(symbol) { + if (!symbol) { + return; + } + var symbolIdString = ts.getSymbolId(symbol).toString(); + if (visitedSymbols.has(symbolIdString)) { + return; + } + visitedSymbols.set(symbolIdString, symbol); + if (!accept(symbol)) { + return true; + } + var t = getTypeOfSymbol(symbol); + visitType(t); + if (symbol.flags & 1952) { + symbol.exports.forEach(visitSymbol); + } + ts.forEach(symbol.declarations, function (d) { + if (d.type && d.type.kind === 162) { + var query = d.type; + var entity = getResolvedSymbol(getFirstIdentifier(query.exprName)); + visitSymbol(entity); + } + }); + } + } + } + ts.createGetSymbolWalker = createGetSymbolWalker; +})(ts || (ts = {})); +var ts; (function (ts) { var ambientModuleSymbolRegex = /^".+"$/; var nextSymbolId = 1; @@ -19437,6 +19607,9 @@ var ts; node = ts.getParseTreeNode(node, ts.isExportSpecifier); return node ? getExportSpecifierLocalTargetSymbol(node) : undefined; }, + getExportSymbolOfSymbol: function (symbol) { + return getMergedSymbol(symbol.exportSymbol || symbol); + }, getTypeAtLocation: function (node) { node = ts.getParseTreeNode(node); return node ? getTypeOfNode(node) : unknownType; @@ -19499,6 +19672,7 @@ var ts; getEmitResolver: getEmitResolver, getExportsOfModule: getExportsOfModuleAsArray, getExportsAndPropertiesOfModule: getExportsAndPropertiesOfModule, + getSymbolWalker: ts.createGetSymbolWalker(getRestTypeOfSignature, getReturnTypeOfSignature, getBaseTypes, resolveStructuredTypeMembers, getTypeOfSymbol, getResolvedSymbol, getIndexTypeOfStructuredType, getConstraintFromTypeParameter, getFirstIdentifier), getAmbientModules: getAmbientModules, getAllAttributesTypeFromJsxOpeningLikeElement: function (node) { node = ts.getParseTreeNode(node, ts.isJsxOpeningLikeElement); @@ -19519,11 +19693,10 @@ var ts; getSuggestionForNonexistentProperty: function (node, type) { return ts.unescapeLeadingUnderscores(getSuggestionForNonexistentProperty(node, type)); }, getSuggestionForNonexistentSymbol: function (location, name, meaning) { return ts.unescapeLeadingUnderscores(getSuggestionForNonexistentSymbol(location, ts.escapeLeadingUnderscores(name), meaning)); }, getBaseConstraintOfType: getBaseConstraintOfType, - getJsxNamespace: function () { return ts.unescapeLeadingUnderscores(getJsxNamespace()); }, - resolveNameAtLocation: function (location, name, meaning) { - location = ts.getParseTreeNode(location); - return resolveName(location, ts.escapeLeadingUnderscores(name), meaning, undefined, ts.escapeLeadingUnderscores(name)); + resolveName: function (name, location, meaning) { + return resolveName(location, ts.escapeLeadingUnderscores(name), meaning, undefined, undefined); }, + getJsxNamespace: function () { return ts.unescapeLeadingUnderscores(getJsxNamespace()); }, }; var tupleTypes = []; var unionTypes = ts.createMap(); @@ -20006,7 +20179,10 @@ var ts; } return true; } - if (usage.parent.kind === 246) { + if (usage.parent.kind === 246 || (usage.parent.kind === 243 && usage.parent.isExportEquals)) { + return true; + } + if (usage.kind === 243 && usage.isExportEquals) { return true; } var container = ts.getEnclosingBlockScopeContainer(declaration); @@ -20036,13 +20212,13 @@ var ts; current.parent.kind === 149 && current.parent.initializer === current; if (initializerOfProperty) { - if (ts.getModifierFlags(current.parent) & 32) { + if (ts.hasModifier(current.parent, 32)) { if (declaration.kind === 151) { return true; } } else { - var isDeclarationInstanceProperty = declaration.kind === 149 && !(ts.getModifierFlags(declaration) & 32); + var isDeclarationInstanceProperty = declaration.kind === 149 && !ts.hasModifier(declaration, 32); if (!isDeclarationInstanceProperty || ts.getContainingClass(usage) !== ts.getContainingClass(declaration)) { return true; } @@ -20122,7 +20298,7 @@ var ts; break; case 149: case 148: - if (ts.isClassLike(location.parent) && !(ts.getModifierFlags(location) & 32)) { + if (ts.isClassLike(location.parent) && !ts.hasModifier(location, 32)) { var ctor = findConstructorDeclaration(location.parent); if (ctor && ctor.locals) { if (lookup(ctor.locals, name, meaning & 107455)) { @@ -20139,7 +20315,7 @@ var ts; result = undefined; break; } - if (lastLocation && ts.getModifierFlags(lastLocation) & 32) { + if (lastLocation && ts.hasModifier(lastLocation, 32)) { error(errorLocation, ts.Diagnostics.Static_members_cannot_reference_class_type_parameters); return undefined; } @@ -20153,6 +20329,17 @@ var ts; } } break; + case 201: + if (lastLocation === location.expression && location.parent.token === 85) { + var container = location.parent.parent; + if (ts.isClassLike(container) && (result = lookup(getSymbolOfNode(container).members, name, meaning & 793064))) { + if (nameNotFoundMessage) { + error(errorLocation, ts.Diagnostics.Base_class_expressions_cannot_reference_class_type_parameters); + } + return undefined; + } + } + break; case 144: grandparent = location.parent.parent; if (ts.isClassLike(grandparent) || grandparent.kind === 230) { @@ -20199,7 +20386,7 @@ var ts; lastLocation = location; location = location.parent; } - if (result && nameNotFoundMessage && noUnusedIdentifiers) { + if (result && nameNotFoundMessage && noUnusedIdentifiers && result !== lastLocation.symbol) { result.isReferenced = true; } if (!result) { @@ -20280,7 +20467,7 @@ var ts; error(errorLocation, ts.Diagnostics.Cannot_find_name_0_Did_you_mean_the_static_member_1_0, diagnosticName(nameArg), symbolToString(classSymbol)); return true; } - if (location === container && !(ts.getModifierFlags(location) & 32)) { + if (location === container && !ts.hasModifier(location, 32)) { var instanceType = getDeclaredTypeOfSymbol(classSymbol).thisType; if (getPropertyOfType(instanceType, name)) { error(errorLocation, ts.Diagnostics.Cannot_find_name_0_Did_you_mean_the_instance_member_this_0, diagnosticName(nameArg)); @@ -20666,7 +20853,6 @@ var ts; if (ambientModule) { return ambientModule; } - var isRelative = ts.isExternalModuleNameRelative(moduleReference); var resolvedModule = ts.getResolvedModule(ts.getSourceFileOfNode(location), moduleReference); var resolutionDiagnostic = resolvedModule && ts.getResolutionDiagnostic(compilerOptions, resolvedModule); var sourceFile = resolvedModule && !resolutionDiagnostic && host.getSourceFile(resolvedModule.resolvedFileName); @@ -20685,7 +20871,7 @@ var ts; return getMergedSymbol(pattern.symbol); } } - if (!isRelative && resolvedModule && !ts.extensionIsTypeScript(resolvedModule.extension)) { + if (resolvedModule && resolvedModule.isExternalLibraryImport && !ts.extensionIsTypeScript(resolvedModule.extension)) { if (isForAugmentation) { var diag = ts.Diagnostics.Invalid_module_name_in_augmentation_Module_0_resolves_to_an_untyped_module_at_1_which_cannot_be_augmented; error(errorNode, diag, moduleReference, resolvedModule.resolvedFileName); @@ -21020,6 +21206,10 @@ var ts; } return false; } + function isTypeSymbolAccessible(typeSymbol, enclosingDeclaration) { + var access = isSymbolAccessible(typeSymbol, enclosingDeclaration, 793064, false); + return access.accessibility === 0; + } function isSymbolAccessible(symbol, enclosingDeclaration, meaning, shouldComputeAliasesToMakeVisible) { if (symbol && enclosingDeclaration && !(symbol.flags & 262144)) { var initialSymbol = symbol; @@ -21075,7 +21265,7 @@ var ts; if (!isDeclarationVisible(declaration)) { var anyImportSyntax = getAnyImportSyntax(declaration); if (anyImportSyntax && - !(ts.getModifierFlags(anyImportSyntax) & 1) && + !ts.hasModifier(anyImportSyntax, 1) && isDeclarationVisible(anyImportSyntax.parent)) { if (shouldComputeAliasToMakeVisible) { getNodeLinks(declaration).isVisible = true; @@ -21273,8 +21463,7 @@ var ts; var name = symbolToName(type.symbol, context, 793064, false); return ts.createTypeReferenceNode(name, undefined); } - if (!inTypeAlias && type.aliasSymbol && - isSymbolAccessible(type.aliasSymbol, context.enclosingDeclaration, 793064, false).accessibility === 0) { + if (!inTypeAlias && type.aliasSymbol && isTypeSymbolAccessible(type.aliasSymbol, context.enclosingDeclaration)) { var name = symbolToTypeReferenceName(type.aliasSymbol); var typeArgumentNodes = mapToTypeNodes(type.aliasTypeArguments, context); return ts.createTypeReferenceNode(name, typeArgumentNodes); @@ -21349,8 +21538,8 @@ var ts; return createTypeNodeFromObjectType(type); } function shouldWriteTypeOfFunctionSymbol() { - var isStaticMethodSymbol = !!(symbol.flags & 8192 && - ts.forEach(symbol.declarations, function (declaration) { return ts.getModifierFlags(declaration) & 32; })); + var isStaticMethodSymbol = !!(symbol.flags & 8192) && + ts.some(symbol.declarations, function (declaration) { return ts.hasModifier(declaration, 32); }); var isNonLocalFunctionSymbol = !!(symbol.flags & 16) && (symbol.parent || ts.forEach(symbol.declarations, function (declaration) { @@ -21362,10 +21551,8 @@ var ts; } } function createTypeNodeFromObjectType(type) { - if (type.objectFlags & 32) { - if (getConstraintTypeFromMappedType(type).flags & (16384 | 262144)) { - return createMappedTypeNodeFromType(type); - } + if (isGenericMappedType(type)) { + return createMappedTypeNodeFromType(type); } var resolved = resolveStructuredTypeMembers(type); if (!resolved.properties.length && !resolved.stringIndexInfo && !resolved.numberIndexInfo) { @@ -21893,7 +22080,7 @@ var ts; buildSymbolDisplay(type.symbol, writer, enclosingDeclaration, 793064, 0, nextFlags); } else if (!(flags & 1024) && type.aliasSymbol && - isSymbolAccessible(type.aliasSymbol, enclosingDeclaration, 793064, false).accessibility === 0) { + ((flags & 65536) || isTypeSymbolAccessible(type.aliasSymbol, enclosingDeclaration))) { var typeArguments = type.aliasTypeArguments; writeSymbolTypeReference(type.aliasSymbol, typeArguments, 0, ts.length(typeArguments), nextFlags); } @@ -22037,9 +22224,7 @@ var ts; if (!symbolStack) { symbolStack = []; } - var isConstructorObject = type.flags & 32768 && - getObjectFlags(type) & 16 && - type.symbol && type.symbol.flags & 32; + var isConstructorObject = type.objectFlags & 16 && type.symbol && type.symbol.flags & 32; if (isConstructorObject) { writeLiteralType(type, flags); } @@ -22054,16 +22239,16 @@ var ts; writeLiteralType(type, flags); } function shouldWriteTypeOfFunctionSymbol() { - var isStaticMethodSymbol = !!(symbol.flags & 8192 && - ts.forEach(symbol.declarations, function (declaration) { return ts.getModifierFlags(declaration) & 32; })); + var isStaticMethodSymbol = !!(symbol.flags & 8192) && + ts.some(symbol.declarations, function (declaration) { return ts.hasModifier(declaration, 32); }); var isNonLocalFunctionSymbol = !!(symbol.flags & 16) && (symbol.parent || - ts.forEach(symbol.declarations, function (declaration) { + ts.some(symbol.declarations, function (declaration) { return declaration.parent.kind === 265 || declaration.parent.kind === 234; })); if (isStaticMethodSymbol || isNonLocalFunctionSymbol) { return !!(flags & 4) || - (ts.contains(symbolStack, symbol)); + ts.contains(symbolStack, symbol); } } } @@ -22100,11 +22285,9 @@ var ts; return false; } function writeLiteralType(type, flags) { - if (type.objectFlags & 32) { - if (getConstraintTypeFromMappedType(type).flags & (16384 | 262144)) { - writeMappedType(type); - return; - } + if (isGenericMappedType(type)) { + writeMappedType(type); + return; } var resolved = resolveStructuredTypeMembers(type); if (!resolved.properties.length && !resolved.stringIndexInfo && !resolved.numberIndexInfo) { @@ -22472,7 +22655,7 @@ var ts; case 154: case 151: case 150: - if (ts.getModifierFlags(node) & (8 | 16)) { + if (ts.hasModifier(node, 8 | 16)) { return false; } case 152: @@ -23149,8 +23332,8 @@ var ts; } } function appendTypeParameters(typeParameters, declarations) { - for (var _i = 0, declarations_3 = declarations; _i < declarations_3.length; _i++) { - var declaration = declarations_3[_i]; + for (var _i = 0, declarations_2 = declarations; _i < declarations_2.length; _i++) { + var declaration = declarations_2[_i]; var tp = getDeclaredTypeOfTypeParameter(getSymbolOfNode(declaration)); if (!typeParameters) { typeParameters = [tp]; @@ -23274,7 +23457,7 @@ var ts; return type.resolvedBaseTypes; } function resolveBaseTypesOfClass(type) { - type.resolvedBaseTypes = type.resolvedBaseTypes || ts.emptyArray; + type.resolvedBaseTypes = ts.emptyArray; var baseConstructorType = getApparentType(getBaseConstructorTypeOfClass(type)); if (!(baseConstructorType.flags & (32768 | 131072 | 1))) { return; @@ -23316,12 +23499,7 @@ var ts; error(valueDecl, ts.Diagnostics.Type_0_recursively_references_itself_as_a_base_type, typeToString(type, undefined, 1)); return; } - if (type.resolvedBaseTypes === ts.emptyArray) { - type.resolvedBaseTypes = [baseType]; - } - else { - type.resolvedBaseTypes.push(baseType); - } + type.resolvedBaseTypes = [baseType]; } function areAllOuterTypeParametersApplied(type) { var outerTypeParameters = type.outerTypeParameters; @@ -23419,7 +23597,9 @@ var ts; if (!pushTypeResolution(symbol, 2)) { return unknownType; } - var declaration = ts.findDeclaration(symbol, function (d) { return d.kind === 283 || d.kind === 231; }); + var declaration = ts.find(symbol.declarations, function (d) { + return d.kind === 283 || d.kind === 231; + }); var type = getTypeFromTypeNode(declaration.kind === 283 ? declaration.typeExpression : declaration.type); if (popTypeResolution()) { var typeParameters = getLocalTypeParametersOfClassOrInterfaceOrTypeAlias(symbol); @@ -23911,17 +24091,12 @@ var ts; } else { var members = emptySymbols; - var constructSignatures = ts.emptyArray; var stringIndexInfo = undefined; if (symbol.exports) { members = getExportsOfSymbol(symbol); } if (symbol.flags & 32) { var classType = getDeclaredTypeOfClassOrInterface(symbol); - constructSignatures = getSignaturesOfSymbol(symbol.members.get("__constructor")); - if (!constructSignatures.length) { - constructSignatures = getDefaultConstructSignatures(classType); - } var baseConstructorType = getBaseConstructorTypeOfClass(classType); if (baseConstructorType.flags & (32768 | 131072 | 540672)) { members = ts.createSymbolTable(getNamedMembers(members)); @@ -23932,10 +24107,18 @@ var ts; } } var numberIndexInfo = symbol.flags & 384 ? enumNumberIndexInfo : undefined; - setStructuredTypeMembers(type, members, ts.emptyArray, constructSignatures, stringIndexInfo, numberIndexInfo); + setStructuredTypeMembers(type, members, ts.emptyArray, ts.emptyArray, stringIndexInfo, numberIndexInfo); if (symbol.flags & (16 | 8192)) { type.callSignatures = getSignaturesOfSymbol(symbol); } + if (symbol.flags & 32) { + var classType = getDeclaredTypeOfClassOrInterface(symbol); + var constructSignatures = getSignaturesOfSymbol(symbol.members.get("__constructor")); + if (!constructSignatures.length) { + constructSignatures = getDefaultConstructSignatures(classType); + } + type.constructSignatures = constructSignatures; + } } } function resolveMappedTypeMembers(type) { @@ -24018,8 +24201,7 @@ var ts; return getObjectFlags(type) & 32 && !!type.declaration.questionToken; } function isGenericMappedType(type) { - return getObjectFlags(type) & 32 && - maybeTypeOfKind(getConstraintTypeFromMappedType(type), 540672 | 262144); + return getObjectFlags(type) & 32 && isGenericIndexType(getConstraintTypeFromMappedType(type)); } function resolveStructuredTypeMembers(type) { if (!type.members) { @@ -24119,6 +24301,10 @@ var ts; return hasNonCircularBaseConstraint(typeParameter) ? getConstraintFromTypeParameter(typeParameter) : undefined; } function getConstraintOfIndexedAccess(type) { + var transformed = getTransformedIndexedAccessType(type); + if (transformed) { + return transformed; + } var baseObjectType = getBaseConstraintOfType(type.objectType); var baseIndexType = getBaseConstraintOfType(type.indexType); return baseObjectType || baseIndexType ? getIndexedAccessType(baseObjectType || type.objectType, baseIndexType || type.indexType) : undefined; @@ -24181,11 +24367,18 @@ var ts; return stringType; } if (t.flags & 524288) { + var transformed = getTransformedIndexedAccessType(t); + if (transformed) { + return getBaseConstraint(transformed); + } var baseObjectType = getBaseConstraint(t.objectType); var baseIndexType = getBaseConstraint(t.indexType); var baseIndexedAccess = baseObjectType && baseIndexType ? getIndexedAccessType(baseObjectType, baseIndexType) : undefined; return baseIndexedAccess && baseIndexedAccess !== unknownType ? getBaseConstraint(baseIndexedAccess) : undefined; } + if (isGenericMappedType(t)) { + return emptyObjectType; + } return t; } } @@ -24665,6 +24858,9 @@ var ts; } return signature.resolvedReturnType; } + function isResolvingReturnTypeOfSignature(signature) { + return !signature.resolvedReturnType && findResolutionCycleStartIndex(signature, 3) >= 0; + } function getRestTypeOfSignature(signature) { if (signature.hasRestParameter) { var type = getTypeOfSymbol(ts.lastOrUndefined(signature.parameters)); @@ -24733,7 +24929,7 @@ var ts; function getIndexInfoOfSymbol(symbol, kind) { var declaration = getIndexDeclarationOfSymbol(symbol, kind); if (declaration) { - return createIndexInfo(declaration.type ? getTypeFromTypeNode(declaration.type) : anyType, (ts.getModifierFlags(declaration) & 64) !== 0, declaration); + return createIndexInfo(declaration.type ? getTypeFromTypeNode(declaration.type) : anyType, ts.hasModifier(declaration, 64), declaration); } return undefined; } @@ -25001,8 +25197,8 @@ var ts; function getTypeOfGlobalSymbol(symbol, arity) { function getTypeDeclaration(symbol) { var declarations = symbol.declarations; - for (var _i = 0, declarations_4 = declarations; _i < declarations_4.length; _i++) { - var declaration = declarations_4[_i]; + for (var _i = 0, declarations_3 = declarations; _i < declarations_3.length; _i++) { + var declaration = declarations_3[_i]; switch (declaration.kind) { case 229: case 230: @@ -25459,17 +25655,16 @@ var ts; return getTypeOfSymbol(prop); } } - if (isTypeAnyOrAllConstituentTypesHaveKind(indexType, 262178 | 84 | 512)) { + if (!(indexType.flags & 6144) && isTypeAssignableToKind(indexType, 262178 | 84 | 512)) { if (isTypeAny(objectType)) { return anyType; } - var indexInfo = isTypeAnyOrAllConstituentTypesHaveKind(indexType, 84) && getIndexInfoOfType(objectType, 1) || + var indexInfo = isTypeAssignableToKind(indexType, 84) && getIndexInfoOfType(objectType, 1) || getIndexInfoOfType(objectType, 0) || undefined; if (indexInfo) { if (accessExpression && indexInfo.isReadonly && (ts.isAssignmentTarget(accessExpression) || ts.isDeleteTarget(accessExpression))) { error(accessExpression, ts.Diagnostics.Index_signature_in_type_0_only_permits_reading, typeToString(objectType)); - return unknownType; } return indexInfo.type; } @@ -25501,25 +25696,68 @@ var ts; return anyType; } function getIndexedAccessForMappedType(type, indexType, accessNode) { - var accessExpression = accessNode && accessNode.kind === 180 ? accessNode : undefined; - if (accessExpression && ts.isAssignmentTarget(accessExpression) && type.declaration.readonlyToken) { - error(accessExpression, ts.Diagnostics.Index_signature_in_type_0_only_permits_reading, typeToString(type)); - return unknownType; + if (accessNode) { + if (!isTypeAssignableTo(indexType, getIndexType(type))) { + error(accessNode, ts.Diagnostics.Type_0_cannot_be_used_to_index_type_1, typeToString(indexType), typeToString(type)); + return unknownType; + } + if (accessNode.kind === 180 && ts.isAssignmentTarget(accessNode) && type.declaration.readonlyToken) { + error(accessNode, ts.Diagnostics.Index_signature_in_type_0_only_permits_reading, typeToString(type)); + } } var mapper = createTypeMapper([getTypeParameterFromMappedType(type)], [indexType]); var templateMapper = type.mapper ? combineTypeMappers(type.mapper, mapper) : mapper; return instantiateType(getTemplateTypeFromMappedType(type), templateMapper); } + function isGenericObjectType(type) { + return type.flags & 540672 ? true : + getObjectFlags(type) & 32 ? isGenericIndexType(getConstraintTypeFromMappedType(type)) : + type.flags & 196608 ? ts.forEach(type.types, isGenericObjectType) : + false; + } + function isGenericIndexType(type) { + return type.flags & (540672 | 262144) ? true : + type.flags & 196608 ? ts.forEach(type.types, isGenericIndexType) : + false; + } + function isStringIndexOnlyType(type) { + if (type.flags & 32768 && !isGenericMappedType(type)) { + var t = resolveStructuredTypeMembers(type); + return t.properties.length === 0 && + t.callSignatures.length === 0 && t.constructSignatures.length === 0 && + t.stringIndexInfo && !t.numberIndexInfo; + } + return false; + } + function getTransformedIndexedAccessType(type) { + var objectType = type.objectType; + if (objectType.flags & 131072 && isGenericObjectType(objectType) && ts.some(objectType.types, isStringIndexOnlyType)) { + var regularTypes = []; + var stringIndexTypes = []; + for (var _i = 0, _a = objectType.types; _i < _a.length; _i++) { + var t = _a[_i]; + if (isStringIndexOnlyType(t)) { + stringIndexTypes.push(getIndexTypeOfType(t, 0)); + } + else { + regularTypes.push(t); + } + } + return getUnionType([ + getIndexedAccessType(getIntersectionType(regularTypes), type.indexType), + getIntersectionType(stringIndexTypes) + ]); + } + return undefined; + } function getIndexedAccessType(objectType, indexType, accessNode) { - if (maybeTypeOfKind(indexType, 540672 | 262144) || - maybeTypeOfKind(objectType, 540672) && !(accessNode && accessNode.kind === 180) || - isGenericMappedType(objectType)) { + if (isGenericMappedType(objectType)) { + return getIndexedAccessForMappedType(objectType, indexType, accessNode); + } + if (isGenericIndexType(indexType) || !(accessNode && accessNode.kind === 180) && isGenericObjectType(objectType)) { if (objectType.flags & 1) { return objectType; } - if (isGenericMappedType(objectType)) { - return getIndexedAccessForMappedType(objectType, indexType, accessNode); - } var id = objectType.id + "," + indexType.id; var type = indexedAccessTypes.get(id); if (!type) { @@ -25718,7 +25956,7 @@ var ts; var container = ts.getThisContainer(node, false); var parent = container && container.parent; if (parent && (ts.isClassLike(parent) || parent.kind === 230)) { - if (!(ts.getModifierFlags(container) & 32) && + if (!ts.hasModifier(container, 32) && (container.kind !== 152 || ts.isNodeDescendantOf(node, container.body))) { return getDeclaredTypeOfClassOrInterface(getSymbolOfNode(parent)).thisType; } @@ -25865,7 +26103,7 @@ var ts; } function cloneTypeMapper(mapper) { return mapper && isInferenceContext(mapper) ? - createInferenceContext(mapper.signature, mapper.flags | 2, mapper.inferences) : + createInferenceContext(mapper.signature, mapper.flags | 2, mapper.compareTypes, mapper.inferences) : mapper; } function identityMapper(type) { @@ -26129,11 +26367,13 @@ var ts; if (ts.forEach(node.parameters, function (p) { return !ts.getEffectiveTypeAnnotationNode(p); })) { return true; } - if (node.kind === 187) { - return false; + if (node.kind !== 187) { + var parameter = ts.firstOrUndefined(node.parameters); + if (!(parameter && ts.parameterIsThisKeyword(parameter))) { + return true; + } } - var parameter = ts.firstOrUndefined(node.parameters); - return !(parameter && ts.parameterIsThisKeyword(parameter)); + return node.body.kind === 207 ? false : isContextSensitive(node.body); } function isContextSensitiveFunctionOrObjectLiteralMethod(func) { return (isFunctionExpressionOrArrowFunction(func) || ts.isObjectLiteralMethod(func)) && isContextSensitiveFunctionLikeDeclaration(func); @@ -26196,7 +26436,7 @@ var ts; return 0; } if (source.typeParameters) { - source = instantiateSignatureInContextOf(source, target); + source = instantiateSignatureInContextOf(source, target, undefined, compareTypes); } var result = -1; var sourceThisType = getThisTypeOfSignature(source); @@ -26245,7 +26485,7 @@ var ts; var sourceReturnType = getReturnTypeOfSignature(source); if (target.typePredicate) { if (source.typePredicate) { - result &= compareTypePredicateRelatedTo(source.typePredicate, target.typePredicate, reportErrors, errorReporter, compareTypes); + result &= compareTypePredicateRelatedTo(source.typePredicate, target.typePredicate, source.declaration, target.declaration, reportErrors, errorReporter, compareTypes); } else if (ts.isIdentifierTypePredicate(target.typePredicate)) { if (reportErrors) { @@ -26261,7 +26501,7 @@ var ts; } return result; } - function compareTypePredicateRelatedTo(source, target, reportErrors, errorReporter, compareTypes) { + function compareTypePredicateRelatedTo(source, target, sourceDeclaration, targetDeclaration, reportErrors, errorReporter, compareTypes) { if (source.kind !== target.kind) { if (reportErrors) { errorReporter(ts.Diagnostics.A_this_based_type_guard_is_not_compatible_with_a_parameter_based_type_guard); @@ -26270,11 +26510,13 @@ var ts; return 0; } if (source.kind === 1) { - var sourceIdentifierPredicate = source; - var targetIdentifierPredicate = target; - if (sourceIdentifierPredicate.parameterIndex !== targetIdentifierPredicate.parameterIndex) { + var sourcePredicate = source; + var targetPredicate = target; + var sourceIndex = sourcePredicate.parameterIndex - (ts.getThisParameter(sourceDeclaration) ? 1 : 0); + var targetIndex = targetPredicate.parameterIndex - (ts.getThisParameter(targetDeclaration) ? 1 : 0); + if (sourceIndex !== targetIndex) { if (reportErrors) { - errorReporter(ts.Diagnostics.Parameter_0_is_not_in_the_same_position_as_parameter_1, sourceIdentifierPredicate.parameterName, targetIdentifierPredicate.parameterName); + errorReporter(ts.Diagnostics.Parameter_0_is_not_in_the_same_position_as_parameter_1, sourcePredicate.parameterName, targetPredicate.parameterName); errorReporter(ts.Diagnostics.Type_predicate_0_is_not_assignable_to_1, typePredicateToString(source), typePredicateToString(target)); } return 0; @@ -26419,8 +26661,7 @@ var ts; return true; } if (source.flags & 32768 && target.flags & 32768) { - var id = relation !== identityRelation || source.id < target.id ? source.id + "," + target.id : target.id + "," + source.id; - var related = relation.get(id); + var related = relation.get(getRelationKey(source, target, relation)); if (related !== undefined) { return related === 1; } @@ -26533,11 +26774,21 @@ var ts; !(target.flags & 65536) && !isIntersectionConstituent && source !== globalObjectType && - getPropertiesOfType(source).length > 0 && + (getPropertiesOfType(source).length > 0 || + getSignaturesOfType(source, 0).length > 0 || + getSignaturesOfType(source, 1).length > 0) && isWeakType(target) && !hasCommonProperties(source, target)) { if (reportErrors) { - reportError(ts.Diagnostics.Type_0_has_no_properties_in_common_with_type_1, typeToString(source), typeToString(target)); + var calls = getSignaturesOfType(source, 0); + var constructs = getSignaturesOfType(source, 1); + if (calls.length > 0 && isRelatedTo(getReturnTypeOfSignature(calls[0]), target, false) || + constructs.length > 0 && isRelatedTo(getReturnTypeOfSignature(constructs[0]), target, false)) { + reportError(ts.Diagnostics.Value_of_type_0_has_no_properties_in_common_with_type_1_Did_you_mean_to_call_it, typeToString(source), typeToString(target)); + } + else { + reportError(ts.Diagnostics.Type_0_has_no_properties_in_common_with_type_1, typeToString(source), typeToString(target)); + } } return 0; } @@ -26738,7 +26989,7 @@ var ts; if (overflow) { return 0; } - var id = relation !== identityRelation || source.id < target.id ? source.id + "," + target.id : target.id + "," + source.id; + var id = getRelationKey(source, target, relation); var related = relation.get(id); if (related !== undefined) { if (reportErrors && related === 2) { @@ -27158,6 +27409,9 @@ var ts; if (sourceInfo) { return indexInfoRelatedTo(sourceInfo, targetInfo, reportErrors); } + if (isGenericMappedType(source)) { + return kind === 0 && isRelatedTo(getTemplateTypeFromMappedType(source), targetInfo.type, reportErrors); + } if (isObjectLiteralType(source)) { var related = -1; if (kind === 0) { @@ -27191,8 +27445,8 @@ var ts; if (!sourceSignature.declaration || !targetSignature.declaration) { return true; } - var sourceAccessibility = ts.getModifierFlags(sourceSignature.declaration) & 24; - var targetAccessibility = ts.getModifierFlags(targetSignature.declaration) & 24; + var sourceAccessibility = ts.getSelectedModifierFlags(sourceSignature.declaration, 24); + var targetAccessibility = ts.getSelectedModifierFlags(targetSignature.declaration, 24); if (targetAccessibility === 8) { return true; } @@ -27208,6 +27462,42 @@ var ts; return false; } } + function isUnconstrainedTypeParameter(type) { + return type.flags & 16384 && !getConstraintFromTypeParameter(type); + } + function isTypeReferenceWithGenericArguments(type) { + return getObjectFlags(type) & 4 && ts.some(type.typeArguments, isUnconstrainedTypeParameter); + } + function getTypeReferenceId(type, typeParameters) { + var result = "" + type.target.id; + for (var _i = 0, _a = type.typeArguments; _i < _a.length; _i++) { + var t = _a[_i]; + if (isUnconstrainedTypeParameter(t)) { + var index = ts.indexOf(typeParameters, t); + if (index < 0) { + index = typeParameters.length; + typeParameters.push(t); + } + result += "=" + index; + } + else { + result += "-" + t.id; + } + } + return result; + } + function getRelationKey(source, target, relation) { + if (relation === identityRelation && source.id > target.id) { + var temp = source; + source = target; + target = temp; + } + if (isTypeReferenceWithGenericArguments(source) && isTypeReferenceWithGenericArguments(target)) { + var typeParameters = []; + return getTypeReferenceId(source, typeParameters) + "," + getTypeReferenceId(target, typeParameters); + } + return source.id + "," + target.id; + } function forEachProperty(prop, callback) { if (ts.getCheckFlags(prop) & 6) { for (var _i = 0, _a = prop.containingType.types; _i < _a.length; _i++) { @@ -27244,7 +27534,7 @@ var ts; var symbol = type.symbol; if (symbol && symbol.flags & 32) { var declaration = getClassLikeDeclarationOfSymbol(symbol); - if (declaration && ts.getModifierFlags(declaration) & 128) { + if (declaration && ts.hasModifier(declaration, 128)) { return true; } } @@ -27630,13 +27920,14 @@ var ts; callback(getTypeAtPosition(source, i), getTypeAtPosition(target, i)); } } - function createInferenceContext(signature, flags, baseInferences) { + function createInferenceContext(signature, flags, compareTypes, baseInferences) { var inferences = baseInferences ? ts.map(baseInferences, cloneInferenceInfo) : ts.map(signature.typeParameters, createInferenceInfo); var context = mapper; context.mappedTypes = signature.typeParameters; context.signature = signature; context.inferences = inferences; context.flags = flags; + context.compareTypes = compareTypes || compareTypesAssignable; return context; function mapper(t) { for (var i = 0; i < inferences.length; i++) { @@ -27724,6 +28015,19 @@ var ts; return inference.candidates && getUnionType(inference.candidates, true); } } + function isPossiblyAssignableTo(source, target) { + var properties = getPropertiesOfObjectType(target); + for (var _i = 0, properties_5 = properties; _i < properties_5.length; _i++) { + var targetProp = properties_5[_i]; + if (!(targetProp.flags & (16777216 | 4194304))) { + var sourceProp = getPropertyOfObjectType(source, targetProp.escapedName); + if (!sourceProp) { + return false; + } + } + } + return true; + } function inferTypes(inferences, originalSource, originalTarget, priority) { if (priority === void 0) { priority = 0; } var symbolStack; @@ -27884,15 +28188,17 @@ var ts; return; } } - inferFromProperties(source, target); - inferFromSignatures(source, target, 0); - inferFromSignatures(source, target, 1); - inferFromIndexTypes(source, target); + if (isPossiblyAssignableTo(source, target) || isPossiblyAssignableTo(target, source)) { + inferFromProperties(source, target); + inferFromSignatures(source, target, 0); + inferFromSignatures(source, target, 1); + inferFromIndexTypes(source, target); + } } function inferFromProperties(source, target) { var properties = getPropertiesOfObjectType(target); - for (var _i = 0, properties_5 = properties; _i < properties_5.length; _i++) { - var targetProp = properties_5[_i]; + for (var _i = 0, properties_6 = properties; _i < properties_6.length; _i++) { + var targetProp = properties_6[_i]; var sourceProp = getPropertyOfObjectType(source, targetProp.escapedName); if (sourceProp) { inferFromTypes(getTypeOfSymbol(sourceProp), getTypeOfSymbol(targetProp)); @@ -27991,7 +28297,7 @@ var ts; var constraint = getConstraintOfTypeParameter(context.signature.typeParameters[index]); if (constraint) { var instantiatedConstraint = instantiateType(constraint, context); - if (!isTypeAssignableTo(inferredType, getTypeWithThisArgument(instantiatedConstraint, inferredType))) { + if (!context.compareTypes(inferredType, getTypeWithThisArgument(instantiatedConstraint, inferredType))) { inference.inferredType = inferredType = instantiatedConstraint; } } @@ -28039,16 +28345,6 @@ var ts; } return undefined; } - function getLeftmostIdentifierOrThis(node) { - switch (node.kind) { - case 71: - case 99: - return node; - case 179: - return getLeftmostIdentifierOrThis(node.expression); - } - return undefined; - } function getBindingElementNameText(element) { if (element.parent.kind === 174) { var name = element.propertyName || element.name; @@ -28540,7 +28836,7 @@ var ts; parent.parent.operatorToken.kind === 58 && parent.parent.left === parent && !ts.isAssignmentTarget(parent.parent) && - isTypeAnyOrAllConstituentTypesHaveKind(getTypeOfExpression(parent.argumentExpression), 84 | 2048); + isTypeAssignableToKind(getTypeOfExpression(parent.argumentExpression), 84); return isLengthPushOrUnshift || isElementAssignment; } function maybeTypePredicateCall(node) { @@ -28686,7 +28982,7 @@ var ts; } else { var indexType = getTypeOfExpression(node.left.argumentExpression); - if (isTypeAnyOrAllConstituentTypesHaveKind(indexType, 84 | 2048)) { + if (isTypeAssignableToKind(indexType, 84)) { evolvedType_1 = addEvolvingArrayElementType(evolvedType_1, node.right); } } @@ -29372,7 +29668,7 @@ var ts; break; case 149: case 148: - if (ts.getModifierFlags(container) & 32) { + if (ts.hasModifier(container, 32)) { error(node, ts.Diagnostics.this_cannot_be_referenced_in_a_static_property_initializer); } break; @@ -29463,14 +29759,14 @@ var ts; if (!isCallExpression && container.kind === 152) { checkThisBeforeSuper(node, container, ts.Diagnostics.super_must_be_called_before_accessing_a_property_of_super_in_the_constructor_of_a_derived_class); } - if ((ts.getModifierFlags(container) & 32) || isCallExpression) { + if (ts.hasModifier(container, 32) || isCallExpression) { nodeCheckFlag = 512; } else { nodeCheckFlag = 256; } getNodeLinks(node).flags |= nodeCheckFlag; - if (container.kind === 151 && ts.getModifierFlags(container) & 256) { + if (container.kind === 151 && ts.hasModifier(container, 256)) { if (ts.isSuperProperty(node.parent) && ts.isAssignmentTarget(node.parent)) { getNodeLinks(container).flags |= 4096; } @@ -29515,7 +29811,7 @@ var ts; } else { if (ts.isClassLike(container.parent) || container.parent.kind === 178) { - if (ts.getModifierFlags(container) & 32) { + if (ts.hasModifier(container, 32)) { return container.kind === 151 || container.kind === 150 || container.kind === 153 || @@ -29705,7 +30001,7 @@ var ts; return getReturnTypeOfSignature(getSignatureFromDeclaration(functionDecl)); } var signature = getContextualSignatureForFunctionLikeDeclaration(functionDecl); - if (signature) { + if (signature && !isResolvingReturnTypeOfSignature(signature)) { return getReturnTypeOfSignature(signature); } return undefined; @@ -29809,11 +30105,11 @@ var ts; return undefined; } if (ts.isJsxAttribute(node.parent)) { - return getTypeOfPropertyOfType(attributesType, node.parent.name.escapedText); + return getTypeOfPropertyOfContextualType(attributesType, node.parent.name.escapedText); } else if (node.parent.kind === 249) { var jsxChildrenPropertyName = getJsxElementChildrenPropertyname(); - return jsxChildrenPropertyName && jsxChildrenPropertyName !== "" ? getTypeOfPropertyOfType(attributesType, jsxChildrenPropertyName) : anyType; + return jsxChildrenPropertyName && jsxChildrenPropertyName !== "" ? getTypeOfPropertyOfContextualType(attributesType, jsxChildrenPropertyName) : anyType; } else { return attributesType; @@ -29825,7 +30121,7 @@ var ts; if (!attributesType || isTypeAny(attributesType)) { return undefined; } - return getTypeOfPropertyOfType(attributesType, attribute.name.escapedText); + return getTypeOfPropertyOfContextualType(attributesType, attribute.name.escapedText); } else { return attributesType; @@ -30041,10 +30337,7 @@ var ts; } } function isNumericComputedName(name) { - return isTypeAnyOrAllConstituentTypesHaveKind(checkComputedPropertyName(name), 84); - } - function isTypeAnyOrAllConstituentTypesHaveKind(type, kind) { - return isTypeAny(type) || isTypeOfKind(type, kind); + return isTypeAssignableToKind(checkComputedPropertyName(name), 84); } function isInfinityOrNaNString(name) { return name === "Infinity" || name === "-Infinity" || name === "NaN"; @@ -30056,7 +30349,9 @@ var ts; var links = getNodeLinks(node.expression); if (!links.resolvedType) { links.resolvedType = checkExpression(node.expression); - if (!isTypeAnyOrAllConstituentTypesHaveKind(links.resolvedType, 84 | 262178 | 512)) { + if (links.resolvedType.flags & 6144 || + !isTypeAssignableToKind(links.resolvedType, 262178 | 84 | 512) && + !isTypeAssignableTo(links.resolvedType, getUnionType([stringType, numberType, esSymbolType]))) { error(node, ts.Diagnostics.A_computed_property_name_must_be_of_type_string_number_symbol_or_any); } else { @@ -30541,9 +30836,7 @@ var ts; return undefined; } function resolveCustomJsxElementAttributesType(openingLikeElement, shouldIncludeAllStatelessAttributesType, elementType, elementClassType) { - if (!elementType) { - elementType = checkExpression(openingLikeElement.tagName); - } + if (elementType === void 0) { elementType = checkExpression(openingLikeElement.tagName); } if (elementType.flags & 65536) { var types = elementType.types; return getUnionType(types.map(function (type) { @@ -30638,11 +30931,12 @@ var ts; } function getCustomJsxElementAttributesType(node, shouldIncludeAllStatelessAttributesType) { var links = getNodeLinks(node); - if (!links.resolvedJsxElementAttributesType) { + var linkLocation = shouldIncludeAllStatelessAttributesType ? "resolvedJsxElementAllAttributesType" : "resolvedJsxElementAttributesType"; + if (!links[linkLocation]) { var elemClassType = getJsxGlobalElementClassType(); - return links.resolvedJsxElementAttributesType = resolveCustomJsxElementAttributesType(node, shouldIncludeAllStatelessAttributesType, undefined, elemClassType); + return links[linkLocation] = resolveCustomJsxElementAttributesType(node, shouldIncludeAllStatelessAttributesType, undefined, elemClassType); } - return links.resolvedJsxElementAttributesType; + return links[linkLocation]; } function getAllAttributesTypeFromJsxOpeningLikeElement(node) { if (isJsxIntrinsicIdentifier(node.tagName)) { @@ -30869,9 +31163,12 @@ var ts; } var prop = getPropertyOfType(apparentType, right.escapedText); if (!prop) { - var stringIndexType = getIndexTypeOfType(apparentType, 0); - if (stringIndexType) { - return stringIndexType; + var indexInfo = getIndexInfoOfType(apparentType, 0); + if (indexInfo && indexInfo.type) { + if (indexInfo.isReadonly && (ts.isAssignmentTarget(node) || ts.isDeleteTarget(node))) { + error(node, ts.Diagnostics.Index_signature_in_type_0_only_permits_reading, typeToString(apparentType)); + } + return indexInfo.type; } if (right.escapedText && !checkAndReportErrorForExtendingInterface(node)) { reportNonexistentProperty(right, type.flags & 16384 && type.isThisType ? apparentType : type); @@ -30998,7 +31295,7 @@ var ts; if (prop && noUnusedIdentifiers && (prop.flags & 106500) && - prop.valueDeclaration && (ts.getModifierFlags(prop.valueDeclaration) & 8)) { + prop.valueDeclaration && ts.hasModifier(prop.valueDeclaration, 8)) { if (ts.getCheckFlags(prop) & 1) { getSymbolLinks(prop).target.isReferenced = true; } @@ -31269,8 +31566,8 @@ var ts; } return undefined; } - function instantiateSignatureInContextOf(signature, contextualSignature, contextualMapper) { - var context = createInferenceContext(signature, 1); + function instantiateSignatureInContextOf(signature, contextualSignature, contextualMapper, compareTypes) { + var context = createInferenceContext(signature, 1, compareTypes); forEachMatchingParameterType(contextualSignature, signature, function (source, target) { inferTypes(context.inferences, instantiateType(source, contextualMapper || identityMapper), target); }); @@ -31500,7 +31797,7 @@ var ts; return getLiteralType(element.name.text); case 144: var nameType = checkComputedPropertyName(element.name); - if (isTypeOfKind(nameType, 512)) { + if (isTypeAssignableToKind(nameType, 512)) { return nameType; } else { @@ -31593,9 +31890,10 @@ var ts; return resolveErrorCall(node); } var args = getEffectiveCallArguments(node); + var isSingleNonGenericCandidate = candidates.length === 1 && !candidates[0].typeParameters; var excludeArgument; var excludeCount = 0; - if (!isDecorator) { + if (!isDecorator && !isSingleNonGenericCandidate) { for (var i = isTaggedTemplate ? 1 : 0; i < args.length; i++) { if (isContextSensitive(args[i])) { if (!excludeArgument) { @@ -31687,6 +31985,17 @@ var ts; if (signatureHelpTrailingComma === void 0) { signatureHelpTrailingComma = false; } candidateForArgumentError = undefined; candidateForTypeArgumentError = undefined; + if (isSingleNonGenericCandidate) { + var candidate = candidates[0]; + if (!hasCorrectArity(node, args, candidate, signatureHelpTrailingComma)) { + return undefined; + } + if (!checkApplicableSignature(node, args, candidate, relation, excludeArgument, false)) { + candidateForArgumentError = candidate; + return undefined; + } + return candidate; + } for (var candidateIndex = 0; candidateIndex < candidates.length; candidateIndex++) { var originalCandidate = candidates[candidateIndex]; if (!hasCorrectArity(node, args, originalCandidate, signatureHelpTrailingComma)) { @@ -31817,7 +32126,7 @@ var ts; return resolveErrorCall(node); } var valueDecl = expressionType.symbol && getClassLikeDeclarationOfSymbol(expressionType.symbol); - if (valueDecl && ts.getModifierFlags(valueDecl) & 128) { + if (valueDecl && ts.hasModifier(valueDecl, 128)) { error(node, ts.Diagnostics.Cannot_create_an_instance_of_the_abstract_class_0, ts.declarationNameToString(ts.getNameOfDeclaration(valueDecl))); return resolveErrorCall(node); } @@ -31853,8 +32162,8 @@ var ts; return true; } var declaration = signature.declaration; - var modifiers = ts.getModifierFlags(declaration); - if (!(modifiers & 24)) { + var modifiers = ts.getSelectedModifierFlags(declaration, 24); + if (!modifiers) { return true; } var declaringClassDeclaration = getClassLikeDeclarationOfSymbol(declaration.parent.symbol); @@ -32008,7 +32317,7 @@ var ts; && getSymbolLinks(type.symbol).inferredClassType === type; } function checkCallExpression(node) { - checkGrammarTypeArguments(node, node.typeArguments) || checkGrammarArguments(node, node.arguments); + checkGrammarTypeArguments(node, node.typeArguments) || checkGrammarArguments(node.arguments); var signature = getResolvedSignature(node); if (node.expression.kind === 97) { return voidType; @@ -32041,7 +32350,7 @@ var ts; return getReturnTypeOfSignature(signature); } function checkImportCallExpression(node) { - checkGrammarArguments(node, node.arguments) || checkGrammarImportCallExpression(node); + checkGrammarArguments(node.arguments) || checkGrammarImportCallExpression(node); if (node.arguments.length === 0) { return createPromiseReturnType(node, anyType); } @@ -32057,11 +32366,33 @@ var ts; if (moduleSymbol) { var esModuleSymbol = resolveESModuleSymbol(moduleSymbol, specifier, true); if (esModuleSymbol) { - return createPromiseReturnType(node, getTypeOfSymbol(esModuleSymbol)); + return createPromiseReturnType(node, getTypeWithSyntheticDefaultImportType(getTypeOfSymbol(esModuleSymbol), esModuleSymbol)); } } return createPromiseReturnType(node, anyType); } + function getTypeWithSyntheticDefaultImportType(type, symbol) { + if (allowSyntheticDefaultImports && type && type !== unknownType) { + var synthType = type; + if (!synthType.syntheticType) { + if (!getPropertyOfType(type, "default")) { + var memberTable = ts.createSymbolTable(); + var newSymbol = createSymbol(2097152, "default"); + newSymbol.target = resolveSymbol(symbol); + memberTable.set("default", newSymbol); + var anonymousSymbol = createSymbol(2048, "__type"); + var defaultContainingObject = createAnonymousType(anonymousSymbol, memberTable, ts.emptyArray, ts.emptyArray, undefined, undefined); + anonymousSymbol.type = defaultContainingObject; + synthType.syntheticType = getIntersectionType([type, defaultContainingObject]); + } + else { + synthType.syntheticType = type; + } + } + return synthType.syntheticType; + } + return type; + } function isCommonJsRequire(node) { if (!ts.isRequireCall(node, true)) { return false; @@ -32180,15 +32511,15 @@ var ts; } } } - function assignBindingElementTypes(node) { - if (ts.isBindingPattern(node.name)) { - for (var _i = 0, _a = node.name.elements; _i < _a.length; _i++) { - var element = _a[_i]; - if (!ts.isOmittedExpression(element)) { - if (element.name.kind === 71) { - getSymbolLinks(getSymbolOfNode(element)).type = getTypeForBindingElement(element); - } - assignBindingElementTypes(element); + function assignBindingElementTypes(pattern) { + for (var _i = 0, _a = pattern.elements; _i < _a.length; _i++) { + var element = _a[_i]; + if (!ts.isOmittedExpression(element)) { + if (element.name.kind === 71) { + getSymbolLinks(getSymbolOfNode(element)).type = getTypeForBindingElement(element); + } + else { + assignBindingElementTypes(element.name); } } } @@ -32197,12 +32528,13 @@ var ts; var links = getSymbolLinks(parameter); if (!links.type) { links.type = contextualType; - var name = ts.getNameOfDeclaration(parameter.valueDeclaration); - if (links.type === emptyObjectType && - (name.kind === 174 || name.kind === 175)) { - links.type = getTypeFromBindingPattern(name); + var decl = parameter.valueDeclaration; + if (decl.name.kind !== 71) { + if (links.type === emptyObjectType) { + links.type = getTypeFromBindingPattern(decl.name); + } + assignBindingElementTypes(decl.name); } - assignBindingElementTypes(parameter.valueDeclaration); } } function createPromiseType(promisedType) { @@ -32403,14 +32735,14 @@ var ts; } function checkFunctionExpressionOrObjectLiteralMethod(node, checkMode) { ts.Debug.assert(node.kind !== 151 || ts.isObjectLiteralMethod(node)); - var hasGrammarError = checkGrammarFunctionLikeDeclaration(node); - if (!hasGrammarError && node.kind === 186) { - checkGrammarForGenerator(node); - } if (checkMode === 1 && isContextSensitive(node)) { checkNodeDeferred(node); return anyFunctionType; } + var hasGrammarError = checkGrammarFunctionLikeDeclaration(node); + if (!hasGrammarError && node.kind === 186) { + checkGrammarForGenerator(node); + } var links = getNodeLinks(node); var type = getTypeOfSymbol(node.symbol); if (!(links.flags & 1024)) { @@ -32480,7 +32812,7 @@ var ts; } } function checkArithmeticOperandType(operand, type, diagnostic) { - if (!isTypeAnyOrAllConstituentTypesHaveKind(type, 84)) { + if (!isTypeAssignableToKind(type, 84)) { error(operand, diagnostic); return false; } @@ -32568,8 +32900,13 @@ var ts; if (operandType === silentNeverType) { return silentNeverType; } - if (node.operator === 38 && node.operand.kind === 8) { - return getFreshTypeOfLiteralType(getLiteralType(-node.operand.text)); + if (node.operand.kind === 8) { + if (node.operator === 38) { + return getFreshTypeOfLiteralType(getLiteralType(-node.operand.text)); + } + else if (node.operator === 37) { + return getFreshTypeOfLiteralType(getLiteralType(+node.operand.text)); + } } switch (node.operator) { case 37: @@ -32621,30 +32958,22 @@ var ts; } return false; } - function isTypeOfKind(type, kind) { - if (type.flags & kind) { + function isTypeAssignableToKind(source, kind, strict) { + if (source.flags & kind) { return true; } - if (type.flags & 65536) { - var types = type.types; - for (var _i = 0, types_18 = types; _i < types_18.length; _i++) { - var t = types_18[_i]; - if (!isTypeOfKind(t, kind)) { - return false; - } - } - return true; - } - if (type.flags & 131072) { - var types = type.types; - for (var _a = 0, types_19 = types; _a < types_19.length; _a++) { - var t = types_19[_a]; - if (isTypeOfKind(t, kind)) { - return true; - } - } + if (strict && source.flags & (1 | 1024 | 2048 | 4096)) { + return false; } - return false; + return (kind & 84 && isTypeAssignableTo(source, numberType)) || + (kind & 262178 && isTypeAssignableTo(source, stringType)) || + (kind & 136 && isTypeAssignableTo(source, booleanType)) || + (kind & 1024 && isTypeAssignableTo(source, voidType)) || + (kind & 8192 && isTypeAssignableTo(source, neverType)) || + (kind & 4096 && isTypeAssignableTo(source, nullType)) || + (kind & 2048 && isTypeAssignableTo(source, undefinedType)) || + (kind & 512 && isTypeAssignableTo(source, esSymbolType)) || + (kind & 16777216 && isTypeAssignableTo(source, nonPrimitiveType)); } function isConstEnumObjectType(type) { return getObjectFlags(type) & 16 && type.symbol && isConstEnumSymbol(type.symbol); @@ -32656,7 +32985,7 @@ var ts; if (leftType === silentNeverType || rightType === silentNeverType) { return silentNeverType; } - if (isTypeOfKind(leftType, 8190)) { + if (!isTypeAny(leftType) && isTypeAssignableToKind(leftType, 8190)) { error(left, ts.Diagnostics.The_left_hand_side_of_an_instanceof_expression_must_be_of_type_any_an_object_type_or_a_type_parameter); } if (!(isTypeAny(rightType) || @@ -32673,18 +33002,18 @@ var ts; } leftType = checkNonNullType(leftType, left); rightType = checkNonNullType(rightType, right); - if (!(isTypeComparableTo(leftType, stringType) || isTypeOfKind(leftType, 84 | 512))) { + if (!(isTypeComparableTo(leftType, stringType) || isTypeAssignableToKind(leftType, 84 | 512))) { error(left, ts.Diagnostics.The_left_hand_side_of_an_in_expression_must_be_of_type_any_string_number_or_symbol); } - if (!isTypeAnyOrAllConstituentTypesHaveKind(rightType, 32768 | 540672 | 16777216)) { + if (!isTypeAssignableToKind(rightType, 16777216 | 540672)) { error(right, ts.Diagnostics.The_right_hand_side_of_an_in_expression_must_be_of_type_any_an_object_type_or_a_type_parameter); } return booleanType; } function checkObjectLiteralAssignment(node, sourceType) { var properties = node.properties; - for (var _i = 0, properties_6 = properties; _i < properties_6.length; _i++) { - var p = properties_6[_i]; + for (var _i = 0, properties_7 = properties; _i < properties_7.length; _i++) { + var p = properties_7[_i]; checkObjectLiteralDestructuringPropertyAssignment(sourceType, p, properties); } return sourceType; @@ -32940,24 +33269,22 @@ var ts; if (leftType === silentNeverType || rightType === silentNeverType) { return silentNeverType; } - if (!isTypeOfKind(leftType, 1 | 262178) && !isTypeOfKind(rightType, 1 | 262178)) { + if (!isTypeAssignableToKind(leftType, 262178) && !isTypeAssignableToKind(rightType, 262178)) { leftType = checkNonNullType(leftType, left); rightType = checkNonNullType(rightType, right); } var resultType = void 0; - if (isTypeOfKind(leftType, 84) && isTypeOfKind(rightType, 84)) { + if (isTypeAssignableToKind(leftType, 84, true) && isTypeAssignableToKind(rightType, 84, true)) { resultType = numberType; } - else { - if (isTypeOfKind(leftType, 262178) || isTypeOfKind(rightType, 262178)) { - resultType = stringType; - } - else if (isTypeAny(leftType) || isTypeAny(rightType)) { - resultType = leftType === unknownType || rightType === unknownType ? unknownType : anyType; - } - if (resultType && !checkForDisallowedESSymbolOperand(operator)) { - return resultType; - } + else if (isTypeAssignableToKind(leftType, 262178, true) || isTypeAssignableToKind(rightType, 262178, true)) { + resultType = stringType; + } + else if (isTypeAny(leftType) || isTypeAny(rightType)) { + resultType = leftType === unknownType || rightType === unknownType ? unknownType : anyType; + } + if (resultType && !checkForDisallowedESSymbolOperand(operator)) { + return resultType; } if (!resultType) { reportOperatorError(); @@ -33122,13 +33449,12 @@ var ts; return getBestChoiceType(type1, type2); } function checkLiteralExpression(node) { - if (node.kind === 8) { - checkGrammarNumericLiteral(node); - } switch (node.kind) { + case 13: case 9: return getFreshTypeOfLiteralType(getLiteralType(node.text)); case 8: + checkGrammarNumericLiteral(node); return getFreshTypeOfLiteralType(getLiteralType(+node.text)); case 101: return trueType; @@ -33276,6 +33602,7 @@ var ts; return checkSuperExpression(node); case 95: return nullWideningType; + case 13: case 9: case 8: case 101: @@ -33283,8 +33610,6 @@ var ts; return checkLiteralExpression(node); case 196: return checkTemplateExpression(node); - case 13: - return stringType; case 12: return globalRegExpType; case 177: @@ -33375,7 +33700,7 @@ var ts; checkGrammarDecorators(node) || checkGrammarModifiers(node); checkVariableLikeDeclaration(node); var func = ts.getContainingFunction(node); - if (ts.getModifierFlags(node) & 92) { + if (ts.hasModifier(node, 92)) { func = ts.getContainingFunction(node); if (!(func.kind === 152 && ts.nodeIsPresent(func.body))) { error(node, ts.Diagnostics.A_parameter_property_is_only_allowed_in_a_constructor_implementation); @@ -33565,7 +33890,7 @@ var ts; } } else { - var isStatic = ts.getModifierFlags(member) & 32; + var isStatic = ts.hasModifier(member, 32); var names = isStatic ? staticNames : instanceNames; var memberName = member.name && ts.getPropertyNameForPropertyNameNode(member.name); if (memberName) { @@ -33610,7 +33935,7 @@ var ts; for (var _i = 0, _a = node.members; _i < _a.length; _i++) { var member = _a[_i]; var memberNameNode = member.name; - var isStatic = ts.getModifierFlags(member) & 32; + var isStatic = ts.hasModifier(member, 32); if (isStatic && memberNameNode) { var memberName = ts.getPropertyNameForPropertyNameNode(memberNameNode); switch (memberName) { @@ -33698,7 +34023,7 @@ var ts; function checkMethodDeclaration(node) { checkGrammarMethod(node) || checkGrammarComputedPropertyName(node.name); checkFunctionOrMethodDeclaration(node); - if (ts.getModifierFlags(node) & 128 && node.body) { + if (ts.hasModifier(node, 128) && node.body) { error(node, ts.Diagnostics.Method_0_cannot_have_an_implementation_because_it_is_marked_abstract, ts.declarationNameToString(node.name)); } } @@ -33734,17 +34059,9 @@ var ts; } return ts.forEachChild(n, containsSuperCall); } - function markThisReferencesAsErrors(n) { - if (n.kind === 99) { - error(n, ts.Diagnostics.this_cannot_be_referenced_in_current_location); - } - else if (n.kind !== 186 && n.kind !== 228) { - ts.forEachChild(n, markThisReferencesAsErrors); - } - } function isInstancePropertyWithInitializer(n) { return n.kind === 149 && - !(ts.getModifierFlags(n) & 32) && + !ts.hasModifier(n, 32) && !!n.initializer; } var containingClassDecl = node.parent; @@ -33756,8 +34073,8 @@ var ts; if (classExtendsNull) { error(superCall, ts.Diagnostics.A_constructor_cannot_contain_a_super_call_when_its_class_extends_null); } - var superCallShouldBeFirst = ts.forEach(node.parent.members, isInstancePropertyWithInitializer) || - ts.forEach(node.parameters, function (p) { return ts.getModifierFlags(p) & 92; }); + var superCallShouldBeFirst = ts.some(node.parent.members, isInstancePropertyWithInitializer) || + ts.some(node.parameters, function (p) { return ts.hasModifier(p, 92); }); if (superCallShouldBeFirst) { var statements = node.body.statements; var superCallStatement = void 0; @@ -33800,10 +34117,12 @@ var ts; var otherKind = node.kind === 153 ? 154 : 153; var otherAccessor = ts.getDeclarationOfKind(node.symbol, otherKind); if (otherAccessor) { - if ((ts.getModifierFlags(node) & 28) !== (ts.getModifierFlags(otherAccessor) & 28)) { + var nodeFlags = ts.getModifierFlags(node); + var otherFlags = ts.getModifierFlags(otherAccessor); + if ((nodeFlags & 28) !== (otherFlags & 28)) { error(node.name, ts.Diagnostics.Getter_and_setter_accessors_do_not_agree_in_visibility); } - if (ts.hasModifier(node, 128) !== ts.hasModifier(otherAccessor, 128)) { + if ((nodeFlags & 128) !== (otherFlags & 128)) { error(node.name, ts.Diagnostics.Accessors_must_both_be_abstract_or_non_abstract); } checkAccessorDeclarationTypesIdentical(node, otherAccessor, getAnnotatedAccessorType, ts.Diagnostics.get_and_set_accessor_must_have_the_same_type); @@ -33849,7 +34168,7 @@ var ts; function checkTypeReferenceNode(node) { checkGrammarTypeArguments(node, node.typeArguments); if (node.kind === 159 && node.typeName.jsdocDotPos !== undefined && !ts.isInJavaScriptFile(node) && !ts.isInJSDoc(node)) { - grammarErrorAtPos(ts.getSourceFileOfNode(node), node.typeName.jsdocDotPos, 1, ts.Diagnostics.JSDoc_types_can_only_be_used_inside_documentation_comments); + grammarErrorAtPos(node, node.typeName.jsdocDotPos, 1, ts.Diagnostics.JSDoc_types_can_only_be_used_inside_documentation_comments); } var type = getTypeFromTypeReference(node); if (type !== unknownType) { @@ -33857,7 +34176,14 @@ var ts; ts.forEach(node.typeArguments, checkSourceElement); if (produceDiagnostics) { var symbol = getNodeLinks(node).resolvedSymbol; - var typeParameters = symbol.flags & 524288 ? getSymbolLinks(symbol).typeParameters : type.target.localTypeParameters; + if (!symbol) { + error(node, ts.Diagnostics.Type_0_is_not_generic, typeToString(type)); + return; + } + var typeParameters = symbol.flags & 524288 && getSymbolLinks(symbol).typeParameters; + if (!typeParameters && getObjectFlags(type) & 4) { + typeParameters = type.target.localTypeParameters; + } checkTypeArgumentConstraints(typeParameters, node.typeArguments); } } @@ -33900,16 +34226,15 @@ var ts; if (isTypeAssignableTo(indexType, getIndexType(objectType))) { return type; } - if (maybeTypeOfKind(objectType, 540672) && isTypeOfKind(indexType, 84)) { - var constraint = getBaseConstraintOfType(objectType); - if (constraint && getIndexInfoOfType(constraint, 1)) { - return type; - } + if (getIndexInfoOfType(getApparentType(objectType), 1) && isTypeAssignableToKind(indexType, 84)) { + return type; } error(accessNode, ts.Diagnostics.Type_0_cannot_be_used_to_index_type_1, typeToString(indexType), typeToString(objectType)); return type; } function checkIndexedAccessType(node) { + checkSourceElement(node.objectType); + checkSourceElement(node.indexType); checkIndexedAccessIndexType(getTypeFromIndexedAccessTypeNode(node), node); } function checkMappedType(node) { @@ -33920,7 +34245,7 @@ var ts; checkTypeAssignableTo(constraintType, stringType, node.typeParameter.constraint); } function isPrivateWithinAmbient(node) { - return (ts.getModifierFlags(node) & 8) && ts.isInAmbientContext(node); + return ts.hasModifier(node, 8) && ts.isInAmbientContext(node); } function getEffectiveDeclarationFlags(n, flagsToCheck) { var flags = ts.getCombinedModifierFlags(n); @@ -34007,9 +34332,9 @@ var ts; (ts.isComputedPropertyName(node.name) && ts.isComputedPropertyName(subsequentName) || !ts.isComputedPropertyName(node.name) && !ts.isComputedPropertyName(subsequentName) && ts.getEscapedTextOfIdentifierOrLiteral(node.name) === ts.getEscapedTextOfIdentifierOrLiteral(subsequentName))) { var reportError = (node.kind === 151 || node.kind === 150) && - (ts.getModifierFlags(node) & 32) !== (ts.getModifierFlags(subsequentNode) & 32); + ts.hasModifier(node, 32) !== ts.hasModifier(subsequentNode, 32); if (reportError) { - var diagnostic = ts.getModifierFlags(node) & 32 ? ts.Diagnostics.Function_overload_must_be_static : ts.Diagnostics.Function_overload_must_not_be_static; + var diagnostic = ts.hasModifier(node, 32) ? ts.Diagnostics.Function_overload_must_be_static : ts.Diagnostics.Function_overload_must_not_be_static; error(errorNode_1, diagnostic); } return; @@ -34025,7 +34350,7 @@ var ts; error(errorNode, ts.Diagnostics.Constructor_implementation_is_missing); } else { - if (ts.getModifierFlags(node) & 128) { + if (ts.hasModifier(node, 128)) { error(errorNode, ts.Diagnostics.All_declarations_of_an_abstract_method_must_be_consecutive); } else { @@ -34035,8 +34360,8 @@ var ts; } var duplicateFunctionDeclaration = false; var multipleConstructorImplementation = false; - for (var _i = 0, declarations_5 = declarations; _i < declarations_5.length; _i++) { - var current = declarations_5[_i]; + for (var _i = 0, declarations_4 = declarations; _i < declarations_4.length; _i++) { + var current = declarations_4[_i]; var node = current; var inAmbientContext = ts.isInAmbientContext(node); var inAmbientContextOrInterface = node.parent.kind === 230 || node.parent.kind === 163 || inAmbientContext; @@ -34085,7 +34410,7 @@ var ts; }); } if (lastSeenNonAmbientDeclaration && !lastSeenNonAmbientDeclaration.body && - !(ts.getModifierFlags(lastSeenNonAmbientDeclaration) & 128) && !lastSeenNonAmbientDeclaration.questionToken) { + !ts.hasModifier(lastSeenNonAmbientDeclaration, 128) && !lastSeenNonAmbientDeclaration.questionToken) { reportImplementationExpectedError(lastSeenNonAmbientDeclaration); } if (hasOverloads) { @@ -34494,7 +34819,7 @@ var ts; if (!ts.hasDynamicName(node)) { var symbol = getSymbolOfNode(node); var localSymbol = node.localSymbol || symbol; - var firstDeclaration = ts.find(localSymbol.declarations, function (declaration) { return declaration.kind === node.kind && !ts.isSourceFileJavaScript(ts.getSourceFileOfNode(declaration)); }); + var firstDeclaration = ts.find(localSymbol.declarations, function (declaration) { return declaration.kind === node.kind && !(declaration.flags & 65536); }); if (node === firstDeclaration) { checkFunctionOrConstructorSymbol(localSymbol); } @@ -34629,14 +34954,14 @@ var ts; for (var _i = 0, _a = node.members; _i < _a.length; _i++) { var member = _a[_i]; if (member.kind === 151 || member.kind === 149) { - if (!member.symbol.isReferenced && ts.getModifierFlags(member) & 8) { + if (!member.symbol.isReferenced && ts.hasModifier(member, 8)) { error(member.name, ts.Diagnostics._0_is_declared_but_never_used, ts.unescapeLeadingUnderscores(member.symbol.escapedName)); } } else if (member.kind === 152) { for (var _b = 0, _c = member.parameters; _b < _c.length; _b++) { var parameter = _c[_b]; - if (!parameter.symbol.isReferenced && ts.getModifierFlags(parameter) & 8) { + if (!parameter.symbol.isReferenced && ts.hasModifier(parameter, 8)) { error(parameter.name, ts.Diagnostics.Property_0_is_declared_but_never_used, ts.unescapeLeadingUnderscores(parameter.symbol.escapedName)); } } @@ -34976,7 +35301,7 @@ var ts; 128 | 64 | 32; - return (ts.getModifierFlags(left) & interestingFlags) === (ts.getModifierFlags(right) & interestingFlags); + return ts.getSelectedModifierFlags(left, interestingFlags) === ts.getSelectedModifierFlags(right, interestingFlags); } function checkVariableDeclaration(node) { checkGrammarVariableDeclaration(node); @@ -35106,7 +35431,7 @@ var ts; checkReferenceExpression(varExpr, ts.Diagnostics.The_left_hand_side_of_a_for_in_statement_must_be_a_variable_or_a_property_access); } } - if (!isTypeAnyOrAllConstituentTypesHaveKind(rightType, 32768 | 540672 | 16777216)) { + if (!isTypeAssignableToKind(rightType, 16777216 | 540672)) { error(node.expression, ts.Diagnostics.The_right_hand_side_of_a_for_in_statement_must_be_of_type_any_an_object_type_or_a_type_parameter); } checkSourceElement(node.statement); @@ -35478,7 +35803,7 @@ var ts; var classDeclaration = type.symbol.valueDeclaration; for (var _i = 0, _a = classDeclaration.members; _i < _a.length; _i++) { var member = _a[_i]; - if (!(ts.getModifierFlags(member) & 32) && ts.hasDynamicName(member)) { + if (!ts.hasModifier(member, 32) && ts.hasDynamicName(member)) { var propType = getTypeOfSymbol(member.symbol); checkIndexConstraintForProperty(member.symbol, propType, type, declaredStringIndexer, stringIndexType, 0); checkIndexConstraintForProperty(member.symbol, propType, type, declaredNumberIndexer, numberIndexType, 1); @@ -35575,8 +35900,8 @@ var ts; var type = getDeclaredTypeOfSymbol(symbol); if (!areTypeParametersIdentical(declarations, type.localTypeParameters)) { var name = symbolToString(symbol); - for (var _i = 0, declarations_6 = declarations; _i < declarations_6.length; _i++) { - var declaration = declarations_6[_i]; + for (var _i = 0, declarations_5 = declarations; _i < declarations_5.length; _i++) { + var declaration = declarations_5[_i]; error(declaration.name, ts.Diagnostics.All_declarations_of_0_must_have_identical_type_parameters, name); } } @@ -35585,8 +35910,8 @@ var ts; function areTypeParametersIdentical(declarations, typeParameters) { var maxTypeArgumentCount = ts.length(typeParameters); var minTypeArgumentCount = getMinTypeArgumentCount(typeParameters); - for (var _i = 0, declarations_7 = declarations; _i < declarations_7.length; _i++) { - var declaration = declarations_7[_i]; + for (var _i = 0, declarations_6 = declarations; _i < declarations_6.length; _i++) { + var declaration = declarations_6[_i]; var numTypeParameters = ts.length(declaration.typeParameters); if (numTypeParameters < minTypeArgumentCount || numTypeParameters > maxTypeArgumentCount) { return false; @@ -35622,7 +35947,7 @@ var ts; registerForUnusedIdentifiersCheck(node); } function checkClassDeclaration(node) { - if (!node.name && !(ts.getModifierFlags(node) & 512)) { + if (!node.name && !ts.hasModifier(node, 512)) { grammarErrorOnFirstToken(node, ts.Diagnostics.A_class_declaration_without_the_default_modifier_must_have_a_name); } checkClassLikeDeclaration(node); @@ -35715,7 +36040,7 @@ var ts; var signatures = getSignaturesOfType(type, 1); if (signatures.length) { var declaration = signatures[0].declaration; - if (declaration && ts.getModifierFlags(declaration) & 8) { + if (declaration && ts.hasModifier(declaration, 8)) { var typeClassDeclaration = getClassLikeDeclarationOfSymbol(type.symbol); if (!isNodeWithinClass(node, typeClassDeclaration)) { error(node, ts.Diagnostics.Cannot_extend_a_class_0_Class_constructor_is_marked_as_private, getFullyQualifiedName(type.symbol)); @@ -35748,7 +36073,7 @@ var ts; if (derived) { if (derived === base) { var derivedClassDecl = getClassLikeDeclarationOfSymbol(type.symbol); - if (baseDeclarationFlags & 128 && (!derivedClassDecl || !(ts.getModifierFlags(derivedClassDecl) & 128))) { + if (baseDeclarationFlags & 128 && (!derivedClassDecl || !ts.hasModifier(derivedClassDecl, 128))) { if (derivedClassDecl.kind === 199) { error(derivedClassDecl, ts.Diagnostics.Non_abstract_class_expression_does_not_implement_inherited_abstract_member_0_from_class_1, symbolToString(baseProperty), typeToString(baseType)); } @@ -35796,8 +36121,8 @@ var ts; for (var _i = 0, baseTypes_2 = baseTypes; _i < baseTypes_2.length; _i++) { var base = baseTypes_2[_i]; var properties = getPropertiesOfType(getTypeWithThisArgument(base, type.thisType)); - for (var _a = 0, properties_7 = properties; _a < properties_7.length; _a++) { - var prop = properties_7[_a]; + for (var _a = 0, properties_8 = properties; _a < properties_8.length; _a++) { + var prop = properties_8[_a]; var existing = seen.get(prop.escapedName); if (!existing) { seen.set(prop.escapedName, { prop: prop, containingType: base }); @@ -36051,8 +36376,8 @@ var ts; } function getFirstNonAmbientClassOrFunctionDeclaration(symbol) { var declarations = symbol.declarations; - for (var _i = 0, declarations_8 = declarations; _i < declarations_8.length; _i++) { - var declaration = declarations_8[_i]; + for (var _i = 0, declarations_7 = declarations; _i < declarations_7.length; _i++) { + var declaration = declarations_7[_i]; if ((declaration.kind === 229 || (declaration.kind === 228 && ts.nodeIsPresent(declaration.body))) && !ts.isInAmbientContext(declaration)) { @@ -36267,7 +36592,7 @@ var ts; if (checkGrammarModuleElementContext(node, ts.Diagnostics.An_import_declaration_can_only_be_used_in_a_namespace_or_module)) { return; } - if (!checkGrammarDecorators(node) && !checkGrammarModifiers(node) && ts.getModifierFlags(node) !== 0) { + if (!checkGrammarDecorators(node) && !checkGrammarModifiers(node) && ts.hasModifiers(node)) { grammarErrorOnFirstToken(node, ts.Diagnostics.An_import_declaration_cannot_have_modifiers); } if (checkExternalImportOrExportDeclaration(node)) { @@ -36294,7 +36619,7 @@ var ts; checkGrammarDecorators(node) || checkGrammarModifiers(node); if (ts.isInternalModuleImportEqualsDeclaration(node) || checkExternalImportOrExportDeclaration(node)) { checkImportBinding(node); - if (ts.getModifierFlags(node) & 1) { + if (ts.hasModifier(node, 1)) { markExportAsReferenced(node); } if (ts.isInternalModuleImportEqualsDeclaration(node)) { @@ -36322,7 +36647,7 @@ var ts; if (checkGrammarModuleElementContext(node, ts.Diagnostics.An_export_declaration_can_only_be_used_in_a_module)) { return; } - if (!checkGrammarDecorators(node) && !checkGrammarModifiers(node) && ts.getModifierFlags(node) !== 0) { + if (!checkGrammarDecorators(node) && !checkGrammarModifiers(node) && ts.hasModifiers(node)) { grammarErrorOnFirstToken(node, ts.Diagnostics.An_export_declaration_cannot_have_modifiers); } if (!node.moduleSpecifier || checkExternalImportOrExportDeclaration(node)) { @@ -36380,7 +36705,7 @@ var ts; } return; } - if (!checkGrammarDecorators(node) && !checkGrammarModifiers(node) && ts.getModifierFlags(node) !== 0) { + if (!checkGrammarDecorators(node) && !checkGrammarModifiers(node) && ts.hasModifiers(node)) { grammarErrorOnFirstToken(node, ts.Diagnostics.An_export_assignment_cannot_have_modifiers); } if (node.expression.kind === 71) { @@ -36427,8 +36752,8 @@ var ts; return; } if (exportedDeclarationsCount > 1) { - for (var _i = 0, declarations_9 = declarations; _i < declarations_9.length; _i++) { - var declaration = declarations_9[_i]; + for (var _i = 0, declarations_8 = declarations; _i < declarations_8.length; _i++) { + var declaration = declarations_8[_i]; if (isNotOverload(declaration)) { diagnostics.add(ts.createDiagnosticForNode(declaration, ts.Diagnostics.Cannot_redeclare_exported_variable_0, ts.unescapeLeadingUnderscores(id))); } @@ -36706,7 +37031,7 @@ var ts; return []; } var symbols = ts.createSymbolTable(); - var memberFlags = 0; + var isStatic = false; populateSymbols(); return symbolsToArray(symbols); function populateSymbols() { @@ -36728,7 +37053,7 @@ var ts; } case 229: case 230: - if (!(memberFlags & 32)) { + if (!isStatic) { copySymbols(getSymbolOfNode(location).members, meaning & 793064); } break; @@ -36742,7 +37067,7 @@ var ts; if (ts.introducesArgumentsExoticObject(location)) { copySymbol(argumentsSymbol, meaning); } - memberFlags = ts.getModifierFlags(location); + isStatic = ts.hasModifier(location, 32); location = location.parent; } copySymbols(globals, meaning); @@ -36977,12 +37302,7 @@ var ts; case 8: if (node.parent.kind === 180 && node.parent.argumentExpression === node) { var objectType = getTypeOfExpression(node.parent.expression); - if (objectType === unknownType) - return undefined; - var apparentType = getApparentType(objectType); - if (apparentType === unknownType) - return undefined; - return getPropertyOfType(apparentType, node.text); + return getPropertyOfType(objectType, node.text); } break; } @@ -37078,7 +37398,7 @@ var ts; } function getParentTypeOfClassElement(node) { var classSymbol = getSymbolOfNode(node.parent); - return ts.getModifierFlags(node) & 32 + return ts.hasModifier(node, 32) ? getTypeOfSymbol(classSymbol) : getDeclaredTypeOfSymbol(classSymbol); } @@ -37303,13 +37623,13 @@ var ts; return strictNullChecks && !isOptionalParameter(parameter) && parameter.initializer && - !(ts.getModifierFlags(parameter) & 92); + !ts.hasModifier(parameter, 92); } function isOptionalUninitializedParameterProperty(parameter) { return strictNullChecks && isOptionalParameter(parameter) && !parameter.initializer && - !!(ts.getModifierFlags(parameter) & 92); + ts.hasModifier(parameter, 92); } function getNodeCheckFlags(node) { return getNodeLinks(node).flags; @@ -37365,22 +37685,22 @@ var ts; else if (type.flags & 1) { return ts.TypeReferenceSerializationKind.ObjectType; } - else if (isTypeOfKind(type, 1024 | 6144 | 8192)) { + else if (isTypeAssignableToKind(type, 1024 | 6144 | 8192)) { return ts.TypeReferenceSerializationKind.VoidNullableOrNeverType; } - else if (isTypeOfKind(type, 136)) { + else if (isTypeAssignableToKind(type, 136)) { return ts.TypeReferenceSerializationKind.BooleanType; } - else if (isTypeOfKind(type, 84)) { + else if (isTypeAssignableToKind(type, 84)) { return ts.TypeReferenceSerializationKind.NumberLikeType; } - else if (isTypeOfKind(type, 262178)) { + else if (isTypeAssignableToKind(type, 262178)) { return ts.TypeReferenceSerializationKind.StringLikeType; } else if (isTupleType(type)) { return ts.TypeReferenceSerializationKind.ArrayLikeType; } - else if (isTypeOfKind(type, 512)) { + else if (isTypeAssignableToKind(type, 512)) { return ts.TypeReferenceSerializationKind.ESSymbolType; } else if (isFunctionType(type)) { @@ -37845,7 +38165,7 @@ var ts; node.kind !== 154) { return grammarErrorOnNode(modifier, ts.Diagnostics.abstract_modifier_can_only_appear_on_a_class_method_or_property_declaration); } - if (!(node.parent.kind === 229 && ts.getModifierFlags(node.parent) & 128)) { + if (!(node.parent.kind === 229 && ts.hasModifier(node.parent, 128))) { return grammarErrorOnNode(modifier, ts.Diagnostics.Abstract_methods_can_only_appear_within_an_abstract_class); } if (flags & 32) { @@ -37964,8 +38284,7 @@ var ts; if (list && list.hasTrailingComma) { var start = list.end - ",".length; var end = list.end; - var sourceFile = ts.getSourceFileOfNode(list[0]); - return grammarErrorAtPos(sourceFile, start, end - start, ts.Diagnostics.Trailing_comma_not_allowed); + return grammarErrorAtPos(list[0], start, end - start, ts.Diagnostics.Trailing_comma_not_allowed); } } function checkGrammarTypeParameterList(typeParameters, file) { @@ -38041,7 +38360,7 @@ var ts; if (parameter.dotDotDotToken) { return grammarErrorOnNode(parameter.dotDotDotToken, ts.Diagnostics.An_index_signature_cannot_have_a_rest_parameter); } - if (ts.getModifierFlags(parameter) !== 0) { + if (ts.hasModifiers(parameter)) { return grammarErrorOnNode(parameter.name, ts.Diagnostics.An_index_signature_parameter_cannot_have_an_accessibility_modifier); } if (parameter.questionToken) { @@ -38075,19 +38394,18 @@ var ts; return checkGrammarForDisallowedTrailingComma(typeArguments) || checkGrammarForAtLeastOneTypeArgument(node, typeArguments); } - function checkGrammarForOmittedArgument(node, args) { + function checkGrammarForOmittedArgument(args) { if (args) { - var sourceFile = ts.getSourceFileOfNode(node); for (var _i = 0, args_5 = args; _i < args_5.length; _i++) { var arg = args_5[_i]; if (arg.kind === 200) { - return grammarErrorAtPos(sourceFile, arg.pos, 0, ts.Diagnostics.Argument_expression_expected); + return grammarErrorAtPos(arg, arg.pos, 0, ts.Diagnostics.Argument_expression_expected); } } } } - function checkGrammarArguments(node, args) { - return checkGrammarForOmittedArgument(node, args); + function checkGrammarArguments(args) { + return checkGrammarForOmittedArgument(args); } function checkGrammarHeritageClause(node) { var types = node.types; @@ -38096,8 +38414,7 @@ var ts; } if (types && types.length === 0) { var listType = ts.tokenToString(node.token); - var sourceFile = ts.getSourceFileOfNode(node); - return grammarErrorAtPos(sourceFile, types.pos, 0, ts.Diagnostics._0_list_cannot_be_empty, listType); + return grammarErrorAtPos(node, types.pos, 0, ts.Diagnostics._0_list_cannot_be_empty, listType); } return ts.forEach(types, checkGrammarExpressionWithTypeArguments); } @@ -38320,10 +38637,10 @@ var ts; else if (ts.isInAmbientContext(accessor)) { return grammarErrorOnNode(accessor.name, ts.Diagnostics.An_accessor_cannot_be_declared_in_an_ambient_context); } - else if (accessor.body === undefined && !(ts.getModifierFlags(accessor) & 128)) { - return grammarErrorAtPos(ts.getSourceFileOfNode(accessor), accessor.end - 1, ";".length, ts.Diagnostics._0_expected, "{"); + else if (accessor.body === undefined && !ts.hasModifier(accessor, 128)) { + return grammarErrorAtPos(accessor, accessor.end - 1, ";".length, ts.Diagnostics._0_expected, "{"); } - else if (accessor.body && ts.getModifierFlags(accessor) & 128) { + else if (accessor.body && ts.hasModifier(accessor, 128)) { return grammarErrorOnNode(accessor, ts.Diagnostics.An_abstract_accessor_cannot_have_an_implementation); } else if (accessor.typeParameters) { @@ -38376,7 +38693,7 @@ var ts; return true; } else if (node.body === undefined) { - return grammarErrorAtPos(ts.getSourceFileOfNode(node), node.end - 1, ";".length, ts.Diagnostics._0_expected, "{"); + return grammarErrorAtPos(node, node.end - 1, ";".length, ts.Diagnostics._0_expected, "{"); } } if (ts.isClassLike(node.parent)) { @@ -38447,7 +38764,7 @@ var ts; return grammarErrorOnNode(node.name, ts.Diagnostics.A_rest_element_cannot_contain_a_binding_pattern); } if (node.initializer) { - return grammarErrorAtPos(ts.getSourceFileOfNode(node), node.initializer.pos - 1, 1, ts.Diagnostics.A_rest_element_cannot_have_an_initializer); + return grammarErrorAtPos(node, node.initializer.pos - 1, 1, ts.Diagnostics.A_rest_element_cannot_have_an_initializer); } } } @@ -38467,12 +38784,12 @@ var ts; } else { var equalsTokenLength = "=".length; - return grammarErrorAtPos(ts.getSourceFileOfNode(node), node.initializer.pos - equalsTokenLength, equalsTokenLength, ts.Diagnostics.Initializers_are_not_allowed_in_ambient_contexts); + return grammarErrorAtPos(node, node.initializer.pos - equalsTokenLength, equalsTokenLength, ts.Diagnostics.Initializers_are_not_allowed_in_ambient_contexts); } } if (node.initializer && !(ts.isConst(node) && isStringOrNumberLiteralExpression(node.initializer))) { var equalsTokenLength = "=".length; - return grammarErrorAtPos(ts.getSourceFileOfNode(node), node.initializer.pos - equalsTokenLength, equalsTokenLength, ts.Diagnostics.Initializers_are_not_allowed_in_ambient_contexts); + return grammarErrorAtPos(node, node.initializer.pos - equalsTokenLength, equalsTokenLength, ts.Diagnostics.Initializers_are_not_allowed_in_ambient_contexts); } } else if (!node.initializer) { @@ -38529,7 +38846,7 @@ var ts; return true; } if (!declarationList.declarations.length) { - return grammarErrorAtPos(ts.getSourceFileOfNode(declarationList), declarations.pos, declarations.end - declarations.pos, ts.Diagnostics.Variable_declaration_list_cannot_be_empty); + return grammarErrorAtPos(declarationList, declarations.pos, declarations.end - declarations.pos, ts.Diagnostics.Variable_declaration_list_cannot_be_empty); } } function allowLetAndConstDeclarations(parent) { @@ -38575,7 +38892,8 @@ var ts; return true; } } - function grammarErrorAtPos(sourceFile, start, length, message, arg0, arg1, arg2) { + function grammarErrorAtPos(nodeForSourceFile, start, length, message, arg0, arg1, arg2) { + var sourceFile = ts.getSourceFileOfNode(nodeForSourceFile); if (!hasParseDiagnostics(sourceFile)) { diagnostics.add(ts.createFileDiagnostic(sourceFile, start, length, message, arg0, arg1, arg2)); return true; @@ -38590,7 +38908,7 @@ var ts; } function checkGrammarConstructorTypeParameters(node) { if (node.typeParameters) { - return grammarErrorAtPos(ts.getSourceFileOfNode(node), node.typeParameters.pos, node.typeParameters.end - node.typeParameters.pos, ts.Diagnostics.Type_parameters_cannot_appear_on_a_constructor_declaration); + return grammarErrorAtPos(node, node.typeParameters.pos, node.typeParameters.end - node.typeParameters.pos, ts.Diagnostics.Type_parameters_cannot_appear_on_a_constructor_declaration); } } function checkGrammarConstructorTypeAnnotation(node) { @@ -38632,7 +38950,7 @@ var ts; node.kind === 244 || node.kind === 243 || node.kind === 236 || - ts.getModifierFlags(node) & (2 | 1 | 512)) { + ts.hasModifier(node, 2 | 1 | 512)) { return false; } return grammarErrorOnFirstToken(node, ts.Diagnostics.A_declare_modifier_is_required_for_a_top_level_declaration_in_a_d_ts_file); @@ -41401,27 +41719,27 @@ var ts; function createExpressionForAccessorDeclaration(properties, property, receiver, multiLine) { var _a = ts.getAllAccessorDeclarations(properties, property), firstAccessor = _a.firstAccessor, getAccessor = _a.getAccessor, setAccessor = _a.setAccessor; if (property === firstAccessor) { - var properties_8 = []; + var properties_9 = []; if (getAccessor) { var getterFunction = ts.createFunctionExpression(getAccessor.modifiers, undefined, undefined, undefined, getAccessor.parameters, undefined, getAccessor.body); ts.setTextRange(getterFunction, getAccessor); ts.setOriginalNode(getterFunction, getAccessor); var getter = ts.createPropertyAssignment("get", getterFunction); - properties_8.push(getter); + properties_9.push(getter); } if (setAccessor) { var setterFunction = ts.createFunctionExpression(setAccessor.modifiers, undefined, undefined, undefined, setAccessor.parameters, undefined, setAccessor.body); ts.setTextRange(setterFunction, setAccessor); ts.setOriginalNode(setterFunction, setAccessor); var setter = ts.createPropertyAssignment("set", setterFunction); - properties_8.push(setter); + properties_9.push(setter); } - properties_8.push(ts.createPropertyAssignment("enumerable", ts.createTrue())); - properties_8.push(ts.createPropertyAssignment("configurable", ts.createTrue())); + properties_9.push(ts.createPropertyAssignment("enumerable", ts.createTrue())); + properties_9.push(ts.createPropertyAssignment("configurable", ts.createTrue())); var expression = ts.setTextRange(ts.createCall(ts.createPropertyAccess(ts.createIdentifier("Object"), "defineProperty"), undefined, [ receiver, createExpressionForPropertyName(property.name), - ts.createObjectLiteral(properties_8, multiLine) + ts.createObjectLiteral(properties_9, multiLine) ]), firstAccessor); return ts.aggregateTransformFlags(expression); } @@ -43361,7 +43679,8 @@ var ts; ? undefined : numElements, location), false, location); } - else if (numElements !== 1 && (flattenContext.level < 1 || numElements === 0)) { + else if (numElements !== 1 && (flattenContext.level < 1 || numElements === 0) + || ts.every(elements, ts.isOmittedExpression)) { var reuseIdentifierExpressions = !ts.isDeclarationBindingElement(parent) || numElements !== 0; value = ensureIdentifier(flattenContext, value, reuseIdentifierExpressions, location); } @@ -43568,7 +43887,12 @@ var ts; if (ts.hasModifier(node, 2)) { break; } - recordEmittedDeclarationInScope(node); + if (node.name) { + recordEmittedDeclarationInScope(node); + } + else { + ts.Debug.assert(node.kind === 229 || ts.hasModifier(node, 512)); + } break; } } @@ -43982,8 +44306,8 @@ var ts; && member.initializer !== undefined; } function addInitializedPropertyStatements(statements, properties, receiver) { - for (var _i = 0, properties_9 = properties; _i < properties_9.length; _i++) { - var property = properties_9[_i]; + for (var _i = 0, properties_10 = properties; _i < properties_10.length; _i++) { + var property = properties_10[_i]; var statement = ts.createStatement(transformInitializedProperty(property, receiver)); ts.setSourceMapRange(statement, ts.moveRangePastModifiers(property)); ts.setCommentRange(statement, property); @@ -43992,8 +44316,8 @@ var ts; } function generateInitializedPropertyExpressions(properties, receiver) { var expressions = []; - for (var _i = 0, properties_10 = properties; _i < properties_10.length; _i++) { - var property = properties_10[_i]; + for (var _i = 0, properties_11 = properties; _i < properties_11.length; _i++) { + var property = properties_11[_i]; var expression = transformInitializedProperty(property, receiver); expression.startsOnNewLine = true; ts.setSourceMapRange(expression, ts.moveRangePastModifiers(property)); @@ -44688,24 +45012,24 @@ var ts; && moduleKind !== ts.ModuleKind.System); } function recordEmittedDeclarationInScope(node) { - var name = node.symbol && node.symbol.escapedName; - if (name) { - if (!currentScopeFirstDeclarationsOfName) { - currentScopeFirstDeclarationsOfName = ts.createUnderscoreEscapedMap(); - } - if (!currentScopeFirstDeclarationsOfName.has(name)) { - currentScopeFirstDeclarationsOfName.set(name, node); - } + if (!currentScopeFirstDeclarationsOfName) { + currentScopeFirstDeclarationsOfName = ts.createUnderscoreEscapedMap(); + } + var name = declaredNameInScope(node); + if (!currentScopeFirstDeclarationsOfName.has(name)) { + currentScopeFirstDeclarationsOfName.set(name, node); } } function isFirstEmittedDeclarationInScope(node) { if (currentScopeFirstDeclarationsOfName) { - var name = node.symbol && node.symbol.escapedName; - if (name) { - return currentScopeFirstDeclarationsOfName.get(name) === node; - } + var name = declaredNameInScope(node); + return currentScopeFirstDeclarationsOfName.get(name) === node; } - return false; + return true; + } + function declaredNameInScope(node) { + ts.Debug.assertNode(node.name, ts.isIdentifier); + return node.name.escapedText; } function addVarForEnumOrModuleDeclaration(statements, node) { var statement = ts.createVariableStatement(ts.visitNodes(node.modifiers, modifierVisitor, ts.isModifier), ts.createVariableDeclarationList([ @@ -44736,7 +45060,7 @@ var ts; if (!shouldEmitModuleDeclaration(node)) { return ts.createNotEmittedStatement(node); } - ts.Debug.assert(ts.isIdentifier(node.name), "TypeScript module should have an Identifier name."); + ts.Debug.assertNode(node.name, ts.isIdentifier, "A TypeScript namespace should have an Identifier name."); enableSubstitutionForNamespaceExports(); var statements = []; var emitFlags = 2; @@ -45460,6 +45784,8 @@ var ts; return visitExpressionStatement(node); case 185: return visitParenthesizedExpression(node, noDestructuringValue); + case 260: + return visitCatchClause(node); default: return ts.visitEachChild(node, visitor, context); } @@ -45534,6 +45860,12 @@ var ts; function visitParenthesizedExpression(node, noDestructuringValue) { return ts.visitEachChild(node, noDestructuringValue ? visitorNoDestructuringValue : visitor, context); } + function visitCatchClause(node) { + if (!node.variableDeclaration) { + return ts.updateCatchClause(node, ts.createVariableDeclaration(ts.createTempVariable(undefined)), ts.visitNode(node.block, visitor, ts.isBlock)); + } + return ts.visitEachChild(node, visitor, context); + } function visitBinaryExpression(node, noDestructuringValue) { if (ts.isDestructuringAssignment(node) && node.left.transformFlags & 1048576) { return ts.flattenDestructuringAssignment(node, visitor, context, 1, !noDestructuringValue); @@ -45980,7 +46312,7 @@ var ts; objectProperties = ts.createAssignHelper(context, segments); } } - var element = ts.createExpressionForJsxElement(context.getEmitResolver().getJsxFactoryEntity(), compilerOptions.reactNamespace, tagName, objectProperties, ts.filter(ts.map(children, transformJsxChildToExpression), ts.isDefined), node, location); + var element = ts.createExpressionForJsxElement(context.getEmitResolver().getJsxFactoryEntity(), compilerOptions.reactNamespace, tagName, objectProperties, ts.mapDefined(children, transformJsxChildToExpression), node, location); if (isChild) { ts.startOnNewLine(element); } @@ -46567,7 +46899,7 @@ var ts; function shouldVisitNode(node) { return (node.transformFlags & 128) !== 0 || convertedLoopState !== undefined - || (hierarchyFacts & 4096 && ts.isStatement(node)) + || (hierarchyFacts & 4096 && (ts.isStatement(node) || (node.kind === 207))) || (ts.isIterationStatement(node, false) && shouldConvertIterationStatementBody(node)) || isTypeScriptClassWrapper(node); } @@ -46847,9 +47179,11 @@ var ts; var outer = ts.createPartiallyEmittedExpression(inner); outer.end = ts.skipTrivia(currentText, node.pos); ts.setEmitFlags(outer, 1536); - return ts.createParen(ts.createCall(outer, undefined, extendsClauseElement + var result = ts.createParen(ts.createCall(outer, undefined, extendsClauseElement ? [ts.visitNode(extendsClauseElement.expression, visitor, ts.isExpression)] : [])); + ts.addSyntheticLeadingComment(result, 3, "* @class "); + return result; } function transformClassBody(node, extendsClauseElement) { var statements = []; @@ -47434,11 +47768,12 @@ var ts; ts.setTextRange(declarationList, node); ts.setCommentRange(declarationList, node); if (node.transformFlags & 8388608 - && (ts.isBindingPattern(node.declarations[0].name) - || ts.isBindingPattern(ts.lastOrUndefined(node.declarations).name))) { + && (ts.isBindingPattern(node.declarations[0].name) || ts.isBindingPattern(ts.lastOrUndefined(node.declarations).name))) { var firstDeclaration = ts.firstOrUndefined(declarations); - var lastDeclaration = ts.lastOrUndefined(declarations); - ts.setSourceMapRange(declarationList, ts.createRange(firstDeclaration.pos, lastDeclaration.end)); + if (firstDeclaration) { + var lastDeclaration = ts.lastOrUndefined(declarations); + ts.setSourceMapRange(declarationList, ts.createRange(firstDeclaration.pos, lastDeclaration.end)); + } } return declarationList; } @@ -47977,6 +48312,7 @@ var ts; function visitCatchClause(node) { var ancestorFacts = enterSubtree(4032, 0); var updated; + ts.Debug.assert(!!node.variableDeclaration, "Catch clause variable should always be present when downleveling ES2015."); if (ts.isBindingPattern(node.variableDeclaration.name)) { var temp = ts.createTempVariable(undefined); var newVariableDeclaration = ts.createVariableDeclaration(temp); @@ -49224,8 +49560,12 @@ var ts; } function transformAndEmitContinueStatement(node) { var label = findContinueTarget(node.label ? ts.unescapeLeadingUnderscores(node.label.escapedText) : undefined); - ts.Debug.assert(label > 0, "Expected continue statment to point to a valid Label."); - emitBreak(label, node); + if (label > 0) { + emitBreak(label, node); + } + else { + emitStatement(node); + } } function visitContinueStatement(node) { if (inStatementContainingYield) { @@ -49238,8 +49578,12 @@ var ts; } function transformAndEmitBreakStatement(node) { var label = findBreakTarget(node.label ? ts.unescapeLeadingUnderscores(node.label.escapedText) : undefined); - ts.Debug.assert(label > 0, "Expected break statment to point to a valid Label."); - emitBreak(label, node); + if (label > 0) { + emitBreak(label, node); + } + else { + emitStatement(node); + } } function visitBreakStatement(node) { if (inStatementContainingYield) { @@ -49496,9 +49840,6 @@ var ts; var block = endBlock(); markLabel(block.endLabel); } - function isWithBlock(block) { - return block.kind === 1; - } function beginExceptionBlock() { var startLabel = defineLabel(); var endLabel = defineLabel(); @@ -49567,9 +49908,6 @@ var ts; emitNop(); exception.state = 3; } - function isExceptionBlock(block) { - return block.kind === 0; - } function beginScriptLoopBlock() { beginBlock({ kind: 3, @@ -49669,43 +50007,45 @@ var ts; return false; } function findBreakTarget(labelText) { - ts.Debug.assert(blocks !== undefined); - if (labelText) { - for (var i = blockStack.length - 1; i >= 0; i--) { - var block = blockStack[i]; - if (supportsLabeledBreakOrContinue(block) && block.labelText === labelText) { - return block.breakLabel; - } - else if (supportsUnlabeledBreak(block) && hasImmediateContainingLabeledBlock(labelText, i - 1)) { - return block.breakLabel; + if (blockStack) { + if (labelText) { + for (var i = blockStack.length - 1; i >= 0; i--) { + var block = blockStack[i]; + if (supportsLabeledBreakOrContinue(block) && block.labelText === labelText) { + return block.breakLabel; + } + else if (supportsUnlabeledBreak(block) && hasImmediateContainingLabeledBlock(labelText, i - 1)) { + return block.breakLabel; + } } } - } - else { - for (var i = blockStack.length - 1; i >= 0; i--) { - var block = blockStack[i]; - if (supportsUnlabeledBreak(block)) { - return block.breakLabel; + else { + for (var i = blockStack.length - 1; i >= 0; i--) { + var block = blockStack[i]; + if (supportsUnlabeledBreak(block)) { + return block.breakLabel; + } } } } return 0; } function findContinueTarget(labelText) { - ts.Debug.assert(blocks !== undefined); - if (labelText) { - for (var i = blockStack.length - 1; i >= 0; i--) { - var block = blockStack[i]; - if (supportsUnlabeledContinue(block) && hasImmediateContainingLabeledBlock(labelText, i - 1)) { - return block.continueLabel; + if (blockStack) { + if (labelText) { + for (var i = blockStack.length - 1; i >= 0; i--) { + var block = blockStack[i]; + if (supportsUnlabeledContinue(block) && hasImmediateContainingLabeledBlock(labelText, i - 1)) { + return block.continueLabel; + } } } - } - else { - for (var i = blockStack.length - 1; i >= 0; i--) { - var block = blockStack[i]; - if (supportsUnlabeledContinue(block)) { - return block.continueLabel; + else { + for (var i = blockStack.length - 1; i >= 0; i--) { + var block = blockStack[i]; + if (supportsUnlabeledContinue(block)) { + return block.continueLabel; + } } } } @@ -49733,7 +50073,7 @@ var ts; return literal; } function createInlineBreak(label, location) { - ts.Debug.assert(label > 0, "Invalid label: " + label); + ts.Debug.assertLessThan(0, label, "Invalid label"); return ts.setTextRange(ts.createReturn(ts.createArrayLiteral([ createInstruction(3), createLabel(label) @@ -49941,31 +50281,33 @@ var ts; for (; blockIndex < blockActions.length && blockOffsets[blockIndex] <= operationIndex; blockIndex++) { var block = blocks[blockIndex]; var blockAction = blockActions[blockIndex]; - if (isExceptionBlock(block)) { - if (blockAction === 0) { - if (!exceptionBlockStack) { - exceptionBlockStack = []; + switch (block.kind) { + case 0: + if (blockAction === 0) { + if (!exceptionBlockStack) { + exceptionBlockStack = []; + } + if (!statements) { + statements = []; + } + exceptionBlockStack.push(currentExceptionBlock); + currentExceptionBlock = block; } - if (!statements) { - statements = []; + else if (blockAction === 1) { + currentExceptionBlock = exceptionBlockStack.pop(); } - exceptionBlockStack.push(currentExceptionBlock); - currentExceptionBlock = block; - } - else if (blockAction === 1) { - currentExceptionBlock = exceptionBlockStack.pop(); - } - } - else if (isWithBlock(block)) { - if (blockAction === 0) { - if (!withBlockStack) { - withBlockStack = []; + break; + case 1: + if (blockAction === 0) { + if (!withBlockStack) { + withBlockStack = []; + } + withBlockStack.push(block); } - withBlockStack.push(block); - } - else if (blockAction === 1) { - withBlockStack.pop(); - } + else if (blockAction === 1) { + withBlockStack.pop(); + } + break; } } } @@ -52275,7 +52617,6 @@ var ts; errorNameNode = declaration.name; var format = 4 | 16384 | - 2048 | (shouldUseResolverType ? 8192 : 0); resolver.writeTypeOfDeclaration(declaration, enclosingDeclaration, format, writer); errorNameNode = undefined; @@ -52289,7 +52630,7 @@ var ts; } else { errorNameNode = signature.name; - resolver.writeReturnTypeOfSignatureDeclaration(signature, enclosingDeclaration, 4 | 2048 | 16384, writer); + resolver.writeReturnTypeOfSignatureDeclaration(signature, enclosingDeclaration, 4 | 16384, writer); errorNameNode = undefined; } } @@ -52519,7 +52860,7 @@ var ts; write(tempVarName); write(": "); writer.getSymbolAccessibilityDiagnostic = function () { return diagnostic; }; - resolver.writeTypeOfExpression(expr, enclosingDeclaration, 4 | 2048 | 16384, writer); + resolver.writeTypeOfExpression(expr, enclosingDeclaration, 4 | 16384, writer); write(";"); writeLine(); return tempVarName; @@ -53156,6 +53497,9 @@ var ts; return ts.forEach(node.declarationList.declarations, function (varDeclaration) { return resolver.isDeclarationVisible(varDeclaration); }); } function writeVariableStatement(node) { + if (ts.every(node.declarationList && node.declarationList.declarations, function (decl) { return decl.name && ts.isEmptyBindingPattern(decl.name); })) { + return; + } emitJsDocComments(node); emitModuleElementDeclarationFlags(node); if (ts.isLet(node.declarationList)) { @@ -54121,14 +54465,14 @@ var ts; writer.writeLine(); } } - function emitTrailingCommentsOfPosition(pos) { + function emitTrailingCommentsOfPosition(pos, prefixSpace) { if (disabled) { return; } if (extendedDiagnostics) { ts.performance.mark("beforeEmitTrailingCommentsOfPosition"); } - forEachTrailingCommentToEmit(pos, emitTrailingCommentOfPosition); + forEachTrailingCommentToEmit(pos, prefixSpace ? emitTrailingComment : emitTrailingCommentOfPosition); if (extendedDiagnostics) { ts.performance.measure("commentTime", "beforeEmitTrailingCommentsOfPosition"); } @@ -54208,15 +54552,7 @@ var ts; emitPos(commentEnd); } function isTripleSlashComment(commentPos, commentEnd) { - if (currentText.charCodeAt(commentPos + 1) === 47 && - commentPos + 2 < commentEnd && - currentText.charCodeAt(commentPos + 2) === 47) { - var textSubStr = currentText.substring(commentPos, commentEnd); - return textSubStr.match(ts.fullTripleSlashReferencePathRegEx) || - textSubStr.match(ts.fullTripleSlashAMDReferencePathRegEx) ? - true : false; - } - return false; + return ts.isRecognizedTripleSlashComment(currentText, commentPos, commentEnd); } } ts.createCommentWriter = createCommentWriter; @@ -55155,7 +55491,9 @@ var ts; if (!(ts.getEmitFlags(node) & 131072)) { var dotRangeStart = node.expression.end; var dotRangeEnd = ts.skipTrivia(currentSourceFile.text, node.expression.end) + 1; - var dotToken = { kind: 23, pos: dotRangeStart, end: dotRangeEnd }; + var dotToken = ts.createToken(23); + dotToken.pos = dotRangeStart; + dotToken.end = dotRangeEnd; indentBeforeDot = needsIndentation(node, node.expression, dotToken); indentAfterDot = needsIndentation(node, dotToken, node.name); } @@ -55267,7 +55605,9 @@ var ts; var indentAfterOperator = needsIndentation(node, node.operatorToken, node.right); emitExpression(node.left); increaseIndentIf(indentBeforeOperator, isCommaOperator ? " " : undefined); + emitLeadingCommentsOfPosition(node.operatorToken.pos); writeTokenNode(node.operatorToken); + emitTrailingCommentsOfPosition(node.operatorToken.end, true); increaseIndentIf(indentAfterOperator, " "); emitExpression(node.right); decreaseIndentIf(indentBeforeOperator, indentAfterOperator); @@ -55454,8 +55794,19 @@ var ts; emitWithPrefix(" ", node.label); write(";"); } + function emitTokenWithComment(token, pos, contextNode) { + var node = contextNode && ts.getParseTreeNode(contextNode); + if (node && node.kind === contextNode.kind) { + pos = ts.skipTrivia(currentSourceFile.text, pos); + } + pos = writeToken(token, pos, contextNode); + if (node && node.kind === contextNode.kind) { + emitTrailingCommentsOfPosition(pos, true); + } + return pos; + } function emitReturnStatement(node) { - writeToken(96, node.pos, node); + emitTokenWithComment(96, node.pos, node); emitExpressionWithPrefix(" ", node.expression); write(";"); } @@ -55896,10 +56247,12 @@ var ts; function emitCatchClause(node) { var openParenPos = writeToken(74, node.pos); write(" "); - writeToken(19, openParenPos); - emit(node.variableDeclaration); - writeToken(20, node.variableDeclaration ? node.variableDeclaration.end : openParenPos); - write(" "); + if (node.variableDeclaration) { + writeToken(19, openParenPos); + emit(node.variableDeclaration); + writeToken(20, node.variableDeclaration.end); + write(" "); + } emit(node.block); } function emitPropertyAssignment(node) { @@ -57011,6 +57364,9 @@ var ts; var loader_2 = function (typesRef, containingFile) { return ts.resolveTypeReferenceDirective(typesRef, containingFile, options, host).resolvedTypeReferenceDirective; }; resolveTypeReferenceDirectiveNamesWorker = function (typeReferenceDirectiveNames, containingFile) { return loadWithLocalCache(checkAllDefined(typeReferenceDirectiveNames), containingFile, loader_2); }; } + var packageIdToSourceFile = ts.createMap(); + var sourceFileToPackageName = ts.createMap(); + var redirectTargetsSet = ts.createMap(); var filesByName = ts.createMap(); var filesByNameIgnoreCase = host.useCaseSensitiveFileNames() ? ts.createMap() : undefined; var structuralIsReused = tryReuseStructureFromOldProgram(); @@ -57067,6 +57423,8 @@ var ts; isSourceFileFromExternalLibrary: isSourceFileFromExternalLibrary, dropDiagnosticsProducingTypeChecker: dropDiagnosticsProducingTypeChecker, getSourceFileFromReference: getSourceFileFromReference, + sourceFileToPackageName: sourceFileToPackageName, + redirectTargetsSet: redirectTargetsSet, }; verifyCompilerOptions(); ts.performance.mark("afterProgram"); @@ -57210,17 +57568,51 @@ var ts; var filePaths = []; var modifiedSourceFiles = []; oldProgram.structureIsReused = 2; - for (var _i = 0, _a = oldProgram.getSourceFiles(); _i < _a.length; _i++) { - var oldSourceFile = _a[_i]; + var oldSourceFiles = oldProgram.getSourceFiles(); + var SeenPackageName; + (function (SeenPackageName) { + SeenPackageName[SeenPackageName["Exists"] = 0] = "Exists"; + SeenPackageName[SeenPackageName["Modified"] = 1] = "Modified"; + })(SeenPackageName || (SeenPackageName = {})); + var seenPackageNames = ts.createMap(); + for (var _i = 0, oldSourceFiles_1 = oldSourceFiles; _i < oldSourceFiles_1.length; _i++) { + var oldSourceFile = oldSourceFiles_1[_i]; var newSourceFile = host.getSourceFileByPath ? host.getSourceFileByPath(oldSourceFile.fileName, oldSourceFile.path, options.target) : host.getSourceFile(oldSourceFile.fileName, options.target); if (!newSourceFile) { return oldProgram.structureIsReused = 0; } + ts.Debug.assert(!newSourceFile.redirectInfo, "Host should not return a redirect source file from `getSourceFile`"); + var fileChanged = void 0; + if (oldSourceFile.redirectInfo) { + if (newSourceFile !== oldSourceFile.redirectInfo.unredirected) { + return oldProgram.structureIsReused = 0; + } + fileChanged = false; + newSourceFile = oldSourceFile; + } + else if (oldProgram.redirectTargetsSet.has(oldSourceFile.path)) { + if (newSourceFile !== oldSourceFile) { + return oldProgram.structureIsReused = 0; + } + fileChanged = false; + } + else { + fileChanged = newSourceFile !== oldSourceFile; + } newSourceFile.path = oldSourceFile.path; filePaths.push(newSourceFile.path); - if (oldSourceFile !== newSourceFile) { + var packageName = oldProgram.sourceFileToPackageName.get(oldSourceFile.path); + if (packageName !== undefined) { + var prevKind = seenPackageNames.get(packageName); + var newKind = fileChanged ? 1 : 0; + if ((prevKind !== undefined && newKind === 1) || prevKind === 1) { + return oldProgram.structureIsReused = 0; + } + seenPackageNames.set(packageName, newKind); + } + if (fileChanged) { if (oldSourceFile.hasNoDefaultLib !== newSourceFile.hasNoDefaultLib) { oldProgram.structureIsReused = 1; } @@ -57248,8 +57640,8 @@ var ts; return oldProgram.structureIsReused; } modifiedFilePaths = modifiedSourceFiles.map(function (f) { return f.newFile.path; }); - for (var _b = 0, modifiedSourceFiles_1 = modifiedSourceFiles; _b < modifiedSourceFiles_1.length; _b++) { - var _c = modifiedSourceFiles_1[_b], oldSourceFile = _c.oldFile, newSourceFile = _c.newFile; + for (var _a = 0, modifiedSourceFiles_1 = modifiedSourceFiles; _a < modifiedSourceFiles_1.length; _a++) { + var _b = modifiedSourceFiles_1[_a], oldSourceFile = _b.oldFile, newSourceFile = _b.newFile; var newSourceFilePath = ts.getNormalizedAbsolutePath(newSourceFile.fileName, currentDirectory); if (resolveModuleNamesWorker) { var moduleNames = ts.map(ts.concatenate(newSourceFile.imports, newSourceFile.moduleAugmentations), getTextOfLiteral); @@ -57283,8 +57675,8 @@ var ts; if (oldProgram.getMissingFilePaths().some(function (missingFilePath) { return host.fileExists(missingFilePath); })) { return oldProgram.structureIsReused = 1; } - for (var _d = 0, _e = oldProgram.getMissingFilePaths(); _d < _e.length; _d++) { - var p = _e[_d]; + for (var _c = 0, _d = oldProgram.getMissingFilePaths(); _c < _d.length; _c++) { + var p = _d[_c]; filesByName.set(p, undefined); } for (var i = 0; i < newSourceFiles.length; i++) { @@ -57292,11 +57684,13 @@ var ts; } files = newSourceFiles; fileProcessingDiagnostics = oldProgram.getFileProcessingDiagnostics(); - for (var _f = 0, modifiedSourceFiles_2 = modifiedSourceFiles; _f < modifiedSourceFiles_2.length; _f++) { - var modifiedFile = modifiedSourceFiles_2[_f]; + for (var _e = 0, modifiedSourceFiles_2 = modifiedSourceFiles; _e < modifiedSourceFiles_2.length; _e++) { + var modifiedFile = modifiedSourceFiles_2[_e]; fileProcessingDiagnostics.reattachFileDiagnostics(modifiedFile.newFile); } resolvedTypeReferenceDirectives = oldProgram.getResolvedTypeReferenceDirectives(); + sourceFileToPackageName = oldProgram.sourceFileToPackageName; + redirectTargetsSet = oldProgram.redirectTargetsSet; return oldProgram.structureIsReused = 2; } function getEmitHost(writeFileCallback) { @@ -57775,7 +58169,7 @@ var ts; } } function processSourceFile(fileName, isDefaultLib, refFile, refPos, refEnd) { - getSourceFileFromReferenceWorker(fileName, function (fileName) { return findSourceFile(fileName, toPath(fileName), isDefaultLib, refFile, refPos, refEnd); }, function (diagnostic) { + getSourceFileFromReferenceWorker(fileName, function (fileName) { return findSourceFile(fileName, toPath(fileName), isDefaultLib, refFile, refPos, refEnd, undefined); }, function (diagnostic) { var args = []; for (var _i = 1; _i < arguments.length; _i++) { args[_i - 1] = arguments[_i]; @@ -57792,7 +58186,24 @@ var ts; fileProcessingDiagnostics.add(ts.createCompilerDiagnostic(ts.Diagnostics.File_name_0_differs_from_already_included_file_name_1_only_in_casing, fileName, existingFileName)); } } - function findSourceFile(fileName, path, isDefaultLib, refFile, refPos, refEnd) { + function createRedirectSourceFile(redirectTarget, unredirected, fileName, path) { + var redirect = Object.create(redirectTarget); + redirect.fileName = fileName; + redirect.path = path; + redirect.redirectInfo = { redirectTarget: redirectTarget, unredirected: unredirected }; + Object.defineProperties(redirect, { + id: { + get: function () { return this.redirectInfo.redirectTarget.id; }, + set: function (value) { this.redirectInfo.redirectTarget.id = value; }, + }, + symbol: { + get: function () { return this.redirectInfo.redirectTarget.symbol; }, + set: function (value) { this.redirectInfo.redirectTarget.symbol = value; }, + }, + }); + return redirect; + } + function findSourceFile(fileName, path, isDefaultLib, refFile, refPos, refEnd, packageId) { if (filesByName.has(path)) { var file_1 = filesByName.get(path); if (file_1 && options.forceConsistentCasingInFileNames && ts.getNormalizedAbsolutePath(file_1.fileName, currentDirectory) !== ts.getNormalizedAbsolutePath(fileName, currentDirectory)) { @@ -57823,6 +58234,22 @@ var ts; fileProcessingDiagnostics.add(ts.createCompilerDiagnostic(ts.Diagnostics.Cannot_read_file_0_Colon_1, fileName, hostErrorMessage)); } }); + if (packageId) { + var packageIdKey = packageId.name + "@" + packageId.version; + var fileFromPackageId = packageIdToSourceFile.get(packageIdKey); + if (fileFromPackageId) { + var dupFile = createRedirectSourceFile(fileFromPackageId, file, fileName, path); + redirectTargetsSet.set(fileFromPackageId.path, true); + filesByName.set(path, dupFile); + sourceFileToPackageName.set(path, packageId.name); + files.push(dupFile); + return dupFile; + } + else if (file) { + packageIdToSourceFile.set(packageIdKey, file); + sourceFileToPackageName.set(path, packageId.name); + } + } filesByName.set(path, file); if (file) { sourceFilesFoundSearchingNodeModules.set(path, currentNodeModulesDepth > 0); @@ -57944,7 +58371,7 @@ var ts; else if (shouldAddFile) { var path = toPath(resolvedFileName); var pos = ts.skipTrivia(file.text, file.imports[i].pos); - findSourceFile(resolvedFileName, path, false, file, pos, file.imports[i].end); + findSourceFile(resolvedFileName, path, false, file, pos, file.imports[i].end, resolution.packageId); } if (isFromNodeModulesSearch) { currentNodeModulesDepth--; @@ -58623,6 +59050,12 @@ var ts; category: ts.Diagnostics.Module_Resolution_Options, description: ts.Diagnostics.Allow_default_imports_from_modules_with_no_default_export_This_does_not_affect_code_emit_just_typechecking }, + { + name: "preserveSymlinks", + type: "boolean", + category: ts.Diagnostics.Module_Resolution_Options, + description: ts.Diagnostics.Do_not_resolve_the_real_path_of_symlinks, + }, { name: "sourceRoot", type: "string", @@ -59234,7 +59667,7 @@ var ts; var text = valueExpression.text; if (option && typeof option.type !== "string") { var customOption = option; - if (!customOption.type.has(text)) { + if (!customOption.type.has(text.toLowerCase())) { errors.push(createDiagnosticForInvalidCustomType(customOption, function (message, arg0, arg1) { return ts.createDiagnosticForNodeInSourceFile(sourceFile, valueExpression, message, arg0, arg1); })); } } @@ -59485,12 +59918,10 @@ var ts; } } else { - var specs = includeSpecs ? [] : ["node_modules", "bower_components", "jspm_packages"]; var outDir = raw["compilerOptions"] && raw["compilerOptions"]["outDir"]; if (outDir) { - specs.push(outDir); + excludeSpecs = [outDir]; } - excludeSpecs = specs; } if (fileNames === undefined && includeSpecs === undefined) { includeSpecs = ["**/*"]; @@ -59741,7 +60172,7 @@ var ts; return value; } else if (typeof option.type !== "string") { - return option.type.get(value); + return option.type.get(typeof value === "string" ? value.toLowerCase() : value); } return normalizeNonListOptionValue(option, basePath, value); } @@ -59816,23 +60247,13 @@ var ts; }; } function validateSpecs(specs, errors, allowTrailingRecursion, jsonSourceFile, specKey) { - var validSpecs = []; - for (var _i = 0, specs_1 = specs; _i < specs_1.length; _i++) { - var spec = specs_1[_i]; - if (!allowTrailingRecursion && invalidTrailingRecursionPattern.test(spec)) { - errors.push(createDiagnostic(ts.Diagnostics.File_specification_cannot_end_in_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0, spec)); - } - else if (invalidMultipleRecursionPatterns.test(spec)) { - errors.push(createDiagnostic(ts.Diagnostics.File_specification_cannot_contain_multiple_recursive_directory_wildcards_Asterisk_Asterisk_Colon_0, spec)); - } - else if (invalidDotDotAfterRecursiveWildcardPattern.test(spec)) { - errors.push(createDiagnostic(ts.Diagnostics.File_specification_cannot_contain_a_parent_directory_that_appears_after_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0, spec)); - } - else { - validSpecs.push(spec); + return specs.filter(function (spec) { + var diag = specToDiagnostic(spec, allowTrailingRecursion); + if (diag !== undefined) { + errors.push(createDiagnostic(diag, spec)); } - } - return validSpecs; + return diag === undefined; + }); function createDiagnostic(message, spec) { if (jsonSourceFile && jsonSourceFile.jsonObject) { for (var _i = 0, _a = ts.getPropertyAssignment(jsonSourceFile.jsonObject, specKey); _i < _a.length; _i++) { @@ -59850,6 +60271,17 @@ var ts; return ts.createCompilerDiagnostic(message, spec); } } + function specToDiagnostic(spec, allowTrailingRecursion) { + if (!allowTrailingRecursion && invalidTrailingRecursionPattern.test(spec)) { + return ts.Diagnostics.File_specification_cannot_end_in_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0; + } + else if (invalidMultipleRecursionPatterns.test(spec)) { + return ts.Diagnostics.File_specification_cannot_contain_multiple_recursive_directory_wildcards_Asterisk_Asterisk_Colon_0; + } + else if (invalidDotDotAfterRecursiveWildcardPattern.test(spec)) { + return ts.Diagnostics.File_specification_cannot_contain_a_parent_directory_that_appears_after_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0; + } + } function getWildcardDirectories(include, exclude, path, useCaseSensitiveFileNames) { var rawExcludeRegex = ts.getRegularExpressionForWildcard(exclude, path, "exclude"); var excludeRegex = rawExcludeRegex && new RegExp(rawExcludeRegex, useCaseSensitiveFileNames ? "" : "i"); @@ -60758,7 +61190,9 @@ var ts; } ts.findNextToken = findNextToken; function findPrecedingToken(position, sourceFile, startNode, includeJsDoc) { - return find(startNode || sourceFile); + var result = find(startNode || sourceFile); + ts.Debug.assert(!(result && isWhiteSpaceOnlyJsxText(result))); + return result; function findRightmostToken(n) { if (ts.isToken(n)) { return n; @@ -60774,10 +61208,11 @@ var ts; var children = n.getChildren(); for (var i = 0; i < children.length; i++) { var child = children[i]; - if (position < child.end && (nodeHasTokens(child) || child.kind === 10)) { + if (position < child.end) { var start = child.getStart(sourceFile, includeJsDoc); var lookInPreviousChild = (start >= position) || - (child.kind === 10 && start === child.end); + !nodeHasTokens(child) || + isWhiteSpaceOnlyJsxText(child); if (lookInPreviousChild) { var candidate = findRightmostChildNodeWithTokens(children, i); return candidate && findRightmostToken(candidate); @@ -60795,7 +61230,11 @@ var ts; } function findRightmostChildNodeWithTokens(children, exclusiveStartPosition) { for (var i = exclusiveStartPosition - 1; i >= 0; i--) { - if (nodeHasTokens(children[i])) { + var child = children[i]; + if (isWhiteSpaceOnlyJsxText(child)) { + ts.Debug.assert(i > 0, "`JsxText` tokens should not be the first child of `JsxElement | JsxSelfClosingElement`"); + } + else if (nodeHasTokens(children[i])) { return children[i]; } } @@ -60840,34 +61279,19 @@ var ts; return false; } ts.isInsideJsxElementOrAttribute = isInsideJsxElementOrAttribute; + function isWhiteSpaceOnlyJsxText(node) { + return ts.isJsxText(node) && node.containsOnlyWhiteSpaces; + } + ts.isWhiteSpaceOnlyJsxText = isWhiteSpaceOnlyJsxText; function isInTemplateString(sourceFile, position) { var token = getTokenAtPosition(sourceFile, position, false); return ts.isTemplateLiteralKind(token.kind) && position > token.getStart(sourceFile); } ts.isInTemplateString = isInTemplateString; function isInComment(sourceFile, position, tokenAtPosition, predicate) { - if (tokenAtPosition === void 0) { tokenAtPosition = getTokenAtPosition(sourceFile, position, false); } - return position <= tokenAtPosition.getStart(sourceFile) && - (isInCommentRange(ts.getLeadingCommentRanges(sourceFile.text, tokenAtPosition.pos)) || - isInCommentRange(ts.getTrailingCommentRanges(sourceFile.text, tokenAtPosition.pos))); - function isInCommentRange(commentRanges) { - return ts.forEach(commentRanges, function (c) { return isPositionInCommentRange(c, position, sourceFile.text) && (!predicate || predicate(c)); }); - } + return !!ts.formatting.getRangeOfEnclosingComment(sourceFile, position, false, undefined, tokenAtPosition, predicate); } ts.isInComment = isInComment; - function isPositionInCommentRange(_a, position, text) { - var pos = _a.pos, end = _a.end, kind = _a.kind; - if (pos < position && position < end) { - return true; - } - else if (position === end) { - return kind === 2 || - !(text.charCodeAt(end - 1) === 47 && text.charCodeAt(end - 2) === 42); - } - else { - return false; - } - } function hasDocComment(sourceFile, position) { var token = getTokenAtPosition(sourceFile, position, false); var commentRanges = ts.getLeadingCommentRanges(sourceFile.text, token.pos); @@ -61220,6 +61644,7 @@ var ts; } ts.symbolToDisplayParts = symbolToDisplayParts; function signatureToDisplayParts(typechecker, signature, enclosingDeclaration, flags) { + flags |= 65536; return mapToDisplayParts(function (writer) { typechecker.getSymbolDisplayBuilder().buildSignatureDisplay(signature, writer, enclosingDeclaration, flags); }); @@ -61925,11 +62350,11 @@ var ts; templateStack.pop(); } else { - ts.Debug.assert(token === 15, "Should have been a template middle. Was " + token); + ts.Debug.assertEqual(token, 15, "Should have been a template middle."); } } else { - ts.Debug.assert(lastTemplateStackToken === 17, "Should have been an open brace. Was: " + token); + ts.Debug.assertEqual(lastTemplateStackToken, 17, "Should have been an open brace"); templateStack.pop(); } } @@ -63587,7 +64012,7 @@ var ts; var typeForObject = typeChecker.getTypeAtLocation(objectLikeContainer); if (!typeForObject) return false; - typeMembers = typeChecker.getPropertiesOfType(typeForObject); + typeMembers = typeChecker.getPropertiesOfType(typeForObject).filter(function (symbol) { return !(ts.getDeclarationModifierFlagsFromSymbol(symbol) & 24); }); existingMembers = objectLikeContainer.elements; } } @@ -63964,8 +64389,8 @@ var ts; addPropertySymbols(implementingTypeSymbols, 24); return result; function addPropertySymbols(properties, inValidModifierFlags) { - for (var _i = 0, properties_11 = properties; _i < properties_11.length; _i++) { - var property = properties_11[_i]; + for (var _i = 0, properties_12 = properties; _i < properties_12.length; _i++) { + var property = properties_12[_i]; if (isValidProperty(property, inValidModifierFlags)) { result.push(property); } @@ -65655,11 +66080,15 @@ var ts; } function getPropertySymbolOfObjectBindingPatternWithoutPropertyName(symbol, checker) { var bindingElement = getObjectBindingElementWithoutPropertyName(symbol); - if (bindingElement) { - var typeOfPattern = checker.getTypeAtLocation(bindingElement.parent); - return typeOfPattern && checker.getPropertyOfType(typeOfPattern, bindingElement.name.text); + if (!bindingElement) + return undefined; + var typeOfPattern = checker.getTypeAtLocation(bindingElement.parent); + var propSymbol = typeOfPattern && checker.getPropertyOfType(typeOfPattern, bindingElement.name.text); + if (propSymbol && propSymbol.flags & 98304) { + ts.Debug.assert(!!(propSymbol.flags & 33554432)); + return propSymbol.target; } - return undefined; + return propSymbol; } function getSymbolScope(symbol) { var declarations = symbol.declarations, flags = symbol.flags, parent = symbol.parent, valueDeclaration = symbol.valueDeclaration; @@ -65679,12 +66108,13 @@ var ts; if (getObjectBindingElementWithoutPropertyName(symbol)) { return undefined; } - if (parent && !((parent.flags & 1536) && ts.isExternalModuleSymbol(parent) && !parent.globalExports)) { + var exposedByParent = parent && !(symbol.flags & 262144); + if (exposedByParent && !((parent.flags & 1536) && ts.isExternalModuleSymbol(parent) && !parent.globalExports)) { return undefined; } var scope; - for (var _i = 0, declarations_10 = declarations; _i < declarations_10.length; _i++) { - var declaration = declarations_10[_i]; + for (var _i = 0, declarations_9 = declarations; _i < declarations_9.length; _i++) { + var declaration = declarations_9[_i]; var container = ts.getContainerNode(declaration); if (scope && scope !== container) { return undefined; @@ -65694,7 +66124,7 @@ var ts; } scope = container; } - return parent ? scope.getSourceFile() : scope; + return exposedByParent ? scope.getSourceFile() : scope; } function getPossibleSymbolReferencePositions(sourceFile, symbolName, container) { if (container === void 0) { container = sourceFile; } @@ -66371,8 +66801,8 @@ var ts; var lastIterationMeaning = void 0; do { lastIterationMeaning = meaning; - for (var _i = 0, declarations_11 = declarations; _i < declarations_11.length; _i++) { - var declaration = declarations_11[_i]; + for (var _i = 0, declarations_10 = declarations; _i < declarations_10.length; _i++) { + var declaration = declarations_10[_i]; var declarationMeaning = ts.getMeaningFromDeclaration(declaration); if (declarationMeaning & meaning) { meaning |= declarationMeaning; @@ -66517,6 +66947,16 @@ var ts; var shorthandContainerName_1 = typeChecker.symbolToString(symbol.parent, node); return ts.map(shorthandDeclarations, function (declaration) { return createDefinitionInfo(declaration, shorthandSymbolKind_1, shorthandSymbolName_1, shorthandContainerName_1); }); } + if (ts.isPropertyName(node) && ts.isBindingElement(node.parent) && ts.isObjectBindingPattern(node.parent.parent) && + (node === (node.parent.propertyName || node.parent.name))) { + var type = typeChecker.getTypeAtLocation(node.parent.parent); + if (type) { + var propSymbols = ts.getPropertySymbolsFromType(type, node); + if (propSymbols) { + return ts.flatMap(propSymbols, function (propSymbol) { return getDefinitionFromSymbol(typeChecker, propSymbol, node); }); + } + } + } var element = ts.getContainingObjectLiteralElement(node); if (element && typeChecker.getContextualType(element.parent)) { return ts.flatMap(ts.getPropertySymbolsFromContextualType(typeChecker, element), function (propertySymbol) { @@ -66933,12 +67373,20 @@ var ts; "crypto", "stream", "util", "assert", "tty", "domain", "constants", "process", "v8", "timers", "console" ]; - var nodeCoreModules = ts.arrayToMap(JsTyping.nodeCoreModuleList, function (x) { return x; }); + var nodeCoreModules = ts.arrayToSet(JsTyping.nodeCoreModuleList); function loadSafeList(host, safeListPath) { var result = ts.readConfigFile(safeListPath, function (path) { return host.readFile(path); }); return ts.createMapFromTemplate(result.config); } JsTyping.loadSafeList = loadSafeList; + function loadTypesMap(host, typesMapPath) { + var result = ts.readConfigFile(typesMapPath, function (path) { return host.readFile(path); }); + if (result.config) { + return ts.createMapFromTemplate(result.config.simpleMap); + } + return undefined; + } + JsTyping.loadTypesMap = loadTypesMap; function discoverTypings(host, log, fileNames, projectRootPath, safeList, packageNameToTypingLocation, typeAcquisition, unresolvedImports) { if (!typeAcquisition || !typeAcquisition.enable) { return { cachedTypingPaths: [], newTypingNames: [], filesToWatch: [] }; @@ -67093,8 +67541,8 @@ var ts; if (!matches) { return; } - for (var _i = 0, declarations_12 = declarations; _i < declarations_12.length; _i++) { - var declaration = declarations_12[_i]; + for (var _i = 0, declarations_11 = declarations; _i < declarations_11.length; _i++) { + var declaration = declarations_11[_i]; if (patternMatcher.patternContainsDots) { var containers = getContainers(declaration); if (!containers) { @@ -67753,13 +68201,17 @@ var ts; (function (ts) { var OutliningElementsCollector; (function (OutliningElementsCollector) { + var collapseText = "..."; + var maxDepth = 20; function collectElements(sourceFile, cancellationToken) { var elements = []; - var collapseText = "..."; - function addOutliningSpan(hintSpanNode, startElement, endElement, autoCollapse) { + var depth = 0; + walk(sourceFile); + return elements; + function addOutliningSpan(hintSpanNode, startElement, endElement, autoCollapse, useFullStart) { if (hintSpanNode && startElement && endElement) { var span_13 = { - textSpan: ts.createTextSpanFromBounds(startElement.pos, endElement.end), + textSpan: ts.createTextSpanFromBounds(useFullStart ? startElement.getFullStart() : startElement.getStart(), endElement.getEnd()), hintSpan: ts.createTextSpanFromNode(hintSpanNode, sourceFile), bannerText: collapseText, autoCollapse: autoCollapse, @@ -67820,8 +68272,6 @@ var ts; function autoCollapse(node) { return ts.isFunctionBlock(node) && node.parent.kind !== 187; } - var depth = 0; - var maxDepth = 20; function walk(n) { cancellationToken.throwIfCancellationRequested(); if (depth > maxDepth) { @@ -67834,8 +68284,8 @@ var ts; case 207: if (!ts.isFunctionBlock(n)) { var parent = n.parent; - var openBrace = ts.findChildOfKind(n, 17, sourceFile); - var closeBrace = ts.findChildOfKind(n, 18, sourceFile); + var openBrace_1 = ts.findChildOfKind(n, 17, sourceFile); + var closeBrace_1 = ts.findChildOfKind(n, 18, sourceFile); if (parent.kind === 212 || parent.kind === 215 || parent.kind === 216 || @@ -67844,19 +68294,19 @@ var ts; parent.kind === 213 || parent.kind === 220 || parent.kind === 260) { - addOutliningSpan(parent, openBrace, closeBrace, autoCollapse(n)); + addOutliningSpan(parent, openBrace_1, closeBrace_1, autoCollapse(n), true); break; } if (parent.kind === 224) { var tryStatement = parent; if (tryStatement.tryBlock === n) { - addOutliningSpan(parent, openBrace, closeBrace, autoCollapse(n)); + addOutliningSpan(parent, openBrace_1, closeBrace_1, autoCollapse(n), true); break; } else if (tryStatement.finallyBlock === n) { var finallyKeyword = ts.findChildOfKind(tryStatement, 87, sourceFile); if (finallyKeyword) { - addOutliningSpan(finallyKeyword, openBrace, closeBrace, autoCollapse(n)); + addOutliningSpan(finallyKeyword, openBrace_1, closeBrace_1, autoCollapse(n), true); break; } } @@ -67871,33 +68321,35 @@ var ts; break; } case 234: { - var openBrace = ts.findChildOfKind(n, 17, sourceFile); - var closeBrace = ts.findChildOfKind(n, 18, sourceFile); - addOutliningSpan(n.parent, openBrace, closeBrace, autoCollapse(n)); + var openBrace_2 = ts.findChildOfKind(n, 17, sourceFile); + var closeBrace_2 = ts.findChildOfKind(n, 18, sourceFile); + addOutliningSpan(n.parent, openBrace_2, closeBrace_2, autoCollapse(n), true); break; } case 229: case 230: case 232: - case 178: case 235: { + var openBrace_3 = ts.findChildOfKind(n, 17, sourceFile); + var closeBrace_3 = ts.findChildOfKind(n, 18, sourceFile); + addOutliningSpan(n, openBrace_3, closeBrace_3, autoCollapse(n), true); + break; + } + case 178: var openBrace = ts.findChildOfKind(n, 17, sourceFile); var closeBrace = ts.findChildOfKind(n, 18, sourceFile); - addOutliningSpan(n, openBrace, closeBrace, autoCollapse(n)); + addOutliningSpan(n, openBrace, closeBrace, autoCollapse(n), !ts.isArrayLiteralExpression(n.parent)); break; - } case 177: var openBracket = ts.findChildOfKind(n, 21, sourceFile); var closeBracket = ts.findChildOfKind(n, 22, sourceFile); - addOutliningSpan(n, openBracket, closeBracket, autoCollapse(n)); + addOutliningSpan(n, openBracket, closeBracket, autoCollapse(n), !ts.isArrayLiteralExpression(n.parent)); break; } depth++; ts.forEachChild(n, walk); depth--; } - walk(sourceFile); - return elements; } OutliningElementsCollector.collectElements = collectElements; })(OutliningElementsCollector = ts.OutliningElementsCollector || (ts.OutliningElementsCollector = {})); @@ -68741,8 +69193,8 @@ var ts; var nameToDeclarations = sourceFile.getNamedDeclarations(); var declarations = nameToDeclarations.get(name.text); if (declarations) { - for (var _b = 0, declarations_13 = declarations; _b < declarations_13.length; _b++) { - var declaration = declarations_13[_b]; + for (var _b = 0, declarations_12 = declarations; _b < declarations_12.length; _b++) { + var declaration = declarations_12[_b]; var symbol = declaration.symbol; if (symbol) { var type = typeChecker.getTypeOfSymbolAtLocation(symbol, declaration); @@ -68775,7 +69227,9 @@ var ts; } var kind = invocation.typeArguments && invocation.typeArguments.pos === list.pos ? 0 : 1; var argumentCount = getArgumentCount(list); - ts.Debug.assert(argumentIndex === 0 || argumentIndex < argumentCount, "argumentCount < argumentIndex, " + argumentCount + " < " + argumentIndex); + if (argumentIndex !== 0) { + ts.Debug.assertLessThan(argumentIndex, argumentCount); + } var argumentsSpan = getApplicableSpanForArguments(list, sourceFile); return { kind: kind, invocation: invocation, argumentsSpan: argumentsSpan, argumentIndex: argumentIndex, argumentCount: argumentCount }; } @@ -68853,7 +69307,9 @@ var ts; var argumentCount = tagExpression.template.kind === 13 ? 1 : tagExpression.template.templateSpans.length + 1; - ts.Debug.assert(argumentIndex === 0 || argumentIndex < argumentCount, "argumentCount < argumentIndex, " + argumentCount + " < " + argumentIndex); + if (argumentIndex !== 0) { + ts.Debug.assertLessThan(argumentIndex, argumentCount); + } return { kind: 2, invocation: tagExpression, @@ -68950,7 +69406,9 @@ var ts; tags: candidateSignature.getJsDocTags() }; }); - ts.Debug.assert(argumentIndex === 0 || argumentIndex < argumentCount, "argumentCount < argumentIndex, " + argumentCount + " < " + argumentIndex); + if (argumentIndex !== 0) { + ts.Debug.assertLessThan(argumentIndex, argumentCount); + } var selectedItemIndex = candidates.indexOf(resolvedSignature); ts.Debug.assert(selectedItemIndex !== -1); return { items: items, applicableSpan: applicableSpan, selectedItemIndex: selectedItemIndex, argumentIndex: argumentIndex, argumentCount: argumentCount }; @@ -69091,102 +69549,100 @@ var ts; } var signature = void 0; type = isThisExpression ? typeChecker.getTypeAtLocation(location) : typeChecker.getTypeOfSymbolAtLocation(symbol.exportSymbol || symbol, location); - if (type) { - if (location.parent && location.parent.kind === 179) { - var right = location.parent.name; - if (right === location || (right && right.getFullWidth() === 0)) { - location = location.parent; - } + if (location.parent && location.parent.kind === 179) { + var right = location.parent.name; + if (right === location || (right && right.getFullWidth() === 0)) { + location = location.parent; } - var callExpressionLike = void 0; - if (ts.isCallOrNewExpression(location)) { - callExpressionLike = location; - } - else if (ts.isCallExpressionTarget(location) || ts.isNewExpressionTarget(location)) { - callExpressionLike = location.parent; + } + var callExpressionLike = void 0; + if (ts.isCallOrNewExpression(location)) { + callExpressionLike = location; + } + else if (ts.isCallExpressionTarget(location) || ts.isNewExpressionTarget(location)) { + callExpressionLike = location.parent; + } + else if (location.parent && ts.isJsxOpeningLikeElement(location.parent) && ts.isFunctionLike(symbol.valueDeclaration)) { + callExpressionLike = location.parent; + } + if (callExpressionLike) { + var candidateSignatures = []; + signature = typeChecker.getResolvedSignature(callExpressionLike, candidateSignatures); + if (!signature && candidateSignatures.length) { + signature = candidateSignatures[0]; } - else if (location.parent && ts.isJsxOpeningLikeElement(location.parent) && ts.isFunctionLike(symbol.valueDeclaration)) { - callExpressionLike = location.parent; + var useConstructSignatures = callExpressionLike.kind === 182 || (ts.isCallExpression(callExpressionLike) && callExpressionLike.expression.kind === 97); + var allSignatures = useConstructSignatures ? type.getConstructSignatures() : type.getCallSignatures(); + if (!ts.contains(allSignatures, signature.target) && !ts.contains(allSignatures, signature)) { + signature = allSignatures.length ? allSignatures[0] : undefined; } - if (callExpressionLike) { - var candidateSignatures = []; - signature = typeChecker.getResolvedSignature(callExpressionLike, candidateSignatures); - if (!signature && candidateSignatures.length) { - signature = candidateSignatures[0]; - } - var useConstructSignatures = callExpressionLike.kind === 182 || (ts.isCallExpression(callExpressionLike) && callExpressionLike.expression.kind === 97); - var allSignatures = useConstructSignatures ? type.getConstructSignatures() : type.getCallSignatures(); - if (!ts.contains(allSignatures, signature.target) && !ts.contains(allSignatures, signature)) { - signature = allSignatures.length ? allSignatures[0] : undefined; + if (signature) { + if (useConstructSignatures && (symbolFlags & 32)) { + symbolKind = "constructor"; + addPrefixForAnyFunctionOrVar(type.symbol, symbolKind); } - if (signature) { - if (useConstructSignatures && (symbolFlags & 32)) { - symbolKind = "constructor"; - addPrefixForAnyFunctionOrVar(type.symbol, symbolKind); + else if (symbolFlags & 2097152) { + symbolKind = "alias"; + pushTypePart(symbolKind); + displayParts.push(ts.spacePart()); + if (useConstructSignatures) { + displayParts.push(ts.keywordPart(94)); + displayParts.push(ts.spacePart()); } - else if (symbolFlags & 2097152) { - symbolKind = "alias"; - pushTypePart(symbolKind); + addFullSymbolName(symbol); + } + else { + addPrefixForAnyFunctionOrVar(symbol, symbolKind); + } + switch (symbolKind) { + case "JSX attribute": + case "property": + case "var": + case "const": + case "let": + case "parameter": + case "local var": + displayParts.push(ts.punctuationPart(56)); displayParts.push(ts.spacePart()); if (useConstructSignatures) { displayParts.push(ts.keywordPart(94)); displayParts.push(ts.spacePart()); } - addFullSymbolName(symbol); - } - else { - addPrefixForAnyFunctionOrVar(symbol, symbolKind); - } - switch (symbolKind) { - case "JSX attribute": - case "property": - case "var": - case "const": - case "let": - case "parameter": - case "local var": - displayParts.push(ts.punctuationPart(56)); - displayParts.push(ts.spacePart()); - if (useConstructSignatures) { - displayParts.push(ts.keywordPart(94)); - displayParts.push(ts.spacePart()); - } - if (!(type.flags & 32768 && type.objectFlags & 16) && type.symbol) { - ts.addRange(displayParts, ts.symbolToDisplayParts(typeChecker, type.symbol, enclosingDeclaration, undefined, 1)); - } - addSignatureDisplayParts(signature, allSignatures, 16); - break; - default: - addSignatureDisplayParts(signature, allSignatures); - } - hasAddedSymbolInfo = true; + if (!(type.flags & 32768 && type.objectFlags & 16) && type.symbol) { + ts.addRange(displayParts, ts.symbolToDisplayParts(typeChecker, type.symbol, enclosingDeclaration, undefined, 1)); + } + addSignatureDisplayParts(signature, allSignatures, 16); + break; + default: + addSignatureDisplayParts(signature, allSignatures); } + hasAddedSymbolInfo = true; } - else if ((ts.isNameOfFunctionDeclaration(location) && !(symbolFlags & 98304)) || - (location.kind === 123 && location.parent.kind === 152)) { - var functionDeclaration_1 = location.parent; - var locationIsSymbolDeclaration = ts.findDeclaration(symbol, function (declaration) { - return declaration === (location.kind === 123 ? functionDeclaration_1.parent : functionDeclaration_1); - }); - if (locationIsSymbolDeclaration) { - var allSignatures = functionDeclaration_1.kind === 152 ? type.getNonNullableType().getConstructSignatures() : type.getNonNullableType().getCallSignatures(); - if (!typeChecker.isImplementationOfOverload(functionDeclaration_1)) { - signature = typeChecker.getSignatureFromDeclaration(functionDeclaration_1); - } - else { - signature = allSignatures[0]; - } - if (functionDeclaration_1.kind === 152) { - symbolKind = "constructor"; - addPrefixForAnyFunctionOrVar(type.symbol, symbolKind); - } - else { - addPrefixForAnyFunctionOrVar(functionDeclaration_1.kind === 155 && - !(type.symbol.flags & 2048 || type.symbol.flags & 4096) ? type.symbol : symbol, symbolKind); - } - addSignatureDisplayParts(signature, allSignatures); - hasAddedSymbolInfo = true; + } + else if ((ts.isNameOfFunctionDeclaration(location) && !(symbolFlags & 98304)) || + (location.kind === 123 && location.parent.kind === 152)) { + var functionDeclaration_1 = location.parent; + var locationIsSymbolDeclaration = ts.find(symbol.declarations, function (declaration) { + return declaration === (location.kind === 123 ? functionDeclaration_1.parent : functionDeclaration_1); + }); + if (locationIsSymbolDeclaration) { + var allSignatures = functionDeclaration_1.kind === 152 ? type.getNonNullableType().getConstructSignatures() : type.getNonNullableType().getCallSignatures(); + if (!typeChecker.isImplementationOfOverload(functionDeclaration_1)) { + signature = typeChecker.getSignatureFromDeclaration(functionDeclaration_1); } + else { + signature = allSignatures[0]; + } + if (functionDeclaration_1.kind === 152) { + symbolKind = "constructor"; + addPrefixForAnyFunctionOrVar(type.symbol, symbolKind); + } + else { + addPrefixForAnyFunctionOrVar(functionDeclaration_1.kind === 155 && + !(type.symbol.flags & 2048 || type.symbol.flags & 4096) ? type.symbol : symbol, symbolKind); + } + addSignatureDisplayParts(signature, allSignatures); + hasAddedSymbolInfo = true; } } } @@ -69361,7 +69817,9 @@ var ts; symbolFlags & 98304 || symbolKind === "method") { var allSignatures = type.getNonNullableType().getCallSignatures(); - addSignatureDisplayParts(allSignatures[0], allSignatures); + if (allSignatures.length) { + addSignatureDisplayParts(allSignatures[0], allSignatures); + } } } } @@ -69509,11 +69967,11 @@ var ts; getSourceFile: function (fileName) { return fileName === ts.normalizePath(inputFileName) ? sourceFile : undefined; }, writeFile: function (name, text) { if (ts.fileExtensionIs(name, ".map")) { - ts.Debug.assert(sourceMapText === undefined, "Unexpected multiple source map outputs for the file '" + name + "'"); + ts.Debug.assertEqual(sourceMapText, undefined, "Unexpected multiple source map outputs, file:", name); sourceMapText = text; } else { - ts.Debug.assert(outputText === undefined, "Unexpected multiple outputs for the file: '" + name + "'"); + ts.Debug.assertEqual(outputText, undefined, "Unexpected multiple outputs, file:", name); outputText = text; } }, @@ -70132,6 +70590,7 @@ var ts; this.NoSpaceAfterSemicolonInFor = new formatting.Rule(formatting.RuleDescriptor.create3(25, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsOptionDisabledOrUndefined("insertSpaceAfterSemicolonInForStatements"), Rules.IsNonJsxSameLineTokenContext, Rules.IsForContext), 8)); this.SpaceAfterOpenParen = new formatting.Rule(formatting.RuleDescriptor.create3(19, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsOptionEnabled("insertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis"), Rules.IsNonJsxSameLineTokenContext), 2)); this.SpaceBeforeCloseParen = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 20), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsOptionEnabled("insertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis"), Rules.IsNonJsxSameLineTokenContext), 2)); + this.SpaceBetweenOpenParens = new formatting.Rule(formatting.RuleDescriptor.create1(19, 19), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsOptionEnabled("insertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis"), Rules.IsNonJsxSameLineTokenContext), 2)); this.NoSpaceBetweenParens = new formatting.Rule(formatting.RuleDescriptor.create1(19, 20), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 8)); this.NoSpaceAfterOpenParen = new formatting.Rule(formatting.RuleDescriptor.create3(19, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsOptionDisabledOrUndefined("insertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis"), Rules.IsNonJsxSameLineTokenContext), 8)); this.NoSpaceBeforeCloseParen = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 20), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsOptionDisabledOrUndefined("insertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis"), Rules.IsNonJsxSameLineTokenContext), 8)); @@ -70203,7 +70662,7 @@ var ts; this.SpaceAfterComma, this.NoSpaceAfterComma, this.SpaceAfterAnonymousFunctionKeyword, this.NoSpaceAfterAnonymousFunctionKeyword, this.SpaceAfterKeywordInControl, this.NoSpaceAfterKeywordInControl, - this.SpaceAfterOpenParen, this.SpaceBeforeCloseParen, this.NoSpaceBetweenParens, this.NoSpaceAfterOpenParen, this.NoSpaceBeforeCloseParen, + this.SpaceAfterOpenParen, this.SpaceBeforeCloseParen, this.SpaceBetweenOpenParens, this.NoSpaceBetweenParens, this.NoSpaceAfterOpenParen, this.NoSpaceBeforeCloseParen, this.SpaceAfterOpenBracket, this.SpaceBeforeCloseBracket, this.NoSpaceBetweenBrackets, this.NoSpaceAfterOpenBracket, this.NoSpaceBeforeCloseBracket, this.SpaceAfterOpenBrace, this.SpaceBeforeCloseBrace, this.NoSpaceBetweenEmptyBraceBrackets, this.NoSpaceAfterOpenBrace, this.NoSpaceBeforeCloseBrace, this.SpaceAfterTemplateHeadAndMiddle, this.SpaceBeforeTemplateMiddleAndTail, this.NoSpaceAfterTemplateHeadAndMiddle, this.NoSpaceBeforeTemplateMiddleAndTail, @@ -71003,7 +71462,6 @@ var ts; } function formatSpanWorker(originalRange, enclosingNode, initialIndentation, delta, formattingScanner, options, rulesProvider, requestKind, rangeContainsError, sourceFile) { var formattingContext = new formatting.FormattingContext(sourceFile, requestKind, options); - var previousRangeHasError; var previousRange; var previousParent; var previousRangeStartLine; @@ -71339,7 +71797,7 @@ var ts; function processRange(range, rangeStart, parent, contextNode, dynamicIndentation) { var rangeHasError = rangeContainsError(range); var lineAdded; - if (!rangeHasError && !previousRangeHasError) { + if (!rangeHasError) { if (!previousRange) { var originalStart = sourceFile.getLineAndCharacterOfPosition(originalRange.pos); trimTrailingWhitespacesForLines(originalStart.line, rangeStart.line); @@ -71352,7 +71810,6 @@ var ts; previousRange = range; previousParent = parent; previousRangeStartLine = rangeStart.line; - previousRangeHasError = rangeHasError; return lineAdded; } function processPair(currentItem, currentStartLine, currentParent, previousItem, previousStartLine, previousParent, contextNode, dynamicIndentation) { @@ -71531,6 +71988,32 @@ var ts; } } } + function getRangeOfEnclosingComment(sourceFile, position, onlyMultiLine, precedingToken, tokenAtPosition, predicate) { + if (tokenAtPosition === void 0) { tokenAtPosition = ts.getTokenAtPosition(sourceFile, position, false); } + var tokenStart = tokenAtPosition.getStart(sourceFile); + if (tokenStart <= position && position < tokenAtPosition.getEnd()) { + return undefined; + } + if (precedingToken === undefined) { + precedingToken = ts.findPrecedingToken(position, sourceFile); + } + var trailingRangesOfPreviousToken = precedingToken && ts.getTrailingCommentRanges(sourceFile.text, precedingToken.end); + var leadingCommentRangesOfNextToken = ts.getLeadingCommentRangesOfNode(tokenAtPosition, sourceFile); + var commentRanges = trailingRangesOfPreviousToken && leadingCommentRangesOfNextToken ? + trailingRangesOfPreviousToken.concat(leadingCommentRangesOfNextToken) : + trailingRangesOfPreviousToken || leadingCommentRangesOfNextToken; + if (commentRanges) { + for (var _i = 0, commentRanges_1 = commentRanges; _i < commentRanges_1.length; _i++) { + var range = commentRanges_1[_i]; + if ((range.pos < position && position < range.end || + position === range.end && (range.kind === 2 || position === sourceFile.getFullWidth()))) { + return (range.kind === 3 || !onlyMultiLine) && (!predicate || predicate(range)) ? range : undefined; + } + } + } + return undefined; + } + formatting.getRangeOfEnclosingComment = getRangeOfEnclosingComment; function getOpenTokenForList(node, list) { switch (node.kind) { case 152: @@ -71641,11 +72124,27 @@ var ts; return 0; } var precedingToken = ts.findPrecedingToken(position, sourceFile); + var enclosingCommentRange = formatting.getRangeOfEnclosingComment(sourceFile, position, true, precedingToken || null); + if (enclosingCommentRange) { + var previousLine = ts.getLineAndCharacterOfPosition(sourceFile, position).line - 1; + var commentStartLine = ts.getLineAndCharacterOfPosition(sourceFile, enclosingCommentRange.pos).line; + ts.Debug.assert(commentStartLine >= 0); + if (previousLine <= commentStartLine) { + return findFirstNonWhitespaceColumn(ts.getStartPositionOfLine(commentStartLine, sourceFile), position, sourceFile, options); + } + var startPostionOfLine = ts.getStartPositionOfLine(previousLine, sourceFile); + var _a = findFirstNonWhitespaceCharacterAndColumn(startPostionOfLine, position, sourceFile, options), column = _a.column, character = _a.character; + if (column === 0) { + return column; + } + var firstNonWhitespaceCharacterCode = sourceFile.text.charCodeAt(startPostionOfLine + character); + return firstNonWhitespaceCharacterCode === 42 ? column - 1 : column; + } if (!precedingToken) { return getBaseIndentation(options); } var precedingTokenIsLiteral = ts.isStringOrRegularExpressionOrTemplateLiteral(precedingToken.kind); - if (precedingTokenIsLiteral && precedingToken.getStart(sourceFile) <= position && precedingToken.end > position) { + if (precedingTokenIsLiteral && precedingToken.getStart(sourceFile) <= position && position < precedingToken.end) { return 0; } var lineAtPosition = sourceFile.getLineAndCharacterOfPosition(position).line; @@ -72050,6 +72549,12 @@ var ts; } return false; } + var ChangeKind; + (function (ChangeKind) { + ChangeKind[ChangeKind["Remove"] = 0] = "Remove"; + ChangeKind[ChangeKind["ReplaceWithSingleNode"] = 1] = "ReplaceWithSingleNode"; + ChangeKind[ChangeKind["ReplaceWithMultipleNodes"] = 2] = "ReplaceWithMultipleNodes"; + })(ChangeKind || (ChangeKind = {})); function getSeparatorCharacter(separator) { return ts.tokenToString(separator.kind); } @@ -72074,7 +72579,7 @@ var ts; } textChanges.getAdjustedStartPosition = getAdjustedStartPosition; function getAdjustedEndPosition(sourceFile, node, options) { - if (options.useNonAdjustedEndPosition) { + if (options.useNonAdjustedEndPosition || ts.isExpression(node)) { return node.getEnd(); } var end = node.getEnd(); @@ -72094,6 +72599,9 @@ var ts; } return s; } + function getNewlineKind(context) { + return context.newLineCharacter === "\n" ? 1 : 0; + } var ChangeTracker = (function () { function ChangeTracker(newLine, rulesProvider, validator) { this.newLine = newLine; @@ -72103,24 +72611,24 @@ var ts; this.newLineCharacter = ts.getNewLineCharacter({ newLine: newLine }); } ChangeTracker.fromCodeFixContext = function (context) { - return new ChangeTracker(context.newLineCharacter === "\n" ? 1 : 0, context.rulesProvider); + return new ChangeTracker(getNewlineKind(context), context.rulesProvider); + }; + ChangeTracker.prototype.deleteRange = function (sourceFile, range) { + this.changes.push({ kind: ChangeKind.Remove, sourceFile: sourceFile, range: range }); + return this; }; ChangeTracker.prototype.deleteNode = function (sourceFile, node, options) { if (options === void 0) { options = {}; } var startPosition = getAdjustedStartPosition(sourceFile, node, options, Position.FullStart); var endPosition = getAdjustedEndPosition(sourceFile, node, options); - this.changes.push({ sourceFile: sourceFile, options: options, range: { pos: startPosition, end: endPosition } }); - return this; - }; - ChangeTracker.prototype.deleteRange = function (sourceFile, range) { - this.changes.push({ sourceFile: sourceFile, range: range }); + this.changes.push({ kind: ChangeKind.Remove, sourceFile: sourceFile, range: { pos: startPosition, end: endPosition } }); return this; }; ChangeTracker.prototype.deleteNodeRange = function (sourceFile, startNode, endNode, options) { if (options === void 0) { options = {}; } var startPosition = getAdjustedStartPosition(sourceFile, startNode, options, Position.FullStart); var endPosition = getAdjustedEndPosition(sourceFile, endNode, options); - this.changes.push({ sourceFile: sourceFile, options: options, range: { pos: startPosition, end: endPosition } }); + this.changes.push({ kind: ChangeKind.Remove, sourceFile: sourceFile, range: { pos: startPosition, end: endPosition } }); return this; }; ChangeTracker.prototype.deleteNodeInList = function (sourceFile, node) { @@ -72156,33 +72664,68 @@ var ts; }; ChangeTracker.prototype.replaceRange = function (sourceFile, range, newNode, options) { if (options === void 0) { options = {}; } - this.changes.push({ sourceFile: sourceFile, range: range, options: options, node: newNode }); + this.changes.push({ kind: ChangeKind.ReplaceWithSingleNode, sourceFile: sourceFile, range: range, options: options, node: newNode }); return this; }; ChangeTracker.prototype.replaceNode = function (sourceFile, oldNode, newNode, options) { if (options === void 0) { options = {}; } var startPosition = getAdjustedStartPosition(sourceFile, oldNode, options, Position.Start); var endPosition = getAdjustedEndPosition(sourceFile, oldNode, options); - this.changes.push({ sourceFile: sourceFile, options: options, useIndentationFromFile: true, node: newNode, range: { pos: startPosition, end: endPosition } }); - return this; + return this.replaceWithSingle(sourceFile, startPosition, endPosition, newNode, options); }; ChangeTracker.prototype.replaceNodeRange = function (sourceFile, startNode, endNode, newNode, options) { if (options === void 0) { options = {}; } var startPosition = getAdjustedStartPosition(sourceFile, startNode, options, Position.Start); var endPosition = getAdjustedEndPosition(sourceFile, endNode, options); - this.changes.push({ sourceFile: sourceFile, options: options, useIndentationFromFile: true, node: newNode, range: { pos: startPosition, end: endPosition } }); + return this.replaceWithSingle(sourceFile, startPosition, endPosition, newNode, options); + }; + ChangeTracker.prototype.replaceWithSingle = function (sourceFile, startPosition, endPosition, newNode, options) { + this.changes.push({ + kind: ChangeKind.ReplaceWithSingleNode, + sourceFile: sourceFile, + options: options, + node: newNode, + range: { pos: startPosition, end: endPosition } + }); + return this; + }; + ChangeTracker.prototype.replaceWithMultiple = function (sourceFile, startPosition, endPosition, newNodes, options) { + this.changes.push({ + kind: ChangeKind.ReplaceWithMultipleNodes, + sourceFile: sourceFile, + options: options, + nodes: newNodes, + range: { pos: startPosition, end: endPosition } + }); return this; }; + ChangeTracker.prototype.replaceNodeWithNodes = function (sourceFile, oldNode, newNodes, options) { + var startPosition = getAdjustedStartPosition(sourceFile, oldNode, options, Position.Start); + var endPosition = getAdjustedEndPosition(sourceFile, oldNode, options); + return this.replaceWithMultiple(sourceFile, startPosition, endPosition, newNodes, options); + }; + ChangeTracker.prototype.replaceNodesWithNodes = function (sourceFile, oldNodes, newNodes, options) { + var startPosition = getAdjustedStartPosition(sourceFile, oldNodes[0], options, Position.Start); + var endPosition = getAdjustedEndPosition(sourceFile, ts.lastOrUndefined(oldNodes), options); + return this.replaceWithMultiple(sourceFile, startPosition, endPosition, newNodes, options); + }; + ChangeTracker.prototype.replaceRangeWithNodes = function (sourceFile, range, newNodes, options) { + return this.replaceWithMultiple(sourceFile, range.pos, range.end, newNodes, options); + }; + ChangeTracker.prototype.replaceNodeRangeWithNodes = function (sourceFile, startNode, endNode, newNodes, options) { + var startPosition = getAdjustedStartPosition(sourceFile, startNode, options, Position.Start); + var endPosition = getAdjustedEndPosition(sourceFile, endNode, options); + return this.replaceWithMultiple(sourceFile, startPosition, endPosition, newNodes, options); + }; ChangeTracker.prototype.insertNodeAt = function (sourceFile, pos, newNode, options) { if (options === void 0) { options = {}; } - this.changes.push({ sourceFile: sourceFile, options: options, node: newNode, range: { pos: pos, end: pos } }); + this.changes.push({ kind: ChangeKind.ReplaceWithSingleNode, sourceFile: sourceFile, options: options, node: newNode, range: { pos: pos, end: pos } }); return this; }; ChangeTracker.prototype.insertNodeBefore = function (sourceFile, before, newNode, options) { if (options === void 0) { options = {}; } var startPosition = getAdjustedStartPosition(sourceFile, before, options, Position.Start); - this.changes.push({ sourceFile: sourceFile, options: options, useIndentationFromFile: true, node: newNode, range: { pos: startPosition, end: startPosition } }); - return this; + return this.replaceWithSingle(sourceFile, startPosition, startPosition, newNode, options); }; ChangeTracker.prototype.insertNodeAfter = function (sourceFile, after, newNode, options) { if (options === void 0) { options = {}; } @@ -72192,6 +72735,7 @@ var ts; after.kind === 150) { if (sourceFile.text.charCodeAt(after.end - 1) !== 59) { this.changes.push({ + kind: ChangeKind.ReplaceWithSingleNode, sourceFile: sourceFile, options: {}, range: { pos: after.end, end: after.end }, @@ -72200,8 +72744,7 @@ var ts; } } var endPosition = getAdjustedEndPosition(sourceFile, after, options); - this.changes.push({ sourceFile: sourceFile, options: options, useIndentationFromFile: true, node: newNode, range: { pos: endPosition, end: endPosition } }); - return this; + return this.replaceWithSingle(sourceFile, endPosition, endPosition, newNode, options); }; ChangeTracker.prototype.insertNodeInListAfter = function (sourceFile, after, newNode) { var containingList = ts.formatting.SmartIndenter.getContainingList(after, sourceFile); @@ -72229,10 +72772,10 @@ var ts; startPos = ts.getStartPositionOfLine(lineAndCharOfNextElement.line, sourceFile); } this.changes.push({ + kind: ChangeKind.ReplaceWithSingleNode, sourceFile: sourceFile, range: { pos: startPos, end: containingList[index + 1].getStart(sourceFile) }, node: newNode, - useIndentationFromFile: true, options: { prefix: prefix, suffix: "" + ts.tokenToString(nextToken.kind) + sourceFile.text.substring(nextToken.end, containingList[index + 1].getStart(sourceFile)) @@ -72259,6 +72802,7 @@ var ts; } if (multilineList) { this.changes.push({ + kind: ChangeKind.ReplaceWithSingleNode, sourceFile: sourceFile, range: { pos: end, end: end }, node: ts.createToken(separator), @@ -72270,6 +72814,7 @@ var ts; insertPos--; } this.changes.push({ + kind: ChangeKind.ReplaceWithSingleNode, sourceFile: sourceFile, range: { pos: insertPos, end: insertPos }, node: newNode, @@ -72278,6 +72823,7 @@ var ts; } else { this.changes.push({ + kind: ChangeKind.ReplaceWithSingleNode, sourceFile: sourceFile, range: { pos: end, end: end }, node: newNode, @@ -72317,30 +72863,43 @@ var ts; return ts.createTextSpanFromBounds(change.range.pos, change.range.end); }; ChangeTracker.prototype.computeNewText = function (change, sourceFile) { - if (!change.node) { + var _this = this; + if (change.kind === ChangeKind.Remove) { return ""; } var options = change.options || {}; - var nonFormattedText = getNonformattedText(change.node, sourceFile, this.newLine); + var text; + var pos = change.range.pos; + var posStartsLine = ts.getLineStartPositionForPosition(pos, sourceFile) === pos; + if (change.kind === ChangeKind.ReplaceWithMultipleNodes) { + var parts = change.nodes.map(function (n) { return _this.getFormattedTextOfNode(n, sourceFile, pos, options); }); + text = parts.join(change.options.nodeSeparator); + } + else { + ts.Debug.assert(change.kind === ChangeKind.ReplaceWithSingleNode, "change.kind === ReplaceWithSingleNode"); + text = this.getFormattedTextOfNode(change.node, sourceFile, pos, options); + } + text = (posStartsLine || options.indentation !== undefined) ? text : text.replace(/^\s+/, ""); + return (options.prefix || "") + text + (options.suffix || ""); + }; + ChangeTracker.prototype.getFormattedTextOfNode = function (node, sourceFile, pos, options) { + var nonformattedText = getNonformattedText(node, sourceFile, this.newLine); if (this.validator) { - this.validator(nonFormattedText); + this.validator(nonformattedText); } var formatOptions = this.rulesProvider.getFormatOptions(); - var pos = change.range.pos; var posStartsLine = ts.getLineStartPositionForPosition(pos, sourceFile) === pos; - var initialIndentation = change.options.indentation !== undefined - ? change.options.indentation - : change.useIndentationFromFile - ? ts.formatting.SmartIndenter.getIndentation(change.range.pos, sourceFile, formatOptions, posStartsLine || (change.options.prefix === this.newLineCharacter)) + var initialIndentation = options.indentation !== undefined + ? options.indentation + : (options.useIndentationFromFile !== false) + ? ts.formatting.SmartIndenter.getIndentation(pos, sourceFile, formatOptions, posStartsLine || (options.prefix === this.newLineCharacter)) : 0; - var delta = change.options.delta !== undefined - ? change.options.delta - : ts.formatting.SmartIndenter.shouldIndentChildNode(change.node) - ? formatOptions.indentSize + var delta = options.delta !== undefined + ? options.delta + : ts.formatting.SmartIndenter.shouldIndentChildNode(node) + ? (formatOptions.indentSize || 0) : 0; - var text = applyFormatting(nonFormattedText, sourceFile, initialIndentation, delta, this.rulesProvider); - text = posStartsLine || change.options.indentation !== undefined ? text : text.replace(/^\s+/, ""); - return (options.prefix || "") + text + (options.suffix || ""); + return applyFormatting(nonformattedText, sourceFile, initialIndentation, delta, this.rulesProvider); }; ChangeTracker.normalize = function (changes) { var normalized = ts.stableSort(changes, function (a, b) { return a.range.pos - b.range.pos; }); @@ -73319,7 +73878,7 @@ var ts; symbolName = name; } else if (ts.isJsxOpeningLikeElement(token.parent) && token.parent.tagName === token) { - symbol = checker.getAliasedSymbol(checker.resolveNameAtLocation(token, checker.getJsxNamespace(), 107455)); + symbol = checker.getAliasedSymbol(checker.resolveName(checker.getJsxNamespace(), token.parent.tagName, 107455)); symbolName = symbol.name; } else { @@ -73403,8 +73962,8 @@ var ts; var namespaceImportDeclaration; var namedImportDeclaration; var existingModuleSpecifier; - for (var _i = 0, declarations_14 = declarations; _i < declarations_14.length; _i++) { - var declaration = declarations_14[_i]; + for (var _i = 0, declarations_13 = declarations; _i < declarations_13.length; _i++) { + var declaration = declarations_13[_i]; if (declaration.kind === 238) { var namedBindings = declaration.importClause && declaration.importClause.namedBindings; if (namedBindings && namedBindings.kind === 240) { @@ -73478,14 +74037,53 @@ var ts; : isNamespaceImport ? ts.createImportClause(undefined, ts.createNamespaceImport(ts.createIdentifier(symbolName))) : ts.createImportClause(undefined, ts.createNamedImports([ts.createImportSpecifier(undefined, ts.createIdentifier(symbolName))])); - var importDecl = ts.createImportDeclaration(undefined, undefined, importClause, ts.createLiteral(moduleSpecifierWithoutQuotes)); + var moduleSpecifierLiteral = ts.createLiteral(moduleSpecifierWithoutQuotes); + moduleSpecifierLiteral.singleQuote = getSingleQuoteStyleFromExistingImports(); + var importDecl = ts.createImportDeclaration(undefined, undefined, importClause, moduleSpecifierLiteral); if (!lastImportDeclaration) { - changeTracker.insertNodeAt(sourceFile, sourceFile.getStart(), importDecl, { suffix: "" + context.newLineCharacter + context.newLineCharacter }); + changeTracker.insertNodeAt(sourceFile, getSourceFileImportLocation(sourceFile), importDecl, { suffix: "" + context.newLineCharacter + context.newLineCharacter }); } else { changeTracker.insertNodeAfter(sourceFile, lastImportDeclaration, importDecl, { suffix: context.newLineCharacter }); } return createCodeAction(ts.Diagnostics.Import_0_from_1, [symbolName, "\"" + moduleSpecifierWithoutQuotes + "\""], changeTracker.getChanges(), "NewImport", moduleSpecifierWithoutQuotes); + function getSourceFileImportLocation(node) { + var text = node.text; + var ranges = ts.getLeadingCommentRanges(text, 0); + if (!ranges) + return 0; + var position = 0; + if (ranges.length && ranges[0].kind === 3 && ts.isPinnedComment(text, ranges[0])) { + position = ranges[0].end + 1; + ranges = ranges.slice(1); + } + for (var _i = 0, ranges_1 = ranges; _i < ranges_1.length; _i++) { + var range = ranges_1[_i]; + if (range.kind === 2 && ts.isRecognizedTripleSlashComment(node.text, range.pos, range.end)) { + position = range.end + 1; + continue; + } + break; + } + return position; + } + function getSingleQuoteStyleFromExistingImports() { + var firstModuleSpecifier = ts.forEach(sourceFile.statements, function (node) { + if (ts.isImportDeclaration(node) || ts.isExportDeclaration(node)) { + if (node.moduleSpecifier && ts.isStringLiteral(node.moduleSpecifier)) { + return node.moduleSpecifier; + } + } + else if (ts.isImportEqualsDeclaration(node)) { + if (ts.isExternalModuleReference(node.moduleReference) && ts.isStringLiteral(node.moduleReference.expression)) { + return node.moduleReference.expression; + } + } + }); + if (firstModuleSpecifier) { + return sourceFile.text.charCodeAt(firstModuleSpecifier.getStart()) === 39; + } + } function getModuleSpecifierForNewImport() { var fileName = sourceFile.fileName; var moduleFileName = moduleSymbol.valueDeclaration.getSourceFile().fileName; @@ -73615,7 +74213,8 @@ var ts; (function (States) { States[States["BeforeNodeModules"] = 0] = "BeforeNodeModules"; States[States["NodeModules"] = 1] = "NodeModules"; - States[States["PackageContent"] = 2] = "PackageContent"; + States[States["Scope"] = 2] = "Scope"; + States[States["PackageContent"] = 3] = "PackageContent"; })(States || (States = {})); var partStart = 0; var partEnd = 0; @@ -73632,15 +74231,21 @@ var ts; } break; case 1: - packageRootIndex = partEnd; - state = 2; - break; case 2: + if (state === 1 && fullPath.charAt(partStart + 1) === "@") { + state = 2; + } + else { + packageRootIndex = partEnd; + state = 3; + } + break; + case 3: if (fullPath.indexOf("/node_modules/", partStart) === partStart) { state = 1; } else { - state = 2; + state = 3; } break; } @@ -73930,206 +74535,1029 @@ var ts; (function (ts) { var refactor; (function (refactor) { - var actionName = "convert"; - var convertFunctionToES6Class = { - name: "Convert to ES2015 class", - description: ts.Diagnostics.Convert_function_to_an_ES2015_class.message, - getEditsForAction: getEditsForAction, - getAvailableActions: getAvailableActions - }; - refactor.registerRefactor(convertFunctionToES6Class); - function getAvailableActions(context) { - if (!ts.isInJavaScriptFile(context.file)) { - return undefined; - } - var start = context.startPosition; - var node = ts.getTokenAtPosition(context.file, start, false); - var checker = context.program.getTypeChecker(); - var symbol = checker.getSymbolAtLocation(node); - if (symbol && ts.isDeclarationOfFunctionOrClassExpression(symbol)) { - symbol = symbol.valueDeclaration.initializer.symbol; + var convertFunctionToES6Class; + (function (convertFunctionToES6Class_1) { + var actionName = "convert"; + var convertFunctionToES6Class = { + name: "Convert to ES2015 class", + description: ts.Diagnostics.Convert_function_to_an_ES2015_class.message, + getEditsForAction: getEditsForAction, + getAvailableActions: getAvailableActions + }; + refactor.registerRefactor(convertFunctionToES6Class); + function getAvailableActions(context) { + if (!ts.isInJavaScriptFile(context.file)) { + return undefined; + } + var start = context.startPosition; + var node = ts.getTokenAtPosition(context.file, start, false); + var checker = context.program.getTypeChecker(); + var symbol = checker.getSymbolAtLocation(node); + if (symbol && ts.isDeclarationOfFunctionOrClassExpression(symbol)) { + symbol = symbol.valueDeclaration.initializer.symbol; + } + if (symbol && (symbol.flags & 16) && symbol.members && (symbol.members.size > 0)) { + return [ + { + name: convertFunctionToES6Class.name, + description: convertFunctionToES6Class.description, + actions: [ + { + description: convertFunctionToES6Class.description, + name: actionName + } + ] + } + ]; + } } - if (symbol && (symbol.flags & 16) && symbol.members && (symbol.members.size > 0)) { - return [ - { - name: convertFunctionToES6Class.name, - description: convertFunctionToES6Class.description, - actions: [ - { - description: convertFunctionToES6Class.description, - name: actionName + function getEditsForAction(context, action) { + if (actionName !== action) { + return undefined; + } + var start = context.startPosition; + var sourceFile = context.file; + var checker = context.program.getTypeChecker(); + var token = ts.getTokenAtPosition(sourceFile, start, false); + var ctorSymbol = checker.getSymbolAtLocation(token); + var newLine = context.rulesProvider.getFormatOptions().newLineCharacter; + var deletedNodes = []; + var deletes = []; + if (!(ctorSymbol.flags & (16 | 3))) { + return undefined; + } + var ctorDeclaration = ctorSymbol.valueDeclaration; + var changeTracker = ts.textChanges.ChangeTracker.fromCodeFixContext(context); + var precedingNode; + var newClassDeclaration; + switch (ctorDeclaration.kind) { + case 228: + precedingNode = ctorDeclaration; + deleteNode(ctorDeclaration); + newClassDeclaration = createClassFromFunctionDeclaration(ctorDeclaration); + break; + case 226: + precedingNode = ctorDeclaration.parent.parent; + if (ctorDeclaration.parent.declarations.length === 1) { + deleteNode(precedingNode); + } + else { + deleteNode(ctorDeclaration, true); + } + newClassDeclaration = createClassFromVariableDeclaration(ctorDeclaration); + break; + } + if (!newClassDeclaration) { + return undefined; + } + changeTracker.insertNodeAfter(sourceFile, precedingNode, newClassDeclaration, { suffix: newLine }); + for (var _i = 0, deletes_1 = deletes; _i < deletes_1.length; _i++) { + var deleteCallback = deletes_1[_i]; + deleteCallback(); + } + return { + edits: changeTracker.getChanges() + }; + function deleteNode(node, inList) { + if (inList === void 0) { inList = false; } + if (deletedNodes.some(function (n) { return ts.isNodeDescendantOf(node, n); })) { + return; + } + deletedNodes.push(node); + if (inList) { + deletes.push(function () { return changeTracker.deleteNodeInList(sourceFile, node); }); + } + else { + deletes.push(function () { return changeTracker.deleteNode(sourceFile, node); }); + } + } + function createClassElementsFromSymbol(symbol) { + var memberElements = []; + if (symbol.members) { + symbol.members.forEach(function (member) { + var memberElement = createClassElement(member, undefined); + if (memberElement) { + memberElements.push(memberElement); } - ] + }); } - ]; - } - } - function getEditsForAction(context, action) { - if (actionName !== action) { - return undefined; + if (symbol.exports) { + symbol.exports.forEach(function (member) { + var memberElement = createClassElement(member, [ts.createToken(115)]); + if (memberElement) { + memberElements.push(memberElement); + } + }); + } + return memberElements; + function shouldConvertDeclaration(_target, source) { + return ts.isFunctionLike(source); + } + function createClassElement(symbol, modifiers) { + if (!(symbol.flags & 4)) { + return; + } + var memberDeclaration = symbol.valueDeclaration; + var assignmentBinaryExpression = memberDeclaration.parent; + if (!shouldConvertDeclaration(memberDeclaration, assignmentBinaryExpression.right)) { + return; + } + var nodeToDelete = assignmentBinaryExpression.parent && assignmentBinaryExpression.parent.kind === 210 + ? assignmentBinaryExpression.parent : assignmentBinaryExpression; + deleteNode(nodeToDelete); + if (!assignmentBinaryExpression.right) { + return ts.createProperty([], modifiers, symbol.name, undefined, undefined, undefined); + } + switch (assignmentBinaryExpression.right.kind) { + case 186: { + var functionExpression = assignmentBinaryExpression.right; + var method = ts.createMethod(undefined, modifiers, undefined, memberDeclaration.name, undefined, undefined, functionExpression.parameters, undefined, functionExpression.body); + copyComments(assignmentBinaryExpression, method); + return method; + } + case 187: { + var arrowFunction = assignmentBinaryExpression.right; + var arrowFunctionBody = arrowFunction.body; + var bodyBlock = void 0; + if (arrowFunctionBody.kind === 207) { + bodyBlock = arrowFunctionBody; + } + else { + var expression = arrowFunctionBody; + bodyBlock = ts.createBlock([ts.createReturn(expression)]); + } + var method = ts.createMethod(undefined, modifiers, undefined, memberDeclaration.name, undefined, undefined, arrowFunction.parameters, undefined, bodyBlock); + copyComments(assignmentBinaryExpression, method); + return method; + } + default: { + if (ts.isSourceFileJavaScript(sourceFile)) { + return; + } + var prop = ts.createProperty(undefined, modifiers, memberDeclaration.name, undefined, undefined, assignmentBinaryExpression.right); + copyComments(assignmentBinaryExpression.parent, prop); + return prop; + } + } + } + } + function copyComments(sourceNode, targetNode) { + ts.forEachLeadingCommentRange(sourceFile.text, sourceNode.pos, function (pos, end, kind, htnl) { + if (kind === 3) { + pos += 2; + end -= 2; + } + else { + pos += 2; + } + ts.addSyntheticLeadingComment(targetNode, kind, sourceFile.text.slice(pos, end), htnl); + }); + } + function createClassFromVariableDeclaration(node) { + var initializer = node.initializer; + if (!initializer || initializer.kind !== 186) { + return undefined; + } + if (node.name.kind !== 71) { + return undefined; + } + var memberElements = createClassElementsFromSymbol(initializer.symbol); + if (initializer.body) { + memberElements.unshift(ts.createConstructor(undefined, undefined, initializer.parameters, initializer.body)); + } + var cls = ts.createClassDeclaration(undefined, undefined, node.name, undefined, undefined, memberElements); + return cls; + } + function createClassFromFunctionDeclaration(node) { + var memberElements = createClassElementsFromSymbol(ctorSymbol); + if (node.body) { + memberElements.unshift(ts.createConstructor(undefined, undefined, node.parameters, node.body)); + } + var cls = ts.createClassDeclaration(undefined, undefined, node.name, undefined, undefined, memberElements); + return cls; + } } - var start = context.startPosition; - var sourceFile = context.file; - var checker = context.program.getTypeChecker(); - var token = ts.getTokenAtPosition(sourceFile, start, false); - var ctorSymbol = checker.getSymbolAtLocation(token); - var newLine = context.rulesProvider.getFormatOptions().newLineCharacter; - var deletedNodes = []; - var deletes = []; - if (!(ctorSymbol.flags & (16 | 3))) { - return undefined; + })(convertFunctionToES6Class = refactor.convertFunctionToES6Class || (refactor.convertFunctionToES6Class = {})); + })(refactor = ts.refactor || (ts.refactor = {})); +})(ts || (ts = {})); +var ts; +(function (ts) { + var refactor; + (function (refactor) { + var extractMethod; + (function (extractMethod_1) { + var extractMethod = { + name: "Extract Method", + description: ts.Diagnostics.Extract_function.message, + getAvailableActions: getAvailableActions, + getEditsForAction: getEditsForAction, + }; + refactor.registerRefactor(extractMethod); + function getAvailableActions(context) { + var rangeToExtract = getRangeToExtract(context.file, { start: context.startPosition, length: context.endPosition - context.startPosition }); + var targetRange = rangeToExtract.targetRange; + if (targetRange === undefined) { + return undefined; + } + var extractions = getPossibleExtractions(targetRange, context); + if (extractions === undefined) { + return undefined; + } + var actions = []; + var usedNames = ts.createMap(); + var i = 0; + for (var _i = 0, extractions_1 = extractions; _i < extractions_1.length; _i++) { + var extr = extractions_1[_i]; + if (extr.errors && extr.errors.length) { + continue; + } + var description = ts.formatStringFromArgs(ts.Diagnostics.Extract_function_into_0.message, [extr.scopeDescription]); + if (!usedNames.has(description)) { + usedNames.set(description, true); + actions.push({ + description: description, + name: "scope_" + i + }); + } + i++; + } + if (actions.length === 0) { + return undefined; + } + return [{ + name: extractMethod.name, + description: extractMethod.description, + inlineable: true, + actions: actions + }]; } - var ctorDeclaration = ctorSymbol.valueDeclaration; - var changeTracker = ts.textChanges.ChangeTracker.fromCodeFixContext(context); - var precedingNode; - var newClassDeclaration; - switch (ctorDeclaration.kind) { - case 228: - precedingNode = ctorDeclaration; - deleteNode(ctorDeclaration); - newClassDeclaration = createClassFromFunctionDeclaration(ctorDeclaration); - break; - case 226: - precedingNode = ctorDeclaration.parent.parent; - if (ctorDeclaration.parent.declarations.length === 1) { - deleteNode(precedingNode); + function getEditsForAction(context, actionName) { + var length = context.endPosition === undefined ? 0 : context.endPosition - context.startPosition; + var rangeToExtract = getRangeToExtract(context.file, { start: context.startPosition, length: length }); + var targetRange = rangeToExtract.targetRange; + var parsedIndexMatch = /^scope_(\d+)$/.exec(actionName); + ts.Debug.assert(!!parsedIndexMatch, "Scope name should have matched the regexp"); + var index = +parsedIndexMatch[1]; + ts.Debug.assert(isFinite(index), "Expected to parse a finite number from the scope index"); + var extractions = getPossibleExtractions(targetRange, context, index); + ts.Debug.assert(extractions !== undefined, "The extraction went missing? How?"); + return ({ edits: extractions[0].changes }); + } + var Messages; + (function (Messages) { + function createMessage(message) { + return { message: message, code: 0, category: ts.DiagnosticCategory.Message, key: message }; + } + Messages.CannotExtractFunction = createMessage("Cannot extract function."); + Messages.StatementOrExpressionExpected = createMessage("Statement or expression expected."); + Messages.CannotExtractRangeContainingConditionalBreakOrContinueStatements = createMessage("Cannot extract range containing conditional break or continue statements."); + Messages.CannotExtractRangeContainingConditionalReturnStatement = createMessage("Cannot extract range containing conditional return statement."); + Messages.CannotExtractRangeContainingLabeledBreakOrContinueStatementWithTargetOutsideOfTheRange = createMessage("Cannot extract range containing labeled break or continue with target outside of the range."); + Messages.CannotExtractRangeThatContainsWritesToReferencesLocatedOutsideOfTheTargetRangeInGenerators = createMessage("Cannot extract range containing writes to references located outside of the target range in generators."); + Messages.TypeWillNotBeVisibleInTheNewScope = createMessage("Type will not visible in the new scope."); + Messages.FunctionWillNotBeVisibleInTheNewScope = createMessage("Function will not visible in the new scope."); + Messages.InsufficientSelection = createMessage("Select more than a single identifier."); + Messages.CannotExtractExportedEntity = createMessage("Cannot extract exported declaration"); + Messages.CannotCombineWritesAndReturns = createMessage("Cannot combine writes and returns"); + Messages.CannotExtractReadonlyPropertyInitializerOutsideConstructor = createMessage("Cannot move initialization of read-only class property outside of the constructor"); + Messages.CannotExtractAmbientBlock = createMessage("Cannot extract code from ambient contexts"); + })(Messages || (Messages = {})); + var RangeFacts; + (function (RangeFacts) { + RangeFacts[RangeFacts["None"] = 0] = "None"; + RangeFacts[RangeFacts["HasReturn"] = 1] = "HasReturn"; + RangeFacts[RangeFacts["IsGenerator"] = 2] = "IsGenerator"; + RangeFacts[RangeFacts["IsAsyncFunction"] = 4] = "IsAsyncFunction"; + RangeFacts[RangeFacts["UsesThis"] = 8] = "UsesThis"; + RangeFacts[RangeFacts["InStaticRegion"] = 16] = "InStaticRegion"; + })(RangeFacts = extractMethod_1.RangeFacts || (extractMethod_1.RangeFacts = {})); + function getRangeToExtract(sourceFile, span) { + var length = span.length || 0; + var start = getParentNodeInSpan(ts.getTokenAtPosition(sourceFile, span.start, false), sourceFile, span); + var end = getParentNodeInSpan(ts.findTokenOnLeftOfPosition(sourceFile, ts.textSpanEnd(span)), sourceFile, span); + var declarations = []; + var rangeFacts = RangeFacts.None; + if (!start || !end) { + return { errors: [ts.createFileDiagnostic(sourceFile, span.start, length, Messages.CannotExtractFunction)] }; + } + if (start.parent !== end.parent) { + var startParent = ts.skipParentheses(start.parent); + var endParent = ts.skipParentheses(end.parent); + if (ts.isBinaryExpression(startParent) && ts.isBinaryExpression(endParent) && ts.isNodeDescendantOf(startParent, endParent)) { + start = end = endParent; } else { - deleteNode(ctorDeclaration, true); + return createErrorResult(sourceFile, span.start, length, Messages.CannotExtractFunction); } - newClassDeclaration = createClassFromVariableDeclaration(ctorDeclaration); - break; + } + if (start !== end) { + if (!isBlockLike(start.parent)) { + return createErrorResult(sourceFile, span.start, length, Messages.CannotExtractFunction); + } + var statements = []; + for (var _i = 0, _a = start.parent.statements; _i < _a.length; _i++) { + var statement = _a[_i]; + if (statement === start || statements.length) { + var errors = checkNode(statement); + if (errors) { + return { errors: errors }; + } + statements.push(statement); + } + if (statement === end) { + break; + } + } + return { targetRange: { range: statements, facts: rangeFacts, declarations: declarations } }; + } + else { + var errors = checkRootNode(start) || checkNode(start); + if (errors) { + return { errors: errors }; + } + var range = ts.isStatement(start) + ? [start] + : start.parent && start.parent.kind === 210 + ? [start.parent] + : start; + return { targetRange: { range: range, facts: rangeFacts, declarations: declarations } }; + } + function createErrorResult(sourceFile, start, length, message) { + return { errors: [ts.createFileDiagnostic(sourceFile, start, length, message)] }; + } + function checkRootNode(node) { + if (ts.isIdentifier(node)) { + return [ts.createDiagnosticForNode(node, Messages.InsufficientSelection)]; + } + return undefined; + } + function checkForStaticContext(nodeToCheck, containingClass) { + var current = nodeToCheck; + while (current !== containingClass) { + if (current.kind === 149) { + if (ts.hasModifier(current, 32)) { + rangeFacts |= RangeFacts.InStaticRegion; + } + break; + } + else if (current.kind === 146) { + var ctorOrMethod = ts.getContainingFunction(current); + if (ctorOrMethod.kind === 152) { + rangeFacts |= RangeFacts.InStaticRegion; + } + break; + } + else if (current.kind === 151) { + if (ts.hasModifier(current, 32)) { + rangeFacts |= RangeFacts.InStaticRegion; + } + } + current = current.parent; + } + } + function checkNode(nodeToCheck) { + var PermittedJumps; + (function (PermittedJumps) { + PermittedJumps[PermittedJumps["None"] = 0] = "None"; + PermittedJumps[PermittedJumps["Break"] = 1] = "Break"; + PermittedJumps[PermittedJumps["Continue"] = 2] = "Continue"; + PermittedJumps[PermittedJumps["Return"] = 4] = "Return"; + })(PermittedJumps || (PermittedJumps = {})); + if (!ts.isStatement(nodeToCheck) && !(ts.isExpression(nodeToCheck) && isExtractableExpression(nodeToCheck))) { + return [ts.createDiagnosticForNode(nodeToCheck, Messages.StatementOrExpressionExpected)]; + } + if (ts.isInAmbientContext(nodeToCheck)) { + return [ts.createDiagnosticForNode(nodeToCheck, Messages.CannotExtractAmbientBlock)]; + } + var containingClass = ts.getContainingClass(nodeToCheck); + if (containingClass) { + checkForStaticContext(nodeToCheck, containingClass); + } + var errors; + var permittedJumps = 4; + var seenLabels; + visit(nodeToCheck); + return errors; + function visit(node) { + if (errors) { + return true; + } + if (ts.isDeclaration(node)) { + var declaringNode = (node.kind === 226) ? node.parent.parent : node; + if (ts.hasModifier(declaringNode, 1)) { + (errors || (errors = [])).push(ts.createDiagnosticForNode(node, Messages.CannotExtractExportedEntity)); + return true; + } + declarations.push(node.symbol); + } + switch (node.kind) { + case 238: + (errors || (errors = [])).push(ts.createDiagnosticForNode(node, Messages.CannotExtractFunction)); + return true; + case 97: + if (node.parent.kind === 181) { + var containingClass_1 = ts.getContainingClass(node); + if (containingClass_1.pos < span.start || containingClass_1.end >= (span.start + span.length)) { + (errors || (errors = [])).push(ts.createDiagnosticForNode(node, Messages.CannotExtractFunction)); + return true; + } + } + else { + rangeFacts |= RangeFacts.UsesThis; + } + break; + } + if (!node || ts.isFunctionLike(node) || ts.isClassLike(node)) { + switch (node.kind) { + case 228: + case 229: + if (node.parent.kind === 265 && node.parent.externalModuleIndicator === undefined) { + (errors || (errors = [])).push(ts.createDiagnosticForNode(node, Messages.FunctionWillNotBeVisibleInTheNewScope)); + } + break; + } + return false; + } + var savedPermittedJumps = permittedJumps; + if (node.parent) { + switch (node.parent.kind) { + case 211: + if (node.parent.thenStatement === node || node.parent.elseStatement === node) { + permittedJumps = 0; + } + break; + case 224: + if (node.parent.tryBlock === node) { + permittedJumps = 0; + } + else if (node.parent.finallyBlock === node) { + permittedJumps = 4; + } + break; + case 260: + if (node.parent.block === node) { + permittedJumps = 0; + } + break; + case 257: + if (node.expression !== node) { + permittedJumps |= 1; + } + break; + default: + if (ts.isIterationStatement(node.parent, false)) { + if (node.parent.statement === node) { + permittedJumps |= 1 | 2; + } + } + break; + } + } + switch (node.kind) { + case 169: + case 99: + rangeFacts |= RangeFacts.UsesThis; + break; + case 222: + { + var label = node.label; + (seenLabels || (seenLabels = [])).push(label.escapedText); + ts.forEachChild(node, visit); + seenLabels.pop(); + break; + } + case 218: + case 217: + { + var label = node.label; + if (label) { + if (!ts.contains(seenLabels, label.escapedText)) { + (errors || (errors = [])).push(ts.createDiagnosticForNode(node, Messages.CannotExtractRangeContainingLabeledBreakOrContinueStatementWithTargetOutsideOfTheRange)); + } + } + else { + if (!(permittedJumps & (218 ? 1 : 2))) { + (errors || (errors = [])).push(ts.createDiagnosticForNode(node, Messages.CannotExtractRangeContainingConditionalBreakOrContinueStatements)); + } + } + break; + } + case 191: + rangeFacts |= RangeFacts.IsAsyncFunction; + break; + case 197: + rangeFacts |= RangeFacts.IsGenerator; + break; + case 219: + if (permittedJumps & 4) { + rangeFacts |= RangeFacts.HasReturn; + } + else { + (errors || (errors = [])).push(ts.createDiagnosticForNode(node, Messages.CannotExtractRangeContainingConditionalReturnStatement)); + } + break; + default: + ts.forEachChild(node, visit); + break; + } + permittedJumps = savedPermittedJumps; + } + } } - if (!newClassDeclaration) { - return undefined; + extractMethod_1.getRangeToExtract = getRangeToExtract; + function isValidExtractionTarget(node) { + return (node.kind === 228) || ts.isSourceFile(node) || ts.isModuleBlock(node) || ts.isClassLike(node); } - changeTracker.insertNodeAfter(sourceFile, precedingNode, newClassDeclaration, { suffix: newLine }); - for (var _i = 0, deletes_1 = deletes; _i < deletes_1.length; _i++) { - var deleteCallback = deletes_1[_i]; - deleteCallback(); + function collectEnclosingScopes(range) { + var current = isReadonlyArray(range.range) ? ts.firstOrUndefined(range.range) : range.range; + if (range.facts & RangeFacts.UsesThis) { + var containingClass = ts.getContainingClass(current); + if (containingClass) { + return [containingClass]; + } + } + var start = current; + var scopes = undefined; + while (current) { + if (current !== start && isValidExtractionTarget(current)) { + (scopes = scopes || []).push(current); + } + if (current && current.parent && current.parent.kind === 146) { + current = ts.findAncestor(current, function (parent) { return ts.isFunctionLike(parent); }).parent; + } + else { + current = current.parent; + } + } + return scopes; } - return { - edits: changeTracker.getChanges() - }; - function deleteNode(node, inList) { - if (inList === void 0) { inList = false; } - if (deletedNodes.some(function (n) { return ts.isNodeDescendantOf(node, n); })) { - return; + extractMethod_1.collectEnclosingScopes = collectEnclosingScopes; + function getPossibleExtractions(targetRange, context, requestedChangesIndex) { + if (requestedChangesIndex === void 0) { requestedChangesIndex = undefined; } + var sourceFile = context.file; + if (targetRange === undefined) { + return undefined; } - deletedNodes.push(node); - if (inList) { - deletes.push(function () { return changeTracker.deleteNodeInList(sourceFile, node); }); + var scopes = collectEnclosingScopes(targetRange); + if (scopes === undefined) { + return undefined; + } + var enclosingTextRange = getEnclosingTextRange(targetRange, sourceFile); + var _a = collectReadsAndWrites(targetRange, scopes, enclosingTextRange, sourceFile, context.program.getTypeChecker()), target = _a.target, usagesPerScope = _a.usagesPerScope, errorsPerScope = _a.errorsPerScope; + context.cancellationToken.throwIfCancellationRequested(); + if (requestedChangesIndex !== undefined) { + if (errorsPerScope[requestedChangesIndex].length) { + return undefined; + } + return [extractFunctionInScope(target, scopes[requestedChangesIndex], usagesPerScope[requestedChangesIndex], targetRange, context)]; } else { - deletes.push(function () { return changeTracker.deleteNode(sourceFile, node); }); + return scopes.map(function (scope, i) { + var errors = errorsPerScope[i]; + if (errors.length) { + return { + scope: scope, + scopeDescription: getDescriptionForScope(scope), + errors: errors + }; + } + return { scope: scope, scopeDescription: getDescriptionForScope(scope) }; + }); } } - function createClassElementsFromSymbol(symbol) { - var memberElements = []; - if (symbol.members) { - symbol.members.forEach(function (member) { - var memberElement = createClassElement(member, undefined); - if (memberElement) { - memberElements.push(memberElement); + extractMethod_1.getPossibleExtractions = getPossibleExtractions; + function getDescriptionForScope(scope) { + if (ts.isFunctionLike(scope)) { + switch (scope.kind) { + case 152: + return "constructor"; + case 186: + return scope.name + ? "function expression " + scope.name.getText() + : "anonymous function expression"; + case 228: + return "function " + scope.name.getText(); + case 187: + return "arrow function"; + case 151: + return "method " + scope.name.getText(); + case 153: + return "get " + scope.name.getText(); + case 154: + return "set " + scope.name.getText(); + } + } + else if (ts.isModuleBlock(scope)) { + return "namespace " + scope.parent.name.getText(); + } + else if (ts.isClassLike(scope)) { + return scope.kind === 229 + ? "class " + scope.name.text + : scope.name.text + ? "class expression " + scope.name.text + : "anonymous class expression"; + } + else if (ts.isSourceFile(scope)) { + return "file '" + scope.fileName + "'"; + } + else { + return "unknown"; + } + } + function getUniqueName(isNameOkay) { + var functionNameText = "newFunction"; + if (isNameOkay(functionNameText)) { + return functionNameText; + } + var i = 1; + while (!isNameOkay(functionNameText = "newFunction_" + i)) { + i++; + } + return functionNameText; + } + function extractFunctionInScope(node, scope, _a, range, context) { + var usagesInScope = _a.usages, substitutions = _a.substitutions; + var checker = context.program.getTypeChecker(); + var file = scope.getSourceFile(); + var functionNameText = getUniqueName(function (n) { return !file.identifiers.has(n); }); + var isJS = ts.isInJavaScriptFile(scope); + var functionName = ts.createIdentifier(functionNameText); + var functionReference = ts.createIdentifier(functionNameText); + var returnType = undefined; + var parameters = []; + var callArguments = []; + var writes; + usagesInScope.forEach(function (usage, name) { + var typeNode = undefined; + if (!isJS) { + var type = checker.getTypeOfSymbolAtLocation(usage.symbol, usage.node); + type = checker.getBaseTypeOfLiteralType(type); + typeNode = checker.typeToTypeNode(type, node, ts.NodeBuilderFlags.NoTruncation); + } + var paramDecl = ts.createParameter(undefined, undefined, undefined, name, undefined, typeNode); + parameters.push(paramDecl); + if (usage.usage === 2) { + (writes || (writes = [])).push(usage); + } + callArguments.push(ts.createIdentifier(name)); + }); + if (ts.isExpression(node) && !isJS) { + var contextualType = checker.getContextualType(node); + returnType = checker.typeToTypeNode(contextualType); + } + var _b = transformFunctionBody(node), body = _b.body, returnValueProperty = _b.returnValueProperty; + var newFunction; + if (ts.isClassLike(scope)) { + var modifiers = isJS ? [] : [ts.createToken(112)]; + if (range.facts & RangeFacts.InStaticRegion) { + modifiers.push(ts.createToken(115)); + } + if (range.facts & RangeFacts.IsAsyncFunction) { + modifiers.push(ts.createToken(120)); + } + newFunction = ts.createMethod(undefined, modifiers, range.facts & RangeFacts.IsGenerator ? ts.createToken(39) : undefined, functionName, undefined, [], parameters, returnType, body); + } + else { + newFunction = ts.createFunctionDeclaration(undefined, range.facts & RangeFacts.IsAsyncFunction ? [ts.createToken(120)] : undefined, range.facts & RangeFacts.IsGenerator ? ts.createToken(39) : undefined, functionName, [], parameters, returnType, body); + } + var changeTracker = ts.textChanges.ChangeTracker.fromCodeFixContext(context); + changeTracker.insertNodeBefore(context.file, scope.getLastToken(), newFunction, { prefix: context.newLineCharacter, suffix: context.newLineCharacter }); + var newNodes = []; + var call = ts.createCall(ts.isClassLike(scope) ? ts.createPropertyAccess(range.facts & RangeFacts.InStaticRegion ? ts.createIdentifier(scope.name.getText()) : ts.createThis(), functionReference) : functionReference, undefined, callArguments); + if (range.facts & RangeFacts.IsGenerator) { + call = ts.createYield(ts.createToken(39), call); + } + if (range.facts & RangeFacts.IsAsyncFunction) { + call = ts.createAwait(call); + } + if (writes) { + if (returnValueProperty) { + newNodes.push(ts.createVariableStatement(undefined, [ts.createVariableDeclaration(returnValueProperty, ts.createKeywordTypeNode(119))])); + } + var assignments = getPropertyAssignmentsForWrites(writes); + if (returnValueProperty) { + assignments.unshift(ts.createShorthandPropertyAssignment(returnValueProperty)); + } + if (assignments.length === 1) { + if (returnValueProperty) { + newNodes.push(ts.createReturn(ts.createIdentifier(returnValueProperty))); + } + else { + newNodes.push(ts.createStatement(ts.createBinary(assignments[0].name, 58, call))); + } + } + else { + newNodes.push(ts.createStatement(ts.createBinary(ts.createObjectLiteral(assignments), 58, call))); + if (returnValueProperty) { + newNodes.push(ts.createReturn(ts.createIdentifier(returnValueProperty))); } + } + } + else { + if (range.facts & RangeFacts.HasReturn) { + newNodes.push(ts.createReturn(call)); + } + else if (isReadonlyArray(range.range)) { + newNodes.push(ts.createStatement(call)); + } + else { + newNodes.push(call); + } + } + if (isReadonlyArray(range.range)) { + changeTracker.replaceNodesWithNodes(context.file, range.range, newNodes, { + nodeSeparator: context.newLineCharacter, + suffix: context.newLineCharacter }); } - if (symbol.exports) { - symbol.exports.forEach(function (member) { - var memberElement = createClassElement(member, [ts.createToken(115)]); - if (memberElement) { - memberElements.push(memberElement); + else { + changeTracker.replaceNodeWithNodes(context.file, range.range, newNodes, { nodeSeparator: context.newLineCharacter }); + } + return { + scope: scope, + scopeDescription: getDescriptionForScope(scope), + changes: changeTracker.getChanges() + }; + function getPropertyAssignmentsForWrites(writes) { + return writes.map(function (w) { return ts.createShorthandPropertyAssignment(w.symbol.name); }); + } + function generateReturnValueProperty() { + return "__return"; + } + function transformFunctionBody(body) { + if (ts.isBlock(body) && !writes && substitutions.size === 0) { + return { body: ts.createBlock(body.statements, true), returnValueProperty: undefined }; + } + var returnValueProperty; + var statements = ts.createNodeArray(ts.isBlock(body) ? body.statements.slice(0) : [ts.isStatement(body) ? body : ts.createReturn(body)]); + if (writes || substitutions.size) { + var rewrittenStatements = ts.visitNodes(statements, visitor).slice(); + if (writes && !(range.facts & RangeFacts.HasReturn) && ts.isStatement(body)) { + var assignments = getPropertyAssignmentsForWrites(writes); + if (assignments.length === 1) { + rewrittenStatements.push(ts.createReturn(assignments[0].name)); + } + else { + rewrittenStatements.push(ts.createReturn(ts.createObjectLiteral(assignments))); + } + } + return { body: ts.createBlock(rewrittenStatements, true), returnValueProperty: returnValueProperty }; + } + else { + return { body: ts.createBlock(statements, true), returnValueProperty: undefined }; + } + function visitor(node) { + if (node.kind === 219 && writes) { + var assignments = getPropertyAssignmentsForWrites(writes); + if (node.expression) { + if (!returnValueProperty) { + returnValueProperty = generateReturnValueProperty(); + } + assignments.unshift(ts.createPropertyAssignment(returnValueProperty, ts.visitNode(node.expression, visitor))); + } + if (assignments.length === 1) { + return ts.createReturn(assignments[0].name); + } + else { + return ts.createReturn(ts.createObjectLiteral(assignments)); + } + } + else { + var substitution = substitutions.get(ts.getNodeId(node).toString()); + return substitution || ts.visitEachChild(node, visitor, ts.nullTransformationContext); + } + } + } + } + extractMethod_1.extractFunctionInScope = extractFunctionInScope; + function isReadonlyArray(v) { + return ts.isArray(v); + } + function getEnclosingTextRange(targetRange, sourceFile) { + return isReadonlyArray(targetRange.range) + ? { pos: targetRange.range[0].getStart(sourceFile), end: targetRange.range[targetRange.range.length - 1].getEnd() } + : targetRange.range; + } + var Usage; + (function (Usage) { + Usage[Usage["Read"] = 1] = "Read"; + Usage[Usage["Write"] = 2] = "Write"; + })(Usage || (Usage = {})); + function collectReadsAndWrites(targetRange, scopes, enclosingTextRange, sourceFile, checker) { + var usagesPerScope = []; + var substitutionsPerScope = []; + var errorsPerScope = []; + var visibleDeclarationsInExtractedRange = []; + for (var _i = 0, scopes_1 = scopes; _i < scopes_1.length; _i++) { + var _ = scopes_1[_i]; + usagesPerScope.push({ usages: ts.createMap(), substitutions: ts.createMap() }); + substitutionsPerScope.push(ts.createMap()); + errorsPerScope.push([]); + } + var seenUsages = ts.createMap(); + var target = isReadonlyArray(targetRange.range) ? ts.createBlock(targetRange.range) : targetRange.range; + var containingLexicalScopeOfExtraction = ts.isBlockScope(scopes[0], scopes[0].parent) ? scopes[0] : ts.getEnclosingBlockScopeContainer(scopes[0]); + collectUsages(target); + var _loop_8 = function (i) { + var hasWrite = false; + var readonlyClassPropertyWrite = undefined; + usagesPerScope[i].usages.forEach(function (value) { + if (value.usage === 2) { + hasWrite = true; + if (value.symbol.flags & 106500 && + value.symbol.valueDeclaration && + ts.hasModifier(value.symbol.valueDeclaration, 64)) { + readonlyClassPropertyWrite = value.symbol.valueDeclaration; + } } }); + if (hasWrite && !isReadonlyArray(targetRange.range) && ts.isExpression(targetRange.range)) { + errorsPerScope[i].push(ts.createDiagnosticForNode(targetRange.range, Messages.CannotCombineWritesAndReturns)); + } + else if (readonlyClassPropertyWrite && i > 0) { + errorsPerScope[i].push(ts.createDiagnosticForNode(readonlyClassPropertyWrite, Messages.CannotCombineWritesAndReturns)); + } + }; + for (var i = 0; i < scopes.length; i++) { + _loop_8(i); } - return memberElements; - function shouldConvertDeclaration(_target, source) { - return ts.isFunctionLike(source); + if (visibleDeclarationsInExtractedRange.length) { + ts.forEachChild(containingLexicalScopeOfExtraction, checkForUsedDeclarations); } - function createClassElement(symbol, modifiers) { - if (!(symbol.flags & 4)) { - return; + return { target: target, usagesPerScope: usagesPerScope, errorsPerScope: errorsPerScope }; + function collectUsages(node, valueUsage) { + if (valueUsage === void 0) { valueUsage = 1; } + if (ts.isDeclaration(node) && node.symbol) { + visibleDeclarationsInExtractedRange.push(node.symbol); } - var memberDeclaration = symbol.valueDeclaration; - var assignmentBinaryExpression = memberDeclaration.parent; - if (!shouldConvertDeclaration(memberDeclaration, assignmentBinaryExpression.right)) { - return; + if (ts.isAssignmentExpression(node)) { + collectUsages(node.left, 2); + collectUsages(node.right); } - var nodeToDelete = assignmentBinaryExpression.parent && assignmentBinaryExpression.parent.kind === 210 - ? assignmentBinaryExpression.parent : assignmentBinaryExpression; - deleteNode(nodeToDelete); - if (!assignmentBinaryExpression.right) { - return ts.createProperty([], modifiers, symbol.name, undefined, undefined, undefined); - } - switch (assignmentBinaryExpression.right.kind) { - case 186: { - var functionExpression = assignmentBinaryExpression.right; - var method = ts.createMethod(undefined, modifiers, undefined, memberDeclaration.name, undefined, undefined, functionExpression.parameters, undefined, functionExpression.body); - copyComments(assignmentBinaryExpression, method); - return method; - } - case 187: { - var arrowFunction = assignmentBinaryExpression.right; - var arrowFunctionBody = arrowFunction.body; - var bodyBlock = void 0; - if (arrowFunctionBody.kind === 207) { - bodyBlock = arrowFunctionBody; + else if (ts.isUnaryExpressionWithWrite(node)) { + collectUsages(node.operand, 2); + } + else if (ts.isPropertyAccessExpression(node) || ts.isElementAccessExpression(node)) { + ts.forEachChild(node, collectUsages); + } + else if (ts.isIdentifier(node)) { + if (!node.parent) { + return; + } + if (ts.isQualifiedName(node.parent) && node !== node.parent.left) { + return; + } + if (ts.isPropertyAccessExpression(node.parent) && node !== node.parent.expression) { + return; + } + recordUsage(node, valueUsage, ts.isPartOfTypeNode(node)); + } + else { + ts.forEachChild(node, collectUsages); + } + } + function recordUsage(n, usage, isTypeNode) { + var symbolId = recordUsagebySymbol(n, usage, isTypeNode); + if (symbolId) { + for (var i = 0; i < scopes.length; i++) { + var substitition = substitutionsPerScope[i].get(symbolId); + if (substitition) { + usagesPerScope[i].substitutions.set(ts.getNodeId(n).toString(), substitition); } - else { - var expression = arrowFunctionBody; - bodyBlock = ts.createBlock([ts.createReturn(expression)]); + } + } + } + function recordUsagebySymbol(identifier, usage, isTypeName) { + var symbol = checker.getSymbolAtLocation(identifier); + if (!symbol) { + return undefined; + } + var symbolId = ts.getSymbolId(symbol).toString(); + var lastUsage = seenUsages.get(symbolId); + if (lastUsage && lastUsage >= usage) { + return symbolId; + } + seenUsages.set(symbolId, usage); + if (lastUsage) { + for (var _i = 0, usagesPerScope_1 = usagesPerScope; _i < usagesPerScope_1.length; _i++) { + var perScope = usagesPerScope_1[_i]; + var prevEntry = perScope.usages.get(identifier.text); + if (prevEntry) { + perScope.usages.set(identifier.text, { usage: usage, symbol: symbol, node: identifier }); } - var method = ts.createMethod(undefined, modifiers, undefined, memberDeclaration.name, undefined, undefined, arrowFunction.parameters, undefined, bodyBlock); - copyComments(assignmentBinaryExpression, method); - return method; } - default: { - if (ts.isSourceFileJavaScript(sourceFile)) { - return; + return symbolId; + } + var declInFile = ts.find(symbol.getDeclarations(), function (d) { return d.getSourceFile() === sourceFile; }); + if (!declInFile) { + return undefined; + } + if (ts.rangeContainsRange(enclosingTextRange, declInFile)) { + return undefined; + } + if (targetRange.facts & RangeFacts.IsGenerator && usage === 2) { + for (var _a = 0, errorsPerScope_1 = errorsPerScope; _a < errorsPerScope_1.length; _a++) { + var errors = errorsPerScope_1[_a]; + errors.push(ts.createDiagnosticForNode(identifier, Messages.CannotExtractRangeThatContainsWritesToReferencesLocatedOutsideOfTheTargetRangeInGenerators)); + } + } + for (var i = 0; i < scopes.length; i++) { + var scope = scopes[i]; + var resolvedSymbol = checker.resolveName(symbol.name, scope, symbol.flags); + if (resolvedSymbol === symbol) { + continue; + } + if (!substitutionsPerScope[i].has(symbolId)) { + var substitution = tryReplaceWithQualifiedNameOrPropertyAccess(symbol.exportSymbol || symbol, scope, isTypeName); + if (substitution) { + substitutionsPerScope[i].set(symbolId, substitution); + } + else if (isTypeName) { + errorsPerScope[i].push(ts.createDiagnosticForNode(identifier, Messages.TypeWillNotBeVisibleInTheNewScope)); + } + else { + usagesPerScope[i].usages.set(identifier.text, { usage: usage, symbol: symbol, node: identifier }); } - var prop = ts.createProperty(undefined, modifiers, memberDeclaration.name, undefined, undefined, assignmentBinaryExpression.right); - copyComments(assignmentBinaryExpression.parent, prop); - return prop; } } + return symbolId; } - } - function copyComments(sourceNode, targetNode) { - ts.forEachLeadingCommentRange(sourceFile.text, sourceNode.pos, function (pos, end, kind, htnl) { - if (kind === 3) { - pos += 2; - end -= 2; + function checkForUsedDeclarations(node) { + if (node === targetRange.range || (isReadonlyArray(targetRange.range) && targetRange.range.indexOf(node) >= 0)) { + return; + } + var sym = checker.getSymbolAtLocation(node); + if (sym && visibleDeclarationsInExtractedRange.some(function (d) { return d === sym; })) { + for (var _i = 0, errorsPerScope_2 = errorsPerScope; _i < errorsPerScope_2.length; _i++) { + var scope = errorsPerScope_2[_i]; + scope.push(ts.createDiagnosticForNode(node, Messages.CannotExtractExportedEntity)); + } + return true; } else { - pos += 2; + ts.forEachChild(node, checkForUsedDeclarations); } - ts.addSyntheticLeadingComment(targetNode, kind, sourceFile.text.slice(pos, end), htnl); - }); + } + function tryReplaceWithQualifiedNameOrPropertyAccess(symbol, scopeDecl, isTypeNode) { + if (!symbol) { + return undefined; + } + if (symbol.getDeclarations().some(function (d) { return d.parent === scopeDecl; })) { + return ts.createIdentifier(symbol.name); + } + var prefix = tryReplaceWithQualifiedNameOrPropertyAccess(symbol.parent, scopeDecl, isTypeNode); + if (prefix === undefined) { + return undefined; + } + return isTypeNode ? ts.createQualifiedName(prefix, ts.createIdentifier(symbol.name)) : ts.createPropertyAccess(prefix, symbol.name); + } } - function createClassFromVariableDeclaration(node) { - var initializer = node.initializer; - if (!initializer || initializer.kind !== 186) { + function getParentNodeInSpan(node, file, span) { + if (!node) return undefined; + while (node.parent) { + if (ts.isSourceFile(node.parent) || !spanContainsNode(span, node.parent, file)) { + return node; + } + node = node.parent; } - if (node.name.kind !== 71) { - return undefined; + } + function spanContainsNode(span, node, file) { + return ts.textSpanContainsPosition(span, node.getStart(file)) && + node.getEnd() <= ts.textSpanEnd(span); + } + function isExtractableExpression(node) { + switch (node.parent.kind) { + case 264: + return false; } - var memberElements = createClassElementsFromSymbol(initializer.symbol); - if (initializer.body) { - memberElements.unshift(ts.createConstructor(undefined, undefined, initializer.parameters, initializer.body)); + switch (node.kind) { + case 9: + return node.parent.kind !== 238 && + node.parent.kind !== 242; + case 198: + case 174: + case 176: + return false; + case 71: + return node.parent.kind !== 176 && + node.parent.kind !== 242 && + node.parent.kind !== 246; } - var cls = ts.createClassDeclaration(undefined, undefined, node.name, undefined, undefined, memberElements); - return cls; + return true; } - function createClassFromFunctionDeclaration(node) { - var memberElements = createClassElementsFromSymbol(ctorSymbol); - if (node.body) { - memberElements.unshift(ts.createConstructor(undefined, undefined, node.parameters, node.body)); + function isBlockLike(node) { + switch (node.kind) { + case 207: + case 265: + case 234: + case 257: + return true; + default: + return false; } - var cls = ts.createClassDeclaration(undefined, undefined, node.name, undefined, undefined, memberElements); - return cls; } - } + })(extractMethod = refactor.extractMethod || (refactor.extractMethod = {})); })(refactor = ts.refactor || (ts.refactor = {})); })(ts || (ts = {})); var ts; @@ -74186,12 +75614,14 @@ var ts; ts.scanner.setTextPos(pos); while (pos < end) { var token = ts.scanner.scan(); - ts.Debug.assert(token !== 1); var textPos = ts.scanner.getTextPos(); if (textPos <= end) { nodes.push(createNode(token, pos, textPos, this)); } pos = textPos; + if (token === 1) { + break; + } } return pos; }; @@ -74986,8 +76416,8 @@ var ts; if (program) { var oldSourceFiles = program.getSourceFiles(); var oldSettingsKey = documentRegistry.getKeyForCompilationSettings(oldSettings); - for (var _i = 0, oldSourceFiles_1 = oldSourceFiles; _i < oldSourceFiles_1.length; _i++) { - var oldSourceFile = oldSourceFiles_1[_i]; + for (var _i = 0, oldSourceFiles_2 = oldSourceFiles; _i < oldSourceFiles_2.length; _i++) { + var oldSourceFile = oldSourceFiles_2[_i]; if (!newProgram.getSourceFile(oldSourceFile.fileName) || shouldCreateNewSourceFiles) { documentRegistry.releaseDocumentWithKey(oldSourceFile.path, oldSettingsKey); } @@ -75009,7 +76439,7 @@ var ts; if (!shouldCreateNewSourceFiles) { var oldSourceFile = program && program.getSourceFileByPath(path); if (oldSourceFile) { - ts.Debug.assert(hostFileInformation.scriptKind === oldSourceFile.scriptKind, "Registered script kind (" + oldSourceFile.scriptKind + ") should match new script kind (" + hostFileInformation.scriptKind + ") for file: " + path); + ts.Debug.assertEqual(hostFileInformation.scriptKind, oldSourceFile.scriptKind, "Registered script kind should match new script kind.", path); return documentRegistry.updateDocumentWithKey(fileName, path, newSettings, documentRegistryBucketKey, hostFileInformation.scriptSnapshot, hostFileInformation.version, hostFileInformation.scriptKind); } } @@ -75372,17 +76802,19 @@ var ts; function getFormattingEditsAfterKeystroke(fileName, position, key, options) { var sourceFile = syntaxTreeCache.getCurrentSourceFile(fileName); var settings = toEditorSettings(options); - if (key === "{") { - return ts.formatting.formatOnOpeningCurly(position, sourceFile, getRuleProvider(settings), settings); - } - else if (key === "}") { - return ts.formatting.formatOnClosingCurly(position, sourceFile, getRuleProvider(settings), settings); - } - else if (key === ";") { - return ts.formatting.formatOnSemicolon(position, sourceFile, getRuleProvider(settings), settings); - } - else if (key === "\n") { - return ts.formatting.formatOnEnter(position, sourceFile, getRuleProvider(settings), settings); + if (!ts.isInComment(sourceFile, position)) { + if (key === "{") { + return ts.formatting.formatOnOpeningCurly(position, sourceFile, getRuleProvider(settings), settings); + } + else if (key === "}") { + return ts.formatting.formatOnClosingCurly(position, sourceFile, getRuleProvider(settings), settings); + } + else if (key === ";") { + return ts.formatting.formatOnSemicolon(position, sourceFile, getRuleProvider(settings), settings); + } + else if (key === "\n") { + return ts.formatting.formatOnEnter(position, sourceFile, getRuleProvider(settings), settings); + } } return []; } @@ -75422,6 +76854,11 @@ var ts; } return true; } + function getSpanOfEnclosingComment(fileName, position, onlyMultiLine) { + var sourceFile = syntaxTreeCache.getCurrentSourceFile(fileName); + var range = ts.formatting.getRangeOfEnclosingComment(sourceFile, position, onlyMultiLine); + return range && ts.createTextSpanFromRange(range); + } function getTodoComments(fileName, descriptors) { synchronizeHostData(); var sourceFile = getValidSourceFile(fileName); @@ -75545,6 +76982,7 @@ var ts; getFormattingEditsAfterKeystroke: getFormattingEditsAfterKeystroke, getDocCommentTemplateAtPosition: getDocCommentTemplateAtPosition, isValidBraceCompletionAtPosition: isValidBraceCompletionAtPosition, + getSpanOfEnclosingComment: getSpanOfEnclosingComment, getCodeFixesAtPosition: getCodeFixesAtPosition, getEmitOutput: getEmitOutput, getNonBoundSourceFile: getNonBoundSourceFile, @@ -75615,12 +77053,16 @@ var ts; function getPropertySymbolsFromContextualType(typeChecker, node) { var objectLiteral = node.parent; var contextualType = typeChecker.getContextualType(objectLiteral); - var name = ts.unescapeLeadingUnderscores(ts.getTextOfPropertyName(node.name)); - if (name && contextualType) { + return getPropertySymbolsFromType(contextualType, node.name); + } + ts.getPropertySymbolsFromContextualType = getPropertySymbolsFromContextualType; + function getPropertySymbolsFromType(type, propName) { + var name = ts.unescapeLeadingUnderscores(ts.getTextOfPropertyName(propName)); + if (name && type) { var result_10 = []; - var symbol = contextualType.getProperty(name); - if (contextualType.flags & 65536) { - ts.forEach(contextualType.types, function (t) { + var symbol = type.getProperty(name); + if (type.flags & 65536) { + ts.forEach(type.types, function (t) { var symbol = t.getProperty(name); if (symbol) { result_10.push(symbol); @@ -75635,7 +77077,7 @@ var ts; } return undefined; } - ts.getPropertySymbolsFromContextualType = getPropertySymbolsFromContextualType; + ts.getPropertySymbolsFromType = getPropertySymbolsFromType; function isArgumentOfElementAccessExpression(node) { return node && node.parent && @@ -76012,6 +77454,10 @@ var ts; var _this = this; return this.forwardJSONCall("isValidBraceCompletionAtPosition('" + fileName + "', " + position + ", " + openingBrace + ")", function () { return _this.languageService.isValidBraceCompletionAtPosition(fileName, position, openingBrace); }); }; + LanguageServiceShimObject.prototype.getSpanOfEnclosingComment = function (fileName, position, onlyMultiLine) { + var _this = this; + return this.forwardJSONCall("getSpanOfEnclosingComment('" + fileName + "', " + position + ")", function () { return _this.languageService.getSpanOfEnclosingComment(fileName, position, onlyMultiLine); }); + }; LanguageServiceShimObject.prototype.getIndentationAtPosition = function (fileName, position, options) { var _this = this; return this.forwardJSONCall("getIndentationAtPosition('" + fileName + "', " + position + ")", function () { @@ -76307,7 +77753,7 @@ var TypeScript; Services.TypeScriptServicesFactory = ts.TypeScriptServicesFactory; })(Services = TypeScript.Services || (TypeScript.Services = {})); })(TypeScript || (TypeScript = {})); -var toolsVersion = "2.5"; +var toolsVersion = "2.6"; var ts; (function (ts) { var server; @@ -76323,6 +77769,7 @@ var ts; Arguments.LogFile = "--logFile"; Arguments.EnableTelemetry = "--enableTelemetry"; Arguments.TypingSafeListLocation = "--typingSafeListLocation"; + Arguments.TypesMapLocation = "--typesMapLocation"; Arguments.NpmLocation = "--npmLocation"; })(Arguments = server.Arguments || (server.Arguments = {})); function hasArgument(argumentName) { @@ -76370,7 +77817,7 @@ var ts; function createInstallTypingsRequest(project, typeAcquisition, unresolvedImports, cachePath) { return { projectName: project.getProjectName(), - fileNames: project.getFileNames(true, true), + fileNames: project.getFileNames(true, true).concat(project.getExcludedFiles()), compilerOptions: project.getCompilerOptions(), typeAcquisition: typeAcquisition, unresolvedImports: unresolvedImports, @@ -76470,42 +77917,6 @@ var ts; return []; } server.createSortedArray = createSortedArray; - function toSortedArray(arr, comparer) { - arr.sort(comparer); - return arr; - } - server.toSortedArray = toSortedArray; - function enumerateInsertsAndDeletes(newItems, oldItems, inserted, deleted, compare) { - compare = compare || ts.compareValues; - var newIndex = 0; - var oldIndex = 0; - var newLen = newItems.length; - var oldLen = oldItems.length; - while (newIndex < newLen && oldIndex < oldLen) { - var newItem = newItems[newIndex]; - var oldItem = oldItems[oldIndex]; - var compareResult = compare(newItem, oldItem); - if (compareResult === -1) { - inserted(newItem); - newIndex++; - } - else if (compareResult === 1) { - deleted(oldItem); - oldIndex++; - } - else { - newIndex++; - oldIndex++; - } - } - while (newIndex < newLen) { - inserted(newItems[newIndex++]); - } - while (oldIndex < oldLen) { - deleted(oldItems[oldIndex++]); - } - } - server.enumerateInsertsAndDeletes = enumerateInsertsAndDeletes; var ThrottledOperations = (function () { function ThrottledOperations(host) { this.host = host; @@ -76550,6 +77961,11 @@ var ts; return GcTimer; }()); server.GcTimer = GcTimer; + })(server = ts.server || (ts.server = {})); +})(ts || (ts = {})); +(function (ts) { + var server; + (function (server) { function insertSorted(array, insert, compare) { if (array.length === 0) { array.push(insert); @@ -76575,6 +77991,51 @@ var ts; } } server.removeSorted = removeSorted; + function toSortedArray(arr, comparer) { + arr.sort(comparer); + return arr; + } + server.toSortedArray = toSortedArray; + function toDeduplicatedSortedArray(arr) { + arr.sort(); + ts.filterMutate(arr, isNonDuplicateInSortedArray); + return arr; + } + server.toDeduplicatedSortedArray = toDeduplicatedSortedArray; + function isNonDuplicateInSortedArray(value, index, array) { + return index === 0 || value !== array[index - 1]; + } + function enumerateInsertsAndDeletes(newItems, oldItems, inserted, deleted, compare) { + compare = compare || ts.compareValues; + var newIndex = 0; + var oldIndex = 0; + var newLen = newItems.length; + var oldLen = oldItems.length; + while (newIndex < newLen && oldIndex < oldLen) { + var newItem = newItems[newIndex]; + var oldItem = oldItems[oldIndex]; + var compareResult = compare(newItem, oldItem); + if (compareResult === -1) { + inserted(newItem); + newIndex++; + } + else if (compareResult === 1) { + deleted(oldItem); + oldIndex++; + } + else { + newIndex++; + oldIndex++; + } + } + while (newIndex < newLen) { + inserted(newItems[newIndex++]); + } + while (oldIndex < oldLen) { + deleted(oldItems[oldIndex++]); + } + } + server.enumerateInsertsAndDeletes = enumerateInsertsAndDeletes; })(server = ts.server || (ts.server = {})); })(ts || (ts = {})); var ts; @@ -76588,6 +78049,7 @@ var ts; CommandTypes["Brace"] = "brace"; CommandTypes["BraceFull"] = "brace-full"; CommandTypes["BraceCompletion"] = "braceCompletion"; + CommandTypes["GetSpanOfEnclosingComment"] = "getSpanOfEnclosingComment"; CommandTypes["Change"] = "change"; CommandTypes["Close"] = "close"; CommandTypes["Completions"] = "completions"; @@ -76679,6 +78141,7 @@ var ts; ModuleKind["System"] = "System"; ModuleKind["ES6"] = "ES6"; ModuleKind["ES2015"] = "ES2015"; + ModuleKind["ESNext"] = "ESNext"; })(ModuleKind = protocol.ModuleKind || (protocol.ModuleKind = {})); var ModuleResolutionKind; (function (ModuleResolutionKind) { @@ -76696,6 +78159,9 @@ var ts; ScriptTarget["ES5"] = "ES5"; ScriptTarget["ES6"] = "ES6"; ScriptTarget["ES2015"] = "ES2015"; + ScriptTarget["ES2016"] = "ES2016"; + ScriptTarget["ES2017"] = "ES2017"; + ScriptTarget["ESNext"] = "ESNext"; })(ScriptTarget = protocol.ScriptTarget || (protocol.ScriptTarget = {})); })(protocol = server.protocol || (server.protocol = {})); })(server = ts.server || (ts.server = {})); @@ -76713,7 +78179,7 @@ var ts; } TextStorage.prototype.getVersion = function () { return this.svc - ? "SVC-" + this.svcVersion + "-" + this.svc.getSnapshot().version + ? "SVC-" + this.svcVersion + "-" + this.svc.getSnapshotVersion() : "Text-" + this.textVersion; }; TextStorage.prototype.hasScriptVersionCache = function () { @@ -76751,7 +78217,7 @@ var ts; : ts.ScriptSnapshot.fromString(this.getOrLoadText()); }; TextStorage.prototype.getLineInfo = function (line) { - return this.switchToScriptVersionCache().getSnapshot().index.lineNumberToInfo(line); + return this.switchToScriptVersionCache().getLineInfo(line); }; TextStorage.prototype.lineToTextSpan = function (line) { if (!this.svc) { @@ -76760,23 +78226,20 @@ var ts; var end = line + 1 < lineMap.length ? lineMap[line + 1] : this.text.length; return ts.createTextSpanFromBounds(start, end); } - var index = this.svc.getSnapshot().index; - var _a = index.lineNumberToInfo(line + 1), lineText = _a.lineText, absolutePosition = _a.absolutePosition; - var len = lineText !== undefined ? lineText.length : index.absolutePositionOfStartOfLine(line + 2) - absolutePosition; - return ts.createTextSpan(absolutePosition, len); + return this.svc.lineToTextSpan(line); }; TextStorage.prototype.lineOffsetToPosition = function (line, offset) { if (!this.svc) { return ts.computePositionOfLineAndCharacter(this.getLineMap(), line - 1, offset - 1, this.text); } - return this.svc.getSnapshot().index.absolutePositionOfStartOfLine(line) + (offset - 1); + return this.svc.lineOffsetToPosition(line, offset); }; TextStorage.prototype.positionToLineOffset = function (position) { if (!this.svc) { var _a = ts.computeLineAndCharacterOfPosition(this.getLineMap(), position), line = _a.line, character = _a.character; return { line: line + 1, offset: character + 1 }; } - return this.svc.getSnapshot().index.positionToLineOffset(position); + return this.svc.positionToLineOffset(position); }; TextStorage.prototype.getFileText = function (tempFileName) { return this.host.readFile(tempFileName || this.fileName) || ""; @@ -77685,7 +79148,8 @@ var ts; log("Loading " + moduleName + " from " + initialDir + " (resolved to " + resolvedPath + ")"); var result = host.require(resolvedPath, moduleName); if (result.error) { - log("Failed to load module: " + JSON.stringify(result.error)); + var err = result.error.stack || result.error.message || JSON.stringify(result.error); + log("Failed to load module '" + moduleName + "': " + err); return undefined; } return result.module; @@ -77815,7 +79279,7 @@ var ts; return ts.map(this.program.getSourceFiles(), function (sourceFile) { var scriptInfo = _this.projectService.getScriptInfoForPath(sourceFile.path); if (!scriptInfo) { - ts.Debug.assert(false, "scriptInfo for a file '" + sourceFile.fileName + "' is missing."); + ts.Debug.fail("scriptInfo for a file '" + sourceFile.fileName + "' is missing."); } return scriptInfo; }); @@ -77826,6 +79290,9 @@ var ts; } return this.getLanguageService().getEmitOutput(info.fileName, emitOnlyDtsFiles); }; + Project.prototype.getExcludedFiles = function () { + return server.emptyArray; + }; Project.prototype.getFileNames = function (excludeFilesFromExternalLibraries, excludeConfigFiles) { if (!this.program) { return []; @@ -77977,7 +79444,7 @@ var ts; var sourceFile = _b[_a]; this.extractUnresolvedImportsFromSourceFile(sourceFile, result); } - this.lastCachedUnresolvedImportsList = server.toSortedArray(result); + this.lastCachedUnresolvedImportsList = server.toDeduplicatedSortedArray(result); } unresolvedImports = this.lastCachedUnresolvedImportsList; var cachedTypings = this.projectService.typingsCache.getTypingsForProject(this, unresolvedImports, hasChanges); @@ -78029,7 +79496,7 @@ var ts; fileWatcher.close(); } }); - var _loop_8 = function (missingFilePath) { + var _loop_9 = function (missingFilePath) { if (!this_1.missingFilesMap.has(missingFilePath)) { var fileWatcher_1 = this_1.projectService.host.watchFile(missingFilePath, function (_filename, eventKind) { if (eventKind === ts.FileWatcherEventKind.Created && _this.missingFilesMap.has(missingFilePath)) { @@ -78045,7 +79512,7 @@ var ts; var this_1 = this; for (var _b = 0, missingFilePaths_1 = missingFilePaths; _b < missingFilePaths_1.length; _b++) { var missingFilePath = missingFilePaths_1[_b]; - _loop_8(missingFilePath); + _loop_9(missingFilePath); } } var oldExternalFiles = this.externalFiles || server.emptyArray; @@ -78209,10 +79676,11 @@ var ts; server.Project = Project; var InferredProject = (function (_super) { __extends(InferredProject, _super); - function InferredProject(projectService, documentRegistry, compilerOptions) { + function InferredProject(projectService, documentRegistry, compilerOptions, projectRootPath) { var _this = _super.call(this, InferredProject.newName(), ProjectKind.Inferred, projectService, documentRegistry, undefined, true, compilerOptions, false) || this; _this._isJsInferredProject = false; _this.directoriesWatchedForTsconfig = []; + _this.projectRootPath = projectRootPath; return _this; } InferredProject.prototype.toggleJsInferredProject = function (isJsInferredProject) { @@ -78316,7 +79784,7 @@ var ts; } } if (this.projectService.globalPlugins) { - var _loop_9 = function (globalPluginName) { + var _loop_10 = function (globalPluginName) { if (options.plugins && options.plugins.some(function (p) { return p.name === globalPluginName; })) return "continue"; this_2.enablePlugin({ name: globalPluginName, global: true }, searchPaths); @@ -78324,7 +79792,7 @@ var ts; var this_2 = this; for (var _b = 0, _c = this.projectService.globalPlugins; _b < _c.length; _b++) { var globalPluginName = _c[_b]; - _loop_9(globalPluginName); + _loop_10(globalPluginName); } } }; @@ -78447,10 +79915,12 @@ var ts; } this.typeRootsWatchers = undefined; } - this.directoriesWatchedForWildcards.forEach(function (watcher) { - watcher.close(); - }); - this.directoriesWatchedForWildcards = undefined; + if (this.directoriesWatchedForWildcards) { + this.directoriesWatchedForWildcards.forEach(function (watcher) { + watcher.close(); + }); + this.directoriesWatchedForWildcards = undefined; + } this.stopWatchingDirectory(); }; ConfiguredProject.prototype.addOpenRef = function () { @@ -78473,8 +79943,12 @@ var ts; _this.externalProjectName = externalProjectName; _this.compileOnSaveEnabled = compileOnSaveEnabled; _this.projectFilePath = projectFilePath; + _this.excludedFiles = []; return _this; } + ExternalProject.prototype.getExcludedFiles = function () { + return this.excludedFiles; + }; ExternalProject.prototype.getProjectRootPath = function () { if (this.projectFilePath) { return ts.getDirectoryPath(this.projectFilePath); @@ -78680,6 +80154,7 @@ var ts; this.inferredProjects = []; this.configuredProjects = []; this.openFiles = []; + this.compilerOptionsForInferredProjectsPerProjectRoot = ts.createMap(); this.projectToSizeMap = ts.createMap(); this.safelist = defaultTypeSafeList; this.seenProjects = ts.createMap(); @@ -78687,16 +80162,21 @@ var ts; this.logger = opts.logger; this.cancellationToken = opts.cancellationToken; this.useSingleInferredProject = opts.useSingleInferredProject; + this.useInferredProjectPerProjectRoot = opts.useInferredProjectPerProjectRoot; this.typingsInstaller = opts.typingsInstaller || server.nullTypingsInstaller; this.throttleWaitMilliseconds = opts.throttleWaitMilliseconds; this.eventHandler = opts.eventHandler; this.globalPlugins = opts.globalPlugins || server.emptyArray; this.pluginProbeLocations = opts.pluginProbeLocations || server.emptyArray; this.allowLocalPluginLoads = !!opts.allowLocalPluginLoads; + this.typesMapLocation = (opts.typesMapLocation === undefined) ? ts.combinePaths(this.host.getExecutingFilePath(), "../typesMap.json") : opts.typesMapLocation; ts.Debug.assert(!!this.host.createHash, "'ServerHost.createHash' is required for ProjectService"); this.toCanonicalFileName = ts.createGetCanonicalFileName(this.host.useCaseSensitiveFileNames); this.directoryWatchers = new DirectoryWatchers(this); this.throttledOperations = new server.ThrottledOperations(this.host); + if (opts.typesMapLocation) { + this.loadTypesMap(); + } this.typingsInstaller.attach(this); this.typingsCache = new server.TypingsCache(this.typingsInstaller); this.hostConfiguration = { @@ -78719,10 +80199,30 @@ var ts; if (!this.eventHandler) { return; } - this.eventHandler({ + var event = { eventName: server.ProjectLanguageServiceStateEvent, data: { project: project, languageServiceEnabled: languageServiceEnabled } - }); + }; + this.eventHandler(event); + }; + ProjectService.prototype.loadTypesMap = function () { + try { + var fileContent = this.host.readFile(this.typesMapLocation); + if (fileContent === undefined) { + this.logger.info("Provided types map file \"" + this.typesMapLocation + "\" doesn't exist"); + return; + } + var raw = JSON.parse(fileContent); + for (var _i = 0, _a = Object.keys(raw.typesMap); _i < _a.length; _i++) { + var k = _a[_i]; + raw.typesMap[k].match = new RegExp(raw.typesMap[k].match, "i"); + } + this.safelist = raw.typesMap; + } + catch (e) { + this.logger.info("Error loading types map: " + e); + this.safelist = defaultTypeSafeList; + } }; ProjectService.prototype.updateTypingsForProject = function (response) { var project = this.findProject(response.projectName); @@ -78739,16 +80239,28 @@ var ts; } project.updateGraph(); }; - ProjectService.prototype.setCompilerOptionsForInferredProjects = function (projectCompilerOptions) { - this.compilerOptionsForInferredProjects = convertCompilerOptions(projectCompilerOptions); - this.compilerOptionsForInferredProjects.allowNonTsExtensions = true; - this.compileOnSaveForInferredProjects = projectCompilerOptions.compileOnSave; + ProjectService.prototype.setCompilerOptionsForInferredProjects = function (projectCompilerOptions, projectRootPath) { + ts.Debug.assert(projectRootPath === undefined || this.useInferredProjectPerProjectRoot, "Setting compiler options per project root path is only supported when useInferredProjectPerProjectRoot is enabled"); + var compilerOptions = convertCompilerOptions(projectCompilerOptions); + compilerOptions.allowNonTsExtensions = true; + if (projectRootPath) { + this.compilerOptionsForInferredProjectsPerProjectRoot.set(projectRootPath, compilerOptions); + } + else { + this.compilerOptionsForInferredProjects = compilerOptions; + } + var updatedProjects = []; for (var _i = 0, _a = this.inferredProjects; _i < _a.length; _i++) { - var proj = _a[_i]; - proj.setCompilerOptions(this.compilerOptionsForInferredProjects); - proj.compileOnSaveEnabled = projectCompilerOptions.compileOnSave; + var project = _a[_i]; + if (projectRootPath ? + project.projectRootPath === projectRootPath : + !project.projectRootPath || !this.compilerOptionsForInferredProjectsPerProjectRoot.has(project.projectRootPath)) { + project.setCompilerOptions(compilerOptions); + project.compileOnSaveEnabled = compilerOptions.compileOnSave; + updatedProjects.push(project); + } } - this.updateProjectGraphs(this.inferredProjects); + this.updateProjectGraphs(updatedProjects); }; ProjectService.prototype.stopWatchingDirectory = function (directory) { this.directoryWatchers.stopWatchingDirectory(directory); @@ -78855,10 +80367,11 @@ var ts; } for (var _i = 0, _a = this.openFiles; _i < _a.length; _i++) { var openFile = _a[_i]; - this.eventHandler({ + var event = { eventName: server.ContextEvent, data: { project: openFile.getDefaultProject(), fileName: openFile.fileName } - }); + }; + this.eventHandler(event); } } this.printProjects(); @@ -78930,7 +80443,7 @@ var ts; break; } }; - ProjectService.prototype.assignScriptInfoToInferredProjectIfNecessary = function (info, addToListOfOpenFiles) { + ProjectService.prototype.assignScriptInfoToInferredProjectIfNecessary = function (info, addToListOfOpenFiles, projectRootPath) { var externalProject = this.findContainingExternalProject(info.fileName); if (externalProject) { if (addToListOfOpenFiles) { @@ -78955,19 +80468,19 @@ var ts; return; } if (info.containingProjects.length === 0) { - var inferredProject = this.createInferredProjectWithRootFileIfNecessary(info); - if (!this.useSingleInferredProject) { + var inferredProject = this.createInferredProjectWithRootFileIfNecessary(info, projectRootPath); + if (!this.useSingleInferredProject && !inferredProject.projectRootPath) { for (var _b = 0, _c = this.openFiles; _b < _c.length; _b++) { var f = _c[_b]; if (f.containingProjects.length === 0 || !inferredProject.containsScriptInfo(f)) { continue; } for (var _d = 0, _e = f.containingProjects; _d < _e.length; _d++) { - var fContainingProject = _e[_d]; - if (fContainingProject.projectKind === server.ProjectKind.Inferred && - fContainingProject.isRoot(f) && - fContainingProject !== inferredProject) { - this.removeProject(fContainingProject); + var containingProject = _e[_d]; + if (containingProject.projectKind === server.ProjectKind.Inferred && + containingProject !== inferredProject && + containingProject.isRoot(f)) { + this.removeProject(containingProject); f.attachToProject(inferredProject); } } @@ -79078,31 +80591,32 @@ var ts; return undefined; }; ProjectService.prototype.printProjects = function () { + var _this = this; if (!this.logger.hasLevel(server.LogLevel.verbose)) { return; } this.logger.startGroup(); var counter = 0; - counter = printProjects(this.logger, this.externalProjects, counter); - counter = printProjects(this.logger, this.configuredProjects, counter); - counter = printProjects(this.logger, this.inferredProjects, counter); - this.logger.info("Open files: "); - for (var _i = 0, _a = this.openFiles; _i < _a.length; _i++) { - var rootFile = _a[_i]; - this.logger.info("\t" + rootFile.fileName); - } - this.logger.endGroup(); - function printProjects(logger, projects, counter) { + var printProjects = function (projects, counter) { for (var _i = 0, projects_3 = projects; _i < projects_3.length; _i++) { var project = projects_3[_i]; project.updateGraph(); - logger.info("Project '" + project.getProjectName() + "' (" + server.ProjectKind[project.projectKind] + ") " + counter); - logger.info(project.filesToString()); - logger.info("-----------------------------------------------"); + _this.logger.info("Project '" + project.getProjectName() + "' (" + server.ProjectKind[project.projectKind] + ") " + counter); + _this.logger.info(project.filesToString()); + _this.logger.info("-----------------------------------------------"); counter++; } return counter; + }; + counter = printProjects(this.externalProjects, counter); + counter = printProjects(this.configuredProjects, counter); + printProjects(this.inferredProjects, counter); + this.logger.info("Open files: "); + for (var _i = 0, _a = this.openFiles; _i < _a.length; _i++) { + var rootFile = _a[_i]; + this.logger.info("\t" + rootFile.fileName); } + this.logger.endGroup(); }; ProjectService.prototype.findConfiguredProjectByProjectName = function (configFileName) { configFileName = server.asNormalizedPath(this.toCanonicalFileName(configFileName)); @@ -79223,10 +80737,11 @@ var ts; if (!this.eventHandler) { return; } - this.eventHandler({ + var event = { eventName: server.ConfigFileDiagEvent, - data: { configFileName: configFileName, diagnostics: diagnostics || [], triggerFile: triggerFile } - }); + data: { configFileName: configFileName, diagnostics: diagnostics || server.emptyArray, triggerFile: triggerFile } + }; + this.eventHandler(event); }; ProjectService.prototype.createAndAddConfiguredProject = function (configFileName, projectOptions, configFileErrors, clientFileName) { var _this = this; @@ -79375,18 +80890,60 @@ var ts; } return configFileErrors; }; - ProjectService.prototype.createInferredProjectWithRootFileIfNecessary = function (root) { + ProjectService.prototype.getOrCreateInferredProjectForProjectRootPathIfEnabled = function (root, projectRootPath) { + if (!this.useInferredProjectPerProjectRoot) { + return undefined; + } + if (projectRootPath) { + for (var _i = 0, _a = this.inferredProjects; _i < _a.length; _i++) { + var project = _a[_i]; + if (project.projectRootPath === projectRootPath) { + return project; + } + } + return this.createInferredProject(false, projectRootPath); + } + var bestMatch; + for (var _b = 0, _c = this.inferredProjects; _b < _c.length; _b++) { + var project = _c[_b]; + if (!project.projectRootPath) + continue; + if (!ts.containsPath(project.projectRootPath, root.path, this.host.getCurrentDirectory(), !this.host.useCaseSensitiveFileNames)) + continue; + if (bestMatch && bestMatch.projectRootPath.length > project.projectRootPath.length) + continue; + bestMatch = project; + } + return bestMatch; + }; + ProjectService.prototype.getOrCreateSingleInferredProjectIfEnabled = function () { + if (!this.useSingleInferredProject) { + return undefined; + } + if (this.inferredProjects.length > 0 && this.inferredProjects[0].projectRootPath === undefined) { + return this.inferredProjects[0]; + } + return this.createInferredProject(true); + }; + ProjectService.prototype.createInferredProject = function (isSingleInferredProject, projectRootPath) { + var compilerOptions = projectRootPath && this.compilerOptionsForInferredProjectsPerProjectRoot.get(projectRootPath) || this.compilerOptionsForInferredProjects; + var project = new server.InferredProject(this, this.documentRegistry, compilerOptions, projectRootPath); + if (isSingleInferredProject) { + this.inferredProjects.unshift(project); + } + else { + this.inferredProjects.push(project); + } + return project; + }; + ProjectService.prototype.createInferredProjectWithRootFileIfNecessary = function (root, projectRootPath) { var _this = this; - var useExistingProject = this.useSingleInferredProject && this.inferredProjects.length; - var project = useExistingProject - ? this.inferredProjects[0] - : new server.InferredProject(this, this.documentRegistry, this.compilerOptionsForInferredProjects); + var project = this.getOrCreateInferredProjectForProjectRootPathIfEnabled(root, projectRootPath) || + this.getOrCreateSingleInferredProjectIfEnabled() || + this.createInferredProject(); project.addRoot(root); this.directoryWatchers.startWatchingContainingDirectoriesForFile(root.fileName, project, function (fileName) { return _this.onConfigFileAddedForInferredProject(fileName); }); project.updateGraph(); - if (!useExistingProject) { - this.inferredProjects.push(project); - } return project; }; ProjectService.prototype.getOrCreateScriptInfo = function (uncheckedFileName, openedByClient, fileContent, scriptKind) { @@ -79519,7 +81076,7 @@ var ts; project.markAsDirty(); } var info = this.getOrCreateScriptInfoForNormalizedPath(fileName, true, fileContent, scriptKind, hasMixedContent); - this.assignScriptInfoToInferredProjectIfNecessary(info, true); + this.assignScriptInfoToInferredProjectIfNecessary(info, true, projectRootPath); this.deleteOrphanScriptInfoNotInAnyProject(); this.printProjects(); return { configFileName: configFileName, configFileErrors: configFileErrors }; @@ -79533,13 +81090,13 @@ var ts; this.printProjects(); }; ProjectService.prototype.collectChanges = function (lastKnownProjectVersions, currentProjects, result) { - var _loop_10 = function (proj) { + var _loop_11 = function (proj) { var knownProject = ts.forEach(lastKnownProjectVersions, function (p) { return p.projectName === proj.getProjectName() && p; }); result.push(proj.getChangesSinceVersion(knownProject && knownProject.version)); }; for (var _i = 0, currentProjects_1 = currentProjects; _i < currentProjects_1.length; _i++) { var proj = currentProjects_1[_i]; - _loop_10(proj); + _loop_11(proj); } }; ProjectService.prototype.synchronizeProjectList = function (knownProjects) { @@ -79644,21 +81201,14 @@ var ts; ProjectService.prototype.resetSafeList = function () { this.safelist = defaultTypeSafeList; }; - ProjectService.prototype.loadSafeList = function (fileName) { - var raw = JSON.parse(this.host.readFile(fileName, "utf-8")); - for (var _i = 0, _a = Object.keys(raw); _i < _a.length; _i++) { - var k = _a[_i]; - raw[k].match = new RegExp(raw[k].match, "i"); - } - this.safelist = raw; - }; ProjectService.prototype.applySafeList = function (proj) { var _this = this; var rootFiles = proj.rootFiles, typeAcquisition = proj.typeAcquisition; var types = (typeAcquisition && typeAcquisition.include) || []; var excludeRules = []; var normalizedNames = rootFiles.map(function (f) { return ts.normalizeSlashes(f.fileName); }); - var _loop_11 = function (name) { + var excludedFiles = []; + var _loop_12 = function (name) { var rule = this_3.safelist[name]; for (var _i = 0, normalizedNames_1 = normalizedNames; _i < normalizedNames_1.length; _i++) { var root = normalizedNames_1[_i]; @@ -79673,7 +81223,7 @@ var ts; } } if (rule.exclude) { - var _loop_12 = function (exclude) { + var _loop_13 = function (exclude) { var processedRule = root.replace(rule.match, function () { var groups = []; for (var _i = 0; _i < arguments.length; _i++) { @@ -79696,7 +81246,7 @@ var ts; }; for (var _c = 0, _d = rule.exclude; _c < _d.length; _c++) { var exclude = _d[_c]; - _loop_12(exclude); + _loop_13(exclude); } } else { @@ -79715,10 +81265,23 @@ var ts; var this_3 = this; for (var _i = 0, _a = Object.keys(this.safelist); _i < _a.length; _i++) { var name = _a[_i]; - _loop_11(name); + _loop_12(name); } var excludeRegexes = excludeRules.map(function (e) { return new RegExp(e, "i"); }); - proj.rootFiles = proj.rootFiles.filter(function (_file, index) { return !excludeRegexes.some(function (re) { return re.test(normalizedNames[index]); }); }); + var filesToKeep = []; + var _loop_14 = function (i) { + if (excludeRegexes.some(function (re) { return re.test(normalizedNames[i]); })) { + excludedFiles.push(normalizedNames[i]); + } + else { + filesToKeep.push(proj.rootFiles[i]); + } + }; + for (var i = 0; i < proj.rootFiles.length; i++) { + _loop_14(i); + } + proj.rootFiles = filesToKeep; + return excludedFiles; }; ProjectService.prototype.openExternalProject = function (proj, suppressRefreshOfInferredProjects) { if (suppressRefreshOfInferredProjects === void 0) { suppressRefreshOfInferredProjects = false; } @@ -79726,7 +81289,7 @@ var ts; var typeAcquisition = ts.convertEnableAutoDiscoveryToEnable(proj.typingOptions); proj.typeAcquisition = typeAcquisition; } - this.applySafeList(proj); + var excludedFiles = this.applySafeList(proj); var tsConfigFiles; var rootFiles = []; for (var _i = 0, _a = proj.rootFiles; _i < _a.length; _i++) { @@ -79747,6 +81310,7 @@ var ts; var externalProject = this.findExternalProjectByProjectName(proj.projectFileName); var exisingConfigFiles; if (externalProject) { + externalProject.excludedFiles = excludedFiles; if (!tsConfigFiles) { var compilerOptions = convertCompilerOptions(proj.options); if (this.exceededTotalSizeLimitForNonTsFiles(proj.projectFileName, compilerOptions, proj.rootFiles, externalFilePropertyReader)) { @@ -79805,7 +81369,8 @@ var ts; } else { this.externalProjectToConfiguredProjectMap.delete(proj.projectFileName); - this.createAndAddExternalProject(proj.projectFileName, rootFiles, proj.options, proj.typeAcquisition); + var newProj = this.createAndAddExternalProject(proj.projectFileName, rootFiles, proj.options, proj.typeAcquisition); + newProj.excludedFiles = excludedFiles; } if (!suppressRefreshOfInferredProjects) { this.refreshInferredProjects(); @@ -79904,20 +81469,16 @@ var ts; var MultistepOperation = (function () { function MultistepOperation(operationHost) { this.operationHost = operationHost; - this.completed = true; } MultistepOperation.prototype.startNew = function (action) { this.complete(); this.requestId = this.operationHost.getCurrentRequestId(); - this.completed = false; this.executeAction(action); }; MultistepOperation.prototype.complete = function () { - if (!this.completed) { - if (this.requestId) { - this.operationHost.sendRequestCompletedEvent(this.requestId); - } - this.completed = true; + if (this.requestId !== undefined) { + this.operationHost.sendRequestCompletedEvent(this.requestId); + this.requestId = undefined; } this.setTimerHandle(undefined); this.setImmediateId(undefined); @@ -80082,6 +81643,9 @@ var ts; _a[server.CommandNames.DocCommentTemplate] = function (request) { return _this.requiredResponse(_this.getDocCommentTemplate(request.arguments)); }, + _a[server.CommandNames.GetSpanOfEnclosingComment] = function (request) { + return _this.requiredResponse(_this.getSpanOfEnclosingComment(request.arguments)); + }, _a[server.CommandNames.Format] = function (request) { return _this.requiredResponse(_this.getFormattingEditsForRange(request.arguments)); }, @@ -80253,6 +81817,7 @@ var ts; logger: this.logger, cancellationToken: this.cancellationToken, useSingleInferredProject: opts.useSingleInferredProject, + useInferredProjectPerProjectRoot: opts.useInferredProjectPerProjectRoot, typingsInstaller: this.typingsInstaller, throttleWaitMilliseconds: throttleWaitMilliseconds, eventHandler: this.eventHandler, @@ -80279,7 +81844,7 @@ var ts; case server.ContextEvent: var _a = event.data, project_1 = _a.project, fileName_3 = _a.fileName; this.projectService.logger.info("got context event, updating diagnostics for " + fileName_3); - this.errorCheck.startNew(function (next) { return _this.updateErrorCheck(next, [{ fileName: fileName_3, project: project_1 }], _this.changeSeq, function (n) { return n === _this.changeSeq; }, 100); }); + this.errorCheck.startNew(function (next) { return _this.updateErrorCheck(next, [{ fileName: fileName_3, project: project_1 }], 100); }); break; case server.ConfigFileDiagEvent: var _b = event.data, triggerFile = _b.triggerFile, configFileName = _b.configFileName, diagnostics = _b.diagnostics; @@ -80387,26 +81952,24 @@ var ts; this.logError(err, "syntactic check"); } }; - Session.prototype.updateProjectStructure = function (seq, matchSeq, ms) { + Session.prototype.updateProjectStructure = function () { var _this = this; - if (ms === void 0) { ms = 1500; } + var ms = 1500; + var seq = this.changeSeq; this.host.setTimeout(function () { - if (matchSeq(seq)) { + if (_this.changeSeq === seq) { _this.projectService.refreshInferredProjects(); } }, ms); }; - Session.prototype.updateErrorCheck = function (next, checkList, seq, matchSeq, ms, followMs, requireOpen) { + Session.prototype.updateErrorCheck = function (next, checkList, ms, requireOpen) { var _this = this; - if (ms === void 0) { ms = 1500; } - if (followMs === void 0) { followMs = 200; } if (requireOpen === void 0) { requireOpen = true; } - if (followMs > ms) { - followMs = ms; - } + var seq = this.changeSeq; + var followMs = Math.min(ms, 200); var index = 0; var checkOne = function () { - if (matchSeq(seq)) { + if (_this.changeSeq === seq) { var checkSpec_1 = checkList[index]; index++; if (checkSpec_1.project.containsFile(checkSpec_1.fileName, requireOpen)) { @@ -80420,7 +81983,7 @@ var ts; } } }; - if ((checkList.length > index) && (matchSeq(seq))) { + if (checkList.length > index && this.changeSeq === seq) { next.delay(ms, checkOne); } }; @@ -80498,7 +82061,7 @@ var ts; Session.prototype.getDiagnosticsWorker = function (args, isSemantic, selector, includeLinePosition) { var _a = this.getFileAndProject(args), project = _a.project, file = _a.file; if (isSemantic && isDeclarationFileInJSOnlyNonConfiguredProject(project, file)) { - return []; + return server.emptyArray; } var scriptInfo = project.getScriptInfoForNormalizedPath(file); var diagnostics = selector(project, file); @@ -80512,7 +82075,7 @@ var ts; var position = this.getPosition(args, scriptInfo); var definitions = project.getLanguageService().getDefinitionAtPosition(file, position); if (!definitions) { - return undefined; + return server.emptyArray; } if (simplifiedResult) { return definitions.map(function (def) { @@ -80534,7 +82097,7 @@ var ts; var position = this.getPosition(args, scriptInfo); var definitions = project.getLanguageService().getTypeDefinitionAtPosition(file, position); if (!definitions) { - return undefined; + return server.emptyArray; } return definitions.map(function (def) { var defScriptInfo = project.getScriptInfo(def.fileName); @@ -80550,7 +82113,7 @@ var ts; var position = this.getPosition(args, project.getScriptInfoForNormalizedPath(file)); var implementations = project.getLanguageService().getImplementationAtPosition(file, position); if (!implementations) { - return []; + return server.emptyArray; } if (simplifiedResult) { return implementations.map(function (_a) { @@ -80573,7 +82136,7 @@ var ts; var position = this.getPosition(args, scriptInfo); var occurrences = project.getLanguageService().getOccurrencesAtPosition(file, position); if (!occurrences) { - return undefined; + return server.emptyArray; } return occurrences.map(function (occurrence) { var fileName = occurrence.fileName, isWriteAccess = occurrence.isWriteAccess, textSpan = occurrence.textSpan, isInString = occurrence.isInString; @@ -80595,7 +82158,7 @@ var ts; Session.prototype.getSyntacticDiagnosticsSync = function (args) { var configFile = this.getConfigFileAndProject(args).configFile; if (configFile) { - return []; + return server.emptyArray; } return this.getDiagnosticsWorker(args, false, function (project, file) { return project.getLanguageService().getSyntacticDiagnostics(file); }, args.includeLinePosition); }; @@ -80612,7 +82175,7 @@ var ts; var position = this.getPosition(args, scriptInfo); var documentHighlights = project.getLanguageService().getDocumentHighlights(file, position, args.filesToSearch); if (!documentHighlights) { - return undefined; + return server.emptyArray; } if (simplifiedResult) { return documentHighlights.map(convertToDocumentHighlightsItem); @@ -80636,7 +82199,7 @@ var ts; } }; Session.prototype.setCompilerOptionsForInferredProjects = function (args) { - this.projectService.setCompilerOptionsForInferredProjects(args.options); + this.projectService.setCompilerOptionsForInferredProjects(args.options, args.projectRootPath); }; Session.prototype.getProjectInfo = function (args) { return this.getProjectInfoWorker(args.file, args.projectFileName, args.needFileNameList, false); @@ -80698,13 +82261,13 @@ var ts; if (!renameInfo.canRename) { return { info: renameInfo, - locs: [] + locs: server.emptyArray }; } var fileSpans = server.combineProjectOutput(projects, function (project) { var renameLocations = project.getLanguageService().findRenameLocations(file, position, args.findInStrings, args.findInComments); if (!renameLocations) { - return []; + return server.emptyArray; } return renameLocations.map(function (location) { var locationScriptInfo = project.getScriptInfo(location.fileName); @@ -80785,7 +82348,7 @@ var ts; var refs = server.combineProjectOutput(projects, function (project) { var references = project.getLanguageService().getReferencesAtPosition(file, position); if (!references) { - return []; + return server.emptyArray; } return references.map(function (ref) { var refScriptInfo = project.getScriptInfo(ref.fileName); @@ -80826,7 +82389,7 @@ var ts; if (this.eventHandler) { this.eventHandler({ eventName: "configFileDiag", - data: { triggerFile: fileName, configFileName: configFileName, diagnostics: configFileErrors || [] } + data: { triggerFile: fileName, configFileName: configFileName, diagnostics: configFileErrors || server.emptyArray } }); } }; @@ -80863,6 +82426,13 @@ var ts; var position = this.getPosition(args, scriptInfo); return project.getLanguageService(false).getDocCommentTemplateAtPosition(file, position); }; + Session.prototype.getSpanOfEnclosingComment = function (args) { + var _a = this.getFileAndProjectWithoutRefreshingInferredProjects(args), file = _a.file, project = _a.project; + var scriptInfo = project.getScriptInfoForNormalizedPath(file); + var onlyMultiLine = args.onlyMultiLine; + var position = this.getPosition(args, scriptInfo); + return project.getLanguageService(false).getSpanOfEnclosingComment(file, position, onlyMultiLine); + }; Session.prototype.getIndentation = function (args) { var _a = this.getFileAndProjectWithoutRefreshingInferredProjects(args), file = _a.file, project = _a.project; var position = this.getPosition(args, project.getScriptInfoForNormalizedPath(file)); @@ -80986,11 +82556,8 @@ var ts; var scriptInfo = project.getScriptInfoForNormalizedPath(file); var position = this.getPosition(args, scriptInfo); var completions = project.getLanguageService().getCompletionsAtPosition(file, position); - if (!completions) { - return undefined; - } if (simplifiedResult) { - return ts.mapDefined(completions.entries, function (entry) { + return ts.mapDefined(completions && completions.entries, function (entry) { if (completions.isMemberCompletion || (entry.name.toLowerCase().indexOf(prefix.toLowerCase()) === 0)) { var name = entry.name, kind = entry.kind, kindModifiers = entry.kindModifiers, sortText = entry.sortText, replacementSpan = entry.replacementSpan; var convertedSpan = replacementSpan ? _this.decorateSpan(replacementSpan, scriptInfo) : undefined; @@ -81014,7 +82581,7 @@ var ts; var info = this.projectService.getScriptInfo(args.file); var result = []; if (!info) { - return []; + return server.emptyArray; } var projectsToSearch = args.projectFileName ? [this.projectService.findProject(args.projectFileName)] : info.containingProjects; for (var _i = 0, projectsToSearch_1 = projectsToSearch; _i < projectsToSearch_1.length; _i++) { @@ -81074,11 +82641,10 @@ var ts; return project && { fileName: fileName, project: project }; }); if (checkList.length > 0) { - this.updateErrorCheck(next, checkList, this.changeSeq, function (n) { return n === _this.changeSeq; }, delay); + this.updateErrorCheck(next, checkList, delay); } }; Session.prototype.change = function (args) { - var _this = this; var _a = this.getFileAndProject(args, false), file = _a.file, project = _a.project; if (project) { var scriptInfo = project.getScriptInfoForNormalizedPath(file); @@ -81088,7 +82654,7 @@ var ts; scriptInfo.editContent(start, end, args.insertString); this.changeSeq++; } - this.updateProjectStructure(this.changeSeq, function (n) { return n === _this.changeSeq; }); + this.updateProjectStructure(); } }; Session.prototype.reload = function (args, reqSeq) { @@ -81167,7 +82733,7 @@ var ts; return server.combineProjectOutput(projects, function (project) { var navItems = project.getLanguageService().getNavigateToItems(args.searchValue, args.maxResultCount, fileName, project.isNonTsProject()); if (!navItems) { - return []; + return server.emptyArray; } return navItems.map(function (navItem) { var scriptInfo = project.getScriptInfo(navItem.fileName); @@ -81357,7 +82923,6 @@ var ts; : spans; }; Session.prototype.getDiagnosticsForProject = function (next, delay, fileName) { - var _this = this; var _a = this.getProjectInfoWorker(fileName, undefined, true, true), fileNames = _a.fileNames, languageServiceDisabled = _a.languageServiceDisabled; if (languageServiceDisabled) { return; @@ -81392,7 +82957,7 @@ var ts; fileNamesInProject = highPriorityFiles.concat(mediumPriorityFiles).concat(lowPriorityFiles).concat(veryLowPriorityFiles); if (fileNamesInProject.length > 0) { var checkList = fileNamesInProject.map(function (fileName) { return ({ fileName: fileName, project: project }); }); - this.updateErrorCheck(next, checkList, this.changeSeq, function (n) { return n === _this.changeSeq; }, delay, 200, false); + this.updateErrorCheck(next, checkList, delay, false); } }; Session.prototype.getCanonicalFileName = function (fileName) { @@ -81499,13 +83064,13 @@ var ts; CharRangeSection[CharRangeSection["Mid"] = 3] = "Mid"; CharRangeSection[CharRangeSection["End"] = 4] = "End"; CharRangeSection[CharRangeSection["PostEnd"] = 5] = "PostEnd"; - })(CharRangeSection = server.CharRangeSection || (server.CharRangeSection = {})); + })(CharRangeSection || (CharRangeSection = {})); var EditWalker = (function () { function EditWalker() { this.goSubtree = true; this.lineIndex = new LineIndex(); this.endBranch = []; - this.state = CharRangeSection.Entire; + this.state = 2; this.initialText = ""; this.trailingText = ""; this.lineIndex.root = new LineNode(); @@ -81594,14 +83159,14 @@ var ts; }; EditWalker.prototype.post = function (_relativeStart, _relativeLength, lineCollection) { if (lineCollection === this.lineCollectionAtBranch) { - this.state = CharRangeSection.End; + this.state = 4; } this.stack.pop(); }; EditWalker.prototype.pre = function (_relativeStart, _relativeLength, lineCollection, _parent, nodeType) { var currentNode = this.stack[this.stack.length - 1]; - if ((this.state === CharRangeSection.Entire) && (nodeType === CharRangeSection.Start)) { - this.state = CharRangeSection.Start; + if ((this.state === 2) && (nodeType === 1)) { + this.state = 1; this.branchNode = currentNode; this.lineCollectionAtBranch = lineCollection; } @@ -81614,14 +83179,14 @@ var ts; return new LineNode(); } switch (nodeType) { - case CharRangeSection.PreStart: + case 0: this.goSubtree = false; - if (this.state !== CharRangeSection.End) { + if (this.state !== 4) { currentNode.add(lineCollection); } break; - case CharRangeSection.Start: - if (this.state === CharRangeSection.End) { + case 1: + if (this.state === 4) { this.goSubtree = false; } else { @@ -81630,8 +83195,8 @@ var ts; this.startPath.push(child); } break; - case CharRangeSection.Entire: - if (this.state !== CharRangeSection.End) { + case 2: + if (this.state !== 4) { child = fresh(lineCollection); currentNode.add(child); this.startPath.push(child); @@ -81644,11 +83209,11 @@ var ts; } } break; - case CharRangeSection.Mid: + case 3: this.goSubtree = false; break; - case CharRangeSection.End: - if (this.state !== CharRangeSection.End) { + case 4: + if (this.state !== 4) { this.goSubtree = false; } else { @@ -81659,9 +83224,9 @@ var ts; } } break; - case CharRangeSection.PostEnd: + case 5: this.goSubtree = false; - if (this.state !== CharRangeSection.Start) { + if (this.state !== 1) { currentNode.add(lineCollection); } break; @@ -81671,10 +83236,10 @@ var ts; } }; EditWalker.prototype.leaf = function (relativeStart, relativeLength, ll) { - if (this.state === CharRangeSection.Start) { + if (this.state === 1) { this.initialText = ll.text.substring(0, relativeStart); } - else if (this.state === CharRangeSection.Entire) { + else if (this.state === 2) { this.initialText = ll.text.substring(0, relativeStart); this.trailingText = ll.text.substring(relativeStart + relativeLength); } @@ -81695,7 +83260,6 @@ var ts; }; return TextChange; }()); - server.TextChange = TextChange; var ScriptVersionCache = (function () { function ScriptVersionCache() { this.changes = []; @@ -81720,15 +83284,6 @@ var ts; this.getSnapshot(); } }; - ScriptVersionCache.prototype.latest = function () { - return this.versions[this.currentVersionToIndex()]; - }; - ScriptVersionCache.prototype.latestVersion = function () { - if (this.changes.length > 0) { - this.getSnapshot(); - } - return this.currentVersion; - }; ScriptVersionCache.prototype.reload = function (script) { this.currentVersion++; this.changes = []; @@ -81741,7 +83296,8 @@ var ts; snap.index.load(lm.lines); this.minVersion = this.currentVersion; }; - ScriptVersionCache.prototype.getSnapshot = function () { + ScriptVersionCache.prototype.getSnapshot = function () { return this._getSnapshot(); }; + ScriptVersionCache.prototype._getSnapshot = function () { var snap = this.versions[this.currentVersionToIndex()]; if (this.changes.length > 0) { var snapIndex = snap.index; @@ -81759,6 +83315,24 @@ var ts; } return snap; }; + ScriptVersionCache.prototype.getSnapshotVersion = function () { + return this._getSnapshot().version; + }; + ScriptVersionCache.prototype.getLineInfo = function (line) { + return this._getSnapshot().index.lineNumberToInfo(line); + }; + ScriptVersionCache.prototype.lineOffsetToPosition = function (line, column) { + return this._getSnapshot().index.absolutePositionOfStartOfLine(line) + (column - 1); + }; + ScriptVersionCache.prototype.positionToLineOffset = function (position) { + return this._getSnapshot().index.positionToLineOffset(position); + }; + ScriptVersionCache.prototype.lineToTextSpan = function (line) { + var index = this._getSnapshot().index; + var _a = index.lineNumberToInfo(line + 1), lineText = _a.lineText, absolutePosition = _a.absolutePosition; + var len = lineText !== undefined ? lineText.length : index.absolutePositionOfStartOfLine(line + 2) - absolutePosition; + return ts.createTextSpan(absolutePosition, len); + }; ScriptVersionCache.prototype.getTextChangesBetweenVersions = function (oldVersion, newVersion) { if (oldVersion < newVersion) { if (oldVersion >= this.minVersion) { @@ -81820,7 +83394,6 @@ var ts; }; return LineIndexSnapshot; }()); - server.LineIndexSnapshot = LineIndexSnapshot; var LineIndex = (function () { function LineIndex() { this.checkEdits = false; @@ -82019,18 +83592,18 @@ var ts; var childCharCount = this.children[childIndex].charCount(); var adjustedStart = rangeStart; while (adjustedStart >= childCharCount) { - this.skipChild(adjustedStart, rangeLength, childIndex, walkFns, CharRangeSection.PreStart); + this.skipChild(adjustedStart, rangeLength, childIndex, walkFns, 0); adjustedStart -= childCharCount; childIndex++; childCharCount = this.children[childIndex].charCount(); } if ((adjustedStart + rangeLength) <= childCharCount) { - if (this.execWalk(adjustedStart, rangeLength, walkFns, childIndex, CharRangeSection.Entire)) { + if (this.execWalk(adjustedStart, rangeLength, walkFns, childIndex, 2)) { return; } } else { - if (this.execWalk(adjustedStart, childCharCount - adjustedStart, walkFns, childIndex, CharRangeSection.Start)) { + if (this.execWalk(adjustedStart, childCharCount - adjustedStart, walkFns, childIndex, 1)) { return; } var adjustedLength = rangeLength - (childCharCount - adjustedStart); @@ -82038,7 +83611,7 @@ var ts; var child = this.children[childIndex]; childCharCount = child.charCount(); while (adjustedLength > childCharCount) { - if (this.execWalk(0, childCharCount, walkFns, childIndex, CharRangeSection.Mid)) { + if (this.execWalk(0, childCharCount, walkFns, childIndex, 3)) { return; } adjustedLength -= childCharCount; @@ -82046,7 +83619,7 @@ var ts; childCharCount = this.children[childIndex].charCount(); } if (adjustedLength > 0) { - if (this.execWalk(0, adjustedLength, walkFns, childIndex, CharRangeSection.End)) { + if (this.execWalk(0, adjustedLength, walkFns, childIndex, 4)) { return; } } @@ -82055,82 +83628,46 @@ var ts; var clen = this.children.length; if (childIndex < (clen - 1)) { for (var ej = childIndex + 1; ej < clen; ej++) { - this.skipChild(0, 0, ej, walkFns, CharRangeSection.PostEnd); + this.skipChild(0, 0, ej, walkFns, 5); } } } }; LineNode.prototype.charOffsetToLineInfo = function (lineNumberAccumulator, relativePosition) { - var childInfo = this.childFromCharOffset(lineNumberAccumulator, relativePosition); - if (!childInfo.child) { - return { - oneBasedLine: lineNumberAccumulator, - zeroBasedColumn: relativePosition, - lineText: undefined, - }; + if (this.children.length === 0) { + return { oneBasedLine: lineNumberAccumulator, zeroBasedColumn: relativePosition, lineText: undefined }; } - else if (childInfo.childIndex < this.children.length) { - if (childInfo.child.isLeaf()) { - return { - oneBasedLine: childInfo.lineNumberAccumulator, - zeroBasedColumn: childInfo.relativePosition, - lineText: childInfo.child.text, - }; + for (var _i = 0, _a = this.children; _i < _a.length; _i++) { + var child = _a[_i]; + if (child.charCount() > relativePosition) { + if (child.isLeaf()) { + return { oneBasedLine: lineNumberAccumulator, zeroBasedColumn: relativePosition, lineText: child.text }; + } + else { + return child.charOffsetToLineInfo(lineNumberAccumulator, relativePosition); + } } else { - var lineNode = (childInfo.child); - return lineNode.charOffsetToLineInfo(childInfo.lineNumberAccumulator, childInfo.relativePosition); + relativePosition -= child.charCount(); + lineNumberAccumulator += child.lineCount(); } } - else { - var lineInfo = this.lineNumberToInfo(this.lineCount(), 0); - return { oneBasedLine: this.lineCount(), zeroBasedColumn: lineInfo.leaf.charCount(), lineText: undefined }; - } + var leaf = this.lineNumberToInfo(this.lineCount(), 0).leaf; + return { oneBasedLine: this.lineCount(), zeroBasedColumn: leaf.charCount(), lineText: undefined }; }; LineNode.prototype.lineNumberToInfo = function (relativeOneBasedLine, positionAccumulator) { - var childInfo = this.childFromLineNumber(relativeOneBasedLine, positionAccumulator); - if (!childInfo.child) { - return { position: positionAccumulator, leaf: undefined }; - } - else if (childInfo.child.isLeaf()) { - return { position: childInfo.positionAccumulator, leaf: childInfo.child }; - } - else { - var lineNode = (childInfo.child); - return lineNode.lineNumberToInfo(childInfo.relativeOneBasedLine, childInfo.positionAccumulator); - } - }; - LineNode.prototype.childFromLineNumber = function (relativeOneBasedLine, positionAccumulator) { - var child; - var i; - for (i = 0; i < this.children.length; i++) { - child = this.children[i]; + for (var _i = 0, _a = this.children; _i < _a.length; _i++) { + var child = _a[_i]; var childLineCount = child.lineCount(); if (childLineCount >= relativeOneBasedLine) { - break; + return child.isLeaf() ? { position: positionAccumulator, leaf: child } : child.lineNumberToInfo(relativeOneBasedLine, positionAccumulator); } else { relativeOneBasedLine -= childLineCount; positionAccumulator += child.charCount(); } } - return { child: child, relativeOneBasedLine: relativeOneBasedLine, positionAccumulator: positionAccumulator }; - }; - LineNode.prototype.childFromCharOffset = function (lineNumberAccumulator, relativePosition) { - var child; - var i; - var len; - for (i = 0, len = this.children.length; i < len; i++) { - child = this.children[i]; - if (child.charCount() > relativePosition) { - break; - } - else { - relativePosition -= child.charCount(); - lineNumberAccumulator += child.lineCount(); - } - } - return { child: child, childIndex: i, relativePosition: relativePosition, lineNumberAccumulator: lineNumberAccumulator }; + return { position: positionAccumulator, leaf: undefined }; }; LineNode.prototype.splitAfter = function (childIndex) { var splitNode; @@ -82227,7 +83764,6 @@ var ts; }; return LineNode; }()); - server.LineNode = LineNode; var LineLeaf = (function () { function LineLeaf(text) { this.text = text; @@ -82246,7 +83782,6 @@ var ts; }; return LineLeaf; }()); - server.LineLeaf = LineLeaf; })(server = ts.server || (ts.server = {})); })(ts || (ts = {})); var ts; @@ -82335,14 +83870,15 @@ var ts; Logger.prototype.info = function (s) { this.msg(s, server.Msg.Info); }; + Logger.prototype.err = function (s) { + this.msg(s, server.Msg.Err); + }; Logger.prototype.startGroup = function () { this.inGroup = true; this.firstInGroup = true; }; Logger.prototype.endGroup = function () { this.inGroup = false; - this.seq++; - this.firstInGroup = true; }; Logger.prototype.loggingEnabled = function () { return !!this.logFilename || this.traceToConsole; @@ -82352,24 +83888,32 @@ var ts; }; Logger.prototype.msg = function (s, type) { if (type === void 0) { type = server.Msg.Err; } - if (this.fd >= 0 || this.traceToConsole) { - s = "[" + nowString() + "] " + s + "\n"; + if (!this.canWrite) + return; + s = "[" + nowString() + "] " + s + "\n"; + if (!this.inGroup || this.firstInGroup) { var prefix = Logger.padStringRight(type + " " + this.seq.toString(), " "); - if (this.firstInGroup) { - s = prefix + s; - this.firstInGroup = false; - } - if (!this.inGroup) { - this.seq++; - this.firstInGroup = true; - } - if (this.fd >= 0) { - var buf = new Buffer(s); - fs.writeSync(this.fd, buf, 0, buf.length, null); - } - if (this.traceToConsole) { - console.warn(s); - } + s = prefix + s; + } + this.write(s); + if (!this.inGroup) { + this.seq++; + } + }; + Object.defineProperty(Logger.prototype, "canWrite", { + get: function () { + return this.fd >= 0 || this.traceToConsole; + }, + enumerable: true, + configurable: true + }); + Logger.prototype.write = function (s) { + if (this.fd >= 0) { + var buf = new Buffer(s); + fs.writeSync(this.fd, buf, 0, buf.length, null); + } + if (this.traceToConsole) { + console.warn(s); } }; return Logger; @@ -82379,12 +83923,13 @@ var ts; return d.getHours() + ":" + d.getMinutes() + ":" + d.getSeconds() + "." + d.getMilliseconds(); } var NodeTypingsInstaller = (function () { - function NodeTypingsInstaller(telemetryEnabled, logger, host, eventPort, globalTypingsCacheLocation, typingSafeListLocation, npmLocation, newLine) { + function NodeTypingsInstaller(telemetryEnabled, logger, host, eventPort, globalTypingsCacheLocation, typingSafeListLocation, typesMapLocation, npmLocation, newLine) { var _this = this; this.telemetryEnabled = telemetryEnabled; this.logger = logger; this.globalTypingsCacheLocation = globalTypingsCacheLocation; this.typingSafeListLocation = typingSafeListLocation; + this.typesMapLocation = typesMapLocation; this.npmLocation = npmLocation; this.newLine = newLine; this.installerPidReported = false; @@ -82427,6 +83972,9 @@ var ts; if (this.typingSafeListLocation) { args.push(server.Arguments.TypingSafeListLocation, this.typingSafeListLocation); } + if (this.typesMapLocation) { + args.push(server.Arguments.TypesMapLocation, this.typesMapLocation); + } if (this.npmLocation) { args.push(server.Arguments.NpmLocation, this.npmLocation); } @@ -82530,14 +84078,15 @@ var ts; __extends(IOSession, _super); function IOSession(options) { var _this = this; - var host = options.host, installerEventPort = options.installerEventPort, globalTypingsCacheLocation = options.globalTypingsCacheLocation, typingSafeListLocation = options.typingSafeListLocation, npmLocation = options.npmLocation, canUseEvents = options.canUseEvents; + var host = options.host, installerEventPort = options.installerEventPort, globalTypingsCacheLocation = options.globalTypingsCacheLocation, typingSafeListLocation = options.typingSafeListLocation, typesMapLocation = options.typesMapLocation, npmLocation = options.npmLocation, canUseEvents = options.canUseEvents; var typingsInstaller = disableAutomaticTypingAcquisition ? undefined - : new NodeTypingsInstaller(telemetryEnabled, logger, host, installerEventPort, globalTypingsCacheLocation, typingSafeListLocation, npmLocation, host.newLine); + : new NodeTypingsInstaller(telemetryEnabled, logger, host, installerEventPort, globalTypingsCacheLocation, typingSafeListLocation, typesMapLocation, npmLocation, host.newLine); _this = _super.call(this, { host: host, cancellationToken: cancellationToken, useSingleInferredProject: useSingleInferredProject, + useInferredProjectPerProjectRoot: useInferredProjectPerProjectRoot, typingsInstaller: typingsInstaller || server.nullTypingsInstaller, byteLength: Buffer.byteLength, hrtime: process.hrtime, @@ -82820,12 +84369,22 @@ var ts; if (localeStr) { ts.validateLocaleAndSetLanguage(localeStr, sys); } + ts.setStackTraceLimit(); var typingSafeListLocation = server.findArgument(server.Arguments.TypingSafeListLocation); + var typesMapLocation = server.findArgument(server.Arguments.TypesMapLocation) || ts.combinePaths(sys.getExecutingFilePath(), "../typesMap.json"); var npmLocation = server.findArgument(server.Arguments.NpmLocation); - var globalPlugins = (server.findArgument("--globalPlugins") || "").split(","); - var pluginProbeLocations = (server.findArgument("--pluginProbeLocations") || "").split(","); + function parseStringArray(argName) { + var arg = server.findArgument(argName); + if (arg === undefined) { + return server.emptyArray; + } + return arg.split(",").filter(function (name) { return name !== ""; }); + } + var globalPlugins = parseStringArray("--globalPlugins"); + var pluginProbeLocations = parseStringArray("--pluginProbeLocations"); var allowLocalPluginLoads = server.hasArgument("--allowLocalPluginLoads"); var useSingleInferredProject = server.hasArgument("--useSingleInferredProject"); + var useInferredProjectPerProjectRoot = server.hasArgument("--useInferredProjectPerProjectRoot"); var disableAutomaticTypingAcquisition = server.hasArgument("--disableAutomaticTypingAcquisition"); var telemetryEnabled = server.hasArgument(server.Arguments.EnableTelemetry); var options = { @@ -82834,9 +84393,11 @@ var ts; installerEventPort: eventPort, canUseEvents: eventPort === undefined, useSingleInferredProject: useSingleInferredProject, + useInferredProjectPerProjectRoot: useInferredProjectPerProjectRoot, disableAutomaticTypingAcquisition: disableAutomaticTypingAcquisition, globalTypingsCacheLocation: getGlobalTypingsCacheLocation(), typingSafeListLocation: typingSafeListLocation, + typesMapLocation: typesMapLocation, npmLocation: npmLocation, telemetryEnabled: telemetryEnabled, logger: logger, @@ -82852,3 +84413,5 @@ var ts; ioSession.listen(); })(server = ts.server || (ts.server = {})); })(ts || (ts = {})); + +//# sourceMappingURL=tsserver.js.map diff --git a/lib/tsserverlibrary.d.ts b/lib/tsserverlibrary.d.ts index fce0d53e6350a..513d8079a40fb 100644 --- a/lib/tsserverlibrary.d.ts +++ b/lib/tsserverlibrary.d.ts @@ -50,7 +50,7 @@ declare namespace ts { pos: number; end: number; } - enum SyntaxKind { + const enum SyntaxKind { Unknown = 0, EndOfFileToken = 1, SingleLineCommentTrivia = 2, @@ -374,7 +374,7 @@ declare namespace ts { FirstJSDocTagNode = 276, LastJSDocTagNode = 285, } - enum NodeFlags { + const enum NodeFlags { None = 0, Let = 1, Const = 2, @@ -402,7 +402,7 @@ declare namespace ts { ContextFlags = 96256, TypeExcludesFlags = 20480, } - enum ModifierFlags { + const enum ModifierFlags { None = 0, Export = 1, Ambient = 2, @@ -422,7 +422,7 @@ declare namespace ts { TypeScriptModifier = 2270, ExportDefault = 513, } - enum JsxFlags { + const enum JsxFlags { None = 0, IntrinsicNamedElement = 1, IntrinsicIndexedElement = 2, @@ -1175,7 +1175,7 @@ declare namespace ts { interface CatchClause extends Node { kind: SyntaxKind.CatchClause; parent?: TryStatement; - variableDeclaration: VariableDeclaration; + variableDeclaration?: VariableDeclaration; block: Block; } type DeclarationWithTypeParameters = SignatureDeclaration | ClassLikeDeclaration | InterfaceDeclaration | TypeAliasDeclaration | JSDocTemplateTag; @@ -1432,7 +1432,7 @@ declare namespace ts { jsDocTypeTag?: JSDocTypeTag; isArrayType?: boolean; } - enum FlowFlags { + const enum FlowFlags { Unreachable = 1, Start = 2, BranchLabel = 4, @@ -1452,38 +1452,39 @@ declare namespace ts { interface FlowLock { locked?: boolean; } - interface AfterFinallyFlow extends FlowNode, FlowLock { + interface AfterFinallyFlow extends FlowNodeBase, FlowLock { antecedent: FlowNode; } - interface PreFinallyFlow extends FlowNode { + interface PreFinallyFlow extends FlowNodeBase { antecedent: FlowNode; lock: FlowLock; } - interface FlowNode { + type FlowNode = AfterFinallyFlow | PreFinallyFlow | FlowStart | FlowLabel | FlowAssignment | FlowCondition | FlowSwitchClause | FlowArrayMutation; + interface FlowNodeBase { flags: FlowFlags; id?: number; } - interface FlowStart extends FlowNode { + interface FlowStart extends FlowNodeBase { container?: FunctionExpression | ArrowFunction | MethodDeclaration; } - interface FlowLabel extends FlowNode { + interface FlowLabel extends FlowNodeBase { antecedents: FlowNode[]; } - interface FlowAssignment extends FlowNode { + interface FlowAssignment extends FlowNodeBase { node: Expression | VariableDeclaration | BindingElement; antecedent: FlowNode; } - interface FlowCondition extends FlowNode { + interface FlowCondition extends FlowNodeBase { expression: Expression; antecedent: FlowNode; } - interface FlowSwitchClause extends FlowNode { + interface FlowSwitchClause extends FlowNodeBase { switchStatement: SwitchStatement; clauseStart: number; clauseEnd: number; antecedent: FlowNode; } - interface FlowArrayMutation extends FlowNode { + interface FlowArrayMutation extends FlowNodeBase { node: CallExpression | BinaryExpression; antecedent: FlowNode; } @@ -1607,6 +1608,7 @@ declare namespace ts { getSymbolsOfParameterPropertyDeclaration(parameter: ParameterDeclaration, parameterName: string): Symbol[]; getShorthandAssignmentValueSymbol(location: Node): Symbol | undefined; getExportSpecifierLocalTargetSymbol(location: ExportSpecifier): Symbol | undefined; + getExportSymbolOfSymbol(symbol: Symbol): Symbol; getPropertySymbolOfDestructuringAssignment(location: Identifier): Symbol | undefined; getTypeAtLocation(node: Node): Type; getTypeFromTypeNode(node: TypeNode): Type; @@ -1684,7 +1686,7 @@ declare namespace ts { reportInaccessibleThisError(): void; reportPrivateInBaseOfClassExpression(propertyName: string): void; } - enum TypeFormatFlags { + const enum TypeFormatFlags { None = 0, WriteArrayAsGenericType = 1, UseTypeOfFunction = 4, @@ -1696,18 +1698,18 @@ declare namespace ts { UseFullyQualifiedType = 256, InFirstTypeArgument = 512, InTypeAlias = 1024, - UseTypeAliasValue = 2048, SuppressAnyReturnType = 4096, AddUndefined = 8192, WriteClassExpressionAsTypeLiteral = 16384, InArrayType = 32768, + UseAliasDefinedOutsideCurrentScope = 65536, } - enum SymbolFormatFlags { + const enum SymbolFormatFlags { None = 0, WriteTypeParametersOrArguments = 1, UseOnlyExternalAliasing = 2, } - enum TypePredicateKind { + const enum TypePredicateKind { This = 0, Identifier = 1, } @@ -1724,7 +1726,7 @@ declare namespace ts { parameterIndex: number; } type TypePredicate = IdentifierTypePredicate | ThisTypePredicate; - enum SymbolFlags { + const enum SymbolFlags { None = 0, FunctionScopedVariable = 1, BlockScopedVariable = 2, @@ -1794,7 +1796,7 @@ declare namespace ts { exports?: SymbolTable; globalExports?: SymbolTable; } - enum InternalSymbolName { + const enum InternalSymbolName { Call = "__call", Constructor = "__constructor", New = "__new", @@ -1832,7 +1834,7 @@ declare namespace ts { clear(): void; } type SymbolTable = UnderscoreEscapedMap; - enum TypeFlags { + const enum TypeFlags { Any = 1, String = 2, Number = 4, @@ -1889,7 +1891,7 @@ declare namespace ts { } interface EnumType extends Type { } - enum ObjectFlags { + const enum ObjectFlags { Class = 1, Interface = 2, Reference = 4, @@ -1951,7 +1953,7 @@ declare namespace ts { interface IndexType extends Type { type: TypeVariable | UnionOrIntersectionType; } - enum SignatureKind { + const enum SignatureKind { Call = 0, Construct = 1, } @@ -1960,7 +1962,7 @@ declare namespace ts { typeParameters?: TypeParameter[]; parameters: Symbol[]; } - enum IndexKind { + const enum IndexKind { String = 0, Number = 1, } @@ -1969,7 +1971,7 @@ declare namespace ts { isReadonly: boolean; declaration?: SignatureDeclaration; } - enum InferencePriority { + const enum InferencePriority { NakedTypeVariable = 1, MappedType = 2, ReturnType = 4, @@ -1982,11 +1984,17 @@ declare namespace ts { topLevel: boolean; isFixed: boolean; } - enum InferenceFlags { + const enum InferenceFlags { InferUnionTypes = 1, NoDefault = 2, AnyDefault = 4, } + const enum Ternary { + False = 0, + Maybe = 1, + True = -1, + } + type TypeComparer = (s: Type, t: Type, reportErrors?: boolean) => Ternary; interface JsFileExtensionInfo { extension: string; isMixedContent: boolean; @@ -2073,6 +2081,7 @@ declare namespace ts { outFile?: string; paths?: MapLike; preserveConstEnums?: boolean; + preserveSymlinks?: boolean; project?: string; reactNamespace?: string; jsxFactory?: string; @@ -2118,13 +2127,13 @@ declare namespace ts { ES2015 = 5, ESNext = 6, } - enum JsxEmit { + const enum JsxEmit { None = 0, Preserve = 1, React = 2, ReactNative = 3, } - enum NewLineKind { + const enum NewLineKind { CarriageReturnLineFeed = 0, LineFeed = 1, } @@ -2132,7 +2141,7 @@ declare namespace ts { line: number; character: number; } - enum ScriptKind { + const enum ScriptKind { Unknown = 0, JS = 1, JSX = 2, @@ -2141,7 +2150,7 @@ declare namespace ts { External = 5, JSON = 6, } - enum ScriptTarget { + const enum ScriptTarget { ES3 = 0, ES5 = 1, ES2015 = 2, @@ -2150,7 +2159,7 @@ declare namespace ts { ESNext = 5, Latest = 5, } - enum LanguageVariant { + const enum LanguageVariant { Standard = 0, JSX = 1, } @@ -2163,7 +2172,7 @@ declare namespace ts { wildcardDirectories?: MapLike; compileOnSave?: boolean; } - enum WatchDirectoryFlags { + const enum WatchDirectoryFlags { None = 0, Recursive = 1, } @@ -2186,8 +2195,13 @@ declare namespace ts { } interface ResolvedModuleFull extends ResolvedModule { extension: Extension; + packageId?: PackageId; + } + interface PackageId { + name: string; + version: string; } - enum Extension { + const enum Extension { Ts = ".ts", Tsx = ".tsx", Dts = ".d.ts", @@ -2229,7 +2243,7 @@ declare namespace ts { text: string; skipTrivia?: (pos: number) => number; } - enum EmitFlags { + const enum EmitFlags { SingleLine = 1, AdviseOnEmitNode = 2, NoSubstitution = 4, @@ -2265,7 +2279,7 @@ declare namespace ts { readonly text: string; readonly priority?: number; } - enum EmitHint { + const enum EmitHint { SourceFile = 0, Expression = 1, IdentifierName = 2, @@ -2326,7 +2340,7 @@ declare namespace ts { } } declare namespace ts { - const versionMajorMinor = "2.5"; + const versionMajorMinor = "2.6"; const version: string; } declare function setTimeout(handler: (...args: any[]) => void, timeout: number): any; @@ -2402,6 +2416,8 @@ declare namespace ts { function collapseTextChangeRangesAcrossMultipleVersions(changes: ReadonlyArray): TextChangeRange; function getTypeParameterOwner(d: Declaration): Declaration; function isParameterPropertyDeclaration(node: Node): boolean; + function isEmptyBindingPattern(node: BindingName): node is BindingPattern; + function isEmptyBindingElement(node: BindingElement): boolean; function getCombinedModifierFlags(node: Node): ModifierFlags; function getCombinedNodeFlags(node: Node): NodeFlags; function validateLocaleAndSetLanguage(locale: string, sys: { @@ -2959,8 +2975,8 @@ declare namespace ts { function updateDefaultClause(node: DefaultClause, statements: ReadonlyArray): DefaultClause; function createHeritageClause(token: HeritageClause["token"], types: ReadonlyArray): HeritageClause; function updateHeritageClause(node: HeritageClause, types: ReadonlyArray): HeritageClause; - function createCatchClause(variableDeclaration: string | VariableDeclaration, block: Block): CatchClause; - function updateCatchClause(node: CatchClause, variableDeclaration: VariableDeclaration, block: Block): CatchClause; + function createCatchClause(variableDeclaration: string | VariableDeclaration | undefined, block: Block): CatchClause; + function updateCatchClause(node: CatchClause, variableDeclaration: VariableDeclaration | undefined, block: Block): CatchClause; function createPropertyAssignment(name: string | PropertyName, initializer: Expression): PropertyAssignment; function updatePropertyAssignment(node: PropertyAssignment, name: PropertyName, initializer: Expression): PropertyAssignment; function createShorthandPropertyAssignment(name: string | Identifier, objectAssignmentInitializer?: Expression): ShorthandPropertyAssignment; @@ -3197,6 +3213,7 @@ declare namespace ts { getFormattingEditsAfterKeystroke(fileName: string, position: number, key: string, options: FormatCodeOptions | FormatCodeSettings): TextChange[]; getDocCommentTemplateAtPosition(fileName: string, position: number): TextInsertion; isValidBraceCompletionAtPosition(fileName: string, position: number, openingBrace: number): boolean; + getSpanOfEnclosingComment(fileName: string, position: number, onlyMultiLine: boolean): TextSpan; getCodeFixesAtPosition(fileName: string, start: number, end: number, errorCodes: number[], formatOptions: FormatCodeSettings): CodeAction[]; getApplicableRefactors(fileName: string, positionOrRaneg: number | TextRange): ApplicableRefactorInfo[]; getEditsForRefactor(fileName: string, formatOptions: FormatCodeSettings, positionOrRange: number | TextRange, refactorName: string, actionName: string): RefactorEditInfo | undefined; @@ -3288,7 +3305,7 @@ declare namespace ts { fileName: string; highlightSpans: HighlightSpan[]; } - enum HighlightSpanKind { + const enum HighlightSpanKind { none = "none", definition = "definition", reference = "reference", @@ -3483,7 +3500,7 @@ declare namespace ts { outputFiles: OutputFile[]; emitSkipped: boolean; } - enum OutputFileType { + const enum OutputFileType { JavaScript = 0, SourceMap = 1, Declaration = 2, @@ -3493,7 +3510,7 @@ declare namespace ts { writeByteOrderMark: boolean; text: string; } - enum EndOfLineState { + const enum EndOfLineState { None = 0, InMultiLineCommentTrivia = 1, InSingleQuoteStringLiteral = 2, @@ -3525,7 +3542,7 @@ declare namespace ts { getClassificationsForLine(text: string, lexState: EndOfLineState, syntacticClassifierAbsent: boolean): ClassificationResult; getEncodedLexicalClassifications(text: string, endOfLineState: EndOfLineState, syntacticClassifierAbsent: boolean): Classifications; } - enum ScriptElementKind { + const enum ScriptElementKind { unknown = "", warning = "warning", keyword = "keyword", @@ -3560,7 +3577,7 @@ declare namespace ts { externalModuleName = "external module name", jsxAttribute = "JSX attribute", } - enum ScriptElementKindModifier { + const enum ScriptElementKindModifier { none = "", publicMemberModifier = "public", privateMemberModifier = "private", @@ -3570,7 +3587,7 @@ declare namespace ts { staticModifier = "static", abstractModifier = "abstract", } - enum ClassificationTypeNames { + const enum ClassificationTypeNames { comment = "comment", identifier = "identifier", keyword = "keyword", @@ -3595,7 +3612,7 @@ declare namespace ts { jsxText = "jsx text", jsxAttributeStringLiteralValue = "jsx attribute string literal value", } - enum ClassificationType { + const enum ClassificationType { comment = 1, identifier = 2, keyword = 3, @@ -3687,7 +3704,10 @@ declare namespace ts.server { error: undefined; } | { module: undefined; - error: {}; + error: { + stack?: string; + message?: string; + }; }; interface ServerHost extends System { setTimeout(callback: (...args: any[]) => void, ms: number, ...args: any[]): any; @@ -3770,6 +3790,7 @@ declare namespace ts.server { const LogFile = "--logFile"; const EnableTelemetry = "--enableTelemetry"; const TypingSafeListLocation = "--typingSafeListLocation"; + const TypesMapLocation = "--typesMapLocation"; const NpmLocation = "--npmLocation"; } function hasArgument(argumentName: string): boolean; @@ -3838,9 +3859,6 @@ declare namespace ts.server { function isInferredProjectName(name: string): boolean; function makeInferredProjectName(counter: number): string; function createSortedArray(): SortedArray; - function toSortedArray(arr: string[]): SortedArray; - function toSortedArray(arr: T[], comparer: Comparer): SortedArray; - function enumerateInsertsAndDeletes(newItems: SortedReadonlyArray, oldItems: SortedReadonlyArray, inserted: (newItem: T) => void, deleted: (oldItem: T) => void, compare?: Comparer): void; class ThrottledOperations { private readonly host; private pendingTimeouts; @@ -3857,13 +3875,12 @@ declare namespace ts.server { scheduleCollect(): void; private static run(self); } - function insertSorted(array: SortedArray, insert: T, compare: Comparer): void; - function removeSorted(array: SortedArray, remove: T, compare: Comparer): void; } declare namespace ts.server.protocol { - enum CommandTypes { + const enum CommandTypes { Brace = "brace", BraceCompletion = "braceCompletion", + GetSpanOfEnclosingComment = "getSpanOfEnclosingComment", Change = "change", Close = "close", Completions = "completions", @@ -3951,6 +3968,13 @@ declare namespace ts.server.protocol { interface TodoCommentsResponse extends Response { body?: TodoComment[]; } + interface SpanOfEnclosingCommentRequest extends FileLocationRequest { + command: CommandTypes.GetSpanOfEnclosingComment; + arguments: SpanOfEnclosingCommentRequestArgs; + } + interface SpanOfEnclosingCommentRequestArgs extends FileLocationRequestArgs { + onlyMultiLine: boolean; + } interface IndentationRequest extends FileLocationRequest { command: CommandTypes.Indentation; arguments: IndentationRequestArgs; @@ -4168,7 +4192,7 @@ declare namespace ts.server.protocol { } interface RenameResponseBody { info: RenameInfo; - locs: SpanGroup[]; + locs: ReadonlyArray; } interface RenameResponse extends Response { body?: RenameResponseBody; @@ -4248,6 +4272,7 @@ declare namespace ts.server.protocol { } interface SetCompilerOptionsForInferredProjectsArgs { options: ExternalProjectCompilerOptions; + projectRootPath?: string; } interface SetCompilerOptionsForInferredProjectsResponse extends Response { } @@ -4603,7 +4628,7 @@ declare namespace ts.server.protocol { interface NavTreeResponse extends Response { body?: NavigationTree; } - enum IndentStyle { + const enum IndentStyle { None = "None", Block = "Block", Smart = "Smart", @@ -4681,6 +4706,7 @@ declare namespace ts.server.protocol { paths?: MapLike; plugins?: PluginImport[]; preserveConstEnums?: boolean; + preserveSymlinks?: boolean; project?: string; reactNamespace?: string; removeComments?: boolean; @@ -4700,13 +4726,13 @@ declare namespace ts.server.protocol { typeRoots?: string[]; [option: string]: CompilerOptionsValue | undefined; } - enum JsxEmit { + const enum JsxEmit { None = "None", Preserve = "Preserve", ReactNative = "ReactNative", React = "React", } - enum ModuleKind { + const enum ModuleKind { None = "None", CommonJS = "CommonJS", AMD = "AMD", @@ -4714,20 +4740,24 @@ declare namespace ts.server.protocol { System = "System", ES6 = "ES6", ES2015 = "ES2015", + ESNext = "ESNext", } - enum ModuleResolutionKind { + const enum ModuleResolutionKind { Classic = "Classic", Node = "Node", } - enum NewLineKind { + const enum NewLineKind { Crlf = "Crlf", Lf = "Lf", } - enum ScriptTarget { + const enum ScriptTarget { ES3 = "ES3", ES5 = "ES5", ES6 = "ES6", ES2015 = "ES2015", + ES2016 = "ES2016", + ES2017 = "ES2017", + ESNext = "ESNext", } } declare namespace ts.server { @@ -4750,6 +4780,7 @@ declare namespace ts.server { host: ServerHost; cancellationToken: ServerCancellationToken; useSingleInferredProject: boolean; + useInferredProjectPerProjectRoot: boolean; typingsInstaller: ITypingsInstaller; byteLength: (buf: string, encoding?: string) => number; hrtime: (start?: number[]) => number[]; @@ -4757,8 +4788,8 @@ declare namespace ts.server { canUseEvents: boolean; eventHandler?: ProjectServiceEventHandler; throttleWaitMilliseconds?: number; - globalPlugins?: string[]; - pluginProbeLocations?: string[]; + globalPlugins?: ReadonlyArray; + pluginProbeLocations?: ReadonlyArray; allowLocalPluginLoads?: boolean; } class Session implements EventSender { @@ -4780,13 +4811,13 @@ declare namespace ts.server { private defaultEventHandler(event); logError(err: Error, cmd: string): void; send(msg: protocol.Message): void; - configFileDiagnosticEvent(triggerFile: string, configFile: string, diagnostics: Diagnostic[]): void; + configFileDiagnosticEvent(triggerFile: string, configFile: string, diagnostics: ReadonlyArray): void; event(info: T, eventName: string): void; output(info: any, cmdName: string, reqSeq?: number, errorMsg?: string): void; private semanticCheck(file, project); private syntacticCheck(file, project); - private updateProjectStructure(seq, matchSeq, ms?); - private updateErrorCheck(next, checkList, seq, matchSeq, ms?, followMs?, requireOpen?); + private updateProjectStructure(); + private updateErrorCheck(next, checkList, ms, requireOpen?); private cleanProjects(caption, projects); private cleanup(); private getEncodedSemanticClassifications(args); @@ -4820,6 +4851,7 @@ declare namespace ts.server { private getOutliningSpans(args); private getTodoComments(args); private getDocCommentTemplate(args); + private getSpanOfEnclosingComment(args); private getIndentation(args); private getBreakpointStatement(args); private getNameOrDottedNameSpan(args); @@ -4878,38 +4910,10 @@ declare namespace ts.server { } } declare namespace ts.server { - interface LineCollection { - charCount(): number; - lineCount(): number; - isLeaf(): this is LineLeaf; - walk(rangeStart: number, rangeLength: number, walkFns: ILineIndexWalker): void; - } interface AbsolutePositionAndLineText { absolutePosition: number; lineText: string | undefined; } - enum CharRangeSection { - PreStart = 0, - Start = 1, - Entire = 2, - Mid = 3, - End = 4, - PostEnd = 5, - } - interface ILineIndexWalker { - goSubtree: boolean; - done: boolean; - leaf(relativeStart: number, relativeLength: number, lineCollection: LineLeaf): void; - pre?(relativeStart: number, relativeLength: number, lineCollection: LineCollection, parent: LineNode, nodeType: CharRangeSection): void; - post?(relativeStart: number, relativeLength: number, lineCollection: LineCollection, parent: LineNode, nodeType: CharRangeSection): void; - } - class TextChange { - pos: number; - deleteLen: number; - insertedText: string; - constructor(pos: number, deleteLen: number, insertedText?: string); - getTextChangeRange(): TextChangeRange; - } class ScriptVersionCache { private changes; private readonly versions; @@ -4921,79 +4925,17 @@ declare namespace ts.server { private versionToIndex(version); private currentVersionToIndex(); edit(pos: number, deleteLen: number, insertedText?: string): void; - latest(): LineIndexSnapshot; - latestVersion(): number; reload(script: string): void; - getSnapshot(): LineIndexSnapshot; + getSnapshot(): IScriptSnapshot; + private _getSnapshot(); + getSnapshotVersion(): number; + getLineInfo(line: number): AbsolutePositionAndLineText; + lineOffsetToPosition(line: number, column: number): number; + positionToLineOffset(position: number): protocol.Location; + lineToTextSpan(line: number): TextSpan; getTextChangesBetweenVersions(oldVersion: number, newVersion: number): TextChangeRange; static fromString(script: string): ScriptVersionCache; } - class LineIndexSnapshot implements IScriptSnapshot { - readonly version: number; - readonly cache: ScriptVersionCache; - readonly index: LineIndex; - readonly changesSincePreviousVersion: ReadonlyArray; - constructor(version: number, cache: ScriptVersionCache, index: LineIndex, changesSincePreviousVersion?: ReadonlyArray); - getText(rangeStart: number, rangeEnd: number): string; - getLength(): number; - getChangeRange(oldSnapshot: IScriptSnapshot): TextChangeRange; - } - class LineIndex { - root: LineNode; - checkEdits: boolean; - absolutePositionOfStartOfLine(oneBasedLine: number): number; - positionToLineOffset(position: number): protocol.Location; - private positionToColumnAndLineText(position); - lineNumberToInfo(oneBasedLine: number): AbsolutePositionAndLineText; - load(lines: string[]): void; - walk(rangeStart: number, rangeLength: number, walkFns: ILineIndexWalker): void; - getText(rangeStart: number, rangeLength: number): string; - getLength(): number; - every(f: (ll: LineLeaf, s: number, len: number) => boolean, rangeStart: number, rangeEnd?: number): boolean; - edit(pos: number, deleteLength: number, newText?: string): LineIndex; - private static buildTreeFromBottom(nodes); - static linesFromText(text: string): { - lines: string[]; - lineMap: number[]; - }; - } - class LineNode implements LineCollection { - private readonly children; - totalChars: number; - totalLines: number; - constructor(children?: LineCollection[]); - isLeaf(): boolean; - updateCounts(): void; - private execWalk(rangeStart, rangeLength, walkFns, childIndex, nodeType); - private skipChild(relativeStart, relativeLength, childIndex, walkFns, nodeType); - walk(rangeStart: number, rangeLength: number, walkFns: ILineIndexWalker): void; - charOffsetToLineInfo(lineNumberAccumulator: number, relativePosition: number): { - oneBasedLine: number; - zeroBasedColumn: number; - lineText: string | undefined; - }; - lineNumberToInfo(relativeOneBasedLine: number, positionAccumulator: number): { - position: number; - leaf: LineLeaf | undefined; - }; - private childFromLineNumber(relativeOneBasedLine, positionAccumulator); - private childFromCharOffset(lineNumberAccumulator, relativePosition); - private splitAfter(childIndex); - remove(child: LineCollection): void; - private findChildIndex(child); - insertAt(child: LineCollection, nodes: LineCollection[]): LineNode[]; - add(collection: LineCollection): void; - charCount(): number; - lineCount(): number; - } - class LineLeaf implements LineCollection { - text: string; - constructor(text: string); - isLeaf(): boolean; - walk(rangeStart: number, rangeLength: number, walkFns: ILineIndexWalker): void; - charCount(): number; - lineCount(): number; - } } declare namespace ts.server { class ScriptInfo { @@ -5174,7 +5116,7 @@ declare namespace ts.server { private projectStructureVersion; private projectStateVersion; private typingFiles; - protected projectErrors: Diagnostic[]; + protected projectErrors: ReadonlyArray; typesVersion: number; isNonTsProject(): boolean; isJsOnlyProject(): boolean; @@ -5182,8 +5124,8 @@ declare namespace ts.server { static resolveModule(moduleName: string, initialDir: string, host: ServerHost, log: (message: string) => void): {}; constructor(projectName: string, projectKind: ProjectKind, projectService: ProjectService, documentRegistry: DocumentRegistry, hasExplicitListOfFiles: boolean, languageServiceEnabled: boolean, compilerOptions: CompilerOptions, compileOnSaveEnabled: boolean); private setInternalCompilerOptionsForEmittingJsFiles(); - getGlobalProjectErrors(): Diagnostic[]; - getAllProjectErrors(): Diagnostic[]; + getGlobalProjectErrors(): ReadonlyArray; + getAllProjectErrors(): ReadonlyArray; getLanguageService(ensureSynchronized?: boolean): LanguageService; getCompileOnSaveAffectedFileList(scriptInfo: ScriptInfo): string[]; getProjectVersion(): string; @@ -5203,6 +5145,7 @@ declare namespace ts.server { getRootScriptInfos(): ScriptInfo[]; getScriptInfos(): ScriptInfo[]; getFileEmitOutput(info: ScriptInfo, emitOnlyDtsFiles: boolean): EmitOutput; + getExcludedFiles(): ReadonlyArray; getFileNames(excludeFilesFromExternalLibraries?: boolean, excludeConfigFiles?: boolean): NormalizedPath[]; hasConfigFile(configFilePath: NormalizedPath): boolean; getAllEmittableFiles(): string[]; @@ -5228,12 +5171,13 @@ declare namespace ts.server { protected removeRoot(info: ScriptInfo): void; } class InferredProject extends Project { + readonly projectRootPath: string | undefined; private static readonly newName; private _isJsInferredProject; toggleJsInferredProject(isJsInferredProject: boolean): void; setCompilerOptions(options?: CompilerOptions): void; directoriesWatchedForTsconfig: string[]; - constructor(projectService: ProjectService, documentRegistry: DocumentRegistry, compilerOptions: CompilerOptions); + constructor(projectService: ProjectService, documentRegistry: DocumentRegistry, compilerOptions: CompilerOptions, projectRootPath?: string); addRoot(info: ScriptInfo): void; removeRoot(info: ScriptInfo): void; getProjectRootPath(): string; @@ -5257,7 +5201,7 @@ declare namespace ts.server { private enablePlugin(pluginConfigEntry, searchPaths); private enableProxy(pluginModuleFactory, configEntry); getProjectRootPath(): string; - setProjectErrors(projectErrors: Diagnostic[]): void; + setProjectErrors(projectErrors: ReadonlyArray): void; setTypeAcquisition(newTypeAcquisition: TypeAcquisition): void; getTypeAcquisition(): TypeAcquisition; getExternalFiles(): SortedReadonlyArray; @@ -5275,11 +5219,13 @@ declare namespace ts.server { externalProjectName: string; compileOnSaveEnabled: boolean; private readonly projectFilePath; + excludedFiles: ReadonlyArray; private typeAcquisition; constructor(externalProjectName: string, projectService: ProjectService, documentRegistry: DocumentRegistry, compilerOptions: CompilerOptions, languageServiceEnabled: boolean, compileOnSaveEnabled: boolean, projectFilePath?: string); + getExcludedFiles(): ReadonlyArray; getProjectRootPath(): string; getTypeAcquisition(): TypeAcquisition; - setProjectErrors(projectErrors: Diagnostic[]): void; + setProjectErrors(projectErrors: ReadonlyArray): void; setTypeAcquisition(newTypeAcquisition: TypeAcquisition): void; } } @@ -5301,7 +5247,7 @@ declare namespace ts.server { data: { triggerFile: string; configFileName: string; - diagnostics: Diagnostic[]; + diagnostics: ReadonlyArray; }; } interface ProjectLanguageServiceStateEvent { @@ -5353,11 +5299,15 @@ declare namespace ts.server { types?: string[]; }; } + interface TypesMapFile { + typesMap: SafeList; + simpleMap: string[]; + } function convertFormatOptions(protocolOptions: protocol.FormatCodeSettings): FormatCodeSettings; function convertCompilerOptions(protocolOptions: protocol.ExternalProjectCompilerOptions): CompilerOptions & protocol.CompileOnSaveMixin; function tryConvertScriptKindName(scriptKindName: protocol.ScriptKindName | ScriptKind): ScriptKind; function convertScriptKindName(scriptKindName: protocol.ScriptKindName): ScriptKind.Unknown | ScriptKind.JS | ScriptKind.JSX | ScriptKind.TS | ScriptKind.TSX; - function combineProjectOutput(projects: Project[], action: (project: Project) => T[], comparer?: (a: T, b: T) => number, areEqual?: (a: T, b: T) => boolean): T[]; + function combineProjectOutput(projects: ReadonlyArray, action: (project: Project) => ReadonlyArray, comparer?: (a: T, b: T) => number, areEqual?: (a: T, b: T) => boolean): T[]; interface HostConfiguration { formatCodeOptions: FormatCodeSettings; hostInfo: string; @@ -5365,19 +5315,21 @@ declare namespace ts.server { } interface OpenConfiguredProjectResult { configFileName?: NormalizedPath; - configFileErrors?: Diagnostic[]; + configFileErrors?: ReadonlyArray; } interface ProjectServiceOptions { host: ServerHost; logger: Logger; cancellationToken: HostCancellationToken; useSingleInferredProject: boolean; + useInferredProjectPerProjectRoot: boolean; typingsInstaller: ITypingsInstaller; eventHandler?: ProjectServiceEventHandler; throttleWaitMilliseconds?: number; - globalPlugins?: string[]; - pluginProbeLocations?: string[]; + globalPlugins?: ReadonlyArray; + pluginProbeLocations?: ReadonlyArray; allowLocalPluginLoads?: boolean; + typesMapLocation?: string; } class ProjectService { readonly typingsCache: TypingsCache; @@ -5389,7 +5341,7 @@ declare namespace ts.server { readonly configuredProjects: ConfiguredProject[]; readonly openFiles: ScriptInfo[]; private compilerOptionsForInferredProjects; - private compileOnSaveForInferredProjects; + private compilerOptionsForInferredProjectsPerProjectRoot; private readonly projectToSizeMap; private readonly directoryWatchers; private readonly throttledOperations; @@ -5402,19 +5354,22 @@ declare namespace ts.server { readonly logger: Logger; readonly cancellationToken: HostCancellationToken; readonly useSingleInferredProject: boolean; + readonly useInferredProjectPerProjectRoot: boolean; readonly typingsInstaller: ITypingsInstaller; readonly throttleWaitMilliseconds?: number; private readonly eventHandler?; readonly globalPlugins: ReadonlyArray; readonly pluginProbeLocations: ReadonlyArray; readonly allowLocalPluginLoads: boolean; + readonly typesMapLocation: string | undefined; private readonly seenProjects; constructor(opts: ProjectServiceOptions); ensureInferredProjectsUpToDate_TestOnly(): void; getCompilerOptionsForInferredProjects(): CompilerOptions; onUpdateLanguageServiceStateForProject(project: Project, languageServiceEnabled: boolean): void; + private loadTypesMap(); updateTypingsForProject(response: SetTypings | InvalidateCachedTypings): void; - setCompilerOptionsForInferredProjects(projectCompilerOptions: protocol.ExternalProjectCompilerOptions): void; + setCompilerOptionsForInferredProjects(projectCompilerOptions: protocol.ExternalProjectCompilerOptions, projectRootPath?: string): void; stopWatchingDirectory(directory: string): void; findProject(projectName: string): Project; getDefaultProjectForFile(fileName: NormalizedPath, refreshInferredProjects: boolean): Project; @@ -5431,7 +5386,7 @@ declare namespace ts.server { private onConfigFileAddedForInferredProject(fileName); private getCanonicalFileName(fileName); private removeProject(project); - private assignScriptInfoToInferredProjectIfNecessary(info, addToListOfOpenFiles); + private assignScriptInfoToInferredProjectIfNecessary(info, addToListOfOpenFiles, projectRootPath?); private closeOpenFile(info); private deleteOrphanScriptInfoNotInAnyProject(); private openOrUpdateConfiguredProjectForFile(fileName, projectRootPath?); @@ -5450,7 +5405,10 @@ declare namespace ts.server { private openConfigFile(configFileName, clientFileName?); private updateNonInferredProject(project, newUncheckedFiles, propertyReader, newOptions, newTypeAcquisition, compileOnSave, configFileErrors); private updateConfiguredProject(project); - createInferredProjectWithRootFileIfNecessary(root: ScriptInfo): InferredProject; + private getOrCreateInferredProjectForProjectRootPathIfEnabled(root, projectRootPath); + private getOrCreateSingleInferredProjectIfEnabled(); + private createInferredProject(isSingleInferredProject?, projectRootPath?); + createInferredProjectWithRootFileIfNecessary(root: ScriptInfo, projectRootPath?: string): InferredProject; getOrCreateScriptInfo(uncheckedFileName: string, openedByClient: boolean, fileContent?: string, scriptKind?: ScriptKind): ScriptInfo; getScriptInfo(uncheckedFileName: string): ScriptInfo; watchClosedScriptInfo(info: ScriptInfo): void; @@ -5471,8 +5429,7 @@ declare namespace ts.server { private static readonly filenameEscapeRegexp; private static escapeFilenameForRegex(filename); resetSafeList(): void; - loadSafeList(fileName: string): void; - applySafeList(proj: protocol.ExternalProject): void; + applySafeList(proj: protocol.ExternalProject): NormalizedPath[]; openExternalProject(proj: protocol.ExternalProject, suppressRefreshOfInferredProjects?: boolean): void; } } diff --git a/lib/tsserverlibrary.js b/lib/tsserverlibrary.js index 07c0852235dd1..263796daa7acd 100644 --- a/lib/tsserverlibrary.js +++ b/lib/tsserverlibrary.js @@ -508,11 +508,11 @@ var ts; TypeFormatFlags[TypeFormatFlags["UseFullyQualifiedType"] = 256] = "UseFullyQualifiedType"; TypeFormatFlags[TypeFormatFlags["InFirstTypeArgument"] = 512] = "InFirstTypeArgument"; TypeFormatFlags[TypeFormatFlags["InTypeAlias"] = 1024] = "InTypeAlias"; - TypeFormatFlags[TypeFormatFlags["UseTypeAliasValue"] = 2048] = "UseTypeAliasValue"; TypeFormatFlags[TypeFormatFlags["SuppressAnyReturnType"] = 4096] = "SuppressAnyReturnType"; TypeFormatFlags[TypeFormatFlags["AddUndefined"] = 8192] = "AddUndefined"; TypeFormatFlags[TypeFormatFlags["WriteClassExpressionAsTypeLiteral"] = 16384] = "WriteClassExpressionAsTypeLiteral"; TypeFormatFlags[TypeFormatFlags["InArrayType"] = 32768] = "InArrayType"; + TypeFormatFlags[TypeFormatFlags["UseAliasDefinedOutsideCurrentScope"] = 65536] = "UseAliasDefinedOutsideCurrentScope"; })(TypeFormatFlags = ts.TypeFormatFlags || (ts.TypeFormatFlags = {})); var SymbolFormatFlags; (function (SymbolFormatFlags) { @@ -759,6 +759,12 @@ var ts; InferenceFlags[InferenceFlags["NoDefault"] = 2] = "NoDefault"; InferenceFlags[InferenceFlags["AnyDefault"] = 4] = "AnyDefault"; })(InferenceFlags = ts.InferenceFlags || (ts.InferenceFlags = {})); + var Ternary; + (function (Ternary) { + Ternary[Ternary["False"] = 0] = "False"; + Ternary[Ternary["Maybe"] = 1] = "Maybe"; + Ternary[Ternary["True"] = -1] = "True"; + })(Ternary = ts.Ternary || (ts.Ternary = {})); var SpecialPropertyAssignmentKind; (function (SpecialPropertyAssignmentKind) { SpecialPropertyAssignmentKind[SpecialPropertyAssignmentKind["None"] = 0] = "None"; @@ -1155,16 +1161,10 @@ var ts; })(ts || (ts = {})); var ts; (function (ts) { - ts.versionMajorMinor = "2.5"; + ts.versionMajorMinor = "2.6"; ts.version = ts.versionMajorMinor + ".0"; })(ts || (ts = {})); (function (ts) { - var Ternary; - (function (Ternary) { - Ternary[Ternary["False"] = 0] = "False"; - Ternary[Ternary["Maybe"] = 1] = "Maybe"; - Ternary[Ternary["True"] = -1] = "True"; - })(Ternary = ts.Ternary || (ts.Ternary = {})); ts.collator = typeof Intl === "object" && typeof Intl.Collator === "function" ? new Intl.Collator(undefined, { usage: "sort", sensitivity: "accent" }) : undefined; ts.localeCompareIsCorrect = ts.collator && ts.collator.compare("a", "B") < 0; function createDictionaryObject() { @@ -1452,10 +1452,9 @@ var ts; ts.removeWhere = removeWhere; function filterMutate(array, f) { var outIndex = 0; - for (var _i = 0, array_3 = array; _i < array_3.length; _i++) { - var item = array_3[_i]; - if (f(item)) { - array[outIndex] = item; + for (var i = 0; i < array.length; i++) { + if (f(array[i], i, array)) { + array[outIndex] = array[i]; outIndex++; } } @@ -1501,8 +1500,8 @@ var ts; var result; if (array) { result = []; - for (var _i = 0, array_4 = array; _i < array_4.length; _i++) { - var v = array_4[_i]; + for (var _i = 0, array_3 = array; _i < array_3.length; _i++) { + var v = array_3[_i]; if (v) { if (isArray(v)) { addRange(result, v); @@ -1572,11 +1571,13 @@ var ts; ts.sameFlatMap = sameFlatMap; function mapDefined(array, mapFn) { var result = []; - for (var i = 0; i < array.length; i++) { - var item = array[i]; - var mapped = mapFn(item, i); - if (mapped !== undefined) { - result.push(mapped); + if (array) { + for (var i = 0; i < array.length; i++) { + var item = array[i]; + var mapped = mapFn(item, i); + if (mapped !== undefined) { + result.push(mapped); + } } } return result; @@ -1644,8 +1645,8 @@ var ts; function some(array, predicate) { if (array) { if (predicate) { - for (var _i = 0, array_5 = array; _i < array_5.length; _i++) { - var v = array_5[_i]; + for (var _i = 0, array_4 = array; _i < array_4.length; _i++) { + var v = array_4[_i]; if (predicate(v)) { return true; } @@ -1670,8 +1671,8 @@ var ts; var result; if (array) { result = []; - loop: for (var _i = 0, array_6 = array; _i < array_6.length; _i++) { - var item = array_6[_i]; + loop: for (var _i = 0, array_5 = array; _i < array_5.length; _i++) { + var item = array_5[_i]; for (var _a = 0, result_1 = result; _a < result_1.length; _a++) { var res = result_1[_a]; if (areEqual ? areEqual(res, item) : res === item) { @@ -1759,8 +1760,8 @@ var ts; ts.relativeComplement = relativeComplement; function sum(array, prop) { var result = 0; - for (var _i = 0, array_7 = array; _i < array_7.length; _i++) { - var v = array_7[_i]; + for (var _i = 0, array_6 = array; _i < array_6.length; _i++) { + var v = array_6[_i]; result += v[prop]; } return result; @@ -2020,8 +2021,8 @@ var ts; ts.equalOwnProperties = equalOwnProperties; function arrayToMap(array, makeKey, makeValue) { var result = createMap(); - for (var _i = 0, array_8 = array; _i < array_8.length; _i++) { - var value = array_8[_i]; + for (var _i = 0, array_7 = array; _i < array_7.length; _i++) { + var value = array_7[_i]; result.set(makeKey(value), makeValue ? makeValue(value) : value); } return result; @@ -2181,11 +2182,11 @@ var ts; ts.getLocaleSpecificMessage = getLocaleSpecificMessage; function createFileDiagnostic(file, start, length, message) { var end = start + length; - Debug.assert(start >= 0, "start must be non-negative, is " + start); - Debug.assert(length >= 0, "length must be non-negative, is " + length); + Debug.assertGreaterThanOrEqual(start, 0); + Debug.assertGreaterThanOrEqual(length, 0); if (file) { - Debug.assert(start <= file.text.length, "start must be within the bounds of the file. " + start + " > " + file.text.length); - Debug.assert(end <= file.text.length, "end must be the bounds of the file. " + end + " > " + file.text.length); + Debug.assertLessThanOrEqual(start, file.text.length); + Debug.assertLessThanOrEqual(end, file.text.length); } var text = getLocaleSpecificMessage(message); if (arguments.length > 4) { @@ -2394,19 +2395,23 @@ var ts; return normalized; } function normalizePath(path) { + return normalizePathAndParts(path).path; + } + ts.normalizePath = normalizePath; + function normalizePathAndParts(path) { path = normalizeSlashes(path); var rootLength = getRootLength(path); var root = path.substr(0, rootLength); - var normalized = getNormalizedParts(path, rootLength); - if (normalized.length) { - var joinedParts = root + normalized.join(ts.directorySeparator); - return pathEndsWithDirectorySeparator(path) ? joinedParts + ts.directorySeparator : joinedParts; + var parts = getNormalizedParts(path, rootLength); + if (parts.length) { + var joinedParts = root + parts.join(ts.directorySeparator); + return { path: pathEndsWithDirectorySeparator(path) ? joinedParts + ts.directorySeparator : joinedParts, parts: parts }; } else { - return root; + return { path: root, parts: parts }; } } - ts.normalizePath = normalizePath; + ts.normalizePathAndParts = normalizePathAndParts; function pathEndsWithDirectorySeparator(path) { return path.charCodeAt(path.length - 1) === directorySeparatorCharCode; } @@ -2669,8 +2674,28 @@ var ts; ts.fileExtensionIsOneOf = fileExtensionIsOneOf; var reservedCharacterPattern = /[^\w\s\/]/g; var wildcardCharCodes = [42, 63]; - var singleAsteriskRegexFragmentFiles = "([^./]|(\\.(?!min\\.js$))?)*"; - var singleAsteriskRegexFragmentOther = "[^/]*"; + ts.commonPackageFolders = ["node_modules", "bower_components", "jspm_packages"]; + var implicitExcludePathRegexPattern = "(?!(" + ts.commonPackageFolders.join("|") + ")(/|$))"; + var filesMatcher = { + singleAsteriskRegexFragment: "([^./]|(\\.(?!min\\.js$))?)*", + doubleAsteriskRegexFragment: "(/" + implicitExcludePathRegexPattern + "[^/.][^/]*)*?", + replaceWildcardCharacter: function (match) { return replaceWildcardCharacter(match, filesMatcher.singleAsteriskRegexFragment); } + }; + var directoriesMatcher = { + singleAsteriskRegexFragment: "[^/]*", + doubleAsteriskRegexFragment: "(/" + implicitExcludePathRegexPattern + "[^/.][^/]*)*?", + replaceWildcardCharacter: function (match) { return replaceWildcardCharacter(match, directoriesMatcher.singleAsteriskRegexFragment); } + }; + var excludeMatcher = { + singleAsteriskRegexFragment: "[^/]*", + doubleAsteriskRegexFragment: "(/.+?)?", + replaceWildcardCharacter: function (match) { return replaceWildcardCharacter(match, excludeMatcher.singleAsteriskRegexFragment); } + }; + var wildcardMatchers = { + files: filesMatcher, + directories: directoriesMatcher, + exclude: excludeMatcher + }; function getRegularExpressionForWildcard(specs, basePath, usage) { var patterns = getRegularExpressionsForWildcards(specs, basePath, usage); if (!patterns || !patterns.length) { @@ -2685,18 +2710,16 @@ var ts; if (specs === undefined || specs.length === 0) { return undefined; } - var replaceWildcardCharacter = usage === "files" ? replaceWildCardCharacterFiles : replaceWildCardCharacterOther; - var singleAsteriskRegexFragment = usage === "files" ? singleAsteriskRegexFragmentFiles : singleAsteriskRegexFragmentOther; - var doubleAsteriskRegexFragment = usage === "exclude" ? "(/.+?)?" : "(/[^/.][^/]*)*?"; return flatMap(specs, function (spec) { - return spec && getSubPatternFromSpec(spec, basePath, usage, singleAsteriskRegexFragment, doubleAsteriskRegexFragment, replaceWildcardCharacter); + return spec && getSubPatternFromSpec(spec, basePath, usage, wildcardMatchers[usage]); }); } function isImplicitGlob(lastPathComponent) { return !/[.*?]/.test(lastPathComponent); } ts.isImplicitGlob = isImplicitGlob; - function getSubPatternFromSpec(spec, basePath, usage, singleAsteriskRegexFragment, doubleAsteriskRegexFragment, replaceWildcardCharacter) { + function getSubPatternFromSpec(spec, basePath, usage, _a) { + var singleAsteriskRegexFragment = _a.singleAsteriskRegexFragment, doubleAsteriskRegexFragment = _a.doubleAsteriskRegexFragment, replaceWildcardCharacter = _a.replaceWildcardCharacter; var subpattern = ""; var hasRecursiveDirectoryWildcard = false; var hasWrittenComponent = false; @@ -2728,16 +2751,24 @@ var ts; subpattern += ts.directorySeparator; } if (usage !== "exclude") { + var componentPattern = ""; if (component.charCodeAt(0) === 42) { - subpattern += "([^./]" + singleAsteriskRegexFragment + ")?"; + componentPattern += "([^./]" + singleAsteriskRegexFragment + ")?"; component = component.substr(1); } else if (component.charCodeAt(0) === 63) { - subpattern += "[^./]"; + componentPattern += "[^./]"; component = component.substr(1); } + componentPattern += component.replace(reservedCharacterPattern, replaceWildcardCharacter); + if (componentPattern !== component) { + subpattern += implicitExcludePathRegexPattern; + } + subpattern += componentPattern; + } + else { + subpattern += component.replace(reservedCharacterPattern, replaceWildcardCharacter); } - subpattern += component.replace(reservedCharacterPattern, replaceWildcardCharacter); } hasWrittenComponent = true; } @@ -2747,12 +2778,6 @@ var ts; } return subpattern; } - function replaceWildCardCharacterFiles(match) { - return replaceWildcardCharacter(match, singleAsteriskRegexFragmentFiles); - } - function replaceWildCardCharacterOther(match) { - return replaceWildcardCharacter(match, singleAsteriskRegexFragmentOther); - } function replaceWildcardCharacter(match, singleAsteriskRegexFragment) { return match === "*" ? singleAsteriskRegexFragment : match === "?" ? "[^/]" : "\\" + match; } @@ -2788,19 +2813,19 @@ var ts; var _a = getFileSystemEntries(path), files = _a.files, directories = _a.directories; files = files.slice().sort(comparer); var _loop_1 = function (current) { - var name = combinePaths(path, current); + var name_1 = combinePaths(path, current); var absoluteName = combinePaths(absolutePath, current); - if (extensions && !fileExtensionIsOneOf(name, extensions)) + if (extensions && !fileExtensionIsOneOf(name_1, extensions)) return "continue"; if (excludeRegex && excludeRegex.test(absoluteName)) return "continue"; if (!includeFileRegexes) { - results[0].push(name); + results[0].push(name_1); } else { var includeIndex = findIndex(includeFileRegexes, function (re) { return re.test(absoluteName); }); if (includeIndex !== -1) { - results[includeIndex].push(name); + results[includeIndex].push(name_1); } } }; @@ -2817,11 +2842,11 @@ var ts; directories = directories.slice().sort(comparer); for (var _b = 0, directories_1 = directories; _b < directories_1.length; _b++) { var current = directories_1[_b]; - var name = combinePaths(path, current); + var name_2 = combinePaths(path, current); var absoluteName = combinePaths(absolutePath, current); if ((!includeDirectoryRegex || includeDirectoryRegex.test(absoluteName)) && (!excludeRegex || !excludeRegex.test(absoluteName))) { - visitDirectory(name, absoluteName, depth); + visitDirectory(name_2, absoluteName, depth); } } } @@ -2889,14 +2914,7 @@ var ts; if (!extraFileExtensions || extraFileExtensions.length === 0 || !needAllExtensions) { return needAllExtensions ? allSupportedExtensions : ts.supportedTypeScriptExtensions; } - var extensions = allSupportedExtensions.slice(0); - for (var _i = 0, extraFileExtensions_1 = extraFileExtensions; _i < extraFileExtensions_1.length; _i++) { - var extInfo = extraFileExtensions_1[_i]; - if (extensions.indexOf(extInfo.extension) === -1) { - extensions.push(extInfo.extension); - } - } - return extensions; + return deduplicate(allSupportedExtensions.concat(extraFileExtensions.map(function (e) { return e.extension; }))); } ts.getSupportedExtensions = getSupportedExtensions; function hasJavaScriptFileExtension(fileName) { @@ -3038,12 +3056,37 @@ var ts; function assert(expression, message, verboseDebugInfo, stackCrawlMark) { if (!expression) { if (verboseDebugInfo) { - message += "\r\nVerbose Debug Information: " + verboseDebugInfo(); + message += "\r\nVerbose Debug Information: " + (typeof verboseDebugInfo === "string" ? verboseDebugInfo : verboseDebugInfo()); } fail(message ? "False expression: " + message : "False expression.", stackCrawlMark || assert); } } Debug.assert = assert; + function assertEqual(a, b, msg, msg2) { + if (a !== b) { + var message = msg ? msg2 ? msg + " " + msg2 : msg : ""; + fail("Expected " + a + " === " + b + ". " + message); + } + } + Debug.assertEqual = assertEqual; + function assertLessThan(a, b, msg) { + if (a >= b) { + fail("Expected " + a + " < " + b + ". " + (msg || "")); + } + } + Debug.assertLessThan = assertLessThan; + function assertLessThanOrEqual(a, b) { + if (a > b) { + fail("Expected " + a + " <= " + b); + } + } + Debug.assertLessThanOrEqual = assertLessThanOrEqual; + function assertGreaterThanOrEqual(a, b) { + if (a < b) { + fail("Expected " + a + " >= " + b); + } + } + Debug.assertGreaterThanOrEqual = assertGreaterThanOrEqual; function fail(message, stackCrawlMark) { debugger; var e = new Error(message ? "Debug Failure. " + message : "Debug Failure."); @@ -3178,6 +3221,10 @@ var ts; Debug.fail("File " + path + " has unknown extension."); } ts.extensionFromPath = extensionFromPath; + function isAnySupportedFileExtension(path) { + return tryGetExtensionFromPath(path) !== undefined; + } + ts.isAnySupportedFileExtension = isAnySupportedFileExtension; function tryGetExtensionFromPath(path) { return find(ts.supportedTypescriptExtensionsForExtractExtension, function (e) { return fileExtensionIs(path, e); }) || find(ts.supportedJavascriptExtensions, function (e) { return fileExtensionIs(path, e); }); } @@ -3189,6 +3236,12 @@ var ts; })(ts || (ts = {})); var ts; (function (ts) { + function setStackTraceLimit() { + if (Error.stackTraceLimit < 100) { + Error.stackTraceLimit = 100; + } + } + ts.setStackTraceLimit = setStackTraceLimit; var FileWatcherEventKind; (function (FileWatcherEventKind) { FileWatcherEventKind[FileWatcherEventKind["Created"] = 0] = "Created"; @@ -3238,7 +3291,7 @@ var ts; watcher.referenceCount += 1; return; } - watcher = _fs.watch(dirPath, { persistent: true }, function (eventName, relativeFileName) { return fileEventHandler(eventName, relativeFileName, dirPath); }); + watcher = _fs.watch(dirPath || ".", { persistent: true }, function (eventName, relativeFileName) { return fileEventHandler(eventName, relativeFileName, dirPath); }); watcher.referenceCount = 1; dirWatchers.set(dirPath, watcher); return; @@ -3338,10 +3391,10 @@ var ts; if (entry === "." || entry === "..") { continue; } - var name = ts.combinePaths(path, entry); + var name_3 = ts.combinePaths(path, entry); var stat = void 0; try { - stat = _fs.statSync(name); + stat = _fs.statSync(name_3); } catch (e) { continue; @@ -4064,6 +4117,8 @@ var ts; Expected_at_least_0_arguments_but_got_a_minimum_of_1: diag(2557, ts.DiagnosticCategory.Error, "Expected_at_least_0_arguments_but_got_a_minimum_of_1_2557", "Expected at least {0} arguments, but got a minimum of {1}."), Expected_0_type_arguments_but_got_1: diag(2558, ts.DiagnosticCategory.Error, "Expected_0_type_arguments_but_got_1_2558", "Expected {0} type arguments, but got {1}."), Type_0_has_no_properties_in_common_with_type_1: diag(2559, ts.DiagnosticCategory.Error, "Type_0_has_no_properties_in_common_with_type_1_2559", "Type '{0}' has no properties in common with type '{1}'."), + Value_of_type_0_has_no_properties_in_common_with_type_1_Did_you_mean_to_call_it: diag(2560, ts.DiagnosticCategory.Error, "Value_of_type_0_has_no_properties_in_common_with_type_1_Did_you_mean_to_call_it_2560", "Value of type '{0}' has no properties in common with type '{1}'. Did you mean to call it?"), + Base_class_expressions_cannot_reference_class_type_parameters: diag(2561, ts.DiagnosticCategory.Error, "Base_class_expressions_cannot_reference_class_type_parameters_2561", "Base class expressions cannot reference class type parameters."), JSX_element_attributes_type_0_may_not_be_a_union_type: diag(2600, ts.DiagnosticCategory.Error, "JSX_element_attributes_type_0_may_not_be_a_union_type_2600", "JSX element attributes type '{0}' may not be a union type."), The_return_type_of_a_JSX_element_constructor_must_return_an_object_type: diag(2601, ts.DiagnosticCategory.Error, "The_return_type_of_a_JSX_element_constructor_must_return_an_object_type_2601", "The return type of a JSX element constructor must return an object type."), JSX_element_implicitly_has_type_any_because_the_global_type_JSX_Element_does_not_exist: diag(2602, ts.DiagnosticCategory.Error, "JSX_element_implicitly_has_type_any_because_the_global_type_JSX_Element_does_not_exist_2602", "JSX element implicitly has type 'any' because the global type 'JSX.Element' does not exist."), @@ -4251,6 +4306,7 @@ var ts; Do_not_emit_outputs: diag(6010, ts.DiagnosticCategory.Message, "Do_not_emit_outputs_6010", "Do not emit outputs."), Allow_default_imports_from_modules_with_no_default_export_This_does_not_affect_code_emit_just_typechecking: diag(6011, ts.DiagnosticCategory.Message, "Allow_default_imports_from_modules_with_no_default_export_This_does_not_affect_code_emit_just_typech_6011", "Allow default imports from modules with no default export. This does not affect code emit, just typechecking."), Skip_type_checking_of_declaration_files: diag(6012, ts.DiagnosticCategory.Message, "Skip_type_checking_of_declaration_files_6012", "Skip type checking of declaration files."), + Do_not_resolve_the_real_path_of_symlinks: diag(6013, ts.DiagnosticCategory.Message, "Do_not_resolve_the_real_path_of_symlinks_6013", "Do not resolve the real path of symlinks."), Specify_ECMAScript_target_version_Colon_ES3_default_ES5_ES2015_ES2016_ES2017_or_ESNEXT: diag(6015, ts.DiagnosticCategory.Message, "Specify_ECMAScript_target_version_Colon_ES3_default_ES5_ES2015_ES2016_ES2017_or_ESNEXT_6015", "Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', or 'ESNEXT'."), Specify_module_code_generation_Colon_none_commonjs_amd_system_umd_es2015_or_ESNext: diag(6016, ts.DiagnosticCategory.Message, "Specify_module_code_generation_Colon_none_commonjs_amd_system_umd_es2015_or_ESNext_6016", "Specify module code generation: 'none', commonjs', 'amd', 'system', 'umd', 'es2015', or 'ESNext'."), Print_this_message: diag(6017, ts.DiagnosticCategory.Message, "Print_this_message_6017", "Print this message."), @@ -4504,6 +4560,8 @@ var ts; Rewrite_as_the_indexed_access_type_0: diag(90026, ts.DiagnosticCategory.Message, "Rewrite_as_the_indexed_access_type_0_90026", "Rewrite as the indexed access type '{0}'."), Convert_function_to_an_ES2015_class: diag(95001, ts.DiagnosticCategory.Message, "Convert_function_to_an_ES2015_class_95001", "Convert function to an ES2015 class"), Convert_function_0_to_class: diag(95002, ts.DiagnosticCategory.Message, "Convert_function_0_to_class_95002", "Convert function '{0}' to class"), + Extract_function: diag(95003, ts.DiagnosticCategory.Message, "Extract_function_95003", "Extract function"), + Extract_function_into_0: diag(95004, ts.DiagnosticCategory.Message, "Extract_function_into_0_95004", "Extract function into '{0}'"), }; })(ts || (ts = {})); var ts; @@ -4524,19 +4582,6 @@ var ts; return undefined; } ts.getDeclarationOfKind = getDeclarationOfKind; - function findDeclaration(symbol, predicate) { - var declarations = symbol.declarations; - if (declarations) { - for (var _i = 0, declarations_2 = declarations; _i < declarations_2.length; _i++) { - var declaration = declarations_2[_i]; - if (predicate(declaration)) { - return declaration; - } - } - } - return undefined; - } - ts.findDeclaration = findDeclaration; var stringWriter = createSingleLineStringWriter(); var stringWriterAcquired = false; function createSingleLineStringWriter() { @@ -4599,9 +4644,13 @@ var ts; function moduleResolutionIsEqualTo(oldResolution, newResolution) { return oldResolution.isExternalLibraryImport === newResolution.isExternalLibraryImport && oldResolution.extension === newResolution.extension && - oldResolution.resolvedFileName === newResolution.resolvedFileName; + oldResolution.resolvedFileName === newResolution.resolvedFileName && + packageIdIsEqual(oldResolution.packageId, newResolution.packageId); } ts.moduleResolutionIsEqualTo = moduleResolutionIsEqualTo; + function packageIdIsEqual(a, b) { + return a === b || a && b && a.name === b.name && a.version === b.version; + } function typeDirectiveIsEqualTo(oldResolution, newResolution) { return oldResolution.resolvedFileName === newResolution.resolvedFileName && oldResolution.primary === newResolution.primary; } @@ -4666,14 +4715,6 @@ var ts; return file.fileName + "(" + (loc.line + 1) + "," + (loc.character + 1) + ")"; } ts.nodePosToString = nodePosToString; - function getStartPosOfNode(node) { - return node.pos; - } - ts.getStartPosOfNode = getStartPosOfNode; - function isDefined(value) { - return value !== undefined; - } - ts.isDefined = isDefined; function getEndLinePosition(line, sourceFile) { ts.Debug.assert(line >= 0); var lineStarts = ts.getLineStarts(sourceFile); @@ -4704,6 +4745,25 @@ var ts; return !nodeIsMissing(node); } ts.nodeIsPresent = nodeIsPresent; + function isRecognizedTripleSlashComment(text, commentPos, commentEnd) { + if (text.charCodeAt(commentPos + 1) === 47 && + commentPos + 2 < commentEnd && + text.charCodeAt(commentPos + 2) === 47) { + var textSubStr = text.substring(commentPos, commentEnd); + return textSubStr.match(ts.fullTripleSlashReferencePathRegEx) || + textSubStr.match(ts.fullTripleSlashAMDReferencePathRegEx) || + textSubStr.match(fullTripleSlashReferenceTypeReferenceDirectiveRegEx) || + textSubStr.match(defaultLibReferenceRegEx) ? + true : false; + } + return false; + } + ts.isRecognizedTripleSlashComment = isRecognizedTripleSlashComment; + function isPinnedComment(text, comment) { + return text.charCodeAt(comment.pos + 1) === 42 && + text.charCodeAt(comment.pos + 2) === 33; + } + ts.isPinnedComment = isPinnedComment; function getTokenPosOfNode(node, sourceFile, includeJsDoc) { if (nodeIsMissing(node)) { return node.pos; @@ -4760,15 +4820,20 @@ var ts; var escapeText = getEmitFlags(node) & 16777216 ? escapeString : escapeNonAsciiString; switch (node.kind) { case 9: - return '"' + escapeText(node.text) + '"'; + if (node.singleQuote) { + return "'" + escapeText(node.text, 39) + "'"; + } + else { + return '"' + escapeText(node.text, 34) + '"'; + } case 13: - return "`" + escapeText(node.text) + "`"; + return "`" + escapeText(node.text, 96) + "`"; case 14: - return "`" + escapeText(node.text) + "${"; + return "`" + escapeText(node.text, 96) + "${"; case 15: - return "}" + escapeText(node.text) + "${"; + return "}" + escapeText(node.text, 96) + "${"; case 16: - return "}" + escapeText(node.text) + "`"; + return "}" + escapeText(node.text, 96) + "`"; case 8: return node.text; } @@ -5020,13 +5085,9 @@ var ts; } ts.isPrologueDirective = isPrologueDirective; function getLeadingCommentRangesOfNode(node, sourceFileOfNode) { - return ts.getLeadingCommentRanges(sourceFileOfNode.text, node.pos); + return node.kind !== 10 ? ts.getLeadingCommentRanges(sourceFileOfNode.text, node.pos) : undefined; } ts.getLeadingCommentRangesOfNode = getLeadingCommentRangesOfNode; - function getLeadingCommentRangesOfNodeFromText(node, text) { - return ts.getLeadingCommentRanges(text, node.pos); - } - ts.getLeadingCommentRangesOfNodeFromText = getLeadingCommentRangesOfNodeFromText; function getJSDocCommentRanges(node, text) { var commentRanges = (node.kind === 146 || node.kind === 145 || @@ -5034,7 +5095,7 @@ var ts; node.kind === 187 || node.kind === 185) ? ts.concatenate(ts.getTrailingCommentRanges(text, node.pos), ts.getLeadingCommentRanges(text, node.pos)) : - getLeadingCommentRangesOfNodeFromText(node, text); + ts.getLeadingCommentRanges(text, node.pos); return ts.filter(commentRanges, function (comment) { return text.charCodeAt(comment.pos + 1) === 42 && text.charCodeAt(comment.pos + 2) === 42 && @@ -5043,8 +5104,9 @@ var ts; } ts.getJSDocCommentRanges = getJSDocCommentRanges; ts.fullTripleSlashReferencePathRegEx = /^(\/\/\/\s*/; - ts.fullTripleSlashReferenceTypeReferenceDirectiveRegEx = /^(\/\/\/\s*/; + var fullTripleSlashReferenceTypeReferenceDirectiveRegEx = /^(\/\/\/\s*/; ts.fullTripleSlashAMDReferencePathRegEx = /^(\/\/\/\s*/; + var defaultLibReferenceRegEx = /^(\/\/\/\s*/; function isPartOfTypeNode(node) { if (158 <= node.kind && node.kind <= 173) { return true; @@ -5073,23 +5135,23 @@ var ts; case 143: case 179: case 99: - var parent = node.parent; - if (parent.kind === 162) { + var parent_1 = node.parent; + if (parent_1.kind === 162) { return false; } - if (158 <= parent.kind && parent.kind <= 173) { + if (158 <= parent_1.kind && parent_1.kind <= 173) { return true; } - switch (parent.kind) { + switch (parent_1.kind) { case 201: - return !isExpressionWithTypeArgumentsInClassExtendsClause(parent); + return !isExpressionWithTypeArgumentsInClassExtendsClause(parent_1); case 145: - return node === parent.constraint; + return node === parent_1.constraint; case 149: case 148: case 146: case 226: - return node === parent.type; + return node === parent_1.type; case 228: case 186: case 187: @@ -5098,16 +5160,16 @@ var ts; case 150: case 153: case 154: - return node === parent.type; + return node === parent_1.type; case 155: case 156: case 157: - return node === parent.type; + return node === parent_1.type; case 184: - return node === parent.type; + return node === parent_1.type; case 181: case 182: - return parent.typeArguments && ts.indexOf(parent.typeArguments, node) >= 0; + return parent_1.typeArguments && ts.indexOf(parent_1.typeArguments, node) >= 0; case 183: return false; } @@ -5171,9 +5233,9 @@ var ts; return; default: if (ts.isFunctionLike(node)) { - var name = node.name; - if (name && name.kind === 144) { - traverse(name.expression); + var name_4 = node.name; + if (name_4 && name_4.kind === 144) { + traverse(name_4.expression); return; } } @@ -5271,21 +5333,11 @@ var ts; } ts.getPropertyAssignment = getPropertyAssignment; function getContainingFunction(node) { - while (true) { - node = node.parent; - if (!node || ts.isFunctionLike(node)) { - return node; - } - } + return ts.findAncestor(node.parent, ts.isFunctionLike); } ts.getContainingFunction = getContainingFunction; function getContainingClass(node) { - while (true) { - node = node.parent; - if (!node || ts.isClassLike(node)) { - return node; - } - } + return ts.findAncestor(node.parent, ts.isClassLike); } ts.getContainingClass = getContainingClass; function getThisContainer(node, includeArrowFunctions) { @@ -5385,13 +5437,13 @@ var ts; function getImmediatelyInvokedFunctionExpression(func) { if (func.kind === 186 || func.kind === 187) { var prev = func; - var parent = func.parent; - while (parent.kind === 185) { - prev = parent; - parent = parent.parent; + var parent_2 = func.parent; + while (parent_2.kind === 185) { + prev = parent_2; + parent_2 = parent_2.parent; } - if (parent.kind === 181 && parent.expression === prev) { - return parent; + if (parent_2.kind === 181 && parent_2.expression === prev) { + return parent_2; } } } @@ -5527,8 +5579,8 @@ var ts; case 8: case 9: case 99: - var parent = node.parent; - switch (parent.kind) { + var parent_3 = node.parent; + switch (parent_3.kind) { case 226: case 146: case 149: @@ -5536,7 +5588,7 @@ var ts; case 264: case 261: case 176: - return parent.initializer === node; + return parent_3.initializer === node; case 210: case 211: case 212: @@ -5546,33 +5598,33 @@ var ts; case 221: case 257: case 223: - return parent.expression === node; + return parent_3.expression === node; case 214: - var forStatement = parent; + var forStatement = parent_3; return (forStatement.initializer === node && forStatement.initializer.kind !== 227) || forStatement.condition === node || forStatement.incrementor === node; case 215: case 216: - var forInStatement = parent; + var forInStatement = parent_3; return (forInStatement.initializer === node && forInStatement.initializer.kind !== 227) || forInStatement.expression === node; case 184: case 202: - return node === parent.expression; + return node === parent_3.expression; case 205: - return node === parent.expression; + return node === parent_3.expression; case 144: - return node === parent.expression; + return node === parent_3.expression; case 147: case 256: case 255: case 263: return true; case 201: - return parent.expression === node && isExpressionWithTypeArgumentsInClassExtendsClause(parent); + return parent_3.expression === node && isExpressionWithTypeArgumentsInClassExtendsClause(parent_3); default: - if (isPartOfExpression(parent)) { + if (isPartOfExpression(parent_3)) { return true; } } @@ -5807,8 +5859,8 @@ var ts; } function getJSDocParameterTags(param) { if (param.name && ts.isIdentifier(param.name)) { - var name_1 = param.name.escapedText; - return getJSDocTags(param.parent).filter(function (tag) { return ts.isJSDocParameterTag(tag) && ts.isIdentifier(tag.name) && tag.name.escapedText === name_1; }); + var name_5 = param.name.escapedText; + return getJSDocTags(param.parent).filter(function (tag) { return ts.isJSDocParameterTag(tag) && ts.isIdentifier(tag.name) && tag.name.escapedText === name_5; }); } return undefined; } @@ -6095,14 +6147,14 @@ var ts; ts.getAncestor = getAncestor; function getFileReferenceFromReferencePath(comment, commentRange) { var simpleReferenceRegEx = /^\/\/\/\s*/gim; + var isNoDefaultLibRegEx = new RegExp(defaultLibReferenceRegEx.source, "gim"); if (simpleReferenceRegEx.test(comment)) { if (isNoDefaultLibRegEx.test(comment)) { return { isNoDefaultLib: true }; } else { var refMatchResult = ts.fullTripleSlashReferencePathRegEx.exec(comment); - var refLibResult = !refMatchResult && ts.fullTripleSlashReferenceTypeReferenceDirectiveRegEx.exec(comment); + var refLibResult = !refMatchResult && fullTripleSlashReferenceTypeReferenceDirectiveRegEx.exec(comment); var match = refMatchResult || refLibResult; if (match) { var pos = commentRange.pos + match[1].length + match[2].length; @@ -6291,10 +6343,6 @@ var ts; return ts.getParseTreeNode(sourceFile, ts.isSourceFile) || sourceFile; } ts.getOriginalSourceFile = getOriginalSourceFile; - function getOriginalSourceFiles(sourceFiles) { - return ts.sameMap(sourceFiles, getOriginalSourceFile); - } - ts.getOriginalSourceFiles = getOriginalSourceFiles; var Associativity; (function (Associativity) { Associativity[Associativity["Left"] = 0] = "Left"; @@ -6533,7 +6581,9 @@ var ts; } } ts.createDiagnosticCollection = createDiagnosticCollection; - var escapedCharsRegExp = /[\\\"\u0000-\u001f\t\v\f\b\r\n\u2028\u2029\u0085]/g; + var doubleQuoteEscapedCharsRegExp = /[\\\"\u0000-\u001f\t\v\f\b\r\n\u2028\u2029\u0085]/g; + var singleQuoteEscapedCharsRegExp = /[\\\'\u0000-\u001f\t\v\f\b\r\n\u2028\u2029\u0085]/g; + var backtickQuoteEscapedCharsRegExp = /[\\\`\u0000-\u001f\t\v\f\b\r\n\u2028\u2029\u0085]/g; var escapedCharsMap = ts.createMapFromTemplate({ "\0": "\\0", "\t": "\\t", @@ -6544,11 +6594,16 @@ var ts; "\n": "\\n", "\\": "\\\\", "\"": "\\\"", + "\'": "\\\'", + "\`": "\\\`", "\u2028": "\\u2028", "\u2029": "\\u2029", "\u0085": "\\u0085" }); - function escapeString(s) { + function escapeString(s, quoteChar) { + var escapedCharsRegExp = quoteChar === 96 ? backtickQuoteEscapedCharsRegExp : + quoteChar === 39 ? singleQuoteEscapedCharsRegExp : + doubleQuoteEscapedCharsRegExp; return s.replace(escapedCharsRegExp, getReplacement); } ts.escapeString = escapeString; @@ -6566,8 +6621,8 @@ var ts; return "\\u" + paddedHexCode; } var nonAsciiCharacters = /[^\u0000-\u007F]/g; - function escapeNonAsciiString(s) { - s = escapeString(s); + function escapeNonAsciiString(s, quoteChar) { + s = escapeString(s, quoteChar); return nonAsciiCharacters.test(s) ? s.replace(nonAsciiCharacters, function (c) { return get16BitUnicodeEscapeSequence(c.charCodeAt(0)); }) : s; @@ -6908,7 +6963,7 @@ var ts; var currentDetachedCommentInfo; if (removeComments) { if (node.pos === 0) { - leadingComments = ts.filter(ts.getLeadingCommentRanges(text, node.pos), isPinnedComment); + leadingComments = ts.filter(ts.getLeadingCommentRanges(text, node.pos), isPinnedCommentLocal); } } else { @@ -6940,9 +6995,8 @@ var ts; } } return currentDetachedCommentInfo; - function isPinnedComment(comment) { - return text.charCodeAt(comment.pos + 1) === 42 && - text.charCodeAt(comment.pos + 2) === 33; + function isPinnedCommentLocal(comment) { + return isPinnedComment(text, comment); } } ts.emitDetachedComments = emitDetachedComments; @@ -7013,9 +7067,13 @@ var ts; } ts.hasModifiers = hasModifiers; function hasModifier(node, flags) { - return (getModifierFlags(node) & flags) !== 0; + return !!getSelectedModifierFlags(node, flags); } ts.hasModifier = hasModifier; + function getSelectedModifierFlags(node, flags) { + return getModifierFlags(node) & flags; + } + ts.getSelectedModifierFlags = getSelectedModifierFlags; function getModifierFlags(node) { if (node.modifierFlagsCache & 536870912) { return node.modifierFlagsCache & ~536870912; @@ -7091,21 +7149,6 @@ var ts; return false; } ts.isDestructuringAssignment = isDestructuringAssignment; - function isSupportedExpressionWithTypeArguments(node) { - return isSupportedExpressionWithTypeArgumentsRest(node.expression); - } - ts.isSupportedExpressionWithTypeArguments = isSupportedExpressionWithTypeArguments; - function isSupportedExpressionWithTypeArgumentsRest(node) { - if (node.kind === 71) { - return true; - } - else if (ts.isPropertyAccessExpression(node)) { - return isSupportedExpressionWithTypeArgumentsRest(node.expression); - } - else { - return false; - } - } function isExpressionWithTypeArgumentsInClassExtendsClause(node) { return tryGetClassExtendingExpressionWithTypeArguments(node) !== undefined; } @@ -7218,72 +7261,6 @@ var ts; return carriageReturnLineFeed; } ts.getNewLineCharacter = getNewLineCharacter; - function isSimpleExpression(node) { - return isSimpleExpressionWorker(node, 0); - } - ts.isSimpleExpression = isSimpleExpression; - function isSimpleExpressionWorker(node, depth) { - if (depth <= 5) { - var kind = node.kind; - if (kind === 9 - || kind === 8 - || kind === 12 - || kind === 13 - || kind === 71 - || kind === 99 - || kind === 97 - || kind === 101 - || kind === 86 - || kind === 95) { - return true; - } - else if (kind === 179) { - return isSimpleExpressionWorker(node.expression, depth + 1); - } - else if (kind === 180) { - return isSimpleExpressionWorker(node.expression, depth + 1) - && isSimpleExpressionWorker(node.argumentExpression, depth + 1); - } - else if (kind === 192 - || kind === 193) { - return isSimpleExpressionWorker(node.operand, depth + 1); - } - else if (kind === 194) { - return node.operatorToken.kind !== 40 - && isSimpleExpressionWorker(node.left, depth + 1) - && isSimpleExpressionWorker(node.right, depth + 1); - } - else if (kind === 195) { - return isSimpleExpressionWorker(node.condition, depth + 1) - && isSimpleExpressionWorker(node.whenTrue, depth + 1) - && isSimpleExpressionWorker(node.whenFalse, depth + 1); - } - else if (kind === 190 - || kind === 189 - || kind === 188) { - return isSimpleExpressionWorker(node.expression, depth + 1); - } - else if (kind === 177) { - return node.elements.length === 0; - } - else if (kind === 178) { - return node.properties.length === 0; - } - else if (kind === 181) { - if (!isSimpleExpressionWorker(node.expression, depth + 1)) { - return false; - } - for (var _i = 0, _a = node.arguments; _i < _a.length; _i++) { - var argument = _a[_i]; - if (!isSimpleExpressionWorker(argument, depth + 1)) { - return false; - } - } - return true; - } - } - return false; - } function formatEnum(value, enumObject, isFlags) { if (value === void 0) { value = 0; } var members = getEnumMembers(enumObject); @@ -7316,10 +7293,10 @@ var ts; } function getEnumMembers(enumObject) { var result = []; - for (var name in enumObject) { - var value = enumObject[name]; + for (var name_6 in enumObject) { + var value = enumObject[name_6]; if (typeof value === "number") { - result.push([value, name]); + result.push([value, name_6]); } } return ts.stableSort(result, function (x, y) { return ts.compareValues(x[0], y[0]); }); @@ -7352,18 +7329,6 @@ var ts; return formatEnum(flags, ts.ObjectFlags, true); } ts.formatObjectFlags = formatObjectFlags; - function getRangePos(range) { - return range ? range.pos : -1; - } - ts.getRangePos = getRangePos; - function getRangeEnd(range) { - return range ? range.end : -1; - } - ts.getRangeEnd = getRangeEnd; - function movePos(pos, value) { - return ts.positionIsSynthesized(pos) ? -1 : pos + value; - } - ts.movePos = movePos; function createRange(pos, end) { return { pos: pos, end: end }; } @@ -7392,14 +7357,6 @@ var ts; return range.pos === range.end; } ts.isCollapsedRange = isCollapsedRange; - function collapseRangeToStart(range) { - return isCollapsedRange(range) ? range : moveRangeEnd(range, range.pos); - } - ts.collapseRangeToStart = collapseRangeToStart; - function collapseRangeToEnd(range) { - return isCollapsedRange(range) ? range : moveRangePos(range, range.end); - } - ts.collapseRangeToEnd = collapseRangeToEnd; function createTokenRange(pos, token) { return createRange(pos, pos + ts.tokenToString(token).length); } @@ -7452,22 +7409,6 @@ var ts; function isInitializedVariable(node) { return node.initializer !== undefined; } - function isMergedWithClass(node) { - if (node.symbol) { - for (var _i = 0, _a = node.symbol.declarations; _i < _a.length; _i++) { - var declaration = _a[_i]; - if (declaration.kind === 229 && declaration !== node) { - return true; - } - } - } - return false; - } - ts.isMergedWithClass = isMergedWithClass; - function isFirstDeclarationOfKind(node, kind) { - return node.symbol && getDeclarationOfKind(node.symbol, kind) === node; - } - ts.isFirstDeclarationOfKind = isFirstDeclarationOfKind; function isWatchSet(options) { return options.watch && options.hasOwnProperty("watch"); } @@ -7668,6 +7609,20 @@ var ts; return ts.hasModifier(node, 92) && node.parent.kind === 152 && ts.isClassLike(node.parent.parent); } ts.isParameterPropertyDeclaration = isParameterPropertyDeclaration; + function isEmptyBindingPattern(node) { + if (ts.isBindingPattern(node)) { + return ts.every(node.elements, isEmptyBindingElement); + } + return false; + } + ts.isEmptyBindingPattern = isEmptyBindingPattern; + function isEmptyBindingElement(node) { + if (ts.isOmittedExpression(node)) { + return true; + } + return isEmptyBindingPattern(node.name); + } + ts.isEmptyBindingElement = isEmptyBindingElement; function walkUpBindingElementsAndPatterns(node) { while (node && (node.kind === 176 || ts.isBindingPattern(node))) { node = node.parent; @@ -8748,6 +8703,18 @@ var ts; return isUnaryExpressionKind(ts.skipPartiallyEmittedExpressions(node).kind); } ts.isUnaryExpression = isUnaryExpression; + function isUnaryExpressionWithWrite(expr) { + switch (expr.kind) { + case 193: + return true; + case 192: + return expr.operator === 43 || + expr.operator === 44; + default: + return false; + } + } + ts.isUnaryExpressionWithWrite = isUnaryExpressionWithWrite; function isExpressionKind(kind) { return kind === 195 || kind === 197 @@ -8932,9 +8899,19 @@ var ts; var kind = node.kind; return isStatementKindButNotDeclarationKind(kind) || isDeclarationStatementKind(kind) - || kind === 207; + || isBlockStatement(node); } ts.isStatement = isStatement; + function isBlockStatement(node) { + if (node.kind !== 207) + return false; + if (node.parent !== undefined) { + if (node.parent.kind === 224 || node.parent.kind === 260) { + return false; + } + } + return !ts.isFunctionBlock(node); + } function isModuleReference(node) { var kind = node.kind; return kind === 248 @@ -12439,11 +12416,31 @@ var ts; var node = parseTokenNode(); return token() === 23 ? undefined : node; } - function parseLiteralTypeNode() { + function parseLiteralTypeNode(negative) { var node = createNode(173); - node.literal = parseSimpleUnaryExpression(); - finishNode(node); - return node; + var unaryMinusExpression; + if (negative) { + unaryMinusExpression = createNode(192); + unaryMinusExpression.operator = 38; + nextToken(); + } + var expression; + switch (token()) { + case 9: + case 8: + expression = parseLiteralLikeNode(token()); + break; + case 101: + case 86: + expression = parseTokenNode(); + } + if (negative) { + unaryMinusExpression.operand = expression; + finishNode(unaryMinusExpression); + expression = unaryMinusExpression; + } + node.literal = expression; + return finishNode(node); } function nextTokenIsNumericLiteral() { return nextToken() === 8; @@ -12475,7 +12472,7 @@ var ts; case 86: return parseLiteralTypeNode(); case 38: - return lookAhead(nextTokenIsNumericLiteral) ? parseLiteralTypeNode() : parseTypeReference(); + return lookAhead(nextTokenIsNumericLiteral) ? parseLiteralTypeNode(true) : parseTypeReference(); case 105: case 95: return parseTokenNode(); @@ -12524,6 +12521,7 @@ var ts; case 101: case 86: case 134: + case 39: return true; case 38: return lookAhead(nextTokenIsNumericLiteral); @@ -12842,7 +12840,7 @@ var ts; if (!arrowFunction) { return undefined; } - var isAsync = !!(ts.getModifierFlags(arrowFunction) & 256); + var isAsync = ts.hasModifier(arrowFunction, 256); var lastToken = token(); arrowFunction.equalsGreaterThanToken = parseExpectedToken(36, false, ts.Diagnostics._0_expected, "=>"); arrowFunction.body = (lastToken === 36 || lastToken === 17) @@ -12958,7 +12956,7 @@ var ts; function parseParenthesizedArrowFunctionExpressionHead(allowAmbiguity) { var node = createNode(187); node.modifiers = parseModifiersForArrowFunction(); - var isAsync = (ts.getModifierFlags(node) & 256) ? 2 : 0; + var isAsync = ts.hasModifier(node, 256) ? 2 : 0; fillSignature(56, isAsync | (allowAmbiguity ? 0 : 8), node); if (!node.parameters) { return undefined; @@ -13691,7 +13689,7 @@ var ts; parseExpected(89); node.asteriskToken = parseOptionalToken(39); var isGenerator = node.asteriskToken ? 1 : 0; - var isAsync = (ts.getModifierFlags(node) & 256) ? 2 : 0; + var isAsync = ts.hasModifier(node, 256) ? 2 : 0; node.name = isGenerator && isAsync ? doInYieldAndAwaitContext(parseOptionalIdentifier) : isGenerator ? doInYieldContext(parseOptionalIdentifier) : @@ -13916,10 +13914,13 @@ var ts; function parseCatchClause() { var result = createNode(260); parseExpected(74); - if (parseExpected(19)) { + if (parseOptional(19)) { result.variableDeclaration = parseVariableDeclaration(); + parseExpected(20); + } + else { + result.variableDeclaration = undefined; } - parseExpected(20); result.block = parseBlock(false); return finishNode(result); } @@ -14505,8 +14506,8 @@ var ts; return parsePropertyOrMethodDeclaration(fullStart, decorators, modifiers); } if (decorators || modifiers) { - var name = createMissingNode(71, true, ts.Diagnostics.Declaration_expected); - return parsePropertyDeclaration(fullStart, decorators, modifiers, name, undefined); + var name_7 = createMissingNode(71, true, ts.Diagnostics.Declaration_expected); + return parsePropertyDeclaration(fullStart, decorators, modifiers, name_7, undefined); } ts.Debug.fail("Should not have attempted to parse class member declaration."); } @@ -15524,14 +15525,14 @@ var ts; } var typeParameters = createNodeArray(); while (true) { - var name = parseJSDocIdentifierName(); + var name_8 = parseJSDocIdentifierName(); skipWhitespace(); - if (!name) { + if (!name_8) { parseErrorAtPosition(scanner.getStartPos(), 0, ts.Diagnostics.Identifier_expected); return undefined; } - var typeParameter = createNode(145, name.pos); - typeParameter.name = name; + var typeParameter = createNode(145, name_8.pos); + typeParameter.name = name_8; finishNode(typeParameter); typeParameters.push(typeParameter); if (token() === 26) { @@ -15559,11 +15560,11 @@ var ts; parseExpected(22); } while (parseOptional(23)) { - var name = parseJSDocIdentifierName(true); + var name_9 = parseJSDocIdentifierName(true); if (parseOptional(21)) { parseExpected(22); } - entity = createQualifiedName(entity, name); + entity = createQualifiedName(entity, name_9); } return entity; } @@ -15651,8 +15652,8 @@ var ts; array._children = undefined; array.pos += delta; array.end += delta; - for (var _i = 0, array_9 = array; _i < array_9.length; _i++) { - var node = array_9[_i]; + for (var _i = 0, array_8 = array; _i < array_8.length; _i++) { + var node = array_8[_i]; visitNode(node); } } @@ -15724,8 +15725,8 @@ var ts; array.intersectsChange = true; array._children = undefined; adjustIntersectingElement(array, changeStart, changeRangeOldEnd, changeRangeNewEnd, delta); - for (var _i = 0, array_10 = array; _i < array_10.length; _i++) { - var node = array_10[_i]; + for (var _i = 0, array_9 = array; _i < array_9.length; _i++) { + var node = array_9[_i]; visitNode(node); } return; @@ -16241,6 +16242,12 @@ var ts; category: ts.Diagnostics.Module_Resolution_Options, description: ts.Diagnostics.Allow_default_imports_from_modules_with_no_default_export_This_does_not_affect_code_emit_just_typechecking }, + { + name: "preserveSymlinks", + type: "boolean", + category: ts.Diagnostics.Module_Resolution_Options, + description: ts.Diagnostics.Do_not_resolve_the_real_path_of_symlinks, + }, { name: "sourceRoot", type: "string", @@ -16852,7 +16859,7 @@ var ts; var text = valueExpression.text; if (option && typeof option.type !== "string") { var customOption = option; - if (!customOption.type.has(text)) { + if (!customOption.type.has(text.toLowerCase())) { errors.push(createDiagnosticForInvalidCustomType(customOption, function (message, arg0, arg1) { return ts.createDiagnosticForNodeInSourceFile(sourceFile, valueExpression, message, arg0, arg1); })); } } @@ -16930,31 +16937,31 @@ var ts; function serializeCompilerOptions(options) { var result = ts.createMap(); var optionsNameMap = getOptionNameMap().optionNameMap; - var _loop_3 = function (name) { - if (ts.hasProperty(options, name)) { - if (optionsNameMap.has(name) && optionsNameMap.get(name).category === ts.Diagnostics.Command_line_Options) { + var _loop_3 = function (name_10) { + if (ts.hasProperty(options, name_10)) { + if (optionsNameMap.has(name_10) && optionsNameMap.get(name_10).category === ts.Diagnostics.Command_line_Options) { return "continue"; } - var value = options[name]; - var optionDefinition = optionsNameMap.get(name.toLowerCase()); + var value = options[name_10]; + var optionDefinition = optionsNameMap.get(name_10.toLowerCase()); if (optionDefinition) { var customTypeMap_1 = getCustomTypeMapOfCommandLineOption(optionDefinition); if (!customTypeMap_1) { - result.set(name, value); + result.set(name_10, value); } else { if (optionDefinition.type === "list") { - result.set(name, value.map(function (element) { return getNameOfCompilerOptionValue(element, customTypeMap_1); })); + result.set(name_10, value.map(function (element) { return getNameOfCompilerOptionValue(element, customTypeMap_1); })); } else { - result.set(name, getNameOfCompilerOptionValue(value, customTypeMap_1)); + result.set(name_10, getNameOfCompilerOptionValue(value, customTypeMap_1)); } } } } }; - for (var name in options) { - _loop_3(name); + for (var name_10 in options) { + _loop_3(name_10); } return result; } @@ -17103,12 +17110,10 @@ var ts; } } else { - var specs = includeSpecs ? [] : ["node_modules", "bower_components", "jspm_packages"]; var outDir = raw["compilerOptions"] && raw["compilerOptions"]["outDir"]; if (outDir) { - specs.push(outDir); + excludeSpecs = [outDir]; } - excludeSpecs = specs; } if (fileNames === undefined && includeSpecs === undefined) { includeSpecs = ["**/*"]; @@ -17359,7 +17364,7 @@ var ts; return value; } else if (typeof option.type !== "string") { - return option.type.get(value); + return option.type.get(typeof value === "string" ? value.toLowerCase() : value); } return normalizeNonListOptionValue(option, basePath, value); } @@ -17434,23 +17439,13 @@ var ts; }; } function validateSpecs(specs, errors, allowTrailingRecursion, jsonSourceFile, specKey) { - var validSpecs = []; - for (var _i = 0, specs_1 = specs; _i < specs_1.length; _i++) { - var spec = specs_1[_i]; - if (!allowTrailingRecursion && invalidTrailingRecursionPattern.test(spec)) { - errors.push(createDiagnostic(ts.Diagnostics.File_specification_cannot_end_in_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0, spec)); - } - else if (invalidMultipleRecursionPatterns.test(spec)) { - errors.push(createDiagnostic(ts.Diagnostics.File_specification_cannot_contain_multiple_recursive_directory_wildcards_Asterisk_Asterisk_Colon_0, spec)); - } - else if (invalidDotDotAfterRecursiveWildcardPattern.test(spec)) { - errors.push(createDiagnostic(ts.Diagnostics.File_specification_cannot_contain_a_parent_directory_that_appears_after_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0, spec)); - } - else { - validSpecs.push(spec); + return specs.filter(function (spec) { + var diag = specToDiagnostic(spec, allowTrailingRecursion); + if (diag !== undefined) { + errors.push(createDiagnostic(diag, spec)); } - } - return validSpecs; + return diag === undefined; + }); function createDiagnostic(message, spec) { if (jsonSourceFile && jsonSourceFile.jsonObject) { for (var _i = 0, _a = ts.getPropertyAssignment(jsonSourceFile.jsonObject, specKey); _i < _a.length; _i++) { @@ -17468,6 +17463,17 @@ var ts; return ts.createCompilerDiagnostic(message, spec); } } + function specToDiagnostic(spec, allowTrailingRecursion) { + if (!allowTrailingRecursion && invalidTrailingRecursionPattern.test(spec)) { + return ts.Diagnostics.File_specification_cannot_end_in_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0; + } + else if (invalidMultipleRecursionPatterns.test(spec)) { + return ts.Diagnostics.File_specification_cannot_contain_multiple_recursive_directory_wildcards_Asterisk_Asterisk_Colon_0; + } + else if (invalidDotDotAfterRecursiveWildcardPattern.test(spec)) { + return ts.Diagnostics.File_specification_cannot_contain_a_parent_directory_that_appears_after_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0; + } + } function getWildcardDirectories(include, exclude, path, useCaseSensitiveFileNames) { var rawExcludeRegex = ts.getRegularExpressionForWildcard(exclude, path, "exclude"); var excludeRegex = rawExcludeRegex && new RegExp(rawExcludeRegex, useCaseSensitiveFileNames ? "" : "i"); @@ -17590,6 +17596,12 @@ var ts; return compilerOptions.traceResolution && host.trace !== undefined; } ts.isTraceEnabled = isTraceEnabled; + function withPackageId(packageId, r) { + return r && { path: r.path, extension: r.ext, packageId: packageId }; + } + function noPackageId(r) { + return withPackageId(undefined, r); + } var Extensions; (function (Extensions) { Extensions[Extensions["TypeScript"] = 0] = "TypeScript"; @@ -17605,12 +17617,11 @@ var ts; } function createResolvedModuleWithFailedLookupLocations(resolved, isExternalLibraryImport, failedLookupLocations) { return { - resolvedModule: resolved && { resolvedFileName: resolved.path, extension: resolved.extension, isExternalLibraryImport: isExternalLibraryImport }, + resolvedModule: resolved && { resolvedFileName: resolved.path, extension: resolved.extension, isExternalLibraryImport: isExternalLibraryImport, packageId: resolved.packageId }, failedLookupLocations: failedLookupLocations }; } - function tryReadPackageJsonFields(readTypes, packageJsonPath, baseDirectory, state) { - var jsonContent = readJson(packageJsonPath, state.host); + function tryReadPackageJsonFields(readTypes, jsonContent, baseDirectory, state) { return readTypes ? tryReadFromField("typings") || tryReadFromField("types") : tryReadFromField("main"); function tryReadFromField(fieldName) { if (!ts.hasProperty(jsonContent, fieldName)) { @@ -17704,7 +17715,9 @@ var ts; } var resolvedTypeReferenceDirective; if (resolved) { - resolved = realpath(resolved, host, traceEnabled); + if (!options.preserveSymlinks) { + resolved = realPath(resolved, host, traceEnabled); + } if (traceEnabled) { trace(host, ts.Diagnostics.Type_reference_directive_0_was_successfully_resolved_to_1_primary_Colon_2, typeReferenceDirectiveName, resolved, primary); } @@ -17821,12 +17834,12 @@ var ts; var commonPrefix = getCommonPrefix(path, resolvedFileName); var current = path; while (true) { - var parent = ts.getDirectoryPath(current); - if (parent === current || directoryPathMap.has(parent)) { + var parent_4 = ts.getDirectoryPath(current); + if (parent_4 === current || directoryPathMap.has(parent_4)) { break; } - directoryPathMap.set(parent, result); - current = parent; + directoryPathMap.set(parent_4, result); + current = parent_4; if (current === commonPrefix) { break; } @@ -18005,7 +18018,7 @@ var ts; if (extension !== undefined) { var path_1 = tryFile(candidate, failedLookupLocations, false, state); if (path_1 !== undefined) { - return { path: path_1, extension: extension }; + return { path: path_1, extension: extension, packageId: undefined }; } } return loader(extensions, candidate, failedLookupLocations, !directoryProbablyExists(ts.getDirectoryPath(candidate), state.host), state); @@ -18026,7 +18039,7 @@ var ts; function resolveJavaScriptModule(moduleName, initialDir, host) { var _a = nodeModuleNameResolverWorker(moduleName, initialDir, { moduleResolution: ts.ModuleResolutionKind.NodeJs, allowJs: true }, host, undefined, true), resolvedModule = _a.resolvedModule, failedLookupLocations = _a.failedLookupLocations; if (!resolvedModule) { - throw new Error("Could not resolve JS module " + moduleName + " starting at " + initialDir + ". Looked in: " + failedLookupLocations.join(", ")); + throw new Error("Could not resolve JS module '" + moduleName + "' starting at '" + initialDir + "'. Looked in: " + failedLookupLocations.join(", ")); } return resolvedModule.resolvedFileName; } @@ -18052,16 +18065,22 @@ var ts; trace(host, ts.Diagnostics.Loading_module_0_from_node_modules_folder_target_file_type_1, moduleName, Extensions[extensions]); } var resolved_1 = loadModuleFromNodeModules(extensions, moduleName, containingDirectory, failedLookupLocations, state, cache); - return resolved_1 && { value: resolved_1.value && { resolved: { path: realpath(resolved_1.value.path, host, traceEnabled), extension: resolved_1.value.extension }, isExternalLibraryImport: true } }; + if (!resolved_1) + return undefined; + var resolvedValue = resolved_1.value; + if (!compilerOptions.preserveSymlinks) { + resolvedValue = resolvedValue && __assign({}, resolved_1.value, { path: realPath(resolved_1.value.path, host, traceEnabled), extension: resolved_1.value.extension }); + } + return { value: resolvedValue && { resolved: resolvedValue, isExternalLibraryImport: true } }; } else { - var candidate = ts.normalizePath(ts.combinePaths(containingDirectory, moduleName)); + var _a = ts.normalizePathAndParts(ts.combinePaths(containingDirectory, moduleName)), candidate = _a.path, parts = _a.parts; var resolved_2 = nodeLoadModuleByRelativeName(extensions, candidate, failedLookupLocations, false, state, true); - return resolved_2 && toSearchResult({ resolved: resolved_2, isExternalLibraryImport: false }); + return resolved_2 && toSearchResult({ resolved: resolved_2, isExternalLibraryImport: ts.contains(parts, "node_modules") }); } } } - function realpath(path, host, traceEnabled) { + function realPath(path, host, traceEnabled) { if (!host.realpath) { return path; } @@ -18087,7 +18106,7 @@ var ts; } var resolvedFromFile = loadModuleFromFile(extensions, candidate, failedLookupLocations, onlyRecordFailures, state); if (resolvedFromFile) { - return resolvedFromFile; + return noPackageId(resolvedFromFile); } } if (!onlyRecordFailures) { @@ -18105,6 +18124,9 @@ var ts; return !host.directoryExists || host.directoryExists(directoryName); } ts.directoryProbablyExists = directoryProbablyExists; + function loadModuleFromFileNoPackageId(extensions, candidate, failedLookupLocations, onlyRecordFailures, state) { + return noPackageId(loadModuleFromFile(extensions, candidate, failedLookupLocations, onlyRecordFailures, state)); + } function loadModuleFromFile(extensions, candidate, failedLookupLocations, onlyRecordFailures, state) { var resolvedByAddingExtension = tryAddingExtensions(candidate, extensions, failedLookupLocations, onlyRecordFailures, state); if (resolvedByAddingExtension) { @@ -18134,9 +18156,9 @@ var ts; case Extensions.JavaScript: return tryExtension(".js") || tryExtension(".jsx"); } - function tryExtension(extension) { - var path = tryFile(candidate + extension, failedLookupLocations, onlyRecordFailures, state); - return path && { path: path, extension: extension }; + function tryExtension(ext) { + var path = tryFile(candidate + ext, failedLookupLocations, onlyRecordFailures, state); + return path && { path: path, ext: ext }; } } function tryFile(fileName, failedLookupLocations, onlyRecordFailures, state) { @@ -18159,12 +18181,20 @@ var ts; function loadNodeModuleFromDirectory(extensions, candidate, failedLookupLocations, onlyRecordFailures, state, considerPackageJson) { if (considerPackageJson === void 0) { considerPackageJson = true; } var directoryExists = !onlyRecordFailures && directoryProbablyExists(candidate, state.host); + var packageId; if (considerPackageJson) { var packageJsonPath = pathToPackageJson(candidate); if (directoryExists && state.host.fileExists(packageJsonPath)) { - var fromPackageJson = loadModuleFromPackageJson(packageJsonPath, extensions, candidate, failedLookupLocations, state); + if (state.traceEnabled) { + trace(state.host, ts.Diagnostics.Found_package_json_at_0, packageJsonPath); + } + var jsonContent = readJson(packageJsonPath, state.host); + if (typeof jsonContent.name === "string" && typeof jsonContent.version === "string") { + packageId = { name: jsonContent.name, version: jsonContent.version }; + } + var fromPackageJson = loadModuleFromPackageJson(jsonContent, extensions, candidate, failedLookupLocations, state); if (fromPackageJson) { - return fromPackageJson; + return withPackageId(packageId, fromPackageJson); } } else { @@ -18174,13 +18204,10 @@ var ts; failedLookupLocations.push(packageJsonPath); } } - return loadModuleFromFile(extensions, ts.combinePaths(candidate, "index"), failedLookupLocations, !directoryExists, state); + return withPackageId(packageId, loadModuleFromFile(extensions, ts.combinePaths(candidate, "index"), failedLookupLocations, !directoryExists, state)); } - function loadModuleFromPackageJson(packageJsonPath, extensions, candidate, failedLookupLocations, state) { - if (state.traceEnabled) { - trace(state.host, ts.Diagnostics.Found_package_json_at_0, packageJsonPath); - } - var file = tryReadPackageJsonFields(extensions !== Extensions.JavaScript, packageJsonPath, candidate, state); + function loadModuleFromPackageJson(jsonContent, extensions, candidate, failedLookupLocations, state) { + var file = tryReadPackageJsonFields(extensions !== Extensions.JavaScript, jsonContent, candidate, state); if (!file) { return undefined; } @@ -18196,11 +18223,15 @@ var ts; } } var nextExtensions = extensions === Extensions.DtsOnly ? Extensions.TypeScript : extensions; - return nodeLoadModuleByRelativeName(nextExtensions, file, failedLookupLocations, onlyRecordFailures, state, false); + var result = nodeLoadModuleByRelativeName(nextExtensions, file, failedLookupLocations, onlyRecordFailures, state, false); + if (result) { + ts.Debug.assert(result.packageId === undefined); + return { path: result.path, ext: result.extension }; + } } function resolvedIfExtensionMatches(extensions, path) { - var extension = ts.tryGetExtensionFromPath(path); - return extension !== undefined && extensionIsOk(extensions, extension) ? { path: path, extension: extension } : undefined; + var ext = ts.tryGetExtensionFromPath(path); + return ext !== undefined && extensionIsOk(extensions, ext) ? { path: path, ext: ext } : undefined; } function extensionIsOk(extensions, extension) { switch (extensions) { @@ -18217,7 +18248,7 @@ var ts; } function loadModuleFromNodeModulesFolder(extensions, moduleName, nodeModulesFolder, nodeModulesFolderExists, failedLookupLocations, state) { var candidate = ts.normalizePath(ts.combinePaths(nodeModulesFolder, moduleName)); - return loadModuleFromFile(extensions, candidate, failedLookupLocations, !nodeModulesFolderExists, state) || + return loadModuleFromFileNoPackageId(extensions, candidate, failedLookupLocations, !nodeModulesFolderExists, state) || loadNodeModuleFromDirectory(extensions, candidate, failedLookupLocations, !nodeModulesFolderExists, state); } function loadModuleFromNodeModules(extensions, moduleName, directory, failedLookupLocations, state, cache) { @@ -18291,7 +18322,7 @@ var ts; if (traceEnabled) { trace(host, ts.Diagnostics.Resolution_for_module_0_was_found_in_cache, moduleName); } - return { value: result.resolvedModule && { path: result.resolvedModule.resolvedFileName, extension: result.resolvedModule.extension } }; + return { value: result.resolvedModule && { path: result.resolvedModule.resolvedFileName, extension: result.resolvedModule.extension, packageId: result.resolvedModule.packageId } }; } } function classicNameResolver(moduleName, containingFile, compilerOptions, host, cache) { @@ -18302,7 +18333,7 @@ var ts; var resolved = tryResolve(Extensions.TypeScript) || tryResolve(Extensions.JavaScript); return createResolvedModuleWithFailedLookupLocations(resolved && resolved.value, false, failedLookupLocations); function tryResolve(extensions) { - var resolvedUsingSettings = tryLoadModuleUsingOptionalResolutionSettings(extensions, moduleName, containingDirectory, loadModuleFromFile, failedLookupLocations, state); + var resolvedUsingSettings = tryLoadModuleUsingOptionalResolutionSettings(extensions, moduleName, containingDirectory, loadModuleFromFileNoPackageId, failedLookupLocations, state); if (resolvedUsingSettings) { return { value: resolvedUsingSettings }; } @@ -18314,7 +18345,7 @@ var ts; return resolutionFromCache; } var searchName = ts.normalizePath(ts.combinePaths(directory, moduleName)); - return toSearchResult(loadModuleFromFile(extensions, searchName, failedLookupLocations, false, state)); + return toSearchResult(loadModuleFromFileNoPackageId(extensions, searchName, failedLookupLocations, false, state)); }); if (resolved_3) { return resolved_3; @@ -18325,7 +18356,7 @@ var ts; } else { var candidate = ts.normalizePath(ts.combinePaths(containingDirectory, moduleName)); - return toSearchResult(loadModuleFromFile(extensions, candidate, failedLookupLocations, false, state)); + return toSearchResult(loadModuleFromFileNoPackageId(extensions, candidate, failedLookupLocations, false, state)); } } } @@ -18976,40 +19007,23 @@ var ts; return antecedent; } setFlowNodeReferenced(antecedent); - return { - flags: flags, - expression: expression, - antecedent: antecedent - }; + return { flags: flags, expression: expression, antecedent: antecedent }; } function createFlowSwitchClause(antecedent, switchStatement, clauseStart, clauseEnd) { if (!isNarrowingExpression(switchStatement.expression)) { return antecedent; } setFlowNodeReferenced(antecedent); - return { - flags: 128, - switchStatement: switchStatement, - clauseStart: clauseStart, - clauseEnd: clauseEnd, - antecedent: antecedent - }; + return { flags: 128, switchStatement: switchStatement, clauseStart: clauseStart, clauseEnd: clauseEnd, antecedent: antecedent }; } function createFlowAssignment(antecedent, node) { setFlowNodeReferenced(antecedent); - return { - flags: 16, - antecedent: antecedent, - node: node - }; + return { flags: 16, antecedent: antecedent, node: node }; } function createFlowArrayMutation(antecedent, node) { setFlowNodeReferenced(antecedent); - return { - flags: 256, - antecedent: antecedent, - node: node - }; + var res = { flags: 256, antecedent: antecedent, node: node }; + return res; } function finishFlowLabel(flow) { var antecedents = flow.antecedents; @@ -20107,12 +20121,12 @@ var ts; return; } else { - var parent_1 = node.parent; - if (!ts.isExternalModule(parent_1)) { + var parent_5 = node.parent; + if (!ts.isExternalModule(parent_5)) { file.bindDiagnostics.push(ts.createDiagnosticForNode(node, ts.Diagnostics.Global_module_exports_may_only_appear_in_module_files)); return; } - if (!parent_1.isDeclarationFile) { + if (!parent_5.isDeclarationFile) { file.bindDiagnostics.push(ts.createDiagnosticForNode(node, ts.Diagnostics.Global_module_exports_may_only_appear_in_declaration_files)); return; } @@ -20477,7 +20491,6 @@ var ts; } function computeParameter(node, subtreeFlags) { var transformFlags = subtreeFlags; - var modifierFlags = ts.getModifierFlags(node); var name = node.name; var initializer = node.initializer; var dotDotDotToken = node.dotDotDotToken; @@ -20487,7 +20500,7 @@ var ts; || ts.isThisIdentifier(name)) { transformFlags |= 3; } - if (modifierFlags & 92) { + if (ts.hasModifier(node, 92)) { transformFlags |= 3 | 262144; } if (subtreeFlags & 1048576) { @@ -20516,8 +20529,7 @@ var ts; } function computeClassDeclaration(node, subtreeFlags) { var transformFlags; - var modifierFlags = ts.getModifierFlags(node); - if (modifierFlags & 2) { + if (ts.hasModifier(node, 2)) { transformFlags = 3; } else { @@ -20563,7 +20575,10 @@ var ts; } function computeCatchClause(node, subtreeFlags) { var transformFlags = subtreeFlags; - if (node.variableDeclaration && ts.isBindingPattern(node.variableDeclaration.name)) { + if (!node.variableDeclaration) { + transformFlags |= 8; + } + else if (ts.isBindingPattern(node.variableDeclaration.name)) { transformFlags |= 192; } node.transformFlags = transformFlags | 536870912; @@ -20727,9 +20742,8 @@ var ts; } function computeVariableStatement(node, subtreeFlags) { var transformFlags; - var modifierFlags = ts.getModifierFlags(node); var declarationListTransformFlags = node.declarationList.transformFlags; - if (modifierFlags & 2) { + if (ts.hasModifier(node, 2)) { transformFlags = 3; } else { @@ -21028,6 +21042,167 @@ var ts; } })(ts || (ts = {})); var ts; +(function (ts) { + function createGetSymbolWalker(getRestTypeOfSignature, getReturnTypeOfSignature, getBaseTypes, resolveStructuredTypeMembers, getTypeOfSymbol, getResolvedSymbol, getIndexTypeOfStructuredType, getConstraintFromTypeParameter, getFirstIdentifier) { + return getSymbolWalker; + function getSymbolWalker(accept) { + if (accept === void 0) { accept = function () { return true; }; } + var visitedTypes = ts.createMap(); + var visitedSymbols = ts.createMap(); + return { + walkType: function (type) { + visitedTypes.clear(); + visitedSymbols.clear(); + visitType(type); + return { visitedTypes: ts.arrayFrom(visitedTypes.values()), visitedSymbols: ts.arrayFrom(visitedSymbols.values()) }; + }, + walkSymbol: function (symbol) { + visitedTypes.clear(); + visitedSymbols.clear(); + visitSymbol(symbol); + return { visitedTypes: ts.arrayFrom(visitedTypes.values()), visitedSymbols: ts.arrayFrom(visitedSymbols.values()) }; + }, + }; + function visitType(type) { + if (!type) { + return; + } + var typeIdString = type.id.toString(); + if (visitedTypes.has(typeIdString)) { + return; + } + visitedTypes.set(typeIdString, type); + var shouldBail = visitSymbol(type.symbol); + if (shouldBail) + return; + if (type.flags & 32768) { + var objectType = type; + var objectFlags = objectType.objectFlags; + if (objectFlags & 4) { + visitTypeReference(type); + } + if (objectFlags & 32) { + visitMappedType(type); + } + if (objectFlags & (1 | 2)) { + visitInterfaceType(type); + } + if (objectFlags & (8 | 16)) { + visitObjectType(objectType); + } + } + if (type.flags & 16384) { + visitTypeParameter(type); + } + if (type.flags & 196608) { + visitUnionOrIntersectionType(type); + } + if (type.flags & 262144) { + visitIndexType(type); + } + if (type.flags & 524288) { + visitIndexedAccessType(type); + } + } + function visitTypeList(types) { + if (!types) { + return; + } + for (var i = 0; i < types.length; i++) { + visitType(types[i]); + } + } + function visitTypeReference(type) { + visitType(type.target); + visitTypeList(type.typeArguments); + } + function visitTypeParameter(type) { + visitType(getConstraintFromTypeParameter(type)); + } + function visitUnionOrIntersectionType(type) { + visitTypeList(type.types); + } + function visitIndexType(type) { + visitType(type.type); + } + function visitIndexedAccessType(type) { + visitType(type.objectType); + visitType(type.indexType); + visitType(type.constraint); + } + function visitMappedType(type) { + visitType(type.typeParameter); + visitType(type.constraintType); + visitType(type.templateType); + visitType(type.modifiersType); + } + function visitSignature(signature) { + if (signature.typePredicate) { + visitType(signature.typePredicate.type); + } + visitTypeList(signature.typeParameters); + for (var _i = 0, _a = signature.parameters; _i < _a.length; _i++) { + var parameter = _a[_i]; + visitSymbol(parameter); + } + visitType(getRestTypeOfSignature(signature)); + visitType(getReturnTypeOfSignature(signature)); + } + function visitInterfaceType(interfaceT) { + visitObjectType(interfaceT); + visitTypeList(interfaceT.typeParameters); + visitTypeList(getBaseTypes(interfaceT)); + visitType(interfaceT.thisType); + } + function visitObjectType(type) { + var stringIndexType = getIndexTypeOfStructuredType(type, 0); + visitType(stringIndexType); + var numberIndexType = getIndexTypeOfStructuredType(type, 1); + visitType(numberIndexType); + var resolved = resolveStructuredTypeMembers(type); + for (var _i = 0, _a = resolved.callSignatures; _i < _a.length; _i++) { + var signature = _a[_i]; + visitSignature(signature); + } + for (var _b = 0, _c = resolved.constructSignatures; _b < _c.length; _b++) { + var signature = _c[_b]; + visitSignature(signature); + } + for (var _d = 0, _e = resolved.properties; _d < _e.length; _d++) { + var p = _e[_d]; + visitSymbol(p); + } + } + function visitSymbol(symbol) { + if (!symbol) { + return; + } + var symbolIdString = ts.getSymbolId(symbol).toString(); + if (visitedSymbols.has(symbolIdString)) { + return; + } + visitedSymbols.set(symbolIdString, symbol); + if (!accept(symbol)) { + return true; + } + var t = getTypeOfSymbol(symbol); + visitType(t); + if (symbol.flags & 1952) { + symbol.exports.forEach(visitSymbol); + } + ts.forEach(symbol.declarations, function (d) { + if (d.type && d.type.kind === 162) { + var query = d.type; + var entity = getResolvedSymbol(getFirstIdentifier(query.exprName)); + visitSymbol(entity); + } + }); + } + } + } + ts.createGetSymbolWalker = createGetSymbolWalker; +})(ts || (ts = {})); +var ts; (function (ts) { var ambientModuleSymbolRegex = /^".+"$/; var nextSymbolId = 1; @@ -21138,6 +21313,9 @@ var ts; node = ts.getParseTreeNode(node, ts.isExportSpecifier); return node ? getExportSpecifierLocalTargetSymbol(node) : undefined; }, + getExportSymbolOfSymbol: function (symbol) { + return getMergedSymbol(symbol.exportSymbol || symbol); + }, getTypeAtLocation: function (node) { node = ts.getParseTreeNode(node); return node ? getTypeOfNode(node) : unknownType; @@ -21200,6 +21378,7 @@ var ts; getEmitResolver: getEmitResolver, getExportsOfModule: getExportsOfModuleAsArray, getExportsAndPropertiesOfModule: getExportsAndPropertiesOfModule, + getSymbolWalker: ts.createGetSymbolWalker(getRestTypeOfSignature, getReturnTypeOfSignature, getBaseTypes, resolveStructuredTypeMembers, getTypeOfSymbol, getResolvedSymbol, getIndexTypeOfStructuredType, getConstraintFromTypeParameter, getFirstIdentifier), getAmbientModules: getAmbientModules, getAllAttributesTypeFromJsxOpeningLikeElement: function (node) { node = ts.getParseTreeNode(node, ts.isJsxOpeningLikeElement); @@ -21220,11 +21399,10 @@ var ts; getSuggestionForNonexistentProperty: function (node, type) { return ts.unescapeLeadingUnderscores(getSuggestionForNonexistentProperty(node, type)); }, getSuggestionForNonexistentSymbol: function (location, name, meaning) { return ts.unescapeLeadingUnderscores(getSuggestionForNonexistentSymbol(location, ts.escapeLeadingUnderscores(name), meaning)); }, getBaseConstraintOfType: getBaseConstraintOfType, - getJsxNamespace: function () { return ts.unescapeLeadingUnderscores(getJsxNamespace()); }, - resolveNameAtLocation: function (location, name, meaning) { - location = ts.getParseTreeNode(location); - return resolveName(location, ts.escapeLeadingUnderscores(name), meaning, undefined, ts.escapeLeadingUnderscores(name)); + resolveName: function (name, location, meaning) { + return resolveName(location, ts.escapeLeadingUnderscores(name), meaning, undefined, undefined); }, + getJsxNamespace: function () { return ts.unescapeLeadingUnderscores(getJsxNamespace()); }, }; var tupleTypes = []; var unionTypes = ts.createMap(); @@ -21707,7 +21885,10 @@ var ts; } return true; } - if (usage.parent.kind === 246) { + if (usage.parent.kind === 246 || (usage.parent.kind === 243 && usage.parent.isExportEquals)) { + return true; + } + if (usage.kind === 243 && usage.isExportEquals) { return true; } var container = ts.getEnclosingBlockScopeContainer(declaration); @@ -21737,13 +21918,13 @@ var ts; current.parent.kind === 149 && current.parent.initializer === current; if (initializerOfProperty) { - if (ts.getModifierFlags(current.parent) & 32) { + if (ts.hasModifier(current.parent, 32)) { if (declaration.kind === 151) { return true; } } else { - var isDeclarationInstanceProperty = declaration.kind === 149 && !(ts.getModifierFlags(declaration) & 32); + var isDeclarationInstanceProperty = declaration.kind === 149 && !ts.hasModifier(declaration, 32); if (!isDeclarationInstanceProperty || ts.getContainingClass(usage) !== ts.getContainingClass(declaration)) { return true; } @@ -21823,7 +22004,7 @@ var ts; break; case 149: case 148: - if (ts.isClassLike(location.parent) && !(ts.getModifierFlags(location) & 32)) { + if (ts.isClassLike(location.parent) && !ts.hasModifier(location, 32)) { var ctor = findConstructorDeclaration(location.parent); if (ctor && ctor.locals) { if (lookup(ctor.locals, name, meaning & 107455)) { @@ -21840,7 +22021,7 @@ var ts; result = undefined; break; } - if (lastLocation && ts.getModifierFlags(lastLocation) & 32) { + if (lastLocation && ts.hasModifier(lastLocation, 32)) { error(errorLocation, ts.Diagnostics.Static_members_cannot_reference_class_type_parameters); return undefined; } @@ -21854,6 +22035,17 @@ var ts; } } break; + case 201: + if (lastLocation === location.expression && location.parent.token === 85) { + var container = location.parent.parent; + if (ts.isClassLike(container) && (result = lookup(getSymbolOfNode(container).members, name, meaning & 793064))) { + if (nameNotFoundMessage) { + error(errorLocation, ts.Diagnostics.Base_class_expressions_cannot_reference_class_type_parameters); + } + return undefined; + } + } + break; case 144: grandparent = location.parent.parent; if (ts.isClassLike(grandparent) || grandparent.kind === 230) { @@ -21900,7 +22092,7 @@ var ts; lastLocation = location; location = location.parent; } - if (result && nameNotFoundMessage && noUnusedIdentifiers) { + if (result && nameNotFoundMessage && noUnusedIdentifiers && result !== lastLocation.symbol) { result.isReferenced = true; } if (!result) { @@ -21981,7 +22173,7 @@ var ts; error(errorLocation, ts.Diagnostics.Cannot_find_name_0_Did_you_mean_the_static_member_1_0, diagnosticName(nameArg), symbolToString(classSymbol)); return true; } - if (location === container && !(ts.getModifierFlags(location) & 32)) { + if (location === container && !ts.hasModifier(location, 32)) { var instanceType = getDeclaredTypeOfSymbol(classSymbol).thisType; if (getPropertyOfType(instanceType, name)) { error(errorLocation, ts.Diagnostics.Cannot_find_name_0_Did_you_mean_the_instance_member_this_0, diagnosticName(nameArg)); @@ -22016,14 +22208,14 @@ var ts; function checkAndReportErrorForUsingTypeAsNamespace(errorLocation, name, meaning) { if (meaning === 1920) { var symbol = resolveSymbol(resolveName(errorLocation, name, 793064 & ~107455, undefined, undefined)); - var parent = errorLocation.parent; + var parent_6 = errorLocation.parent; if (symbol) { - if (ts.isQualifiedName(parent)) { - ts.Debug.assert(parent.left === errorLocation, "Should only be resolving left side of qualified name as a namespace"); - var propName = parent.right.escapedText; + if (ts.isQualifiedName(parent_6)) { + ts.Debug.assert(parent_6.left === errorLocation, "Should only be resolving left side of qualified name as a namespace"); + var propName = parent_6.right.escapedText; var propType = getPropertyOfType(getDeclaredTypeOfSymbol(symbol), propName); if (propType) { - error(parent, ts.Diagnostics.Cannot_access_0_1_because_0_is_a_type_but_not_a_namespace_Did_you_mean_to_retrieve_the_type_of_the_property_1_in_0_with_0_1, ts.unescapeLeadingUnderscores(name), ts.unescapeLeadingUnderscores(propName)); + error(parent_6, ts.Diagnostics.Cannot_access_0_1_because_0_is_a_type_but_not_a_namespace_Did_you_mean_to_retrieve_the_type_of_the_property_1_in_0_with_0_1, ts.unescapeLeadingUnderscores(name), ts.unescapeLeadingUnderscores(propName)); return true; } } @@ -22161,28 +22353,28 @@ var ts; var moduleSymbol = resolveExternalModuleName(node, node.moduleSpecifier); var targetSymbol = resolveESModuleSymbol(moduleSymbol, node.moduleSpecifier, dontResolveAlias); if (targetSymbol) { - var name = specifier.propertyName || specifier.name; - if (name.escapedText) { + var name_11 = specifier.propertyName || specifier.name; + if (name_11.escapedText) { if (ts.isShorthandAmbientModuleSymbol(moduleSymbol)) { return moduleSymbol; } var symbolFromVariable = void 0; if (moduleSymbol && moduleSymbol.exports && moduleSymbol.exports.get("export=")) { - symbolFromVariable = getPropertyOfType(getTypeOfSymbol(targetSymbol), name.escapedText); + symbolFromVariable = getPropertyOfType(getTypeOfSymbol(targetSymbol), name_11.escapedText); } else { - symbolFromVariable = getPropertyOfVariable(targetSymbol, name.escapedText); + symbolFromVariable = getPropertyOfVariable(targetSymbol, name_11.escapedText); } symbolFromVariable = resolveSymbol(symbolFromVariable, dontResolveAlias); - var symbolFromModule = getExportOfModule(targetSymbol, name.escapedText, dontResolveAlias); - if (!symbolFromModule && allowSyntheticDefaultImports && name.escapedText === "default") { + var symbolFromModule = getExportOfModule(targetSymbol, name_11.escapedText, dontResolveAlias); + if (!symbolFromModule && allowSyntheticDefaultImports && name_11.escapedText === "default") { symbolFromModule = resolveExternalModuleSymbol(moduleSymbol, dontResolveAlias) || resolveSymbol(moduleSymbol, dontResolveAlias); } var symbol = symbolFromModule && symbolFromVariable ? combineValueAndTypeSymbols(symbolFromVariable, symbolFromModule) : symbolFromModule || symbolFromVariable; if (!symbol) { - error(name, ts.Diagnostics.Module_0_has_no_exported_member_1, getFullyQualifiedName(moduleSymbol), ts.declarationNameToString(name)); + error(name_11, ts.Diagnostics.Module_0_has_no_exported_member_1, getFullyQualifiedName(moduleSymbol), ts.declarationNameToString(name_11)); } return symbol; } @@ -22367,7 +22559,6 @@ var ts; if (ambientModule) { return ambientModule; } - var isRelative = ts.isExternalModuleNameRelative(moduleReference); var resolvedModule = ts.getResolvedModule(ts.getSourceFileOfNode(location), moduleReference); var resolutionDiagnostic = resolvedModule && ts.getResolutionDiagnostic(compilerOptions, resolvedModule); var sourceFile = resolvedModule && !resolutionDiagnostic && host.getSourceFile(resolvedModule.resolvedFileName); @@ -22386,7 +22577,7 @@ var ts; return getMergedSymbol(pattern.symbol); } } - if (!isRelative && resolvedModule && !ts.extensionIsTypeScript(resolvedModule.extension)) { + if (resolvedModule && resolvedModule.isExternalLibraryImport && !ts.extensionIsTypeScript(resolvedModule.extension)) { if (isForAugmentation) { var diag = ts.Diagnostics.Invalid_module_name_in_augmentation_Module_0_resolves_to_an_untyped_module_at_1_which_cannot_be_augmented; error(errorNode, diag, moduleReference, resolvedModule.resolvedFileName); @@ -22609,19 +22800,19 @@ var ts; } function forEachSymbolTableInScope(enclosingDeclaration, callback) { var result; - for (var location = enclosingDeclaration; location; location = location.parent) { - if (location.locals && !isGlobalSourceFile(location)) { - if (result = callback(location.locals)) { + for (var location_1 = enclosingDeclaration; location_1; location_1 = location_1.parent) { + if (location_1.locals && !isGlobalSourceFile(location_1)) { + if (result = callback(location_1.locals)) { return result; } } - switch (location.kind) { + switch (location_1.kind) { case 265: - if (!ts.isExternalOrCommonJsModule(location)) { + if (!ts.isExternalOrCommonJsModule(location_1)) { break; } case 233: - if (result = callback(getSymbolOfNode(location).exports)) { + if (result = callback(getSymbolOfNode(location_1).exports)) { return result; } break; @@ -22721,6 +22912,10 @@ var ts; } return false; } + function isTypeSymbolAccessible(typeSymbol, enclosingDeclaration) { + var access = isSymbolAccessible(typeSymbol, enclosingDeclaration, 793064, false); + return access.accessibility === 0; + } function isSymbolAccessible(symbol, enclosingDeclaration, meaning, shouldComputeAliasesToMakeVisible) { if (symbol && enclosingDeclaration && !(symbol.flags & 262144)) { var initialSymbol = symbol; @@ -22776,7 +22971,7 @@ var ts; if (!isDeclarationVisible(declaration)) { var anyImportSyntax = getAnyImportSyntax(declaration); if (anyImportSyntax && - !(ts.getModifierFlags(anyImportSyntax) & 1) && + !ts.hasModifier(anyImportSyntax, 1) && isDeclarationVisible(anyImportSyntax.parent)) { if (shouldComputeAliasToMakeVisible) { getNodeLinks(declaration).isVisible = true; @@ -22927,8 +23122,8 @@ var ts; return ts.createTypeReferenceNode(enumLiteralName, undefined); } if (type.flags & 272) { - var name = symbolToName(type.symbol, context, 793064, false); - return ts.createTypeReferenceNode(name, undefined); + var name_12 = symbolToName(type.symbol, context, 793064, false); + return ts.createTypeReferenceNode(name_12, undefined); } if (type.flags & (32)) { return ts.createLiteralTypeNode(ts.setEmitFlags(ts.createLiteral(type.value), 16777216)); @@ -22971,14 +23166,13 @@ var ts; return typeReferenceToTypeNode(type); } if (type.flags & 16384 || objectFlags & 3) { - var name = symbolToName(type.symbol, context, 793064, false); - return ts.createTypeReferenceNode(name, undefined); + var name_13 = symbolToName(type.symbol, context, 793064, false); + return ts.createTypeReferenceNode(name_13, undefined); } - if (!inTypeAlias && type.aliasSymbol && - isSymbolAccessible(type.aliasSymbol, context.enclosingDeclaration, 793064, false).accessibility === 0) { - var name = symbolToTypeReferenceName(type.aliasSymbol); + if (!inTypeAlias && type.aliasSymbol && isTypeSymbolAccessible(type.aliasSymbol, context.enclosingDeclaration)) { + var name_14 = symbolToTypeReferenceName(type.aliasSymbol); var typeArgumentNodes = mapToTypeNodes(type.aliasTypeArguments, context); - return ts.createTypeReferenceNode(name, typeArgumentNodes); + return ts.createTypeReferenceNode(name_14, typeArgumentNodes); } if (type.flags & (65536 | 131072)) { var types = type.flags & 65536 ? formatUnionTypes(type.types) : type.types; @@ -23050,8 +23244,8 @@ var ts; return createTypeNodeFromObjectType(type); } function shouldWriteTypeOfFunctionSymbol() { - var isStaticMethodSymbol = !!(symbol.flags & 8192 && - ts.forEach(symbol.declarations, function (declaration) { return ts.getModifierFlags(declaration) & 32; })); + var isStaticMethodSymbol = !!(symbol.flags & 8192) && + ts.some(symbol.declarations, function (declaration) { return ts.hasModifier(declaration, 32); }); var isNonLocalFunctionSymbol = !!(symbol.flags & 16) && (symbol.parent || ts.forEach(symbol.declarations, function (declaration) { @@ -23063,10 +23257,8 @@ var ts; } } function createTypeNodeFromObjectType(type) { - if (type.objectFlags & 32) { - if (getConstraintTypeFromMappedType(type).flags & (16384 | 262144)) { - return createMappedTypeNodeFromType(type); - } + if (isGenericMappedType(type)) { + return createMappedTypeNodeFromType(type); } var resolved = resolveStructuredTypeMembers(type); if (!resolved.properties.length && !resolved.stringIndexInfo && !resolved.numberIndexInfo) { @@ -23130,14 +23322,14 @@ var ts; var length_2 = outerTypeParameters.length; while (i < length_2) { var start = i; - var parent = getParentSymbolOfTypeParameter(outerTypeParameters[i]); + var parent_7 = getParentSymbolOfTypeParameter(outerTypeParameters[i]); do { i++; - } while (i < length_2 && getParentSymbolOfTypeParameter(outerTypeParameters[i]) === parent); + } while (i < length_2 && getParentSymbolOfTypeParameter(outerTypeParameters[i]) === parent_7); if (!ts.rangeEquals(outerTypeParameters, typeArguments, start, i)) { var typeArgumentSlice = mapToTypeNodes(typeArguments.slice(start, i), context); var typeArgumentNodes_1 = typeArgumentSlice && ts.createNodeArray(typeArgumentSlice); - var namePart = symbolToTypeReferenceName(parent); + var namePart = symbolToTypeReferenceName(parent_7); (namePart.kind === 71 ? namePart : namePart.right).typeArguments = typeArgumentNodes_1; if (qualifiedName) { ts.Debug.assert(!qualifiedName.right); @@ -23367,11 +23559,11 @@ var ts; var parentSymbol; if (!accessibleSymbolChain || needsQualification(accessibleSymbolChain[0], context.enclosingDeclaration, accessibleSymbolChain.length === 1 ? meaning : getQualifiedLeftMeaning(meaning))) { - var parent = getParentOfSymbol(accessibleSymbolChain ? accessibleSymbolChain[0] : symbol); - if (parent) { - var parentChain = getSymbolChain(parent, getQualifiedLeftMeaning(meaning), false); + var parent_8 = getParentOfSymbol(accessibleSymbolChain ? accessibleSymbolChain[0] : symbol); + if (parent_8) { + var parentChain = getSymbolChain(parent_8, getQualifiedLeftMeaning(meaning), false); if (parentChain) { - parentSymbol = parent; + parentSymbol = parent_8; accessibleSymbolChain = parentChain.concat(accessibleSymbolChain || [symbol]); } } @@ -23389,9 +23581,9 @@ var ts; function getNameOfSymbol(symbol, context) { var declaration = ts.firstOrUndefined(symbol.declarations); if (declaration) { - var name = ts.getNameOfDeclaration(declaration); - if (name) { - return ts.declarationNameToString(name); + var name_15 = ts.getNameOfDeclaration(declaration); + if (name_15) { + return ts.declarationNameToString(name_15); } if (declaration.parent && declaration.parent.kind === 226) { return ts.declarationNameToString(declaration.parent.name); @@ -23471,9 +23663,9 @@ var ts; function getNameOfSymbol(symbol) { if (symbol.declarations && symbol.declarations.length) { var declaration = symbol.declarations[0]; - var name = ts.getNameOfDeclaration(declaration); - if (name) { - return ts.declarationNameToString(name); + var name_16 = ts.getNameOfDeclaration(declaration); + if (name_16) { + return ts.declarationNameToString(name_16); } if (declaration.parent && declaration.parent.kind === 226) { return ts.declarationNameToString(declaration.parent.name); @@ -23536,9 +23728,9 @@ var ts; var accessibleSymbolChain = getAccessibleSymbolChain(symbol, enclosingDeclaration, meaning, !!(flags & 2)); if (!accessibleSymbolChain || needsQualification(accessibleSymbolChain[0], enclosingDeclaration, accessibleSymbolChain.length === 1 ? meaning : getQualifiedLeftMeaning(meaning))) { - var parent = getParentOfSymbol(accessibleSymbolChain ? accessibleSymbolChain[0] : symbol); - if (parent) { - walkSymbol(parent, getQualifiedLeftMeaning(meaning), false); + var parent_9 = getParentOfSymbol(accessibleSymbolChain ? accessibleSymbolChain[0] : symbol); + if (parent_9) { + walkSymbol(parent_9, getQualifiedLeftMeaning(meaning), false); } } if (accessibleSymbolChain) { @@ -23583,9 +23775,9 @@ var ts; writeTypeReference(type, nextFlags); } else if (type.flags & 256 && !(type.flags & 65536)) { - var parent = getParentOfSymbol(type.symbol); - buildSymbolDisplay(parent, writer, enclosingDeclaration, 793064, 0, nextFlags); - if (getDeclaredTypeOfSymbol(parent) !== type) { + var parent_10 = getParentOfSymbol(type.symbol); + buildSymbolDisplay(parent_10, writer, enclosingDeclaration, 793064, 0, nextFlags); + if (getDeclaredTypeOfSymbol(parent_10) !== type) { writePunctuation(writer, 23); appendSymbolNameOnly(type.symbol, writer); } @@ -23594,7 +23786,7 @@ var ts; buildSymbolDisplay(type.symbol, writer, enclosingDeclaration, 793064, 0, nextFlags); } else if (!(flags & 1024) && type.aliasSymbol && - isSymbolAccessible(type.aliasSymbol, enclosingDeclaration, 793064, false).accessibility === 0) { + ((flags & 65536) || isTypeSymbolAccessible(type.aliasSymbol, enclosingDeclaration))) { var typeArguments = type.aliasTypeArguments; writeSymbolTypeReference(type.aliasSymbol, typeArguments, 0, ts.length(typeArguments), nextFlags); } @@ -23685,12 +23877,12 @@ var ts; var length_3 = outerTypeParameters.length; while (i < length_3) { var start = i; - var parent = getParentSymbolOfTypeParameter(outerTypeParameters[i]); + var parent_11 = getParentSymbolOfTypeParameter(outerTypeParameters[i]); do { i++; - } while (i < length_3 && getParentSymbolOfTypeParameter(outerTypeParameters[i]) === parent); + } while (i < length_3 && getParentSymbolOfTypeParameter(outerTypeParameters[i]) === parent_11); if (!ts.rangeEquals(outerTypeParameters, typeArguments, start, i)) { - writeSymbolTypeReference(parent, typeArguments, start, i, flags); + writeSymbolTypeReference(parent_11, typeArguments, start, i, flags); writePunctuation(writer, 23); } } @@ -23738,9 +23930,7 @@ var ts; if (!symbolStack) { symbolStack = []; } - var isConstructorObject = type.flags & 32768 && - getObjectFlags(type) & 16 && - type.symbol && type.symbol.flags & 32; + var isConstructorObject = type.objectFlags & 16 && type.symbol && type.symbol.flags & 32; if (isConstructorObject) { writeLiteralType(type, flags); } @@ -23755,16 +23945,16 @@ var ts; writeLiteralType(type, flags); } function shouldWriteTypeOfFunctionSymbol() { - var isStaticMethodSymbol = !!(symbol.flags & 8192 && - ts.forEach(symbol.declarations, function (declaration) { return ts.getModifierFlags(declaration) & 32; })); + var isStaticMethodSymbol = !!(symbol.flags & 8192) && + ts.some(symbol.declarations, function (declaration) { return ts.hasModifier(declaration, 32); }); var isNonLocalFunctionSymbol = !!(symbol.flags & 16) && (symbol.parent || - ts.forEach(symbol.declarations, function (declaration) { + ts.some(symbol.declarations, function (declaration) { return declaration.parent.kind === 265 || declaration.parent.kind === 234; })); if (isStaticMethodSymbol || isNonLocalFunctionSymbol) { return !!(flags & 4) || - (ts.contains(symbolStack, symbol)); + ts.contains(symbolStack, symbol); } } } @@ -23801,11 +23991,9 @@ var ts; return false; } function writeLiteralType(type, flags) { - if (type.objectFlags & 32) { - if (getConstraintTypeFromMappedType(type).flags & (16384 | 262144)) { - writeMappedType(type); - return; - } + if (isGenericMappedType(type)) { + writeMappedType(type); + return; } var resolved = resolveStructuredTypeMembers(type); if (!resolved.properties.length && !resolved.stringIndexInfo && !resolved.numberIndexInfo) { @@ -24161,19 +24349,19 @@ var ts; if (ts.isExternalModuleAugmentation(node)) { return true; } - var parent = getDeclarationContainer(node); + var parent_12 = getDeclarationContainer(node); if (!(ts.getCombinedModifierFlags(node) & 1) && - !(node.kind !== 237 && parent.kind !== 265 && ts.isInAmbientContext(parent))) { - return isGlobalSourceFile(parent); + !(node.kind !== 237 && parent_12.kind !== 265 && ts.isInAmbientContext(parent_12))) { + return isGlobalSourceFile(parent_12); } - return isDeclarationVisible(parent); + return isDeclarationVisible(parent_12); case 149: case 148: case 153: case 154: case 151: case 150: - if (ts.getModifierFlags(node) & (8 | 16)) { + if (ts.hasModifier(node, 8 | 16)) { return false; } case 152: @@ -24328,8 +24516,8 @@ var ts; var members = ts.createSymbolTable(); var names = ts.createUnderscoreEscapedMap(); for (var _i = 0, properties_2 = properties; _i < properties_2.length; _i++) { - var name = properties_2[_i]; - names.set(ts.getTextOfPropertyName(name), true); + var name_17 = properties_2[_i]; + names.set(ts.getTextOfPropertyName(name_17), true); } for (var _a = 0, _b = getPropertiesOfType(source); _a < _b.length; _a++) { var prop = _b[_a]; @@ -24373,20 +24561,20 @@ var ts; type = getRestType(parentType, literalMembers, declaration.symbol); } else { - var name = declaration.propertyName || declaration.name; - if (isComputedNonLiteralName(name)) { + var name_18 = declaration.propertyName || declaration.name; + if (isComputedNonLiteralName(name_18)) { return anyType; } if (declaration.initializer) { getContextualType(declaration.initializer); } - var text = ts.getTextOfPropertyName(name); + var text = ts.getTextOfPropertyName(name_18); var declaredType = getTypeOfPropertyOfType(parentType, text); type = declaredType && getFlowTypeOfReference(declaration, declaredType) || isNumericLiteralName(text) && getIndexTypeOfType(parentType, 1) || getIndexTypeOfType(parentType, 0); if (!type) { - error(name, ts.Diagnostics.Type_0_has_no_property_1_and_no_string_index_signature, typeToString(parentType), ts.declarationNameToString(name)); + error(name_18, ts.Diagnostics.Type_0_has_no_property_1_and_no_string_index_signature, typeToString(parentType), ts.declarationNameToString(name_18)); return unknownType; } } @@ -24532,8 +24720,8 @@ var ts; jsDocType = declarationType; } else if (jsDocType !== unknownType && declarationType !== unknownType && !isTypeIdenticalTo(jsDocType, declarationType)) { - var name = ts.getNameOfDeclaration(declaration); - error(name, ts.Diagnostics.Subsequent_variable_declarations_must_have_the_same_type_Variable_0_must_be_of_type_1_but_here_has_type_2, ts.declarationNameToString(name), typeToString(jsDocType), typeToString(declarationType)); + var name_19 = ts.getNameOfDeclaration(declaration); + error(name_19, ts.Diagnostics.Subsequent_variable_declarations_must_have_the_same_type_Variable_0_must_be_of_type_1_but_here_has_type_2, ts.declarationNameToString(name_19), typeToString(jsDocType), typeToString(declarationType)); } } else if (!jsDocType) { @@ -24850,8 +25038,8 @@ var ts; } } function appendTypeParameters(typeParameters, declarations) { - for (var _i = 0, declarations_3 = declarations; _i < declarations_3.length; _i++) { - var declaration = declarations_3[_i]; + for (var _i = 0, declarations_2 = declarations; _i < declarations_2.length; _i++) { + var declaration = declarations_2[_i]; var tp = getDeclaredTypeOfTypeParameter(getSymbolOfNode(declaration)); if (!typeParameters) { typeParameters = [tp]; @@ -24975,7 +25163,7 @@ var ts; return type.resolvedBaseTypes; } function resolveBaseTypesOfClass(type) { - type.resolvedBaseTypes = type.resolvedBaseTypes || ts.emptyArray; + type.resolvedBaseTypes = ts.emptyArray; var baseConstructorType = getApparentType(getBaseConstructorTypeOfClass(type)); if (!(baseConstructorType.flags & (32768 | 131072 | 1))) { return; @@ -25017,12 +25205,7 @@ var ts; error(valueDecl, ts.Diagnostics.Type_0_recursively_references_itself_as_a_base_type, typeToString(type, undefined, 1)); return; } - if (type.resolvedBaseTypes === ts.emptyArray) { - type.resolvedBaseTypes = [baseType]; - } - else { - type.resolvedBaseTypes.push(baseType); - } + type.resolvedBaseTypes = [baseType]; } function areAllOuterTypeParametersApplied(type) { var outerTypeParameters = type.outerTypeParameters; @@ -25120,7 +25303,9 @@ var ts; if (!pushTypeResolution(symbol, 2)) { return unknownType; } - var declaration = ts.findDeclaration(symbol, function (d) { return d.kind === 283 || d.kind === 231; }); + var declaration = ts.find(symbol.declarations, function (d) { + return d.kind === 283 || d.kind === 231; + }); var type = getTypeFromTypeNode(declaration.kind === 283 ? declaration.typeExpression : declaration.type); if (popTypeResolution()) { var typeParameters = getLocalTypeParametersOfClassOrInterfaceOrTypeAlias(symbol); @@ -25612,17 +25797,12 @@ var ts; } else { var members = emptySymbols; - var constructSignatures = ts.emptyArray; var stringIndexInfo = undefined; if (symbol.exports) { members = getExportsOfSymbol(symbol); } if (symbol.flags & 32) { var classType = getDeclaredTypeOfClassOrInterface(symbol); - constructSignatures = getSignaturesOfSymbol(symbol.members.get("__constructor")); - if (!constructSignatures.length) { - constructSignatures = getDefaultConstructSignatures(classType); - } var baseConstructorType = getBaseConstructorTypeOfClass(classType); if (baseConstructorType.flags & (32768 | 131072 | 540672)) { members = ts.createSymbolTable(getNamedMembers(members)); @@ -25633,10 +25813,18 @@ var ts; } } var numberIndexInfo = symbol.flags & 384 ? enumNumberIndexInfo : undefined; - setStructuredTypeMembers(type, members, ts.emptyArray, constructSignatures, stringIndexInfo, numberIndexInfo); + setStructuredTypeMembers(type, members, ts.emptyArray, ts.emptyArray, stringIndexInfo, numberIndexInfo); if (symbol.flags & (16 | 8192)) { type.callSignatures = getSignaturesOfSymbol(symbol); } + if (symbol.flags & 32) { + var classType = getDeclaredTypeOfClassOrInterface(symbol); + var constructSignatures = getSignaturesOfSymbol(symbol.members.get("__constructor")); + if (!constructSignatures.length) { + constructSignatures = getDefaultConstructSignatures(classType); + } + type.constructSignatures = constructSignatures; + } } } function resolveMappedTypeMembers(type) { @@ -25719,8 +25907,7 @@ var ts; return getObjectFlags(type) & 32 && !!type.declaration.questionToken; } function isGenericMappedType(type) { - return getObjectFlags(type) & 32 && - maybeTypeOfKind(getConstraintTypeFromMappedType(type), 540672 | 262144); + return getObjectFlags(type) & 32 && isGenericIndexType(getConstraintTypeFromMappedType(type)); } function resolveStructuredTypeMembers(type) { if (!type.members) { @@ -25820,6 +26007,10 @@ var ts; return hasNonCircularBaseConstraint(typeParameter) ? getConstraintFromTypeParameter(typeParameter) : undefined; } function getConstraintOfIndexedAccess(type) { + var transformed = getTransformedIndexedAccessType(type); + if (transformed) { + return transformed; + } var baseObjectType = getBaseConstraintOfType(type.objectType); var baseIndexType = getBaseConstraintOfType(type.indexType); return baseObjectType || baseIndexType ? getIndexedAccessType(baseObjectType || type.objectType, baseIndexType || type.indexType) : undefined; @@ -25882,11 +26073,18 @@ var ts; return stringType; } if (t.flags & 524288) { + var transformed = getTransformedIndexedAccessType(t); + if (transformed) { + return getBaseConstraint(transformed); + } var baseObjectType = getBaseConstraint(t.objectType); var baseIndexType = getBaseConstraint(t.indexType); var baseIndexedAccess = baseObjectType && baseIndexType ? getIndexedAccessType(baseObjectType, baseIndexType) : undefined; return baseIndexedAccess && baseIndexedAccess !== unknownType ? getBaseConstraint(baseIndexedAccess) : undefined; } + if (isGenericMappedType(t)) { + return emptyObjectType; + } return t; } } @@ -26353,9 +26551,9 @@ var ts; type = anyType; if (noImplicitAny) { var declaration = signature.declaration; - var name = ts.getNameOfDeclaration(declaration); - if (name) { - error(name, ts.Diagnostics._0_implicitly_has_return_type_any_because_it_does_not_have_a_return_type_annotation_and_is_referenced_directly_or_indirectly_in_one_of_its_return_expressions, ts.declarationNameToString(name)); + var name_20 = ts.getNameOfDeclaration(declaration); + if (name_20) { + error(name_20, ts.Diagnostics._0_implicitly_has_return_type_any_because_it_does_not_have_a_return_type_annotation_and_is_referenced_directly_or_indirectly_in_one_of_its_return_expressions, ts.declarationNameToString(name_20)); } else { error(declaration, ts.Diagnostics.Function_implicitly_has_return_type_any_because_it_does_not_have_a_return_type_annotation_and_is_referenced_directly_or_indirectly_in_one_of_its_return_expressions); @@ -26366,6 +26564,9 @@ var ts; } return signature.resolvedReturnType; } + function isResolvingReturnTypeOfSignature(signature) { + return !signature.resolvedReturnType && findResolutionCycleStartIndex(signature, 3) >= 0; + } function getRestTypeOfSignature(signature) { if (signature.hasRestParameter) { var type = getTypeOfSymbol(ts.lastOrUndefined(signature.parameters)); @@ -26434,7 +26635,7 @@ var ts; function getIndexInfoOfSymbol(symbol, kind) { var declaration = getIndexDeclarationOfSymbol(symbol, kind); if (declaration) { - return createIndexInfo(declaration.type ? getTypeFromTypeNode(declaration.type) : anyType, (ts.getModifierFlags(declaration) & 64) !== 0, declaration); + return createIndexInfo(declaration.type ? getTypeFromTypeNode(declaration.type) : anyType, ts.hasModifier(declaration, 64), declaration); } return undefined; } @@ -26702,8 +26903,8 @@ var ts; function getTypeOfGlobalSymbol(symbol, arity) { function getTypeDeclaration(symbol) { var declarations = symbol.declarations; - for (var _i = 0, declarations_4 = declarations; _i < declarations_4.length; _i++) { - var declaration = declarations_4[_i]; + for (var _i = 0, declarations_3 = declarations; _i < declarations_3.length; _i++) { + var declaration = declarations_3[_i]; switch (declaration.kind) { case 229: case 230: @@ -27160,17 +27361,16 @@ var ts; return getTypeOfSymbol(prop); } } - if (isTypeAnyOrAllConstituentTypesHaveKind(indexType, 262178 | 84 | 512)) { + if (!(indexType.flags & 6144) && isTypeAssignableToKind(indexType, 262178 | 84 | 512)) { if (isTypeAny(objectType)) { return anyType; } - var indexInfo = isTypeAnyOrAllConstituentTypesHaveKind(indexType, 84) && getIndexInfoOfType(objectType, 1) || + var indexInfo = isTypeAssignableToKind(indexType, 84) && getIndexInfoOfType(objectType, 1) || getIndexInfoOfType(objectType, 0) || undefined; if (indexInfo) { if (accessExpression && indexInfo.isReadonly && (ts.isAssignmentTarget(accessExpression) || ts.isDeleteTarget(accessExpression))) { error(accessExpression, ts.Diagnostics.Index_signature_in_type_0_only_permits_reading, typeToString(objectType)); - return unknownType; } return indexInfo.type; } @@ -27202,25 +27402,68 @@ var ts; return anyType; } function getIndexedAccessForMappedType(type, indexType, accessNode) { - var accessExpression = accessNode && accessNode.kind === 180 ? accessNode : undefined; - if (accessExpression && ts.isAssignmentTarget(accessExpression) && type.declaration.readonlyToken) { - error(accessExpression, ts.Diagnostics.Index_signature_in_type_0_only_permits_reading, typeToString(type)); - return unknownType; + if (accessNode) { + if (!isTypeAssignableTo(indexType, getIndexType(type))) { + error(accessNode, ts.Diagnostics.Type_0_cannot_be_used_to_index_type_1, typeToString(indexType), typeToString(type)); + return unknownType; + } + if (accessNode.kind === 180 && ts.isAssignmentTarget(accessNode) && type.declaration.readonlyToken) { + error(accessNode, ts.Diagnostics.Index_signature_in_type_0_only_permits_reading, typeToString(type)); + } } var mapper = createTypeMapper([getTypeParameterFromMappedType(type)], [indexType]); var templateMapper = type.mapper ? combineTypeMappers(type.mapper, mapper) : mapper; return instantiateType(getTemplateTypeFromMappedType(type), templateMapper); } + function isGenericObjectType(type) { + return type.flags & 540672 ? true : + getObjectFlags(type) & 32 ? isGenericIndexType(getConstraintTypeFromMappedType(type)) : + type.flags & 196608 ? ts.forEach(type.types, isGenericObjectType) : + false; + } + function isGenericIndexType(type) { + return type.flags & (540672 | 262144) ? true : + type.flags & 196608 ? ts.forEach(type.types, isGenericIndexType) : + false; + } + function isStringIndexOnlyType(type) { + if (type.flags & 32768 && !isGenericMappedType(type)) { + var t = resolveStructuredTypeMembers(type); + return t.properties.length === 0 && + t.callSignatures.length === 0 && t.constructSignatures.length === 0 && + t.stringIndexInfo && !t.numberIndexInfo; + } + return false; + } + function getTransformedIndexedAccessType(type) { + var objectType = type.objectType; + if (objectType.flags & 131072 && isGenericObjectType(objectType) && ts.some(objectType.types, isStringIndexOnlyType)) { + var regularTypes = []; + var stringIndexTypes = []; + for (var _i = 0, _a = objectType.types; _i < _a.length; _i++) { + var t = _a[_i]; + if (isStringIndexOnlyType(t)) { + stringIndexTypes.push(getIndexTypeOfType(t, 0)); + } + else { + regularTypes.push(t); + } + } + return getUnionType([ + getIndexedAccessType(getIntersectionType(regularTypes), type.indexType), + getIntersectionType(stringIndexTypes) + ]); + } + return undefined; + } function getIndexedAccessType(objectType, indexType, accessNode) { - if (maybeTypeOfKind(indexType, 540672 | 262144) || - maybeTypeOfKind(objectType, 540672) && !(accessNode && accessNode.kind === 180) || - isGenericMappedType(objectType)) { + if (isGenericMappedType(objectType)) { + return getIndexedAccessForMappedType(objectType, indexType, accessNode); + } + if (isGenericIndexType(indexType) || !(accessNode && accessNode.kind === 180) && isGenericObjectType(objectType)) { if (objectType.flags & 1) { return objectType; } - if (isGenericMappedType(objectType)) { - return getIndexedAccessForMappedType(objectType, indexType, accessNode); - } var id = objectType.id + "," + indexType.id; var type = indexedAccessTypes.get(id); if (!type) { @@ -27419,7 +27662,7 @@ var ts; var container = ts.getThisContainer(node, false); var parent = container && container.parent; if (parent && (ts.isClassLike(parent) || parent.kind === 230)) { - if (!(ts.getModifierFlags(container) & 32) && + if (!ts.hasModifier(container, 32) && (container.kind !== 152 || ts.isNodeDescendantOf(node, container.body))) { return getDeclaredTypeOfClassOrInterface(getSymbolOfNode(parent)).thisType; } @@ -27566,7 +27809,7 @@ var ts; } function cloneTypeMapper(mapper) { return mapper && isInferenceContext(mapper) ? - createInferenceContext(mapper.signature, mapper.flags | 2, mapper.inferences) : + createInferenceContext(mapper.signature, mapper.flags | 2, mapper.compareTypes, mapper.inferences) : mapper; } function identityMapper(type) { @@ -27830,11 +28073,13 @@ var ts; if (ts.forEach(node.parameters, function (p) { return !ts.getEffectiveTypeAnnotationNode(p); })) { return true; } - if (node.kind === 187) { - return false; + if (node.kind !== 187) { + var parameter = ts.firstOrUndefined(node.parameters); + if (!(parameter && ts.parameterIsThisKeyword(parameter))) { + return true; + } } - var parameter = ts.firstOrUndefined(node.parameters); - return !(parameter && ts.parameterIsThisKeyword(parameter)); + return node.body.kind === 207 ? false : isContextSensitive(node.body); } function isContextSensitiveFunctionOrObjectLiteralMethod(func) { return (isFunctionExpressionOrArrowFunction(func) || ts.isObjectLiteralMethod(func)) && isContextSensitiveFunctionLikeDeclaration(func); @@ -27897,7 +28142,7 @@ var ts; return 0; } if (source.typeParameters) { - source = instantiateSignatureInContextOf(source, target); + source = instantiateSignatureInContextOf(source, target, undefined, compareTypes); } var result = -1; var sourceThisType = getThisTypeOfSignature(source); @@ -27946,7 +28191,7 @@ var ts; var sourceReturnType = getReturnTypeOfSignature(source); if (target.typePredicate) { if (source.typePredicate) { - result &= compareTypePredicateRelatedTo(source.typePredicate, target.typePredicate, reportErrors, errorReporter, compareTypes); + result &= compareTypePredicateRelatedTo(source.typePredicate, target.typePredicate, source.declaration, target.declaration, reportErrors, errorReporter, compareTypes); } else if (ts.isIdentifierTypePredicate(target.typePredicate)) { if (reportErrors) { @@ -27962,7 +28207,7 @@ var ts; } return result; } - function compareTypePredicateRelatedTo(source, target, reportErrors, errorReporter, compareTypes) { + function compareTypePredicateRelatedTo(source, target, sourceDeclaration, targetDeclaration, reportErrors, errorReporter, compareTypes) { if (source.kind !== target.kind) { if (reportErrors) { errorReporter(ts.Diagnostics.A_this_based_type_guard_is_not_compatible_with_a_parameter_based_type_guard); @@ -27971,11 +28216,13 @@ var ts; return 0; } if (source.kind === 1) { - var sourceIdentifierPredicate = source; - var targetIdentifierPredicate = target; - if (sourceIdentifierPredicate.parameterIndex !== targetIdentifierPredicate.parameterIndex) { + var sourcePredicate = source; + var targetPredicate = target; + var sourceIndex = sourcePredicate.parameterIndex - (ts.getThisParameter(sourceDeclaration) ? 1 : 0); + var targetIndex = targetPredicate.parameterIndex - (ts.getThisParameter(targetDeclaration) ? 1 : 0); + if (sourceIndex !== targetIndex) { if (reportErrors) { - errorReporter(ts.Diagnostics.Parameter_0_is_not_in_the_same_position_as_parameter_1, sourceIdentifierPredicate.parameterName, targetIdentifierPredicate.parameterName); + errorReporter(ts.Diagnostics.Parameter_0_is_not_in_the_same_position_as_parameter_1, sourcePredicate.parameterName, targetPredicate.parameterName); errorReporter(ts.Diagnostics.Type_predicate_0_is_not_assignable_to_1, typePredicateToString(source), typePredicateToString(target)); } return 0; @@ -28120,8 +28367,7 @@ var ts; return true; } if (source.flags & 32768 && target.flags & 32768) { - var id = relation !== identityRelation || source.id < target.id ? source.id + "," + target.id : target.id + "," + source.id; - var related = relation.get(id); + var related = relation.get(getRelationKey(source, target, relation)); if (related !== undefined) { return related === 1; } @@ -28234,11 +28480,21 @@ var ts; !(target.flags & 65536) && !isIntersectionConstituent && source !== globalObjectType && - getPropertiesOfType(source).length > 0 && + (getPropertiesOfType(source).length > 0 || + getSignaturesOfType(source, 0).length > 0 || + getSignaturesOfType(source, 1).length > 0) && isWeakType(target) && !hasCommonProperties(source, target)) { if (reportErrors) { - reportError(ts.Diagnostics.Type_0_has_no_properties_in_common_with_type_1, typeToString(source), typeToString(target)); + var calls = getSignaturesOfType(source, 0); + var constructs = getSignaturesOfType(source, 1); + if (calls.length > 0 && isRelatedTo(getReturnTypeOfSignature(calls[0]), target, false) || + constructs.length > 0 && isRelatedTo(getReturnTypeOfSignature(constructs[0]), target, false)) { + reportError(ts.Diagnostics.Value_of_type_0_has_no_properties_in_common_with_type_1_Did_you_mean_to_call_it, typeToString(source), typeToString(target)); + } + else { + reportError(ts.Diagnostics.Type_0_has_no_properties_in_common_with_type_1, typeToString(source), typeToString(target)); + } } return 0; } @@ -28439,7 +28695,7 @@ var ts; if (overflow) { return 0; } - var id = relation !== identityRelation || source.id < target.id ? source.id + "," + target.id : target.id + "," + source.id; + var id = getRelationKey(source, target, relation); var related = relation.get(id); if (related !== undefined) { if (reportErrors && related === 2) { @@ -28859,6 +29115,9 @@ var ts; if (sourceInfo) { return indexInfoRelatedTo(sourceInfo, targetInfo, reportErrors); } + if (isGenericMappedType(source)) { + return kind === 0 && isRelatedTo(getTemplateTypeFromMappedType(source), targetInfo.type, reportErrors); + } if (isObjectLiteralType(source)) { var related = -1; if (kind === 0) { @@ -28892,8 +29151,8 @@ var ts; if (!sourceSignature.declaration || !targetSignature.declaration) { return true; } - var sourceAccessibility = ts.getModifierFlags(sourceSignature.declaration) & 24; - var targetAccessibility = ts.getModifierFlags(targetSignature.declaration) & 24; + var sourceAccessibility = ts.getSelectedModifierFlags(sourceSignature.declaration, 24); + var targetAccessibility = ts.getSelectedModifierFlags(targetSignature.declaration, 24); if (targetAccessibility === 8) { return true; } @@ -28909,6 +29168,42 @@ var ts; return false; } } + function isUnconstrainedTypeParameter(type) { + return type.flags & 16384 && !getConstraintFromTypeParameter(type); + } + function isTypeReferenceWithGenericArguments(type) { + return getObjectFlags(type) & 4 && ts.some(type.typeArguments, isUnconstrainedTypeParameter); + } + function getTypeReferenceId(type, typeParameters) { + var result = "" + type.target.id; + for (var _i = 0, _a = type.typeArguments; _i < _a.length; _i++) { + var t = _a[_i]; + if (isUnconstrainedTypeParameter(t)) { + var index = ts.indexOf(typeParameters, t); + if (index < 0) { + index = typeParameters.length; + typeParameters.push(t); + } + result += "=" + index; + } + else { + result += "-" + t.id; + } + } + return result; + } + function getRelationKey(source, target, relation) { + if (relation === identityRelation && source.id > target.id) { + var temp = source; + source = target; + target = temp; + } + if (isTypeReferenceWithGenericArguments(source) && isTypeReferenceWithGenericArguments(target)) { + var typeParameters = []; + return getTypeReferenceId(source, typeParameters) + "," + getTypeReferenceId(target, typeParameters); + } + return source.id + "," + target.id; + } function forEachProperty(prop, callback) { if (ts.getCheckFlags(prop) & 6) { for (var _i = 0, _a = prop.containingType.types; _i < _a.length; _i++) { @@ -28945,7 +29240,7 @@ var ts; var symbol = type.symbol; if (symbol && symbol.flags & 32) { var declaration = getClassLikeDeclarationOfSymbol(symbol); - if (declaration && ts.getModifierFlags(declaration) & 128) { + if (declaration && ts.hasModifier(declaration, 128)) { return true; } } @@ -29331,13 +29626,14 @@ var ts; callback(getTypeAtPosition(source, i), getTypeAtPosition(target, i)); } } - function createInferenceContext(signature, flags, baseInferences) { + function createInferenceContext(signature, flags, compareTypes, baseInferences) { var inferences = baseInferences ? ts.map(baseInferences, cloneInferenceInfo) : ts.map(signature.typeParameters, createInferenceInfo); var context = mapper; context.mappedTypes = signature.typeParameters; context.signature = signature; context.inferences = inferences; context.flags = flags; + context.compareTypes = compareTypes || compareTypesAssignable; return context; function mapper(t) { for (var i = 0; i < inferences.length; i++) { @@ -29425,6 +29721,19 @@ var ts; return inference.candidates && getUnionType(inference.candidates, true); } } + function isPossiblyAssignableTo(source, target) { + var properties = getPropertiesOfObjectType(target); + for (var _i = 0, properties_5 = properties; _i < properties_5.length; _i++) { + var targetProp = properties_5[_i]; + if (!(targetProp.flags & (16777216 | 4194304))) { + var sourceProp = getPropertyOfObjectType(source, targetProp.escapedName); + if (!sourceProp) { + return false; + } + } + } + return true; + } function inferTypes(inferences, originalSource, originalTarget, priority) { if (priority === void 0) { priority = 0; } var symbolStack; @@ -29585,15 +29894,17 @@ var ts; return; } } - inferFromProperties(source, target); - inferFromSignatures(source, target, 0); - inferFromSignatures(source, target, 1); - inferFromIndexTypes(source, target); + if (isPossiblyAssignableTo(source, target) || isPossiblyAssignableTo(target, source)) { + inferFromProperties(source, target); + inferFromSignatures(source, target, 0); + inferFromSignatures(source, target, 1); + inferFromIndexTypes(source, target); + } } function inferFromProperties(source, target) { var properties = getPropertiesOfObjectType(target); - for (var _i = 0, properties_5 = properties; _i < properties_5.length; _i++) { - var targetProp = properties_5[_i]; + for (var _i = 0, properties_6 = properties; _i < properties_6.length; _i++) { + var targetProp = properties_6[_i]; var sourceProp = getPropertyOfObjectType(source, targetProp.escapedName); if (sourceProp) { inferFromTypes(getTypeOfSymbol(sourceProp), getTypeOfSymbol(targetProp)); @@ -29692,7 +30003,7 @@ var ts; var constraint = getConstraintOfTypeParameter(context.signature.typeParameters[index]); if (constraint) { var instantiatedConstraint = instantiateType(constraint, context); - if (!isTypeAssignableTo(inferredType, getTypeWithThisArgument(instantiatedConstraint, inferredType))) { + if (!context.compareTypes(inferredType, getTypeWithThisArgument(instantiatedConstraint, inferredType))) { inference.inferredType = inferredType = instantiatedConstraint; } } @@ -29740,27 +30051,17 @@ var ts; } return undefined; } - function getLeftmostIdentifierOrThis(node) { - switch (node.kind) { - case 71: - case 99: - return node; - case 179: - return getLeftmostIdentifierOrThis(node.expression); - } - return undefined; - } function getBindingElementNameText(element) { if (element.parent.kind === 174) { - var name = element.propertyName || element.name; - switch (name.kind) { + var name_21 = element.propertyName || element.name; + switch (name_21.kind) { case 71: - return ts.unescapeLeadingUnderscores(name.escapedText); + return ts.unescapeLeadingUnderscores(name_21.escapedText); case 144: - return ts.isStringOrNumericLiteral(name.expression) ? name.expression.text : undefined; + return ts.isStringOrNumericLiteral(name_21.expression) ? name_21.expression.text : undefined; case 9: case 8: - return name.text; + return name_21.text; default: ts.Debug.fail("Unexpected name kind for binding element name"); } @@ -30241,7 +30542,7 @@ var ts; parent.parent.operatorToken.kind === 58 && parent.parent.left === parent && !ts.isAssignmentTarget(parent.parent) && - isTypeAnyOrAllConstituentTypesHaveKind(getTypeOfExpression(parent.argumentExpression), 84 | 2048); + isTypeAssignableToKind(getTypeOfExpression(parent.argumentExpression), 84); return isLengthPushOrUnshift || isElementAssignment; } function maybeTypePredicateCall(node) { @@ -30387,7 +30688,7 @@ var ts; } else { var indexType = getTypeOfExpression(node.left.argumentExpression); - if (isTypeAnyOrAllConstituentTypesHaveKind(indexType, 84 | 2048)) { + if (isTypeAssignableToKind(indexType, 84)) { evolvedType_1 = addEvolvingArrayElementType(evolvedType_1, node.right); } } @@ -31073,7 +31374,7 @@ var ts; break; case 149: case 148: - if (ts.getModifierFlags(container) & 32) { + if (ts.hasModifier(container, 32)) { error(node, ts.Diagnostics.this_cannot_be_referenced_in_a_static_property_initializer); } break; @@ -31164,14 +31465,14 @@ var ts; if (!isCallExpression && container.kind === 152) { checkThisBeforeSuper(node, container, ts.Diagnostics.super_must_be_called_before_accessing_a_property_of_super_in_the_constructor_of_a_derived_class); } - if ((ts.getModifierFlags(container) & 32) || isCallExpression) { + if (ts.hasModifier(container, 32) || isCallExpression) { nodeCheckFlag = 512; } else { nodeCheckFlag = 256; } getNodeLinks(node).flags |= nodeCheckFlag; - if (container.kind === 151 && ts.getModifierFlags(container) & 256) { + if (container.kind === 151 && ts.hasModifier(container, 256)) { if (ts.isSuperProperty(node.parent) && ts.isAssignmentTarget(node.parent)) { getNodeLinks(container).flags |= 4096; } @@ -31216,7 +31517,7 @@ var ts; } else { if (ts.isClassLike(container.parent) || container.parent.kind === 178) { - if (ts.getModifierFlags(container) & 32) { + if (ts.hasModifier(container, 32)) { return container.kind === 151 || container.kind === 150 || container.kind === 153 || @@ -31349,11 +31650,11 @@ var ts; } if (ts.isBindingPattern(declaration.parent)) { var parentDeclaration = declaration.parent.parent; - var name = declaration.propertyName || declaration.name; + var name_22 = declaration.propertyName || declaration.name; if (parentDeclaration.kind !== 176) { var parentTypeNode = ts.getEffectiveTypeAnnotationNode(parentDeclaration); - if (parentTypeNode && !ts.isBindingPattern(name)) { - var text = ts.getTextOfPropertyName(name); + if (parentTypeNode && !ts.isBindingPattern(name_22)) { + var text = ts.getTextOfPropertyName(name_22); if (text) { return getTypeOfPropertyOfType(getTypeFromTypeNode(parentTypeNode), text); } @@ -31406,7 +31707,7 @@ var ts; return getReturnTypeOfSignature(getSignatureFromDeclaration(functionDecl)); } var signature = getContextualSignatureForFunctionLikeDeclaration(functionDecl); - if (signature) { + if (signature && !isResolvingReturnTypeOfSignature(signature)) { return getReturnTypeOfSignature(signature); } return undefined; @@ -31510,11 +31811,11 @@ var ts; return undefined; } if (ts.isJsxAttribute(node.parent)) { - return getTypeOfPropertyOfType(attributesType, node.parent.name.escapedText); + return getTypeOfPropertyOfContextualType(attributesType, node.parent.name.escapedText); } else if (node.parent.kind === 249) { var jsxChildrenPropertyName = getJsxElementChildrenPropertyname(); - return jsxChildrenPropertyName && jsxChildrenPropertyName !== "" ? getTypeOfPropertyOfType(attributesType, jsxChildrenPropertyName) : anyType; + return jsxChildrenPropertyName && jsxChildrenPropertyName !== "" ? getTypeOfPropertyOfContextualType(attributesType, jsxChildrenPropertyName) : anyType; } else { return attributesType; @@ -31526,7 +31827,7 @@ var ts; if (!attributesType || isTypeAny(attributesType)) { return undefined; } - return getTypeOfPropertyOfType(attributesType, attribute.name.escapedText); + return getTypeOfPropertyOfContextualType(attributesType, attribute.name.escapedText); } else { return attributesType; @@ -31742,10 +32043,7 @@ var ts; } } function isNumericComputedName(name) { - return isTypeAnyOrAllConstituentTypesHaveKind(checkComputedPropertyName(name), 84); - } - function isTypeAnyOrAllConstituentTypesHaveKind(type, kind) { - return isTypeAny(type) || isTypeOfKind(type, kind); + return isTypeAssignableToKind(checkComputedPropertyName(name), 84); } function isInfinityOrNaNString(name) { return name === "Infinity" || name === "-Infinity" || name === "NaN"; @@ -31757,7 +32055,9 @@ var ts; var links = getNodeLinks(node.expression); if (!links.resolvedType) { links.resolvedType = checkExpression(node.expression); - if (!isTypeAnyOrAllConstituentTypesHaveKind(links.resolvedType, 84 | 262178 | 512)) { + if (links.resolvedType.flags & 6144 || + !isTypeAssignableToKind(links.resolvedType, 262178 | 84 | 512) && + !isTypeAssignableTo(links.resolvedType, getUnionType([stringType, numberType, esSymbolType]))) { error(node, ts.Diagnostics.A_computed_property_name_must_be_of_type_string_number_symbol_or_any); } else { @@ -32242,9 +32542,7 @@ var ts; return undefined; } function resolveCustomJsxElementAttributesType(openingLikeElement, shouldIncludeAllStatelessAttributesType, elementType, elementClassType) { - if (!elementType) { - elementType = checkExpression(openingLikeElement.tagName); - } + if (elementType === void 0) { elementType = checkExpression(openingLikeElement.tagName); } if (elementType.flags & 65536) { var types = elementType.types; return getUnionType(types.map(function (type) { @@ -32339,11 +32637,12 @@ var ts; } function getCustomJsxElementAttributesType(node, shouldIncludeAllStatelessAttributesType) { var links = getNodeLinks(node); - if (!links.resolvedJsxElementAttributesType) { + var linkLocation = shouldIncludeAllStatelessAttributesType ? "resolvedJsxElementAllAttributesType" : "resolvedJsxElementAttributesType"; + if (!links[linkLocation]) { var elemClassType = getJsxGlobalElementClassType(); - return links.resolvedJsxElementAttributesType = resolveCustomJsxElementAttributesType(node, shouldIncludeAllStatelessAttributesType, undefined, elemClassType); + return links[linkLocation] = resolveCustomJsxElementAttributesType(node, shouldIncludeAllStatelessAttributesType, undefined, elemClassType); } - return links.resolvedJsxElementAttributesType; + return links[linkLocation]; } function getAllAttributesTypeFromJsxOpeningLikeElement(node) { if (isJsxIntrinsicIdentifier(node.tagName)) { @@ -32570,9 +32869,12 @@ var ts; } var prop = getPropertyOfType(apparentType, right.escapedText); if (!prop) { - var stringIndexType = getIndexTypeOfType(apparentType, 0); - if (stringIndexType) { - return stringIndexType; + var indexInfo = getIndexInfoOfType(apparentType, 0); + if (indexInfo && indexInfo.type) { + if (indexInfo.isReadonly && (ts.isAssignmentTarget(node) || ts.isDeleteTarget(node))) { + error(node, ts.Diagnostics.Index_signature_in_type_0_only_permits_reading, typeToString(apparentType)); + } + return indexInfo.type; } if (right.escapedText && !checkAndReportErrorForExtendingInterface(node)) { reportNonexistentProperty(right, type.flags & 16384 && type.isThisType ? apparentType : type); @@ -32699,7 +33001,7 @@ var ts; if (prop && noUnusedIdentifiers && (prop.flags & 106500) && - prop.valueDeclaration && (ts.getModifierFlags(prop.valueDeclaration) & 8)) { + prop.valueDeclaration && ts.hasModifier(prop.valueDeclaration, 8)) { if (ts.getCheckFlags(prop) & 1) { getSymbolLinks(prop).target.isReferenced = true; } @@ -32867,19 +33169,19 @@ var ts; for (var _i = 0, signatures_4 = signatures; _i < signatures_4.length; _i++) { var signature = signatures_4[_i]; var symbol = signature.declaration && getSymbolOfNode(signature.declaration); - var parent = signature.declaration && signature.declaration.parent; + var parent_13 = signature.declaration && signature.declaration.parent; if (!lastSymbol || symbol === lastSymbol) { - if (lastParent && parent === lastParent) { + if (lastParent && parent_13 === lastParent) { index++; } else { - lastParent = parent; + lastParent = parent_13; index = cutoffIndex; } } else { index = cutoffIndex = result.length; - lastParent = parent; + lastParent = parent_13; } lastSymbol = symbol; if (signature.hasLiteralTypes) { @@ -32970,8 +33272,8 @@ var ts; } return undefined; } - function instantiateSignatureInContextOf(signature, contextualSignature, contextualMapper) { - var context = createInferenceContext(signature, 1); + function instantiateSignatureInContextOf(signature, contextualSignature, contextualMapper, compareTypes) { + var context = createInferenceContext(signature, 1, compareTypes); forEachMatchingParameterType(contextualSignature, signature, function (source, target) { inferTypes(context.inferences, instantiateType(source, contextualMapper || identityMapper), target); }); @@ -33201,7 +33503,7 @@ var ts; return getLiteralType(element.name.text); case 144: var nameType = checkComputedPropertyName(element.name); - if (isTypeOfKind(nameType, 512)) { + if (isTypeAssignableToKind(nameType, 512)) { return nameType; } else { @@ -33294,9 +33596,10 @@ var ts; return resolveErrorCall(node); } var args = getEffectiveCallArguments(node); + var isSingleNonGenericCandidate = candidates.length === 1 && !candidates[0].typeParameters; var excludeArgument; var excludeCount = 0; - if (!isDecorator) { + if (!isDecorator && !isSingleNonGenericCandidate) { for (var i = isTaggedTemplate ? 1 : 0; i < args.length; i++) { if (isContextSensitive(args[i])) { if (!excludeArgument) { @@ -33388,6 +33691,17 @@ var ts; if (signatureHelpTrailingComma === void 0) { signatureHelpTrailingComma = false; } candidateForArgumentError = undefined; candidateForTypeArgumentError = undefined; + if (isSingleNonGenericCandidate) { + var candidate = candidates[0]; + if (!hasCorrectArity(node, args, candidate, signatureHelpTrailingComma)) { + return undefined; + } + if (!checkApplicableSignature(node, args, candidate, relation, excludeArgument, false)) { + candidateForArgumentError = candidate; + return undefined; + } + return candidate; + } for (var candidateIndex = 0; candidateIndex < candidates.length; candidateIndex++) { var originalCandidate = candidates[candidateIndex]; if (!hasCorrectArity(node, args, originalCandidate, signatureHelpTrailingComma)) { @@ -33518,7 +33832,7 @@ var ts; return resolveErrorCall(node); } var valueDecl = expressionType.symbol && getClassLikeDeclarationOfSymbol(expressionType.symbol); - if (valueDecl && ts.getModifierFlags(valueDecl) & 128) { + if (valueDecl && ts.hasModifier(valueDecl, 128)) { error(node, ts.Diagnostics.Cannot_create_an_instance_of_the_abstract_class_0, ts.declarationNameToString(ts.getNameOfDeclaration(valueDecl))); return resolveErrorCall(node); } @@ -33554,8 +33868,8 @@ var ts; return true; } var declaration = signature.declaration; - var modifiers = ts.getModifierFlags(declaration); - if (!(modifiers & 24)) { + var modifiers = ts.getSelectedModifierFlags(declaration, 24); + if (!modifiers) { return true; } var declaringClassDeclaration = getClassLikeDeclarationOfSymbol(declaration.parent.symbol); @@ -33709,7 +34023,7 @@ var ts; && getSymbolLinks(type.symbol).inferredClassType === type; } function checkCallExpression(node) { - checkGrammarTypeArguments(node, node.typeArguments) || checkGrammarArguments(node, node.arguments); + checkGrammarTypeArguments(node, node.typeArguments) || checkGrammarArguments(node.arguments); var signature = getResolvedSignature(node); if (node.expression.kind === 97) { return voidType; @@ -33742,7 +34056,7 @@ var ts; return getReturnTypeOfSignature(signature); } function checkImportCallExpression(node) { - checkGrammarArguments(node, node.arguments) || checkGrammarImportCallExpression(node); + checkGrammarArguments(node.arguments) || checkGrammarImportCallExpression(node); if (node.arguments.length === 0) { return createPromiseReturnType(node, anyType); } @@ -33758,11 +34072,33 @@ var ts; if (moduleSymbol) { var esModuleSymbol = resolveESModuleSymbol(moduleSymbol, specifier, true); if (esModuleSymbol) { - return createPromiseReturnType(node, getTypeOfSymbol(esModuleSymbol)); + return createPromiseReturnType(node, getTypeWithSyntheticDefaultImportType(getTypeOfSymbol(esModuleSymbol), esModuleSymbol)); } } return createPromiseReturnType(node, anyType); } + function getTypeWithSyntheticDefaultImportType(type, symbol) { + if (allowSyntheticDefaultImports && type && type !== unknownType) { + var synthType = type; + if (!synthType.syntheticType) { + if (!getPropertyOfType(type, "default")) { + var memberTable = ts.createSymbolTable(); + var newSymbol = createSymbol(2097152, "default"); + newSymbol.target = resolveSymbol(symbol); + memberTable.set("default", newSymbol); + var anonymousSymbol = createSymbol(2048, "__type"); + var defaultContainingObject = createAnonymousType(anonymousSymbol, memberTable, ts.emptyArray, ts.emptyArray, undefined, undefined); + anonymousSymbol.type = defaultContainingObject; + synthType.syntheticType = getIntersectionType([type, defaultContainingObject]); + } + else { + synthType.syntheticType = type; + } + } + return synthType.syntheticType; + } + return type; + } function isCommonJsRequire(node) { if (!ts.isRequireCall(node, true)) { return false; @@ -33881,15 +34217,15 @@ var ts; } } } - function assignBindingElementTypes(node) { - if (ts.isBindingPattern(node.name)) { - for (var _i = 0, _a = node.name.elements; _i < _a.length; _i++) { - var element = _a[_i]; - if (!ts.isOmittedExpression(element)) { - if (element.name.kind === 71) { - getSymbolLinks(getSymbolOfNode(element)).type = getTypeForBindingElement(element); - } - assignBindingElementTypes(element); + function assignBindingElementTypes(pattern) { + for (var _i = 0, _a = pattern.elements; _i < _a.length; _i++) { + var element = _a[_i]; + if (!ts.isOmittedExpression(element)) { + if (element.name.kind === 71) { + getSymbolLinks(getSymbolOfNode(element)).type = getTypeForBindingElement(element); + } + else { + assignBindingElementTypes(element.name); } } } @@ -33898,12 +34234,13 @@ var ts; var links = getSymbolLinks(parameter); if (!links.type) { links.type = contextualType; - var name = ts.getNameOfDeclaration(parameter.valueDeclaration); - if (links.type === emptyObjectType && - (name.kind === 174 || name.kind === 175)) { - links.type = getTypeFromBindingPattern(name); + var decl = parameter.valueDeclaration; + if (decl.name.kind !== 71) { + if (links.type === emptyObjectType) { + links.type = getTypeFromBindingPattern(decl.name); + } + assignBindingElementTypes(decl.name); } - assignBindingElementTypes(parameter.valueDeclaration); } } function createPromiseType(promisedType) { @@ -34104,14 +34441,14 @@ var ts; } function checkFunctionExpressionOrObjectLiteralMethod(node, checkMode) { ts.Debug.assert(node.kind !== 151 || ts.isObjectLiteralMethod(node)); - var hasGrammarError = checkGrammarFunctionLikeDeclaration(node); - if (!hasGrammarError && node.kind === 186) { - checkGrammarForGenerator(node); - } if (checkMode === 1 && isContextSensitive(node)) { checkNodeDeferred(node); return anyFunctionType; } + var hasGrammarError = checkGrammarFunctionLikeDeclaration(node); + if (!hasGrammarError && node.kind === 186) { + checkGrammarForGenerator(node); + } var links = getNodeLinks(node); var type = getTypeOfSymbol(node.symbol); if (!(links.flags & 1024)) { @@ -34181,7 +34518,7 @@ var ts; } } function checkArithmeticOperandType(operand, type, diagnostic) { - if (!isTypeAnyOrAllConstituentTypesHaveKind(type, 84)) { + if (!isTypeAssignableToKind(type, 84)) { error(operand, diagnostic); return false; } @@ -34269,8 +34606,13 @@ var ts; if (operandType === silentNeverType) { return silentNeverType; } - if (node.operator === 38 && node.operand.kind === 8) { - return getFreshTypeOfLiteralType(getLiteralType(-node.operand.text)); + if (node.operand.kind === 8) { + if (node.operator === 38) { + return getFreshTypeOfLiteralType(getLiteralType(-node.operand.text)); + } + else if (node.operator === 37) { + return getFreshTypeOfLiteralType(getLiteralType(+node.operand.text)); + } } switch (node.operator) { case 37: @@ -34322,30 +34664,22 @@ var ts; } return false; } - function isTypeOfKind(type, kind) { - if (type.flags & kind) { - return true; - } - if (type.flags & 65536) { - var types = type.types; - for (var _i = 0, types_18 = types; _i < types_18.length; _i++) { - var t = types_18[_i]; - if (!isTypeOfKind(t, kind)) { - return false; - } - } + function isTypeAssignableToKind(source, kind, strict) { + if (source.flags & kind) { return true; } - if (type.flags & 131072) { - var types = type.types; - for (var _a = 0, types_19 = types; _a < types_19.length; _a++) { - var t = types_19[_a]; - if (isTypeOfKind(t, kind)) { - return true; - } - } + if (strict && source.flags & (1 | 1024 | 2048 | 4096)) { + return false; } - return false; + return (kind & 84 && isTypeAssignableTo(source, numberType)) || + (kind & 262178 && isTypeAssignableTo(source, stringType)) || + (kind & 136 && isTypeAssignableTo(source, booleanType)) || + (kind & 1024 && isTypeAssignableTo(source, voidType)) || + (kind & 8192 && isTypeAssignableTo(source, neverType)) || + (kind & 4096 && isTypeAssignableTo(source, nullType)) || + (kind & 2048 && isTypeAssignableTo(source, undefinedType)) || + (kind & 512 && isTypeAssignableTo(source, esSymbolType)) || + (kind & 16777216 && isTypeAssignableTo(source, nonPrimitiveType)); } function isConstEnumObjectType(type) { return getObjectFlags(type) & 16 && type.symbol && isConstEnumSymbol(type.symbol); @@ -34357,7 +34691,7 @@ var ts; if (leftType === silentNeverType || rightType === silentNeverType) { return silentNeverType; } - if (isTypeOfKind(leftType, 8190)) { + if (!isTypeAny(leftType) && isTypeAssignableToKind(leftType, 8190)) { error(left, ts.Diagnostics.The_left_hand_side_of_an_instanceof_expression_must_be_of_type_any_an_object_type_or_a_type_parameter); } if (!(isTypeAny(rightType) || @@ -34374,32 +34708,32 @@ var ts; } leftType = checkNonNullType(leftType, left); rightType = checkNonNullType(rightType, right); - if (!(isTypeComparableTo(leftType, stringType) || isTypeOfKind(leftType, 84 | 512))) { + if (!(isTypeComparableTo(leftType, stringType) || isTypeAssignableToKind(leftType, 84 | 512))) { error(left, ts.Diagnostics.The_left_hand_side_of_an_in_expression_must_be_of_type_any_string_number_or_symbol); } - if (!isTypeAnyOrAllConstituentTypesHaveKind(rightType, 32768 | 540672 | 16777216)) { + if (!isTypeAssignableToKind(rightType, 16777216 | 540672)) { error(right, ts.Diagnostics.The_right_hand_side_of_an_in_expression_must_be_of_type_any_an_object_type_or_a_type_parameter); } return booleanType; } function checkObjectLiteralAssignment(node, sourceType) { var properties = node.properties; - for (var _i = 0, properties_6 = properties; _i < properties_6.length; _i++) { - var p = properties_6[_i]; + for (var _i = 0, properties_7 = properties; _i < properties_7.length; _i++) { + var p = properties_7[_i]; checkObjectLiteralDestructuringPropertyAssignment(sourceType, p, properties); } return sourceType; } function checkObjectLiteralDestructuringPropertyAssignment(objectLiteralType, property, allProperties) { if (property.kind === 261 || property.kind === 262) { - var name = property.name; - if (name.kind === 144) { - checkComputedPropertyName(name); + var name_23 = property.name; + if (name_23.kind === 144) { + checkComputedPropertyName(name_23); } - if (isComputedNonLiteralName(name)) { + if (isComputedNonLiteralName(name_23)) { return undefined; } - var text = ts.getTextOfPropertyName(name); + var text = ts.getTextOfPropertyName(name_23); var type = isTypeAny(objectLiteralType) ? objectLiteralType : getTypeOfPropertyOfType(objectLiteralType, text) || @@ -34414,7 +34748,7 @@ var ts; } } else { - error(name, ts.Diagnostics.Type_0_has_no_property_1_and_no_string_index_signature, typeToString(objectLiteralType), ts.declarationNameToString(name)); + error(name_23, ts.Diagnostics.Type_0_has_no_property_1_and_no_string_index_signature, typeToString(objectLiteralType), ts.declarationNameToString(name_23)); } } else if (property.kind === 263) { @@ -34641,24 +34975,22 @@ var ts; if (leftType === silentNeverType || rightType === silentNeverType) { return silentNeverType; } - if (!isTypeOfKind(leftType, 1 | 262178) && !isTypeOfKind(rightType, 1 | 262178)) { + if (!isTypeAssignableToKind(leftType, 262178) && !isTypeAssignableToKind(rightType, 262178)) { leftType = checkNonNullType(leftType, left); rightType = checkNonNullType(rightType, right); } var resultType = void 0; - if (isTypeOfKind(leftType, 84) && isTypeOfKind(rightType, 84)) { + if (isTypeAssignableToKind(leftType, 84, true) && isTypeAssignableToKind(rightType, 84, true)) { resultType = numberType; } - else { - if (isTypeOfKind(leftType, 262178) || isTypeOfKind(rightType, 262178)) { - resultType = stringType; - } - else if (isTypeAny(leftType) || isTypeAny(rightType)) { - resultType = leftType === unknownType || rightType === unknownType ? unknownType : anyType; - } - if (resultType && !checkForDisallowedESSymbolOperand(operator)) { - return resultType; - } + else if (isTypeAssignableToKind(leftType, 262178, true) || isTypeAssignableToKind(rightType, 262178, true)) { + resultType = stringType; + } + else if (isTypeAny(leftType) || isTypeAny(rightType)) { + resultType = leftType === unknownType || rightType === unknownType ? unknownType : anyType; + } + if (resultType && !checkForDisallowedESSymbolOperand(operator)) { + return resultType; } if (!resultType) { reportOperatorError(); @@ -34823,13 +35155,12 @@ var ts; return getBestChoiceType(type1, type2); } function checkLiteralExpression(node) { - if (node.kind === 8) { - checkGrammarNumericLiteral(node); - } switch (node.kind) { + case 13: case 9: return getFreshTypeOfLiteralType(getLiteralType(node.text)); case 8: + checkGrammarNumericLiteral(node); return getFreshTypeOfLiteralType(getLiteralType(+node.text)); case 101: return trueType; @@ -34977,6 +35308,7 @@ var ts; return checkSuperExpression(node); case 95: return nullWideningType; + case 13: case 9: case 8: case 101: @@ -34984,8 +35316,6 @@ var ts; return checkLiteralExpression(node); case 196: return checkTemplateExpression(node); - case 13: - return stringType; case 12: return globalRegExpType; case 177: @@ -35076,7 +35406,7 @@ var ts; checkGrammarDecorators(node) || checkGrammarModifiers(node); checkVariableLikeDeclaration(node); var func = ts.getContainingFunction(node); - if (ts.getModifierFlags(node) & 92) { + if (ts.hasModifier(node, 92)) { func = ts.getContainingFunction(node); if (!(func.kind === 152 && ts.nodeIsPresent(func.body))) { error(node, ts.Diagnostics.A_parameter_property_is_only_allowed_in_a_constructor_implementation); @@ -35136,9 +35466,9 @@ var ts; else if (parameterName) { var hasReportedError = false; for (var _i = 0, _a = parent.parameters; _i < _a.length; _i++) { - var name = _a[_i].name; - if (ts.isBindingPattern(name) && - checkIfTypePredicateVariableIsDeclaredInBindingPattern(name, parameterName, typePredicate.parameterName)) { + var name_24 = _a[_i].name; + if (ts.isBindingPattern(name_24) && + checkIfTypePredicateVariableIsDeclaredInBindingPattern(name_24, parameterName, typePredicate.parameterName)) { hasReportedError = true; break; } @@ -35158,9 +35488,9 @@ var ts; case 160: case 151: case 150: - var parent = node.parent; - if (node === parent.type) { - return parent; + var parent_14 = node.parent; + if (node === parent_14.type) { + return parent_14; } } } @@ -35170,13 +35500,13 @@ var ts; if (ts.isOmittedExpression(element)) { continue; } - var name = element.name; - if (name.kind === 71 && name.escapedText === predicateVariableName) { + var name_25 = element.name; + if (name_25.kind === 71 && name_25.escapedText === predicateVariableName) { error(predicateVariableNode, ts.Diagnostics.A_type_predicate_cannot_reference_element_0_in_a_binding_pattern, predicateVariableName); return true; } - else if (name.kind === 175 || name.kind === 174) { - if (checkIfTypePredicateVariableIsDeclaredInBindingPattern(name, predicateVariableNode, predicateVariableName)) { + else if (name_25.kind === 175 || name_25.kind === 174) { + if (checkIfTypePredicateVariableIsDeclaredInBindingPattern(name_25, predicateVariableNode, predicateVariableName)) { return true; } } @@ -35266,7 +35596,7 @@ var ts; } } else { - var isStatic = ts.getModifierFlags(member) & 32; + var isStatic = ts.hasModifier(member, 32); var names = isStatic ? staticNames : instanceNames; var memberName = member.name && ts.getPropertyNameForPropertyNameNode(member.name); if (memberName) { @@ -35311,7 +35641,7 @@ var ts; for (var _i = 0, _a = node.members; _i < _a.length; _i++) { var member = _a[_i]; var memberNameNode = member.name; - var isStatic = ts.getModifierFlags(member) & 32; + var isStatic = ts.hasModifier(member, 32); if (isStatic && memberNameNode) { var memberName = ts.getPropertyNameForPropertyNameNode(memberNameNode); switch (memberName) { @@ -35399,7 +35729,7 @@ var ts; function checkMethodDeclaration(node) { checkGrammarMethod(node) || checkGrammarComputedPropertyName(node.name); checkFunctionOrMethodDeclaration(node); - if (ts.getModifierFlags(node) & 128 && node.body) { + if (ts.hasModifier(node, 128) && node.body) { error(node, ts.Diagnostics.Method_0_cannot_have_an_implementation_because_it_is_marked_abstract, ts.declarationNameToString(node.name)); } } @@ -35435,17 +35765,9 @@ var ts; } return ts.forEachChild(n, containsSuperCall); } - function markThisReferencesAsErrors(n) { - if (n.kind === 99) { - error(n, ts.Diagnostics.this_cannot_be_referenced_in_current_location); - } - else if (n.kind !== 186 && n.kind !== 228) { - ts.forEachChild(n, markThisReferencesAsErrors); - } - } function isInstancePropertyWithInitializer(n) { return n.kind === 149 && - !(ts.getModifierFlags(n) & 32) && + !ts.hasModifier(n, 32) && !!n.initializer; } var containingClassDecl = node.parent; @@ -35457,8 +35779,8 @@ var ts; if (classExtendsNull) { error(superCall, ts.Diagnostics.A_constructor_cannot_contain_a_super_call_when_its_class_extends_null); } - var superCallShouldBeFirst = ts.forEach(node.parent.members, isInstancePropertyWithInitializer) || - ts.forEach(node.parameters, function (p) { return ts.getModifierFlags(p) & 92; }); + var superCallShouldBeFirst = ts.some(node.parent.members, isInstancePropertyWithInitializer) || + ts.some(node.parameters, function (p) { return ts.hasModifier(p, 92); }); if (superCallShouldBeFirst) { var statements = node.body.statements; var superCallStatement = void 0; @@ -35501,10 +35823,12 @@ var ts; var otherKind = node.kind === 153 ? 154 : 153; var otherAccessor = ts.getDeclarationOfKind(node.symbol, otherKind); if (otherAccessor) { - if ((ts.getModifierFlags(node) & 28) !== (ts.getModifierFlags(otherAccessor) & 28)) { + var nodeFlags = ts.getModifierFlags(node); + var otherFlags = ts.getModifierFlags(otherAccessor); + if ((nodeFlags & 28) !== (otherFlags & 28)) { error(node.name, ts.Diagnostics.Getter_and_setter_accessors_do_not_agree_in_visibility); } - if (ts.hasModifier(node, 128) !== ts.hasModifier(otherAccessor, 128)) { + if ((nodeFlags & 128) !== (otherFlags & 128)) { error(node.name, ts.Diagnostics.Accessors_must_both_be_abstract_or_non_abstract); } checkAccessorDeclarationTypesIdentical(node, otherAccessor, getAnnotatedAccessorType, ts.Diagnostics.get_and_set_accessor_must_have_the_same_type); @@ -35550,7 +35874,7 @@ var ts; function checkTypeReferenceNode(node) { checkGrammarTypeArguments(node, node.typeArguments); if (node.kind === 159 && node.typeName.jsdocDotPos !== undefined && !ts.isInJavaScriptFile(node) && !ts.isInJSDoc(node)) { - grammarErrorAtPos(ts.getSourceFileOfNode(node), node.typeName.jsdocDotPos, 1, ts.Diagnostics.JSDoc_types_can_only_be_used_inside_documentation_comments); + grammarErrorAtPos(node, node.typeName.jsdocDotPos, 1, ts.Diagnostics.JSDoc_types_can_only_be_used_inside_documentation_comments); } var type = getTypeFromTypeReference(node); if (type !== unknownType) { @@ -35558,7 +35882,14 @@ var ts; ts.forEach(node.typeArguments, checkSourceElement); if (produceDiagnostics) { var symbol = getNodeLinks(node).resolvedSymbol; - var typeParameters = symbol.flags & 524288 ? getSymbolLinks(symbol).typeParameters : type.target.localTypeParameters; + if (!symbol) { + error(node, ts.Diagnostics.Type_0_is_not_generic, typeToString(type)); + return; + } + var typeParameters = symbol.flags & 524288 && getSymbolLinks(symbol).typeParameters; + if (!typeParameters && getObjectFlags(type) & 4) { + typeParameters = type.target.localTypeParameters; + } checkTypeArgumentConstraints(typeParameters, node.typeArguments); } } @@ -35601,16 +35932,15 @@ var ts; if (isTypeAssignableTo(indexType, getIndexType(objectType))) { return type; } - if (maybeTypeOfKind(objectType, 540672) && isTypeOfKind(indexType, 84)) { - var constraint = getBaseConstraintOfType(objectType); - if (constraint && getIndexInfoOfType(constraint, 1)) { - return type; - } + if (getIndexInfoOfType(getApparentType(objectType), 1) && isTypeAssignableToKind(indexType, 84)) { + return type; } error(accessNode, ts.Diagnostics.Type_0_cannot_be_used_to_index_type_1, typeToString(indexType), typeToString(objectType)); return type; } function checkIndexedAccessType(node) { + checkSourceElement(node.objectType); + checkSourceElement(node.indexType); checkIndexedAccessIndexType(getTypeFromIndexedAccessTypeNode(node), node); } function checkMappedType(node) { @@ -35621,7 +35951,7 @@ var ts; checkTypeAssignableTo(constraintType, stringType, node.typeParameter.constraint); } function isPrivateWithinAmbient(node) { - return (ts.getModifierFlags(node) & 8) && ts.isInAmbientContext(node); + return ts.hasModifier(node, 8) && ts.isInAmbientContext(node); } function getEffectiveDeclarationFlags(n, flagsToCheck) { var flags = ts.getCombinedModifierFlags(n); @@ -35708,9 +36038,9 @@ var ts; (ts.isComputedPropertyName(node.name) && ts.isComputedPropertyName(subsequentName) || !ts.isComputedPropertyName(node.name) && !ts.isComputedPropertyName(subsequentName) && ts.getEscapedTextOfIdentifierOrLiteral(node.name) === ts.getEscapedTextOfIdentifierOrLiteral(subsequentName))) { var reportError = (node.kind === 151 || node.kind === 150) && - (ts.getModifierFlags(node) & 32) !== (ts.getModifierFlags(subsequentNode) & 32); + ts.hasModifier(node, 32) !== ts.hasModifier(subsequentNode, 32); if (reportError) { - var diagnostic = ts.getModifierFlags(node) & 32 ? ts.Diagnostics.Function_overload_must_be_static : ts.Diagnostics.Function_overload_must_not_be_static; + var diagnostic = ts.hasModifier(node, 32) ? ts.Diagnostics.Function_overload_must_be_static : ts.Diagnostics.Function_overload_must_not_be_static; error(errorNode_1, diagnostic); } return; @@ -35726,7 +36056,7 @@ var ts; error(errorNode, ts.Diagnostics.Constructor_implementation_is_missing); } else { - if (ts.getModifierFlags(node) & 128) { + if (ts.hasModifier(node, 128)) { error(errorNode, ts.Diagnostics.All_declarations_of_an_abstract_method_must_be_consecutive); } else { @@ -35736,8 +36066,8 @@ var ts; } var duplicateFunctionDeclaration = false; var multipleConstructorImplementation = false; - for (var _i = 0, declarations_5 = declarations; _i < declarations_5.length; _i++) { - var current = declarations_5[_i]; + for (var _i = 0, declarations_4 = declarations; _i < declarations_4.length; _i++) { + var current = declarations_4[_i]; var node = current; var inAmbientContext = ts.isInAmbientContext(node); var inAmbientContextOrInterface = node.parent.kind === 230 || node.parent.kind === 163 || inAmbientContext; @@ -35786,7 +36116,7 @@ var ts; }); } if (lastSeenNonAmbientDeclaration && !lastSeenNonAmbientDeclaration.body && - !(ts.getModifierFlags(lastSeenNonAmbientDeclaration) & 128) && !lastSeenNonAmbientDeclaration.questionToken) { + !ts.hasModifier(lastSeenNonAmbientDeclaration, 128) && !lastSeenNonAmbientDeclaration.questionToken) { reportImplementationExpectedError(lastSeenNonAmbientDeclaration); } if (hasOverloads) { @@ -35845,12 +36175,12 @@ var ts; for (var _b = 0, _c = symbol.declarations; _b < _c.length; _b++) { var d = _c[_b]; var declarationSpaces = getDeclarationSpaces(d); - var name = ts.getNameOfDeclaration(d); + var name_26 = ts.getNameOfDeclaration(d); if (declarationSpaces & commonDeclarationSpacesForDefaultAndNonDefault) { - error(name, ts.Diagnostics.Merged_declaration_0_cannot_include_a_default_export_declaration_Consider_adding_a_separate_export_default_0_declaration_instead, ts.declarationNameToString(name)); + error(name_26, ts.Diagnostics.Merged_declaration_0_cannot_include_a_default_export_declaration_Consider_adding_a_separate_export_default_0_declaration_instead, ts.declarationNameToString(name_26)); } else if (declarationSpaces & commonDeclarationSpacesForExportsAndLocals) { - error(name, ts.Diagnostics.Individual_declarations_in_merged_declaration_0_must_be_all_exported_or_all_local, ts.declarationNameToString(name)); + error(name_26, ts.Diagnostics.Individual_declarations_in_merged_declaration_0_must_be_all_exported_or_all_local, ts.declarationNameToString(name_26)); } } } @@ -36195,7 +36525,7 @@ var ts; if (!ts.hasDynamicName(node)) { var symbol = getSymbolOfNode(node); var localSymbol = node.localSymbol || symbol; - var firstDeclaration = ts.find(localSymbol.declarations, function (declaration) { return declaration.kind === node.kind && !ts.isSourceFileJavaScript(ts.getSourceFileOfNode(declaration)); }); + var firstDeclaration = ts.find(localSymbol.declarations, function (declaration) { return declaration.kind === node.kind && !(declaration.flags & 65536); }); if (node === firstDeclaration) { checkFunctionOrConstructorSymbol(localSymbol); } @@ -36285,12 +36615,12 @@ var ts; if (!local.isReferenced) { if (local.valueDeclaration && ts.getRootDeclaration(local.valueDeclaration).kind === 146) { var parameter = ts.getRootDeclaration(local.valueDeclaration); - var name = ts.getNameOfDeclaration(local.valueDeclaration); + var name_27 = ts.getNameOfDeclaration(local.valueDeclaration); if (compilerOptions.noUnusedParameters && !ts.isParameterPropertyDeclaration(parameter) && !ts.parameterIsThisKeyword(parameter) && - !parameterNameStartsWithUnderscore(name)) { - error(name, ts.Diagnostics._0_is_declared_but_never_used, ts.unescapeLeadingUnderscores(local.escapedName)); + !parameterNameStartsWithUnderscore(name_27)) { + error(name_27, ts.Diagnostics._0_is_declared_but_never_used, ts.unescapeLeadingUnderscores(local.escapedName)); } } else if (compilerOptions.noUnusedLocals) { @@ -36330,14 +36660,14 @@ var ts; for (var _i = 0, _a = node.members; _i < _a.length; _i++) { var member = _a[_i]; if (member.kind === 151 || member.kind === 149) { - if (!member.symbol.isReferenced && ts.getModifierFlags(member) & 8) { + if (!member.symbol.isReferenced && ts.hasModifier(member, 8)) { error(member.name, ts.Diagnostics._0_is_declared_but_never_used, ts.unescapeLeadingUnderscores(member.symbol.escapedName)); } } else if (member.kind === 152) { for (var _b = 0, _c = member.parameters; _b < _c.length; _b++) { var parameter = _c[_b]; - if (!parameter.symbol.isReferenced && ts.getModifierFlags(parameter) & 8) { + if (!parameter.symbol.isReferenced && ts.hasModifier(parameter, 8)) { error(parameter.name, ts.Diagnostics.Property_0_is_declared_but_never_used, ts.unescapeLeadingUnderscores(parameter.symbol.escapedName)); } } @@ -36526,8 +36856,8 @@ var ts; container.kind === 233 || container.kind === 265); if (!namesShareScope) { - var name = symbolToString(localDeclarationSymbol); - error(node, ts.Diagnostics.Cannot_initialize_outer_scoped_variable_0_in_the_same_scope_as_block_scoped_declaration_1, name, name); + var name_28 = symbolToString(localDeclarationSymbol); + error(node, ts.Diagnostics.Cannot_initialize_outer_scoped_variable_0_in_the_same_scope_as_block_scoped_declaration_1, name_28, name_28); } } } @@ -36604,13 +36934,13 @@ var ts; if (node.propertyName && node.propertyName.kind === 144) { checkComputedPropertyName(node.propertyName); } - var parent = node.parent.parent; - var parentType = getTypeForBindingElementParent(parent); - var name = node.propertyName || node.name; - var property = getPropertyOfType(parentType, ts.getTextOfPropertyName(name)); + var parent_15 = node.parent.parent; + var parentType = getTypeForBindingElementParent(parent_15); + var name_29 = node.propertyName || node.name; + var property = getPropertyOfType(parentType, ts.getTextOfPropertyName(name_29)); markPropertyAsReferenced(property); - if (parent.initializer && property) { - checkPropertyAccessibility(parent, parent.initializer, parentType, property); + if (parent_15.initializer && property) { + checkPropertyAccessibility(parent_15, parent_15.initializer, parentType, property); } } if (ts.isBindingPattern(node.name)) { @@ -36677,7 +37007,7 @@ var ts; 128 | 64 | 32; - return (ts.getModifierFlags(left) & interestingFlags) === (ts.getModifierFlags(right) & interestingFlags); + return ts.getSelectedModifierFlags(left, interestingFlags) === ts.getSelectedModifierFlags(right, interestingFlags); } function checkVariableDeclaration(node) { checkGrammarVariableDeclaration(node); @@ -36807,7 +37137,7 @@ var ts; checkReferenceExpression(varExpr, ts.Diagnostics.The_left_hand_side_of_a_for_in_statement_must_be_a_variable_or_a_property_access); } } - if (!isTypeAnyOrAllConstituentTypesHaveKind(rightType, 32768 | 540672 | 16777216)) { + if (!isTypeAssignableToKind(rightType, 16777216 | 540672)) { error(node.expression, ts.Diagnostics.The_right_hand_side_of_a_for_in_statement_must_be_of_type_any_an_object_type_or_a_type_parameter); } checkSourceElement(node.statement); @@ -37179,7 +37509,7 @@ var ts; var classDeclaration = type.symbol.valueDeclaration; for (var _i = 0, _a = classDeclaration.members; _i < _a.length; _i++) { var member = _a[_i]; - if (!(ts.getModifierFlags(member) & 32) && ts.hasDynamicName(member)) { + if (!ts.hasModifier(member, 32) && ts.hasDynamicName(member)) { var propType = getTypeOfSymbol(member.symbol); checkIndexConstraintForProperty(member.symbol, propType, type, declaredStringIndexer, stringIndexType, 0); checkIndexConstraintForProperty(member.symbol, propType, type, declaredNumberIndexer, numberIndexType, 1); @@ -37275,10 +37605,10 @@ var ts; } var type = getDeclaredTypeOfSymbol(symbol); if (!areTypeParametersIdentical(declarations, type.localTypeParameters)) { - var name = symbolToString(symbol); - for (var _i = 0, declarations_6 = declarations; _i < declarations_6.length; _i++) { - var declaration = declarations_6[_i]; - error(declaration.name, ts.Diagnostics.All_declarations_of_0_must_have_identical_type_parameters, name); + var name_30 = symbolToString(symbol); + for (var _i = 0, declarations_5 = declarations; _i < declarations_5.length; _i++) { + var declaration = declarations_5[_i]; + error(declaration.name, ts.Diagnostics.All_declarations_of_0_must_have_identical_type_parameters, name_30); } } } @@ -37286,8 +37616,8 @@ var ts; function areTypeParametersIdentical(declarations, typeParameters) { var maxTypeArgumentCount = ts.length(typeParameters); var minTypeArgumentCount = getMinTypeArgumentCount(typeParameters); - for (var _i = 0, declarations_7 = declarations; _i < declarations_7.length; _i++) { - var declaration = declarations_7[_i]; + for (var _i = 0, declarations_6 = declarations; _i < declarations_6.length; _i++) { + var declaration = declarations_6[_i]; var numTypeParameters = ts.length(declaration.typeParameters); if (numTypeParameters < minTypeArgumentCount || numTypeParameters > maxTypeArgumentCount) { return false; @@ -37323,7 +37653,7 @@ var ts; registerForUnusedIdentifiersCheck(node); } function checkClassDeclaration(node) { - if (!node.name && !(ts.getModifierFlags(node) & 512)) { + if (!node.name && !ts.hasModifier(node, 512)) { grammarErrorOnFirstToken(node, ts.Diagnostics.A_class_declaration_without_the_default_modifier_must_have_a_name); } checkClassLikeDeclaration(node); @@ -37416,7 +37746,7 @@ var ts; var signatures = getSignaturesOfType(type, 1); if (signatures.length) { var declaration = signatures[0].declaration; - if (declaration && ts.getModifierFlags(declaration) & 8) { + if (declaration && ts.hasModifier(declaration, 8)) { var typeClassDeclaration = getClassLikeDeclarationOfSymbol(type.symbol); if (!isNodeWithinClass(node, typeClassDeclaration)) { error(node, ts.Diagnostics.Cannot_extend_a_class_0_Class_constructor_is_marked_as_private, getFullyQualifiedName(type.symbol)); @@ -37449,7 +37779,7 @@ var ts; if (derived) { if (derived === base) { var derivedClassDecl = getClassLikeDeclarationOfSymbol(type.symbol); - if (baseDeclarationFlags & 128 && (!derivedClassDecl || !(ts.getModifierFlags(derivedClassDecl) & 128))) { + if (baseDeclarationFlags & 128 && (!derivedClassDecl || !ts.hasModifier(derivedClassDecl, 128))) { if (derivedClassDecl.kind === 199) { error(derivedClassDecl, ts.Diagnostics.Non_abstract_class_expression_does_not_implement_inherited_abstract_member_0_from_class_1, symbolToString(baseProperty), typeToString(baseType)); } @@ -37497,8 +37827,8 @@ var ts; for (var _i = 0, baseTypes_2 = baseTypes; _i < baseTypes_2.length; _i++) { var base = baseTypes_2[_i]; var properties = getPropertiesOfType(getTypeWithThisArgument(base, type.thisType)); - for (var _a = 0, properties_7 = properties; _a < properties_7.length; _a++) { - var prop = properties_7[_a]; + for (var _a = 0, properties_8 = properties; _a < properties_8.length; _a++) { + var prop = properties_8[_a]; var existing = seen.get(prop.escapedName); if (!existing) { seen.set(prop.escapedName, { prop: prop, containingType: base }); @@ -37666,16 +37996,16 @@ var ts; if (isConstantMemberAccess(ex)) { var type = getTypeOfExpression(ex.expression); if (type.symbol && type.symbol.flags & 384) { - var name = void 0; + var name_31; if (ex.kind === 179) { - name = ex.name.escapedText; + name_31 = ex.name.escapedText; } else { var argument = ex.argumentExpression; ts.Debug.assert(ts.isLiteralExpression(argument)); - name = ts.escapeLeadingUnderscores(argument.text); + name_31 = ts.escapeLeadingUnderscores(argument.text); } - return evaluateEnumMember(expr, type.symbol, name); + return evaluateEnumMember(expr, type.symbol, name_31); } } break; @@ -37752,8 +38082,8 @@ var ts; } function getFirstNonAmbientClassOrFunctionDeclaration(symbol) { var declarations = symbol.declarations; - for (var _i = 0, declarations_8 = declarations; _i < declarations_8.length; _i++) { - var declaration = declarations_8[_i]; + for (var _i = 0, declarations_7 = declarations; _i < declarations_7.length; _i++) { + var declaration = declarations_7[_i]; if ((declaration.kind === 229 || (declaration.kind === 228 && ts.nodeIsPresent(declaration.body))) && !ts.isInAmbientContext(declaration)) { @@ -37873,9 +38203,9 @@ var ts; break; case 176: case 226: - var name = node.name; - if (ts.isBindingPattern(name)) { - for (var _b = 0, _c = name.elements; _b < _c.length; _b++) { + var name_32 = node.name; + if (ts.isBindingPattern(name_32)) { + for (var _b = 0, _c = name_32.elements; _b < _c.length; _b++) { var el = _c[_b]; checkModuleAugmentationElement(el, isGlobalAugmentation); } @@ -37968,7 +38298,7 @@ var ts; if (checkGrammarModuleElementContext(node, ts.Diagnostics.An_import_declaration_can_only_be_used_in_a_namespace_or_module)) { return; } - if (!checkGrammarDecorators(node) && !checkGrammarModifiers(node) && ts.getModifierFlags(node) !== 0) { + if (!checkGrammarDecorators(node) && !checkGrammarModifiers(node) && ts.hasModifiers(node)) { grammarErrorOnFirstToken(node, ts.Diagnostics.An_import_declaration_cannot_have_modifiers); } if (checkExternalImportOrExportDeclaration(node)) { @@ -37995,7 +38325,7 @@ var ts; checkGrammarDecorators(node) || checkGrammarModifiers(node); if (ts.isInternalModuleImportEqualsDeclaration(node) || checkExternalImportOrExportDeclaration(node)) { checkImportBinding(node); - if (ts.getModifierFlags(node) & 1) { + if (ts.hasModifier(node, 1)) { markExportAsReferenced(node); } if (ts.isInternalModuleImportEqualsDeclaration(node)) { @@ -38023,7 +38353,7 @@ var ts; if (checkGrammarModuleElementContext(node, ts.Diagnostics.An_export_declaration_can_only_be_used_in_a_module)) { return; } - if (!checkGrammarDecorators(node) && !checkGrammarModifiers(node) && ts.getModifierFlags(node) !== 0) { + if (!checkGrammarDecorators(node) && !checkGrammarModifiers(node) && ts.hasModifiers(node)) { grammarErrorOnFirstToken(node, ts.Diagnostics.An_export_declaration_cannot_have_modifiers); } if (!node.moduleSpecifier || checkExternalImportOrExportDeclaration(node)) { @@ -38081,7 +38411,7 @@ var ts; } return; } - if (!checkGrammarDecorators(node) && !checkGrammarModifiers(node) && ts.getModifierFlags(node) !== 0) { + if (!checkGrammarDecorators(node) && !checkGrammarModifiers(node) && ts.hasModifiers(node)) { grammarErrorOnFirstToken(node, ts.Diagnostics.An_export_assignment_cannot_have_modifiers); } if (node.expression.kind === 71) { @@ -38128,8 +38458,8 @@ var ts; return; } if (exportedDeclarationsCount > 1) { - for (var _i = 0, declarations_9 = declarations; _i < declarations_9.length; _i++) { - var declaration = declarations_9[_i]; + for (var _i = 0, declarations_8 = declarations; _i < declarations_8.length; _i++) { + var declaration = declarations_8[_i]; if (isNotOverload(declaration)) { diagnostics.add(ts.createDiagnosticForNode(declaration, ts.Diagnostics.Cannot_redeclare_exported_variable_0, ts.unescapeLeadingUnderscores(id))); } @@ -38407,7 +38737,7 @@ var ts; return []; } var symbols = ts.createSymbolTable(); - var memberFlags = 0; + var isStatic = false; populateSymbols(); return symbolsToArray(symbols); function populateSymbols() { @@ -38429,7 +38759,7 @@ var ts; } case 229: case 230: - if (!(memberFlags & 32)) { + if (!isStatic) { copySymbols(getSymbolOfNode(location).members, meaning & 793064); } break; @@ -38443,7 +38773,7 @@ var ts; if (ts.introducesArgumentsExoticObject(location)) { copySymbol(argumentsSymbol, meaning); } - memberFlags = ts.getModifierFlags(location); + isStatic = ts.hasModifier(location, 32); location = location.parent; } copySymbols(globals, meaning); @@ -38678,12 +39008,7 @@ var ts; case 8: if (node.parent.kind === 180 && node.parent.argumentExpression === node) { var objectType = getTypeOfExpression(node.parent.expression); - if (objectType === unknownType) - return undefined; - var apparentType = getApparentType(objectType); - if (apparentType === unknownType) - return undefined; - return getPropertyOfType(apparentType, node.text); + return getPropertyOfType(objectType, node.text); } break; } @@ -38779,7 +39104,7 @@ var ts; } function getParentTypeOfClassElement(node) { var classSymbol = getSymbolOfNode(node.parent); - return ts.getModifierFlags(node) & 32 + return ts.hasModifier(node, 32) ? getTypeOfSymbol(classSymbol) : getDeclaredTypeOfSymbol(classSymbol); } @@ -38798,9 +39123,9 @@ var ts; function getRootSymbols(symbol) { if (ts.getCheckFlags(symbol) & 6) { var symbols_4 = []; - var name_2 = symbol.escapedName; + var name_33 = symbol.escapedName; ts.forEach(getSymbolLinks(symbol).containingType.types, function (t) { - var symbol = getPropertyOfType(t, name_2); + var symbol = getPropertyOfType(t, name_33); if (symbol) { symbols_4.push(symbol); } @@ -39004,13 +39329,13 @@ var ts; return strictNullChecks && !isOptionalParameter(parameter) && parameter.initializer && - !(ts.getModifierFlags(parameter) & 92); + !ts.hasModifier(parameter, 92); } function isOptionalUninitializedParameterProperty(parameter) { return strictNullChecks && isOptionalParameter(parameter) && !parameter.initializer && - !!(ts.getModifierFlags(parameter) & 92); + ts.hasModifier(parameter, 92); } function getNodeCheckFlags(node) { return getNodeLinks(node).flags; @@ -39066,22 +39391,22 @@ var ts; else if (type.flags & 1) { return ts.TypeReferenceSerializationKind.ObjectType; } - else if (isTypeOfKind(type, 1024 | 6144 | 8192)) { + else if (isTypeAssignableToKind(type, 1024 | 6144 | 8192)) { return ts.TypeReferenceSerializationKind.VoidNullableOrNeverType; } - else if (isTypeOfKind(type, 136)) { + else if (isTypeAssignableToKind(type, 136)) { return ts.TypeReferenceSerializationKind.BooleanType; } - else if (isTypeOfKind(type, 84)) { + else if (isTypeAssignableToKind(type, 84)) { return ts.TypeReferenceSerializationKind.NumberLikeType; } - else if (isTypeOfKind(type, 262178)) { + else if (isTypeAssignableToKind(type, 262178)) { return ts.TypeReferenceSerializationKind.StringLikeType; } else if (isTupleType(type)) { return ts.TypeReferenceSerializationKind.ArrayLikeType; } - else if (isTypeOfKind(type, 512)) { + else if (isTypeAssignableToKind(type, 512)) { return ts.TypeReferenceSerializationKind.ESSymbolType; } else if (isFunctionType(type)) { @@ -39122,9 +39447,9 @@ var ts; } var location = reference; if (startInDeclarationContainer) { - var parent = reference.parent; - if (ts.isDeclaration(parent) && reference === parent.name) { - location = getDeclarationContainer(parent); + var parent_16 = reference.parent; + if (ts.isDeclaration(parent_16) && reference === parent_16.name) { + location = getDeclarationContainer(parent_16); } } return resolveName(location, reference.escapedText, 107455 | 1048576 | 2097152, undefined, undefined); @@ -39249,9 +39574,9 @@ var ts; } var current = symbol; while (true) { - var parent = getParentOfSymbol(current); - if (parent) { - current = parent; + var parent_17 = getParentOfSymbol(current); + if (parent_17) { + current = parent_17; } else { break; @@ -39339,10 +39664,10 @@ var ts; var uncheckedHelpers = helpers & ~requestedExternalEmitHelpers; for (var helper = 1; helper <= 32768; helper <<= 1) { if (uncheckedHelpers & helper) { - var name = getHelperName(helper); - var symbol = getSymbol(helpersModule.exports, ts.escapeLeadingUnderscores(name), 107455); + var name_34 = getHelperName(helper); + var symbol = getSymbol(helpersModule.exports, ts.escapeLeadingUnderscores(name_34), 107455); if (!symbol) { - error(location, ts.Diagnostics.This_syntax_requires_an_imported_helper_named_1_but_module_0_has_no_exported_member_1, ts.externalHelpersModuleNameText, name); + error(location, ts.Diagnostics.This_syntax_requires_an_imported_helper_named_1_but_module_0_has_no_exported_member_1, ts.externalHelpersModuleNameText, name_34); } } } @@ -39546,7 +39871,7 @@ var ts; node.kind !== 154) { return grammarErrorOnNode(modifier, ts.Diagnostics.abstract_modifier_can_only_appear_on_a_class_method_or_property_declaration); } - if (!(node.parent.kind === 229 && ts.getModifierFlags(node.parent) & 128)) { + if (!(node.parent.kind === 229 && ts.hasModifier(node.parent, 128))) { return grammarErrorOnNode(modifier, ts.Diagnostics.Abstract_methods_can_only_appear_within_an_abstract_class); } if (flags & 32) { @@ -39665,8 +39990,7 @@ var ts; if (list && list.hasTrailingComma) { var start = list.end - ",".length; var end = list.end; - var sourceFile = ts.getSourceFileOfNode(list[0]); - return grammarErrorAtPos(sourceFile, start, end - start, ts.Diagnostics.Trailing_comma_not_allowed); + return grammarErrorAtPos(list[0], start, end - start, ts.Diagnostics.Trailing_comma_not_allowed); } } function checkGrammarTypeParameterList(typeParameters, file) { @@ -39742,7 +40066,7 @@ var ts; if (parameter.dotDotDotToken) { return grammarErrorOnNode(parameter.dotDotDotToken, ts.Diagnostics.An_index_signature_cannot_have_a_rest_parameter); } - if (ts.getModifierFlags(parameter) !== 0) { + if (ts.hasModifiers(parameter)) { return grammarErrorOnNode(parameter.name, ts.Diagnostics.An_index_signature_parameter_cannot_have_an_accessibility_modifier); } if (parameter.questionToken) { @@ -39776,19 +40100,18 @@ var ts; return checkGrammarForDisallowedTrailingComma(typeArguments) || checkGrammarForAtLeastOneTypeArgument(node, typeArguments); } - function checkGrammarForOmittedArgument(node, args) { + function checkGrammarForOmittedArgument(args) { if (args) { - var sourceFile = ts.getSourceFileOfNode(node); for (var _i = 0, args_5 = args; _i < args_5.length; _i++) { var arg = args_5[_i]; if (arg.kind === 200) { - return grammarErrorAtPos(sourceFile, arg.pos, 0, ts.Diagnostics.Argument_expression_expected); + return grammarErrorAtPos(arg, arg.pos, 0, ts.Diagnostics.Argument_expression_expected); } } } } - function checkGrammarArguments(node, args) { - return checkGrammarForOmittedArgument(node, args); + function checkGrammarArguments(args) { + return checkGrammarForOmittedArgument(args); } function checkGrammarHeritageClause(node) { var types = node.types; @@ -39797,8 +40120,7 @@ var ts; } if (types && types.length === 0) { var listType = ts.tokenToString(node.token); - var sourceFile = ts.getSourceFileOfNode(node); - return grammarErrorAtPos(sourceFile, types.pos, 0, ts.Diagnostics._0_list_cannot_be_empty, listType); + return grammarErrorAtPos(node, types.pos, 0, ts.Diagnostics._0_list_cannot_be_empty, listType); } return ts.forEach(types, checkGrammarExpressionWithTypeArguments); } @@ -39892,9 +40214,9 @@ var ts; if (prop.kind === 263) { continue; } - var name = prop.name; - if (name.kind === 144) { - checkGrammarComputedPropertyName(name); + var name_35 = prop.name; + if (name_35.kind === 144) { + checkGrammarComputedPropertyName(name_35); } if (prop.kind === 262 && !inDestructuring && prop.objectAssignmentInitializer) { return grammarErrorOnNode(prop.equalsToken, ts.Diagnostics.can_only_be_used_in_an_object_literal_property_inside_a_destructuring_assignment); @@ -39910,8 +40232,8 @@ var ts; var currentKind = void 0; if (prop.kind === 261 || prop.kind === 262) { checkGrammarForInvalidQuestionMark(prop.questionToken, ts.Diagnostics.An_object_member_cannot_be_declared_optional); - if (name.kind === 8) { - checkGrammarNumericLiteral(name); + if (name_35.kind === 8) { + checkGrammarNumericLiteral(name_35); } currentKind = Property; } @@ -39927,7 +40249,7 @@ var ts; else { ts.Debug.fail("Unexpected syntax kind:" + prop.kind); } - var effectiveName = ts.getPropertyNameForPropertyNameNode(name); + var effectiveName = ts.getPropertyNameForPropertyNameNode(name_35); if (effectiveName === undefined) { continue; } @@ -39937,18 +40259,18 @@ var ts; } else { if (currentKind === Property && existingKind === Property) { - grammarErrorOnNode(name, ts.Diagnostics.Duplicate_identifier_0, ts.getTextOfNode(name)); + grammarErrorOnNode(name_35, ts.Diagnostics.Duplicate_identifier_0, ts.getTextOfNode(name_35)); } else if ((currentKind & GetOrSetAccessor) && (existingKind & GetOrSetAccessor)) { if (existingKind !== GetOrSetAccessor && currentKind !== existingKind) { seen.set(effectiveName, currentKind | existingKind); } else { - return grammarErrorOnNode(name, ts.Diagnostics.An_object_literal_cannot_have_multiple_get_Slashset_accessors_with_the_same_name); + return grammarErrorOnNode(name_35, ts.Diagnostics.An_object_literal_cannot_have_multiple_get_Slashset_accessors_with_the_same_name); } } else { - return grammarErrorOnNode(name, ts.Diagnostics.An_object_literal_cannot_have_property_and_accessor_with_the_same_name); + return grammarErrorOnNode(name_35, ts.Diagnostics.An_object_literal_cannot_have_property_and_accessor_with_the_same_name); } } } @@ -39961,12 +40283,12 @@ var ts; continue; } var jsxAttr = attr; - var name = jsxAttr.name; - if (!seen.get(name.escapedText)) { - seen.set(name.escapedText, true); + var name_36 = jsxAttr.name; + if (!seen.get(name_36.escapedText)) { + seen.set(name_36.escapedText, true); } else { - return grammarErrorOnNode(name, ts.Diagnostics.JSX_elements_cannot_have_multiple_attributes_with_the_same_name); + return grammarErrorOnNode(name_36, ts.Diagnostics.JSX_elements_cannot_have_multiple_attributes_with_the_same_name); } var initializer = jsxAttr.initializer; if (initializer && initializer.kind === 256 && !initializer.expression) { @@ -40021,10 +40343,10 @@ var ts; else if (ts.isInAmbientContext(accessor)) { return grammarErrorOnNode(accessor.name, ts.Diagnostics.An_accessor_cannot_be_declared_in_an_ambient_context); } - else if (accessor.body === undefined && !(ts.getModifierFlags(accessor) & 128)) { - return grammarErrorAtPos(ts.getSourceFileOfNode(accessor), accessor.end - 1, ";".length, ts.Diagnostics._0_expected, "{"); + else if (accessor.body === undefined && !ts.hasModifier(accessor, 128)) { + return grammarErrorAtPos(accessor, accessor.end - 1, ";".length, ts.Diagnostics._0_expected, "{"); } - else if (accessor.body && ts.getModifierFlags(accessor) & 128) { + else if (accessor.body && ts.hasModifier(accessor, 128)) { return grammarErrorOnNode(accessor, ts.Diagnostics.An_abstract_accessor_cannot_have_an_implementation); } else if (accessor.typeParameters) { @@ -40077,7 +40399,7 @@ var ts; return true; } else if (node.body === undefined) { - return grammarErrorAtPos(ts.getSourceFileOfNode(node), node.end - 1, ";".length, ts.Diagnostics._0_expected, "{"); + return grammarErrorAtPos(node, node.end - 1, ";".length, ts.Diagnostics._0_expected, "{"); } } if (ts.isClassLike(node.parent)) { @@ -40148,7 +40470,7 @@ var ts; return grammarErrorOnNode(node.name, ts.Diagnostics.A_rest_element_cannot_contain_a_binding_pattern); } if (node.initializer) { - return grammarErrorAtPos(ts.getSourceFileOfNode(node), node.initializer.pos - 1, 1, ts.Diagnostics.A_rest_element_cannot_have_an_initializer); + return grammarErrorAtPos(node, node.initializer.pos - 1, 1, ts.Diagnostics.A_rest_element_cannot_have_an_initializer); } } } @@ -40168,12 +40490,12 @@ var ts; } else { var equalsTokenLength = "=".length; - return grammarErrorAtPos(ts.getSourceFileOfNode(node), node.initializer.pos - equalsTokenLength, equalsTokenLength, ts.Diagnostics.Initializers_are_not_allowed_in_ambient_contexts); + return grammarErrorAtPos(node, node.initializer.pos - equalsTokenLength, equalsTokenLength, ts.Diagnostics.Initializers_are_not_allowed_in_ambient_contexts); } } if (node.initializer && !(ts.isConst(node) && isStringOrNumberLiteralExpression(node.initializer))) { var equalsTokenLength = "=".length; - return grammarErrorAtPos(ts.getSourceFileOfNode(node), node.initializer.pos - equalsTokenLength, equalsTokenLength, ts.Diagnostics.Initializers_are_not_allowed_in_ambient_contexts); + return grammarErrorAtPos(node, node.initializer.pos - equalsTokenLength, equalsTokenLength, ts.Diagnostics.Initializers_are_not_allowed_in_ambient_contexts); } } else if (!node.initializer) { @@ -40230,7 +40552,7 @@ var ts; return true; } if (!declarationList.declarations.length) { - return grammarErrorAtPos(ts.getSourceFileOfNode(declarationList), declarations.pos, declarations.end - declarations.pos, ts.Diagnostics.Variable_declaration_list_cannot_be_empty); + return grammarErrorAtPos(declarationList, declarations.pos, declarations.end - declarations.pos, ts.Diagnostics.Variable_declaration_list_cannot_be_empty); } } function allowLetAndConstDeclarations(parent) { @@ -40276,7 +40598,8 @@ var ts; return true; } } - function grammarErrorAtPos(sourceFile, start, length, message, arg0, arg1, arg2) { + function grammarErrorAtPos(nodeForSourceFile, start, length, message, arg0, arg1, arg2) { + var sourceFile = ts.getSourceFileOfNode(nodeForSourceFile); if (!hasParseDiagnostics(sourceFile)) { diagnostics.add(ts.createFileDiagnostic(sourceFile, start, length, message, arg0, arg1, arg2)); return true; @@ -40291,7 +40614,7 @@ var ts; } function checkGrammarConstructorTypeParameters(node) { if (node.typeParameters) { - return grammarErrorAtPos(ts.getSourceFileOfNode(node), node.typeParameters.pos, node.typeParameters.end - node.typeParameters.pos, ts.Diagnostics.Type_parameters_cannot_appear_on_a_constructor_declaration); + return grammarErrorAtPos(node, node.typeParameters.pos, node.typeParameters.end - node.typeParameters.pos, ts.Diagnostics.Type_parameters_cannot_appear_on_a_constructor_declaration); } } function checkGrammarConstructorTypeAnnotation(node) { @@ -40333,7 +40656,7 @@ var ts; node.kind === 244 || node.kind === 243 || node.kind === 236 || - ts.getModifierFlags(node) & (2 | 1 | 512)) { + ts.hasModifier(node, 2 | 1 | 512)) { return false; } return grammarErrorOnFirstToken(node, ts.Diagnostics.A_declare_modifier_is_required_for_a_top_level_declaration_in_a_d_ts_file); @@ -43102,27 +43425,27 @@ var ts; function createExpressionForAccessorDeclaration(properties, property, receiver, multiLine) { var _a = ts.getAllAccessorDeclarations(properties, property), firstAccessor = _a.firstAccessor, getAccessor = _a.getAccessor, setAccessor = _a.setAccessor; if (property === firstAccessor) { - var properties_8 = []; + var properties_9 = []; if (getAccessor) { var getterFunction = ts.createFunctionExpression(getAccessor.modifiers, undefined, undefined, undefined, getAccessor.parameters, undefined, getAccessor.body); ts.setTextRange(getterFunction, getAccessor); ts.setOriginalNode(getterFunction, getAccessor); var getter = ts.createPropertyAssignment("get", getterFunction); - properties_8.push(getter); + properties_9.push(getter); } if (setAccessor) { var setterFunction = ts.createFunctionExpression(setAccessor.modifiers, undefined, undefined, undefined, setAccessor.parameters, undefined, setAccessor.body); ts.setTextRange(setterFunction, setAccessor); ts.setOriginalNode(setterFunction, setAccessor); var setter = ts.createPropertyAssignment("set", setterFunction); - properties_8.push(setter); + properties_9.push(setter); } - properties_8.push(ts.createPropertyAssignment("enumerable", ts.createTrue())); - properties_8.push(ts.createPropertyAssignment("configurable", ts.createTrue())); + properties_9.push(ts.createPropertyAssignment("enumerable", ts.createTrue())); + properties_9.push(ts.createPropertyAssignment("configurable", ts.createTrue())); var expression = ts.setTextRange(ts.createCall(ts.createPropertyAccess(ts.createIdentifier("Object"), "defineProperty"), undefined, [ receiver, createExpressionForPropertyName(property.name), - ts.createObjectLiteral(properties_8, multiLine) + ts.createObjectLiteral(properties_9, multiLine) ]), firstAccessor); return ts.aggregateTransformFlags(expression); } @@ -43168,15 +43491,15 @@ var ts; function getName(node, allowComments, allowSourceMaps, emitFlags) { var nodeName = ts.getNameOfDeclaration(node); if (nodeName && ts.isIdentifier(nodeName) && !ts.isGeneratedIdentifier(nodeName)) { - var name = ts.getMutableClone(nodeName); + var name_37 = ts.getMutableClone(nodeName); emitFlags |= ts.getEmitFlags(nodeName); if (!allowSourceMaps) emitFlags |= 48; if (!allowComments) emitFlags |= 1536; if (emitFlags) - ts.setEmitFlags(name, emitFlags); - return name; + ts.setEmitFlags(name_37, emitFlags); + return name_37; } return ts.getGeneratedNameForNode(node); } @@ -43643,8 +43966,8 @@ var ts; function getLocalNameForExternalImport(node, sourceFile) { var namespaceDeclaration = ts.getNamespaceDeclarationNode(node); if (namespaceDeclaration && !ts.isDefaultImport(node)) { - var name = namespaceDeclaration.name; - return ts.isGeneratedIdentifier(name) ? name : ts.createIdentifier(ts.getSourceTextOfNodeFromSourceFile(sourceFile, namespaceDeclaration.name)); + var name_38 = namespaceDeclaration.name; + return ts.isGeneratedIdentifier(name_38) ? name_38 : ts.createIdentifier(ts.getSourceTextOfNodeFromSourceFile(sourceFile, namespaceDeclaration.name)); } if (node.kind === 238 && node.importClause) { return ts.getGeneratedNameForNode(node); @@ -44765,10 +45088,10 @@ var ts; for (var _b = 0, _c = node.exportClause.elements; _b < _c.length; _b++) { var specifier = _c[_b]; if (!uniqueExports.get(ts.unescapeLeadingUnderscores(specifier.name.escapedText))) { - var name = specifier.propertyName || specifier.name; - exportSpecifiers.add(ts.unescapeLeadingUnderscores(name.escapedText), specifier); - var decl = resolver.getReferencedImportDeclaration(name) - || resolver.getReferencedValueDeclaration(name); + var name_39 = specifier.propertyName || specifier.name; + exportSpecifiers.add(ts.unescapeLeadingUnderscores(name_39.escapedText), specifier); + var decl = resolver.getReferencedImportDeclaration(name_39) + || resolver.getReferencedValueDeclaration(name_39); if (decl) { multiMapSparseArrayAdd(exportedBindings, getOriginalNodeId(decl), specifier.name); } @@ -44800,11 +45123,11 @@ var ts; } } else { - var name = node.name; - if (!uniqueExports.get(ts.unescapeLeadingUnderscores(name.escapedText))) { - multiMapSparseArrayAdd(exportedBindings, getOriginalNodeId(node), name); - uniqueExports.set(ts.unescapeLeadingUnderscores(name.escapedText), true); - exportedNames = ts.append(exportedNames, name); + var name_40 = node.name; + if (!uniqueExports.get(ts.unescapeLeadingUnderscores(name_40.escapedText))) { + multiMapSparseArrayAdd(exportedBindings, getOriginalNodeId(node), name_40); + uniqueExports.set(ts.unescapeLeadingUnderscores(name_40.escapedText), true); + exportedNames = ts.append(exportedNames, name_40); } } } @@ -44818,11 +45141,11 @@ var ts; } } else { - var name = node.name; - if (!uniqueExports.get(ts.unescapeLeadingUnderscores(name.escapedText))) { - multiMapSparseArrayAdd(exportedBindings, getOriginalNodeId(node), name); - uniqueExports.set(ts.unescapeLeadingUnderscores(name.escapedText), true); - exportedNames = ts.append(exportedNames, name); + var name_41 = node.name; + if (!uniqueExports.get(ts.unescapeLeadingUnderscores(name_41.escapedText))) { + multiMapSparseArrayAdd(exportedBindings, getOriginalNodeId(node), name_41); + uniqueExports.set(ts.unescapeLeadingUnderscores(name_41.escapedText), true); + exportedNames = ts.append(exportedNames, name_41); } } } @@ -44965,11 +45288,11 @@ var ts; } } for (var _i = 0, pendingDeclarations_1 = pendingDeclarations; _i < pendingDeclarations_1.length; _i++) { - var _a = pendingDeclarations_1[_i], pendingExpressions_1 = _a.pendingExpressions, name = _a.name, value = _a.value, location = _a.location, original = _a.original; - var variable = ts.createVariableDeclaration(name, undefined, pendingExpressions_1 ? ts.inlineExpressions(ts.append(pendingExpressions_1, value)) : value); + var _a = pendingDeclarations_1[_i], pendingExpressions_1 = _a.pendingExpressions, name_42 = _a.name, value = _a.value, location_2 = _a.location, original = _a.original; + var variable = ts.createVariableDeclaration(name_42, undefined, pendingExpressions_1 ? ts.inlineExpressions(ts.append(pendingExpressions_1, value)) : value); variable.original = original; - ts.setTextRange(variable, location); - if (ts.isIdentifier(name)) { + ts.setTextRange(variable, location_2); + if (ts.isIdentifier(name_42)) { ts.setEmitFlags(variable, 64); } ts.aggregateTransformFlags(variable); @@ -45062,7 +45385,8 @@ var ts; ? undefined : numElements, location), false, location); } - else if (numElements !== 1 && (flattenContext.level < 1 || numElements === 0)) { + else if (numElements !== 1 && (flattenContext.level < 1 || numElements === 0) + || ts.every(elements, ts.isOmittedExpression)) { var reuseIdentifierExpressions = !ts.isDeclarationBindingElement(parent) || numElements !== 0; value = ensureIdentifier(flattenContext, value, reuseIdentifierExpressions, location); } @@ -45120,8 +45444,8 @@ var ts; return ts.createElementAccess(value, argumentExpression); } else { - var name = ts.createIdentifier(ts.unescapeLeadingUnderscores(propertyName.escapedText)); - return ts.createPropertyAccess(value, name); + var name_43 = ts.createIdentifier(ts.unescapeLeadingUnderscores(propertyName.escapedText)); + return ts.createPropertyAccess(value, name_43); } } function ensureIdentifier(flattenContext, value, reuseIdentifierExpressions, location) { @@ -45269,7 +45593,12 @@ var ts; if (ts.hasModifier(node, 2)) { break; } - recordEmittedDeclarationInScope(node); + if (node.name) { + recordEmittedDeclarationInScope(node); + } + else { + ts.Debug.assert(node.kind === 229 || ts.hasModifier(node, 512)); + } break; } } @@ -45683,8 +46012,8 @@ var ts; && member.initializer !== undefined; } function addInitializedPropertyStatements(statements, properties, receiver) { - for (var _i = 0, properties_9 = properties; _i < properties_9.length; _i++) { - var property = properties_9[_i]; + for (var _i = 0, properties_10 = properties; _i < properties_10.length; _i++) { + var property = properties_10[_i]; var statement = ts.createStatement(transformInitializedProperty(property, receiver)); ts.setSourceMapRange(statement, ts.moveRangePastModifiers(property)); ts.setCommentRange(statement, property); @@ -45693,8 +46022,8 @@ var ts; } function generateInitializedPropertyExpressions(properties, receiver) { var expressions = []; - for (var _i = 0, properties_10 = properties; _i < properties_10.length; _i++) { - var property = properties_10[_i]; + for (var _i = 0, properties_11 = properties; _i < properties_11.length; _i++) { + var property = properties_11[_i]; var expression = transformInitializedProperty(property, receiver); expression.startsOnNewLine = true; ts.setSourceMapRange(expression, ts.moveRangePastModifiers(property)); @@ -46117,14 +46446,14 @@ var ts; function serializeEntityNameAsExpression(node, useFallback) { switch (node.kind) { case 71: - var name = ts.getMutableClone(node); - name.flags &= ~8; - name.original = undefined; - name.parent = currentScope; + var name_44 = ts.getMutableClone(node); + name_44.flags &= ~8; + name_44.original = undefined; + name_44.parent = currentScope; if (useFallback) { - return ts.createLogicalAnd(ts.createStrictInequality(ts.createTypeOf(name), ts.createLiteral("undefined")), name); + return ts.createLogicalAnd(ts.createStrictInequality(ts.createTypeOf(name_44), ts.createLiteral("undefined")), name_44); } - return name; + return name_44; case 143: return serializeQualifiedNameAsExpression(node, useFallback); } @@ -46389,24 +46718,24 @@ var ts; && moduleKind !== ts.ModuleKind.System); } function recordEmittedDeclarationInScope(node) { - var name = node.symbol && node.symbol.escapedName; - if (name) { - if (!currentScopeFirstDeclarationsOfName) { - currentScopeFirstDeclarationsOfName = ts.createUnderscoreEscapedMap(); - } - if (!currentScopeFirstDeclarationsOfName.has(name)) { - currentScopeFirstDeclarationsOfName.set(name, node); - } + if (!currentScopeFirstDeclarationsOfName) { + currentScopeFirstDeclarationsOfName = ts.createUnderscoreEscapedMap(); + } + var name = declaredNameInScope(node); + if (!currentScopeFirstDeclarationsOfName.has(name)) { + currentScopeFirstDeclarationsOfName.set(name, node); } } function isFirstEmittedDeclarationInScope(node) { if (currentScopeFirstDeclarationsOfName) { - var name = node.symbol && node.symbol.escapedName; - if (name) { - return currentScopeFirstDeclarationsOfName.get(name) === node; - } + var name_45 = declaredNameInScope(node); + return currentScopeFirstDeclarationsOfName.get(name_45) === node; } - return false; + return true; + } + function declaredNameInScope(node) { + ts.Debug.assertNode(node.name, ts.isIdentifier); + return node.name.escapedText; } function addVarForEnumOrModuleDeclaration(statements, node) { var statement = ts.createVariableStatement(ts.visitNodes(node.modifiers, modifierVisitor, ts.isModifier), ts.createVariableDeclarationList([ @@ -46437,7 +46766,7 @@ var ts; if (!shouldEmitModuleDeclaration(node)) { return ts.createNotEmittedStatement(node); } - ts.Debug.assert(ts.isIdentifier(node.name), "TypeScript module should have an Identifier name."); + ts.Debug.assertNode(node.name, ts.isIdentifier, "A TypeScript namespace should have an Identifier name."); enableSubstitutionForNamespaceExports(); var statements = []; var emitFlags = 2; @@ -46699,14 +47028,14 @@ var ts; } function substituteShorthandPropertyAssignment(node) { if (enabledSubstitutions & 2) { - var name = node.name; - var exportedName = trySubstituteNamespaceExportedName(name); + var name_46 = node.name; + var exportedName = trySubstituteNamespaceExportedName(name_46); if (exportedName) { if (node.objectAssignmentInitializer) { var initializer = ts.createAssignment(exportedName, node.objectAssignmentInitializer); - return ts.setTextRange(ts.createPropertyAssignment(name, initializer), node); + return ts.setTextRange(ts.createPropertyAssignment(name_46, initializer), node); } - return ts.setTextRange(ts.createPropertyAssignment(name, exportedName), node); + return ts.setTextRange(ts.createPropertyAssignment(name_46, exportedName), node); } } return node; @@ -47161,6 +47490,8 @@ var ts; return visitExpressionStatement(node); case 185: return visitParenthesizedExpression(node, noDestructuringValue); + case 260: + return visitCatchClause(node); default: return ts.visitEachChild(node, visitor, context); } @@ -47235,6 +47566,12 @@ var ts; function visitParenthesizedExpression(node, noDestructuringValue) { return ts.visitEachChild(node, noDestructuringValue ? visitorNoDestructuringValue : visitor, context); } + function visitCatchClause(node) { + if (!node.variableDeclaration) { + return ts.updateCatchClause(node, ts.createVariableDeclaration(ts.createTempVariable(undefined)), ts.visitNode(node.block, visitor, ts.isBlock)); + } + return ts.visitEachChild(node, visitor, context); + } function visitBinaryExpression(node, noDestructuringValue) { if (ts.isDestructuringAssignment(node) && node.left.transformFlags & 1048576) { return ts.flattenDestructuringAssignment(node, visitor, context, 1, !noDestructuringValue); @@ -47681,7 +48018,7 @@ var ts; objectProperties = ts.createAssignHelper(context, segments); } } - var element = ts.createExpressionForJsxElement(context.getEmitResolver().getJsxFactoryEntity(), compilerOptions.reactNamespace, tagName, objectProperties, ts.filter(ts.map(children, transformJsxChildToExpression), ts.isDefined), node, location); + var element = ts.createExpressionForJsxElement(context.getEmitResolver().getJsxFactoryEntity(), compilerOptions.reactNamespace, tagName, objectProperties, ts.mapDefined(children, transformJsxChildToExpression), node, location); if (isChild) { ts.startOnNewLine(element); } @@ -47767,12 +48104,12 @@ var ts; return getTagName(node.openingElement); } else { - var name = node.tagName; - if (ts.isIdentifier(name) && ts.isIntrinsicJsxName(name.escapedText)) { - return ts.createLiteral(ts.unescapeLeadingUnderscores(name.escapedText)); + var name_47 = node.tagName; + if (ts.isIdentifier(name_47) && ts.isIntrinsicJsxName(name_47.escapedText)) { + return ts.createLiteral(ts.unescapeLeadingUnderscores(name_47.escapedText)); } else { - return ts.createExpressionFromEntityName(name); + return ts.createExpressionFromEntityName(name_47); } } } @@ -48268,7 +48605,7 @@ var ts; function shouldVisitNode(node) { return (node.transformFlags & 128) !== 0 || convertedLoopState !== undefined - || (hierarchyFacts & 4096 && ts.isStatement(node)) + || (hierarchyFacts & 4096 && (ts.isStatement(node) || (node.kind === 207))) || (ts.isIterationStatement(node, false) && shouldConvertIterationStatementBody(node)) || isTypeScriptClassWrapper(node); } @@ -48548,9 +48885,11 @@ var ts; var outer = ts.createPartiallyEmittedExpression(inner); outer.end = ts.skipTrivia(currentText, node.pos); ts.setEmitFlags(outer, 1536); - return ts.createParen(ts.createCall(outer, undefined, extendsClauseElement + var result = ts.createParen(ts.createCall(outer, undefined, extendsClauseElement ? [ts.visitNode(extendsClauseElement.expression, visitor, ts.isExpression)] : [])); + ts.addSyntheticLeadingComment(result, 3, "* @class "); + return result; } function transformClassBody(node, extendsClauseElement) { var statements = []; @@ -48732,15 +49071,15 @@ var ts; } for (var _i = 0, _a = node.parameters; _i < _a.length; _i++) { var parameter = _a[_i]; - var name = parameter.name, initializer = parameter.initializer, dotDotDotToken = parameter.dotDotDotToken; + var name_48 = parameter.name, initializer = parameter.initializer, dotDotDotToken = parameter.dotDotDotToken; if (dotDotDotToken) { continue; } - if (ts.isBindingPattern(name)) { - addDefaultValueAssignmentForBindingPattern(statements, parameter, name, initializer); + if (ts.isBindingPattern(name_48)) { + addDefaultValueAssignmentForBindingPattern(statements, parameter, name_48, initializer); } else if (initializer) { - addDefaultValueAssignmentForInitializer(statements, parameter, name, initializer); + addDefaultValueAssignmentForInitializer(statements, parameter, name_48, initializer); } } } @@ -49135,11 +49474,12 @@ var ts; ts.setTextRange(declarationList, node); ts.setCommentRange(declarationList, node); if (node.transformFlags & 8388608 - && (ts.isBindingPattern(node.declarations[0].name) - || ts.isBindingPattern(ts.lastOrUndefined(node.declarations).name))) { + && (ts.isBindingPattern(node.declarations[0].name) || ts.isBindingPattern(ts.lastOrUndefined(node.declarations).name))) { var firstDeclaration = ts.firstOrUndefined(declarations); - var lastDeclaration = ts.lastOrUndefined(declarations); - ts.setSourceMapRange(declarationList, ts.createRange(firstDeclaration.pos, lastDeclaration.end)); + if (firstDeclaration) { + var lastDeclaration = ts.lastOrUndefined(declarations); + ts.setSourceMapRange(declarationList, ts.createRange(firstDeclaration.pos, lastDeclaration.end)); + } } return declarationList; } @@ -49678,6 +50018,7 @@ var ts; function visitCatchClause(node) { var ancestorFacts = enterSubtree(4032, 0); var updated; + ts.Debug.assert(!!node.variableDeclaration, "Catch clause variable should always be present when downleveling ES2015."); if (ts.isBindingPattern(node.variableDeclaration.name)) { var temp = ts.createTempVariable(undefined); var newVariableDeclaration = ts.createVariableDeclaration(temp); @@ -50712,9 +51053,9 @@ var ts; function transformAndEmitVariableDeclarationList(node) { for (var _i = 0, _a = node.declarations; _i < _a.length; _i++) { var variable = _a[_i]; - var name = ts.getSynthesizedClone(variable.name); - ts.setCommentRange(name, variable.name); - hoistVariableDeclaration(name); + var name_49 = ts.getSynthesizedClone(variable.name); + ts.setCommentRange(name_49, variable.name); + hoistVariableDeclaration(name_49); } var variables = ts.getInitializedVariables(node); var numVariables = variables.length; @@ -50925,8 +51266,12 @@ var ts; } function transformAndEmitContinueStatement(node) { var label = findContinueTarget(node.label ? ts.unescapeLeadingUnderscores(node.label.escapedText) : undefined); - ts.Debug.assert(label > 0, "Expected continue statment to point to a valid Label."); - emitBreak(label, node); + if (label > 0) { + emitBreak(label, node); + } + else { + emitStatement(node); + } } function visitContinueStatement(node) { if (inStatementContainingYield) { @@ -50939,8 +51284,12 @@ var ts; } function transformAndEmitBreakStatement(node) { var label = findBreakTarget(node.label ? ts.unescapeLeadingUnderscores(node.label.escapedText) : undefined); - ts.Debug.assert(label > 0, "Expected break statment to point to a valid Label."); - emitBreak(label, node); + if (label > 0) { + emitBreak(label, node); + } + else { + emitStatement(node); + } } function visitBreakStatement(node) { if (inStatementContainingYield) { @@ -51109,9 +51458,9 @@ var ts; if (ts.isIdentifier(original) && original.parent) { var declaration = resolver.getReferencedValueDeclaration(original); if (declaration) { - var name = renamedCatchVariableDeclarations[ts.getOriginalNodeId(declaration)]; - if (name) { - var clone_6 = ts.getMutableClone(name); + var name_50 = renamedCatchVariableDeclarations[ts.getOriginalNodeId(declaration)]; + if (name_50) { + var clone_6 = ts.getMutableClone(name_50); ts.setSourceMapRange(clone_6, node); ts.setCommentRange(clone_6, node); return clone_6; @@ -51197,9 +51546,6 @@ var ts; var block = endBlock(); markLabel(block.endLabel); } - function isWithBlock(block) { - return block.kind === 1; - } function beginExceptionBlock() { var startLabel = defineLabel(); var endLabel = defineLabel(); @@ -51268,9 +51614,6 @@ var ts; emitNop(); exception.state = 3; } - function isExceptionBlock(block) { - return block.kind === 0; - } function beginScriptLoopBlock() { beginBlock({ kind: 3, @@ -51370,43 +51713,45 @@ var ts; return false; } function findBreakTarget(labelText) { - ts.Debug.assert(blocks !== undefined); - if (labelText) { - for (var i = blockStack.length - 1; i >= 0; i--) { - var block = blockStack[i]; - if (supportsLabeledBreakOrContinue(block) && block.labelText === labelText) { - return block.breakLabel; - } - else if (supportsUnlabeledBreak(block) && hasImmediateContainingLabeledBlock(labelText, i - 1)) { - return block.breakLabel; + if (blockStack) { + if (labelText) { + for (var i = blockStack.length - 1; i >= 0; i--) { + var block = blockStack[i]; + if (supportsLabeledBreakOrContinue(block) && block.labelText === labelText) { + return block.breakLabel; + } + else if (supportsUnlabeledBreak(block) && hasImmediateContainingLabeledBlock(labelText, i - 1)) { + return block.breakLabel; + } } } - } - else { - for (var i = blockStack.length - 1; i >= 0; i--) { - var block = blockStack[i]; - if (supportsUnlabeledBreak(block)) { - return block.breakLabel; + else { + for (var i = blockStack.length - 1; i >= 0; i--) { + var block = blockStack[i]; + if (supportsUnlabeledBreak(block)) { + return block.breakLabel; + } } } } return 0; } function findContinueTarget(labelText) { - ts.Debug.assert(blocks !== undefined); - if (labelText) { - for (var i = blockStack.length - 1; i >= 0; i--) { - var block = blockStack[i]; - if (supportsUnlabeledContinue(block) && hasImmediateContainingLabeledBlock(labelText, i - 1)) { - return block.continueLabel; + if (blockStack) { + if (labelText) { + for (var i = blockStack.length - 1; i >= 0; i--) { + var block = blockStack[i]; + if (supportsUnlabeledContinue(block) && hasImmediateContainingLabeledBlock(labelText, i - 1)) { + return block.continueLabel; + } } } - } - else { - for (var i = blockStack.length - 1; i >= 0; i--) { - var block = blockStack[i]; - if (supportsUnlabeledContinue(block)) { - return block.continueLabel; + else { + for (var i = blockStack.length - 1; i >= 0; i--) { + var block = blockStack[i]; + if (supportsUnlabeledContinue(block)) { + return block.continueLabel; + } } } } @@ -51434,7 +51779,7 @@ var ts; return literal; } function createInlineBreak(label, location) { - ts.Debug.assert(label > 0, "Invalid label: " + label); + ts.Debug.assertLessThan(0, label, "Invalid label"); return ts.setTextRange(ts.createReturn(ts.createArrayLiteral([ createInstruction(3), createLabel(label) @@ -51642,31 +51987,33 @@ var ts; for (; blockIndex < blockActions.length && blockOffsets[blockIndex] <= operationIndex; blockIndex++) { var block = blocks[blockIndex]; var blockAction = blockActions[blockIndex]; - if (isExceptionBlock(block)) { - if (blockAction === 0) { - if (!exceptionBlockStack) { - exceptionBlockStack = []; + switch (block.kind) { + case 0: + if (blockAction === 0) { + if (!exceptionBlockStack) { + exceptionBlockStack = []; + } + if (!statements) { + statements = []; + } + exceptionBlockStack.push(currentExceptionBlock); + currentExceptionBlock = block; } - if (!statements) { - statements = []; + else if (blockAction === 1) { + currentExceptionBlock = exceptionBlockStack.pop(); } - exceptionBlockStack.push(currentExceptionBlock); - currentExceptionBlock = block; - } - else if (blockAction === 1) { - currentExceptionBlock = exceptionBlockStack.pop(); - } - } - else if (isWithBlock(block)) { - if (blockAction === 0) { - if (!withBlockStack) { - withBlockStack = []; + break; + case 1: + if (blockAction === 0) { + if (!withBlockStack) { + withBlockStack = []; + } + withBlockStack.push(block); } - withBlockStack.push(block); - } - else if (blockAction === 1) { - withBlockStack.pop(); - } + else if (blockAction === 1) { + withBlockStack.pop(); + } + break; } } } @@ -52501,8 +52848,8 @@ var ts; return ts.setTextRange(ts.createPropertyAccess(ts.getGeneratedNameForNode(importDeclaration.parent), ts.createIdentifier("default")), node); } else if (ts.isImportSpecifier(importDeclaration)) { - var name = importDeclaration.propertyName || importDeclaration.name; - return ts.setTextRange(ts.createPropertyAccess(ts.getGeneratedNameForNode(importDeclaration.parent.parent.parent), ts.getSynthesizedClone(name)), node); + var name_51 = importDeclaration.propertyName || importDeclaration.name; + return ts.setTextRange(ts.createPropertyAccess(ts.getGeneratedNameForNode(importDeclaration.parent.parent.parent), ts.getSynthesizedClone(name_51)), node); } } } @@ -53976,7 +54323,6 @@ var ts; errorNameNode = declaration.name; var format = 4 | 16384 | - 2048 | (shouldUseResolverType ? 8192 : 0); resolver.writeTypeOfDeclaration(declaration, enclosingDeclaration, format, writer); errorNameNode = undefined; @@ -53990,7 +54336,7 @@ var ts; } else { errorNameNode = signature.name; - resolver.writeReturnTypeOfSignatureDeclaration(signature, enclosingDeclaration, 4 | 2048 | 16384, writer); + resolver.writeReturnTypeOfSignatureDeclaration(signature, enclosingDeclaration, 4 | 16384, writer); errorNameNode = undefined; } } @@ -54205,9 +54551,9 @@ var ts; var count = 0; while (true) { count++; - var name = baseName + "_" + count; - if (!currentIdentifiers.has(name)) { - return name; + var name_52 = baseName + "_" + count; + if (!currentIdentifiers.has(name_52)) { + return name_52; } } } @@ -54220,7 +54566,7 @@ var ts; write(tempVarName); write(": "); writer.getSymbolAccessibilityDiagnostic = function () { return diagnostic; }; - resolver.writeTypeOfExpression(expr, enclosingDeclaration, 4 | 2048 | 16384, writer); + resolver.writeTypeOfExpression(expr, enclosingDeclaration, 4 | 16384, writer); write(";"); writeLine(); return tempVarName; @@ -54857,6 +55203,9 @@ var ts; return ts.forEach(node.declarationList.declarations, function (varDeclaration) { return resolver.isDeclarationVisible(varDeclaration); }); } function writeVariableStatement(node) { + if (ts.every(node.declarationList && node.declarationList.declarations, function (decl) { return decl.name && ts.isEmptyBindingPattern(decl.name); })) { + return; + } emitJsDocComments(node); emitModuleElementDeclarationFlags(node); if (ts.isLet(node.declarationList)) { @@ -55822,14 +56171,14 @@ var ts; writer.writeLine(); } } - function emitTrailingCommentsOfPosition(pos) { + function emitTrailingCommentsOfPosition(pos, prefixSpace) { if (disabled) { return; } if (extendedDiagnostics) { ts.performance.mark("beforeEmitTrailingCommentsOfPosition"); } - forEachTrailingCommentToEmit(pos, emitTrailingCommentOfPosition); + forEachTrailingCommentToEmit(pos, prefixSpace ? emitTrailingComment : emitTrailingCommentOfPosition); if (extendedDiagnostics) { ts.performance.measure("commentTime", "beforeEmitTrailingCommentsOfPosition"); } @@ -55909,15 +56258,7 @@ var ts; emitPos(commentEnd); } function isTripleSlashComment(commentPos, commentEnd) { - if (currentText.charCodeAt(commentPos + 1) === 47 && - commentPos + 2 < commentEnd && - currentText.charCodeAt(commentPos + 2) === 47) { - var textSubStr = currentText.substring(commentPos, commentEnd); - return textSubStr.match(ts.fullTripleSlashReferencePathRegEx) || - textSubStr.match(ts.fullTripleSlashAMDReferencePathRegEx) ? - true : false; - } - return false; + return ts.isRecognizedTripleSlashComment(currentText, commentPos, commentEnd); } } ts.createCommentWriter = createCommentWriter; @@ -56856,7 +57197,9 @@ var ts; if (!(ts.getEmitFlags(node) & 131072)) { var dotRangeStart = node.expression.end; var dotRangeEnd = ts.skipTrivia(currentSourceFile.text, node.expression.end) + 1; - var dotToken = { kind: 23, pos: dotRangeStart, end: dotRangeEnd }; + var dotToken = ts.createToken(23); + dotToken.pos = dotRangeStart; + dotToken.end = dotRangeEnd; indentBeforeDot = needsIndentation(node, node.expression, dotToken); indentAfterDot = needsIndentation(node, dotToken, node.name); } @@ -56968,7 +57311,9 @@ var ts; var indentAfterOperator = needsIndentation(node, node.operatorToken, node.right); emitExpression(node.left); increaseIndentIf(indentBeforeOperator, isCommaOperator ? " " : undefined); + emitLeadingCommentsOfPosition(node.operatorToken.pos); writeTokenNode(node.operatorToken); + emitTrailingCommentsOfPosition(node.operatorToken.end, true); increaseIndentIf(indentAfterOperator, " "); emitExpression(node.right); decreaseIndentIf(indentBeforeOperator, indentAfterOperator); @@ -57155,8 +57500,19 @@ var ts; emitWithPrefix(" ", node.label); write(";"); } + function emitTokenWithComment(token, pos, contextNode) { + var node = contextNode && ts.getParseTreeNode(contextNode); + if (node && node.kind === contextNode.kind) { + pos = ts.skipTrivia(currentSourceFile.text, pos); + } + pos = writeToken(token, pos, contextNode); + if (node && node.kind === contextNode.kind) { + emitTrailingCommentsOfPosition(pos, true); + } + return pos; + } function emitReturnStatement(node) { - writeToken(96, node.pos, node); + emitTokenWithComment(96, node.pos, node); emitExpressionWithPrefix(" ", node.expression); write(";"); } @@ -57597,10 +57953,12 @@ var ts; function emitCatchClause(node) { var openParenPos = writeToken(74, node.pos); write(" "); - writeToken(19, openParenPos); - emit(node.variableDeclaration); - writeToken(20, node.variableDeclaration ? node.variableDeclaration.end : openParenPos); - write(" "); + if (node.variableDeclaration) { + writeToken(19, openParenPos); + emit(node.variableDeclaration); + writeToken(20, node.variableDeclaration.end); + write(" "); + } emit(node.block); } function emitPropertyAssignment(node) { @@ -58154,21 +58512,21 @@ var ts; } function makeTempVariableName(flags) { if (flags && !(tempFlags & flags)) { - var name = flags === 268435456 ? "_i" : "_n"; - if (isUniqueName(name)) { + var name_53 = flags === 268435456 ? "_i" : "_n"; + if (isUniqueName(name_53)) { tempFlags |= flags; - return name; + return name_53; } } while (true) { var count = tempFlags & 268435455; tempFlags++; if (count !== 8 && count !== 13) { - var name = count < 26 + var name_54 = count < 26 ? "_" + String.fromCharCode(97 + count) : "_" + (count - 26); - if (isUniqueName(name)) { - return name; + if (isUniqueName(name_54)) { + return name_54; } } } @@ -58651,13 +59009,13 @@ var ts; var resolutions = []; var cache = ts.createMap(); for (var _i = 0, names_1 = names; _i < names_1.length; _i++) { - var name = names_1[_i]; + var name_55 = names_1[_i]; var result = void 0; - if (cache.has(name)) { - result = cache.get(name); + if (cache.has(name_55)) { + result = cache.get(name_55); } else { - cache.set(name, result = loader(name, containingFile)); + cache.set(name_55, result = loader(name_55, containingFile)); } resolutions.push(result); } @@ -58712,6 +59070,9 @@ var ts; var loader_2 = function (typesRef, containingFile) { return ts.resolveTypeReferenceDirective(typesRef, containingFile, options, host).resolvedTypeReferenceDirective; }; resolveTypeReferenceDirectiveNamesWorker = function (typeReferenceDirectiveNames, containingFile) { return loadWithLocalCache(checkAllDefined(typeReferenceDirectiveNames), containingFile, loader_2); }; } + var packageIdToSourceFile = ts.createMap(); + var sourceFileToPackageName = ts.createMap(); + var redirectTargetsSet = ts.createMap(); var filesByName = ts.createMap(); var filesByNameIgnoreCase = host.useCaseSensitiveFileNames() ? ts.createMap() : undefined; var structuralIsReused = tryReuseStructureFromOldProgram(); @@ -58768,6 +59129,8 @@ var ts; isSourceFileFromExternalLibrary: isSourceFileFromExternalLibrary, dropDiagnosticsProducingTypeChecker: dropDiagnosticsProducingTypeChecker, getSourceFileFromReference: getSourceFileFromReference, + sourceFileToPackageName: sourceFileToPackageName, + redirectTargetsSet: redirectTargetsSet, }; verifyCompilerOptions(); ts.performance.mark("afterProgram"); @@ -58911,17 +59274,51 @@ var ts; var filePaths = []; var modifiedSourceFiles = []; oldProgram.structureIsReused = 2; - for (var _i = 0, _a = oldProgram.getSourceFiles(); _i < _a.length; _i++) { - var oldSourceFile = _a[_i]; + var oldSourceFiles = oldProgram.getSourceFiles(); + var SeenPackageName; + (function (SeenPackageName) { + SeenPackageName[SeenPackageName["Exists"] = 0] = "Exists"; + SeenPackageName[SeenPackageName["Modified"] = 1] = "Modified"; + })(SeenPackageName || (SeenPackageName = {})); + var seenPackageNames = ts.createMap(); + for (var _i = 0, oldSourceFiles_1 = oldSourceFiles; _i < oldSourceFiles_1.length; _i++) { + var oldSourceFile = oldSourceFiles_1[_i]; var newSourceFile = host.getSourceFileByPath ? host.getSourceFileByPath(oldSourceFile.fileName, oldSourceFile.path, options.target) : host.getSourceFile(oldSourceFile.fileName, options.target); if (!newSourceFile) { return oldProgram.structureIsReused = 0; } + ts.Debug.assert(!newSourceFile.redirectInfo, "Host should not return a redirect source file from `getSourceFile`"); + var fileChanged = void 0; + if (oldSourceFile.redirectInfo) { + if (newSourceFile !== oldSourceFile.redirectInfo.unredirected) { + return oldProgram.structureIsReused = 0; + } + fileChanged = false; + newSourceFile = oldSourceFile; + } + else if (oldProgram.redirectTargetsSet.has(oldSourceFile.path)) { + if (newSourceFile !== oldSourceFile) { + return oldProgram.structureIsReused = 0; + } + fileChanged = false; + } + else { + fileChanged = newSourceFile !== oldSourceFile; + } newSourceFile.path = oldSourceFile.path; filePaths.push(newSourceFile.path); - if (oldSourceFile !== newSourceFile) { + var packageName = oldProgram.sourceFileToPackageName.get(oldSourceFile.path); + if (packageName !== undefined) { + var prevKind = seenPackageNames.get(packageName); + var newKind = fileChanged ? 1 : 0; + if ((prevKind !== undefined && newKind === 1) || prevKind === 1) { + return oldProgram.structureIsReused = 0; + } + seenPackageNames.set(packageName, newKind); + } + if (fileChanged) { if (oldSourceFile.hasNoDefaultLib !== newSourceFile.hasNoDefaultLib) { oldProgram.structureIsReused = 1; } @@ -58949,8 +59346,8 @@ var ts; return oldProgram.structureIsReused; } modifiedFilePaths = modifiedSourceFiles.map(function (f) { return f.newFile.path; }); - for (var _b = 0, modifiedSourceFiles_1 = modifiedSourceFiles; _b < modifiedSourceFiles_1.length; _b++) { - var _c = modifiedSourceFiles_1[_b], oldSourceFile = _c.oldFile, newSourceFile = _c.newFile; + for (var _a = 0, modifiedSourceFiles_1 = modifiedSourceFiles; _a < modifiedSourceFiles_1.length; _a++) { + var _b = modifiedSourceFiles_1[_a], oldSourceFile = _b.oldFile, newSourceFile = _b.newFile; var newSourceFilePath = ts.getNormalizedAbsolutePath(newSourceFile.fileName, currentDirectory); if (resolveModuleNamesWorker) { var moduleNames = ts.map(ts.concatenate(newSourceFile.imports, newSourceFile.moduleAugmentations), getTextOfLiteral); @@ -58984,8 +59381,8 @@ var ts; if (oldProgram.getMissingFilePaths().some(function (missingFilePath) { return host.fileExists(missingFilePath); })) { return oldProgram.structureIsReused = 1; } - for (var _d = 0, _e = oldProgram.getMissingFilePaths(); _d < _e.length; _d++) { - var p = _e[_d]; + for (var _c = 0, _d = oldProgram.getMissingFilePaths(); _c < _d.length; _c++) { + var p = _d[_c]; filesByName.set(p, undefined); } for (var i = 0; i < newSourceFiles.length; i++) { @@ -58993,11 +59390,13 @@ var ts; } files = newSourceFiles; fileProcessingDiagnostics = oldProgram.getFileProcessingDiagnostics(); - for (var _f = 0, modifiedSourceFiles_2 = modifiedSourceFiles; _f < modifiedSourceFiles_2.length; _f++) { - var modifiedFile = modifiedSourceFiles_2[_f]; + for (var _e = 0, modifiedSourceFiles_2 = modifiedSourceFiles; _e < modifiedSourceFiles_2.length; _e++) { + var modifiedFile = modifiedSourceFiles_2[_e]; fileProcessingDiagnostics.reattachFileDiagnostics(modifiedFile.newFile); } resolvedTypeReferenceDirectives = oldProgram.getResolvedTypeReferenceDirectives(); + sourceFileToPackageName = oldProgram.sourceFileToPackageName; + redirectTargetsSet = oldProgram.redirectTargetsSet; return oldProgram.structureIsReused = 2; } function getEmitHost(writeFileCallback) { @@ -59476,7 +59875,7 @@ var ts; } } function processSourceFile(fileName, isDefaultLib, refFile, refPos, refEnd) { - getSourceFileFromReferenceWorker(fileName, function (fileName) { return findSourceFile(fileName, toPath(fileName), isDefaultLib, refFile, refPos, refEnd); }, function (diagnostic) { + getSourceFileFromReferenceWorker(fileName, function (fileName) { return findSourceFile(fileName, toPath(fileName), isDefaultLib, refFile, refPos, refEnd, undefined); }, function (diagnostic) { var args = []; for (var _i = 1; _i < arguments.length; _i++) { args[_i - 1] = arguments[_i]; @@ -59493,7 +59892,24 @@ var ts; fileProcessingDiagnostics.add(ts.createCompilerDiagnostic(ts.Diagnostics.File_name_0_differs_from_already_included_file_name_1_only_in_casing, fileName, existingFileName)); } } - function findSourceFile(fileName, path, isDefaultLib, refFile, refPos, refEnd) { + function createRedirectSourceFile(redirectTarget, unredirected, fileName, path) { + var redirect = Object.create(redirectTarget); + redirect.fileName = fileName; + redirect.path = path; + redirect.redirectInfo = { redirectTarget: redirectTarget, unredirected: unredirected }; + Object.defineProperties(redirect, { + id: { + get: function () { return this.redirectInfo.redirectTarget.id; }, + set: function (value) { this.redirectInfo.redirectTarget.id = value; }, + }, + symbol: { + get: function () { return this.redirectInfo.redirectTarget.symbol; }, + set: function (value) { this.redirectInfo.redirectTarget.symbol = value; }, + }, + }); + return redirect; + } + function findSourceFile(fileName, path, isDefaultLib, refFile, refPos, refEnd, packageId) { if (filesByName.has(path)) { var file_1 = filesByName.get(path); if (file_1 && options.forceConsistentCasingInFileNames && ts.getNormalizedAbsolutePath(file_1.fileName, currentDirectory) !== ts.getNormalizedAbsolutePath(fileName, currentDirectory)) { @@ -59524,6 +59940,22 @@ var ts; fileProcessingDiagnostics.add(ts.createCompilerDiagnostic(ts.Diagnostics.Cannot_read_file_0_Colon_1, fileName, hostErrorMessage)); } }); + if (packageId) { + var packageIdKey = packageId.name + "@" + packageId.version; + var fileFromPackageId = packageIdToSourceFile.get(packageIdKey); + if (fileFromPackageId) { + var dupFile = createRedirectSourceFile(fileFromPackageId, file, fileName, path); + redirectTargetsSet.set(fileFromPackageId.path, true); + filesByName.set(path, dupFile); + sourceFileToPackageName.set(path, packageId.name); + files.push(dupFile); + return dupFile; + } + else if (file) { + packageIdToSourceFile.set(packageIdKey, file); + sourceFileToPackageName.set(path, packageId.name); + } + } filesByName.set(path, file); if (file) { sourceFilesFoundSearchingNodeModules.set(path, currentNodeModulesDepth > 0); @@ -59645,7 +60077,7 @@ var ts; else if (shouldAddFile) { var path = toPath(resolvedFileName); var pos = ts.skipTrivia(file.text, file.imports[i].pos); - findSourceFile(resolvedFileName, path, false, file, pos, file.imports[i].end); + findSourceFile(resolvedFileName, path, false, file, pos, file.imports[i].end, resolution.packageId); } if (isFromNodeModulesSearch) { currentNodeModulesDepth--; @@ -60758,7 +61190,9 @@ var ts; } ts.findNextToken = findNextToken; function findPrecedingToken(position, sourceFile, startNode, includeJsDoc) { - return find(startNode || sourceFile); + var result = find(startNode || sourceFile); + ts.Debug.assert(!(result && isWhiteSpaceOnlyJsxText(result))); + return result; function findRightmostToken(n) { if (ts.isToken(n)) { return n; @@ -60774,10 +61208,11 @@ var ts; var children = n.getChildren(); for (var i = 0; i < children.length; i++) { var child = children[i]; - if (position < child.end && (nodeHasTokens(child) || child.kind === 10)) { + if (position < child.end) { var start = child.getStart(sourceFile, includeJsDoc); var lookInPreviousChild = (start >= position) || - (child.kind === 10 && start === child.end); + !nodeHasTokens(child) || + isWhiteSpaceOnlyJsxText(child); if (lookInPreviousChild) { var candidate = findRightmostChildNodeWithTokens(children, i); return candidate && findRightmostToken(candidate); @@ -60795,7 +61230,11 @@ var ts; } function findRightmostChildNodeWithTokens(children, exclusiveStartPosition) { for (var i = exclusiveStartPosition - 1; i >= 0; i--) { - if (nodeHasTokens(children[i])) { + var child = children[i]; + if (isWhiteSpaceOnlyJsxText(child)) { + ts.Debug.assert(i > 0, "`JsxText` tokens should not be the first child of `JsxElement | JsxSelfClosingElement`"); + } + else if (nodeHasTokens(children[i])) { return children[i]; } } @@ -60840,34 +61279,19 @@ var ts; return false; } ts.isInsideJsxElementOrAttribute = isInsideJsxElementOrAttribute; + function isWhiteSpaceOnlyJsxText(node) { + return ts.isJsxText(node) && node.containsOnlyWhiteSpaces; + } + ts.isWhiteSpaceOnlyJsxText = isWhiteSpaceOnlyJsxText; function isInTemplateString(sourceFile, position) { var token = getTokenAtPosition(sourceFile, position, false); return ts.isTemplateLiteralKind(token.kind) && position > token.getStart(sourceFile); } ts.isInTemplateString = isInTemplateString; function isInComment(sourceFile, position, tokenAtPosition, predicate) { - if (tokenAtPosition === void 0) { tokenAtPosition = getTokenAtPosition(sourceFile, position, false); } - return position <= tokenAtPosition.getStart(sourceFile) && - (isInCommentRange(ts.getLeadingCommentRanges(sourceFile.text, tokenAtPosition.pos)) || - isInCommentRange(ts.getTrailingCommentRanges(sourceFile.text, tokenAtPosition.pos))); - function isInCommentRange(commentRanges) { - return ts.forEach(commentRanges, function (c) { return isPositionInCommentRange(c, position, sourceFile.text) && (!predicate || predicate(c)); }); - } + return !!ts.formatting.getRangeOfEnclosingComment(sourceFile, position, false, undefined, tokenAtPosition, predicate); } ts.isInComment = isInComment; - function isPositionInCommentRange(_a, position, text) { - var pos = _a.pos, end = _a.end, kind = _a.kind; - if (pos < position && position < end) { - return true; - } - else if (position === end) { - return kind === 2 || - !(text.charCodeAt(end - 1) === 47 && text.charCodeAt(end - 2) === 42); - } - else { - return false; - } - } function hasDocComment(sourceFile, position) { var token = getTokenAtPosition(sourceFile, position, false); var commentRanges = ts.getLeadingCommentRanges(sourceFile.text, token.pos); @@ -61220,6 +61644,7 @@ var ts; } ts.symbolToDisplayParts = symbolToDisplayParts; function signatureToDisplayParts(typechecker, signature, enclosingDeclaration, flags) { + flags |= 65536; return mapToDisplayParts(function (writer) { typechecker.getSymbolDisplayBuilder().buildSignatureDisplay(signature, writer, enclosingDeclaration, flags); }); @@ -61925,11 +62350,11 @@ var ts; templateStack.pop(); } else { - ts.Debug.assert(token === 15, "Should have been a template middle. Was " + token); + ts.Debug.assertEqual(token, 15, "Should have been a template middle."); } } else { - ts.Debug.assert(lastTemplateStackToken === 17, "Should have been an open brace. Was: " + token); + ts.Debug.assertEqual(lastTemplateStackToken, 17, "Should have been an open brace"); templateStack.pop(); } } @@ -62791,11 +63216,11 @@ var ts; if (currentConfigPath) { paths.push(currentConfigPath); currentDir = ts.getDirectoryPath(currentConfigPath); - var parent = ts.getDirectoryPath(currentDir); - if (currentDir === parent) { + var parent_18 = ts.getDirectoryPath(currentDir); + if (currentDir === parent_18) { break; } - currentDir = parent; + currentDir = parent_18; } else { break; @@ -63102,11 +63527,11 @@ var ts; } } else if (type.flags & 32) { - var name = type.value; - if (!uniques.has(name)) { - uniques.set(name, true); + var name_56 = type.value; + if (!uniques.has(name_56)) { + uniques.set(name_56, true); result.push({ - name: name, + name: name_56, kindModifiers: "", kind: "var", sortText: "0" @@ -63117,10 +63542,10 @@ var ts; function getCompletionEntryDetails(typeChecker, log, compilerOptions, sourceFile, position, entryName) { var completionData = getCompletionData(typeChecker, log, sourceFile, position); if (completionData) { - var symbols = completionData.symbols, location = completionData.location; + var symbols = completionData.symbols, location_3 = completionData.location; var symbol = ts.forEach(symbols, function (s) { return getCompletionEntryDisplayNameForSymbol(s, compilerOptions.target, false) === entryName ? s : undefined; }); if (symbol) { - var _a = ts.SymbolDisplay.getSymbolDisplayPartsDocumentationAndSymbolKind(typeChecker, symbol, sourceFile, location, location, 7), displayParts = _a.displayParts, documentation = _a.documentation, symbolKind = _a.symbolKind, tags = _a.tags; + var _a = ts.SymbolDisplay.getSymbolDisplayPartsDocumentationAndSymbolKind(typeChecker, symbol, sourceFile, location_3, location_3, 7), displayParts = _a.displayParts, documentation = _a.documentation, symbolKind = _a.symbolKind, tags = _a.tags; return { name: entryName, kindModifiers: ts.SymbolDisplay.getSymbolModifiers(symbol), @@ -63217,13 +63642,13 @@ var ts; log("Returning an empty list because completion was requested in an invalid position."); return undefined; } - var parent = contextToken.parent; + var parent_19 = contextToken.parent; if (contextToken.kind === 23) { - if (parent.kind === 179) { + if (parent_19.kind === 179) { node = contextToken.parent.expression; isRightOfDot = true; } - else if (parent.kind === 143) { + else if (parent_19.kind === 143) { node = contextToken.parent.left; isRightOfDot = true; } @@ -63232,11 +63657,11 @@ var ts; } } else if (sourceFile.languageVariant === 1) { - if (parent && parent.kind === 179) { - contextToken = parent; - parent = parent.parent; + if (parent_19 && parent_19.kind === 179) { + contextToken = parent_19; + parent_19 = parent_19.parent; } - switch (parent.kind) { + switch (parent_19.kind) { case 252: if (contextToken.kind === 41) { isStartingCloseTag = true; @@ -63244,7 +63669,7 @@ var ts; } break; case 194: - if (!(parent.left.flags & 32768)) { + if (!(parent_19.left.flags & 32768)) { break; } case 250: @@ -63587,7 +64012,7 @@ var ts; var typeForObject = typeChecker.getTypeAtLocation(objectLikeContainer); if (!typeForObject) return false; - typeMembers = typeChecker.getPropertiesOfType(typeForObject); + typeMembers = typeChecker.getPropertiesOfType(typeForObject).filter(function (symbol) { return !(ts.getDeclarationModifierFlagsFromSymbol(symbol) & 24); }); existingMembers = objectLikeContainer.elements; } } @@ -63657,9 +64082,9 @@ var ts; switch (contextToken.kind) { case 17: case 26: - var parent = contextToken.parent; - if (ts.isObjectLiteralExpression(parent) || ts.isObjectBindingPattern(parent)) { - return parent; + var parent_20 = contextToken.parent; + if (ts.isObjectLiteralExpression(parent_20) || ts.isObjectBindingPattern(parent_20)) { + return parent_20; } break; } @@ -63739,7 +64164,7 @@ var ts; } function tryGetContainingJsxElement(contextToken) { if (contextToken) { - var parent = contextToken.parent; + var parent_21 = contextToken.parent; switch (contextToken.kind) { case 28: case 41: @@ -63748,26 +64173,26 @@ var ts; case 254: case 253: case 255: - if (parent && (parent.kind === 250 || parent.kind === 251)) { - return parent; + if (parent_21 && (parent_21.kind === 250 || parent_21.kind === 251)) { + return parent_21; } - else if (parent.kind === 253) { - return parent.parent.parent; + else if (parent_21.kind === 253) { + return parent_21.parent.parent; } break; case 9: - if (parent && ((parent.kind === 253) || (parent.kind === 255))) { - return parent.parent.parent; + if (parent_21 && ((parent_21.kind === 253) || (parent_21.kind === 255))) { + return parent_21.parent.parent; } break; case 18: - if (parent && - parent.kind === 256 && - parent.parent && parent.parent.kind === 253) { - return parent.parent.parent.parent; + if (parent_21 && + parent_21.kind === 256 && + parent_21.parent && parent_21.parent.kind === 253) { + return parent_21.parent.parent.parent; } - if (parent && parent.kind === 255) { - return parent.parent.parent; + if (parent_21 && parent_21.kind === 255) { + return parent_21.parent.parent; } break; } @@ -63892,8 +64317,8 @@ var ts; if (isCurrentlyEditingNode(element)) { continue; } - var name = element.propertyName || element.name; - existingImportsOrExports.set(name.escapedText, true); + var name_57 = element.propertyName || element.name; + existingImportsOrExports.set(name_57.escapedText, true); } if (existingImportsOrExports.size === 0) { return ts.filter(exportsOfModule, function (e) { return e.escapedName !== "default"; }); @@ -63925,8 +64350,8 @@ var ts; } } else { - var name = ts.getNameOfDeclaration(m); - existingName = ts.getEscapedTextOfIdentifierOrLiteral(name); + var name_58 = ts.getNameOfDeclaration(m); + existingName = ts.getEscapedTextOfIdentifierOrLiteral(name_58); } existingMemberNames.set(existingName, true); } @@ -63964,8 +64389,8 @@ var ts; addPropertySymbols(implementingTypeSymbols, 24); return result; function addPropertySymbols(properties, inValidModifierFlags) { - for (var _i = 0, properties_11 = properties; _i < properties_11.length; _i++) { - var property = properties_11[_i]; + for (var _i = 0, properties_12 = properties; _i < properties_12.length; _i++) { + var property = properties_12[_i]; if (isValidProperty(property, inValidModifierFlags)) { result.push(property); } @@ -64282,17 +64707,17 @@ var ts; function getThrowStatementOwner(throwStatement) { var child = throwStatement; while (child.parent) { - var parent_2 = child.parent; - if (ts.isFunctionBlock(parent_2) || parent_2.kind === 265) { - return parent_2; + var parent_22 = child.parent; + if (ts.isFunctionBlock(parent_22) || parent_22.kind === 265) { + return parent_22; } - if (parent_2.kind === 224) { - var tryStatement = parent_2; + if (parent_22.kind === 224) { + var tryStatement = parent_22; if (tryStatement.tryBlock === child && tryStatement.catchClause) { return child; } } - child = parent_2; + child = parent_22; } return undefined; } @@ -64763,11 +65188,11 @@ var ts; switch (direct.kind) { case 181: if (!isAvailableThroughGlobal) { - var parent = direct.parent; - if (exportKind === 2 && parent.kind === 226) { - var name = parent.name; - if (name.kind === 71) { - directImports.push(name); + var parent_23 = direct.parent; + if (exportKind === 2 && parent_23.kind === 226) { + var name_59 = parent_23.name; + if (name_59.kind === 71) { + directImports.push(name_59); break; } } @@ -64884,10 +65309,10 @@ var ts; searchForNamedImport(namedBindings); } else { - var name = importClause.name; - if (name && (!isForRename || name.escapedText === symbolName(exportSymbol))) { - var defaultImportAlias = checker.getSymbolAtLocation(name); - addSearch(name, defaultImportAlias); + var name_60 = importClause.name; + if (name_60 && (!isForRename || name_60.escapedText === symbolName(exportSymbol))) { + var defaultImportAlias = checker.getSymbolAtLocation(name_60); + addSearch(name_60, defaultImportAlias); } if (!isForRename && exportKind === 1) { ts.Debug.assert(exportName === "default"); @@ -64904,21 +65329,21 @@ var ts; if (namedBindings) { for (var _i = 0, _a = namedBindings.elements; _i < _a.length; _i++) { var element = _a[_i]; - var name = element.name, propertyName = element.propertyName; - if ((propertyName || name).escapedText !== exportName) { + var name_61 = element.name, propertyName = element.propertyName; + if ((propertyName || name_61).escapedText !== exportName) { continue; } if (propertyName) { singleReferences.push(propertyName); if (!isForRename) { - addSearch(name, checker.getSymbolAtLocation(name)); + addSearch(name_61, checker.getSymbolAtLocation(name_61)); } } else { var localSymbol = element.kind === 246 && element.propertyName ? checker.getExportSpecifierLocalTargetSymbol(element) - : checker.getSymbolAtLocation(name); - addSearch(name, localSymbol); + : checker.getSymbolAtLocation(name_61); + addSearch(name_61, localSymbol); } } } @@ -65288,8 +65713,8 @@ var ts; case "symbol": { var symbol = def.symbol, node_2 = def.node; var _a = getDefinitionKindAndDisplayParts(symbol, node_2, checker), displayParts_1 = _a.displayParts, kind_1 = _a.kind; - var name_3 = displayParts_1.map(function (p) { return p.text; }).join(""); - return { node: node_2, name: name_3, kind: kind_1, displayParts: displayParts_1 }; + var name_62 = displayParts_1.map(function (p) { return p.text; }).join(""); + return { node: node_2, name: name_62, kind: kind_1, displayParts: displayParts_1 }; } case "label": { var node_3 = def.node; @@ -65297,8 +65722,8 @@ var ts; } case "keyword": { var node_4 = def.node; - var name_4 = ts.tokenToString(node_4.kind); - return { node: node_4, name: name_4, kind: "keyword", displayParts: [{ text: name_4, kind: "keyword" }] }; + var name_63 = ts.tokenToString(node_4.kind); + return { node: node_4, name: name_63, kind: "keyword", displayParts: [{ text: name_63, kind: "keyword" }] }; } case "this": { var node_5 = def.node; @@ -65655,11 +66080,15 @@ var ts; } function getPropertySymbolOfObjectBindingPatternWithoutPropertyName(symbol, checker) { var bindingElement = getObjectBindingElementWithoutPropertyName(symbol); - if (bindingElement) { - var typeOfPattern = checker.getTypeAtLocation(bindingElement.parent); - return typeOfPattern && checker.getPropertyOfType(typeOfPattern, bindingElement.name.text); + if (!bindingElement) + return undefined; + var typeOfPattern = checker.getTypeAtLocation(bindingElement.parent); + var propSymbol = typeOfPattern && checker.getPropertyOfType(typeOfPattern, bindingElement.name.text); + if (propSymbol && propSymbol.flags & 98304) { + ts.Debug.assert(!!(propSymbol.flags & 33554432)); + return propSymbol.target; } - return undefined; + return propSymbol; } function getSymbolScope(symbol) { var declarations = symbol.declarations, flags = symbol.flags, parent = symbol.parent, valueDeclaration = symbol.valueDeclaration; @@ -65679,12 +66108,13 @@ var ts; if (getObjectBindingElementWithoutPropertyName(symbol)) { return undefined; } - if (parent && !((parent.flags & 1536) && ts.isExternalModuleSymbol(parent) && !parent.globalExports)) { + var exposedByParent = parent && !(symbol.flags & 262144); + if (exposedByParent && !((parent.flags & 1536) && ts.isExternalModuleSymbol(parent) && !parent.globalExports)) { return undefined; } var scope; - for (var _i = 0, declarations_10 = declarations; _i < declarations_10.length; _i++) { - var declaration = declarations_10[_i]; + for (var _i = 0, declarations_9 = declarations; _i < declarations_9.length; _i++) { + var declaration = declarations_9[_i]; var container = ts.getContainerNode(declaration); if (scope && scope !== container) { return undefined; @@ -65694,7 +66124,7 @@ var ts; } scope = container; } - return parent ? scope.getSourceFile() : scope; + return exposedByParent ? scope.getSourceFile() : scope; } function getPossibleSymbolReferencePositions(sourceFile, symbolName, container) { if (container === void 0) { container = sourceFile; } @@ -65970,12 +66400,12 @@ var ts; } var containingTypeReference = getContainingTypeReference(refNode); if (containingTypeReference && state.markSeenContainingTypeReference(containingTypeReference)) { - var parent = containingTypeReference.parent; - if (ts.isVariableLike(parent) && parent.type === containingTypeReference && parent.initializer && isImplementationExpression(parent.initializer)) { - addReference(parent.initializer); + var parent_24 = containingTypeReference.parent; + if (ts.isVariableLike(parent_24) && parent_24.type === containingTypeReference && parent_24.initializer && isImplementationExpression(parent_24.initializer)) { + addReference(parent_24.initializer); } - else if (ts.isFunctionLike(parent) && parent.type === containingTypeReference && parent.body) { - var body = parent.body; + else if (ts.isFunctionLike(parent_24) && parent_24.type === containingTypeReference && parent_24.body) { + var body = parent_24.body; if (body.kind === 207) { ts.forEachReturnStatement(body, function (returnStatement) { if (returnStatement.expression && isImplementationExpression(returnStatement.expression)) { @@ -65987,8 +66417,8 @@ var ts; addReference(body); } } - else if (ts.isAssertionExpression(parent) && isImplementationExpression(parent.expression)) { - addReference(parent.expression); + else if (ts.isAssertionExpression(parent_24) && isImplementationExpression(parent_24.expression)) { + addReference(parent_24.expression); } } } @@ -66371,8 +66801,8 @@ var ts; var lastIterationMeaning = void 0; do { lastIterationMeaning = meaning; - for (var _i = 0, declarations_11 = declarations; _i < declarations_11.length; _i++) { - var declaration = declarations_11[_i]; + for (var _i = 0, declarations_10 = declarations; _i < declarations_10.length; _i++) { + var declaration = declarations_10[_i]; var declarationMeaning = ts.getMeaningFromDeclaration(declaration); if (declarationMeaning & meaning) { meaning |= declarationMeaning; @@ -66517,6 +66947,16 @@ var ts; var shorthandContainerName_1 = typeChecker.symbolToString(symbol.parent, node); return ts.map(shorthandDeclarations, function (declaration) { return createDefinitionInfo(declaration, shorthandSymbolKind_1, shorthandSymbolName_1, shorthandContainerName_1); }); } + if (ts.isPropertyName(node) && ts.isBindingElement(node.parent) && ts.isObjectBindingPattern(node.parent.parent) && + (node === (node.parent.propertyName || node.parent.name))) { + var type = typeChecker.getTypeAtLocation(node.parent.parent); + if (type) { + var propSymbols = ts.getPropertySymbolsFromType(type, node); + if (propSymbols) { + return ts.flatMap(propSymbols, function (propSymbol) { return getDefinitionFromSymbol(typeChecker, propSymbol, node); }); + } + } + } var element = ts.getContainingObjectLiteralElement(node); if (element && typeChecker.getContextualType(element.parent)) { return ts.flatMap(ts.getPropertySymbolsFromContextualType(typeChecker, element), function (propertySymbol) { @@ -66933,12 +67373,20 @@ var ts; "crypto", "stream", "util", "assert", "tty", "domain", "constants", "process", "v8", "timers", "console" ]; - var nodeCoreModules = ts.arrayToMap(JsTyping.nodeCoreModuleList, function (x) { return x; }); + var nodeCoreModules = ts.arrayToSet(JsTyping.nodeCoreModuleList); function loadSafeList(host, safeListPath) { var result = ts.readConfigFile(safeListPath, function (path) { return host.readFile(path); }); return ts.createMapFromTemplate(result.config); } JsTyping.loadSafeList = loadSafeList; + function loadTypesMap(host, typesMapPath) { + var result = ts.readConfigFile(typesMapPath, function (path) { return host.readFile(path); }); + if (result.config) { + return ts.createMapFromTemplate(result.config.simpleMap); + } + return undefined; + } + JsTyping.loadTypesMap = loadTypesMap; function discoverTypings(host, log, fileNames, projectRootPath, safeList, packageNameToTypingLocation, typeAcquisition, unresolvedImports) { if (!typeAcquisition || !typeAcquisition.enable) { return { cachedTypingPaths: [], newTypingNames: [], filesToWatch: [] }; @@ -67093,8 +67541,8 @@ var ts; if (!matches) { return; } - for (var _i = 0, declarations_12 = declarations; _i < declarations_12.length; _i++) { - var declaration = declarations_12[_i]; + for (var _i = 0, declarations_11 = declarations; _i < declarations_11.length; _i++) { + var declaration = declarations_11[_i]; if (patternMatcher.patternContainsDots) { var containers = getContainers(declaration); if (!containers) { @@ -67145,14 +67593,14 @@ var ts; } function tryAddSingleDeclarationName(declaration, containers) { if (declaration) { - var name = ts.getNameOfDeclaration(declaration); - if (name) { - var text = ts.getTextOfIdentifierOrLiteral(name); + var name_64 = ts.getNameOfDeclaration(declaration); + if (name_64) { + var text = ts.getTextOfIdentifierOrLiteral(name_64); if (text !== undefined) { containers.unshift(text); } - else if (name.kind === 144) { - return tryAddComputedPropertyName(name.expression, containers, true); + else if (name_64.kind === 144) { + return tryAddComputedPropertyName(name_64.expression, containers, true); } else { return false; @@ -67378,9 +67826,9 @@ var ts; case 176: case 226: var decl = node; - var name = decl.name; - if (ts.isBindingPattern(name)) { - addChildrenRecursively(name); + var name_65 = decl.name; + if (ts.isBindingPattern(name_65)) { + addChildrenRecursively(name_65); } else if (decl.initializer && isFunctionOrClassExpression(decl.initializer)) { addChildrenRecursively(decl.initializer); @@ -67753,13 +68201,17 @@ var ts; (function (ts) { var OutliningElementsCollector; (function (OutliningElementsCollector) { + var collapseText = "..."; + var maxDepth = 20; function collectElements(sourceFile, cancellationToken) { var elements = []; - var collapseText = "..."; - function addOutliningSpan(hintSpanNode, startElement, endElement, autoCollapse) { + var depth = 0; + walk(sourceFile); + return elements; + function addOutliningSpan(hintSpanNode, startElement, endElement, autoCollapse, useFullStart) { if (hintSpanNode && startElement && endElement) { var span_13 = { - textSpan: ts.createTextSpanFromBounds(startElement.pos, endElement.end), + textSpan: ts.createTextSpanFromBounds(useFullStart ? startElement.getFullStart() : startElement.getStart(), endElement.getEnd()), hintSpan: ts.createTextSpanFromNode(hintSpanNode, sourceFile), bannerText: collapseText, autoCollapse: autoCollapse, @@ -67820,8 +68272,6 @@ var ts; function autoCollapse(node) { return ts.isFunctionBlock(node) && node.parent.kind !== 187; } - var depth = 0; - var maxDepth = 20; function walk(n) { cancellationToken.throwIfCancellationRequested(); if (depth > maxDepth) { @@ -67833,30 +68283,30 @@ var ts; switch (n.kind) { case 207: if (!ts.isFunctionBlock(n)) { - var parent = n.parent; - var openBrace = ts.findChildOfKind(n, 17, sourceFile); - var closeBrace = ts.findChildOfKind(n, 18, sourceFile); - if (parent.kind === 212 || - parent.kind === 215 || - parent.kind === 216 || - parent.kind === 214 || - parent.kind === 211 || - parent.kind === 213 || - parent.kind === 220 || - parent.kind === 260) { - addOutliningSpan(parent, openBrace, closeBrace, autoCollapse(n)); + var parent_25 = n.parent; + var openBrace_1 = ts.findChildOfKind(n, 17, sourceFile); + var closeBrace_1 = ts.findChildOfKind(n, 18, sourceFile); + if (parent_25.kind === 212 || + parent_25.kind === 215 || + parent_25.kind === 216 || + parent_25.kind === 214 || + parent_25.kind === 211 || + parent_25.kind === 213 || + parent_25.kind === 220 || + parent_25.kind === 260) { + addOutliningSpan(parent_25, openBrace_1, closeBrace_1, autoCollapse(n), true); break; } - if (parent.kind === 224) { - var tryStatement = parent; + if (parent_25.kind === 224) { + var tryStatement = parent_25; if (tryStatement.tryBlock === n) { - addOutliningSpan(parent, openBrace, closeBrace, autoCollapse(n)); + addOutliningSpan(parent_25, openBrace_1, closeBrace_1, autoCollapse(n), true); break; } else if (tryStatement.finallyBlock === n) { var finallyKeyword = ts.findChildOfKind(tryStatement, 87, sourceFile); if (finallyKeyword) { - addOutliningSpan(finallyKeyword, openBrace, closeBrace, autoCollapse(n)); + addOutliningSpan(finallyKeyword, openBrace_1, closeBrace_1, autoCollapse(n), true); break; } } @@ -67871,33 +68321,35 @@ var ts; break; } case 234: { - var openBrace = ts.findChildOfKind(n, 17, sourceFile); - var closeBrace = ts.findChildOfKind(n, 18, sourceFile); - addOutliningSpan(n.parent, openBrace, closeBrace, autoCollapse(n)); + var openBrace_2 = ts.findChildOfKind(n, 17, sourceFile); + var closeBrace_2 = ts.findChildOfKind(n, 18, sourceFile); + addOutliningSpan(n.parent, openBrace_2, closeBrace_2, autoCollapse(n), true); break; } case 229: case 230: case 232: - case 178: case 235: { + var openBrace_3 = ts.findChildOfKind(n, 17, sourceFile); + var closeBrace_3 = ts.findChildOfKind(n, 18, sourceFile); + addOutliningSpan(n, openBrace_3, closeBrace_3, autoCollapse(n), true); + break; + } + case 178: var openBrace = ts.findChildOfKind(n, 17, sourceFile); var closeBrace = ts.findChildOfKind(n, 18, sourceFile); - addOutliningSpan(n, openBrace, closeBrace, autoCollapse(n)); + addOutliningSpan(n, openBrace, closeBrace, autoCollapse(n), !ts.isArrayLiteralExpression(n.parent)); break; - } case 177: var openBracket = ts.findChildOfKind(n, 21, sourceFile); var closeBracket = ts.findChildOfKind(n, 22, sourceFile); - addOutliningSpan(n, openBracket, closeBracket, autoCollapse(n)); + addOutliningSpan(n, openBracket, closeBracket, autoCollapse(n), !ts.isArrayLiteralExpression(n.parent)); break; } depth++; ts.forEachChild(n, walk); depth--; } - walk(sourceFile); - return elements; } OutliningElementsCollector.collectElements = collectElements; })(OutliningElementsCollector = ts.OutliningElementsCollector || (ts.OutliningElementsCollector = {})); @@ -68741,8 +69193,8 @@ var ts; var nameToDeclarations = sourceFile.getNamedDeclarations(); var declarations = nameToDeclarations.get(name.text); if (declarations) { - for (var _b = 0, declarations_13 = declarations; _b < declarations_13.length; _b++) { - var declaration = declarations_13[_b]; + for (var _b = 0, declarations_12 = declarations; _b < declarations_12.length; _b++) { + var declaration = declarations_12[_b]; var symbol = declaration.symbol; if (symbol) { var type = typeChecker.getTypeOfSymbolAtLocation(symbol, declaration); @@ -68775,7 +69227,9 @@ var ts; } var kind = invocation.typeArguments && invocation.typeArguments.pos === list.pos ? 0 : 1; var argumentCount = getArgumentCount(list); - ts.Debug.assert(argumentIndex === 0 || argumentIndex < argumentCount, "argumentCount < argumentIndex, " + argumentCount + " < " + argumentIndex); + if (argumentIndex !== 0) { + ts.Debug.assertLessThan(argumentIndex, argumentCount); + } var argumentsSpan = getApplicableSpanForArguments(list, sourceFile); return { kind: kind, invocation: invocation, argumentsSpan: argumentsSpan, argumentIndex: argumentIndex, argumentCount: argumentCount }; } @@ -68853,7 +69307,9 @@ var ts; var argumentCount = tagExpression.template.kind === 13 ? 1 : tagExpression.template.templateSpans.length + 1; - ts.Debug.assert(argumentIndex === 0 || argumentIndex < argumentCount, "argumentCount < argumentIndex, " + argumentCount + " < " + argumentIndex); + if (argumentIndex !== 0) { + ts.Debug.assertLessThan(argumentIndex, argumentCount); + } return { kind: 2, invocation: tagExpression, @@ -68950,7 +69406,9 @@ var ts; tags: candidateSignature.getJsDocTags() }; }); - ts.Debug.assert(argumentIndex === 0 || argumentIndex < argumentCount, "argumentCount < argumentIndex, " + argumentCount + " < " + argumentIndex); + if (argumentIndex !== 0) { + ts.Debug.assertLessThan(argumentIndex, argumentCount); + } var selectedItemIndex = candidates.indexOf(resolvedSignature); ts.Debug.assert(selectedItemIndex !== -1); return { items: items, applicableSpan: applicableSpan, selectedItemIndex: selectedItemIndex, argumentIndex: argumentIndex, argumentCount: argumentCount }; @@ -69091,102 +69549,100 @@ var ts; } var signature = void 0; type = isThisExpression ? typeChecker.getTypeAtLocation(location) : typeChecker.getTypeOfSymbolAtLocation(symbol.exportSymbol || symbol, location); - if (type) { - if (location.parent && location.parent.kind === 179) { - var right = location.parent.name; - if (right === location || (right && right.getFullWidth() === 0)) { - location = location.parent; - } - } - var callExpressionLike = void 0; - if (ts.isCallOrNewExpression(location)) { - callExpressionLike = location; + if (location.parent && location.parent.kind === 179) { + var right = location.parent.name; + if (right === location || (right && right.getFullWidth() === 0)) { + location = location.parent; } - else if (ts.isCallExpressionTarget(location) || ts.isNewExpressionTarget(location)) { - callExpressionLike = location.parent; + } + var callExpressionLike = void 0; + if (ts.isCallOrNewExpression(location)) { + callExpressionLike = location; + } + else if (ts.isCallExpressionTarget(location) || ts.isNewExpressionTarget(location)) { + callExpressionLike = location.parent; + } + else if (location.parent && ts.isJsxOpeningLikeElement(location.parent) && ts.isFunctionLike(symbol.valueDeclaration)) { + callExpressionLike = location.parent; + } + if (callExpressionLike) { + var candidateSignatures = []; + signature = typeChecker.getResolvedSignature(callExpressionLike, candidateSignatures); + if (!signature && candidateSignatures.length) { + signature = candidateSignatures[0]; } - else if (location.parent && ts.isJsxOpeningLikeElement(location.parent) && ts.isFunctionLike(symbol.valueDeclaration)) { - callExpressionLike = location.parent; + var useConstructSignatures = callExpressionLike.kind === 182 || (ts.isCallExpression(callExpressionLike) && callExpressionLike.expression.kind === 97); + var allSignatures = useConstructSignatures ? type.getConstructSignatures() : type.getCallSignatures(); + if (!ts.contains(allSignatures, signature.target) && !ts.contains(allSignatures, signature)) { + signature = allSignatures.length ? allSignatures[0] : undefined; } - if (callExpressionLike) { - var candidateSignatures = []; - signature = typeChecker.getResolvedSignature(callExpressionLike, candidateSignatures); - if (!signature && candidateSignatures.length) { - signature = candidateSignatures[0]; - } - var useConstructSignatures = callExpressionLike.kind === 182 || (ts.isCallExpression(callExpressionLike) && callExpressionLike.expression.kind === 97); - var allSignatures = useConstructSignatures ? type.getConstructSignatures() : type.getCallSignatures(); - if (!ts.contains(allSignatures, signature.target) && !ts.contains(allSignatures, signature)) { - signature = allSignatures.length ? allSignatures[0] : undefined; + if (signature) { + if (useConstructSignatures && (symbolFlags & 32)) { + symbolKind = "constructor"; + addPrefixForAnyFunctionOrVar(type.symbol, symbolKind); } - if (signature) { - if (useConstructSignatures && (symbolFlags & 32)) { - symbolKind = "constructor"; - addPrefixForAnyFunctionOrVar(type.symbol, symbolKind); + else if (symbolFlags & 2097152) { + symbolKind = "alias"; + pushTypePart(symbolKind); + displayParts.push(ts.spacePart()); + if (useConstructSignatures) { + displayParts.push(ts.keywordPart(94)); + displayParts.push(ts.spacePart()); } - else if (symbolFlags & 2097152) { - symbolKind = "alias"; - pushTypePart(symbolKind); + addFullSymbolName(symbol); + } + else { + addPrefixForAnyFunctionOrVar(symbol, symbolKind); + } + switch (symbolKind) { + case "JSX attribute": + case "property": + case "var": + case "const": + case "let": + case "parameter": + case "local var": + displayParts.push(ts.punctuationPart(56)); displayParts.push(ts.spacePart()); if (useConstructSignatures) { displayParts.push(ts.keywordPart(94)); displayParts.push(ts.spacePart()); } - addFullSymbolName(symbol); - } - else { - addPrefixForAnyFunctionOrVar(symbol, symbolKind); - } - switch (symbolKind) { - case "JSX attribute": - case "property": - case "var": - case "const": - case "let": - case "parameter": - case "local var": - displayParts.push(ts.punctuationPart(56)); - displayParts.push(ts.spacePart()); - if (useConstructSignatures) { - displayParts.push(ts.keywordPart(94)); - displayParts.push(ts.spacePart()); - } - if (!(type.flags & 32768 && type.objectFlags & 16) && type.symbol) { - ts.addRange(displayParts, ts.symbolToDisplayParts(typeChecker, type.symbol, enclosingDeclaration, undefined, 1)); - } - addSignatureDisplayParts(signature, allSignatures, 16); - break; - default: - addSignatureDisplayParts(signature, allSignatures); - } - hasAddedSymbolInfo = true; + if (!(type.flags & 32768 && type.objectFlags & 16) && type.symbol) { + ts.addRange(displayParts, ts.symbolToDisplayParts(typeChecker, type.symbol, enclosingDeclaration, undefined, 1)); + } + addSignatureDisplayParts(signature, allSignatures, 16); + break; + default: + addSignatureDisplayParts(signature, allSignatures); } + hasAddedSymbolInfo = true; } - else if ((ts.isNameOfFunctionDeclaration(location) && !(symbolFlags & 98304)) || - (location.kind === 123 && location.parent.kind === 152)) { - var functionDeclaration_1 = location.parent; - var locationIsSymbolDeclaration = ts.findDeclaration(symbol, function (declaration) { - return declaration === (location.kind === 123 ? functionDeclaration_1.parent : functionDeclaration_1); - }); - if (locationIsSymbolDeclaration) { - var allSignatures = functionDeclaration_1.kind === 152 ? type.getNonNullableType().getConstructSignatures() : type.getNonNullableType().getCallSignatures(); - if (!typeChecker.isImplementationOfOverload(functionDeclaration_1)) { - signature = typeChecker.getSignatureFromDeclaration(functionDeclaration_1); - } - else { - signature = allSignatures[0]; - } - if (functionDeclaration_1.kind === 152) { - symbolKind = "constructor"; - addPrefixForAnyFunctionOrVar(type.symbol, symbolKind); - } - else { - addPrefixForAnyFunctionOrVar(functionDeclaration_1.kind === 155 && - !(type.symbol.flags & 2048 || type.symbol.flags & 4096) ? type.symbol : symbol, symbolKind); - } - addSignatureDisplayParts(signature, allSignatures); - hasAddedSymbolInfo = true; + } + else if ((ts.isNameOfFunctionDeclaration(location) && !(symbolFlags & 98304)) || + (location.kind === 123 && location.parent.kind === 152)) { + var functionDeclaration_1 = location.parent; + var locationIsSymbolDeclaration = ts.find(symbol.declarations, function (declaration) { + return declaration === (location.kind === 123 ? functionDeclaration_1.parent : functionDeclaration_1); + }); + if (locationIsSymbolDeclaration) { + var allSignatures = functionDeclaration_1.kind === 152 ? type.getNonNullableType().getConstructSignatures() : type.getNonNullableType().getCallSignatures(); + if (!typeChecker.isImplementationOfOverload(functionDeclaration_1)) { + signature = typeChecker.getSignatureFromDeclaration(functionDeclaration_1); + } + else { + signature = allSignatures[0]; + } + if (functionDeclaration_1.kind === 152) { + symbolKind = "constructor"; + addPrefixForAnyFunctionOrVar(type.symbol, symbolKind); } + else { + addPrefixForAnyFunctionOrVar(functionDeclaration_1.kind === 155 && + !(type.symbol.flags & 2048 || type.symbol.flags & 4096) ? type.symbol : symbol, symbolKind); + } + addSignatureDisplayParts(signature, allSignatures); + hasAddedSymbolInfo = true; } } } @@ -69361,7 +69817,9 @@ var ts; symbolFlags & 98304 || symbolKind === "method") { var allSignatures = type.getNonNullableType().getCallSignatures(); - addSignatureDisplayParts(allSignatures[0], allSignatures); + if (allSignatures.length) { + addSignatureDisplayParts(allSignatures[0], allSignatures); + } } } } @@ -69464,8 +69922,8 @@ var ts; if (declaration.kind !== 226 && declaration.kind !== 228) { return false; } - for (var parent = declaration.parent; !ts.isFunctionBlock(parent); parent = parent.parent) { - if (parent.kind === 265 || parent.kind === 234) { + for (var parent_26 = declaration.parent; !ts.isFunctionBlock(parent_26); parent_26 = parent_26.parent) { + if (parent_26.kind === 265 || parent_26.kind === 234) { return false; } } @@ -69509,11 +69967,11 @@ var ts; getSourceFile: function (fileName) { return fileName === ts.normalizePath(inputFileName) ? sourceFile : undefined; }, writeFile: function (name, text) { if (ts.fileExtensionIs(name, ".map")) { - ts.Debug.assert(sourceMapText === undefined, "Unexpected multiple source map outputs for the file '" + name + "'"); + ts.Debug.assertEqual(sourceMapText, undefined, "Unexpected multiple source map outputs, file:", name); sourceMapText = text; } else { - ts.Debug.assert(outputText === undefined, "Unexpected multiple outputs for the file: '" + name + "'"); + ts.Debug.assertEqual(outputText, undefined, "Unexpected multiple outputs, file:", name); outputText = text; } }, @@ -70132,6 +70590,7 @@ var ts; this.NoSpaceAfterSemicolonInFor = new formatting.Rule(formatting.RuleDescriptor.create3(25, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsOptionDisabledOrUndefined("insertSpaceAfterSemicolonInForStatements"), Rules.IsNonJsxSameLineTokenContext, Rules.IsForContext), 8)); this.SpaceAfterOpenParen = new formatting.Rule(formatting.RuleDescriptor.create3(19, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsOptionEnabled("insertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis"), Rules.IsNonJsxSameLineTokenContext), 2)); this.SpaceBeforeCloseParen = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 20), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsOptionEnabled("insertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis"), Rules.IsNonJsxSameLineTokenContext), 2)); + this.SpaceBetweenOpenParens = new formatting.Rule(formatting.RuleDescriptor.create1(19, 19), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsOptionEnabled("insertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis"), Rules.IsNonJsxSameLineTokenContext), 2)); this.NoSpaceBetweenParens = new formatting.Rule(formatting.RuleDescriptor.create1(19, 20), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 8)); this.NoSpaceAfterOpenParen = new formatting.Rule(formatting.RuleDescriptor.create3(19, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsOptionDisabledOrUndefined("insertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis"), Rules.IsNonJsxSameLineTokenContext), 8)); this.NoSpaceBeforeCloseParen = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 20), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsOptionDisabledOrUndefined("insertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis"), Rules.IsNonJsxSameLineTokenContext), 8)); @@ -70203,7 +70662,7 @@ var ts; this.SpaceAfterComma, this.NoSpaceAfterComma, this.SpaceAfterAnonymousFunctionKeyword, this.NoSpaceAfterAnonymousFunctionKeyword, this.SpaceAfterKeywordInControl, this.NoSpaceAfterKeywordInControl, - this.SpaceAfterOpenParen, this.SpaceBeforeCloseParen, this.NoSpaceBetweenParens, this.NoSpaceAfterOpenParen, this.NoSpaceBeforeCloseParen, + this.SpaceAfterOpenParen, this.SpaceBeforeCloseParen, this.SpaceBetweenOpenParens, this.NoSpaceBetweenParens, this.NoSpaceAfterOpenParen, this.NoSpaceBeforeCloseParen, this.SpaceAfterOpenBracket, this.SpaceBeforeCloseBracket, this.NoSpaceBetweenBrackets, this.NoSpaceAfterOpenBracket, this.NoSpaceBeforeCloseBracket, this.SpaceAfterOpenBrace, this.SpaceBeforeCloseBrace, this.NoSpaceBetweenEmptyBraceBrackets, this.NoSpaceAfterOpenBrace, this.NoSpaceBeforeCloseBrace, this.SpaceAfterTemplateHeadAndMiddle, this.SpaceBeforeTemplateMiddleAndTail, this.NoSpaceAfterTemplateHeadAndMiddle, this.NoSpaceBeforeTemplateMiddleAndTail, @@ -70227,9 +70686,9 @@ var ts; } Rules.prototype.getRuleName = function (rule) { var o = this; - for (var name in o) { - if (o[name] === rule) { - return name; + for (var name_66 in o) { + if (o[name_66] === rule) { + return name_66; } } throw new Error("Unknown rule"); @@ -71003,7 +71462,6 @@ var ts; } function formatSpanWorker(originalRange, enclosingNode, initialIndentation, delta, formattingScanner, options, rulesProvider, requestKind, rangeContainsError, sourceFile) { var formattingContext = new formatting.FormattingContext(sourceFile, requestKind, options); - var previousRangeHasError; var previousRange; var previousParent; var previousRangeStartLine; @@ -71339,7 +71797,7 @@ var ts; function processRange(range, rangeStart, parent, contextNode, dynamicIndentation) { var rangeHasError = rangeContainsError(range); var lineAdded; - if (!rangeHasError && !previousRangeHasError) { + if (!rangeHasError) { if (!previousRange) { var originalStart = sourceFile.getLineAndCharacterOfPosition(originalRange.pos); trimTrailingWhitespacesForLines(originalStart.line, rangeStart.line); @@ -71352,7 +71810,6 @@ var ts; previousRange = range; previousParent = parent; previousRangeStartLine = rangeStart.line; - previousRangeHasError = rangeHasError; return lineAdded; } function processPair(currentItem, currentStartLine, currentParent, previousItem, previousStartLine, previousParent, contextNode, dynamicIndentation) { @@ -71531,6 +71988,32 @@ var ts; } } } + function getRangeOfEnclosingComment(sourceFile, position, onlyMultiLine, precedingToken, tokenAtPosition, predicate) { + if (tokenAtPosition === void 0) { tokenAtPosition = ts.getTokenAtPosition(sourceFile, position, false); } + var tokenStart = tokenAtPosition.getStart(sourceFile); + if (tokenStart <= position && position < tokenAtPosition.getEnd()) { + return undefined; + } + if (precedingToken === undefined) { + precedingToken = ts.findPrecedingToken(position, sourceFile); + } + var trailingRangesOfPreviousToken = precedingToken && ts.getTrailingCommentRanges(sourceFile.text, precedingToken.end); + var leadingCommentRangesOfNextToken = ts.getLeadingCommentRangesOfNode(tokenAtPosition, sourceFile); + var commentRanges = trailingRangesOfPreviousToken && leadingCommentRangesOfNextToken ? + trailingRangesOfPreviousToken.concat(leadingCommentRangesOfNextToken) : + trailingRangesOfPreviousToken || leadingCommentRangesOfNextToken; + if (commentRanges) { + for (var _i = 0, commentRanges_1 = commentRanges; _i < commentRanges_1.length; _i++) { + var range = commentRanges_1[_i]; + if ((range.pos < position && position < range.end || + position === range.end && (range.kind === 2 || position === sourceFile.getFullWidth()))) { + return (range.kind === 3 || !onlyMultiLine) && (!predicate || predicate(range)) ? range : undefined; + } + } + } + return undefined; + } + formatting.getRangeOfEnclosingComment = getRangeOfEnclosingComment; function getOpenTokenForList(node, list) { switch (node.kind) { case 152: @@ -71641,11 +72124,27 @@ var ts; return 0; } var precedingToken = ts.findPrecedingToken(position, sourceFile); + var enclosingCommentRange = formatting.getRangeOfEnclosingComment(sourceFile, position, true, precedingToken || null); + if (enclosingCommentRange) { + var previousLine = ts.getLineAndCharacterOfPosition(sourceFile, position).line - 1; + var commentStartLine = ts.getLineAndCharacterOfPosition(sourceFile, enclosingCommentRange.pos).line; + ts.Debug.assert(commentStartLine >= 0); + if (previousLine <= commentStartLine) { + return findFirstNonWhitespaceColumn(ts.getStartPositionOfLine(commentStartLine, sourceFile), position, sourceFile, options); + } + var startPostionOfLine = ts.getStartPositionOfLine(previousLine, sourceFile); + var _a = findFirstNonWhitespaceCharacterAndColumn(startPostionOfLine, position, sourceFile, options), column = _a.column, character = _a.character; + if (column === 0) { + return column; + } + var firstNonWhitespaceCharacterCode = sourceFile.text.charCodeAt(startPostionOfLine + character); + return firstNonWhitespaceCharacterCode === 42 ? column - 1 : column; + } if (!precedingToken) { return getBaseIndentation(options); } var precedingTokenIsLiteral = ts.isStringOrRegularExpressionOrTemplateLiteral(precedingToken.kind); - if (precedingTokenIsLiteral && precedingToken.getStart(sourceFile) <= position && precedingToken.end > position) { + if (precedingTokenIsLiteral && precedingToken.getStart(sourceFile) <= position && position < precedingToken.end) { return 0; } var lineAtPosition = sourceFile.getLineAndCharacterOfPosition(position).line; @@ -72050,6 +72549,12 @@ var ts; } return false; } + var ChangeKind; + (function (ChangeKind) { + ChangeKind[ChangeKind["Remove"] = 0] = "Remove"; + ChangeKind[ChangeKind["ReplaceWithSingleNode"] = 1] = "ReplaceWithSingleNode"; + ChangeKind[ChangeKind["ReplaceWithMultipleNodes"] = 2] = "ReplaceWithMultipleNodes"; + })(ChangeKind || (ChangeKind = {})); function getSeparatorCharacter(separator) { return ts.tokenToString(separator.kind); } @@ -72074,7 +72579,7 @@ var ts; } textChanges.getAdjustedStartPosition = getAdjustedStartPosition; function getAdjustedEndPosition(sourceFile, node, options) { - if (options.useNonAdjustedEndPosition) { + if (options.useNonAdjustedEndPosition || ts.isExpression(node)) { return node.getEnd(); } var end = node.getEnd(); @@ -72094,6 +72599,9 @@ var ts; } return s; } + function getNewlineKind(context) { + return context.newLineCharacter === "\n" ? 1 : 0; + } var ChangeTracker = (function () { function ChangeTracker(newLine, rulesProvider, validator) { this.newLine = newLine; @@ -72103,24 +72611,24 @@ var ts; this.newLineCharacter = ts.getNewLineCharacter({ newLine: newLine }); } ChangeTracker.fromCodeFixContext = function (context) { - return new ChangeTracker(context.newLineCharacter === "\n" ? 1 : 0, context.rulesProvider); + return new ChangeTracker(getNewlineKind(context), context.rulesProvider); + }; + ChangeTracker.prototype.deleteRange = function (sourceFile, range) { + this.changes.push({ kind: ChangeKind.Remove, sourceFile: sourceFile, range: range }); + return this; }; ChangeTracker.prototype.deleteNode = function (sourceFile, node, options) { if (options === void 0) { options = {}; } var startPosition = getAdjustedStartPosition(sourceFile, node, options, Position.FullStart); var endPosition = getAdjustedEndPosition(sourceFile, node, options); - this.changes.push({ sourceFile: sourceFile, options: options, range: { pos: startPosition, end: endPosition } }); - return this; - }; - ChangeTracker.prototype.deleteRange = function (sourceFile, range) { - this.changes.push({ sourceFile: sourceFile, range: range }); + this.changes.push({ kind: ChangeKind.Remove, sourceFile: sourceFile, range: { pos: startPosition, end: endPosition } }); return this; }; ChangeTracker.prototype.deleteNodeRange = function (sourceFile, startNode, endNode, options) { if (options === void 0) { options = {}; } var startPosition = getAdjustedStartPosition(sourceFile, startNode, options, Position.FullStart); var endPosition = getAdjustedEndPosition(sourceFile, endNode, options); - this.changes.push({ sourceFile: sourceFile, options: options, range: { pos: startPosition, end: endPosition } }); + this.changes.push({ kind: ChangeKind.Remove, sourceFile: sourceFile, range: { pos: startPosition, end: endPosition } }); return this; }; ChangeTracker.prototype.deleteNodeInList = function (sourceFile, node) { @@ -72156,33 +72664,68 @@ var ts; }; ChangeTracker.prototype.replaceRange = function (sourceFile, range, newNode, options) { if (options === void 0) { options = {}; } - this.changes.push({ sourceFile: sourceFile, range: range, options: options, node: newNode }); + this.changes.push({ kind: ChangeKind.ReplaceWithSingleNode, sourceFile: sourceFile, range: range, options: options, node: newNode }); return this; }; ChangeTracker.prototype.replaceNode = function (sourceFile, oldNode, newNode, options) { if (options === void 0) { options = {}; } var startPosition = getAdjustedStartPosition(sourceFile, oldNode, options, Position.Start); var endPosition = getAdjustedEndPosition(sourceFile, oldNode, options); - this.changes.push({ sourceFile: sourceFile, options: options, useIndentationFromFile: true, node: newNode, range: { pos: startPosition, end: endPosition } }); - return this; + return this.replaceWithSingle(sourceFile, startPosition, endPosition, newNode, options); }; ChangeTracker.prototype.replaceNodeRange = function (sourceFile, startNode, endNode, newNode, options) { if (options === void 0) { options = {}; } var startPosition = getAdjustedStartPosition(sourceFile, startNode, options, Position.Start); var endPosition = getAdjustedEndPosition(sourceFile, endNode, options); - this.changes.push({ sourceFile: sourceFile, options: options, useIndentationFromFile: true, node: newNode, range: { pos: startPosition, end: endPosition } }); + return this.replaceWithSingle(sourceFile, startPosition, endPosition, newNode, options); + }; + ChangeTracker.prototype.replaceWithSingle = function (sourceFile, startPosition, endPosition, newNode, options) { + this.changes.push({ + kind: ChangeKind.ReplaceWithSingleNode, + sourceFile: sourceFile, + options: options, + node: newNode, + range: { pos: startPosition, end: endPosition } + }); return this; }; + ChangeTracker.prototype.replaceWithMultiple = function (sourceFile, startPosition, endPosition, newNodes, options) { + this.changes.push({ + kind: ChangeKind.ReplaceWithMultipleNodes, + sourceFile: sourceFile, + options: options, + nodes: newNodes, + range: { pos: startPosition, end: endPosition } + }); + return this; + }; + ChangeTracker.prototype.replaceNodeWithNodes = function (sourceFile, oldNode, newNodes, options) { + var startPosition = getAdjustedStartPosition(sourceFile, oldNode, options, Position.Start); + var endPosition = getAdjustedEndPosition(sourceFile, oldNode, options); + return this.replaceWithMultiple(sourceFile, startPosition, endPosition, newNodes, options); + }; + ChangeTracker.prototype.replaceNodesWithNodes = function (sourceFile, oldNodes, newNodes, options) { + var startPosition = getAdjustedStartPosition(sourceFile, oldNodes[0], options, Position.Start); + var endPosition = getAdjustedEndPosition(sourceFile, ts.lastOrUndefined(oldNodes), options); + return this.replaceWithMultiple(sourceFile, startPosition, endPosition, newNodes, options); + }; + ChangeTracker.prototype.replaceRangeWithNodes = function (sourceFile, range, newNodes, options) { + return this.replaceWithMultiple(sourceFile, range.pos, range.end, newNodes, options); + }; + ChangeTracker.prototype.replaceNodeRangeWithNodes = function (sourceFile, startNode, endNode, newNodes, options) { + var startPosition = getAdjustedStartPosition(sourceFile, startNode, options, Position.Start); + var endPosition = getAdjustedEndPosition(sourceFile, endNode, options); + return this.replaceWithMultiple(sourceFile, startPosition, endPosition, newNodes, options); + }; ChangeTracker.prototype.insertNodeAt = function (sourceFile, pos, newNode, options) { if (options === void 0) { options = {}; } - this.changes.push({ sourceFile: sourceFile, options: options, node: newNode, range: { pos: pos, end: pos } }); + this.changes.push({ kind: ChangeKind.ReplaceWithSingleNode, sourceFile: sourceFile, options: options, node: newNode, range: { pos: pos, end: pos } }); return this; }; ChangeTracker.prototype.insertNodeBefore = function (sourceFile, before, newNode, options) { if (options === void 0) { options = {}; } var startPosition = getAdjustedStartPosition(sourceFile, before, options, Position.Start); - this.changes.push({ sourceFile: sourceFile, options: options, useIndentationFromFile: true, node: newNode, range: { pos: startPosition, end: startPosition } }); - return this; + return this.replaceWithSingle(sourceFile, startPosition, startPosition, newNode, options); }; ChangeTracker.prototype.insertNodeAfter = function (sourceFile, after, newNode, options) { if (options === void 0) { options = {}; } @@ -72192,6 +72735,7 @@ var ts; after.kind === 150) { if (sourceFile.text.charCodeAt(after.end - 1) !== 59) { this.changes.push({ + kind: ChangeKind.ReplaceWithSingleNode, sourceFile: sourceFile, options: {}, range: { pos: after.end, end: after.end }, @@ -72200,8 +72744,7 @@ var ts; } } var endPosition = getAdjustedEndPosition(sourceFile, after, options); - this.changes.push({ sourceFile: sourceFile, options: options, useIndentationFromFile: true, node: newNode, range: { pos: endPosition, end: endPosition } }); - return this; + return this.replaceWithSingle(sourceFile, endPosition, endPosition, newNode, options); }; ChangeTracker.prototype.insertNodeInListAfter = function (sourceFile, after, newNode) { var containingList = ts.formatting.SmartIndenter.getContainingList(after, sourceFile); @@ -72229,10 +72772,10 @@ var ts; startPos = ts.getStartPositionOfLine(lineAndCharOfNextElement.line, sourceFile); } this.changes.push({ + kind: ChangeKind.ReplaceWithSingleNode, sourceFile: sourceFile, range: { pos: startPos, end: containingList[index + 1].getStart(sourceFile) }, node: newNode, - useIndentationFromFile: true, options: { prefix: prefix, suffix: "" + ts.tokenToString(nextToken.kind) + sourceFile.text.substring(nextToken.end, containingList[index + 1].getStart(sourceFile)) @@ -72259,6 +72802,7 @@ var ts; } if (multilineList) { this.changes.push({ + kind: ChangeKind.ReplaceWithSingleNode, sourceFile: sourceFile, range: { pos: end, end: end }, node: ts.createToken(separator), @@ -72270,6 +72814,7 @@ var ts; insertPos--; } this.changes.push({ + kind: ChangeKind.ReplaceWithSingleNode, sourceFile: sourceFile, range: { pos: insertPos, end: insertPos }, node: newNode, @@ -72278,6 +72823,7 @@ var ts; } else { this.changes.push({ + kind: ChangeKind.ReplaceWithSingleNode, sourceFile: sourceFile, range: { pos: end, end: end }, node: newNode, @@ -72317,30 +72863,43 @@ var ts; return ts.createTextSpanFromBounds(change.range.pos, change.range.end); }; ChangeTracker.prototype.computeNewText = function (change, sourceFile) { - if (!change.node) { + var _this = this; + if (change.kind === ChangeKind.Remove) { return ""; } var options = change.options || {}; - var nonFormattedText = getNonformattedText(change.node, sourceFile, this.newLine); + var text; + var pos = change.range.pos; + var posStartsLine = ts.getLineStartPositionForPosition(pos, sourceFile) === pos; + if (change.kind === ChangeKind.ReplaceWithMultipleNodes) { + var parts = change.nodes.map(function (n) { return _this.getFormattedTextOfNode(n, sourceFile, pos, options); }); + text = parts.join(change.options.nodeSeparator); + } + else { + ts.Debug.assert(change.kind === ChangeKind.ReplaceWithSingleNode, "change.kind === ReplaceWithSingleNode"); + text = this.getFormattedTextOfNode(change.node, sourceFile, pos, options); + } + text = (posStartsLine || options.indentation !== undefined) ? text : text.replace(/^\s+/, ""); + return (options.prefix || "") + text + (options.suffix || ""); + }; + ChangeTracker.prototype.getFormattedTextOfNode = function (node, sourceFile, pos, options) { + var nonformattedText = getNonformattedText(node, sourceFile, this.newLine); if (this.validator) { - this.validator(nonFormattedText); + this.validator(nonformattedText); } var formatOptions = this.rulesProvider.getFormatOptions(); - var pos = change.range.pos; var posStartsLine = ts.getLineStartPositionForPosition(pos, sourceFile) === pos; - var initialIndentation = change.options.indentation !== undefined - ? change.options.indentation - : change.useIndentationFromFile - ? ts.formatting.SmartIndenter.getIndentation(change.range.pos, sourceFile, formatOptions, posStartsLine || (change.options.prefix === this.newLineCharacter)) + var initialIndentation = options.indentation !== undefined + ? options.indentation + : (options.useIndentationFromFile !== false) + ? ts.formatting.SmartIndenter.getIndentation(pos, sourceFile, formatOptions, posStartsLine || (options.prefix === this.newLineCharacter)) : 0; - var delta = change.options.delta !== undefined - ? change.options.delta - : ts.formatting.SmartIndenter.shouldIndentChildNode(change.node) - ? formatOptions.indentSize + var delta = options.delta !== undefined + ? options.delta + : ts.formatting.SmartIndenter.shouldIndentChildNode(node) + ? (formatOptions.indentSize || 0) : 0; - var text = applyFormatting(nonFormattedText, sourceFile, initialIndentation, delta, this.rulesProvider); - text = posStartsLine || change.options.indentation !== undefined ? text : text.replace(/^\s+/, ""); - return (options.prefix || "") + text + (options.suffix || ""); + return applyFormatting(nonformattedText, sourceFile, initialIndentation, delta, this.rulesProvider); }; ChangeTracker.normalize = function (changes) { var normalized = ts.stableSort(changes, function (a, b) { return a.range.pos - b.range.pos; }); @@ -73319,7 +73878,7 @@ var ts; symbolName = name; } else if (ts.isJsxOpeningLikeElement(token.parent) && token.parent.tagName === token) { - symbol = checker.getAliasedSymbol(checker.resolveNameAtLocation(token, checker.getJsxNamespace(), 107455)); + symbol = checker.getAliasedSymbol(checker.resolveName(checker.getJsxNamespace(), token.parent.tagName, 107455)); symbolName = symbol.name; } else { @@ -73403,8 +73962,8 @@ var ts; var namespaceImportDeclaration; var namedImportDeclaration; var existingModuleSpecifier; - for (var _i = 0, declarations_14 = declarations; _i < declarations_14.length; _i++) { - var declaration = declarations_14[_i]; + for (var _i = 0, declarations_13 = declarations; _i < declarations_13.length; _i++) { + var declaration = declarations_13[_i]; if (declaration.kind === 238) { var namedBindings = declaration.importClause && declaration.importClause.namedBindings; if (namedBindings && namedBindings.kind === 240) { @@ -73478,14 +74037,53 @@ var ts; : isNamespaceImport ? ts.createImportClause(undefined, ts.createNamespaceImport(ts.createIdentifier(symbolName))) : ts.createImportClause(undefined, ts.createNamedImports([ts.createImportSpecifier(undefined, ts.createIdentifier(symbolName))])); - var importDecl = ts.createImportDeclaration(undefined, undefined, importClause, ts.createLiteral(moduleSpecifierWithoutQuotes)); + var moduleSpecifierLiteral = ts.createLiteral(moduleSpecifierWithoutQuotes); + moduleSpecifierLiteral.singleQuote = getSingleQuoteStyleFromExistingImports(); + var importDecl = ts.createImportDeclaration(undefined, undefined, importClause, moduleSpecifierLiteral); if (!lastImportDeclaration) { - changeTracker.insertNodeAt(sourceFile, sourceFile.getStart(), importDecl, { suffix: "" + context.newLineCharacter + context.newLineCharacter }); + changeTracker.insertNodeAt(sourceFile, getSourceFileImportLocation(sourceFile), importDecl, { suffix: "" + context.newLineCharacter + context.newLineCharacter }); } else { changeTracker.insertNodeAfter(sourceFile, lastImportDeclaration, importDecl, { suffix: context.newLineCharacter }); } return createCodeAction(ts.Diagnostics.Import_0_from_1, [symbolName, "\"" + moduleSpecifierWithoutQuotes + "\""], changeTracker.getChanges(), "NewImport", moduleSpecifierWithoutQuotes); + function getSourceFileImportLocation(node) { + var text = node.text; + var ranges = ts.getLeadingCommentRanges(text, 0); + if (!ranges) + return 0; + var position = 0; + if (ranges.length && ranges[0].kind === 3 && ts.isPinnedComment(text, ranges[0])) { + position = ranges[0].end + 1; + ranges = ranges.slice(1); + } + for (var _i = 0, ranges_1 = ranges; _i < ranges_1.length; _i++) { + var range = ranges_1[_i]; + if (range.kind === 2 && ts.isRecognizedTripleSlashComment(node.text, range.pos, range.end)) { + position = range.end + 1; + continue; + } + break; + } + return position; + } + function getSingleQuoteStyleFromExistingImports() { + var firstModuleSpecifier = ts.forEach(sourceFile.statements, function (node) { + if (ts.isImportDeclaration(node) || ts.isExportDeclaration(node)) { + if (node.moduleSpecifier && ts.isStringLiteral(node.moduleSpecifier)) { + return node.moduleSpecifier; + } + } + else if (ts.isImportEqualsDeclaration(node)) { + if (ts.isExternalModuleReference(node.moduleReference) && ts.isStringLiteral(node.moduleReference.expression)) { + return node.moduleReference.expression; + } + } + }); + if (firstModuleSpecifier) { + return sourceFile.text.charCodeAt(firstModuleSpecifier.getStart()) === 39; + } + } function getModuleSpecifierForNewImport() { var fileName = sourceFile.fileName; var moduleFileName = moduleSymbol.valueDeclaration.getSourceFile().fileName; @@ -73615,7 +74213,8 @@ var ts; (function (States) { States[States["BeforeNodeModules"] = 0] = "BeforeNodeModules"; States[States["NodeModules"] = 1] = "NodeModules"; - States[States["PackageContent"] = 2] = "PackageContent"; + States[States["Scope"] = 2] = "Scope"; + States[States["PackageContent"] = 3] = "PackageContent"; })(States || (States = {})); var partStart = 0; var partEnd = 0; @@ -73632,15 +74231,21 @@ var ts; } break; case 1: - packageRootIndex = partEnd; - state = 2; - break; case 2: + if (state === 1 && fullPath.charAt(partStart + 1) === "@") { + state = 2; + } + else { + packageRootIndex = partEnd; + state = 3; + } + break; + case 3: if (fullPath.indexOf("/node_modules/", partStart) === partStart) { state = 1; } else { - state = 2; + state = 3; } break; } @@ -73867,8 +74472,8 @@ var ts; if (includeTypeScriptSyntax) { var typeArgCount = ts.length(callExpression.typeArguments); for (var i = 0; i < typeArgCount; i++) { - var name = typeArgCount < 8 ? String.fromCharCode(84 + i) : "T" + i; - var typeParameter = ts.createTypeParameterDeclaration(name, undefined, undefined); + var name_67 = typeArgCount < 8 ? String.fromCharCode(84 + i) : "T" + i; + var typeParameter = ts.createTypeParameterDeclaration(name_67, undefined, undefined); (typeParameters ? typeParameters : typeParameters = []).push(typeParameter); } } @@ -73930,206 +74535,1029 @@ var ts; (function (ts) { var refactor; (function (refactor) { - var actionName = "convert"; - var convertFunctionToES6Class = { - name: "Convert to ES2015 class", - description: ts.Diagnostics.Convert_function_to_an_ES2015_class.message, - getEditsForAction: getEditsForAction, - getAvailableActions: getAvailableActions - }; - refactor.registerRefactor(convertFunctionToES6Class); - function getAvailableActions(context) { - if (!ts.isInJavaScriptFile(context.file)) { - return undefined; - } - var start = context.startPosition; - var node = ts.getTokenAtPosition(context.file, start, false); - var checker = context.program.getTypeChecker(); - var symbol = checker.getSymbolAtLocation(node); - if (symbol && ts.isDeclarationOfFunctionOrClassExpression(symbol)) { - symbol = symbol.valueDeclaration.initializer.symbol; + var convertFunctionToES6Class; + (function (convertFunctionToES6Class_1) { + var actionName = "convert"; + var convertFunctionToES6Class = { + name: "Convert to ES2015 class", + description: ts.Diagnostics.Convert_function_to_an_ES2015_class.message, + getEditsForAction: getEditsForAction, + getAvailableActions: getAvailableActions + }; + refactor.registerRefactor(convertFunctionToES6Class); + function getAvailableActions(context) { + if (!ts.isInJavaScriptFile(context.file)) { + return undefined; + } + var start = context.startPosition; + var node = ts.getTokenAtPosition(context.file, start, false); + var checker = context.program.getTypeChecker(); + var symbol = checker.getSymbolAtLocation(node); + if (symbol && ts.isDeclarationOfFunctionOrClassExpression(symbol)) { + symbol = symbol.valueDeclaration.initializer.symbol; + } + if (symbol && (symbol.flags & 16) && symbol.members && (symbol.members.size > 0)) { + return [ + { + name: convertFunctionToES6Class.name, + description: convertFunctionToES6Class.description, + actions: [ + { + description: convertFunctionToES6Class.description, + name: actionName + } + ] + } + ]; + } } - if (symbol && (symbol.flags & 16) && symbol.members && (symbol.members.size > 0)) { - return [ - { - name: convertFunctionToES6Class.name, - description: convertFunctionToES6Class.description, - actions: [ - { - description: convertFunctionToES6Class.description, - name: actionName + function getEditsForAction(context, action) { + if (actionName !== action) { + return undefined; + } + var start = context.startPosition; + var sourceFile = context.file; + var checker = context.program.getTypeChecker(); + var token = ts.getTokenAtPosition(sourceFile, start, false); + var ctorSymbol = checker.getSymbolAtLocation(token); + var newLine = context.rulesProvider.getFormatOptions().newLineCharacter; + var deletedNodes = []; + var deletes = []; + if (!(ctorSymbol.flags & (16 | 3))) { + return undefined; + } + var ctorDeclaration = ctorSymbol.valueDeclaration; + var changeTracker = ts.textChanges.ChangeTracker.fromCodeFixContext(context); + var precedingNode; + var newClassDeclaration; + switch (ctorDeclaration.kind) { + case 228: + precedingNode = ctorDeclaration; + deleteNode(ctorDeclaration); + newClassDeclaration = createClassFromFunctionDeclaration(ctorDeclaration); + break; + case 226: + precedingNode = ctorDeclaration.parent.parent; + if (ctorDeclaration.parent.declarations.length === 1) { + deleteNode(precedingNode); + } + else { + deleteNode(ctorDeclaration, true); + } + newClassDeclaration = createClassFromVariableDeclaration(ctorDeclaration); + break; + } + if (!newClassDeclaration) { + return undefined; + } + changeTracker.insertNodeAfter(sourceFile, precedingNode, newClassDeclaration, { suffix: newLine }); + for (var _i = 0, deletes_1 = deletes; _i < deletes_1.length; _i++) { + var deleteCallback = deletes_1[_i]; + deleteCallback(); + } + return { + edits: changeTracker.getChanges() + }; + function deleteNode(node, inList) { + if (inList === void 0) { inList = false; } + if (deletedNodes.some(function (n) { return ts.isNodeDescendantOf(node, n); })) { + return; + } + deletedNodes.push(node); + if (inList) { + deletes.push(function () { return changeTracker.deleteNodeInList(sourceFile, node); }); + } + else { + deletes.push(function () { return changeTracker.deleteNode(sourceFile, node); }); + } + } + function createClassElementsFromSymbol(symbol) { + var memberElements = []; + if (symbol.members) { + symbol.members.forEach(function (member) { + var memberElement = createClassElement(member, undefined); + if (memberElement) { + memberElements.push(memberElement); } - ] + }); } - ]; - } - } - function getEditsForAction(context, action) { - if (actionName !== action) { - return undefined; + if (symbol.exports) { + symbol.exports.forEach(function (member) { + var memberElement = createClassElement(member, [ts.createToken(115)]); + if (memberElement) { + memberElements.push(memberElement); + } + }); + } + return memberElements; + function shouldConvertDeclaration(_target, source) { + return ts.isFunctionLike(source); + } + function createClassElement(symbol, modifiers) { + if (!(symbol.flags & 4)) { + return; + } + var memberDeclaration = symbol.valueDeclaration; + var assignmentBinaryExpression = memberDeclaration.parent; + if (!shouldConvertDeclaration(memberDeclaration, assignmentBinaryExpression.right)) { + return; + } + var nodeToDelete = assignmentBinaryExpression.parent && assignmentBinaryExpression.parent.kind === 210 + ? assignmentBinaryExpression.parent : assignmentBinaryExpression; + deleteNode(nodeToDelete); + if (!assignmentBinaryExpression.right) { + return ts.createProperty([], modifiers, symbol.name, undefined, undefined, undefined); + } + switch (assignmentBinaryExpression.right.kind) { + case 186: { + var functionExpression = assignmentBinaryExpression.right; + var method = ts.createMethod(undefined, modifiers, undefined, memberDeclaration.name, undefined, undefined, functionExpression.parameters, undefined, functionExpression.body); + copyComments(assignmentBinaryExpression, method); + return method; + } + case 187: { + var arrowFunction = assignmentBinaryExpression.right; + var arrowFunctionBody = arrowFunction.body; + var bodyBlock = void 0; + if (arrowFunctionBody.kind === 207) { + bodyBlock = arrowFunctionBody; + } + else { + var expression = arrowFunctionBody; + bodyBlock = ts.createBlock([ts.createReturn(expression)]); + } + var method = ts.createMethod(undefined, modifiers, undefined, memberDeclaration.name, undefined, undefined, arrowFunction.parameters, undefined, bodyBlock); + copyComments(assignmentBinaryExpression, method); + return method; + } + default: { + if (ts.isSourceFileJavaScript(sourceFile)) { + return; + } + var prop = ts.createProperty(undefined, modifiers, memberDeclaration.name, undefined, undefined, assignmentBinaryExpression.right); + copyComments(assignmentBinaryExpression.parent, prop); + return prop; + } + } + } + } + function copyComments(sourceNode, targetNode) { + ts.forEachLeadingCommentRange(sourceFile.text, sourceNode.pos, function (pos, end, kind, htnl) { + if (kind === 3) { + pos += 2; + end -= 2; + } + else { + pos += 2; + } + ts.addSyntheticLeadingComment(targetNode, kind, sourceFile.text.slice(pos, end), htnl); + }); + } + function createClassFromVariableDeclaration(node) { + var initializer = node.initializer; + if (!initializer || initializer.kind !== 186) { + return undefined; + } + if (node.name.kind !== 71) { + return undefined; + } + var memberElements = createClassElementsFromSymbol(initializer.symbol); + if (initializer.body) { + memberElements.unshift(ts.createConstructor(undefined, undefined, initializer.parameters, initializer.body)); + } + var cls = ts.createClassDeclaration(undefined, undefined, node.name, undefined, undefined, memberElements); + return cls; + } + function createClassFromFunctionDeclaration(node) { + var memberElements = createClassElementsFromSymbol(ctorSymbol); + if (node.body) { + memberElements.unshift(ts.createConstructor(undefined, undefined, node.parameters, node.body)); + } + var cls = ts.createClassDeclaration(undefined, undefined, node.name, undefined, undefined, memberElements); + return cls; + } } - var start = context.startPosition; - var sourceFile = context.file; - var checker = context.program.getTypeChecker(); - var token = ts.getTokenAtPosition(sourceFile, start, false); - var ctorSymbol = checker.getSymbolAtLocation(token); - var newLine = context.rulesProvider.getFormatOptions().newLineCharacter; - var deletedNodes = []; - var deletes = []; - if (!(ctorSymbol.flags & (16 | 3))) { - return undefined; + })(convertFunctionToES6Class = refactor.convertFunctionToES6Class || (refactor.convertFunctionToES6Class = {})); + })(refactor = ts.refactor || (ts.refactor = {})); +})(ts || (ts = {})); +var ts; +(function (ts) { + var refactor; + (function (refactor) { + var extractMethod; + (function (extractMethod_1) { + var extractMethod = { + name: "Extract Method", + description: ts.Diagnostics.Extract_function.message, + getAvailableActions: getAvailableActions, + getEditsForAction: getEditsForAction, + }; + refactor.registerRefactor(extractMethod); + function getAvailableActions(context) { + var rangeToExtract = getRangeToExtract(context.file, { start: context.startPosition, length: context.endPosition - context.startPosition }); + var targetRange = rangeToExtract.targetRange; + if (targetRange === undefined) { + return undefined; + } + var extractions = getPossibleExtractions(targetRange, context); + if (extractions === undefined) { + return undefined; + } + var actions = []; + var usedNames = ts.createMap(); + var i = 0; + for (var _i = 0, extractions_1 = extractions; _i < extractions_1.length; _i++) { + var extr = extractions_1[_i]; + if (extr.errors && extr.errors.length) { + continue; + } + var description = ts.formatStringFromArgs(ts.Diagnostics.Extract_function_into_0.message, [extr.scopeDescription]); + if (!usedNames.has(description)) { + usedNames.set(description, true); + actions.push({ + description: description, + name: "scope_" + i + }); + } + i++; + } + if (actions.length === 0) { + return undefined; + } + return [{ + name: extractMethod.name, + description: extractMethod.description, + inlineable: true, + actions: actions + }]; } - var ctorDeclaration = ctorSymbol.valueDeclaration; - var changeTracker = ts.textChanges.ChangeTracker.fromCodeFixContext(context); - var precedingNode; - var newClassDeclaration; - switch (ctorDeclaration.kind) { - case 228: - precedingNode = ctorDeclaration; - deleteNode(ctorDeclaration); - newClassDeclaration = createClassFromFunctionDeclaration(ctorDeclaration); - break; - case 226: - precedingNode = ctorDeclaration.parent.parent; - if (ctorDeclaration.parent.declarations.length === 1) { - deleteNode(precedingNode); + function getEditsForAction(context, actionName) { + var length = context.endPosition === undefined ? 0 : context.endPosition - context.startPosition; + var rangeToExtract = getRangeToExtract(context.file, { start: context.startPosition, length: length }); + var targetRange = rangeToExtract.targetRange; + var parsedIndexMatch = /^scope_(\d+)$/.exec(actionName); + ts.Debug.assert(!!parsedIndexMatch, "Scope name should have matched the regexp"); + var index = +parsedIndexMatch[1]; + ts.Debug.assert(isFinite(index), "Expected to parse a finite number from the scope index"); + var extractions = getPossibleExtractions(targetRange, context, index); + ts.Debug.assert(extractions !== undefined, "The extraction went missing? How?"); + return ({ edits: extractions[0].changes }); + } + var Messages; + (function (Messages) { + function createMessage(message) { + return { message: message, code: 0, category: ts.DiagnosticCategory.Message, key: message }; + } + Messages.CannotExtractFunction = createMessage("Cannot extract function."); + Messages.StatementOrExpressionExpected = createMessage("Statement or expression expected."); + Messages.CannotExtractRangeContainingConditionalBreakOrContinueStatements = createMessage("Cannot extract range containing conditional break or continue statements."); + Messages.CannotExtractRangeContainingConditionalReturnStatement = createMessage("Cannot extract range containing conditional return statement."); + Messages.CannotExtractRangeContainingLabeledBreakOrContinueStatementWithTargetOutsideOfTheRange = createMessage("Cannot extract range containing labeled break or continue with target outside of the range."); + Messages.CannotExtractRangeThatContainsWritesToReferencesLocatedOutsideOfTheTargetRangeInGenerators = createMessage("Cannot extract range containing writes to references located outside of the target range in generators."); + Messages.TypeWillNotBeVisibleInTheNewScope = createMessage("Type will not visible in the new scope."); + Messages.FunctionWillNotBeVisibleInTheNewScope = createMessage("Function will not visible in the new scope."); + Messages.InsufficientSelection = createMessage("Select more than a single identifier."); + Messages.CannotExtractExportedEntity = createMessage("Cannot extract exported declaration"); + Messages.CannotCombineWritesAndReturns = createMessage("Cannot combine writes and returns"); + Messages.CannotExtractReadonlyPropertyInitializerOutsideConstructor = createMessage("Cannot move initialization of read-only class property outside of the constructor"); + Messages.CannotExtractAmbientBlock = createMessage("Cannot extract code from ambient contexts"); + })(Messages || (Messages = {})); + var RangeFacts; + (function (RangeFacts) { + RangeFacts[RangeFacts["None"] = 0] = "None"; + RangeFacts[RangeFacts["HasReturn"] = 1] = "HasReturn"; + RangeFacts[RangeFacts["IsGenerator"] = 2] = "IsGenerator"; + RangeFacts[RangeFacts["IsAsyncFunction"] = 4] = "IsAsyncFunction"; + RangeFacts[RangeFacts["UsesThis"] = 8] = "UsesThis"; + RangeFacts[RangeFacts["InStaticRegion"] = 16] = "InStaticRegion"; + })(RangeFacts = extractMethod_1.RangeFacts || (extractMethod_1.RangeFacts = {})); + function getRangeToExtract(sourceFile, span) { + var length = span.length || 0; + var start = getParentNodeInSpan(ts.getTokenAtPosition(sourceFile, span.start, false), sourceFile, span); + var end = getParentNodeInSpan(ts.findTokenOnLeftOfPosition(sourceFile, ts.textSpanEnd(span)), sourceFile, span); + var declarations = []; + var rangeFacts = RangeFacts.None; + if (!start || !end) { + return { errors: [ts.createFileDiagnostic(sourceFile, span.start, length, Messages.CannotExtractFunction)] }; + } + if (start.parent !== end.parent) { + var startParent = ts.skipParentheses(start.parent); + var endParent = ts.skipParentheses(end.parent); + if (ts.isBinaryExpression(startParent) && ts.isBinaryExpression(endParent) && ts.isNodeDescendantOf(startParent, endParent)) { + start = end = endParent; } else { - deleteNode(ctorDeclaration, true); + return createErrorResult(sourceFile, span.start, length, Messages.CannotExtractFunction); } - newClassDeclaration = createClassFromVariableDeclaration(ctorDeclaration); - break; + } + if (start !== end) { + if (!isBlockLike(start.parent)) { + return createErrorResult(sourceFile, span.start, length, Messages.CannotExtractFunction); + } + var statements = []; + for (var _i = 0, _a = start.parent.statements; _i < _a.length; _i++) { + var statement = _a[_i]; + if (statement === start || statements.length) { + var errors = checkNode(statement); + if (errors) { + return { errors: errors }; + } + statements.push(statement); + } + if (statement === end) { + break; + } + } + return { targetRange: { range: statements, facts: rangeFacts, declarations: declarations } }; + } + else { + var errors = checkRootNode(start) || checkNode(start); + if (errors) { + return { errors: errors }; + } + var range = ts.isStatement(start) + ? [start] + : start.parent && start.parent.kind === 210 + ? [start.parent] + : start; + return { targetRange: { range: range, facts: rangeFacts, declarations: declarations } }; + } + function createErrorResult(sourceFile, start, length, message) { + return { errors: [ts.createFileDiagnostic(sourceFile, start, length, message)] }; + } + function checkRootNode(node) { + if (ts.isIdentifier(node)) { + return [ts.createDiagnosticForNode(node, Messages.InsufficientSelection)]; + } + return undefined; + } + function checkForStaticContext(nodeToCheck, containingClass) { + var current = nodeToCheck; + while (current !== containingClass) { + if (current.kind === 149) { + if (ts.hasModifier(current, 32)) { + rangeFacts |= RangeFacts.InStaticRegion; + } + break; + } + else if (current.kind === 146) { + var ctorOrMethod = ts.getContainingFunction(current); + if (ctorOrMethod.kind === 152) { + rangeFacts |= RangeFacts.InStaticRegion; + } + break; + } + else if (current.kind === 151) { + if (ts.hasModifier(current, 32)) { + rangeFacts |= RangeFacts.InStaticRegion; + } + } + current = current.parent; + } + } + function checkNode(nodeToCheck) { + var PermittedJumps; + (function (PermittedJumps) { + PermittedJumps[PermittedJumps["None"] = 0] = "None"; + PermittedJumps[PermittedJumps["Break"] = 1] = "Break"; + PermittedJumps[PermittedJumps["Continue"] = 2] = "Continue"; + PermittedJumps[PermittedJumps["Return"] = 4] = "Return"; + })(PermittedJumps || (PermittedJumps = {})); + if (!ts.isStatement(nodeToCheck) && !(ts.isExpression(nodeToCheck) && isExtractableExpression(nodeToCheck))) { + return [ts.createDiagnosticForNode(nodeToCheck, Messages.StatementOrExpressionExpected)]; + } + if (ts.isInAmbientContext(nodeToCheck)) { + return [ts.createDiagnosticForNode(nodeToCheck, Messages.CannotExtractAmbientBlock)]; + } + var containingClass = ts.getContainingClass(nodeToCheck); + if (containingClass) { + checkForStaticContext(nodeToCheck, containingClass); + } + var errors; + var permittedJumps = 4; + var seenLabels; + visit(nodeToCheck); + return errors; + function visit(node) { + if (errors) { + return true; + } + if (ts.isDeclaration(node)) { + var declaringNode = (node.kind === 226) ? node.parent.parent : node; + if (ts.hasModifier(declaringNode, 1)) { + (errors || (errors = [])).push(ts.createDiagnosticForNode(node, Messages.CannotExtractExportedEntity)); + return true; + } + declarations.push(node.symbol); + } + switch (node.kind) { + case 238: + (errors || (errors = [])).push(ts.createDiagnosticForNode(node, Messages.CannotExtractFunction)); + return true; + case 97: + if (node.parent.kind === 181) { + var containingClass_1 = ts.getContainingClass(node); + if (containingClass_1.pos < span.start || containingClass_1.end >= (span.start + span.length)) { + (errors || (errors = [])).push(ts.createDiagnosticForNode(node, Messages.CannotExtractFunction)); + return true; + } + } + else { + rangeFacts |= RangeFacts.UsesThis; + } + break; + } + if (!node || ts.isFunctionLike(node) || ts.isClassLike(node)) { + switch (node.kind) { + case 228: + case 229: + if (node.parent.kind === 265 && node.parent.externalModuleIndicator === undefined) { + (errors || (errors = [])).push(ts.createDiagnosticForNode(node, Messages.FunctionWillNotBeVisibleInTheNewScope)); + } + break; + } + return false; + } + var savedPermittedJumps = permittedJumps; + if (node.parent) { + switch (node.parent.kind) { + case 211: + if (node.parent.thenStatement === node || node.parent.elseStatement === node) { + permittedJumps = 0; + } + break; + case 224: + if (node.parent.tryBlock === node) { + permittedJumps = 0; + } + else if (node.parent.finallyBlock === node) { + permittedJumps = 4; + } + break; + case 260: + if (node.parent.block === node) { + permittedJumps = 0; + } + break; + case 257: + if (node.expression !== node) { + permittedJumps |= 1; + } + break; + default: + if (ts.isIterationStatement(node.parent, false)) { + if (node.parent.statement === node) { + permittedJumps |= 1 | 2; + } + } + break; + } + } + switch (node.kind) { + case 169: + case 99: + rangeFacts |= RangeFacts.UsesThis; + break; + case 222: + { + var label = node.label; + (seenLabels || (seenLabels = [])).push(label.escapedText); + ts.forEachChild(node, visit); + seenLabels.pop(); + break; + } + case 218: + case 217: + { + var label = node.label; + if (label) { + if (!ts.contains(seenLabels, label.escapedText)) { + (errors || (errors = [])).push(ts.createDiagnosticForNode(node, Messages.CannotExtractRangeContainingLabeledBreakOrContinueStatementWithTargetOutsideOfTheRange)); + } + } + else { + if (!(permittedJumps & (218 ? 1 : 2))) { + (errors || (errors = [])).push(ts.createDiagnosticForNode(node, Messages.CannotExtractRangeContainingConditionalBreakOrContinueStatements)); + } + } + break; + } + case 191: + rangeFacts |= RangeFacts.IsAsyncFunction; + break; + case 197: + rangeFacts |= RangeFacts.IsGenerator; + break; + case 219: + if (permittedJumps & 4) { + rangeFacts |= RangeFacts.HasReturn; + } + else { + (errors || (errors = [])).push(ts.createDiagnosticForNode(node, Messages.CannotExtractRangeContainingConditionalReturnStatement)); + } + break; + default: + ts.forEachChild(node, visit); + break; + } + permittedJumps = savedPermittedJumps; + } + } } - if (!newClassDeclaration) { - return undefined; + extractMethod_1.getRangeToExtract = getRangeToExtract; + function isValidExtractionTarget(node) { + return (node.kind === 228) || ts.isSourceFile(node) || ts.isModuleBlock(node) || ts.isClassLike(node); } - changeTracker.insertNodeAfter(sourceFile, precedingNode, newClassDeclaration, { suffix: newLine }); - for (var _i = 0, deletes_1 = deletes; _i < deletes_1.length; _i++) { - var deleteCallback = deletes_1[_i]; - deleteCallback(); + function collectEnclosingScopes(range) { + var current = isReadonlyArray(range.range) ? ts.firstOrUndefined(range.range) : range.range; + if (range.facts & RangeFacts.UsesThis) { + var containingClass = ts.getContainingClass(current); + if (containingClass) { + return [containingClass]; + } + } + var start = current; + var scopes = undefined; + while (current) { + if (current !== start && isValidExtractionTarget(current)) { + (scopes = scopes || []).push(current); + } + if (current && current.parent && current.parent.kind === 146) { + current = ts.findAncestor(current, function (parent) { return ts.isFunctionLike(parent); }).parent; + } + else { + current = current.parent; + } + } + return scopes; } - return { - edits: changeTracker.getChanges() - }; - function deleteNode(node, inList) { - if (inList === void 0) { inList = false; } - if (deletedNodes.some(function (n) { return ts.isNodeDescendantOf(node, n); })) { - return; + extractMethod_1.collectEnclosingScopes = collectEnclosingScopes; + function getPossibleExtractions(targetRange, context, requestedChangesIndex) { + if (requestedChangesIndex === void 0) { requestedChangesIndex = undefined; } + var sourceFile = context.file; + if (targetRange === undefined) { + return undefined; + } + var scopes = collectEnclosingScopes(targetRange); + if (scopes === undefined) { + return undefined; } - deletedNodes.push(node); - if (inList) { - deletes.push(function () { return changeTracker.deleteNodeInList(sourceFile, node); }); + var enclosingTextRange = getEnclosingTextRange(targetRange, sourceFile); + var _a = collectReadsAndWrites(targetRange, scopes, enclosingTextRange, sourceFile, context.program.getTypeChecker()), target = _a.target, usagesPerScope = _a.usagesPerScope, errorsPerScope = _a.errorsPerScope; + context.cancellationToken.throwIfCancellationRequested(); + if (requestedChangesIndex !== undefined) { + if (errorsPerScope[requestedChangesIndex].length) { + return undefined; + } + return [extractFunctionInScope(target, scopes[requestedChangesIndex], usagesPerScope[requestedChangesIndex], targetRange, context)]; } else { - deletes.push(function () { return changeTracker.deleteNode(sourceFile, node); }); + return scopes.map(function (scope, i) { + var errors = errorsPerScope[i]; + if (errors.length) { + return { + scope: scope, + scopeDescription: getDescriptionForScope(scope), + errors: errors + }; + } + return { scope: scope, scopeDescription: getDescriptionForScope(scope) }; + }); } } - function createClassElementsFromSymbol(symbol) { - var memberElements = []; - if (symbol.members) { - symbol.members.forEach(function (member) { - var memberElement = createClassElement(member, undefined); - if (memberElement) { - memberElements.push(memberElement); + extractMethod_1.getPossibleExtractions = getPossibleExtractions; + function getDescriptionForScope(scope) { + if (ts.isFunctionLike(scope)) { + switch (scope.kind) { + case 152: + return "constructor"; + case 186: + return scope.name + ? "function expression " + scope.name.getText() + : "anonymous function expression"; + case 228: + return "function " + scope.name.getText(); + case 187: + return "arrow function"; + case 151: + return "method " + scope.name.getText(); + case 153: + return "get " + scope.name.getText(); + case 154: + return "set " + scope.name.getText(); + } + } + else if (ts.isModuleBlock(scope)) { + return "namespace " + scope.parent.name.getText(); + } + else if (ts.isClassLike(scope)) { + return scope.kind === 229 + ? "class " + scope.name.text + : scope.name.text + ? "class expression " + scope.name.text + : "anonymous class expression"; + } + else if (ts.isSourceFile(scope)) { + return "file '" + scope.fileName + "'"; + } + else { + return "unknown"; + } + } + function getUniqueName(isNameOkay) { + var functionNameText = "newFunction"; + if (isNameOkay(functionNameText)) { + return functionNameText; + } + var i = 1; + while (!isNameOkay(functionNameText = "newFunction_" + i)) { + i++; + } + return functionNameText; + } + function extractFunctionInScope(node, scope, _a, range, context) { + var usagesInScope = _a.usages, substitutions = _a.substitutions; + var checker = context.program.getTypeChecker(); + var file = scope.getSourceFile(); + var functionNameText = getUniqueName(function (n) { return !file.identifiers.has(n); }); + var isJS = ts.isInJavaScriptFile(scope); + var functionName = ts.createIdentifier(functionNameText); + var functionReference = ts.createIdentifier(functionNameText); + var returnType = undefined; + var parameters = []; + var callArguments = []; + var writes; + usagesInScope.forEach(function (usage, name) { + var typeNode = undefined; + if (!isJS) { + var type = checker.getTypeOfSymbolAtLocation(usage.symbol, usage.node); + type = checker.getBaseTypeOfLiteralType(type); + typeNode = checker.typeToTypeNode(type, node, ts.NodeBuilderFlags.NoTruncation); + } + var paramDecl = ts.createParameter(undefined, undefined, undefined, name, undefined, typeNode); + parameters.push(paramDecl); + if (usage.usage === 2) { + (writes || (writes = [])).push(usage); + } + callArguments.push(ts.createIdentifier(name)); + }); + if (ts.isExpression(node) && !isJS) { + var contextualType = checker.getContextualType(node); + returnType = checker.typeToTypeNode(contextualType); + } + var _b = transformFunctionBody(node), body = _b.body, returnValueProperty = _b.returnValueProperty; + var newFunction; + if (ts.isClassLike(scope)) { + var modifiers = isJS ? [] : [ts.createToken(112)]; + if (range.facts & RangeFacts.InStaticRegion) { + modifiers.push(ts.createToken(115)); + } + if (range.facts & RangeFacts.IsAsyncFunction) { + modifiers.push(ts.createToken(120)); + } + newFunction = ts.createMethod(undefined, modifiers, range.facts & RangeFacts.IsGenerator ? ts.createToken(39) : undefined, functionName, undefined, [], parameters, returnType, body); + } + else { + newFunction = ts.createFunctionDeclaration(undefined, range.facts & RangeFacts.IsAsyncFunction ? [ts.createToken(120)] : undefined, range.facts & RangeFacts.IsGenerator ? ts.createToken(39) : undefined, functionName, [], parameters, returnType, body); + } + var changeTracker = ts.textChanges.ChangeTracker.fromCodeFixContext(context); + changeTracker.insertNodeBefore(context.file, scope.getLastToken(), newFunction, { prefix: context.newLineCharacter, suffix: context.newLineCharacter }); + var newNodes = []; + var call = ts.createCall(ts.isClassLike(scope) ? ts.createPropertyAccess(range.facts & RangeFacts.InStaticRegion ? ts.createIdentifier(scope.name.getText()) : ts.createThis(), functionReference) : functionReference, undefined, callArguments); + if (range.facts & RangeFacts.IsGenerator) { + call = ts.createYield(ts.createToken(39), call); + } + if (range.facts & RangeFacts.IsAsyncFunction) { + call = ts.createAwait(call); + } + if (writes) { + if (returnValueProperty) { + newNodes.push(ts.createVariableStatement(undefined, [ts.createVariableDeclaration(returnValueProperty, ts.createKeywordTypeNode(119))])); + } + var assignments = getPropertyAssignmentsForWrites(writes); + if (returnValueProperty) { + assignments.unshift(ts.createShorthandPropertyAssignment(returnValueProperty)); + } + if (assignments.length === 1) { + if (returnValueProperty) { + newNodes.push(ts.createReturn(ts.createIdentifier(returnValueProperty))); + } + else { + newNodes.push(ts.createStatement(ts.createBinary(assignments[0].name, 58, call))); } + } + else { + newNodes.push(ts.createStatement(ts.createBinary(ts.createObjectLiteral(assignments), 58, call))); + if (returnValueProperty) { + newNodes.push(ts.createReturn(ts.createIdentifier(returnValueProperty))); + } + } + } + else { + if (range.facts & RangeFacts.HasReturn) { + newNodes.push(ts.createReturn(call)); + } + else if (isReadonlyArray(range.range)) { + newNodes.push(ts.createStatement(call)); + } + else { + newNodes.push(call); + } + } + if (isReadonlyArray(range.range)) { + changeTracker.replaceNodesWithNodes(context.file, range.range, newNodes, { + nodeSeparator: context.newLineCharacter, + suffix: context.newLineCharacter }); } - if (symbol.exports) { - symbol.exports.forEach(function (member) { - var memberElement = createClassElement(member, [ts.createToken(115)]); - if (memberElement) { - memberElements.push(memberElement); + else { + changeTracker.replaceNodeWithNodes(context.file, range.range, newNodes, { nodeSeparator: context.newLineCharacter }); + } + return { + scope: scope, + scopeDescription: getDescriptionForScope(scope), + changes: changeTracker.getChanges() + }; + function getPropertyAssignmentsForWrites(writes) { + return writes.map(function (w) { return ts.createShorthandPropertyAssignment(w.symbol.name); }); + } + function generateReturnValueProperty() { + return "__return"; + } + function transformFunctionBody(body) { + if (ts.isBlock(body) && !writes && substitutions.size === 0) { + return { body: ts.createBlock(body.statements, true), returnValueProperty: undefined }; + } + var returnValueProperty; + var statements = ts.createNodeArray(ts.isBlock(body) ? body.statements.slice(0) : [ts.isStatement(body) ? body : ts.createReturn(body)]); + if (writes || substitutions.size) { + var rewrittenStatements = ts.visitNodes(statements, visitor).slice(); + if (writes && !(range.facts & RangeFacts.HasReturn) && ts.isStatement(body)) { + var assignments = getPropertyAssignmentsForWrites(writes); + if (assignments.length === 1) { + rewrittenStatements.push(ts.createReturn(assignments[0].name)); + } + else { + rewrittenStatements.push(ts.createReturn(ts.createObjectLiteral(assignments))); + } + } + return { body: ts.createBlock(rewrittenStatements, true), returnValueProperty: returnValueProperty }; + } + else { + return { body: ts.createBlock(statements, true), returnValueProperty: undefined }; + } + function visitor(node) { + if (node.kind === 219 && writes) { + var assignments = getPropertyAssignmentsForWrites(writes); + if (node.expression) { + if (!returnValueProperty) { + returnValueProperty = generateReturnValueProperty(); + } + assignments.unshift(ts.createPropertyAssignment(returnValueProperty, ts.visitNode(node.expression, visitor))); + } + if (assignments.length === 1) { + return ts.createReturn(assignments[0].name); + } + else { + return ts.createReturn(ts.createObjectLiteral(assignments)); + } + } + else { + var substitution = substitutions.get(ts.getNodeId(node).toString()); + return substitution || ts.visitEachChild(node, visitor, ts.nullTransformationContext); + } + } + } + } + extractMethod_1.extractFunctionInScope = extractFunctionInScope; + function isReadonlyArray(v) { + return ts.isArray(v); + } + function getEnclosingTextRange(targetRange, sourceFile) { + return isReadonlyArray(targetRange.range) + ? { pos: targetRange.range[0].getStart(sourceFile), end: targetRange.range[targetRange.range.length - 1].getEnd() } + : targetRange.range; + } + var Usage; + (function (Usage) { + Usage[Usage["Read"] = 1] = "Read"; + Usage[Usage["Write"] = 2] = "Write"; + })(Usage || (Usage = {})); + function collectReadsAndWrites(targetRange, scopes, enclosingTextRange, sourceFile, checker) { + var usagesPerScope = []; + var substitutionsPerScope = []; + var errorsPerScope = []; + var visibleDeclarationsInExtractedRange = []; + for (var _i = 0, scopes_1 = scopes; _i < scopes_1.length; _i++) { + var _ = scopes_1[_i]; + usagesPerScope.push({ usages: ts.createMap(), substitutions: ts.createMap() }); + substitutionsPerScope.push(ts.createMap()); + errorsPerScope.push([]); + } + var seenUsages = ts.createMap(); + var target = isReadonlyArray(targetRange.range) ? ts.createBlock(targetRange.range) : targetRange.range; + var containingLexicalScopeOfExtraction = ts.isBlockScope(scopes[0], scopes[0].parent) ? scopes[0] : ts.getEnclosingBlockScopeContainer(scopes[0]); + collectUsages(target); + var _loop_8 = function (i) { + var hasWrite = false; + var readonlyClassPropertyWrite = undefined; + usagesPerScope[i].usages.forEach(function (value) { + if (value.usage === 2) { + hasWrite = true; + if (value.symbol.flags & 106500 && + value.symbol.valueDeclaration && + ts.hasModifier(value.symbol.valueDeclaration, 64)) { + readonlyClassPropertyWrite = value.symbol.valueDeclaration; + } } }); + if (hasWrite && !isReadonlyArray(targetRange.range) && ts.isExpression(targetRange.range)) { + errorsPerScope[i].push(ts.createDiagnosticForNode(targetRange.range, Messages.CannotCombineWritesAndReturns)); + } + else if (readonlyClassPropertyWrite && i > 0) { + errorsPerScope[i].push(ts.createDiagnosticForNode(readonlyClassPropertyWrite, Messages.CannotCombineWritesAndReturns)); + } + }; + for (var i = 0; i < scopes.length; i++) { + _loop_8(i); } - return memberElements; - function shouldConvertDeclaration(_target, source) { - return ts.isFunctionLike(source); + if (visibleDeclarationsInExtractedRange.length) { + ts.forEachChild(containingLexicalScopeOfExtraction, checkForUsedDeclarations); } - function createClassElement(symbol, modifiers) { - if (!(symbol.flags & 4)) { - return; + return { target: target, usagesPerScope: usagesPerScope, errorsPerScope: errorsPerScope }; + function collectUsages(node, valueUsage) { + if (valueUsage === void 0) { valueUsage = 1; } + if (ts.isDeclaration(node) && node.symbol) { + visibleDeclarationsInExtractedRange.push(node.symbol); } - var memberDeclaration = symbol.valueDeclaration; - var assignmentBinaryExpression = memberDeclaration.parent; - if (!shouldConvertDeclaration(memberDeclaration, assignmentBinaryExpression.right)) { - return; + if (ts.isAssignmentExpression(node)) { + collectUsages(node.left, 2); + collectUsages(node.right); + } + else if (ts.isUnaryExpressionWithWrite(node)) { + collectUsages(node.operand, 2); + } + else if (ts.isPropertyAccessExpression(node) || ts.isElementAccessExpression(node)) { + ts.forEachChild(node, collectUsages); } - var nodeToDelete = assignmentBinaryExpression.parent && assignmentBinaryExpression.parent.kind === 210 - ? assignmentBinaryExpression.parent : assignmentBinaryExpression; - deleteNode(nodeToDelete); - if (!assignmentBinaryExpression.right) { - return ts.createProperty([], modifiers, symbol.name, undefined, undefined, undefined); - } - switch (assignmentBinaryExpression.right.kind) { - case 186: { - var functionExpression = assignmentBinaryExpression.right; - var method = ts.createMethod(undefined, modifiers, undefined, memberDeclaration.name, undefined, undefined, functionExpression.parameters, undefined, functionExpression.body); - copyComments(assignmentBinaryExpression, method); - return method; - } - case 187: { - var arrowFunction = assignmentBinaryExpression.right; - var arrowFunctionBody = arrowFunction.body; - var bodyBlock = void 0; - if (arrowFunctionBody.kind === 207) { - bodyBlock = arrowFunctionBody; + else if (ts.isIdentifier(node)) { + if (!node.parent) { + return; + } + if (ts.isQualifiedName(node.parent) && node !== node.parent.left) { + return; + } + if (ts.isPropertyAccessExpression(node.parent) && node !== node.parent.expression) { + return; + } + recordUsage(node, valueUsage, ts.isPartOfTypeNode(node)); + } + else { + ts.forEachChild(node, collectUsages); + } + } + function recordUsage(n, usage, isTypeNode) { + var symbolId = recordUsagebySymbol(n, usage, isTypeNode); + if (symbolId) { + for (var i = 0; i < scopes.length; i++) { + var substitition = substitutionsPerScope[i].get(symbolId); + if (substitition) { + usagesPerScope[i].substitutions.set(ts.getNodeId(n).toString(), substitition); } - else { - var expression = arrowFunctionBody; - bodyBlock = ts.createBlock([ts.createReturn(expression)]); + } + } + } + function recordUsagebySymbol(identifier, usage, isTypeName) { + var symbol = checker.getSymbolAtLocation(identifier); + if (!symbol) { + return undefined; + } + var symbolId = ts.getSymbolId(symbol).toString(); + var lastUsage = seenUsages.get(symbolId); + if (lastUsage && lastUsage >= usage) { + return symbolId; + } + seenUsages.set(symbolId, usage); + if (lastUsage) { + for (var _i = 0, usagesPerScope_1 = usagesPerScope; _i < usagesPerScope_1.length; _i++) { + var perScope = usagesPerScope_1[_i]; + var prevEntry = perScope.usages.get(identifier.text); + if (prevEntry) { + perScope.usages.set(identifier.text, { usage: usage, symbol: symbol, node: identifier }); } - var method = ts.createMethod(undefined, modifiers, undefined, memberDeclaration.name, undefined, undefined, arrowFunction.parameters, undefined, bodyBlock); - copyComments(assignmentBinaryExpression, method); - return method; } - default: { - if (ts.isSourceFileJavaScript(sourceFile)) { - return; + return symbolId; + } + var declInFile = ts.find(symbol.getDeclarations(), function (d) { return d.getSourceFile() === sourceFile; }); + if (!declInFile) { + return undefined; + } + if (ts.rangeContainsRange(enclosingTextRange, declInFile)) { + return undefined; + } + if (targetRange.facts & RangeFacts.IsGenerator && usage === 2) { + for (var _a = 0, errorsPerScope_1 = errorsPerScope; _a < errorsPerScope_1.length; _a++) { + var errors = errorsPerScope_1[_a]; + errors.push(ts.createDiagnosticForNode(identifier, Messages.CannotExtractRangeThatContainsWritesToReferencesLocatedOutsideOfTheTargetRangeInGenerators)); + } + } + for (var i = 0; i < scopes.length; i++) { + var scope = scopes[i]; + var resolvedSymbol = checker.resolveName(symbol.name, scope, symbol.flags); + if (resolvedSymbol === symbol) { + continue; + } + if (!substitutionsPerScope[i].has(symbolId)) { + var substitution = tryReplaceWithQualifiedNameOrPropertyAccess(symbol.exportSymbol || symbol, scope, isTypeName); + if (substitution) { + substitutionsPerScope[i].set(symbolId, substitution); + } + else if (isTypeName) { + errorsPerScope[i].push(ts.createDiagnosticForNode(identifier, Messages.TypeWillNotBeVisibleInTheNewScope)); + } + else { + usagesPerScope[i].usages.set(identifier.text, { usage: usage, symbol: symbol, node: identifier }); } - var prop = ts.createProperty(undefined, modifiers, memberDeclaration.name, undefined, undefined, assignmentBinaryExpression.right); - copyComments(assignmentBinaryExpression.parent, prop); - return prop; } } + return symbolId; } - } - function copyComments(sourceNode, targetNode) { - ts.forEachLeadingCommentRange(sourceFile.text, sourceNode.pos, function (pos, end, kind, htnl) { - if (kind === 3) { - pos += 2; - end -= 2; + function checkForUsedDeclarations(node) { + if (node === targetRange.range || (isReadonlyArray(targetRange.range) && targetRange.range.indexOf(node) >= 0)) { + return; + } + var sym = checker.getSymbolAtLocation(node); + if (sym && visibleDeclarationsInExtractedRange.some(function (d) { return d === sym; })) { + for (var _i = 0, errorsPerScope_2 = errorsPerScope; _i < errorsPerScope_2.length; _i++) { + var scope = errorsPerScope_2[_i]; + scope.push(ts.createDiagnosticForNode(node, Messages.CannotExtractExportedEntity)); + } + return true; } else { - pos += 2; + ts.forEachChild(node, checkForUsedDeclarations); } - ts.addSyntheticLeadingComment(targetNode, kind, sourceFile.text.slice(pos, end), htnl); - }); + } + function tryReplaceWithQualifiedNameOrPropertyAccess(symbol, scopeDecl, isTypeNode) { + if (!symbol) { + return undefined; + } + if (symbol.getDeclarations().some(function (d) { return d.parent === scopeDecl; })) { + return ts.createIdentifier(symbol.name); + } + var prefix = tryReplaceWithQualifiedNameOrPropertyAccess(symbol.parent, scopeDecl, isTypeNode); + if (prefix === undefined) { + return undefined; + } + return isTypeNode ? ts.createQualifiedName(prefix, ts.createIdentifier(symbol.name)) : ts.createPropertyAccess(prefix, symbol.name); + } } - function createClassFromVariableDeclaration(node) { - var initializer = node.initializer; - if (!initializer || initializer.kind !== 186) { + function getParentNodeInSpan(node, file, span) { + if (!node) return undefined; + while (node.parent) { + if (ts.isSourceFile(node.parent) || !spanContainsNode(span, node.parent, file)) { + return node; + } + node = node.parent; } - if (node.name.kind !== 71) { - return undefined; + } + function spanContainsNode(span, node, file) { + return ts.textSpanContainsPosition(span, node.getStart(file)) && + node.getEnd() <= ts.textSpanEnd(span); + } + function isExtractableExpression(node) { + switch (node.parent.kind) { + case 264: + return false; } - var memberElements = createClassElementsFromSymbol(initializer.symbol); - if (initializer.body) { - memberElements.unshift(ts.createConstructor(undefined, undefined, initializer.parameters, initializer.body)); + switch (node.kind) { + case 9: + return node.parent.kind !== 238 && + node.parent.kind !== 242; + case 198: + case 174: + case 176: + return false; + case 71: + return node.parent.kind !== 176 && + node.parent.kind !== 242 && + node.parent.kind !== 246; } - var cls = ts.createClassDeclaration(undefined, undefined, node.name, undefined, undefined, memberElements); - return cls; + return true; } - function createClassFromFunctionDeclaration(node) { - var memberElements = createClassElementsFromSymbol(ctorSymbol); - if (node.body) { - memberElements.unshift(ts.createConstructor(undefined, undefined, node.parameters, node.body)); + function isBlockLike(node) { + switch (node.kind) { + case 207: + case 265: + case 234: + case 257: + return true; + default: + return false; } - var cls = ts.createClassDeclaration(undefined, undefined, node.name, undefined, undefined, memberElements); - return cls; } - } + })(extractMethod = refactor.extractMethod || (refactor.extractMethod = {})); })(refactor = ts.refactor || (ts.refactor = {})); })(ts || (ts = {})); var ts; @@ -74186,12 +75614,14 @@ var ts; ts.scanner.setTextPos(pos); while (pos < end) { var token = ts.scanner.scan(); - ts.Debug.assert(token !== 1); var textPos = ts.scanner.getTextPos(); if (textPos <= end) { nodes.push(createNode(token, pos, textPos, this)); } pos = textPos; + if (token === 1) { + break; + } } return pos; }; @@ -74986,8 +76416,8 @@ var ts; if (program) { var oldSourceFiles = program.getSourceFiles(); var oldSettingsKey = documentRegistry.getKeyForCompilationSettings(oldSettings); - for (var _i = 0, oldSourceFiles_1 = oldSourceFiles; _i < oldSourceFiles_1.length; _i++) { - var oldSourceFile = oldSourceFiles_1[_i]; + for (var _i = 0, oldSourceFiles_2 = oldSourceFiles; _i < oldSourceFiles_2.length; _i++) { + var oldSourceFile = oldSourceFiles_2[_i]; if (!newProgram.getSourceFile(oldSourceFile.fileName) || shouldCreateNewSourceFiles) { documentRegistry.releaseDocumentWithKey(oldSourceFile.path, oldSettingsKey); } @@ -75009,7 +76439,7 @@ var ts; if (!shouldCreateNewSourceFiles) { var oldSourceFile = program && program.getSourceFileByPath(path); if (oldSourceFile) { - ts.Debug.assert(hostFileInformation.scriptKind === oldSourceFile.scriptKind, "Registered script kind (" + oldSourceFile.scriptKind + ") should match new script kind (" + hostFileInformation.scriptKind + ") for file: " + path); + ts.Debug.assertEqual(hostFileInformation.scriptKind, oldSourceFile.scriptKind, "Registered script kind should match new script kind.", path); return documentRegistry.updateDocumentWithKey(fileName, path, newSettings, documentRegistryBucketKey, hostFileInformation.scriptSnapshot, hostFileInformation.version, hostFileInformation.scriptKind); } } @@ -75372,17 +76802,19 @@ var ts; function getFormattingEditsAfterKeystroke(fileName, position, key, options) { var sourceFile = syntaxTreeCache.getCurrentSourceFile(fileName); var settings = toEditorSettings(options); - if (key === "{") { - return ts.formatting.formatOnOpeningCurly(position, sourceFile, getRuleProvider(settings), settings); - } - else if (key === "}") { - return ts.formatting.formatOnClosingCurly(position, sourceFile, getRuleProvider(settings), settings); - } - else if (key === ";") { - return ts.formatting.formatOnSemicolon(position, sourceFile, getRuleProvider(settings), settings); - } - else if (key === "\n") { - return ts.formatting.formatOnEnter(position, sourceFile, getRuleProvider(settings), settings); + if (!ts.isInComment(sourceFile, position)) { + if (key === "{") { + return ts.formatting.formatOnOpeningCurly(position, sourceFile, getRuleProvider(settings), settings); + } + else if (key === "}") { + return ts.formatting.formatOnClosingCurly(position, sourceFile, getRuleProvider(settings), settings); + } + else if (key === ";") { + return ts.formatting.formatOnSemicolon(position, sourceFile, getRuleProvider(settings), settings); + } + else if (key === "\n") { + return ts.formatting.formatOnEnter(position, sourceFile, getRuleProvider(settings), settings); + } } return []; } @@ -75422,6 +76854,11 @@ var ts; } return true; } + function getSpanOfEnclosingComment(fileName, position, onlyMultiLine) { + var sourceFile = syntaxTreeCache.getCurrentSourceFile(fileName); + var range = ts.formatting.getRangeOfEnclosingComment(sourceFile, position, onlyMultiLine); + return range && ts.createTextSpanFromRange(range); + } function getTodoComments(fileName, descriptors) { synchronizeHostData(); var sourceFile = getValidSourceFile(fileName); @@ -75545,6 +76982,7 @@ var ts; getFormattingEditsAfterKeystroke: getFormattingEditsAfterKeystroke, getDocCommentTemplateAtPosition: getDocCommentTemplateAtPosition, isValidBraceCompletionAtPosition: isValidBraceCompletionAtPosition, + getSpanOfEnclosingComment: getSpanOfEnclosingComment, getCodeFixesAtPosition: getCodeFixesAtPosition, getEmitOutput: getEmitOutput, getNonBoundSourceFile: getNonBoundSourceFile, @@ -75615,12 +77053,16 @@ var ts; function getPropertySymbolsFromContextualType(typeChecker, node) { var objectLiteral = node.parent; var contextualType = typeChecker.getContextualType(objectLiteral); - var name = ts.unescapeLeadingUnderscores(ts.getTextOfPropertyName(node.name)); - if (name && contextualType) { + return getPropertySymbolsFromType(contextualType, node.name); + } + ts.getPropertySymbolsFromContextualType = getPropertySymbolsFromContextualType; + function getPropertySymbolsFromType(type, propName) { + var name = ts.unescapeLeadingUnderscores(ts.getTextOfPropertyName(propName)); + if (name && type) { var result_10 = []; - var symbol = contextualType.getProperty(name); - if (contextualType.flags & 65536) { - ts.forEach(contextualType.types, function (t) { + var symbol = type.getProperty(name); + if (type.flags & 65536) { + ts.forEach(type.types, function (t) { var symbol = t.getProperty(name); if (symbol) { result_10.push(symbol); @@ -75635,7 +77077,7 @@ var ts; } return undefined; } - ts.getPropertySymbolsFromContextualType = getPropertySymbolsFromContextualType; + ts.getPropertySymbolsFromType = getPropertySymbolsFromType; function isArgumentOfElementAccessExpression(node) { return node && node.parent && @@ -75666,6 +77108,7 @@ var ts; Arguments.LogFile = "--logFile"; Arguments.EnableTelemetry = "--enableTelemetry"; Arguments.TypingSafeListLocation = "--typingSafeListLocation"; + Arguments.TypesMapLocation = "--typesMapLocation"; Arguments.NpmLocation = "--npmLocation"; })(Arguments = server.Arguments || (server.Arguments = {})); function hasArgument(argumentName) { @@ -75713,7 +77156,7 @@ var ts; function createInstallTypingsRequest(project, typeAcquisition, unresolvedImports, cachePath) { return { projectName: project.getProjectName(), - fileNames: project.getFileNames(true, true), + fileNames: project.getFileNames(true, true).concat(project.getExcludedFiles()), compilerOptions: project.getCompilerOptions(), typeAcquisition: typeAcquisition, unresolvedImports: unresolvedImports, @@ -75813,42 +77256,6 @@ var ts; return []; } server.createSortedArray = createSortedArray; - function toSortedArray(arr, comparer) { - arr.sort(comparer); - return arr; - } - server.toSortedArray = toSortedArray; - function enumerateInsertsAndDeletes(newItems, oldItems, inserted, deleted, compare) { - compare = compare || ts.compareValues; - var newIndex = 0; - var oldIndex = 0; - var newLen = newItems.length; - var oldLen = oldItems.length; - while (newIndex < newLen && oldIndex < oldLen) { - var newItem = newItems[newIndex]; - var oldItem = oldItems[oldIndex]; - var compareResult = compare(newItem, oldItem); - if (compareResult === -1) { - inserted(newItem); - newIndex++; - } - else if (compareResult === 1) { - deleted(oldItem); - oldIndex++; - } - else { - newIndex++; - oldIndex++; - } - } - while (newIndex < newLen) { - inserted(newItems[newIndex++]); - } - while (oldIndex < oldLen) { - deleted(oldItems[oldIndex++]); - } - } - server.enumerateInsertsAndDeletes = enumerateInsertsAndDeletes; var ThrottledOperations = (function () { function ThrottledOperations(host) { this.host = host; @@ -75893,6 +77300,11 @@ var ts; return GcTimer; }()); server.GcTimer = GcTimer; + })(server = ts.server || (ts.server = {})); +})(ts || (ts = {})); +(function (ts) { + var server; + (function (server) { function insertSorted(array, insert, compare) { if (array.length === 0) { array.push(insert); @@ -75918,6 +77330,51 @@ var ts; } } server.removeSorted = removeSorted; + function toSortedArray(arr, comparer) { + arr.sort(comparer); + return arr; + } + server.toSortedArray = toSortedArray; + function toDeduplicatedSortedArray(arr) { + arr.sort(); + ts.filterMutate(arr, isNonDuplicateInSortedArray); + return arr; + } + server.toDeduplicatedSortedArray = toDeduplicatedSortedArray; + function isNonDuplicateInSortedArray(value, index, array) { + return index === 0 || value !== array[index - 1]; + } + function enumerateInsertsAndDeletes(newItems, oldItems, inserted, deleted, compare) { + compare = compare || ts.compareValues; + var newIndex = 0; + var oldIndex = 0; + var newLen = newItems.length; + var oldLen = oldItems.length; + while (newIndex < newLen && oldIndex < oldLen) { + var newItem = newItems[newIndex]; + var oldItem = oldItems[oldIndex]; + var compareResult = compare(newItem, oldItem); + if (compareResult === -1) { + inserted(newItem); + newIndex++; + } + else if (compareResult === 1) { + deleted(oldItem); + oldIndex++; + } + else { + newIndex++; + oldIndex++; + } + } + while (newIndex < newLen) { + inserted(newItems[newIndex++]); + } + while (oldIndex < oldLen) { + deleted(oldItems[oldIndex++]); + } + } + server.enumerateInsertsAndDeletes = enumerateInsertsAndDeletes; })(server = ts.server || (ts.server = {})); })(ts || (ts = {})); var ts; @@ -75931,6 +77388,7 @@ var ts; CommandTypes["Brace"] = "brace"; CommandTypes["BraceFull"] = "brace-full"; CommandTypes["BraceCompletion"] = "braceCompletion"; + CommandTypes["GetSpanOfEnclosingComment"] = "getSpanOfEnclosingComment"; CommandTypes["Change"] = "change"; CommandTypes["Close"] = "close"; CommandTypes["Completions"] = "completions"; @@ -76022,6 +77480,7 @@ var ts; ModuleKind["System"] = "System"; ModuleKind["ES6"] = "ES6"; ModuleKind["ES2015"] = "ES2015"; + ModuleKind["ESNext"] = "ESNext"; })(ModuleKind = protocol.ModuleKind || (protocol.ModuleKind = {})); var ModuleResolutionKind; (function (ModuleResolutionKind) { @@ -76039,6 +77498,9 @@ var ts; ScriptTarget["ES5"] = "ES5"; ScriptTarget["ES6"] = "ES6"; ScriptTarget["ES2015"] = "ES2015"; + ScriptTarget["ES2016"] = "ES2016"; + ScriptTarget["ES2017"] = "ES2017"; + ScriptTarget["ESNext"] = "ESNext"; })(ScriptTarget = protocol.ScriptTarget || (protocol.ScriptTarget = {})); })(protocol = server.protocol || (server.protocol = {})); })(server = ts.server || (ts.server = {})); @@ -76130,20 +77592,16 @@ var ts; var MultistepOperation = (function () { function MultistepOperation(operationHost) { this.operationHost = operationHost; - this.completed = true; } MultistepOperation.prototype.startNew = function (action) { this.complete(); this.requestId = this.operationHost.getCurrentRequestId(); - this.completed = false; this.executeAction(action); }; MultistepOperation.prototype.complete = function () { - if (!this.completed) { - if (this.requestId) { - this.operationHost.sendRequestCompletedEvent(this.requestId); - } - this.completed = true; + if (this.requestId !== undefined) { + this.operationHost.sendRequestCompletedEvent(this.requestId); + this.requestId = undefined; } this.setTimerHandle(undefined); this.setImmediateId(undefined); @@ -76308,6 +77766,9 @@ var ts; _a[server.CommandNames.DocCommentTemplate] = function (request) { return _this.requiredResponse(_this.getDocCommentTemplate(request.arguments)); }, + _a[server.CommandNames.GetSpanOfEnclosingComment] = function (request) { + return _this.requiredResponse(_this.getSpanOfEnclosingComment(request.arguments)); + }, _a[server.CommandNames.Format] = function (request) { return _this.requiredResponse(_this.getFormattingEditsForRange(request.arguments)); }, @@ -76479,6 +77940,7 @@ var ts; logger: this.logger, cancellationToken: this.cancellationToken, useSingleInferredProject: opts.useSingleInferredProject, + useInferredProjectPerProjectRoot: opts.useInferredProjectPerProjectRoot, typingsInstaller: this.typingsInstaller, throttleWaitMilliseconds: throttleWaitMilliseconds, eventHandler: this.eventHandler, @@ -76505,7 +77967,7 @@ var ts; case server.ContextEvent: var _a = event.data, project_1 = _a.project, fileName_2 = _a.fileName; this.projectService.logger.info("got context event, updating diagnostics for " + fileName_2); - this.errorCheck.startNew(function (next) { return _this.updateErrorCheck(next, [{ fileName: fileName_2, project: project_1 }], _this.changeSeq, function (n) { return n === _this.changeSeq; }, 100); }); + this.errorCheck.startNew(function (next) { return _this.updateErrorCheck(next, [{ fileName: fileName_2, project: project_1 }], 100); }); break; case server.ConfigFileDiagEvent: var _b = event.data, triggerFile = _b.triggerFile, configFileName = _b.configFileName, diagnostics = _b.diagnostics; @@ -76613,26 +78075,24 @@ var ts; this.logError(err, "syntactic check"); } }; - Session.prototype.updateProjectStructure = function (seq, matchSeq, ms) { + Session.prototype.updateProjectStructure = function () { var _this = this; - if (ms === void 0) { ms = 1500; } + var ms = 1500; + var seq = this.changeSeq; this.host.setTimeout(function () { - if (matchSeq(seq)) { + if (_this.changeSeq === seq) { _this.projectService.refreshInferredProjects(); } }, ms); }; - Session.prototype.updateErrorCheck = function (next, checkList, seq, matchSeq, ms, followMs, requireOpen) { + Session.prototype.updateErrorCheck = function (next, checkList, ms, requireOpen) { var _this = this; - if (ms === void 0) { ms = 1500; } - if (followMs === void 0) { followMs = 200; } if (requireOpen === void 0) { requireOpen = true; } - if (followMs > ms) { - followMs = ms; - } + var seq = this.changeSeq; + var followMs = Math.min(ms, 200); var index = 0; var checkOne = function () { - if (matchSeq(seq)) { + if (_this.changeSeq === seq) { var checkSpec_1 = checkList[index]; index++; if (checkSpec_1.project.containsFile(checkSpec_1.fileName, requireOpen)) { @@ -76646,7 +78106,7 @@ var ts; } } }; - if ((checkList.length > index) && (matchSeq(seq))) { + if (checkList.length > index && this.changeSeq === seq) { next.delay(ms, checkOne); } }; @@ -76724,7 +78184,7 @@ var ts; Session.prototype.getDiagnosticsWorker = function (args, isSemantic, selector, includeLinePosition) { var _a = this.getFileAndProject(args), project = _a.project, file = _a.file; if (isSemantic && isDeclarationFileInJSOnlyNonConfiguredProject(project, file)) { - return []; + return server.emptyArray; } var scriptInfo = project.getScriptInfoForNormalizedPath(file); var diagnostics = selector(project, file); @@ -76738,7 +78198,7 @@ var ts; var position = this.getPosition(args, scriptInfo); var definitions = project.getLanguageService().getDefinitionAtPosition(file, position); if (!definitions) { - return undefined; + return server.emptyArray; } if (simplifiedResult) { return definitions.map(function (def) { @@ -76760,7 +78220,7 @@ var ts; var position = this.getPosition(args, scriptInfo); var definitions = project.getLanguageService().getTypeDefinitionAtPosition(file, position); if (!definitions) { - return undefined; + return server.emptyArray; } return definitions.map(function (def) { var defScriptInfo = project.getScriptInfo(def.fileName); @@ -76776,7 +78236,7 @@ var ts; var position = this.getPosition(args, project.getScriptInfoForNormalizedPath(file)); var implementations = project.getLanguageService().getImplementationAtPosition(file, position); if (!implementations) { - return []; + return server.emptyArray; } if (simplifiedResult) { return implementations.map(function (_a) { @@ -76799,7 +78259,7 @@ var ts; var position = this.getPosition(args, scriptInfo); var occurrences = project.getLanguageService().getOccurrencesAtPosition(file, position); if (!occurrences) { - return undefined; + return server.emptyArray; } return occurrences.map(function (occurrence) { var fileName = occurrence.fileName, isWriteAccess = occurrence.isWriteAccess, textSpan = occurrence.textSpan, isInString = occurrence.isInString; @@ -76821,7 +78281,7 @@ var ts; Session.prototype.getSyntacticDiagnosticsSync = function (args) { var configFile = this.getConfigFileAndProject(args).configFile; if (configFile) { - return []; + return server.emptyArray; } return this.getDiagnosticsWorker(args, false, function (project, file) { return project.getLanguageService().getSyntacticDiagnostics(file); }, args.includeLinePosition); }; @@ -76838,7 +78298,7 @@ var ts; var position = this.getPosition(args, scriptInfo); var documentHighlights = project.getLanguageService().getDocumentHighlights(file, position, args.filesToSearch); if (!documentHighlights) { - return undefined; + return server.emptyArray; } if (simplifiedResult) { return documentHighlights.map(convertToDocumentHighlightsItem); @@ -76862,7 +78322,7 @@ var ts; } }; Session.prototype.setCompilerOptionsForInferredProjects = function (args) { - this.projectService.setCompilerOptionsForInferredProjects(args.options); + this.projectService.setCompilerOptionsForInferredProjects(args.options, args.projectRootPath); }; Session.prototype.getProjectInfo = function (args) { return this.getProjectInfoWorker(args.file, args.projectFileName, args.needFileNameList, false); @@ -76924,13 +78384,13 @@ var ts; if (!renameInfo.canRename) { return { info: renameInfo, - locs: [] + locs: server.emptyArray }; } var fileSpans = server.combineProjectOutput(projects, function (project) { var renameLocations = project.getLanguageService().findRenameLocations(file, position, args.findInStrings, args.findInComments); if (!renameLocations) { - return []; + return server.emptyArray; } return renameLocations.map(function (location) { var locationScriptInfo = project.getScriptInfo(location.fileName); @@ -77011,7 +78471,7 @@ var ts; var refs = server.combineProjectOutput(projects, function (project) { var references = project.getLanguageService().getReferencesAtPosition(file, position); if (!references) { - return []; + return server.emptyArray; } return references.map(function (ref) { var refScriptInfo = project.getScriptInfo(ref.fileName); @@ -77052,7 +78512,7 @@ var ts; if (this.eventHandler) { this.eventHandler({ eventName: "configFileDiag", - data: { triggerFile: fileName, configFileName: configFileName, diagnostics: configFileErrors || [] } + data: { triggerFile: fileName, configFileName: configFileName, diagnostics: configFileErrors || server.emptyArray } }); } }; @@ -77089,6 +78549,13 @@ var ts; var position = this.getPosition(args, scriptInfo); return project.getLanguageService(false).getDocCommentTemplateAtPosition(file, position); }; + Session.prototype.getSpanOfEnclosingComment = function (args) { + var _a = this.getFileAndProjectWithoutRefreshingInferredProjects(args), file = _a.file, project = _a.project; + var scriptInfo = project.getScriptInfoForNormalizedPath(file); + var onlyMultiLine = args.onlyMultiLine; + var position = this.getPosition(args, scriptInfo); + return project.getLanguageService(false).getSpanOfEnclosingComment(file, position, onlyMultiLine); + }; Session.prototype.getIndentation = function (args) { var _a = this.getFileAndProjectWithoutRefreshingInferredProjects(args), file = _a.file, project = _a.project; var position = this.getPosition(args, project.getScriptInfoForNormalizedPath(file)); @@ -77212,15 +78679,12 @@ var ts; var scriptInfo = project.getScriptInfoForNormalizedPath(file); var position = this.getPosition(args, scriptInfo); var completions = project.getLanguageService().getCompletionsAtPosition(file, position); - if (!completions) { - return undefined; - } if (simplifiedResult) { - return ts.mapDefined(completions.entries, function (entry) { + return ts.mapDefined(completions && completions.entries, function (entry) { if (completions.isMemberCompletion || (entry.name.toLowerCase().indexOf(prefix.toLowerCase()) === 0)) { - var name = entry.name, kind = entry.kind, kindModifiers = entry.kindModifiers, sortText = entry.sortText, replacementSpan = entry.replacementSpan; + var name_68 = entry.name, kind = entry.kind, kindModifiers = entry.kindModifiers, sortText = entry.sortText, replacementSpan = entry.replacementSpan; var convertedSpan = replacementSpan ? _this.decorateSpan(replacementSpan, scriptInfo) : undefined; - return { name: name, kind: kind, kindModifiers: kindModifiers, sortText: sortText, replacementSpan: convertedSpan }; + return { name: name_68, kind: kind, kindModifiers: kindModifiers, sortText: sortText, replacementSpan: convertedSpan }; } }).sort(function (a, b) { return ts.compareStrings(a.name, b.name); }); } @@ -77240,7 +78704,7 @@ var ts; var info = this.projectService.getScriptInfo(args.file); var result = []; if (!info) { - return []; + return server.emptyArray; } var projectsToSearch = args.projectFileName ? [this.projectService.findProject(args.projectFileName)] : info.containingProjects; for (var _i = 0, projectsToSearch_1 = projectsToSearch; _i < projectsToSearch_1.length; _i++) { @@ -77300,11 +78764,10 @@ var ts; return project && { fileName: fileName, project: project }; }); if (checkList.length > 0) { - this.updateErrorCheck(next, checkList, this.changeSeq, function (n) { return n === _this.changeSeq; }, delay); + this.updateErrorCheck(next, checkList, delay); } }; Session.prototype.change = function (args) { - var _this = this; var _a = this.getFileAndProject(args, false), file = _a.file, project = _a.project; if (project) { var scriptInfo = project.getScriptInfoForNormalizedPath(file); @@ -77314,7 +78777,7 @@ var ts; scriptInfo.editContent(start, end, args.insertString); this.changeSeq++; } - this.updateProjectStructure(this.changeSeq, function (n) { return n === _this.changeSeq; }); + this.updateProjectStructure(); } }; Session.prototype.reload = function (args, reqSeq) { @@ -77393,7 +78856,7 @@ var ts; return server.combineProjectOutput(projects, function (project) { var navItems = project.getLanguageService().getNavigateToItems(args.searchValue, args.maxResultCount, fileName, project.isNonTsProject()); if (!navItems) { - return []; + return server.emptyArray; } return navItems.map(function (navItem) { var scriptInfo = project.getScriptInfo(navItem.fileName); @@ -77492,13 +78955,13 @@ var ts; } if (simplifiedResult) { var file_2 = result.renameFilename; - var location = void 0; + var location_4; if (file_2 !== undefined && result.renameLocation !== undefined) { var renameScriptInfo = project.getScriptInfoForNormalizedPath(server.toNormalizedPath(file_2)); - location = renameScriptInfo.positionToLineOffset(result.renameLocation); + location_4 = renameScriptInfo.positionToLineOffset(result.renameLocation); } return { - renameLocation: location, + renameLocation: location_4, renameFilename: file_2, edits: result.edits.map(function (change) { return _this.mapTextChangesToCodeEdits(project, change); }) }; @@ -77583,7 +79046,6 @@ var ts; : spans; }; Session.prototype.getDiagnosticsForProject = function (next, delay, fileName) { - var _this = this; var _a = this.getProjectInfoWorker(fileName, undefined, true, true), fileNames = _a.fileNames, languageServiceDisabled = _a.languageServiceDisabled; if (languageServiceDisabled) { return; @@ -77618,7 +79080,7 @@ var ts; fileNamesInProject = highPriorityFiles.concat(mediumPriorityFiles).concat(lowPriorityFiles).concat(veryLowPriorityFiles); if (fileNamesInProject.length > 0) { var checkList = fileNamesInProject.map(function (fileName) { return ({ fileName: fileName, project: project }); }); - this.updateErrorCheck(next, checkList, this.changeSeq, function (n) { return n === _this.changeSeq; }, delay, 200, false); + this.updateErrorCheck(next, checkList, delay, false); } }; Session.prototype.getCanonicalFileName = function (fileName) { @@ -77725,13 +79187,13 @@ var ts; CharRangeSection[CharRangeSection["Mid"] = 3] = "Mid"; CharRangeSection[CharRangeSection["End"] = 4] = "End"; CharRangeSection[CharRangeSection["PostEnd"] = 5] = "PostEnd"; - })(CharRangeSection = server.CharRangeSection || (server.CharRangeSection = {})); + })(CharRangeSection || (CharRangeSection = {})); var EditWalker = (function () { function EditWalker() { this.goSubtree = true; this.lineIndex = new LineIndex(); this.endBranch = []; - this.state = CharRangeSection.Entire; + this.state = 2; this.initialText = ""; this.trailingText = ""; this.lineIndex.root = new LineNode(); @@ -77820,14 +79282,14 @@ var ts; }; EditWalker.prototype.post = function (_relativeStart, _relativeLength, lineCollection) { if (lineCollection === this.lineCollectionAtBranch) { - this.state = CharRangeSection.End; + this.state = 4; } this.stack.pop(); }; EditWalker.prototype.pre = function (_relativeStart, _relativeLength, lineCollection, _parent, nodeType) { var currentNode = this.stack[this.stack.length - 1]; - if ((this.state === CharRangeSection.Entire) && (nodeType === CharRangeSection.Start)) { - this.state = CharRangeSection.Start; + if ((this.state === 2) && (nodeType === 1)) { + this.state = 1; this.branchNode = currentNode; this.lineCollectionAtBranch = lineCollection; } @@ -77840,14 +79302,14 @@ var ts; return new LineNode(); } switch (nodeType) { - case CharRangeSection.PreStart: + case 0: this.goSubtree = false; - if (this.state !== CharRangeSection.End) { + if (this.state !== 4) { currentNode.add(lineCollection); } break; - case CharRangeSection.Start: - if (this.state === CharRangeSection.End) { + case 1: + if (this.state === 4) { this.goSubtree = false; } else { @@ -77856,8 +79318,8 @@ var ts; this.startPath.push(child); } break; - case CharRangeSection.Entire: - if (this.state !== CharRangeSection.End) { + case 2: + if (this.state !== 4) { child = fresh(lineCollection); currentNode.add(child); this.startPath.push(child); @@ -77870,11 +79332,11 @@ var ts; } } break; - case CharRangeSection.Mid: + case 3: this.goSubtree = false; break; - case CharRangeSection.End: - if (this.state !== CharRangeSection.End) { + case 4: + if (this.state !== 4) { this.goSubtree = false; } else { @@ -77885,9 +79347,9 @@ var ts; } } break; - case CharRangeSection.PostEnd: + case 5: this.goSubtree = false; - if (this.state !== CharRangeSection.Start) { + if (this.state !== 1) { currentNode.add(lineCollection); } break; @@ -77897,10 +79359,10 @@ var ts; } }; EditWalker.prototype.leaf = function (relativeStart, relativeLength, ll) { - if (this.state === CharRangeSection.Start) { + if (this.state === 1) { this.initialText = ll.text.substring(0, relativeStart); } - else if (this.state === CharRangeSection.Entire) { + else if (this.state === 2) { this.initialText = ll.text.substring(0, relativeStart); this.trailingText = ll.text.substring(relativeStart + relativeLength); } @@ -77921,7 +79383,6 @@ var ts; }; return TextChange; }()); - server.TextChange = TextChange; var ScriptVersionCache = (function () { function ScriptVersionCache() { this.changes = []; @@ -77946,15 +79407,6 @@ var ts; this.getSnapshot(); } }; - ScriptVersionCache.prototype.latest = function () { - return this.versions[this.currentVersionToIndex()]; - }; - ScriptVersionCache.prototype.latestVersion = function () { - if (this.changes.length > 0) { - this.getSnapshot(); - } - return this.currentVersion; - }; ScriptVersionCache.prototype.reload = function (script) { this.currentVersion++; this.changes = []; @@ -77967,7 +79419,8 @@ var ts; snap.index.load(lm.lines); this.minVersion = this.currentVersion; }; - ScriptVersionCache.prototype.getSnapshot = function () { + ScriptVersionCache.prototype.getSnapshot = function () { return this._getSnapshot(); }; + ScriptVersionCache.prototype._getSnapshot = function () { var snap = this.versions[this.currentVersionToIndex()]; if (this.changes.length > 0) { var snapIndex = snap.index; @@ -77985,6 +79438,24 @@ var ts; } return snap; }; + ScriptVersionCache.prototype.getSnapshotVersion = function () { + return this._getSnapshot().version; + }; + ScriptVersionCache.prototype.getLineInfo = function (line) { + return this._getSnapshot().index.lineNumberToInfo(line); + }; + ScriptVersionCache.prototype.lineOffsetToPosition = function (line, column) { + return this._getSnapshot().index.absolutePositionOfStartOfLine(line) + (column - 1); + }; + ScriptVersionCache.prototype.positionToLineOffset = function (position) { + return this._getSnapshot().index.positionToLineOffset(position); + }; + ScriptVersionCache.prototype.lineToTextSpan = function (line) { + var index = this._getSnapshot().index; + var _a = index.lineNumberToInfo(line + 1), lineText = _a.lineText, absolutePosition = _a.absolutePosition; + var len = lineText !== undefined ? lineText.length : index.absolutePositionOfStartOfLine(line + 2) - absolutePosition; + return ts.createTextSpan(absolutePosition, len); + }; ScriptVersionCache.prototype.getTextChangesBetweenVersions = function (oldVersion, newVersion) { if (oldVersion < newVersion) { if (oldVersion >= this.minVersion) { @@ -78046,7 +79517,6 @@ var ts; }; return LineIndexSnapshot; }()); - server.LineIndexSnapshot = LineIndexSnapshot; var LineIndex = (function () { function LineIndex() { this.checkEdits = false; @@ -78245,18 +79715,18 @@ var ts; var childCharCount = this.children[childIndex].charCount(); var adjustedStart = rangeStart; while (adjustedStart >= childCharCount) { - this.skipChild(adjustedStart, rangeLength, childIndex, walkFns, CharRangeSection.PreStart); + this.skipChild(adjustedStart, rangeLength, childIndex, walkFns, 0); adjustedStart -= childCharCount; childIndex++; childCharCount = this.children[childIndex].charCount(); } if ((adjustedStart + rangeLength) <= childCharCount) { - if (this.execWalk(adjustedStart, rangeLength, walkFns, childIndex, CharRangeSection.Entire)) { + if (this.execWalk(adjustedStart, rangeLength, walkFns, childIndex, 2)) { return; } } else { - if (this.execWalk(adjustedStart, childCharCount - adjustedStart, walkFns, childIndex, CharRangeSection.Start)) { + if (this.execWalk(adjustedStart, childCharCount - adjustedStart, walkFns, childIndex, 1)) { return; } var adjustedLength = rangeLength - (childCharCount - adjustedStart); @@ -78264,7 +79734,7 @@ var ts; var child = this.children[childIndex]; childCharCount = child.charCount(); while (adjustedLength > childCharCount) { - if (this.execWalk(0, childCharCount, walkFns, childIndex, CharRangeSection.Mid)) { + if (this.execWalk(0, childCharCount, walkFns, childIndex, 3)) { return; } adjustedLength -= childCharCount; @@ -78272,7 +79742,7 @@ var ts; childCharCount = this.children[childIndex].charCount(); } if (adjustedLength > 0) { - if (this.execWalk(0, adjustedLength, walkFns, childIndex, CharRangeSection.End)) { + if (this.execWalk(0, adjustedLength, walkFns, childIndex, 4)) { return; } } @@ -78281,82 +79751,46 @@ var ts; var clen = this.children.length; if (childIndex < (clen - 1)) { for (var ej = childIndex + 1; ej < clen; ej++) { - this.skipChild(0, 0, ej, walkFns, CharRangeSection.PostEnd); + this.skipChild(0, 0, ej, walkFns, 5); } } } }; LineNode.prototype.charOffsetToLineInfo = function (lineNumberAccumulator, relativePosition) { - var childInfo = this.childFromCharOffset(lineNumberAccumulator, relativePosition); - if (!childInfo.child) { - return { - oneBasedLine: lineNumberAccumulator, - zeroBasedColumn: relativePosition, - lineText: undefined, - }; + if (this.children.length === 0) { + return { oneBasedLine: lineNumberAccumulator, zeroBasedColumn: relativePosition, lineText: undefined }; } - else if (childInfo.childIndex < this.children.length) { - if (childInfo.child.isLeaf()) { - return { - oneBasedLine: childInfo.lineNumberAccumulator, - zeroBasedColumn: childInfo.relativePosition, - lineText: childInfo.child.text, - }; + for (var _i = 0, _a = this.children; _i < _a.length; _i++) { + var child = _a[_i]; + if (child.charCount() > relativePosition) { + if (child.isLeaf()) { + return { oneBasedLine: lineNumberAccumulator, zeroBasedColumn: relativePosition, lineText: child.text }; + } + else { + return child.charOffsetToLineInfo(lineNumberAccumulator, relativePosition); + } } else { - var lineNode = (childInfo.child); - return lineNode.charOffsetToLineInfo(childInfo.lineNumberAccumulator, childInfo.relativePosition); + relativePosition -= child.charCount(); + lineNumberAccumulator += child.lineCount(); } } - else { - var lineInfo = this.lineNumberToInfo(this.lineCount(), 0); - return { oneBasedLine: this.lineCount(), zeroBasedColumn: lineInfo.leaf.charCount(), lineText: undefined }; - } + var leaf = this.lineNumberToInfo(this.lineCount(), 0).leaf; + return { oneBasedLine: this.lineCount(), zeroBasedColumn: leaf.charCount(), lineText: undefined }; }; LineNode.prototype.lineNumberToInfo = function (relativeOneBasedLine, positionAccumulator) { - var childInfo = this.childFromLineNumber(relativeOneBasedLine, positionAccumulator); - if (!childInfo.child) { - return { position: positionAccumulator, leaf: undefined }; - } - else if (childInfo.child.isLeaf()) { - return { position: childInfo.positionAccumulator, leaf: childInfo.child }; - } - else { - var lineNode = (childInfo.child); - return lineNode.lineNumberToInfo(childInfo.relativeOneBasedLine, childInfo.positionAccumulator); - } - }; - LineNode.prototype.childFromLineNumber = function (relativeOneBasedLine, positionAccumulator) { - var child; - var i; - for (i = 0; i < this.children.length; i++) { - child = this.children[i]; + for (var _i = 0, _a = this.children; _i < _a.length; _i++) { + var child = _a[_i]; var childLineCount = child.lineCount(); if (childLineCount >= relativeOneBasedLine) { - break; + return child.isLeaf() ? { position: positionAccumulator, leaf: child } : child.lineNumberToInfo(relativeOneBasedLine, positionAccumulator); } else { relativeOneBasedLine -= childLineCount; positionAccumulator += child.charCount(); } } - return { child: child, relativeOneBasedLine: relativeOneBasedLine, positionAccumulator: positionAccumulator }; - }; - LineNode.prototype.childFromCharOffset = function (lineNumberAccumulator, relativePosition) { - var child; - var i; - var len; - for (i = 0, len = this.children.length; i < len; i++) { - child = this.children[i]; - if (child.charCount() > relativePosition) { - break; - } - else { - relativePosition -= child.charCount(); - lineNumberAccumulator += child.lineCount(); - } - } - return { child: child, childIndex: i, relativePosition: relativePosition, lineNumberAccumulator: lineNumberAccumulator }; + return { position: positionAccumulator, leaf: undefined }; }; LineNode.prototype.splitAfter = function (childIndex) { var splitNode; @@ -78453,7 +79887,6 @@ var ts; }; return LineNode; }()); - server.LineNode = LineNode; var LineLeaf = (function () { function LineLeaf(text) { this.text = text; @@ -78472,7 +79905,6 @@ var ts; }; return LineLeaf; }()); - server.LineLeaf = LineLeaf; })(server = ts.server || (ts.server = {})); })(ts || (ts = {})); var ts; @@ -78488,7 +79920,7 @@ var ts; } TextStorage.prototype.getVersion = function () { return this.svc - ? "SVC-" + this.svcVersion + "-" + this.svc.getSnapshot().version + ? "SVC-" + this.svcVersion + "-" + this.svc.getSnapshotVersion() : "Text-" + this.textVersion; }; TextStorage.prototype.hasScriptVersionCache = function () { @@ -78526,7 +79958,7 @@ var ts; : ts.ScriptSnapshot.fromString(this.getOrLoadText()); }; TextStorage.prototype.getLineInfo = function (line) { - return this.switchToScriptVersionCache().getSnapshot().index.lineNumberToInfo(line); + return this.switchToScriptVersionCache().getLineInfo(line); }; TextStorage.prototype.lineToTextSpan = function (line) { if (!this.svc) { @@ -78535,23 +79967,20 @@ var ts; var end = line + 1 < lineMap.length ? lineMap[line + 1] : this.text.length; return ts.createTextSpanFromBounds(start, end); } - var index = this.svc.getSnapshot().index; - var _a = index.lineNumberToInfo(line + 1), lineText = _a.lineText, absolutePosition = _a.absolutePosition; - var len = lineText !== undefined ? lineText.length : index.absolutePositionOfStartOfLine(line + 2) - absolutePosition; - return ts.createTextSpan(absolutePosition, len); + return this.svc.lineToTextSpan(line); }; TextStorage.prototype.lineOffsetToPosition = function (line, offset) { if (!this.svc) { return ts.computePositionOfLineAndCharacter(this.getLineMap(), line - 1, offset - 1, this.text); } - return this.svc.getSnapshot().index.absolutePositionOfStartOfLine(line) + (offset - 1); + return this.svc.lineOffsetToPosition(line, offset); }; TextStorage.prototype.positionToLineOffset = function (position) { if (!this.svc) { var _a = ts.computeLineAndCharacterOfPosition(this.getLineMap(), position), line = _a.line, character = _a.character; return { line: line + 1, offset: character + 1 }; } - return this.svc.getSnapshot().index.positionToLineOffset(position); + return this.svc.positionToLineOffset(position); }; TextStorage.prototype.getFileText = function (tempFileName) { return this.host.readFile(tempFileName || this.fileName) || ""; @@ -78817,16 +80246,16 @@ var ts; var compilerOptions = this.getCompilationSettings(); var lastDeletedFileName = this.project.projectService.lastDeletedFile && this.project.projectService.lastDeletedFile.fileName; for (var _i = 0, names_2 = names; _i < names_2.length; _i++) { - var name = names_2[_i]; - var resolution = newResolutions.get(name); + var name_69 = names_2[_i]; + var resolution = newResolutions.get(name_69); if (!resolution) { - var existingResolution = currentResolutionsInFile && currentResolutionsInFile.get(name); + var existingResolution = currentResolutionsInFile && currentResolutionsInFile.get(name_69); if (moduleResolutionIsValid(existingResolution)) { resolution = existingResolution; } else { - resolution = loader(name, containingFile, compilerOptions, this); - newResolutions.set(name, resolution); + resolution = loader(name_69, containingFile, compilerOptions, this); + newResolutions.set(name_69, resolution); } if (logChanges && this.filesWithChangedSetOfUnresolvedImports && !resolutionIsEqualTo(existingResolution, resolution)) { this.filesWithChangedSetOfUnresolvedImports.push(path); @@ -79460,7 +80889,8 @@ var ts; log("Loading " + moduleName + " from " + initialDir + " (resolved to " + resolvedPath + ")"); var result = host.require(resolvedPath, moduleName); if (result.error) { - log("Failed to load module: " + JSON.stringify(result.error)); + var err = result.error.stack || result.error.message || JSON.stringify(result.error); + log("Failed to load module '" + moduleName + "': " + err); return undefined; } return result.module; @@ -79590,7 +81020,7 @@ var ts; return ts.map(this.program.getSourceFiles(), function (sourceFile) { var scriptInfo = _this.projectService.getScriptInfoForPath(sourceFile.path); if (!scriptInfo) { - ts.Debug.assert(false, "scriptInfo for a file '" + sourceFile.fileName + "' is missing."); + ts.Debug.fail("scriptInfo for a file '" + sourceFile.fileName + "' is missing."); } return scriptInfo; }); @@ -79601,6 +81031,9 @@ var ts; } return this.getLanguageService().getEmitOutput(info.fileName, emitOnlyDtsFiles); }; + Project.prototype.getExcludedFiles = function () { + return server.emptyArray; + }; Project.prototype.getFileNames = function (excludeFilesFromExternalLibraries, excludeConfigFiles) { if (!this.program) { return []; @@ -79752,7 +81185,7 @@ var ts; var sourceFile = _b[_a]; this.extractUnresolvedImportsFromSourceFile(sourceFile, result); } - this.lastCachedUnresolvedImportsList = server.toSortedArray(result); + this.lastCachedUnresolvedImportsList = server.toDeduplicatedSortedArray(result); } unresolvedImports = this.lastCachedUnresolvedImportsList; var cachedTypings = this.projectService.typingsCache.getTypingsForProject(this, unresolvedImports, hasChanges); @@ -79804,7 +81237,7 @@ var ts; fileWatcher.close(); } }); - var _loop_8 = function (missingFilePath) { + var _loop_9 = function (missingFilePath) { if (!this_1.missingFilesMap.has(missingFilePath)) { var fileWatcher_1 = this_1.projectService.host.watchFile(missingFilePath, function (_filename, eventKind) { if (eventKind === ts.FileWatcherEventKind.Created && _this.missingFilesMap.has(missingFilePath)) { @@ -79820,7 +81253,7 @@ var ts; var this_1 = this; for (var _b = 0, missingFilePaths_1 = missingFilePaths; _b < missingFilePaths_1.length; _b++) { var missingFilePath = missingFilePaths_1[_b]; - _loop_8(missingFilePath); + _loop_9(missingFilePath); } } var oldExternalFiles = this.externalFiles || server.emptyArray; @@ -79984,10 +81417,11 @@ var ts; server.Project = Project; var InferredProject = (function (_super) { __extends(InferredProject, _super); - function InferredProject(projectService, documentRegistry, compilerOptions) { + function InferredProject(projectService, documentRegistry, compilerOptions, projectRootPath) { var _this = _super.call(this, InferredProject.newName(), ProjectKind.Inferred, projectService, documentRegistry, undefined, true, compilerOptions, false) || this; _this._isJsInferredProject = false; _this.directoriesWatchedForTsconfig = []; + _this.projectRootPath = projectRootPath; return _this; } InferredProject.prototype.toggleJsInferredProject = function (isJsInferredProject) { @@ -80091,7 +81525,7 @@ var ts; } } if (this.projectService.globalPlugins) { - var _loop_9 = function (globalPluginName) { + var _loop_10 = function (globalPluginName) { if (options.plugins && options.plugins.some(function (p) { return p.name === globalPluginName; })) return "continue"; this_2.enablePlugin({ name: globalPluginName, global: true }, searchPaths); @@ -80099,7 +81533,7 @@ var ts; var this_2 = this; for (var _b = 0, _c = this.projectService.globalPlugins; _b < _c.length; _b++) { var globalPluginName = _c[_b]; - _loop_9(globalPluginName); + _loop_10(globalPluginName); } } }; @@ -80222,10 +81656,12 @@ var ts; } this.typeRootsWatchers = undefined; } - this.directoriesWatchedForWildcards.forEach(function (watcher) { - watcher.close(); - }); - this.directoriesWatchedForWildcards = undefined; + if (this.directoriesWatchedForWildcards) { + this.directoriesWatchedForWildcards.forEach(function (watcher) { + watcher.close(); + }); + this.directoriesWatchedForWildcards = undefined; + } this.stopWatchingDirectory(); }; ConfiguredProject.prototype.addOpenRef = function () { @@ -80248,8 +81684,12 @@ var ts; _this.externalProjectName = externalProjectName; _this.compileOnSaveEnabled = compileOnSaveEnabled; _this.projectFilePath = projectFilePath; + _this.excludedFiles = []; return _this; } + ExternalProject.prototype.getExcludedFiles = function () { + return this.excludedFiles; + }; ExternalProject.prototype.getProjectRootPath = function () { if (this.projectFilePath) { return ts.getDirectoryPath(this.projectFilePath); @@ -80455,6 +81895,7 @@ var ts; this.inferredProjects = []; this.configuredProjects = []; this.openFiles = []; + this.compilerOptionsForInferredProjectsPerProjectRoot = ts.createMap(); this.projectToSizeMap = ts.createMap(); this.safelist = defaultTypeSafeList; this.seenProjects = ts.createMap(); @@ -80462,16 +81903,21 @@ var ts; this.logger = opts.logger; this.cancellationToken = opts.cancellationToken; this.useSingleInferredProject = opts.useSingleInferredProject; + this.useInferredProjectPerProjectRoot = opts.useInferredProjectPerProjectRoot; this.typingsInstaller = opts.typingsInstaller || server.nullTypingsInstaller; this.throttleWaitMilliseconds = opts.throttleWaitMilliseconds; this.eventHandler = opts.eventHandler; this.globalPlugins = opts.globalPlugins || server.emptyArray; this.pluginProbeLocations = opts.pluginProbeLocations || server.emptyArray; this.allowLocalPluginLoads = !!opts.allowLocalPluginLoads; + this.typesMapLocation = (opts.typesMapLocation === undefined) ? ts.combinePaths(this.host.getExecutingFilePath(), "../typesMap.json") : opts.typesMapLocation; ts.Debug.assert(!!this.host.createHash, "'ServerHost.createHash' is required for ProjectService"); this.toCanonicalFileName = ts.createGetCanonicalFileName(this.host.useCaseSensitiveFileNames); this.directoryWatchers = new DirectoryWatchers(this); this.throttledOperations = new server.ThrottledOperations(this.host); + if (opts.typesMapLocation) { + this.loadTypesMap(); + } this.typingsInstaller.attach(this); this.typingsCache = new server.TypingsCache(this.typingsInstaller); this.hostConfiguration = { @@ -80494,10 +81940,30 @@ var ts; if (!this.eventHandler) { return; } - this.eventHandler({ + var event = { eventName: server.ProjectLanguageServiceStateEvent, data: { project: project, languageServiceEnabled: languageServiceEnabled } - }); + }; + this.eventHandler(event); + }; + ProjectService.prototype.loadTypesMap = function () { + try { + var fileContent = this.host.readFile(this.typesMapLocation); + if (fileContent === undefined) { + this.logger.info("Provided types map file \"" + this.typesMapLocation + "\" doesn't exist"); + return; + } + var raw = JSON.parse(fileContent); + for (var _i = 0, _a = Object.keys(raw.typesMap); _i < _a.length; _i++) { + var k = _a[_i]; + raw.typesMap[k].match = new RegExp(raw.typesMap[k].match, "i"); + } + this.safelist = raw.typesMap; + } + catch (e) { + this.logger.info("Error loading types map: " + e); + this.safelist = defaultTypeSafeList; + } }; ProjectService.prototype.updateTypingsForProject = function (response) { var project = this.findProject(response.projectName); @@ -80514,16 +81980,28 @@ var ts; } project.updateGraph(); }; - ProjectService.prototype.setCompilerOptionsForInferredProjects = function (projectCompilerOptions) { - this.compilerOptionsForInferredProjects = convertCompilerOptions(projectCompilerOptions); - this.compilerOptionsForInferredProjects.allowNonTsExtensions = true; - this.compileOnSaveForInferredProjects = projectCompilerOptions.compileOnSave; + ProjectService.prototype.setCompilerOptionsForInferredProjects = function (projectCompilerOptions, projectRootPath) { + ts.Debug.assert(projectRootPath === undefined || this.useInferredProjectPerProjectRoot, "Setting compiler options per project root path is only supported when useInferredProjectPerProjectRoot is enabled"); + var compilerOptions = convertCompilerOptions(projectCompilerOptions); + compilerOptions.allowNonTsExtensions = true; + if (projectRootPath) { + this.compilerOptionsForInferredProjectsPerProjectRoot.set(projectRootPath, compilerOptions); + } + else { + this.compilerOptionsForInferredProjects = compilerOptions; + } + var updatedProjects = []; for (var _i = 0, _a = this.inferredProjects; _i < _a.length; _i++) { - var proj = _a[_i]; - proj.setCompilerOptions(this.compilerOptionsForInferredProjects); - proj.compileOnSaveEnabled = projectCompilerOptions.compileOnSave; + var project = _a[_i]; + if (projectRootPath ? + project.projectRootPath === projectRootPath : + !project.projectRootPath || !this.compilerOptionsForInferredProjectsPerProjectRoot.has(project.projectRootPath)) { + project.setCompilerOptions(compilerOptions); + project.compileOnSaveEnabled = compilerOptions.compileOnSave; + updatedProjects.push(project); + } } - this.updateProjectGraphs(this.inferredProjects); + this.updateProjectGraphs(updatedProjects); }; ProjectService.prototype.stopWatchingDirectory = function (directory) { this.directoryWatchers.stopWatchingDirectory(directory); @@ -80630,10 +82108,11 @@ var ts; } for (var _i = 0, _a = this.openFiles; _i < _a.length; _i++) { var openFile = _a[_i]; - this.eventHandler({ + var event_1 = { eventName: server.ContextEvent, data: { project: openFile.getDefaultProject(), fileName: openFile.fileName } - }); + }; + this.eventHandler(event_1); } } this.printProjects(); @@ -80705,7 +82184,7 @@ var ts; break; } }; - ProjectService.prototype.assignScriptInfoToInferredProjectIfNecessary = function (info, addToListOfOpenFiles) { + ProjectService.prototype.assignScriptInfoToInferredProjectIfNecessary = function (info, addToListOfOpenFiles, projectRootPath) { var externalProject = this.findContainingExternalProject(info.fileName); if (externalProject) { if (addToListOfOpenFiles) { @@ -80730,19 +82209,19 @@ var ts; return; } if (info.containingProjects.length === 0) { - var inferredProject = this.createInferredProjectWithRootFileIfNecessary(info); - if (!this.useSingleInferredProject) { + var inferredProject = this.createInferredProjectWithRootFileIfNecessary(info, projectRootPath); + if (!this.useSingleInferredProject && !inferredProject.projectRootPath) { for (var _b = 0, _c = this.openFiles; _b < _c.length; _b++) { var f = _c[_b]; if (f.containingProjects.length === 0 || !inferredProject.containsScriptInfo(f)) { continue; } for (var _d = 0, _e = f.containingProjects; _d < _e.length; _d++) { - var fContainingProject = _e[_d]; - if (fContainingProject.projectKind === server.ProjectKind.Inferred && - fContainingProject.isRoot(f) && - fContainingProject !== inferredProject) { - this.removeProject(fContainingProject); + var containingProject = _e[_d]; + if (containingProject.projectKind === server.ProjectKind.Inferred && + containingProject !== inferredProject && + containingProject.isRoot(f)) { + this.removeProject(containingProject); f.attachToProject(inferredProject); } } @@ -80853,31 +82332,32 @@ var ts; return undefined; }; ProjectService.prototype.printProjects = function () { + var _this = this; if (!this.logger.hasLevel(server.LogLevel.verbose)) { return; } this.logger.startGroup(); var counter = 0; - counter = printProjects(this.logger, this.externalProjects, counter); - counter = printProjects(this.logger, this.configuredProjects, counter); - counter = printProjects(this.logger, this.inferredProjects, counter); - this.logger.info("Open files: "); - for (var _i = 0, _a = this.openFiles; _i < _a.length; _i++) { - var rootFile = _a[_i]; - this.logger.info("\t" + rootFile.fileName); - } - this.logger.endGroup(); - function printProjects(logger, projects, counter) { + var printProjects = function (projects, counter) { for (var _i = 0, projects_4 = projects; _i < projects_4.length; _i++) { var project = projects_4[_i]; project.updateGraph(); - logger.info("Project '" + project.getProjectName() + "' (" + server.ProjectKind[project.projectKind] + ") " + counter); - logger.info(project.filesToString()); - logger.info("-----------------------------------------------"); + _this.logger.info("Project '" + project.getProjectName() + "' (" + server.ProjectKind[project.projectKind] + ") " + counter); + _this.logger.info(project.filesToString()); + _this.logger.info("-----------------------------------------------"); counter++; } return counter; + }; + counter = printProjects(this.externalProjects, counter); + counter = printProjects(this.configuredProjects, counter); + printProjects(this.inferredProjects, counter); + this.logger.info("Open files: "); + for (var _i = 0, _a = this.openFiles; _i < _a.length; _i++) { + var rootFile = _a[_i]; + this.logger.info("\t" + rootFile.fileName); } + this.logger.endGroup(); }; ProjectService.prototype.findConfiguredProjectByProjectName = function (configFileName) { configFileName = server.asNormalizedPath(this.toCanonicalFileName(configFileName)); @@ -80998,10 +82478,11 @@ var ts; if (!this.eventHandler) { return; } - this.eventHandler({ + var event = { eventName: server.ConfigFileDiagEvent, - data: { configFileName: configFileName, diagnostics: diagnostics || [], triggerFile: triggerFile } - }); + data: { configFileName: configFileName, diagnostics: diagnostics || server.emptyArray, triggerFile: triggerFile } + }; + this.eventHandler(event); }; ProjectService.prototype.createAndAddConfiguredProject = function (configFileName, projectOptions, configFileErrors, clientFileName) { var _this = this; @@ -81150,18 +82631,60 @@ var ts; } return configFileErrors; }; - ProjectService.prototype.createInferredProjectWithRootFileIfNecessary = function (root) { + ProjectService.prototype.getOrCreateInferredProjectForProjectRootPathIfEnabled = function (root, projectRootPath) { + if (!this.useInferredProjectPerProjectRoot) { + return undefined; + } + if (projectRootPath) { + for (var _i = 0, _a = this.inferredProjects; _i < _a.length; _i++) { + var project = _a[_i]; + if (project.projectRootPath === projectRootPath) { + return project; + } + } + return this.createInferredProject(false, projectRootPath); + } + var bestMatch; + for (var _b = 0, _c = this.inferredProjects; _b < _c.length; _b++) { + var project = _c[_b]; + if (!project.projectRootPath) + continue; + if (!ts.containsPath(project.projectRootPath, root.path, this.host.getCurrentDirectory(), !this.host.useCaseSensitiveFileNames)) + continue; + if (bestMatch && bestMatch.projectRootPath.length > project.projectRootPath.length) + continue; + bestMatch = project; + } + return bestMatch; + }; + ProjectService.prototype.getOrCreateSingleInferredProjectIfEnabled = function () { + if (!this.useSingleInferredProject) { + return undefined; + } + if (this.inferredProjects.length > 0 && this.inferredProjects[0].projectRootPath === undefined) { + return this.inferredProjects[0]; + } + return this.createInferredProject(true); + }; + ProjectService.prototype.createInferredProject = function (isSingleInferredProject, projectRootPath) { + var compilerOptions = projectRootPath && this.compilerOptionsForInferredProjectsPerProjectRoot.get(projectRootPath) || this.compilerOptionsForInferredProjects; + var project = new server.InferredProject(this, this.documentRegistry, compilerOptions, projectRootPath); + if (isSingleInferredProject) { + this.inferredProjects.unshift(project); + } + else { + this.inferredProjects.push(project); + } + return project; + }; + ProjectService.prototype.createInferredProjectWithRootFileIfNecessary = function (root, projectRootPath) { var _this = this; - var useExistingProject = this.useSingleInferredProject && this.inferredProjects.length; - var project = useExistingProject - ? this.inferredProjects[0] - : new server.InferredProject(this, this.documentRegistry, this.compilerOptionsForInferredProjects); + var project = this.getOrCreateInferredProjectForProjectRootPathIfEnabled(root, projectRootPath) || + this.getOrCreateSingleInferredProjectIfEnabled() || + this.createInferredProject(); project.addRoot(root); this.directoryWatchers.startWatchingContainingDirectoriesForFile(root.fileName, project, function (fileName) { return _this.onConfigFileAddedForInferredProject(fileName); }); project.updateGraph(); - if (!useExistingProject) { - this.inferredProjects.push(project); - } return project; }; ProjectService.prototype.getOrCreateScriptInfo = function (uncheckedFileName, openedByClient, fileContent, scriptKind) { @@ -81294,7 +82817,7 @@ var ts; project.markAsDirty(); } var info = this.getOrCreateScriptInfoForNormalizedPath(fileName, true, fileContent, scriptKind, hasMixedContent); - this.assignScriptInfoToInferredProjectIfNecessary(info, true); + this.assignScriptInfoToInferredProjectIfNecessary(info, true, projectRootPath); this.deleteOrphanScriptInfoNotInAnyProject(); this.printProjects(); return { configFileName: configFileName, configFileErrors: configFileErrors }; @@ -81308,13 +82831,13 @@ var ts; this.printProjects(); }; ProjectService.prototype.collectChanges = function (lastKnownProjectVersions, currentProjects, result) { - var _loop_10 = function (proj) { + var _loop_11 = function (proj) { var knownProject = ts.forEach(lastKnownProjectVersions, function (p) { return p.projectName === proj.getProjectName() && p; }); result.push(proj.getChangesSinceVersion(knownProject && knownProject.version)); }; for (var _i = 0, currentProjects_1 = currentProjects; _i < currentProjects_1.length; _i++) { var proj = currentProjects_1[_i]; - _loop_10(proj); + _loop_11(proj); } }; ProjectService.prototype.synchronizeProjectList = function (knownProjects) { @@ -81419,26 +82942,19 @@ var ts; ProjectService.prototype.resetSafeList = function () { this.safelist = defaultTypeSafeList; }; - ProjectService.prototype.loadSafeList = function (fileName) { - var raw = JSON.parse(this.host.readFile(fileName, "utf-8")); - for (var _i = 0, _a = Object.keys(raw); _i < _a.length; _i++) { - var k = _a[_i]; - raw[k].match = new RegExp(raw[k].match, "i"); - } - this.safelist = raw; - }; ProjectService.prototype.applySafeList = function (proj) { var _this = this; var rootFiles = proj.rootFiles, typeAcquisition = proj.typeAcquisition; var types = (typeAcquisition && typeAcquisition.include) || []; var excludeRules = []; var normalizedNames = rootFiles.map(function (f) { return ts.normalizeSlashes(f.fileName); }); - var _loop_11 = function (name) { - var rule = this_3.safelist[name]; + var excludedFiles = []; + var _loop_12 = function (name_70) { + var rule = this_3.safelist[name_70]; for (var _i = 0, normalizedNames_1 = normalizedNames; _i < normalizedNames_1.length; _i++) { var root = normalizedNames_1[_i]; if (rule.match.test(root)) { - this_3.logger.info("Excluding files based on rule " + name); + this_3.logger.info("Excluding files based on rule " + name_70); if (rule.types) { for (var _a = 0, _b = rule.types; _a < _b.length; _a++) { var type = _b[_a]; @@ -81448,7 +82964,7 @@ var ts; } } if (rule.exclude) { - var _loop_12 = function (exclude) { + var _loop_13 = function (exclude) { var processedRule = root.replace(rule.match, function () { var groups = []; for (var _i = 0; _i < arguments.length; _i++) { @@ -81457,7 +82973,7 @@ var ts; return exclude.map(function (groupNumberOrString) { if (typeof groupNumberOrString === "number") { if (typeof groups[groupNumberOrString] !== "string") { - _this.logger.info("Incorrect RegExp specification in safelist rule " + name + " - not enough groups"); + _this.logger.info("Incorrect RegExp specification in safelist rule " + name_70 + " - not enough groups"); return "\\*"; } return ProjectService.escapeFilenameForRegex(groups[groupNumberOrString]); @@ -81471,7 +82987,7 @@ var ts; }; for (var _c = 0, _d = rule.exclude; _c < _d.length; _c++) { var exclude = _d[_c]; - _loop_12(exclude); + _loop_13(exclude); } } else { @@ -81489,11 +83005,24 @@ var ts; }; var this_3 = this; for (var _i = 0, _a = Object.keys(this.safelist); _i < _a.length; _i++) { - var name = _a[_i]; - _loop_11(name); + var name_70 = _a[_i]; + _loop_12(name_70); } var excludeRegexes = excludeRules.map(function (e) { return new RegExp(e, "i"); }); - proj.rootFiles = proj.rootFiles.filter(function (_file, index) { return !excludeRegexes.some(function (re) { return re.test(normalizedNames[index]); }); }); + var filesToKeep = []; + var _loop_14 = function (i) { + if (excludeRegexes.some(function (re) { return re.test(normalizedNames[i]); })) { + excludedFiles.push(normalizedNames[i]); + } + else { + filesToKeep.push(proj.rootFiles[i]); + } + }; + for (var i = 0; i < proj.rootFiles.length; i++) { + _loop_14(i); + } + proj.rootFiles = filesToKeep; + return excludedFiles; }; ProjectService.prototype.openExternalProject = function (proj, suppressRefreshOfInferredProjects) { if (suppressRefreshOfInferredProjects === void 0) { suppressRefreshOfInferredProjects = false; } @@ -81501,7 +83030,7 @@ var ts; var typeAcquisition = ts.convertEnableAutoDiscoveryToEnable(proj.typingOptions); proj.typeAcquisition = typeAcquisition; } - this.applySafeList(proj); + var excludedFiles = this.applySafeList(proj); var tsConfigFiles; var rootFiles = []; for (var _i = 0, _a = proj.rootFiles; _i < _a.length; _i++) { @@ -81522,6 +83051,7 @@ var ts; var externalProject = this.findExternalProjectByProjectName(proj.projectFileName); var exisingConfigFiles; if (externalProject) { + externalProject.excludedFiles = excludedFiles; if (!tsConfigFiles) { var compilerOptions = convertCompilerOptions(proj.options); if (this.exceededTotalSizeLimitForNonTsFiles(proj.projectFileName, compilerOptions, proj.rootFiles, externalFilePropertyReader)) { @@ -81580,7 +83110,8 @@ var ts; } else { this.externalProjectToConfiguredProjectMap.delete(proj.projectFileName); - this.createAndAddExternalProject(proj.projectFileName, rootFiles, proj.options, proj.typeAcquisition); + var newProj = this.createAndAddExternalProject(proj.projectFileName, rootFiles, proj.options, proj.typeAcquisition); + newProj.excludedFiles = excludedFiles; } if (!suppressRefreshOfInferredProjects) { this.refreshInferredProjects(); @@ -81953,6 +83484,10 @@ var ts; var _this = this; return this.forwardJSONCall("isValidBraceCompletionAtPosition('" + fileName + "', " + position + ", " + openingBrace + ")", function () { return _this.languageService.isValidBraceCompletionAtPosition(fileName, position, openingBrace); }); }; + LanguageServiceShimObject.prototype.getSpanOfEnclosingComment = function (fileName, position, onlyMultiLine) { + var _this = this; + return this.forwardJSONCall("getSpanOfEnclosingComment('" + fileName + "', " + position + ")", function () { return _this.languageService.getSpanOfEnclosingComment(fileName, position, onlyMultiLine); }); + }; LanguageServiceShimObject.prototype.getIndentationAtPosition = function (fileName, position, options) { var _this = this; return this.forwardJSONCall("getIndentationAtPosition('" + fileName + "', " + position + ")", function () { @@ -82248,4 +83783,6 @@ var TypeScript; Services.TypeScriptServicesFactory = ts.TypeScriptServicesFactory; })(Services = TypeScript.Services || (TypeScript.Services = {})); })(TypeScript || (TypeScript = {})); -var toolsVersion = "2.5"; +var toolsVersion = "2.6"; + +//# sourceMappingURL=tsserverlibrary.js.map diff --git a/lib/typescript.d.ts b/lib/typescript.d.ts index 1ca5c4d7736fc..dd56f51d4ac86 100644 --- a/lib/typescript.d.ts +++ b/lib/typescript.d.ts @@ -1210,7 +1210,7 @@ declare namespace ts { interface CatchClause extends Node { kind: SyntaxKind.CatchClause; parent?: TryStatement; - variableDeclaration: VariableDeclaration; + variableDeclaration?: VariableDeclaration; block: Block; } type DeclarationWithTypeParameters = SignatureDeclaration | ClassLikeDeclaration | InterfaceDeclaration | TypeAliasDeclaration | JSDocTemplateTag; @@ -1496,38 +1496,39 @@ declare namespace ts { interface FlowLock { locked?: boolean; } - interface AfterFinallyFlow extends FlowNode, FlowLock { + interface AfterFinallyFlow extends FlowNodeBase, FlowLock { antecedent: FlowNode; } - interface PreFinallyFlow extends FlowNode { + interface PreFinallyFlow extends FlowNodeBase { antecedent: FlowNode; lock: FlowLock; } - interface FlowNode { + type FlowNode = AfterFinallyFlow | PreFinallyFlow | FlowStart | FlowLabel | FlowAssignment | FlowCondition | FlowSwitchClause | FlowArrayMutation; + interface FlowNodeBase { flags: FlowFlags; id?: number; } - interface FlowStart extends FlowNode { + interface FlowStart extends FlowNodeBase { container?: FunctionExpression | ArrowFunction | MethodDeclaration; } - interface FlowLabel extends FlowNode { + interface FlowLabel extends FlowNodeBase { antecedents: FlowNode[]; } - interface FlowAssignment extends FlowNode { + interface FlowAssignment extends FlowNodeBase { node: Expression | VariableDeclaration | BindingElement; antecedent: FlowNode; } - interface FlowCondition extends FlowNode { + interface FlowCondition extends FlowNodeBase { expression: Expression; antecedent: FlowNode; } - interface FlowSwitchClause extends FlowNode { + interface FlowSwitchClause extends FlowNodeBase { switchStatement: SwitchStatement; clauseStart: number; clauseEnd: number; antecedent: FlowNode; } - interface FlowArrayMutation extends FlowNode { + interface FlowArrayMutation extends FlowNodeBase { node: CallExpression | BinaryExpression; antecedent: FlowNode; } @@ -1696,6 +1697,15 @@ declare namespace ts { getSymbolsOfParameterPropertyDeclaration(parameter: ParameterDeclaration, parameterName: string): Symbol[]; getShorthandAssignmentValueSymbol(location: Node): Symbol | undefined; getExportSpecifierLocalTargetSymbol(location: ExportSpecifier): Symbol | undefined; + /** + * If a symbol is a local symbol with an associated exported symbol, returns the exported symbol. + * Otherwise returns its input. + * For example, at `export type T = number;`: + * - `getSymbolAtLocation` at the location `T` will return the exported symbol for `T`. + * - But the result of `getSymbolsInScope` will contain the *local* symbol for `T`, not the exported symbol. + * - Calling `getExportSymbolOfSymbol` on that local symbol will return the exported symbol. + */ + getExportSymbolOfSymbol(symbol: Symbol): Symbol; getPropertySymbolOfDestructuringAssignment(location: Identifier): Symbol | undefined; getTypeAtLocation(node: Node): Type; getTypeFromTypeNode(node: TypeNode): Type; @@ -1790,11 +1800,11 @@ declare namespace ts { UseFullyQualifiedType = 256, InFirstTypeArgument = 512, InTypeAlias = 1024, - UseTypeAliasValue = 2048, SuppressAnyReturnType = 4096, AddUndefined = 8192, WriteClassExpressionAsTypeLiteral = 16384, InArrayType = 32768, + UseAliasDefinedOutsideCurrentScope = 65536, } enum SymbolFormatFlags { None = 0, @@ -2056,6 +2066,7 @@ declare namespace ts { interface TypeVariable extends Type { } interface TypeParameter extends TypeVariable { + /** Retrieve using getConstraintFromTypeParameter */ constraint: Type; default?: Type; } @@ -2103,6 +2114,21 @@ declare namespace ts { NoDefault = 2, AnyDefault = 4, } + /** + * Ternary values are defined such that + * x & y is False if either x or y is False. + * x & y is Maybe if either x or y is Maybe, but neither x or y is False. + * x & y is True if both x and y are True. + * x | y is False if both x and y are False. + * x | y is Maybe if either x or y is Maybe, but neither x or y is True. + * x | y is True if either x or y is True. + */ + enum Ternary { + False = 0, + Maybe = 1, + True = -1, + } + type TypeComparer = (s: Type, t: Type, reportErrors?: boolean) => Ternary; interface JsFileExtensionInfo { extension: string; isMixedContent: boolean; @@ -2195,6 +2221,7 @@ declare namespace ts { outFile?: string; paths?: MapLike; preserveConstEnums?: boolean; + preserveSymlinks?: boolean; project?: string; reactNamespace?: string; jsxFactory?: string; @@ -2300,6 +2327,10 @@ declare namespace ts { readFile(fileName: string): string | undefined; trace?(s: string): void; directoryExists?(directoryName: string): boolean; + /** + * Resolve a symbolic link. + * @see https://nodejs.org/api/fs.html#fs_fs_realpathsync_path_options + */ realpath?(path: string): string; getCurrentDirectory?(): string; getDirectories?(path: string): string[]; @@ -2314,17 +2345,13 @@ declare namespace ts { interface ResolvedModule { /** Path of the file the module was resolved to. */ resolvedFileName: string; - /** - * Denotes if 'resolvedFileName' is isExternalLibraryImport and thus should be a proper external module: - * - be a .d.ts file - * - use top level imports\exports - * - don't use tripleslash references - */ + /** True if `resolvedFileName` comes from `node_modules`. */ isExternalLibraryImport?: boolean; } /** * ResolvedModule with an explicitly provided `extension` property. * Prefer this over `ResolvedModule`. + * If changing this, remember to change `moduleResolutionIsEqualTo`. */ interface ResolvedModuleFull extends ResolvedModule { /** @@ -2332,6 +2359,21 @@ declare namespace ts { * This is optional for backwards-compatibility, but will be added if not provided. */ extension: Extension; + packageId?: PackageId; + } + /** + * Unique identifier with a package name and version. + * If changing this, remember to change `packageIdIsEqual`. + */ + interface PackageId { + /** + * Name of the package. + * Should not include `@types`. + * If accessing a non-index file, this should include its name e.g. "foo/bar". + */ + name: string; + /** Version of the package, e.g. "1.2.3" */ + version: string; } enum Extension { Ts = ".ts", @@ -2593,7 +2635,7 @@ declare namespace ts { } } declare namespace ts { - const versionMajorMinor = "2.5"; + const versionMajorMinor = "2.6"; /** The version of the TypeScript compiler release */ const version: string; } @@ -2741,6 +2783,8 @@ declare namespace ts { function collapseTextChangeRangesAcrossMultipleVersions(changes: ReadonlyArray): TextChangeRange; function getTypeParameterOwner(d: Declaration): Declaration; function isParameterPropertyDeclaration(node: Node): boolean; + function isEmptyBindingPattern(node: BindingName): node is BindingPattern; + function isEmptyBindingElement(node: BindingElement): boolean; function getCombinedModifierFlags(node: Node): ModifierFlags; function getCombinedNodeFlags(node: Node): NodeFlags; /** @@ -3310,8 +3354,8 @@ declare namespace ts { function updateDefaultClause(node: DefaultClause, statements: ReadonlyArray): DefaultClause; function createHeritageClause(token: HeritageClause["token"], types: ReadonlyArray): HeritageClause; function updateHeritageClause(node: HeritageClause, types: ReadonlyArray): HeritageClause; - function createCatchClause(variableDeclaration: string | VariableDeclaration, block: Block): CatchClause; - function updateCatchClause(node: CatchClause, variableDeclaration: VariableDeclaration, block: Block): CatchClause; + function createCatchClause(variableDeclaration: string | VariableDeclaration | undefined, block: Block): CatchClause; + function updateCatchClause(node: CatchClause, variableDeclaration: VariableDeclaration | undefined, block: Block): CatchClause; function createPropertyAssignment(name: string | PropertyName, initializer: Expression): PropertyAssignment; function updatePropertyAssignment(node: PropertyAssignment, name: PropertyName, initializer: Expression): PropertyAssignment; function createShorthandPropertyAssignment(name: string | Identifier, objectAssignmentInitializer?: Expression): ShorthandPropertyAssignment; @@ -3773,6 +3817,7 @@ declare namespace ts { getFormattingEditsAfterKeystroke(fileName: string, position: number, key: string, options: FormatCodeOptions | FormatCodeSettings): TextChange[]; getDocCommentTemplateAtPosition(fileName: string, position: number): TextInsertion; isValidBraceCompletionAtPosition(fileName: string, position: number, openingBrace: number): boolean; + getSpanOfEnclosingComment(fileName: string, position: number, onlyMultiLine: boolean): TextSpan; getCodeFixesAtPosition(fileName: string, start: number, end: number, errorCodes: number[], formatOptions: FormatCodeSettings): CodeAction[]; getApplicableRefactors(fileName: string, positionOrRaneg: number | TextRange): ApplicableRefactorInfo[]; getEditsForRefactor(fileName: string, formatOptions: FormatCodeSettings, positionOrRange: number | TextRange, refactorName: string, actionName: string): RefactorEditInfo | undefined; diff --git a/lib/typescript.js b/lib/typescript.js index eb71a73ba466d..f1356d558c67c 100644 --- a/lib/typescript.js +++ b/lib/typescript.js @@ -511,7 +511,7 @@ var ts; FlowFlags[FlowFlags["Label"] = 12] = "Label"; FlowFlags[FlowFlags["Condition"] = 96] = "Condition"; })(FlowFlags = ts.FlowFlags || (ts.FlowFlags = {})); - var OperationCanceledException = (function () { + var OperationCanceledException = /** @class */ (function () { function OperationCanceledException() { } return OperationCanceledException; @@ -570,11 +570,12 @@ var ts; TypeFormatFlags[TypeFormatFlags["UseFullyQualifiedType"] = 256] = "UseFullyQualifiedType"; TypeFormatFlags[TypeFormatFlags["InFirstTypeArgument"] = 512] = "InFirstTypeArgument"; TypeFormatFlags[TypeFormatFlags["InTypeAlias"] = 1024] = "InTypeAlias"; - TypeFormatFlags[TypeFormatFlags["UseTypeAliasValue"] = 2048] = "UseTypeAliasValue"; TypeFormatFlags[TypeFormatFlags["SuppressAnyReturnType"] = 4096] = "SuppressAnyReturnType"; TypeFormatFlags[TypeFormatFlags["AddUndefined"] = 8192] = "AddUndefined"; TypeFormatFlags[TypeFormatFlags["WriteClassExpressionAsTypeLiteral"] = 16384] = "WriteClassExpressionAsTypeLiteral"; TypeFormatFlags[TypeFormatFlags["InArrayType"] = 32768] = "InArrayType"; + TypeFormatFlags[TypeFormatFlags["UseAliasDefinedOutsideCurrentScope"] = 65536] = "UseAliasDefinedOutsideCurrentScope"; + // even though `T` can't be accessed in the current scope. })(TypeFormatFlags = ts.TypeFormatFlags || (ts.TypeFormatFlags = {})); var SymbolFormatFlags; (function (SymbolFormatFlags) { @@ -860,6 +861,21 @@ var ts; InferenceFlags[InferenceFlags["NoDefault"] = 2] = "NoDefault"; InferenceFlags[InferenceFlags["AnyDefault"] = 4] = "AnyDefault"; })(InferenceFlags = ts.InferenceFlags || (ts.InferenceFlags = {})); + /** + * Ternary values are defined such that + * x & y is False if either x or y is False. + * x & y is Maybe if either x or y is Maybe, but neither x or y is False. + * x & y is True if both x and y are True. + * x | y is False if both x and y are False. + * x | y is Maybe if either x or y is Maybe, but neither x or y is True. + * x | y is True if either x or y is True. + */ + var Ternary; + (function (Ternary) { + Ternary[Ternary["False"] = 0] = "False"; + Ternary[Ternary["Maybe"] = 1] = "Maybe"; + Ternary[Ternary["True"] = -1] = "True"; + })(Ternary = ts.Ternary || (ts.Ternary = {})); /* @internal */ var SpecialPropertyAssignmentKind; (function (SpecialPropertyAssignmentKind) { @@ -1329,27 +1345,12 @@ var ts; (function (ts) { // WARNING: The script `configureNightly.ts` uses a regexp to parse out these values. // If changing the text in this section, be sure to test `configureNightly` too. - ts.versionMajorMinor = "2.5"; + ts.versionMajorMinor = "2.6"; /** The version of the TypeScript compiler release */ ts.version = ts.versionMajorMinor + ".0"; })(ts || (ts = {})); /* @internal */ (function (ts) { - /** - * Ternary values are defined such that - * x & y is False if either x or y is False. - * x & y is Maybe if either x or y is Maybe, but neither x or y is False. - * x & y is True if both x and y are True. - * x | y is False if both x and y are False. - * x | y is Maybe if either x or y is Maybe, but neither x or y is True. - * x | y is True if either x or y is True. - */ - var Ternary; - (function (Ternary) { - Ternary[Ternary["False"] = 0] = "False"; - Ternary[Ternary["Maybe"] = 1] = "Maybe"; - Ternary[Ternary["True"] = -1] = "True"; - })(Ternary = ts.Ternary || (ts.Ternary = {})); // More efficient to create a collator once and use its `compare` than to call `a.localeCompare(b)` many times. ts.collator = typeof Intl === "object" && typeof Intl.Collator === "function" ? new Intl.Collator(/*locales*/ undefined, { usage: "sort", sensitivity: "accent" }) : undefined; // Intl is missing in Safari, and node 0.10 treats "a" as greater than "B". @@ -1403,7 +1404,7 @@ var ts; var MapCtr = typeof Map !== "undefined" && "entries" in Map.prototype ? Map : shimMap(); // Keep the class inside a function so it doesn't get compiled if it's not used. function shimMap() { - var MapIterator = (function () { + var MapIterator = /** @class */ (function () { function MapIterator(data, selector) { this.index = 0; this.data = data; @@ -1420,7 +1421,7 @@ var ts; }; return MapIterator; }()); - return (function () { + return /** @class */ (function () { function class_1() { this.data = createDictionaryObject(); this.size = 0; @@ -1668,10 +1669,9 @@ var ts; ts.removeWhere = removeWhere; function filterMutate(array, f) { var outIndex = 0; - for (var _i = 0, array_3 = array; _i < array_3.length; _i++) { - var item = array_3[_i]; - if (f(item)) { - array[outIndex] = item; + for (var i = 0; i < array.length; i++) { + if (f(array[i], i, array)) { + array[outIndex] = array[i]; outIndex++; } } @@ -1722,8 +1722,8 @@ var ts; var result; if (array) { result = []; - for (var _i = 0, array_4 = array; _i < array_4.length; _i++) { - var v = array_4[_i]; + for (var _i = 0, array_3 = array; _i < array_3.length; _i++) { + var v = array_3[_i]; if (v) { if (isArray(v)) { addRange(result, v); @@ -1799,11 +1799,13 @@ var ts; ts.sameFlatMap = sameFlatMap; function mapDefined(array, mapFn) { var result = []; - for (var i = 0; i < array.length; i++) { - var item = array[i]; - var mapped = mapFn(item, i); - if (mapped !== undefined) { - result.push(mapped); + if (array) { + for (var i = 0; i < array.length; i++) { + var item = array[i]; + var mapped = mapFn(item, i); + if (mapped !== undefined) { + result.push(mapped); + } } } return result; @@ -1882,8 +1884,8 @@ var ts; function some(array, predicate) { if (array) { if (predicate) { - for (var _i = 0, array_5 = array; _i < array_5.length; _i++) { - var v = array_5[_i]; + for (var _i = 0, array_4 = array; _i < array_4.length; _i++) { + var v = array_4[_i]; if (predicate(v)) { return true; } @@ -1909,8 +1911,8 @@ var ts; var result; if (array) { result = []; - loop: for (var _i = 0, array_6 = array; _i < array_6.length; _i++) { - var item = array_6[_i]; + loop: for (var _i = 0, array_5 = array; _i < array_5.length; _i++) { + var item = array_5[_i]; for (var _a = 0, result_1 = result; _a < result_1.length; _a++) { var res = result_1[_a]; if (areEqual ? areEqual(res, item) : res === item) { @@ -2003,8 +2005,8 @@ var ts; ts.relativeComplement = relativeComplement; function sum(array, prop) { var result = 0; - for (var _i = 0, array_7 = array; _i < array_7.length; _i++) { - var v = array_7[_i]; + for (var _i = 0, array_6 = array; _i < array_6.length; _i++) { + var v = array_6[_i]; // Note: we need the following type assertion because of GH #17069 result += v[prop]; } @@ -2336,8 +2338,8 @@ var ts; ts.equalOwnProperties = equalOwnProperties; function arrayToMap(array, makeKey, makeValue) { var result = createMap(); - for (var _i = 0, array_8 = array; _i < array_8.length; _i++) { - var value = array_8[_i]; + for (var _i = 0, array_7 = array; _i < array_7.length; _i++) { + var value = array_7[_i]; result.set(makeKey(value), makeValue ? makeValue(value) : value); } return result; @@ -2502,11 +2504,11 @@ var ts; ts.getLocaleSpecificMessage = getLocaleSpecificMessage; function createFileDiagnostic(file, start, length, message) { var end = start + length; - Debug.assert(start >= 0, "start must be non-negative, is " + start); - Debug.assert(length >= 0, "length must be non-negative, is " + length); + Debug.assertGreaterThanOrEqual(start, 0); + Debug.assertGreaterThanOrEqual(length, 0); if (file) { - Debug.assert(start <= file.text.length, "start must be within the bounds of the file. " + start + " > " + file.text.length); - Debug.assert(end <= file.text.length, "end must be the bounds of the file. " + end + " > " + file.text.length); + Debug.assertLessThanOrEqual(start, file.text.length); + Debug.assertLessThanOrEqual(end, file.text.length); } var text = getLocaleSpecificMessage(message); if (arguments.length > 4) { @@ -2736,19 +2738,23 @@ var ts; return normalized; } function normalizePath(path) { + return normalizePathAndParts(path).path; + } + ts.normalizePath = normalizePath; + function normalizePathAndParts(path) { path = normalizeSlashes(path); var rootLength = getRootLength(path); var root = path.substr(0, rootLength); - var normalized = getNormalizedParts(path, rootLength); - if (normalized.length) { - var joinedParts = root + normalized.join(ts.directorySeparator); - return pathEndsWithDirectorySeparator(path) ? joinedParts + ts.directorySeparator : joinedParts; + var parts = getNormalizedParts(path, rootLength); + if (parts.length) { + var joinedParts = root + parts.join(ts.directorySeparator); + return { path: pathEndsWithDirectorySeparator(path) ? joinedParts + ts.directorySeparator : joinedParts, parts: parts }; } else { - return root; + return { path: root, parts: parts }; } } - ts.normalizePath = normalizePath; + ts.normalizePathAndParts = normalizePathAndParts; /** A path ending with '/' refers to a directory only, never a file. */ function pathEndsWithDirectorySeparator(path) { return path.charCodeAt(path.length - 1) === directorySeparatorCharCode; @@ -3055,14 +3061,43 @@ var ts; // proof. var reservedCharacterPattern = /[^\w\s\/]/g; var wildcardCharCodes = [42 /* asterisk */, 63 /* question */]; - /** - * Matches any single directory segment unless it is the last segment and a .min.js file - * Breakdown: - * [^./] # matches everything up to the first . character (excluding directory seperators) - * (\\.(?!min\\.js$))? # matches . characters but not if they are part of the .min.js file extension - */ - var singleAsteriskRegexFragmentFiles = "([^./]|(\\.(?!min\\.js$))?)*"; - var singleAsteriskRegexFragmentOther = "[^/]*"; + /* @internal */ + ts.commonPackageFolders = ["node_modules", "bower_components", "jspm_packages"]; + var implicitExcludePathRegexPattern = "(?!(" + ts.commonPackageFolders.join("|") + ")(/|$))"; + var filesMatcher = { + /** + * Matches any single directory segment unless it is the last segment and a .min.js file + * Breakdown: + * [^./] # matches everything up to the first . character (excluding directory seperators) + * (\\.(?!min\\.js$))? # matches . characters but not if they are part of the .min.js file extension + */ + singleAsteriskRegexFragment: "([^./]|(\\.(?!min\\.js$))?)*", + /** + * Regex for the ** wildcard. Matches any number of subdirectories. When used for including + * files or directories, does not match subdirectories that start with a . character + */ + doubleAsteriskRegexFragment: "(/" + implicitExcludePathRegexPattern + "[^/.][^/]*)*?", + replaceWildcardCharacter: function (match) { return replaceWildcardCharacter(match, filesMatcher.singleAsteriskRegexFragment); } + }; + var directoriesMatcher = { + singleAsteriskRegexFragment: "[^/]*", + /** + * Regex for the ** wildcard. Matches any number of subdirectories. When used for including + * files or directories, does not match subdirectories that start with a . character + */ + doubleAsteriskRegexFragment: "(/" + implicitExcludePathRegexPattern + "[^/.][^/]*)*?", + replaceWildcardCharacter: function (match) { return replaceWildcardCharacter(match, directoriesMatcher.singleAsteriskRegexFragment); } + }; + var excludeMatcher = { + singleAsteriskRegexFragment: "[^/]*", + doubleAsteriskRegexFragment: "(/.+?)?", + replaceWildcardCharacter: function (match) { return replaceWildcardCharacter(match, excludeMatcher.singleAsteriskRegexFragment); } + }; + var wildcardMatchers = { + files: filesMatcher, + directories: directoriesMatcher, + exclude: excludeMatcher + }; function getRegularExpressionForWildcard(specs, basePath, usage) { var patterns = getRegularExpressionsForWildcards(specs, basePath, usage); if (!patterns || !patterns.length) { @@ -3078,15 +3113,8 @@ var ts; if (specs === undefined || specs.length === 0) { return undefined; } - var replaceWildcardCharacter = usage === "files" ? replaceWildCardCharacterFiles : replaceWildCardCharacterOther; - var singleAsteriskRegexFragment = usage === "files" ? singleAsteriskRegexFragmentFiles : singleAsteriskRegexFragmentOther; - /** - * Regex for the ** wildcard. Matches any number of subdirectories. When used for including - * files or directories, does not match subdirectories that start with a . character - */ - var doubleAsteriskRegexFragment = usage === "exclude" ? "(/.+?)?" : "(/[^/.][^/]*)*?"; return flatMap(specs, function (spec) { - return spec && getSubPatternFromSpec(spec, basePath, usage, singleAsteriskRegexFragment, doubleAsteriskRegexFragment, replaceWildcardCharacter); + return spec && getSubPatternFromSpec(spec, basePath, usage, wildcardMatchers[usage]); }); } /** @@ -3097,7 +3125,8 @@ var ts; return !/[.*?]/.test(lastPathComponent); } ts.isImplicitGlob = isImplicitGlob; - function getSubPatternFromSpec(spec, basePath, usage, singleAsteriskRegexFragment, doubleAsteriskRegexFragment, replaceWildcardCharacter) { + function getSubPatternFromSpec(spec, basePath, usage, _a) { + var singleAsteriskRegexFragment = _a.singleAsteriskRegexFragment, doubleAsteriskRegexFragment = _a.doubleAsteriskRegexFragment, replaceWildcardCharacter = _a.replaceWildcardCharacter; var subpattern = ""; var hasRecursiveDirectoryWildcard = false; var hasWrittenComponent = false; @@ -3131,19 +3160,33 @@ var ts; subpattern += ts.directorySeparator; } if (usage !== "exclude") { + var componentPattern = ""; // The * and ? wildcards should not match directories or files that start with . if they // appear first in a component. Dotted directories and files can be included explicitly // like so: **/.*/.* if (component.charCodeAt(0) === 42 /* asterisk */) { - subpattern += "([^./]" + singleAsteriskRegexFragment + ")?"; + componentPattern += "([^./]" + singleAsteriskRegexFragment + ")?"; component = component.substr(1); } else if (component.charCodeAt(0) === 63 /* question */) { - subpattern += "[^./]"; + componentPattern += "[^./]"; component = component.substr(1); } + componentPattern += component.replace(reservedCharacterPattern, replaceWildcardCharacter); + // Patterns should not include subfolders like node_modules unless they are + // explicitly included as part of the path. + // + // As an optimization, if the component pattern is the same as the component, + // then there definitely were no wildcard characters and we do not need to + // add the exclusion pattern. + if (componentPattern !== component) { + subpattern += implicitExcludePathRegexPattern; + } + subpattern += componentPattern; + } + else { + subpattern += component.replace(reservedCharacterPattern, replaceWildcardCharacter); } - subpattern += component.replace(reservedCharacterPattern, replaceWildcardCharacter); } hasWrittenComponent = true; } @@ -3153,12 +3196,6 @@ var ts; } return subpattern; } - function replaceWildCardCharacterFiles(match) { - return replaceWildcardCharacter(match, singleAsteriskRegexFragmentFiles); - } - function replaceWildCardCharacterOther(match) { - return replaceWildcardCharacter(match, singleAsteriskRegexFragmentOther); - } function replaceWildcardCharacter(match, singleAsteriskRegexFragment) { return match === "*" ? singleAsteriskRegexFragment : match === "?" ? "[^/]" : "\\" + match; } @@ -3319,14 +3356,7 @@ var ts; if (!extraFileExtensions || extraFileExtensions.length === 0 || !needAllExtensions) { return needAllExtensions ? allSupportedExtensions : ts.supportedTypeScriptExtensions; } - var extensions = allSupportedExtensions.slice(0); - for (var _i = 0, extraFileExtensions_1 = extraFileExtensions; _i < extraFileExtensions_1.length; _i++) { - var extInfo = extraFileExtensions_1[_i]; - if (extensions.indexOf(extInfo.extension) === -1) { - extensions.push(extInfo.extension); - } - } - return extensions; + return deduplicate(allSupportedExtensions.concat(extraFileExtensions.map(function (e) { return e.extension; }))); } ts.getSupportedExtensions = getSupportedExtensions; function hasJavaScriptFileExtension(fileName) { @@ -3481,12 +3511,37 @@ var ts; function assert(expression, message, verboseDebugInfo, stackCrawlMark) { if (!expression) { if (verboseDebugInfo) { - message += "\r\nVerbose Debug Information: " + verboseDebugInfo(); + message += "\r\nVerbose Debug Information: " + (typeof verboseDebugInfo === "string" ? verboseDebugInfo : verboseDebugInfo()); } fail(message ? "False expression: " + message : "False expression.", stackCrawlMark || assert); } } Debug.assert = assert; + function assertEqual(a, b, msg, msg2) { + if (a !== b) { + var message = msg ? msg2 ? msg + " " + msg2 : msg : ""; + fail("Expected " + a + " === " + b + ". " + message); + } + } + Debug.assertEqual = assertEqual; + function assertLessThan(a, b, msg) { + if (a >= b) { + fail("Expected " + a + " < " + b + ". " + (msg || "")); + } + } + Debug.assertLessThan = assertLessThan; + function assertLessThanOrEqual(a, b) { + if (a > b) { + fail("Expected " + a + " <= " + b); + } + } + Debug.assertLessThanOrEqual = assertLessThanOrEqual; + function assertGreaterThanOrEqual(a, b) { + if (a < b) { + fail("Expected " + a + " >= " + b); + } + } + Debug.assertGreaterThanOrEqual = assertGreaterThanOrEqual; function fail(message, stackCrawlMark) { debugger; var e = new Error(message ? "Debug Failure. " + message : "Debug Failure."); @@ -3652,6 +3707,10 @@ var ts; Debug.fail("File " + path + " has unknown extension."); } ts.extensionFromPath = extensionFromPath; + function isAnySupportedFileExtension(path) { + return tryGetExtensionFromPath(path) !== undefined; + } + ts.isAnySupportedFileExtension = isAnySupportedFileExtension; function tryGetExtensionFromPath(path) { return find(ts.supportedTypescriptExtensionsForExtractExtension, function (e) { return fileExtensionIs(path, e); }) || find(ts.supportedJavascriptExtensions, function (e) { return fileExtensionIs(path, e); }); } @@ -3664,6 +3723,18 @@ var ts; /// var ts; (function (ts) { + /** + * Set a high stack trace limit to provide more information in case of an error. + * Called for command-line and server use cases. + * Not called if TypeScript is used as a library. + */ + /* @internal */ + function setStackTraceLimit() { + if (Error.stackTraceLimit < 100) { + Error.stackTraceLimit = 100; + } + } + ts.setStackTraceLimit = setStackTraceLimit; var FileWatcherEventKind; (function (FileWatcherEventKind) { FileWatcherEventKind[FileWatcherEventKind["Created"] = 0] = "Created"; @@ -3714,7 +3785,7 @@ var ts; watcher.referenceCount += 1; return; } - watcher = _fs.watch(dirPath, { persistent: true }, function (eventName, relativeFileName) { return fileEventHandler(eventName, relativeFileName, dirPath); }); + watcher = _fs.watch(dirPath || ".", { persistent: true }, function (eventName, relativeFileName) { return fileEventHandler(eventName, relativeFileName, dirPath); }); watcher.referenceCount = 1; dirWatchers.set(dirPath, watcher); return; @@ -4569,6 +4640,8 @@ var ts; Expected_at_least_0_arguments_but_got_a_minimum_of_1: diag(2557, ts.DiagnosticCategory.Error, "Expected_at_least_0_arguments_but_got_a_minimum_of_1_2557", "Expected at least {0} arguments, but got a minimum of {1}."), Expected_0_type_arguments_but_got_1: diag(2558, ts.DiagnosticCategory.Error, "Expected_0_type_arguments_but_got_1_2558", "Expected {0} type arguments, but got {1}."), Type_0_has_no_properties_in_common_with_type_1: diag(2559, ts.DiagnosticCategory.Error, "Type_0_has_no_properties_in_common_with_type_1_2559", "Type '{0}' has no properties in common with type '{1}'."), + Value_of_type_0_has_no_properties_in_common_with_type_1_Did_you_mean_to_call_it: diag(2560, ts.DiagnosticCategory.Error, "Value_of_type_0_has_no_properties_in_common_with_type_1_Did_you_mean_to_call_it_2560", "Value of type '{0}' has no properties in common with type '{1}'. Did you mean to call it?"), + Base_class_expressions_cannot_reference_class_type_parameters: diag(2561, ts.DiagnosticCategory.Error, "Base_class_expressions_cannot_reference_class_type_parameters_2561", "Base class expressions cannot reference class type parameters."), JSX_element_attributes_type_0_may_not_be_a_union_type: diag(2600, ts.DiagnosticCategory.Error, "JSX_element_attributes_type_0_may_not_be_a_union_type_2600", "JSX element attributes type '{0}' may not be a union type."), The_return_type_of_a_JSX_element_constructor_must_return_an_object_type: diag(2601, ts.DiagnosticCategory.Error, "The_return_type_of_a_JSX_element_constructor_must_return_an_object_type_2601", "The return type of a JSX element constructor must return an object type."), JSX_element_implicitly_has_type_any_because_the_global_type_JSX_Element_does_not_exist: diag(2602, ts.DiagnosticCategory.Error, "JSX_element_implicitly_has_type_any_because_the_global_type_JSX_Element_does_not_exist_2602", "JSX element implicitly has type 'any' because the global type 'JSX.Element' does not exist."), @@ -4756,6 +4829,7 @@ var ts; Do_not_emit_outputs: diag(6010, ts.DiagnosticCategory.Message, "Do_not_emit_outputs_6010", "Do not emit outputs."), Allow_default_imports_from_modules_with_no_default_export_This_does_not_affect_code_emit_just_typechecking: diag(6011, ts.DiagnosticCategory.Message, "Allow_default_imports_from_modules_with_no_default_export_This_does_not_affect_code_emit_just_typech_6011", "Allow default imports from modules with no default export. This does not affect code emit, just typechecking."), Skip_type_checking_of_declaration_files: diag(6012, ts.DiagnosticCategory.Message, "Skip_type_checking_of_declaration_files_6012", "Skip type checking of declaration files."), + Do_not_resolve_the_real_path_of_symlinks: diag(6013, ts.DiagnosticCategory.Message, "Do_not_resolve_the_real_path_of_symlinks_6013", "Do not resolve the real path of symlinks."), Specify_ECMAScript_target_version_Colon_ES3_default_ES5_ES2015_ES2016_ES2017_or_ESNEXT: diag(6015, ts.DiagnosticCategory.Message, "Specify_ECMAScript_target_version_Colon_ES3_default_ES5_ES2015_ES2016_ES2017_or_ESNEXT_6015", "Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', or 'ESNEXT'."), Specify_module_code_generation_Colon_none_commonjs_amd_system_umd_es2015_or_ESNext: diag(6016, ts.DiagnosticCategory.Message, "Specify_module_code_generation_Colon_none_commonjs_amd_system_umd_es2015_or_ESNext_6016", "Specify module code generation: 'none', commonjs', 'amd', 'system', 'umd', 'es2015', or 'ESNext'."), Print_this_message: diag(6017, ts.DiagnosticCategory.Message, "Print_this_message_6017", "Print this message."), @@ -5009,6 +5083,8 @@ var ts; Rewrite_as_the_indexed_access_type_0: diag(90026, ts.DiagnosticCategory.Message, "Rewrite_as_the_indexed_access_type_0_90026", "Rewrite as the indexed access type '{0}'."), Convert_function_to_an_ES2015_class: diag(95001, ts.DiagnosticCategory.Message, "Convert_function_to_an_ES2015_class_95001", "Convert function to an ES2015 class"), Convert_function_0_to_class: diag(95002, ts.DiagnosticCategory.Message, "Convert_function_0_to_class_95002", "Convert function '{0}' to class"), + Extract_function: diag(95003, ts.DiagnosticCategory.Message, "Extract_function_95003", "Extract function"), + Extract_function_into_0: diag(95004, ts.DiagnosticCategory.Message, "Extract_function_into_0_95004", "Extract function into '{0}'"), }; })(ts || (ts = {})); /// @@ -6812,19 +6888,6 @@ var ts; return undefined; } ts.getDeclarationOfKind = getDeclarationOfKind; - function findDeclaration(symbol, predicate) { - var declarations = symbol.declarations; - if (declarations) { - for (var _i = 0, declarations_2 = declarations; _i < declarations_2.length; _i++) { - var declaration = declarations_2[_i]; - if (predicate(declaration)) { - return declaration; - } - } - } - return undefined; - } - ts.findDeclaration = findDeclaration; var stringWriter = createSingleLineStringWriter(); var stringWriterAcquired = false; function createSingleLineStringWriter() { @@ -6886,19 +6949,20 @@ var ts; sourceFile.resolvedTypeReferenceDirectiveNames.set(typeReferenceDirectiveName, resolvedTypeReferenceDirective); } ts.setResolvedTypeReferenceDirective = setResolvedTypeReferenceDirective; - /* @internal */ function moduleResolutionIsEqualTo(oldResolution, newResolution) { return oldResolution.isExternalLibraryImport === newResolution.isExternalLibraryImport && oldResolution.extension === newResolution.extension && - oldResolution.resolvedFileName === newResolution.resolvedFileName; + oldResolution.resolvedFileName === newResolution.resolvedFileName && + packageIdIsEqual(oldResolution.packageId, newResolution.packageId); } ts.moduleResolutionIsEqualTo = moduleResolutionIsEqualTo; - /* @internal */ + function packageIdIsEqual(a, b) { + return a === b || a && b && a.name === b.name && a.version === b.version; + } function typeDirectiveIsEqualTo(oldResolution, newResolution) { return oldResolution.resolvedFileName === newResolution.resolvedFileName && oldResolution.primary === newResolution.primary; } ts.typeDirectiveIsEqualTo = typeDirectiveIsEqualTo; - /* @internal */ function hasChangesInResolutions(names, newResolutions, oldResolutions, comparer) { ts.Debug.assert(names.length === newResolutions.length); for (var i = 0; i < names.length; i++) { @@ -6968,14 +7032,6 @@ var ts; return file.fileName + "(" + (loc.line + 1) + "," + (loc.character + 1) + ")"; } ts.nodePosToString = nodePosToString; - function getStartPosOfNode(node) { - return node.pos; - } - ts.getStartPosOfNode = getStartPosOfNode; - function isDefined(value) { - return value !== undefined; - } - ts.isDefined = isDefined; function getEndLinePosition(line, sourceFile) { ts.Debug.assert(line >= 0); var lineStarts = ts.getLineStarts(sourceFile); @@ -7025,6 +7081,32 @@ var ts; return !nodeIsMissing(node); } ts.nodeIsPresent = nodeIsPresent; + /** + * Determine if the given comment is a triple-slash + * + * @return true if the comment is a triple-slash comment else false + */ + function isRecognizedTripleSlashComment(text, commentPos, commentEnd) { + // Verify this is /// comment, but do the regexp match only when we first can find /// in the comment text + // so that we don't end up computing comment string and doing match for all // comments + if (text.charCodeAt(commentPos + 1) === 47 /* slash */ && + commentPos + 2 < commentEnd && + text.charCodeAt(commentPos + 2) === 47 /* slash */) { + var textSubStr = text.substring(commentPos, commentEnd); + return textSubStr.match(ts.fullTripleSlashReferencePathRegEx) || + textSubStr.match(ts.fullTripleSlashAMDReferencePathRegEx) || + textSubStr.match(fullTripleSlashReferenceTypeReferenceDirectiveRegEx) || + textSubStr.match(defaultLibReferenceRegEx) ? + true : false; + } + return false; + } + ts.isRecognizedTripleSlashComment = isRecognizedTripleSlashComment; + function isPinnedComment(text, comment) { + return text.charCodeAt(comment.pos + 1) === 42 /* asterisk */ && + text.charCodeAt(comment.pos + 2) === 33 /* exclamation */; + } + ts.isPinnedComment = isPinnedComment; function getTokenPosOfNode(node, sourceFile, includeJsDoc) { // With nodes that have no width (i.e. 'Missing' nodes), we actually *don't* // want to skip trivia because this will launch us forward to the next token. @@ -7094,15 +7176,20 @@ var ts; // or a (possibly escaped) quoted form of the original text if it's string-like. switch (node.kind) { case 9 /* StringLiteral */: - return '"' + escapeText(node.text) + '"'; + if (node.singleQuote) { + return "'" + escapeText(node.text, 39 /* singleQuote */) + "'"; + } + else { + return '"' + escapeText(node.text, 34 /* doubleQuote */) + '"'; + } case 13 /* NoSubstitutionTemplateLiteral */: - return "`" + escapeText(node.text) + "`"; + return "`" + escapeText(node.text, 96 /* backtick */) + "`"; case 14 /* TemplateHead */: - return "`" + escapeText(node.text) + "${"; + return "`" + escapeText(node.text, 96 /* backtick */) + "${"; case 15 /* TemplateMiddle */: - return "}" + escapeText(node.text) + "${"; + return "}" + escapeText(node.text, 96 /* backtick */) + "${"; case 16 /* TemplateTail */: - return "}" + escapeText(node.text) + "`"; + return "}" + escapeText(node.text, 96 /* backtick */) + "`"; case 8 /* NumericLiteral */: return node.text; } @@ -7191,6 +7278,7 @@ var ts; return ts.isExternalModule(node) || compilerOptions.isolatedModules; } ts.isEffectiveExternalModule = isEffectiveExternalModule; + /* @internal */ function isBlockScope(node, parentNode) { switch (node.kind) { case 265 /* SourceFile */: @@ -7381,13 +7469,9 @@ var ts; } ts.isPrologueDirective = isPrologueDirective; function getLeadingCommentRangesOfNode(node, sourceFileOfNode) { - return ts.getLeadingCommentRanges(sourceFileOfNode.text, node.pos); + return node.kind !== 10 /* JsxText */ ? ts.getLeadingCommentRanges(sourceFileOfNode.text, node.pos) : undefined; } ts.getLeadingCommentRangesOfNode = getLeadingCommentRangesOfNode; - function getLeadingCommentRangesOfNodeFromText(node, text) { - return ts.getLeadingCommentRanges(text, node.pos); - } - ts.getLeadingCommentRangesOfNodeFromText = getLeadingCommentRangesOfNodeFromText; function getJSDocCommentRanges(node, text) { var commentRanges = (node.kind === 146 /* Parameter */ || node.kind === 145 /* TypeParameter */ || @@ -7395,7 +7479,7 @@ var ts; node.kind === 187 /* ArrowFunction */ || node.kind === 185 /* ParenthesizedExpression */) ? ts.concatenate(ts.getTrailingCommentRanges(text, node.pos), ts.getLeadingCommentRanges(text, node.pos)) : - getLeadingCommentRangesOfNodeFromText(node, text); + ts.getLeadingCommentRanges(text, node.pos); // True if the comment starts with '/**' but not if it is '/**/' return ts.filter(commentRanges, function (comment) { return text.charCodeAt(comment.pos + 1) === 42 /* asterisk */ && @@ -7405,8 +7489,9 @@ var ts; } ts.getJSDocCommentRanges = getJSDocCommentRanges; ts.fullTripleSlashReferencePathRegEx = /^(\/\/\/\s*/; - ts.fullTripleSlashReferenceTypeReferenceDirectiveRegEx = /^(\/\/\/\s*/; + var fullTripleSlashReferenceTypeReferenceDirectiveRegEx = /^(\/\/\/\s*/; ts.fullTripleSlashAMDReferencePathRegEx = /^(\/\/\/\s*/; + var defaultLibReferenceRegEx = /^(\/\/\/\s*/; function isPartOfTypeNode(node) { if (158 /* FirstTypeNode */ <= node.kind && node.kind <= 173 /* LastTypeNode */) { return true; @@ -7660,21 +7745,11 @@ var ts; } ts.getPropertyAssignment = getPropertyAssignment; function getContainingFunction(node) { - while (true) { - node = node.parent; - if (!node || ts.isFunctionLike(node)) { - return node; - } - } + return ts.findAncestor(node.parent, ts.isFunctionLike); } ts.getContainingFunction = getContainingFunction; function getContainingClass(node) { - while (true) { - node = node.parent; - if (!node || ts.isClassLike(node)) { - return node; - } - } + return ts.findAncestor(node.parent, ts.isClassLike); } ts.getContainingClass = getContainingClass; function getThisContainer(node, includeArrowFunctions) { @@ -8570,14 +8645,14 @@ var ts; ts.getAncestor = getAncestor; function getFileReferenceFromReferencePath(comment, commentRange) { var simpleReferenceRegEx = /^\/\/\/\s*/gim; + var isNoDefaultLibRegEx = new RegExp(defaultLibReferenceRegEx.source, "gim"); if (simpleReferenceRegEx.test(comment)) { if (isNoDefaultLibRegEx.test(comment)) { return { isNoDefaultLib: true }; } else { var refMatchResult = ts.fullTripleSlashReferencePathRegEx.exec(comment); - var refLibResult = !refMatchResult && ts.fullTripleSlashReferenceTypeReferenceDirectiveRegEx.exec(comment); + var refLibResult = !refMatchResult && fullTripleSlashReferenceTypeReferenceDirectiveRegEx.exec(comment); var match = refMatchResult || refLibResult; if (match) { var pos = commentRange.pos + match[1].length + match[2].length; @@ -8782,10 +8857,6 @@ var ts; return ts.getParseTreeNode(sourceFile, ts.isSourceFile) || sourceFile; } ts.getOriginalSourceFile = getOriginalSourceFile; - function getOriginalSourceFiles(sourceFiles) { - return ts.sameMap(sourceFiles, getOriginalSourceFile); - } - ts.getOriginalSourceFiles = getOriginalSourceFiles; var Associativity; (function (Associativity) { Associativity[Associativity["Left"] = 0] = "Left"; @@ -9029,7 +9100,9 @@ var ts; // the language service. These characters should be escaped when printing, and if any characters are added, // the map below must be updated. Note that this regexp *does not* include the 'delete' character. // There is no reason for this other than that JSON.stringify does not handle it either. - var escapedCharsRegExp = /[\\\"\u0000-\u001f\t\v\f\b\r\n\u2028\u2029\u0085]/g; + var doubleQuoteEscapedCharsRegExp = /[\\\"\u0000-\u001f\t\v\f\b\r\n\u2028\u2029\u0085]/g; + var singleQuoteEscapedCharsRegExp = /[\\\'\u0000-\u001f\t\v\f\b\r\n\u2028\u2029\u0085]/g; + var backtickQuoteEscapedCharsRegExp = /[\\\`\u0000-\u001f\t\v\f\b\r\n\u2028\u2029\u0085]/g; var escapedCharsMap = ts.createMapFromTemplate({ "\0": "\\0", "\t": "\\t", @@ -9040,6 +9113,8 @@ var ts; "\n": "\\n", "\\": "\\\\", "\"": "\\\"", + "\'": "\\\'", + "\`": "\\\`", "\u2028": "\\u2028", "\u2029": "\\u2029", "\u0085": "\\u0085" // nextLine @@ -9049,7 +9124,10 @@ var ts; * but augmented for a few select characters (e.g. lineSeparator, paragraphSeparator, nextLine) * Note that this doesn't actually wrap the input in double quotes. */ - function escapeString(s) { + function escapeString(s, quoteChar) { + var escapedCharsRegExp = quoteChar === 96 /* backtick */ ? backtickQuoteEscapedCharsRegExp : + quoteChar === 39 /* singleQuote */ ? singleQuoteEscapedCharsRegExp : + doubleQuoteEscapedCharsRegExp; return s.replace(escapedCharsRegExp, getReplacement); } ts.escapeString = escapeString; @@ -9069,8 +9147,8 @@ var ts; return "\\u" + paddedHexCode; } var nonAsciiCharacters = /[^\u0000-\u007F]/g; - function escapeNonAsciiString(s) { - s = escapeString(s); + function escapeNonAsciiString(s, quoteChar) { + s = escapeString(s, quoteChar); // Replace non-ASCII characters with '\uNNNN' escapes if any exist. // Otherwise just return the original string. return nonAsciiCharacters.test(s) ? @@ -9455,7 +9533,7 @@ var ts; // // var x = 10; if (node.pos === 0) { - leadingComments = ts.filter(ts.getLeadingCommentRanges(text, node.pos), isPinnedComment); + leadingComments = ts.filter(ts.getLeadingCommentRanges(text, node.pos), isPinnedCommentLocal); } } else { @@ -9495,9 +9573,8 @@ var ts; } } return currentDetachedCommentInfo; - function isPinnedComment(comment) { - return text.charCodeAt(comment.pos + 1) === 42 /* asterisk */ && - text.charCodeAt(comment.pos + 2) === 33 /* exclamation */; + function isPinnedCommentLocal(comment) { + return isPinnedComment(text, comment); } } ts.emitDetachedComments = emitDetachedComments; @@ -9593,9 +9670,13 @@ var ts; } ts.hasModifiers = hasModifiers; function hasModifier(node, flags) { - return (getModifierFlags(node) & flags) !== 0; + return !!getSelectedModifierFlags(node, flags); } ts.hasModifier = hasModifier; + function getSelectedModifierFlags(node, flags) { + return getModifierFlags(node) & flags; + } + ts.getSelectedModifierFlags = getSelectedModifierFlags; function getModifierFlags(node) { if (node.modifierFlagsCache & 536870912 /* HasComputedFlags */) { return node.modifierFlagsCache & ~536870912 /* HasComputedFlags */; @@ -9673,23 +9754,6 @@ var ts; return false; } ts.isDestructuringAssignment = isDestructuringAssignment; - // Returns false if this heritage clause element's expression contains something unsupported - // (i.e. not a name or dotted name). - function isSupportedExpressionWithTypeArguments(node) { - return isSupportedExpressionWithTypeArgumentsRest(node.expression); - } - ts.isSupportedExpressionWithTypeArguments = isSupportedExpressionWithTypeArguments; - function isSupportedExpressionWithTypeArgumentsRest(node) { - if (node.kind === 71 /* Identifier */) { - return true; - } - else if (ts.isPropertyAccessExpression(node)) { - return isSupportedExpressionWithTypeArgumentsRest(node.expression); - } - else { - return false; - } - } function isExpressionWithTypeArgumentsInClassExtendsClause(node) { return tryGetClassExtendingExpressionWithTypeArguments(node) !== undefined; } @@ -9816,78 +9880,6 @@ var ts; return carriageReturnLineFeed; } ts.getNewLineCharacter = getNewLineCharacter; - /** - * Tests whether a node and its subtree is simple enough to have its position - * information ignored when emitting source maps in a destructuring assignment. - * - * @param node The expression to test. - */ - function isSimpleExpression(node) { - return isSimpleExpressionWorker(node, 0); - } - ts.isSimpleExpression = isSimpleExpression; - function isSimpleExpressionWorker(node, depth) { - if (depth <= 5) { - var kind = node.kind; - if (kind === 9 /* StringLiteral */ - || kind === 8 /* NumericLiteral */ - || kind === 12 /* RegularExpressionLiteral */ - || kind === 13 /* NoSubstitutionTemplateLiteral */ - || kind === 71 /* Identifier */ - || kind === 99 /* ThisKeyword */ - || kind === 97 /* SuperKeyword */ - || kind === 101 /* TrueKeyword */ - || kind === 86 /* FalseKeyword */ - || kind === 95 /* NullKeyword */) { - return true; - } - else if (kind === 179 /* PropertyAccessExpression */) { - return isSimpleExpressionWorker(node.expression, depth + 1); - } - else if (kind === 180 /* ElementAccessExpression */) { - return isSimpleExpressionWorker(node.expression, depth + 1) - && isSimpleExpressionWorker(node.argumentExpression, depth + 1); - } - else if (kind === 192 /* PrefixUnaryExpression */ - || kind === 193 /* PostfixUnaryExpression */) { - return isSimpleExpressionWorker(node.operand, depth + 1); - } - else if (kind === 194 /* BinaryExpression */) { - return node.operatorToken.kind !== 40 /* AsteriskAsteriskToken */ - && isSimpleExpressionWorker(node.left, depth + 1) - && isSimpleExpressionWorker(node.right, depth + 1); - } - else if (kind === 195 /* ConditionalExpression */) { - return isSimpleExpressionWorker(node.condition, depth + 1) - && isSimpleExpressionWorker(node.whenTrue, depth + 1) - && isSimpleExpressionWorker(node.whenFalse, depth + 1); - } - else if (kind === 190 /* VoidExpression */ - || kind === 189 /* TypeOfExpression */ - || kind === 188 /* DeleteExpression */) { - return isSimpleExpressionWorker(node.expression, depth + 1); - } - else if (kind === 177 /* ArrayLiteralExpression */) { - return node.elements.length === 0; - } - else if (kind === 178 /* ObjectLiteralExpression */) { - return node.properties.length === 0; - } - else if (kind === 181 /* CallExpression */) { - if (!isSimpleExpressionWorker(node.expression, depth + 1)) { - return false; - } - for (var _i = 0, _a = node.arguments; _i < _a.length; _i++) { - var argument = _a[_i]; - if (!isSimpleExpressionWorker(argument, depth + 1)) { - return false; - } - } - return true; - } - } - return false; - } /** * Formats an enum value as a string for debugging and debug assertions. */ @@ -9959,24 +9951,6 @@ var ts; return formatEnum(flags, ts.ObjectFlags, /*isFlags*/ true); } ts.formatObjectFlags = formatObjectFlags; - function getRangePos(range) { - return range ? range.pos : -1; - } - ts.getRangePos = getRangePos; - function getRangeEnd(range) { - return range ? range.end : -1; - } - ts.getRangeEnd = getRangeEnd; - /** - * Increases (or decreases) a position by the provided amount. - * - * @param pos The position. - * @param value The delta. - */ - function movePos(pos, value) { - return ts.positionIsSynthesized(pos) ? -1 : pos + value; - } - ts.movePos = movePos; /** * Creates a new TextRange from the provided pos and end. * @@ -10034,26 +10008,6 @@ var ts; return range.pos === range.end; } ts.isCollapsedRange = isCollapsedRange; - /** - * Creates a new TextRange from a provided range with its end position collapsed to its - * start position. - * - * @param range A TextRange. - */ - function collapseRangeToStart(range) { - return isCollapsedRange(range) ? range : moveRangeEnd(range, range.pos); - } - ts.collapseRangeToStart = collapseRangeToStart; - /** - * Creates a new TextRange from a provided range with its start position collapsed to its - * end position. - * - * @param range A TextRange. - */ - function collapseRangeToEnd(range) { - return isCollapsedRange(range) ? range : moveRangePos(range, range.end); - } - ts.collapseRangeToEnd = collapseRangeToEnd; /** * Creates a new TextRange for a token at the provides start position. * @@ -10116,31 +10070,6 @@ var ts; function isInitializedVariable(node) { return node.initializer !== undefined; } - /** - * Gets a value indicating whether a node is merged with a class declaration in the same scope. - */ - function isMergedWithClass(node) { - if (node.symbol) { - for (var _i = 0, _a = node.symbol.declarations; _i < _a.length; _i++) { - var declaration = _a[_i]; - if (declaration.kind === 229 /* ClassDeclaration */ && declaration !== node) { - return true; - } - } - } - return false; - } - ts.isMergedWithClass = isMergedWithClass; - /** - * Gets a value indicating whether a node is the first declaration of its kind. - * - * @param node A Declaration node. - * @param kind The SyntaxKind to find among related declarations. - */ - function isFirstDeclarationOfKind(node, kind) { - return node.symbol && getDeclarationOfKind(node.symbol, kind) === node; - } - ts.isFirstDeclarationOfKind = isFirstDeclarationOfKind; function isWatchSet(options) { // Firefox has Object.prototype.watch return options.watch && options.hasOwnProperty("watch"); @@ -10434,6 +10363,20 @@ var ts; return ts.hasModifier(node, 92 /* ParameterPropertyModifier */) && node.parent.kind === 152 /* Constructor */ && ts.isClassLike(node.parent.parent); } ts.isParameterPropertyDeclaration = isParameterPropertyDeclaration; + function isEmptyBindingPattern(node) { + if (ts.isBindingPattern(node)) { + return ts.every(node.elements, isEmptyBindingElement); + } + return false; + } + ts.isEmptyBindingPattern = isEmptyBindingPattern; + function isEmptyBindingElement(node) { + if (ts.isOmittedExpression(node)) { + return true; + } + return isEmptyBindingPattern(node.name); + } + ts.isEmptyBindingElement = isEmptyBindingElement; function walkUpBindingElementsAndPatterns(node) { while (node && (node.kind === 176 /* BindingElement */ || ts.isBindingPattern(node))) { node = node.parent; @@ -11618,6 +11561,19 @@ var ts; return isUnaryExpressionKind(ts.skipPartiallyEmittedExpressions(node).kind); } ts.isUnaryExpression = isUnaryExpression; + /* @internal */ + function isUnaryExpressionWithWrite(expr) { + switch (expr.kind) { + case 193 /* PostfixUnaryExpression */: + return true; + case 192 /* PrefixUnaryExpression */: + return expr.operator === 43 /* PlusPlusToken */ || + expr.operator === 44 /* MinusMinusToken */; + default: + return false; + } + } + ts.isUnaryExpressionWithWrite = isUnaryExpressionWithWrite; function isExpressionKind(kind) { return kind === 195 /* ConditionalExpression */ || kind === 197 /* YieldExpression */ @@ -11824,9 +11780,19 @@ var ts; var kind = node.kind; return isStatementKindButNotDeclarationKind(kind) || isDeclarationStatementKind(kind) - || kind === 207 /* Block */; + || isBlockStatement(node); } ts.isStatement = isStatement; + function isBlockStatement(node) { + if (node.kind !== 207 /* Block */) + return false; + if (node.parent !== undefined) { + if (node.parent.kind === 224 /* TryStatement */ || node.parent.kind === 260 /* CatchClause */) { + return false; + } + } + return !ts.isFunctionBlock(node); + } // Module references /* @internal */ function isModuleReference(node) { @@ -14207,11 +14173,31 @@ var ts; var node = parseTokenNode(); return token() === 23 /* DotToken */ ? undefined : node; } - function parseLiteralTypeNode() { + function parseLiteralTypeNode(negative) { var node = createNode(173 /* LiteralType */); - node.literal = parseSimpleUnaryExpression(); - finishNode(node); - return node; + var unaryMinusExpression; + if (negative) { + unaryMinusExpression = createNode(192 /* PrefixUnaryExpression */); + unaryMinusExpression.operator = 38 /* MinusToken */; + nextToken(); + } + var expression; + switch (token()) { + case 9 /* StringLiteral */: + case 8 /* NumericLiteral */: + expression = parseLiteralLikeNode(token()); + break; + case 101 /* TrueKeyword */: + case 86 /* FalseKeyword */: + expression = parseTokenNode(); + } + if (negative) { + unaryMinusExpression.operand = expression; + finishNode(unaryMinusExpression); + expression = unaryMinusExpression; + } + node.literal = expression; + return finishNode(node); } function nextTokenIsNumericLiteral() { return nextToken() === 8 /* NumericLiteral */; @@ -14244,7 +14230,7 @@ var ts; case 86 /* FalseKeyword */: return parseLiteralTypeNode(); case 38 /* MinusToken */: - return lookAhead(nextTokenIsNumericLiteral) ? parseLiteralTypeNode() : parseTypeReference(); + return lookAhead(nextTokenIsNumericLiteral) ? parseLiteralTypeNode(/*negative*/ true) : parseTypeReference(); case 105 /* VoidKeyword */: case 95 /* NullKeyword */: return parseTokenNode(); @@ -14293,6 +14279,7 @@ var ts; case 101 /* TrueKeyword */: case 86 /* FalseKeyword */: case 134 /* ObjectKeyword */: + case 39 /* AsteriskToken */: return true; case 38 /* MinusToken */: return lookAhead(nextTokenIsNumericLiteral); @@ -14721,7 +14708,7 @@ var ts; // Didn't appear to actually be a parenthesized arrow function. Just bail out. return undefined; } - var isAsync = !!(ts.getModifierFlags(arrowFunction) & 256 /* Async */); + var isAsync = ts.hasModifier(arrowFunction, 256 /* Async */); // If we have an arrow, then try to parse the body. Even if not, try to parse if we // have an opening brace, just in case we're in an error state. var lastToken = token(); @@ -14879,7 +14866,7 @@ var ts; function parseParenthesizedArrowFunctionExpressionHead(allowAmbiguity) { var node = createNode(187 /* ArrowFunction */); node.modifiers = parseModifiersForArrowFunction(); - var isAsync = (ts.getModifierFlags(node) & 256 /* Async */) ? 2 /* Await */ : 0 /* None */; + var isAsync = ts.hasModifier(node, 256 /* Async */) ? 2 /* Await */ : 0 /* None */; // Arrow functions are never generators. // // If we're speculatively parsing a signature for a parenthesized arrow function, then @@ -15890,7 +15877,7 @@ var ts; parseExpected(89 /* FunctionKeyword */); node.asteriskToken = parseOptionalToken(39 /* AsteriskToken */); var isGenerator = node.asteriskToken ? 1 /* Yield */ : 0 /* None */; - var isAsync = (ts.getModifierFlags(node) & 256 /* Async */) ? 2 /* Await */ : 0 /* None */; + var isAsync = ts.hasModifier(node, 256 /* Async */) ? 2 /* Await */ : 0 /* None */; node.name = isGenerator && isAsync ? doInYieldAndAwaitContext(parseOptionalIdentifier) : isGenerator ? doInYieldContext(parseOptionalIdentifier) : @@ -16132,10 +16119,14 @@ var ts; function parseCatchClause() { var result = createNode(260 /* CatchClause */); parseExpected(74 /* CatchKeyword */); - if (parseExpected(19 /* OpenParenToken */)) { + if (parseOptional(19 /* OpenParenToken */)) { result.variableDeclaration = parseVariableDeclaration(); + parseExpected(20 /* CloseParenToken */); + } + else { + // Keep shape of node to avoid degrading performance. + result.variableDeclaration = undefined; } - parseExpected(20 /* CloseParenToken */); result.block = parseBlock(/*ignoreMissingOpenBrace*/ false); return finishNode(result); } @@ -17036,8 +17027,8 @@ var ts; // ImportDeclaration: // import ImportClause from ModuleSpecifier ; // import ModuleSpecifier; - if (identifier || - token() === 39 /* AsteriskToken */ || + if (identifier || // import id + token() === 39 /* AsteriskToken */ || // import * token() === 17 /* OpenBraceToken */) { importDeclaration.importClause = parseImportClause(identifier, afterImportPos); parseExpected(140 /* FromKeyword */); @@ -17345,7 +17336,7 @@ var ts; JSDocParser.parseJSDocTypeExpression = parseJSDocTypeExpression; function parseIsolatedJSDocComment(content, start, length) { initializeState(content, 5 /* Latest */, /*_syntaxCursor:*/ undefined, 1 /* JS */); - sourceFile = { languageVariant: 0 /* Standard */, text: content }; + sourceFile = { languageVariant: 0 /* Standard */, text: content }; // tslint:disable-line no-object-literal-type-assertion var jsDoc = parseJSDocCommentWorker(start, length); var diagnostics = parseDiagnostics; clearState(); @@ -18093,8 +18084,8 @@ var ts; array._children = undefined; array.pos += delta; array.end += delta; - for (var _i = 0, array_9 = array; _i < array_9.length; _i++) { - var node = array_9[_i]; + for (var _i = 0, array_8 = array; _i < array_8.length; _i++) { + var node = array_8[_i]; visitNode(node); } } @@ -18231,8 +18222,8 @@ var ts; array._children = undefined; // Adjust the pos or end (or both) of the intersecting array accordingly. adjustIntersectingElement(array, changeStart, changeRangeOldEnd, changeRangeNewEnd, delta); - for (var _i = 0, array_10 = array; _i < array_10.length; _i++) { - var node = array_10[_i]; + for (var _i = 0, array_9 = array; _i < array_9.length; _i++) { + var node = array_9[_i]; visitNode(node); } return; @@ -19201,40 +19192,23 @@ var ts; return antecedent; } setFlowNodeReferenced(antecedent); - return { - flags: flags, - expression: expression, - antecedent: antecedent - }; + return { flags: flags, expression: expression, antecedent: antecedent }; } function createFlowSwitchClause(antecedent, switchStatement, clauseStart, clauseEnd) { if (!isNarrowingExpression(switchStatement.expression)) { return antecedent; } setFlowNodeReferenced(antecedent); - return { - flags: 128 /* SwitchClause */, - switchStatement: switchStatement, - clauseStart: clauseStart, - clauseEnd: clauseEnd, - antecedent: antecedent - }; + return { flags: 128 /* SwitchClause */, switchStatement: switchStatement, clauseStart: clauseStart, clauseEnd: clauseEnd, antecedent: antecedent }; } function createFlowAssignment(antecedent, node) { setFlowNodeReferenced(antecedent); - return { - flags: 16 /* Assignment */, - antecedent: antecedent, - node: node - }; + return { flags: 16 /* Assignment */, antecedent: antecedent, node: node }; } function createFlowArrayMutation(antecedent, node) { setFlowNodeReferenced(antecedent); - return { - flags: 256 /* ArrayMutation */, - antecedent: antecedent, - node: node - }; + var res = { flags: 256 /* ArrayMutation */, antecedent: antecedent, node: node }; + return res; } function finishFlowLabel(flow) { var antecedents = flow.antecedents; @@ -20956,7 +20930,6 @@ var ts; } function computeParameter(node, subtreeFlags) { var transformFlags = subtreeFlags; - var modifierFlags = ts.getModifierFlags(node); var name = node.name; var initializer = node.initializer; var dotDotDotToken = node.dotDotDotToken; @@ -20969,7 +20942,7 @@ var ts; transformFlags |= 3 /* AssertTypeScript */; } // If a parameter has an accessibility modifier, then it is TypeScript syntax. - if (modifierFlags & 92 /* ParameterPropertyModifier */) { + if (ts.hasModifier(node, 92 /* ParameterPropertyModifier */)) { transformFlags |= 3 /* AssertTypeScript */ | 262144 /* ContainsParameterPropertyAssignments */; } // parameters with object rest destructuring are ES Next syntax @@ -21006,8 +20979,7 @@ var ts; } function computeClassDeclaration(node, subtreeFlags) { var transformFlags; - var modifierFlags = ts.getModifierFlags(node); - if (modifierFlags & 2 /* Ambient */) { + if (ts.hasModifier(node, 2 /* Ambient */)) { // An ambient declaration is TypeScript syntax. transformFlags = 3 /* AssertTypeScript */; } @@ -21068,7 +21040,10 @@ var ts; } function computeCatchClause(node, subtreeFlags) { var transformFlags = subtreeFlags; - if (node.variableDeclaration && ts.isBindingPattern(node.variableDeclaration.name)) { + if (!node.variableDeclaration) { + transformFlags |= 8 /* AssertESNext */; + } + else if (ts.isBindingPattern(node.variableDeclaration.name)) { transformFlags |= 192 /* AssertES2015 */; } node.transformFlags = transformFlags | 536870912 /* HasComputedFlags */; @@ -21283,10 +21258,9 @@ var ts; } function computeVariableStatement(node, subtreeFlags) { var transformFlags; - var modifierFlags = ts.getModifierFlags(node); var declarationListTransformFlags = node.declarationList.transformFlags; // An ambient declaration is TypeScript syntax. - if (modifierFlags & 2 /* Ambient */) { + if (ts.hasModifier(node, 2 /* Ambient */)) { transformFlags = 3 /* AssertTypeScript */; } else { @@ -21634,6 +21608,176 @@ var ts; ts.forEachChild(child, function (childsChild) { return setParentPointers(child, childsChild); }); } })(ts || (ts = {})); +/** @internal */ +var ts; +(function (ts) { + function createGetSymbolWalker(getRestTypeOfSignature, getReturnTypeOfSignature, getBaseTypes, resolveStructuredTypeMembers, getTypeOfSymbol, getResolvedSymbol, getIndexTypeOfStructuredType, getConstraintFromTypeParameter, getFirstIdentifier) { + return getSymbolWalker; + function getSymbolWalker(accept) { + if (accept === void 0) { accept = function () { return true; }; } + var visitedTypes = ts.createMap(); // Key is id as string + var visitedSymbols = ts.createMap(); // Key is id as string + return { + walkType: function (type) { + visitedTypes.clear(); + visitedSymbols.clear(); + visitType(type); + return { visitedTypes: ts.arrayFrom(visitedTypes.values()), visitedSymbols: ts.arrayFrom(visitedSymbols.values()) }; + }, + walkSymbol: function (symbol) { + visitedTypes.clear(); + visitedSymbols.clear(); + visitSymbol(symbol); + return { visitedTypes: ts.arrayFrom(visitedTypes.values()), visitedSymbols: ts.arrayFrom(visitedSymbols.values()) }; + }, + }; + function visitType(type) { + if (!type) { + return; + } + var typeIdString = type.id.toString(); + if (visitedTypes.has(typeIdString)) { + return; + } + visitedTypes.set(typeIdString, type); + // Reuse visitSymbol to visit the type's symbol, + // but be sure to bail on recuring into the type if accept declines the symbol. + var shouldBail = visitSymbol(type.symbol); + if (shouldBail) + return; + // Visit the type's related types, if any + if (type.flags & 32768 /* Object */) { + var objectType = type; + var objectFlags = objectType.objectFlags; + if (objectFlags & 4 /* Reference */) { + visitTypeReference(type); + } + if (objectFlags & 32 /* Mapped */) { + visitMappedType(type); + } + if (objectFlags & (1 /* Class */ | 2 /* Interface */)) { + visitInterfaceType(type); + } + if (objectFlags & (8 /* Tuple */ | 16 /* Anonymous */)) { + visitObjectType(objectType); + } + } + if (type.flags & 16384 /* TypeParameter */) { + visitTypeParameter(type); + } + if (type.flags & 196608 /* UnionOrIntersection */) { + visitUnionOrIntersectionType(type); + } + if (type.flags & 262144 /* Index */) { + visitIndexType(type); + } + if (type.flags & 524288 /* IndexedAccess */) { + visitIndexedAccessType(type); + } + } + function visitTypeList(types) { + if (!types) { + return; + } + for (var i = 0; i < types.length; i++) { + visitType(types[i]); + } + } + function visitTypeReference(type) { + visitType(type.target); + visitTypeList(type.typeArguments); + } + function visitTypeParameter(type) { + visitType(getConstraintFromTypeParameter(type)); + } + function visitUnionOrIntersectionType(type) { + visitTypeList(type.types); + } + function visitIndexType(type) { + visitType(type.type); + } + function visitIndexedAccessType(type) { + visitType(type.objectType); + visitType(type.indexType); + visitType(type.constraint); + } + function visitMappedType(type) { + visitType(type.typeParameter); + visitType(type.constraintType); + visitType(type.templateType); + visitType(type.modifiersType); + } + function visitSignature(signature) { + if (signature.typePredicate) { + visitType(signature.typePredicate.type); + } + visitTypeList(signature.typeParameters); + for (var _i = 0, _a = signature.parameters; _i < _a.length; _i++) { + var parameter = _a[_i]; + visitSymbol(parameter); + } + visitType(getRestTypeOfSignature(signature)); + visitType(getReturnTypeOfSignature(signature)); + } + function visitInterfaceType(interfaceT) { + visitObjectType(interfaceT); + visitTypeList(interfaceT.typeParameters); + visitTypeList(getBaseTypes(interfaceT)); + visitType(interfaceT.thisType); + } + function visitObjectType(type) { + var stringIndexType = getIndexTypeOfStructuredType(type, 0 /* String */); + visitType(stringIndexType); + var numberIndexType = getIndexTypeOfStructuredType(type, 1 /* Number */); + visitType(numberIndexType); + // The two checks above *should* have already resolved the type (if needed), so this should be cached + var resolved = resolveStructuredTypeMembers(type); + for (var _i = 0, _a = resolved.callSignatures; _i < _a.length; _i++) { + var signature = _a[_i]; + visitSignature(signature); + } + for (var _b = 0, _c = resolved.constructSignatures; _b < _c.length; _b++) { + var signature = _c[_b]; + visitSignature(signature); + } + for (var _d = 0, _e = resolved.properties; _d < _e.length; _d++) { + var p = _e[_d]; + visitSymbol(p); + } + } + function visitSymbol(symbol) { + if (!symbol) { + return; + } + var symbolIdString = ts.getSymbolId(symbol).toString(); + if (visitedSymbols.has(symbolIdString)) { + return; + } + visitedSymbols.set(symbolIdString, symbol); + if (!accept(symbol)) { + return true; + } + var t = getTypeOfSymbol(symbol); + visitType(t); // Should handle members on classes and such + if (symbol.flags & 1952 /* HasExports */) { + symbol.exports.forEach(visitSymbol); + } + ts.forEach(symbol.declarations, function (d) { + // Type queries are too far resolved when we just visit the symbol's type + // (their type resolved directly to the member deeply referenced) + // So to get the intervening symbols, we need to check if there's a type + // query node on any of the symbol's declarations and get symbols there + if (d.type && d.type.kind === 162 /* TypeQuery */) { + var query = d.type; + var entity = getResolvedSymbol(getFirstIdentifier(query.exprName)); + visitSymbol(entity); + } + }); + } + } + } + ts.createGetSymbolWalker = createGetSymbolWalker; +})(ts || (ts = {})); /// /// var ts; @@ -21647,6 +21791,12 @@ var ts; return compilerOptions.traceResolution && host.trace !== undefined; } ts.isTraceEnabled = isTraceEnabled; + function withPackageId(packageId, r) { + return r && { path: r.path, extension: r.ext, packageId: packageId }; + } + function noPackageId(r) { + return withPackageId(/*packageId*/ undefined, r); + } /** * Kinds of file that we are currently looking for. * Typically there is one pass with Extensions.TypeScript, then a second pass with Extensions.JavaScript. @@ -21667,13 +21817,12 @@ var ts; } function createResolvedModuleWithFailedLookupLocations(resolved, isExternalLibraryImport, failedLookupLocations) { return { - resolvedModule: resolved && { resolvedFileName: resolved.path, extension: resolved.extension, isExternalLibraryImport: isExternalLibraryImport }, + resolvedModule: resolved && { resolvedFileName: resolved.path, extension: resolved.extension, isExternalLibraryImport: isExternalLibraryImport, packageId: resolved.packageId }, failedLookupLocations: failedLookupLocations }; } /** Reads from "main" or "types"/"typings" depending on `extensions`. */ - function tryReadPackageJsonFields(readTypes, packageJsonPath, baseDirectory, state) { - var jsonContent = readJson(packageJsonPath, state.host); + function tryReadPackageJsonFields(readTypes, jsonContent, baseDirectory, state) { return readTypes ? tryReadFromField("typings") || tryReadFromField("types") : tryReadFromField("main"); function tryReadFromField(fieldName) { if (!ts.hasProperty(jsonContent, fieldName)) { @@ -21778,7 +21927,9 @@ var ts; } var resolvedTypeReferenceDirective; if (resolved) { - resolved = realpath(resolved, host, traceEnabled); + if (!options.preserveSymlinks) { + resolved = realPath(resolved, host, traceEnabled); + } if (traceEnabled) { trace(host, ts.Diagnostics.Type_reference_directive_0_was_successfully_resolved_to_1_primary_Colon_2, typeReferenceDirectiveName, resolved, primary); } @@ -22182,7 +22333,7 @@ var ts; if (extension !== undefined) { var path_1 = tryFile(candidate, failedLookupLocations, /*onlyRecordFailures*/ false, state); if (path_1 !== undefined) { - return { path: path_1, extension: extension }; + return { path: path_1, extension: extension, packageId: undefined }; } } return loader(extensions, candidate, failedLookupLocations, !directoryProbablyExists(ts.getDirectoryPath(candidate), state.host), state); @@ -22209,7 +22360,7 @@ var ts; function resolveJavaScriptModule(moduleName, initialDir, host) { var _a = nodeModuleNameResolverWorker(moduleName, initialDir, { moduleResolution: ts.ModuleResolutionKind.NodeJs, allowJs: true }, host, /*cache*/ undefined, /*jsOnly*/ true), resolvedModule = _a.resolvedModule, failedLookupLocations = _a.failedLookupLocations; if (!resolvedModule) { - throw new Error("Could not resolve JS module " + moduleName + " starting at " + initialDir + ". Looked in: " + failedLookupLocations.join(", ")); + throw new Error("Could not resolve JS module '" + moduleName + "' starting at '" + initialDir + "'. Looked in: " + failedLookupLocations.join(", ")); } return resolvedModule.resolvedFileName; } @@ -22235,17 +22386,24 @@ var ts; trace(host, ts.Diagnostics.Loading_module_0_from_node_modules_folder_target_file_type_1, moduleName, Extensions[extensions]); } var resolved_1 = loadModuleFromNodeModules(extensions, moduleName, containingDirectory, failedLookupLocations, state, cache); + if (!resolved_1) + return undefined; + var resolvedValue = resolved_1.value; + if (!compilerOptions.preserveSymlinks) { + resolvedValue = resolvedValue && __assign({}, resolved_1.value, { path: realPath(resolved_1.value.path, host, traceEnabled), extension: resolved_1.value.extension }); + } // For node_modules lookups, get the real path so that multiple accesses to an `npm link`-ed module do not create duplicate files. - return resolved_1 && { value: resolved_1.value && { resolved: { path: realpath(resolved_1.value.path, host, traceEnabled), extension: resolved_1.value.extension }, isExternalLibraryImport: true } }; + return { value: resolvedValue && { resolved: resolvedValue, isExternalLibraryImport: true } }; } else { - var candidate = ts.normalizePath(ts.combinePaths(containingDirectory, moduleName)); + var _a = ts.normalizePathAndParts(ts.combinePaths(containingDirectory, moduleName)), candidate = _a.path, parts = _a.parts; var resolved_2 = nodeLoadModuleByRelativeName(extensions, candidate, failedLookupLocations, /*onlyRecordFailures*/ false, state, /*considerPackageJson*/ true); - return resolved_2 && toSearchResult({ resolved: resolved_2, isExternalLibraryImport: false }); + // Treat explicit "node_modules" import as an external library import. + return resolved_2 && toSearchResult({ resolved: resolved_2, isExternalLibraryImport: ts.contains(parts, "node_modules") }); } } } - function realpath(path, host, traceEnabled) { + function realPath(path, host, traceEnabled) { if (!host.realpath) { return path; } @@ -22271,7 +22429,7 @@ var ts; } var resolvedFromFile = loadModuleFromFile(extensions, candidate, failedLookupLocations, onlyRecordFailures, state); if (resolvedFromFile) { - return resolvedFromFile; + return noPackageId(resolvedFromFile); } } if (!onlyRecordFailures) { @@ -22291,6 +22449,9 @@ var ts; return !host.directoryExists || host.directoryExists(directoryName); } ts.directoryProbablyExists = directoryProbablyExists; + function loadModuleFromFileNoPackageId(extensions, candidate, failedLookupLocations, onlyRecordFailures, state) { + return noPackageId(loadModuleFromFile(extensions, candidate, failedLookupLocations, onlyRecordFailures, state)); + } /** * @param {boolean} onlyRecordFailures - if true then function won't try to actually load files but instead record all attempts as failures. This flag is necessary * in cases when we know upfront that all load attempts will fail (because containing folder does not exists) however we still need to record all failed lookup locations. @@ -22329,9 +22490,9 @@ var ts; case Extensions.JavaScript: return tryExtension(".js" /* Js */) || tryExtension(".jsx" /* Jsx */); } - function tryExtension(extension) { - var path = tryFile(candidate + extension, failedLookupLocations, onlyRecordFailures, state); - return path && { path: path, extension: extension }; + function tryExtension(ext) { + var path = tryFile(candidate + ext, failedLookupLocations, onlyRecordFailures, state); + return path && { path: path, ext: ext }; } } /** Return the file if it exists. */ @@ -22355,12 +22516,20 @@ var ts; function loadNodeModuleFromDirectory(extensions, candidate, failedLookupLocations, onlyRecordFailures, state, considerPackageJson) { if (considerPackageJson === void 0) { considerPackageJson = true; } var directoryExists = !onlyRecordFailures && directoryProbablyExists(candidate, state.host); + var packageId; if (considerPackageJson) { var packageJsonPath = pathToPackageJson(candidate); if (directoryExists && state.host.fileExists(packageJsonPath)) { - var fromPackageJson = loadModuleFromPackageJson(packageJsonPath, extensions, candidate, failedLookupLocations, state); + if (state.traceEnabled) { + trace(state.host, ts.Diagnostics.Found_package_json_at_0, packageJsonPath); + } + var jsonContent = readJson(packageJsonPath, state.host); + if (typeof jsonContent.name === "string" && typeof jsonContent.version === "string") { + packageId = { name: jsonContent.name, version: jsonContent.version }; + } + var fromPackageJson = loadModuleFromPackageJson(jsonContent, extensions, candidate, failedLookupLocations, state); if (fromPackageJson) { - return fromPackageJson; + return withPackageId(packageId, fromPackageJson); } } else { @@ -22371,13 +22540,10 @@ var ts; failedLookupLocations.push(packageJsonPath); } } - return loadModuleFromFile(extensions, ts.combinePaths(candidate, "index"), failedLookupLocations, !directoryExists, state); + return withPackageId(packageId, loadModuleFromFile(extensions, ts.combinePaths(candidate, "index"), failedLookupLocations, !directoryExists, state)); } - function loadModuleFromPackageJson(packageJsonPath, extensions, candidate, failedLookupLocations, state) { - if (state.traceEnabled) { - trace(state.host, ts.Diagnostics.Found_package_json_at_0, packageJsonPath); - } - var file = tryReadPackageJsonFields(extensions !== Extensions.JavaScript, packageJsonPath, candidate, state); + function loadModuleFromPackageJson(jsonContent, extensions, candidate, failedLookupLocations, state) { + var file = tryReadPackageJsonFields(extensions !== Extensions.JavaScript, jsonContent, candidate, state); if (!file) { return undefined; } @@ -22395,12 +22561,17 @@ var ts; // Even if extensions is DtsOnly, we can still look up a .ts file as a result of package.json "types" var nextExtensions = extensions === Extensions.DtsOnly ? Extensions.TypeScript : extensions; // Don't do package.json lookup recursively, because Node.js' package lookup doesn't. - return nodeLoadModuleByRelativeName(nextExtensions, file, failedLookupLocations, onlyRecordFailures, state, /*considerPackageJson*/ false); + var result = nodeLoadModuleByRelativeName(nextExtensions, file, failedLookupLocations, onlyRecordFailures, state, /*considerPackageJson*/ false); + if (result) { + // It won't have a `packageId` set, because we disabled `considerPackageJson`. + ts.Debug.assert(result.packageId === undefined); + return { path: result.path, ext: result.extension }; + } } /** Resolve from an arbitrarily specified file. Return `undefined` if it has an unsupported extension. */ function resolvedIfExtensionMatches(extensions, path) { - var extension = ts.tryGetExtensionFromPath(path); - return extension !== undefined && extensionIsOk(extensions, extension) ? { path: path, extension: extension } : undefined; + var ext = ts.tryGetExtensionFromPath(path); + return ext !== undefined && extensionIsOk(extensions, ext) ? { path: path, ext: ext } : undefined; } /** True if `extension` is one of the supported `extensions`. */ function extensionIsOk(extensions, extension) { @@ -22418,7 +22589,7 @@ var ts; } function loadModuleFromNodeModulesFolder(extensions, moduleName, nodeModulesFolder, nodeModulesFolderExists, failedLookupLocations, state) { var candidate = ts.normalizePath(ts.combinePaths(nodeModulesFolder, moduleName)); - return loadModuleFromFile(extensions, candidate, failedLookupLocations, !nodeModulesFolderExists, state) || + return loadModuleFromFileNoPackageId(extensions, candidate, failedLookupLocations, !nodeModulesFolderExists, state) || loadNodeModuleFromDirectory(extensions, candidate, failedLookupLocations, !nodeModulesFolderExists, state); } function loadModuleFromNodeModules(extensions, moduleName, directory, failedLookupLocations, state, cache) { @@ -22497,7 +22668,7 @@ var ts; if (traceEnabled) { trace(host, ts.Diagnostics.Resolution_for_module_0_was_found_in_cache, moduleName); } - return { value: result.resolvedModule && { path: result.resolvedModule.resolvedFileName, extension: result.resolvedModule.extension } }; + return { value: result.resolvedModule && { path: result.resolvedModule.resolvedFileName, extension: result.resolvedModule.extension, packageId: result.resolvedModule.packageId } }; } } function classicNameResolver(moduleName, containingFile, compilerOptions, host, cache) { @@ -22508,7 +22679,7 @@ var ts; var resolved = tryResolve(Extensions.TypeScript) || tryResolve(Extensions.JavaScript); return createResolvedModuleWithFailedLookupLocations(resolved && resolved.value, /*isExternalLibraryImport*/ false, failedLookupLocations); function tryResolve(extensions) { - var resolvedUsingSettings = tryLoadModuleUsingOptionalResolutionSettings(extensions, moduleName, containingDirectory, loadModuleFromFile, failedLookupLocations, state); + var resolvedUsingSettings = tryLoadModuleUsingOptionalResolutionSettings(extensions, moduleName, containingDirectory, loadModuleFromFileNoPackageId, failedLookupLocations, state); if (resolvedUsingSettings) { return { value: resolvedUsingSettings }; } @@ -22521,7 +22692,7 @@ var ts; return resolutionFromCache; } var searchName = ts.normalizePath(ts.combinePaths(directory, moduleName)); - return toSearchResult(loadModuleFromFile(extensions, searchName, failedLookupLocations, /*onlyRecordFailures*/ false, state)); + return toSearchResult(loadModuleFromFileNoPackageId(extensions, searchName, failedLookupLocations, /*onlyRecordFailures*/ false, state)); }); if (resolved_3) { return resolved_3; @@ -22533,7 +22704,7 @@ var ts; } else { var candidate = ts.normalizePath(ts.combinePaths(containingDirectory, moduleName)); - return toSearchResult(loadModuleFromFile(extensions, candidate, failedLookupLocations, /*onlyRecordFailures*/ false, state)); + return toSearchResult(loadModuleFromFileNoPackageId(extensions, candidate, failedLookupLocations, /*onlyRecordFailures*/ false, state)); } } } @@ -22578,6 +22749,7 @@ var ts; })(ts || (ts = {})); /// /// +/// /* @internal */ var ts; (function (ts) { @@ -22705,6 +22877,9 @@ var ts; node = ts.getParseTreeNode(node, ts.isExportSpecifier); return node ? getExportSpecifierLocalTargetSymbol(node) : undefined; }, + getExportSymbolOfSymbol: function (symbol) { + return getMergedSymbol(symbol.exportSymbol || symbol); + }, getTypeAtLocation: function (node) { node = ts.getParseTreeNode(node); return node ? getTypeOfNode(node) : unknownType; @@ -22767,6 +22942,7 @@ var ts; getEmitResolver: getEmitResolver, getExportsOfModule: getExportsOfModuleAsArray, getExportsAndPropertiesOfModule: getExportsAndPropertiesOfModule, + getSymbolWalker: ts.createGetSymbolWalker(getRestTypeOfSignature, getReturnTypeOfSignature, getBaseTypes, resolveStructuredTypeMembers, getTypeOfSymbol, getResolvedSymbol, getIndexTypeOfStructuredType, getConstraintFromTypeParameter, getFirstIdentifier), getAmbientModules: getAmbientModules, getAllAttributesTypeFromJsxOpeningLikeElement: function (node) { node = ts.getParseTreeNode(node, ts.isJsxOpeningLikeElement); @@ -22789,11 +22965,10 @@ var ts; getSuggestionForNonexistentProperty: function (node, type) { return ts.unescapeLeadingUnderscores(getSuggestionForNonexistentProperty(node, type)); }, getSuggestionForNonexistentSymbol: function (location, name, meaning) { return ts.unescapeLeadingUnderscores(getSuggestionForNonexistentSymbol(location, ts.escapeLeadingUnderscores(name), meaning)); }, getBaseConstraintOfType: getBaseConstraintOfType, - getJsxNamespace: function () { return ts.unescapeLeadingUnderscores(getJsxNamespace()); }, - resolveNameAtLocation: function (location, name, meaning) { - location = ts.getParseTreeNode(location); - return resolveName(location, ts.escapeLeadingUnderscores(name), meaning, /*nameNotFoundMessage*/ undefined, ts.escapeLeadingUnderscores(name)); + resolveName: function (name, location, meaning) { + return resolveName(location, ts.escapeLeadingUnderscores(name), meaning, /*nameNotFoundMessage*/ undefined, /*nameArg*/ undefined); }, + getJsxNamespace: function () { return ts.unescapeLeadingUnderscores(getJsxNamespace()); }, }; var tupleTypes = []; var unionTypes = ts.createMap(); @@ -23324,12 +23499,17 @@ var ts; // 2. inside a function // 3. inside an instance property initializer, a reference to a non-instance property // 4. inside a static property initializer, a reference to a static method in the same class + // 5. inside a TS export= declaration (since we will move the export statement during emit to avoid TDZ) // or if usage is in a type context: // 1. inside a type query (typeof in type position) - if (usage.parent.kind === 246 /* ExportSpecifier */) { + if (usage.parent.kind === 246 /* ExportSpecifier */ || (usage.parent.kind === 243 /* ExportAssignment */ && usage.parent.isExportEquals)) { // export specifiers do not use the variable, they only make it available for use return true; } + // When resolving symbols for exports, the `usage` location passed in can be the export site directly + if (usage.kind === 243 /* ExportAssignment */ && usage.isExportEquals) { + return true; + } var container = ts.getEnclosingBlockScopeContainer(declaration); return isInTypeQuery(usage) || isUsedInFunctionOrInstanceProperty(usage, declaration, container); function isImmediatelyUsedInInitializerOfBlockScopedVariable(declaration, usage) { @@ -23360,13 +23540,13 @@ var ts; current.parent.kind === 149 /* PropertyDeclaration */ && current.parent.initializer === current; if (initializerOfProperty) { - if (ts.getModifierFlags(current.parent) & 32 /* Static */) { + if (ts.hasModifier(current.parent, 32 /* Static */)) { if (declaration.kind === 151 /* MethodDeclaration */) { return true; } } else { - var isDeclarationInstanceProperty = declaration.kind === 149 /* PropertyDeclaration */ && !(ts.getModifierFlags(declaration) & 32 /* Static */); + var isDeclarationInstanceProperty = declaration.kind === 149 /* PropertyDeclaration */ && !ts.hasModifier(declaration, 32 /* Static */); if (!isDeclarationInstanceProperty || ts.getContainingClass(usage) !== ts.getContainingClass(declaration)) { return true; } @@ -23480,7 +23660,7 @@ var ts; // local variables of the constructor. This effectively means that entities from outer scopes // by the same name as a constructor parameter or local variable are inaccessible // in initializer expressions for instance member variables. - if (ts.isClassLike(location.parent) && !(ts.getModifierFlags(location) & 32 /* Static */)) { + if (ts.isClassLike(location.parent) && !ts.hasModifier(location, 32 /* Static */)) { var ctor = findConstructorDeclaration(location.parent); if (ctor && ctor.locals) { if (lookup(ctor.locals, name, meaning & 107455 /* Value */)) { @@ -23499,7 +23679,7 @@ var ts; result = undefined; break; } - if (lastLocation && ts.getModifierFlags(lastLocation) & 32 /* Static */) { + if (lastLocation && ts.hasModifier(lastLocation, 32 /* Static */)) { // TypeScript 1.0 spec (April 2014): 3.4.1 // The scope of a type parameter extends over the entire declaration with which the type // parameter list is associated, with the exception of static member declarations in classes. @@ -23516,6 +23696,18 @@ var ts; } } break; + case 201 /* ExpressionWithTypeArguments */: + // The type parameters of a class are not in scope in the base class expression. + if (lastLocation === location.expression && location.parent.token === 85 /* ExtendsKeyword */) { + var container = location.parent.parent; + if (ts.isClassLike(container) && (result = lookup(getSymbolOfNode(container).members, name, meaning & 793064 /* Type */))) { + if (nameNotFoundMessage) { + error(errorLocation, ts.Diagnostics.Base_class_expressions_cannot_reference_class_type_parameters); + } + return undefined; + } + } + break; // It is not legal to reference a class's own type parameters from a computed property name that // belongs to the class. For example: // @@ -23585,7 +23777,10 @@ var ts; lastLocation = location; location = location.parent; } - if (result && nameNotFoundMessage && noUnusedIdentifiers) { + // We just climbed up parents looking for the name, meaning that we started in a descendant node of `lastLocation`. + // If `result === lastLocation.symbol`, that means that we are somewhere inside `lastLocation` looking up a name, and resolving to `lastLocation` itself. + // That means that this is a self-reference of `lastLocation`, and shouldn't count this when considering whether `lastLocation` is used. + if (result && nameNotFoundMessage && noUnusedIdentifiers && result !== lastLocation.symbol) { result.isReferenced = true; } if (!result) { @@ -23684,7 +23879,7 @@ var ts; } // No static member is present. // Check if we're in an instance method and look for a relevant instance member. - if (location === container && !(ts.getModifierFlags(location) & 32 /* Static */)) { + if (location === container && !ts.hasModifier(location, 32 /* Static */)) { var instanceType = getDeclaredTypeOfSymbol(classSymbol).thisType; if (getPropertyOfType(instanceType, name)) { error(errorLocation, ts.Diagnostics.Cannot_find_name_0_Did_you_mean_the_instance_member_this_0, diagnosticName(nameArg)); @@ -24130,7 +24325,6 @@ var ts; if (ambientModule) { return ambientModule; } - var isRelative = ts.isExternalModuleNameRelative(moduleReference); var resolvedModule = ts.getResolvedModule(ts.getSourceFileOfNode(location), moduleReference); var resolutionDiagnostic = resolvedModule && ts.getResolutionDiagnostic(compilerOptions, resolvedModule); var sourceFile = resolvedModule && !resolutionDiagnostic && host.getSourceFile(resolvedModule.resolvedFileName); @@ -24152,7 +24346,7 @@ var ts; } } // May be an untyped module. If so, ignore resolutionDiagnostic. - if (!isRelative && resolvedModule && !ts.extensionIsTypeScript(resolvedModule.extension)) { + if (resolvedModule && resolvedModule.isExternalLibraryImport && !ts.extensionIsTypeScript(resolvedModule.extension)) { if (isForAugmentation) { var diag = ts.Diagnostics.Invalid_module_name_in_augmentation_Module_0_resolves_to_an_untyped_module_at_1_which_cannot_be_augmented; error(errorNode, diag, moduleReference, resolvedModule.resolvedFileName); @@ -24186,7 +24380,7 @@ var ts; // An external module with an 'export =' declaration resolves to the target of the 'export =' declaration, // and an external module with no 'export =' declaration resolves to the module itself. function resolveExternalModuleSymbol(moduleSymbol, dontResolveAlias) { - return moduleSymbol && getMergedSymbol(resolveSymbol(moduleSymbol.exports.get("export="), dontResolveAlias)) || moduleSymbol; + return moduleSymbol && getMergedSymbol(resolveSymbol(moduleSymbol.exports.get("export=" /* ExportEquals */), dontResolveAlias)) || moduleSymbol; } // An external module with an 'export =' declaration may be referenced as an ES6 module provided the 'export =' // references a symbol that is at least declared as a module or a variable. The target of the 'export =' may @@ -24199,7 +24393,7 @@ var ts; return symbol; } function hasExportAssignmentSymbol(moduleSymbol) { - return moduleSymbol.exports.get("export=") !== undefined; + return moduleSymbol.exports.get("export=" /* ExportEquals */) !== undefined; } function getExportsOfModuleAsArray(moduleSymbol) { return symbolsToArray(getExportsOfModule(moduleSymbol)); @@ -24461,7 +24655,7 @@ var ts; if (symbolFromSymbolTable.flags & 2097152 /* Alias */ && symbolFromSymbolTable.escapedName !== "export=" && !ts.getDeclarationOfKind(symbolFromSymbolTable, 246 /* ExportSpecifier */)) { - if (!useOnlyExternalAliasing || + if (!useOnlyExternalAliasing || // We can use any type of alias to get the name // Is this external alias, then use it to name ts.forEach(symbolFromSymbolTable.declarations, ts.isExternalModuleImportEqualsDeclaration)) { var resolvedImportedSymbol = resolveAlias(symbolFromSymbolTable); @@ -24526,6 +24720,10 @@ var ts; } return false; } + function isTypeSymbolAccessible(typeSymbol, enclosingDeclaration) { + var access = isSymbolAccessible(typeSymbol, enclosingDeclaration, 793064 /* Type */, /*shouldComputeAliasesToMakeVisible*/ false); + return access.accessibility === 0 /* Accessible */; + } /** * Check if the given symbol in given enclosing declaration is accessible and mark all associated alias to be visible if requested * @@ -24608,7 +24806,7 @@ var ts; // because these kind of aliases can be used to name types in declaration file var anyImportSyntax = getAnyImportSyntax(declaration); if (anyImportSyntax && - !(ts.getModifierFlags(anyImportSyntax) & 1 /* Export */) && + !ts.hasModifier(anyImportSyntax, 1 /* Export */) && // import clause without export isDeclarationVisible(anyImportSyntax.parent)) { // In function "buildTypeDisplay" where we decide whether to write type-alias or serialize types, // we want to just check if type- alias is accessible or not but we don't care about emitting those alias at that time @@ -24817,8 +25015,7 @@ var ts; // Ignore constraint/default when creating a usage (as opposed to declaration) of a type parameter. return ts.createTypeReferenceNode(name, /*typeArguments*/ undefined); } - if (!inTypeAlias && type.aliasSymbol && - isSymbolAccessible(type.aliasSymbol, context.enclosingDeclaration, 793064 /* Type */, /*shouldComputeAliasesToMakeVisible*/ false).accessibility === 0 /* Accessible */) { + if (!inTypeAlias && type.aliasSymbol && isTypeSymbolAccessible(type.aliasSymbol, context.enclosingDeclaration)) { var name = symbolToTypeReferenceName(type.aliasSymbol); var typeArgumentNodes = mapToTypeNodes(type.aliasTypeArguments, context); return ts.createTypeReferenceNode(name, typeArgumentNodes); @@ -24900,10 +25097,10 @@ var ts; return createTypeNodeFromObjectType(type); } function shouldWriteTypeOfFunctionSymbol() { - var isStaticMethodSymbol = !!(symbol.flags & 8192 /* Method */ && - ts.forEach(symbol.declarations, function (declaration) { return ts.getModifierFlags(declaration) & 32 /* Static */; })); + var isStaticMethodSymbol = !!(symbol.flags & 8192 /* Method */) && // typeof static method + ts.some(symbol.declarations, function (declaration) { return ts.hasModifier(declaration, 32 /* Static */); }); var isNonLocalFunctionSymbol = !!(symbol.flags & 16 /* Function */) && - (symbol.parent || + (symbol.parent || // is exported function symbol ts.forEach(symbol.declarations, function (declaration) { return declaration.parent.kind === 265 /* SourceFile */ || declaration.parent.kind === 234 /* ModuleBlock */; })); @@ -24914,10 +25111,8 @@ var ts; } } function createTypeNodeFromObjectType(type) { - if (type.objectFlags & 32 /* Mapped */) { - if (getConstraintTypeFromMappedType(type).flags & (16384 /* TypeParameter */ | 262144 /* Index */)) { - return createMappedTypeNodeFromType(type); - } + if (isGenericMappedType(type)) { + return createMappedTypeNodeFromType(type); } var resolved = resolveStructuredTypeMembers(type); if (!resolved.properties.length && !resolved.stringIndexInfo && !resolved.numberIndexInfo) { @@ -25505,7 +25700,7 @@ var ts; buildSymbolDisplay(type.symbol, writer, enclosingDeclaration, 793064 /* Type */, 0 /* None */, nextFlags); } else if (!(flags & 1024 /* InTypeAlias */) && type.aliasSymbol && - isSymbolAccessible(type.aliasSymbol, enclosingDeclaration, 793064 /* Type */, /*shouldComputeAliasesToMakeVisible*/ false).accessibility === 0 /* Accessible */) { + ((flags & 65536 /* UseAliasDefinedOutsideCurrentScope */) || isTypeSymbolAccessible(type.aliasSymbol, enclosingDeclaration))) { var typeArguments = type.aliasTypeArguments; writeSymbolTypeReference(type.aliasSymbol, typeArguments, 0, ts.length(typeArguments), nextFlags); } @@ -25667,9 +25862,7 @@ var ts; if (!symbolStack) { symbolStack = []; } - var isConstructorObject = type.flags & 32768 /* Object */ && - getObjectFlags(type) & 16 /* Anonymous */ && - type.symbol && type.symbol.flags & 32 /* Class */; + var isConstructorObject = type.objectFlags & 16 /* Anonymous */ && type.symbol && type.symbol.flags & 32 /* Class */; if (isConstructorObject) { writeLiteralType(type, flags); } @@ -25685,17 +25878,17 @@ var ts; writeLiteralType(type, flags); } function shouldWriteTypeOfFunctionSymbol() { - var isStaticMethodSymbol = !!(symbol.flags & 8192 /* Method */ && - ts.forEach(symbol.declarations, function (declaration) { return ts.getModifierFlags(declaration) & 32 /* Static */; })); + var isStaticMethodSymbol = !!(symbol.flags & 8192 /* Method */) && // typeof static method + ts.some(symbol.declarations, function (declaration) { return ts.hasModifier(declaration, 32 /* Static */); }); var isNonLocalFunctionSymbol = !!(symbol.flags & 16 /* Function */) && - (symbol.parent || - ts.forEach(symbol.declarations, function (declaration) { + (symbol.parent || // is exported function symbol + ts.some(symbol.declarations, function (declaration) { return declaration.parent.kind === 265 /* SourceFile */ || declaration.parent.kind === 234 /* ModuleBlock */; })); if (isStaticMethodSymbol || isNonLocalFunctionSymbol) { // typeof is allowed only for static/non local functions - return !!(flags & 4 /* UseTypeOfFunction */) || - (ts.contains(symbolStack, symbol)); // it is type of the symbol uses itself recursively + return !!(flags & 4 /* UseTypeOfFunction */) || // use typeof if format flags specify it + ts.contains(symbolStack, symbol); // it is type of the symbol uses itself recursively } } } @@ -25733,11 +25926,9 @@ var ts; return false; } function writeLiteralType(type, flags) { - if (type.objectFlags & 32 /* Mapped */) { - if (getConstraintTypeFromMappedType(type).flags & (16384 /* TypeParameter */ | 262144 /* Index */)) { - writeMappedType(type); - return; - } + if (isGenericMappedType(type)) { + writeMappedType(type); + return; } var resolved = resolveStructuredTypeMembers(type); if (!resolved.properties.length && !resolved.stringIndexInfo && !resolved.numberIndexInfo) { @@ -26113,7 +26304,7 @@ var ts; case 154 /* SetAccessor */: case 151 /* MethodDeclaration */: case 150 /* MethodSignature */: - if (ts.getModifierFlags(node) & (8 /* Private */ | 16 /* Protected */)) { + if (ts.hasModifier(node, 8 /* Private */ | 16 /* Protected */)) { // Private/protected properties/methods are not visible return false; } @@ -26910,8 +27101,8 @@ var ts; // The function allocates a new array if the input type parameter set is undefined, but otherwise it modifies the set // in-place and returns the same array. function appendTypeParameters(typeParameters, declarations) { - for (var _i = 0, declarations_3 = declarations; _i < declarations_3.length; _i++) { - var declaration = declarations_3[_i]; + for (var _i = 0, declarations_2 = declarations; _i < declarations_2.length; _i++) { + var declaration = declarations_2[_i]; var tp = getDeclaredTypeOfTypeParameter(getSymbolOfNode(declaration)); if (!typeParameters) { typeParameters = [tp]; @@ -27055,7 +27246,7 @@ var ts; return type.resolvedBaseTypes; } function resolveBaseTypesOfClass(type) { - type.resolvedBaseTypes = type.resolvedBaseTypes || ts.emptyArray; + type.resolvedBaseTypes = ts.emptyArray; var baseConstructorType = getApparentType(getBaseConstructorTypeOfClass(type)); if (!(baseConstructorType.flags & (32768 /* Object */ | 131072 /* Intersection */ | 1 /* Any */))) { return; @@ -27104,12 +27295,7 @@ var ts; error(valueDecl, ts.Diagnostics.Type_0_recursively_references_itself_as_a_base_type, typeToString(type, /*enclosingDeclaration*/ undefined, 1 /* WriteArrayAsGenericType */)); return; } - if (type.resolvedBaseTypes === ts.emptyArray) { - type.resolvedBaseTypes = [baseType]; - } - else { - type.resolvedBaseTypes.push(baseType); - } + type.resolvedBaseTypes = [baseType]; } function areAllOuterTypeParametersApplied(type) { // An unapplied type parameter has its symbol still the same as the matching argument symbol. @@ -27221,7 +27407,9 @@ var ts; if (!pushTypeResolution(symbol, 2 /* DeclaredType */)) { return unknownType; } - var declaration = ts.findDeclaration(symbol, function (d) { return d.kind === 283 /* JSDocTypedefTag */ || d.kind === 231 /* TypeAliasDeclaration */; }); + var declaration = ts.find(symbol.declarations, function (d) { + return d.kind === 283 /* JSDocTypedefTag */ || d.kind === 231 /* TypeAliasDeclaration */; + }); var type = getTypeFromTypeNode(declaration.kind === 283 /* JSDocTypedefTag */ ? declaration.typeExpression : declaration.type); if (popTypeResolution()) { var typeParameters = getLocalTypeParametersOfClassOrInterfaceOrTypeAlias(symbol); @@ -27753,17 +27941,12 @@ var ts; else { // Combinations of function, class, enum and module var members = emptySymbols; - var constructSignatures = ts.emptyArray; var stringIndexInfo = undefined; if (symbol.exports) { members = getExportsOfSymbol(symbol); } if (symbol.flags & 32 /* Class */) { var classType = getDeclaredTypeOfClassOrInterface(symbol); - constructSignatures = getSignaturesOfSymbol(symbol.members.get("__constructor" /* Constructor */)); - if (!constructSignatures.length) { - constructSignatures = getDefaultConstructSignatures(classType); - } var baseConstructorType = getBaseConstructorTypeOfClass(classType); if (baseConstructorType.flags & (32768 /* Object */ | 131072 /* Intersection */ | 540672 /* TypeVariable */)) { members = ts.createSymbolTable(getNamedMembers(members)); @@ -27774,7 +27957,7 @@ var ts; } } var numberIndexInfo = symbol.flags & 384 /* Enum */ ? enumNumberIndexInfo : undefined; - setStructuredTypeMembers(type, members, ts.emptyArray, constructSignatures, stringIndexInfo, numberIndexInfo); + setStructuredTypeMembers(type, members, ts.emptyArray, ts.emptyArray, stringIndexInfo, numberIndexInfo); // We resolve the members before computing the signatures because a signature may use // typeof with a qualified name expression that circularly references the type we are // in the process of resolving (see issue #6072). The temporarily empty signature list @@ -27782,6 +27965,15 @@ var ts; if (symbol.flags & (16 /* Function */ | 8192 /* Method */)) { type.callSignatures = getSignaturesOfSymbol(symbol); } + // And likewise for construct signatures for classes + if (symbol.flags & 32 /* Class */) { + var classType = getDeclaredTypeOfClassOrInterface(symbol); + var constructSignatures = getSignaturesOfSymbol(symbol.members.get("__constructor" /* Constructor */)); + if (!constructSignatures.length) { + constructSignatures = getDefaultConstructSignatures(classType); + } + type.constructSignatures = constructSignatures; + } } } /** Resolve the members of a mapped type { [P in K]: T } */ @@ -27883,8 +28075,7 @@ var ts; return getObjectFlags(type) & 32 /* Mapped */ && !!type.declaration.questionToken; } function isGenericMappedType(type) { - return getObjectFlags(type) & 32 /* Mapped */ && - maybeTypeOfKind(getConstraintTypeFromMappedType(type), 540672 /* TypeVariable */ | 262144 /* Index */); + return getObjectFlags(type) & 32 /* Mapped */ && isGenericIndexType(getConstraintTypeFromMappedType(type)); } function resolveStructuredTypeMembers(type) { if (!type.members) { @@ -27990,6 +28181,10 @@ var ts; return hasNonCircularBaseConstraint(typeParameter) ? getConstraintFromTypeParameter(typeParameter) : undefined; } function getConstraintOfIndexedAccess(type) { + var transformed = getTransformedIndexedAccessType(type); + if (transformed) { + return transformed; + } var baseObjectType = getBaseConstraintOfType(type.objectType); var baseIndexType = getBaseConstraintOfType(type.indexType); return baseObjectType || baseIndexType ? getIndexedAccessType(baseObjectType || type.objectType, baseIndexType || type.indexType) : undefined; @@ -28057,11 +28252,18 @@ var ts; return stringType; } if (t.flags & 524288 /* IndexedAccess */) { + var transformed = getTransformedIndexedAccessType(t); + if (transformed) { + return getBaseConstraint(transformed); + } var baseObjectType = getBaseConstraint(t.objectType); var baseIndexType = getBaseConstraint(t.indexType); var baseIndexedAccess = baseObjectType && baseIndexType ? getIndexedAccessType(baseObjectType, baseIndexType) : undefined; return baseIndexedAccess && baseIndexedAccess !== unknownType ? getBaseConstraint(baseIndexedAccess) : undefined; } + if (isGenericMappedType(t)) { + return emptyObjectType; + } return t; } } @@ -28608,6 +28810,9 @@ var ts; } return signature.resolvedReturnType; } + function isResolvingReturnTypeOfSignature(signature) { + return !signature.resolvedReturnType && findResolutionCycleStartIndex(signature, 3 /* ResolvedReturnType */) >= 0; + } function getRestTypeOfSignature(signature) { if (signature.hasRestParameter) { var type = getTypeOfSymbol(ts.lastOrUndefined(signature.parameters)); @@ -28680,7 +28885,7 @@ var ts; function getIndexInfoOfSymbol(symbol, kind) { var declaration = getIndexDeclarationOfSymbol(symbol, kind); if (declaration) { - return createIndexInfo(declaration.type ? getTypeFromTypeNode(declaration.type) : anyType, (ts.getModifierFlags(declaration) & 64 /* Readonly */) !== 0, declaration); + return createIndexInfo(declaration.type ? getTypeFromTypeNode(declaration.type) : anyType, ts.hasModifier(declaration, 64 /* Readonly */), declaration); } return undefined; } @@ -28978,8 +29183,8 @@ var ts; function getTypeOfGlobalSymbol(symbol, arity) { function getTypeDeclaration(symbol) { var declarations = symbol.declarations; - for (var _i = 0, declarations_4 = declarations; _i < declarations_4.length; _i++) { - var declaration = declarations_4[_i]; + for (var _i = 0, declarations_3 = declarations; _i < declarations_3.length; _i++) { + var declaration = declarations_3[_i]; switch (declaration.kind) { case 229 /* ClassDeclaration */: case 230 /* InterfaceDeclaration */: @@ -29475,17 +29680,16 @@ var ts; return getTypeOfSymbol(prop); } } - if (isTypeAnyOrAllConstituentTypesHaveKind(indexType, 262178 /* StringLike */ | 84 /* NumberLike */ | 512 /* ESSymbol */)) { + if (!(indexType.flags & 6144 /* Nullable */) && isTypeAssignableToKind(indexType, 262178 /* StringLike */ | 84 /* NumberLike */ | 512 /* ESSymbol */)) { if (isTypeAny(objectType)) { return anyType; } - var indexInfo = isTypeAnyOrAllConstituentTypesHaveKind(indexType, 84 /* NumberLike */) && getIndexInfoOfType(objectType, 1 /* Number */) || + var indexInfo = isTypeAssignableToKind(indexType, 84 /* NumberLike */) && getIndexInfoOfType(objectType, 1 /* Number */) || getIndexInfoOfType(objectType, 0 /* String */) || undefined; if (indexInfo) { if (accessExpression && indexInfo.isReadonly && (ts.isAssignmentTarget(accessExpression) || ts.isDeleteTarget(accessExpression))) { error(accessExpression, ts.Diagnostics.Index_signature_in_type_0_only_permits_reading, typeToString(objectType)); - return unknownType; } return indexInfo.type; } @@ -29517,35 +29721,84 @@ var ts; return anyType; } function getIndexedAccessForMappedType(type, indexType, accessNode) { - var accessExpression = accessNode && accessNode.kind === 180 /* ElementAccessExpression */ ? accessNode : undefined; - if (accessExpression && ts.isAssignmentTarget(accessExpression) && type.declaration.readonlyToken) { - error(accessExpression, ts.Diagnostics.Index_signature_in_type_0_only_permits_reading, typeToString(type)); - return unknownType; + if (accessNode) { + // Check if the index type is assignable to 'keyof T' for the object type. + if (!isTypeAssignableTo(indexType, getIndexType(type))) { + error(accessNode, ts.Diagnostics.Type_0_cannot_be_used_to_index_type_1, typeToString(indexType), typeToString(type)); + return unknownType; + } + if (accessNode.kind === 180 /* ElementAccessExpression */ && ts.isAssignmentTarget(accessNode) && type.declaration.readonlyToken) { + error(accessNode, ts.Diagnostics.Index_signature_in_type_0_only_permits_reading, typeToString(type)); + } } var mapper = createTypeMapper([getTypeParameterFromMappedType(type)], [indexType]); var templateMapper = type.mapper ? combineTypeMappers(type.mapper, mapper) : mapper; return instantiateType(getTemplateTypeFromMappedType(type), templateMapper); } + function isGenericObjectType(type) { + return type.flags & 540672 /* TypeVariable */ ? true : + getObjectFlags(type) & 32 /* Mapped */ ? isGenericIndexType(getConstraintTypeFromMappedType(type)) : + type.flags & 196608 /* UnionOrIntersection */ ? ts.forEach(type.types, isGenericObjectType) : + false; + } + function isGenericIndexType(type) { + return type.flags & (540672 /* TypeVariable */ | 262144 /* Index */) ? true : + type.flags & 196608 /* UnionOrIntersection */ ? ts.forEach(type.types, isGenericIndexType) : + false; + } + // Return true if the given type is a non-generic object type with a string index signature and no + // other members. + function isStringIndexOnlyType(type) { + if (type.flags & 32768 /* Object */ && !isGenericMappedType(type)) { + var t = resolveStructuredTypeMembers(type); + return t.properties.length === 0 && + t.callSignatures.length === 0 && t.constructSignatures.length === 0 && + t.stringIndexInfo && !t.numberIndexInfo; + } + return false; + } + // Given an indexed access type T[K], if T is an intersection containing one or more generic types and one or + // more object types with only a string index signature, e.g. '(U & V & { [x: string]: D })[K]', return a + // transformed type of the form '(U & V)[K] | D'. This allows us to properly reason about higher order indexed + // access types with default property values as expressed by D. + function getTransformedIndexedAccessType(type) { + var objectType = type.objectType; + if (objectType.flags & 131072 /* Intersection */ && isGenericObjectType(objectType) && ts.some(objectType.types, isStringIndexOnlyType)) { + var regularTypes = []; + var stringIndexTypes = []; + for (var _i = 0, _a = objectType.types; _i < _a.length; _i++) { + var t = _a[_i]; + if (isStringIndexOnlyType(t)) { + stringIndexTypes.push(getIndexTypeOfType(t, 0 /* String */)); + } + else { + regularTypes.push(t); + } + } + return getUnionType([ + getIndexedAccessType(getIntersectionType(regularTypes), type.indexType), + getIntersectionType(stringIndexTypes) + ]); + } + return undefined; + } function getIndexedAccessType(objectType, indexType, accessNode) { - // If the index type is generic, if the object type is generic and doesn't originate in an expression, - // or if the object type is a mapped type with a generic constraint, we are performing a higher-order - // index access where we cannot meaningfully access the properties of the object type. Note that for a - // generic T and a non-generic K, we eagerly resolve T[K] if it originates in an expression. This is to - // preserve backwards compatibility. For example, an element access 'this["foo"]' has always been resolved - // eagerly using the constraint type of 'this' at the given location. - if (maybeTypeOfKind(indexType, 540672 /* TypeVariable */ | 262144 /* Index */) || - maybeTypeOfKind(objectType, 540672 /* TypeVariable */) && !(accessNode && accessNode.kind === 180 /* ElementAccessExpression */) || - isGenericMappedType(objectType)) { + // If the object type is a mapped type { [P in K]: E }, where K is generic, we instantiate E using a mapper + // that substitutes the index type for P. For example, for an index access { [P in K]: Box }[X], we + // construct the type Box. + if (isGenericMappedType(objectType)) { + return getIndexedAccessForMappedType(objectType, indexType, accessNode); + } + // Otherwise, if the index type is generic, or if the object type is generic and doesn't originate in an + // expression, we are performing a higher-order index access where we cannot meaningfully access the properties + // of the object type. Note that for a generic T and a non-generic K, we eagerly resolve T[K] if it originates + // in an expression. This is to preserve backwards compatibility. For example, an element access 'this["foo"]' + // has always been resolved eagerly using the constraint type of 'this' at the given location. + if (isGenericIndexType(indexType) || !(accessNode && accessNode.kind === 180 /* ElementAccessExpression */) && isGenericObjectType(objectType)) { if (objectType.flags & 1 /* Any */) { return objectType; } - // If the object type is a mapped type { [P in K]: E }, we instantiate E using a mapper that substitutes - // the index type for P. For example, for an index access { [P in K]: Box }[X], we construct the - // type Box. - if (isGenericMappedType(objectType)) { - return getIndexedAccessForMappedType(objectType, indexType, accessNode); - } - // Otherwise we defer the operation by creating an indexed access type. + // Defer the operation by creating an indexed access type. var id = objectType.id + "," + indexType.id; var type = indexedAccessTypes.get(id); if (!type) { @@ -29759,7 +30012,7 @@ var ts; var container = ts.getThisContainer(node, /*includeArrowFunctions*/ false); var parent = container && container.parent; if (parent && (ts.isClassLike(parent) || parent.kind === 230 /* InterfaceDeclaration */)) { - if (!(ts.getModifierFlags(container) & 32 /* Static */) && + if (!ts.hasModifier(container, 32 /* Static */) && (container.kind !== 152 /* Constructor */ || ts.isNodeDescendantOf(node, container.body))) { return getDeclaredTypeOfClassOrInterface(getSymbolOfNode(parent)).thisType; } @@ -29912,7 +30165,7 @@ var ts; } function cloneTypeMapper(mapper) { return mapper && isInferenceContext(mapper) ? - createInferenceContext(mapper.signature, mapper.flags | 2 /* NoDefault */, mapper.inferences) : + createInferenceContext(mapper.signature, mapper.flags | 2 /* NoDefault */, mapper.compareTypes, mapper.inferences) : mapper; } function identityMapper(type) { @@ -30222,16 +30475,16 @@ var ts; if (ts.forEach(node.parameters, function (p) { return !ts.getEffectiveTypeAnnotationNode(p); })) { return true; } - // For arrow functions we now know we're not context sensitive. - if (node.kind === 187 /* ArrowFunction */) { - return false; + if (node.kind !== 187 /* ArrowFunction */) { + // If the first parameter is not an explicit 'this' parameter, then the function has + // an implicit 'this' parameter which is subject to contextual typing. + var parameter = ts.firstOrUndefined(node.parameters); + if (!(parameter && ts.parameterIsThisKeyword(parameter))) { + return true; + } } - // If the first parameter is not an explicit 'this' parameter, then the function has - // an implicit 'this' parameter which is subject to contextual typing. Otherwise we - // know that all parameters (including 'this') have type annotations and nothing is - // subject to contextual typing. - var parameter = ts.firstOrUndefined(node.parameters); - return !(parameter && ts.parameterIsThisKeyword(parameter)); + // TODO(anhans): A block should be context-sensitive if it has a context-sensitive return value. + return node.body.kind === 207 /* Block */ ? false : isContextSensitive(node.body); } function isContextSensitiveFunctionOrObjectLiteralMethod(func) { return (isFunctionExpressionOrArrowFunction(func) || ts.isObjectLiteralMethod(func)) && isContextSensitiveFunctionLikeDeclaration(func); @@ -30317,7 +30570,7 @@ var ts; return 0 /* False */; } if (source.typeParameters) { - source = instantiateSignatureInContextOf(source, target); + source = instantiateSignatureInContextOf(source, target, /*contextualMapper*/ undefined, compareTypes); } var result = -1 /* True */; var sourceThisType = getThisTypeOfSignature(source); @@ -30376,7 +30629,7 @@ var ts; // The following block preserves behavior forbidding boolean returning functions from being assignable to type guard returning functions if (target.typePredicate) { if (source.typePredicate) { - result &= compareTypePredicateRelatedTo(source.typePredicate, target.typePredicate, reportErrors, errorReporter, compareTypes); + result &= compareTypePredicateRelatedTo(source.typePredicate, target.typePredicate, source.declaration, target.declaration, reportErrors, errorReporter, compareTypes); } else if (ts.isIdentifierTypePredicate(target.typePredicate)) { if (reportErrors) { @@ -30395,7 +30648,7 @@ var ts; } return result; } - function compareTypePredicateRelatedTo(source, target, reportErrors, errorReporter, compareTypes) { + function compareTypePredicateRelatedTo(source, target, sourceDeclaration, targetDeclaration, reportErrors, errorReporter, compareTypes) { if (source.kind !== target.kind) { if (reportErrors) { errorReporter(ts.Diagnostics.A_this_based_type_guard_is_not_compatible_with_a_parameter_based_type_guard); @@ -30404,11 +30657,13 @@ var ts; return 0 /* False */; } if (source.kind === 1 /* Identifier */) { - var sourceIdentifierPredicate = source; - var targetIdentifierPredicate = target; - if (sourceIdentifierPredicate.parameterIndex !== targetIdentifierPredicate.parameterIndex) { + var sourcePredicate = source; + var targetPredicate = target; + var sourceIndex = sourcePredicate.parameterIndex - (ts.getThisParameter(sourceDeclaration) ? 1 : 0); + var targetIndex = targetPredicate.parameterIndex - (ts.getThisParameter(targetDeclaration) ? 1 : 0); + if (sourceIndex !== targetIndex) { if (reportErrors) { - errorReporter(ts.Diagnostics.Parameter_0_is_not_in_the_same_position_as_parameter_1, sourceIdentifierPredicate.parameterName, targetIdentifierPredicate.parameterName); + errorReporter(ts.Diagnostics.Parameter_0_is_not_in_the_same_position_as_parameter_1, sourcePredicate.parameterName, targetPredicate.parameterName); errorReporter(ts.Diagnostics.Type_predicate_0_is_not_assignable_to_1, typePredicateToString(source), typePredicateToString(target)); } return 0 /* False */; @@ -30560,8 +30815,7 @@ var ts; return true; } if (source.flags & 32768 /* Object */ && target.flags & 32768 /* Object */) { - var id = relation !== identityRelation || source.id < target.id ? source.id + "," + target.id : target.id + "," + source.id; - var related = relation.get(id); + var related = relation.get(getRelationKey(source, target, relation)); if (related !== undefined) { return related === 1 /* Succeeded */; } @@ -30697,11 +30951,21 @@ var ts; !(target.flags & 65536 /* Union */) && !isIntersectionConstituent && source !== globalObjectType && - getPropertiesOfType(source).length > 0 && + (getPropertiesOfType(source).length > 0 || + getSignaturesOfType(source, 0 /* Call */).length > 0 || + getSignaturesOfType(source, 1 /* Construct */).length > 0) && isWeakType(target) && !hasCommonProperties(source, target)) { if (reportErrors) { - reportError(ts.Diagnostics.Type_0_has_no_properties_in_common_with_type_1, typeToString(source), typeToString(target)); + var calls = getSignaturesOfType(source, 0 /* Call */); + var constructs = getSignaturesOfType(source, 1 /* Construct */); + if (calls.length > 0 && isRelatedTo(getReturnTypeOfSignature(calls[0]), target, /*reportErrors*/ false) || + constructs.length > 0 && isRelatedTo(getReturnTypeOfSignature(constructs[0]), target, /*reportErrors*/ false)) { + reportError(ts.Diagnostics.Value_of_type_0_has_no_properties_in_common_with_type_1_Did_you_mean_to_call_it, typeToString(source), typeToString(target)); + } + else { + reportError(ts.Diagnostics.Type_0_has_no_properties_in_common_with_type_1, typeToString(source), typeToString(target)); + } } return 0 /* False */; } @@ -30929,7 +31193,7 @@ var ts; if (overflow) { return 0 /* False */; } - var id = relation !== identityRelation || source.id < target.id ? source.id + "," + target.id : target.id + "," + source.id; + var id = getRelationKey(source, target, relation); var related = relation.get(id); if (related !== undefined) { if (reportErrors && related === 2 /* Failed */) { @@ -31411,6 +31675,11 @@ var ts; if (sourceInfo) { return indexInfoRelatedTo(sourceInfo, targetInfo, reportErrors); } + if (isGenericMappedType(source)) { + // A generic mapped type { [P in K]: T } is related to an index signature { [x: string]: U } + // if T is related to U. + return kind === 0 /* String */ && isRelatedTo(getTemplateTypeFromMappedType(source), targetInfo.type, reportErrors); + } if (isObjectLiteralType(source)) { var related = -1 /* True */; if (kind === 0 /* String */) { @@ -31444,8 +31713,8 @@ var ts; if (!sourceSignature.declaration || !targetSignature.declaration) { return true; } - var sourceAccessibility = ts.getModifierFlags(sourceSignature.declaration) & 24 /* NonPublicAccessibilityModifier */; - var targetAccessibility = ts.getModifierFlags(targetSignature.declaration) & 24 /* NonPublicAccessibilityModifier */; + var sourceAccessibility = ts.getSelectedModifierFlags(sourceSignature.declaration, 24 /* NonPublicAccessibilityModifier */); + var targetAccessibility = ts.getSelectedModifierFlags(targetSignature.declaration, 24 /* NonPublicAccessibilityModifier */); // A public, protected and private signature is assignable to a private signature. if (targetAccessibility === 8 /* Private */) { return true; @@ -31464,6 +31733,50 @@ var ts; return false; } } + function isUnconstrainedTypeParameter(type) { + return type.flags & 16384 /* TypeParameter */ && !getConstraintFromTypeParameter(type); + } + function isTypeReferenceWithGenericArguments(type) { + return getObjectFlags(type) & 4 /* Reference */ && ts.some(type.typeArguments, isUnconstrainedTypeParameter); + } + /** + * getTypeReferenceId(A) returns "111=0-12=1" + * where A.id=111 and number.id=12 + */ + function getTypeReferenceId(type, typeParameters) { + var result = "" + type.target.id; + for (var _i = 0, _a = type.typeArguments; _i < _a.length; _i++) { + var t = _a[_i]; + if (isUnconstrainedTypeParameter(t)) { + var index = ts.indexOf(typeParameters, t); + if (index < 0) { + index = typeParameters.length; + typeParameters.push(t); + } + result += "=" + index; + } + else { + result += "-" + t.id; + } + } + return result; + } + /** + * To improve caching, the relation key for two generic types uses the target's id plus ids of the type parameters. + * For other cases, the types ids are used. + */ + function getRelationKey(source, target, relation) { + if (relation === identityRelation && source.id > target.id) { + var temp = source; + source = target; + target = temp; + } + if (isTypeReferenceWithGenericArguments(source) && isTypeReferenceWithGenericArguments(target)) { + var typeParameters = []; + return getTypeReferenceId(source, typeParameters) + "," + getTypeReferenceId(target, typeParameters); + } + return source.id + "," + target.id; + } // Invoke the callback for each underlying property symbol of the given symbol and return the first // value that isn't undefined. function forEachProperty(prop, callback) { @@ -31509,7 +31822,7 @@ var ts; var symbol = type.symbol; if (symbol && symbol.flags & 32 /* Class */) { var declaration = getClassLikeDeclarationOfSymbol(symbol); - if (declaration && ts.getModifierFlags(declaration) & 128 /* Abstract */) { + if (declaration && ts.hasModifier(declaration, 128 /* Abstract */)) { return true; } } @@ -31960,13 +32273,14 @@ var ts; callback(getTypeAtPosition(source, i), getTypeAtPosition(target, i)); } } - function createInferenceContext(signature, flags, baseInferences) { + function createInferenceContext(signature, flags, compareTypes, baseInferences) { var inferences = baseInferences ? ts.map(baseInferences, cloneInferenceInfo) : ts.map(signature.typeParameters, createInferenceInfo); var context = mapper; context.mappedTypes = signature.typeParameters; context.signature = signature; context.inferences = inferences; context.flags = flags; + context.compareTypes = compareTypes || compareTypesAssignable; return context; function mapper(t) { for (var i = 0; i < inferences.length; i++) { @@ -32061,6 +32375,19 @@ var ts; return inference.candidates && getUnionType(inference.candidates, /*subtypeReduction*/ true); } } + function isPossiblyAssignableTo(source, target) { + var properties = getPropertiesOfObjectType(target); + for (var _i = 0, properties_5 = properties; _i < properties_5.length; _i++) { + var targetProp = properties_5[_i]; + if (!(targetProp.flags & (16777216 /* Optional */ | 4194304 /* Prototype */))) { + var sourceProp = getPropertyOfObjectType(source, targetProp.escapedName); + if (!sourceProp) { + return false; + } + } + } + return true; + } function inferTypes(inferences, originalSource, originalTarget, priority) { if (priority === void 0) { priority = 0; } var symbolStack; @@ -32257,15 +32584,19 @@ var ts; return; } } - inferFromProperties(source, target); - inferFromSignatures(source, target, 0 /* Call */); - inferFromSignatures(source, target, 1 /* Construct */); - inferFromIndexTypes(source, target); + // Infer from the members of source and target only if the two types are possibly related. We check + // in both directions because we may be inferring for a co-variant or a contra-variant position. + if (isPossiblyAssignableTo(source, target) || isPossiblyAssignableTo(target, source)) { + inferFromProperties(source, target); + inferFromSignatures(source, target, 0 /* Call */); + inferFromSignatures(source, target, 1 /* Construct */); + inferFromIndexTypes(source, target); + } } function inferFromProperties(source, target) { var properties = getPropertiesOfObjectType(target); - for (var _i = 0, properties_5 = properties; _i < properties_5.length; _i++) { - var targetProp = properties_5[_i]; + for (var _i = 0, properties_6 = properties; _i < properties_6.length; _i++) { + var targetProp = properties_6[_i]; var sourceProp = getPropertyOfObjectType(source, targetProp.escapedName); if (sourceProp) { inferFromTypes(getTypeOfSymbol(sourceProp), getTypeOfSymbol(targetProp)); @@ -32382,7 +32713,7 @@ var ts; var constraint = getConstraintOfTypeParameter(context.signature.typeParameters[index]); if (constraint) { var instantiatedConstraint = instantiateType(constraint, context); - if (!isTypeAssignableTo(inferredType, getTypeWithThisArgument(instantiatedConstraint, inferredType))) { + if (!context.compareTypes(inferredType, getTypeWithThisArgument(instantiatedConstraint, inferredType))) { inference.inferredType = inferredType = instantiatedConstraint; } } @@ -32440,16 +32771,6 @@ var ts; } return undefined; } - function getLeftmostIdentifierOrThis(node) { - switch (node.kind) { - case 71 /* Identifier */: - case 99 /* ThisKeyword */: - return node; - case 179 /* PropertyAccessExpression */: - return getLeftmostIdentifierOrThis(node.expression); - } - return undefined; - } function getBindingElementNameText(element) { if (element.parent.kind === 174 /* ObjectBindingPattern */) { var name = element.propertyName || element.name; @@ -32975,7 +33296,7 @@ var ts; parent.parent.operatorToken.kind === 58 /* EqualsToken */ && parent.parent.left === parent && !ts.isAssignmentTarget(parent.parent) && - isTypeAnyOrAllConstituentTypesHaveKind(getTypeOfExpression(parent.argumentExpression), 84 /* NumberLike */ | 2048 /* Undefined */); + isTypeAssignableToKind(getTypeOfExpression(parent.argumentExpression), 84 /* NumberLike */); return isLengthPushOrUnshift || isElementAssignment; } function maybeTypePredicateCall(node) { @@ -33143,7 +33464,7 @@ var ts; } else { var indexType = getTypeOfExpression(node.left.argumentExpression); - if (isTypeAnyOrAllConstituentTypesHaveKind(indexType, 84 /* NumberLike */ | 2048 /* Undefined */)) { + if (isTypeAssignableToKind(indexType, 84 /* NumberLike */)) { evolvedType_1 = addEvolvingArrayElementType(evolvedType_1, node.right); } } @@ -33978,7 +34299,7 @@ var ts; break; case 149 /* PropertyDeclaration */: case 148 /* PropertySignature */: - if (ts.getModifierFlags(container) & 32 /* Static */) { + if (ts.hasModifier(container, 32 /* Static */)) { error(node, ts.Diagnostics.this_cannot_be_referenced_in_a_static_property_initializer); // do not return here so in case if lexical this is captured - it will be reflected in flags on NodeLinks } @@ -34081,7 +34402,7 @@ var ts; if (!isCallExpression && container.kind === 152 /* Constructor */) { checkThisBeforeSuper(node, container, ts.Diagnostics.super_must_be_called_before_accessing_a_property_of_super_in_the_constructor_of_a_derived_class); } - if ((ts.getModifierFlags(container) & 32 /* Static */) || isCallExpression) { + if (ts.hasModifier(container, 32 /* Static */) || isCallExpression) { nodeCheckFlag = 512 /* SuperStatic */; } else { @@ -34144,7 +34465,7 @@ var ts; // This helper creates an object with a "value" property that wraps the `super` property or indexed access for both get and set. // This is required for destructuring assignments, as a call expression cannot be used as the target of a destructuring assignment // while a property access can. - if (container.kind === 151 /* MethodDeclaration */ && ts.getModifierFlags(container) & 256 /* Async */) { + if (container.kind === 151 /* MethodDeclaration */ && ts.hasModifier(container, 256 /* Async */)) { if (ts.isSuperProperty(node.parent) && ts.isAssignmentTarget(node.parent)) { getNodeLinks(container).flags |= 4096 /* AsyncMethodWithSuperBinding */; } @@ -34202,7 +34523,7 @@ var ts; // - In a static member function or static member accessor // topmost container must be something that is directly nested in the class declaration\object literal expression if (ts.isClassLike(container.parent) || container.parent.kind === 178 /* ObjectLiteralExpression */) { - if (ts.getModifierFlags(container) & 32 /* Static */) { + if (ts.hasModifier(container, 32 /* Static */)) { return container.kind === 151 /* MethodDeclaration */ || container.kind === 150 /* MethodSignature */ || container.kind === 153 /* GetAccessor */ || @@ -34414,7 +34735,7 @@ var ts; // Otherwise, if the containing function is contextually typed by a function type with exactly one call signature // and that call signature is non-generic, return statements are contextually typed by the return type of the signature var signature = getContextualSignatureForFunctionLikeDeclaration(functionDecl); - if (signature) { + if (signature && !isResolvingReturnTypeOfSignature(signature)) { return getReturnTypeOfSignature(signature); } return undefined; @@ -34543,12 +34864,12 @@ var ts; } if (ts.isJsxAttribute(node.parent)) { // JSX expression is in JSX attribute - return getTypeOfPropertyOfType(attributesType, node.parent.name.escapedText); + return getTypeOfPropertyOfContextualType(attributesType, node.parent.name.escapedText); } else if (node.parent.kind === 249 /* JsxElement */) { // JSX expression is in children of JSX Element, we will look for an "children" atttribute (we get the name from JSX.ElementAttributesProperty) var jsxChildrenPropertyName = getJsxElementChildrenPropertyname(); - return jsxChildrenPropertyName && jsxChildrenPropertyName !== "" ? getTypeOfPropertyOfType(attributesType, jsxChildrenPropertyName) : anyType; + return jsxChildrenPropertyName && jsxChildrenPropertyName !== "" ? getTypeOfPropertyOfContextualType(attributesType, jsxChildrenPropertyName) : anyType; } else { // JSX expression is in JSX spread attribute @@ -34564,7 +34885,7 @@ var ts; if (!attributesType || isTypeAny(attributesType)) { return undefined; } - return getTypeOfPropertyOfType(attributesType, attribute.name.escapedText); + return getTypeOfPropertyOfContextualType(attributesType, attribute.name.escapedText); } else { return attributesType; @@ -34832,10 +35153,7 @@ var ts; function isNumericComputedName(name) { // It seems odd to consider an expression of type Any to result in a numeric name, // but this behavior is consistent with checkIndexedAccess - return isTypeAnyOrAllConstituentTypesHaveKind(checkComputedPropertyName(name), 84 /* NumberLike */); - } - function isTypeAnyOrAllConstituentTypesHaveKind(type, kind) { - return isTypeAny(type) || isTypeOfKind(type, kind); + return isTypeAssignableToKind(checkComputedPropertyName(name), 84 /* NumberLike */); } function isInfinityOrNaNString(name) { return name === "Infinity" || name === "-Infinity" || name === "NaN"; @@ -34870,7 +35188,9 @@ var ts; links.resolvedType = checkExpression(node.expression); // This will allow types number, string, symbol or any. It will also allow enums, the unknown // type, and any union of these types (like string | number). - if (!isTypeAnyOrAllConstituentTypesHaveKind(links.resolvedType, 84 /* NumberLike */ | 262178 /* StringLike */ | 512 /* ESSymbol */)) { + if (links.resolvedType.flags & 6144 /* Nullable */ || + !isTypeAssignableToKind(links.resolvedType, 262178 /* StringLike */ | 84 /* NumberLike */ | 512 /* ESSymbol */) && + !isTypeAssignableTo(links.resolvedType, getUnionType([stringType, numberType, esSymbolType]))) { error(node, ts.Diagnostics.A_computed_property_name_must_be_of_type_string_number_symbol_or_any); } else { @@ -35484,9 +35804,7 @@ var ts; * emptyObjectType if there is no "prop" in the element instance type */ function resolveCustomJsxElementAttributesType(openingLikeElement, shouldIncludeAllStatelessAttributesType, elementType, elementClassType) { - if (!elementType) { - elementType = checkExpression(openingLikeElement.tagName); - } + if (elementType === void 0) { elementType = checkExpression(openingLikeElement.tagName); } if (elementType.flags & 65536 /* Union */) { var types = elementType.types; return getUnionType(types.map(function (type) { @@ -35607,11 +35925,12 @@ var ts; */ function getCustomJsxElementAttributesType(node, shouldIncludeAllStatelessAttributesType) { var links = getNodeLinks(node); - if (!links.resolvedJsxElementAttributesType) { + var linkLocation = shouldIncludeAllStatelessAttributesType ? "resolvedJsxElementAllAttributesType" : "resolvedJsxElementAttributesType"; + if (!links[linkLocation]) { var elemClassType = getJsxGlobalElementClassType(); - return links.resolvedJsxElementAttributesType = resolveCustomJsxElementAttributesType(node, shouldIncludeAllStatelessAttributesType, /*elementType*/ undefined, elemClassType); + return links[linkLocation] = resolveCustomJsxElementAttributesType(node, shouldIncludeAllStatelessAttributesType, /*elementType*/ undefined, elemClassType); } - return links.resolvedJsxElementAttributesType; + return links[linkLocation]; } /** * Get all possible attributes type, especially from an overload stateless function component, of the given JSX opening-like element. @@ -35933,9 +36252,12 @@ var ts; } var prop = getPropertyOfType(apparentType, right.escapedText); if (!prop) { - var stringIndexType = getIndexTypeOfType(apparentType, 0 /* String */); - if (stringIndexType) { - return stringIndexType; + var indexInfo = getIndexInfoOfType(apparentType, 0 /* String */); + if (indexInfo && indexInfo.type) { + if (indexInfo.isReadonly && (ts.isAssignmentTarget(node) || ts.isDeleteTarget(node))) { + error(node, ts.Diagnostics.Index_signature_in_type_0_only_permits_reading, typeToString(apparentType)); + } + return indexInfo.type; } if (right.escapedText && !checkAndReportErrorForExtendingInterface(node)) { reportNonexistentProperty(right, type.flags & 16384 /* TypeParameter */ && type.isThisType ? apparentType : type); @@ -36084,7 +36406,7 @@ var ts; if (prop && noUnusedIdentifiers && (prop.flags & 106500 /* ClassMember */) && - prop.valueDeclaration && (ts.getModifierFlags(prop.valueDeclaration) & 8 /* Private */)) { + prop.valueDeclaration && ts.hasModifier(prop.valueDeclaration, 8 /* Private */)) { if (ts.getCheckFlags(prop) & 1 /* Instantiated */) { getSymbolLinks(prop).target.isReferenced = true; } @@ -36407,8 +36729,8 @@ var ts; return undefined; } // Instantiate a generic signature in the context of a non-generic signature (section 3.8.5 in TypeScript spec) - function instantiateSignatureInContextOf(signature, contextualSignature, contextualMapper) { - var context = createInferenceContext(signature, 1 /* InferUnionTypes */); + function instantiateSignatureInContextOf(signature, contextualSignature, contextualMapper, compareTypes) { + var context = createInferenceContext(signature, 1 /* InferUnionTypes */, compareTypes); forEachMatchingParameterType(contextualSignature, signature, function (source, target) { // Type parameters from outer context referenced by source type are fixed by instantiation of the source type inferTypes(context.inferences, instantiateType(source, contextualMapper || identityMapper), target); @@ -36780,7 +37102,7 @@ var ts; return getLiteralType(element.name.text); case 144 /* ComputedPropertyName */: var nameType = checkComputedPropertyName(element.name); - if (isTypeOfKind(nameType, 512 /* ESSymbol */)) { + if (isTypeAssignableToKind(nameType, 512 /* ESSymbol */)) { return nameType; } else { @@ -36921,9 +37243,10 @@ var ts; // // For a decorator, no arguments are susceptible to contextual typing due to the fact // decorators are applied to a declaration by the emitter, and not to an expression. + var isSingleNonGenericCandidate = candidates.length === 1 && !candidates[0].typeParameters; var excludeArgument; var excludeCount = 0; - if (!isDecorator) { + if (!isDecorator && !isSingleNonGenericCandidate) { // We do not need to call `getEffectiveArgumentCount` here as it only // applies when calculating the number of arguments for a decorator. for (var i = isTaggedTemplate ? 1 : 0; i < args.length; i++) { @@ -37068,6 +37391,17 @@ var ts; if (signatureHelpTrailingComma === void 0) { signatureHelpTrailingComma = false; } candidateForArgumentError = undefined; candidateForTypeArgumentError = undefined; + if (isSingleNonGenericCandidate) { + var candidate = candidates[0]; + if (!hasCorrectArity(node, args, candidate, signatureHelpTrailingComma)) { + return undefined; + } + if (!checkApplicableSignature(node, args, candidate, relation, excludeArgument, /*reportErrors*/ false)) { + candidateForArgumentError = candidate; + return undefined; + } + return candidate; + } for (var candidateIndex = 0; candidateIndex < candidates.length; candidateIndex++) { var originalCandidate = candidates[candidateIndex]; if (!hasCorrectArity(node, args, originalCandidate, signatureHelpTrailingComma)) { @@ -37230,7 +37564,7 @@ var ts; // In the case of a merged class-module or class-interface declaration, // only the class declaration node will have the Abstract flag set. var valueDecl = expressionType.symbol && getClassLikeDeclarationOfSymbol(expressionType.symbol); - if (valueDecl && ts.getModifierFlags(valueDecl) & 128 /* Abstract */) { + if (valueDecl && ts.hasModifier(valueDecl, 128 /* Abstract */)) { error(node, ts.Diagnostics.Cannot_create_an_instance_of_the_abstract_class_0, ts.declarationNameToString(ts.getNameOfDeclaration(valueDecl))); return resolveErrorCall(node); } @@ -37277,9 +37611,9 @@ var ts; return true; } var declaration = signature.declaration; - var modifiers = ts.getModifierFlags(declaration); + var modifiers = ts.getSelectedModifierFlags(declaration, 24 /* NonPublicAccessibilityModifier */); // Public constructor is accessible. - if (!(modifiers & 24 /* NonPublicAccessibilityModifier */)) { + if (!modifiers) { return true; } var declaringClassDeclaration = getClassLikeDeclarationOfSymbol(declaration.parent.symbol); @@ -37488,7 +37822,7 @@ var ts; */ function checkCallExpression(node) { // Grammar checking; stop grammar-checking if checkGrammarTypeArguments return true - checkGrammarTypeArguments(node, node.typeArguments) || checkGrammarArguments(node, node.arguments); + checkGrammarTypeArguments(node, node.typeArguments) || checkGrammarArguments(node.arguments); var signature = getResolvedSignature(node); if (node.expression.kind === 97 /* SuperKeyword */) { return voidType; @@ -37528,7 +37862,7 @@ var ts; } function checkImportCallExpression(node) { // Check grammar of dynamic import - checkGrammarArguments(node, node.arguments) || checkGrammarImportCallExpression(node); + checkGrammarArguments(node.arguments) || checkGrammarImportCallExpression(node); if (node.arguments.length === 0) { return createPromiseReturnType(node, anyType); } @@ -37546,11 +37880,33 @@ var ts; if (moduleSymbol) { var esModuleSymbol = resolveESModuleSymbol(moduleSymbol, specifier, /*dontRecursivelyResolve*/ true); if (esModuleSymbol) { - return createPromiseReturnType(node, getTypeOfSymbol(esModuleSymbol)); + return createPromiseReturnType(node, getTypeWithSyntheticDefaultImportType(getTypeOfSymbol(esModuleSymbol), esModuleSymbol)); } } return createPromiseReturnType(node, anyType); } + function getTypeWithSyntheticDefaultImportType(type, symbol) { + if (allowSyntheticDefaultImports && type && type !== unknownType) { + var synthType = type; + if (!synthType.syntheticType) { + if (!getPropertyOfType(type, "default" /* Default */)) { + var memberTable = ts.createSymbolTable(); + var newSymbol = createSymbol(2097152 /* Alias */, "default" /* Default */); + newSymbol.target = resolveSymbol(symbol); + memberTable.set("default" /* Default */, newSymbol); + var anonymousSymbol = createSymbol(2048 /* TypeLiteral */, "__type" /* Type */); + var defaultContainingObject = createAnonymousType(anonymousSymbol, memberTable, ts.emptyArray, ts.emptyArray, /*stringIndexInfo*/ undefined, /*numberIndexInfo*/ undefined); + anonymousSymbol.type = defaultContainingObject; + synthType.syntheticType = getIntersectionType([type, defaultContainingObject]); + } + else { + synthType.syntheticType = type; + } + } + return synthType.syntheticType; + } + return type; + } function isCommonJsRequire(node) { if (!ts.isRequireCall(node, /*checkArgumentIsStringLiteral*/ true)) { return false; @@ -37675,15 +38031,15 @@ var ts; } // When contextual typing assigns a type to a parameter that contains a binding pattern, we also need to push // the destructured type into the contained binding elements. - function assignBindingElementTypes(node) { - if (ts.isBindingPattern(node.name)) { - for (var _i = 0, _a = node.name.elements; _i < _a.length; _i++) { - var element = _a[_i]; - if (!ts.isOmittedExpression(element)) { - if (element.name.kind === 71 /* Identifier */) { - getSymbolLinks(getSymbolOfNode(element)).type = getTypeForBindingElement(element); - } - assignBindingElementTypes(element); + function assignBindingElementTypes(pattern) { + for (var _i = 0, _a = pattern.elements; _i < _a.length; _i++) { + var element = _a[_i]; + if (!ts.isOmittedExpression(element)) { + if (element.name.kind === 71 /* Identifier */) { + getSymbolLinks(getSymbolOfNode(element)).type = getTypeForBindingElement(element); + } + else { + assignBindingElementTypes(element.name); } } } @@ -37692,13 +38048,14 @@ var ts; var links = getSymbolLinks(parameter); if (!links.type) { links.type = contextualType; - var name = ts.getNameOfDeclaration(parameter.valueDeclaration); - // if inference didn't come up with anything but {}, fall back to the binding pattern if present. - if (links.type === emptyObjectType && - (name.kind === 174 /* ObjectBindingPattern */ || name.kind === 175 /* ArrayBindingPattern */)) { - links.type = getTypeFromBindingPattern(name); + var decl = parameter.valueDeclaration; + if (decl.name.kind !== 71 /* Identifier */) { + // if inference didn't come up with anything but {}, fall back to the binding pattern if present. + if (links.type === emptyObjectType) { + links.type = getTypeFromBindingPattern(decl.name); + } + assignBindingElementTypes(decl.name); } - assignBindingElementTypes(parameter.valueDeclaration); } } function createPromiseType(promisedType) { @@ -37934,16 +38291,16 @@ var ts; } function checkFunctionExpressionOrObjectLiteralMethod(node, checkMode) { ts.Debug.assert(node.kind !== 151 /* MethodDeclaration */ || ts.isObjectLiteralMethod(node)); - // Grammar checking - var hasGrammarError = checkGrammarFunctionLikeDeclaration(node); - if (!hasGrammarError && node.kind === 186 /* FunctionExpression */) { - checkGrammarForGenerator(node); - } // The identityMapper object is used to indicate that function expressions are wildcards if (checkMode === 1 /* SkipContextSensitive */ && isContextSensitive(node)) { checkNodeDeferred(node); return anyFunctionType; } + // Grammar checking + var hasGrammarError = checkGrammarFunctionLikeDeclaration(node); + if (!hasGrammarError && node.kind === 186 /* FunctionExpression */) { + checkGrammarForGenerator(node); + } var links = getNodeLinks(node); var type = getTypeOfSymbol(node.symbol); // Check if function expression is contextually typed and assign parameter types if so. @@ -38028,7 +38385,7 @@ var ts; } } function checkArithmeticOperandType(operand, type, diagnostic) { - if (!isTypeAnyOrAllConstituentTypesHaveKind(type, 84 /* NumberLike */)) { + if (!isTypeAssignableToKind(type, 84 /* NumberLike */)) { error(operand, diagnostic); return false; } @@ -38129,8 +38486,13 @@ var ts; if (operandType === silentNeverType) { return silentNeverType; } - if (node.operator === 38 /* MinusToken */ && node.operand.kind === 8 /* NumericLiteral */) { - return getFreshTypeOfLiteralType(getLiteralType(-node.operand.text)); + if (node.operand.kind === 8 /* NumericLiteral */) { + if (node.operator === 38 /* MinusToken */) { + return getFreshTypeOfLiteralType(getLiteralType(-node.operand.text)); + } + else if (node.operator === 37 /* PlusToken */) { + return getFreshTypeOfLiteralType(getLiteralType(+node.operand.text)); + } } switch (node.operator) { case 37 /* PlusToken */: @@ -38186,33 +38548,22 @@ var ts; } return false; } - // Return true if type is of the given kind. A union type is of a given kind if all constituent types - // are of the given kind. An intersection type is of a given kind if at least one constituent type is - // of the given kind. - function isTypeOfKind(type, kind) { - if (type.flags & kind) { - return true; - } - if (type.flags & 65536 /* Union */) { - var types = type.types; - for (var _i = 0, types_18 = types; _i < types_18.length; _i++) { - var t = types_18[_i]; - if (!isTypeOfKind(t, kind)) { - return false; - } - } + function isTypeAssignableToKind(source, kind, strict) { + if (source.flags & kind) { return true; } - if (type.flags & 131072 /* Intersection */) { - var types = type.types; - for (var _a = 0, types_19 = types; _a < types_19.length; _a++) { - var t = types_19[_a]; - if (isTypeOfKind(t, kind)) { - return true; - } - } + if (strict && source.flags & (1 /* Any */ | 1024 /* Void */ | 2048 /* Undefined */ | 4096 /* Null */)) { + return false; } - return false; + return (kind & 84 /* NumberLike */ && isTypeAssignableTo(source, numberType)) || + (kind & 262178 /* StringLike */ && isTypeAssignableTo(source, stringType)) || + (kind & 136 /* BooleanLike */ && isTypeAssignableTo(source, booleanType)) || + (kind & 1024 /* Void */ && isTypeAssignableTo(source, voidType)) || + (kind & 8192 /* Never */ && isTypeAssignableTo(source, neverType)) || + (kind & 4096 /* Null */ && isTypeAssignableTo(source, nullType)) || + (kind & 2048 /* Undefined */ && isTypeAssignableTo(source, undefinedType)) || + (kind & 512 /* ESSymbol */ && isTypeAssignableTo(source, esSymbolType)) || + (kind & 16777216 /* NonPrimitive */ && isTypeAssignableTo(source, nonPrimitiveType)); } function isConstEnumObjectType(type) { return getObjectFlags(type) & 16 /* Anonymous */ && type.symbol && isConstEnumSymbol(type.symbol); @@ -38229,7 +38580,7 @@ var ts; // and the right operand to be of type Any, a subtype of the 'Function' interface type, or have a call or construct signature. // The result is always of the Boolean primitive type. // NOTE: do not raise error if leftType is unknown as related error was already reported - if (isTypeOfKind(leftType, 8190 /* Primitive */)) { + if (!isTypeAny(leftType) && isTypeAssignableToKind(leftType, 8190 /* Primitive */)) { error(left, ts.Diagnostics.The_left_hand_side_of_an_instanceof_expression_must_be_of_type_any_an_object_type_or_a_type_parameter); } // NOTE: do not raise error if right is unknown as related error was already reported @@ -38251,18 +38602,18 @@ var ts; // The in operator requires the left operand to be of type Any, the String primitive type, or the Number primitive type, // and the right operand to be of type Any, an object type, or a type parameter type. // The result is always of the Boolean primitive type. - if (!(isTypeComparableTo(leftType, stringType) || isTypeOfKind(leftType, 84 /* NumberLike */ | 512 /* ESSymbol */))) { + if (!(isTypeComparableTo(leftType, stringType) || isTypeAssignableToKind(leftType, 84 /* NumberLike */ | 512 /* ESSymbol */))) { error(left, ts.Diagnostics.The_left_hand_side_of_an_in_expression_must_be_of_type_any_string_number_or_symbol); } - if (!isTypeAnyOrAllConstituentTypesHaveKind(rightType, 32768 /* Object */ | 540672 /* TypeVariable */ | 16777216 /* NonPrimitive */)) { + if (!isTypeAssignableToKind(rightType, 16777216 /* NonPrimitive */ | 540672 /* TypeVariable */)) { error(right, ts.Diagnostics.The_right_hand_side_of_an_in_expression_must_be_of_type_any_an_object_type_or_a_type_parameter); } return booleanType; } function checkObjectLiteralAssignment(node, sourceType) { var properties = node.properties; - for (var _i = 0, properties_6 = properties; _i < properties_6.length; _i++) { - var p = properties_6[_i]; + for (var _i = 0, properties_7 = properties; _i < properties_7.length; _i++) { + var p = properties_7[_i]; checkObjectLiteralDestructuringPropertyAssignment(sourceType, p, properties); } return sourceType; @@ -38541,30 +38892,28 @@ var ts; if (leftType === silentNeverType || rightType === silentNeverType) { return silentNeverType; } - if (!isTypeOfKind(leftType, 1 /* Any */ | 262178 /* StringLike */) && !isTypeOfKind(rightType, 1 /* Any */ | 262178 /* StringLike */)) { + if (!isTypeAssignableToKind(leftType, 262178 /* StringLike */) && !isTypeAssignableToKind(rightType, 262178 /* StringLike */)) { leftType = checkNonNullType(leftType, left); rightType = checkNonNullType(rightType, right); } var resultType = void 0; - if (isTypeOfKind(leftType, 84 /* NumberLike */) && isTypeOfKind(rightType, 84 /* NumberLike */)) { + if (isTypeAssignableToKind(leftType, 84 /* NumberLike */, /*strict*/ true) && isTypeAssignableToKind(rightType, 84 /* NumberLike */, /*strict*/ true)) { // Operands of an enum type are treated as having the primitive type Number. // If both operands are of the Number primitive type, the result is of the Number primitive type. resultType = numberType; } - else { - if (isTypeOfKind(leftType, 262178 /* StringLike */) || isTypeOfKind(rightType, 262178 /* StringLike */)) { - // If one or both operands are of the String primitive type, the result is of the String primitive type. - resultType = stringType; - } - else if (isTypeAny(leftType) || isTypeAny(rightType)) { - // Otherwise, the result is of type Any. - // NOTE: unknown type here denotes error type. Old compiler treated this case as any type so do we. - resultType = leftType === unknownType || rightType === unknownType ? unknownType : anyType; - } - // Symbols are not allowed at all in arithmetic expressions - if (resultType && !checkForDisallowedESSymbolOperand(operator)) { - return resultType; - } + else if (isTypeAssignableToKind(leftType, 262178 /* StringLike */, /*strict*/ true) || isTypeAssignableToKind(rightType, 262178 /* StringLike */, /*strict*/ true)) { + // If one or both operands are of the String primitive type, the result is of the String primitive type. + resultType = stringType; + } + else if (isTypeAny(leftType) || isTypeAny(rightType)) { + // Otherwise, the result is of type Any. + // NOTE: unknown type here denotes error type. Old compiler treated this case as any type so do we. + resultType = leftType === unknownType || rightType === unknownType ? unknownType : anyType; + } + // Symbols are not allowed at all in arithmetic expressions + if (resultType && !checkForDisallowedESSymbolOperand(operator)) { + return resultType; } if (!resultType) { reportOperatorError(); @@ -38749,13 +39098,12 @@ var ts; return getBestChoiceType(type1, type2); } function checkLiteralExpression(node) { - if (node.kind === 8 /* NumericLiteral */) { - checkGrammarNumericLiteral(node); - } switch (node.kind) { + case 13 /* NoSubstitutionTemplateLiteral */: case 9 /* StringLiteral */: return getFreshTypeOfLiteralType(getLiteralType(node.text)); case 8 /* NumericLiteral */: + checkGrammarNumericLiteral(node); return getFreshTypeOfLiteralType(getLiteralType(+node.text)); case 101 /* TrueKeyword */: return trueType; @@ -38951,6 +39299,7 @@ var ts; return checkSuperExpression(node); case 95 /* NullKeyword */: return nullWideningType; + case 13 /* NoSubstitutionTemplateLiteral */: case 9 /* StringLiteral */: case 8 /* NumericLiteral */: case 101 /* TrueKeyword */: @@ -38958,8 +39307,6 @@ var ts; return checkLiteralExpression(node); case 196 /* TemplateExpression */: return checkTemplateExpression(node); - case 13 /* NoSubstitutionTemplateLiteral */: - return stringType; case 12 /* RegularExpressionLiteral */: return globalRegExpType; case 177 /* ArrayLiteralExpression */: @@ -39058,7 +39405,7 @@ var ts; checkGrammarDecorators(node) || checkGrammarModifiers(node); checkVariableLikeDeclaration(node); var func = ts.getContainingFunction(node); - if (ts.getModifierFlags(node) & 92 /* ParameterPropertyModifier */) { + if (ts.hasModifier(node, 92 /* ParameterPropertyModifier */)) { func = ts.getContainingFunction(node); if (!(func.kind === 152 /* Constructor */ && ts.nodeIsPresent(func.body))) { error(node, ts.Diagnostics.A_parameter_property_is_only_allowed_in_a_constructor_implementation); @@ -39264,7 +39611,7 @@ var ts; } } else { - var isStatic = ts.getModifierFlags(member) & 32 /* Static */; + var isStatic = ts.hasModifier(member, 32 /* Static */); var names = isStatic ? staticNames : instanceNames; var memberName = member.name && ts.getPropertyNameForPropertyNameNode(member.name); if (memberName) { @@ -39320,7 +39667,7 @@ var ts; for (var _i = 0, _a = node.members; _i < _a.length; _i++) { var member = _a[_i]; var memberNameNode = member.name; - var isStatic = ts.getModifierFlags(member) & 32 /* Static */; + var isStatic = ts.hasModifier(member, 32 /* Static */); if (isStatic && memberNameNode) { var memberName = ts.getPropertyNameForPropertyNameNode(memberNameNode); switch (memberName) { @@ -39418,7 +39765,7 @@ var ts; checkFunctionOrMethodDeclaration(node); // Abstract methods cannot have an implementation. // Extra checks are to avoid reporting multiple errors relating to the "abstractness" of the node. - if (ts.getModifierFlags(node) & 128 /* Abstract */ && node.body) { + if (ts.hasModifier(node, 128 /* Abstract */) && node.body) { error(node, ts.Diagnostics.Method_0_cannot_have_an_implementation_because_it_is_marked_abstract, ts.declarationNameToString(node.name)); } } @@ -39458,17 +39805,9 @@ var ts; } return ts.forEachChild(n, containsSuperCall); } - function markThisReferencesAsErrors(n) { - if (n.kind === 99 /* ThisKeyword */) { - error(n, ts.Diagnostics.this_cannot_be_referenced_in_current_location); - } - else if (n.kind !== 186 /* FunctionExpression */ && n.kind !== 228 /* FunctionDeclaration */) { - ts.forEachChild(n, markThisReferencesAsErrors); - } - } function isInstancePropertyWithInitializer(n) { return n.kind === 149 /* PropertyDeclaration */ && - !(ts.getModifierFlags(n) & 32 /* Static */) && + !ts.hasModifier(n, 32 /* Static */) && !!n.initializer; } // TS 1.0 spec (April 2014): 8.3.2 @@ -39488,8 +39827,8 @@ var ts; // - The containing class is a derived class. // - The constructor declares parameter properties // or the containing class declares instance member variables with initializers. - var superCallShouldBeFirst = ts.forEach(node.parent.members, isInstancePropertyWithInitializer) || - ts.forEach(node.parameters, function (p) { return ts.getModifierFlags(p) & 92 /* ParameterPropertyModifier */; }); + var superCallShouldBeFirst = ts.some(node.parent.members, isInstancePropertyWithInitializer) || + ts.some(node.parameters, function (p) { return ts.hasModifier(p, 92 /* ParameterPropertyModifier */); }); // Skip past any prologue directives to find the first statement // to ensure that it was a super call. if (superCallShouldBeFirst) { @@ -39540,10 +39879,12 @@ var ts; var otherKind = node.kind === 153 /* GetAccessor */ ? 154 /* SetAccessor */ : 153 /* GetAccessor */; var otherAccessor = ts.getDeclarationOfKind(node.symbol, otherKind); if (otherAccessor) { - if ((ts.getModifierFlags(node) & 28 /* AccessibilityModifier */) !== (ts.getModifierFlags(otherAccessor) & 28 /* AccessibilityModifier */)) { + var nodeFlags = ts.getModifierFlags(node); + var otherFlags = ts.getModifierFlags(otherAccessor); + if ((nodeFlags & 28 /* AccessibilityModifier */) !== (otherFlags & 28 /* AccessibilityModifier */)) { error(node.name, ts.Diagnostics.Getter_and_setter_accessors_do_not_agree_in_visibility); } - if (ts.hasModifier(node, 128 /* Abstract */) !== ts.hasModifier(otherAccessor, 128 /* Abstract */)) { + if ((nodeFlags & 128 /* Abstract */) !== (otherFlags & 128 /* Abstract */)) { error(node.name, ts.Diagnostics.Accessors_must_both_be_abstract_or_non_abstract); } // TypeScript 1.0 spec (April 2014): 4.5 @@ -39591,7 +39932,7 @@ var ts; function checkTypeReferenceNode(node) { checkGrammarTypeArguments(node, node.typeArguments); if (node.kind === 159 /* TypeReference */ && node.typeName.jsdocDotPos !== undefined && !ts.isInJavaScriptFile(node) && !ts.isInJSDoc(node)) { - grammarErrorAtPos(ts.getSourceFileOfNode(node), node.typeName.jsdocDotPos, 1, ts.Diagnostics.JSDoc_types_can_only_be_used_inside_documentation_comments); + grammarErrorAtPos(node, node.typeName.jsdocDotPos, 1, ts.Diagnostics.JSDoc_types_can_only_be_used_inside_documentation_comments); } var type = getTypeFromTypeReference(node); if (type !== unknownType) { @@ -39600,7 +39941,17 @@ var ts; ts.forEach(node.typeArguments, checkSourceElement); if (produceDiagnostics) { var symbol = getNodeLinks(node).resolvedSymbol; - var typeParameters = symbol.flags & 524288 /* TypeAlias */ ? getSymbolLinks(symbol).typeParameters : type.target.localTypeParameters; + if (!symbol) { + // There is no resolved symbol cached if the type resolved to a builtin + // via JSDoc type reference resolution (eg, Boolean became boolean), none + // of which are generic when they have no associated symbol + error(node, ts.Diagnostics.Type_0_is_not_generic, typeToString(type)); + return; + } + var typeParameters = symbol.flags & 524288 /* TypeAlias */ && getSymbolLinks(symbol).typeParameters; + if (!typeParameters && getObjectFlags(type) & 4 /* Reference */) { + typeParameters = type.target.localTypeParameters; + } checkTypeArgumentConstraints(typeParameters, node.typeArguments); } } @@ -39645,18 +39996,17 @@ var ts; if (isTypeAssignableTo(indexType, getIndexType(objectType))) { return type; } - // Check if we're indexing with a numeric type and the object type is a generic - // type with a constraint that has a numeric index signature. - if (maybeTypeOfKind(objectType, 540672 /* TypeVariable */) && isTypeOfKind(indexType, 84 /* NumberLike */)) { - var constraint = getBaseConstraintOfType(objectType); - if (constraint && getIndexInfoOfType(constraint, 1 /* Number */)) { - return type; - } + // Check if we're indexing with a numeric type and if either object or index types + // is a generic type with a constraint that has a numeric index signature. + if (getIndexInfoOfType(getApparentType(objectType), 1 /* Number */) && isTypeAssignableToKind(indexType, 84 /* NumberLike */)) { + return type; } error(accessNode, ts.Diagnostics.Type_0_cannot_be_used_to_index_type_1, typeToString(indexType), typeToString(objectType)); return type; } function checkIndexedAccessType(node) { + checkSourceElement(node.objectType); + checkSourceElement(node.indexType); checkIndexedAccessIndexType(getTypeFromIndexedAccessTypeNode(node), node); } function checkMappedType(node) { @@ -39667,7 +40017,7 @@ var ts; checkTypeAssignableTo(constraintType, stringType, node.typeParameter.constraint); } function isPrivateWithinAmbient(node) { - return (ts.getModifierFlags(node) & 8 /* Private */) && ts.isInAmbientContext(node); + return ts.hasModifier(node, 8 /* Private */) && ts.isInAmbientContext(node); } function getEffectiveDeclarationFlags(n, flagsToCheck) { var flags = ts.getCombinedModifierFlags(n); @@ -39767,13 +40117,13 @@ var ts; (ts.isComputedPropertyName(node.name) && ts.isComputedPropertyName(subsequentName) || !ts.isComputedPropertyName(node.name) && !ts.isComputedPropertyName(subsequentName) && ts.getEscapedTextOfIdentifierOrLiteral(node.name) === ts.getEscapedTextOfIdentifierOrLiteral(subsequentName))) { var reportError = (node.kind === 151 /* MethodDeclaration */ || node.kind === 150 /* MethodSignature */) && - (ts.getModifierFlags(node) & 32 /* Static */) !== (ts.getModifierFlags(subsequentNode) & 32 /* Static */); + ts.hasModifier(node, 32 /* Static */) !== ts.hasModifier(subsequentNode, 32 /* Static */); // we can get here in two cases // 1. mixed static and instance class members // 2. something with the same name was defined before the set of overloads that prevents them from merging // here we'll report error only for the first case since for second we should already report error in binder if (reportError) { - var diagnostic = ts.getModifierFlags(node) & 32 /* Static */ ? ts.Diagnostics.Function_overload_must_be_static : ts.Diagnostics.Function_overload_must_not_be_static; + var diagnostic = ts.hasModifier(node, 32 /* Static */) ? ts.Diagnostics.Function_overload_must_be_static : ts.Diagnostics.Function_overload_must_not_be_static; error(errorNode_1, diagnostic); } return; @@ -39791,7 +40141,7 @@ var ts; else { // Report different errors regarding non-consecutive blocks of declarations depending on whether // the node in question is abstract. - if (ts.getModifierFlags(node) & 128 /* Abstract */) { + if (ts.hasModifier(node, 128 /* Abstract */)) { error(errorNode, ts.Diagnostics.All_declarations_of_an_abstract_method_must_be_consecutive); } else { @@ -39801,8 +40151,8 @@ var ts; } var duplicateFunctionDeclaration = false; var multipleConstructorImplementation = false; - for (var _i = 0, declarations_5 = declarations; _i < declarations_5.length; _i++) { - var current = declarations_5[_i]; + for (var _i = 0, declarations_4 = declarations; _i < declarations_4.length; _i++) { + var current = declarations_4[_i]; var node = current; var inAmbientContext = ts.isInAmbientContext(node); var inAmbientContextOrInterface = node.parent.kind === 230 /* InterfaceDeclaration */ || node.parent.kind === 163 /* TypeLiteral */ || inAmbientContext; @@ -39859,7 +40209,7 @@ var ts; } // Abstract methods can't have an implementation -- in particular, they don't need one. if (lastSeenNonAmbientDeclaration && !lastSeenNonAmbientDeclaration.body && - !(ts.getModifierFlags(lastSeenNonAmbientDeclaration) & 128 /* Abstract */) && !lastSeenNonAmbientDeclaration.questionToken) { + !ts.hasModifier(lastSeenNonAmbientDeclaration, 128 /* Abstract */) && !lastSeenNonAmbientDeclaration.questionToken) { reportImplementationExpectedError(lastSeenNonAmbientDeclaration); } if (hasOverloads) { @@ -40426,7 +40776,7 @@ var ts; // checkFunctionOrConstructorSymbol wouldn't be called if we didnt ignore javascript function. var firstDeclaration = ts.find(localSymbol.declarations, // Get first non javascript function declaration - function (declaration) { return declaration.kind === node.kind && !ts.isSourceFileJavaScript(ts.getSourceFileOfNode(declaration)); }); + function (declaration) { return declaration.kind === node.kind && !(declaration.flags & 65536 /* JavaScriptFile */); }); // Only type check the symbol once if (node === firstDeclaration) { checkFunctionOrConstructorSymbol(localSymbol); @@ -40569,14 +40919,14 @@ var ts; for (var _i = 0, _a = node.members; _i < _a.length; _i++) { var member = _a[_i]; if (member.kind === 151 /* MethodDeclaration */ || member.kind === 149 /* PropertyDeclaration */) { - if (!member.symbol.isReferenced && ts.getModifierFlags(member) & 8 /* Private */) { + if (!member.symbol.isReferenced && ts.hasModifier(member, 8 /* Private */)) { error(member.name, ts.Diagnostics._0_is_declared_but_never_used, ts.unescapeLeadingUnderscores(member.symbol.escapedName)); } } else if (member.kind === 152 /* Constructor */) { for (var _b = 0, _c = member.parameters; _b < _c.length; _b++) { var parameter = _c[_b]; - if (!parameter.symbol.isReferenced && ts.getModifierFlags(parameter) & 8 /* Private */) { + if (!parameter.symbol.isReferenced && ts.hasModifier(parameter, 8 /* Private */)) { error(parameter.name, ts.Diagnostics.Property_0_is_declared_but_never_used, ts.unescapeLeadingUnderscores(parameter.symbol.escapedName)); } } @@ -40997,7 +41347,7 @@ var ts; 128 /* Abstract */ | 64 /* Readonly */ | 32 /* Static */; - return (ts.getModifierFlags(left) & interestingFlags) === (ts.getModifierFlags(right) & interestingFlags); + return ts.getSelectedModifierFlags(left, interestingFlags) === ts.getSelectedModifierFlags(right, interestingFlags); } function checkVariableDeclaration(node) { checkGrammarVariableDeclaration(node); @@ -41162,7 +41512,7 @@ var ts; } // unknownType is returned i.e. if node.expression is identifier whose name cannot be resolved // in this case error about missing name is already reported - do not report extra one - if (!isTypeAnyOrAllConstituentTypesHaveKind(rightType, 32768 /* Object */ | 540672 /* TypeVariable */ | 16777216 /* NonPrimitive */)) { + if (!isTypeAssignableToKind(rightType, 16777216 /* NonPrimitive */ | 540672 /* TypeVariable */)) { error(node.expression, ts.Diagnostics.The_right_hand_side_of_a_for_in_statement_must_be_of_type_any_an_object_type_or_a_type_parameter); } checkSourceElement(node.statement); @@ -41662,7 +42012,7 @@ var ts; // Only process instance properties with computed names here. // Static properties cannot be in conflict with indexers, // and properties with literal names were already checked. - if (!(ts.getModifierFlags(member) & 32 /* Static */) && ts.hasDynamicName(member)) { + if (!ts.hasModifier(member, 32 /* Static */) && ts.hasDynamicName(member)) { var propType = getTypeOfSymbol(member.symbol); checkIndexConstraintForProperty(member.symbol, propType, type, declaredStringIndexer, stringIndexType, 0 /* String */); checkIndexConstraintForProperty(member.symbol, propType, type, declaredNumberIndexer, numberIndexType, 1 /* Number */); @@ -41773,8 +42123,8 @@ var ts; if (!areTypeParametersIdentical(declarations, type.localTypeParameters)) { // Report an error on every conflicting declaration. var name = symbolToString(symbol); - for (var _i = 0, declarations_6 = declarations; _i < declarations_6.length; _i++) { - var declaration = declarations_6[_i]; + for (var _i = 0, declarations_5 = declarations; _i < declarations_5.length; _i++) { + var declaration = declarations_5[_i]; error(declaration.name, ts.Diagnostics.All_declarations_of_0_must_have_identical_type_parameters, name); } } @@ -41783,8 +42133,8 @@ var ts; function areTypeParametersIdentical(declarations, typeParameters) { var maxTypeArgumentCount = ts.length(typeParameters); var minTypeArgumentCount = getMinTypeArgumentCount(typeParameters); - for (var _i = 0, declarations_7 = declarations; _i < declarations_7.length; _i++) { - var declaration = declarations_7[_i]; + for (var _i = 0, declarations_6 = declarations; _i < declarations_6.length; _i++) { + var declaration = declarations_6[_i]; // If this declaration has too few or too many type parameters, we report an error var numTypeParameters = ts.length(declaration.typeParameters); if (numTypeParameters < minTypeArgumentCount || numTypeParameters > maxTypeArgumentCount) { @@ -41827,7 +42177,7 @@ var ts; registerForUnusedIdentifiersCheck(node); } function checkClassDeclaration(node) { - if (!node.name && !(ts.getModifierFlags(node) & 512 /* Default */)) { + if (!node.name && !ts.hasModifier(node, 512 /* Default */)) { grammarErrorOnFirstToken(node, ts.Diagnostics.A_class_declaration_without_the_default_modifier_must_have_a_name); } checkClassLikeDeclaration(node); @@ -41925,7 +42275,7 @@ var ts; var signatures = getSignaturesOfType(type, 1 /* Construct */); if (signatures.length) { var declaration = signatures[0].declaration; - if (declaration && ts.getModifierFlags(declaration) & 8 /* Private */) { + if (declaration && ts.hasModifier(declaration, 8 /* Private */)) { var typeClassDeclaration = getClassLikeDeclarationOfSymbol(type.symbol); if (!isNodeWithinClass(node, typeClassDeclaration)) { error(node, ts.Diagnostics.Cannot_extend_a_class_0_Class_constructor_is_marked_as_private, getFullyQualifiedName(type.symbol)); @@ -41981,7 +42331,7 @@ var ts; // It is an error to inherit an abstract member without implementing it or being declared abstract. // If there is no declaration for the derived class (as in the case of class expressions), // then the class cannot be declared abstract. - if (baseDeclarationFlags & 128 /* Abstract */ && (!derivedClassDecl || !(ts.getModifierFlags(derivedClassDecl) & 128 /* Abstract */))) { + if (baseDeclarationFlags & 128 /* Abstract */ && (!derivedClassDecl || !ts.hasModifier(derivedClassDecl, 128 /* Abstract */))) { if (derivedClassDecl.kind === 199 /* ClassExpression */) { error(derivedClassDecl, ts.Diagnostics.Non_abstract_class_expression_does_not_implement_inherited_abstract_member_0_from_class_1, symbolToString(baseProperty), typeToString(baseType)); } @@ -42032,8 +42382,8 @@ var ts; for (var _i = 0, baseTypes_2 = baseTypes; _i < baseTypes_2.length; _i++) { var base = baseTypes_2[_i]; var properties = getPropertiesOfType(getTypeWithThisArgument(base, type.thisType)); - for (var _a = 0, properties_7 = properties; _a < properties_7.length; _a++) { - var prop = properties_7[_a]; + for (var _a = 0, properties_8 = properties; _a < properties_8.length; _a++) { + var prop = properties_8[_a]; var existing = seen.get(prop.escapedName); if (!existing) { seen.set(prop.escapedName, { prop: prop, containingType: base }); @@ -42307,8 +42657,8 @@ var ts; } function getFirstNonAmbientClassOrFunctionDeclaration(symbol) { var declarations = symbol.declarations; - for (var _i = 0, declarations_8 = declarations; _i < declarations_8.length; _i++) { - var declaration = declarations_8[_i]; + for (var _i = 0, declarations_7 = declarations; _i < declarations_7.length; _i++) { + var declaration = declarations_7[_i]; if ((declaration.kind === 229 /* ClassDeclaration */ || (declaration.kind === 228 /* FunctionDeclaration */ && ts.nodeIsPresent(declaration.body))) && !ts.isInAmbientContext(declaration)) { @@ -42558,7 +42908,7 @@ var ts; // If we hit an import declaration in an illegal context, just bail out to avoid cascading errors. return; } - if (!checkGrammarDecorators(node) && !checkGrammarModifiers(node) && ts.getModifierFlags(node) !== 0) { + if (!checkGrammarDecorators(node) && !checkGrammarModifiers(node) && ts.hasModifiers(node)) { grammarErrorOnFirstToken(node, ts.Diagnostics.An_import_declaration_cannot_have_modifiers); } if (checkExternalImportOrExportDeclaration(node)) { @@ -42586,7 +42936,7 @@ var ts; checkGrammarDecorators(node) || checkGrammarModifiers(node); if (ts.isInternalModuleImportEqualsDeclaration(node) || checkExternalImportOrExportDeclaration(node)) { checkImportBinding(node); - if (ts.getModifierFlags(node) & 1 /* Export */) { + if (ts.hasModifier(node, 1 /* Export */)) { markExportAsReferenced(node); } if (ts.isInternalModuleImportEqualsDeclaration(node)) { @@ -42617,7 +42967,7 @@ var ts; // If we hit an export in an illegal context, just bail out to avoid cascading errors. return; } - if (!checkGrammarDecorators(node) && !checkGrammarModifiers(node) && ts.getModifierFlags(node) !== 0) { + if (!checkGrammarDecorators(node) && !checkGrammarModifiers(node) && ts.hasModifiers(node)) { grammarErrorOnFirstToken(node, ts.Diagnostics.An_export_declaration_cannot_have_modifiers); } if (!node.moduleSpecifier || checkExternalImportOrExportDeclaration(node)) { @@ -42682,7 +43032,7 @@ var ts; return; } // Grammar checking - if (!checkGrammarDecorators(node) && !checkGrammarModifiers(node) && ts.getModifierFlags(node) !== 0) { + if (!checkGrammarDecorators(node) && !checkGrammarModifiers(node) && ts.hasModifiers(node)) { grammarErrorOnFirstToken(node, ts.Diagnostics.An_export_assignment_cannot_have_modifiers); } if (node.expression.kind === 71 /* Identifier */) { @@ -42736,8 +43086,8 @@ var ts; return; } if (exportedDeclarationsCount > 1) { - for (var _i = 0, declarations_9 = declarations; _i < declarations_9.length; _i++) { - var declaration = declarations_9[_i]; + for (var _i = 0, declarations_8 = declarations; _i < declarations_8.length; _i++) { + var declaration = declarations_8[_i]; if (isNotOverload(declaration)) { diagnostics.add(ts.createDiagnosticForNode(declaration, ts.Diagnostics.Cannot_redeclare_exported_variable_0, ts.unescapeLeadingUnderscores(id))); } @@ -43046,7 +43396,7 @@ var ts; return []; } var symbols = ts.createSymbolTable(); - var memberFlags = 0 /* None */; + var isStatic = false; populateSymbols(); return symbolsToArray(symbols); function populateSymbols() { @@ -43075,7 +43425,7 @@ var ts; // add the type parameters into the symbol table // (type parameters of classDeclaration/classExpression and interface are in member property of the symbol. // Note: that the memberFlags come from previous iteration. - if (!(memberFlags & 32 /* Static */)) { + if (!isStatic) { copySymbols(getSymbolOfNode(location).members, meaning & 793064 /* Type */); } break; @@ -43089,7 +43439,7 @@ var ts; if (ts.introducesArgumentsExoticObject(location)) { copySymbol(argumentsSymbol, meaning); } - memberFlags = ts.getModifierFlags(location); + isStatic = ts.hasModifier(location, 32 /* Static */); location = location.parent; } copySymbols(globals, meaning); @@ -43351,12 +43701,7 @@ var ts; // index access if (node.parent.kind === 180 /* ElementAccessExpression */ && node.parent.argumentExpression === node) { var objectType = getTypeOfExpression(node.parent.expression); - if (objectType === unknownType) - return undefined; - var apparentType = getApparentType(objectType); - if (apparentType === unknownType) - return undefined; - return getPropertyOfType(apparentType, node.text); + return getPropertyOfType(objectType, node.text); } break; } @@ -43487,7 +43832,7 @@ var ts; */ function getParentTypeOfClassElement(node) { var classSymbol = getSymbolOfNode(node.parent); - return ts.getModifierFlags(node) & 32 /* Static */ + return ts.hasModifier(node, 32 /* Static */) ? getTypeOfSymbol(classSymbol) : getDeclaredTypeOfSymbol(classSymbol); } @@ -43769,13 +44114,13 @@ var ts; return strictNullChecks && !isOptionalParameter(parameter) && parameter.initializer && - !(ts.getModifierFlags(parameter) & 92 /* ParameterPropertyModifier */); + !ts.hasModifier(parameter, 92 /* ParameterPropertyModifier */); } function isOptionalUninitializedParameterProperty(parameter) { return strictNullChecks && isOptionalParameter(parameter) && !parameter.initializer && - !!(ts.getModifierFlags(parameter) & 92 /* ParameterPropertyModifier */); + ts.hasModifier(parameter, 92 /* ParameterPropertyModifier */); } function getNodeCheckFlags(node) { return getNodeLinks(node).flags; @@ -43835,22 +44180,22 @@ var ts; else if (type.flags & 1 /* Any */) { return ts.TypeReferenceSerializationKind.ObjectType; } - else if (isTypeOfKind(type, 1024 /* Void */ | 6144 /* Nullable */ | 8192 /* Never */)) { + else if (isTypeAssignableToKind(type, 1024 /* Void */ | 6144 /* Nullable */ | 8192 /* Never */)) { return ts.TypeReferenceSerializationKind.VoidNullableOrNeverType; } - else if (isTypeOfKind(type, 136 /* BooleanLike */)) { + else if (isTypeAssignableToKind(type, 136 /* BooleanLike */)) { return ts.TypeReferenceSerializationKind.BooleanType; } - else if (isTypeOfKind(type, 84 /* NumberLike */)) { + else if (isTypeAssignableToKind(type, 84 /* NumberLike */)) { return ts.TypeReferenceSerializationKind.NumberLikeType; } - else if (isTypeOfKind(type, 262178 /* StringLike */)) { + else if (isTypeAssignableToKind(type, 262178 /* StringLike */)) { return ts.TypeReferenceSerializationKind.StringLikeType; } else if (isTupleType(type)) { return ts.TypeReferenceSerializationKind.ArrayLikeType; } - else if (isTypeOfKind(type, 512 /* ESSymbol */)) { + else if (isTypeAssignableToKind(type, 512 /* ESSymbol */)) { return ts.TypeReferenceSerializationKind.ESSymbolType; } else if (isFunctionType(type)) { @@ -44346,7 +44691,7 @@ var ts; node.kind !== 154 /* SetAccessor */) { return grammarErrorOnNode(modifier, ts.Diagnostics.abstract_modifier_can_only_appear_on_a_class_method_or_property_declaration); } - if (!(node.parent.kind === 229 /* ClassDeclaration */ && ts.getModifierFlags(node.parent) & 128 /* Abstract */)) { + if (!(node.parent.kind === 229 /* ClassDeclaration */ && ts.hasModifier(node.parent, 128 /* Abstract */))) { return grammarErrorOnNode(modifier, ts.Diagnostics.Abstract_methods_can_only_appear_within_an_abstract_class); } if (flags & 32 /* Static */) { @@ -44469,8 +44814,7 @@ var ts; if (list && list.hasTrailingComma) { var start = list.end - ",".length; var end = list.end; - var sourceFile = ts.getSourceFileOfNode(list[0]); - return grammarErrorAtPos(sourceFile, start, end - start, ts.Diagnostics.Trailing_comma_not_allowed); + return grammarErrorAtPos(list[0], start, end - start, ts.Diagnostics.Trailing_comma_not_allowed); } } function checkGrammarTypeParameterList(typeParameters, file) { @@ -44547,7 +44891,7 @@ var ts; if (parameter.dotDotDotToken) { return grammarErrorOnNode(parameter.dotDotDotToken, ts.Diagnostics.An_index_signature_cannot_have_a_rest_parameter); } - if (ts.getModifierFlags(parameter) !== 0) { + if (ts.hasModifiers(parameter)) { return grammarErrorOnNode(parameter.name, ts.Diagnostics.An_index_signature_parameter_cannot_have_an_accessibility_modifier); } if (parameter.questionToken) { @@ -44582,19 +44926,18 @@ var ts; return checkGrammarForDisallowedTrailingComma(typeArguments) || checkGrammarForAtLeastOneTypeArgument(node, typeArguments); } - function checkGrammarForOmittedArgument(node, args) { + function checkGrammarForOmittedArgument(args) { if (args) { - var sourceFile = ts.getSourceFileOfNode(node); for (var _i = 0, args_5 = args; _i < args_5.length; _i++) { var arg = args_5[_i]; if (arg.kind === 200 /* OmittedExpression */) { - return grammarErrorAtPos(sourceFile, arg.pos, 0, ts.Diagnostics.Argument_expression_expected); + return grammarErrorAtPos(arg, arg.pos, 0, ts.Diagnostics.Argument_expression_expected); } } } } - function checkGrammarArguments(node, args) { - return checkGrammarForOmittedArgument(node, args); + function checkGrammarArguments(args) { + return checkGrammarForOmittedArgument(args); } function checkGrammarHeritageClause(node) { var types = node.types; @@ -44603,8 +44946,7 @@ var ts; } if (types && types.length === 0) { var listType = ts.tokenToString(node.token); - var sourceFile = ts.getSourceFileOfNode(node); - return grammarErrorAtPos(sourceFile, types.pos, 0, ts.Diagnostics._0_list_cannot_be_empty, listType); + return grammarErrorAtPos(node, types.pos, 0, ts.Diagnostics._0_list_cannot_be_empty, listType); } return ts.forEach(types, checkGrammarExpressionWithTypeArguments); } @@ -44850,10 +45192,10 @@ var ts; else if (ts.isInAmbientContext(accessor)) { return grammarErrorOnNode(accessor.name, ts.Diagnostics.An_accessor_cannot_be_declared_in_an_ambient_context); } - else if (accessor.body === undefined && !(ts.getModifierFlags(accessor) & 128 /* Abstract */)) { - return grammarErrorAtPos(ts.getSourceFileOfNode(accessor), accessor.end - 1, ";".length, ts.Diagnostics._0_expected, "{"); + else if (accessor.body === undefined && !ts.hasModifier(accessor, 128 /* Abstract */)) { + return grammarErrorAtPos(accessor, accessor.end - 1, ";".length, ts.Diagnostics._0_expected, "{"); } - else if (accessor.body && ts.getModifierFlags(accessor) & 128 /* Abstract */) { + else if (accessor.body && ts.hasModifier(accessor, 128 /* Abstract */)) { return grammarErrorOnNode(accessor, ts.Diagnostics.An_abstract_accessor_cannot_have_an_implementation); } else if (accessor.typeParameters) { @@ -44910,7 +45252,7 @@ var ts; return true; } else if (node.body === undefined) { - return grammarErrorAtPos(ts.getSourceFileOfNode(node), node.end - 1, ";".length, ts.Diagnostics._0_expected, "{"); + return grammarErrorAtPos(node, node.end - 1, ";".length, ts.Diagnostics._0_expected, "{"); } } if (ts.isClassLike(node.parent)) { @@ -44991,7 +45333,7 @@ var ts; } if (node.initializer) { // Error on equals token which immediately precedes the initializer - return grammarErrorAtPos(ts.getSourceFileOfNode(node), node.initializer.pos - 1, 1, ts.Diagnostics.A_rest_element_cannot_have_an_initializer); + return grammarErrorAtPos(node, node.initializer.pos - 1, 1, ts.Diagnostics.A_rest_element_cannot_have_an_initializer); } } } @@ -45012,13 +45354,13 @@ var ts; else { // Error on equals token which immediate precedes the initializer var equalsTokenLength = "=".length; - return grammarErrorAtPos(ts.getSourceFileOfNode(node), node.initializer.pos - equalsTokenLength, equalsTokenLength, ts.Diagnostics.Initializers_are_not_allowed_in_ambient_contexts); + return grammarErrorAtPos(node, node.initializer.pos - equalsTokenLength, equalsTokenLength, ts.Diagnostics.Initializers_are_not_allowed_in_ambient_contexts); } } if (node.initializer && !(ts.isConst(node) && isStringOrNumberLiteralExpression(node.initializer))) { // Error on equals token which immediate precedes the initializer var equalsTokenLength = "=".length; - return grammarErrorAtPos(ts.getSourceFileOfNode(node), node.initializer.pos - equalsTokenLength, equalsTokenLength, ts.Diagnostics.Initializers_are_not_allowed_in_ambient_contexts); + return grammarErrorAtPos(node, node.initializer.pos - equalsTokenLength, equalsTokenLength, ts.Diagnostics.Initializers_are_not_allowed_in_ambient_contexts); } } else if (!node.initializer) { @@ -45081,7 +45423,7 @@ var ts; return true; } if (!declarationList.declarations.length) { - return grammarErrorAtPos(ts.getSourceFileOfNode(declarationList), declarations.pos, declarations.end - declarations.pos, ts.Diagnostics.Variable_declaration_list_cannot_be_empty); + return grammarErrorAtPos(declarationList, declarations.pos, declarations.end - declarations.pos, ts.Diagnostics.Variable_declaration_list_cannot_be_empty); } } function allowLetAndConstDeclarations(parent) { @@ -45127,7 +45469,8 @@ var ts; return true; } } - function grammarErrorAtPos(sourceFile, start, length, message, arg0, arg1, arg2) { + function grammarErrorAtPos(nodeForSourceFile, start, length, message, arg0, arg1, arg2) { + var sourceFile = ts.getSourceFileOfNode(nodeForSourceFile); if (!hasParseDiagnostics(sourceFile)) { diagnostics.add(ts.createFileDiagnostic(sourceFile, start, length, message, arg0, arg1, arg2)); return true; @@ -45142,7 +45485,7 @@ var ts; } function checkGrammarConstructorTypeParameters(node) { if (node.typeParameters) { - return grammarErrorAtPos(ts.getSourceFileOfNode(node), node.typeParameters.pos, node.typeParameters.end - node.typeParameters.pos, ts.Diagnostics.Type_parameters_cannot_appear_on_a_constructor_declaration); + return grammarErrorAtPos(node, node.typeParameters.pos, node.typeParameters.end - node.typeParameters.pos, ts.Diagnostics.Type_parameters_cannot_appear_on_a_constructor_declaration); } } function checkGrammarConstructorTypeAnnotation(node) { @@ -45196,7 +45539,7 @@ var ts; node.kind === 244 /* ExportDeclaration */ || node.kind === 243 /* ExportAssignment */ || node.kind === 236 /* NamespaceExportDeclaration */ || - ts.getModifierFlags(node) & (2 /* Ambient */ | 1 /* Export */ | 512 /* Default */)) { + ts.hasModifier(node, 2 /* Ambient */ | 1 /* Export */ | 512 /* Default */)) { return false; } return grammarErrorOnFirstToken(node, ts.Diagnostics.A_declare_modifier_is_required_for_a_top_level_declaration_in_a_d_ts_file); @@ -48142,7 +48485,7 @@ var ts; function createExpressionForAccessorDeclaration(properties, property, receiver, multiLine) { var _a = ts.getAllAccessorDeclarations(properties, property), firstAccessor = _a.firstAccessor, getAccessor = _a.getAccessor, setAccessor = _a.setAccessor; if (property === firstAccessor) { - var properties_8 = []; + var properties_9 = []; if (getAccessor) { var getterFunction = ts.createFunctionExpression(getAccessor.modifiers, /*asteriskToken*/ undefined, @@ -48152,7 +48495,7 @@ var ts; ts.setTextRange(getterFunction, getAccessor); ts.setOriginalNode(getterFunction, getAccessor); var getter = ts.createPropertyAssignment("get", getterFunction); - properties_8.push(getter); + properties_9.push(getter); } if (setAccessor) { var setterFunction = ts.createFunctionExpression(setAccessor.modifiers, @@ -48163,15 +48506,15 @@ var ts; ts.setTextRange(setterFunction, setAccessor); ts.setOriginalNode(setterFunction, setAccessor); var setter = ts.createPropertyAssignment("set", setterFunction); - properties_8.push(setter); + properties_9.push(setter); } - properties_8.push(ts.createPropertyAssignment("enumerable", ts.createTrue())); - properties_8.push(ts.createPropertyAssignment("configurable", ts.createTrue())); + properties_9.push(ts.createPropertyAssignment("enumerable", ts.createTrue())); + properties_9.push(ts.createPropertyAssignment("configurable", ts.createTrue())); var expression = ts.setTextRange(ts.createCall(ts.createPropertyAccess(ts.createIdentifier("Object"), "defineProperty"), /*typeArguments*/ undefined, [ receiver, createExpressionForPropertyName(property.name), - ts.createObjectLiteral(properties_8, multiLine) + ts.createObjectLiteral(properties_9, multiLine) ]), /*location*/ firstAccessor); return ts.aggregateTransformFlags(expression); @@ -50628,11 +50971,14 @@ var ts; : numElements, location), /*reuseIdentifierExpressions*/ false, location); } - else if (numElements !== 1 && (flattenContext.level < 1 /* ObjectRest */ || numElements === 0)) { + else if (numElements !== 1 && (flattenContext.level < 1 /* ObjectRest */ || numElements === 0) + || ts.every(elements, ts.isOmittedExpression)) { // For anything other than a single-element destructuring we need to generate a temporary // to ensure value is evaluated exactly once. Additionally, if we have zero elements // we need to emit *something* to ensure that in case a 'var' keyword was already emitted, // so in that case, we'll intentionally create that temporary. + // Or all the elements of the binding pattern are omitted expression such as "var [,] = [1,2]", + // then we will create temporary variable. var reuseIdentifierExpressions = !ts.isDeclarationBindingElement(parent) || numElements !== 0; value = ensureIdentifier(flattenContext, value, reuseIdentifierExpressions, location); } @@ -50919,7 +51265,16 @@ var ts; if (ts.hasModifier(node, 2 /* Ambient */)) { break; } - recordEmittedDeclarationInScope(node); + // Record these declarations provided that they have a name. + if (node.name) { + recordEmittedDeclarationInScope(node); + } + else { + // These nodes should always have names unless they are default-exports; + // however, class declaration parsing allows for undefined names, so syntactically invalid + // programs may also have an undefined name. + ts.Debug.assert(node.kind === 229 /* ClassDeclaration */ || ts.hasModifier(node, 512 /* Default */)); + } break; } } @@ -51748,8 +52103,8 @@ var ts; * @param receiver The receiver on which each property should be assigned. */ function addInitializedPropertyStatements(statements, properties, receiver) { - for (var _i = 0, properties_9 = properties; _i < properties_9.length; _i++) { - var property = properties_9[_i]; + for (var _i = 0, properties_10 = properties; _i < properties_10.length; _i++) { + var property = properties_10[_i]; var statement = ts.createStatement(transformInitializedProperty(property, receiver)); ts.setSourceMapRange(statement, ts.moveRangePastModifiers(property)); ts.setCommentRange(statement, property); @@ -51764,8 +52119,8 @@ var ts; */ function generateInitializedPropertyExpressions(properties, receiver) { var expressions = []; - for (var _i = 0, properties_10 = properties; _i < properties_10.length; _i++) { - var property = properties_10[_i]; + for (var _i = 0, properties_11 = properties; _i < properties_11.length; _i++) { + var property = properties_11[_i]; var expression = transformInitializedProperty(property, receiver); expression.startsOnNewLine = true; ts.setSourceMapRange(expression, ts.moveRangePastModifiers(property)); @@ -52928,33 +53283,30 @@ var ts; /** * Records that a declaration was emitted in the current scope, if it was the first * declaration for the provided symbol. - * - * NOTE: if there is ever a transformation above this one, we may not be able to rely - * on symbol names. */ function recordEmittedDeclarationInScope(node) { - var name = node.symbol && node.symbol.escapedName; - if (name) { - if (!currentScopeFirstDeclarationsOfName) { - currentScopeFirstDeclarationsOfName = ts.createUnderscoreEscapedMap(); - } - if (!currentScopeFirstDeclarationsOfName.has(name)) { - currentScopeFirstDeclarationsOfName.set(name, node); - } + if (!currentScopeFirstDeclarationsOfName) { + currentScopeFirstDeclarationsOfName = ts.createUnderscoreEscapedMap(); + } + var name = declaredNameInScope(node); + if (!currentScopeFirstDeclarationsOfName.has(name)) { + currentScopeFirstDeclarationsOfName.set(name, node); } } /** - * Determines whether a declaration is the first declaration with the same name emitted - * in the current scope. + * Determines whether a declaration is the first declaration with + * the same name emitted in the current scope. */ function isFirstEmittedDeclarationInScope(node) { if (currentScopeFirstDeclarationsOfName) { - var name = node.symbol && node.symbol.escapedName; - if (name) { - return currentScopeFirstDeclarationsOfName.get(name) === node; - } + var name = declaredNameInScope(node); + return currentScopeFirstDeclarationsOfName.get(name) === node; } - return false; + return true; + } + function declaredNameInScope(node) { + ts.Debug.assertNode(node.name, ts.isIdentifier); + return node.name.escapedText; } /** * Adds a leading VariableStatement for a enum or module declaration. @@ -53021,7 +53373,7 @@ var ts; if (!shouldEmitModuleDeclaration(node)) { return ts.createNotEmittedStatement(node); } - ts.Debug.assert(ts.isIdentifier(node.name), "TypeScript module should have an Identifier name."); + ts.Debug.assertNode(node.name, ts.isIdentifier, "A TypeScript namespace should have an Identifier name."); enableSubstitutionForNamespaceExports(); var statements = []; // We request to be advised when the printer is about to print this node. This allows @@ -54050,6 +54402,8 @@ var ts; return visitExpressionStatement(node); case 185 /* ParenthesizedExpression */: return visitParenthesizedExpression(node, noDestructuringValue); + case 260 /* CatchClause */: + return visitCatchClause(node); default: return ts.visitEachChild(node, visitor, context); } @@ -54130,6 +54484,12 @@ var ts; function visitParenthesizedExpression(node, noDestructuringValue) { return ts.visitEachChild(node, noDestructuringValue ? visitorNoDestructuringValue : visitor, context); } + function visitCatchClause(node) { + if (!node.variableDeclaration) { + return ts.updateCatchClause(node, ts.createVariableDeclaration(ts.createTempVariable(/*recordTempVariable*/ undefined)), ts.visitNode(node.block, visitor, ts.isBlock)); + } + return ts.visitEachChild(node, visitor, context); + } /** * Visits a BinaryExpression that contains a destructuring assignment. * @@ -54674,7 +55034,7 @@ var ts; objectProperties = ts.createAssignHelper(context, segments); } } - var element = ts.createExpressionForJsxElement(context.getEmitResolver().getJsxFactoryEntity(), compilerOptions.reactNamespace, tagName, objectProperties, ts.filter(ts.map(children, transformJsxChildToExpression), ts.isDefined), node, location); + var element = ts.createExpressionForJsxElement(context.getEmitResolver().getJsxFactoryEntity(), compilerOptions.reactNamespace, tagName, objectProperties, ts.mapDefined(children, transformJsxChildToExpression), node, location); if (isChild) { ts.startOnNewLine(element); } @@ -55378,7 +55738,7 @@ var ts; function shouldVisitNode(node) { return (node.transformFlags & 128 /* ContainsES2015 */) !== 0 || convertedLoopState !== undefined - || (hierarchyFacts & 4096 /* ConstructorWithCapturedSuper */ && ts.isStatement(node)) + || (hierarchyFacts & 4096 /* ConstructorWithCapturedSuper */ && (ts.isStatement(node) || (node.kind === 207 /* Block */))) || (ts.isIterationStatement(node, /*lookInLabeledStatements*/ false) && shouldConvertIterationStatementBody(node)) || isTypeScriptClassWrapper(node); } @@ -55733,10 +56093,12 @@ var ts; var outer = ts.createPartiallyEmittedExpression(inner); outer.end = ts.skipTrivia(currentText, node.pos); ts.setEmitFlags(outer, 1536 /* NoComments */); - return ts.createParen(ts.createCall(outer, + var result = ts.createParen(ts.createCall(outer, /*typeArguments*/ undefined, extendsClauseElement ? [ts.visitNode(extendsClauseElement.expression, visitor, ts.isExpression)] : [])); + ts.addSyntheticLeadingComment(result, 3 /* MultiLineCommentTrivia */, "* @class "); + return result; } /** * Transforms a ClassExpression or ClassDeclaration into a function body. @@ -56654,13 +57016,14 @@ var ts; ts.setTextRange(declarationList, node); ts.setCommentRange(declarationList, node); if (node.transformFlags & 8388608 /* ContainsBindingPattern */ - && (ts.isBindingPattern(node.declarations[0].name) - || ts.isBindingPattern(ts.lastOrUndefined(node.declarations).name))) { + && (ts.isBindingPattern(node.declarations[0].name) || ts.isBindingPattern(ts.lastOrUndefined(node.declarations).name))) { // If the first or last declaration is a binding pattern, we need to modify // the source map range for the declaration list. var firstDeclaration = ts.firstOrUndefined(declarations); - var lastDeclaration = ts.lastOrUndefined(declarations); - ts.setSourceMapRange(declarationList, ts.createRange(firstDeclaration.pos, lastDeclaration.end)); + if (firstDeclaration) { + var lastDeclaration = ts.lastOrUndefined(declarations); + ts.setSourceMapRange(declarationList, ts.createRange(firstDeclaration.pos, lastDeclaration.end)); + } } return declarationList; } @@ -57405,6 +57768,7 @@ var ts; function visitCatchClause(node) { var ancestorFacts = enterSubtree(4032 /* BlockScopeExcludes */, 0 /* BlockScopeIncludes */); var updated; + ts.Debug.assert(!!node.variableDeclaration, "Catch clause variable should always be present when downleveling ES2015."); if (ts.isBindingPattern(node.variableDeclaration.name)) { var temp = ts.createTempVariable(/*recordTempVariable*/ undefined); var newVariableDeclaration = ts.createVariableDeclaration(temp); @@ -59593,8 +59957,13 @@ var ts; } function transformAndEmitContinueStatement(node) { var label = findContinueTarget(node.label ? ts.unescapeLeadingUnderscores(node.label.escapedText) : undefined); - ts.Debug.assert(label > 0, "Expected continue statment to point to a valid Label."); - emitBreak(label, /*location*/ node); + if (label > 0) { + emitBreak(label, /*location*/ node); + } + else { + // invalid continue without a containing loop. Leave the node as is, per #17875. + emitStatement(node); + } } function visitContinueStatement(node) { if (inStatementContainingYield) { @@ -59607,8 +59976,13 @@ var ts; } function transformAndEmitBreakStatement(node) { var label = findBreakTarget(node.label ? ts.unescapeLeadingUnderscores(node.label.escapedText) : undefined); - ts.Debug.assert(label > 0, "Expected break statment to point to a valid Label."); - emitBreak(label, /*location*/ node); + if (label > 0) { + emitBreak(label, /*location*/ node); + } + else { + // invalid break without a containing loop, switch, or labeled statement. Leave the node as is, per #17875. + emitStatement(node); + } } function visitBreakStatement(node) { if (inStatementContainingYield) { @@ -59979,9 +60353,6 @@ var ts; var block = endBlock(); markLabel(block.endLabel); } - function isWithBlock(block) { - return block.kind === 1 /* With */; - } /** * Begins a code block for a generated `try` statement. */ @@ -60065,9 +60436,6 @@ var ts; emitNop(); exception.state = 3 /* Done */; } - function isExceptionBlock(block) { - return block.kind === 0 /* Exception */; - } /** * Begins a code block that supports `break` or `continue` statements that are defined in * the source tree and not from generated code. @@ -60218,23 +60586,24 @@ var ts; * @param labelText An optional name of a containing labeled statement. */ function findBreakTarget(labelText) { - ts.Debug.assert(blocks !== undefined); - if (labelText) { - for (var i = blockStack.length - 1; i >= 0; i--) { - var block = blockStack[i]; - if (supportsLabeledBreakOrContinue(block) && block.labelText === labelText) { - return block.breakLabel; - } - else if (supportsUnlabeledBreak(block) && hasImmediateContainingLabeledBlock(labelText, i - 1)) { - return block.breakLabel; + if (blockStack) { + if (labelText) { + for (var i = blockStack.length - 1; i >= 0; i--) { + var block = blockStack[i]; + if (supportsLabeledBreakOrContinue(block) && block.labelText === labelText) { + return block.breakLabel; + } + else if (supportsUnlabeledBreak(block) && hasImmediateContainingLabeledBlock(labelText, i - 1)) { + return block.breakLabel; + } } } - } - else { - for (var i = blockStack.length - 1; i >= 0; i--) { - var block = blockStack[i]; - if (supportsUnlabeledBreak(block)) { - return block.breakLabel; + else { + for (var i = blockStack.length - 1; i >= 0; i--) { + var block = blockStack[i]; + if (supportsUnlabeledBreak(block)) { + return block.breakLabel; + } } } } @@ -60246,20 +60615,21 @@ var ts; * @param labelText An optional name of a containing labeled statement. */ function findContinueTarget(labelText) { - ts.Debug.assert(blocks !== undefined); - if (labelText) { - for (var i = blockStack.length - 1; i >= 0; i--) { - var block = blockStack[i]; - if (supportsUnlabeledContinue(block) && hasImmediateContainingLabeledBlock(labelText, i - 1)) { - return block.continueLabel; + if (blockStack) { + if (labelText) { + for (var i = blockStack.length - 1; i >= 0; i--) { + var block = blockStack[i]; + if (supportsUnlabeledContinue(block) && hasImmediateContainingLabeledBlock(labelText, i - 1)) { + return block.continueLabel; + } } } - } - else { - for (var i = blockStack.length - 1; i >= 0; i--) { - var block = blockStack[i]; - if (supportsUnlabeledContinue(block)) { - return block.continueLabel; + else { + for (var i = blockStack.length - 1; i >= 0; i--) { + var block = blockStack[i]; + if (supportsUnlabeledContinue(block)) { + return block.continueLabel; + } } } } @@ -60301,7 +60671,7 @@ var ts; * @param location An optional source map location for the statement. */ function createInlineBreak(label, location) { - ts.Debug.assert(label > 0, "Invalid label: " + label); + ts.Debug.assertLessThan(0, label, "Invalid label"); return ts.setTextRange(ts.createReturn(ts.createArrayLiteral([ createInstruction(3 /* Break */), createLabel(label) @@ -60642,31 +61012,33 @@ var ts; for (; blockIndex < blockActions.length && blockOffsets[blockIndex] <= operationIndex; blockIndex++) { var block = blocks[blockIndex]; var blockAction = blockActions[blockIndex]; - if (isExceptionBlock(block)) { - if (blockAction === 0 /* Open */) { - if (!exceptionBlockStack) { - exceptionBlockStack = []; + switch (block.kind) { + case 0 /* Exception */: + if (blockAction === 0 /* Open */) { + if (!exceptionBlockStack) { + exceptionBlockStack = []; + } + if (!statements) { + statements = []; + } + exceptionBlockStack.push(currentExceptionBlock); + currentExceptionBlock = block; } - if (!statements) { - statements = []; + else if (blockAction === 1 /* Close */) { + currentExceptionBlock = exceptionBlockStack.pop(); } - exceptionBlockStack.push(currentExceptionBlock); - currentExceptionBlock = block; - } - else if (blockAction === 1 /* Close */) { - currentExceptionBlock = exceptionBlockStack.pop(); - } - } - else if (isWithBlock(block)) { - if (blockAction === 0 /* Open */) { - if (!withBlockStack) { - withBlockStack = []; + break; + case 1 /* With */: + if (blockAction === 0 /* Open */) { + if (!withBlockStack) { + withBlockStack = []; + } + withBlockStack.push(block); } - withBlockStack.push(block); - } - else if (blockAction === 1 /* Close */) { - withBlockStack.pop(); - } + else if (blockAction === 1 /* Close */) { + withBlockStack.pop(); + } + break; } } } @@ -64580,14 +64952,14 @@ var ts; writer.writeLine(); } } - function emitTrailingCommentsOfPosition(pos) { + function emitTrailingCommentsOfPosition(pos, prefixSpace) { if (disabled) { return; } if (extendedDiagnostics) { ts.performance.mark("beforeEmitTrailingCommentsOfPosition"); } - forEachTrailingCommentToEmit(pos, emitTrailingCommentOfPosition); + forEachTrailingCommentToEmit(pos, prefixSpace ? emitTrailingComment : emitTrailingCommentOfPosition); if (extendedDiagnostics) { ts.performance.measure("commentTime", "beforeEmitTrailingCommentsOfPosition"); } @@ -64676,17 +65048,7 @@ var ts; * @return true if the comment is a triple-slash comment else false */ function isTripleSlashComment(commentPos, commentEnd) { - // Verify this is /// comment, but do the regexp match only when we first can find /// in the comment text - // so that we don't end up computing comment string and doing match for all // comments - if (currentText.charCodeAt(commentPos + 1) === 47 /* slash */ && - commentPos + 2 < commentEnd && - currentText.charCodeAt(commentPos + 2) === 47 /* slash */) { - var textSubStr = currentText.substring(commentPos, commentEnd); - return textSubStr.match(ts.fullTripleSlashReferencePathRegEx) || - textSubStr.match(ts.fullTripleSlashAMDReferencePathRegEx) ? - true : false; - } - return false; + return ts.isRecognizedTripleSlashComment(currentText, commentPos, commentEnd); } } ts.createCommentWriter = createCommentWriter; @@ -64972,7 +65334,6 @@ var ts; errorNameNode = declaration.name; var format = 4 /* UseTypeOfFunction */ | 16384 /* WriteClassExpressionAsTypeLiteral */ | - 2048 /* UseTypeAliasValue */ | (shouldUseResolverType ? 8192 /* AddUndefined */ : 0); resolver.writeTypeOfDeclaration(declaration, enclosingDeclaration, format, writer); errorNameNode = undefined; @@ -64987,7 +65348,7 @@ var ts; } else { errorNameNode = signature.name; - resolver.writeReturnTypeOfSignatureDeclaration(signature, enclosingDeclaration, 4 /* UseTypeOfFunction */ | 2048 /* UseTypeAliasValue */ | 16384 /* WriteClassExpressionAsTypeLiteral */, writer); + resolver.writeReturnTypeOfSignatureDeclaration(signature, enclosingDeclaration, 4 /* UseTypeOfFunction */ | 16384 /* WriteClassExpressionAsTypeLiteral */, writer); errorNameNode = undefined; } } @@ -65225,7 +65586,7 @@ var ts; write(tempVarName); write(": "); writer.getSymbolAccessibilityDiagnostic = function () { return diagnostic; }; - resolver.writeTypeOfExpression(expr, enclosingDeclaration, 4 /* UseTypeOfFunction */ | 2048 /* UseTypeAliasValue */ | 16384 /* WriteClassExpressionAsTypeLiteral */, writer); + resolver.writeTypeOfExpression(expr, enclosingDeclaration, 4 /* UseTypeOfFunction */ | 16384 /* WriteClassExpressionAsTypeLiteral */, writer); write(";"); writeLine(); return tempVarName; @@ -65898,6 +66259,10 @@ var ts; return ts.forEach(node.declarationList.declarations, function (varDeclaration) { return resolver.isDeclarationVisible(varDeclaration); }); } function writeVariableStatement(node) { + // If binding pattern doesn't have name, then there is nothing to be emitted for declaration file i.e. const [,] = [1,2]. + if (ts.every(node.declarationList && node.declarationList.declarations, function (decl) { return decl.name && ts.isEmptyBindingPattern(decl.name); })) { + return; + } emitJsDocComments(node); emitModuleElementDeclarationFlags(node); if (ts.isLet(node.declarationList)) { @@ -67437,7 +67802,9 @@ var ts; if (!(ts.getEmitFlags(node) & 131072 /* NoIndentation */)) { var dotRangeStart = node.expression.end; var dotRangeEnd = ts.skipTrivia(currentSourceFile.text, node.expression.end) + 1; - var dotToken = { kind: 23 /* DotToken */, pos: dotRangeStart, end: dotRangeEnd }; + var dotToken = ts.createToken(23 /* DotToken */); + dotToken.pos = dotRangeStart; + dotToken.end = dotRangeEnd; indentBeforeDot = needsIndentation(node, node.expression, dotToken); indentAfterDot = needsIndentation(node, dotToken, node.name); } @@ -67566,7 +67933,9 @@ var ts; var indentAfterOperator = needsIndentation(node, node.operatorToken, node.right); emitExpression(node.left); increaseIndentIf(indentBeforeOperator, isCommaOperator ? " " : undefined); + emitLeadingCommentsOfPosition(node.operatorToken.pos); writeTokenNode(node.operatorToken); + emitTrailingCommentsOfPosition(node.operatorToken.end, /*prefixSpace*/ true); // Binary operators should have a space before the comment starts increaseIndentIf(indentAfterOperator, " "); emitExpression(node.right); decreaseIndentIf(indentBeforeOperator, indentAfterOperator); @@ -67760,8 +68129,19 @@ var ts; emitWithPrefix(" ", node.label); write(";"); } + function emitTokenWithComment(token, pos, contextNode) { + var node = contextNode && ts.getParseTreeNode(contextNode); + if (node && node.kind === contextNode.kind) { + pos = ts.skipTrivia(currentSourceFile.text, pos); + } + pos = writeToken(token, pos, /*contextNode*/ contextNode); + if (node && node.kind === contextNode.kind) { + emitTrailingCommentsOfPosition(pos, /*prefixSpace*/ true); + } + return pos; + } function emitReturnStatement(node) { - writeToken(96 /* ReturnKeyword */, node.pos, /*contextNode*/ node); + emitTokenWithComment(96 /* ReturnKeyword */, node.pos, /*contextNode*/ node); emitExpressionWithPrefix(" ", node.expression); write(";"); } @@ -68237,10 +68617,12 @@ var ts; function emitCatchClause(node) { var openParenPos = writeToken(74 /* CatchKeyword */, node.pos); write(" "); - writeToken(19 /* OpenParenToken */, openParenPos); - emit(node.variableDeclaration); - writeToken(20 /* CloseParenToken */, node.variableDeclaration ? node.variableDeclaration.end : openParenPos); - write(" "); + if (node.variableDeclaration) { + writeToken(19 /* OpenParenToken */, openParenPos); + emit(node.variableDeclaration); + writeToken(20 /* CloseParenToken */, node.variableDeclaration.end); + write(" "); + } emit(node.block); } // @@ -69520,6 +69902,14 @@ var ts; var loader_2 = function (typesRef, containingFile) { return ts.resolveTypeReferenceDirective(typesRef, containingFile, options, host).resolvedTypeReferenceDirective; }; resolveTypeReferenceDirectiveNamesWorker = function (typeReferenceDirectiveNames, containingFile) { return loadWithLocalCache(checkAllDefined(typeReferenceDirectiveNames), containingFile, loader_2); }; } + // Map from a stringified PackageId to the source file with that id. + // Only one source file may have a given packageId. Others become redirects (see createRedirectSourceFile). + // `packageIdToSourceFile` is only used while building the program, while `sourceFileToPackageName` and `isSourceFileTargetOfRedirect` are kept around. + var packageIdToSourceFile = ts.createMap(); + // Maps from a SourceFile's `.path` to the name of the package it was imported with. + var sourceFileToPackageName = ts.createMap(); + // See `sourceFileIsRedirectedTo`. + var redirectTargetsSet = ts.createMap(); var filesByName = ts.createMap(); // stores 'filename -> file association' ignoring case // used to track cases when two file names differ only in casing @@ -69588,6 +69978,8 @@ var ts; isSourceFileFromExternalLibrary: isSourceFileFromExternalLibrary, dropDiagnosticsProducingTypeChecker: dropDiagnosticsProducingTypeChecker, getSourceFileFromReference: getSourceFileFromReference, + sourceFileToPackageName: sourceFileToPackageName, + redirectTargetsSet: redirectTargetsSet, }; verifyCompilerOptions(); ts.performance.mark("afterProgram"); @@ -69780,17 +70172,57 @@ var ts; var filePaths = []; var modifiedSourceFiles = []; oldProgram.structureIsReused = 2 /* Completely */; - for (var _i = 0, _a = oldProgram.getSourceFiles(); _i < _a.length; _i++) { - var oldSourceFile = _a[_i]; + var oldSourceFiles = oldProgram.getSourceFiles(); + var SeenPackageName; + (function (SeenPackageName) { + SeenPackageName[SeenPackageName["Exists"] = 0] = "Exists"; + SeenPackageName[SeenPackageName["Modified"] = 1] = "Modified"; + })(SeenPackageName || (SeenPackageName = {})); + var seenPackageNames = ts.createMap(); + for (var _i = 0, oldSourceFiles_1 = oldSourceFiles; _i < oldSourceFiles_1.length; _i++) { + var oldSourceFile = oldSourceFiles_1[_i]; var newSourceFile = host.getSourceFileByPath ? host.getSourceFileByPath(oldSourceFile.fileName, oldSourceFile.path, options.target) : host.getSourceFile(oldSourceFile.fileName, options.target); if (!newSourceFile) { return oldProgram.structureIsReused = 0 /* Not */; } + ts.Debug.assert(!newSourceFile.redirectInfo, "Host should not return a redirect source file from `getSourceFile`"); + var fileChanged = void 0; + if (oldSourceFile.redirectInfo) { + // We got `newSourceFile` by path, so it is actually for the unredirected file. + // This lets us know if the unredirected file has changed. If it has we should break the redirect. + if (newSourceFile !== oldSourceFile.redirectInfo.unredirected) { + // Underlying file has changed. Might not redirect anymore. Must rebuild program. + return oldProgram.structureIsReused = 0 /* Not */; + } + fileChanged = false; + newSourceFile = oldSourceFile; // Use the redirect. + } + else if (oldProgram.redirectTargetsSet.has(oldSourceFile.path)) { + // If a redirected-to source file changes, the redirect may be broken. + if (newSourceFile !== oldSourceFile) { + return oldProgram.structureIsReused = 0 /* Not */; + } + fileChanged = false; + } + else { + fileChanged = newSourceFile !== oldSourceFile; + } newSourceFile.path = oldSourceFile.path; filePaths.push(newSourceFile.path); - if (oldSourceFile !== newSourceFile) { + var packageName = oldProgram.sourceFileToPackageName.get(oldSourceFile.path); + if (packageName !== undefined) { + // If there are 2 different source files for the same package name and at least one of them changes, + // they might become redirects. So we must rebuild the program. + var prevKind = seenPackageNames.get(packageName); + var newKind = fileChanged ? 1 /* Modified */ : 0 /* Exists */; + if ((prevKind !== undefined && newKind === 1 /* Modified */) || prevKind === 1 /* Modified */) { + return oldProgram.structureIsReused = 0 /* Not */; + } + seenPackageNames.set(packageName, newKind); + } + if (fileChanged) { // The `newSourceFile` object was created for the new program. if (oldSourceFile.hasNoDefaultLib !== newSourceFile.hasNoDefaultLib) { // value of no-default-lib has changed @@ -69831,8 +70263,8 @@ var ts; } modifiedFilePaths = modifiedSourceFiles.map(function (f) { return f.newFile.path; }); // try to verify results of module resolution - for (var _b = 0, modifiedSourceFiles_1 = modifiedSourceFiles; _b < modifiedSourceFiles_1.length; _b++) { - var _c = modifiedSourceFiles_1[_b], oldSourceFile = _c.oldFile, newSourceFile = _c.newFile; + for (var _a = 0, modifiedSourceFiles_1 = modifiedSourceFiles; _a < modifiedSourceFiles_1.length; _a++) { + var _b = modifiedSourceFiles_1[_a], oldSourceFile = _b.oldFile, newSourceFile = _b.newFile; var newSourceFilePath = ts.getNormalizedAbsolutePath(newSourceFile.fileName, currentDirectory); if (resolveModuleNamesWorker) { var moduleNames = ts.map(ts.concatenate(newSourceFile.imports, newSourceFile.moduleAugmentations), getTextOfLiteral); @@ -69875,8 +70307,8 @@ var ts; if (oldProgram.getMissingFilePaths().some(function (missingFilePath) { return host.fileExists(missingFilePath); })) { return oldProgram.structureIsReused = 1 /* SafeModules */; } - for (var _d = 0, _e = oldProgram.getMissingFilePaths(); _d < _e.length; _d++) { - var p = _e[_d]; + for (var _c = 0, _d = oldProgram.getMissingFilePaths(); _c < _d.length; _c++) { + var p = _d[_c]; filesByName.set(p, undefined); } // update fileName -> file mapping @@ -69885,11 +70317,13 @@ var ts; } files = newSourceFiles; fileProcessingDiagnostics = oldProgram.getFileProcessingDiagnostics(); - for (var _f = 0, modifiedSourceFiles_2 = modifiedSourceFiles; _f < modifiedSourceFiles_2.length; _f++) { - var modifiedFile = modifiedSourceFiles_2[_f]; + for (var _e = 0, modifiedSourceFiles_2 = modifiedSourceFiles; _e < modifiedSourceFiles_2.length; _e++) { + var modifiedFile = modifiedSourceFiles_2[_e]; fileProcessingDiagnostics.reattachFileDiagnostics(modifiedFile.newFile); } resolvedTypeReferenceDirectives = oldProgram.getResolvedTypeReferenceDirectives(); + sourceFileToPackageName = oldProgram.sourceFileToPackageName; + redirectTargetsSet = oldProgram.redirectTargetsSet; return oldProgram.structureIsReused = 2 /* Completely */; } function getEmitHost(writeFileCallback) { @@ -70436,7 +70870,7 @@ var ts; } /** This has side effects through `findSourceFile`. */ function processSourceFile(fileName, isDefaultLib, refFile, refPos, refEnd) { - getSourceFileFromReferenceWorker(fileName, function (fileName) { return findSourceFile(fileName, toPath(fileName), isDefaultLib, refFile, refPos, refEnd); }, function (diagnostic) { + getSourceFileFromReferenceWorker(fileName, function (fileName) { return findSourceFile(fileName, toPath(fileName), isDefaultLib, refFile, refPos, refEnd, /*packageId*/ undefined); }, function (diagnostic) { var args = []; for (var _i = 1; _i < arguments.length; _i++) { args[_i - 1] = arguments[_i]; @@ -70453,8 +70887,25 @@ var ts; fileProcessingDiagnostics.add(ts.createCompilerDiagnostic(ts.Diagnostics.File_name_0_differs_from_already_included_file_name_1_only_in_casing, fileName, existingFileName)); } } + function createRedirectSourceFile(redirectTarget, unredirected, fileName, path) { + var redirect = Object.create(redirectTarget); + redirect.fileName = fileName; + redirect.path = path; + redirect.redirectInfo = { redirectTarget: redirectTarget, unredirected: unredirected }; + Object.defineProperties(redirect, { + id: { + get: function () { return this.redirectInfo.redirectTarget.id; }, + set: function (value) { this.redirectInfo.redirectTarget.id = value; }, + }, + symbol: { + get: function () { return this.redirectInfo.redirectTarget.symbol; }, + set: function (value) { this.redirectInfo.redirectTarget.symbol = value; }, + }, + }); + return redirect; + } // Get source file from normalized fileName - function findSourceFile(fileName, path, isDefaultLib, refFile, refPos, refEnd) { + function findSourceFile(fileName, path, isDefaultLib, refFile, refPos, refEnd, packageId) { if (filesByName.has(path)) { var file_1 = filesByName.get(path); // try to check if we've already seen this file but with a different casing in path @@ -70490,6 +70941,25 @@ var ts; fileProcessingDiagnostics.add(ts.createCompilerDiagnostic(ts.Diagnostics.Cannot_read_file_0_Colon_1, fileName, hostErrorMessage)); } }); + if (packageId) { + var packageIdKey = packageId.name + "@" + packageId.version; + var fileFromPackageId = packageIdToSourceFile.get(packageIdKey); + if (fileFromPackageId) { + // Some other SourceFile already exists with this package name and version. + // Instead of creating a duplicate, just redirect to the existing one. + var dupFile = createRedirectSourceFile(fileFromPackageId, file, fileName, path); + redirectTargetsSet.set(fileFromPackageId.path, true); + filesByName.set(path, dupFile); + sourceFileToPackageName.set(path, packageId.name); + files.push(dupFile); + return dupFile; + } + else if (file) { + // This is the first source file to have this packageId. + packageIdToSourceFile.set(packageIdKey, file); + sourceFileToPackageName.set(path, packageId.name); + } + } filesByName.set(path, file); if (file) { sourceFilesFoundSearchingNodeModules.set(path, currentNodeModulesDepth > 0); @@ -70630,7 +71100,7 @@ var ts; else if (shouldAddFile) { var path = toPath(resolvedFileName); var pos = ts.skipTrivia(file.text, file.imports[i].pos); - findSourceFile(resolvedFileName, path, /*isDefaultLib*/ false, file, pos, file.imports[i].end); + findSourceFile(resolvedFileName, path, /*isDefaultLib*/ false, file, pos, file.imports[i].end, resolution.packageId); } if (isFromNodeModulesSearch) { currentNodeModulesDepth--; @@ -70785,8 +71255,8 @@ var ts; } // there has to be common source directory if user specified --outdir || --sourceRoot // if user specified --mapRoot, there needs to be common source directory if there would be multiple files being emitted - if (options.outDir || - options.sourceRoot || + if (options.outDir || // there is --outDir specified + options.sourceRoot || // there is --sourceRoot specified options.mapRoot) { // Precalculate and cache the common source directory var dir = getCommonSourceDirectory(); @@ -71349,6 +71819,12 @@ var ts; category: ts.Diagnostics.Module_Resolution_Options, description: ts.Diagnostics.Allow_default_imports_from_modules_with_no_default_export_This_does_not_affect_code_emit_just_typechecking }, + { + name: "preserveSymlinks", + type: "boolean", + category: ts.Diagnostics.Module_Resolution_Options, + description: ts.Diagnostics.Do_not_resolve_the_real_path_of_symlinks, + }, // Source Maps { name: "sourceRoot", @@ -72006,7 +72482,7 @@ var ts; if (option && typeof option.type !== "string") { var customOption = option; // Validate custom option type - if (!customOption.type.has(text)) { + if (!customOption.type.has(text.toLowerCase())) { errors.push(createDiagnosticForInvalidCustomType(customOption, function (message, arg0, arg1) { return ts.createDiagnosticForNodeInSourceFile(sourceFile, valueExpression, message, arg0, arg1); })); } } @@ -72306,13 +72782,10 @@ var ts; } } else { - // If no includes were specified, exclude common package folders and the outDir - var specs = includeSpecs ? [] : ["node_modules", "bower_components", "jspm_packages"]; var outDir = raw["compilerOptions"] && raw["compilerOptions"]["outDir"]; if (outDir) { - specs.push(outDir); + excludeSpecs = [outDir]; } - excludeSpecs = specs; } if (fileNames === undefined && includeSpecs === undefined) { includeSpecs = ["**/*"]; @@ -72573,7 +73046,7 @@ var ts; return value; } else if (typeof option.type !== "string") { - return option.type.get(value); + return option.type.get(typeof value === "string" ? value.toLowerCase() : value); } return normalizeNonListOptionValue(option, basePath, value); } @@ -72748,23 +73221,13 @@ var ts; }; } function validateSpecs(specs, errors, allowTrailingRecursion, jsonSourceFile, specKey) { - var validSpecs = []; - for (var _i = 0, specs_1 = specs; _i < specs_1.length; _i++) { - var spec = specs_1[_i]; - if (!allowTrailingRecursion && invalidTrailingRecursionPattern.test(spec)) { - errors.push(createDiagnostic(ts.Diagnostics.File_specification_cannot_end_in_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0, spec)); + return specs.filter(function (spec) { + var diag = specToDiagnostic(spec, allowTrailingRecursion); + if (diag !== undefined) { + errors.push(createDiagnostic(diag, spec)); } - else if (invalidMultipleRecursionPatterns.test(spec)) { - errors.push(createDiagnostic(ts.Diagnostics.File_specification_cannot_contain_multiple_recursive_directory_wildcards_Asterisk_Asterisk_Colon_0, spec)); - } - else if (invalidDotDotAfterRecursiveWildcardPattern.test(spec)) { - errors.push(createDiagnostic(ts.Diagnostics.File_specification_cannot_contain_a_parent_directory_that_appears_after_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0, spec)); - } - else { - validSpecs.push(spec); - } - } - return validSpecs; + return diag === undefined; + }); function createDiagnostic(message, spec) { if (jsonSourceFile && jsonSourceFile.jsonObject) { for (var _i = 0, _a = ts.getPropertyAssignment(jsonSourceFile.jsonObject, specKey); _i < _a.length; _i++) { @@ -72782,6 +73245,17 @@ var ts; return ts.createCompilerDiagnostic(message, spec); } } + function specToDiagnostic(spec, allowTrailingRecursion) { + if (!allowTrailingRecursion && invalidTrailingRecursionPattern.test(spec)) { + return ts.Diagnostics.File_specification_cannot_end_in_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0; + } + else if (invalidMultipleRecursionPatterns.test(spec)) { + return ts.Diagnostics.File_specification_cannot_contain_multiple_recursive_directory_wildcards_Asterisk_Asterisk_Colon_0; + } + else if (invalidDotDotAfterRecursiveWildcardPattern.test(spec)) { + return ts.Diagnostics.File_specification_cannot_contain_a_parent_directory_that_appears_after_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0; + } + } /** * Gets directories in a set of include patterns that should be watched for changes. */ @@ -72945,7 +73419,7 @@ var ts; (function (ts) { var ScriptSnapshot; (function (ScriptSnapshot) { - var StringScriptSnapshot = (function () { + var StringScriptSnapshot = /** @class */ (function () { function StringScriptSnapshot(text) { this.text = text; } @@ -72969,7 +73443,7 @@ var ts; } ScriptSnapshot.fromString = fromString; })(ScriptSnapshot = ts.ScriptSnapshot || (ts.ScriptSnapshot = {})); - var TextChange = (function () { + var TextChange = /** @class */ (function () { function TextChange() { } return TextChange; @@ -73831,8 +74305,14 @@ var ts; } } ts.findNextToken = findNextToken; + /** + * Finds the rightmost token satisfying `token.end <= position`, + * excluding `JsxText` tokens containing only whitespace. + */ function findPrecedingToken(position, sourceFile, startNode, includeJsDoc) { - return find(startNode || sourceFile); + var result = find(startNode || sourceFile); + ts.Debug.assert(!(result && isWhiteSpaceOnlyJsxText(result))); + return result; function findRightmostToken(n) { if (ts.isToken(n)) { return n; @@ -73848,18 +74328,16 @@ var ts; var children = n.getChildren(); for (var i = 0; i < children.length; i++) { var child = children[i]; - // condition 'position < child.end' checks if child node end after the position - // in the example below this condition will be false for 'aaaa' and 'bbbb' and true for 'ccc' - // aaaa___bbbb___$__ccc - // after we found child node with end after the position we check if start of the node is after the position. - // if yes - then position is in the trivia and we need to look into the previous child to find the token in question. - // if no - position is in the node itself so we should recurse in it. - // NOTE: JsxText is a weird kind of node that can contain only whitespaces (since they are not counted as trivia). - // if this is the case - then we should assume that token in question is located in previous child. - if (position < child.end && (nodeHasTokens(child) || child.kind === 10 /* JsxText */)) { + // Note that the span of a node's tokens is [node.getStart(...), node.end). + // Given that `position < child.end` and child has constituent tokens, we distinguish these cases: + // 1) `position` precedes `child`'s tokens or `child` has no tokens (ie: in a comment or whitespace preceding `child`): + // we need to find the last token in a previous child. + // 2) `position` is within the same span: we recurse on `child`. + if (position < child.end) { var start = child.getStart(sourceFile, includeJsDoc); - var lookInPreviousChild = (start >= position) || - (child.kind === 10 /* JsxText */ && start === child.end); // whitespace only JsxText + var lookInPreviousChild = (start >= position) || // cursor in the leading trivia + !nodeHasTokens(child) || + isWhiteSpaceOnlyJsxText(child); if (lookInPreviousChild) { // actual start of the node is past the position - previous token should be at the end of previous child var candidate = findRightmostChildNodeWithTokens(children, /*exclusiveStartPosition*/ i); @@ -73881,10 +74359,16 @@ var ts; return candidate && findRightmostToken(candidate); } } - /// finds last node that is considered as candidate for search (isCandidate(node) === true) starting from 'exclusiveStartPosition' + /** + * Finds the rightmost child to the left of `children[exclusiveStartPosition]` which is a non-all-whitespace token or has constituent tokens. + */ function findRightmostChildNodeWithTokens(children, exclusiveStartPosition) { for (var i = exclusiveStartPosition - 1; i >= 0; i--) { - if (nodeHasTokens(children[i])) { + var child = children[i]; + if (isWhiteSpaceOnlyJsxText(child)) { + ts.Debug.assert(i > 0, "`JsxText` tokens should not be the first child of `JsxElement | JsxSelfClosingElement`"); + } + else if (nodeHasTokens(children[i])) { return children[i]; } } @@ -73942,6 +74426,10 @@ var ts; return false; } ts.isInsideJsxElementOrAttribute = isInsideJsxElementOrAttribute; + function isWhiteSpaceOnlyJsxText(node) { + return ts.isJsxText(node) && node.containsOnlyWhiteSpaces; + } + ts.isWhiteSpaceOnlyJsxText = isWhiteSpaceOnlyJsxText; function isInTemplateString(sourceFile, position) { var token = getTokenAtPosition(sourceFile, position, /*includeJsDocComment*/ false); return ts.isTemplateLiteralKind(token.kind) && position > token.getStart(sourceFile); @@ -73954,39 +74442,9 @@ var ts; * @param predicate Additional predicate to test on the comment range. */ function isInComment(sourceFile, position, tokenAtPosition, predicate) { - if (tokenAtPosition === void 0) { tokenAtPosition = getTokenAtPosition(sourceFile, position, /*includeJsDocComment*/ false); } - return position <= tokenAtPosition.getStart(sourceFile) && - (isInCommentRange(ts.getLeadingCommentRanges(sourceFile.text, tokenAtPosition.pos)) || - isInCommentRange(ts.getTrailingCommentRanges(sourceFile.text, tokenAtPosition.pos))); - function isInCommentRange(commentRanges) { - return ts.forEach(commentRanges, function (c) { return isPositionInCommentRange(c, position, sourceFile.text) && (!predicate || predicate(c)); }); - } + return !!ts.formatting.getRangeOfEnclosingComment(sourceFile, position, /*onlyMultiLine*/ false, /*precedingToken*/ undefined, tokenAtPosition, predicate); } ts.isInComment = isInComment; - function isPositionInCommentRange(_a, position, text) { - var pos = _a.pos, end = _a.end, kind = _a.kind; - if (pos < position && position < end) { - return true; - } - else if (position === end) { - // The end marker of a single-line comment does not include the newline character. - // In the following case, we are inside a comment (^ denotes the cursor position): - // - // // asdf ^\n - // - // But for multi-line comments, we don't want to be inside the comment in the following case: - // - // /* asdf */^ - // - // Internally, we represent the end of the comment at the newline and closing '/', respectively. - return kind === 2 /* SingleLineCommentTrivia */ || - // true for unterminated multi-line comment - !(text.charCodeAt(end - 1) === 47 /* slash */ && text.charCodeAt(end - 2) === 42 /* asterisk */); - } - else { - return false; - } - } function hasDocComment(sourceFile, position) { var token = getTokenAtPosition(sourceFile, position, /*includeJsDocComment*/ false); // First, we have to see if this position actually landed in a comment. @@ -74000,7 +74458,7 @@ var ts; ts.hasDocComment = hasDocComment; function nodeHasTokens(n) { // If we have a token or node that has a non-zero width, it must have tokens. - // Note, that getWidth() does not take trivia into account. + // Note: getWidth() does not take trivia into account. return n.getWidth() !== 0; } function getNodeModifiers(node) { @@ -74357,6 +74815,7 @@ var ts; } ts.symbolToDisplayParts = symbolToDisplayParts; function signatureToDisplayParts(typechecker, signature, enclosingDeclaration, flags) { + flags |= 65536 /* UseAliasDefinedOutsideCurrentScope */; return mapToDisplayParts(function (writer) { typechecker.getSymbolDisplayBuilder().buildSignatureDisplay(signature, writer, enclosingDeclaration, flags); }); @@ -74666,11 +75125,11 @@ var ts; templateStack.pop(); } else { - ts.Debug.assert(token === 15 /* TemplateMiddle */, "Should have been a template middle. Was " + token); + ts.Debug.assertEqual(token, 15 /* TemplateMiddle */, "Should have been a template middle."); } } else { - ts.Debug.assert(lastTemplateStackToken === 17 /* OpenBraceToken */, "Should have been an open brace. Was: " + token); + ts.Debug.assertEqual(lastTemplateStackToken, 17 /* OpenBraceToken */, "Should have been an open brace"); templateStack.pop(); } } @@ -76652,7 +77111,7 @@ var ts; if (!typeForObject) return false; // In a binding pattern, get only known properties. Everywhere else we will get all possible properties. - typeMembers = typeChecker.getPropertiesOfType(typeForObject); + typeMembers = typeChecker.getPropertiesOfType(typeForObject).filter(function (symbol) { return !(ts.getDeclarationModifierFlagsFromSymbol(symbol) & 24 /* NonPublicAccessibilityModifier */); }); existingMembers = objectLikeContainer.elements; } } @@ -76916,11 +77375,11 @@ var ts; return containingNodeKind === 226 /* VariableDeclaration */ || containingNodeKind === 227 /* VariableDeclarationList */ || containingNodeKind === 208 /* VariableStatement */ || - containingNodeKind === 232 /* EnumDeclaration */ || + containingNodeKind === 232 /* EnumDeclaration */ || // enum a { foo, | isFunctionLikeButNotConstructor(containingNodeKind) || - containingNodeKind === 230 /* InterfaceDeclaration */ || - containingNodeKind === 175 /* ArrayBindingPattern */ || - containingNodeKind === 231 /* TypeAliasDeclaration */ || + containingNodeKind === 230 /* InterfaceDeclaration */ || // interface A undefined); => should get use to the declaration in file "./foo" + // + // function bar(onfulfilled: (value: T) => void) { //....} + // interface Test { + // pr/*destination*/op1: number + // } + // bar(({pr/*goto*/op1})=>{}); + if (ts.isPropertyName(node) && ts.isBindingElement(node.parent) && ts.isObjectBindingPattern(node.parent.parent) && + (node === (node.parent.propertyName || node.parent.name))) { + var type = typeChecker.getTypeAtLocation(node.parent.parent); + if (type) { + var propSymbols = ts.getPropertySymbolsFromType(type, node); + if (propSymbols) { + return ts.flatMap(propSymbols, function (propSymbol) { return getDefinitionFromSymbol(typeChecker, propSymbol, node); }); + } + } + } // If the current location we want to find its definition is in an object literal, try to get the contextual type for the // object literal, lookup the property symbol in the contextual type, and use this for goto-definition. // For example @@ -80614,12 +81104,20 @@ var ts; "crypto", "stream", "util", "assert", "tty", "domain", "constants", "process", "v8", "timers", "console" ]; - var nodeCoreModules = ts.arrayToMap(JsTyping.nodeCoreModuleList, function (x) { return x; }); + var nodeCoreModules = ts.arrayToSet(JsTyping.nodeCoreModuleList); function loadSafeList(host, safeListPath) { var result = ts.readConfigFile(safeListPath, function (path) { return host.readFile(path); }); return ts.createMapFromTemplate(result.config); } JsTyping.loadSafeList = loadSafeList; + function loadTypesMap(host, typesMapPath) { + var result = ts.readConfigFile(typesMapPath, function (path) { return host.readFile(path); }); + if (result.config) { + return ts.createMapFromTemplate(result.config.simpleMap); + } + return undefined; + } + JsTyping.loadTypesMap = loadTypesMap; /** * @param host is the object providing I/O related operations. * @param fileNames are the file names that belong to the same project @@ -80812,8 +81310,8 @@ var ts; if (!matches) { return; // continue to next named declarations } - for (var _i = 0, declarations_12 = declarations; _i < declarations_12.length; _i++) { - var declaration = declarations_12[_i]; + for (var _i = 0, declarations_11 = declarations; _i < declarations_11.length; _i++) { + var declaration = declarations_11[_i]; // It was a match! If the pattern has dots in it, then also see if the // declaration container matches as well. if (patternMatcher.patternContainsDots) { @@ -81549,13 +82047,18 @@ var ts; (function (ts) { var OutliningElementsCollector; (function (OutliningElementsCollector) { + var collapseText = "..."; + var maxDepth = 20; function collectElements(sourceFile, cancellationToken) { var elements = []; - var collapseText = "..."; - function addOutliningSpan(hintSpanNode, startElement, endElement, autoCollapse) { + var depth = 0; + walk(sourceFile); + return elements; + /** If useFullStart is true, then the collapsing span includes leading whitespace, including linebreaks. */ + function addOutliningSpan(hintSpanNode, startElement, endElement, autoCollapse, useFullStart) { if (hintSpanNode && startElement && endElement) { var span_13 = { - textSpan: ts.createTextSpanFromBounds(startElement.pos, endElement.end), + textSpan: ts.createTextSpanFromBounds(useFullStart ? startElement.getFullStart() : startElement.getStart(), endElement.getEnd()), hintSpan: ts.createTextSpanFromNode(hintSpanNode, sourceFile), bannerText: collapseText, autoCollapse: autoCollapse, @@ -81619,8 +82122,6 @@ var ts; function autoCollapse(node) { return ts.isFunctionBlock(node) && node.parent.kind !== 187 /* ArrowFunction */; } - var depth = 0; - var maxDepth = 20; function walk(n) { cancellationToken.throwIfCancellationRequested(); if (depth > maxDepth) { @@ -81633,8 +82134,8 @@ var ts; case 207 /* Block */: if (!ts.isFunctionBlock(n)) { var parent = n.parent; - var openBrace = ts.findChildOfKind(n, 17 /* OpenBraceToken */, sourceFile); - var closeBrace = ts.findChildOfKind(n, 18 /* CloseBraceToken */, sourceFile); + var openBrace_1 = ts.findChildOfKind(n, 17 /* OpenBraceToken */, sourceFile); + var closeBrace_1 = ts.findChildOfKind(n, 18 /* CloseBraceToken */, sourceFile); // Check if the block is standalone, or 'attached' to some parent statement. // If the latter, we want to collapse the block, but consider its hint span // to be the entire span of the parent. @@ -81646,20 +82147,20 @@ var ts; parent.kind === 213 /* WhileStatement */ || parent.kind === 220 /* WithStatement */ || parent.kind === 260 /* CatchClause */) { - addOutliningSpan(parent, openBrace, closeBrace, autoCollapse(n)); + addOutliningSpan(parent, openBrace_1, closeBrace_1, autoCollapse(n), /*useFullStart*/ true); break; } if (parent.kind === 224 /* TryStatement */) { // Could be the try-block, or the finally-block. var tryStatement = parent; if (tryStatement.tryBlock === n) { - addOutliningSpan(parent, openBrace, closeBrace, autoCollapse(n)); + addOutliningSpan(parent, openBrace_1, closeBrace_1, autoCollapse(n), /*useFullStart*/ true); break; } else if (tryStatement.finallyBlock === n) { var finallyKeyword = ts.findChildOfKind(tryStatement, 87 /* FinallyKeyword */, sourceFile); if (finallyKeyword) { - addOutliningSpan(finallyKeyword, openBrace, closeBrace, autoCollapse(n)); + addOutliningSpan(finallyKeyword, openBrace_1, closeBrace_1, autoCollapse(n), /*useFullStart*/ true); break; } } @@ -81678,33 +82179,38 @@ var ts; } // falls through case 234 /* ModuleBlock */: { - var openBrace = ts.findChildOfKind(n, 17 /* OpenBraceToken */, sourceFile); - var closeBrace = ts.findChildOfKind(n, 18 /* CloseBraceToken */, sourceFile); - addOutliningSpan(n.parent, openBrace, closeBrace, autoCollapse(n)); + var openBrace_2 = ts.findChildOfKind(n, 17 /* OpenBraceToken */, sourceFile); + var closeBrace_2 = ts.findChildOfKind(n, 18 /* CloseBraceToken */, sourceFile); + addOutliningSpan(n.parent, openBrace_2, closeBrace_2, autoCollapse(n), /*useFullStart*/ true); break; } case 229 /* ClassDeclaration */: case 230 /* InterfaceDeclaration */: case 232 /* EnumDeclaration */: - case 178 /* ObjectLiteralExpression */: case 235 /* CaseBlock */: { + var openBrace_3 = ts.findChildOfKind(n, 17 /* OpenBraceToken */, sourceFile); + var closeBrace_3 = ts.findChildOfKind(n, 18 /* CloseBraceToken */, sourceFile); + addOutliningSpan(n, openBrace_3, closeBrace_3, autoCollapse(n), /*useFullStart*/ true); + break; + } + // If the block has no leading keywords and is inside an array literal, + // we only want to collapse the span of the block. + // Otherwise, the collapsed section will include the end of the previous line. + case 178 /* ObjectLiteralExpression */: var openBrace = ts.findChildOfKind(n, 17 /* OpenBraceToken */, sourceFile); var closeBrace = ts.findChildOfKind(n, 18 /* CloseBraceToken */, sourceFile); - addOutliningSpan(n, openBrace, closeBrace, autoCollapse(n)); + addOutliningSpan(n, openBrace, closeBrace, autoCollapse(n), /*useFullStart*/ !ts.isArrayLiteralExpression(n.parent)); break; - } case 177 /* ArrayLiteralExpression */: var openBracket = ts.findChildOfKind(n, 21 /* OpenBracketToken */, sourceFile); var closeBracket = ts.findChildOfKind(n, 22 /* CloseBracketToken */, sourceFile); - addOutliningSpan(n, openBracket, closeBracket, autoCollapse(n)); + addOutliningSpan(n, openBracket, closeBracket, autoCollapse(n), /*useFullStart*/ !ts.isArrayLiteralExpression(n.parent)); break; } depth++; ts.forEachChild(n, walk); depth--; } - walk(sourceFile); - return elements; } OutliningElementsCollector.collectElements = collectElements; })(OutliningElementsCollector = ts.OutliningElementsCollector || (ts.OutliningElementsCollector = {})); @@ -82760,8 +83266,8 @@ var ts; var nameToDeclarations = sourceFile.getNamedDeclarations(); var declarations = nameToDeclarations.get(name.text); if (declarations) { - for (var _b = 0, declarations_13 = declarations; _b < declarations_13.length; _b++) { - var declaration = declarations_13[_b]; + for (var _b = 0, declarations_12 = declarations; _b < declarations_12.length; _b++) { + var declaration = declarations_12[_b]; var symbol = declaration.symbol; if (symbol) { var type = typeChecker.getTypeOfSymbolAtLocation(symbol, declaration); @@ -82820,7 +83326,9 @@ var ts; } var kind = invocation.typeArguments && invocation.typeArguments.pos === list.pos ? 0 /* TypeArguments */ : 1 /* CallArguments */; var argumentCount = getArgumentCount(list); - ts.Debug.assert(argumentIndex === 0 || argumentIndex < argumentCount, "argumentCount < argumentIndex, " + argumentCount + " < " + argumentIndex); + if (argumentIndex !== 0) { + ts.Debug.assertLessThan(argumentIndex, argumentCount); + } var argumentsSpan = getApplicableSpanForArguments(list, sourceFile); return { kind: kind, invocation: invocation, argumentsSpan: argumentsSpan, argumentIndex: argumentIndex, argumentCount: argumentCount }; } @@ -82942,7 +83450,9 @@ var ts; var argumentCount = tagExpression.template.kind === 13 /* NoSubstitutionTemplateLiteral */ ? 1 : tagExpression.template.templateSpans.length + 1; - ts.Debug.assert(argumentIndex === 0 || argumentIndex < argumentCount, "argumentCount < argumentIndex, " + argumentCount + " < " + argumentIndex); + if (argumentIndex !== 0) { + ts.Debug.assertLessThan(argumentIndex, argumentCount); + } return { kind: 2 /* TaggedTemplateArguments */, invocation: tagExpression, @@ -83060,7 +83570,9 @@ var ts; tags: candidateSignature.getJsDocTags() }; }); - ts.Debug.assert(argumentIndex === 0 || argumentIndex < argumentCount, "argumentCount < argumentIndex, " + argumentCount + " < " + argumentIndex); + if (argumentIndex !== 0) { + ts.Debug.assertLessThan(argumentIndex, argumentCount); + } var selectedItemIndex = candidates.indexOf(resolvedSignature); ts.Debug.assert(selectedItemIndex !== -1); // If candidates is non-empty it should always include bestSignature. We check for an empty candidates before calling this function. return { items: items, applicableSpan: applicableSpan, selectedItemIndex: selectedItemIndex, argumentIndex: argumentIndex, argumentCount: argumentCount }; @@ -83209,114 +83721,112 @@ var ts; } var signature = void 0; type = isThisExpression ? typeChecker.getTypeAtLocation(location) : typeChecker.getTypeOfSymbolAtLocation(symbol.exportSymbol || symbol, location); - if (type) { - if (location.parent && location.parent.kind === 179 /* PropertyAccessExpression */) { - var right = location.parent.name; - // Either the location is on the right of a property access, or on the left and the right is missing - if (right === location || (right && right.getFullWidth() === 0)) { - location = location.parent; - } - } - // try get the call/construct signature from the type if it matches - var callExpressionLike = void 0; - if (ts.isCallOrNewExpression(location)) { - callExpressionLike = location; - } - else if (ts.isCallExpressionTarget(location) || ts.isNewExpressionTarget(location)) { - callExpressionLike = location.parent; - } - else if (location.parent && ts.isJsxOpeningLikeElement(location.parent) && ts.isFunctionLike(symbol.valueDeclaration)) { - callExpressionLike = location.parent; - } - if (callExpressionLike) { - var candidateSignatures = []; - signature = typeChecker.getResolvedSignature(callExpressionLike, candidateSignatures); - if (!signature && candidateSignatures.length) { - // Use the first candidate: - signature = candidateSignatures[0]; - } - var useConstructSignatures = callExpressionLike.kind === 182 /* NewExpression */ || (ts.isCallExpression(callExpressionLike) && callExpressionLike.expression.kind === 97 /* SuperKeyword */); - var allSignatures = useConstructSignatures ? type.getConstructSignatures() : type.getCallSignatures(); - if (!ts.contains(allSignatures, signature.target) && !ts.contains(allSignatures, signature)) { - // Get the first signature if there is one -- allSignatures may contain - // either the original signature or its target, so check for either - signature = allSignatures.length ? allSignatures[0] : undefined; - } - if (signature) { - if (useConstructSignatures && (symbolFlags & 32 /* Class */)) { - // Constructor - symbolKind = "constructor" /* constructorImplementationElement */; - addPrefixForAnyFunctionOrVar(type.symbol, symbolKind); + if (location.parent && location.parent.kind === 179 /* PropertyAccessExpression */) { + var right = location.parent.name; + // Either the location is on the right of a property access, or on the left and the right is missing + if (right === location || (right && right.getFullWidth() === 0)) { + location = location.parent; + } + } + // try get the call/construct signature from the type if it matches + var callExpressionLike = void 0; + if (ts.isCallOrNewExpression(location)) { + callExpressionLike = location; + } + else if (ts.isCallExpressionTarget(location) || ts.isNewExpressionTarget(location)) { + callExpressionLike = location.parent; + } + else if (location.parent && ts.isJsxOpeningLikeElement(location.parent) && ts.isFunctionLike(symbol.valueDeclaration)) { + callExpressionLike = location.parent; + } + if (callExpressionLike) { + var candidateSignatures = []; + signature = typeChecker.getResolvedSignature(callExpressionLike, candidateSignatures); + if (!signature && candidateSignatures.length) { + // Use the first candidate: + signature = candidateSignatures[0]; + } + var useConstructSignatures = callExpressionLike.kind === 182 /* NewExpression */ || (ts.isCallExpression(callExpressionLike) && callExpressionLike.expression.kind === 97 /* SuperKeyword */); + var allSignatures = useConstructSignatures ? type.getConstructSignatures() : type.getCallSignatures(); + if (!ts.contains(allSignatures, signature.target) && !ts.contains(allSignatures, signature)) { + // Get the first signature if there is one -- allSignatures may contain + // either the original signature or its target, so check for either + signature = allSignatures.length ? allSignatures[0] : undefined; + } + if (signature) { + if (useConstructSignatures && (symbolFlags & 32 /* Class */)) { + // Constructor + symbolKind = "constructor" /* constructorImplementationElement */; + addPrefixForAnyFunctionOrVar(type.symbol, symbolKind); + } + else if (symbolFlags & 2097152 /* Alias */) { + symbolKind = "alias" /* alias */; + pushTypePart(symbolKind); + displayParts.push(ts.spacePart()); + if (useConstructSignatures) { + displayParts.push(ts.keywordPart(94 /* NewKeyword */)); + displayParts.push(ts.spacePart()); } - else if (symbolFlags & 2097152 /* Alias */) { - symbolKind = "alias" /* alias */; - pushTypePart(symbolKind); + addFullSymbolName(symbol); + } + else { + addPrefixForAnyFunctionOrVar(symbol, symbolKind); + } + switch (symbolKind) { + case "JSX attribute" /* jsxAttribute */: + case "property" /* memberVariableElement */: + case "var" /* variableElement */: + case "const" /* constElement */: + case "let" /* letElement */: + case "parameter" /* parameterElement */: + case "local var" /* localVariableElement */: + // If it is call or construct signature of lambda's write type name + displayParts.push(ts.punctuationPart(56 /* ColonToken */)); displayParts.push(ts.spacePart()); if (useConstructSignatures) { displayParts.push(ts.keywordPart(94 /* NewKeyword */)); displayParts.push(ts.spacePart()); } - addFullSymbolName(symbol); - } - else { - addPrefixForAnyFunctionOrVar(symbol, symbolKind); - } - switch (symbolKind) { - case "JSX attribute" /* jsxAttribute */: - case "property" /* memberVariableElement */: - case "var" /* variableElement */: - case "const" /* constElement */: - case "let" /* letElement */: - case "parameter" /* parameterElement */: - case "local var" /* localVariableElement */: - // If it is call or construct signature of lambda's write type name - displayParts.push(ts.punctuationPart(56 /* ColonToken */)); - displayParts.push(ts.spacePart()); - if (useConstructSignatures) { - displayParts.push(ts.keywordPart(94 /* NewKeyword */)); - displayParts.push(ts.spacePart()); - } - if (!(type.flags & 32768 /* Object */ && type.objectFlags & 16 /* Anonymous */) && type.symbol) { - ts.addRange(displayParts, ts.symbolToDisplayParts(typeChecker, type.symbol, enclosingDeclaration, /*meaning*/ undefined, 1 /* WriteTypeParametersOrArguments */)); - } - addSignatureDisplayParts(signature, allSignatures, 16 /* WriteArrowStyleSignature */); - break; - default: - // Just signature - addSignatureDisplayParts(signature, allSignatures); - } - hasAddedSymbolInfo = true; + if (!(type.flags & 32768 /* Object */ && type.objectFlags & 16 /* Anonymous */) && type.symbol) { + ts.addRange(displayParts, ts.symbolToDisplayParts(typeChecker, type.symbol, enclosingDeclaration, /*meaning*/ undefined, 1 /* WriteTypeParametersOrArguments */)); + } + addSignatureDisplayParts(signature, allSignatures, 16 /* WriteArrowStyleSignature */); + break; + default: + // Just signature + addSignatureDisplayParts(signature, allSignatures); } + hasAddedSymbolInfo = true; } - else if ((ts.isNameOfFunctionDeclaration(location) && !(symbolFlags & 98304 /* Accessor */)) || - (location.kind === 123 /* ConstructorKeyword */ && location.parent.kind === 152 /* Constructor */)) { - // get the signature from the declaration and write it - var functionDeclaration_1 = location.parent; - // Use function declaration to write the signatures only if the symbol corresponding to this declaration - var locationIsSymbolDeclaration = ts.findDeclaration(symbol, function (declaration) { - return declaration === (location.kind === 123 /* ConstructorKeyword */ ? functionDeclaration_1.parent : functionDeclaration_1); - }); - if (locationIsSymbolDeclaration) { - var allSignatures = functionDeclaration_1.kind === 152 /* Constructor */ ? type.getNonNullableType().getConstructSignatures() : type.getNonNullableType().getCallSignatures(); - if (!typeChecker.isImplementationOfOverload(functionDeclaration_1)) { - signature = typeChecker.getSignatureFromDeclaration(functionDeclaration_1); - } - else { - signature = allSignatures[0]; - } - if (functionDeclaration_1.kind === 152 /* Constructor */) { - // show (constructor) Type(...) signature - symbolKind = "constructor" /* constructorImplementationElement */; - addPrefixForAnyFunctionOrVar(type.symbol, symbolKind); - } - else { - // (function/method) symbol(..signature) - addPrefixForAnyFunctionOrVar(functionDeclaration_1.kind === 155 /* CallSignature */ && - !(type.symbol.flags & 2048 /* TypeLiteral */ || type.symbol.flags & 4096 /* ObjectLiteral */) ? type.symbol : symbol, symbolKind); - } - addSignatureDisplayParts(signature, allSignatures); - hasAddedSymbolInfo = true; + } + else if ((ts.isNameOfFunctionDeclaration(location) && !(symbolFlags & 98304 /* Accessor */)) || // name of function declaration + (location.kind === 123 /* ConstructorKeyword */ && location.parent.kind === 152 /* Constructor */)) { + // get the signature from the declaration and write it + var functionDeclaration_1 = location.parent; + // Use function declaration to write the signatures only if the symbol corresponding to this declaration + var locationIsSymbolDeclaration = ts.find(symbol.declarations, function (declaration) { + return declaration === (location.kind === 123 /* ConstructorKeyword */ ? functionDeclaration_1.parent : functionDeclaration_1); + }); + if (locationIsSymbolDeclaration) { + var allSignatures = functionDeclaration_1.kind === 152 /* Constructor */ ? type.getNonNullableType().getConstructSignatures() : type.getNonNullableType().getCallSignatures(); + if (!typeChecker.isImplementationOfOverload(functionDeclaration_1)) { + signature = typeChecker.getSignatureFromDeclaration(functionDeclaration_1); + } + else { + signature = allSignatures[0]; } + if (functionDeclaration_1.kind === 152 /* Constructor */) { + // show (constructor) Type(...) signature + symbolKind = "constructor" /* constructorImplementationElement */; + addPrefixForAnyFunctionOrVar(type.symbol, symbolKind); + } + else { + // (function/method) symbol(..signature) + addPrefixForAnyFunctionOrVar(functionDeclaration_1.kind === 155 /* CallSignature */ && + !(type.symbol.flags & 2048 /* TypeLiteral */ || type.symbol.flags & 4096 /* ObjectLiteral */) ? type.symbol : symbol, symbolKind); + } + addSignatureDisplayParts(signature, allSignatures); + hasAddedSymbolInfo = true; } } } @@ -83502,7 +84012,9 @@ var ts; symbolFlags & 98304 /* Accessor */ || symbolKind === "method" /* memberFunctionElement */) { var allSignatures = type.getNonNullableType().getCallSignatures(); - addSignatureDisplayParts(allSignatures[0], allSignatures); + if (allSignatures.length) { + addSignatureDisplayParts(allSignatures[0], allSignatures); + } } } } @@ -83676,11 +84188,11 @@ var ts; getSourceFile: function (fileName) { return fileName === ts.normalizePath(inputFileName) ? sourceFile : undefined; }, writeFile: function (name, text) { if (ts.fileExtensionIs(name, ".map")) { - ts.Debug.assert(sourceMapText === undefined, "Unexpected multiple source map outputs for the file '" + name + "'"); + ts.Debug.assertEqual(sourceMapText, undefined, "Unexpected multiple source map outputs, file:", name); sourceMapText = text; } else { - ts.Debug.assert(outputText === undefined, "Unexpected multiple outputs for the file: '" + name + "'"); + ts.Debug.assertEqual(outputText, undefined, "Unexpected multiple outputs, file:", name); outputText = text; } }, @@ -84005,7 +84517,7 @@ var ts; (function (ts) { var formatting; (function (formatting) { - var FormattingContext = (function () { + var FormattingContext = /** @class */ (function () { function FormattingContext(sourceFile, formattingRequestKind, options) { this.sourceFile = sourceFile; this.formattingRequestKind = formattingRequestKind; @@ -84104,7 +84616,7 @@ var ts; (function (ts) { var formatting; (function (formatting) { - var Rule = (function () { + var Rule = /** @class */ (function () { function Rule(Descriptor, Operation, Flag) { if (Flag === void 0) { Flag = 0 /* None */; } this.Descriptor = Descriptor; @@ -84142,7 +84654,7 @@ var ts; (function (ts) { var formatting; (function (formatting) { - var RuleDescriptor = (function () { + var RuleDescriptor = /** @class */ (function () { function RuleDescriptor(LeftTokenRange, RightTokenRange) { this.LeftTokenRange = LeftTokenRange; this.RightTokenRange = RightTokenRange; @@ -84187,7 +84699,7 @@ var ts; (function (ts) { var formatting; (function (formatting) { - var RuleOperation = (function () { + var RuleOperation = /** @class */ (function () { function RuleOperation(Context, Action) { this.Context = Context; this.Action = Action; @@ -84213,7 +84725,7 @@ var ts; (function (ts) { var formatting; (function (formatting) { - var RuleOperationContext = (function () { + var RuleOperationContext = /** @class */ (function () { function RuleOperationContext() { var funcs = []; for (var _i = 0; _i < arguments.length; _i++) { @@ -84248,7 +84760,7 @@ var ts; (function (ts) { var formatting; (function (formatting) { - var Rules = (function () { + var Rules = /** @class */ (function () { function Rules() { /// /// Common Rules @@ -84407,6 +84919,7 @@ var ts; // Insert space after opening and before closing nonempty parenthesis this.SpaceAfterOpenParen = new formatting.Rule(formatting.RuleDescriptor.create3(19 /* OpenParenToken */, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsOptionEnabled("insertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis"), Rules.IsNonJsxSameLineTokenContext), 2 /* Space */)); this.SpaceBeforeCloseParen = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 20 /* CloseParenToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsOptionEnabled("insertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis"), Rules.IsNonJsxSameLineTokenContext), 2 /* Space */)); + this.SpaceBetweenOpenParens = new formatting.Rule(formatting.RuleDescriptor.create1(19 /* OpenParenToken */, 19 /* OpenParenToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsOptionEnabled("insertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis"), Rules.IsNonJsxSameLineTokenContext), 2 /* Space */)); this.NoSpaceBetweenParens = new formatting.Rule(formatting.RuleDescriptor.create1(19 /* OpenParenToken */, 20 /* CloseParenToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 8 /* Delete */)); this.NoSpaceAfterOpenParen = new formatting.Rule(formatting.RuleDescriptor.create3(19 /* OpenParenToken */, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsOptionDisabledOrUndefined("insertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis"), Rules.IsNonJsxSameLineTokenContext), 8 /* Delete */)); this.NoSpaceBeforeCloseParen = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 20 /* CloseParenToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsOptionDisabledOrUndefined("insertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis"), Rules.IsNonJsxSameLineTokenContext), 8 /* Delete */)); @@ -84486,7 +84999,7 @@ var ts; this.SpaceAfterComma, this.NoSpaceAfterComma, this.SpaceAfterAnonymousFunctionKeyword, this.NoSpaceAfterAnonymousFunctionKeyword, this.SpaceAfterKeywordInControl, this.NoSpaceAfterKeywordInControl, - this.SpaceAfterOpenParen, this.SpaceBeforeCloseParen, this.NoSpaceBetweenParens, this.NoSpaceAfterOpenParen, this.NoSpaceBeforeCloseParen, + this.SpaceAfterOpenParen, this.SpaceBeforeCloseParen, this.SpaceBetweenOpenParens, this.NoSpaceBetweenParens, this.NoSpaceAfterOpenParen, this.NoSpaceBeforeCloseParen, this.SpaceAfterOpenBracket, this.SpaceBeforeCloseBracket, this.NoSpaceBetweenBrackets, this.NoSpaceAfterOpenBracket, this.NoSpaceBeforeCloseBracket, this.SpaceAfterOpenBrace, this.SpaceBeforeCloseBrace, this.NoSpaceBetweenEmptyBraceBrackets, this.NoSpaceAfterOpenBrace, this.NoSpaceBeforeCloseBrace, this.SpaceAfterTemplateHeadAndMiddle, this.SpaceBeforeTemplateMiddleAndTail, this.NoSpaceAfterTemplateHeadAndMiddle, this.NoSpaceBeforeTemplateMiddleAndTail, @@ -84825,7 +85338,7 @@ var ts; (function (ts) { var formatting; (function (formatting) { - var RulesMap = (function () { + var RulesMap = /** @class */ (function () { function RulesMap() { this.map = []; this.mapRowLength = 0; @@ -84895,7 +85408,7 @@ var ts; RulesPosition[RulesPosition["NoContextRulesSpecific"] = MaskBitSize * 4] = "NoContextRulesSpecific"; RulesPosition[RulesPosition["NoContextRulesAny"] = MaskBitSize * 5] = "NoContextRulesAny"; })(RulesPosition = formatting.RulesPosition || (formatting.RulesPosition = {})); - var RulesBucketConstructionState = (function () { + var RulesBucketConstructionState = /** @class */ (function () { function RulesBucketConstructionState() { //// The Rules list contains all the inserted rules into a rulebucket in the following order: //// 1- Ignore rules with specific token combination @@ -84936,7 +85449,7 @@ var ts; return RulesBucketConstructionState; }()); formatting.RulesBucketConstructionState = RulesBucketConstructionState; - var RulesBucket = (function () { + var RulesBucket = /** @class */ (function () { function RulesBucket() { this.rules = []; } @@ -84985,7 +85498,7 @@ var ts; for (var token = 0 /* FirstToken */; token <= 142 /* LastToken */; token++) { allTokens.push(token); } - var TokenValuesAccess = (function () { + var TokenValuesAccess = /** @class */ (function () { function TokenValuesAccess(tokens) { if (tokens === void 0) { tokens = []; } this.tokens = tokens; @@ -84999,7 +85512,7 @@ var ts; TokenValuesAccess.prototype.isSpecific = function () { return true; }; return TokenValuesAccess; }()); - var TokenSingleValueAccess = (function () { + var TokenSingleValueAccess = /** @class */ (function () { function TokenSingleValueAccess(token) { this.token = token; } @@ -85012,7 +85525,7 @@ var ts; TokenSingleValueAccess.prototype.isSpecific = function () { return true; }; return TokenSingleValueAccess; }()); - var TokenAllAccess = (function () { + var TokenAllAccess = /** @class */ (function () { function TokenAllAccess() { } TokenAllAccess.prototype.GetTokens = function () { @@ -85027,7 +85540,7 @@ var ts; TokenAllAccess.prototype.isSpecific = function () { return false; }; return TokenAllAccess; }()); - var TokenAllExceptAccess = (function () { + var TokenAllExceptAccess = /** @class */ (function () { function TokenAllExceptAccess(except) { this.except = except; } @@ -85119,7 +85632,7 @@ var ts; (function (ts) { var formatting; (function (formatting) { - var RulesProvider = (function () { + var RulesProvider = /** @class */ (function () { function RulesProvider() { this.globalRules = new formatting.Rules(); var activeRules = this.globalRules.HighPriorityCommonRules.slice(0).concat(this.globalRules.UserConfigurableRules).concat(this.globalRules.LowPriorityCommonRules); @@ -85427,7 +85940,6 @@ var ts; function formatSpanWorker(originalRange, enclosingNode, initialIndentation, delta, formattingScanner, options, rulesProvider, requestKind, rangeContainsError, sourceFile) { // formatting context is used by rules provider var formattingContext = new formatting.FormattingContext(sourceFile, requestKind, options); - var previousRangeHasError; var previousRange; var previousParent; var previousRangeStartLine; @@ -85818,7 +86330,7 @@ var ts; function processRange(range, rangeStart, parent, contextNode, dynamicIndentation) { var rangeHasError = rangeContainsError(range); var lineAdded; - if (!rangeHasError && !previousRangeHasError) { + if (!rangeHasError) { if (!previousRange) { // trim whitespaces starting from the beginning of the span up to the current line var originalStart = sourceFile.getLineAndCharacterOfPosition(originalRange.pos); @@ -85832,7 +86344,6 @@ var ts; previousRange = range; previousParent = parent; previousRangeStartLine = rangeStart.line; - previousRangeHasError = rangeHasError; return lineAdded; } function processPair(currentItem, currentStartLine, currentParent, previousItem, previousStartLine, previousParent, contextNode, dynamicIndentation) { @@ -86038,6 +86549,51 @@ var ts; } } } + /** + * @param precedingToken pass `null` if preceding token was already computed and result was `undefined`. + */ + function getRangeOfEnclosingComment(sourceFile, position, onlyMultiLine, precedingToken, // tslint:disable-line:no-null-keyword + tokenAtPosition, predicate) { + if (tokenAtPosition === void 0) { tokenAtPosition = ts.getTokenAtPosition(sourceFile, position, /*includeJsDocComment*/ false); } + var tokenStart = tokenAtPosition.getStart(sourceFile); + if (tokenStart <= position && position < tokenAtPosition.getEnd()) { + return undefined; + } + if (precedingToken === undefined) { + precedingToken = ts.findPrecedingToken(position, sourceFile); + } + // Between two consecutive tokens, all comments are either trailing on the former + // or leading on the latter (and none are in both lists). + var trailingRangesOfPreviousToken = precedingToken && ts.getTrailingCommentRanges(sourceFile.text, precedingToken.end); + var leadingCommentRangesOfNextToken = ts.getLeadingCommentRangesOfNode(tokenAtPosition, sourceFile); + var commentRanges = trailingRangesOfPreviousToken && leadingCommentRangesOfNextToken ? + trailingRangesOfPreviousToken.concat(leadingCommentRangesOfNextToken) : + trailingRangesOfPreviousToken || leadingCommentRangesOfNextToken; + if (commentRanges) { + for (var _i = 0, commentRanges_1 = commentRanges; _i < commentRanges_1.length; _i++) { + var range = commentRanges_1[_i]; + // The end marker of a single-line comment does not include the newline character. + // With caret at `^`, in the following case, we are inside a comment (^ denotes the cursor position): + // + // // asdf ^\n + // + // But for closed multi-line comments, we don't want to be inside the comment in the following case: + // + // /* asdf */^ + // + // However, unterminated multi-line comments *do* contain their end. + // + // Internally, we represent the end of the comment at the newline and closing '/', respectively. + // + if ((range.pos < position && position < range.end || + position === range.end && (range.kind === 2 /* SingleLineCommentTrivia */ || position === sourceFile.getFullWidth()))) { + return (range.kind === 3 /* MultiLineCommentTrivia */ || !onlyMultiLine) && (!predicate || predicate(range)) ? range : undefined; + } + } + } + return undefined; + } + formatting.getRangeOfEnclosingComment = getRangeOfEnclosingComment; function getOpenTokenForList(node, list) { switch (node.kind) { case 152 /* Constructor */: @@ -86165,12 +86721,28 @@ var ts; return 0; } var precedingToken = ts.findPrecedingToken(position, sourceFile); + var enclosingCommentRange = formatting.getRangeOfEnclosingComment(sourceFile, position, /*onlyMultiLine*/ true, precedingToken || null); // tslint:disable-line:no-null-keyword + if (enclosingCommentRange) { + var previousLine = ts.getLineAndCharacterOfPosition(sourceFile, position).line - 1; + var commentStartLine = ts.getLineAndCharacterOfPosition(sourceFile, enclosingCommentRange.pos).line; + ts.Debug.assert(commentStartLine >= 0); + if (previousLine <= commentStartLine) { + return findFirstNonWhitespaceColumn(ts.getStartPositionOfLine(commentStartLine, sourceFile), position, sourceFile, options); + } + var startPostionOfLine = ts.getStartPositionOfLine(previousLine, sourceFile); + var _a = findFirstNonWhitespaceCharacterAndColumn(startPostionOfLine, position, sourceFile, options), column = _a.column, character = _a.character; + if (column === 0) { + return column; + } + var firstNonWhitespaceCharacterCode = sourceFile.text.charCodeAt(startPostionOfLine + character); + return firstNonWhitespaceCharacterCode === 42 /* asterisk */ ? column - 1 : column; + } if (!precedingToken) { return getBaseIndentation(options); } // no indentation in string \regex\template literals var precedingTokenIsLiteral = ts.isStringOrRegularExpressionOrTemplateLiteral(precedingToken.kind); - if (precedingTokenIsLiteral && precedingToken.getStart(sourceFile) <= position && precedingToken.end > position) { + if (precedingTokenIsLiteral && precedingToken.getStart(sourceFile) <= position && position < precedingToken.end) { return 0; } var lineAtPosition = sourceFile.getLineAndCharacterOfPosition(position).line; @@ -86473,13 +87045,13 @@ var ts; var lineStart = sourceFile.getPositionOfLineAndCharacter(lineAndCharacter.line, 0); return findFirstNonWhitespaceColumn(lineStart, lineStart + lineAndCharacter.character, sourceFile, options); } - /* - Character is the actual index of the character since the beginning of the line. - Column - position of the character after expanding tabs to spaces - "0\t2$" - value of 'character' for '$' is 3 - value of 'column' for '$' is 6 (assuming that tab size is 4) - */ + /** + * Character is the actual index of the character since the beginning of the line. + * Column - position of the character after expanding tabs to spaces. + * "0\t2$" + * value of 'character' for '$' is 3 + * value of 'column' for '$' is 6 (assuming that tab size is 4) + */ function findFirstNonWhitespaceCharacterAndColumn(startPos, endPos, sourceFile, options) { var character = 0; var column = 0; @@ -86633,6 +87205,12 @@ var ts; } return false; } + var ChangeKind; + (function (ChangeKind) { + ChangeKind[ChangeKind["Remove"] = 0] = "Remove"; + ChangeKind[ChangeKind["ReplaceWithSingleNode"] = 1] = "ReplaceWithSingleNode"; + ChangeKind[ChangeKind["ReplaceWithMultipleNodes"] = 2] = "ReplaceWithMultipleNodes"; + })(ChangeKind || (ChangeKind = {})); function getSeparatorCharacter(separator) { return ts.tokenToString(separator.kind); } @@ -86666,13 +87244,11 @@ var ts; } textChanges.getAdjustedStartPosition = getAdjustedStartPosition; function getAdjustedEndPosition(sourceFile, node, options) { - if (options.useNonAdjustedEndPosition) { + if (options.useNonAdjustedEndPosition || ts.isExpression(node)) { return node.getEnd(); } var end = node.getEnd(); var newEnd = ts.skipTrivia(sourceFile.text, end, /*stopAfterLineBreak*/ true); - // check if last character before newPos is linebreak - // if yes - considered all skipped trivia to be trailing trivia of the node return newEnd !== end && ts.isLineBreak(sourceFile.text.charCodeAt(newEnd - 1)) ? newEnd : end; @@ -86691,7 +87267,10 @@ var ts; } return s; } - var ChangeTracker = (function () { + function getNewlineKind(context) { + return context.newLineCharacter === "\n" ? 1 /* LineFeed */ : 0 /* CarriageReturnLineFeed */; + } + var ChangeTracker = /** @class */ (function () { function ChangeTracker(newLine, rulesProvider, validator) { this.newLine = newLine; this.rulesProvider = rulesProvider; @@ -86700,24 +87279,24 @@ var ts; this.newLineCharacter = ts.getNewLineCharacter({ newLine: newLine }); } ChangeTracker.fromCodeFixContext = function (context) { - return new ChangeTracker(context.newLineCharacter === "\n" ? 1 /* LineFeed */ : 0 /* CarriageReturnLineFeed */, context.rulesProvider); + return new ChangeTracker(getNewlineKind(context), context.rulesProvider); + }; + ChangeTracker.prototype.deleteRange = function (sourceFile, range) { + this.changes.push({ kind: ChangeKind.Remove, sourceFile: sourceFile, range: range }); + return this; }; ChangeTracker.prototype.deleteNode = function (sourceFile, node, options) { if (options === void 0) { options = {}; } var startPosition = getAdjustedStartPosition(sourceFile, node, options, Position.FullStart); var endPosition = getAdjustedEndPosition(sourceFile, node, options); - this.changes.push({ sourceFile: sourceFile, options: options, range: { pos: startPosition, end: endPosition } }); - return this; - }; - ChangeTracker.prototype.deleteRange = function (sourceFile, range) { - this.changes.push({ sourceFile: sourceFile, range: range }); + this.changes.push({ kind: ChangeKind.Remove, sourceFile: sourceFile, range: { pos: startPosition, end: endPosition } }); return this; }; ChangeTracker.prototype.deleteNodeRange = function (sourceFile, startNode, endNode, options) { if (options === void 0) { options = {}; } var startPosition = getAdjustedStartPosition(sourceFile, startNode, options, Position.FullStart); var endPosition = getAdjustedEndPosition(sourceFile, endNode, options); - this.changes.push({ sourceFile: sourceFile, options: options, range: { pos: startPosition, end: endPosition } }); + this.changes.push({ kind: ChangeKind.Remove, sourceFile: sourceFile, range: { pos: startPosition, end: endPosition } }); return this; }; ChangeTracker.prototype.deleteNodeInList = function (sourceFile, node) { @@ -86756,33 +87335,68 @@ var ts; }; ChangeTracker.prototype.replaceRange = function (sourceFile, range, newNode, options) { if (options === void 0) { options = {}; } - this.changes.push({ sourceFile: sourceFile, range: range, options: options, node: newNode }); + this.changes.push({ kind: ChangeKind.ReplaceWithSingleNode, sourceFile: sourceFile, range: range, options: options, node: newNode }); return this; }; ChangeTracker.prototype.replaceNode = function (sourceFile, oldNode, newNode, options) { if (options === void 0) { options = {}; } var startPosition = getAdjustedStartPosition(sourceFile, oldNode, options, Position.Start); var endPosition = getAdjustedEndPosition(sourceFile, oldNode, options); - this.changes.push({ sourceFile: sourceFile, options: options, useIndentationFromFile: true, node: newNode, range: { pos: startPosition, end: endPosition } }); - return this; + return this.replaceWithSingle(sourceFile, startPosition, endPosition, newNode, options); }; ChangeTracker.prototype.replaceNodeRange = function (sourceFile, startNode, endNode, newNode, options) { if (options === void 0) { options = {}; } var startPosition = getAdjustedStartPosition(sourceFile, startNode, options, Position.Start); var endPosition = getAdjustedEndPosition(sourceFile, endNode, options); - this.changes.push({ sourceFile: sourceFile, options: options, useIndentationFromFile: true, node: newNode, range: { pos: startPosition, end: endPosition } }); + return this.replaceWithSingle(sourceFile, startPosition, endPosition, newNode, options); + }; + ChangeTracker.prototype.replaceWithSingle = function (sourceFile, startPosition, endPosition, newNode, options) { + this.changes.push({ + kind: ChangeKind.ReplaceWithSingleNode, + sourceFile: sourceFile, + options: options, + node: newNode, + range: { pos: startPosition, end: endPosition } + }); return this; }; + ChangeTracker.prototype.replaceWithMultiple = function (sourceFile, startPosition, endPosition, newNodes, options) { + this.changes.push({ + kind: ChangeKind.ReplaceWithMultipleNodes, + sourceFile: sourceFile, + options: options, + nodes: newNodes, + range: { pos: startPosition, end: endPosition } + }); + return this; + }; + ChangeTracker.prototype.replaceNodeWithNodes = function (sourceFile, oldNode, newNodes, options) { + var startPosition = getAdjustedStartPosition(sourceFile, oldNode, options, Position.Start); + var endPosition = getAdjustedEndPosition(sourceFile, oldNode, options); + return this.replaceWithMultiple(sourceFile, startPosition, endPosition, newNodes, options); + }; + ChangeTracker.prototype.replaceNodesWithNodes = function (sourceFile, oldNodes, newNodes, options) { + var startPosition = getAdjustedStartPosition(sourceFile, oldNodes[0], options, Position.Start); + var endPosition = getAdjustedEndPosition(sourceFile, ts.lastOrUndefined(oldNodes), options); + return this.replaceWithMultiple(sourceFile, startPosition, endPosition, newNodes, options); + }; + ChangeTracker.prototype.replaceRangeWithNodes = function (sourceFile, range, newNodes, options) { + return this.replaceWithMultiple(sourceFile, range.pos, range.end, newNodes, options); + }; + ChangeTracker.prototype.replaceNodeRangeWithNodes = function (sourceFile, startNode, endNode, newNodes, options) { + var startPosition = getAdjustedStartPosition(sourceFile, startNode, options, Position.Start); + var endPosition = getAdjustedEndPosition(sourceFile, endNode, options); + return this.replaceWithMultiple(sourceFile, startPosition, endPosition, newNodes, options); + }; ChangeTracker.prototype.insertNodeAt = function (sourceFile, pos, newNode, options) { if (options === void 0) { options = {}; } - this.changes.push({ sourceFile: sourceFile, options: options, node: newNode, range: { pos: pos, end: pos } }); + this.changes.push({ kind: ChangeKind.ReplaceWithSingleNode, sourceFile: sourceFile, options: options, node: newNode, range: { pos: pos, end: pos } }); return this; }; ChangeTracker.prototype.insertNodeBefore = function (sourceFile, before, newNode, options) { if (options === void 0) { options = {}; } var startPosition = getAdjustedStartPosition(sourceFile, before, options, Position.Start); - this.changes.push({ sourceFile: sourceFile, options: options, useIndentationFromFile: true, node: newNode, range: { pos: startPosition, end: startPosition } }); - return this; + return this.replaceWithSingle(sourceFile, startPosition, startPosition, newNode, options); }; ChangeTracker.prototype.insertNodeAfter = function (sourceFile, after, newNode, options) { if (options === void 0) { options = {}; } @@ -86794,6 +87408,7 @@ var ts; // if not - insert semicolon to preserve the code from changing the meaning due to ASI if (sourceFile.text.charCodeAt(after.end - 1) !== 59 /* semicolon */) { this.changes.push({ + kind: ChangeKind.ReplaceWithSingleNode, sourceFile: sourceFile, options: {}, range: { pos: after.end, end: after.end }, @@ -86802,8 +87417,7 @@ var ts; } } var endPosition = getAdjustedEndPosition(sourceFile, after, options); - this.changes.push({ sourceFile: sourceFile, options: options, useIndentationFromFile: true, node: newNode, range: { pos: endPosition, end: endPosition } }); - return this; + return this.replaceWithSingle(sourceFile, endPosition, endPosition, newNode, options); }; /** * This function should be used to insert nodes in lists when nodes don't carry separators as the part of the node range, @@ -86869,10 +87483,10 @@ var ts; startPos = ts.getStartPositionOfLine(lineAndCharOfNextElement.line, sourceFile); } this.changes.push({ + kind: ChangeKind.ReplaceWithSingleNode, sourceFile: sourceFile, range: { pos: startPos, end: containingList[index + 1].getStart(sourceFile) }, node: newNode, - useIndentationFromFile: true, options: { prefix: prefix, // write separator and leading trivia of the next element as suffix @@ -86911,6 +87525,7 @@ var ts; if (multilineList) { // insert separator immediately following the 'after' node to preserve comments in trailing trivia this.changes.push({ + kind: ChangeKind.ReplaceWithSingleNode, sourceFile: sourceFile, range: { pos: end, end: end }, node: ts.createToken(separator), @@ -86924,6 +87539,7 @@ var ts; insertPos--; } this.changes.push({ + kind: ChangeKind.ReplaceWithSingleNode, sourceFile: sourceFile, range: { pos: insertPos, end: insertPos }, node: newNode, @@ -86932,6 +87548,7 @@ var ts; } else { this.changes.push({ + kind: ChangeKind.ReplaceWithSingleNode, sourceFile: sourceFile, range: { pos: end, end: end }, node: newNode, @@ -86973,33 +87590,45 @@ var ts; return ts.createTextSpanFromBounds(change.range.pos, change.range.end); }; ChangeTracker.prototype.computeNewText = function (change, sourceFile) { - if (!change.node) { + var _this = this; + if (change.kind === ChangeKind.Remove) { // deletion case return ""; } var options = change.options || {}; - var nonFormattedText = getNonformattedText(change.node, sourceFile, this.newLine); + var text; + var pos = change.range.pos; + var posStartsLine = ts.getLineStartPositionForPosition(pos, sourceFile) === pos; + if (change.kind === ChangeKind.ReplaceWithMultipleNodes) { + var parts = change.nodes.map(function (n) { return _this.getFormattedTextOfNode(n, sourceFile, pos, options); }); + text = parts.join(change.options.nodeSeparator); + } + else { + ts.Debug.assert(change.kind === ChangeKind.ReplaceWithSingleNode, "change.kind === ReplaceWithSingleNode"); + text = this.getFormattedTextOfNode(change.node, sourceFile, pos, options); + } + // strip initial indentation (spaces or tabs) if text will be inserted in the middle of the line + text = (posStartsLine || options.indentation !== undefined) ? text : text.replace(/^\s+/, ""); + return (options.prefix || "") + text + (options.suffix || ""); + }; + ChangeTracker.prototype.getFormattedTextOfNode = function (node, sourceFile, pos, options) { + var nonformattedText = getNonformattedText(node, sourceFile, this.newLine); if (this.validator) { - this.validator(nonFormattedText); + this.validator(nonformattedText); } var formatOptions = this.rulesProvider.getFormatOptions(); - var pos = change.range.pos; var posStartsLine = ts.getLineStartPositionForPosition(pos, sourceFile) === pos; - var initialIndentation = change.options.indentation !== undefined - ? change.options.indentation - : change.useIndentationFromFile - ? ts.formatting.SmartIndenter.getIndentation(change.range.pos, sourceFile, formatOptions, posStartsLine || (change.options.prefix === this.newLineCharacter)) + var initialIndentation = options.indentation !== undefined + ? options.indentation + : (options.useIndentationFromFile !== false) + ? ts.formatting.SmartIndenter.getIndentation(pos, sourceFile, formatOptions, posStartsLine || (options.prefix === this.newLineCharacter)) : 0; - var delta = change.options.delta !== undefined - ? change.options.delta - : ts.formatting.SmartIndenter.shouldIndentChildNode(change.node) - ? formatOptions.indentSize + var delta = options.delta !== undefined + ? options.delta + : ts.formatting.SmartIndenter.shouldIndentChildNode(node) + ? (formatOptions.indentSize || 0) : 0; - var text = applyFormatting(nonFormattedText, sourceFile, initialIndentation, delta, this.rulesProvider); - // strip initial indentation (spaces or tabs) if text will be inserted in the middle of the line - // however keep indentation if it is was forced - text = posStartsLine || change.options.indentation !== undefined ? text : text.replace(/^\s+/, ""); - return (options.prefix || "") + text + (options.suffix || ""); + return applyFormatting(nonformattedText, sourceFile, initialIndentation, delta, this.rulesProvider); }; ChangeTracker.normalize = function (changes) { // order changes by start position @@ -87065,7 +87694,7 @@ var ts; nodeArray.end = getEnd(nodes); return nodeArray; } - var Writer = (function () { + var Writer = /** @class */ (function () { function Writer(newLine) { var _this = this; this.lastNonTriviaPosition = 0; @@ -87948,7 +88577,7 @@ var ts; ModuleSpecifierComparison[ModuleSpecifierComparison["Equal"] = 1] = "Equal"; ModuleSpecifierComparison[ModuleSpecifierComparison["Worse"] = 2] = "Worse"; })(ModuleSpecifierComparison || (ModuleSpecifierComparison = {})); - var ImportCodeActionMap = (function () { + var ImportCodeActionMap = /** @class */ (function () { function ImportCodeActionMap() { this.symbolIdToActionMap = []; } @@ -88061,7 +88690,7 @@ var ts; } else if (ts.isJsxOpeningLikeElement(token.parent) && token.parent.tagName === token) { // The error wasn't for the symbolAtLocation, it was for the JSX tag itself, which needs access to e.g. `React`. - symbol = checker.getAliasedSymbol(checker.resolveNameAtLocation(token, checker.getJsxNamespace(), 107455 /* Value */)); + symbol = checker.getAliasedSymbol(checker.resolveName(checker.getJsxNamespace(), token.parent.tagName, 107455 /* Value */)); symbolName = symbol.name; } else { @@ -88086,7 +88715,7 @@ var ts; if (localSymbol && localSymbol.escapedName === name && checkSymbolHasMeaning(localSymbol, currentTokenMeaning)) { // check if this symbol is already used var symbolId = getUniqueSymbolId(localSymbol); - symbolIdActionMap.addActions(symbolId, getCodeActionForImport(moduleSymbol, name, /*isDefault*/ true)); + symbolIdActionMap.addActions(symbolId, getCodeActionForImport(moduleSymbol, name, /*isNamespaceImport*/ true)); } } // "default" is a keyword and not a legal identifier for the import, so we don't expect it here @@ -88162,8 +88791,8 @@ var ts; var namespaceImportDeclaration; var namedImportDeclaration; var existingModuleSpecifier; - for (var _i = 0, declarations_14 = declarations; _i < declarations_14.length; _i++) { - var declaration = declarations_14[_i]; + for (var _i = 0, declarations_13 = declarations; _i < declarations_13.length; _i++) { + var declaration = declarations_13[_i]; if (declaration.kind === 238 /* ImportDeclaration */) { var namedBindings = declaration.importClause && declaration.importClause.namedBindings; if (namedBindings && namedBindings.kind === 240 /* NamespaceImport */) { @@ -88273,9 +88902,11 @@ var ts; : isNamespaceImport ? ts.createImportClause(/*name*/ undefined, ts.createNamespaceImport(ts.createIdentifier(symbolName))) : ts.createImportClause(/*name*/ undefined, ts.createNamedImports([ts.createImportSpecifier(/*propertyName*/ undefined, ts.createIdentifier(symbolName))])); - var importDecl = ts.createImportDeclaration(/*decorators*/ undefined, /*modifiers*/ undefined, importClause, ts.createLiteral(moduleSpecifierWithoutQuotes)); + var moduleSpecifierLiteral = ts.createLiteral(moduleSpecifierWithoutQuotes); + moduleSpecifierLiteral.singleQuote = getSingleQuoteStyleFromExistingImports(); + var importDecl = ts.createImportDeclaration(/*decorators*/ undefined, /*modifiers*/ undefined, importClause, moduleSpecifierLiteral); if (!lastImportDeclaration) { - changeTracker.insertNodeAt(sourceFile, sourceFile.getStart(), importDecl, { suffix: "" + context.newLineCharacter + context.newLineCharacter }); + changeTracker.insertNodeAt(sourceFile, getSourceFileImportLocation(sourceFile), importDecl, { suffix: "" + context.newLineCharacter + context.newLineCharacter }); } else { changeTracker.insertNodeAfter(sourceFile, lastImportDeclaration, importDecl, { suffix: context.newLineCharacter }); @@ -88284,6 +88915,46 @@ var ts; // between the only import statement and user code. Otherwise just insert the statement because chances // are there are already a new line seperating code and import statements. return createCodeAction(ts.Diagnostics.Import_0_from_1, [symbolName, "\"" + moduleSpecifierWithoutQuotes + "\""], changeTracker.getChanges(), "NewImport", moduleSpecifierWithoutQuotes); + function getSourceFileImportLocation(node) { + // For a source file, it is possible there are detached comments we should not skip + var text = node.text; + var ranges = ts.getLeadingCommentRanges(text, 0); + if (!ranges) + return 0; + var position = 0; + // However we should still skip a pinned comment at the top + if (ranges.length && ranges[0].kind === 3 /* MultiLineCommentTrivia */ && ts.isPinnedComment(text, ranges[0])) { + position = ranges[0].end + 1; + ranges = ranges.slice(1); + } + // As well as any triple slash references + for (var _i = 0, ranges_1 = ranges; _i < ranges_1.length; _i++) { + var range = ranges_1[_i]; + if (range.kind === 2 /* SingleLineCommentTrivia */ && ts.isRecognizedTripleSlashComment(node.text, range.pos, range.end)) { + position = range.end + 1; + continue; + } + break; + } + return position; + } + function getSingleQuoteStyleFromExistingImports() { + var firstModuleSpecifier = ts.forEach(sourceFile.statements, function (node) { + if (ts.isImportDeclaration(node) || ts.isExportDeclaration(node)) { + if (node.moduleSpecifier && ts.isStringLiteral(node.moduleSpecifier)) { + return node.moduleSpecifier; + } + } + else if (ts.isImportEqualsDeclaration(node)) { + if (ts.isExternalModuleReference(node.moduleReference) && ts.isStringLiteral(node.moduleReference.expression)) { + return node.moduleReference.expression; + } + } + }); + if (firstModuleSpecifier) { + return sourceFile.text.charCodeAt(firstModuleSpecifier.getStart()) === 39 /* singleQuote */; + } + } function getModuleSpecifierForNewImport() { var fileName = sourceFile.fileName; var moduleFileName = moduleSymbol.valueDeclaration.getSourceFile().fileName; @@ -88415,8 +89086,8 @@ var ts; } function getNodeModulePathParts(fullPath) { // If fullPath can't be valid module file within node_modules, returns undefined. - // Example of expected pattern: /base/path/node_modules/[otherpackage/node_modules/]package/[subdirectory/]file.js - // Returns indices: ^ ^ ^ ^ + // Example of expected pattern: /base/path/node_modules/[@scope/otherpackage/@otherscope/node_modules/]package/[subdirectory/]file.js + // Returns indices: ^ ^ ^ ^ var topLevelNodeModulesIndex = 0; var topLevelPackageNameIndex = 0; var packageRootIndex = 0; @@ -88425,7 +89096,8 @@ var ts; (function (States) { States[States["BeforeNodeModules"] = 0] = "BeforeNodeModules"; States[States["NodeModules"] = 1] = "NodeModules"; - States[States["PackageContent"] = 2] = "PackageContent"; + States[States["Scope"] = 2] = "Scope"; + States[States["PackageContent"] = 3] = "PackageContent"; })(States || (States = {})); var partStart = 0; var partEnd = 0; @@ -88442,15 +89114,21 @@ var ts; } break; case 1 /* NodeModules */: - packageRootIndex = partEnd; - state = 2 /* PackageContent */; + case 2 /* Scope */: + if (state === 1 /* NodeModules */ && fullPath.charAt(partStart + 1) === "@") { + state = 2 /* Scope */; + } + else { + packageRootIndex = partEnd; + state = 3 /* PackageContent */; + } break; - case 2 /* PackageContent */: + case 3 /* PackageContent */: if (fullPath.indexOf("/node_modules/", partStart) === partStart) { state = 1 /* NodeModules */; } else { - state = 2 /* PackageContent */; + state = 3 /* PackageContent */; } break; } @@ -88807,231 +89485,1208 @@ var ts; (function (ts) { var refactor; (function (refactor) { - var actionName = "convert"; - var convertFunctionToES6Class = { - name: "Convert to ES2015 class", - description: ts.Diagnostics.Convert_function_to_an_ES2015_class.message, - getEditsForAction: getEditsForAction, - getAvailableActions: getAvailableActions - }; - refactor.registerRefactor(convertFunctionToES6Class); - function getAvailableActions(context) { - if (!ts.isInJavaScriptFile(context.file)) { - return undefined; - } - var start = context.startPosition; - var node = ts.getTokenAtPosition(context.file, start, /*includeJsDocComment*/ false); - var checker = context.program.getTypeChecker(); - var symbol = checker.getSymbolAtLocation(node); - if (symbol && ts.isDeclarationOfFunctionOrClassExpression(symbol)) { - symbol = symbol.valueDeclaration.initializer.symbol; + var convertFunctionToES6Class; + (function (convertFunctionToES6Class_1) { + var actionName = "convert"; + var convertFunctionToES6Class = { + name: "Convert to ES2015 class", + description: ts.Diagnostics.Convert_function_to_an_ES2015_class.message, + getEditsForAction: getEditsForAction, + getAvailableActions: getAvailableActions + }; + refactor.registerRefactor(convertFunctionToES6Class); + function getAvailableActions(context) { + if (!ts.isInJavaScriptFile(context.file)) { + return undefined; + } + var start = context.startPosition; + var node = ts.getTokenAtPosition(context.file, start, /*includeJsDocComment*/ false); + var checker = context.program.getTypeChecker(); + var symbol = checker.getSymbolAtLocation(node); + if (symbol && ts.isDeclarationOfFunctionOrClassExpression(symbol)) { + symbol = symbol.valueDeclaration.initializer.symbol; + } + if (symbol && (symbol.flags & 16 /* Function */) && symbol.members && (symbol.members.size > 0)) { + return [ + { + name: convertFunctionToES6Class.name, + description: convertFunctionToES6Class.description, + actions: [ + { + description: convertFunctionToES6Class.description, + name: actionName + } + ] + } + ]; + } } - if (symbol && (symbol.flags & 16 /* Function */) && symbol.members && (symbol.members.size > 0)) { - return [ - { - name: convertFunctionToES6Class.name, - description: convertFunctionToES6Class.description, - actions: [ - { - description: convertFunctionToES6Class.description, - name: actionName + function getEditsForAction(context, action) { + // Somehow wrong action got invoked? + if (actionName !== action) { + return undefined; + } + var start = context.startPosition; + var sourceFile = context.file; + var checker = context.program.getTypeChecker(); + var token = ts.getTokenAtPosition(sourceFile, start, /*includeJsDocComment*/ false); + var ctorSymbol = checker.getSymbolAtLocation(token); + var newLine = context.rulesProvider.getFormatOptions().newLineCharacter; + var deletedNodes = []; + var deletes = []; + if (!(ctorSymbol.flags & (16 /* Function */ | 3 /* Variable */))) { + return undefined; + } + var ctorDeclaration = ctorSymbol.valueDeclaration; + var changeTracker = ts.textChanges.ChangeTracker.fromCodeFixContext(context); + var precedingNode; + var newClassDeclaration; + switch (ctorDeclaration.kind) { + case 228 /* FunctionDeclaration */: + precedingNode = ctorDeclaration; + deleteNode(ctorDeclaration); + newClassDeclaration = createClassFromFunctionDeclaration(ctorDeclaration); + break; + case 226 /* VariableDeclaration */: + precedingNode = ctorDeclaration.parent.parent; + if (ctorDeclaration.parent.declarations.length === 1) { + deleteNode(precedingNode); + } + else { + deleteNode(ctorDeclaration, /*inList*/ true); + } + newClassDeclaration = createClassFromVariableDeclaration(ctorDeclaration); + break; + } + if (!newClassDeclaration) { + return undefined; + } + // Because the preceding node could be touched, we need to insert nodes before delete nodes. + changeTracker.insertNodeAfter(sourceFile, precedingNode, newClassDeclaration, { suffix: newLine }); + for (var _i = 0, deletes_1 = deletes; _i < deletes_1.length; _i++) { + var deleteCallback = deletes_1[_i]; + deleteCallback(); + } + return { + edits: changeTracker.getChanges() + }; + function deleteNode(node, inList) { + if (inList === void 0) { inList = false; } + if (deletedNodes.some(function (n) { return ts.isNodeDescendantOf(node, n); })) { + // Parent node has already been deleted; do nothing + return; + } + deletedNodes.push(node); + if (inList) { + deletes.push(function () { return changeTracker.deleteNodeInList(sourceFile, node); }); + } + else { + deletes.push(function () { return changeTracker.deleteNode(sourceFile, node); }); + } + } + function createClassElementsFromSymbol(symbol) { + var memberElements = []; + // all instance members are stored in the "member" array of symbol + if (symbol.members) { + symbol.members.forEach(function (member) { + var memberElement = createClassElement(member, /*modifiers*/ undefined); + if (memberElement) { + memberElements.push(memberElement); } - ] + }); } - ]; - } - } - function getEditsForAction(context, action) { - // Somehow wrong action got invoked? - if (actionName !== action) { - return undefined; + // all static members are stored in the "exports" array of symbol + if (symbol.exports) { + symbol.exports.forEach(function (member) { + var memberElement = createClassElement(member, [ts.createToken(115 /* StaticKeyword */)]); + if (memberElement) { + memberElements.push(memberElement); + } + }); + } + return memberElements; + function shouldConvertDeclaration(_target, source) { + // Right now the only thing we can convert are function expressions - other values shouldn't get + // transformed. We can update this once ES public class properties are available. + return ts.isFunctionLike(source); + } + function createClassElement(symbol, modifiers) { + // both properties and methods are bound as property symbols + if (!(symbol.flags & 4 /* Property */)) { + return; + } + var memberDeclaration = symbol.valueDeclaration; + var assignmentBinaryExpression = memberDeclaration.parent; + if (!shouldConvertDeclaration(memberDeclaration, assignmentBinaryExpression.right)) { + return; + } + // delete the entire statement if this expression is the sole expression to take care of the semicolon at the end + var nodeToDelete = assignmentBinaryExpression.parent && assignmentBinaryExpression.parent.kind === 210 /* ExpressionStatement */ + ? assignmentBinaryExpression.parent : assignmentBinaryExpression; + deleteNode(nodeToDelete); + if (!assignmentBinaryExpression.right) { + return ts.createProperty([], modifiers, symbol.name, /*questionToken*/ undefined, + /*type*/ undefined, /*initializer*/ undefined); + } + switch (assignmentBinaryExpression.right.kind) { + case 186 /* FunctionExpression */: { + var functionExpression = assignmentBinaryExpression.right; + var method = ts.createMethod(/*decorators*/ undefined, modifiers, /*asteriskToken*/ undefined, memberDeclaration.name, /*questionToken*/ undefined, + /*typeParameters*/ undefined, functionExpression.parameters, /*type*/ undefined, functionExpression.body); + copyComments(assignmentBinaryExpression, method); + return method; + } + case 187 /* ArrowFunction */: { + var arrowFunction = assignmentBinaryExpression.right; + var arrowFunctionBody = arrowFunction.body; + var bodyBlock = void 0; + // case 1: () => { return [1,2,3] } + if (arrowFunctionBody.kind === 207 /* Block */) { + bodyBlock = arrowFunctionBody; + } + else { + var expression = arrowFunctionBody; + bodyBlock = ts.createBlock([ts.createReturn(expression)]); + } + var method = ts.createMethod(/*decorators*/ undefined, modifiers, /*asteriskToken*/ undefined, memberDeclaration.name, /*questionToken*/ undefined, + /*typeParameters*/ undefined, arrowFunction.parameters, /*type*/ undefined, bodyBlock); + copyComments(assignmentBinaryExpression, method); + return method; + } + default: { + // Don't try to declare members in JavaScript files + if (ts.isSourceFileJavaScript(sourceFile)) { + return; + } + var prop = ts.createProperty(/*decorators*/ undefined, modifiers, memberDeclaration.name, /*questionToken*/ undefined, + /*type*/ undefined, assignmentBinaryExpression.right); + copyComments(assignmentBinaryExpression.parent, prop); + return prop; + } + } + } + } + function copyComments(sourceNode, targetNode) { + ts.forEachLeadingCommentRange(sourceFile.text, sourceNode.pos, function (pos, end, kind, htnl) { + if (kind === 3 /* MultiLineCommentTrivia */) { + // Remove leading /* + pos += 2; + // Remove trailing */ + end -= 2; + } + else { + // Remove leading // + pos += 2; + } + ts.addSyntheticLeadingComment(targetNode, kind, sourceFile.text.slice(pos, end), htnl); + }); + } + function createClassFromVariableDeclaration(node) { + var initializer = node.initializer; + if (!initializer || initializer.kind !== 186 /* FunctionExpression */) { + return undefined; + } + if (node.name.kind !== 71 /* Identifier */) { + return undefined; + } + var memberElements = createClassElementsFromSymbol(initializer.symbol); + if (initializer.body) { + memberElements.unshift(ts.createConstructor(/*decorators*/ undefined, /*modifiers*/ undefined, initializer.parameters, initializer.body)); + } + var cls = ts.createClassDeclaration(/*decorators*/ undefined, /*modifiers*/ undefined, node.name, + /*typeParameters*/ undefined, /*heritageClauses*/ undefined, memberElements); + // Don't call copyComments here because we'll already leave them in place + return cls; + } + function createClassFromFunctionDeclaration(node) { + var memberElements = createClassElementsFromSymbol(ctorSymbol); + if (node.body) { + memberElements.unshift(ts.createConstructor(/*decorators*/ undefined, /*modifiers*/ undefined, node.parameters, node.body)); + } + var cls = ts.createClassDeclaration(/*decorators*/ undefined, /*modifiers*/ undefined, node.name, + /*typeParameters*/ undefined, /*heritageClauses*/ undefined, memberElements); + // Don't call copyComments here because we'll already leave them in place + return cls; + } } - var start = context.startPosition; - var sourceFile = context.file; - var checker = context.program.getTypeChecker(); - var token = ts.getTokenAtPosition(sourceFile, start, /*includeJsDocComment*/ false); - var ctorSymbol = checker.getSymbolAtLocation(token); - var newLine = context.rulesProvider.getFormatOptions().newLineCharacter; - var deletedNodes = []; - var deletes = []; - if (!(ctorSymbol.flags & (16 /* Function */ | 3 /* Variable */))) { - return undefined; + })(convertFunctionToES6Class = refactor.convertFunctionToES6Class || (refactor.convertFunctionToES6Class = {})); + })(refactor = ts.refactor || (ts.refactor = {})); +})(ts || (ts = {})); +/// +/// +/* @internal */ +var ts; +(function (ts) { + var refactor; + (function (refactor) { + var extractMethod; + (function (extractMethod_1) { + var extractMethod = { + name: "Extract Method", + description: ts.Diagnostics.Extract_function.message, + getAvailableActions: getAvailableActions, + getEditsForAction: getEditsForAction, + }; + refactor.registerRefactor(extractMethod); + /** Compute the associated code actions */ + function getAvailableActions(context) { + var rangeToExtract = getRangeToExtract(context.file, { start: context.startPosition, length: context.endPosition - context.startPosition }); + var targetRange = rangeToExtract.targetRange; + if (targetRange === undefined) { + return undefined; + } + var extractions = getPossibleExtractions(targetRange, context); + if (extractions === undefined) { + // No extractions possible + return undefined; + } + var actions = []; + var usedNames = ts.createMap(); + var i = 0; + for (var _i = 0, extractions_1 = extractions; _i < extractions_1.length; _i++) { + var extr = extractions_1[_i]; + // Skip these since we don't have a way to report errors yet + if (extr.errors && extr.errors.length) { + continue; + } + // Don't issue refactorings with duplicated names. + // Scopes come back in "innermost first" order, so extractions will + // preferentially go into nearer scopes + var description = ts.formatStringFromArgs(ts.Diagnostics.Extract_function_into_0.message, [extr.scopeDescription]); + if (!usedNames.has(description)) { + usedNames.set(description, true); + actions.push({ + description: description, + name: "scope_" + i + }); + } + // *do* increment i anyway because we'll look for the i-th scope + // later when actually doing the refactoring if the user requests it + i++; + } + if (actions.length === 0) { + return undefined; + } + return [{ + name: extractMethod.name, + description: extractMethod.description, + inlineable: true, + actions: actions + }]; } - var ctorDeclaration = ctorSymbol.valueDeclaration; - var changeTracker = ts.textChanges.ChangeTracker.fromCodeFixContext(context); - var precedingNode; - var newClassDeclaration; - switch (ctorDeclaration.kind) { - case 228 /* FunctionDeclaration */: - precedingNode = ctorDeclaration; - deleteNode(ctorDeclaration); - newClassDeclaration = createClassFromFunctionDeclaration(ctorDeclaration); - break; - case 226 /* VariableDeclaration */: - precedingNode = ctorDeclaration.parent.parent; - if (ctorDeclaration.parent.declarations.length === 1) { - deleteNode(precedingNode); + function getEditsForAction(context, actionName) { + var length = context.endPosition === undefined ? 0 : context.endPosition - context.startPosition; + var rangeToExtract = getRangeToExtract(context.file, { start: context.startPosition, length: length }); + var targetRange = rangeToExtract.targetRange; + var parsedIndexMatch = /^scope_(\d+)$/.exec(actionName); + ts.Debug.assert(!!parsedIndexMatch, "Scope name should have matched the regexp"); + var index = +parsedIndexMatch[1]; + ts.Debug.assert(isFinite(index), "Expected to parse a finite number from the scope index"); + var extractions = getPossibleExtractions(targetRange, context, index); + // Scope is no longer valid from when the user issued the refactor (??) + ts.Debug.assert(extractions !== undefined, "The extraction went missing? How?"); + return ({ edits: extractions[0].changes }); + } + // Move these into diagnostic messages if they become user-facing + var Messages; + (function (Messages) { + function createMessage(message) { + return { message: message, code: 0, category: ts.DiagnosticCategory.Message, key: message }; + } + Messages.CannotExtractFunction = createMessage("Cannot extract function."); + Messages.StatementOrExpressionExpected = createMessage("Statement or expression expected."); + Messages.CannotExtractRangeContainingConditionalBreakOrContinueStatements = createMessage("Cannot extract range containing conditional break or continue statements."); + Messages.CannotExtractRangeContainingConditionalReturnStatement = createMessage("Cannot extract range containing conditional return statement."); + Messages.CannotExtractRangeContainingLabeledBreakOrContinueStatementWithTargetOutsideOfTheRange = createMessage("Cannot extract range containing labeled break or continue with target outside of the range."); + Messages.CannotExtractRangeThatContainsWritesToReferencesLocatedOutsideOfTheTargetRangeInGenerators = createMessage("Cannot extract range containing writes to references located outside of the target range in generators."); + Messages.TypeWillNotBeVisibleInTheNewScope = createMessage("Type will not visible in the new scope."); + Messages.FunctionWillNotBeVisibleInTheNewScope = createMessage("Function will not visible in the new scope."); + Messages.InsufficientSelection = createMessage("Select more than a single identifier."); + Messages.CannotExtractExportedEntity = createMessage("Cannot extract exported declaration"); + Messages.CannotCombineWritesAndReturns = createMessage("Cannot combine writes and returns"); + Messages.CannotExtractReadonlyPropertyInitializerOutsideConstructor = createMessage("Cannot move initialization of read-only class property outside of the constructor"); + Messages.CannotExtractAmbientBlock = createMessage("Cannot extract code from ambient contexts"); + })(Messages || (Messages = {})); + var RangeFacts; + (function (RangeFacts) { + RangeFacts[RangeFacts["None"] = 0] = "None"; + RangeFacts[RangeFacts["HasReturn"] = 1] = "HasReturn"; + RangeFacts[RangeFacts["IsGenerator"] = 2] = "IsGenerator"; + RangeFacts[RangeFacts["IsAsyncFunction"] = 4] = "IsAsyncFunction"; + RangeFacts[RangeFacts["UsesThis"] = 8] = "UsesThis"; + /** + * The range is in a function which needs the 'static' modifier in a class + */ + RangeFacts[RangeFacts["InStaticRegion"] = 16] = "InStaticRegion"; + })(RangeFacts = extractMethod_1.RangeFacts || (extractMethod_1.RangeFacts = {})); + /** + * getRangeToExtract takes a span inside a text file and returns either an expression or an array + * of statements representing the minimum set of nodes needed to extract the entire span. This + * process may fail, in which case a set of errors is returned instead (these are currently + * not shown to the user, but can be used by us diagnostically) + */ + function getRangeToExtract(sourceFile, span) { + var length = span.length || 0; + // Walk up starting from the the start position until we find a non-SourceFile node that subsumes the selected span. + // This may fail (e.g. you select two statements in the root of a source file) + var start = getParentNodeInSpan(ts.getTokenAtPosition(sourceFile, span.start, /*includeJsDocComment*/ false), sourceFile, span); + // Do the same for the ending position + var end = getParentNodeInSpan(ts.findTokenOnLeftOfPosition(sourceFile, ts.textSpanEnd(span)), sourceFile, span); + var declarations = []; + // We'll modify these flags as we walk the tree to collect data + // about what things need to be done as part of the extraction. + var rangeFacts = RangeFacts.None; + if (!start || !end) { + // cannot find either start or end node + return { errors: [ts.createFileDiagnostic(sourceFile, span.start, length, Messages.CannotExtractFunction)] }; + } + if (start.parent !== end.parent) { + // handle cases like 1 + [2 + 3] + 4 + // user selection is marked with []. + // in this case 2 + 3 does not belong to the same tree node + // instead the shape of the tree looks like this: + // + + // / \ + // + 4 + // / \ + // + 3 + // / \ + // 1 2 + // in this case there is no such one node that covers ends of selection and is located inside the selection + // to handle this we check if both start and end of the selection belong to some binary operation + // and start node is parented by the parent of the end node + // if this is the case - expand the selection to the entire parent of end node (in this case it will be [1 + 2 + 3] + 4) + var startParent = ts.skipParentheses(start.parent); + var endParent = ts.skipParentheses(end.parent); + if (ts.isBinaryExpression(startParent) && ts.isBinaryExpression(endParent) && ts.isNodeDescendantOf(startParent, endParent)) { + start = end = endParent; } else { - deleteNode(ctorDeclaration, /*inList*/ true); + // start and end nodes belong to different subtrees + return createErrorResult(sourceFile, span.start, length, Messages.CannotExtractFunction); } - newClassDeclaration = createClassFromVariableDeclaration(ctorDeclaration); - break; + } + if (start !== end) { + // start and end should be statements and parent should be either block or a source file + if (!isBlockLike(start.parent)) { + return createErrorResult(sourceFile, span.start, length, Messages.CannotExtractFunction); + } + var statements = []; + for (var _i = 0, _a = start.parent.statements; _i < _a.length; _i++) { + var statement = _a[_i]; + if (statement === start || statements.length) { + var errors = checkNode(statement); + if (errors) { + return { errors: errors }; + } + statements.push(statement); + } + if (statement === end) { + break; + } + } + return { targetRange: { range: statements, facts: rangeFacts, declarations: declarations } }; + } + else { + // We have a single node (start) + var errors = checkRootNode(start) || checkNode(start); + if (errors) { + return { errors: errors }; + } + // If our selection is the expression in an ExpressionStatement, expand + // the selection to include the enclosing Statement (this stops us + // from trying to care about the return value of the extracted function + // and eliminates double semicolon insertion in certain scenarios) + var range = ts.isStatement(start) + ? [start] + : start.parent && start.parent.kind === 210 /* ExpressionStatement */ + ? [start.parent] + : start; + return { targetRange: { range: range, facts: rangeFacts, declarations: declarations } }; + } + function createErrorResult(sourceFile, start, length, message) { + return { errors: [ts.createFileDiagnostic(sourceFile, start, length, message)] }; + } + function checkRootNode(node) { + if (ts.isIdentifier(node)) { + return [ts.createDiagnosticForNode(node, Messages.InsufficientSelection)]; + } + return undefined; + } + function checkForStaticContext(nodeToCheck, containingClass) { + var current = nodeToCheck; + while (current !== containingClass) { + if (current.kind === 149 /* PropertyDeclaration */) { + if (ts.hasModifier(current, 32 /* Static */)) { + rangeFacts |= RangeFacts.InStaticRegion; + } + break; + } + else if (current.kind === 146 /* Parameter */) { + var ctorOrMethod = ts.getContainingFunction(current); + if (ctorOrMethod.kind === 152 /* Constructor */) { + rangeFacts |= RangeFacts.InStaticRegion; + } + break; + } + else if (current.kind === 151 /* MethodDeclaration */) { + if (ts.hasModifier(current, 32 /* Static */)) { + rangeFacts |= RangeFacts.InStaticRegion; + } + } + current = current.parent; + } + } + // Verifies whether we can actually extract this node or not. + function checkNode(nodeToCheck) { + var PermittedJumps; + (function (PermittedJumps) { + PermittedJumps[PermittedJumps["None"] = 0] = "None"; + PermittedJumps[PermittedJumps["Break"] = 1] = "Break"; + PermittedJumps[PermittedJumps["Continue"] = 2] = "Continue"; + PermittedJumps[PermittedJumps["Return"] = 4] = "Return"; + })(PermittedJumps || (PermittedJumps = {})); + if (!ts.isStatement(nodeToCheck) && !(ts.isExpression(nodeToCheck) && isExtractableExpression(nodeToCheck))) { + return [ts.createDiagnosticForNode(nodeToCheck, Messages.StatementOrExpressionExpected)]; + } + if (ts.isInAmbientContext(nodeToCheck)) { + return [ts.createDiagnosticForNode(nodeToCheck, Messages.CannotExtractAmbientBlock)]; + } + // If we're in a class, see whether we're in a static region (static property initializer, static method, class constructor parameter default) + var containingClass = ts.getContainingClass(nodeToCheck); + if (containingClass) { + checkForStaticContext(nodeToCheck, containingClass); + } + var errors; + var permittedJumps = 4 /* Return */; + var seenLabels; + visit(nodeToCheck); + return errors; + function visit(node) { + if (errors) { + // already found an error - can stop now + return true; + } + if (ts.isDeclaration(node)) { + var declaringNode = (node.kind === 226 /* VariableDeclaration */) ? node.parent.parent : node; + if (ts.hasModifier(declaringNode, 1 /* Export */)) { + (errors || (errors = [])).push(ts.createDiagnosticForNode(node, Messages.CannotExtractExportedEntity)); + return true; + } + declarations.push(node.symbol); + } + // Some things can't be extracted in certain situations + switch (node.kind) { + case 238 /* ImportDeclaration */: + (errors || (errors = [])).push(ts.createDiagnosticForNode(node, Messages.CannotExtractFunction)); + return true; + case 97 /* SuperKeyword */: + // For a super *constructor call*, we have to be extracting the entire class, + // but a super *method call* simply implies a 'this' reference + if (node.parent.kind === 181 /* CallExpression */) { + // Super constructor call + var containingClass_1 = ts.getContainingClass(node); + if (containingClass_1.pos < span.start || containingClass_1.end >= (span.start + span.length)) { + (errors || (errors = [])).push(ts.createDiagnosticForNode(node, Messages.CannotExtractFunction)); + return true; + } + } + else { + rangeFacts |= RangeFacts.UsesThis; + } + break; + } + if (!node || ts.isFunctionLike(node) || ts.isClassLike(node)) { + switch (node.kind) { + case 228 /* FunctionDeclaration */: + case 229 /* ClassDeclaration */: + if (node.parent.kind === 265 /* SourceFile */ && node.parent.externalModuleIndicator === undefined) { + // You cannot extract global declarations + (errors || (errors = [])).push(ts.createDiagnosticForNode(node, Messages.FunctionWillNotBeVisibleInTheNewScope)); + } + break; + } + // do not dive into functions or classes + return false; + } + var savedPermittedJumps = permittedJumps; + if (node.parent) { + switch (node.parent.kind) { + case 211 /* IfStatement */: + if (node.parent.thenStatement === node || node.parent.elseStatement === node) { + // forbid all jumps inside thenStatement or elseStatement + permittedJumps = 0 /* None */; + } + break; + case 224 /* TryStatement */: + if (node.parent.tryBlock === node) { + // forbid all jumps inside try blocks + permittedJumps = 0 /* None */; + } + else if (node.parent.finallyBlock === node) { + // allow unconditional returns from finally blocks + permittedJumps = 4 /* Return */; + } + break; + case 260 /* CatchClause */: + if (node.parent.block === node) { + // forbid all jumps inside the block of catch clause + permittedJumps = 0 /* None */; + } + break; + case 257 /* CaseClause */: + if (node.expression !== node) { + // allow unlabeled break inside case clauses + permittedJumps |= 1 /* Break */; + } + break; + default: + if (ts.isIterationStatement(node.parent, /*lookInLabeledStatements*/ false)) { + if (node.parent.statement === node) { + // allow unlabeled break/continue inside loops + permittedJumps |= 1 /* Break */ | 2 /* Continue */; + } + } + break; + } + } + switch (node.kind) { + case 169 /* ThisType */: + case 99 /* ThisKeyword */: + rangeFacts |= RangeFacts.UsesThis; + break; + case 222 /* LabeledStatement */: + { + var label = node.label; + (seenLabels || (seenLabels = [])).push(label.escapedText); + ts.forEachChild(node, visit); + seenLabels.pop(); + break; + } + case 218 /* BreakStatement */: + case 217 /* ContinueStatement */: + { + var label = node.label; + if (label) { + if (!ts.contains(seenLabels, label.escapedText)) { + // attempts to jump to label that is not in range to be extracted + (errors || (errors = [])).push(ts.createDiagnosticForNode(node, Messages.CannotExtractRangeContainingLabeledBreakOrContinueStatementWithTargetOutsideOfTheRange)); + } + } + else { + if (!(permittedJumps & (218 /* BreakStatement */ ? 1 /* Break */ : 2 /* Continue */))) { + // attempt to break or continue in a forbidden context + (errors || (errors = [])).push(ts.createDiagnosticForNode(node, Messages.CannotExtractRangeContainingConditionalBreakOrContinueStatements)); + } + } + break; + } + case 191 /* AwaitExpression */: + rangeFacts |= RangeFacts.IsAsyncFunction; + break; + case 197 /* YieldExpression */: + rangeFacts |= RangeFacts.IsGenerator; + break; + case 219 /* ReturnStatement */: + if (permittedJumps & 4 /* Return */) { + rangeFacts |= RangeFacts.HasReturn; + } + else { + (errors || (errors = [])).push(ts.createDiagnosticForNode(node, Messages.CannotExtractRangeContainingConditionalReturnStatement)); + } + break; + default: + ts.forEachChild(node, visit); + break; + } + permittedJumps = savedPermittedJumps; + } + } } - if (!newClassDeclaration) { - return undefined; + extractMethod_1.getRangeToExtract = getRangeToExtract; + function isValidExtractionTarget(node) { + // Note that we don't use isFunctionLike because we don't want to put the extracted closure *inside* a method + return (node.kind === 228 /* FunctionDeclaration */) || ts.isSourceFile(node) || ts.isModuleBlock(node) || ts.isClassLike(node); } - // Because the preceding node could be touched, we need to insert nodes before delete nodes. - changeTracker.insertNodeAfter(sourceFile, precedingNode, newClassDeclaration, { suffix: newLine }); - for (var _i = 0, deletes_1 = deletes; _i < deletes_1.length; _i++) { - var deleteCallback = deletes_1[_i]; - deleteCallback(); + /** + * Computes possible places we could extract the function into. For example, + * you may be able to extract into a class method *or* local closure *or* namespace function, + * depending on what's in the extracted body. + */ + function collectEnclosingScopes(range) { + var current = isReadonlyArray(range.range) ? ts.firstOrUndefined(range.range) : range.range; + if (range.facts & RangeFacts.UsesThis) { + // if range uses this as keyword or as type inside the class then it can only be extracted to a method of the containing class + var containingClass = ts.getContainingClass(current); + if (containingClass) { + return [containingClass]; + } + } + var start = current; + var scopes = undefined; + while (current) { + // We want to find the nearest parent where we can place an "equivalent" sibling to the node we're extracting out of. + // Walk up to the closest parent of a place where we can logically put a sibling: + // * Function declaration + // * Class declaration or expression + // * Module/namespace or source file + if (current !== start && isValidExtractionTarget(current)) { + (scopes = scopes || []).push(current); + } + // A function parameter's initializer is actually in the outer scope, not the function declaration + if (current && current.parent && current.parent.kind === 146 /* Parameter */) { + // Skip all the way to the outer scope of the function that declared this parameter + current = ts.findAncestor(current, function (parent) { return ts.isFunctionLike(parent); }).parent; + } + else { + current = current.parent; + } + } + return scopes; } - return { - edits: changeTracker.getChanges() - }; - function deleteNode(node, inList) { - if (inList === void 0) { inList = false; } - if (deletedNodes.some(function (n) { return ts.isNodeDescendantOf(node, n); })) { - // Parent node has already been deleted; do nothing - return; + extractMethod_1.collectEnclosingScopes = collectEnclosingScopes; + /** + * Given a piece of text to extract ('targetRange'), computes a list of possible extractions. + * Each returned ExtractResultForScope corresponds to a possible target scope and is either a set of changes + * or an error explaining why we can't extract into that scope. + */ + function getPossibleExtractions(targetRange, context, requestedChangesIndex) { + if (requestedChangesIndex === void 0) { requestedChangesIndex = undefined; } + var sourceFile = context.file; + if (targetRange === undefined) { + return undefined; + } + var scopes = collectEnclosingScopes(targetRange); + if (scopes === undefined) { + return undefined; + } + var enclosingTextRange = getEnclosingTextRange(targetRange, sourceFile); + var _a = collectReadsAndWrites(targetRange, scopes, enclosingTextRange, sourceFile, context.program.getTypeChecker()), target = _a.target, usagesPerScope = _a.usagesPerScope, errorsPerScope = _a.errorsPerScope; + context.cancellationToken.throwIfCancellationRequested(); + if (requestedChangesIndex !== undefined) { + if (errorsPerScope[requestedChangesIndex].length) { + return undefined; + } + return [extractFunctionInScope(target, scopes[requestedChangesIndex], usagesPerScope[requestedChangesIndex], targetRange, context)]; + } + else { + return scopes.map(function (scope, i) { + var errors = errorsPerScope[i]; + if (errors.length) { + return { + scope: scope, + scopeDescription: getDescriptionForScope(scope), + errors: errors + }; + } + return { scope: scope, scopeDescription: getDescriptionForScope(scope) }; + }); } - deletedNodes.push(node); - if (inList) { - deletes.push(function () { return changeTracker.deleteNodeInList(sourceFile, node); }); + } + extractMethod_1.getPossibleExtractions = getPossibleExtractions; + function getDescriptionForScope(scope) { + if (ts.isFunctionLike(scope)) { + switch (scope.kind) { + case 152 /* Constructor */: + return "constructor"; + case 186 /* FunctionExpression */: + return scope.name + ? "function expression " + scope.name.getText() + : "anonymous function expression"; + case 228 /* FunctionDeclaration */: + return "function " + scope.name.getText(); + case 187 /* ArrowFunction */: + return "arrow function"; + case 151 /* MethodDeclaration */: + return "method " + scope.name.getText(); + case 153 /* GetAccessor */: + return "get " + scope.name.getText(); + case 154 /* SetAccessor */: + return "set " + scope.name.getText(); + } + } + else if (ts.isModuleBlock(scope)) { + return "namespace " + scope.parent.name.getText(); + } + else if (ts.isClassLike(scope)) { + return scope.kind === 229 /* ClassDeclaration */ + ? "class " + scope.name.text + : scope.name.text + ? "class expression " + scope.name.text + : "anonymous class expression"; + } + else if (ts.isSourceFile(scope)) { + return "file '" + scope.fileName + "'"; } else { - deletes.push(function () { return changeTracker.deleteNode(sourceFile, node); }); + return "unknown"; } } - function createClassElementsFromSymbol(symbol) { - var memberElements = []; - // all instance members are stored in the "member" array of symbol - if (symbol.members) { - symbol.members.forEach(function (member) { - var memberElement = createClassElement(member, /*modifiers*/ undefined); - if (memberElement) { - memberElements.push(memberElement); + function getUniqueName(isNameOkay) { + var functionNameText = "newFunction"; + if (isNameOkay(functionNameText)) { + return functionNameText; + } + var i = 1; + while (!isNameOkay(functionNameText = "newFunction_" + i)) { + i++; + } + return functionNameText; + } + function extractFunctionInScope(node, scope, _a, range, context) { + var usagesInScope = _a.usages, substitutions = _a.substitutions; + var checker = context.program.getTypeChecker(); + // Make a unique name for the extracted function + var file = scope.getSourceFile(); + var functionNameText = getUniqueName(function (n) { return !file.identifiers.has(n); }); + var isJS = ts.isInJavaScriptFile(scope); + var functionName = ts.createIdentifier(functionNameText); + var functionReference = ts.createIdentifier(functionNameText); + var returnType = undefined; + var parameters = []; + var callArguments = []; + var writes; + usagesInScope.forEach(function (usage, name) { + var typeNode = undefined; + if (!isJS) { + var type = checker.getTypeOfSymbolAtLocation(usage.symbol, usage.node); + // Widen the type so we don't emit nonsense annotations like "function fn(x: 3) {" + type = checker.getBaseTypeOfLiteralType(type); + typeNode = checker.typeToTypeNode(type, node, ts.NodeBuilderFlags.NoTruncation); + } + var paramDecl = ts.createParameter( + /*decorators*/ undefined, + /*modifiers*/ undefined, + /*dotDotDotToken*/ undefined, + /*name*/ name, + /*questionToken*/ undefined, typeNode); + parameters.push(paramDecl); + if (usage.usage === 2 /* Write */) { + (writes || (writes = [])).push(usage); + } + callArguments.push(ts.createIdentifier(name)); + }); + // Provide explicit return types for contexutally-typed functions + // to avoid problems when there are literal types present + if (ts.isExpression(node) && !isJS) { + var contextualType = checker.getContextualType(node); + returnType = checker.typeToTypeNode(contextualType); + } + var _b = transformFunctionBody(node), body = _b.body, returnValueProperty = _b.returnValueProperty; + var newFunction; + if (ts.isClassLike(scope)) { + // always create private method in TypeScript files + var modifiers = isJS ? [] : [ts.createToken(112 /* PrivateKeyword */)]; + if (range.facts & RangeFacts.InStaticRegion) { + modifiers.push(ts.createToken(115 /* StaticKeyword */)); + } + if (range.facts & RangeFacts.IsAsyncFunction) { + modifiers.push(ts.createToken(120 /* AsyncKeyword */)); + } + newFunction = ts.createMethod( + /*decorators*/ undefined, modifiers, range.facts & RangeFacts.IsGenerator ? ts.createToken(39 /* AsteriskToken */) : undefined, functionName, + /*questionToken*/ undefined, + /*typeParameters*/ [], parameters, returnType, body); + } + else { + newFunction = ts.createFunctionDeclaration( + /*decorators*/ undefined, range.facts & RangeFacts.IsAsyncFunction ? [ts.createToken(120 /* AsyncKeyword */)] : undefined, range.facts & RangeFacts.IsGenerator ? ts.createToken(39 /* AsteriskToken */) : undefined, functionName, + /*typeParameters*/ [], parameters, returnType, body); + } + var changeTracker = ts.textChanges.ChangeTracker.fromCodeFixContext(context); + // insert function at the end of the scope + changeTracker.insertNodeBefore(context.file, scope.getLastToken(), newFunction, { prefix: context.newLineCharacter, suffix: context.newLineCharacter }); + var newNodes = []; + // replace range with function call + var call = ts.createCall(ts.isClassLike(scope) ? ts.createPropertyAccess(range.facts & RangeFacts.InStaticRegion ? ts.createIdentifier(scope.name.getText()) : ts.createThis(), functionReference) : functionReference, + /*typeArguments*/ undefined, callArguments); + if (range.facts & RangeFacts.IsGenerator) { + call = ts.createYield(ts.createToken(39 /* AsteriskToken */), call); + } + if (range.facts & RangeFacts.IsAsyncFunction) { + call = ts.createAwait(call); + } + if (writes) { + if (returnValueProperty) { + // has both writes and return, need to create variable declaration to hold return value; + newNodes.push(ts.createVariableStatement( + /*modifiers*/ undefined, [ts.createVariableDeclaration(returnValueProperty, ts.createKeywordTypeNode(119 /* AnyKeyword */))])); + } + var assignments = getPropertyAssignmentsForWrites(writes); + if (returnValueProperty) { + assignments.unshift(ts.createShorthandPropertyAssignment(returnValueProperty)); + } + // propagate writes back + if (assignments.length === 1) { + if (returnValueProperty) { + newNodes.push(ts.createReturn(ts.createIdentifier(returnValueProperty))); + } + else { + newNodes.push(ts.createStatement(ts.createBinary(assignments[0].name, 58 /* EqualsToken */, call))); } + } + else { + // emit e.g. + // { a, b, __return } = newFunction(a, b); + // return __return; + newNodes.push(ts.createStatement(ts.createBinary(ts.createObjectLiteral(assignments), 58 /* EqualsToken */, call))); + if (returnValueProperty) { + newNodes.push(ts.createReturn(ts.createIdentifier(returnValueProperty))); + } + } + } + else { + if (range.facts & RangeFacts.HasReturn) { + newNodes.push(ts.createReturn(call)); + } + else if (isReadonlyArray(range.range)) { + newNodes.push(ts.createStatement(call)); + } + else { + newNodes.push(call); + } + } + if (isReadonlyArray(range.range)) { + changeTracker.replaceNodesWithNodes(context.file, range.range, newNodes, { + nodeSeparator: context.newLineCharacter, + suffix: context.newLineCharacter // insert newline only when replacing statements }); } - // all static members are stored in the "exports" array of symbol - if (symbol.exports) { - symbol.exports.forEach(function (member) { - var memberElement = createClassElement(member, [ts.createToken(115 /* StaticKeyword */)]); - if (memberElement) { - memberElements.push(memberElement); + else { + changeTracker.replaceNodeWithNodes(context.file, range.range, newNodes, { nodeSeparator: context.newLineCharacter }); + } + return { + scope: scope, + scopeDescription: getDescriptionForScope(scope), + changes: changeTracker.getChanges() + }; + function getPropertyAssignmentsForWrites(writes) { + return writes.map(function (w) { return ts.createShorthandPropertyAssignment(w.symbol.name); }); + } + function generateReturnValueProperty() { + return "__return"; + } + function transformFunctionBody(body) { + if (ts.isBlock(body) && !writes && substitutions.size === 0) { + // already block, no writes to propagate back, no substitutions - can use node as is + return { body: ts.createBlock(body.statements, /*multLine*/ true), returnValueProperty: undefined }; + } + var returnValueProperty; + var statements = ts.createNodeArray(ts.isBlock(body) ? body.statements.slice(0) : [ts.isStatement(body) ? body : ts.createReturn(body)]); + // rewrite body if either there are writes that should be propagated back via return statements or there are substitutions + if (writes || substitutions.size) { + var rewrittenStatements = ts.visitNodes(statements, visitor).slice(); + if (writes && !(range.facts & RangeFacts.HasReturn) && ts.isStatement(body)) { + // add return at the end to propagate writes back in case if control flow falls out of the function body + // it is ok to know that range has at least one return since it we only allow unconditional returns + var assignments = getPropertyAssignmentsForWrites(writes); + if (assignments.length === 1) { + rewrittenStatements.push(ts.createReturn(assignments[0].name)); + } + else { + rewrittenStatements.push(ts.createReturn(ts.createObjectLiteral(assignments))); + } + } + return { body: ts.createBlock(rewrittenStatements, /*multiLine*/ true), returnValueProperty: returnValueProperty }; + } + else { + return { body: ts.createBlock(statements, /*multiLine*/ true), returnValueProperty: undefined }; + } + function visitor(node) { + if (node.kind === 219 /* ReturnStatement */ && writes) { + var assignments = getPropertyAssignmentsForWrites(writes); + if (node.expression) { + if (!returnValueProperty) { + returnValueProperty = generateReturnValueProperty(); + } + assignments.unshift(ts.createPropertyAssignment(returnValueProperty, ts.visitNode(node.expression, visitor))); + } + if (assignments.length === 1) { + return ts.createReturn(assignments[0].name); + } + else { + return ts.createReturn(ts.createObjectLiteral(assignments)); + } + } + else { + var substitution = substitutions.get(ts.getNodeId(node).toString()); + return substitution || ts.visitEachChild(node, visitor, ts.nullTransformationContext); + } + } + } + } + extractMethod_1.extractFunctionInScope = extractFunctionInScope; + function isReadonlyArray(v) { + return ts.isArray(v); + } + /** + * Produces a range that spans the entirety of nodes, given a selection + * that might start/end in the middle of nodes. + * + * For example, when the user makes a selection like this + * v---v + * var someThing = foo + bar; + * this returns ^-------^ + */ + function getEnclosingTextRange(targetRange, sourceFile) { + return isReadonlyArray(targetRange.range) + ? { pos: targetRange.range[0].getStart(sourceFile), end: targetRange.range[targetRange.range.length - 1].getEnd() } + : targetRange.range; + } + var Usage; + (function (Usage) { + // value should be passed to extracted method + Usage[Usage["Read"] = 1] = "Read"; + // value should be passed to extracted method and propagated back + Usage[Usage["Write"] = 2] = "Write"; + })(Usage || (Usage = {})); + function collectReadsAndWrites(targetRange, scopes, enclosingTextRange, sourceFile, checker) { + var usagesPerScope = []; + var substitutionsPerScope = []; + var errorsPerScope = []; + var visibleDeclarationsInExtractedRange = []; + // initialize results + for (var _i = 0, scopes_1 = scopes; _i < scopes_1.length; _i++) { + var _ = scopes_1[_i]; + usagesPerScope.push({ usages: ts.createMap(), substitutions: ts.createMap() }); + substitutionsPerScope.push(ts.createMap()); + errorsPerScope.push([]); + } + var seenUsages = ts.createMap(); + var target = isReadonlyArray(targetRange.range) ? ts.createBlock(targetRange.range) : targetRange.range; + var containingLexicalScopeOfExtraction = ts.isBlockScope(scopes[0], scopes[0].parent) ? scopes[0] : ts.getEnclosingBlockScopeContainer(scopes[0]); + collectUsages(target); + var _loop_8 = function (i) { + var hasWrite = false; + var readonlyClassPropertyWrite = undefined; + usagesPerScope[i].usages.forEach(function (value) { + if (value.usage === 2 /* Write */) { + hasWrite = true; + if (value.symbol.flags & 106500 /* ClassMember */ && + value.symbol.valueDeclaration && + ts.hasModifier(value.symbol.valueDeclaration, 64 /* Readonly */)) { + readonlyClassPropertyWrite = value.symbol.valueDeclaration; + } } }); + if (hasWrite && !isReadonlyArray(targetRange.range) && ts.isExpression(targetRange.range)) { + errorsPerScope[i].push(ts.createDiagnosticForNode(targetRange.range, Messages.CannotCombineWritesAndReturns)); + } + else if (readonlyClassPropertyWrite && i > 0) { + errorsPerScope[i].push(ts.createDiagnosticForNode(readonlyClassPropertyWrite, Messages.CannotCombineWritesAndReturns)); + } + }; + for (var i = 0; i < scopes.length; i++) { + _loop_8(i); + } + // If there are any declarations in the extracted block that are used in the same enclosing + // lexical scope, we can't move the extraction "up" as those declarations will become unreachable + if (visibleDeclarationsInExtractedRange.length) { + ts.forEachChild(containingLexicalScopeOfExtraction, checkForUsedDeclarations); + } + return { target: target, usagesPerScope: usagesPerScope, errorsPerScope: errorsPerScope }; + function collectUsages(node, valueUsage) { + if (valueUsage === void 0) { valueUsage = 1 /* Read */; } + if (ts.isDeclaration(node) && node.symbol) { + visibleDeclarationsInExtractedRange.push(node.symbol); + } + if (ts.isAssignmentExpression(node)) { + // use 'write' as default usage for values + collectUsages(node.left, 2 /* Write */); + collectUsages(node.right); + } + else if (ts.isUnaryExpressionWithWrite(node)) { + collectUsages(node.operand, 2 /* Write */); + } + else if (ts.isPropertyAccessExpression(node) || ts.isElementAccessExpression(node)) { + // use 'write' as default usage for values + ts.forEachChild(node, collectUsages); + } + else if (ts.isIdentifier(node)) { + if (!node.parent) { + return; + } + if (ts.isQualifiedName(node.parent) && node !== node.parent.left) { + return; + } + if (ts.isPropertyAccessExpression(node.parent) && node !== node.parent.expression) { + return; + } + recordUsage(node, valueUsage, /*isTypeNode*/ ts.isPartOfTypeNode(node)); + } + else { + ts.forEachChild(node, collectUsages); + } } - return memberElements; - function shouldConvertDeclaration(_target, source) { - // Right now the only thing we can convert are function expressions - other values shouldn't get - // transformed. We can update this once ES public class properties are available. - return ts.isFunctionLike(source); + function recordUsage(n, usage, isTypeNode) { + var symbolId = recordUsagebySymbol(n, usage, isTypeNode); + if (symbolId) { + for (var i = 0; i < scopes.length; i++) { + // push substitution from map to map to simplify rewriting + var substitition = substitutionsPerScope[i].get(symbolId); + if (substitition) { + usagesPerScope[i].substitutions.set(ts.getNodeId(n).toString(), substitition); + } + } + } } - function createClassElement(symbol, modifiers) { - // both properties and methods are bound as property symbols - if (!(symbol.flags & 4 /* Property */)) { - return; + function recordUsagebySymbol(identifier, usage, isTypeName) { + var symbol = checker.getSymbolAtLocation(identifier); + if (!symbol) { + // cannot find symbol - do nothing + return undefined; } - var memberDeclaration = symbol.valueDeclaration; - var assignmentBinaryExpression = memberDeclaration.parent; - if (!shouldConvertDeclaration(memberDeclaration, assignmentBinaryExpression.right)) { - return; + var symbolId = ts.getSymbolId(symbol).toString(); + var lastUsage = seenUsages.get(symbolId); + // there are two kinds of value usages + // - reads - if range contains a read from the value located outside of the range then value should be passed as a parameter + // - writes - if range contains a write to a value located outside the range the value should be passed as a parameter and + // returned as a return value + // 'write' case is a superset of 'read' so if we already have processed 'write' of some symbol there is not need to handle 'read' + // since all information is already recorded + if (lastUsage && lastUsage >= usage) { + return symbolId; + } + seenUsages.set(symbolId, usage); + if (lastUsage) { + // if we get here this means that we are trying to handle 'write' and 'read' was already processed + // walk scopes and update existing records. + for (var _i = 0, usagesPerScope_1 = usagesPerScope; _i < usagesPerScope_1.length; _i++) { + var perScope = usagesPerScope_1[_i]; + var prevEntry = perScope.usages.get(identifier.text); + if (prevEntry) { + perScope.usages.set(identifier.text, { usage: usage, symbol: symbol, node: identifier }); + } + } + return symbolId; + } + // find first declaration in this file + var declInFile = ts.find(symbol.getDeclarations(), function (d) { return d.getSourceFile() === sourceFile; }); + if (!declInFile) { + return undefined; + } + if (ts.rangeContainsRange(enclosingTextRange, declInFile)) { + // declaration is located in range to be extracted - do nothing + return undefined; } - // delete the entire statement if this expression is the sole expression to take care of the semicolon at the end - var nodeToDelete = assignmentBinaryExpression.parent && assignmentBinaryExpression.parent.kind === 210 /* ExpressionStatement */ - ? assignmentBinaryExpression.parent : assignmentBinaryExpression; - deleteNode(nodeToDelete); - if (!assignmentBinaryExpression.right) { - return ts.createProperty([], modifiers, symbol.name, /*questionToken*/ undefined, - /*type*/ undefined, /*initializer*/ undefined); - } - switch (assignmentBinaryExpression.right.kind) { - case 186 /* FunctionExpression */: { - var functionExpression = assignmentBinaryExpression.right; - var method = ts.createMethod(/*decorators*/ undefined, modifiers, /*asteriskToken*/ undefined, memberDeclaration.name, /*questionToken*/ undefined, - /*typeParameters*/ undefined, functionExpression.parameters, /*type*/ undefined, functionExpression.body); - copyComments(assignmentBinaryExpression, method); - return method; - } - case 187 /* ArrowFunction */: { - var arrowFunction = assignmentBinaryExpression.right; - var arrowFunctionBody = arrowFunction.body; - var bodyBlock = void 0; - // case 1: () => { return [1,2,3] } - if (arrowFunctionBody.kind === 207 /* Block */) { - bodyBlock = arrowFunctionBody; + if (targetRange.facts & RangeFacts.IsGenerator && usage === 2 /* Write */) { + // this is write to a reference located outside of the target scope and range is extracted into generator + // currently this is unsupported scenario + for (var _a = 0, errorsPerScope_1 = errorsPerScope; _a < errorsPerScope_1.length; _a++) { + var errors = errorsPerScope_1[_a]; + errors.push(ts.createDiagnosticForNode(identifier, Messages.CannotExtractRangeThatContainsWritesToReferencesLocatedOutsideOfTheTargetRangeInGenerators)); + } + } + for (var i = 0; i < scopes.length; i++) { + var scope = scopes[i]; + var resolvedSymbol = checker.resolveName(symbol.name, scope, symbol.flags); + if (resolvedSymbol === symbol) { + continue; + } + if (!substitutionsPerScope[i].has(symbolId)) { + var substitution = tryReplaceWithQualifiedNameOrPropertyAccess(symbol.exportSymbol || symbol, scope, isTypeName); + if (substitution) { + substitutionsPerScope[i].set(symbolId, substitution); } - else { - var expression = arrowFunctionBody; - bodyBlock = ts.createBlock([ts.createReturn(expression)]); + else if (isTypeName) { + errorsPerScope[i].push(ts.createDiagnosticForNode(identifier, Messages.TypeWillNotBeVisibleInTheNewScope)); } - var method = ts.createMethod(/*decorators*/ undefined, modifiers, /*asteriskToken*/ undefined, memberDeclaration.name, /*questionToken*/ undefined, - /*typeParameters*/ undefined, arrowFunction.parameters, /*type*/ undefined, bodyBlock); - copyComments(assignmentBinaryExpression, method); - return method; - } - default: { - // Don't try to declare members in JavaScript files - if (ts.isSourceFileJavaScript(sourceFile)) { - return; + else { + usagesPerScope[i].usages.set(identifier.text, { usage: usage, symbol: symbol, node: identifier }); } - var prop = ts.createProperty(/*decorators*/ undefined, modifiers, memberDeclaration.name, /*questionToken*/ undefined, - /*type*/ undefined, assignmentBinaryExpression.right); - copyComments(assignmentBinaryExpression.parent, prop); - return prop; } } + return symbolId; } - } - function copyComments(sourceNode, targetNode) { - ts.forEachLeadingCommentRange(sourceFile.text, sourceNode.pos, function (pos, end, kind, htnl) { - if (kind === 3 /* MultiLineCommentTrivia */) { - // Remove leading /* - pos += 2; - // Remove trailing */ - end -= 2; + function checkForUsedDeclarations(node) { + // If this node is entirely within the original extraction range, we don't need to do anything. + if (node === targetRange.range || (isReadonlyArray(targetRange.range) && targetRange.range.indexOf(node) >= 0)) { + return; + } + // Otherwise check and recurse. + var sym = checker.getSymbolAtLocation(node); + if (sym && visibleDeclarationsInExtractedRange.some(function (d) { return d === sym; })) { + for (var _i = 0, errorsPerScope_2 = errorsPerScope; _i < errorsPerScope_2.length; _i++) { + var scope = errorsPerScope_2[_i]; + scope.push(ts.createDiagnosticForNode(node, Messages.CannotExtractExportedEntity)); + } + return true; } else { - // Remove leading // - pos += 2; + ts.forEachChild(node, checkForUsedDeclarations); } - ts.addSyntheticLeadingComment(targetNode, kind, sourceFile.text.slice(pos, end), htnl); - }); + } + function tryReplaceWithQualifiedNameOrPropertyAccess(symbol, scopeDecl, isTypeNode) { + if (!symbol) { + return undefined; + } + if (symbol.getDeclarations().some(function (d) { return d.parent === scopeDecl; })) { + return ts.createIdentifier(symbol.name); + } + var prefix = tryReplaceWithQualifiedNameOrPropertyAccess(symbol.parent, scopeDecl, isTypeNode); + if (prefix === undefined) { + return undefined; + } + return isTypeNode ? ts.createQualifiedName(prefix, ts.createIdentifier(symbol.name)) : ts.createPropertyAccess(prefix, symbol.name); + } } - function createClassFromVariableDeclaration(node) { - var initializer = node.initializer; - if (!initializer || initializer.kind !== 186 /* FunctionExpression */) { + function getParentNodeInSpan(node, file, span) { + if (!node) return undefined; + while (node.parent) { + if (ts.isSourceFile(node.parent) || !spanContainsNode(span, node.parent, file)) { + return node; + } + node = node.parent; } - if (node.name.kind !== 71 /* Identifier */) { - return undefined; + } + function spanContainsNode(span, node, file) { + return ts.textSpanContainsPosition(span, node.getStart(file)) && + node.getEnd() <= ts.textSpanEnd(span); + } + /** + * Computes whether or not a node represents an expression in a position where it could + * be extracted. + * The isExpression() in utilities.ts returns some false positives we need to handle, + * such as `import x from 'y'` -- the 'y' is a StringLiteral but is *not* an expression + * in the sense of something that you could extract on + */ + function isExtractableExpression(node) { + switch (node.parent.kind) { + case 264 /* EnumMember */: + return false; } - var memberElements = createClassElementsFromSymbol(initializer.symbol); - if (initializer.body) { - memberElements.unshift(ts.createConstructor(/*decorators*/ undefined, /*modifiers*/ undefined, initializer.parameters, initializer.body)); + switch (node.kind) { + case 9 /* StringLiteral */: + return node.parent.kind !== 238 /* ImportDeclaration */ && + node.parent.kind !== 242 /* ImportSpecifier */; + case 198 /* SpreadElement */: + case 174 /* ObjectBindingPattern */: + case 176 /* BindingElement */: + return false; + case 71 /* Identifier */: + return node.parent.kind !== 176 /* BindingElement */ && + node.parent.kind !== 242 /* ImportSpecifier */ && + node.parent.kind !== 246 /* ExportSpecifier */; } - var cls = ts.createClassDeclaration(/*decorators*/ undefined, /*modifiers*/ undefined, node.name, - /*typeParameters*/ undefined, /*heritageClauses*/ undefined, memberElements); - // Don't call copyComments here because we'll already leave them in place - return cls; + return true; } - function createClassFromFunctionDeclaration(node) { - var memberElements = createClassElementsFromSymbol(ctorSymbol); - if (node.body) { - memberElements.unshift(ts.createConstructor(/*decorators*/ undefined, /*modifiers*/ undefined, node.parameters, node.body)); + function isBlockLike(node) { + switch (node.kind) { + case 207 /* Block */: + case 265 /* SourceFile */: + case 234 /* ModuleBlock */: + case 257 /* CaseClause */: + return true; + default: + return false; } - var cls = ts.createClassDeclaration(/*decorators*/ undefined, /*modifiers*/ undefined, node.name, - /*typeParameters*/ undefined, /*heritageClauses*/ undefined, memberElements); - // Don't call copyComments here because we'll already leave them in place - return cls; } - } + })(extractMethod = refactor.extractMethod || (refactor.extractMethod = {})); })(refactor = ts.refactor || (ts.refactor = {})); })(ts || (ts = {})); /// +/// /// /// /// @@ -89074,7 +90729,7 @@ var ts; node.parent = parent; return node; } - var NodeObject = (function () { + var NodeObject = /** @class */ (function () { function NodeObject(kind, pos, end) { this.pos = pos; this.end = end; @@ -89117,12 +90772,14 @@ var ts; ts.scanner.setTextPos(pos); while (pos < end) { var token = ts.scanner.scan(); - ts.Debug.assert(token !== 1 /* EndOfFileToken */); // Else it would infinitely loop var textPos = ts.scanner.getTextPos(); if (textPos <= end) { nodes.push(createNode(token, pos, textPos, this)); } pos = textPos; + if (token === 1 /* EndOfFileToken */) { + break; + } } return pos; }; @@ -89227,7 +90884,7 @@ var ts; }; return NodeObject; }()); - var TokenOrIdentifierObject = (function () { + var TokenOrIdentifierObject = /** @class */ (function () { function TokenOrIdentifierObject(pos, end) { // Set properties in same order as NodeObject this.pos = pos; @@ -89282,7 +90939,7 @@ var ts; }; return TokenOrIdentifierObject; }()); - var SymbolObject = (function () { + var SymbolObject = /** @class */ (function () { function SymbolObject(flags, name) { this.flags = flags; this.escapedName = name; @@ -89320,7 +90977,7 @@ var ts; }; return SymbolObject; }()); - var TokenObject = (function (_super) { + var TokenObject = /** @class */ (function (_super) { __extends(TokenObject, _super); function TokenObject(kind, pos, end) { var _this = _super.call(this, pos, end) || this; @@ -89329,7 +90986,7 @@ var ts; } return TokenObject; }(TokenOrIdentifierObject)); - var IdentifierObject = (function (_super) { + var IdentifierObject = /** @class */ (function (_super) { __extends(IdentifierObject, _super); function IdentifierObject(_kind, pos, end) { return _super.call(this, pos, end) || this; @@ -89344,7 +91001,7 @@ var ts; return IdentifierObject; }(TokenOrIdentifierObject)); IdentifierObject.prototype.kind = 71 /* Identifier */; - var TypeObject = (function () { + var TypeObject = /** @class */ (function () { function TypeObject(checker, flags) { this.checker = checker; this.flags = flags; @@ -89386,7 +91043,7 @@ var ts; }; return TypeObject; }()); - var SignatureObject = (function () { + var SignatureObject = /** @class */ (function () { function SignatureObject(checker) { this.checker = checker; } @@ -89416,7 +91073,7 @@ var ts; }; return SignatureObject; }()); - var SourceFileObject = (function (_super) { + var SourceFileObject = /** @class */ (function (_super) { __extends(SourceFileObject, _super); function SourceFileObject(kind, pos, end) { return _super.call(this, kind, pos, end) || this; @@ -89587,7 +91244,7 @@ var ts; }; return SourceFileObject; }(NodeObject)); - var SourceMapSourceObject = (function () { + var SourceMapSourceObject = /** @class */ (function () { function SourceMapSourceObject(fileName, text, skipTrivia) { this.fileName = fileName; this.text = text; @@ -89656,7 +91313,7 @@ var ts; // Cache host information about script Should be refreshed // at each language service public entry point, since we don't know when // the set of scripts handled by the host changes. - var HostCache = (function () { + var HostCache = /** @class */ (function () { function HostCache(host, getCanonicalFileName) { this.host = host; // script id => script index @@ -89718,7 +91375,7 @@ var ts; }; return HostCache; }()); - var SyntaxTreeCache = (function () { + var SyntaxTreeCache = /** @class */ (function () { function SyntaxTreeCache(host) { this.host = host; } @@ -89813,7 +91470,7 @@ var ts; return createLanguageServiceSourceFile(sourceFile.fileName, scriptSnapshot, sourceFile.languageVersion, version, /*setNodeParents*/ true, sourceFile.scriptKind); } ts.updateLanguageServiceSourceFile = updateLanguageServiceSourceFile; - var CancellationTokenObject = (function () { + var CancellationTokenObject = /** @class */ (function () { function CancellationTokenObject(cancellationToken) { this.cancellationToken = cancellationToken; } @@ -89829,7 +91486,7 @@ var ts; }()); /* @internal */ /** A cancellation that throttles calls to the host */ - var ThrottledCancellationToken = (function () { + var ThrottledCancellationToken = /** @class */ (function () { function ThrottledCancellationToken(hostCancellationToken, throttleWaitMilliseconds) { if (throttleWaitMilliseconds === void 0) { throttleWaitMilliseconds = 20; } this.hostCancellationToken = hostCancellationToken; @@ -89980,8 +91637,8 @@ var ts; if (program) { var oldSourceFiles = program.getSourceFiles(); var oldSettingsKey = documentRegistry.getKeyForCompilationSettings(oldSettings); - for (var _i = 0, oldSourceFiles_1 = oldSourceFiles; _i < oldSourceFiles_1.length; _i++) { - var oldSourceFile = oldSourceFiles_1[_i]; + for (var _i = 0, oldSourceFiles_2 = oldSourceFiles; _i < oldSourceFiles_2.length; _i++) { + var oldSourceFile = oldSourceFiles_2[_i]; if (!newProgram.getSourceFile(oldSourceFile.fileName) || shouldCreateNewSourceFiles) { documentRegistry.releaseDocumentWithKey(oldSourceFile.path, oldSettingsKey); } @@ -90038,7 +91695,7 @@ var ts; // We do not support the scenario where a host can modify a registered // file's script kind, i.e. in one project some file is treated as ".ts" // and in another as ".js" - ts.Debug.assert(hostFileInformation.scriptKind === oldSourceFile.scriptKind, "Registered script kind (" + oldSourceFile.scriptKind + ") should match new script kind (" + hostFileInformation.scriptKind + ") for file: " + path); + ts.Debug.assertEqual(hostFileInformation.scriptKind, oldSourceFile.scriptKind, "Registered script kind should match new script kind.", path); return documentRegistry.updateDocumentWithKey(fileName, path, newSettings, documentRegistryBucketKey, hostFileInformation.scriptSnapshot, hostFileInformation.version, hostFileInformation.scriptKind); } // We didn't already have the file. Fall through and acquire it from the registry. @@ -90447,17 +92104,19 @@ var ts; function getFormattingEditsAfterKeystroke(fileName, position, key, options) { var sourceFile = syntaxTreeCache.getCurrentSourceFile(fileName); var settings = toEditorSettings(options); - if (key === "{") { - return ts.formatting.formatOnOpeningCurly(position, sourceFile, getRuleProvider(settings), settings); - } - else if (key === "}") { - return ts.formatting.formatOnClosingCurly(position, sourceFile, getRuleProvider(settings), settings); - } - else if (key === ";") { - return ts.formatting.formatOnSemicolon(position, sourceFile, getRuleProvider(settings), settings); - } - else if (key === "\n") { - return ts.formatting.formatOnEnter(position, sourceFile, getRuleProvider(settings), settings); + if (!ts.isInComment(sourceFile, position)) { + if (key === "{") { + return ts.formatting.formatOnOpeningCurly(position, sourceFile, getRuleProvider(settings), settings); + } + else if (key === "}") { + return ts.formatting.formatOnClosingCurly(position, sourceFile, getRuleProvider(settings), settings); + } + else if (key === ";") { + return ts.formatting.formatOnSemicolon(position, sourceFile, getRuleProvider(settings), settings); + } + else if (key === "\n") { + return ts.formatting.formatOnEnter(position, sourceFile, getRuleProvider(settings), settings); + } } return []; } @@ -90504,6 +92163,11 @@ var ts; } return true; } + function getSpanOfEnclosingComment(fileName, position, onlyMultiLine) { + var sourceFile = syntaxTreeCache.getCurrentSourceFile(fileName); + var range = ts.formatting.getRangeOfEnclosingComment(sourceFile, position, onlyMultiLine); + return range && ts.createTextSpanFromRange(range); + } function getTodoComments(fileName, descriptors) { // Note: while getting todo comments seems like a syntactic operation, we actually // treat it as a semantic operation here. This is because we expect our host to call @@ -90693,6 +92357,7 @@ var ts; getFormattingEditsAfterKeystroke: getFormattingEditsAfterKeystroke, getDocCommentTemplateAtPosition: getDocCommentTemplateAtPosition, isValidBraceCompletionAtPosition: isValidBraceCompletionAtPosition, + getSpanOfEnclosingComment: getSpanOfEnclosingComment, getCodeFixesAtPosition: getCodeFixesAtPosition, getEmitOutput: getEmitOutput, getNonBoundSourceFile: getNonBoundSourceFile, @@ -90777,12 +92442,17 @@ var ts; function getPropertySymbolsFromContextualType(typeChecker, node) { var objectLiteral = node.parent; var contextualType = typeChecker.getContextualType(objectLiteral); - var name = ts.unescapeLeadingUnderscores(ts.getTextOfPropertyName(node.name)); - if (name && contextualType) { + return getPropertySymbolsFromType(contextualType, node.name); + } + ts.getPropertySymbolsFromContextualType = getPropertySymbolsFromContextualType; + /* @internal */ + function getPropertySymbolsFromType(type, propName) { + var name = ts.unescapeLeadingUnderscores(ts.getTextOfPropertyName(propName)); + if (name && type) { var result_10 = []; - var symbol = contextualType.getProperty(name); - if (contextualType.flags & 65536 /* Union */) { - ts.forEach(contextualType.types, function (t) { + var symbol = type.getProperty(name); + if (type.flags & 65536 /* Union */) { + ts.forEach(type.types, function (t) { var symbol = t.getProperty(name); if (symbol) { result_10.push(symbol); @@ -90797,7 +92467,7 @@ var ts; } return undefined; } - ts.getPropertySymbolsFromContextualType = getPropertySymbolsFromContextualType; + ts.getPropertySymbolsFromType = getPropertySymbolsFromType; function isArgumentOfElementAccessExpression(node) { return node && node.parent && @@ -91352,7 +93022,7 @@ var ts; } } function spanInOpenParenToken(node) { - if (node.parent.kind === 212 /* DoStatement */ || + if (node.parent.kind === 212 /* DoStatement */ || // Go to while keyword and do action instead node.parent.kind === 181 /* CallExpression */ || node.parent.kind === 182 /* NewExpression */) { return spanInPreviousNode(node); @@ -91471,7 +93141,7 @@ var ts; logger.log("*INTERNAL ERROR* - Exception in typescript services: " + err.message); } } - var ScriptSnapshotShimAdapter = (function () { + var ScriptSnapshotShimAdapter = /** @class */ (function () { function ScriptSnapshotShimAdapter(scriptSnapshotShim) { this.scriptSnapshotShim = scriptSnapshotShim; } @@ -91499,7 +93169,7 @@ var ts; }; return ScriptSnapshotShimAdapter; }()); - var LanguageServiceShimHostAdapter = (function () { + var LanguageServiceShimHostAdapter = /** @class */ (function () { function LanguageServiceShimHostAdapter(shimHost) { var _this = this; this.shimHost = shimHost; @@ -91623,7 +93293,7 @@ var ts; return LanguageServiceShimHostAdapter; }()); ts.LanguageServiceShimHostAdapter = LanguageServiceShimHostAdapter; - var CoreServicesShimHostAdapter = (function () { + var CoreServicesShimHostAdapter = /** @class */ (function () { function CoreServicesShimHostAdapter(shimHost) { var _this = this; this.shimHost = shimHost; @@ -91688,7 +93358,7 @@ var ts; return JSON.stringify({ error: err }); } } - var ShimBase = (function () { + var ShimBase = /** @class */ (function () { function ShimBase(factory) { this.factory = factory; factory.registerShim(this); @@ -91712,7 +93382,7 @@ var ts; code: diagnostic.code }; } - var LanguageServiceShimObject = (function (_super) { + var LanguageServiceShimObject = /** @class */ (function (_super) { __extends(LanguageServiceShimObject, _super); function LanguageServiceShimObject(factory, host, languageService) { var _this = _super.call(this, factory) || this; @@ -91878,6 +93548,10 @@ var ts; var _this = this; return this.forwardJSONCall("isValidBraceCompletionAtPosition('" + fileName + "', " + position + ", " + openingBrace + ")", function () { return _this.languageService.isValidBraceCompletionAtPosition(fileName, position, openingBrace); }); }; + LanguageServiceShimObject.prototype.getSpanOfEnclosingComment = function (fileName, position, onlyMultiLine) { + var _this = this; + return this.forwardJSONCall("getSpanOfEnclosingComment('" + fileName + "', " + position + ")", function () { return _this.languageService.getSpanOfEnclosingComment(fileName, position, onlyMultiLine); }); + }; /// GET SMART INDENT LanguageServiceShimObject.prototype.getIndentationAtPosition = function (fileName, position, options /*Services.EditorOptions*/) { var _this = this; @@ -91985,7 +93659,7 @@ var ts; function convertClassifications(classifications) { return { spans: classifications.spans.join(","), endOfLineState: classifications.endOfLineState }; } - var ClassifierShimObject = (function (_super) { + var ClassifierShimObject = /** @class */ (function (_super) { __extends(ClassifierShimObject, _super); function ClassifierShimObject(factory, logger) { var _this = _super.call(this, factory) || this; @@ -92012,7 +93686,7 @@ var ts; }; return ClassifierShimObject; }(ShimBase)); - var CoreServicesShimObject = (function (_super) { + var CoreServicesShimObject = /** @class */ (function (_super) { __extends(CoreServicesShimObject, _super); function CoreServicesShimObject(factory, logger, host) { var _this = _super.call(this, factory) || this; @@ -92119,7 +93793,7 @@ var ts; }; return CoreServicesShimObject; }(ShimBase)); - var TypeScriptServicesFactory = (function () { + var TypeScriptServicesFactory = /** @class */ (function () { function TypeScriptServicesFactory() { this._shims = []; } @@ -92200,4 +93874,6 @@ var TypeScript; // 'toolsVersion' gets consumed by the managed side, so it's not unused. // TODO: it should be moved into a namespace though. /* @internal */ -var toolsVersion = "2.5"; +var toolsVersion = "2.6"; + +//# sourceMappingURL=typescriptServices.js.map diff --git a/lib/typescriptServices.d.ts b/lib/typescriptServices.d.ts index 392b7e36a07f9..0b54986035c2f 100644 --- a/lib/typescriptServices.d.ts +++ b/lib/typescriptServices.d.ts @@ -1210,7 +1210,7 @@ declare namespace ts { interface CatchClause extends Node { kind: SyntaxKind.CatchClause; parent?: TryStatement; - variableDeclaration: VariableDeclaration; + variableDeclaration?: VariableDeclaration; block: Block; } type DeclarationWithTypeParameters = SignatureDeclaration | ClassLikeDeclaration | InterfaceDeclaration | TypeAliasDeclaration | JSDocTemplateTag; @@ -1496,38 +1496,39 @@ declare namespace ts { interface FlowLock { locked?: boolean; } - interface AfterFinallyFlow extends FlowNode, FlowLock { + interface AfterFinallyFlow extends FlowNodeBase, FlowLock { antecedent: FlowNode; } - interface PreFinallyFlow extends FlowNode { + interface PreFinallyFlow extends FlowNodeBase { antecedent: FlowNode; lock: FlowLock; } - interface FlowNode { + type FlowNode = AfterFinallyFlow | PreFinallyFlow | FlowStart | FlowLabel | FlowAssignment | FlowCondition | FlowSwitchClause | FlowArrayMutation; + interface FlowNodeBase { flags: FlowFlags; id?: number; } - interface FlowStart extends FlowNode { + interface FlowStart extends FlowNodeBase { container?: FunctionExpression | ArrowFunction | MethodDeclaration; } - interface FlowLabel extends FlowNode { + interface FlowLabel extends FlowNodeBase { antecedents: FlowNode[]; } - interface FlowAssignment extends FlowNode { + interface FlowAssignment extends FlowNodeBase { node: Expression | VariableDeclaration | BindingElement; antecedent: FlowNode; } - interface FlowCondition extends FlowNode { + interface FlowCondition extends FlowNodeBase { expression: Expression; antecedent: FlowNode; } - interface FlowSwitchClause extends FlowNode { + interface FlowSwitchClause extends FlowNodeBase { switchStatement: SwitchStatement; clauseStart: number; clauseEnd: number; antecedent: FlowNode; } - interface FlowArrayMutation extends FlowNode { + interface FlowArrayMutation extends FlowNodeBase { node: CallExpression | BinaryExpression; antecedent: FlowNode; } @@ -1696,6 +1697,15 @@ declare namespace ts { getSymbolsOfParameterPropertyDeclaration(parameter: ParameterDeclaration, parameterName: string): Symbol[]; getShorthandAssignmentValueSymbol(location: Node): Symbol | undefined; getExportSpecifierLocalTargetSymbol(location: ExportSpecifier): Symbol | undefined; + /** + * If a symbol is a local symbol with an associated exported symbol, returns the exported symbol. + * Otherwise returns its input. + * For example, at `export type T = number;`: + * - `getSymbolAtLocation` at the location `T` will return the exported symbol for `T`. + * - But the result of `getSymbolsInScope` will contain the *local* symbol for `T`, not the exported symbol. + * - Calling `getExportSymbolOfSymbol` on that local symbol will return the exported symbol. + */ + getExportSymbolOfSymbol(symbol: Symbol): Symbol; getPropertySymbolOfDestructuringAssignment(location: Identifier): Symbol | undefined; getTypeAtLocation(node: Node): Type; getTypeFromTypeNode(node: TypeNode): Type; @@ -1790,11 +1800,11 @@ declare namespace ts { UseFullyQualifiedType = 256, InFirstTypeArgument = 512, InTypeAlias = 1024, - UseTypeAliasValue = 2048, SuppressAnyReturnType = 4096, AddUndefined = 8192, WriteClassExpressionAsTypeLiteral = 16384, InArrayType = 32768, + UseAliasDefinedOutsideCurrentScope = 65536, } enum SymbolFormatFlags { None = 0, @@ -2056,6 +2066,7 @@ declare namespace ts { interface TypeVariable extends Type { } interface TypeParameter extends TypeVariable { + /** Retrieve using getConstraintFromTypeParameter */ constraint: Type; default?: Type; } @@ -2103,6 +2114,21 @@ declare namespace ts { NoDefault = 2, AnyDefault = 4, } + /** + * Ternary values are defined such that + * x & y is False if either x or y is False. + * x & y is Maybe if either x or y is Maybe, but neither x or y is False. + * x & y is True if both x and y are True. + * x | y is False if both x and y are False. + * x | y is Maybe if either x or y is Maybe, but neither x or y is True. + * x | y is True if either x or y is True. + */ + enum Ternary { + False = 0, + Maybe = 1, + True = -1, + } + type TypeComparer = (s: Type, t: Type, reportErrors?: boolean) => Ternary; interface JsFileExtensionInfo { extension: string; isMixedContent: boolean; @@ -2195,6 +2221,7 @@ declare namespace ts { outFile?: string; paths?: MapLike; preserveConstEnums?: boolean; + preserveSymlinks?: boolean; project?: string; reactNamespace?: string; jsxFactory?: string; @@ -2300,6 +2327,10 @@ declare namespace ts { readFile(fileName: string): string | undefined; trace?(s: string): void; directoryExists?(directoryName: string): boolean; + /** + * Resolve a symbolic link. + * @see https://nodejs.org/api/fs.html#fs_fs_realpathsync_path_options + */ realpath?(path: string): string; getCurrentDirectory?(): string; getDirectories?(path: string): string[]; @@ -2314,17 +2345,13 @@ declare namespace ts { interface ResolvedModule { /** Path of the file the module was resolved to. */ resolvedFileName: string; - /** - * Denotes if 'resolvedFileName' is isExternalLibraryImport and thus should be a proper external module: - * - be a .d.ts file - * - use top level imports\exports - * - don't use tripleslash references - */ + /** True if `resolvedFileName` comes from `node_modules`. */ isExternalLibraryImport?: boolean; } /** * ResolvedModule with an explicitly provided `extension` property. * Prefer this over `ResolvedModule`. + * If changing this, remember to change `moduleResolutionIsEqualTo`. */ interface ResolvedModuleFull extends ResolvedModule { /** @@ -2332,6 +2359,21 @@ declare namespace ts { * This is optional for backwards-compatibility, but will be added if not provided. */ extension: Extension; + packageId?: PackageId; + } + /** + * Unique identifier with a package name and version. + * If changing this, remember to change `packageIdIsEqual`. + */ + interface PackageId { + /** + * Name of the package. + * Should not include `@types`. + * If accessing a non-index file, this should include its name e.g. "foo/bar". + */ + name: string; + /** Version of the package, e.g. "1.2.3" */ + version: string; } enum Extension { Ts = ".ts", @@ -2593,7 +2635,7 @@ declare namespace ts { } } declare namespace ts { - const versionMajorMinor = "2.5"; + const versionMajorMinor = "2.6"; /** The version of the TypeScript compiler release */ const version: string; } @@ -2741,6 +2783,8 @@ declare namespace ts { function collapseTextChangeRangesAcrossMultipleVersions(changes: ReadonlyArray): TextChangeRange; function getTypeParameterOwner(d: Declaration): Declaration; function isParameterPropertyDeclaration(node: Node): boolean; + function isEmptyBindingPattern(node: BindingName): node is BindingPattern; + function isEmptyBindingElement(node: BindingElement): boolean; function getCombinedModifierFlags(node: Node): ModifierFlags; function getCombinedNodeFlags(node: Node): NodeFlags; /** @@ -3310,8 +3354,8 @@ declare namespace ts { function updateDefaultClause(node: DefaultClause, statements: ReadonlyArray): DefaultClause; function createHeritageClause(token: HeritageClause["token"], types: ReadonlyArray): HeritageClause; function updateHeritageClause(node: HeritageClause, types: ReadonlyArray): HeritageClause; - function createCatchClause(variableDeclaration: string | VariableDeclaration, block: Block): CatchClause; - function updateCatchClause(node: CatchClause, variableDeclaration: VariableDeclaration, block: Block): CatchClause; + function createCatchClause(variableDeclaration: string | VariableDeclaration | undefined, block: Block): CatchClause; + function updateCatchClause(node: CatchClause, variableDeclaration: VariableDeclaration | undefined, block: Block): CatchClause; function createPropertyAssignment(name: string | PropertyName, initializer: Expression): PropertyAssignment; function updatePropertyAssignment(node: PropertyAssignment, name: PropertyName, initializer: Expression): PropertyAssignment; function createShorthandPropertyAssignment(name: string | Identifier, objectAssignmentInitializer?: Expression): ShorthandPropertyAssignment; @@ -3773,6 +3817,7 @@ declare namespace ts { getFormattingEditsAfterKeystroke(fileName: string, position: number, key: string, options: FormatCodeOptions | FormatCodeSettings): TextChange[]; getDocCommentTemplateAtPosition(fileName: string, position: number): TextInsertion; isValidBraceCompletionAtPosition(fileName: string, position: number, openingBrace: number): boolean; + getSpanOfEnclosingComment(fileName: string, position: number, onlyMultiLine: boolean): TextSpan; getCodeFixesAtPosition(fileName: string, start: number, end: number, errorCodes: number[], formatOptions: FormatCodeSettings): CodeAction[]; getApplicableRefactors(fileName: string, positionOrRaneg: number | TextRange): ApplicableRefactorInfo[]; getEditsForRefactor(fileName: string, formatOptions: FormatCodeSettings, positionOrRange: number | TextRange, refactorName: string, actionName: string): RefactorEditInfo | undefined; diff --git a/lib/typescriptServices.js b/lib/typescriptServices.js index eb71a73ba466d..f1356d558c67c 100644 --- a/lib/typescriptServices.js +++ b/lib/typescriptServices.js @@ -511,7 +511,7 @@ var ts; FlowFlags[FlowFlags["Label"] = 12] = "Label"; FlowFlags[FlowFlags["Condition"] = 96] = "Condition"; })(FlowFlags = ts.FlowFlags || (ts.FlowFlags = {})); - var OperationCanceledException = (function () { + var OperationCanceledException = /** @class */ (function () { function OperationCanceledException() { } return OperationCanceledException; @@ -570,11 +570,12 @@ var ts; TypeFormatFlags[TypeFormatFlags["UseFullyQualifiedType"] = 256] = "UseFullyQualifiedType"; TypeFormatFlags[TypeFormatFlags["InFirstTypeArgument"] = 512] = "InFirstTypeArgument"; TypeFormatFlags[TypeFormatFlags["InTypeAlias"] = 1024] = "InTypeAlias"; - TypeFormatFlags[TypeFormatFlags["UseTypeAliasValue"] = 2048] = "UseTypeAliasValue"; TypeFormatFlags[TypeFormatFlags["SuppressAnyReturnType"] = 4096] = "SuppressAnyReturnType"; TypeFormatFlags[TypeFormatFlags["AddUndefined"] = 8192] = "AddUndefined"; TypeFormatFlags[TypeFormatFlags["WriteClassExpressionAsTypeLiteral"] = 16384] = "WriteClassExpressionAsTypeLiteral"; TypeFormatFlags[TypeFormatFlags["InArrayType"] = 32768] = "InArrayType"; + TypeFormatFlags[TypeFormatFlags["UseAliasDefinedOutsideCurrentScope"] = 65536] = "UseAliasDefinedOutsideCurrentScope"; + // even though `T` can't be accessed in the current scope. })(TypeFormatFlags = ts.TypeFormatFlags || (ts.TypeFormatFlags = {})); var SymbolFormatFlags; (function (SymbolFormatFlags) { @@ -860,6 +861,21 @@ var ts; InferenceFlags[InferenceFlags["NoDefault"] = 2] = "NoDefault"; InferenceFlags[InferenceFlags["AnyDefault"] = 4] = "AnyDefault"; })(InferenceFlags = ts.InferenceFlags || (ts.InferenceFlags = {})); + /** + * Ternary values are defined such that + * x & y is False if either x or y is False. + * x & y is Maybe if either x or y is Maybe, but neither x or y is False. + * x & y is True if both x and y are True. + * x | y is False if both x and y are False. + * x | y is Maybe if either x or y is Maybe, but neither x or y is True. + * x | y is True if either x or y is True. + */ + var Ternary; + (function (Ternary) { + Ternary[Ternary["False"] = 0] = "False"; + Ternary[Ternary["Maybe"] = 1] = "Maybe"; + Ternary[Ternary["True"] = -1] = "True"; + })(Ternary = ts.Ternary || (ts.Ternary = {})); /* @internal */ var SpecialPropertyAssignmentKind; (function (SpecialPropertyAssignmentKind) { @@ -1329,27 +1345,12 @@ var ts; (function (ts) { // WARNING: The script `configureNightly.ts` uses a regexp to parse out these values. // If changing the text in this section, be sure to test `configureNightly` too. - ts.versionMajorMinor = "2.5"; + ts.versionMajorMinor = "2.6"; /** The version of the TypeScript compiler release */ ts.version = ts.versionMajorMinor + ".0"; })(ts || (ts = {})); /* @internal */ (function (ts) { - /** - * Ternary values are defined such that - * x & y is False if either x or y is False. - * x & y is Maybe if either x or y is Maybe, but neither x or y is False. - * x & y is True if both x and y are True. - * x | y is False if both x and y are False. - * x | y is Maybe if either x or y is Maybe, but neither x or y is True. - * x | y is True if either x or y is True. - */ - var Ternary; - (function (Ternary) { - Ternary[Ternary["False"] = 0] = "False"; - Ternary[Ternary["Maybe"] = 1] = "Maybe"; - Ternary[Ternary["True"] = -1] = "True"; - })(Ternary = ts.Ternary || (ts.Ternary = {})); // More efficient to create a collator once and use its `compare` than to call `a.localeCompare(b)` many times. ts.collator = typeof Intl === "object" && typeof Intl.Collator === "function" ? new Intl.Collator(/*locales*/ undefined, { usage: "sort", sensitivity: "accent" }) : undefined; // Intl is missing in Safari, and node 0.10 treats "a" as greater than "B". @@ -1403,7 +1404,7 @@ var ts; var MapCtr = typeof Map !== "undefined" && "entries" in Map.prototype ? Map : shimMap(); // Keep the class inside a function so it doesn't get compiled if it's not used. function shimMap() { - var MapIterator = (function () { + var MapIterator = /** @class */ (function () { function MapIterator(data, selector) { this.index = 0; this.data = data; @@ -1420,7 +1421,7 @@ var ts; }; return MapIterator; }()); - return (function () { + return /** @class */ (function () { function class_1() { this.data = createDictionaryObject(); this.size = 0; @@ -1668,10 +1669,9 @@ var ts; ts.removeWhere = removeWhere; function filterMutate(array, f) { var outIndex = 0; - for (var _i = 0, array_3 = array; _i < array_3.length; _i++) { - var item = array_3[_i]; - if (f(item)) { - array[outIndex] = item; + for (var i = 0; i < array.length; i++) { + if (f(array[i], i, array)) { + array[outIndex] = array[i]; outIndex++; } } @@ -1722,8 +1722,8 @@ var ts; var result; if (array) { result = []; - for (var _i = 0, array_4 = array; _i < array_4.length; _i++) { - var v = array_4[_i]; + for (var _i = 0, array_3 = array; _i < array_3.length; _i++) { + var v = array_3[_i]; if (v) { if (isArray(v)) { addRange(result, v); @@ -1799,11 +1799,13 @@ var ts; ts.sameFlatMap = sameFlatMap; function mapDefined(array, mapFn) { var result = []; - for (var i = 0; i < array.length; i++) { - var item = array[i]; - var mapped = mapFn(item, i); - if (mapped !== undefined) { - result.push(mapped); + if (array) { + for (var i = 0; i < array.length; i++) { + var item = array[i]; + var mapped = mapFn(item, i); + if (mapped !== undefined) { + result.push(mapped); + } } } return result; @@ -1882,8 +1884,8 @@ var ts; function some(array, predicate) { if (array) { if (predicate) { - for (var _i = 0, array_5 = array; _i < array_5.length; _i++) { - var v = array_5[_i]; + for (var _i = 0, array_4 = array; _i < array_4.length; _i++) { + var v = array_4[_i]; if (predicate(v)) { return true; } @@ -1909,8 +1911,8 @@ var ts; var result; if (array) { result = []; - loop: for (var _i = 0, array_6 = array; _i < array_6.length; _i++) { - var item = array_6[_i]; + loop: for (var _i = 0, array_5 = array; _i < array_5.length; _i++) { + var item = array_5[_i]; for (var _a = 0, result_1 = result; _a < result_1.length; _a++) { var res = result_1[_a]; if (areEqual ? areEqual(res, item) : res === item) { @@ -2003,8 +2005,8 @@ var ts; ts.relativeComplement = relativeComplement; function sum(array, prop) { var result = 0; - for (var _i = 0, array_7 = array; _i < array_7.length; _i++) { - var v = array_7[_i]; + for (var _i = 0, array_6 = array; _i < array_6.length; _i++) { + var v = array_6[_i]; // Note: we need the following type assertion because of GH #17069 result += v[prop]; } @@ -2336,8 +2338,8 @@ var ts; ts.equalOwnProperties = equalOwnProperties; function arrayToMap(array, makeKey, makeValue) { var result = createMap(); - for (var _i = 0, array_8 = array; _i < array_8.length; _i++) { - var value = array_8[_i]; + for (var _i = 0, array_7 = array; _i < array_7.length; _i++) { + var value = array_7[_i]; result.set(makeKey(value), makeValue ? makeValue(value) : value); } return result; @@ -2502,11 +2504,11 @@ var ts; ts.getLocaleSpecificMessage = getLocaleSpecificMessage; function createFileDiagnostic(file, start, length, message) { var end = start + length; - Debug.assert(start >= 0, "start must be non-negative, is " + start); - Debug.assert(length >= 0, "length must be non-negative, is " + length); + Debug.assertGreaterThanOrEqual(start, 0); + Debug.assertGreaterThanOrEqual(length, 0); if (file) { - Debug.assert(start <= file.text.length, "start must be within the bounds of the file. " + start + " > " + file.text.length); - Debug.assert(end <= file.text.length, "end must be the bounds of the file. " + end + " > " + file.text.length); + Debug.assertLessThanOrEqual(start, file.text.length); + Debug.assertLessThanOrEqual(end, file.text.length); } var text = getLocaleSpecificMessage(message); if (arguments.length > 4) { @@ -2736,19 +2738,23 @@ var ts; return normalized; } function normalizePath(path) { + return normalizePathAndParts(path).path; + } + ts.normalizePath = normalizePath; + function normalizePathAndParts(path) { path = normalizeSlashes(path); var rootLength = getRootLength(path); var root = path.substr(0, rootLength); - var normalized = getNormalizedParts(path, rootLength); - if (normalized.length) { - var joinedParts = root + normalized.join(ts.directorySeparator); - return pathEndsWithDirectorySeparator(path) ? joinedParts + ts.directorySeparator : joinedParts; + var parts = getNormalizedParts(path, rootLength); + if (parts.length) { + var joinedParts = root + parts.join(ts.directorySeparator); + return { path: pathEndsWithDirectorySeparator(path) ? joinedParts + ts.directorySeparator : joinedParts, parts: parts }; } else { - return root; + return { path: root, parts: parts }; } } - ts.normalizePath = normalizePath; + ts.normalizePathAndParts = normalizePathAndParts; /** A path ending with '/' refers to a directory only, never a file. */ function pathEndsWithDirectorySeparator(path) { return path.charCodeAt(path.length - 1) === directorySeparatorCharCode; @@ -3055,14 +3061,43 @@ var ts; // proof. var reservedCharacterPattern = /[^\w\s\/]/g; var wildcardCharCodes = [42 /* asterisk */, 63 /* question */]; - /** - * Matches any single directory segment unless it is the last segment and a .min.js file - * Breakdown: - * [^./] # matches everything up to the first . character (excluding directory seperators) - * (\\.(?!min\\.js$))? # matches . characters but not if they are part of the .min.js file extension - */ - var singleAsteriskRegexFragmentFiles = "([^./]|(\\.(?!min\\.js$))?)*"; - var singleAsteriskRegexFragmentOther = "[^/]*"; + /* @internal */ + ts.commonPackageFolders = ["node_modules", "bower_components", "jspm_packages"]; + var implicitExcludePathRegexPattern = "(?!(" + ts.commonPackageFolders.join("|") + ")(/|$))"; + var filesMatcher = { + /** + * Matches any single directory segment unless it is the last segment and a .min.js file + * Breakdown: + * [^./] # matches everything up to the first . character (excluding directory seperators) + * (\\.(?!min\\.js$))? # matches . characters but not if they are part of the .min.js file extension + */ + singleAsteriskRegexFragment: "([^./]|(\\.(?!min\\.js$))?)*", + /** + * Regex for the ** wildcard. Matches any number of subdirectories. When used for including + * files or directories, does not match subdirectories that start with a . character + */ + doubleAsteriskRegexFragment: "(/" + implicitExcludePathRegexPattern + "[^/.][^/]*)*?", + replaceWildcardCharacter: function (match) { return replaceWildcardCharacter(match, filesMatcher.singleAsteriskRegexFragment); } + }; + var directoriesMatcher = { + singleAsteriskRegexFragment: "[^/]*", + /** + * Regex for the ** wildcard. Matches any number of subdirectories. When used for including + * files or directories, does not match subdirectories that start with a . character + */ + doubleAsteriskRegexFragment: "(/" + implicitExcludePathRegexPattern + "[^/.][^/]*)*?", + replaceWildcardCharacter: function (match) { return replaceWildcardCharacter(match, directoriesMatcher.singleAsteriskRegexFragment); } + }; + var excludeMatcher = { + singleAsteriskRegexFragment: "[^/]*", + doubleAsteriskRegexFragment: "(/.+?)?", + replaceWildcardCharacter: function (match) { return replaceWildcardCharacter(match, excludeMatcher.singleAsteriskRegexFragment); } + }; + var wildcardMatchers = { + files: filesMatcher, + directories: directoriesMatcher, + exclude: excludeMatcher + }; function getRegularExpressionForWildcard(specs, basePath, usage) { var patterns = getRegularExpressionsForWildcards(specs, basePath, usage); if (!patterns || !patterns.length) { @@ -3078,15 +3113,8 @@ var ts; if (specs === undefined || specs.length === 0) { return undefined; } - var replaceWildcardCharacter = usage === "files" ? replaceWildCardCharacterFiles : replaceWildCardCharacterOther; - var singleAsteriskRegexFragment = usage === "files" ? singleAsteriskRegexFragmentFiles : singleAsteriskRegexFragmentOther; - /** - * Regex for the ** wildcard. Matches any number of subdirectories. When used for including - * files or directories, does not match subdirectories that start with a . character - */ - var doubleAsteriskRegexFragment = usage === "exclude" ? "(/.+?)?" : "(/[^/.][^/]*)*?"; return flatMap(specs, function (spec) { - return spec && getSubPatternFromSpec(spec, basePath, usage, singleAsteriskRegexFragment, doubleAsteriskRegexFragment, replaceWildcardCharacter); + return spec && getSubPatternFromSpec(spec, basePath, usage, wildcardMatchers[usage]); }); } /** @@ -3097,7 +3125,8 @@ var ts; return !/[.*?]/.test(lastPathComponent); } ts.isImplicitGlob = isImplicitGlob; - function getSubPatternFromSpec(spec, basePath, usage, singleAsteriskRegexFragment, doubleAsteriskRegexFragment, replaceWildcardCharacter) { + function getSubPatternFromSpec(spec, basePath, usage, _a) { + var singleAsteriskRegexFragment = _a.singleAsteriskRegexFragment, doubleAsteriskRegexFragment = _a.doubleAsteriskRegexFragment, replaceWildcardCharacter = _a.replaceWildcardCharacter; var subpattern = ""; var hasRecursiveDirectoryWildcard = false; var hasWrittenComponent = false; @@ -3131,19 +3160,33 @@ var ts; subpattern += ts.directorySeparator; } if (usage !== "exclude") { + var componentPattern = ""; // The * and ? wildcards should not match directories or files that start with . if they // appear first in a component. Dotted directories and files can be included explicitly // like so: **/.*/.* if (component.charCodeAt(0) === 42 /* asterisk */) { - subpattern += "([^./]" + singleAsteriskRegexFragment + ")?"; + componentPattern += "([^./]" + singleAsteriskRegexFragment + ")?"; component = component.substr(1); } else if (component.charCodeAt(0) === 63 /* question */) { - subpattern += "[^./]"; + componentPattern += "[^./]"; component = component.substr(1); } + componentPattern += component.replace(reservedCharacterPattern, replaceWildcardCharacter); + // Patterns should not include subfolders like node_modules unless they are + // explicitly included as part of the path. + // + // As an optimization, if the component pattern is the same as the component, + // then there definitely were no wildcard characters and we do not need to + // add the exclusion pattern. + if (componentPattern !== component) { + subpattern += implicitExcludePathRegexPattern; + } + subpattern += componentPattern; + } + else { + subpattern += component.replace(reservedCharacterPattern, replaceWildcardCharacter); } - subpattern += component.replace(reservedCharacterPattern, replaceWildcardCharacter); } hasWrittenComponent = true; } @@ -3153,12 +3196,6 @@ var ts; } return subpattern; } - function replaceWildCardCharacterFiles(match) { - return replaceWildcardCharacter(match, singleAsteriskRegexFragmentFiles); - } - function replaceWildCardCharacterOther(match) { - return replaceWildcardCharacter(match, singleAsteriskRegexFragmentOther); - } function replaceWildcardCharacter(match, singleAsteriskRegexFragment) { return match === "*" ? singleAsteriskRegexFragment : match === "?" ? "[^/]" : "\\" + match; } @@ -3319,14 +3356,7 @@ var ts; if (!extraFileExtensions || extraFileExtensions.length === 0 || !needAllExtensions) { return needAllExtensions ? allSupportedExtensions : ts.supportedTypeScriptExtensions; } - var extensions = allSupportedExtensions.slice(0); - for (var _i = 0, extraFileExtensions_1 = extraFileExtensions; _i < extraFileExtensions_1.length; _i++) { - var extInfo = extraFileExtensions_1[_i]; - if (extensions.indexOf(extInfo.extension) === -1) { - extensions.push(extInfo.extension); - } - } - return extensions; + return deduplicate(allSupportedExtensions.concat(extraFileExtensions.map(function (e) { return e.extension; }))); } ts.getSupportedExtensions = getSupportedExtensions; function hasJavaScriptFileExtension(fileName) { @@ -3481,12 +3511,37 @@ var ts; function assert(expression, message, verboseDebugInfo, stackCrawlMark) { if (!expression) { if (verboseDebugInfo) { - message += "\r\nVerbose Debug Information: " + verboseDebugInfo(); + message += "\r\nVerbose Debug Information: " + (typeof verboseDebugInfo === "string" ? verboseDebugInfo : verboseDebugInfo()); } fail(message ? "False expression: " + message : "False expression.", stackCrawlMark || assert); } } Debug.assert = assert; + function assertEqual(a, b, msg, msg2) { + if (a !== b) { + var message = msg ? msg2 ? msg + " " + msg2 : msg : ""; + fail("Expected " + a + " === " + b + ". " + message); + } + } + Debug.assertEqual = assertEqual; + function assertLessThan(a, b, msg) { + if (a >= b) { + fail("Expected " + a + " < " + b + ". " + (msg || "")); + } + } + Debug.assertLessThan = assertLessThan; + function assertLessThanOrEqual(a, b) { + if (a > b) { + fail("Expected " + a + " <= " + b); + } + } + Debug.assertLessThanOrEqual = assertLessThanOrEqual; + function assertGreaterThanOrEqual(a, b) { + if (a < b) { + fail("Expected " + a + " >= " + b); + } + } + Debug.assertGreaterThanOrEqual = assertGreaterThanOrEqual; function fail(message, stackCrawlMark) { debugger; var e = new Error(message ? "Debug Failure. " + message : "Debug Failure."); @@ -3652,6 +3707,10 @@ var ts; Debug.fail("File " + path + " has unknown extension."); } ts.extensionFromPath = extensionFromPath; + function isAnySupportedFileExtension(path) { + return tryGetExtensionFromPath(path) !== undefined; + } + ts.isAnySupportedFileExtension = isAnySupportedFileExtension; function tryGetExtensionFromPath(path) { return find(ts.supportedTypescriptExtensionsForExtractExtension, function (e) { return fileExtensionIs(path, e); }) || find(ts.supportedJavascriptExtensions, function (e) { return fileExtensionIs(path, e); }); } @@ -3664,6 +3723,18 @@ var ts; /// var ts; (function (ts) { + /** + * Set a high stack trace limit to provide more information in case of an error. + * Called for command-line and server use cases. + * Not called if TypeScript is used as a library. + */ + /* @internal */ + function setStackTraceLimit() { + if (Error.stackTraceLimit < 100) { + Error.stackTraceLimit = 100; + } + } + ts.setStackTraceLimit = setStackTraceLimit; var FileWatcherEventKind; (function (FileWatcherEventKind) { FileWatcherEventKind[FileWatcherEventKind["Created"] = 0] = "Created"; @@ -3714,7 +3785,7 @@ var ts; watcher.referenceCount += 1; return; } - watcher = _fs.watch(dirPath, { persistent: true }, function (eventName, relativeFileName) { return fileEventHandler(eventName, relativeFileName, dirPath); }); + watcher = _fs.watch(dirPath || ".", { persistent: true }, function (eventName, relativeFileName) { return fileEventHandler(eventName, relativeFileName, dirPath); }); watcher.referenceCount = 1; dirWatchers.set(dirPath, watcher); return; @@ -4569,6 +4640,8 @@ var ts; Expected_at_least_0_arguments_but_got_a_minimum_of_1: diag(2557, ts.DiagnosticCategory.Error, "Expected_at_least_0_arguments_but_got_a_minimum_of_1_2557", "Expected at least {0} arguments, but got a minimum of {1}."), Expected_0_type_arguments_but_got_1: diag(2558, ts.DiagnosticCategory.Error, "Expected_0_type_arguments_but_got_1_2558", "Expected {0} type arguments, but got {1}."), Type_0_has_no_properties_in_common_with_type_1: diag(2559, ts.DiagnosticCategory.Error, "Type_0_has_no_properties_in_common_with_type_1_2559", "Type '{0}' has no properties in common with type '{1}'."), + Value_of_type_0_has_no_properties_in_common_with_type_1_Did_you_mean_to_call_it: diag(2560, ts.DiagnosticCategory.Error, "Value_of_type_0_has_no_properties_in_common_with_type_1_Did_you_mean_to_call_it_2560", "Value of type '{0}' has no properties in common with type '{1}'. Did you mean to call it?"), + Base_class_expressions_cannot_reference_class_type_parameters: diag(2561, ts.DiagnosticCategory.Error, "Base_class_expressions_cannot_reference_class_type_parameters_2561", "Base class expressions cannot reference class type parameters."), JSX_element_attributes_type_0_may_not_be_a_union_type: diag(2600, ts.DiagnosticCategory.Error, "JSX_element_attributes_type_0_may_not_be_a_union_type_2600", "JSX element attributes type '{0}' may not be a union type."), The_return_type_of_a_JSX_element_constructor_must_return_an_object_type: diag(2601, ts.DiagnosticCategory.Error, "The_return_type_of_a_JSX_element_constructor_must_return_an_object_type_2601", "The return type of a JSX element constructor must return an object type."), JSX_element_implicitly_has_type_any_because_the_global_type_JSX_Element_does_not_exist: diag(2602, ts.DiagnosticCategory.Error, "JSX_element_implicitly_has_type_any_because_the_global_type_JSX_Element_does_not_exist_2602", "JSX element implicitly has type 'any' because the global type 'JSX.Element' does not exist."), @@ -4756,6 +4829,7 @@ var ts; Do_not_emit_outputs: diag(6010, ts.DiagnosticCategory.Message, "Do_not_emit_outputs_6010", "Do not emit outputs."), Allow_default_imports_from_modules_with_no_default_export_This_does_not_affect_code_emit_just_typechecking: diag(6011, ts.DiagnosticCategory.Message, "Allow_default_imports_from_modules_with_no_default_export_This_does_not_affect_code_emit_just_typech_6011", "Allow default imports from modules with no default export. This does not affect code emit, just typechecking."), Skip_type_checking_of_declaration_files: diag(6012, ts.DiagnosticCategory.Message, "Skip_type_checking_of_declaration_files_6012", "Skip type checking of declaration files."), + Do_not_resolve_the_real_path_of_symlinks: diag(6013, ts.DiagnosticCategory.Message, "Do_not_resolve_the_real_path_of_symlinks_6013", "Do not resolve the real path of symlinks."), Specify_ECMAScript_target_version_Colon_ES3_default_ES5_ES2015_ES2016_ES2017_or_ESNEXT: diag(6015, ts.DiagnosticCategory.Message, "Specify_ECMAScript_target_version_Colon_ES3_default_ES5_ES2015_ES2016_ES2017_or_ESNEXT_6015", "Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', or 'ESNEXT'."), Specify_module_code_generation_Colon_none_commonjs_amd_system_umd_es2015_or_ESNext: diag(6016, ts.DiagnosticCategory.Message, "Specify_module_code_generation_Colon_none_commonjs_amd_system_umd_es2015_or_ESNext_6016", "Specify module code generation: 'none', commonjs', 'amd', 'system', 'umd', 'es2015', or 'ESNext'."), Print_this_message: diag(6017, ts.DiagnosticCategory.Message, "Print_this_message_6017", "Print this message."), @@ -5009,6 +5083,8 @@ var ts; Rewrite_as_the_indexed_access_type_0: diag(90026, ts.DiagnosticCategory.Message, "Rewrite_as_the_indexed_access_type_0_90026", "Rewrite as the indexed access type '{0}'."), Convert_function_to_an_ES2015_class: diag(95001, ts.DiagnosticCategory.Message, "Convert_function_to_an_ES2015_class_95001", "Convert function to an ES2015 class"), Convert_function_0_to_class: diag(95002, ts.DiagnosticCategory.Message, "Convert_function_0_to_class_95002", "Convert function '{0}' to class"), + Extract_function: diag(95003, ts.DiagnosticCategory.Message, "Extract_function_95003", "Extract function"), + Extract_function_into_0: diag(95004, ts.DiagnosticCategory.Message, "Extract_function_into_0_95004", "Extract function into '{0}'"), }; })(ts || (ts = {})); /// @@ -6812,19 +6888,6 @@ var ts; return undefined; } ts.getDeclarationOfKind = getDeclarationOfKind; - function findDeclaration(symbol, predicate) { - var declarations = symbol.declarations; - if (declarations) { - for (var _i = 0, declarations_2 = declarations; _i < declarations_2.length; _i++) { - var declaration = declarations_2[_i]; - if (predicate(declaration)) { - return declaration; - } - } - } - return undefined; - } - ts.findDeclaration = findDeclaration; var stringWriter = createSingleLineStringWriter(); var stringWriterAcquired = false; function createSingleLineStringWriter() { @@ -6886,19 +6949,20 @@ var ts; sourceFile.resolvedTypeReferenceDirectiveNames.set(typeReferenceDirectiveName, resolvedTypeReferenceDirective); } ts.setResolvedTypeReferenceDirective = setResolvedTypeReferenceDirective; - /* @internal */ function moduleResolutionIsEqualTo(oldResolution, newResolution) { return oldResolution.isExternalLibraryImport === newResolution.isExternalLibraryImport && oldResolution.extension === newResolution.extension && - oldResolution.resolvedFileName === newResolution.resolvedFileName; + oldResolution.resolvedFileName === newResolution.resolvedFileName && + packageIdIsEqual(oldResolution.packageId, newResolution.packageId); } ts.moduleResolutionIsEqualTo = moduleResolutionIsEqualTo; - /* @internal */ + function packageIdIsEqual(a, b) { + return a === b || a && b && a.name === b.name && a.version === b.version; + } function typeDirectiveIsEqualTo(oldResolution, newResolution) { return oldResolution.resolvedFileName === newResolution.resolvedFileName && oldResolution.primary === newResolution.primary; } ts.typeDirectiveIsEqualTo = typeDirectiveIsEqualTo; - /* @internal */ function hasChangesInResolutions(names, newResolutions, oldResolutions, comparer) { ts.Debug.assert(names.length === newResolutions.length); for (var i = 0; i < names.length; i++) { @@ -6968,14 +7032,6 @@ var ts; return file.fileName + "(" + (loc.line + 1) + "," + (loc.character + 1) + ")"; } ts.nodePosToString = nodePosToString; - function getStartPosOfNode(node) { - return node.pos; - } - ts.getStartPosOfNode = getStartPosOfNode; - function isDefined(value) { - return value !== undefined; - } - ts.isDefined = isDefined; function getEndLinePosition(line, sourceFile) { ts.Debug.assert(line >= 0); var lineStarts = ts.getLineStarts(sourceFile); @@ -7025,6 +7081,32 @@ var ts; return !nodeIsMissing(node); } ts.nodeIsPresent = nodeIsPresent; + /** + * Determine if the given comment is a triple-slash + * + * @return true if the comment is a triple-slash comment else false + */ + function isRecognizedTripleSlashComment(text, commentPos, commentEnd) { + // Verify this is /// comment, but do the regexp match only when we first can find /// in the comment text + // so that we don't end up computing comment string and doing match for all // comments + if (text.charCodeAt(commentPos + 1) === 47 /* slash */ && + commentPos + 2 < commentEnd && + text.charCodeAt(commentPos + 2) === 47 /* slash */) { + var textSubStr = text.substring(commentPos, commentEnd); + return textSubStr.match(ts.fullTripleSlashReferencePathRegEx) || + textSubStr.match(ts.fullTripleSlashAMDReferencePathRegEx) || + textSubStr.match(fullTripleSlashReferenceTypeReferenceDirectiveRegEx) || + textSubStr.match(defaultLibReferenceRegEx) ? + true : false; + } + return false; + } + ts.isRecognizedTripleSlashComment = isRecognizedTripleSlashComment; + function isPinnedComment(text, comment) { + return text.charCodeAt(comment.pos + 1) === 42 /* asterisk */ && + text.charCodeAt(comment.pos + 2) === 33 /* exclamation */; + } + ts.isPinnedComment = isPinnedComment; function getTokenPosOfNode(node, sourceFile, includeJsDoc) { // With nodes that have no width (i.e. 'Missing' nodes), we actually *don't* // want to skip trivia because this will launch us forward to the next token. @@ -7094,15 +7176,20 @@ var ts; // or a (possibly escaped) quoted form of the original text if it's string-like. switch (node.kind) { case 9 /* StringLiteral */: - return '"' + escapeText(node.text) + '"'; + if (node.singleQuote) { + return "'" + escapeText(node.text, 39 /* singleQuote */) + "'"; + } + else { + return '"' + escapeText(node.text, 34 /* doubleQuote */) + '"'; + } case 13 /* NoSubstitutionTemplateLiteral */: - return "`" + escapeText(node.text) + "`"; + return "`" + escapeText(node.text, 96 /* backtick */) + "`"; case 14 /* TemplateHead */: - return "`" + escapeText(node.text) + "${"; + return "`" + escapeText(node.text, 96 /* backtick */) + "${"; case 15 /* TemplateMiddle */: - return "}" + escapeText(node.text) + "${"; + return "}" + escapeText(node.text, 96 /* backtick */) + "${"; case 16 /* TemplateTail */: - return "}" + escapeText(node.text) + "`"; + return "}" + escapeText(node.text, 96 /* backtick */) + "`"; case 8 /* NumericLiteral */: return node.text; } @@ -7191,6 +7278,7 @@ var ts; return ts.isExternalModule(node) || compilerOptions.isolatedModules; } ts.isEffectiveExternalModule = isEffectiveExternalModule; + /* @internal */ function isBlockScope(node, parentNode) { switch (node.kind) { case 265 /* SourceFile */: @@ -7381,13 +7469,9 @@ var ts; } ts.isPrologueDirective = isPrologueDirective; function getLeadingCommentRangesOfNode(node, sourceFileOfNode) { - return ts.getLeadingCommentRanges(sourceFileOfNode.text, node.pos); + return node.kind !== 10 /* JsxText */ ? ts.getLeadingCommentRanges(sourceFileOfNode.text, node.pos) : undefined; } ts.getLeadingCommentRangesOfNode = getLeadingCommentRangesOfNode; - function getLeadingCommentRangesOfNodeFromText(node, text) { - return ts.getLeadingCommentRanges(text, node.pos); - } - ts.getLeadingCommentRangesOfNodeFromText = getLeadingCommentRangesOfNodeFromText; function getJSDocCommentRanges(node, text) { var commentRanges = (node.kind === 146 /* Parameter */ || node.kind === 145 /* TypeParameter */ || @@ -7395,7 +7479,7 @@ var ts; node.kind === 187 /* ArrowFunction */ || node.kind === 185 /* ParenthesizedExpression */) ? ts.concatenate(ts.getTrailingCommentRanges(text, node.pos), ts.getLeadingCommentRanges(text, node.pos)) : - getLeadingCommentRangesOfNodeFromText(node, text); + ts.getLeadingCommentRanges(text, node.pos); // True if the comment starts with '/**' but not if it is '/**/' return ts.filter(commentRanges, function (comment) { return text.charCodeAt(comment.pos + 1) === 42 /* asterisk */ && @@ -7405,8 +7489,9 @@ var ts; } ts.getJSDocCommentRanges = getJSDocCommentRanges; ts.fullTripleSlashReferencePathRegEx = /^(\/\/\/\s*/; - ts.fullTripleSlashReferenceTypeReferenceDirectiveRegEx = /^(\/\/\/\s*/; + var fullTripleSlashReferenceTypeReferenceDirectiveRegEx = /^(\/\/\/\s*/; ts.fullTripleSlashAMDReferencePathRegEx = /^(\/\/\/\s*/; + var defaultLibReferenceRegEx = /^(\/\/\/\s*/; function isPartOfTypeNode(node) { if (158 /* FirstTypeNode */ <= node.kind && node.kind <= 173 /* LastTypeNode */) { return true; @@ -7660,21 +7745,11 @@ var ts; } ts.getPropertyAssignment = getPropertyAssignment; function getContainingFunction(node) { - while (true) { - node = node.parent; - if (!node || ts.isFunctionLike(node)) { - return node; - } - } + return ts.findAncestor(node.parent, ts.isFunctionLike); } ts.getContainingFunction = getContainingFunction; function getContainingClass(node) { - while (true) { - node = node.parent; - if (!node || ts.isClassLike(node)) { - return node; - } - } + return ts.findAncestor(node.parent, ts.isClassLike); } ts.getContainingClass = getContainingClass; function getThisContainer(node, includeArrowFunctions) { @@ -8570,14 +8645,14 @@ var ts; ts.getAncestor = getAncestor; function getFileReferenceFromReferencePath(comment, commentRange) { var simpleReferenceRegEx = /^\/\/\/\s*/gim; + var isNoDefaultLibRegEx = new RegExp(defaultLibReferenceRegEx.source, "gim"); if (simpleReferenceRegEx.test(comment)) { if (isNoDefaultLibRegEx.test(comment)) { return { isNoDefaultLib: true }; } else { var refMatchResult = ts.fullTripleSlashReferencePathRegEx.exec(comment); - var refLibResult = !refMatchResult && ts.fullTripleSlashReferenceTypeReferenceDirectiveRegEx.exec(comment); + var refLibResult = !refMatchResult && fullTripleSlashReferenceTypeReferenceDirectiveRegEx.exec(comment); var match = refMatchResult || refLibResult; if (match) { var pos = commentRange.pos + match[1].length + match[2].length; @@ -8782,10 +8857,6 @@ var ts; return ts.getParseTreeNode(sourceFile, ts.isSourceFile) || sourceFile; } ts.getOriginalSourceFile = getOriginalSourceFile; - function getOriginalSourceFiles(sourceFiles) { - return ts.sameMap(sourceFiles, getOriginalSourceFile); - } - ts.getOriginalSourceFiles = getOriginalSourceFiles; var Associativity; (function (Associativity) { Associativity[Associativity["Left"] = 0] = "Left"; @@ -9029,7 +9100,9 @@ var ts; // the language service. These characters should be escaped when printing, and if any characters are added, // the map below must be updated. Note that this regexp *does not* include the 'delete' character. // There is no reason for this other than that JSON.stringify does not handle it either. - var escapedCharsRegExp = /[\\\"\u0000-\u001f\t\v\f\b\r\n\u2028\u2029\u0085]/g; + var doubleQuoteEscapedCharsRegExp = /[\\\"\u0000-\u001f\t\v\f\b\r\n\u2028\u2029\u0085]/g; + var singleQuoteEscapedCharsRegExp = /[\\\'\u0000-\u001f\t\v\f\b\r\n\u2028\u2029\u0085]/g; + var backtickQuoteEscapedCharsRegExp = /[\\\`\u0000-\u001f\t\v\f\b\r\n\u2028\u2029\u0085]/g; var escapedCharsMap = ts.createMapFromTemplate({ "\0": "\\0", "\t": "\\t", @@ -9040,6 +9113,8 @@ var ts; "\n": "\\n", "\\": "\\\\", "\"": "\\\"", + "\'": "\\\'", + "\`": "\\\`", "\u2028": "\\u2028", "\u2029": "\\u2029", "\u0085": "\\u0085" // nextLine @@ -9049,7 +9124,10 @@ var ts; * but augmented for a few select characters (e.g. lineSeparator, paragraphSeparator, nextLine) * Note that this doesn't actually wrap the input in double quotes. */ - function escapeString(s) { + function escapeString(s, quoteChar) { + var escapedCharsRegExp = quoteChar === 96 /* backtick */ ? backtickQuoteEscapedCharsRegExp : + quoteChar === 39 /* singleQuote */ ? singleQuoteEscapedCharsRegExp : + doubleQuoteEscapedCharsRegExp; return s.replace(escapedCharsRegExp, getReplacement); } ts.escapeString = escapeString; @@ -9069,8 +9147,8 @@ var ts; return "\\u" + paddedHexCode; } var nonAsciiCharacters = /[^\u0000-\u007F]/g; - function escapeNonAsciiString(s) { - s = escapeString(s); + function escapeNonAsciiString(s, quoteChar) { + s = escapeString(s, quoteChar); // Replace non-ASCII characters with '\uNNNN' escapes if any exist. // Otherwise just return the original string. return nonAsciiCharacters.test(s) ? @@ -9455,7 +9533,7 @@ var ts; // // var x = 10; if (node.pos === 0) { - leadingComments = ts.filter(ts.getLeadingCommentRanges(text, node.pos), isPinnedComment); + leadingComments = ts.filter(ts.getLeadingCommentRanges(text, node.pos), isPinnedCommentLocal); } } else { @@ -9495,9 +9573,8 @@ var ts; } } return currentDetachedCommentInfo; - function isPinnedComment(comment) { - return text.charCodeAt(comment.pos + 1) === 42 /* asterisk */ && - text.charCodeAt(comment.pos + 2) === 33 /* exclamation */; + function isPinnedCommentLocal(comment) { + return isPinnedComment(text, comment); } } ts.emitDetachedComments = emitDetachedComments; @@ -9593,9 +9670,13 @@ var ts; } ts.hasModifiers = hasModifiers; function hasModifier(node, flags) { - return (getModifierFlags(node) & flags) !== 0; + return !!getSelectedModifierFlags(node, flags); } ts.hasModifier = hasModifier; + function getSelectedModifierFlags(node, flags) { + return getModifierFlags(node) & flags; + } + ts.getSelectedModifierFlags = getSelectedModifierFlags; function getModifierFlags(node) { if (node.modifierFlagsCache & 536870912 /* HasComputedFlags */) { return node.modifierFlagsCache & ~536870912 /* HasComputedFlags */; @@ -9673,23 +9754,6 @@ var ts; return false; } ts.isDestructuringAssignment = isDestructuringAssignment; - // Returns false if this heritage clause element's expression contains something unsupported - // (i.e. not a name or dotted name). - function isSupportedExpressionWithTypeArguments(node) { - return isSupportedExpressionWithTypeArgumentsRest(node.expression); - } - ts.isSupportedExpressionWithTypeArguments = isSupportedExpressionWithTypeArguments; - function isSupportedExpressionWithTypeArgumentsRest(node) { - if (node.kind === 71 /* Identifier */) { - return true; - } - else if (ts.isPropertyAccessExpression(node)) { - return isSupportedExpressionWithTypeArgumentsRest(node.expression); - } - else { - return false; - } - } function isExpressionWithTypeArgumentsInClassExtendsClause(node) { return tryGetClassExtendingExpressionWithTypeArguments(node) !== undefined; } @@ -9816,78 +9880,6 @@ var ts; return carriageReturnLineFeed; } ts.getNewLineCharacter = getNewLineCharacter; - /** - * Tests whether a node and its subtree is simple enough to have its position - * information ignored when emitting source maps in a destructuring assignment. - * - * @param node The expression to test. - */ - function isSimpleExpression(node) { - return isSimpleExpressionWorker(node, 0); - } - ts.isSimpleExpression = isSimpleExpression; - function isSimpleExpressionWorker(node, depth) { - if (depth <= 5) { - var kind = node.kind; - if (kind === 9 /* StringLiteral */ - || kind === 8 /* NumericLiteral */ - || kind === 12 /* RegularExpressionLiteral */ - || kind === 13 /* NoSubstitutionTemplateLiteral */ - || kind === 71 /* Identifier */ - || kind === 99 /* ThisKeyword */ - || kind === 97 /* SuperKeyword */ - || kind === 101 /* TrueKeyword */ - || kind === 86 /* FalseKeyword */ - || kind === 95 /* NullKeyword */) { - return true; - } - else if (kind === 179 /* PropertyAccessExpression */) { - return isSimpleExpressionWorker(node.expression, depth + 1); - } - else if (kind === 180 /* ElementAccessExpression */) { - return isSimpleExpressionWorker(node.expression, depth + 1) - && isSimpleExpressionWorker(node.argumentExpression, depth + 1); - } - else if (kind === 192 /* PrefixUnaryExpression */ - || kind === 193 /* PostfixUnaryExpression */) { - return isSimpleExpressionWorker(node.operand, depth + 1); - } - else if (kind === 194 /* BinaryExpression */) { - return node.operatorToken.kind !== 40 /* AsteriskAsteriskToken */ - && isSimpleExpressionWorker(node.left, depth + 1) - && isSimpleExpressionWorker(node.right, depth + 1); - } - else if (kind === 195 /* ConditionalExpression */) { - return isSimpleExpressionWorker(node.condition, depth + 1) - && isSimpleExpressionWorker(node.whenTrue, depth + 1) - && isSimpleExpressionWorker(node.whenFalse, depth + 1); - } - else if (kind === 190 /* VoidExpression */ - || kind === 189 /* TypeOfExpression */ - || kind === 188 /* DeleteExpression */) { - return isSimpleExpressionWorker(node.expression, depth + 1); - } - else if (kind === 177 /* ArrayLiteralExpression */) { - return node.elements.length === 0; - } - else if (kind === 178 /* ObjectLiteralExpression */) { - return node.properties.length === 0; - } - else if (kind === 181 /* CallExpression */) { - if (!isSimpleExpressionWorker(node.expression, depth + 1)) { - return false; - } - for (var _i = 0, _a = node.arguments; _i < _a.length; _i++) { - var argument = _a[_i]; - if (!isSimpleExpressionWorker(argument, depth + 1)) { - return false; - } - } - return true; - } - } - return false; - } /** * Formats an enum value as a string for debugging and debug assertions. */ @@ -9959,24 +9951,6 @@ var ts; return formatEnum(flags, ts.ObjectFlags, /*isFlags*/ true); } ts.formatObjectFlags = formatObjectFlags; - function getRangePos(range) { - return range ? range.pos : -1; - } - ts.getRangePos = getRangePos; - function getRangeEnd(range) { - return range ? range.end : -1; - } - ts.getRangeEnd = getRangeEnd; - /** - * Increases (or decreases) a position by the provided amount. - * - * @param pos The position. - * @param value The delta. - */ - function movePos(pos, value) { - return ts.positionIsSynthesized(pos) ? -1 : pos + value; - } - ts.movePos = movePos; /** * Creates a new TextRange from the provided pos and end. * @@ -10034,26 +10008,6 @@ var ts; return range.pos === range.end; } ts.isCollapsedRange = isCollapsedRange; - /** - * Creates a new TextRange from a provided range with its end position collapsed to its - * start position. - * - * @param range A TextRange. - */ - function collapseRangeToStart(range) { - return isCollapsedRange(range) ? range : moveRangeEnd(range, range.pos); - } - ts.collapseRangeToStart = collapseRangeToStart; - /** - * Creates a new TextRange from a provided range with its start position collapsed to its - * end position. - * - * @param range A TextRange. - */ - function collapseRangeToEnd(range) { - return isCollapsedRange(range) ? range : moveRangePos(range, range.end); - } - ts.collapseRangeToEnd = collapseRangeToEnd; /** * Creates a new TextRange for a token at the provides start position. * @@ -10116,31 +10070,6 @@ var ts; function isInitializedVariable(node) { return node.initializer !== undefined; } - /** - * Gets a value indicating whether a node is merged with a class declaration in the same scope. - */ - function isMergedWithClass(node) { - if (node.symbol) { - for (var _i = 0, _a = node.symbol.declarations; _i < _a.length; _i++) { - var declaration = _a[_i]; - if (declaration.kind === 229 /* ClassDeclaration */ && declaration !== node) { - return true; - } - } - } - return false; - } - ts.isMergedWithClass = isMergedWithClass; - /** - * Gets a value indicating whether a node is the first declaration of its kind. - * - * @param node A Declaration node. - * @param kind The SyntaxKind to find among related declarations. - */ - function isFirstDeclarationOfKind(node, kind) { - return node.symbol && getDeclarationOfKind(node.symbol, kind) === node; - } - ts.isFirstDeclarationOfKind = isFirstDeclarationOfKind; function isWatchSet(options) { // Firefox has Object.prototype.watch return options.watch && options.hasOwnProperty("watch"); @@ -10434,6 +10363,20 @@ var ts; return ts.hasModifier(node, 92 /* ParameterPropertyModifier */) && node.parent.kind === 152 /* Constructor */ && ts.isClassLike(node.parent.parent); } ts.isParameterPropertyDeclaration = isParameterPropertyDeclaration; + function isEmptyBindingPattern(node) { + if (ts.isBindingPattern(node)) { + return ts.every(node.elements, isEmptyBindingElement); + } + return false; + } + ts.isEmptyBindingPattern = isEmptyBindingPattern; + function isEmptyBindingElement(node) { + if (ts.isOmittedExpression(node)) { + return true; + } + return isEmptyBindingPattern(node.name); + } + ts.isEmptyBindingElement = isEmptyBindingElement; function walkUpBindingElementsAndPatterns(node) { while (node && (node.kind === 176 /* BindingElement */ || ts.isBindingPattern(node))) { node = node.parent; @@ -11618,6 +11561,19 @@ var ts; return isUnaryExpressionKind(ts.skipPartiallyEmittedExpressions(node).kind); } ts.isUnaryExpression = isUnaryExpression; + /* @internal */ + function isUnaryExpressionWithWrite(expr) { + switch (expr.kind) { + case 193 /* PostfixUnaryExpression */: + return true; + case 192 /* PrefixUnaryExpression */: + return expr.operator === 43 /* PlusPlusToken */ || + expr.operator === 44 /* MinusMinusToken */; + default: + return false; + } + } + ts.isUnaryExpressionWithWrite = isUnaryExpressionWithWrite; function isExpressionKind(kind) { return kind === 195 /* ConditionalExpression */ || kind === 197 /* YieldExpression */ @@ -11824,9 +11780,19 @@ var ts; var kind = node.kind; return isStatementKindButNotDeclarationKind(kind) || isDeclarationStatementKind(kind) - || kind === 207 /* Block */; + || isBlockStatement(node); } ts.isStatement = isStatement; + function isBlockStatement(node) { + if (node.kind !== 207 /* Block */) + return false; + if (node.parent !== undefined) { + if (node.parent.kind === 224 /* TryStatement */ || node.parent.kind === 260 /* CatchClause */) { + return false; + } + } + return !ts.isFunctionBlock(node); + } // Module references /* @internal */ function isModuleReference(node) { @@ -14207,11 +14173,31 @@ var ts; var node = parseTokenNode(); return token() === 23 /* DotToken */ ? undefined : node; } - function parseLiteralTypeNode() { + function parseLiteralTypeNode(negative) { var node = createNode(173 /* LiteralType */); - node.literal = parseSimpleUnaryExpression(); - finishNode(node); - return node; + var unaryMinusExpression; + if (negative) { + unaryMinusExpression = createNode(192 /* PrefixUnaryExpression */); + unaryMinusExpression.operator = 38 /* MinusToken */; + nextToken(); + } + var expression; + switch (token()) { + case 9 /* StringLiteral */: + case 8 /* NumericLiteral */: + expression = parseLiteralLikeNode(token()); + break; + case 101 /* TrueKeyword */: + case 86 /* FalseKeyword */: + expression = parseTokenNode(); + } + if (negative) { + unaryMinusExpression.operand = expression; + finishNode(unaryMinusExpression); + expression = unaryMinusExpression; + } + node.literal = expression; + return finishNode(node); } function nextTokenIsNumericLiteral() { return nextToken() === 8 /* NumericLiteral */; @@ -14244,7 +14230,7 @@ var ts; case 86 /* FalseKeyword */: return parseLiteralTypeNode(); case 38 /* MinusToken */: - return lookAhead(nextTokenIsNumericLiteral) ? parseLiteralTypeNode() : parseTypeReference(); + return lookAhead(nextTokenIsNumericLiteral) ? parseLiteralTypeNode(/*negative*/ true) : parseTypeReference(); case 105 /* VoidKeyword */: case 95 /* NullKeyword */: return parseTokenNode(); @@ -14293,6 +14279,7 @@ var ts; case 101 /* TrueKeyword */: case 86 /* FalseKeyword */: case 134 /* ObjectKeyword */: + case 39 /* AsteriskToken */: return true; case 38 /* MinusToken */: return lookAhead(nextTokenIsNumericLiteral); @@ -14721,7 +14708,7 @@ var ts; // Didn't appear to actually be a parenthesized arrow function. Just bail out. return undefined; } - var isAsync = !!(ts.getModifierFlags(arrowFunction) & 256 /* Async */); + var isAsync = ts.hasModifier(arrowFunction, 256 /* Async */); // If we have an arrow, then try to parse the body. Even if not, try to parse if we // have an opening brace, just in case we're in an error state. var lastToken = token(); @@ -14879,7 +14866,7 @@ var ts; function parseParenthesizedArrowFunctionExpressionHead(allowAmbiguity) { var node = createNode(187 /* ArrowFunction */); node.modifiers = parseModifiersForArrowFunction(); - var isAsync = (ts.getModifierFlags(node) & 256 /* Async */) ? 2 /* Await */ : 0 /* None */; + var isAsync = ts.hasModifier(node, 256 /* Async */) ? 2 /* Await */ : 0 /* None */; // Arrow functions are never generators. // // If we're speculatively parsing a signature for a parenthesized arrow function, then @@ -15890,7 +15877,7 @@ var ts; parseExpected(89 /* FunctionKeyword */); node.asteriskToken = parseOptionalToken(39 /* AsteriskToken */); var isGenerator = node.asteriskToken ? 1 /* Yield */ : 0 /* None */; - var isAsync = (ts.getModifierFlags(node) & 256 /* Async */) ? 2 /* Await */ : 0 /* None */; + var isAsync = ts.hasModifier(node, 256 /* Async */) ? 2 /* Await */ : 0 /* None */; node.name = isGenerator && isAsync ? doInYieldAndAwaitContext(parseOptionalIdentifier) : isGenerator ? doInYieldContext(parseOptionalIdentifier) : @@ -16132,10 +16119,14 @@ var ts; function parseCatchClause() { var result = createNode(260 /* CatchClause */); parseExpected(74 /* CatchKeyword */); - if (parseExpected(19 /* OpenParenToken */)) { + if (parseOptional(19 /* OpenParenToken */)) { result.variableDeclaration = parseVariableDeclaration(); + parseExpected(20 /* CloseParenToken */); + } + else { + // Keep shape of node to avoid degrading performance. + result.variableDeclaration = undefined; } - parseExpected(20 /* CloseParenToken */); result.block = parseBlock(/*ignoreMissingOpenBrace*/ false); return finishNode(result); } @@ -17036,8 +17027,8 @@ var ts; // ImportDeclaration: // import ImportClause from ModuleSpecifier ; // import ModuleSpecifier; - if (identifier || - token() === 39 /* AsteriskToken */ || + if (identifier || // import id + token() === 39 /* AsteriskToken */ || // import * token() === 17 /* OpenBraceToken */) { importDeclaration.importClause = parseImportClause(identifier, afterImportPos); parseExpected(140 /* FromKeyword */); @@ -17345,7 +17336,7 @@ var ts; JSDocParser.parseJSDocTypeExpression = parseJSDocTypeExpression; function parseIsolatedJSDocComment(content, start, length) { initializeState(content, 5 /* Latest */, /*_syntaxCursor:*/ undefined, 1 /* JS */); - sourceFile = { languageVariant: 0 /* Standard */, text: content }; + sourceFile = { languageVariant: 0 /* Standard */, text: content }; // tslint:disable-line no-object-literal-type-assertion var jsDoc = parseJSDocCommentWorker(start, length); var diagnostics = parseDiagnostics; clearState(); @@ -18093,8 +18084,8 @@ var ts; array._children = undefined; array.pos += delta; array.end += delta; - for (var _i = 0, array_9 = array; _i < array_9.length; _i++) { - var node = array_9[_i]; + for (var _i = 0, array_8 = array; _i < array_8.length; _i++) { + var node = array_8[_i]; visitNode(node); } } @@ -18231,8 +18222,8 @@ var ts; array._children = undefined; // Adjust the pos or end (or both) of the intersecting array accordingly. adjustIntersectingElement(array, changeStart, changeRangeOldEnd, changeRangeNewEnd, delta); - for (var _i = 0, array_10 = array; _i < array_10.length; _i++) { - var node = array_10[_i]; + for (var _i = 0, array_9 = array; _i < array_9.length; _i++) { + var node = array_9[_i]; visitNode(node); } return; @@ -19201,40 +19192,23 @@ var ts; return antecedent; } setFlowNodeReferenced(antecedent); - return { - flags: flags, - expression: expression, - antecedent: antecedent - }; + return { flags: flags, expression: expression, antecedent: antecedent }; } function createFlowSwitchClause(antecedent, switchStatement, clauseStart, clauseEnd) { if (!isNarrowingExpression(switchStatement.expression)) { return antecedent; } setFlowNodeReferenced(antecedent); - return { - flags: 128 /* SwitchClause */, - switchStatement: switchStatement, - clauseStart: clauseStart, - clauseEnd: clauseEnd, - antecedent: antecedent - }; + return { flags: 128 /* SwitchClause */, switchStatement: switchStatement, clauseStart: clauseStart, clauseEnd: clauseEnd, antecedent: antecedent }; } function createFlowAssignment(antecedent, node) { setFlowNodeReferenced(antecedent); - return { - flags: 16 /* Assignment */, - antecedent: antecedent, - node: node - }; + return { flags: 16 /* Assignment */, antecedent: antecedent, node: node }; } function createFlowArrayMutation(antecedent, node) { setFlowNodeReferenced(antecedent); - return { - flags: 256 /* ArrayMutation */, - antecedent: antecedent, - node: node - }; + var res = { flags: 256 /* ArrayMutation */, antecedent: antecedent, node: node }; + return res; } function finishFlowLabel(flow) { var antecedents = flow.antecedents; @@ -20956,7 +20930,6 @@ var ts; } function computeParameter(node, subtreeFlags) { var transformFlags = subtreeFlags; - var modifierFlags = ts.getModifierFlags(node); var name = node.name; var initializer = node.initializer; var dotDotDotToken = node.dotDotDotToken; @@ -20969,7 +20942,7 @@ var ts; transformFlags |= 3 /* AssertTypeScript */; } // If a parameter has an accessibility modifier, then it is TypeScript syntax. - if (modifierFlags & 92 /* ParameterPropertyModifier */) { + if (ts.hasModifier(node, 92 /* ParameterPropertyModifier */)) { transformFlags |= 3 /* AssertTypeScript */ | 262144 /* ContainsParameterPropertyAssignments */; } // parameters with object rest destructuring are ES Next syntax @@ -21006,8 +20979,7 @@ var ts; } function computeClassDeclaration(node, subtreeFlags) { var transformFlags; - var modifierFlags = ts.getModifierFlags(node); - if (modifierFlags & 2 /* Ambient */) { + if (ts.hasModifier(node, 2 /* Ambient */)) { // An ambient declaration is TypeScript syntax. transformFlags = 3 /* AssertTypeScript */; } @@ -21068,7 +21040,10 @@ var ts; } function computeCatchClause(node, subtreeFlags) { var transformFlags = subtreeFlags; - if (node.variableDeclaration && ts.isBindingPattern(node.variableDeclaration.name)) { + if (!node.variableDeclaration) { + transformFlags |= 8 /* AssertESNext */; + } + else if (ts.isBindingPattern(node.variableDeclaration.name)) { transformFlags |= 192 /* AssertES2015 */; } node.transformFlags = transformFlags | 536870912 /* HasComputedFlags */; @@ -21283,10 +21258,9 @@ var ts; } function computeVariableStatement(node, subtreeFlags) { var transformFlags; - var modifierFlags = ts.getModifierFlags(node); var declarationListTransformFlags = node.declarationList.transformFlags; // An ambient declaration is TypeScript syntax. - if (modifierFlags & 2 /* Ambient */) { + if (ts.hasModifier(node, 2 /* Ambient */)) { transformFlags = 3 /* AssertTypeScript */; } else { @@ -21634,6 +21608,176 @@ var ts; ts.forEachChild(child, function (childsChild) { return setParentPointers(child, childsChild); }); } })(ts || (ts = {})); +/** @internal */ +var ts; +(function (ts) { + function createGetSymbolWalker(getRestTypeOfSignature, getReturnTypeOfSignature, getBaseTypes, resolveStructuredTypeMembers, getTypeOfSymbol, getResolvedSymbol, getIndexTypeOfStructuredType, getConstraintFromTypeParameter, getFirstIdentifier) { + return getSymbolWalker; + function getSymbolWalker(accept) { + if (accept === void 0) { accept = function () { return true; }; } + var visitedTypes = ts.createMap(); // Key is id as string + var visitedSymbols = ts.createMap(); // Key is id as string + return { + walkType: function (type) { + visitedTypes.clear(); + visitedSymbols.clear(); + visitType(type); + return { visitedTypes: ts.arrayFrom(visitedTypes.values()), visitedSymbols: ts.arrayFrom(visitedSymbols.values()) }; + }, + walkSymbol: function (symbol) { + visitedTypes.clear(); + visitedSymbols.clear(); + visitSymbol(symbol); + return { visitedTypes: ts.arrayFrom(visitedTypes.values()), visitedSymbols: ts.arrayFrom(visitedSymbols.values()) }; + }, + }; + function visitType(type) { + if (!type) { + return; + } + var typeIdString = type.id.toString(); + if (visitedTypes.has(typeIdString)) { + return; + } + visitedTypes.set(typeIdString, type); + // Reuse visitSymbol to visit the type's symbol, + // but be sure to bail on recuring into the type if accept declines the symbol. + var shouldBail = visitSymbol(type.symbol); + if (shouldBail) + return; + // Visit the type's related types, if any + if (type.flags & 32768 /* Object */) { + var objectType = type; + var objectFlags = objectType.objectFlags; + if (objectFlags & 4 /* Reference */) { + visitTypeReference(type); + } + if (objectFlags & 32 /* Mapped */) { + visitMappedType(type); + } + if (objectFlags & (1 /* Class */ | 2 /* Interface */)) { + visitInterfaceType(type); + } + if (objectFlags & (8 /* Tuple */ | 16 /* Anonymous */)) { + visitObjectType(objectType); + } + } + if (type.flags & 16384 /* TypeParameter */) { + visitTypeParameter(type); + } + if (type.flags & 196608 /* UnionOrIntersection */) { + visitUnionOrIntersectionType(type); + } + if (type.flags & 262144 /* Index */) { + visitIndexType(type); + } + if (type.flags & 524288 /* IndexedAccess */) { + visitIndexedAccessType(type); + } + } + function visitTypeList(types) { + if (!types) { + return; + } + for (var i = 0; i < types.length; i++) { + visitType(types[i]); + } + } + function visitTypeReference(type) { + visitType(type.target); + visitTypeList(type.typeArguments); + } + function visitTypeParameter(type) { + visitType(getConstraintFromTypeParameter(type)); + } + function visitUnionOrIntersectionType(type) { + visitTypeList(type.types); + } + function visitIndexType(type) { + visitType(type.type); + } + function visitIndexedAccessType(type) { + visitType(type.objectType); + visitType(type.indexType); + visitType(type.constraint); + } + function visitMappedType(type) { + visitType(type.typeParameter); + visitType(type.constraintType); + visitType(type.templateType); + visitType(type.modifiersType); + } + function visitSignature(signature) { + if (signature.typePredicate) { + visitType(signature.typePredicate.type); + } + visitTypeList(signature.typeParameters); + for (var _i = 0, _a = signature.parameters; _i < _a.length; _i++) { + var parameter = _a[_i]; + visitSymbol(parameter); + } + visitType(getRestTypeOfSignature(signature)); + visitType(getReturnTypeOfSignature(signature)); + } + function visitInterfaceType(interfaceT) { + visitObjectType(interfaceT); + visitTypeList(interfaceT.typeParameters); + visitTypeList(getBaseTypes(interfaceT)); + visitType(interfaceT.thisType); + } + function visitObjectType(type) { + var stringIndexType = getIndexTypeOfStructuredType(type, 0 /* String */); + visitType(stringIndexType); + var numberIndexType = getIndexTypeOfStructuredType(type, 1 /* Number */); + visitType(numberIndexType); + // The two checks above *should* have already resolved the type (if needed), so this should be cached + var resolved = resolveStructuredTypeMembers(type); + for (var _i = 0, _a = resolved.callSignatures; _i < _a.length; _i++) { + var signature = _a[_i]; + visitSignature(signature); + } + for (var _b = 0, _c = resolved.constructSignatures; _b < _c.length; _b++) { + var signature = _c[_b]; + visitSignature(signature); + } + for (var _d = 0, _e = resolved.properties; _d < _e.length; _d++) { + var p = _e[_d]; + visitSymbol(p); + } + } + function visitSymbol(symbol) { + if (!symbol) { + return; + } + var symbolIdString = ts.getSymbolId(symbol).toString(); + if (visitedSymbols.has(symbolIdString)) { + return; + } + visitedSymbols.set(symbolIdString, symbol); + if (!accept(symbol)) { + return true; + } + var t = getTypeOfSymbol(symbol); + visitType(t); // Should handle members on classes and such + if (symbol.flags & 1952 /* HasExports */) { + symbol.exports.forEach(visitSymbol); + } + ts.forEach(symbol.declarations, function (d) { + // Type queries are too far resolved when we just visit the symbol's type + // (their type resolved directly to the member deeply referenced) + // So to get the intervening symbols, we need to check if there's a type + // query node on any of the symbol's declarations and get symbols there + if (d.type && d.type.kind === 162 /* TypeQuery */) { + var query = d.type; + var entity = getResolvedSymbol(getFirstIdentifier(query.exprName)); + visitSymbol(entity); + } + }); + } + } + } + ts.createGetSymbolWalker = createGetSymbolWalker; +})(ts || (ts = {})); /// /// var ts; @@ -21647,6 +21791,12 @@ var ts; return compilerOptions.traceResolution && host.trace !== undefined; } ts.isTraceEnabled = isTraceEnabled; + function withPackageId(packageId, r) { + return r && { path: r.path, extension: r.ext, packageId: packageId }; + } + function noPackageId(r) { + return withPackageId(/*packageId*/ undefined, r); + } /** * Kinds of file that we are currently looking for. * Typically there is one pass with Extensions.TypeScript, then a second pass with Extensions.JavaScript. @@ -21667,13 +21817,12 @@ var ts; } function createResolvedModuleWithFailedLookupLocations(resolved, isExternalLibraryImport, failedLookupLocations) { return { - resolvedModule: resolved && { resolvedFileName: resolved.path, extension: resolved.extension, isExternalLibraryImport: isExternalLibraryImport }, + resolvedModule: resolved && { resolvedFileName: resolved.path, extension: resolved.extension, isExternalLibraryImport: isExternalLibraryImport, packageId: resolved.packageId }, failedLookupLocations: failedLookupLocations }; } /** Reads from "main" or "types"/"typings" depending on `extensions`. */ - function tryReadPackageJsonFields(readTypes, packageJsonPath, baseDirectory, state) { - var jsonContent = readJson(packageJsonPath, state.host); + function tryReadPackageJsonFields(readTypes, jsonContent, baseDirectory, state) { return readTypes ? tryReadFromField("typings") || tryReadFromField("types") : tryReadFromField("main"); function tryReadFromField(fieldName) { if (!ts.hasProperty(jsonContent, fieldName)) { @@ -21778,7 +21927,9 @@ var ts; } var resolvedTypeReferenceDirective; if (resolved) { - resolved = realpath(resolved, host, traceEnabled); + if (!options.preserveSymlinks) { + resolved = realPath(resolved, host, traceEnabled); + } if (traceEnabled) { trace(host, ts.Diagnostics.Type_reference_directive_0_was_successfully_resolved_to_1_primary_Colon_2, typeReferenceDirectiveName, resolved, primary); } @@ -22182,7 +22333,7 @@ var ts; if (extension !== undefined) { var path_1 = tryFile(candidate, failedLookupLocations, /*onlyRecordFailures*/ false, state); if (path_1 !== undefined) { - return { path: path_1, extension: extension }; + return { path: path_1, extension: extension, packageId: undefined }; } } return loader(extensions, candidate, failedLookupLocations, !directoryProbablyExists(ts.getDirectoryPath(candidate), state.host), state); @@ -22209,7 +22360,7 @@ var ts; function resolveJavaScriptModule(moduleName, initialDir, host) { var _a = nodeModuleNameResolverWorker(moduleName, initialDir, { moduleResolution: ts.ModuleResolutionKind.NodeJs, allowJs: true }, host, /*cache*/ undefined, /*jsOnly*/ true), resolvedModule = _a.resolvedModule, failedLookupLocations = _a.failedLookupLocations; if (!resolvedModule) { - throw new Error("Could not resolve JS module " + moduleName + " starting at " + initialDir + ". Looked in: " + failedLookupLocations.join(", ")); + throw new Error("Could not resolve JS module '" + moduleName + "' starting at '" + initialDir + "'. Looked in: " + failedLookupLocations.join(", ")); } return resolvedModule.resolvedFileName; } @@ -22235,17 +22386,24 @@ var ts; trace(host, ts.Diagnostics.Loading_module_0_from_node_modules_folder_target_file_type_1, moduleName, Extensions[extensions]); } var resolved_1 = loadModuleFromNodeModules(extensions, moduleName, containingDirectory, failedLookupLocations, state, cache); + if (!resolved_1) + return undefined; + var resolvedValue = resolved_1.value; + if (!compilerOptions.preserveSymlinks) { + resolvedValue = resolvedValue && __assign({}, resolved_1.value, { path: realPath(resolved_1.value.path, host, traceEnabled), extension: resolved_1.value.extension }); + } // For node_modules lookups, get the real path so that multiple accesses to an `npm link`-ed module do not create duplicate files. - return resolved_1 && { value: resolved_1.value && { resolved: { path: realpath(resolved_1.value.path, host, traceEnabled), extension: resolved_1.value.extension }, isExternalLibraryImport: true } }; + return { value: resolvedValue && { resolved: resolvedValue, isExternalLibraryImport: true } }; } else { - var candidate = ts.normalizePath(ts.combinePaths(containingDirectory, moduleName)); + var _a = ts.normalizePathAndParts(ts.combinePaths(containingDirectory, moduleName)), candidate = _a.path, parts = _a.parts; var resolved_2 = nodeLoadModuleByRelativeName(extensions, candidate, failedLookupLocations, /*onlyRecordFailures*/ false, state, /*considerPackageJson*/ true); - return resolved_2 && toSearchResult({ resolved: resolved_2, isExternalLibraryImport: false }); + // Treat explicit "node_modules" import as an external library import. + return resolved_2 && toSearchResult({ resolved: resolved_2, isExternalLibraryImport: ts.contains(parts, "node_modules") }); } } } - function realpath(path, host, traceEnabled) { + function realPath(path, host, traceEnabled) { if (!host.realpath) { return path; } @@ -22271,7 +22429,7 @@ var ts; } var resolvedFromFile = loadModuleFromFile(extensions, candidate, failedLookupLocations, onlyRecordFailures, state); if (resolvedFromFile) { - return resolvedFromFile; + return noPackageId(resolvedFromFile); } } if (!onlyRecordFailures) { @@ -22291,6 +22449,9 @@ var ts; return !host.directoryExists || host.directoryExists(directoryName); } ts.directoryProbablyExists = directoryProbablyExists; + function loadModuleFromFileNoPackageId(extensions, candidate, failedLookupLocations, onlyRecordFailures, state) { + return noPackageId(loadModuleFromFile(extensions, candidate, failedLookupLocations, onlyRecordFailures, state)); + } /** * @param {boolean} onlyRecordFailures - if true then function won't try to actually load files but instead record all attempts as failures. This flag is necessary * in cases when we know upfront that all load attempts will fail (because containing folder does not exists) however we still need to record all failed lookup locations. @@ -22329,9 +22490,9 @@ var ts; case Extensions.JavaScript: return tryExtension(".js" /* Js */) || tryExtension(".jsx" /* Jsx */); } - function tryExtension(extension) { - var path = tryFile(candidate + extension, failedLookupLocations, onlyRecordFailures, state); - return path && { path: path, extension: extension }; + function tryExtension(ext) { + var path = tryFile(candidate + ext, failedLookupLocations, onlyRecordFailures, state); + return path && { path: path, ext: ext }; } } /** Return the file if it exists. */ @@ -22355,12 +22516,20 @@ var ts; function loadNodeModuleFromDirectory(extensions, candidate, failedLookupLocations, onlyRecordFailures, state, considerPackageJson) { if (considerPackageJson === void 0) { considerPackageJson = true; } var directoryExists = !onlyRecordFailures && directoryProbablyExists(candidate, state.host); + var packageId; if (considerPackageJson) { var packageJsonPath = pathToPackageJson(candidate); if (directoryExists && state.host.fileExists(packageJsonPath)) { - var fromPackageJson = loadModuleFromPackageJson(packageJsonPath, extensions, candidate, failedLookupLocations, state); + if (state.traceEnabled) { + trace(state.host, ts.Diagnostics.Found_package_json_at_0, packageJsonPath); + } + var jsonContent = readJson(packageJsonPath, state.host); + if (typeof jsonContent.name === "string" && typeof jsonContent.version === "string") { + packageId = { name: jsonContent.name, version: jsonContent.version }; + } + var fromPackageJson = loadModuleFromPackageJson(jsonContent, extensions, candidate, failedLookupLocations, state); if (fromPackageJson) { - return fromPackageJson; + return withPackageId(packageId, fromPackageJson); } } else { @@ -22371,13 +22540,10 @@ var ts; failedLookupLocations.push(packageJsonPath); } } - return loadModuleFromFile(extensions, ts.combinePaths(candidate, "index"), failedLookupLocations, !directoryExists, state); + return withPackageId(packageId, loadModuleFromFile(extensions, ts.combinePaths(candidate, "index"), failedLookupLocations, !directoryExists, state)); } - function loadModuleFromPackageJson(packageJsonPath, extensions, candidate, failedLookupLocations, state) { - if (state.traceEnabled) { - trace(state.host, ts.Diagnostics.Found_package_json_at_0, packageJsonPath); - } - var file = tryReadPackageJsonFields(extensions !== Extensions.JavaScript, packageJsonPath, candidate, state); + function loadModuleFromPackageJson(jsonContent, extensions, candidate, failedLookupLocations, state) { + var file = tryReadPackageJsonFields(extensions !== Extensions.JavaScript, jsonContent, candidate, state); if (!file) { return undefined; } @@ -22395,12 +22561,17 @@ var ts; // Even if extensions is DtsOnly, we can still look up a .ts file as a result of package.json "types" var nextExtensions = extensions === Extensions.DtsOnly ? Extensions.TypeScript : extensions; // Don't do package.json lookup recursively, because Node.js' package lookup doesn't. - return nodeLoadModuleByRelativeName(nextExtensions, file, failedLookupLocations, onlyRecordFailures, state, /*considerPackageJson*/ false); + var result = nodeLoadModuleByRelativeName(nextExtensions, file, failedLookupLocations, onlyRecordFailures, state, /*considerPackageJson*/ false); + if (result) { + // It won't have a `packageId` set, because we disabled `considerPackageJson`. + ts.Debug.assert(result.packageId === undefined); + return { path: result.path, ext: result.extension }; + } } /** Resolve from an arbitrarily specified file. Return `undefined` if it has an unsupported extension. */ function resolvedIfExtensionMatches(extensions, path) { - var extension = ts.tryGetExtensionFromPath(path); - return extension !== undefined && extensionIsOk(extensions, extension) ? { path: path, extension: extension } : undefined; + var ext = ts.tryGetExtensionFromPath(path); + return ext !== undefined && extensionIsOk(extensions, ext) ? { path: path, ext: ext } : undefined; } /** True if `extension` is one of the supported `extensions`. */ function extensionIsOk(extensions, extension) { @@ -22418,7 +22589,7 @@ var ts; } function loadModuleFromNodeModulesFolder(extensions, moduleName, nodeModulesFolder, nodeModulesFolderExists, failedLookupLocations, state) { var candidate = ts.normalizePath(ts.combinePaths(nodeModulesFolder, moduleName)); - return loadModuleFromFile(extensions, candidate, failedLookupLocations, !nodeModulesFolderExists, state) || + return loadModuleFromFileNoPackageId(extensions, candidate, failedLookupLocations, !nodeModulesFolderExists, state) || loadNodeModuleFromDirectory(extensions, candidate, failedLookupLocations, !nodeModulesFolderExists, state); } function loadModuleFromNodeModules(extensions, moduleName, directory, failedLookupLocations, state, cache) { @@ -22497,7 +22668,7 @@ var ts; if (traceEnabled) { trace(host, ts.Diagnostics.Resolution_for_module_0_was_found_in_cache, moduleName); } - return { value: result.resolvedModule && { path: result.resolvedModule.resolvedFileName, extension: result.resolvedModule.extension } }; + return { value: result.resolvedModule && { path: result.resolvedModule.resolvedFileName, extension: result.resolvedModule.extension, packageId: result.resolvedModule.packageId } }; } } function classicNameResolver(moduleName, containingFile, compilerOptions, host, cache) { @@ -22508,7 +22679,7 @@ var ts; var resolved = tryResolve(Extensions.TypeScript) || tryResolve(Extensions.JavaScript); return createResolvedModuleWithFailedLookupLocations(resolved && resolved.value, /*isExternalLibraryImport*/ false, failedLookupLocations); function tryResolve(extensions) { - var resolvedUsingSettings = tryLoadModuleUsingOptionalResolutionSettings(extensions, moduleName, containingDirectory, loadModuleFromFile, failedLookupLocations, state); + var resolvedUsingSettings = tryLoadModuleUsingOptionalResolutionSettings(extensions, moduleName, containingDirectory, loadModuleFromFileNoPackageId, failedLookupLocations, state); if (resolvedUsingSettings) { return { value: resolvedUsingSettings }; } @@ -22521,7 +22692,7 @@ var ts; return resolutionFromCache; } var searchName = ts.normalizePath(ts.combinePaths(directory, moduleName)); - return toSearchResult(loadModuleFromFile(extensions, searchName, failedLookupLocations, /*onlyRecordFailures*/ false, state)); + return toSearchResult(loadModuleFromFileNoPackageId(extensions, searchName, failedLookupLocations, /*onlyRecordFailures*/ false, state)); }); if (resolved_3) { return resolved_3; @@ -22533,7 +22704,7 @@ var ts; } else { var candidate = ts.normalizePath(ts.combinePaths(containingDirectory, moduleName)); - return toSearchResult(loadModuleFromFile(extensions, candidate, failedLookupLocations, /*onlyRecordFailures*/ false, state)); + return toSearchResult(loadModuleFromFileNoPackageId(extensions, candidate, failedLookupLocations, /*onlyRecordFailures*/ false, state)); } } } @@ -22578,6 +22749,7 @@ var ts; })(ts || (ts = {})); /// /// +/// /* @internal */ var ts; (function (ts) { @@ -22705,6 +22877,9 @@ var ts; node = ts.getParseTreeNode(node, ts.isExportSpecifier); return node ? getExportSpecifierLocalTargetSymbol(node) : undefined; }, + getExportSymbolOfSymbol: function (symbol) { + return getMergedSymbol(symbol.exportSymbol || symbol); + }, getTypeAtLocation: function (node) { node = ts.getParseTreeNode(node); return node ? getTypeOfNode(node) : unknownType; @@ -22767,6 +22942,7 @@ var ts; getEmitResolver: getEmitResolver, getExportsOfModule: getExportsOfModuleAsArray, getExportsAndPropertiesOfModule: getExportsAndPropertiesOfModule, + getSymbolWalker: ts.createGetSymbolWalker(getRestTypeOfSignature, getReturnTypeOfSignature, getBaseTypes, resolveStructuredTypeMembers, getTypeOfSymbol, getResolvedSymbol, getIndexTypeOfStructuredType, getConstraintFromTypeParameter, getFirstIdentifier), getAmbientModules: getAmbientModules, getAllAttributesTypeFromJsxOpeningLikeElement: function (node) { node = ts.getParseTreeNode(node, ts.isJsxOpeningLikeElement); @@ -22789,11 +22965,10 @@ var ts; getSuggestionForNonexistentProperty: function (node, type) { return ts.unescapeLeadingUnderscores(getSuggestionForNonexistentProperty(node, type)); }, getSuggestionForNonexistentSymbol: function (location, name, meaning) { return ts.unescapeLeadingUnderscores(getSuggestionForNonexistentSymbol(location, ts.escapeLeadingUnderscores(name), meaning)); }, getBaseConstraintOfType: getBaseConstraintOfType, - getJsxNamespace: function () { return ts.unescapeLeadingUnderscores(getJsxNamespace()); }, - resolveNameAtLocation: function (location, name, meaning) { - location = ts.getParseTreeNode(location); - return resolveName(location, ts.escapeLeadingUnderscores(name), meaning, /*nameNotFoundMessage*/ undefined, ts.escapeLeadingUnderscores(name)); + resolveName: function (name, location, meaning) { + return resolveName(location, ts.escapeLeadingUnderscores(name), meaning, /*nameNotFoundMessage*/ undefined, /*nameArg*/ undefined); }, + getJsxNamespace: function () { return ts.unescapeLeadingUnderscores(getJsxNamespace()); }, }; var tupleTypes = []; var unionTypes = ts.createMap(); @@ -23324,12 +23499,17 @@ var ts; // 2. inside a function // 3. inside an instance property initializer, a reference to a non-instance property // 4. inside a static property initializer, a reference to a static method in the same class + // 5. inside a TS export= declaration (since we will move the export statement during emit to avoid TDZ) // or if usage is in a type context: // 1. inside a type query (typeof in type position) - if (usage.parent.kind === 246 /* ExportSpecifier */) { + if (usage.parent.kind === 246 /* ExportSpecifier */ || (usage.parent.kind === 243 /* ExportAssignment */ && usage.parent.isExportEquals)) { // export specifiers do not use the variable, they only make it available for use return true; } + // When resolving symbols for exports, the `usage` location passed in can be the export site directly + if (usage.kind === 243 /* ExportAssignment */ && usage.isExportEquals) { + return true; + } var container = ts.getEnclosingBlockScopeContainer(declaration); return isInTypeQuery(usage) || isUsedInFunctionOrInstanceProperty(usage, declaration, container); function isImmediatelyUsedInInitializerOfBlockScopedVariable(declaration, usage) { @@ -23360,13 +23540,13 @@ var ts; current.parent.kind === 149 /* PropertyDeclaration */ && current.parent.initializer === current; if (initializerOfProperty) { - if (ts.getModifierFlags(current.parent) & 32 /* Static */) { + if (ts.hasModifier(current.parent, 32 /* Static */)) { if (declaration.kind === 151 /* MethodDeclaration */) { return true; } } else { - var isDeclarationInstanceProperty = declaration.kind === 149 /* PropertyDeclaration */ && !(ts.getModifierFlags(declaration) & 32 /* Static */); + var isDeclarationInstanceProperty = declaration.kind === 149 /* PropertyDeclaration */ && !ts.hasModifier(declaration, 32 /* Static */); if (!isDeclarationInstanceProperty || ts.getContainingClass(usage) !== ts.getContainingClass(declaration)) { return true; } @@ -23480,7 +23660,7 @@ var ts; // local variables of the constructor. This effectively means that entities from outer scopes // by the same name as a constructor parameter or local variable are inaccessible // in initializer expressions for instance member variables. - if (ts.isClassLike(location.parent) && !(ts.getModifierFlags(location) & 32 /* Static */)) { + if (ts.isClassLike(location.parent) && !ts.hasModifier(location, 32 /* Static */)) { var ctor = findConstructorDeclaration(location.parent); if (ctor && ctor.locals) { if (lookup(ctor.locals, name, meaning & 107455 /* Value */)) { @@ -23499,7 +23679,7 @@ var ts; result = undefined; break; } - if (lastLocation && ts.getModifierFlags(lastLocation) & 32 /* Static */) { + if (lastLocation && ts.hasModifier(lastLocation, 32 /* Static */)) { // TypeScript 1.0 spec (April 2014): 3.4.1 // The scope of a type parameter extends over the entire declaration with which the type // parameter list is associated, with the exception of static member declarations in classes. @@ -23516,6 +23696,18 @@ var ts; } } break; + case 201 /* ExpressionWithTypeArguments */: + // The type parameters of a class are not in scope in the base class expression. + if (lastLocation === location.expression && location.parent.token === 85 /* ExtendsKeyword */) { + var container = location.parent.parent; + if (ts.isClassLike(container) && (result = lookup(getSymbolOfNode(container).members, name, meaning & 793064 /* Type */))) { + if (nameNotFoundMessage) { + error(errorLocation, ts.Diagnostics.Base_class_expressions_cannot_reference_class_type_parameters); + } + return undefined; + } + } + break; // It is not legal to reference a class's own type parameters from a computed property name that // belongs to the class. For example: // @@ -23585,7 +23777,10 @@ var ts; lastLocation = location; location = location.parent; } - if (result && nameNotFoundMessage && noUnusedIdentifiers) { + // We just climbed up parents looking for the name, meaning that we started in a descendant node of `lastLocation`. + // If `result === lastLocation.symbol`, that means that we are somewhere inside `lastLocation` looking up a name, and resolving to `lastLocation` itself. + // That means that this is a self-reference of `lastLocation`, and shouldn't count this when considering whether `lastLocation` is used. + if (result && nameNotFoundMessage && noUnusedIdentifiers && result !== lastLocation.symbol) { result.isReferenced = true; } if (!result) { @@ -23684,7 +23879,7 @@ var ts; } // No static member is present. // Check if we're in an instance method and look for a relevant instance member. - if (location === container && !(ts.getModifierFlags(location) & 32 /* Static */)) { + if (location === container && !ts.hasModifier(location, 32 /* Static */)) { var instanceType = getDeclaredTypeOfSymbol(classSymbol).thisType; if (getPropertyOfType(instanceType, name)) { error(errorLocation, ts.Diagnostics.Cannot_find_name_0_Did_you_mean_the_instance_member_this_0, diagnosticName(nameArg)); @@ -24130,7 +24325,6 @@ var ts; if (ambientModule) { return ambientModule; } - var isRelative = ts.isExternalModuleNameRelative(moduleReference); var resolvedModule = ts.getResolvedModule(ts.getSourceFileOfNode(location), moduleReference); var resolutionDiagnostic = resolvedModule && ts.getResolutionDiagnostic(compilerOptions, resolvedModule); var sourceFile = resolvedModule && !resolutionDiagnostic && host.getSourceFile(resolvedModule.resolvedFileName); @@ -24152,7 +24346,7 @@ var ts; } } // May be an untyped module. If so, ignore resolutionDiagnostic. - if (!isRelative && resolvedModule && !ts.extensionIsTypeScript(resolvedModule.extension)) { + if (resolvedModule && resolvedModule.isExternalLibraryImport && !ts.extensionIsTypeScript(resolvedModule.extension)) { if (isForAugmentation) { var diag = ts.Diagnostics.Invalid_module_name_in_augmentation_Module_0_resolves_to_an_untyped_module_at_1_which_cannot_be_augmented; error(errorNode, diag, moduleReference, resolvedModule.resolvedFileName); @@ -24186,7 +24380,7 @@ var ts; // An external module with an 'export =' declaration resolves to the target of the 'export =' declaration, // and an external module with no 'export =' declaration resolves to the module itself. function resolveExternalModuleSymbol(moduleSymbol, dontResolveAlias) { - return moduleSymbol && getMergedSymbol(resolveSymbol(moduleSymbol.exports.get("export="), dontResolveAlias)) || moduleSymbol; + return moduleSymbol && getMergedSymbol(resolveSymbol(moduleSymbol.exports.get("export=" /* ExportEquals */), dontResolveAlias)) || moduleSymbol; } // An external module with an 'export =' declaration may be referenced as an ES6 module provided the 'export =' // references a symbol that is at least declared as a module or a variable. The target of the 'export =' may @@ -24199,7 +24393,7 @@ var ts; return symbol; } function hasExportAssignmentSymbol(moduleSymbol) { - return moduleSymbol.exports.get("export=") !== undefined; + return moduleSymbol.exports.get("export=" /* ExportEquals */) !== undefined; } function getExportsOfModuleAsArray(moduleSymbol) { return symbolsToArray(getExportsOfModule(moduleSymbol)); @@ -24461,7 +24655,7 @@ var ts; if (symbolFromSymbolTable.flags & 2097152 /* Alias */ && symbolFromSymbolTable.escapedName !== "export=" && !ts.getDeclarationOfKind(symbolFromSymbolTable, 246 /* ExportSpecifier */)) { - if (!useOnlyExternalAliasing || + if (!useOnlyExternalAliasing || // We can use any type of alias to get the name // Is this external alias, then use it to name ts.forEach(symbolFromSymbolTable.declarations, ts.isExternalModuleImportEqualsDeclaration)) { var resolvedImportedSymbol = resolveAlias(symbolFromSymbolTable); @@ -24526,6 +24720,10 @@ var ts; } return false; } + function isTypeSymbolAccessible(typeSymbol, enclosingDeclaration) { + var access = isSymbolAccessible(typeSymbol, enclosingDeclaration, 793064 /* Type */, /*shouldComputeAliasesToMakeVisible*/ false); + return access.accessibility === 0 /* Accessible */; + } /** * Check if the given symbol in given enclosing declaration is accessible and mark all associated alias to be visible if requested * @@ -24608,7 +24806,7 @@ var ts; // because these kind of aliases can be used to name types in declaration file var anyImportSyntax = getAnyImportSyntax(declaration); if (anyImportSyntax && - !(ts.getModifierFlags(anyImportSyntax) & 1 /* Export */) && + !ts.hasModifier(anyImportSyntax, 1 /* Export */) && // import clause without export isDeclarationVisible(anyImportSyntax.parent)) { // In function "buildTypeDisplay" where we decide whether to write type-alias or serialize types, // we want to just check if type- alias is accessible or not but we don't care about emitting those alias at that time @@ -24817,8 +25015,7 @@ var ts; // Ignore constraint/default when creating a usage (as opposed to declaration) of a type parameter. return ts.createTypeReferenceNode(name, /*typeArguments*/ undefined); } - if (!inTypeAlias && type.aliasSymbol && - isSymbolAccessible(type.aliasSymbol, context.enclosingDeclaration, 793064 /* Type */, /*shouldComputeAliasesToMakeVisible*/ false).accessibility === 0 /* Accessible */) { + if (!inTypeAlias && type.aliasSymbol && isTypeSymbolAccessible(type.aliasSymbol, context.enclosingDeclaration)) { var name = symbolToTypeReferenceName(type.aliasSymbol); var typeArgumentNodes = mapToTypeNodes(type.aliasTypeArguments, context); return ts.createTypeReferenceNode(name, typeArgumentNodes); @@ -24900,10 +25097,10 @@ var ts; return createTypeNodeFromObjectType(type); } function shouldWriteTypeOfFunctionSymbol() { - var isStaticMethodSymbol = !!(symbol.flags & 8192 /* Method */ && - ts.forEach(symbol.declarations, function (declaration) { return ts.getModifierFlags(declaration) & 32 /* Static */; })); + var isStaticMethodSymbol = !!(symbol.flags & 8192 /* Method */) && // typeof static method + ts.some(symbol.declarations, function (declaration) { return ts.hasModifier(declaration, 32 /* Static */); }); var isNonLocalFunctionSymbol = !!(symbol.flags & 16 /* Function */) && - (symbol.parent || + (symbol.parent || // is exported function symbol ts.forEach(symbol.declarations, function (declaration) { return declaration.parent.kind === 265 /* SourceFile */ || declaration.parent.kind === 234 /* ModuleBlock */; })); @@ -24914,10 +25111,8 @@ var ts; } } function createTypeNodeFromObjectType(type) { - if (type.objectFlags & 32 /* Mapped */) { - if (getConstraintTypeFromMappedType(type).flags & (16384 /* TypeParameter */ | 262144 /* Index */)) { - return createMappedTypeNodeFromType(type); - } + if (isGenericMappedType(type)) { + return createMappedTypeNodeFromType(type); } var resolved = resolveStructuredTypeMembers(type); if (!resolved.properties.length && !resolved.stringIndexInfo && !resolved.numberIndexInfo) { @@ -25505,7 +25700,7 @@ var ts; buildSymbolDisplay(type.symbol, writer, enclosingDeclaration, 793064 /* Type */, 0 /* None */, nextFlags); } else if (!(flags & 1024 /* InTypeAlias */) && type.aliasSymbol && - isSymbolAccessible(type.aliasSymbol, enclosingDeclaration, 793064 /* Type */, /*shouldComputeAliasesToMakeVisible*/ false).accessibility === 0 /* Accessible */) { + ((flags & 65536 /* UseAliasDefinedOutsideCurrentScope */) || isTypeSymbolAccessible(type.aliasSymbol, enclosingDeclaration))) { var typeArguments = type.aliasTypeArguments; writeSymbolTypeReference(type.aliasSymbol, typeArguments, 0, ts.length(typeArguments), nextFlags); } @@ -25667,9 +25862,7 @@ var ts; if (!symbolStack) { symbolStack = []; } - var isConstructorObject = type.flags & 32768 /* Object */ && - getObjectFlags(type) & 16 /* Anonymous */ && - type.symbol && type.symbol.flags & 32 /* Class */; + var isConstructorObject = type.objectFlags & 16 /* Anonymous */ && type.symbol && type.symbol.flags & 32 /* Class */; if (isConstructorObject) { writeLiteralType(type, flags); } @@ -25685,17 +25878,17 @@ var ts; writeLiteralType(type, flags); } function shouldWriteTypeOfFunctionSymbol() { - var isStaticMethodSymbol = !!(symbol.flags & 8192 /* Method */ && - ts.forEach(symbol.declarations, function (declaration) { return ts.getModifierFlags(declaration) & 32 /* Static */; })); + var isStaticMethodSymbol = !!(symbol.flags & 8192 /* Method */) && // typeof static method + ts.some(symbol.declarations, function (declaration) { return ts.hasModifier(declaration, 32 /* Static */); }); var isNonLocalFunctionSymbol = !!(symbol.flags & 16 /* Function */) && - (symbol.parent || - ts.forEach(symbol.declarations, function (declaration) { + (symbol.parent || // is exported function symbol + ts.some(symbol.declarations, function (declaration) { return declaration.parent.kind === 265 /* SourceFile */ || declaration.parent.kind === 234 /* ModuleBlock */; })); if (isStaticMethodSymbol || isNonLocalFunctionSymbol) { // typeof is allowed only for static/non local functions - return !!(flags & 4 /* UseTypeOfFunction */) || - (ts.contains(symbolStack, symbol)); // it is type of the symbol uses itself recursively + return !!(flags & 4 /* UseTypeOfFunction */) || // use typeof if format flags specify it + ts.contains(symbolStack, symbol); // it is type of the symbol uses itself recursively } } } @@ -25733,11 +25926,9 @@ var ts; return false; } function writeLiteralType(type, flags) { - if (type.objectFlags & 32 /* Mapped */) { - if (getConstraintTypeFromMappedType(type).flags & (16384 /* TypeParameter */ | 262144 /* Index */)) { - writeMappedType(type); - return; - } + if (isGenericMappedType(type)) { + writeMappedType(type); + return; } var resolved = resolveStructuredTypeMembers(type); if (!resolved.properties.length && !resolved.stringIndexInfo && !resolved.numberIndexInfo) { @@ -26113,7 +26304,7 @@ var ts; case 154 /* SetAccessor */: case 151 /* MethodDeclaration */: case 150 /* MethodSignature */: - if (ts.getModifierFlags(node) & (8 /* Private */ | 16 /* Protected */)) { + if (ts.hasModifier(node, 8 /* Private */ | 16 /* Protected */)) { // Private/protected properties/methods are not visible return false; } @@ -26910,8 +27101,8 @@ var ts; // The function allocates a new array if the input type parameter set is undefined, but otherwise it modifies the set // in-place and returns the same array. function appendTypeParameters(typeParameters, declarations) { - for (var _i = 0, declarations_3 = declarations; _i < declarations_3.length; _i++) { - var declaration = declarations_3[_i]; + for (var _i = 0, declarations_2 = declarations; _i < declarations_2.length; _i++) { + var declaration = declarations_2[_i]; var tp = getDeclaredTypeOfTypeParameter(getSymbolOfNode(declaration)); if (!typeParameters) { typeParameters = [tp]; @@ -27055,7 +27246,7 @@ var ts; return type.resolvedBaseTypes; } function resolveBaseTypesOfClass(type) { - type.resolvedBaseTypes = type.resolvedBaseTypes || ts.emptyArray; + type.resolvedBaseTypes = ts.emptyArray; var baseConstructorType = getApparentType(getBaseConstructorTypeOfClass(type)); if (!(baseConstructorType.flags & (32768 /* Object */ | 131072 /* Intersection */ | 1 /* Any */))) { return; @@ -27104,12 +27295,7 @@ var ts; error(valueDecl, ts.Diagnostics.Type_0_recursively_references_itself_as_a_base_type, typeToString(type, /*enclosingDeclaration*/ undefined, 1 /* WriteArrayAsGenericType */)); return; } - if (type.resolvedBaseTypes === ts.emptyArray) { - type.resolvedBaseTypes = [baseType]; - } - else { - type.resolvedBaseTypes.push(baseType); - } + type.resolvedBaseTypes = [baseType]; } function areAllOuterTypeParametersApplied(type) { // An unapplied type parameter has its symbol still the same as the matching argument symbol. @@ -27221,7 +27407,9 @@ var ts; if (!pushTypeResolution(symbol, 2 /* DeclaredType */)) { return unknownType; } - var declaration = ts.findDeclaration(symbol, function (d) { return d.kind === 283 /* JSDocTypedefTag */ || d.kind === 231 /* TypeAliasDeclaration */; }); + var declaration = ts.find(symbol.declarations, function (d) { + return d.kind === 283 /* JSDocTypedefTag */ || d.kind === 231 /* TypeAliasDeclaration */; + }); var type = getTypeFromTypeNode(declaration.kind === 283 /* JSDocTypedefTag */ ? declaration.typeExpression : declaration.type); if (popTypeResolution()) { var typeParameters = getLocalTypeParametersOfClassOrInterfaceOrTypeAlias(symbol); @@ -27753,17 +27941,12 @@ var ts; else { // Combinations of function, class, enum and module var members = emptySymbols; - var constructSignatures = ts.emptyArray; var stringIndexInfo = undefined; if (symbol.exports) { members = getExportsOfSymbol(symbol); } if (symbol.flags & 32 /* Class */) { var classType = getDeclaredTypeOfClassOrInterface(symbol); - constructSignatures = getSignaturesOfSymbol(symbol.members.get("__constructor" /* Constructor */)); - if (!constructSignatures.length) { - constructSignatures = getDefaultConstructSignatures(classType); - } var baseConstructorType = getBaseConstructorTypeOfClass(classType); if (baseConstructorType.flags & (32768 /* Object */ | 131072 /* Intersection */ | 540672 /* TypeVariable */)) { members = ts.createSymbolTable(getNamedMembers(members)); @@ -27774,7 +27957,7 @@ var ts; } } var numberIndexInfo = symbol.flags & 384 /* Enum */ ? enumNumberIndexInfo : undefined; - setStructuredTypeMembers(type, members, ts.emptyArray, constructSignatures, stringIndexInfo, numberIndexInfo); + setStructuredTypeMembers(type, members, ts.emptyArray, ts.emptyArray, stringIndexInfo, numberIndexInfo); // We resolve the members before computing the signatures because a signature may use // typeof with a qualified name expression that circularly references the type we are // in the process of resolving (see issue #6072). The temporarily empty signature list @@ -27782,6 +27965,15 @@ var ts; if (symbol.flags & (16 /* Function */ | 8192 /* Method */)) { type.callSignatures = getSignaturesOfSymbol(symbol); } + // And likewise for construct signatures for classes + if (symbol.flags & 32 /* Class */) { + var classType = getDeclaredTypeOfClassOrInterface(symbol); + var constructSignatures = getSignaturesOfSymbol(symbol.members.get("__constructor" /* Constructor */)); + if (!constructSignatures.length) { + constructSignatures = getDefaultConstructSignatures(classType); + } + type.constructSignatures = constructSignatures; + } } } /** Resolve the members of a mapped type { [P in K]: T } */ @@ -27883,8 +28075,7 @@ var ts; return getObjectFlags(type) & 32 /* Mapped */ && !!type.declaration.questionToken; } function isGenericMappedType(type) { - return getObjectFlags(type) & 32 /* Mapped */ && - maybeTypeOfKind(getConstraintTypeFromMappedType(type), 540672 /* TypeVariable */ | 262144 /* Index */); + return getObjectFlags(type) & 32 /* Mapped */ && isGenericIndexType(getConstraintTypeFromMappedType(type)); } function resolveStructuredTypeMembers(type) { if (!type.members) { @@ -27990,6 +28181,10 @@ var ts; return hasNonCircularBaseConstraint(typeParameter) ? getConstraintFromTypeParameter(typeParameter) : undefined; } function getConstraintOfIndexedAccess(type) { + var transformed = getTransformedIndexedAccessType(type); + if (transformed) { + return transformed; + } var baseObjectType = getBaseConstraintOfType(type.objectType); var baseIndexType = getBaseConstraintOfType(type.indexType); return baseObjectType || baseIndexType ? getIndexedAccessType(baseObjectType || type.objectType, baseIndexType || type.indexType) : undefined; @@ -28057,11 +28252,18 @@ var ts; return stringType; } if (t.flags & 524288 /* IndexedAccess */) { + var transformed = getTransformedIndexedAccessType(t); + if (transformed) { + return getBaseConstraint(transformed); + } var baseObjectType = getBaseConstraint(t.objectType); var baseIndexType = getBaseConstraint(t.indexType); var baseIndexedAccess = baseObjectType && baseIndexType ? getIndexedAccessType(baseObjectType, baseIndexType) : undefined; return baseIndexedAccess && baseIndexedAccess !== unknownType ? getBaseConstraint(baseIndexedAccess) : undefined; } + if (isGenericMappedType(t)) { + return emptyObjectType; + } return t; } } @@ -28608,6 +28810,9 @@ var ts; } return signature.resolvedReturnType; } + function isResolvingReturnTypeOfSignature(signature) { + return !signature.resolvedReturnType && findResolutionCycleStartIndex(signature, 3 /* ResolvedReturnType */) >= 0; + } function getRestTypeOfSignature(signature) { if (signature.hasRestParameter) { var type = getTypeOfSymbol(ts.lastOrUndefined(signature.parameters)); @@ -28680,7 +28885,7 @@ var ts; function getIndexInfoOfSymbol(symbol, kind) { var declaration = getIndexDeclarationOfSymbol(symbol, kind); if (declaration) { - return createIndexInfo(declaration.type ? getTypeFromTypeNode(declaration.type) : anyType, (ts.getModifierFlags(declaration) & 64 /* Readonly */) !== 0, declaration); + return createIndexInfo(declaration.type ? getTypeFromTypeNode(declaration.type) : anyType, ts.hasModifier(declaration, 64 /* Readonly */), declaration); } return undefined; } @@ -28978,8 +29183,8 @@ var ts; function getTypeOfGlobalSymbol(symbol, arity) { function getTypeDeclaration(symbol) { var declarations = symbol.declarations; - for (var _i = 0, declarations_4 = declarations; _i < declarations_4.length; _i++) { - var declaration = declarations_4[_i]; + for (var _i = 0, declarations_3 = declarations; _i < declarations_3.length; _i++) { + var declaration = declarations_3[_i]; switch (declaration.kind) { case 229 /* ClassDeclaration */: case 230 /* InterfaceDeclaration */: @@ -29475,17 +29680,16 @@ var ts; return getTypeOfSymbol(prop); } } - if (isTypeAnyOrAllConstituentTypesHaveKind(indexType, 262178 /* StringLike */ | 84 /* NumberLike */ | 512 /* ESSymbol */)) { + if (!(indexType.flags & 6144 /* Nullable */) && isTypeAssignableToKind(indexType, 262178 /* StringLike */ | 84 /* NumberLike */ | 512 /* ESSymbol */)) { if (isTypeAny(objectType)) { return anyType; } - var indexInfo = isTypeAnyOrAllConstituentTypesHaveKind(indexType, 84 /* NumberLike */) && getIndexInfoOfType(objectType, 1 /* Number */) || + var indexInfo = isTypeAssignableToKind(indexType, 84 /* NumberLike */) && getIndexInfoOfType(objectType, 1 /* Number */) || getIndexInfoOfType(objectType, 0 /* String */) || undefined; if (indexInfo) { if (accessExpression && indexInfo.isReadonly && (ts.isAssignmentTarget(accessExpression) || ts.isDeleteTarget(accessExpression))) { error(accessExpression, ts.Diagnostics.Index_signature_in_type_0_only_permits_reading, typeToString(objectType)); - return unknownType; } return indexInfo.type; } @@ -29517,35 +29721,84 @@ var ts; return anyType; } function getIndexedAccessForMappedType(type, indexType, accessNode) { - var accessExpression = accessNode && accessNode.kind === 180 /* ElementAccessExpression */ ? accessNode : undefined; - if (accessExpression && ts.isAssignmentTarget(accessExpression) && type.declaration.readonlyToken) { - error(accessExpression, ts.Diagnostics.Index_signature_in_type_0_only_permits_reading, typeToString(type)); - return unknownType; + if (accessNode) { + // Check if the index type is assignable to 'keyof T' for the object type. + if (!isTypeAssignableTo(indexType, getIndexType(type))) { + error(accessNode, ts.Diagnostics.Type_0_cannot_be_used_to_index_type_1, typeToString(indexType), typeToString(type)); + return unknownType; + } + if (accessNode.kind === 180 /* ElementAccessExpression */ && ts.isAssignmentTarget(accessNode) && type.declaration.readonlyToken) { + error(accessNode, ts.Diagnostics.Index_signature_in_type_0_only_permits_reading, typeToString(type)); + } } var mapper = createTypeMapper([getTypeParameterFromMappedType(type)], [indexType]); var templateMapper = type.mapper ? combineTypeMappers(type.mapper, mapper) : mapper; return instantiateType(getTemplateTypeFromMappedType(type), templateMapper); } + function isGenericObjectType(type) { + return type.flags & 540672 /* TypeVariable */ ? true : + getObjectFlags(type) & 32 /* Mapped */ ? isGenericIndexType(getConstraintTypeFromMappedType(type)) : + type.flags & 196608 /* UnionOrIntersection */ ? ts.forEach(type.types, isGenericObjectType) : + false; + } + function isGenericIndexType(type) { + return type.flags & (540672 /* TypeVariable */ | 262144 /* Index */) ? true : + type.flags & 196608 /* UnionOrIntersection */ ? ts.forEach(type.types, isGenericIndexType) : + false; + } + // Return true if the given type is a non-generic object type with a string index signature and no + // other members. + function isStringIndexOnlyType(type) { + if (type.flags & 32768 /* Object */ && !isGenericMappedType(type)) { + var t = resolveStructuredTypeMembers(type); + return t.properties.length === 0 && + t.callSignatures.length === 0 && t.constructSignatures.length === 0 && + t.stringIndexInfo && !t.numberIndexInfo; + } + return false; + } + // Given an indexed access type T[K], if T is an intersection containing one or more generic types and one or + // more object types with only a string index signature, e.g. '(U & V & { [x: string]: D })[K]', return a + // transformed type of the form '(U & V)[K] | D'. This allows us to properly reason about higher order indexed + // access types with default property values as expressed by D. + function getTransformedIndexedAccessType(type) { + var objectType = type.objectType; + if (objectType.flags & 131072 /* Intersection */ && isGenericObjectType(objectType) && ts.some(objectType.types, isStringIndexOnlyType)) { + var regularTypes = []; + var stringIndexTypes = []; + for (var _i = 0, _a = objectType.types; _i < _a.length; _i++) { + var t = _a[_i]; + if (isStringIndexOnlyType(t)) { + stringIndexTypes.push(getIndexTypeOfType(t, 0 /* String */)); + } + else { + regularTypes.push(t); + } + } + return getUnionType([ + getIndexedAccessType(getIntersectionType(regularTypes), type.indexType), + getIntersectionType(stringIndexTypes) + ]); + } + return undefined; + } function getIndexedAccessType(objectType, indexType, accessNode) { - // If the index type is generic, if the object type is generic and doesn't originate in an expression, - // or if the object type is a mapped type with a generic constraint, we are performing a higher-order - // index access where we cannot meaningfully access the properties of the object type. Note that for a - // generic T and a non-generic K, we eagerly resolve T[K] if it originates in an expression. This is to - // preserve backwards compatibility. For example, an element access 'this["foo"]' has always been resolved - // eagerly using the constraint type of 'this' at the given location. - if (maybeTypeOfKind(indexType, 540672 /* TypeVariable */ | 262144 /* Index */) || - maybeTypeOfKind(objectType, 540672 /* TypeVariable */) && !(accessNode && accessNode.kind === 180 /* ElementAccessExpression */) || - isGenericMappedType(objectType)) { + // If the object type is a mapped type { [P in K]: E }, where K is generic, we instantiate E using a mapper + // that substitutes the index type for P. For example, for an index access { [P in K]: Box }[X], we + // construct the type Box. + if (isGenericMappedType(objectType)) { + return getIndexedAccessForMappedType(objectType, indexType, accessNode); + } + // Otherwise, if the index type is generic, or if the object type is generic and doesn't originate in an + // expression, we are performing a higher-order index access where we cannot meaningfully access the properties + // of the object type. Note that for a generic T and a non-generic K, we eagerly resolve T[K] if it originates + // in an expression. This is to preserve backwards compatibility. For example, an element access 'this["foo"]' + // has always been resolved eagerly using the constraint type of 'this' at the given location. + if (isGenericIndexType(indexType) || !(accessNode && accessNode.kind === 180 /* ElementAccessExpression */) && isGenericObjectType(objectType)) { if (objectType.flags & 1 /* Any */) { return objectType; } - // If the object type is a mapped type { [P in K]: E }, we instantiate E using a mapper that substitutes - // the index type for P. For example, for an index access { [P in K]: Box }[X], we construct the - // type Box. - if (isGenericMappedType(objectType)) { - return getIndexedAccessForMappedType(objectType, indexType, accessNode); - } - // Otherwise we defer the operation by creating an indexed access type. + // Defer the operation by creating an indexed access type. var id = objectType.id + "," + indexType.id; var type = indexedAccessTypes.get(id); if (!type) { @@ -29759,7 +30012,7 @@ var ts; var container = ts.getThisContainer(node, /*includeArrowFunctions*/ false); var parent = container && container.parent; if (parent && (ts.isClassLike(parent) || parent.kind === 230 /* InterfaceDeclaration */)) { - if (!(ts.getModifierFlags(container) & 32 /* Static */) && + if (!ts.hasModifier(container, 32 /* Static */) && (container.kind !== 152 /* Constructor */ || ts.isNodeDescendantOf(node, container.body))) { return getDeclaredTypeOfClassOrInterface(getSymbolOfNode(parent)).thisType; } @@ -29912,7 +30165,7 @@ var ts; } function cloneTypeMapper(mapper) { return mapper && isInferenceContext(mapper) ? - createInferenceContext(mapper.signature, mapper.flags | 2 /* NoDefault */, mapper.inferences) : + createInferenceContext(mapper.signature, mapper.flags | 2 /* NoDefault */, mapper.compareTypes, mapper.inferences) : mapper; } function identityMapper(type) { @@ -30222,16 +30475,16 @@ var ts; if (ts.forEach(node.parameters, function (p) { return !ts.getEffectiveTypeAnnotationNode(p); })) { return true; } - // For arrow functions we now know we're not context sensitive. - if (node.kind === 187 /* ArrowFunction */) { - return false; + if (node.kind !== 187 /* ArrowFunction */) { + // If the first parameter is not an explicit 'this' parameter, then the function has + // an implicit 'this' parameter which is subject to contextual typing. + var parameter = ts.firstOrUndefined(node.parameters); + if (!(parameter && ts.parameterIsThisKeyword(parameter))) { + return true; + } } - // If the first parameter is not an explicit 'this' parameter, then the function has - // an implicit 'this' parameter which is subject to contextual typing. Otherwise we - // know that all parameters (including 'this') have type annotations and nothing is - // subject to contextual typing. - var parameter = ts.firstOrUndefined(node.parameters); - return !(parameter && ts.parameterIsThisKeyword(parameter)); + // TODO(anhans): A block should be context-sensitive if it has a context-sensitive return value. + return node.body.kind === 207 /* Block */ ? false : isContextSensitive(node.body); } function isContextSensitiveFunctionOrObjectLiteralMethod(func) { return (isFunctionExpressionOrArrowFunction(func) || ts.isObjectLiteralMethod(func)) && isContextSensitiveFunctionLikeDeclaration(func); @@ -30317,7 +30570,7 @@ var ts; return 0 /* False */; } if (source.typeParameters) { - source = instantiateSignatureInContextOf(source, target); + source = instantiateSignatureInContextOf(source, target, /*contextualMapper*/ undefined, compareTypes); } var result = -1 /* True */; var sourceThisType = getThisTypeOfSignature(source); @@ -30376,7 +30629,7 @@ var ts; // The following block preserves behavior forbidding boolean returning functions from being assignable to type guard returning functions if (target.typePredicate) { if (source.typePredicate) { - result &= compareTypePredicateRelatedTo(source.typePredicate, target.typePredicate, reportErrors, errorReporter, compareTypes); + result &= compareTypePredicateRelatedTo(source.typePredicate, target.typePredicate, source.declaration, target.declaration, reportErrors, errorReporter, compareTypes); } else if (ts.isIdentifierTypePredicate(target.typePredicate)) { if (reportErrors) { @@ -30395,7 +30648,7 @@ var ts; } return result; } - function compareTypePredicateRelatedTo(source, target, reportErrors, errorReporter, compareTypes) { + function compareTypePredicateRelatedTo(source, target, sourceDeclaration, targetDeclaration, reportErrors, errorReporter, compareTypes) { if (source.kind !== target.kind) { if (reportErrors) { errorReporter(ts.Diagnostics.A_this_based_type_guard_is_not_compatible_with_a_parameter_based_type_guard); @@ -30404,11 +30657,13 @@ var ts; return 0 /* False */; } if (source.kind === 1 /* Identifier */) { - var sourceIdentifierPredicate = source; - var targetIdentifierPredicate = target; - if (sourceIdentifierPredicate.parameterIndex !== targetIdentifierPredicate.parameterIndex) { + var sourcePredicate = source; + var targetPredicate = target; + var sourceIndex = sourcePredicate.parameterIndex - (ts.getThisParameter(sourceDeclaration) ? 1 : 0); + var targetIndex = targetPredicate.parameterIndex - (ts.getThisParameter(targetDeclaration) ? 1 : 0); + if (sourceIndex !== targetIndex) { if (reportErrors) { - errorReporter(ts.Diagnostics.Parameter_0_is_not_in_the_same_position_as_parameter_1, sourceIdentifierPredicate.parameterName, targetIdentifierPredicate.parameterName); + errorReporter(ts.Diagnostics.Parameter_0_is_not_in_the_same_position_as_parameter_1, sourcePredicate.parameterName, targetPredicate.parameterName); errorReporter(ts.Diagnostics.Type_predicate_0_is_not_assignable_to_1, typePredicateToString(source), typePredicateToString(target)); } return 0 /* False */; @@ -30560,8 +30815,7 @@ var ts; return true; } if (source.flags & 32768 /* Object */ && target.flags & 32768 /* Object */) { - var id = relation !== identityRelation || source.id < target.id ? source.id + "," + target.id : target.id + "," + source.id; - var related = relation.get(id); + var related = relation.get(getRelationKey(source, target, relation)); if (related !== undefined) { return related === 1 /* Succeeded */; } @@ -30697,11 +30951,21 @@ var ts; !(target.flags & 65536 /* Union */) && !isIntersectionConstituent && source !== globalObjectType && - getPropertiesOfType(source).length > 0 && + (getPropertiesOfType(source).length > 0 || + getSignaturesOfType(source, 0 /* Call */).length > 0 || + getSignaturesOfType(source, 1 /* Construct */).length > 0) && isWeakType(target) && !hasCommonProperties(source, target)) { if (reportErrors) { - reportError(ts.Diagnostics.Type_0_has_no_properties_in_common_with_type_1, typeToString(source), typeToString(target)); + var calls = getSignaturesOfType(source, 0 /* Call */); + var constructs = getSignaturesOfType(source, 1 /* Construct */); + if (calls.length > 0 && isRelatedTo(getReturnTypeOfSignature(calls[0]), target, /*reportErrors*/ false) || + constructs.length > 0 && isRelatedTo(getReturnTypeOfSignature(constructs[0]), target, /*reportErrors*/ false)) { + reportError(ts.Diagnostics.Value_of_type_0_has_no_properties_in_common_with_type_1_Did_you_mean_to_call_it, typeToString(source), typeToString(target)); + } + else { + reportError(ts.Diagnostics.Type_0_has_no_properties_in_common_with_type_1, typeToString(source), typeToString(target)); + } } return 0 /* False */; } @@ -30929,7 +31193,7 @@ var ts; if (overflow) { return 0 /* False */; } - var id = relation !== identityRelation || source.id < target.id ? source.id + "," + target.id : target.id + "," + source.id; + var id = getRelationKey(source, target, relation); var related = relation.get(id); if (related !== undefined) { if (reportErrors && related === 2 /* Failed */) { @@ -31411,6 +31675,11 @@ var ts; if (sourceInfo) { return indexInfoRelatedTo(sourceInfo, targetInfo, reportErrors); } + if (isGenericMappedType(source)) { + // A generic mapped type { [P in K]: T } is related to an index signature { [x: string]: U } + // if T is related to U. + return kind === 0 /* String */ && isRelatedTo(getTemplateTypeFromMappedType(source), targetInfo.type, reportErrors); + } if (isObjectLiteralType(source)) { var related = -1 /* True */; if (kind === 0 /* String */) { @@ -31444,8 +31713,8 @@ var ts; if (!sourceSignature.declaration || !targetSignature.declaration) { return true; } - var sourceAccessibility = ts.getModifierFlags(sourceSignature.declaration) & 24 /* NonPublicAccessibilityModifier */; - var targetAccessibility = ts.getModifierFlags(targetSignature.declaration) & 24 /* NonPublicAccessibilityModifier */; + var sourceAccessibility = ts.getSelectedModifierFlags(sourceSignature.declaration, 24 /* NonPublicAccessibilityModifier */); + var targetAccessibility = ts.getSelectedModifierFlags(targetSignature.declaration, 24 /* NonPublicAccessibilityModifier */); // A public, protected and private signature is assignable to a private signature. if (targetAccessibility === 8 /* Private */) { return true; @@ -31464,6 +31733,50 @@ var ts; return false; } } + function isUnconstrainedTypeParameter(type) { + return type.flags & 16384 /* TypeParameter */ && !getConstraintFromTypeParameter(type); + } + function isTypeReferenceWithGenericArguments(type) { + return getObjectFlags(type) & 4 /* Reference */ && ts.some(type.typeArguments, isUnconstrainedTypeParameter); + } + /** + * getTypeReferenceId(A) returns "111=0-12=1" + * where A.id=111 and number.id=12 + */ + function getTypeReferenceId(type, typeParameters) { + var result = "" + type.target.id; + for (var _i = 0, _a = type.typeArguments; _i < _a.length; _i++) { + var t = _a[_i]; + if (isUnconstrainedTypeParameter(t)) { + var index = ts.indexOf(typeParameters, t); + if (index < 0) { + index = typeParameters.length; + typeParameters.push(t); + } + result += "=" + index; + } + else { + result += "-" + t.id; + } + } + return result; + } + /** + * To improve caching, the relation key for two generic types uses the target's id plus ids of the type parameters. + * For other cases, the types ids are used. + */ + function getRelationKey(source, target, relation) { + if (relation === identityRelation && source.id > target.id) { + var temp = source; + source = target; + target = temp; + } + if (isTypeReferenceWithGenericArguments(source) && isTypeReferenceWithGenericArguments(target)) { + var typeParameters = []; + return getTypeReferenceId(source, typeParameters) + "," + getTypeReferenceId(target, typeParameters); + } + return source.id + "," + target.id; + } // Invoke the callback for each underlying property symbol of the given symbol and return the first // value that isn't undefined. function forEachProperty(prop, callback) { @@ -31509,7 +31822,7 @@ var ts; var symbol = type.symbol; if (symbol && symbol.flags & 32 /* Class */) { var declaration = getClassLikeDeclarationOfSymbol(symbol); - if (declaration && ts.getModifierFlags(declaration) & 128 /* Abstract */) { + if (declaration && ts.hasModifier(declaration, 128 /* Abstract */)) { return true; } } @@ -31960,13 +32273,14 @@ var ts; callback(getTypeAtPosition(source, i), getTypeAtPosition(target, i)); } } - function createInferenceContext(signature, flags, baseInferences) { + function createInferenceContext(signature, flags, compareTypes, baseInferences) { var inferences = baseInferences ? ts.map(baseInferences, cloneInferenceInfo) : ts.map(signature.typeParameters, createInferenceInfo); var context = mapper; context.mappedTypes = signature.typeParameters; context.signature = signature; context.inferences = inferences; context.flags = flags; + context.compareTypes = compareTypes || compareTypesAssignable; return context; function mapper(t) { for (var i = 0; i < inferences.length; i++) { @@ -32061,6 +32375,19 @@ var ts; return inference.candidates && getUnionType(inference.candidates, /*subtypeReduction*/ true); } } + function isPossiblyAssignableTo(source, target) { + var properties = getPropertiesOfObjectType(target); + for (var _i = 0, properties_5 = properties; _i < properties_5.length; _i++) { + var targetProp = properties_5[_i]; + if (!(targetProp.flags & (16777216 /* Optional */ | 4194304 /* Prototype */))) { + var sourceProp = getPropertyOfObjectType(source, targetProp.escapedName); + if (!sourceProp) { + return false; + } + } + } + return true; + } function inferTypes(inferences, originalSource, originalTarget, priority) { if (priority === void 0) { priority = 0; } var symbolStack; @@ -32257,15 +32584,19 @@ var ts; return; } } - inferFromProperties(source, target); - inferFromSignatures(source, target, 0 /* Call */); - inferFromSignatures(source, target, 1 /* Construct */); - inferFromIndexTypes(source, target); + // Infer from the members of source and target only if the two types are possibly related. We check + // in both directions because we may be inferring for a co-variant or a contra-variant position. + if (isPossiblyAssignableTo(source, target) || isPossiblyAssignableTo(target, source)) { + inferFromProperties(source, target); + inferFromSignatures(source, target, 0 /* Call */); + inferFromSignatures(source, target, 1 /* Construct */); + inferFromIndexTypes(source, target); + } } function inferFromProperties(source, target) { var properties = getPropertiesOfObjectType(target); - for (var _i = 0, properties_5 = properties; _i < properties_5.length; _i++) { - var targetProp = properties_5[_i]; + for (var _i = 0, properties_6 = properties; _i < properties_6.length; _i++) { + var targetProp = properties_6[_i]; var sourceProp = getPropertyOfObjectType(source, targetProp.escapedName); if (sourceProp) { inferFromTypes(getTypeOfSymbol(sourceProp), getTypeOfSymbol(targetProp)); @@ -32382,7 +32713,7 @@ var ts; var constraint = getConstraintOfTypeParameter(context.signature.typeParameters[index]); if (constraint) { var instantiatedConstraint = instantiateType(constraint, context); - if (!isTypeAssignableTo(inferredType, getTypeWithThisArgument(instantiatedConstraint, inferredType))) { + if (!context.compareTypes(inferredType, getTypeWithThisArgument(instantiatedConstraint, inferredType))) { inference.inferredType = inferredType = instantiatedConstraint; } } @@ -32440,16 +32771,6 @@ var ts; } return undefined; } - function getLeftmostIdentifierOrThis(node) { - switch (node.kind) { - case 71 /* Identifier */: - case 99 /* ThisKeyword */: - return node; - case 179 /* PropertyAccessExpression */: - return getLeftmostIdentifierOrThis(node.expression); - } - return undefined; - } function getBindingElementNameText(element) { if (element.parent.kind === 174 /* ObjectBindingPattern */) { var name = element.propertyName || element.name; @@ -32975,7 +33296,7 @@ var ts; parent.parent.operatorToken.kind === 58 /* EqualsToken */ && parent.parent.left === parent && !ts.isAssignmentTarget(parent.parent) && - isTypeAnyOrAllConstituentTypesHaveKind(getTypeOfExpression(parent.argumentExpression), 84 /* NumberLike */ | 2048 /* Undefined */); + isTypeAssignableToKind(getTypeOfExpression(parent.argumentExpression), 84 /* NumberLike */); return isLengthPushOrUnshift || isElementAssignment; } function maybeTypePredicateCall(node) { @@ -33143,7 +33464,7 @@ var ts; } else { var indexType = getTypeOfExpression(node.left.argumentExpression); - if (isTypeAnyOrAllConstituentTypesHaveKind(indexType, 84 /* NumberLike */ | 2048 /* Undefined */)) { + if (isTypeAssignableToKind(indexType, 84 /* NumberLike */)) { evolvedType_1 = addEvolvingArrayElementType(evolvedType_1, node.right); } } @@ -33978,7 +34299,7 @@ var ts; break; case 149 /* PropertyDeclaration */: case 148 /* PropertySignature */: - if (ts.getModifierFlags(container) & 32 /* Static */) { + if (ts.hasModifier(container, 32 /* Static */)) { error(node, ts.Diagnostics.this_cannot_be_referenced_in_a_static_property_initializer); // do not return here so in case if lexical this is captured - it will be reflected in flags on NodeLinks } @@ -34081,7 +34402,7 @@ var ts; if (!isCallExpression && container.kind === 152 /* Constructor */) { checkThisBeforeSuper(node, container, ts.Diagnostics.super_must_be_called_before_accessing_a_property_of_super_in_the_constructor_of_a_derived_class); } - if ((ts.getModifierFlags(container) & 32 /* Static */) || isCallExpression) { + if (ts.hasModifier(container, 32 /* Static */) || isCallExpression) { nodeCheckFlag = 512 /* SuperStatic */; } else { @@ -34144,7 +34465,7 @@ var ts; // This helper creates an object with a "value" property that wraps the `super` property or indexed access for both get and set. // This is required for destructuring assignments, as a call expression cannot be used as the target of a destructuring assignment // while a property access can. - if (container.kind === 151 /* MethodDeclaration */ && ts.getModifierFlags(container) & 256 /* Async */) { + if (container.kind === 151 /* MethodDeclaration */ && ts.hasModifier(container, 256 /* Async */)) { if (ts.isSuperProperty(node.parent) && ts.isAssignmentTarget(node.parent)) { getNodeLinks(container).flags |= 4096 /* AsyncMethodWithSuperBinding */; } @@ -34202,7 +34523,7 @@ var ts; // - In a static member function or static member accessor // topmost container must be something that is directly nested in the class declaration\object literal expression if (ts.isClassLike(container.parent) || container.parent.kind === 178 /* ObjectLiteralExpression */) { - if (ts.getModifierFlags(container) & 32 /* Static */) { + if (ts.hasModifier(container, 32 /* Static */)) { return container.kind === 151 /* MethodDeclaration */ || container.kind === 150 /* MethodSignature */ || container.kind === 153 /* GetAccessor */ || @@ -34414,7 +34735,7 @@ var ts; // Otherwise, if the containing function is contextually typed by a function type with exactly one call signature // and that call signature is non-generic, return statements are contextually typed by the return type of the signature var signature = getContextualSignatureForFunctionLikeDeclaration(functionDecl); - if (signature) { + if (signature && !isResolvingReturnTypeOfSignature(signature)) { return getReturnTypeOfSignature(signature); } return undefined; @@ -34543,12 +34864,12 @@ var ts; } if (ts.isJsxAttribute(node.parent)) { // JSX expression is in JSX attribute - return getTypeOfPropertyOfType(attributesType, node.parent.name.escapedText); + return getTypeOfPropertyOfContextualType(attributesType, node.parent.name.escapedText); } else if (node.parent.kind === 249 /* JsxElement */) { // JSX expression is in children of JSX Element, we will look for an "children" atttribute (we get the name from JSX.ElementAttributesProperty) var jsxChildrenPropertyName = getJsxElementChildrenPropertyname(); - return jsxChildrenPropertyName && jsxChildrenPropertyName !== "" ? getTypeOfPropertyOfType(attributesType, jsxChildrenPropertyName) : anyType; + return jsxChildrenPropertyName && jsxChildrenPropertyName !== "" ? getTypeOfPropertyOfContextualType(attributesType, jsxChildrenPropertyName) : anyType; } else { // JSX expression is in JSX spread attribute @@ -34564,7 +34885,7 @@ var ts; if (!attributesType || isTypeAny(attributesType)) { return undefined; } - return getTypeOfPropertyOfType(attributesType, attribute.name.escapedText); + return getTypeOfPropertyOfContextualType(attributesType, attribute.name.escapedText); } else { return attributesType; @@ -34832,10 +35153,7 @@ var ts; function isNumericComputedName(name) { // It seems odd to consider an expression of type Any to result in a numeric name, // but this behavior is consistent with checkIndexedAccess - return isTypeAnyOrAllConstituentTypesHaveKind(checkComputedPropertyName(name), 84 /* NumberLike */); - } - function isTypeAnyOrAllConstituentTypesHaveKind(type, kind) { - return isTypeAny(type) || isTypeOfKind(type, kind); + return isTypeAssignableToKind(checkComputedPropertyName(name), 84 /* NumberLike */); } function isInfinityOrNaNString(name) { return name === "Infinity" || name === "-Infinity" || name === "NaN"; @@ -34870,7 +35188,9 @@ var ts; links.resolvedType = checkExpression(node.expression); // This will allow types number, string, symbol or any. It will also allow enums, the unknown // type, and any union of these types (like string | number). - if (!isTypeAnyOrAllConstituentTypesHaveKind(links.resolvedType, 84 /* NumberLike */ | 262178 /* StringLike */ | 512 /* ESSymbol */)) { + if (links.resolvedType.flags & 6144 /* Nullable */ || + !isTypeAssignableToKind(links.resolvedType, 262178 /* StringLike */ | 84 /* NumberLike */ | 512 /* ESSymbol */) && + !isTypeAssignableTo(links.resolvedType, getUnionType([stringType, numberType, esSymbolType]))) { error(node, ts.Diagnostics.A_computed_property_name_must_be_of_type_string_number_symbol_or_any); } else { @@ -35484,9 +35804,7 @@ var ts; * emptyObjectType if there is no "prop" in the element instance type */ function resolveCustomJsxElementAttributesType(openingLikeElement, shouldIncludeAllStatelessAttributesType, elementType, elementClassType) { - if (!elementType) { - elementType = checkExpression(openingLikeElement.tagName); - } + if (elementType === void 0) { elementType = checkExpression(openingLikeElement.tagName); } if (elementType.flags & 65536 /* Union */) { var types = elementType.types; return getUnionType(types.map(function (type) { @@ -35607,11 +35925,12 @@ var ts; */ function getCustomJsxElementAttributesType(node, shouldIncludeAllStatelessAttributesType) { var links = getNodeLinks(node); - if (!links.resolvedJsxElementAttributesType) { + var linkLocation = shouldIncludeAllStatelessAttributesType ? "resolvedJsxElementAllAttributesType" : "resolvedJsxElementAttributesType"; + if (!links[linkLocation]) { var elemClassType = getJsxGlobalElementClassType(); - return links.resolvedJsxElementAttributesType = resolveCustomJsxElementAttributesType(node, shouldIncludeAllStatelessAttributesType, /*elementType*/ undefined, elemClassType); + return links[linkLocation] = resolveCustomJsxElementAttributesType(node, shouldIncludeAllStatelessAttributesType, /*elementType*/ undefined, elemClassType); } - return links.resolvedJsxElementAttributesType; + return links[linkLocation]; } /** * Get all possible attributes type, especially from an overload stateless function component, of the given JSX opening-like element. @@ -35933,9 +36252,12 @@ var ts; } var prop = getPropertyOfType(apparentType, right.escapedText); if (!prop) { - var stringIndexType = getIndexTypeOfType(apparentType, 0 /* String */); - if (stringIndexType) { - return stringIndexType; + var indexInfo = getIndexInfoOfType(apparentType, 0 /* String */); + if (indexInfo && indexInfo.type) { + if (indexInfo.isReadonly && (ts.isAssignmentTarget(node) || ts.isDeleteTarget(node))) { + error(node, ts.Diagnostics.Index_signature_in_type_0_only_permits_reading, typeToString(apparentType)); + } + return indexInfo.type; } if (right.escapedText && !checkAndReportErrorForExtendingInterface(node)) { reportNonexistentProperty(right, type.flags & 16384 /* TypeParameter */ && type.isThisType ? apparentType : type); @@ -36084,7 +36406,7 @@ var ts; if (prop && noUnusedIdentifiers && (prop.flags & 106500 /* ClassMember */) && - prop.valueDeclaration && (ts.getModifierFlags(prop.valueDeclaration) & 8 /* Private */)) { + prop.valueDeclaration && ts.hasModifier(prop.valueDeclaration, 8 /* Private */)) { if (ts.getCheckFlags(prop) & 1 /* Instantiated */) { getSymbolLinks(prop).target.isReferenced = true; } @@ -36407,8 +36729,8 @@ var ts; return undefined; } // Instantiate a generic signature in the context of a non-generic signature (section 3.8.5 in TypeScript spec) - function instantiateSignatureInContextOf(signature, contextualSignature, contextualMapper) { - var context = createInferenceContext(signature, 1 /* InferUnionTypes */); + function instantiateSignatureInContextOf(signature, contextualSignature, contextualMapper, compareTypes) { + var context = createInferenceContext(signature, 1 /* InferUnionTypes */, compareTypes); forEachMatchingParameterType(contextualSignature, signature, function (source, target) { // Type parameters from outer context referenced by source type are fixed by instantiation of the source type inferTypes(context.inferences, instantiateType(source, contextualMapper || identityMapper), target); @@ -36780,7 +37102,7 @@ var ts; return getLiteralType(element.name.text); case 144 /* ComputedPropertyName */: var nameType = checkComputedPropertyName(element.name); - if (isTypeOfKind(nameType, 512 /* ESSymbol */)) { + if (isTypeAssignableToKind(nameType, 512 /* ESSymbol */)) { return nameType; } else { @@ -36921,9 +37243,10 @@ var ts; // // For a decorator, no arguments are susceptible to contextual typing due to the fact // decorators are applied to a declaration by the emitter, and not to an expression. + var isSingleNonGenericCandidate = candidates.length === 1 && !candidates[0].typeParameters; var excludeArgument; var excludeCount = 0; - if (!isDecorator) { + if (!isDecorator && !isSingleNonGenericCandidate) { // We do not need to call `getEffectiveArgumentCount` here as it only // applies when calculating the number of arguments for a decorator. for (var i = isTaggedTemplate ? 1 : 0; i < args.length; i++) { @@ -37068,6 +37391,17 @@ var ts; if (signatureHelpTrailingComma === void 0) { signatureHelpTrailingComma = false; } candidateForArgumentError = undefined; candidateForTypeArgumentError = undefined; + if (isSingleNonGenericCandidate) { + var candidate = candidates[0]; + if (!hasCorrectArity(node, args, candidate, signatureHelpTrailingComma)) { + return undefined; + } + if (!checkApplicableSignature(node, args, candidate, relation, excludeArgument, /*reportErrors*/ false)) { + candidateForArgumentError = candidate; + return undefined; + } + return candidate; + } for (var candidateIndex = 0; candidateIndex < candidates.length; candidateIndex++) { var originalCandidate = candidates[candidateIndex]; if (!hasCorrectArity(node, args, originalCandidate, signatureHelpTrailingComma)) { @@ -37230,7 +37564,7 @@ var ts; // In the case of a merged class-module or class-interface declaration, // only the class declaration node will have the Abstract flag set. var valueDecl = expressionType.symbol && getClassLikeDeclarationOfSymbol(expressionType.symbol); - if (valueDecl && ts.getModifierFlags(valueDecl) & 128 /* Abstract */) { + if (valueDecl && ts.hasModifier(valueDecl, 128 /* Abstract */)) { error(node, ts.Diagnostics.Cannot_create_an_instance_of_the_abstract_class_0, ts.declarationNameToString(ts.getNameOfDeclaration(valueDecl))); return resolveErrorCall(node); } @@ -37277,9 +37611,9 @@ var ts; return true; } var declaration = signature.declaration; - var modifiers = ts.getModifierFlags(declaration); + var modifiers = ts.getSelectedModifierFlags(declaration, 24 /* NonPublicAccessibilityModifier */); // Public constructor is accessible. - if (!(modifiers & 24 /* NonPublicAccessibilityModifier */)) { + if (!modifiers) { return true; } var declaringClassDeclaration = getClassLikeDeclarationOfSymbol(declaration.parent.symbol); @@ -37488,7 +37822,7 @@ var ts; */ function checkCallExpression(node) { // Grammar checking; stop grammar-checking if checkGrammarTypeArguments return true - checkGrammarTypeArguments(node, node.typeArguments) || checkGrammarArguments(node, node.arguments); + checkGrammarTypeArguments(node, node.typeArguments) || checkGrammarArguments(node.arguments); var signature = getResolvedSignature(node); if (node.expression.kind === 97 /* SuperKeyword */) { return voidType; @@ -37528,7 +37862,7 @@ var ts; } function checkImportCallExpression(node) { // Check grammar of dynamic import - checkGrammarArguments(node, node.arguments) || checkGrammarImportCallExpression(node); + checkGrammarArguments(node.arguments) || checkGrammarImportCallExpression(node); if (node.arguments.length === 0) { return createPromiseReturnType(node, anyType); } @@ -37546,11 +37880,33 @@ var ts; if (moduleSymbol) { var esModuleSymbol = resolveESModuleSymbol(moduleSymbol, specifier, /*dontRecursivelyResolve*/ true); if (esModuleSymbol) { - return createPromiseReturnType(node, getTypeOfSymbol(esModuleSymbol)); + return createPromiseReturnType(node, getTypeWithSyntheticDefaultImportType(getTypeOfSymbol(esModuleSymbol), esModuleSymbol)); } } return createPromiseReturnType(node, anyType); } + function getTypeWithSyntheticDefaultImportType(type, symbol) { + if (allowSyntheticDefaultImports && type && type !== unknownType) { + var synthType = type; + if (!synthType.syntheticType) { + if (!getPropertyOfType(type, "default" /* Default */)) { + var memberTable = ts.createSymbolTable(); + var newSymbol = createSymbol(2097152 /* Alias */, "default" /* Default */); + newSymbol.target = resolveSymbol(symbol); + memberTable.set("default" /* Default */, newSymbol); + var anonymousSymbol = createSymbol(2048 /* TypeLiteral */, "__type" /* Type */); + var defaultContainingObject = createAnonymousType(anonymousSymbol, memberTable, ts.emptyArray, ts.emptyArray, /*stringIndexInfo*/ undefined, /*numberIndexInfo*/ undefined); + anonymousSymbol.type = defaultContainingObject; + synthType.syntheticType = getIntersectionType([type, defaultContainingObject]); + } + else { + synthType.syntheticType = type; + } + } + return synthType.syntheticType; + } + return type; + } function isCommonJsRequire(node) { if (!ts.isRequireCall(node, /*checkArgumentIsStringLiteral*/ true)) { return false; @@ -37675,15 +38031,15 @@ var ts; } // When contextual typing assigns a type to a parameter that contains a binding pattern, we also need to push // the destructured type into the contained binding elements. - function assignBindingElementTypes(node) { - if (ts.isBindingPattern(node.name)) { - for (var _i = 0, _a = node.name.elements; _i < _a.length; _i++) { - var element = _a[_i]; - if (!ts.isOmittedExpression(element)) { - if (element.name.kind === 71 /* Identifier */) { - getSymbolLinks(getSymbolOfNode(element)).type = getTypeForBindingElement(element); - } - assignBindingElementTypes(element); + function assignBindingElementTypes(pattern) { + for (var _i = 0, _a = pattern.elements; _i < _a.length; _i++) { + var element = _a[_i]; + if (!ts.isOmittedExpression(element)) { + if (element.name.kind === 71 /* Identifier */) { + getSymbolLinks(getSymbolOfNode(element)).type = getTypeForBindingElement(element); + } + else { + assignBindingElementTypes(element.name); } } } @@ -37692,13 +38048,14 @@ var ts; var links = getSymbolLinks(parameter); if (!links.type) { links.type = contextualType; - var name = ts.getNameOfDeclaration(parameter.valueDeclaration); - // if inference didn't come up with anything but {}, fall back to the binding pattern if present. - if (links.type === emptyObjectType && - (name.kind === 174 /* ObjectBindingPattern */ || name.kind === 175 /* ArrayBindingPattern */)) { - links.type = getTypeFromBindingPattern(name); + var decl = parameter.valueDeclaration; + if (decl.name.kind !== 71 /* Identifier */) { + // if inference didn't come up with anything but {}, fall back to the binding pattern if present. + if (links.type === emptyObjectType) { + links.type = getTypeFromBindingPattern(decl.name); + } + assignBindingElementTypes(decl.name); } - assignBindingElementTypes(parameter.valueDeclaration); } } function createPromiseType(promisedType) { @@ -37934,16 +38291,16 @@ var ts; } function checkFunctionExpressionOrObjectLiteralMethod(node, checkMode) { ts.Debug.assert(node.kind !== 151 /* MethodDeclaration */ || ts.isObjectLiteralMethod(node)); - // Grammar checking - var hasGrammarError = checkGrammarFunctionLikeDeclaration(node); - if (!hasGrammarError && node.kind === 186 /* FunctionExpression */) { - checkGrammarForGenerator(node); - } // The identityMapper object is used to indicate that function expressions are wildcards if (checkMode === 1 /* SkipContextSensitive */ && isContextSensitive(node)) { checkNodeDeferred(node); return anyFunctionType; } + // Grammar checking + var hasGrammarError = checkGrammarFunctionLikeDeclaration(node); + if (!hasGrammarError && node.kind === 186 /* FunctionExpression */) { + checkGrammarForGenerator(node); + } var links = getNodeLinks(node); var type = getTypeOfSymbol(node.symbol); // Check if function expression is contextually typed and assign parameter types if so. @@ -38028,7 +38385,7 @@ var ts; } } function checkArithmeticOperandType(operand, type, diagnostic) { - if (!isTypeAnyOrAllConstituentTypesHaveKind(type, 84 /* NumberLike */)) { + if (!isTypeAssignableToKind(type, 84 /* NumberLike */)) { error(operand, diagnostic); return false; } @@ -38129,8 +38486,13 @@ var ts; if (operandType === silentNeverType) { return silentNeverType; } - if (node.operator === 38 /* MinusToken */ && node.operand.kind === 8 /* NumericLiteral */) { - return getFreshTypeOfLiteralType(getLiteralType(-node.operand.text)); + if (node.operand.kind === 8 /* NumericLiteral */) { + if (node.operator === 38 /* MinusToken */) { + return getFreshTypeOfLiteralType(getLiteralType(-node.operand.text)); + } + else if (node.operator === 37 /* PlusToken */) { + return getFreshTypeOfLiteralType(getLiteralType(+node.operand.text)); + } } switch (node.operator) { case 37 /* PlusToken */: @@ -38186,33 +38548,22 @@ var ts; } return false; } - // Return true if type is of the given kind. A union type is of a given kind if all constituent types - // are of the given kind. An intersection type is of a given kind if at least one constituent type is - // of the given kind. - function isTypeOfKind(type, kind) { - if (type.flags & kind) { - return true; - } - if (type.flags & 65536 /* Union */) { - var types = type.types; - for (var _i = 0, types_18 = types; _i < types_18.length; _i++) { - var t = types_18[_i]; - if (!isTypeOfKind(t, kind)) { - return false; - } - } + function isTypeAssignableToKind(source, kind, strict) { + if (source.flags & kind) { return true; } - if (type.flags & 131072 /* Intersection */) { - var types = type.types; - for (var _a = 0, types_19 = types; _a < types_19.length; _a++) { - var t = types_19[_a]; - if (isTypeOfKind(t, kind)) { - return true; - } - } + if (strict && source.flags & (1 /* Any */ | 1024 /* Void */ | 2048 /* Undefined */ | 4096 /* Null */)) { + return false; } - return false; + return (kind & 84 /* NumberLike */ && isTypeAssignableTo(source, numberType)) || + (kind & 262178 /* StringLike */ && isTypeAssignableTo(source, stringType)) || + (kind & 136 /* BooleanLike */ && isTypeAssignableTo(source, booleanType)) || + (kind & 1024 /* Void */ && isTypeAssignableTo(source, voidType)) || + (kind & 8192 /* Never */ && isTypeAssignableTo(source, neverType)) || + (kind & 4096 /* Null */ && isTypeAssignableTo(source, nullType)) || + (kind & 2048 /* Undefined */ && isTypeAssignableTo(source, undefinedType)) || + (kind & 512 /* ESSymbol */ && isTypeAssignableTo(source, esSymbolType)) || + (kind & 16777216 /* NonPrimitive */ && isTypeAssignableTo(source, nonPrimitiveType)); } function isConstEnumObjectType(type) { return getObjectFlags(type) & 16 /* Anonymous */ && type.symbol && isConstEnumSymbol(type.symbol); @@ -38229,7 +38580,7 @@ var ts; // and the right operand to be of type Any, a subtype of the 'Function' interface type, or have a call or construct signature. // The result is always of the Boolean primitive type. // NOTE: do not raise error if leftType is unknown as related error was already reported - if (isTypeOfKind(leftType, 8190 /* Primitive */)) { + if (!isTypeAny(leftType) && isTypeAssignableToKind(leftType, 8190 /* Primitive */)) { error(left, ts.Diagnostics.The_left_hand_side_of_an_instanceof_expression_must_be_of_type_any_an_object_type_or_a_type_parameter); } // NOTE: do not raise error if right is unknown as related error was already reported @@ -38251,18 +38602,18 @@ var ts; // The in operator requires the left operand to be of type Any, the String primitive type, or the Number primitive type, // and the right operand to be of type Any, an object type, or a type parameter type. // The result is always of the Boolean primitive type. - if (!(isTypeComparableTo(leftType, stringType) || isTypeOfKind(leftType, 84 /* NumberLike */ | 512 /* ESSymbol */))) { + if (!(isTypeComparableTo(leftType, stringType) || isTypeAssignableToKind(leftType, 84 /* NumberLike */ | 512 /* ESSymbol */))) { error(left, ts.Diagnostics.The_left_hand_side_of_an_in_expression_must_be_of_type_any_string_number_or_symbol); } - if (!isTypeAnyOrAllConstituentTypesHaveKind(rightType, 32768 /* Object */ | 540672 /* TypeVariable */ | 16777216 /* NonPrimitive */)) { + if (!isTypeAssignableToKind(rightType, 16777216 /* NonPrimitive */ | 540672 /* TypeVariable */)) { error(right, ts.Diagnostics.The_right_hand_side_of_an_in_expression_must_be_of_type_any_an_object_type_or_a_type_parameter); } return booleanType; } function checkObjectLiteralAssignment(node, sourceType) { var properties = node.properties; - for (var _i = 0, properties_6 = properties; _i < properties_6.length; _i++) { - var p = properties_6[_i]; + for (var _i = 0, properties_7 = properties; _i < properties_7.length; _i++) { + var p = properties_7[_i]; checkObjectLiteralDestructuringPropertyAssignment(sourceType, p, properties); } return sourceType; @@ -38541,30 +38892,28 @@ var ts; if (leftType === silentNeverType || rightType === silentNeverType) { return silentNeverType; } - if (!isTypeOfKind(leftType, 1 /* Any */ | 262178 /* StringLike */) && !isTypeOfKind(rightType, 1 /* Any */ | 262178 /* StringLike */)) { + if (!isTypeAssignableToKind(leftType, 262178 /* StringLike */) && !isTypeAssignableToKind(rightType, 262178 /* StringLike */)) { leftType = checkNonNullType(leftType, left); rightType = checkNonNullType(rightType, right); } var resultType = void 0; - if (isTypeOfKind(leftType, 84 /* NumberLike */) && isTypeOfKind(rightType, 84 /* NumberLike */)) { + if (isTypeAssignableToKind(leftType, 84 /* NumberLike */, /*strict*/ true) && isTypeAssignableToKind(rightType, 84 /* NumberLike */, /*strict*/ true)) { // Operands of an enum type are treated as having the primitive type Number. // If both operands are of the Number primitive type, the result is of the Number primitive type. resultType = numberType; } - else { - if (isTypeOfKind(leftType, 262178 /* StringLike */) || isTypeOfKind(rightType, 262178 /* StringLike */)) { - // If one or both operands are of the String primitive type, the result is of the String primitive type. - resultType = stringType; - } - else if (isTypeAny(leftType) || isTypeAny(rightType)) { - // Otherwise, the result is of type Any. - // NOTE: unknown type here denotes error type. Old compiler treated this case as any type so do we. - resultType = leftType === unknownType || rightType === unknownType ? unknownType : anyType; - } - // Symbols are not allowed at all in arithmetic expressions - if (resultType && !checkForDisallowedESSymbolOperand(operator)) { - return resultType; - } + else if (isTypeAssignableToKind(leftType, 262178 /* StringLike */, /*strict*/ true) || isTypeAssignableToKind(rightType, 262178 /* StringLike */, /*strict*/ true)) { + // If one or both operands are of the String primitive type, the result is of the String primitive type. + resultType = stringType; + } + else if (isTypeAny(leftType) || isTypeAny(rightType)) { + // Otherwise, the result is of type Any. + // NOTE: unknown type here denotes error type. Old compiler treated this case as any type so do we. + resultType = leftType === unknownType || rightType === unknownType ? unknownType : anyType; + } + // Symbols are not allowed at all in arithmetic expressions + if (resultType && !checkForDisallowedESSymbolOperand(operator)) { + return resultType; } if (!resultType) { reportOperatorError(); @@ -38749,13 +39098,12 @@ var ts; return getBestChoiceType(type1, type2); } function checkLiteralExpression(node) { - if (node.kind === 8 /* NumericLiteral */) { - checkGrammarNumericLiteral(node); - } switch (node.kind) { + case 13 /* NoSubstitutionTemplateLiteral */: case 9 /* StringLiteral */: return getFreshTypeOfLiteralType(getLiteralType(node.text)); case 8 /* NumericLiteral */: + checkGrammarNumericLiteral(node); return getFreshTypeOfLiteralType(getLiteralType(+node.text)); case 101 /* TrueKeyword */: return trueType; @@ -38951,6 +39299,7 @@ var ts; return checkSuperExpression(node); case 95 /* NullKeyword */: return nullWideningType; + case 13 /* NoSubstitutionTemplateLiteral */: case 9 /* StringLiteral */: case 8 /* NumericLiteral */: case 101 /* TrueKeyword */: @@ -38958,8 +39307,6 @@ var ts; return checkLiteralExpression(node); case 196 /* TemplateExpression */: return checkTemplateExpression(node); - case 13 /* NoSubstitutionTemplateLiteral */: - return stringType; case 12 /* RegularExpressionLiteral */: return globalRegExpType; case 177 /* ArrayLiteralExpression */: @@ -39058,7 +39405,7 @@ var ts; checkGrammarDecorators(node) || checkGrammarModifiers(node); checkVariableLikeDeclaration(node); var func = ts.getContainingFunction(node); - if (ts.getModifierFlags(node) & 92 /* ParameterPropertyModifier */) { + if (ts.hasModifier(node, 92 /* ParameterPropertyModifier */)) { func = ts.getContainingFunction(node); if (!(func.kind === 152 /* Constructor */ && ts.nodeIsPresent(func.body))) { error(node, ts.Diagnostics.A_parameter_property_is_only_allowed_in_a_constructor_implementation); @@ -39264,7 +39611,7 @@ var ts; } } else { - var isStatic = ts.getModifierFlags(member) & 32 /* Static */; + var isStatic = ts.hasModifier(member, 32 /* Static */); var names = isStatic ? staticNames : instanceNames; var memberName = member.name && ts.getPropertyNameForPropertyNameNode(member.name); if (memberName) { @@ -39320,7 +39667,7 @@ var ts; for (var _i = 0, _a = node.members; _i < _a.length; _i++) { var member = _a[_i]; var memberNameNode = member.name; - var isStatic = ts.getModifierFlags(member) & 32 /* Static */; + var isStatic = ts.hasModifier(member, 32 /* Static */); if (isStatic && memberNameNode) { var memberName = ts.getPropertyNameForPropertyNameNode(memberNameNode); switch (memberName) { @@ -39418,7 +39765,7 @@ var ts; checkFunctionOrMethodDeclaration(node); // Abstract methods cannot have an implementation. // Extra checks are to avoid reporting multiple errors relating to the "abstractness" of the node. - if (ts.getModifierFlags(node) & 128 /* Abstract */ && node.body) { + if (ts.hasModifier(node, 128 /* Abstract */) && node.body) { error(node, ts.Diagnostics.Method_0_cannot_have_an_implementation_because_it_is_marked_abstract, ts.declarationNameToString(node.name)); } } @@ -39458,17 +39805,9 @@ var ts; } return ts.forEachChild(n, containsSuperCall); } - function markThisReferencesAsErrors(n) { - if (n.kind === 99 /* ThisKeyword */) { - error(n, ts.Diagnostics.this_cannot_be_referenced_in_current_location); - } - else if (n.kind !== 186 /* FunctionExpression */ && n.kind !== 228 /* FunctionDeclaration */) { - ts.forEachChild(n, markThisReferencesAsErrors); - } - } function isInstancePropertyWithInitializer(n) { return n.kind === 149 /* PropertyDeclaration */ && - !(ts.getModifierFlags(n) & 32 /* Static */) && + !ts.hasModifier(n, 32 /* Static */) && !!n.initializer; } // TS 1.0 spec (April 2014): 8.3.2 @@ -39488,8 +39827,8 @@ var ts; // - The containing class is a derived class. // - The constructor declares parameter properties // or the containing class declares instance member variables with initializers. - var superCallShouldBeFirst = ts.forEach(node.parent.members, isInstancePropertyWithInitializer) || - ts.forEach(node.parameters, function (p) { return ts.getModifierFlags(p) & 92 /* ParameterPropertyModifier */; }); + var superCallShouldBeFirst = ts.some(node.parent.members, isInstancePropertyWithInitializer) || + ts.some(node.parameters, function (p) { return ts.hasModifier(p, 92 /* ParameterPropertyModifier */); }); // Skip past any prologue directives to find the first statement // to ensure that it was a super call. if (superCallShouldBeFirst) { @@ -39540,10 +39879,12 @@ var ts; var otherKind = node.kind === 153 /* GetAccessor */ ? 154 /* SetAccessor */ : 153 /* GetAccessor */; var otherAccessor = ts.getDeclarationOfKind(node.symbol, otherKind); if (otherAccessor) { - if ((ts.getModifierFlags(node) & 28 /* AccessibilityModifier */) !== (ts.getModifierFlags(otherAccessor) & 28 /* AccessibilityModifier */)) { + var nodeFlags = ts.getModifierFlags(node); + var otherFlags = ts.getModifierFlags(otherAccessor); + if ((nodeFlags & 28 /* AccessibilityModifier */) !== (otherFlags & 28 /* AccessibilityModifier */)) { error(node.name, ts.Diagnostics.Getter_and_setter_accessors_do_not_agree_in_visibility); } - if (ts.hasModifier(node, 128 /* Abstract */) !== ts.hasModifier(otherAccessor, 128 /* Abstract */)) { + if ((nodeFlags & 128 /* Abstract */) !== (otherFlags & 128 /* Abstract */)) { error(node.name, ts.Diagnostics.Accessors_must_both_be_abstract_or_non_abstract); } // TypeScript 1.0 spec (April 2014): 4.5 @@ -39591,7 +39932,7 @@ var ts; function checkTypeReferenceNode(node) { checkGrammarTypeArguments(node, node.typeArguments); if (node.kind === 159 /* TypeReference */ && node.typeName.jsdocDotPos !== undefined && !ts.isInJavaScriptFile(node) && !ts.isInJSDoc(node)) { - grammarErrorAtPos(ts.getSourceFileOfNode(node), node.typeName.jsdocDotPos, 1, ts.Diagnostics.JSDoc_types_can_only_be_used_inside_documentation_comments); + grammarErrorAtPos(node, node.typeName.jsdocDotPos, 1, ts.Diagnostics.JSDoc_types_can_only_be_used_inside_documentation_comments); } var type = getTypeFromTypeReference(node); if (type !== unknownType) { @@ -39600,7 +39941,17 @@ var ts; ts.forEach(node.typeArguments, checkSourceElement); if (produceDiagnostics) { var symbol = getNodeLinks(node).resolvedSymbol; - var typeParameters = symbol.flags & 524288 /* TypeAlias */ ? getSymbolLinks(symbol).typeParameters : type.target.localTypeParameters; + if (!symbol) { + // There is no resolved symbol cached if the type resolved to a builtin + // via JSDoc type reference resolution (eg, Boolean became boolean), none + // of which are generic when they have no associated symbol + error(node, ts.Diagnostics.Type_0_is_not_generic, typeToString(type)); + return; + } + var typeParameters = symbol.flags & 524288 /* TypeAlias */ && getSymbolLinks(symbol).typeParameters; + if (!typeParameters && getObjectFlags(type) & 4 /* Reference */) { + typeParameters = type.target.localTypeParameters; + } checkTypeArgumentConstraints(typeParameters, node.typeArguments); } } @@ -39645,18 +39996,17 @@ var ts; if (isTypeAssignableTo(indexType, getIndexType(objectType))) { return type; } - // Check if we're indexing with a numeric type and the object type is a generic - // type with a constraint that has a numeric index signature. - if (maybeTypeOfKind(objectType, 540672 /* TypeVariable */) && isTypeOfKind(indexType, 84 /* NumberLike */)) { - var constraint = getBaseConstraintOfType(objectType); - if (constraint && getIndexInfoOfType(constraint, 1 /* Number */)) { - return type; - } + // Check if we're indexing with a numeric type and if either object or index types + // is a generic type with a constraint that has a numeric index signature. + if (getIndexInfoOfType(getApparentType(objectType), 1 /* Number */) && isTypeAssignableToKind(indexType, 84 /* NumberLike */)) { + return type; } error(accessNode, ts.Diagnostics.Type_0_cannot_be_used_to_index_type_1, typeToString(indexType), typeToString(objectType)); return type; } function checkIndexedAccessType(node) { + checkSourceElement(node.objectType); + checkSourceElement(node.indexType); checkIndexedAccessIndexType(getTypeFromIndexedAccessTypeNode(node), node); } function checkMappedType(node) { @@ -39667,7 +40017,7 @@ var ts; checkTypeAssignableTo(constraintType, stringType, node.typeParameter.constraint); } function isPrivateWithinAmbient(node) { - return (ts.getModifierFlags(node) & 8 /* Private */) && ts.isInAmbientContext(node); + return ts.hasModifier(node, 8 /* Private */) && ts.isInAmbientContext(node); } function getEffectiveDeclarationFlags(n, flagsToCheck) { var flags = ts.getCombinedModifierFlags(n); @@ -39767,13 +40117,13 @@ var ts; (ts.isComputedPropertyName(node.name) && ts.isComputedPropertyName(subsequentName) || !ts.isComputedPropertyName(node.name) && !ts.isComputedPropertyName(subsequentName) && ts.getEscapedTextOfIdentifierOrLiteral(node.name) === ts.getEscapedTextOfIdentifierOrLiteral(subsequentName))) { var reportError = (node.kind === 151 /* MethodDeclaration */ || node.kind === 150 /* MethodSignature */) && - (ts.getModifierFlags(node) & 32 /* Static */) !== (ts.getModifierFlags(subsequentNode) & 32 /* Static */); + ts.hasModifier(node, 32 /* Static */) !== ts.hasModifier(subsequentNode, 32 /* Static */); // we can get here in two cases // 1. mixed static and instance class members // 2. something with the same name was defined before the set of overloads that prevents them from merging // here we'll report error only for the first case since for second we should already report error in binder if (reportError) { - var diagnostic = ts.getModifierFlags(node) & 32 /* Static */ ? ts.Diagnostics.Function_overload_must_be_static : ts.Diagnostics.Function_overload_must_not_be_static; + var diagnostic = ts.hasModifier(node, 32 /* Static */) ? ts.Diagnostics.Function_overload_must_be_static : ts.Diagnostics.Function_overload_must_not_be_static; error(errorNode_1, diagnostic); } return; @@ -39791,7 +40141,7 @@ var ts; else { // Report different errors regarding non-consecutive blocks of declarations depending on whether // the node in question is abstract. - if (ts.getModifierFlags(node) & 128 /* Abstract */) { + if (ts.hasModifier(node, 128 /* Abstract */)) { error(errorNode, ts.Diagnostics.All_declarations_of_an_abstract_method_must_be_consecutive); } else { @@ -39801,8 +40151,8 @@ var ts; } var duplicateFunctionDeclaration = false; var multipleConstructorImplementation = false; - for (var _i = 0, declarations_5 = declarations; _i < declarations_5.length; _i++) { - var current = declarations_5[_i]; + for (var _i = 0, declarations_4 = declarations; _i < declarations_4.length; _i++) { + var current = declarations_4[_i]; var node = current; var inAmbientContext = ts.isInAmbientContext(node); var inAmbientContextOrInterface = node.parent.kind === 230 /* InterfaceDeclaration */ || node.parent.kind === 163 /* TypeLiteral */ || inAmbientContext; @@ -39859,7 +40209,7 @@ var ts; } // Abstract methods can't have an implementation -- in particular, they don't need one. if (lastSeenNonAmbientDeclaration && !lastSeenNonAmbientDeclaration.body && - !(ts.getModifierFlags(lastSeenNonAmbientDeclaration) & 128 /* Abstract */) && !lastSeenNonAmbientDeclaration.questionToken) { + !ts.hasModifier(lastSeenNonAmbientDeclaration, 128 /* Abstract */) && !lastSeenNonAmbientDeclaration.questionToken) { reportImplementationExpectedError(lastSeenNonAmbientDeclaration); } if (hasOverloads) { @@ -40426,7 +40776,7 @@ var ts; // checkFunctionOrConstructorSymbol wouldn't be called if we didnt ignore javascript function. var firstDeclaration = ts.find(localSymbol.declarations, // Get first non javascript function declaration - function (declaration) { return declaration.kind === node.kind && !ts.isSourceFileJavaScript(ts.getSourceFileOfNode(declaration)); }); + function (declaration) { return declaration.kind === node.kind && !(declaration.flags & 65536 /* JavaScriptFile */); }); // Only type check the symbol once if (node === firstDeclaration) { checkFunctionOrConstructorSymbol(localSymbol); @@ -40569,14 +40919,14 @@ var ts; for (var _i = 0, _a = node.members; _i < _a.length; _i++) { var member = _a[_i]; if (member.kind === 151 /* MethodDeclaration */ || member.kind === 149 /* PropertyDeclaration */) { - if (!member.symbol.isReferenced && ts.getModifierFlags(member) & 8 /* Private */) { + if (!member.symbol.isReferenced && ts.hasModifier(member, 8 /* Private */)) { error(member.name, ts.Diagnostics._0_is_declared_but_never_used, ts.unescapeLeadingUnderscores(member.symbol.escapedName)); } } else if (member.kind === 152 /* Constructor */) { for (var _b = 0, _c = member.parameters; _b < _c.length; _b++) { var parameter = _c[_b]; - if (!parameter.symbol.isReferenced && ts.getModifierFlags(parameter) & 8 /* Private */) { + if (!parameter.symbol.isReferenced && ts.hasModifier(parameter, 8 /* Private */)) { error(parameter.name, ts.Diagnostics.Property_0_is_declared_but_never_used, ts.unescapeLeadingUnderscores(parameter.symbol.escapedName)); } } @@ -40997,7 +41347,7 @@ var ts; 128 /* Abstract */ | 64 /* Readonly */ | 32 /* Static */; - return (ts.getModifierFlags(left) & interestingFlags) === (ts.getModifierFlags(right) & interestingFlags); + return ts.getSelectedModifierFlags(left, interestingFlags) === ts.getSelectedModifierFlags(right, interestingFlags); } function checkVariableDeclaration(node) { checkGrammarVariableDeclaration(node); @@ -41162,7 +41512,7 @@ var ts; } // unknownType is returned i.e. if node.expression is identifier whose name cannot be resolved // in this case error about missing name is already reported - do not report extra one - if (!isTypeAnyOrAllConstituentTypesHaveKind(rightType, 32768 /* Object */ | 540672 /* TypeVariable */ | 16777216 /* NonPrimitive */)) { + if (!isTypeAssignableToKind(rightType, 16777216 /* NonPrimitive */ | 540672 /* TypeVariable */)) { error(node.expression, ts.Diagnostics.The_right_hand_side_of_a_for_in_statement_must_be_of_type_any_an_object_type_or_a_type_parameter); } checkSourceElement(node.statement); @@ -41662,7 +42012,7 @@ var ts; // Only process instance properties with computed names here. // Static properties cannot be in conflict with indexers, // and properties with literal names were already checked. - if (!(ts.getModifierFlags(member) & 32 /* Static */) && ts.hasDynamicName(member)) { + if (!ts.hasModifier(member, 32 /* Static */) && ts.hasDynamicName(member)) { var propType = getTypeOfSymbol(member.symbol); checkIndexConstraintForProperty(member.symbol, propType, type, declaredStringIndexer, stringIndexType, 0 /* String */); checkIndexConstraintForProperty(member.symbol, propType, type, declaredNumberIndexer, numberIndexType, 1 /* Number */); @@ -41773,8 +42123,8 @@ var ts; if (!areTypeParametersIdentical(declarations, type.localTypeParameters)) { // Report an error on every conflicting declaration. var name = symbolToString(symbol); - for (var _i = 0, declarations_6 = declarations; _i < declarations_6.length; _i++) { - var declaration = declarations_6[_i]; + for (var _i = 0, declarations_5 = declarations; _i < declarations_5.length; _i++) { + var declaration = declarations_5[_i]; error(declaration.name, ts.Diagnostics.All_declarations_of_0_must_have_identical_type_parameters, name); } } @@ -41783,8 +42133,8 @@ var ts; function areTypeParametersIdentical(declarations, typeParameters) { var maxTypeArgumentCount = ts.length(typeParameters); var minTypeArgumentCount = getMinTypeArgumentCount(typeParameters); - for (var _i = 0, declarations_7 = declarations; _i < declarations_7.length; _i++) { - var declaration = declarations_7[_i]; + for (var _i = 0, declarations_6 = declarations; _i < declarations_6.length; _i++) { + var declaration = declarations_6[_i]; // If this declaration has too few or too many type parameters, we report an error var numTypeParameters = ts.length(declaration.typeParameters); if (numTypeParameters < minTypeArgumentCount || numTypeParameters > maxTypeArgumentCount) { @@ -41827,7 +42177,7 @@ var ts; registerForUnusedIdentifiersCheck(node); } function checkClassDeclaration(node) { - if (!node.name && !(ts.getModifierFlags(node) & 512 /* Default */)) { + if (!node.name && !ts.hasModifier(node, 512 /* Default */)) { grammarErrorOnFirstToken(node, ts.Diagnostics.A_class_declaration_without_the_default_modifier_must_have_a_name); } checkClassLikeDeclaration(node); @@ -41925,7 +42275,7 @@ var ts; var signatures = getSignaturesOfType(type, 1 /* Construct */); if (signatures.length) { var declaration = signatures[0].declaration; - if (declaration && ts.getModifierFlags(declaration) & 8 /* Private */) { + if (declaration && ts.hasModifier(declaration, 8 /* Private */)) { var typeClassDeclaration = getClassLikeDeclarationOfSymbol(type.symbol); if (!isNodeWithinClass(node, typeClassDeclaration)) { error(node, ts.Diagnostics.Cannot_extend_a_class_0_Class_constructor_is_marked_as_private, getFullyQualifiedName(type.symbol)); @@ -41981,7 +42331,7 @@ var ts; // It is an error to inherit an abstract member without implementing it or being declared abstract. // If there is no declaration for the derived class (as in the case of class expressions), // then the class cannot be declared abstract. - if (baseDeclarationFlags & 128 /* Abstract */ && (!derivedClassDecl || !(ts.getModifierFlags(derivedClassDecl) & 128 /* Abstract */))) { + if (baseDeclarationFlags & 128 /* Abstract */ && (!derivedClassDecl || !ts.hasModifier(derivedClassDecl, 128 /* Abstract */))) { if (derivedClassDecl.kind === 199 /* ClassExpression */) { error(derivedClassDecl, ts.Diagnostics.Non_abstract_class_expression_does_not_implement_inherited_abstract_member_0_from_class_1, symbolToString(baseProperty), typeToString(baseType)); } @@ -42032,8 +42382,8 @@ var ts; for (var _i = 0, baseTypes_2 = baseTypes; _i < baseTypes_2.length; _i++) { var base = baseTypes_2[_i]; var properties = getPropertiesOfType(getTypeWithThisArgument(base, type.thisType)); - for (var _a = 0, properties_7 = properties; _a < properties_7.length; _a++) { - var prop = properties_7[_a]; + for (var _a = 0, properties_8 = properties; _a < properties_8.length; _a++) { + var prop = properties_8[_a]; var existing = seen.get(prop.escapedName); if (!existing) { seen.set(prop.escapedName, { prop: prop, containingType: base }); @@ -42307,8 +42657,8 @@ var ts; } function getFirstNonAmbientClassOrFunctionDeclaration(symbol) { var declarations = symbol.declarations; - for (var _i = 0, declarations_8 = declarations; _i < declarations_8.length; _i++) { - var declaration = declarations_8[_i]; + for (var _i = 0, declarations_7 = declarations; _i < declarations_7.length; _i++) { + var declaration = declarations_7[_i]; if ((declaration.kind === 229 /* ClassDeclaration */ || (declaration.kind === 228 /* FunctionDeclaration */ && ts.nodeIsPresent(declaration.body))) && !ts.isInAmbientContext(declaration)) { @@ -42558,7 +42908,7 @@ var ts; // If we hit an import declaration in an illegal context, just bail out to avoid cascading errors. return; } - if (!checkGrammarDecorators(node) && !checkGrammarModifiers(node) && ts.getModifierFlags(node) !== 0) { + if (!checkGrammarDecorators(node) && !checkGrammarModifiers(node) && ts.hasModifiers(node)) { grammarErrorOnFirstToken(node, ts.Diagnostics.An_import_declaration_cannot_have_modifiers); } if (checkExternalImportOrExportDeclaration(node)) { @@ -42586,7 +42936,7 @@ var ts; checkGrammarDecorators(node) || checkGrammarModifiers(node); if (ts.isInternalModuleImportEqualsDeclaration(node) || checkExternalImportOrExportDeclaration(node)) { checkImportBinding(node); - if (ts.getModifierFlags(node) & 1 /* Export */) { + if (ts.hasModifier(node, 1 /* Export */)) { markExportAsReferenced(node); } if (ts.isInternalModuleImportEqualsDeclaration(node)) { @@ -42617,7 +42967,7 @@ var ts; // If we hit an export in an illegal context, just bail out to avoid cascading errors. return; } - if (!checkGrammarDecorators(node) && !checkGrammarModifiers(node) && ts.getModifierFlags(node) !== 0) { + if (!checkGrammarDecorators(node) && !checkGrammarModifiers(node) && ts.hasModifiers(node)) { grammarErrorOnFirstToken(node, ts.Diagnostics.An_export_declaration_cannot_have_modifiers); } if (!node.moduleSpecifier || checkExternalImportOrExportDeclaration(node)) { @@ -42682,7 +43032,7 @@ var ts; return; } // Grammar checking - if (!checkGrammarDecorators(node) && !checkGrammarModifiers(node) && ts.getModifierFlags(node) !== 0) { + if (!checkGrammarDecorators(node) && !checkGrammarModifiers(node) && ts.hasModifiers(node)) { grammarErrorOnFirstToken(node, ts.Diagnostics.An_export_assignment_cannot_have_modifiers); } if (node.expression.kind === 71 /* Identifier */) { @@ -42736,8 +43086,8 @@ var ts; return; } if (exportedDeclarationsCount > 1) { - for (var _i = 0, declarations_9 = declarations; _i < declarations_9.length; _i++) { - var declaration = declarations_9[_i]; + for (var _i = 0, declarations_8 = declarations; _i < declarations_8.length; _i++) { + var declaration = declarations_8[_i]; if (isNotOverload(declaration)) { diagnostics.add(ts.createDiagnosticForNode(declaration, ts.Diagnostics.Cannot_redeclare_exported_variable_0, ts.unescapeLeadingUnderscores(id))); } @@ -43046,7 +43396,7 @@ var ts; return []; } var symbols = ts.createSymbolTable(); - var memberFlags = 0 /* None */; + var isStatic = false; populateSymbols(); return symbolsToArray(symbols); function populateSymbols() { @@ -43075,7 +43425,7 @@ var ts; // add the type parameters into the symbol table // (type parameters of classDeclaration/classExpression and interface are in member property of the symbol. // Note: that the memberFlags come from previous iteration. - if (!(memberFlags & 32 /* Static */)) { + if (!isStatic) { copySymbols(getSymbolOfNode(location).members, meaning & 793064 /* Type */); } break; @@ -43089,7 +43439,7 @@ var ts; if (ts.introducesArgumentsExoticObject(location)) { copySymbol(argumentsSymbol, meaning); } - memberFlags = ts.getModifierFlags(location); + isStatic = ts.hasModifier(location, 32 /* Static */); location = location.parent; } copySymbols(globals, meaning); @@ -43351,12 +43701,7 @@ var ts; // index access if (node.parent.kind === 180 /* ElementAccessExpression */ && node.parent.argumentExpression === node) { var objectType = getTypeOfExpression(node.parent.expression); - if (objectType === unknownType) - return undefined; - var apparentType = getApparentType(objectType); - if (apparentType === unknownType) - return undefined; - return getPropertyOfType(apparentType, node.text); + return getPropertyOfType(objectType, node.text); } break; } @@ -43487,7 +43832,7 @@ var ts; */ function getParentTypeOfClassElement(node) { var classSymbol = getSymbolOfNode(node.parent); - return ts.getModifierFlags(node) & 32 /* Static */ + return ts.hasModifier(node, 32 /* Static */) ? getTypeOfSymbol(classSymbol) : getDeclaredTypeOfSymbol(classSymbol); } @@ -43769,13 +44114,13 @@ var ts; return strictNullChecks && !isOptionalParameter(parameter) && parameter.initializer && - !(ts.getModifierFlags(parameter) & 92 /* ParameterPropertyModifier */); + !ts.hasModifier(parameter, 92 /* ParameterPropertyModifier */); } function isOptionalUninitializedParameterProperty(parameter) { return strictNullChecks && isOptionalParameter(parameter) && !parameter.initializer && - !!(ts.getModifierFlags(parameter) & 92 /* ParameterPropertyModifier */); + ts.hasModifier(parameter, 92 /* ParameterPropertyModifier */); } function getNodeCheckFlags(node) { return getNodeLinks(node).flags; @@ -43835,22 +44180,22 @@ var ts; else if (type.flags & 1 /* Any */) { return ts.TypeReferenceSerializationKind.ObjectType; } - else if (isTypeOfKind(type, 1024 /* Void */ | 6144 /* Nullable */ | 8192 /* Never */)) { + else if (isTypeAssignableToKind(type, 1024 /* Void */ | 6144 /* Nullable */ | 8192 /* Never */)) { return ts.TypeReferenceSerializationKind.VoidNullableOrNeverType; } - else if (isTypeOfKind(type, 136 /* BooleanLike */)) { + else if (isTypeAssignableToKind(type, 136 /* BooleanLike */)) { return ts.TypeReferenceSerializationKind.BooleanType; } - else if (isTypeOfKind(type, 84 /* NumberLike */)) { + else if (isTypeAssignableToKind(type, 84 /* NumberLike */)) { return ts.TypeReferenceSerializationKind.NumberLikeType; } - else if (isTypeOfKind(type, 262178 /* StringLike */)) { + else if (isTypeAssignableToKind(type, 262178 /* StringLike */)) { return ts.TypeReferenceSerializationKind.StringLikeType; } else if (isTupleType(type)) { return ts.TypeReferenceSerializationKind.ArrayLikeType; } - else if (isTypeOfKind(type, 512 /* ESSymbol */)) { + else if (isTypeAssignableToKind(type, 512 /* ESSymbol */)) { return ts.TypeReferenceSerializationKind.ESSymbolType; } else if (isFunctionType(type)) { @@ -44346,7 +44691,7 @@ var ts; node.kind !== 154 /* SetAccessor */) { return grammarErrorOnNode(modifier, ts.Diagnostics.abstract_modifier_can_only_appear_on_a_class_method_or_property_declaration); } - if (!(node.parent.kind === 229 /* ClassDeclaration */ && ts.getModifierFlags(node.parent) & 128 /* Abstract */)) { + if (!(node.parent.kind === 229 /* ClassDeclaration */ && ts.hasModifier(node.parent, 128 /* Abstract */))) { return grammarErrorOnNode(modifier, ts.Diagnostics.Abstract_methods_can_only_appear_within_an_abstract_class); } if (flags & 32 /* Static */) { @@ -44469,8 +44814,7 @@ var ts; if (list && list.hasTrailingComma) { var start = list.end - ",".length; var end = list.end; - var sourceFile = ts.getSourceFileOfNode(list[0]); - return grammarErrorAtPos(sourceFile, start, end - start, ts.Diagnostics.Trailing_comma_not_allowed); + return grammarErrorAtPos(list[0], start, end - start, ts.Diagnostics.Trailing_comma_not_allowed); } } function checkGrammarTypeParameterList(typeParameters, file) { @@ -44547,7 +44891,7 @@ var ts; if (parameter.dotDotDotToken) { return grammarErrorOnNode(parameter.dotDotDotToken, ts.Diagnostics.An_index_signature_cannot_have_a_rest_parameter); } - if (ts.getModifierFlags(parameter) !== 0) { + if (ts.hasModifiers(parameter)) { return grammarErrorOnNode(parameter.name, ts.Diagnostics.An_index_signature_parameter_cannot_have_an_accessibility_modifier); } if (parameter.questionToken) { @@ -44582,19 +44926,18 @@ var ts; return checkGrammarForDisallowedTrailingComma(typeArguments) || checkGrammarForAtLeastOneTypeArgument(node, typeArguments); } - function checkGrammarForOmittedArgument(node, args) { + function checkGrammarForOmittedArgument(args) { if (args) { - var sourceFile = ts.getSourceFileOfNode(node); for (var _i = 0, args_5 = args; _i < args_5.length; _i++) { var arg = args_5[_i]; if (arg.kind === 200 /* OmittedExpression */) { - return grammarErrorAtPos(sourceFile, arg.pos, 0, ts.Diagnostics.Argument_expression_expected); + return grammarErrorAtPos(arg, arg.pos, 0, ts.Diagnostics.Argument_expression_expected); } } } } - function checkGrammarArguments(node, args) { - return checkGrammarForOmittedArgument(node, args); + function checkGrammarArguments(args) { + return checkGrammarForOmittedArgument(args); } function checkGrammarHeritageClause(node) { var types = node.types; @@ -44603,8 +44946,7 @@ var ts; } if (types && types.length === 0) { var listType = ts.tokenToString(node.token); - var sourceFile = ts.getSourceFileOfNode(node); - return grammarErrorAtPos(sourceFile, types.pos, 0, ts.Diagnostics._0_list_cannot_be_empty, listType); + return grammarErrorAtPos(node, types.pos, 0, ts.Diagnostics._0_list_cannot_be_empty, listType); } return ts.forEach(types, checkGrammarExpressionWithTypeArguments); } @@ -44850,10 +45192,10 @@ var ts; else if (ts.isInAmbientContext(accessor)) { return grammarErrorOnNode(accessor.name, ts.Diagnostics.An_accessor_cannot_be_declared_in_an_ambient_context); } - else if (accessor.body === undefined && !(ts.getModifierFlags(accessor) & 128 /* Abstract */)) { - return grammarErrorAtPos(ts.getSourceFileOfNode(accessor), accessor.end - 1, ";".length, ts.Diagnostics._0_expected, "{"); + else if (accessor.body === undefined && !ts.hasModifier(accessor, 128 /* Abstract */)) { + return grammarErrorAtPos(accessor, accessor.end - 1, ";".length, ts.Diagnostics._0_expected, "{"); } - else if (accessor.body && ts.getModifierFlags(accessor) & 128 /* Abstract */) { + else if (accessor.body && ts.hasModifier(accessor, 128 /* Abstract */)) { return grammarErrorOnNode(accessor, ts.Diagnostics.An_abstract_accessor_cannot_have_an_implementation); } else if (accessor.typeParameters) { @@ -44910,7 +45252,7 @@ var ts; return true; } else if (node.body === undefined) { - return grammarErrorAtPos(ts.getSourceFileOfNode(node), node.end - 1, ";".length, ts.Diagnostics._0_expected, "{"); + return grammarErrorAtPos(node, node.end - 1, ";".length, ts.Diagnostics._0_expected, "{"); } } if (ts.isClassLike(node.parent)) { @@ -44991,7 +45333,7 @@ var ts; } if (node.initializer) { // Error on equals token which immediately precedes the initializer - return grammarErrorAtPos(ts.getSourceFileOfNode(node), node.initializer.pos - 1, 1, ts.Diagnostics.A_rest_element_cannot_have_an_initializer); + return grammarErrorAtPos(node, node.initializer.pos - 1, 1, ts.Diagnostics.A_rest_element_cannot_have_an_initializer); } } } @@ -45012,13 +45354,13 @@ var ts; else { // Error on equals token which immediate precedes the initializer var equalsTokenLength = "=".length; - return grammarErrorAtPos(ts.getSourceFileOfNode(node), node.initializer.pos - equalsTokenLength, equalsTokenLength, ts.Diagnostics.Initializers_are_not_allowed_in_ambient_contexts); + return grammarErrorAtPos(node, node.initializer.pos - equalsTokenLength, equalsTokenLength, ts.Diagnostics.Initializers_are_not_allowed_in_ambient_contexts); } } if (node.initializer && !(ts.isConst(node) && isStringOrNumberLiteralExpression(node.initializer))) { // Error on equals token which immediate precedes the initializer var equalsTokenLength = "=".length; - return grammarErrorAtPos(ts.getSourceFileOfNode(node), node.initializer.pos - equalsTokenLength, equalsTokenLength, ts.Diagnostics.Initializers_are_not_allowed_in_ambient_contexts); + return grammarErrorAtPos(node, node.initializer.pos - equalsTokenLength, equalsTokenLength, ts.Diagnostics.Initializers_are_not_allowed_in_ambient_contexts); } } else if (!node.initializer) { @@ -45081,7 +45423,7 @@ var ts; return true; } if (!declarationList.declarations.length) { - return grammarErrorAtPos(ts.getSourceFileOfNode(declarationList), declarations.pos, declarations.end - declarations.pos, ts.Diagnostics.Variable_declaration_list_cannot_be_empty); + return grammarErrorAtPos(declarationList, declarations.pos, declarations.end - declarations.pos, ts.Diagnostics.Variable_declaration_list_cannot_be_empty); } } function allowLetAndConstDeclarations(parent) { @@ -45127,7 +45469,8 @@ var ts; return true; } } - function grammarErrorAtPos(sourceFile, start, length, message, arg0, arg1, arg2) { + function grammarErrorAtPos(nodeForSourceFile, start, length, message, arg0, arg1, arg2) { + var sourceFile = ts.getSourceFileOfNode(nodeForSourceFile); if (!hasParseDiagnostics(sourceFile)) { diagnostics.add(ts.createFileDiagnostic(sourceFile, start, length, message, arg0, arg1, arg2)); return true; @@ -45142,7 +45485,7 @@ var ts; } function checkGrammarConstructorTypeParameters(node) { if (node.typeParameters) { - return grammarErrorAtPos(ts.getSourceFileOfNode(node), node.typeParameters.pos, node.typeParameters.end - node.typeParameters.pos, ts.Diagnostics.Type_parameters_cannot_appear_on_a_constructor_declaration); + return grammarErrorAtPos(node, node.typeParameters.pos, node.typeParameters.end - node.typeParameters.pos, ts.Diagnostics.Type_parameters_cannot_appear_on_a_constructor_declaration); } } function checkGrammarConstructorTypeAnnotation(node) { @@ -45196,7 +45539,7 @@ var ts; node.kind === 244 /* ExportDeclaration */ || node.kind === 243 /* ExportAssignment */ || node.kind === 236 /* NamespaceExportDeclaration */ || - ts.getModifierFlags(node) & (2 /* Ambient */ | 1 /* Export */ | 512 /* Default */)) { + ts.hasModifier(node, 2 /* Ambient */ | 1 /* Export */ | 512 /* Default */)) { return false; } return grammarErrorOnFirstToken(node, ts.Diagnostics.A_declare_modifier_is_required_for_a_top_level_declaration_in_a_d_ts_file); @@ -48142,7 +48485,7 @@ var ts; function createExpressionForAccessorDeclaration(properties, property, receiver, multiLine) { var _a = ts.getAllAccessorDeclarations(properties, property), firstAccessor = _a.firstAccessor, getAccessor = _a.getAccessor, setAccessor = _a.setAccessor; if (property === firstAccessor) { - var properties_8 = []; + var properties_9 = []; if (getAccessor) { var getterFunction = ts.createFunctionExpression(getAccessor.modifiers, /*asteriskToken*/ undefined, @@ -48152,7 +48495,7 @@ var ts; ts.setTextRange(getterFunction, getAccessor); ts.setOriginalNode(getterFunction, getAccessor); var getter = ts.createPropertyAssignment("get", getterFunction); - properties_8.push(getter); + properties_9.push(getter); } if (setAccessor) { var setterFunction = ts.createFunctionExpression(setAccessor.modifiers, @@ -48163,15 +48506,15 @@ var ts; ts.setTextRange(setterFunction, setAccessor); ts.setOriginalNode(setterFunction, setAccessor); var setter = ts.createPropertyAssignment("set", setterFunction); - properties_8.push(setter); + properties_9.push(setter); } - properties_8.push(ts.createPropertyAssignment("enumerable", ts.createTrue())); - properties_8.push(ts.createPropertyAssignment("configurable", ts.createTrue())); + properties_9.push(ts.createPropertyAssignment("enumerable", ts.createTrue())); + properties_9.push(ts.createPropertyAssignment("configurable", ts.createTrue())); var expression = ts.setTextRange(ts.createCall(ts.createPropertyAccess(ts.createIdentifier("Object"), "defineProperty"), /*typeArguments*/ undefined, [ receiver, createExpressionForPropertyName(property.name), - ts.createObjectLiteral(properties_8, multiLine) + ts.createObjectLiteral(properties_9, multiLine) ]), /*location*/ firstAccessor); return ts.aggregateTransformFlags(expression); @@ -50628,11 +50971,14 @@ var ts; : numElements, location), /*reuseIdentifierExpressions*/ false, location); } - else if (numElements !== 1 && (flattenContext.level < 1 /* ObjectRest */ || numElements === 0)) { + else if (numElements !== 1 && (flattenContext.level < 1 /* ObjectRest */ || numElements === 0) + || ts.every(elements, ts.isOmittedExpression)) { // For anything other than a single-element destructuring we need to generate a temporary // to ensure value is evaluated exactly once. Additionally, if we have zero elements // we need to emit *something* to ensure that in case a 'var' keyword was already emitted, // so in that case, we'll intentionally create that temporary. + // Or all the elements of the binding pattern are omitted expression such as "var [,] = [1,2]", + // then we will create temporary variable. var reuseIdentifierExpressions = !ts.isDeclarationBindingElement(parent) || numElements !== 0; value = ensureIdentifier(flattenContext, value, reuseIdentifierExpressions, location); } @@ -50919,7 +51265,16 @@ var ts; if (ts.hasModifier(node, 2 /* Ambient */)) { break; } - recordEmittedDeclarationInScope(node); + // Record these declarations provided that they have a name. + if (node.name) { + recordEmittedDeclarationInScope(node); + } + else { + // These nodes should always have names unless they are default-exports; + // however, class declaration parsing allows for undefined names, so syntactically invalid + // programs may also have an undefined name. + ts.Debug.assert(node.kind === 229 /* ClassDeclaration */ || ts.hasModifier(node, 512 /* Default */)); + } break; } } @@ -51748,8 +52103,8 @@ var ts; * @param receiver The receiver on which each property should be assigned. */ function addInitializedPropertyStatements(statements, properties, receiver) { - for (var _i = 0, properties_9 = properties; _i < properties_9.length; _i++) { - var property = properties_9[_i]; + for (var _i = 0, properties_10 = properties; _i < properties_10.length; _i++) { + var property = properties_10[_i]; var statement = ts.createStatement(transformInitializedProperty(property, receiver)); ts.setSourceMapRange(statement, ts.moveRangePastModifiers(property)); ts.setCommentRange(statement, property); @@ -51764,8 +52119,8 @@ var ts; */ function generateInitializedPropertyExpressions(properties, receiver) { var expressions = []; - for (var _i = 0, properties_10 = properties; _i < properties_10.length; _i++) { - var property = properties_10[_i]; + for (var _i = 0, properties_11 = properties; _i < properties_11.length; _i++) { + var property = properties_11[_i]; var expression = transformInitializedProperty(property, receiver); expression.startsOnNewLine = true; ts.setSourceMapRange(expression, ts.moveRangePastModifiers(property)); @@ -52928,33 +53283,30 @@ var ts; /** * Records that a declaration was emitted in the current scope, if it was the first * declaration for the provided symbol. - * - * NOTE: if there is ever a transformation above this one, we may not be able to rely - * on symbol names. */ function recordEmittedDeclarationInScope(node) { - var name = node.symbol && node.symbol.escapedName; - if (name) { - if (!currentScopeFirstDeclarationsOfName) { - currentScopeFirstDeclarationsOfName = ts.createUnderscoreEscapedMap(); - } - if (!currentScopeFirstDeclarationsOfName.has(name)) { - currentScopeFirstDeclarationsOfName.set(name, node); - } + if (!currentScopeFirstDeclarationsOfName) { + currentScopeFirstDeclarationsOfName = ts.createUnderscoreEscapedMap(); + } + var name = declaredNameInScope(node); + if (!currentScopeFirstDeclarationsOfName.has(name)) { + currentScopeFirstDeclarationsOfName.set(name, node); } } /** - * Determines whether a declaration is the first declaration with the same name emitted - * in the current scope. + * Determines whether a declaration is the first declaration with + * the same name emitted in the current scope. */ function isFirstEmittedDeclarationInScope(node) { if (currentScopeFirstDeclarationsOfName) { - var name = node.symbol && node.symbol.escapedName; - if (name) { - return currentScopeFirstDeclarationsOfName.get(name) === node; - } + var name = declaredNameInScope(node); + return currentScopeFirstDeclarationsOfName.get(name) === node; } - return false; + return true; + } + function declaredNameInScope(node) { + ts.Debug.assertNode(node.name, ts.isIdentifier); + return node.name.escapedText; } /** * Adds a leading VariableStatement for a enum or module declaration. @@ -53021,7 +53373,7 @@ var ts; if (!shouldEmitModuleDeclaration(node)) { return ts.createNotEmittedStatement(node); } - ts.Debug.assert(ts.isIdentifier(node.name), "TypeScript module should have an Identifier name."); + ts.Debug.assertNode(node.name, ts.isIdentifier, "A TypeScript namespace should have an Identifier name."); enableSubstitutionForNamespaceExports(); var statements = []; // We request to be advised when the printer is about to print this node. This allows @@ -54050,6 +54402,8 @@ var ts; return visitExpressionStatement(node); case 185 /* ParenthesizedExpression */: return visitParenthesizedExpression(node, noDestructuringValue); + case 260 /* CatchClause */: + return visitCatchClause(node); default: return ts.visitEachChild(node, visitor, context); } @@ -54130,6 +54484,12 @@ var ts; function visitParenthesizedExpression(node, noDestructuringValue) { return ts.visitEachChild(node, noDestructuringValue ? visitorNoDestructuringValue : visitor, context); } + function visitCatchClause(node) { + if (!node.variableDeclaration) { + return ts.updateCatchClause(node, ts.createVariableDeclaration(ts.createTempVariable(/*recordTempVariable*/ undefined)), ts.visitNode(node.block, visitor, ts.isBlock)); + } + return ts.visitEachChild(node, visitor, context); + } /** * Visits a BinaryExpression that contains a destructuring assignment. * @@ -54674,7 +55034,7 @@ var ts; objectProperties = ts.createAssignHelper(context, segments); } } - var element = ts.createExpressionForJsxElement(context.getEmitResolver().getJsxFactoryEntity(), compilerOptions.reactNamespace, tagName, objectProperties, ts.filter(ts.map(children, transformJsxChildToExpression), ts.isDefined), node, location); + var element = ts.createExpressionForJsxElement(context.getEmitResolver().getJsxFactoryEntity(), compilerOptions.reactNamespace, tagName, objectProperties, ts.mapDefined(children, transformJsxChildToExpression), node, location); if (isChild) { ts.startOnNewLine(element); } @@ -55378,7 +55738,7 @@ var ts; function shouldVisitNode(node) { return (node.transformFlags & 128 /* ContainsES2015 */) !== 0 || convertedLoopState !== undefined - || (hierarchyFacts & 4096 /* ConstructorWithCapturedSuper */ && ts.isStatement(node)) + || (hierarchyFacts & 4096 /* ConstructorWithCapturedSuper */ && (ts.isStatement(node) || (node.kind === 207 /* Block */))) || (ts.isIterationStatement(node, /*lookInLabeledStatements*/ false) && shouldConvertIterationStatementBody(node)) || isTypeScriptClassWrapper(node); } @@ -55733,10 +56093,12 @@ var ts; var outer = ts.createPartiallyEmittedExpression(inner); outer.end = ts.skipTrivia(currentText, node.pos); ts.setEmitFlags(outer, 1536 /* NoComments */); - return ts.createParen(ts.createCall(outer, + var result = ts.createParen(ts.createCall(outer, /*typeArguments*/ undefined, extendsClauseElement ? [ts.visitNode(extendsClauseElement.expression, visitor, ts.isExpression)] : [])); + ts.addSyntheticLeadingComment(result, 3 /* MultiLineCommentTrivia */, "* @class "); + return result; } /** * Transforms a ClassExpression or ClassDeclaration into a function body. @@ -56654,13 +57016,14 @@ var ts; ts.setTextRange(declarationList, node); ts.setCommentRange(declarationList, node); if (node.transformFlags & 8388608 /* ContainsBindingPattern */ - && (ts.isBindingPattern(node.declarations[0].name) - || ts.isBindingPattern(ts.lastOrUndefined(node.declarations).name))) { + && (ts.isBindingPattern(node.declarations[0].name) || ts.isBindingPattern(ts.lastOrUndefined(node.declarations).name))) { // If the first or last declaration is a binding pattern, we need to modify // the source map range for the declaration list. var firstDeclaration = ts.firstOrUndefined(declarations); - var lastDeclaration = ts.lastOrUndefined(declarations); - ts.setSourceMapRange(declarationList, ts.createRange(firstDeclaration.pos, lastDeclaration.end)); + if (firstDeclaration) { + var lastDeclaration = ts.lastOrUndefined(declarations); + ts.setSourceMapRange(declarationList, ts.createRange(firstDeclaration.pos, lastDeclaration.end)); + } } return declarationList; } @@ -57405,6 +57768,7 @@ var ts; function visitCatchClause(node) { var ancestorFacts = enterSubtree(4032 /* BlockScopeExcludes */, 0 /* BlockScopeIncludes */); var updated; + ts.Debug.assert(!!node.variableDeclaration, "Catch clause variable should always be present when downleveling ES2015."); if (ts.isBindingPattern(node.variableDeclaration.name)) { var temp = ts.createTempVariable(/*recordTempVariable*/ undefined); var newVariableDeclaration = ts.createVariableDeclaration(temp); @@ -59593,8 +59957,13 @@ var ts; } function transformAndEmitContinueStatement(node) { var label = findContinueTarget(node.label ? ts.unescapeLeadingUnderscores(node.label.escapedText) : undefined); - ts.Debug.assert(label > 0, "Expected continue statment to point to a valid Label."); - emitBreak(label, /*location*/ node); + if (label > 0) { + emitBreak(label, /*location*/ node); + } + else { + // invalid continue without a containing loop. Leave the node as is, per #17875. + emitStatement(node); + } } function visitContinueStatement(node) { if (inStatementContainingYield) { @@ -59607,8 +59976,13 @@ var ts; } function transformAndEmitBreakStatement(node) { var label = findBreakTarget(node.label ? ts.unescapeLeadingUnderscores(node.label.escapedText) : undefined); - ts.Debug.assert(label > 0, "Expected break statment to point to a valid Label."); - emitBreak(label, /*location*/ node); + if (label > 0) { + emitBreak(label, /*location*/ node); + } + else { + // invalid break without a containing loop, switch, or labeled statement. Leave the node as is, per #17875. + emitStatement(node); + } } function visitBreakStatement(node) { if (inStatementContainingYield) { @@ -59979,9 +60353,6 @@ var ts; var block = endBlock(); markLabel(block.endLabel); } - function isWithBlock(block) { - return block.kind === 1 /* With */; - } /** * Begins a code block for a generated `try` statement. */ @@ -60065,9 +60436,6 @@ var ts; emitNop(); exception.state = 3 /* Done */; } - function isExceptionBlock(block) { - return block.kind === 0 /* Exception */; - } /** * Begins a code block that supports `break` or `continue` statements that are defined in * the source tree and not from generated code. @@ -60218,23 +60586,24 @@ var ts; * @param labelText An optional name of a containing labeled statement. */ function findBreakTarget(labelText) { - ts.Debug.assert(blocks !== undefined); - if (labelText) { - for (var i = blockStack.length - 1; i >= 0; i--) { - var block = blockStack[i]; - if (supportsLabeledBreakOrContinue(block) && block.labelText === labelText) { - return block.breakLabel; - } - else if (supportsUnlabeledBreak(block) && hasImmediateContainingLabeledBlock(labelText, i - 1)) { - return block.breakLabel; + if (blockStack) { + if (labelText) { + for (var i = blockStack.length - 1; i >= 0; i--) { + var block = blockStack[i]; + if (supportsLabeledBreakOrContinue(block) && block.labelText === labelText) { + return block.breakLabel; + } + else if (supportsUnlabeledBreak(block) && hasImmediateContainingLabeledBlock(labelText, i - 1)) { + return block.breakLabel; + } } } - } - else { - for (var i = blockStack.length - 1; i >= 0; i--) { - var block = blockStack[i]; - if (supportsUnlabeledBreak(block)) { - return block.breakLabel; + else { + for (var i = blockStack.length - 1; i >= 0; i--) { + var block = blockStack[i]; + if (supportsUnlabeledBreak(block)) { + return block.breakLabel; + } } } } @@ -60246,20 +60615,21 @@ var ts; * @param labelText An optional name of a containing labeled statement. */ function findContinueTarget(labelText) { - ts.Debug.assert(blocks !== undefined); - if (labelText) { - for (var i = blockStack.length - 1; i >= 0; i--) { - var block = blockStack[i]; - if (supportsUnlabeledContinue(block) && hasImmediateContainingLabeledBlock(labelText, i - 1)) { - return block.continueLabel; + if (blockStack) { + if (labelText) { + for (var i = blockStack.length - 1; i >= 0; i--) { + var block = blockStack[i]; + if (supportsUnlabeledContinue(block) && hasImmediateContainingLabeledBlock(labelText, i - 1)) { + return block.continueLabel; + } } } - } - else { - for (var i = blockStack.length - 1; i >= 0; i--) { - var block = blockStack[i]; - if (supportsUnlabeledContinue(block)) { - return block.continueLabel; + else { + for (var i = blockStack.length - 1; i >= 0; i--) { + var block = blockStack[i]; + if (supportsUnlabeledContinue(block)) { + return block.continueLabel; + } } } } @@ -60301,7 +60671,7 @@ var ts; * @param location An optional source map location for the statement. */ function createInlineBreak(label, location) { - ts.Debug.assert(label > 0, "Invalid label: " + label); + ts.Debug.assertLessThan(0, label, "Invalid label"); return ts.setTextRange(ts.createReturn(ts.createArrayLiteral([ createInstruction(3 /* Break */), createLabel(label) @@ -60642,31 +61012,33 @@ var ts; for (; blockIndex < blockActions.length && blockOffsets[blockIndex] <= operationIndex; blockIndex++) { var block = blocks[blockIndex]; var blockAction = blockActions[blockIndex]; - if (isExceptionBlock(block)) { - if (blockAction === 0 /* Open */) { - if (!exceptionBlockStack) { - exceptionBlockStack = []; + switch (block.kind) { + case 0 /* Exception */: + if (blockAction === 0 /* Open */) { + if (!exceptionBlockStack) { + exceptionBlockStack = []; + } + if (!statements) { + statements = []; + } + exceptionBlockStack.push(currentExceptionBlock); + currentExceptionBlock = block; } - if (!statements) { - statements = []; + else if (blockAction === 1 /* Close */) { + currentExceptionBlock = exceptionBlockStack.pop(); } - exceptionBlockStack.push(currentExceptionBlock); - currentExceptionBlock = block; - } - else if (blockAction === 1 /* Close */) { - currentExceptionBlock = exceptionBlockStack.pop(); - } - } - else if (isWithBlock(block)) { - if (blockAction === 0 /* Open */) { - if (!withBlockStack) { - withBlockStack = []; + break; + case 1 /* With */: + if (blockAction === 0 /* Open */) { + if (!withBlockStack) { + withBlockStack = []; + } + withBlockStack.push(block); } - withBlockStack.push(block); - } - else if (blockAction === 1 /* Close */) { - withBlockStack.pop(); - } + else if (blockAction === 1 /* Close */) { + withBlockStack.pop(); + } + break; } } } @@ -64580,14 +64952,14 @@ var ts; writer.writeLine(); } } - function emitTrailingCommentsOfPosition(pos) { + function emitTrailingCommentsOfPosition(pos, prefixSpace) { if (disabled) { return; } if (extendedDiagnostics) { ts.performance.mark("beforeEmitTrailingCommentsOfPosition"); } - forEachTrailingCommentToEmit(pos, emitTrailingCommentOfPosition); + forEachTrailingCommentToEmit(pos, prefixSpace ? emitTrailingComment : emitTrailingCommentOfPosition); if (extendedDiagnostics) { ts.performance.measure("commentTime", "beforeEmitTrailingCommentsOfPosition"); } @@ -64676,17 +65048,7 @@ var ts; * @return true if the comment is a triple-slash comment else false */ function isTripleSlashComment(commentPos, commentEnd) { - // Verify this is /// comment, but do the regexp match only when we first can find /// in the comment text - // so that we don't end up computing comment string and doing match for all // comments - if (currentText.charCodeAt(commentPos + 1) === 47 /* slash */ && - commentPos + 2 < commentEnd && - currentText.charCodeAt(commentPos + 2) === 47 /* slash */) { - var textSubStr = currentText.substring(commentPos, commentEnd); - return textSubStr.match(ts.fullTripleSlashReferencePathRegEx) || - textSubStr.match(ts.fullTripleSlashAMDReferencePathRegEx) ? - true : false; - } - return false; + return ts.isRecognizedTripleSlashComment(currentText, commentPos, commentEnd); } } ts.createCommentWriter = createCommentWriter; @@ -64972,7 +65334,6 @@ var ts; errorNameNode = declaration.name; var format = 4 /* UseTypeOfFunction */ | 16384 /* WriteClassExpressionAsTypeLiteral */ | - 2048 /* UseTypeAliasValue */ | (shouldUseResolverType ? 8192 /* AddUndefined */ : 0); resolver.writeTypeOfDeclaration(declaration, enclosingDeclaration, format, writer); errorNameNode = undefined; @@ -64987,7 +65348,7 @@ var ts; } else { errorNameNode = signature.name; - resolver.writeReturnTypeOfSignatureDeclaration(signature, enclosingDeclaration, 4 /* UseTypeOfFunction */ | 2048 /* UseTypeAliasValue */ | 16384 /* WriteClassExpressionAsTypeLiteral */, writer); + resolver.writeReturnTypeOfSignatureDeclaration(signature, enclosingDeclaration, 4 /* UseTypeOfFunction */ | 16384 /* WriteClassExpressionAsTypeLiteral */, writer); errorNameNode = undefined; } } @@ -65225,7 +65586,7 @@ var ts; write(tempVarName); write(": "); writer.getSymbolAccessibilityDiagnostic = function () { return diagnostic; }; - resolver.writeTypeOfExpression(expr, enclosingDeclaration, 4 /* UseTypeOfFunction */ | 2048 /* UseTypeAliasValue */ | 16384 /* WriteClassExpressionAsTypeLiteral */, writer); + resolver.writeTypeOfExpression(expr, enclosingDeclaration, 4 /* UseTypeOfFunction */ | 16384 /* WriteClassExpressionAsTypeLiteral */, writer); write(";"); writeLine(); return tempVarName; @@ -65898,6 +66259,10 @@ var ts; return ts.forEach(node.declarationList.declarations, function (varDeclaration) { return resolver.isDeclarationVisible(varDeclaration); }); } function writeVariableStatement(node) { + // If binding pattern doesn't have name, then there is nothing to be emitted for declaration file i.e. const [,] = [1,2]. + if (ts.every(node.declarationList && node.declarationList.declarations, function (decl) { return decl.name && ts.isEmptyBindingPattern(decl.name); })) { + return; + } emitJsDocComments(node); emitModuleElementDeclarationFlags(node); if (ts.isLet(node.declarationList)) { @@ -67437,7 +67802,9 @@ var ts; if (!(ts.getEmitFlags(node) & 131072 /* NoIndentation */)) { var dotRangeStart = node.expression.end; var dotRangeEnd = ts.skipTrivia(currentSourceFile.text, node.expression.end) + 1; - var dotToken = { kind: 23 /* DotToken */, pos: dotRangeStart, end: dotRangeEnd }; + var dotToken = ts.createToken(23 /* DotToken */); + dotToken.pos = dotRangeStart; + dotToken.end = dotRangeEnd; indentBeforeDot = needsIndentation(node, node.expression, dotToken); indentAfterDot = needsIndentation(node, dotToken, node.name); } @@ -67566,7 +67933,9 @@ var ts; var indentAfterOperator = needsIndentation(node, node.operatorToken, node.right); emitExpression(node.left); increaseIndentIf(indentBeforeOperator, isCommaOperator ? " " : undefined); + emitLeadingCommentsOfPosition(node.operatorToken.pos); writeTokenNode(node.operatorToken); + emitTrailingCommentsOfPosition(node.operatorToken.end, /*prefixSpace*/ true); // Binary operators should have a space before the comment starts increaseIndentIf(indentAfterOperator, " "); emitExpression(node.right); decreaseIndentIf(indentBeforeOperator, indentAfterOperator); @@ -67760,8 +68129,19 @@ var ts; emitWithPrefix(" ", node.label); write(";"); } + function emitTokenWithComment(token, pos, contextNode) { + var node = contextNode && ts.getParseTreeNode(contextNode); + if (node && node.kind === contextNode.kind) { + pos = ts.skipTrivia(currentSourceFile.text, pos); + } + pos = writeToken(token, pos, /*contextNode*/ contextNode); + if (node && node.kind === contextNode.kind) { + emitTrailingCommentsOfPosition(pos, /*prefixSpace*/ true); + } + return pos; + } function emitReturnStatement(node) { - writeToken(96 /* ReturnKeyword */, node.pos, /*contextNode*/ node); + emitTokenWithComment(96 /* ReturnKeyword */, node.pos, /*contextNode*/ node); emitExpressionWithPrefix(" ", node.expression); write(";"); } @@ -68237,10 +68617,12 @@ var ts; function emitCatchClause(node) { var openParenPos = writeToken(74 /* CatchKeyword */, node.pos); write(" "); - writeToken(19 /* OpenParenToken */, openParenPos); - emit(node.variableDeclaration); - writeToken(20 /* CloseParenToken */, node.variableDeclaration ? node.variableDeclaration.end : openParenPos); - write(" "); + if (node.variableDeclaration) { + writeToken(19 /* OpenParenToken */, openParenPos); + emit(node.variableDeclaration); + writeToken(20 /* CloseParenToken */, node.variableDeclaration.end); + write(" "); + } emit(node.block); } // @@ -69520,6 +69902,14 @@ var ts; var loader_2 = function (typesRef, containingFile) { return ts.resolveTypeReferenceDirective(typesRef, containingFile, options, host).resolvedTypeReferenceDirective; }; resolveTypeReferenceDirectiveNamesWorker = function (typeReferenceDirectiveNames, containingFile) { return loadWithLocalCache(checkAllDefined(typeReferenceDirectiveNames), containingFile, loader_2); }; } + // Map from a stringified PackageId to the source file with that id. + // Only one source file may have a given packageId. Others become redirects (see createRedirectSourceFile). + // `packageIdToSourceFile` is only used while building the program, while `sourceFileToPackageName` and `isSourceFileTargetOfRedirect` are kept around. + var packageIdToSourceFile = ts.createMap(); + // Maps from a SourceFile's `.path` to the name of the package it was imported with. + var sourceFileToPackageName = ts.createMap(); + // See `sourceFileIsRedirectedTo`. + var redirectTargetsSet = ts.createMap(); var filesByName = ts.createMap(); // stores 'filename -> file association' ignoring case // used to track cases when two file names differ only in casing @@ -69588,6 +69978,8 @@ var ts; isSourceFileFromExternalLibrary: isSourceFileFromExternalLibrary, dropDiagnosticsProducingTypeChecker: dropDiagnosticsProducingTypeChecker, getSourceFileFromReference: getSourceFileFromReference, + sourceFileToPackageName: sourceFileToPackageName, + redirectTargetsSet: redirectTargetsSet, }; verifyCompilerOptions(); ts.performance.mark("afterProgram"); @@ -69780,17 +70172,57 @@ var ts; var filePaths = []; var modifiedSourceFiles = []; oldProgram.structureIsReused = 2 /* Completely */; - for (var _i = 0, _a = oldProgram.getSourceFiles(); _i < _a.length; _i++) { - var oldSourceFile = _a[_i]; + var oldSourceFiles = oldProgram.getSourceFiles(); + var SeenPackageName; + (function (SeenPackageName) { + SeenPackageName[SeenPackageName["Exists"] = 0] = "Exists"; + SeenPackageName[SeenPackageName["Modified"] = 1] = "Modified"; + })(SeenPackageName || (SeenPackageName = {})); + var seenPackageNames = ts.createMap(); + for (var _i = 0, oldSourceFiles_1 = oldSourceFiles; _i < oldSourceFiles_1.length; _i++) { + var oldSourceFile = oldSourceFiles_1[_i]; var newSourceFile = host.getSourceFileByPath ? host.getSourceFileByPath(oldSourceFile.fileName, oldSourceFile.path, options.target) : host.getSourceFile(oldSourceFile.fileName, options.target); if (!newSourceFile) { return oldProgram.structureIsReused = 0 /* Not */; } + ts.Debug.assert(!newSourceFile.redirectInfo, "Host should not return a redirect source file from `getSourceFile`"); + var fileChanged = void 0; + if (oldSourceFile.redirectInfo) { + // We got `newSourceFile` by path, so it is actually for the unredirected file. + // This lets us know if the unredirected file has changed. If it has we should break the redirect. + if (newSourceFile !== oldSourceFile.redirectInfo.unredirected) { + // Underlying file has changed. Might not redirect anymore. Must rebuild program. + return oldProgram.structureIsReused = 0 /* Not */; + } + fileChanged = false; + newSourceFile = oldSourceFile; // Use the redirect. + } + else if (oldProgram.redirectTargetsSet.has(oldSourceFile.path)) { + // If a redirected-to source file changes, the redirect may be broken. + if (newSourceFile !== oldSourceFile) { + return oldProgram.structureIsReused = 0 /* Not */; + } + fileChanged = false; + } + else { + fileChanged = newSourceFile !== oldSourceFile; + } newSourceFile.path = oldSourceFile.path; filePaths.push(newSourceFile.path); - if (oldSourceFile !== newSourceFile) { + var packageName = oldProgram.sourceFileToPackageName.get(oldSourceFile.path); + if (packageName !== undefined) { + // If there are 2 different source files for the same package name and at least one of them changes, + // they might become redirects. So we must rebuild the program. + var prevKind = seenPackageNames.get(packageName); + var newKind = fileChanged ? 1 /* Modified */ : 0 /* Exists */; + if ((prevKind !== undefined && newKind === 1 /* Modified */) || prevKind === 1 /* Modified */) { + return oldProgram.structureIsReused = 0 /* Not */; + } + seenPackageNames.set(packageName, newKind); + } + if (fileChanged) { // The `newSourceFile` object was created for the new program. if (oldSourceFile.hasNoDefaultLib !== newSourceFile.hasNoDefaultLib) { // value of no-default-lib has changed @@ -69831,8 +70263,8 @@ var ts; } modifiedFilePaths = modifiedSourceFiles.map(function (f) { return f.newFile.path; }); // try to verify results of module resolution - for (var _b = 0, modifiedSourceFiles_1 = modifiedSourceFiles; _b < modifiedSourceFiles_1.length; _b++) { - var _c = modifiedSourceFiles_1[_b], oldSourceFile = _c.oldFile, newSourceFile = _c.newFile; + for (var _a = 0, modifiedSourceFiles_1 = modifiedSourceFiles; _a < modifiedSourceFiles_1.length; _a++) { + var _b = modifiedSourceFiles_1[_a], oldSourceFile = _b.oldFile, newSourceFile = _b.newFile; var newSourceFilePath = ts.getNormalizedAbsolutePath(newSourceFile.fileName, currentDirectory); if (resolveModuleNamesWorker) { var moduleNames = ts.map(ts.concatenate(newSourceFile.imports, newSourceFile.moduleAugmentations), getTextOfLiteral); @@ -69875,8 +70307,8 @@ var ts; if (oldProgram.getMissingFilePaths().some(function (missingFilePath) { return host.fileExists(missingFilePath); })) { return oldProgram.structureIsReused = 1 /* SafeModules */; } - for (var _d = 0, _e = oldProgram.getMissingFilePaths(); _d < _e.length; _d++) { - var p = _e[_d]; + for (var _c = 0, _d = oldProgram.getMissingFilePaths(); _c < _d.length; _c++) { + var p = _d[_c]; filesByName.set(p, undefined); } // update fileName -> file mapping @@ -69885,11 +70317,13 @@ var ts; } files = newSourceFiles; fileProcessingDiagnostics = oldProgram.getFileProcessingDiagnostics(); - for (var _f = 0, modifiedSourceFiles_2 = modifiedSourceFiles; _f < modifiedSourceFiles_2.length; _f++) { - var modifiedFile = modifiedSourceFiles_2[_f]; + for (var _e = 0, modifiedSourceFiles_2 = modifiedSourceFiles; _e < modifiedSourceFiles_2.length; _e++) { + var modifiedFile = modifiedSourceFiles_2[_e]; fileProcessingDiagnostics.reattachFileDiagnostics(modifiedFile.newFile); } resolvedTypeReferenceDirectives = oldProgram.getResolvedTypeReferenceDirectives(); + sourceFileToPackageName = oldProgram.sourceFileToPackageName; + redirectTargetsSet = oldProgram.redirectTargetsSet; return oldProgram.structureIsReused = 2 /* Completely */; } function getEmitHost(writeFileCallback) { @@ -70436,7 +70870,7 @@ var ts; } /** This has side effects through `findSourceFile`. */ function processSourceFile(fileName, isDefaultLib, refFile, refPos, refEnd) { - getSourceFileFromReferenceWorker(fileName, function (fileName) { return findSourceFile(fileName, toPath(fileName), isDefaultLib, refFile, refPos, refEnd); }, function (diagnostic) { + getSourceFileFromReferenceWorker(fileName, function (fileName) { return findSourceFile(fileName, toPath(fileName), isDefaultLib, refFile, refPos, refEnd, /*packageId*/ undefined); }, function (diagnostic) { var args = []; for (var _i = 1; _i < arguments.length; _i++) { args[_i - 1] = arguments[_i]; @@ -70453,8 +70887,25 @@ var ts; fileProcessingDiagnostics.add(ts.createCompilerDiagnostic(ts.Diagnostics.File_name_0_differs_from_already_included_file_name_1_only_in_casing, fileName, existingFileName)); } } + function createRedirectSourceFile(redirectTarget, unredirected, fileName, path) { + var redirect = Object.create(redirectTarget); + redirect.fileName = fileName; + redirect.path = path; + redirect.redirectInfo = { redirectTarget: redirectTarget, unredirected: unredirected }; + Object.defineProperties(redirect, { + id: { + get: function () { return this.redirectInfo.redirectTarget.id; }, + set: function (value) { this.redirectInfo.redirectTarget.id = value; }, + }, + symbol: { + get: function () { return this.redirectInfo.redirectTarget.symbol; }, + set: function (value) { this.redirectInfo.redirectTarget.symbol = value; }, + }, + }); + return redirect; + } // Get source file from normalized fileName - function findSourceFile(fileName, path, isDefaultLib, refFile, refPos, refEnd) { + function findSourceFile(fileName, path, isDefaultLib, refFile, refPos, refEnd, packageId) { if (filesByName.has(path)) { var file_1 = filesByName.get(path); // try to check if we've already seen this file but with a different casing in path @@ -70490,6 +70941,25 @@ var ts; fileProcessingDiagnostics.add(ts.createCompilerDiagnostic(ts.Diagnostics.Cannot_read_file_0_Colon_1, fileName, hostErrorMessage)); } }); + if (packageId) { + var packageIdKey = packageId.name + "@" + packageId.version; + var fileFromPackageId = packageIdToSourceFile.get(packageIdKey); + if (fileFromPackageId) { + // Some other SourceFile already exists with this package name and version. + // Instead of creating a duplicate, just redirect to the existing one. + var dupFile = createRedirectSourceFile(fileFromPackageId, file, fileName, path); + redirectTargetsSet.set(fileFromPackageId.path, true); + filesByName.set(path, dupFile); + sourceFileToPackageName.set(path, packageId.name); + files.push(dupFile); + return dupFile; + } + else if (file) { + // This is the first source file to have this packageId. + packageIdToSourceFile.set(packageIdKey, file); + sourceFileToPackageName.set(path, packageId.name); + } + } filesByName.set(path, file); if (file) { sourceFilesFoundSearchingNodeModules.set(path, currentNodeModulesDepth > 0); @@ -70630,7 +71100,7 @@ var ts; else if (shouldAddFile) { var path = toPath(resolvedFileName); var pos = ts.skipTrivia(file.text, file.imports[i].pos); - findSourceFile(resolvedFileName, path, /*isDefaultLib*/ false, file, pos, file.imports[i].end); + findSourceFile(resolvedFileName, path, /*isDefaultLib*/ false, file, pos, file.imports[i].end, resolution.packageId); } if (isFromNodeModulesSearch) { currentNodeModulesDepth--; @@ -70785,8 +71255,8 @@ var ts; } // there has to be common source directory if user specified --outdir || --sourceRoot // if user specified --mapRoot, there needs to be common source directory if there would be multiple files being emitted - if (options.outDir || - options.sourceRoot || + if (options.outDir || // there is --outDir specified + options.sourceRoot || // there is --sourceRoot specified options.mapRoot) { // Precalculate and cache the common source directory var dir = getCommonSourceDirectory(); @@ -71349,6 +71819,12 @@ var ts; category: ts.Diagnostics.Module_Resolution_Options, description: ts.Diagnostics.Allow_default_imports_from_modules_with_no_default_export_This_does_not_affect_code_emit_just_typechecking }, + { + name: "preserveSymlinks", + type: "boolean", + category: ts.Diagnostics.Module_Resolution_Options, + description: ts.Diagnostics.Do_not_resolve_the_real_path_of_symlinks, + }, // Source Maps { name: "sourceRoot", @@ -72006,7 +72482,7 @@ var ts; if (option && typeof option.type !== "string") { var customOption = option; // Validate custom option type - if (!customOption.type.has(text)) { + if (!customOption.type.has(text.toLowerCase())) { errors.push(createDiagnosticForInvalidCustomType(customOption, function (message, arg0, arg1) { return ts.createDiagnosticForNodeInSourceFile(sourceFile, valueExpression, message, arg0, arg1); })); } } @@ -72306,13 +72782,10 @@ var ts; } } else { - // If no includes were specified, exclude common package folders and the outDir - var specs = includeSpecs ? [] : ["node_modules", "bower_components", "jspm_packages"]; var outDir = raw["compilerOptions"] && raw["compilerOptions"]["outDir"]; if (outDir) { - specs.push(outDir); + excludeSpecs = [outDir]; } - excludeSpecs = specs; } if (fileNames === undefined && includeSpecs === undefined) { includeSpecs = ["**/*"]; @@ -72573,7 +73046,7 @@ var ts; return value; } else if (typeof option.type !== "string") { - return option.type.get(value); + return option.type.get(typeof value === "string" ? value.toLowerCase() : value); } return normalizeNonListOptionValue(option, basePath, value); } @@ -72748,23 +73221,13 @@ var ts; }; } function validateSpecs(specs, errors, allowTrailingRecursion, jsonSourceFile, specKey) { - var validSpecs = []; - for (var _i = 0, specs_1 = specs; _i < specs_1.length; _i++) { - var spec = specs_1[_i]; - if (!allowTrailingRecursion && invalidTrailingRecursionPattern.test(spec)) { - errors.push(createDiagnostic(ts.Diagnostics.File_specification_cannot_end_in_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0, spec)); + return specs.filter(function (spec) { + var diag = specToDiagnostic(spec, allowTrailingRecursion); + if (diag !== undefined) { + errors.push(createDiagnostic(diag, spec)); } - else if (invalidMultipleRecursionPatterns.test(spec)) { - errors.push(createDiagnostic(ts.Diagnostics.File_specification_cannot_contain_multiple_recursive_directory_wildcards_Asterisk_Asterisk_Colon_0, spec)); - } - else if (invalidDotDotAfterRecursiveWildcardPattern.test(spec)) { - errors.push(createDiagnostic(ts.Diagnostics.File_specification_cannot_contain_a_parent_directory_that_appears_after_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0, spec)); - } - else { - validSpecs.push(spec); - } - } - return validSpecs; + return diag === undefined; + }); function createDiagnostic(message, spec) { if (jsonSourceFile && jsonSourceFile.jsonObject) { for (var _i = 0, _a = ts.getPropertyAssignment(jsonSourceFile.jsonObject, specKey); _i < _a.length; _i++) { @@ -72782,6 +73245,17 @@ var ts; return ts.createCompilerDiagnostic(message, spec); } } + function specToDiagnostic(spec, allowTrailingRecursion) { + if (!allowTrailingRecursion && invalidTrailingRecursionPattern.test(spec)) { + return ts.Diagnostics.File_specification_cannot_end_in_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0; + } + else if (invalidMultipleRecursionPatterns.test(spec)) { + return ts.Diagnostics.File_specification_cannot_contain_multiple_recursive_directory_wildcards_Asterisk_Asterisk_Colon_0; + } + else if (invalidDotDotAfterRecursiveWildcardPattern.test(spec)) { + return ts.Diagnostics.File_specification_cannot_contain_a_parent_directory_that_appears_after_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0; + } + } /** * Gets directories in a set of include patterns that should be watched for changes. */ @@ -72945,7 +73419,7 @@ var ts; (function (ts) { var ScriptSnapshot; (function (ScriptSnapshot) { - var StringScriptSnapshot = (function () { + var StringScriptSnapshot = /** @class */ (function () { function StringScriptSnapshot(text) { this.text = text; } @@ -72969,7 +73443,7 @@ var ts; } ScriptSnapshot.fromString = fromString; })(ScriptSnapshot = ts.ScriptSnapshot || (ts.ScriptSnapshot = {})); - var TextChange = (function () { + var TextChange = /** @class */ (function () { function TextChange() { } return TextChange; @@ -73831,8 +74305,14 @@ var ts; } } ts.findNextToken = findNextToken; + /** + * Finds the rightmost token satisfying `token.end <= position`, + * excluding `JsxText` tokens containing only whitespace. + */ function findPrecedingToken(position, sourceFile, startNode, includeJsDoc) { - return find(startNode || sourceFile); + var result = find(startNode || sourceFile); + ts.Debug.assert(!(result && isWhiteSpaceOnlyJsxText(result))); + return result; function findRightmostToken(n) { if (ts.isToken(n)) { return n; @@ -73848,18 +74328,16 @@ var ts; var children = n.getChildren(); for (var i = 0; i < children.length; i++) { var child = children[i]; - // condition 'position < child.end' checks if child node end after the position - // in the example below this condition will be false for 'aaaa' and 'bbbb' and true for 'ccc' - // aaaa___bbbb___$__ccc - // after we found child node with end after the position we check if start of the node is after the position. - // if yes - then position is in the trivia and we need to look into the previous child to find the token in question. - // if no - position is in the node itself so we should recurse in it. - // NOTE: JsxText is a weird kind of node that can contain only whitespaces (since they are not counted as trivia). - // if this is the case - then we should assume that token in question is located in previous child. - if (position < child.end && (nodeHasTokens(child) || child.kind === 10 /* JsxText */)) { + // Note that the span of a node's tokens is [node.getStart(...), node.end). + // Given that `position < child.end` and child has constituent tokens, we distinguish these cases: + // 1) `position` precedes `child`'s tokens or `child` has no tokens (ie: in a comment or whitespace preceding `child`): + // we need to find the last token in a previous child. + // 2) `position` is within the same span: we recurse on `child`. + if (position < child.end) { var start = child.getStart(sourceFile, includeJsDoc); - var lookInPreviousChild = (start >= position) || - (child.kind === 10 /* JsxText */ && start === child.end); // whitespace only JsxText + var lookInPreviousChild = (start >= position) || // cursor in the leading trivia + !nodeHasTokens(child) || + isWhiteSpaceOnlyJsxText(child); if (lookInPreviousChild) { // actual start of the node is past the position - previous token should be at the end of previous child var candidate = findRightmostChildNodeWithTokens(children, /*exclusiveStartPosition*/ i); @@ -73881,10 +74359,16 @@ var ts; return candidate && findRightmostToken(candidate); } } - /// finds last node that is considered as candidate for search (isCandidate(node) === true) starting from 'exclusiveStartPosition' + /** + * Finds the rightmost child to the left of `children[exclusiveStartPosition]` which is a non-all-whitespace token or has constituent tokens. + */ function findRightmostChildNodeWithTokens(children, exclusiveStartPosition) { for (var i = exclusiveStartPosition - 1; i >= 0; i--) { - if (nodeHasTokens(children[i])) { + var child = children[i]; + if (isWhiteSpaceOnlyJsxText(child)) { + ts.Debug.assert(i > 0, "`JsxText` tokens should not be the first child of `JsxElement | JsxSelfClosingElement`"); + } + else if (nodeHasTokens(children[i])) { return children[i]; } } @@ -73942,6 +74426,10 @@ var ts; return false; } ts.isInsideJsxElementOrAttribute = isInsideJsxElementOrAttribute; + function isWhiteSpaceOnlyJsxText(node) { + return ts.isJsxText(node) && node.containsOnlyWhiteSpaces; + } + ts.isWhiteSpaceOnlyJsxText = isWhiteSpaceOnlyJsxText; function isInTemplateString(sourceFile, position) { var token = getTokenAtPosition(sourceFile, position, /*includeJsDocComment*/ false); return ts.isTemplateLiteralKind(token.kind) && position > token.getStart(sourceFile); @@ -73954,39 +74442,9 @@ var ts; * @param predicate Additional predicate to test on the comment range. */ function isInComment(sourceFile, position, tokenAtPosition, predicate) { - if (tokenAtPosition === void 0) { tokenAtPosition = getTokenAtPosition(sourceFile, position, /*includeJsDocComment*/ false); } - return position <= tokenAtPosition.getStart(sourceFile) && - (isInCommentRange(ts.getLeadingCommentRanges(sourceFile.text, tokenAtPosition.pos)) || - isInCommentRange(ts.getTrailingCommentRanges(sourceFile.text, tokenAtPosition.pos))); - function isInCommentRange(commentRanges) { - return ts.forEach(commentRanges, function (c) { return isPositionInCommentRange(c, position, sourceFile.text) && (!predicate || predicate(c)); }); - } + return !!ts.formatting.getRangeOfEnclosingComment(sourceFile, position, /*onlyMultiLine*/ false, /*precedingToken*/ undefined, tokenAtPosition, predicate); } ts.isInComment = isInComment; - function isPositionInCommentRange(_a, position, text) { - var pos = _a.pos, end = _a.end, kind = _a.kind; - if (pos < position && position < end) { - return true; - } - else if (position === end) { - // The end marker of a single-line comment does not include the newline character. - // In the following case, we are inside a comment (^ denotes the cursor position): - // - // // asdf ^\n - // - // But for multi-line comments, we don't want to be inside the comment in the following case: - // - // /* asdf */^ - // - // Internally, we represent the end of the comment at the newline and closing '/', respectively. - return kind === 2 /* SingleLineCommentTrivia */ || - // true for unterminated multi-line comment - !(text.charCodeAt(end - 1) === 47 /* slash */ && text.charCodeAt(end - 2) === 42 /* asterisk */); - } - else { - return false; - } - } function hasDocComment(sourceFile, position) { var token = getTokenAtPosition(sourceFile, position, /*includeJsDocComment*/ false); // First, we have to see if this position actually landed in a comment. @@ -74000,7 +74458,7 @@ var ts; ts.hasDocComment = hasDocComment; function nodeHasTokens(n) { // If we have a token or node that has a non-zero width, it must have tokens. - // Note, that getWidth() does not take trivia into account. + // Note: getWidth() does not take trivia into account. return n.getWidth() !== 0; } function getNodeModifiers(node) { @@ -74357,6 +74815,7 @@ var ts; } ts.symbolToDisplayParts = symbolToDisplayParts; function signatureToDisplayParts(typechecker, signature, enclosingDeclaration, flags) { + flags |= 65536 /* UseAliasDefinedOutsideCurrentScope */; return mapToDisplayParts(function (writer) { typechecker.getSymbolDisplayBuilder().buildSignatureDisplay(signature, writer, enclosingDeclaration, flags); }); @@ -74666,11 +75125,11 @@ var ts; templateStack.pop(); } else { - ts.Debug.assert(token === 15 /* TemplateMiddle */, "Should have been a template middle. Was " + token); + ts.Debug.assertEqual(token, 15 /* TemplateMiddle */, "Should have been a template middle."); } } else { - ts.Debug.assert(lastTemplateStackToken === 17 /* OpenBraceToken */, "Should have been an open brace. Was: " + token); + ts.Debug.assertEqual(lastTemplateStackToken, 17 /* OpenBraceToken */, "Should have been an open brace"); templateStack.pop(); } } @@ -76652,7 +77111,7 @@ var ts; if (!typeForObject) return false; // In a binding pattern, get only known properties. Everywhere else we will get all possible properties. - typeMembers = typeChecker.getPropertiesOfType(typeForObject); + typeMembers = typeChecker.getPropertiesOfType(typeForObject).filter(function (symbol) { return !(ts.getDeclarationModifierFlagsFromSymbol(symbol) & 24 /* NonPublicAccessibilityModifier */); }); existingMembers = objectLikeContainer.elements; } } @@ -76916,11 +77375,11 @@ var ts; return containingNodeKind === 226 /* VariableDeclaration */ || containingNodeKind === 227 /* VariableDeclarationList */ || containingNodeKind === 208 /* VariableStatement */ || - containingNodeKind === 232 /* EnumDeclaration */ || + containingNodeKind === 232 /* EnumDeclaration */ || // enum a { foo, | isFunctionLikeButNotConstructor(containingNodeKind) || - containingNodeKind === 230 /* InterfaceDeclaration */ || - containingNodeKind === 175 /* ArrayBindingPattern */ || - containingNodeKind === 231 /* TypeAliasDeclaration */ || + containingNodeKind === 230 /* InterfaceDeclaration */ || // interface A undefined); => should get use to the declaration in file "./foo" + // + // function bar(onfulfilled: (value: T) => void) { //....} + // interface Test { + // pr/*destination*/op1: number + // } + // bar(({pr/*goto*/op1})=>{}); + if (ts.isPropertyName(node) && ts.isBindingElement(node.parent) && ts.isObjectBindingPattern(node.parent.parent) && + (node === (node.parent.propertyName || node.parent.name))) { + var type = typeChecker.getTypeAtLocation(node.parent.parent); + if (type) { + var propSymbols = ts.getPropertySymbolsFromType(type, node); + if (propSymbols) { + return ts.flatMap(propSymbols, function (propSymbol) { return getDefinitionFromSymbol(typeChecker, propSymbol, node); }); + } + } + } // If the current location we want to find its definition is in an object literal, try to get the contextual type for the // object literal, lookup the property symbol in the contextual type, and use this for goto-definition. // For example @@ -80614,12 +81104,20 @@ var ts; "crypto", "stream", "util", "assert", "tty", "domain", "constants", "process", "v8", "timers", "console" ]; - var nodeCoreModules = ts.arrayToMap(JsTyping.nodeCoreModuleList, function (x) { return x; }); + var nodeCoreModules = ts.arrayToSet(JsTyping.nodeCoreModuleList); function loadSafeList(host, safeListPath) { var result = ts.readConfigFile(safeListPath, function (path) { return host.readFile(path); }); return ts.createMapFromTemplate(result.config); } JsTyping.loadSafeList = loadSafeList; + function loadTypesMap(host, typesMapPath) { + var result = ts.readConfigFile(typesMapPath, function (path) { return host.readFile(path); }); + if (result.config) { + return ts.createMapFromTemplate(result.config.simpleMap); + } + return undefined; + } + JsTyping.loadTypesMap = loadTypesMap; /** * @param host is the object providing I/O related operations. * @param fileNames are the file names that belong to the same project @@ -80812,8 +81310,8 @@ var ts; if (!matches) { return; // continue to next named declarations } - for (var _i = 0, declarations_12 = declarations; _i < declarations_12.length; _i++) { - var declaration = declarations_12[_i]; + for (var _i = 0, declarations_11 = declarations; _i < declarations_11.length; _i++) { + var declaration = declarations_11[_i]; // It was a match! If the pattern has dots in it, then also see if the // declaration container matches as well. if (patternMatcher.patternContainsDots) { @@ -81549,13 +82047,18 @@ var ts; (function (ts) { var OutliningElementsCollector; (function (OutliningElementsCollector) { + var collapseText = "..."; + var maxDepth = 20; function collectElements(sourceFile, cancellationToken) { var elements = []; - var collapseText = "..."; - function addOutliningSpan(hintSpanNode, startElement, endElement, autoCollapse) { + var depth = 0; + walk(sourceFile); + return elements; + /** If useFullStart is true, then the collapsing span includes leading whitespace, including linebreaks. */ + function addOutliningSpan(hintSpanNode, startElement, endElement, autoCollapse, useFullStart) { if (hintSpanNode && startElement && endElement) { var span_13 = { - textSpan: ts.createTextSpanFromBounds(startElement.pos, endElement.end), + textSpan: ts.createTextSpanFromBounds(useFullStart ? startElement.getFullStart() : startElement.getStart(), endElement.getEnd()), hintSpan: ts.createTextSpanFromNode(hintSpanNode, sourceFile), bannerText: collapseText, autoCollapse: autoCollapse, @@ -81619,8 +82122,6 @@ var ts; function autoCollapse(node) { return ts.isFunctionBlock(node) && node.parent.kind !== 187 /* ArrowFunction */; } - var depth = 0; - var maxDepth = 20; function walk(n) { cancellationToken.throwIfCancellationRequested(); if (depth > maxDepth) { @@ -81633,8 +82134,8 @@ var ts; case 207 /* Block */: if (!ts.isFunctionBlock(n)) { var parent = n.parent; - var openBrace = ts.findChildOfKind(n, 17 /* OpenBraceToken */, sourceFile); - var closeBrace = ts.findChildOfKind(n, 18 /* CloseBraceToken */, sourceFile); + var openBrace_1 = ts.findChildOfKind(n, 17 /* OpenBraceToken */, sourceFile); + var closeBrace_1 = ts.findChildOfKind(n, 18 /* CloseBraceToken */, sourceFile); // Check if the block is standalone, or 'attached' to some parent statement. // If the latter, we want to collapse the block, but consider its hint span // to be the entire span of the parent. @@ -81646,20 +82147,20 @@ var ts; parent.kind === 213 /* WhileStatement */ || parent.kind === 220 /* WithStatement */ || parent.kind === 260 /* CatchClause */) { - addOutliningSpan(parent, openBrace, closeBrace, autoCollapse(n)); + addOutliningSpan(parent, openBrace_1, closeBrace_1, autoCollapse(n), /*useFullStart*/ true); break; } if (parent.kind === 224 /* TryStatement */) { // Could be the try-block, or the finally-block. var tryStatement = parent; if (tryStatement.tryBlock === n) { - addOutliningSpan(parent, openBrace, closeBrace, autoCollapse(n)); + addOutliningSpan(parent, openBrace_1, closeBrace_1, autoCollapse(n), /*useFullStart*/ true); break; } else if (tryStatement.finallyBlock === n) { var finallyKeyword = ts.findChildOfKind(tryStatement, 87 /* FinallyKeyword */, sourceFile); if (finallyKeyword) { - addOutliningSpan(finallyKeyword, openBrace, closeBrace, autoCollapse(n)); + addOutliningSpan(finallyKeyword, openBrace_1, closeBrace_1, autoCollapse(n), /*useFullStart*/ true); break; } } @@ -81678,33 +82179,38 @@ var ts; } // falls through case 234 /* ModuleBlock */: { - var openBrace = ts.findChildOfKind(n, 17 /* OpenBraceToken */, sourceFile); - var closeBrace = ts.findChildOfKind(n, 18 /* CloseBraceToken */, sourceFile); - addOutliningSpan(n.parent, openBrace, closeBrace, autoCollapse(n)); + var openBrace_2 = ts.findChildOfKind(n, 17 /* OpenBraceToken */, sourceFile); + var closeBrace_2 = ts.findChildOfKind(n, 18 /* CloseBraceToken */, sourceFile); + addOutliningSpan(n.parent, openBrace_2, closeBrace_2, autoCollapse(n), /*useFullStart*/ true); break; } case 229 /* ClassDeclaration */: case 230 /* InterfaceDeclaration */: case 232 /* EnumDeclaration */: - case 178 /* ObjectLiteralExpression */: case 235 /* CaseBlock */: { + var openBrace_3 = ts.findChildOfKind(n, 17 /* OpenBraceToken */, sourceFile); + var closeBrace_3 = ts.findChildOfKind(n, 18 /* CloseBraceToken */, sourceFile); + addOutliningSpan(n, openBrace_3, closeBrace_3, autoCollapse(n), /*useFullStart*/ true); + break; + } + // If the block has no leading keywords and is inside an array literal, + // we only want to collapse the span of the block. + // Otherwise, the collapsed section will include the end of the previous line. + case 178 /* ObjectLiteralExpression */: var openBrace = ts.findChildOfKind(n, 17 /* OpenBraceToken */, sourceFile); var closeBrace = ts.findChildOfKind(n, 18 /* CloseBraceToken */, sourceFile); - addOutliningSpan(n, openBrace, closeBrace, autoCollapse(n)); + addOutliningSpan(n, openBrace, closeBrace, autoCollapse(n), /*useFullStart*/ !ts.isArrayLiteralExpression(n.parent)); break; - } case 177 /* ArrayLiteralExpression */: var openBracket = ts.findChildOfKind(n, 21 /* OpenBracketToken */, sourceFile); var closeBracket = ts.findChildOfKind(n, 22 /* CloseBracketToken */, sourceFile); - addOutliningSpan(n, openBracket, closeBracket, autoCollapse(n)); + addOutliningSpan(n, openBracket, closeBracket, autoCollapse(n), /*useFullStart*/ !ts.isArrayLiteralExpression(n.parent)); break; } depth++; ts.forEachChild(n, walk); depth--; } - walk(sourceFile); - return elements; } OutliningElementsCollector.collectElements = collectElements; })(OutliningElementsCollector = ts.OutliningElementsCollector || (ts.OutliningElementsCollector = {})); @@ -82760,8 +83266,8 @@ var ts; var nameToDeclarations = sourceFile.getNamedDeclarations(); var declarations = nameToDeclarations.get(name.text); if (declarations) { - for (var _b = 0, declarations_13 = declarations; _b < declarations_13.length; _b++) { - var declaration = declarations_13[_b]; + for (var _b = 0, declarations_12 = declarations; _b < declarations_12.length; _b++) { + var declaration = declarations_12[_b]; var symbol = declaration.symbol; if (symbol) { var type = typeChecker.getTypeOfSymbolAtLocation(symbol, declaration); @@ -82820,7 +83326,9 @@ var ts; } var kind = invocation.typeArguments && invocation.typeArguments.pos === list.pos ? 0 /* TypeArguments */ : 1 /* CallArguments */; var argumentCount = getArgumentCount(list); - ts.Debug.assert(argumentIndex === 0 || argumentIndex < argumentCount, "argumentCount < argumentIndex, " + argumentCount + " < " + argumentIndex); + if (argumentIndex !== 0) { + ts.Debug.assertLessThan(argumentIndex, argumentCount); + } var argumentsSpan = getApplicableSpanForArguments(list, sourceFile); return { kind: kind, invocation: invocation, argumentsSpan: argumentsSpan, argumentIndex: argumentIndex, argumentCount: argumentCount }; } @@ -82942,7 +83450,9 @@ var ts; var argumentCount = tagExpression.template.kind === 13 /* NoSubstitutionTemplateLiteral */ ? 1 : tagExpression.template.templateSpans.length + 1; - ts.Debug.assert(argumentIndex === 0 || argumentIndex < argumentCount, "argumentCount < argumentIndex, " + argumentCount + " < " + argumentIndex); + if (argumentIndex !== 0) { + ts.Debug.assertLessThan(argumentIndex, argumentCount); + } return { kind: 2 /* TaggedTemplateArguments */, invocation: tagExpression, @@ -83060,7 +83570,9 @@ var ts; tags: candidateSignature.getJsDocTags() }; }); - ts.Debug.assert(argumentIndex === 0 || argumentIndex < argumentCount, "argumentCount < argumentIndex, " + argumentCount + " < " + argumentIndex); + if (argumentIndex !== 0) { + ts.Debug.assertLessThan(argumentIndex, argumentCount); + } var selectedItemIndex = candidates.indexOf(resolvedSignature); ts.Debug.assert(selectedItemIndex !== -1); // If candidates is non-empty it should always include bestSignature. We check for an empty candidates before calling this function. return { items: items, applicableSpan: applicableSpan, selectedItemIndex: selectedItemIndex, argumentIndex: argumentIndex, argumentCount: argumentCount }; @@ -83209,114 +83721,112 @@ var ts; } var signature = void 0; type = isThisExpression ? typeChecker.getTypeAtLocation(location) : typeChecker.getTypeOfSymbolAtLocation(symbol.exportSymbol || symbol, location); - if (type) { - if (location.parent && location.parent.kind === 179 /* PropertyAccessExpression */) { - var right = location.parent.name; - // Either the location is on the right of a property access, or on the left and the right is missing - if (right === location || (right && right.getFullWidth() === 0)) { - location = location.parent; - } - } - // try get the call/construct signature from the type if it matches - var callExpressionLike = void 0; - if (ts.isCallOrNewExpression(location)) { - callExpressionLike = location; - } - else if (ts.isCallExpressionTarget(location) || ts.isNewExpressionTarget(location)) { - callExpressionLike = location.parent; - } - else if (location.parent && ts.isJsxOpeningLikeElement(location.parent) && ts.isFunctionLike(symbol.valueDeclaration)) { - callExpressionLike = location.parent; - } - if (callExpressionLike) { - var candidateSignatures = []; - signature = typeChecker.getResolvedSignature(callExpressionLike, candidateSignatures); - if (!signature && candidateSignatures.length) { - // Use the first candidate: - signature = candidateSignatures[0]; - } - var useConstructSignatures = callExpressionLike.kind === 182 /* NewExpression */ || (ts.isCallExpression(callExpressionLike) && callExpressionLike.expression.kind === 97 /* SuperKeyword */); - var allSignatures = useConstructSignatures ? type.getConstructSignatures() : type.getCallSignatures(); - if (!ts.contains(allSignatures, signature.target) && !ts.contains(allSignatures, signature)) { - // Get the first signature if there is one -- allSignatures may contain - // either the original signature or its target, so check for either - signature = allSignatures.length ? allSignatures[0] : undefined; - } - if (signature) { - if (useConstructSignatures && (symbolFlags & 32 /* Class */)) { - // Constructor - symbolKind = "constructor" /* constructorImplementationElement */; - addPrefixForAnyFunctionOrVar(type.symbol, symbolKind); + if (location.parent && location.parent.kind === 179 /* PropertyAccessExpression */) { + var right = location.parent.name; + // Either the location is on the right of a property access, or on the left and the right is missing + if (right === location || (right && right.getFullWidth() === 0)) { + location = location.parent; + } + } + // try get the call/construct signature from the type if it matches + var callExpressionLike = void 0; + if (ts.isCallOrNewExpression(location)) { + callExpressionLike = location; + } + else if (ts.isCallExpressionTarget(location) || ts.isNewExpressionTarget(location)) { + callExpressionLike = location.parent; + } + else if (location.parent && ts.isJsxOpeningLikeElement(location.parent) && ts.isFunctionLike(symbol.valueDeclaration)) { + callExpressionLike = location.parent; + } + if (callExpressionLike) { + var candidateSignatures = []; + signature = typeChecker.getResolvedSignature(callExpressionLike, candidateSignatures); + if (!signature && candidateSignatures.length) { + // Use the first candidate: + signature = candidateSignatures[0]; + } + var useConstructSignatures = callExpressionLike.kind === 182 /* NewExpression */ || (ts.isCallExpression(callExpressionLike) && callExpressionLike.expression.kind === 97 /* SuperKeyword */); + var allSignatures = useConstructSignatures ? type.getConstructSignatures() : type.getCallSignatures(); + if (!ts.contains(allSignatures, signature.target) && !ts.contains(allSignatures, signature)) { + // Get the first signature if there is one -- allSignatures may contain + // either the original signature or its target, so check for either + signature = allSignatures.length ? allSignatures[0] : undefined; + } + if (signature) { + if (useConstructSignatures && (symbolFlags & 32 /* Class */)) { + // Constructor + symbolKind = "constructor" /* constructorImplementationElement */; + addPrefixForAnyFunctionOrVar(type.symbol, symbolKind); + } + else if (symbolFlags & 2097152 /* Alias */) { + symbolKind = "alias" /* alias */; + pushTypePart(symbolKind); + displayParts.push(ts.spacePart()); + if (useConstructSignatures) { + displayParts.push(ts.keywordPart(94 /* NewKeyword */)); + displayParts.push(ts.spacePart()); } - else if (symbolFlags & 2097152 /* Alias */) { - symbolKind = "alias" /* alias */; - pushTypePart(symbolKind); + addFullSymbolName(symbol); + } + else { + addPrefixForAnyFunctionOrVar(symbol, symbolKind); + } + switch (symbolKind) { + case "JSX attribute" /* jsxAttribute */: + case "property" /* memberVariableElement */: + case "var" /* variableElement */: + case "const" /* constElement */: + case "let" /* letElement */: + case "parameter" /* parameterElement */: + case "local var" /* localVariableElement */: + // If it is call or construct signature of lambda's write type name + displayParts.push(ts.punctuationPart(56 /* ColonToken */)); displayParts.push(ts.spacePart()); if (useConstructSignatures) { displayParts.push(ts.keywordPart(94 /* NewKeyword */)); displayParts.push(ts.spacePart()); } - addFullSymbolName(symbol); - } - else { - addPrefixForAnyFunctionOrVar(symbol, symbolKind); - } - switch (symbolKind) { - case "JSX attribute" /* jsxAttribute */: - case "property" /* memberVariableElement */: - case "var" /* variableElement */: - case "const" /* constElement */: - case "let" /* letElement */: - case "parameter" /* parameterElement */: - case "local var" /* localVariableElement */: - // If it is call or construct signature of lambda's write type name - displayParts.push(ts.punctuationPart(56 /* ColonToken */)); - displayParts.push(ts.spacePart()); - if (useConstructSignatures) { - displayParts.push(ts.keywordPart(94 /* NewKeyword */)); - displayParts.push(ts.spacePart()); - } - if (!(type.flags & 32768 /* Object */ && type.objectFlags & 16 /* Anonymous */) && type.symbol) { - ts.addRange(displayParts, ts.symbolToDisplayParts(typeChecker, type.symbol, enclosingDeclaration, /*meaning*/ undefined, 1 /* WriteTypeParametersOrArguments */)); - } - addSignatureDisplayParts(signature, allSignatures, 16 /* WriteArrowStyleSignature */); - break; - default: - // Just signature - addSignatureDisplayParts(signature, allSignatures); - } - hasAddedSymbolInfo = true; + if (!(type.flags & 32768 /* Object */ && type.objectFlags & 16 /* Anonymous */) && type.symbol) { + ts.addRange(displayParts, ts.symbolToDisplayParts(typeChecker, type.symbol, enclosingDeclaration, /*meaning*/ undefined, 1 /* WriteTypeParametersOrArguments */)); + } + addSignatureDisplayParts(signature, allSignatures, 16 /* WriteArrowStyleSignature */); + break; + default: + // Just signature + addSignatureDisplayParts(signature, allSignatures); } + hasAddedSymbolInfo = true; } - else if ((ts.isNameOfFunctionDeclaration(location) && !(symbolFlags & 98304 /* Accessor */)) || - (location.kind === 123 /* ConstructorKeyword */ && location.parent.kind === 152 /* Constructor */)) { - // get the signature from the declaration and write it - var functionDeclaration_1 = location.parent; - // Use function declaration to write the signatures only if the symbol corresponding to this declaration - var locationIsSymbolDeclaration = ts.findDeclaration(symbol, function (declaration) { - return declaration === (location.kind === 123 /* ConstructorKeyword */ ? functionDeclaration_1.parent : functionDeclaration_1); - }); - if (locationIsSymbolDeclaration) { - var allSignatures = functionDeclaration_1.kind === 152 /* Constructor */ ? type.getNonNullableType().getConstructSignatures() : type.getNonNullableType().getCallSignatures(); - if (!typeChecker.isImplementationOfOverload(functionDeclaration_1)) { - signature = typeChecker.getSignatureFromDeclaration(functionDeclaration_1); - } - else { - signature = allSignatures[0]; - } - if (functionDeclaration_1.kind === 152 /* Constructor */) { - // show (constructor) Type(...) signature - symbolKind = "constructor" /* constructorImplementationElement */; - addPrefixForAnyFunctionOrVar(type.symbol, symbolKind); - } - else { - // (function/method) symbol(..signature) - addPrefixForAnyFunctionOrVar(functionDeclaration_1.kind === 155 /* CallSignature */ && - !(type.symbol.flags & 2048 /* TypeLiteral */ || type.symbol.flags & 4096 /* ObjectLiteral */) ? type.symbol : symbol, symbolKind); - } - addSignatureDisplayParts(signature, allSignatures); - hasAddedSymbolInfo = true; + } + else if ((ts.isNameOfFunctionDeclaration(location) && !(symbolFlags & 98304 /* Accessor */)) || // name of function declaration + (location.kind === 123 /* ConstructorKeyword */ && location.parent.kind === 152 /* Constructor */)) { + // get the signature from the declaration and write it + var functionDeclaration_1 = location.parent; + // Use function declaration to write the signatures only if the symbol corresponding to this declaration + var locationIsSymbolDeclaration = ts.find(symbol.declarations, function (declaration) { + return declaration === (location.kind === 123 /* ConstructorKeyword */ ? functionDeclaration_1.parent : functionDeclaration_1); + }); + if (locationIsSymbolDeclaration) { + var allSignatures = functionDeclaration_1.kind === 152 /* Constructor */ ? type.getNonNullableType().getConstructSignatures() : type.getNonNullableType().getCallSignatures(); + if (!typeChecker.isImplementationOfOverload(functionDeclaration_1)) { + signature = typeChecker.getSignatureFromDeclaration(functionDeclaration_1); + } + else { + signature = allSignatures[0]; } + if (functionDeclaration_1.kind === 152 /* Constructor */) { + // show (constructor) Type(...) signature + symbolKind = "constructor" /* constructorImplementationElement */; + addPrefixForAnyFunctionOrVar(type.symbol, symbolKind); + } + else { + // (function/method) symbol(..signature) + addPrefixForAnyFunctionOrVar(functionDeclaration_1.kind === 155 /* CallSignature */ && + !(type.symbol.flags & 2048 /* TypeLiteral */ || type.symbol.flags & 4096 /* ObjectLiteral */) ? type.symbol : symbol, symbolKind); + } + addSignatureDisplayParts(signature, allSignatures); + hasAddedSymbolInfo = true; } } } @@ -83502,7 +84012,9 @@ var ts; symbolFlags & 98304 /* Accessor */ || symbolKind === "method" /* memberFunctionElement */) { var allSignatures = type.getNonNullableType().getCallSignatures(); - addSignatureDisplayParts(allSignatures[0], allSignatures); + if (allSignatures.length) { + addSignatureDisplayParts(allSignatures[0], allSignatures); + } } } } @@ -83676,11 +84188,11 @@ var ts; getSourceFile: function (fileName) { return fileName === ts.normalizePath(inputFileName) ? sourceFile : undefined; }, writeFile: function (name, text) { if (ts.fileExtensionIs(name, ".map")) { - ts.Debug.assert(sourceMapText === undefined, "Unexpected multiple source map outputs for the file '" + name + "'"); + ts.Debug.assertEqual(sourceMapText, undefined, "Unexpected multiple source map outputs, file:", name); sourceMapText = text; } else { - ts.Debug.assert(outputText === undefined, "Unexpected multiple outputs for the file: '" + name + "'"); + ts.Debug.assertEqual(outputText, undefined, "Unexpected multiple outputs, file:", name); outputText = text; } }, @@ -84005,7 +84517,7 @@ var ts; (function (ts) { var formatting; (function (formatting) { - var FormattingContext = (function () { + var FormattingContext = /** @class */ (function () { function FormattingContext(sourceFile, formattingRequestKind, options) { this.sourceFile = sourceFile; this.formattingRequestKind = formattingRequestKind; @@ -84104,7 +84616,7 @@ var ts; (function (ts) { var formatting; (function (formatting) { - var Rule = (function () { + var Rule = /** @class */ (function () { function Rule(Descriptor, Operation, Flag) { if (Flag === void 0) { Flag = 0 /* None */; } this.Descriptor = Descriptor; @@ -84142,7 +84654,7 @@ var ts; (function (ts) { var formatting; (function (formatting) { - var RuleDescriptor = (function () { + var RuleDescriptor = /** @class */ (function () { function RuleDescriptor(LeftTokenRange, RightTokenRange) { this.LeftTokenRange = LeftTokenRange; this.RightTokenRange = RightTokenRange; @@ -84187,7 +84699,7 @@ var ts; (function (ts) { var formatting; (function (formatting) { - var RuleOperation = (function () { + var RuleOperation = /** @class */ (function () { function RuleOperation(Context, Action) { this.Context = Context; this.Action = Action; @@ -84213,7 +84725,7 @@ var ts; (function (ts) { var formatting; (function (formatting) { - var RuleOperationContext = (function () { + var RuleOperationContext = /** @class */ (function () { function RuleOperationContext() { var funcs = []; for (var _i = 0; _i < arguments.length; _i++) { @@ -84248,7 +84760,7 @@ var ts; (function (ts) { var formatting; (function (formatting) { - var Rules = (function () { + var Rules = /** @class */ (function () { function Rules() { /// /// Common Rules @@ -84407,6 +84919,7 @@ var ts; // Insert space after opening and before closing nonempty parenthesis this.SpaceAfterOpenParen = new formatting.Rule(formatting.RuleDescriptor.create3(19 /* OpenParenToken */, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsOptionEnabled("insertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis"), Rules.IsNonJsxSameLineTokenContext), 2 /* Space */)); this.SpaceBeforeCloseParen = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 20 /* CloseParenToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsOptionEnabled("insertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis"), Rules.IsNonJsxSameLineTokenContext), 2 /* Space */)); + this.SpaceBetweenOpenParens = new formatting.Rule(formatting.RuleDescriptor.create1(19 /* OpenParenToken */, 19 /* OpenParenToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsOptionEnabled("insertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis"), Rules.IsNonJsxSameLineTokenContext), 2 /* Space */)); this.NoSpaceBetweenParens = new formatting.Rule(formatting.RuleDescriptor.create1(19 /* OpenParenToken */, 20 /* CloseParenToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsNonJsxSameLineTokenContext), 8 /* Delete */)); this.NoSpaceAfterOpenParen = new formatting.Rule(formatting.RuleDescriptor.create3(19 /* OpenParenToken */, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsOptionDisabledOrUndefined("insertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis"), Rules.IsNonJsxSameLineTokenContext), 8 /* Delete */)); this.NoSpaceBeforeCloseParen = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 20 /* CloseParenToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsOptionDisabledOrUndefined("insertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis"), Rules.IsNonJsxSameLineTokenContext), 8 /* Delete */)); @@ -84486,7 +84999,7 @@ var ts; this.SpaceAfterComma, this.NoSpaceAfterComma, this.SpaceAfterAnonymousFunctionKeyword, this.NoSpaceAfterAnonymousFunctionKeyword, this.SpaceAfterKeywordInControl, this.NoSpaceAfterKeywordInControl, - this.SpaceAfterOpenParen, this.SpaceBeforeCloseParen, this.NoSpaceBetweenParens, this.NoSpaceAfterOpenParen, this.NoSpaceBeforeCloseParen, + this.SpaceAfterOpenParen, this.SpaceBeforeCloseParen, this.SpaceBetweenOpenParens, this.NoSpaceBetweenParens, this.NoSpaceAfterOpenParen, this.NoSpaceBeforeCloseParen, this.SpaceAfterOpenBracket, this.SpaceBeforeCloseBracket, this.NoSpaceBetweenBrackets, this.NoSpaceAfterOpenBracket, this.NoSpaceBeforeCloseBracket, this.SpaceAfterOpenBrace, this.SpaceBeforeCloseBrace, this.NoSpaceBetweenEmptyBraceBrackets, this.NoSpaceAfterOpenBrace, this.NoSpaceBeforeCloseBrace, this.SpaceAfterTemplateHeadAndMiddle, this.SpaceBeforeTemplateMiddleAndTail, this.NoSpaceAfterTemplateHeadAndMiddle, this.NoSpaceBeforeTemplateMiddleAndTail, @@ -84825,7 +85338,7 @@ var ts; (function (ts) { var formatting; (function (formatting) { - var RulesMap = (function () { + var RulesMap = /** @class */ (function () { function RulesMap() { this.map = []; this.mapRowLength = 0; @@ -84895,7 +85408,7 @@ var ts; RulesPosition[RulesPosition["NoContextRulesSpecific"] = MaskBitSize * 4] = "NoContextRulesSpecific"; RulesPosition[RulesPosition["NoContextRulesAny"] = MaskBitSize * 5] = "NoContextRulesAny"; })(RulesPosition = formatting.RulesPosition || (formatting.RulesPosition = {})); - var RulesBucketConstructionState = (function () { + var RulesBucketConstructionState = /** @class */ (function () { function RulesBucketConstructionState() { //// The Rules list contains all the inserted rules into a rulebucket in the following order: //// 1- Ignore rules with specific token combination @@ -84936,7 +85449,7 @@ var ts; return RulesBucketConstructionState; }()); formatting.RulesBucketConstructionState = RulesBucketConstructionState; - var RulesBucket = (function () { + var RulesBucket = /** @class */ (function () { function RulesBucket() { this.rules = []; } @@ -84985,7 +85498,7 @@ var ts; for (var token = 0 /* FirstToken */; token <= 142 /* LastToken */; token++) { allTokens.push(token); } - var TokenValuesAccess = (function () { + var TokenValuesAccess = /** @class */ (function () { function TokenValuesAccess(tokens) { if (tokens === void 0) { tokens = []; } this.tokens = tokens; @@ -84999,7 +85512,7 @@ var ts; TokenValuesAccess.prototype.isSpecific = function () { return true; }; return TokenValuesAccess; }()); - var TokenSingleValueAccess = (function () { + var TokenSingleValueAccess = /** @class */ (function () { function TokenSingleValueAccess(token) { this.token = token; } @@ -85012,7 +85525,7 @@ var ts; TokenSingleValueAccess.prototype.isSpecific = function () { return true; }; return TokenSingleValueAccess; }()); - var TokenAllAccess = (function () { + var TokenAllAccess = /** @class */ (function () { function TokenAllAccess() { } TokenAllAccess.prototype.GetTokens = function () { @@ -85027,7 +85540,7 @@ var ts; TokenAllAccess.prototype.isSpecific = function () { return false; }; return TokenAllAccess; }()); - var TokenAllExceptAccess = (function () { + var TokenAllExceptAccess = /** @class */ (function () { function TokenAllExceptAccess(except) { this.except = except; } @@ -85119,7 +85632,7 @@ var ts; (function (ts) { var formatting; (function (formatting) { - var RulesProvider = (function () { + var RulesProvider = /** @class */ (function () { function RulesProvider() { this.globalRules = new formatting.Rules(); var activeRules = this.globalRules.HighPriorityCommonRules.slice(0).concat(this.globalRules.UserConfigurableRules).concat(this.globalRules.LowPriorityCommonRules); @@ -85427,7 +85940,6 @@ var ts; function formatSpanWorker(originalRange, enclosingNode, initialIndentation, delta, formattingScanner, options, rulesProvider, requestKind, rangeContainsError, sourceFile) { // formatting context is used by rules provider var formattingContext = new formatting.FormattingContext(sourceFile, requestKind, options); - var previousRangeHasError; var previousRange; var previousParent; var previousRangeStartLine; @@ -85818,7 +86330,7 @@ var ts; function processRange(range, rangeStart, parent, contextNode, dynamicIndentation) { var rangeHasError = rangeContainsError(range); var lineAdded; - if (!rangeHasError && !previousRangeHasError) { + if (!rangeHasError) { if (!previousRange) { // trim whitespaces starting from the beginning of the span up to the current line var originalStart = sourceFile.getLineAndCharacterOfPosition(originalRange.pos); @@ -85832,7 +86344,6 @@ var ts; previousRange = range; previousParent = parent; previousRangeStartLine = rangeStart.line; - previousRangeHasError = rangeHasError; return lineAdded; } function processPair(currentItem, currentStartLine, currentParent, previousItem, previousStartLine, previousParent, contextNode, dynamicIndentation) { @@ -86038,6 +86549,51 @@ var ts; } } } + /** + * @param precedingToken pass `null` if preceding token was already computed and result was `undefined`. + */ + function getRangeOfEnclosingComment(sourceFile, position, onlyMultiLine, precedingToken, // tslint:disable-line:no-null-keyword + tokenAtPosition, predicate) { + if (tokenAtPosition === void 0) { tokenAtPosition = ts.getTokenAtPosition(sourceFile, position, /*includeJsDocComment*/ false); } + var tokenStart = tokenAtPosition.getStart(sourceFile); + if (tokenStart <= position && position < tokenAtPosition.getEnd()) { + return undefined; + } + if (precedingToken === undefined) { + precedingToken = ts.findPrecedingToken(position, sourceFile); + } + // Between two consecutive tokens, all comments are either trailing on the former + // or leading on the latter (and none are in both lists). + var trailingRangesOfPreviousToken = precedingToken && ts.getTrailingCommentRanges(sourceFile.text, precedingToken.end); + var leadingCommentRangesOfNextToken = ts.getLeadingCommentRangesOfNode(tokenAtPosition, sourceFile); + var commentRanges = trailingRangesOfPreviousToken && leadingCommentRangesOfNextToken ? + trailingRangesOfPreviousToken.concat(leadingCommentRangesOfNextToken) : + trailingRangesOfPreviousToken || leadingCommentRangesOfNextToken; + if (commentRanges) { + for (var _i = 0, commentRanges_1 = commentRanges; _i < commentRanges_1.length; _i++) { + var range = commentRanges_1[_i]; + // The end marker of a single-line comment does not include the newline character. + // With caret at `^`, in the following case, we are inside a comment (^ denotes the cursor position): + // + // // asdf ^\n + // + // But for closed multi-line comments, we don't want to be inside the comment in the following case: + // + // /* asdf */^ + // + // However, unterminated multi-line comments *do* contain their end. + // + // Internally, we represent the end of the comment at the newline and closing '/', respectively. + // + if ((range.pos < position && position < range.end || + position === range.end && (range.kind === 2 /* SingleLineCommentTrivia */ || position === sourceFile.getFullWidth()))) { + return (range.kind === 3 /* MultiLineCommentTrivia */ || !onlyMultiLine) && (!predicate || predicate(range)) ? range : undefined; + } + } + } + return undefined; + } + formatting.getRangeOfEnclosingComment = getRangeOfEnclosingComment; function getOpenTokenForList(node, list) { switch (node.kind) { case 152 /* Constructor */: @@ -86165,12 +86721,28 @@ var ts; return 0; } var precedingToken = ts.findPrecedingToken(position, sourceFile); + var enclosingCommentRange = formatting.getRangeOfEnclosingComment(sourceFile, position, /*onlyMultiLine*/ true, precedingToken || null); // tslint:disable-line:no-null-keyword + if (enclosingCommentRange) { + var previousLine = ts.getLineAndCharacterOfPosition(sourceFile, position).line - 1; + var commentStartLine = ts.getLineAndCharacterOfPosition(sourceFile, enclosingCommentRange.pos).line; + ts.Debug.assert(commentStartLine >= 0); + if (previousLine <= commentStartLine) { + return findFirstNonWhitespaceColumn(ts.getStartPositionOfLine(commentStartLine, sourceFile), position, sourceFile, options); + } + var startPostionOfLine = ts.getStartPositionOfLine(previousLine, sourceFile); + var _a = findFirstNonWhitespaceCharacterAndColumn(startPostionOfLine, position, sourceFile, options), column = _a.column, character = _a.character; + if (column === 0) { + return column; + } + var firstNonWhitespaceCharacterCode = sourceFile.text.charCodeAt(startPostionOfLine + character); + return firstNonWhitespaceCharacterCode === 42 /* asterisk */ ? column - 1 : column; + } if (!precedingToken) { return getBaseIndentation(options); } // no indentation in string \regex\template literals var precedingTokenIsLiteral = ts.isStringOrRegularExpressionOrTemplateLiteral(precedingToken.kind); - if (precedingTokenIsLiteral && precedingToken.getStart(sourceFile) <= position && precedingToken.end > position) { + if (precedingTokenIsLiteral && precedingToken.getStart(sourceFile) <= position && position < precedingToken.end) { return 0; } var lineAtPosition = sourceFile.getLineAndCharacterOfPosition(position).line; @@ -86473,13 +87045,13 @@ var ts; var lineStart = sourceFile.getPositionOfLineAndCharacter(lineAndCharacter.line, 0); return findFirstNonWhitespaceColumn(lineStart, lineStart + lineAndCharacter.character, sourceFile, options); } - /* - Character is the actual index of the character since the beginning of the line. - Column - position of the character after expanding tabs to spaces - "0\t2$" - value of 'character' for '$' is 3 - value of 'column' for '$' is 6 (assuming that tab size is 4) - */ + /** + * Character is the actual index of the character since the beginning of the line. + * Column - position of the character after expanding tabs to spaces. + * "0\t2$" + * value of 'character' for '$' is 3 + * value of 'column' for '$' is 6 (assuming that tab size is 4) + */ function findFirstNonWhitespaceCharacterAndColumn(startPos, endPos, sourceFile, options) { var character = 0; var column = 0; @@ -86633,6 +87205,12 @@ var ts; } return false; } + var ChangeKind; + (function (ChangeKind) { + ChangeKind[ChangeKind["Remove"] = 0] = "Remove"; + ChangeKind[ChangeKind["ReplaceWithSingleNode"] = 1] = "ReplaceWithSingleNode"; + ChangeKind[ChangeKind["ReplaceWithMultipleNodes"] = 2] = "ReplaceWithMultipleNodes"; + })(ChangeKind || (ChangeKind = {})); function getSeparatorCharacter(separator) { return ts.tokenToString(separator.kind); } @@ -86666,13 +87244,11 @@ var ts; } textChanges.getAdjustedStartPosition = getAdjustedStartPosition; function getAdjustedEndPosition(sourceFile, node, options) { - if (options.useNonAdjustedEndPosition) { + if (options.useNonAdjustedEndPosition || ts.isExpression(node)) { return node.getEnd(); } var end = node.getEnd(); var newEnd = ts.skipTrivia(sourceFile.text, end, /*stopAfterLineBreak*/ true); - // check if last character before newPos is linebreak - // if yes - considered all skipped trivia to be trailing trivia of the node return newEnd !== end && ts.isLineBreak(sourceFile.text.charCodeAt(newEnd - 1)) ? newEnd : end; @@ -86691,7 +87267,10 @@ var ts; } return s; } - var ChangeTracker = (function () { + function getNewlineKind(context) { + return context.newLineCharacter === "\n" ? 1 /* LineFeed */ : 0 /* CarriageReturnLineFeed */; + } + var ChangeTracker = /** @class */ (function () { function ChangeTracker(newLine, rulesProvider, validator) { this.newLine = newLine; this.rulesProvider = rulesProvider; @@ -86700,24 +87279,24 @@ var ts; this.newLineCharacter = ts.getNewLineCharacter({ newLine: newLine }); } ChangeTracker.fromCodeFixContext = function (context) { - return new ChangeTracker(context.newLineCharacter === "\n" ? 1 /* LineFeed */ : 0 /* CarriageReturnLineFeed */, context.rulesProvider); + return new ChangeTracker(getNewlineKind(context), context.rulesProvider); + }; + ChangeTracker.prototype.deleteRange = function (sourceFile, range) { + this.changes.push({ kind: ChangeKind.Remove, sourceFile: sourceFile, range: range }); + return this; }; ChangeTracker.prototype.deleteNode = function (sourceFile, node, options) { if (options === void 0) { options = {}; } var startPosition = getAdjustedStartPosition(sourceFile, node, options, Position.FullStart); var endPosition = getAdjustedEndPosition(sourceFile, node, options); - this.changes.push({ sourceFile: sourceFile, options: options, range: { pos: startPosition, end: endPosition } }); - return this; - }; - ChangeTracker.prototype.deleteRange = function (sourceFile, range) { - this.changes.push({ sourceFile: sourceFile, range: range }); + this.changes.push({ kind: ChangeKind.Remove, sourceFile: sourceFile, range: { pos: startPosition, end: endPosition } }); return this; }; ChangeTracker.prototype.deleteNodeRange = function (sourceFile, startNode, endNode, options) { if (options === void 0) { options = {}; } var startPosition = getAdjustedStartPosition(sourceFile, startNode, options, Position.FullStart); var endPosition = getAdjustedEndPosition(sourceFile, endNode, options); - this.changes.push({ sourceFile: sourceFile, options: options, range: { pos: startPosition, end: endPosition } }); + this.changes.push({ kind: ChangeKind.Remove, sourceFile: sourceFile, range: { pos: startPosition, end: endPosition } }); return this; }; ChangeTracker.prototype.deleteNodeInList = function (sourceFile, node) { @@ -86756,33 +87335,68 @@ var ts; }; ChangeTracker.prototype.replaceRange = function (sourceFile, range, newNode, options) { if (options === void 0) { options = {}; } - this.changes.push({ sourceFile: sourceFile, range: range, options: options, node: newNode }); + this.changes.push({ kind: ChangeKind.ReplaceWithSingleNode, sourceFile: sourceFile, range: range, options: options, node: newNode }); return this; }; ChangeTracker.prototype.replaceNode = function (sourceFile, oldNode, newNode, options) { if (options === void 0) { options = {}; } var startPosition = getAdjustedStartPosition(sourceFile, oldNode, options, Position.Start); var endPosition = getAdjustedEndPosition(sourceFile, oldNode, options); - this.changes.push({ sourceFile: sourceFile, options: options, useIndentationFromFile: true, node: newNode, range: { pos: startPosition, end: endPosition } }); - return this; + return this.replaceWithSingle(sourceFile, startPosition, endPosition, newNode, options); }; ChangeTracker.prototype.replaceNodeRange = function (sourceFile, startNode, endNode, newNode, options) { if (options === void 0) { options = {}; } var startPosition = getAdjustedStartPosition(sourceFile, startNode, options, Position.Start); var endPosition = getAdjustedEndPosition(sourceFile, endNode, options); - this.changes.push({ sourceFile: sourceFile, options: options, useIndentationFromFile: true, node: newNode, range: { pos: startPosition, end: endPosition } }); + return this.replaceWithSingle(sourceFile, startPosition, endPosition, newNode, options); + }; + ChangeTracker.prototype.replaceWithSingle = function (sourceFile, startPosition, endPosition, newNode, options) { + this.changes.push({ + kind: ChangeKind.ReplaceWithSingleNode, + sourceFile: sourceFile, + options: options, + node: newNode, + range: { pos: startPosition, end: endPosition } + }); return this; }; + ChangeTracker.prototype.replaceWithMultiple = function (sourceFile, startPosition, endPosition, newNodes, options) { + this.changes.push({ + kind: ChangeKind.ReplaceWithMultipleNodes, + sourceFile: sourceFile, + options: options, + nodes: newNodes, + range: { pos: startPosition, end: endPosition } + }); + return this; + }; + ChangeTracker.prototype.replaceNodeWithNodes = function (sourceFile, oldNode, newNodes, options) { + var startPosition = getAdjustedStartPosition(sourceFile, oldNode, options, Position.Start); + var endPosition = getAdjustedEndPosition(sourceFile, oldNode, options); + return this.replaceWithMultiple(sourceFile, startPosition, endPosition, newNodes, options); + }; + ChangeTracker.prototype.replaceNodesWithNodes = function (sourceFile, oldNodes, newNodes, options) { + var startPosition = getAdjustedStartPosition(sourceFile, oldNodes[0], options, Position.Start); + var endPosition = getAdjustedEndPosition(sourceFile, ts.lastOrUndefined(oldNodes), options); + return this.replaceWithMultiple(sourceFile, startPosition, endPosition, newNodes, options); + }; + ChangeTracker.prototype.replaceRangeWithNodes = function (sourceFile, range, newNodes, options) { + return this.replaceWithMultiple(sourceFile, range.pos, range.end, newNodes, options); + }; + ChangeTracker.prototype.replaceNodeRangeWithNodes = function (sourceFile, startNode, endNode, newNodes, options) { + var startPosition = getAdjustedStartPosition(sourceFile, startNode, options, Position.Start); + var endPosition = getAdjustedEndPosition(sourceFile, endNode, options); + return this.replaceWithMultiple(sourceFile, startPosition, endPosition, newNodes, options); + }; ChangeTracker.prototype.insertNodeAt = function (sourceFile, pos, newNode, options) { if (options === void 0) { options = {}; } - this.changes.push({ sourceFile: sourceFile, options: options, node: newNode, range: { pos: pos, end: pos } }); + this.changes.push({ kind: ChangeKind.ReplaceWithSingleNode, sourceFile: sourceFile, options: options, node: newNode, range: { pos: pos, end: pos } }); return this; }; ChangeTracker.prototype.insertNodeBefore = function (sourceFile, before, newNode, options) { if (options === void 0) { options = {}; } var startPosition = getAdjustedStartPosition(sourceFile, before, options, Position.Start); - this.changes.push({ sourceFile: sourceFile, options: options, useIndentationFromFile: true, node: newNode, range: { pos: startPosition, end: startPosition } }); - return this; + return this.replaceWithSingle(sourceFile, startPosition, startPosition, newNode, options); }; ChangeTracker.prototype.insertNodeAfter = function (sourceFile, after, newNode, options) { if (options === void 0) { options = {}; } @@ -86794,6 +87408,7 @@ var ts; // if not - insert semicolon to preserve the code from changing the meaning due to ASI if (sourceFile.text.charCodeAt(after.end - 1) !== 59 /* semicolon */) { this.changes.push({ + kind: ChangeKind.ReplaceWithSingleNode, sourceFile: sourceFile, options: {}, range: { pos: after.end, end: after.end }, @@ -86802,8 +87417,7 @@ var ts; } } var endPosition = getAdjustedEndPosition(sourceFile, after, options); - this.changes.push({ sourceFile: sourceFile, options: options, useIndentationFromFile: true, node: newNode, range: { pos: endPosition, end: endPosition } }); - return this; + return this.replaceWithSingle(sourceFile, endPosition, endPosition, newNode, options); }; /** * This function should be used to insert nodes in lists when nodes don't carry separators as the part of the node range, @@ -86869,10 +87483,10 @@ var ts; startPos = ts.getStartPositionOfLine(lineAndCharOfNextElement.line, sourceFile); } this.changes.push({ + kind: ChangeKind.ReplaceWithSingleNode, sourceFile: sourceFile, range: { pos: startPos, end: containingList[index + 1].getStart(sourceFile) }, node: newNode, - useIndentationFromFile: true, options: { prefix: prefix, // write separator and leading trivia of the next element as suffix @@ -86911,6 +87525,7 @@ var ts; if (multilineList) { // insert separator immediately following the 'after' node to preserve comments in trailing trivia this.changes.push({ + kind: ChangeKind.ReplaceWithSingleNode, sourceFile: sourceFile, range: { pos: end, end: end }, node: ts.createToken(separator), @@ -86924,6 +87539,7 @@ var ts; insertPos--; } this.changes.push({ + kind: ChangeKind.ReplaceWithSingleNode, sourceFile: sourceFile, range: { pos: insertPos, end: insertPos }, node: newNode, @@ -86932,6 +87548,7 @@ var ts; } else { this.changes.push({ + kind: ChangeKind.ReplaceWithSingleNode, sourceFile: sourceFile, range: { pos: end, end: end }, node: newNode, @@ -86973,33 +87590,45 @@ var ts; return ts.createTextSpanFromBounds(change.range.pos, change.range.end); }; ChangeTracker.prototype.computeNewText = function (change, sourceFile) { - if (!change.node) { + var _this = this; + if (change.kind === ChangeKind.Remove) { // deletion case return ""; } var options = change.options || {}; - var nonFormattedText = getNonformattedText(change.node, sourceFile, this.newLine); + var text; + var pos = change.range.pos; + var posStartsLine = ts.getLineStartPositionForPosition(pos, sourceFile) === pos; + if (change.kind === ChangeKind.ReplaceWithMultipleNodes) { + var parts = change.nodes.map(function (n) { return _this.getFormattedTextOfNode(n, sourceFile, pos, options); }); + text = parts.join(change.options.nodeSeparator); + } + else { + ts.Debug.assert(change.kind === ChangeKind.ReplaceWithSingleNode, "change.kind === ReplaceWithSingleNode"); + text = this.getFormattedTextOfNode(change.node, sourceFile, pos, options); + } + // strip initial indentation (spaces or tabs) if text will be inserted in the middle of the line + text = (posStartsLine || options.indentation !== undefined) ? text : text.replace(/^\s+/, ""); + return (options.prefix || "") + text + (options.suffix || ""); + }; + ChangeTracker.prototype.getFormattedTextOfNode = function (node, sourceFile, pos, options) { + var nonformattedText = getNonformattedText(node, sourceFile, this.newLine); if (this.validator) { - this.validator(nonFormattedText); + this.validator(nonformattedText); } var formatOptions = this.rulesProvider.getFormatOptions(); - var pos = change.range.pos; var posStartsLine = ts.getLineStartPositionForPosition(pos, sourceFile) === pos; - var initialIndentation = change.options.indentation !== undefined - ? change.options.indentation - : change.useIndentationFromFile - ? ts.formatting.SmartIndenter.getIndentation(change.range.pos, sourceFile, formatOptions, posStartsLine || (change.options.prefix === this.newLineCharacter)) + var initialIndentation = options.indentation !== undefined + ? options.indentation + : (options.useIndentationFromFile !== false) + ? ts.formatting.SmartIndenter.getIndentation(pos, sourceFile, formatOptions, posStartsLine || (options.prefix === this.newLineCharacter)) : 0; - var delta = change.options.delta !== undefined - ? change.options.delta - : ts.formatting.SmartIndenter.shouldIndentChildNode(change.node) - ? formatOptions.indentSize + var delta = options.delta !== undefined + ? options.delta + : ts.formatting.SmartIndenter.shouldIndentChildNode(node) + ? (formatOptions.indentSize || 0) : 0; - var text = applyFormatting(nonFormattedText, sourceFile, initialIndentation, delta, this.rulesProvider); - // strip initial indentation (spaces or tabs) if text will be inserted in the middle of the line - // however keep indentation if it is was forced - text = posStartsLine || change.options.indentation !== undefined ? text : text.replace(/^\s+/, ""); - return (options.prefix || "") + text + (options.suffix || ""); + return applyFormatting(nonformattedText, sourceFile, initialIndentation, delta, this.rulesProvider); }; ChangeTracker.normalize = function (changes) { // order changes by start position @@ -87065,7 +87694,7 @@ var ts; nodeArray.end = getEnd(nodes); return nodeArray; } - var Writer = (function () { + var Writer = /** @class */ (function () { function Writer(newLine) { var _this = this; this.lastNonTriviaPosition = 0; @@ -87948,7 +88577,7 @@ var ts; ModuleSpecifierComparison[ModuleSpecifierComparison["Equal"] = 1] = "Equal"; ModuleSpecifierComparison[ModuleSpecifierComparison["Worse"] = 2] = "Worse"; })(ModuleSpecifierComparison || (ModuleSpecifierComparison = {})); - var ImportCodeActionMap = (function () { + var ImportCodeActionMap = /** @class */ (function () { function ImportCodeActionMap() { this.symbolIdToActionMap = []; } @@ -88061,7 +88690,7 @@ var ts; } else if (ts.isJsxOpeningLikeElement(token.parent) && token.parent.tagName === token) { // The error wasn't for the symbolAtLocation, it was for the JSX tag itself, which needs access to e.g. `React`. - symbol = checker.getAliasedSymbol(checker.resolveNameAtLocation(token, checker.getJsxNamespace(), 107455 /* Value */)); + symbol = checker.getAliasedSymbol(checker.resolveName(checker.getJsxNamespace(), token.parent.tagName, 107455 /* Value */)); symbolName = symbol.name; } else { @@ -88086,7 +88715,7 @@ var ts; if (localSymbol && localSymbol.escapedName === name && checkSymbolHasMeaning(localSymbol, currentTokenMeaning)) { // check if this symbol is already used var symbolId = getUniqueSymbolId(localSymbol); - symbolIdActionMap.addActions(symbolId, getCodeActionForImport(moduleSymbol, name, /*isDefault*/ true)); + symbolIdActionMap.addActions(symbolId, getCodeActionForImport(moduleSymbol, name, /*isNamespaceImport*/ true)); } } // "default" is a keyword and not a legal identifier for the import, so we don't expect it here @@ -88162,8 +88791,8 @@ var ts; var namespaceImportDeclaration; var namedImportDeclaration; var existingModuleSpecifier; - for (var _i = 0, declarations_14 = declarations; _i < declarations_14.length; _i++) { - var declaration = declarations_14[_i]; + for (var _i = 0, declarations_13 = declarations; _i < declarations_13.length; _i++) { + var declaration = declarations_13[_i]; if (declaration.kind === 238 /* ImportDeclaration */) { var namedBindings = declaration.importClause && declaration.importClause.namedBindings; if (namedBindings && namedBindings.kind === 240 /* NamespaceImport */) { @@ -88273,9 +88902,11 @@ var ts; : isNamespaceImport ? ts.createImportClause(/*name*/ undefined, ts.createNamespaceImport(ts.createIdentifier(symbolName))) : ts.createImportClause(/*name*/ undefined, ts.createNamedImports([ts.createImportSpecifier(/*propertyName*/ undefined, ts.createIdentifier(symbolName))])); - var importDecl = ts.createImportDeclaration(/*decorators*/ undefined, /*modifiers*/ undefined, importClause, ts.createLiteral(moduleSpecifierWithoutQuotes)); + var moduleSpecifierLiteral = ts.createLiteral(moduleSpecifierWithoutQuotes); + moduleSpecifierLiteral.singleQuote = getSingleQuoteStyleFromExistingImports(); + var importDecl = ts.createImportDeclaration(/*decorators*/ undefined, /*modifiers*/ undefined, importClause, moduleSpecifierLiteral); if (!lastImportDeclaration) { - changeTracker.insertNodeAt(sourceFile, sourceFile.getStart(), importDecl, { suffix: "" + context.newLineCharacter + context.newLineCharacter }); + changeTracker.insertNodeAt(sourceFile, getSourceFileImportLocation(sourceFile), importDecl, { suffix: "" + context.newLineCharacter + context.newLineCharacter }); } else { changeTracker.insertNodeAfter(sourceFile, lastImportDeclaration, importDecl, { suffix: context.newLineCharacter }); @@ -88284,6 +88915,46 @@ var ts; // between the only import statement and user code. Otherwise just insert the statement because chances // are there are already a new line seperating code and import statements. return createCodeAction(ts.Diagnostics.Import_0_from_1, [symbolName, "\"" + moduleSpecifierWithoutQuotes + "\""], changeTracker.getChanges(), "NewImport", moduleSpecifierWithoutQuotes); + function getSourceFileImportLocation(node) { + // For a source file, it is possible there are detached comments we should not skip + var text = node.text; + var ranges = ts.getLeadingCommentRanges(text, 0); + if (!ranges) + return 0; + var position = 0; + // However we should still skip a pinned comment at the top + if (ranges.length && ranges[0].kind === 3 /* MultiLineCommentTrivia */ && ts.isPinnedComment(text, ranges[0])) { + position = ranges[0].end + 1; + ranges = ranges.slice(1); + } + // As well as any triple slash references + for (var _i = 0, ranges_1 = ranges; _i < ranges_1.length; _i++) { + var range = ranges_1[_i]; + if (range.kind === 2 /* SingleLineCommentTrivia */ && ts.isRecognizedTripleSlashComment(node.text, range.pos, range.end)) { + position = range.end + 1; + continue; + } + break; + } + return position; + } + function getSingleQuoteStyleFromExistingImports() { + var firstModuleSpecifier = ts.forEach(sourceFile.statements, function (node) { + if (ts.isImportDeclaration(node) || ts.isExportDeclaration(node)) { + if (node.moduleSpecifier && ts.isStringLiteral(node.moduleSpecifier)) { + return node.moduleSpecifier; + } + } + else if (ts.isImportEqualsDeclaration(node)) { + if (ts.isExternalModuleReference(node.moduleReference) && ts.isStringLiteral(node.moduleReference.expression)) { + return node.moduleReference.expression; + } + } + }); + if (firstModuleSpecifier) { + return sourceFile.text.charCodeAt(firstModuleSpecifier.getStart()) === 39 /* singleQuote */; + } + } function getModuleSpecifierForNewImport() { var fileName = sourceFile.fileName; var moduleFileName = moduleSymbol.valueDeclaration.getSourceFile().fileName; @@ -88415,8 +89086,8 @@ var ts; } function getNodeModulePathParts(fullPath) { // If fullPath can't be valid module file within node_modules, returns undefined. - // Example of expected pattern: /base/path/node_modules/[otherpackage/node_modules/]package/[subdirectory/]file.js - // Returns indices: ^ ^ ^ ^ + // Example of expected pattern: /base/path/node_modules/[@scope/otherpackage/@otherscope/node_modules/]package/[subdirectory/]file.js + // Returns indices: ^ ^ ^ ^ var topLevelNodeModulesIndex = 0; var topLevelPackageNameIndex = 0; var packageRootIndex = 0; @@ -88425,7 +89096,8 @@ var ts; (function (States) { States[States["BeforeNodeModules"] = 0] = "BeforeNodeModules"; States[States["NodeModules"] = 1] = "NodeModules"; - States[States["PackageContent"] = 2] = "PackageContent"; + States[States["Scope"] = 2] = "Scope"; + States[States["PackageContent"] = 3] = "PackageContent"; })(States || (States = {})); var partStart = 0; var partEnd = 0; @@ -88442,15 +89114,21 @@ var ts; } break; case 1 /* NodeModules */: - packageRootIndex = partEnd; - state = 2 /* PackageContent */; + case 2 /* Scope */: + if (state === 1 /* NodeModules */ && fullPath.charAt(partStart + 1) === "@") { + state = 2 /* Scope */; + } + else { + packageRootIndex = partEnd; + state = 3 /* PackageContent */; + } break; - case 2 /* PackageContent */: + case 3 /* PackageContent */: if (fullPath.indexOf("/node_modules/", partStart) === partStart) { state = 1 /* NodeModules */; } else { - state = 2 /* PackageContent */; + state = 3 /* PackageContent */; } break; } @@ -88807,231 +89485,1208 @@ var ts; (function (ts) { var refactor; (function (refactor) { - var actionName = "convert"; - var convertFunctionToES6Class = { - name: "Convert to ES2015 class", - description: ts.Diagnostics.Convert_function_to_an_ES2015_class.message, - getEditsForAction: getEditsForAction, - getAvailableActions: getAvailableActions - }; - refactor.registerRefactor(convertFunctionToES6Class); - function getAvailableActions(context) { - if (!ts.isInJavaScriptFile(context.file)) { - return undefined; - } - var start = context.startPosition; - var node = ts.getTokenAtPosition(context.file, start, /*includeJsDocComment*/ false); - var checker = context.program.getTypeChecker(); - var symbol = checker.getSymbolAtLocation(node); - if (symbol && ts.isDeclarationOfFunctionOrClassExpression(symbol)) { - symbol = symbol.valueDeclaration.initializer.symbol; + var convertFunctionToES6Class; + (function (convertFunctionToES6Class_1) { + var actionName = "convert"; + var convertFunctionToES6Class = { + name: "Convert to ES2015 class", + description: ts.Diagnostics.Convert_function_to_an_ES2015_class.message, + getEditsForAction: getEditsForAction, + getAvailableActions: getAvailableActions + }; + refactor.registerRefactor(convertFunctionToES6Class); + function getAvailableActions(context) { + if (!ts.isInJavaScriptFile(context.file)) { + return undefined; + } + var start = context.startPosition; + var node = ts.getTokenAtPosition(context.file, start, /*includeJsDocComment*/ false); + var checker = context.program.getTypeChecker(); + var symbol = checker.getSymbolAtLocation(node); + if (symbol && ts.isDeclarationOfFunctionOrClassExpression(symbol)) { + symbol = symbol.valueDeclaration.initializer.symbol; + } + if (symbol && (symbol.flags & 16 /* Function */) && symbol.members && (symbol.members.size > 0)) { + return [ + { + name: convertFunctionToES6Class.name, + description: convertFunctionToES6Class.description, + actions: [ + { + description: convertFunctionToES6Class.description, + name: actionName + } + ] + } + ]; + } } - if (symbol && (symbol.flags & 16 /* Function */) && symbol.members && (symbol.members.size > 0)) { - return [ - { - name: convertFunctionToES6Class.name, - description: convertFunctionToES6Class.description, - actions: [ - { - description: convertFunctionToES6Class.description, - name: actionName + function getEditsForAction(context, action) { + // Somehow wrong action got invoked? + if (actionName !== action) { + return undefined; + } + var start = context.startPosition; + var sourceFile = context.file; + var checker = context.program.getTypeChecker(); + var token = ts.getTokenAtPosition(sourceFile, start, /*includeJsDocComment*/ false); + var ctorSymbol = checker.getSymbolAtLocation(token); + var newLine = context.rulesProvider.getFormatOptions().newLineCharacter; + var deletedNodes = []; + var deletes = []; + if (!(ctorSymbol.flags & (16 /* Function */ | 3 /* Variable */))) { + return undefined; + } + var ctorDeclaration = ctorSymbol.valueDeclaration; + var changeTracker = ts.textChanges.ChangeTracker.fromCodeFixContext(context); + var precedingNode; + var newClassDeclaration; + switch (ctorDeclaration.kind) { + case 228 /* FunctionDeclaration */: + precedingNode = ctorDeclaration; + deleteNode(ctorDeclaration); + newClassDeclaration = createClassFromFunctionDeclaration(ctorDeclaration); + break; + case 226 /* VariableDeclaration */: + precedingNode = ctorDeclaration.parent.parent; + if (ctorDeclaration.parent.declarations.length === 1) { + deleteNode(precedingNode); + } + else { + deleteNode(ctorDeclaration, /*inList*/ true); + } + newClassDeclaration = createClassFromVariableDeclaration(ctorDeclaration); + break; + } + if (!newClassDeclaration) { + return undefined; + } + // Because the preceding node could be touched, we need to insert nodes before delete nodes. + changeTracker.insertNodeAfter(sourceFile, precedingNode, newClassDeclaration, { suffix: newLine }); + for (var _i = 0, deletes_1 = deletes; _i < deletes_1.length; _i++) { + var deleteCallback = deletes_1[_i]; + deleteCallback(); + } + return { + edits: changeTracker.getChanges() + }; + function deleteNode(node, inList) { + if (inList === void 0) { inList = false; } + if (deletedNodes.some(function (n) { return ts.isNodeDescendantOf(node, n); })) { + // Parent node has already been deleted; do nothing + return; + } + deletedNodes.push(node); + if (inList) { + deletes.push(function () { return changeTracker.deleteNodeInList(sourceFile, node); }); + } + else { + deletes.push(function () { return changeTracker.deleteNode(sourceFile, node); }); + } + } + function createClassElementsFromSymbol(symbol) { + var memberElements = []; + // all instance members are stored in the "member" array of symbol + if (symbol.members) { + symbol.members.forEach(function (member) { + var memberElement = createClassElement(member, /*modifiers*/ undefined); + if (memberElement) { + memberElements.push(memberElement); } - ] + }); } - ]; - } - } - function getEditsForAction(context, action) { - // Somehow wrong action got invoked? - if (actionName !== action) { - return undefined; + // all static members are stored in the "exports" array of symbol + if (symbol.exports) { + symbol.exports.forEach(function (member) { + var memberElement = createClassElement(member, [ts.createToken(115 /* StaticKeyword */)]); + if (memberElement) { + memberElements.push(memberElement); + } + }); + } + return memberElements; + function shouldConvertDeclaration(_target, source) { + // Right now the only thing we can convert are function expressions - other values shouldn't get + // transformed. We can update this once ES public class properties are available. + return ts.isFunctionLike(source); + } + function createClassElement(symbol, modifiers) { + // both properties and methods are bound as property symbols + if (!(symbol.flags & 4 /* Property */)) { + return; + } + var memberDeclaration = symbol.valueDeclaration; + var assignmentBinaryExpression = memberDeclaration.parent; + if (!shouldConvertDeclaration(memberDeclaration, assignmentBinaryExpression.right)) { + return; + } + // delete the entire statement if this expression is the sole expression to take care of the semicolon at the end + var nodeToDelete = assignmentBinaryExpression.parent && assignmentBinaryExpression.parent.kind === 210 /* ExpressionStatement */ + ? assignmentBinaryExpression.parent : assignmentBinaryExpression; + deleteNode(nodeToDelete); + if (!assignmentBinaryExpression.right) { + return ts.createProperty([], modifiers, symbol.name, /*questionToken*/ undefined, + /*type*/ undefined, /*initializer*/ undefined); + } + switch (assignmentBinaryExpression.right.kind) { + case 186 /* FunctionExpression */: { + var functionExpression = assignmentBinaryExpression.right; + var method = ts.createMethod(/*decorators*/ undefined, modifiers, /*asteriskToken*/ undefined, memberDeclaration.name, /*questionToken*/ undefined, + /*typeParameters*/ undefined, functionExpression.parameters, /*type*/ undefined, functionExpression.body); + copyComments(assignmentBinaryExpression, method); + return method; + } + case 187 /* ArrowFunction */: { + var arrowFunction = assignmentBinaryExpression.right; + var arrowFunctionBody = arrowFunction.body; + var bodyBlock = void 0; + // case 1: () => { return [1,2,3] } + if (arrowFunctionBody.kind === 207 /* Block */) { + bodyBlock = arrowFunctionBody; + } + else { + var expression = arrowFunctionBody; + bodyBlock = ts.createBlock([ts.createReturn(expression)]); + } + var method = ts.createMethod(/*decorators*/ undefined, modifiers, /*asteriskToken*/ undefined, memberDeclaration.name, /*questionToken*/ undefined, + /*typeParameters*/ undefined, arrowFunction.parameters, /*type*/ undefined, bodyBlock); + copyComments(assignmentBinaryExpression, method); + return method; + } + default: { + // Don't try to declare members in JavaScript files + if (ts.isSourceFileJavaScript(sourceFile)) { + return; + } + var prop = ts.createProperty(/*decorators*/ undefined, modifiers, memberDeclaration.name, /*questionToken*/ undefined, + /*type*/ undefined, assignmentBinaryExpression.right); + copyComments(assignmentBinaryExpression.parent, prop); + return prop; + } + } + } + } + function copyComments(sourceNode, targetNode) { + ts.forEachLeadingCommentRange(sourceFile.text, sourceNode.pos, function (pos, end, kind, htnl) { + if (kind === 3 /* MultiLineCommentTrivia */) { + // Remove leading /* + pos += 2; + // Remove trailing */ + end -= 2; + } + else { + // Remove leading // + pos += 2; + } + ts.addSyntheticLeadingComment(targetNode, kind, sourceFile.text.slice(pos, end), htnl); + }); + } + function createClassFromVariableDeclaration(node) { + var initializer = node.initializer; + if (!initializer || initializer.kind !== 186 /* FunctionExpression */) { + return undefined; + } + if (node.name.kind !== 71 /* Identifier */) { + return undefined; + } + var memberElements = createClassElementsFromSymbol(initializer.symbol); + if (initializer.body) { + memberElements.unshift(ts.createConstructor(/*decorators*/ undefined, /*modifiers*/ undefined, initializer.parameters, initializer.body)); + } + var cls = ts.createClassDeclaration(/*decorators*/ undefined, /*modifiers*/ undefined, node.name, + /*typeParameters*/ undefined, /*heritageClauses*/ undefined, memberElements); + // Don't call copyComments here because we'll already leave them in place + return cls; + } + function createClassFromFunctionDeclaration(node) { + var memberElements = createClassElementsFromSymbol(ctorSymbol); + if (node.body) { + memberElements.unshift(ts.createConstructor(/*decorators*/ undefined, /*modifiers*/ undefined, node.parameters, node.body)); + } + var cls = ts.createClassDeclaration(/*decorators*/ undefined, /*modifiers*/ undefined, node.name, + /*typeParameters*/ undefined, /*heritageClauses*/ undefined, memberElements); + // Don't call copyComments here because we'll already leave them in place + return cls; + } } - var start = context.startPosition; - var sourceFile = context.file; - var checker = context.program.getTypeChecker(); - var token = ts.getTokenAtPosition(sourceFile, start, /*includeJsDocComment*/ false); - var ctorSymbol = checker.getSymbolAtLocation(token); - var newLine = context.rulesProvider.getFormatOptions().newLineCharacter; - var deletedNodes = []; - var deletes = []; - if (!(ctorSymbol.flags & (16 /* Function */ | 3 /* Variable */))) { - return undefined; + })(convertFunctionToES6Class = refactor.convertFunctionToES6Class || (refactor.convertFunctionToES6Class = {})); + })(refactor = ts.refactor || (ts.refactor = {})); +})(ts || (ts = {})); +/// +/// +/* @internal */ +var ts; +(function (ts) { + var refactor; + (function (refactor) { + var extractMethod; + (function (extractMethod_1) { + var extractMethod = { + name: "Extract Method", + description: ts.Diagnostics.Extract_function.message, + getAvailableActions: getAvailableActions, + getEditsForAction: getEditsForAction, + }; + refactor.registerRefactor(extractMethod); + /** Compute the associated code actions */ + function getAvailableActions(context) { + var rangeToExtract = getRangeToExtract(context.file, { start: context.startPosition, length: context.endPosition - context.startPosition }); + var targetRange = rangeToExtract.targetRange; + if (targetRange === undefined) { + return undefined; + } + var extractions = getPossibleExtractions(targetRange, context); + if (extractions === undefined) { + // No extractions possible + return undefined; + } + var actions = []; + var usedNames = ts.createMap(); + var i = 0; + for (var _i = 0, extractions_1 = extractions; _i < extractions_1.length; _i++) { + var extr = extractions_1[_i]; + // Skip these since we don't have a way to report errors yet + if (extr.errors && extr.errors.length) { + continue; + } + // Don't issue refactorings with duplicated names. + // Scopes come back in "innermost first" order, so extractions will + // preferentially go into nearer scopes + var description = ts.formatStringFromArgs(ts.Diagnostics.Extract_function_into_0.message, [extr.scopeDescription]); + if (!usedNames.has(description)) { + usedNames.set(description, true); + actions.push({ + description: description, + name: "scope_" + i + }); + } + // *do* increment i anyway because we'll look for the i-th scope + // later when actually doing the refactoring if the user requests it + i++; + } + if (actions.length === 0) { + return undefined; + } + return [{ + name: extractMethod.name, + description: extractMethod.description, + inlineable: true, + actions: actions + }]; } - var ctorDeclaration = ctorSymbol.valueDeclaration; - var changeTracker = ts.textChanges.ChangeTracker.fromCodeFixContext(context); - var precedingNode; - var newClassDeclaration; - switch (ctorDeclaration.kind) { - case 228 /* FunctionDeclaration */: - precedingNode = ctorDeclaration; - deleteNode(ctorDeclaration); - newClassDeclaration = createClassFromFunctionDeclaration(ctorDeclaration); - break; - case 226 /* VariableDeclaration */: - precedingNode = ctorDeclaration.parent.parent; - if (ctorDeclaration.parent.declarations.length === 1) { - deleteNode(precedingNode); + function getEditsForAction(context, actionName) { + var length = context.endPosition === undefined ? 0 : context.endPosition - context.startPosition; + var rangeToExtract = getRangeToExtract(context.file, { start: context.startPosition, length: length }); + var targetRange = rangeToExtract.targetRange; + var parsedIndexMatch = /^scope_(\d+)$/.exec(actionName); + ts.Debug.assert(!!parsedIndexMatch, "Scope name should have matched the regexp"); + var index = +parsedIndexMatch[1]; + ts.Debug.assert(isFinite(index), "Expected to parse a finite number from the scope index"); + var extractions = getPossibleExtractions(targetRange, context, index); + // Scope is no longer valid from when the user issued the refactor (??) + ts.Debug.assert(extractions !== undefined, "The extraction went missing? How?"); + return ({ edits: extractions[0].changes }); + } + // Move these into diagnostic messages if they become user-facing + var Messages; + (function (Messages) { + function createMessage(message) { + return { message: message, code: 0, category: ts.DiagnosticCategory.Message, key: message }; + } + Messages.CannotExtractFunction = createMessage("Cannot extract function."); + Messages.StatementOrExpressionExpected = createMessage("Statement or expression expected."); + Messages.CannotExtractRangeContainingConditionalBreakOrContinueStatements = createMessage("Cannot extract range containing conditional break or continue statements."); + Messages.CannotExtractRangeContainingConditionalReturnStatement = createMessage("Cannot extract range containing conditional return statement."); + Messages.CannotExtractRangeContainingLabeledBreakOrContinueStatementWithTargetOutsideOfTheRange = createMessage("Cannot extract range containing labeled break or continue with target outside of the range."); + Messages.CannotExtractRangeThatContainsWritesToReferencesLocatedOutsideOfTheTargetRangeInGenerators = createMessage("Cannot extract range containing writes to references located outside of the target range in generators."); + Messages.TypeWillNotBeVisibleInTheNewScope = createMessage("Type will not visible in the new scope."); + Messages.FunctionWillNotBeVisibleInTheNewScope = createMessage("Function will not visible in the new scope."); + Messages.InsufficientSelection = createMessage("Select more than a single identifier."); + Messages.CannotExtractExportedEntity = createMessage("Cannot extract exported declaration"); + Messages.CannotCombineWritesAndReturns = createMessage("Cannot combine writes and returns"); + Messages.CannotExtractReadonlyPropertyInitializerOutsideConstructor = createMessage("Cannot move initialization of read-only class property outside of the constructor"); + Messages.CannotExtractAmbientBlock = createMessage("Cannot extract code from ambient contexts"); + })(Messages || (Messages = {})); + var RangeFacts; + (function (RangeFacts) { + RangeFacts[RangeFacts["None"] = 0] = "None"; + RangeFacts[RangeFacts["HasReturn"] = 1] = "HasReturn"; + RangeFacts[RangeFacts["IsGenerator"] = 2] = "IsGenerator"; + RangeFacts[RangeFacts["IsAsyncFunction"] = 4] = "IsAsyncFunction"; + RangeFacts[RangeFacts["UsesThis"] = 8] = "UsesThis"; + /** + * The range is in a function which needs the 'static' modifier in a class + */ + RangeFacts[RangeFacts["InStaticRegion"] = 16] = "InStaticRegion"; + })(RangeFacts = extractMethod_1.RangeFacts || (extractMethod_1.RangeFacts = {})); + /** + * getRangeToExtract takes a span inside a text file and returns either an expression or an array + * of statements representing the minimum set of nodes needed to extract the entire span. This + * process may fail, in which case a set of errors is returned instead (these are currently + * not shown to the user, but can be used by us diagnostically) + */ + function getRangeToExtract(sourceFile, span) { + var length = span.length || 0; + // Walk up starting from the the start position until we find a non-SourceFile node that subsumes the selected span. + // This may fail (e.g. you select two statements in the root of a source file) + var start = getParentNodeInSpan(ts.getTokenAtPosition(sourceFile, span.start, /*includeJsDocComment*/ false), sourceFile, span); + // Do the same for the ending position + var end = getParentNodeInSpan(ts.findTokenOnLeftOfPosition(sourceFile, ts.textSpanEnd(span)), sourceFile, span); + var declarations = []; + // We'll modify these flags as we walk the tree to collect data + // about what things need to be done as part of the extraction. + var rangeFacts = RangeFacts.None; + if (!start || !end) { + // cannot find either start or end node + return { errors: [ts.createFileDiagnostic(sourceFile, span.start, length, Messages.CannotExtractFunction)] }; + } + if (start.parent !== end.parent) { + // handle cases like 1 + [2 + 3] + 4 + // user selection is marked with []. + // in this case 2 + 3 does not belong to the same tree node + // instead the shape of the tree looks like this: + // + + // / \ + // + 4 + // / \ + // + 3 + // / \ + // 1 2 + // in this case there is no such one node that covers ends of selection and is located inside the selection + // to handle this we check if both start and end of the selection belong to some binary operation + // and start node is parented by the parent of the end node + // if this is the case - expand the selection to the entire parent of end node (in this case it will be [1 + 2 + 3] + 4) + var startParent = ts.skipParentheses(start.parent); + var endParent = ts.skipParentheses(end.parent); + if (ts.isBinaryExpression(startParent) && ts.isBinaryExpression(endParent) && ts.isNodeDescendantOf(startParent, endParent)) { + start = end = endParent; } else { - deleteNode(ctorDeclaration, /*inList*/ true); + // start and end nodes belong to different subtrees + return createErrorResult(sourceFile, span.start, length, Messages.CannotExtractFunction); } - newClassDeclaration = createClassFromVariableDeclaration(ctorDeclaration); - break; + } + if (start !== end) { + // start and end should be statements and parent should be either block or a source file + if (!isBlockLike(start.parent)) { + return createErrorResult(sourceFile, span.start, length, Messages.CannotExtractFunction); + } + var statements = []; + for (var _i = 0, _a = start.parent.statements; _i < _a.length; _i++) { + var statement = _a[_i]; + if (statement === start || statements.length) { + var errors = checkNode(statement); + if (errors) { + return { errors: errors }; + } + statements.push(statement); + } + if (statement === end) { + break; + } + } + return { targetRange: { range: statements, facts: rangeFacts, declarations: declarations } }; + } + else { + // We have a single node (start) + var errors = checkRootNode(start) || checkNode(start); + if (errors) { + return { errors: errors }; + } + // If our selection is the expression in an ExpressionStatement, expand + // the selection to include the enclosing Statement (this stops us + // from trying to care about the return value of the extracted function + // and eliminates double semicolon insertion in certain scenarios) + var range = ts.isStatement(start) + ? [start] + : start.parent && start.parent.kind === 210 /* ExpressionStatement */ + ? [start.parent] + : start; + return { targetRange: { range: range, facts: rangeFacts, declarations: declarations } }; + } + function createErrorResult(sourceFile, start, length, message) { + return { errors: [ts.createFileDiagnostic(sourceFile, start, length, message)] }; + } + function checkRootNode(node) { + if (ts.isIdentifier(node)) { + return [ts.createDiagnosticForNode(node, Messages.InsufficientSelection)]; + } + return undefined; + } + function checkForStaticContext(nodeToCheck, containingClass) { + var current = nodeToCheck; + while (current !== containingClass) { + if (current.kind === 149 /* PropertyDeclaration */) { + if (ts.hasModifier(current, 32 /* Static */)) { + rangeFacts |= RangeFacts.InStaticRegion; + } + break; + } + else if (current.kind === 146 /* Parameter */) { + var ctorOrMethod = ts.getContainingFunction(current); + if (ctorOrMethod.kind === 152 /* Constructor */) { + rangeFacts |= RangeFacts.InStaticRegion; + } + break; + } + else if (current.kind === 151 /* MethodDeclaration */) { + if (ts.hasModifier(current, 32 /* Static */)) { + rangeFacts |= RangeFacts.InStaticRegion; + } + } + current = current.parent; + } + } + // Verifies whether we can actually extract this node or not. + function checkNode(nodeToCheck) { + var PermittedJumps; + (function (PermittedJumps) { + PermittedJumps[PermittedJumps["None"] = 0] = "None"; + PermittedJumps[PermittedJumps["Break"] = 1] = "Break"; + PermittedJumps[PermittedJumps["Continue"] = 2] = "Continue"; + PermittedJumps[PermittedJumps["Return"] = 4] = "Return"; + })(PermittedJumps || (PermittedJumps = {})); + if (!ts.isStatement(nodeToCheck) && !(ts.isExpression(nodeToCheck) && isExtractableExpression(nodeToCheck))) { + return [ts.createDiagnosticForNode(nodeToCheck, Messages.StatementOrExpressionExpected)]; + } + if (ts.isInAmbientContext(nodeToCheck)) { + return [ts.createDiagnosticForNode(nodeToCheck, Messages.CannotExtractAmbientBlock)]; + } + // If we're in a class, see whether we're in a static region (static property initializer, static method, class constructor parameter default) + var containingClass = ts.getContainingClass(nodeToCheck); + if (containingClass) { + checkForStaticContext(nodeToCheck, containingClass); + } + var errors; + var permittedJumps = 4 /* Return */; + var seenLabels; + visit(nodeToCheck); + return errors; + function visit(node) { + if (errors) { + // already found an error - can stop now + return true; + } + if (ts.isDeclaration(node)) { + var declaringNode = (node.kind === 226 /* VariableDeclaration */) ? node.parent.parent : node; + if (ts.hasModifier(declaringNode, 1 /* Export */)) { + (errors || (errors = [])).push(ts.createDiagnosticForNode(node, Messages.CannotExtractExportedEntity)); + return true; + } + declarations.push(node.symbol); + } + // Some things can't be extracted in certain situations + switch (node.kind) { + case 238 /* ImportDeclaration */: + (errors || (errors = [])).push(ts.createDiagnosticForNode(node, Messages.CannotExtractFunction)); + return true; + case 97 /* SuperKeyword */: + // For a super *constructor call*, we have to be extracting the entire class, + // but a super *method call* simply implies a 'this' reference + if (node.parent.kind === 181 /* CallExpression */) { + // Super constructor call + var containingClass_1 = ts.getContainingClass(node); + if (containingClass_1.pos < span.start || containingClass_1.end >= (span.start + span.length)) { + (errors || (errors = [])).push(ts.createDiagnosticForNode(node, Messages.CannotExtractFunction)); + return true; + } + } + else { + rangeFacts |= RangeFacts.UsesThis; + } + break; + } + if (!node || ts.isFunctionLike(node) || ts.isClassLike(node)) { + switch (node.kind) { + case 228 /* FunctionDeclaration */: + case 229 /* ClassDeclaration */: + if (node.parent.kind === 265 /* SourceFile */ && node.parent.externalModuleIndicator === undefined) { + // You cannot extract global declarations + (errors || (errors = [])).push(ts.createDiagnosticForNode(node, Messages.FunctionWillNotBeVisibleInTheNewScope)); + } + break; + } + // do not dive into functions or classes + return false; + } + var savedPermittedJumps = permittedJumps; + if (node.parent) { + switch (node.parent.kind) { + case 211 /* IfStatement */: + if (node.parent.thenStatement === node || node.parent.elseStatement === node) { + // forbid all jumps inside thenStatement or elseStatement + permittedJumps = 0 /* None */; + } + break; + case 224 /* TryStatement */: + if (node.parent.tryBlock === node) { + // forbid all jumps inside try blocks + permittedJumps = 0 /* None */; + } + else if (node.parent.finallyBlock === node) { + // allow unconditional returns from finally blocks + permittedJumps = 4 /* Return */; + } + break; + case 260 /* CatchClause */: + if (node.parent.block === node) { + // forbid all jumps inside the block of catch clause + permittedJumps = 0 /* None */; + } + break; + case 257 /* CaseClause */: + if (node.expression !== node) { + // allow unlabeled break inside case clauses + permittedJumps |= 1 /* Break */; + } + break; + default: + if (ts.isIterationStatement(node.parent, /*lookInLabeledStatements*/ false)) { + if (node.parent.statement === node) { + // allow unlabeled break/continue inside loops + permittedJumps |= 1 /* Break */ | 2 /* Continue */; + } + } + break; + } + } + switch (node.kind) { + case 169 /* ThisType */: + case 99 /* ThisKeyword */: + rangeFacts |= RangeFacts.UsesThis; + break; + case 222 /* LabeledStatement */: + { + var label = node.label; + (seenLabels || (seenLabels = [])).push(label.escapedText); + ts.forEachChild(node, visit); + seenLabels.pop(); + break; + } + case 218 /* BreakStatement */: + case 217 /* ContinueStatement */: + { + var label = node.label; + if (label) { + if (!ts.contains(seenLabels, label.escapedText)) { + // attempts to jump to label that is not in range to be extracted + (errors || (errors = [])).push(ts.createDiagnosticForNode(node, Messages.CannotExtractRangeContainingLabeledBreakOrContinueStatementWithTargetOutsideOfTheRange)); + } + } + else { + if (!(permittedJumps & (218 /* BreakStatement */ ? 1 /* Break */ : 2 /* Continue */))) { + // attempt to break or continue in a forbidden context + (errors || (errors = [])).push(ts.createDiagnosticForNode(node, Messages.CannotExtractRangeContainingConditionalBreakOrContinueStatements)); + } + } + break; + } + case 191 /* AwaitExpression */: + rangeFacts |= RangeFacts.IsAsyncFunction; + break; + case 197 /* YieldExpression */: + rangeFacts |= RangeFacts.IsGenerator; + break; + case 219 /* ReturnStatement */: + if (permittedJumps & 4 /* Return */) { + rangeFacts |= RangeFacts.HasReturn; + } + else { + (errors || (errors = [])).push(ts.createDiagnosticForNode(node, Messages.CannotExtractRangeContainingConditionalReturnStatement)); + } + break; + default: + ts.forEachChild(node, visit); + break; + } + permittedJumps = savedPermittedJumps; + } + } } - if (!newClassDeclaration) { - return undefined; + extractMethod_1.getRangeToExtract = getRangeToExtract; + function isValidExtractionTarget(node) { + // Note that we don't use isFunctionLike because we don't want to put the extracted closure *inside* a method + return (node.kind === 228 /* FunctionDeclaration */) || ts.isSourceFile(node) || ts.isModuleBlock(node) || ts.isClassLike(node); } - // Because the preceding node could be touched, we need to insert nodes before delete nodes. - changeTracker.insertNodeAfter(sourceFile, precedingNode, newClassDeclaration, { suffix: newLine }); - for (var _i = 0, deletes_1 = deletes; _i < deletes_1.length; _i++) { - var deleteCallback = deletes_1[_i]; - deleteCallback(); + /** + * Computes possible places we could extract the function into. For example, + * you may be able to extract into a class method *or* local closure *or* namespace function, + * depending on what's in the extracted body. + */ + function collectEnclosingScopes(range) { + var current = isReadonlyArray(range.range) ? ts.firstOrUndefined(range.range) : range.range; + if (range.facts & RangeFacts.UsesThis) { + // if range uses this as keyword or as type inside the class then it can only be extracted to a method of the containing class + var containingClass = ts.getContainingClass(current); + if (containingClass) { + return [containingClass]; + } + } + var start = current; + var scopes = undefined; + while (current) { + // We want to find the nearest parent where we can place an "equivalent" sibling to the node we're extracting out of. + // Walk up to the closest parent of a place where we can logically put a sibling: + // * Function declaration + // * Class declaration or expression + // * Module/namespace or source file + if (current !== start && isValidExtractionTarget(current)) { + (scopes = scopes || []).push(current); + } + // A function parameter's initializer is actually in the outer scope, not the function declaration + if (current && current.parent && current.parent.kind === 146 /* Parameter */) { + // Skip all the way to the outer scope of the function that declared this parameter + current = ts.findAncestor(current, function (parent) { return ts.isFunctionLike(parent); }).parent; + } + else { + current = current.parent; + } + } + return scopes; } - return { - edits: changeTracker.getChanges() - }; - function deleteNode(node, inList) { - if (inList === void 0) { inList = false; } - if (deletedNodes.some(function (n) { return ts.isNodeDescendantOf(node, n); })) { - // Parent node has already been deleted; do nothing - return; + extractMethod_1.collectEnclosingScopes = collectEnclosingScopes; + /** + * Given a piece of text to extract ('targetRange'), computes a list of possible extractions. + * Each returned ExtractResultForScope corresponds to a possible target scope and is either a set of changes + * or an error explaining why we can't extract into that scope. + */ + function getPossibleExtractions(targetRange, context, requestedChangesIndex) { + if (requestedChangesIndex === void 0) { requestedChangesIndex = undefined; } + var sourceFile = context.file; + if (targetRange === undefined) { + return undefined; + } + var scopes = collectEnclosingScopes(targetRange); + if (scopes === undefined) { + return undefined; + } + var enclosingTextRange = getEnclosingTextRange(targetRange, sourceFile); + var _a = collectReadsAndWrites(targetRange, scopes, enclosingTextRange, sourceFile, context.program.getTypeChecker()), target = _a.target, usagesPerScope = _a.usagesPerScope, errorsPerScope = _a.errorsPerScope; + context.cancellationToken.throwIfCancellationRequested(); + if (requestedChangesIndex !== undefined) { + if (errorsPerScope[requestedChangesIndex].length) { + return undefined; + } + return [extractFunctionInScope(target, scopes[requestedChangesIndex], usagesPerScope[requestedChangesIndex], targetRange, context)]; + } + else { + return scopes.map(function (scope, i) { + var errors = errorsPerScope[i]; + if (errors.length) { + return { + scope: scope, + scopeDescription: getDescriptionForScope(scope), + errors: errors + }; + } + return { scope: scope, scopeDescription: getDescriptionForScope(scope) }; + }); } - deletedNodes.push(node); - if (inList) { - deletes.push(function () { return changeTracker.deleteNodeInList(sourceFile, node); }); + } + extractMethod_1.getPossibleExtractions = getPossibleExtractions; + function getDescriptionForScope(scope) { + if (ts.isFunctionLike(scope)) { + switch (scope.kind) { + case 152 /* Constructor */: + return "constructor"; + case 186 /* FunctionExpression */: + return scope.name + ? "function expression " + scope.name.getText() + : "anonymous function expression"; + case 228 /* FunctionDeclaration */: + return "function " + scope.name.getText(); + case 187 /* ArrowFunction */: + return "arrow function"; + case 151 /* MethodDeclaration */: + return "method " + scope.name.getText(); + case 153 /* GetAccessor */: + return "get " + scope.name.getText(); + case 154 /* SetAccessor */: + return "set " + scope.name.getText(); + } + } + else if (ts.isModuleBlock(scope)) { + return "namespace " + scope.parent.name.getText(); + } + else if (ts.isClassLike(scope)) { + return scope.kind === 229 /* ClassDeclaration */ + ? "class " + scope.name.text + : scope.name.text + ? "class expression " + scope.name.text + : "anonymous class expression"; + } + else if (ts.isSourceFile(scope)) { + return "file '" + scope.fileName + "'"; } else { - deletes.push(function () { return changeTracker.deleteNode(sourceFile, node); }); + return "unknown"; } } - function createClassElementsFromSymbol(symbol) { - var memberElements = []; - // all instance members are stored in the "member" array of symbol - if (symbol.members) { - symbol.members.forEach(function (member) { - var memberElement = createClassElement(member, /*modifiers*/ undefined); - if (memberElement) { - memberElements.push(memberElement); + function getUniqueName(isNameOkay) { + var functionNameText = "newFunction"; + if (isNameOkay(functionNameText)) { + return functionNameText; + } + var i = 1; + while (!isNameOkay(functionNameText = "newFunction_" + i)) { + i++; + } + return functionNameText; + } + function extractFunctionInScope(node, scope, _a, range, context) { + var usagesInScope = _a.usages, substitutions = _a.substitutions; + var checker = context.program.getTypeChecker(); + // Make a unique name for the extracted function + var file = scope.getSourceFile(); + var functionNameText = getUniqueName(function (n) { return !file.identifiers.has(n); }); + var isJS = ts.isInJavaScriptFile(scope); + var functionName = ts.createIdentifier(functionNameText); + var functionReference = ts.createIdentifier(functionNameText); + var returnType = undefined; + var parameters = []; + var callArguments = []; + var writes; + usagesInScope.forEach(function (usage, name) { + var typeNode = undefined; + if (!isJS) { + var type = checker.getTypeOfSymbolAtLocation(usage.symbol, usage.node); + // Widen the type so we don't emit nonsense annotations like "function fn(x: 3) {" + type = checker.getBaseTypeOfLiteralType(type); + typeNode = checker.typeToTypeNode(type, node, ts.NodeBuilderFlags.NoTruncation); + } + var paramDecl = ts.createParameter( + /*decorators*/ undefined, + /*modifiers*/ undefined, + /*dotDotDotToken*/ undefined, + /*name*/ name, + /*questionToken*/ undefined, typeNode); + parameters.push(paramDecl); + if (usage.usage === 2 /* Write */) { + (writes || (writes = [])).push(usage); + } + callArguments.push(ts.createIdentifier(name)); + }); + // Provide explicit return types for contexutally-typed functions + // to avoid problems when there are literal types present + if (ts.isExpression(node) && !isJS) { + var contextualType = checker.getContextualType(node); + returnType = checker.typeToTypeNode(contextualType); + } + var _b = transformFunctionBody(node), body = _b.body, returnValueProperty = _b.returnValueProperty; + var newFunction; + if (ts.isClassLike(scope)) { + // always create private method in TypeScript files + var modifiers = isJS ? [] : [ts.createToken(112 /* PrivateKeyword */)]; + if (range.facts & RangeFacts.InStaticRegion) { + modifiers.push(ts.createToken(115 /* StaticKeyword */)); + } + if (range.facts & RangeFacts.IsAsyncFunction) { + modifiers.push(ts.createToken(120 /* AsyncKeyword */)); + } + newFunction = ts.createMethod( + /*decorators*/ undefined, modifiers, range.facts & RangeFacts.IsGenerator ? ts.createToken(39 /* AsteriskToken */) : undefined, functionName, + /*questionToken*/ undefined, + /*typeParameters*/ [], parameters, returnType, body); + } + else { + newFunction = ts.createFunctionDeclaration( + /*decorators*/ undefined, range.facts & RangeFacts.IsAsyncFunction ? [ts.createToken(120 /* AsyncKeyword */)] : undefined, range.facts & RangeFacts.IsGenerator ? ts.createToken(39 /* AsteriskToken */) : undefined, functionName, + /*typeParameters*/ [], parameters, returnType, body); + } + var changeTracker = ts.textChanges.ChangeTracker.fromCodeFixContext(context); + // insert function at the end of the scope + changeTracker.insertNodeBefore(context.file, scope.getLastToken(), newFunction, { prefix: context.newLineCharacter, suffix: context.newLineCharacter }); + var newNodes = []; + // replace range with function call + var call = ts.createCall(ts.isClassLike(scope) ? ts.createPropertyAccess(range.facts & RangeFacts.InStaticRegion ? ts.createIdentifier(scope.name.getText()) : ts.createThis(), functionReference) : functionReference, + /*typeArguments*/ undefined, callArguments); + if (range.facts & RangeFacts.IsGenerator) { + call = ts.createYield(ts.createToken(39 /* AsteriskToken */), call); + } + if (range.facts & RangeFacts.IsAsyncFunction) { + call = ts.createAwait(call); + } + if (writes) { + if (returnValueProperty) { + // has both writes and return, need to create variable declaration to hold return value; + newNodes.push(ts.createVariableStatement( + /*modifiers*/ undefined, [ts.createVariableDeclaration(returnValueProperty, ts.createKeywordTypeNode(119 /* AnyKeyword */))])); + } + var assignments = getPropertyAssignmentsForWrites(writes); + if (returnValueProperty) { + assignments.unshift(ts.createShorthandPropertyAssignment(returnValueProperty)); + } + // propagate writes back + if (assignments.length === 1) { + if (returnValueProperty) { + newNodes.push(ts.createReturn(ts.createIdentifier(returnValueProperty))); + } + else { + newNodes.push(ts.createStatement(ts.createBinary(assignments[0].name, 58 /* EqualsToken */, call))); } + } + else { + // emit e.g. + // { a, b, __return } = newFunction(a, b); + // return __return; + newNodes.push(ts.createStatement(ts.createBinary(ts.createObjectLiteral(assignments), 58 /* EqualsToken */, call))); + if (returnValueProperty) { + newNodes.push(ts.createReturn(ts.createIdentifier(returnValueProperty))); + } + } + } + else { + if (range.facts & RangeFacts.HasReturn) { + newNodes.push(ts.createReturn(call)); + } + else if (isReadonlyArray(range.range)) { + newNodes.push(ts.createStatement(call)); + } + else { + newNodes.push(call); + } + } + if (isReadonlyArray(range.range)) { + changeTracker.replaceNodesWithNodes(context.file, range.range, newNodes, { + nodeSeparator: context.newLineCharacter, + suffix: context.newLineCharacter // insert newline only when replacing statements }); } - // all static members are stored in the "exports" array of symbol - if (symbol.exports) { - symbol.exports.forEach(function (member) { - var memberElement = createClassElement(member, [ts.createToken(115 /* StaticKeyword */)]); - if (memberElement) { - memberElements.push(memberElement); + else { + changeTracker.replaceNodeWithNodes(context.file, range.range, newNodes, { nodeSeparator: context.newLineCharacter }); + } + return { + scope: scope, + scopeDescription: getDescriptionForScope(scope), + changes: changeTracker.getChanges() + }; + function getPropertyAssignmentsForWrites(writes) { + return writes.map(function (w) { return ts.createShorthandPropertyAssignment(w.symbol.name); }); + } + function generateReturnValueProperty() { + return "__return"; + } + function transformFunctionBody(body) { + if (ts.isBlock(body) && !writes && substitutions.size === 0) { + // already block, no writes to propagate back, no substitutions - can use node as is + return { body: ts.createBlock(body.statements, /*multLine*/ true), returnValueProperty: undefined }; + } + var returnValueProperty; + var statements = ts.createNodeArray(ts.isBlock(body) ? body.statements.slice(0) : [ts.isStatement(body) ? body : ts.createReturn(body)]); + // rewrite body if either there are writes that should be propagated back via return statements or there are substitutions + if (writes || substitutions.size) { + var rewrittenStatements = ts.visitNodes(statements, visitor).slice(); + if (writes && !(range.facts & RangeFacts.HasReturn) && ts.isStatement(body)) { + // add return at the end to propagate writes back in case if control flow falls out of the function body + // it is ok to know that range has at least one return since it we only allow unconditional returns + var assignments = getPropertyAssignmentsForWrites(writes); + if (assignments.length === 1) { + rewrittenStatements.push(ts.createReturn(assignments[0].name)); + } + else { + rewrittenStatements.push(ts.createReturn(ts.createObjectLiteral(assignments))); + } + } + return { body: ts.createBlock(rewrittenStatements, /*multiLine*/ true), returnValueProperty: returnValueProperty }; + } + else { + return { body: ts.createBlock(statements, /*multiLine*/ true), returnValueProperty: undefined }; + } + function visitor(node) { + if (node.kind === 219 /* ReturnStatement */ && writes) { + var assignments = getPropertyAssignmentsForWrites(writes); + if (node.expression) { + if (!returnValueProperty) { + returnValueProperty = generateReturnValueProperty(); + } + assignments.unshift(ts.createPropertyAssignment(returnValueProperty, ts.visitNode(node.expression, visitor))); + } + if (assignments.length === 1) { + return ts.createReturn(assignments[0].name); + } + else { + return ts.createReturn(ts.createObjectLiteral(assignments)); + } + } + else { + var substitution = substitutions.get(ts.getNodeId(node).toString()); + return substitution || ts.visitEachChild(node, visitor, ts.nullTransformationContext); + } + } + } + } + extractMethod_1.extractFunctionInScope = extractFunctionInScope; + function isReadonlyArray(v) { + return ts.isArray(v); + } + /** + * Produces a range that spans the entirety of nodes, given a selection + * that might start/end in the middle of nodes. + * + * For example, when the user makes a selection like this + * v---v + * var someThing = foo + bar; + * this returns ^-------^ + */ + function getEnclosingTextRange(targetRange, sourceFile) { + return isReadonlyArray(targetRange.range) + ? { pos: targetRange.range[0].getStart(sourceFile), end: targetRange.range[targetRange.range.length - 1].getEnd() } + : targetRange.range; + } + var Usage; + (function (Usage) { + // value should be passed to extracted method + Usage[Usage["Read"] = 1] = "Read"; + // value should be passed to extracted method and propagated back + Usage[Usage["Write"] = 2] = "Write"; + })(Usage || (Usage = {})); + function collectReadsAndWrites(targetRange, scopes, enclosingTextRange, sourceFile, checker) { + var usagesPerScope = []; + var substitutionsPerScope = []; + var errorsPerScope = []; + var visibleDeclarationsInExtractedRange = []; + // initialize results + for (var _i = 0, scopes_1 = scopes; _i < scopes_1.length; _i++) { + var _ = scopes_1[_i]; + usagesPerScope.push({ usages: ts.createMap(), substitutions: ts.createMap() }); + substitutionsPerScope.push(ts.createMap()); + errorsPerScope.push([]); + } + var seenUsages = ts.createMap(); + var target = isReadonlyArray(targetRange.range) ? ts.createBlock(targetRange.range) : targetRange.range; + var containingLexicalScopeOfExtraction = ts.isBlockScope(scopes[0], scopes[0].parent) ? scopes[0] : ts.getEnclosingBlockScopeContainer(scopes[0]); + collectUsages(target); + var _loop_8 = function (i) { + var hasWrite = false; + var readonlyClassPropertyWrite = undefined; + usagesPerScope[i].usages.forEach(function (value) { + if (value.usage === 2 /* Write */) { + hasWrite = true; + if (value.symbol.flags & 106500 /* ClassMember */ && + value.symbol.valueDeclaration && + ts.hasModifier(value.symbol.valueDeclaration, 64 /* Readonly */)) { + readonlyClassPropertyWrite = value.symbol.valueDeclaration; + } } }); + if (hasWrite && !isReadonlyArray(targetRange.range) && ts.isExpression(targetRange.range)) { + errorsPerScope[i].push(ts.createDiagnosticForNode(targetRange.range, Messages.CannotCombineWritesAndReturns)); + } + else if (readonlyClassPropertyWrite && i > 0) { + errorsPerScope[i].push(ts.createDiagnosticForNode(readonlyClassPropertyWrite, Messages.CannotCombineWritesAndReturns)); + } + }; + for (var i = 0; i < scopes.length; i++) { + _loop_8(i); + } + // If there are any declarations in the extracted block that are used in the same enclosing + // lexical scope, we can't move the extraction "up" as those declarations will become unreachable + if (visibleDeclarationsInExtractedRange.length) { + ts.forEachChild(containingLexicalScopeOfExtraction, checkForUsedDeclarations); + } + return { target: target, usagesPerScope: usagesPerScope, errorsPerScope: errorsPerScope }; + function collectUsages(node, valueUsage) { + if (valueUsage === void 0) { valueUsage = 1 /* Read */; } + if (ts.isDeclaration(node) && node.symbol) { + visibleDeclarationsInExtractedRange.push(node.symbol); + } + if (ts.isAssignmentExpression(node)) { + // use 'write' as default usage for values + collectUsages(node.left, 2 /* Write */); + collectUsages(node.right); + } + else if (ts.isUnaryExpressionWithWrite(node)) { + collectUsages(node.operand, 2 /* Write */); + } + else if (ts.isPropertyAccessExpression(node) || ts.isElementAccessExpression(node)) { + // use 'write' as default usage for values + ts.forEachChild(node, collectUsages); + } + else if (ts.isIdentifier(node)) { + if (!node.parent) { + return; + } + if (ts.isQualifiedName(node.parent) && node !== node.parent.left) { + return; + } + if (ts.isPropertyAccessExpression(node.parent) && node !== node.parent.expression) { + return; + } + recordUsage(node, valueUsage, /*isTypeNode*/ ts.isPartOfTypeNode(node)); + } + else { + ts.forEachChild(node, collectUsages); + } } - return memberElements; - function shouldConvertDeclaration(_target, source) { - // Right now the only thing we can convert are function expressions - other values shouldn't get - // transformed. We can update this once ES public class properties are available. - return ts.isFunctionLike(source); + function recordUsage(n, usage, isTypeNode) { + var symbolId = recordUsagebySymbol(n, usage, isTypeNode); + if (symbolId) { + for (var i = 0; i < scopes.length; i++) { + // push substitution from map to map to simplify rewriting + var substitition = substitutionsPerScope[i].get(symbolId); + if (substitition) { + usagesPerScope[i].substitutions.set(ts.getNodeId(n).toString(), substitition); + } + } + } } - function createClassElement(symbol, modifiers) { - // both properties and methods are bound as property symbols - if (!(symbol.flags & 4 /* Property */)) { - return; + function recordUsagebySymbol(identifier, usage, isTypeName) { + var symbol = checker.getSymbolAtLocation(identifier); + if (!symbol) { + // cannot find symbol - do nothing + return undefined; } - var memberDeclaration = symbol.valueDeclaration; - var assignmentBinaryExpression = memberDeclaration.parent; - if (!shouldConvertDeclaration(memberDeclaration, assignmentBinaryExpression.right)) { - return; + var symbolId = ts.getSymbolId(symbol).toString(); + var lastUsage = seenUsages.get(symbolId); + // there are two kinds of value usages + // - reads - if range contains a read from the value located outside of the range then value should be passed as a parameter + // - writes - if range contains a write to a value located outside the range the value should be passed as a parameter and + // returned as a return value + // 'write' case is a superset of 'read' so if we already have processed 'write' of some symbol there is not need to handle 'read' + // since all information is already recorded + if (lastUsage && lastUsage >= usage) { + return symbolId; + } + seenUsages.set(symbolId, usage); + if (lastUsage) { + // if we get here this means that we are trying to handle 'write' and 'read' was already processed + // walk scopes and update existing records. + for (var _i = 0, usagesPerScope_1 = usagesPerScope; _i < usagesPerScope_1.length; _i++) { + var perScope = usagesPerScope_1[_i]; + var prevEntry = perScope.usages.get(identifier.text); + if (prevEntry) { + perScope.usages.set(identifier.text, { usage: usage, symbol: symbol, node: identifier }); + } + } + return symbolId; + } + // find first declaration in this file + var declInFile = ts.find(symbol.getDeclarations(), function (d) { return d.getSourceFile() === sourceFile; }); + if (!declInFile) { + return undefined; + } + if (ts.rangeContainsRange(enclosingTextRange, declInFile)) { + // declaration is located in range to be extracted - do nothing + return undefined; } - // delete the entire statement if this expression is the sole expression to take care of the semicolon at the end - var nodeToDelete = assignmentBinaryExpression.parent && assignmentBinaryExpression.parent.kind === 210 /* ExpressionStatement */ - ? assignmentBinaryExpression.parent : assignmentBinaryExpression; - deleteNode(nodeToDelete); - if (!assignmentBinaryExpression.right) { - return ts.createProperty([], modifiers, symbol.name, /*questionToken*/ undefined, - /*type*/ undefined, /*initializer*/ undefined); - } - switch (assignmentBinaryExpression.right.kind) { - case 186 /* FunctionExpression */: { - var functionExpression = assignmentBinaryExpression.right; - var method = ts.createMethod(/*decorators*/ undefined, modifiers, /*asteriskToken*/ undefined, memberDeclaration.name, /*questionToken*/ undefined, - /*typeParameters*/ undefined, functionExpression.parameters, /*type*/ undefined, functionExpression.body); - copyComments(assignmentBinaryExpression, method); - return method; - } - case 187 /* ArrowFunction */: { - var arrowFunction = assignmentBinaryExpression.right; - var arrowFunctionBody = arrowFunction.body; - var bodyBlock = void 0; - // case 1: () => { return [1,2,3] } - if (arrowFunctionBody.kind === 207 /* Block */) { - bodyBlock = arrowFunctionBody; + if (targetRange.facts & RangeFacts.IsGenerator && usage === 2 /* Write */) { + // this is write to a reference located outside of the target scope and range is extracted into generator + // currently this is unsupported scenario + for (var _a = 0, errorsPerScope_1 = errorsPerScope; _a < errorsPerScope_1.length; _a++) { + var errors = errorsPerScope_1[_a]; + errors.push(ts.createDiagnosticForNode(identifier, Messages.CannotExtractRangeThatContainsWritesToReferencesLocatedOutsideOfTheTargetRangeInGenerators)); + } + } + for (var i = 0; i < scopes.length; i++) { + var scope = scopes[i]; + var resolvedSymbol = checker.resolveName(symbol.name, scope, symbol.flags); + if (resolvedSymbol === symbol) { + continue; + } + if (!substitutionsPerScope[i].has(symbolId)) { + var substitution = tryReplaceWithQualifiedNameOrPropertyAccess(symbol.exportSymbol || symbol, scope, isTypeName); + if (substitution) { + substitutionsPerScope[i].set(symbolId, substitution); } - else { - var expression = arrowFunctionBody; - bodyBlock = ts.createBlock([ts.createReturn(expression)]); + else if (isTypeName) { + errorsPerScope[i].push(ts.createDiagnosticForNode(identifier, Messages.TypeWillNotBeVisibleInTheNewScope)); } - var method = ts.createMethod(/*decorators*/ undefined, modifiers, /*asteriskToken*/ undefined, memberDeclaration.name, /*questionToken*/ undefined, - /*typeParameters*/ undefined, arrowFunction.parameters, /*type*/ undefined, bodyBlock); - copyComments(assignmentBinaryExpression, method); - return method; - } - default: { - // Don't try to declare members in JavaScript files - if (ts.isSourceFileJavaScript(sourceFile)) { - return; + else { + usagesPerScope[i].usages.set(identifier.text, { usage: usage, symbol: symbol, node: identifier }); } - var prop = ts.createProperty(/*decorators*/ undefined, modifiers, memberDeclaration.name, /*questionToken*/ undefined, - /*type*/ undefined, assignmentBinaryExpression.right); - copyComments(assignmentBinaryExpression.parent, prop); - return prop; } } + return symbolId; } - } - function copyComments(sourceNode, targetNode) { - ts.forEachLeadingCommentRange(sourceFile.text, sourceNode.pos, function (pos, end, kind, htnl) { - if (kind === 3 /* MultiLineCommentTrivia */) { - // Remove leading /* - pos += 2; - // Remove trailing */ - end -= 2; + function checkForUsedDeclarations(node) { + // If this node is entirely within the original extraction range, we don't need to do anything. + if (node === targetRange.range || (isReadonlyArray(targetRange.range) && targetRange.range.indexOf(node) >= 0)) { + return; + } + // Otherwise check and recurse. + var sym = checker.getSymbolAtLocation(node); + if (sym && visibleDeclarationsInExtractedRange.some(function (d) { return d === sym; })) { + for (var _i = 0, errorsPerScope_2 = errorsPerScope; _i < errorsPerScope_2.length; _i++) { + var scope = errorsPerScope_2[_i]; + scope.push(ts.createDiagnosticForNode(node, Messages.CannotExtractExportedEntity)); + } + return true; } else { - // Remove leading // - pos += 2; + ts.forEachChild(node, checkForUsedDeclarations); } - ts.addSyntheticLeadingComment(targetNode, kind, sourceFile.text.slice(pos, end), htnl); - }); + } + function tryReplaceWithQualifiedNameOrPropertyAccess(symbol, scopeDecl, isTypeNode) { + if (!symbol) { + return undefined; + } + if (symbol.getDeclarations().some(function (d) { return d.parent === scopeDecl; })) { + return ts.createIdentifier(symbol.name); + } + var prefix = tryReplaceWithQualifiedNameOrPropertyAccess(symbol.parent, scopeDecl, isTypeNode); + if (prefix === undefined) { + return undefined; + } + return isTypeNode ? ts.createQualifiedName(prefix, ts.createIdentifier(symbol.name)) : ts.createPropertyAccess(prefix, symbol.name); + } } - function createClassFromVariableDeclaration(node) { - var initializer = node.initializer; - if (!initializer || initializer.kind !== 186 /* FunctionExpression */) { + function getParentNodeInSpan(node, file, span) { + if (!node) return undefined; + while (node.parent) { + if (ts.isSourceFile(node.parent) || !spanContainsNode(span, node.parent, file)) { + return node; + } + node = node.parent; } - if (node.name.kind !== 71 /* Identifier */) { - return undefined; + } + function spanContainsNode(span, node, file) { + return ts.textSpanContainsPosition(span, node.getStart(file)) && + node.getEnd() <= ts.textSpanEnd(span); + } + /** + * Computes whether or not a node represents an expression in a position where it could + * be extracted. + * The isExpression() in utilities.ts returns some false positives we need to handle, + * such as `import x from 'y'` -- the 'y' is a StringLiteral but is *not* an expression + * in the sense of something that you could extract on + */ + function isExtractableExpression(node) { + switch (node.parent.kind) { + case 264 /* EnumMember */: + return false; } - var memberElements = createClassElementsFromSymbol(initializer.symbol); - if (initializer.body) { - memberElements.unshift(ts.createConstructor(/*decorators*/ undefined, /*modifiers*/ undefined, initializer.parameters, initializer.body)); + switch (node.kind) { + case 9 /* StringLiteral */: + return node.parent.kind !== 238 /* ImportDeclaration */ && + node.parent.kind !== 242 /* ImportSpecifier */; + case 198 /* SpreadElement */: + case 174 /* ObjectBindingPattern */: + case 176 /* BindingElement */: + return false; + case 71 /* Identifier */: + return node.parent.kind !== 176 /* BindingElement */ && + node.parent.kind !== 242 /* ImportSpecifier */ && + node.parent.kind !== 246 /* ExportSpecifier */; } - var cls = ts.createClassDeclaration(/*decorators*/ undefined, /*modifiers*/ undefined, node.name, - /*typeParameters*/ undefined, /*heritageClauses*/ undefined, memberElements); - // Don't call copyComments here because we'll already leave them in place - return cls; + return true; } - function createClassFromFunctionDeclaration(node) { - var memberElements = createClassElementsFromSymbol(ctorSymbol); - if (node.body) { - memberElements.unshift(ts.createConstructor(/*decorators*/ undefined, /*modifiers*/ undefined, node.parameters, node.body)); + function isBlockLike(node) { + switch (node.kind) { + case 207 /* Block */: + case 265 /* SourceFile */: + case 234 /* ModuleBlock */: + case 257 /* CaseClause */: + return true; + default: + return false; } - var cls = ts.createClassDeclaration(/*decorators*/ undefined, /*modifiers*/ undefined, node.name, - /*typeParameters*/ undefined, /*heritageClauses*/ undefined, memberElements); - // Don't call copyComments here because we'll already leave them in place - return cls; } - } + })(extractMethod = refactor.extractMethod || (refactor.extractMethod = {})); })(refactor = ts.refactor || (ts.refactor = {})); })(ts || (ts = {})); /// +/// /// /// /// @@ -89074,7 +90729,7 @@ var ts; node.parent = parent; return node; } - var NodeObject = (function () { + var NodeObject = /** @class */ (function () { function NodeObject(kind, pos, end) { this.pos = pos; this.end = end; @@ -89117,12 +90772,14 @@ var ts; ts.scanner.setTextPos(pos); while (pos < end) { var token = ts.scanner.scan(); - ts.Debug.assert(token !== 1 /* EndOfFileToken */); // Else it would infinitely loop var textPos = ts.scanner.getTextPos(); if (textPos <= end) { nodes.push(createNode(token, pos, textPos, this)); } pos = textPos; + if (token === 1 /* EndOfFileToken */) { + break; + } } return pos; }; @@ -89227,7 +90884,7 @@ var ts; }; return NodeObject; }()); - var TokenOrIdentifierObject = (function () { + var TokenOrIdentifierObject = /** @class */ (function () { function TokenOrIdentifierObject(pos, end) { // Set properties in same order as NodeObject this.pos = pos; @@ -89282,7 +90939,7 @@ var ts; }; return TokenOrIdentifierObject; }()); - var SymbolObject = (function () { + var SymbolObject = /** @class */ (function () { function SymbolObject(flags, name) { this.flags = flags; this.escapedName = name; @@ -89320,7 +90977,7 @@ var ts; }; return SymbolObject; }()); - var TokenObject = (function (_super) { + var TokenObject = /** @class */ (function (_super) { __extends(TokenObject, _super); function TokenObject(kind, pos, end) { var _this = _super.call(this, pos, end) || this; @@ -89329,7 +90986,7 @@ var ts; } return TokenObject; }(TokenOrIdentifierObject)); - var IdentifierObject = (function (_super) { + var IdentifierObject = /** @class */ (function (_super) { __extends(IdentifierObject, _super); function IdentifierObject(_kind, pos, end) { return _super.call(this, pos, end) || this; @@ -89344,7 +91001,7 @@ var ts; return IdentifierObject; }(TokenOrIdentifierObject)); IdentifierObject.prototype.kind = 71 /* Identifier */; - var TypeObject = (function () { + var TypeObject = /** @class */ (function () { function TypeObject(checker, flags) { this.checker = checker; this.flags = flags; @@ -89386,7 +91043,7 @@ var ts; }; return TypeObject; }()); - var SignatureObject = (function () { + var SignatureObject = /** @class */ (function () { function SignatureObject(checker) { this.checker = checker; } @@ -89416,7 +91073,7 @@ var ts; }; return SignatureObject; }()); - var SourceFileObject = (function (_super) { + var SourceFileObject = /** @class */ (function (_super) { __extends(SourceFileObject, _super); function SourceFileObject(kind, pos, end) { return _super.call(this, kind, pos, end) || this; @@ -89587,7 +91244,7 @@ var ts; }; return SourceFileObject; }(NodeObject)); - var SourceMapSourceObject = (function () { + var SourceMapSourceObject = /** @class */ (function () { function SourceMapSourceObject(fileName, text, skipTrivia) { this.fileName = fileName; this.text = text; @@ -89656,7 +91313,7 @@ var ts; // Cache host information about script Should be refreshed // at each language service public entry point, since we don't know when // the set of scripts handled by the host changes. - var HostCache = (function () { + var HostCache = /** @class */ (function () { function HostCache(host, getCanonicalFileName) { this.host = host; // script id => script index @@ -89718,7 +91375,7 @@ var ts; }; return HostCache; }()); - var SyntaxTreeCache = (function () { + var SyntaxTreeCache = /** @class */ (function () { function SyntaxTreeCache(host) { this.host = host; } @@ -89813,7 +91470,7 @@ var ts; return createLanguageServiceSourceFile(sourceFile.fileName, scriptSnapshot, sourceFile.languageVersion, version, /*setNodeParents*/ true, sourceFile.scriptKind); } ts.updateLanguageServiceSourceFile = updateLanguageServiceSourceFile; - var CancellationTokenObject = (function () { + var CancellationTokenObject = /** @class */ (function () { function CancellationTokenObject(cancellationToken) { this.cancellationToken = cancellationToken; } @@ -89829,7 +91486,7 @@ var ts; }()); /* @internal */ /** A cancellation that throttles calls to the host */ - var ThrottledCancellationToken = (function () { + var ThrottledCancellationToken = /** @class */ (function () { function ThrottledCancellationToken(hostCancellationToken, throttleWaitMilliseconds) { if (throttleWaitMilliseconds === void 0) { throttleWaitMilliseconds = 20; } this.hostCancellationToken = hostCancellationToken; @@ -89980,8 +91637,8 @@ var ts; if (program) { var oldSourceFiles = program.getSourceFiles(); var oldSettingsKey = documentRegistry.getKeyForCompilationSettings(oldSettings); - for (var _i = 0, oldSourceFiles_1 = oldSourceFiles; _i < oldSourceFiles_1.length; _i++) { - var oldSourceFile = oldSourceFiles_1[_i]; + for (var _i = 0, oldSourceFiles_2 = oldSourceFiles; _i < oldSourceFiles_2.length; _i++) { + var oldSourceFile = oldSourceFiles_2[_i]; if (!newProgram.getSourceFile(oldSourceFile.fileName) || shouldCreateNewSourceFiles) { documentRegistry.releaseDocumentWithKey(oldSourceFile.path, oldSettingsKey); } @@ -90038,7 +91695,7 @@ var ts; // We do not support the scenario where a host can modify a registered // file's script kind, i.e. in one project some file is treated as ".ts" // and in another as ".js" - ts.Debug.assert(hostFileInformation.scriptKind === oldSourceFile.scriptKind, "Registered script kind (" + oldSourceFile.scriptKind + ") should match new script kind (" + hostFileInformation.scriptKind + ") for file: " + path); + ts.Debug.assertEqual(hostFileInformation.scriptKind, oldSourceFile.scriptKind, "Registered script kind should match new script kind.", path); return documentRegistry.updateDocumentWithKey(fileName, path, newSettings, documentRegistryBucketKey, hostFileInformation.scriptSnapshot, hostFileInformation.version, hostFileInformation.scriptKind); } // We didn't already have the file. Fall through and acquire it from the registry. @@ -90447,17 +92104,19 @@ var ts; function getFormattingEditsAfterKeystroke(fileName, position, key, options) { var sourceFile = syntaxTreeCache.getCurrentSourceFile(fileName); var settings = toEditorSettings(options); - if (key === "{") { - return ts.formatting.formatOnOpeningCurly(position, sourceFile, getRuleProvider(settings), settings); - } - else if (key === "}") { - return ts.formatting.formatOnClosingCurly(position, sourceFile, getRuleProvider(settings), settings); - } - else if (key === ";") { - return ts.formatting.formatOnSemicolon(position, sourceFile, getRuleProvider(settings), settings); - } - else if (key === "\n") { - return ts.formatting.formatOnEnter(position, sourceFile, getRuleProvider(settings), settings); + if (!ts.isInComment(sourceFile, position)) { + if (key === "{") { + return ts.formatting.formatOnOpeningCurly(position, sourceFile, getRuleProvider(settings), settings); + } + else if (key === "}") { + return ts.formatting.formatOnClosingCurly(position, sourceFile, getRuleProvider(settings), settings); + } + else if (key === ";") { + return ts.formatting.formatOnSemicolon(position, sourceFile, getRuleProvider(settings), settings); + } + else if (key === "\n") { + return ts.formatting.formatOnEnter(position, sourceFile, getRuleProvider(settings), settings); + } } return []; } @@ -90504,6 +92163,11 @@ var ts; } return true; } + function getSpanOfEnclosingComment(fileName, position, onlyMultiLine) { + var sourceFile = syntaxTreeCache.getCurrentSourceFile(fileName); + var range = ts.formatting.getRangeOfEnclosingComment(sourceFile, position, onlyMultiLine); + return range && ts.createTextSpanFromRange(range); + } function getTodoComments(fileName, descriptors) { // Note: while getting todo comments seems like a syntactic operation, we actually // treat it as a semantic operation here. This is because we expect our host to call @@ -90693,6 +92357,7 @@ var ts; getFormattingEditsAfterKeystroke: getFormattingEditsAfterKeystroke, getDocCommentTemplateAtPosition: getDocCommentTemplateAtPosition, isValidBraceCompletionAtPosition: isValidBraceCompletionAtPosition, + getSpanOfEnclosingComment: getSpanOfEnclosingComment, getCodeFixesAtPosition: getCodeFixesAtPosition, getEmitOutput: getEmitOutput, getNonBoundSourceFile: getNonBoundSourceFile, @@ -90777,12 +92442,17 @@ var ts; function getPropertySymbolsFromContextualType(typeChecker, node) { var objectLiteral = node.parent; var contextualType = typeChecker.getContextualType(objectLiteral); - var name = ts.unescapeLeadingUnderscores(ts.getTextOfPropertyName(node.name)); - if (name && contextualType) { + return getPropertySymbolsFromType(contextualType, node.name); + } + ts.getPropertySymbolsFromContextualType = getPropertySymbolsFromContextualType; + /* @internal */ + function getPropertySymbolsFromType(type, propName) { + var name = ts.unescapeLeadingUnderscores(ts.getTextOfPropertyName(propName)); + if (name && type) { var result_10 = []; - var symbol = contextualType.getProperty(name); - if (contextualType.flags & 65536 /* Union */) { - ts.forEach(contextualType.types, function (t) { + var symbol = type.getProperty(name); + if (type.flags & 65536 /* Union */) { + ts.forEach(type.types, function (t) { var symbol = t.getProperty(name); if (symbol) { result_10.push(symbol); @@ -90797,7 +92467,7 @@ var ts; } return undefined; } - ts.getPropertySymbolsFromContextualType = getPropertySymbolsFromContextualType; + ts.getPropertySymbolsFromType = getPropertySymbolsFromType; function isArgumentOfElementAccessExpression(node) { return node && node.parent && @@ -91352,7 +93022,7 @@ var ts; } } function spanInOpenParenToken(node) { - if (node.parent.kind === 212 /* DoStatement */ || + if (node.parent.kind === 212 /* DoStatement */ || // Go to while keyword and do action instead node.parent.kind === 181 /* CallExpression */ || node.parent.kind === 182 /* NewExpression */) { return spanInPreviousNode(node); @@ -91471,7 +93141,7 @@ var ts; logger.log("*INTERNAL ERROR* - Exception in typescript services: " + err.message); } } - var ScriptSnapshotShimAdapter = (function () { + var ScriptSnapshotShimAdapter = /** @class */ (function () { function ScriptSnapshotShimAdapter(scriptSnapshotShim) { this.scriptSnapshotShim = scriptSnapshotShim; } @@ -91499,7 +93169,7 @@ var ts; }; return ScriptSnapshotShimAdapter; }()); - var LanguageServiceShimHostAdapter = (function () { + var LanguageServiceShimHostAdapter = /** @class */ (function () { function LanguageServiceShimHostAdapter(shimHost) { var _this = this; this.shimHost = shimHost; @@ -91623,7 +93293,7 @@ var ts; return LanguageServiceShimHostAdapter; }()); ts.LanguageServiceShimHostAdapter = LanguageServiceShimHostAdapter; - var CoreServicesShimHostAdapter = (function () { + var CoreServicesShimHostAdapter = /** @class */ (function () { function CoreServicesShimHostAdapter(shimHost) { var _this = this; this.shimHost = shimHost; @@ -91688,7 +93358,7 @@ var ts; return JSON.stringify({ error: err }); } } - var ShimBase = (function () { + var ShimBase = /** @class */ (function () { function ShimBase(factory) { this.factory = factory; factory.registerShim(this); @@ -91712,7 +93382,7 @@ var ts; code: diagnostic.code }; } - var LanguageServiceShimObject = (function (_super) { + var LanguageServiceShimObject = /** @class */ (function (_super) { __extends(LanguageServiceShimObject, _super); function LanguageServiceShimObject(factory, host, languageService) { var _this = _super.call(this, factory) || this; @@ -91878,6 +93548,10 @@ var ts; var _this = this; return this.forwardJSONCall("isValidBraceCompletionAtPosition('" + fileName + "', " + position + ", " + openingBrace + ")", function () { return _this.languageService.isValidBraceCompletionAtPosition(fileName, position, openingBrace); }); }; + LanguageServiceShimObject.prototype.getSpanOfEnclosingComment = function (fileName, position, onlyMultiLine) { + var _this = this; + return this.forwardJSONCall("getSpanOfEnclosingComment('" + fileName + "', " + position + ")", function () { return _this.languageService.getSpanOfEnclosingComment(fileName, position, onlyMultiLine); }); + }; /// GET SMART INDENT LanguageServiceShimObject.prototype.getIndentationAtPosition = function (fileName, position, options /*Services.EditorOptions*/) { var _this = this; @@ -91985,7 +93659,7 @@ var ts; function convertClassifications(classifications) { return { spans: classifications.spans.join(","), endOfLineState: classifications.endOfLineState }; } - var ClassifierShimObject = (function (_super) { + var ClassifierShimObject = /** @class */ (function (_super) { __extends(ClassifierShimObject, _super); function ClassifierShimObject(factory, logger) { var _this = _super.call(this, factory) || this; @@ -92012,7 +93686,7 @@ var ts; }; return ClassifierShimObject; }(ShimBase)); - var CoreServicesShimObject = (function (_super) { + var CoreServicesShimObject = /** @class */ (function (_super) { __extends(CoreServicesShimObject, _super); function CoreServicesShimObject(factory, logger, host) { var _this = _super.call(this, factory) || this; @@ -92119,7 +93793,7 @@ var ts; }; return CoreServicesShimObject; }(ShimBase)); - var TypeScriptServicesFactory = (function () { + var TypeScriptServicesFactory = /** @class */ (function () { function TypeScriptServicesFactory() { this._shims = []; } @@ -92200,4 +93874,6 @@ var TypeScript; // 'toolsVersion' gets consumed by the managed side, so it's not unused. // TODO: it should be moved into a namespace though. /* @internal */ -var toolsVersion = "2.5"; +var toolsVersion = "2.6"; + +//# sourceMappingURL=typescriptServices.js.map diff --git a/lib/typingsInstaller.js b/lib/typingsInstaller.js index 0aea3ef23596b..5f69ba3ddcddf 100644 --- a/lib/typingsInstaller.js +++ b/lib/typingsInstaller.js @@ -14,6 +14,14 @@ and limitations under the License. ***************************************************************************** */ "use strict"; +var __assign = (this && this.__assign) || Object.assign || function(t) { + for (var s, i = 1, n = arguments.length; i < n; i++) { + s = arguments[i]; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) + t[p] = s[p]; + } + return t; +}; var __extends = (this && this.__extends) || (function () { var extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || @@ -26,12 +34,443 @@ var __extends = (this && this.__extends) || (function () { })(); var ts; (function (ts) { + var SyntaxKind; + (function (SyntaxKind) { + SyntaxKind[SyntaxKind["Unknown"] = 0] = "Unknown"; + SyntaxKind[SyntaxKind["EndOfFileToken"] = 1] = "EndOfFileToken"; + SyntaxKind[SyntaxKind["SingleLineCommentTrivia"] = 2] = "SingleLineCommentTrivia"; + SyntaxKind[SyntaxKind["MultiLineCommentTrivia"] = 3] = "MultiLineCommentTrivia"; + SyntaxKind[SyntaxKind["NewLineTrivia"] = 4] = "NewLineTrivia"; + SyntaxKind[SyntaxKind["WhitespaceTrivia"] = 5] = "WhitespaceTrivia"; + SyntaxKind[SyntaxKind["ShebangTrivia"] = 6] = "ShebangTrivia"; + SyntaxKind[SyntaxKind["ConflictMarkerTrivia"] = 7] = "ConflictMarkerTrivia"; + SyntaxKind[SyntaxKind["NumericLiteral"] = 8] = "NumericLiteral"; + SyntaxKind[SyntaxKind["StringLiteral"] = 9] = "StringLiteral"; + SyntaxKind[SyntaxKind["JsxText"] = 10] = "JsxText"; + SyntaxKind[SyntaxKind["JsxTextAllWhiteSpaces"] = 11] = "JsxTextAllWhiteSpaces"; + SyntaxKind[SyntaxKind["RegularExpressionLiteral"] = 12] = "RegularExpressionLiteral"; + SyntaxKind[SyntaxKind["NoSubstitutionTemplateLiteral"] = 13] = "NoSubstitutionTemplateLiteral"; + SyntaxKind[SyntaxKind["TemplateHead"] = 14] = "TemplateHead"; + SyntaxKind[SyntaxKind["TemplateMiddle"] = 15] = "TemplateMiddle"; + SyntaxKind[SyntaxKind["TemplateTail"] = 16] = "TemplateTail"; + SyntaxKind[SyntaxKind["OpenBraceToken"] = 17] = "OpenBraceToken"; + SyntaxKind[SyntaxKind["CloseBraceToken"] = 18] = "CloseBraceToken"; + SyntaxKind[SyntaxKind["OpenParenToken"] = 19] = "OpenParenToken"; + SyntaxKind[SyntaxKind["CloseParenToken"] = 20] = "CloseParenToken"; + SyntaxKind[SyntaxKind["OpenBracketToken"] = 21] = "OpenBracketToken"; + SyntaxKind[SyntaxKind["CloseBracketToken"] = 22] = "CloseBracketToken"; + SyntaxKind[SyntaxKind["DotToken"] = 23] = "DotToken"; + SyntaxKind[SyntaxKind["DotDotDotToken"] = 24] = "DotDotDotToken"; + SyntaxKind[SyntaxKind["SemicolonToken"] = 25] = "SemicolonToken"; + SyntaxKind[SyntaxKind["CommaToken"] = 26] = "CommaToken"; + SyntaxKind[SyntaxKind["LessThanToken"] = 27] = "LessThanToken"; + SyntaxKind[SyntaxKind["LessThanSlashToken"] = 28] = "LessThanSlashToken"; + SyntaxKind[SyntaxKind["GreaterThanToken"] = 29] = "GreaterThanToken"; + SyntaxKind[SyntaxKind["LessThanEqualsToken"] = 30] = "LessThanEqualsToken"; + SyntaxKind[SyntaxKind["GreaterThanEqualsToken"] = 31] = "GreaterThanEqualsToken"; + SyntaxKind[SyntaxKind["EqualsEqualsToken"] = 32] = "EqualsEqualsToken"; + SyntaxKind[SyntaxKind["ExclamationEqualsToken"] = 33] = "ExclamationEqualsToken"; + SyntaxKind[SyntaxKind["EqualsEqualsEqualsToken"] = 34] = "EqualsEqualsEqualsToken"; + SyntaxKind[SyntaxKind["ExclamationEqualsEqualsToken"] = 35] = "ExclamationEqualsEqualsToken"; + SyntaxKind[SyntaxKind["EqualsGreaterThanToken"] = 36] = "EqualsGreaterThanToken"; + SyntaxKind[SyntaxKind["PlusToken"] = 37] = "PlusToken"; + SyntaxKind[SyntaxKind["MinusToken"] = 38] = "MinusToken"; + SyntaxKind[SyntaxKind["AsteriskToken"] = 39] = "AsteriskToken"; + SyntaxKind[SyntaxKind["AsteriskAsteriskToken"] = 40] = "AsteriskAsteriskToken"; + SyntaxKind[SyntaxKind["SlashToken"] = 41] = "SlashToken"; + SyntaxKind[SyntaxKind["PercentToken"] = 42] = "PercentToken"; + SyntaxKind[SyntaxKind["PlusPlusToken"] = 43] = "PlusPlusToken"; + SyntaxKind[SyntaxKind["MinusMinusToken"] = 44] = "MinusMinusToken"; + SyntaxKind[SyntaxKind["LessThanLessThanToken"] = 45] = "LessThanLessThanToken"; + SyntaxKind[SyntaxKind["GreaterThanGreaterThanToken"] = 46] = "GreaterThanGreaterThanToken"; + SyntaxKind[SyntaxKind["GreaterThanGreaterThanGreaterThanToken"] = 47] = "GreaterThanGreaterThanGreaterThanToken"; + SyntaxKind[SyntaxKind["AmpersandToken"] = 48] = "AmpersandToken"; + SyntaxKind[SyntaxKind["BarToken"] = 49] = "BarToken"; + SyntaxKind[SyntaxKind["CaretToken"] = 50] = "CaretToken"; + SyntaxKind[SyntaxKind["ExclamationToken"] = 51] = "ExclamationToken"; + SyntaxKind[SyntaxKind["TildeToken"] = 52] = "TildeToken"; + SyntaxKind[SyntaxKind["AmpersandAmpersandToken"] = 53] = "AmpersandAmpersandToken"; + SyntaxKind[SyntaxKind["BarBarToken"] = 54] = "BarBarToken"; + SyntaxKind[SyntaxKind["QuestionToken"] = 55] = "QuestionToken"; + SyntaxKind[SyntaxKind["ColonToken"] = 56] = "ColonToken"; + SyntaxKind[SyntaxKind["AtToken"] = 57] = "AtToken"; + SyntaxKind[SyntaxKind["EqualsToken"] = 58] = "EqualsToken"; + SyntaxKind[SyntaxKind["PlusEqualsToken"] = 59] = "PlusEqualsToken"; + SyntaxKind[SyntaxKind["MinusEqualsToken"] = 60] = "MinusEqualsToken"; + SyntaxKind[SyntaxKind["AsteriskEqualsToken"] = 61] = "AsteriskEqualsToken"; + SyntaxKind[SyntaxKind["AsteriskAsteriskEqualsToken"] = 62] = "AsteriskAsteriskEqualsToken"; + SyntaxKind[SyntaxKind["SlashEqualsToken"] = 63] = "SlashEqualsToken"; + SyntaxKind[SyntaxKind["PercentEqualsToken"] = 64] = "PercentEqualsToken"; + SyntaxKind[SyntaxKind["LessThanLessThanEqualsToken"] = 65] = "LessThanLessThanEqualsToken"; + SyntaxKind[SyntaxKind["GreaterThanGreaterThanEqualsToken"] = 66] = "GreaterThanGreaterThanEqualsToken"; + SyntaxKind[SyntaxKind["GreaterThanGreaterThanGreaterThanEqualsToken"] = 67] = "GreaterThanGreaterThanGreaterThanEqualsToken"; + SyntaxKind[SyntaxKind["AmpersandEqualsToken"] = 68] = "AmpersandEqualsToken"; + SyntaxKind[SyntaxKind["BarEqualsToken"] = 69] = "BarEqualsToken"; + SyntaxKind[SyntaxKind["CaretEqualsToken"] = 70] = "CaretEqualsToken"; + SyntaxKind[SyntaxKind["Identifier"] = 71] = "Identifier"; + SyntaxKind[SyntaxKind["BreakKeyword"] = 72] = "BreakKeyword"; + SyntaxKind[SyntaxKind["CaseKeyword"] = 73] = "CaseKeyword"; + SyntaxKind[SyntaxKind["CatchKeyword"] = 74] = "CatchKeyword"; + SyntaxKind[SyntaxKind["ClassKeyword"] = 75] = "ClassKeyword"; + SyntaxKind[SyntaxKind["ConstKeyword"] = 76] = "ConstKeyword"; + SyntaxKind[SyntaxKind["ContinueKeyword"] = 77] = "ContinueKeyword"; + SyntaxKind[SyntaxKind["DebuggerKeyword"] = 78] = "DebuggerKeyword"; + SyntaxKind[SyntaxKind["DefaultKeyword"] = 79] = "DefaultKeyword"; + SyntaxKind[SyntaxKind["DeleteKeyword"] = 80] = "DeleteKeyword"; + SyntaxKind[SyntaxKind["DoKeyword"] = 81] = "DoKeyword"; + SyntaxKind[SyntaxKind["ElseKeyword"] = 82] = "ElseKeyword"; + SyntaxKind[SyntaxKind["EnumKeyword"] = 83] = "EnumKeyword"; + SyntaxKind[SyntaxKind["ExportKeyword"] = 84] = "ExportKeyword"; + SyntaxKind[SyntaxKind["ExtendsKeyword"] = 85] = "ExtendsKeyword"; + SyntaxKind[SyntaxKind["FalseKeyword"] = 86] = "FalseKeyword"; + SyntaxKind[SyntaxKind["FinallyKeyword"] = 87] = "FinallyKeyword"; + SyntaxKind[SyntaxKind["ForKeyword"] = 88] = "ForKeyword"; + SyntaxKind[SyntaxKind["FunctionKeyword"] = 89] = "FunctionKeyword"; + SyntaxKind[SyntaxKind["IfKeyword"] = 90] = "IfKeyword"; + SyntaxKind[SyntaxKind["ImportKeyword"] = 91] = "ImportKeyword"; + SyntaxKind[SyntaxKind["InKeyword"] = 92] = "InKeyword"; + SyntaxKind[SyntaxKind["InstanceOfKeyword"] = 93] = "InstanceOfKeyword"; + SyntaxKind[SyntaxKind["NewKeyword"] = 94] = "NewKeyword"; + SyntaxKind[SyntaxKind["NullKeyword"] = 95] = "NullKeyword"; + SyntaxKind[SyntaxKind["ReturnKeyword"] = 96] = "ReturnKeyword"; + SyntaxKind[SyntaxKind["SuperKeyword"] = 97] = "SuperKeyword"; + SyntaxKind[SyntaxKind["SwitchKeyword"] = 98] = "SwitchKeyword"; + SyntaxKind[SyntaxKind["ThisKeyword"] = 99] = "ThisKeyword"; + SyntaxKind[SyntaxKind["ThrowKeyword"] = 100] = "ThrowKeyword"; + SyntaxKind[SyntaxKind["TrueKeyword"] = 101] = "TrueKeyword"; + SyntaxKind[SyntaxKind["TryKeyword"] = 102] = "TryKeyword"; + SyntaxKind[SyntaxKind["TypeOfKeyword"] = 103] = "TypeOfKeyword"; + SyntaxKind[SyntaxKind["VarKeyword"] = 104] = "VarKeyword"; + SyntaxKind[SyntaxKind["VoidKeyword"] = 105] = "VoidKeyword"; + SyntaxKind[SyntaxKind["WhileKeyword"] = 106] = "WhileKeyword"; + SyntaxKind[SyntaxKind["WithKeyword"] = 107] = "WithKeyword"; + SyntaxKind[SyntaxKind["ImplementsKeyword"] = 108] = "ImplementsKeyword"; + SyntaxKind[SyntaxKind["InterfaceKeyword"] = 109] = "InterfaceKeyword"; + SyntaxKind[SyntaxKind["LetKeyword"] = 110] = "LetKeyword"; + SyntaxKind[SyntaxKind["PackageKeyword"] = 111] = "PackageKeyword"; + SyntaxKind[SyntaxKind["PrivateKeyword"] = 112] = "PrivateKeyword"; + SyntaxKind[SyntaxKind["ProtectedKeyword"] = 113] = "ProtectedKeyword"; + SyntaxKind[SyntaxKind["PublicKeyword"] = 114] = "PublicKeyword"; + SyntaxKind[SyntaxKind["StaticKeyword"] = 115] = "StaticKeyword"; + SyntaxKind[SyntaxKind["YieldKeyword"] = 116] = "YieldKeyword"; + SyntaxKind[SyntaxKind["AbstractKeyword"] = 117] = "AbstractKeyword"; + SyntaxKind[SyntaxKind["AsKeyword"] = 118] = "AsKeyword"; + SyntaxKind[SyntaxKind["AnyKeyword"] = 119] = "AnyKeyword"; + SyntaxKind[SyntaxKind["AsyncKeyword"] = 120] = "AsyncKeyword"; + SyntaxKind[SyntaxKind["AwaitKeyword"] = 121] = "AwaitKeyword"; + SyntaxKind[SyntaxKind["BooleanKeyword"] = 122] = "BooleanKeyword"; + SyntaxKind[SyntaxKind["ConstructorKeyword"] = 123] = "ConstructorKeyword"; + SyntaxKind[SyntaxKind["DeclareKeyword"] = 124] = "DeclareKeyword"; + SyntaxKind[SyntaxKind["GetKeyword"] = 125] = "GetKeyword"; + SyntaxKind[SyntaxKind["IsKeyword"] = 126] = "IsKeyword"; + SyntaxKind[SyntaxKind["KeyOfKeyword"] = 127] = "KeyOfKeyword"; + SyntaxKind[SyntaxKind["ModuleKeyword"] = 128] = "ModuleKeyword"; + SyntaxKind[SyntaxKind["NamespaceKeyword"] = 129] = "NamespaceKeyword"; + SyntaxKind[SyntaxKind["NeverKeyword"] = 130] = "NeverKeyword"; + SyntaxKind[SyntaxKind["ReadonlyKeyword"] = 131] = "ReadonlyKeyword"; + SyntaxKind[SyntaxKind["RequireKeyword"] = 132] = "RequireKeyword"; + SyntaxKind[SyntaxKind["NumberKeyword"] = 133] = "NumberKeyword"; + SyntaxKind[SyntaxKind["ObjectKeyword"] = 134] = "ObjectKeyword"; + SyntaxKind[SyntaxKind["SetKeyword"] = 135] = "SetKeyword"; + SyntaxKind[SyntaxKind["StringKeyword"] = 136] = "StringKeyword"; + SyntaxKind[SyntaxKind["SymbolKeyword"] = 137] = "SymbolKeyword"; + SyntaxKind[SyntaxKind["TypeKeyword"] = 138] = "TypeKeyword"; + SyntaxKind[SyntaxKind["UndefinedKeyword"] = 139] = "UndefinedKeyword"; + SyntaxKind[SyntaxKind["FromKeyword"] = 140] = "FromKeyword"; + SyntaxKind[SyntaxKind["GlobalKeyword"] = 141] = "GlobalKeyword"; + SyntaxKind[SyntaxKind["OfKeyword"] = 142] = "OfKeyword"; + SyntaxKind[SyntaxKind["QualifiedName"] = 143] = "QualifiedName"; + SyntaxKind[SyntaxKind["ComputedPropertyName"] = 144] = "ComputedPropertyName"; + SyntaxKind[SyntaxKind["TypeParameter"] = 145] = "TypeParameter"; + SyntaxKind[SyntaxKind["Parameter"] = 146] = "Parameter"; + SyntaxKind[SyntaxKind["Decorator"] = 147] = "Decorator"; + SyntaxKind[SyntaxKind["PropertySignature"] = 148] = "PropertySignature"; + SyntaxKind[SyntaxKind["PropertyDeclaration"] = 149] = "PropertyDeclaration"; + SyntaxKind[SyntaxKind["MethodSignature"] = 150] = "MethodSignature"; + SyntaxKind[SyntaxKind["MethodDeclaration"] = 151] = "MethodDeclaration"; + SyntaxKind[SyntaxKind["Constructor"] = 152] = "Constructor"; + SyntaxKind[SyntaxKind["GetAccessor"] = 153] = "GetAccessor"; + SyntaxKind[SyntaxKind["SetAccessor"] = 154] = "SetAccessor"; + SyntaxKind[SyntaxKind["CallSignature"] = 155] = "CallSignature"; + SyntaxKind[SyntaxKind["ConstructSignature"] = 156] = "ConstructSignature"; + SyntaxKind[SyntaxKind["IndexSignature"] = 157] = "IndexSignature"; + SyntaxKind[SyntaxKind["TypePredicate"] = 158] = "TypePredicate"; + SyntaxKind[SyntaxKind["TypeReference"] = 159] = "TypeReference"; + SyntaxKind[SyntaxKind["FunctionType"] = 160] = "FunctionType"; + SyntaxKind[SyntaxKind["ConstructorType"] = 161] = "ConstructorType"; + SyntaxKind[SyntaxKind["TypeQuery"] = 162] = "TypeQuery"; + SyntaxKind[SyntaxKind["TypeLiteral"] = 163] = "TypeLiteral"; + SyntaxKind[SyntaxKind["ArrayType"] = 164] = "ArrayType"; + SyntaxKind[SyntaxKind["TupleType"] = 165] = "TupleType"; + SyntaxKind[SyntaxKind["UnionType"] = 166] = "UnionType"; + SyntaxKind[SyntaxKind["IntersectionType"] = 167] = "IntersectionType"; + SyntaxKind[SyntaxKind["ParenthesizedType"] = 168] = "ParenthesizedType"; + SyntaxKind[SyntaxKind["ThisType"] = 169] = "ThisType"; + SyntaxKind[SyntaxKind["TypeOperator"] = 170] = "TypeOperator"; + SyntaxKind[SyntaxKind["IndexedAccessType"] = 171] = "IndexedAccessType"; + SyntaxKind[SyntaxKind["MappedType"] = 172] = "MappedType"; + SyntaxKind[SyntaxKind["LiteralType"] = 173] = "LiteralType"; + SyntaxKind[SyntaxKind["ObjectBindingPattern"] = 174] = "ObjectBindingPattern"; + SyntaxKind[SyntaxKind["ArrayBindingPattern"] = 175] = "ArrayBindingPattern"; + SyntaxKind[SyntaxKind["BindingElement"] = 176] = "BindingElement"; + SyntaxKind[SyntaxKind["ArrayLiteralExpression"] = 177] = "ArrayLiteralExpression"; + SyntaxKind[SyntaxKind["ObjectLiteralExpression"] = 178] = "ObjectLiteralExpression"; + SyntaxKind[SyntaxKind["PropertyAccessExpression"] = 179] = "PropertyAccessExpression"; + SyntaxKind[SyntaxKind["ElementAccessExpression"] = 180] = "ElementAccessExpression"; + SyntaxKind[SyntaxKind["CallExpression"] = 181] = "CallExpression"; + SyntaxKind[SyntaxKind["NewExpression"] = 182] = "NewExpression"; + SyntaxKind[SyntaxKind["TaggedTemplateExpression"] = 183] = "TaggedTemplateExpression"; + SyntaxKind[SyntaxKind["TypeAssertionExpression"] = 184] = "TypeAssertionExpression"; + SyntaxKind[SyntaxKind["ParenthesizedExpression"] = 185] = "ParenthesizedExpression"; + SyntaxKind[SyntaxKind["FunctionExpression"] = 186] = "FunctionExpression"; + SyntaxKind[SyntaxKind["ArrowFunction"] = 187] = "ArrowFunction"; + SyntaxKind[SyntaxKind["DeleteExpression"] = 188] = "DeleteExpression"; + SyntaxKind[SyntaxKind["TypeOfExpression"] = 189] = "TypeOfExpression"; + SyntaxKind[SyntaxKind["VoidExpression"] = 190] = "VoidExpression"; + SyntaxKind[SyntaxKind["AwaitExpression"] = 191] = "AwaitExpression"; + SyntaxKind[SyntaxKind["PrefixUnaryExpression"] = 192] = "PrefixUnaryExpression"; + SyntaxKind[SyntaxKind["PostfixUnaryExpression"] = 193] = "PostfixUnaryExpression"; + SyntaxKind[SyntaxKind["BinaryExpression"] = 194] = "BinaryExpression"; + SyntaxKind[SyntaxKind["ConditionalExpression"] = 195] = "ConditionalExpression"; + SyntaxKind[SyntaxKind["TemplateExpression"] = 196] = "TemplateExpression"; + SyntaxKind[SyntaxKind["YieldExpression"] = 197] = "YieldExpression"; + SyntaxKind[SyntaxKind["SpreadElement"] = 198] = "SpreadElement"; + SyntaxKind[SyntaxKind["ClassExpression"] = 199] = "ClassExpression"; + SyntaxKind[SyntaxKind["OmittedExpression"] = 200] = "OmittedExpression"; + SyntaxKind[SyntaxKind["ExpressionWithTypeArguments"] = 201] = "ExpressionWithTypeArguments"; + SyntaxKind[SyntaxKind["AsExpression"] = 202] = "AsExpression"; + SyntaxKind[SyntaxKind["NonNullExpression"] = 203] = "NonNullExpression"; + SyntaxKind[SyntaxKind["MetaProperty"] = 204] = "MetaProperty"; + SyntaxKind[SyntaxKind["TemplateSpan"] = 205] = "TemplateSpan"; + SyntaxKind[SyntaxKind["SemicolonClassElement"] = 206] = "SemicolonClassElement"; + SyntaxKind[SyntaxKind["Block"] = 207] = "Block"; + SyntaxKind[SyntaxKind["VariableStatement"] = 208] = "VariableStatement"; + SyntaxKind[SyntaxKind["EmptyStatement"] = 209] = "EmptyStatement"; + SyntaxKind[SyntaxKind["ExpressionStatement"] = 210] = "ExpressionStatement"; + SyntaxKind[SyntaxKind["IfStatement"] = 211] = "IfStatement"; + SyntaxKind[SyntaxKind["DoStatement"] = 212] = "DoStatement"; + SyntaxKind[SyntaxKind["WhileStatement"] = 213] = "WhileStatement"; + SyntaxKind[SyntaxKind["ForStatement"] = 214] = "ForStatement"; + SyntaxKind[SyntaxKind["ForInStatement"] = 215] = "ForInStatement"; + SyntaxKind[SyntaxKind["ForOfStatement"] = 216] = "ForOfStatement"; + SyntaxKind[SyntaxKind["ContinueStatement"] = 217] = "ContinueStatement"; + SyntaxKind[SyntaxKind["BreakStatement"] = 218] = "BreakStatement"; + SyntaxKind[SyntaxKind["ReturnStatement"] = 219] = "ReturnStatement"; + SyntaxKind[SyntaxKind["WithStatement"] = 220] = "WithStatement"; + SyntaxKind[SyntaxKind["SwitchStatement"] = 221] = "SwitchStatement"; + SyntaxKind[SyntaxKind["LabeledStatement"] = 222] = "LabeledStatement"; + SyntaxKind[SyntaxKind["ThrowStatement"] = 223] = "ThrowStatement"; + SyntaxKind[SyntaxKind["TryStatement"] = 224] = "TryStatement"; + SyntaxKind[SyntaxKind["DebuggerStatement"] = 225] = "DebuggerStatement"; + SyntaxKind[SyntaxKind["VariableDeclaration"] = 226] = "VariableDeclaration"; + SyntaxKind[SyntaxKind["VariableDeclarationList"] = 227] = "VariableDeclarationList"; + SyntaxKind[SyntaxKind["FunctionDeclaration"] = 228] = "FunctionDeclaration"; + SyntaxKind[SyntaxKind["ClassDeclaration"] = 229] = "ClassDeclaration"; + SyntaxKind[SyntaxKind["InterfaceDeclaration"] = 230] = "InterfaceDeclaration"; + SyntaxKind[SyntaxKind["TypeAliasDeclaration"] = 231] = "TypeAliasDeclaration"; + SyntaxKind[SyntaxKind["EnumDeclaration"] = 232] = "EnumDeclaration"; + SyntaxKind[SyntaxKind["ModuleDeclaration"] = 233] = "ModuleDeclaration"; + SyntaxKind[SyntaxKind["ModuleBlock"] = 234] = "ModuleBlock"; + SyntaxKind[SyntaxKind["CaseBlock"] = 235] = "CaseBlock"; + SyntaxKind[SyntaxKind["NamespaceExportDeclaration"] = 236] = "NamespaceExportDeclaration"; + SyntaxKind[SyntaxKind["ImportEqualsDeclaration"] = 237] = "ImportEqualsDeclaration"; + SyntaxKind[SyntaxKind["ImportDeclaration"] = 238] = "ImportDeclaration"; + SyntaxKind[SyntaxKind["ImportClause"] = 239] = "ImportClause"; + SyntaxKind[SyntaxKind["NamespaceImport"] = 240] = "NamespaceImport"; + SyntaxKind[SyntaxKind["NamedImports"] = 241] = "NamedImports"; + SyntaxKind[SyntaxKind["ImportSpecifier"] = 242] = "ImportSpecifier"; + SyntaxKind[SyntaxKind["ExportAssignment"] = 243] = "ExportAssignment"; + SyntaxKind[SyntaxKind["ExportDeclaration"] = 244] = "ExportDeclaration"; + SyntaxKind[SyntaxKind["NamedExports"] = 245] = "NamedExports"; + SyntaxKind[SyntaxKind["ExportSpecifier"] = 246] = "ExportSpecifier"; + SyntaxKind[SyntaxKind["MissingDeclaration"] = 247] = "MissingDeclaration"; + SyntaxKind[SyntaxKind["ExternalModuleReference"] = 248] = "ExternalModuleReference"; + SyntaxKind[SyntaxKind["JsxElement"] = 249] = "JsxElement"; + SyntaxKind[SyntaxKind["JsxSelfClosingElement"] = 250] = "JsxSelfClosingElement"; + SyntaxKind[SyntaxKind["JsxOpeningElement"] = 251] = "JsxOpeningElement"; + SyntaxKind[SyntaxKind["JsxClosingElement"] = 252] = "JsxClosingElement"; + SyntaxKind[SyntaxKind["JsxAttribute"] = 253] = "JsxAttribute"; + SyntaxKind[SyntaxKind["JsxAttributes"] = 254] = "JsxAttributes"; + SyntaxKind[SyntaxKind["JsxSpreadAttribute"] = 255] = "JsxSpreadAttribute"; + SyntaxKind[SyntaxKind["JsxExpression"] = 256] = "JsxExpression"; + SyntaxKind[SyntaxKind["CaseClause"] = 257] = "CaseClause"; + SyntaxKind[SyntaxKind["DefaultClause"] = 258] = "DefaultClause"; + SyntaxKind[SyntaxKind["HeritageClause"] = 259] = "HeritageClause"; + SyntaxKind[SyntaxKind["CatchClause"] = 260] = "CatchClause"; + SyntaxKind[SyntaxKind["PropertyAssignment"] = 261] = "PropertyAssignment"; + SyntaxKind[SyntaxKind["ShorthandPropertyAssignment"] = 262] = "ShorthandPropertyAssignment"; + SyntaxKind[SyntaxKind["SpreadAssignment"] = 263] = "SpreadAssignment"; + SyntaxKind[SyntaxKind["EnumMember"] = 264] = "EnumMember"; + SyntaxKind[SyntaxKind["SourceFile"] = 265] = "SourceFile"; + SyntaxKind[SyntaxKind["Bundle"] = 266] = "Bundle"; + SyntaxKind[SyntaxKind["JSDocTypeExpression"] = 267] = "JSDocTypeExpression"; + SyntaxKind[SyntaxKind["JSDocAllType"] = 268] = "JSDocAllType"; + SyntaxKind[SyntaxKind["JSDocUnknownType"] = 269] = "JSDocUnknownType"; + SyntaxKind[SyntaxKind["JSDocNullableType"] = 270] = "JSDocNullableType"; + SyntaxKind[SyntaxKind["JSDocNonNullableType"] = 271] = "JSDocNonNullableType"; + SyntaxKind[SyntaxKind["JSDocOptionalType"] = 272] = "JSDocOptionalType"; + SyntaxKind[SyntaxKind["JSDocFunctionType"] = 273] = "JSDocFunctionType"; + SyntaxKind[SyntaxKind["JSDocVariadicType"] = 274] = "JSDocVariadicType"; + SyntaxKind[SyntaxKind["JSDocComment"] = 275] = "JSDocComment"; + SyntaxKind[SyntaxKind["JSDocTag"] = 276] = "JSDocTag"; + SyntaxKind[SyntaxKind["JSDocAugmentsTag"] = 277] = "JSDocAugmentsTag"; + SyntaxKind[SyntaxKind["JSDocClassTag"] = 278] = "JSDocClassTag"; + SyntaxKind[SyntaxKind["JSDocParameterTag"] = 279] = "JSDocParameterTag"; + SyntaxKind[SyntaxKind["JSDocReturnTag"] = 280] = "JSDocReturnTag"; + SyntaxKind[SyntaxKind["JSDocTypeTag"] = 281] = "JSDocTypeTag"; + SyntaxKind[SyntaxKind["JSDocTemplateTag"] = 282] = "JSDocTemplateTag"; + SyntaxKind[SyntaxKind["JSDocTypedefTag"] = 283] = "JSDocTypedefTag"; + SyntaxKind[SyntaxKind["JSDocPropertyTag"] = 284] = "JSDocPropertyTag"; + SyntaxKind[SyntaxKind["JSDocTypeLiteral"] = 285] = "JSDocTypeLiteral"; + SyntaxKind[SyntaxKind["SyntaxList"] = 286] = "SyntaxList"; + SyntaxKind[SyntaxKind["NotEmittedStatement"] = 287] = "NotEmittedStatement"; + SyntaxKind[SyntaxKind["PartiallyEmittedExpression"] = 288] = "PartiallyEmittedExpression"; + SyntaxKind[SyntaxKind["CommaListExpression"] = 289] = "CommaListExpression"; + SyntaxKind[SyntaxKind["MergeDeclarationMarker"] = 290] = "MergeDeclarationMarker"; + SyntaxKind[SyntaxKind["EndOfDeclarationMarker"] = 291] = "EndOfDeclarationMarker"; + SyntaxKind[SyntaxKind["Count"] = 292] = "Count"; + SyntaxKind[SyntaxKind["FirstAssignment"] = 58] = "FirstAssignment"; + SyntaxKind[SyntaxKind["LastAssignment"] = 70] = "LastAssignment"; + SyntaxKind[SyntaxKind["FirstCompoundAssignment"] = 59] = "FirstCompoundAssignment"; + SyntaxKind[SyntaxKind["LastCompoundAssignment"] = 70] = "LastCompoundAssignment"; + SyntaxKind[SyntaxKind["FirstReservedWord"] = 72] = "FirstReservedWord"; + SyntaxKind[SyntaxKind["LastReservedWord"] = 107] = "LastReservedWord"; + SyntaxKind[SyntaxKind["FirstKeyword"] = 72] = "FirstKeyword"; + SyntaxKind[SyntaxKind["LastKeyword"] = 142] = "LastKeyword"; + SyntaxKind[SyntaxKind["FirstFutureReservedWord"] = 108] = "FirstFutureReservedWord"; + SyntaxKind[SyntaxKind["LastFutureReservedWord"] = 116] = "LastFutureReservedWord"; + SyntaxKind[SyntaxKind["FirstTypeNode"] = 158] = "FirstTypeNode"; + SyntaxKind[SyntaxKind["LastTypeNode"] = 173] = "LastTypeNode"; + SyntaxKind[SyntaxKind["FirstPunctuation"] = 17] = "FirstPunctuation"; + SyntaxKind[SyntaxKind["LastPunctuation"] = 70] = "LastPunctuation"; + SyntaxKind[SyntaxKind["FirstToken"] = 0] = "FirstToken"; + SyntaxKind[SyntaxKind["LastToken"] = 142] = "LastToken"; + SyntaxKind[SyntaxKind["FirstTriviaToken"] = 2] = "FirstTriviaToken"; + SyntaxKind[SyntaxKind["LastTriviaToken"] = 7] = "LastTriviaToken"; + SyntaxKind[SyntaxKind["FirstLiteralToken"] = 8] = "FirstLiteralToken"; + SyntaxKind[SyntaxKind["LastLiteralToken"] = 13] = "LastLiteralToken"; + SyntaxKind[SyntaxKind["FirstTemplateToken"] = 13] = "FirstTemplateToken"; + SyntaxKind[SyntaxKind["LastTemplateToken"] = 16] = "LastTemplateToken"; + SyntaxKind[SyntaxKind["FirstBinaryOperator"] = 27] = "FirstBinaryOperator"; + SyntaxKind[SyntaxKind["LastBinaryOperator"] = 70] = "LastBinaryOperator"; + SyntaxKind[SyntaxKind["FirstNode"] = 143] = "FirstNode"; + SyntaxKind[SyntaxKind["FirstJSDocNode"] = 267] = "FirstJSDocNode"; + SyntaxKind[SyntaxKind["LastJSDocNode"] = 285] = "LastJSDocNode"; + SyntaxKind[SyntaxKind["FirstJSDocTagNode"] = 276] = "FirstJSDocTagNode"; + SyntaxKind[SyntaxKind["LastJSDocTagNode"] = 285] = "LastJSDocTagNode"; + })(SyntaxKind = ts.SyntaxKind || (ts.SyntaxKind = {})); + var NodeFlags; + (function (NodeFlags) { + NodeFlags[NodeFlags["None"] = 0] = "None"; + NodeFlags[NodeFlags["Let"] = 1] = "Let"; + NodeFlags[NodeFlags["Const"] = 2] = "Const"; + NodeFlags[NodeFlags["NestedNamespace"] = 4] = "NestedNamespace"; + NodeFlags[NodeFlags["Synthesized"] = 8] = "Synthesized"; + NodeFlags[NodeFlags["Namespace"] = 16] = "Namespace"; + NodeFlags[NodeFlags["ExportContext"] = 32] = "ExportContext"; + NodeFlags[NodeFlags["ContainsThis"] = 64] = "ContainsThis"; + NodeFlags[NodeFlags["HasImplicitReturn"] = 128] = "HasImplicitReturn"; + NodeFlags[NodeFlags["HasExplicitReturn"] = 256] = "HasExplicitReturn"; + NodeFlags[NodeFlags["GlobalAugmentation"] = 512] = "GlobalAugmentation"; + NodeFlags[NodeFlags["HasAsyncFunctions"] = 1024] = "HasAsyncFunctions"; + NodeFlags[NodeFlags["DisallowInContext"] = 2048] = "DisallowInContext"; + NodeFlags[NodeFlags["YieldContext"] = 4096] = "YieldContext"; + NodeFlags[NodeFlags["DecoratorContext"] = 8192] = "DecoratorContext"; + NodeFlags[NodeFlags["AwaitContext"] = 16384] = "AwaitContext"; + NodeFlags[NodeFlags["ThisNodeHasError"] = 32768] = "ThisNodeHasError"; + NodeFlags[NodeFlags["JavaScriptFile"] = 65536] = "JavaScriptFile"; + NodeFlags[NodeFlags["ThisNodeOrAnySubNodesHasError"] = 131072] = "ThisNodeOrAnySubNodesHasError"; + NodeFlags[NodeFlags["HasAggregatedChildData"] = 262144] = "HasAggregatedChildData"; + NodeFlags[NodeFlags["PossiblyContainsDynamicImport"] = 524288] = "PossiblyContainsDynamicImport"; + NodeFlags[NodeFlags["JSDoc"] = 1048576] = "JSDoc"; + NodeFlags[NodeFlags["BlockScoped"] = 3] = "BlockScoped"; + NodeFlags[NodeFlags["ReachabilityCheckFlags"] = 384] = "ReachabilityCheckFlags"; + NodeFlags[NodeFlags["ReachabilityAndEmitFlags"] = 1408] = "ReachabilityAndEmitFlags"; + NodeFlags[NodeFlags["ContextFlags"] = 96256] = "ContextFlags"; + NodeFlags[NodeFlags["TypeExcludesFlags"] = 20480] = "TypeExcludesFlags"; + })(NodeFlags = ts.NodeFlags || (ts.NodeFlags = {})); + var ModifierFlags; + (function (ModifierFlags) { + ModifierFlags[ModifierFlags["None"] = 0] = "None"; + ModifierFlags[ModifierFlags["Export"] = 1] = "Export"; + ModifierFlags[ModifierFlags["Ambient"] = 2] = "Ambient"; + ModifierFlags[ModifierFlags["Public"] = 4] = "Public"; + ModifierFlags[ModifierFlags["Private"] = 8] = "Private"; + ModifierFlags[ModifierFlags["Protected"] = 16] = "Protected"; + ModifierFlags[ModifierFlags["Static"] = 32] = "Static"; + ModifierFlags[ModifierFlags["Readonly"] = 64] = "Readonly"; + ModifierFlags[ModifierFlags["Abstract"] = 128] = "Abstract"; + ModifierFlags[ModifierFlags["Async"] = 256] = "Async"; + ModifierFlags[ModifierFlags["Default"] = 512] = "Default"; + ModifierFlags[ModifierFlags["Const"] = 2048] = "Const"; + ModifierFlags[ModifierFlags["HasComputedFlags"] = 536870912] = "HasComputedFlags"; + ModifierFlags[ModifierFlags["AccessibilityModifier"] = 28] = "AccessibilityModifier"; + ModifierFlags[ModifierFlags["ParameterPropertyModifier"] = 92] = "ParameterPropertyModifier"; + ModifierFlags[ModifierFlags["NonPublicAccessibilityModifier"] = 24] = "NonPublicAccessibilityModifier"; + ModifierFlags[ModifierFlags["TypeScriptModifier"] = 2270] = "TypeScriptModifier"; + ModifierFlags[ModifierFlags["ExportDefault"] = 513] = "ExportDefault"; + })(ModifierFlags = ts.ModifierFlags || (ts.ModifierFlags = {})); + var JsxFlags; + (function (JsxFlags) { + JsxFlags[JsxFlags["None"] = 0] = "None"; + JsxFlags[JsxFlags["IntrinsicNamedElement"] = 1] = "IntrinsicNamedElement"; + JsxFlags[JsxFlags["IntrinsicIndexedElement"] = 2] = "IntrinsicIndexedElement"; + JsxFlags[JsxFlags["IntrinsicElement"] = 3] = "IntrinsicElement"; + })(JsxFlags = ts.JsxFlags || (ts.JsxFlags = {})); + var RelationComparisonResult; + (function (RelationComparisonResult) { + RelationComparisonResult[RelationComparisonResult["Succeeded"] = 1] = "Succeeded"; + RelationComparisonResult[RelationComparisonResult["Failed"] = 2] = "Failed"; + RelationComparisonResult[RelationComparisonResult["FailedAndReported"] = 3] = "FailedAndReported"; + })(RelationComparisonResult = ts.RelationComparisonResult || (ts.RelationComparisonResult = {})); + var GeneratedIdentifierKind; + (function (GeneratedIdentifierKind) { + GeneratedIdentifierKind[GeneratedIdentifierKind["None"] = 0] = "None"; + GeneratedIdentifierKind[GeneratedIdentifierKind["Auto"] = 1] = "Auto"; + GeneratedIdentifierKind[GeneratedIdentifierKind["Loop"] = 2] = "Loop"; + GeneratedIdentifierKind[GeneratedIdentifierKind["Unique"] = 3] = "Unique"; + GeneratedIdentifierKind[GeneratedIdentifierKind["Node"] = 4] = "Node"; + })(GeneratedIdentifierKind = ts.GeneratedIdentifierKind || (ts.GeneratedIdentifierKind = {})); + var NumericLiteralFlags; + (function (NumericLiteralFlags) { + NumericLiteralFlags[NumericLiteralFlags["None"] = 0] = "None"; + NumericLiteralFlags[NumericLiteralFlags["Scientific"] = 2] = "Scientific"; + NumericLiteralFlags[NumericLiteralFlags["Octal"] = 4] = "Octal"; + NumericLiteralFlags[NumericLiteralFlags["HexSpecifier"] = 8] = "HexSpecifier"; + NumericLiteralFlags[NumericLiteralFlags["BinarySpecifier"] = 16] = "BinarySpecifier"; + NumericLiteralFlags[NumericLiteralFlags["OctalSpecifier"] = 32] = "OctalSpecifier"; + NumericLiteralFlags[NumericLiteralFlags["BinaryOrOctalSpecifier"] = 48] = "BinaryOrOctalSpecifier"; + })(NumericLiteralFlags = ts.NumericLiteralFlags || (ts.NumericLiteralFlags = {})); + var FlowFlags; + (function (FlowFlags) { + FlowFlags[FlowFlags["Unreachable"] = 1] = "Unreachable"; + FlowFlags[FlowFlags["Start"] = 2] = "Start"; + FlowFlags[FlowFlags["BranchLabel"] = 4] = "BranchLabel"; + FlowFlags[FlowFlags["LoopLabel"] = 8] = "LoopLabel"; + FlowFlags[FlowFlags["Assignment"] = 16] = "Assignment"; + FlowFlags[FlowFlags["TrueCondition"] = 32] = "TrueCondition"; + FlowFlags[FlowFlags["FalseCondition"] = 64] = "FalseCondition"; + FlowFlags[FlowFlags["SwitchClause"] = 128] = "SwitchClause"; + FlowFlags[FlowFlags["ArrayMutation"] = 256] = "ArrayMutation"; + FlowFlags[FlowFlags["Referenced"] = 512] = "Referenced"; + FlowFlags[FlowFlags["Shared"] = 1024] = "Shared"; + FlowFlags[FlowFlags["PreFinally"] = 2048] = "PreFinally"; + FlowFlags[FlowFlags["AfterFinally"] = 4096] = "AfterFinally"; + FlowFlags[FlowFlags["Label"] = 12] = "Label"; + FlowFlags[FlowFlags["Condition"] = 96] = "Condition"; + })(FlowFlags = ts.FlowFlags || (ts.FlowFlags = {})); var OperationCanceledException = (function () { function OperationCanceledException() { } return OperationCanceledException; }()); ts.OperationCanceledException = OperationCanceledException; + var StructureIsReused; + (function (StructureIsReused) { + StructureIsReused[StructureIsReused["Not"] = 0] = "Not"; + StructureIsReused[StructureIsReused["SafeModules"] = 1] = "SafeModules"; + StructureIsReused[StructureIsReused["Completely"] = 2] = "Completely"; + })(StructureIsReused = ts.StructureIsReused || (ts.StructureIsReused = {})); var ExitStatus; (function (ExitStatus) { ExitStatus[ExitStatus["Success"] = 0] = "Success"; @@ -56,6 +495,47 @@ var ts; NodeBuilderFlags[NodeBuilderFlags["InObjectTypeLiteral"] = 1048576] = "InObjectTypeLiteral"; NodeBuilderFlags[NodeBuilderFlags["InTypeAlias"] = 8388608] = "InTypeAlias"; })(NodeBuilderFlags = ts.NodeBuilderFlags || (ts.NodeBuilderFlags = {})); + var TypeFormatFlags; + (function (TypeFormatFlags) { + TypeFormatFlags[TypeFormatFlags["None"] = 0] = "None"; + TypeFormatFlags[TypeFormatFlags["WriteArrayAsGenericType"] = 1] = "WriteArrayAsGenericType"; + TypeFormatFlags[TypeFormatFlags["UseTypeOfFunction"] = 4] = "UseTypeOfFunction"; + TypeFormatFlags[TypeFormatFlags["NoTruncation"] = 8] = "NoTruncation"; + TypeFormatFlags[TypeFormatFlags["WriteArrowStyleSignature"] = 16] = "WriteArrowStyleSignature"; + TypeFormatFlags[TypeFormatFlags["WriteOwnNameForAnyLike"] = 32] = "WriteOwnNameForAnyLike"; + TypeFormatFlags[TypeFormatFlags["WriteTypeArgumentsOfSignature"] = 64] = "WriteTypeArgumentsOfSignature"; + TypeFormatFlags[TypeFormatFlags["InElementType"] = 128] = "InElementType"; + TypeFormatFlags[TypeFormatFlags["UseFullyQualifiedType"] = 256] = "UseFullyQualifiedType"; + TypeFormatFlags[TypeFormatFlags["InFirstTypeArgument"] = 512] = "InFirstTypeArgument"; + TypeFormatFlags[TypeFormatFlags["InTypeAlias"] = 1024] = "InTypeAlias"; + TypeFormatFlags[TypeFormatFlags["SuppressAnyReturnType"] = 4096] = "SuppressAnyReturnType"; + TypeFormatFlags[TypeFormatFlags["AddUndefined"] = 8192] = "AddUndefined"; + TypeFormatFlags[TypeFormatFlags["WriteClassExpressionAsTypeLiteral"] = 16384] = "WriteClassExpressionAsTypeLiteral"; + TypeFormatFlags[TypeFormatFlags["InArrayType"] = 32768] = "InArrayType"; + TypeFormatFlags[TypeFormatFlags["UseAliasDefinedOutsideCurrentScope"] = 65536] = "UseAliasDefinedOutsideCurrentScope"; + })(TypeFormatFlags = ts.TypeFormatFlags || (ts.TypeFormatFlags = {})); + var SymbolFormatFlags; + (function (SymbolFormatFlags) { + SymbolFormatFlags[SymbolFormatFlags["None"] = 0] = "None"; + SymbolFormatFlags[SymbolFormatFlags["WriteTypeParametersOrArguments"] = 1] = "WriteTypeParametersOrArguments"; + SymbolFormatFlags[SymbolFormatFlags["UseOnlyExternalAliasing"] = 2] = "UseOnlyExternalAliasing"; + })(SymbolFormatFlags = ts.SymbolFormatFlags || (ts.SymbolFormatFlags = {})); + var SymbolAccessibility; + (function (SymbolAccessibility) { + SymbolAccessibility[SymbolAccessibility["Accessible"] = 0] = "Accessible"; + SymbolAccessibility[SymbolAccessibility["NotAccessible"] = 1] = "NotAccessible"; + SymbolAccessibility[SymbolAccessibility["CannotBeNamed"] = 2] = "CannotBeNamed"; + })(SymbolAccessibility = ts.SymbolAccessibility || (ts.SymbolAccessibility = {})); + var SyntheticSymbolKind; + (function (SyntheticSymbolKind) { + SyntheticSymbolKind[SyntheticSymbolKind["UnionOrIntersection"] = 0] = "UnionOrIntersection"; + SyntheticSymbolKind[SyntheticSymbolKind["Spread"] = 1] = "Spread"; + })(SyntheticSymbolKind = ts.SyntheticSymbolKind || (ts.SyntheticSymbolKind = {})); + var TypePredicateKind; + (function (TypePredicateKind) { + TypePredicateKind[TypePredicateKind["This"] = 0] = "This"; + TypePredicateKind[TypePredicateKind["Identifier"] = 1] = "Identifier"; + })(TypePredicateKind = ts.TypePredicateKind || (ts.TypePredicateKind = {})); var TypeReferenceSerializationKind; (function (TypeReferenceSerializationKind) { TypeReferenceSerializationKind[TypeReferenceSerializationKind["Unknown"] = 0] = "Unknown"; @@ -70,6 +550,230 @@ var ts; TypeReferenceSerializationKind[TypeReferenceSerializationKind["TypeWithCallSignature"] = 9] = "TypeWithCallSignature"; TypeReferenceSerializationKind[TypeReferenceSerializationKind["ObjectType"] = 10] = "ObjectType"; })(TypeReferenceSerializationKind = ts.TypeReferenceSerializationKind || (ts.TypeReferenceSerializationKind = {})); + var SymbolFlags; + (function (SymbolFlags) { + SymbolFlags[SymbolFlags["None"] = 0] = "None"; + SymbolFlags[SymbolFlags["FunctionScopedVariable"] = 1] = "FunctionScopedVariable"; + SymbolFlags[SymbolFlags["BlockScopedVariable"] = 2] = "BlockScopedVariable"; + SymbolFlags[SymbolFlags["Property"] = 4] = "Property"; + SymbolFlags[SymbolFlags["EnumMember"] = 8] = "EnumMember"; + SymbolFlags[SymbolFlags["Function"] = 16] = "Function"; + SymbolFlags[SymbolFlags["Class"] = 32] = "Class"; + SymbolFlags[SymbolFlags["Interface"] = 64] = "Interface"; + SymbolFlags[SymbolFlags["ConstEnum"] = 128] = "ConstEnum"; + SymbolFlags[SymbolFlags["RegularEnum"] = 256] = "RegularEnum"; + SymbolFlags[SymbolFlags["ValueModule"] = 512] = "ValueModule"; + SymbolFlags[SymbolFlags["NamespaceModule"] = 1024] = "NamespaceModule"; + SymbolFlags[SymbolFlags["TypeLiteral"] = 2048] = "TypeLiteral"; + SymbolFlags[SymbolFlags["ObjectLiteral"] = 4096] = "ObjectLiteral"; + SymbolFlags[SymbolFlags["Method"] = 8192] = "Method"; + SymbolFlags[SymbolFlags["Constructor"] = 16384] = "Constructor"; + SymbolFlags[SymbolFlags["GetAccessor"] = 32768] = "GetAccessor"; + SymbolFlags[SymbolFlags["SetAccessor"] = 65536] = "SetAccessor"; + SymbolFlags[SymbolFlags["Signature"] = 131072] = "Signature"; + SymbolFlags[SymbolFlags["TypeParameter"] = 262144] = "TypeParameter"; + SymbolFlags[SymbolFlags["TypeAlias"] = 524288] = "TypeAlias"; + SymbolFlags[SymbolFlags["ExportValue"] = 1048576] = "ExportValue"; + SymbolFlags[SymbolFlags["Alias"] = 2097152] = "Alias"; + SymbolFlags[SymbolFlags["Prototype"] = 4194304] = "Prototype"; + SymbolFlags[SymbolFlags["ExportStar"] = 8388608] = "ExportStar"; + SymbolFlags[SymbolFlags["Optional"] = 16777216] = "Optional"; + SymbolFlags[SymbolFlags["Transient"] = 33554432] = "Transient"; + SymbolFlags[SymbolFlags["Enum"] = 384] = "Enum"; + SymbolFlags[SymbolFlags["Variable"] = 3] = "Variable"; + SymbolFlags[SymbolFlags["Value"] = 107455] = "Value"; + SymbolFlags[SymbolFlags["Type"] = 793064] = "Type"; + SymbolFlags[SymbolFlags["Namespace"] = 1920] = "Namespace"; + SymbolFlags[SymbolFlags["Module"] = 1536] = "Module"; + SymbolFlags[SymbolFlags["Accessor"] = 98304] = "Accessor"; + SymbolFlags[SymbolFlags["FunctionScopedVariableExcludes"] = 107454] = "FunctionScopedVariableExcludes"; + SymbolFlags[SymbolFlags["BlockScopedVariableExcludes"] = 107455] = "BlockScopedVariableExcludes"; + SymbolFlags[SymbolFlags["ParameterExcludes"] = 107455] = "ParameterExcludes"; + SymbolFlags[SymbolFlags["PropertyExcludes"] = 0] = "PropertyExcludes"; + SymbolFlags[SymbolFlags["EnumMemberExcludes"] = 900095] = "EnumMemberExcludes"; + SymbolFlags[SymbolFlags["FunctionExcludes"] = 106927] = "FunctionExcludes"; + SymbolFlags[SymbolFlags["ClassExcludes"] = 899519] = "ClassExcludes"; + SymbolFlags[SymbolFlags["InterfaceExcludes"] = 792968] = "InterfaceExcludes"; + SymbolFlags[SymbolFlags["RegularEnumExcludes"] = 899327] = "RegularEnumExcludes"; + SymbolFlags[SymbolFlags["ConstEnumExcludes"] = 899967] = "ConstEnumExcludes"; + SymbolFlags[SymbolFlags["ValueModuleExcludes"] = 106639] = "ValueModuleExcludes"; + SymbolFlags[SymbolFlags["NamespaceModuleExcludes"] = 0] = "NamespaceModuleExcludes"; + SymbolFlags[SymbolFlags["MethodExcludes"] = 99263] = "MethodExcludes"; + SymbolFlags[SymbolFlags["GetAccessorExcludes"] = 41919] = "GetAccessorExcludes"; + SymbolFlags[SymbolFlags["SetAccessorExcludes"] = 74687] = "SetAccessorExcludes"; + SymbolFlags[SymbolFlags["TypeParameterExcludes"] = 530920] = "TypeParameterExcludes"; + SymbolFlags[SymbolFlags["TypeAliasExcludes"] = 793064] = "TypeAliasExcludes"; + SymbolFlags[SymbolFlags["AliasExcludes"] = 2097152] = "AliasExcludes"; + SymbolFlags[SymbolFlags["ModuleMember"] = 2623475] = "ModuleMember"; + SymbolFlags[SymbolFlags["ExportHasLocal"] = 944] = "ExportHasLocal"; + SymbolFlags[SymbolFlags["HasExports"] = 1952] = "HasExports"; + SymbolFlags[SymbolFlags["HasMembers"] = 6240] = "HasMembers"; + SymbolFlags[SymbolFlags["BlockScoped"] = 418] = "BlockScoped"; + SymbolFlags[SymbolFlags["PropertyOrAccessor"] = 98308] = "PropertyOrAccessor"; + SymbolFlags[SymbolFlags["ClassMember"] = 106500] = "ClassMember"; + SymbolFlags[SymbolFlags["Classifiable"] = 788448] = "Classifiable"; + })(SymbolFlags = ts.SymbolFlags || (ts.SymbolFlags = {})); + var EnumKind; + (function (EnumKind) { + EnumKind[EnumKind["Numeric"] = 0] = "Numeric"; + EnumKind[EnumKind["Literal"] = 1] = "Literal"; + })(EnumKind = ts.EnumKind || (ts.EnumKind = {})); + var CheckFlags; + (function (CheckFlags) { + CheckFlags[CheckFlags["Instantiated"] = 1] = "Instantiated"; + CheckFlags[CheckFlags["SyntheticProperty"] = 2] = "SyntheticProperty"; + CheckFlags[CheckFlags["SyntheticMethod"] = 4] = "SyntheticMethod"; + CheckFlags[CheckFlags["Readonly"] = 8] = "Readonly"; + CheckFlags[CheckFlags["Partial"] = 16] = "Partial"; + CheckFlags[CheckFlags["HasNonUniformType"] = 32] = "HasNonUniformType"; + CheckFlags[CheckFlags["ContainsPublic"] = 64] = "ContainsPublic"; + CheckFlags[CheckFlags["ContainsProtected"] = 128] = "ContainsProtected"; + CheckFlags[CheckFlags["ContainsPrivate"] = 256] = "ContainsPrivate"; + CheckFlags[CheckFlags["ContainsStatic"] = 512] = "ContainsStatic"; + CheckFlags[CheckFlags["Synthetic"] = 6] = "Synthetic"; + })(CheckFlags = ts.CheckFlags || (ts.CheckFlags = {})); + var InternalSymbolName; + (function (InternalSymbolName) { + InternalSymbolName["Call"] = "__call"; + InternalSymbolName["Constructor"] = "__constructor"; + InternalSymbolName["New"] = "__new"; + InternalSymbolName["Index"] = "__index"; + InternalSymbolName["ExportStar"] = "__export"; + InternalSymbolName["Global"] = "__global"; + InternalSymbolName["Missing"] = "__missing"; + InternalSymbolName["Type"] = "__type"; + InternalSymbolName["Object"] = "__object"; + InternalSymbolName["JSXAttributes"] = "__jsxAttributes"; + InternalSymbolName["Class"] = "__class"; + InternalSymbolName["Function"] = "__function"; + InternalSymbolName["Computed"] = "__computed"; + InternalSymbolName["Resolving"] = "__resolving__"; + InternalSymbolName["ExportEquals"] = "export="; + InternalSymbolName["Default"] = "default"; + })(InternalSymbolName = ts.InternalSymbolName || (ts.InternalSymbolName = {})); + var NodeCheckFlags; + (function (NodeCheckFlags) { + NodeCheckFlags[NodeCheckFlags["TypeChecked"] = 1] = "TypeChecked"; + NodeCheckFlags[NodeCheckFlags["LexicalThis"] = 2] = "LexicalThis"; + NodeCheckFlags[NodeCheckFlags["CaptureThis"] = 4] = "CaptureThis"; + NodeCheckFlags[NodeCheckFlags["CaptureNewTarget"] = 8] = "CaptureNewTarget"; + NodeCheckFlags[NodeCheckFlags["SuperInstance"] = 256] = "SuperInstance"; + NodeCheckFlags[NodeCheckFlags["SuperStatic"] = 512] = "SuperStatic"; + NodeCheckFlags[NodeCheckFlags["ContextChecked"] = 1024] = "ContextChecked"; + NodeCheckFlags[NodeCheckFlags["AsyncMethodWithSuper"] = 2048] = "AsyncMethodWithSuper"; + NodeCheckFlags[NodeCheckFlags["AsyncMethodWithSuperBinding"] = 4096] = "AsyncMethodWithSuperBinding"; + NodeCheckFlags[NodeCheckFlags["CaptureArguments"] = 8192] = "CaptureArguments"; + NodeCheckFlags[NodeCheckFlags["EnumValuesComputed"] = 16384] = "EnumValuesComputed"; + NodeCheckFlags[NodeCheckFlags["LexicalModuleMergesWithClass"] = 32768] = "LexicalModuleMergesWithClass"; + NodeCheckFlags[NodeCheckFlags["LoopWithCapturedBlockScopedBinding"] = 65536] = "LoopWithCapturedBlockScopedBinding"; + NodeCheckFlags[NodeCheckFlags["CapturedBlockScopedBinding"] = 131072] = "CapturedBlockScopedBinding"; + NodeCheckFlags[NodeCheckFlags["BlockScopedBindingInLoop"] = 262144] = "BlockScopedBindingInLoop"; + NodeCheckFlags[NodeCheckFlags["ClassWithBodyScopedClassBinding"] = 524288] = "ClassWithBodyScopedClassBinding"; + NodeCheckFlags[NodeCheckFlags["BodyScopedClassBinding"] = 1048576] = "BodyScopedClassBinding"; + NodeCheckFlags[NodeCheckFlags["NeedsLoopOutParameter"] = 2097152] = "NeedsLoopOutParameter"; + NodeCheckFlags[NodeCheckFlags["AssignmentsMarked"] = 4194304] = "AssignmentsMarked"; + NodeCheckFlags[NodeCheckFlags["ClassWithConstructorReference"] = 8388608] = "ClassWithConstructorReference"; + NodeCheckFlags[NodeCheckFlags["ConstructorReferenceInClass"] = 16777216] = "ConstructorReferenceInClass"; + })(NodeCheckFlags = ts.NodeCheckFlags || (ts.NodeCheckFlags = {})); + var TypeFlags; + (function (TypeFlags) { + TypeFlags[TypeFlags["Any"] = 1] = "Any"; + TypeFlags[TypeFlags["String"] = 2] = "String"; + TypeFlags[TypeFlags["Number"] = 4] = "Number"; + TypeFlags[TypeFlags["Boolean"] = 8] = "Boolean"; + TypeFlags[TypeFlags["Enum"] = 16] = "Enum"; + TypeFlags[TypeFlags["StringLiteral"] = 32] = "StringLiteral"; + TypeFlags[TypeFlags["NumberLiteral"] = 64] = "NumberLiteral"; + TypeFlags[TypeFlags["BooleanLiteral"] = 128] = "BooleanLiteral"; + TypeFlags[TypeFlags["EnumLiteral"] = 256] = "EnumLiteral"; + TypeFlags[TypeFlags["ESSymbol"] = 512] = "ESSymbol"; + TypeFlags[TypeFlags["Void"] = 1024] = "Void"; + TypeFlags[TypeFlags["Undefined"] = 2048] = "Undefined"; + TypeFlags[TypeFlags["Null"] = 4096] = "Null"; + TypeFlags[TypeFlags["Never"] = 8192] = "Never"; + TypeFlags[TypeFlags["TypeParameter"] = 16384] = "TypeParameter"; + TypeFlags[TypeFlags["Object"] = 32768] = "Object"; + TypeFlags[TypeFlags["Union"] = 65536] = "Union"; + TypeFlags[TypeFlags["Intersection"] = 131072] = "Intersection"; + TypeFlags[TypeFlags["Index"] = 262144] = "Index"; + TypeFlags[TypeFlags["IndexedAccess"] = 524288] = "IndexedAccess"; + TypeFlags[TypeFlags["FreshLiteral"] = 1048576] = "FreshLiteral"; + TypeFlags[TypeFlags["ContainsWideningType"] = 2097152] = "ContainsWideningType"; + TypeFlags[TypeFlags["ContainsObjectLiteral"] = 4194304] = "ContainsObjectLiteral"; + TypeFlags[TypeFlags["ContainsAnyFunctionType"] = 8388608] = "ContainsAnyFunctionType"; + TypeFlags[TypeFlags["NonPrimitive"] = 16777216] = "NonPrimitive"; + TypeFlags[TypeFlags["JsxAttributes"] = 33554432] = "JsxAttributes"; + TypeFlags[TypeFlags["Nullable"] = 6144] = "Nullable"; + TypeFlags[TypeFlags["Literal"] = 224] = "Literal"; + TypeFlags[TypeFlags["StringOrNumberLiteral"] = 96] = "StringOrNumberLiteral"; + TypeFlags[TypeFlags["DefinitelyFalsy"] = 7392] = "DefinitelyFalsy"; + TypeFlags[TypeFlags["PossiblyFalsy"] = 7406] = "PossiblyFalsy"; + TypeFlags[TypeFlags["Intrinsic"] = 16793231] = "Intrinsic"; + TypeFlags[TypeFlags["Primitive"] = 8190] = "Primitive"; + TypeFlags[TypeFlags["StringLike"] = 262178] = "StringLike"; + TypeFlags[TypeFlags["NumberLike"] = 84] = "NumberLike"; + TypeFlags[TypeFlags["BooleanLike"] = 136] = "BooleanLike"; + TypeFlags[TypeFlags["EnumLike"] = 272] = "EnumLike"; + TypeFlags[TypeFlags["UnionOrIntersection"] = 196608] = "UnionOrIntersection"; + TypeFlags[TypeFlags["StructuredType"] = 229376] = "StructuredType"; + TypeFlags[TypeFlags["StructuredOrTypeVariable"] = 1032192] = "StructuredOrTypeVariable"; + TypeFlags[TypeFlags["TypeVariable"] = 540672] = "TypeVariable"; + TypeFlags[TypeFlags["Narrowable"] = 17810175] = "Narrowable"; + TypeFlags[TypeFlags["NotUnionOrUnit"] = 16810497] = "NotUnionOrUnit"; + TypeFlags[TypeFlags["RequiresWidening"] = 6291456] = "RequiresWidening"; + TypeFlags[TypeFlags["PropagatingFlags"] = 14680064] = "PropagatingFlags"; + })(TypeFlags = ts.TypeFlags || (ts.TypeFlags = {})); + var ObjectFlags; + (function (ObjectFlags) { + ObjectFlags[ObjectFlags["Class"] = 1] = "Class"; + ObjectFlags[ObjectFlags["Interface"] = 2] = "Interface"; + ObjectFlags[ObjectFlags["Reference"] = 4] = "Reference"; + ObjectFlags[ObjectFlags["Tuple"] = 8] = "Tuple"; + ObjectFlags[ObjectFlags["Anonymous"] = 16] = "Anonymous"; + ObjectFlags[ObjectFlags["Mapped"] = 32] = "Mapped"; + ObjectFlags[ObjectFlags["Instantiated"] = 64] = "Instantiated"; + ObjectFlags[ObjectFlags["ObjectLiteral"] = 128] = "ObjectLiteral"; + ObjectFlags[ObjectFlags["EvolvingArray"] = 256] = "EvolvingArray"; + ObjectFlags[ObjectFlags["ObjectLiteralPatternWithComputedProperties"] = 512] = "ObjectLiteralPatternWithComputedProperties"; + ObjectFlags[ObjectFlags["ClassOrInterface"] = 3] = "ClassOrInterface"; + })(ObjectFlags = ts.ObjectFlags || (ts.ObjectFlags = {})); + var SignatureKind; + (function (SignatureKind) { + SignatureKind[SignatureKind["Call"] = 0] = "Call"; + SignatureKind[SignatureKind["Construct"] = 1] = "Construct"; + })(SignatureKind = ts.SignatureKind || (ts.SignatureKind = {})); + var IndexKind; + (function (IndexKind) { + IndexKind[IndexKind["String"] = 0] = "String"; + IndexKind[IndexKind["Number"] = 1] = "Number"; + })(IndexKind = ts.IndexKind || (ts.IndexKind = {})); + var InferencePriority; + (function (InferencePriority) { + InferencePriority[InferencePriority["NakedTypeVariable"] = 1] = "NakedTypeVariable"; + InferencePriority[InferencePriority["MappedType"] = 2] = "MappedType"; + InferencePriority[InferencePriority["ReturnType"] = 4] = "ReturnType"; + })(InferencePriority = ts.InferencePriority || (ts.InferencePriority = {})); + var InferenceFlags; + (function (InferenceFlags) { + InferenceFlags[InferenceFlags["InferUnionTypes"] = 1] = "InferUnionTypes"; + InferenceFlags[InferenceFlags["NoDefault"] = 2] = "NoDefault"; + InferenceFlags[InferenceFlags["AnyDefault"] = 4] = "AnyDefault"; + })(InferenceFlags = ts.InferenceFlags || (ts.InferenceFlags = {})); + var Ternary; + (function (Ternary) { + Ternary[Ternary["False"] = 0] = "False"; + Ternary[Ternary["Maybe"] = 1] = "Maybe"; + Ternary[Ternary["True"] = -1] = "True"; + })(Ternary = ts.Ternary || (ts.Ternary = {})); + var SpecialPropertyAssignmentKind; + (function (SpecialPropertyAssignmentKind) { + SpecialPropertyAssignmentKind[SpecialPropertyAssignmentKind["None"] = 0] = "None"; + SpecialPropertyAssignmentKind[SpecialPropertyAssignmentKind["ExportsProperty"] = 1] = "ExportsProperty"; + SpecialPropertyAssignmentKind[SpecialPropertyAssignmentKind["ModuleExports"] = 2] = "ModuleExports"; + SpecialPropertyAssignmentKind[SpecialPropertyAssignmentKind["PrototypeProperty"] = 3] = "PrototypeProperty"; + SpecialPropertyAssignmentKind[SpecialPropertyAssignmentKind["ThisProperty"] = 4] = "ThisProperty"; + SpecialPropertyAssignmentKind[SpecialPropertyAssignmentKind["Property"] = 5] = "Property"; + })(SpecialPropertyAssignmentKind = ts.SpecialPropertyAssignmentKind || (ts.SpecialPropertyAssignmentKind = {})); var DiagnosticCategory; (function (DiagnosticCategory) { DiagnosticCategory[DiagnosticCategory["Warning"] = 0] = "Warning"; @@ -91,6 +795,310 @@ var ts; ModuleKind[ModuleKind["ES2015"] = 5] = "ES2015"; ModuleKind[ModuleKind["ESNext"] = 6] = "ESNext"; })(ModuleKind = ts.ModuleKind || (ts.ModuleKind = {})); + var JsxEmit; + (function (JsxEmit) { + JsxEmit[JsxEmit["None"] = 0] = "None"; + JsxEmit[JsxEmit["Preserve"] = 1] = "Preserve"; + JsxEmit[JsxEmit["React"] = 2] = "React"; + JsxEmit[JsxEmit["ReactNative"] = 3] = "ReactNative"; + })(JsxEmit = ts.JsxEmit || (ts.JsxEmit = {})); + var NewLineKind; + (function (NewLineKind) { + NewLineKind[NewLineKind["CarriageReturnLineFeed"] = 0] = "CarriageReturnLineFeed"; + NewLineKind[NewLineKind["LineFeed"] = 1] = "LineFeed"; + })(NewLineKind = ts.NewLineKind || (ts.NewLineKind = {})); + var ScriptKind; + (function (ScriptKind) { + ScriptKind[ScriptKind["Unknown"] = 0] = "Unknown"; + ScriptKind[ScriptKind["JS"] = 1] = "JS"; + ScriptKind[ScriptKind["JSX"] = 2] = "JSX"; + ScriptKind[ScriptKind["TS"] = 3] = "TS"; + ScriptKind[ScriptKind["TSX"] = 4] = "TSX"; + ScriptKind[ScriptKind["External"] = 5] = "External"; + ScriptKind[ScriptKind["JSON"] = 6] = "JSON"; + })(ScriptKind = ts.ScriptKind || (ts.ScriptKind = {})); + var ScriptTarget; + (function (ScriptTarget) { + ScriptTarget[ScriptTarget["ES3"] = 0] = "ES3"; + ScriptTarget[ScriptTarget["ES5"] = 1] = "ES5"; + ScriptTarget[ScriptTarget["ES2015"] = 2] = "ES2015"; + ScriptTarget[ScriptTarget["ES2016"] = 3] = "ES2016"; + ScriptTarget[ScriptTarget["ES2017"] = 4] = "ES2017"; + ScriptTarget[ScriptTarget["ESNext"] = 5] = "ESNext"; + ScriptTarget[ScriptTarget["Latest"] = 5] = "Latest"; + })(ScriptTarget = ts.ScriptTarget || (ts.ScriptTarget = {})); + var LanguageVariant; + (function (LanguageVariant) { + LanguageVariant[LanguageVariant["Standard"] = 0] = "Standard"; + LanguageVariant[LanguageVariant["JSX"] = 1] = "JSX"; + })(LanguageVariant = ts.LanguageVariant || (ts.LanguageVariant = {})); + var DiagnosticStyle; + (function (DiagnosticStyle) { + DiagnosticStyle[DiagnosticStyle["Simple"] = 0] = "Simple"; + DiagnosticStyle[DiagnosticStyle["Pretty"] = 1] = "Pretty"; + })(DiagnosticStyle = ts.DiagnosticStyle || (ts.DiagnosticStyle = {})); + var WatchDirectoryFlags; + (function (WatchDirectoryFlags) { + WatchDirectoryFlags[WatchDirectoryFlags["None"] = 0] = "None"; + WatchDirectoryFlags[WatchDirectoryFlags["Recursive"] = 1] = "Recursive"; + })(WatchDirectoryFlags = ts.WatchDirectoryFlags || (ts.WatchDirectoryFlags = {})); + var CharacterCodes; + (function (CharacterCodes) { + CharacterCodes[CharacterCodes["nullCharacter"] = 0] = "nullCharacter"; + CharacterCodes[CharacterCodes["maxAsciiCharacter"] = 127] = "maxAsciiCharacter"; + CharacterCodes[CharacterCodes["lineFeed"] = 10] = "lineFeed"; + CharacterCodes[CharacterCodes["carriageReturn"] = 13] = "carriageReturn"; + CharacterCodes[CharacterCodes["lineSeparator"] = 8232] = "lineSeparator"; + CharacterCodes[CharacterCodes["paragraphSeparator"] = 8233] = "paragraphSeparator"; + CharacterCodes[CharacterCodes["nextLine"] = 133] = "nextLine"; + CharacterCodes[CharacterCodes["space"] = 32] = "space"; + CharacterCodes[CharacterCodes["nonBreakingSpace"] = 160] = "nonBreakingSpace"; + CharacterCodes[CharacterCodes["enQuad"] = 8192] = "enQuad"; + CharacterCodes[CharacterCodes["emQuad"] = 8193] = "emQuad"; + CharacterCodes[CharacterCodes["enSpace"] = 8194] = "enSpace"; + CharacterCodes[CharacterCodes["emSpace"] = 8195] = "emSpace"; + CharacterCodes[CharacterCodes["threePerEmSpace"] = 8196] = "threePerEmSpace"; + CharacterCodes[CharacterCodes["fourPerEmSpace"] = 8197] = "fourPerEmSpace"; + CharacterCodes[CharacterCodes["sixPerEmSpace"] = 8198] = "sixPerEmSpace"; + CharacterCodes[CharacterCodes["figureSpace"] = 8199] = "figureSpace"; + CharacterCodes[CharacterCodes["punctuationSpace"] = 8200] = "punctuationSpace"; + CharacterCodes[CharacterCodes["thinSpace"] = 8201] = "thinSpace"; + CharacterCodes[CharacterCodes["hairSpace"] = 8202] = "hairSpace"; + CharacterCodes[CharacterCodes["zeroWidthSpace"] = 8203] = "zeroWidthSpace"; + CharacterCodes[CharacterCodes["narrowNoBreakSpace"] = 8239] = "narrowNoBreakSpace"; + CharacterCodes[CharacterCodes["ideographicSpace"] = 12288] = "ideographicSpace"; + CharacterCodes[CharacterCodes["mathematicalSpace"] = 8287] = "mathematicalSpace"; + CharacterCodes[CharacterCodes["ogham"] = 5760] = "ogham"; + CharacterCodes[CharacterCodes["_"] = 95] = "_"; + CharacterCodes[CharacterCodes["$"] = 36] = "$"; + CharacterCodes[CharacterCodes["_0"] = 48] = "_0"; + CharacterCodes[CharacterCodes["_1"] = 49] = "_1"; + CharacterCodes[CharacterCodes["_2"] = 50] = "_2"; + CharacterCodes[CharacterCodes["_3"] = 51] = "_3"; + CharacterCodes[CharacterCodes["_4"] = 52] = "_4"; + CharacterCodes[CharacterCodes["_5"] = 53] = "_5"; + CharacterCodes[CharacterCodes["_6"] = 54] = "_6"; + CharacterCodes[CharacterCodes["_7"] = 55] = "_7"; + CharacterCodes[CharacterCodes["_8"] = 56] = "_8"; + CharacterCodes[CharacterCodes["_9"] = 57] = "_9"; + CharacterCodes[CharacterCodes["a"] = 97] = "a"; + CharacterCodes[CharacterCodes["b"] = 98] = "b"; + CharacterCodes[CharacterCodes["c"] = 99] = "c"; + CharacterCodes[CharacterCodes["d"] = 100] = "d"; + CharacterCodes[CharacterCodes["e"] = 101] = "e"; + CharacterCodes[CharacterCodes["f"] = 102] = "f"; + CharacterCodes[CharacterCodes["g"] = 103] = "g"; + CharacterCodes[CharacterCodes["h"] = 104] = "h"; + CharacterCodes[CharacterCodes["i"] = 105] = "i"; + CharacterCodes[CharacterCodes["j"] = 106] = "j"; + CharacterCodes[CharacterCodes["k"] = 107] = "k"; + CharacterCodes[CharacterCodes["l"] = 108] = "l"; + CharacterCodes[CharacterCodes["m"] = 109] = "m"; + CharacterCodes[CharacterCodes["n"] = 110] = "n"; + CharacterCodes[CharacterCodes["o"] = 111] = "o"; + CharacterCodes[CharacterCodes["p"] = 112] = "p"; + CharacterCodes[CharacterCodes["q"] = 113] = "q"; + CharacterCodes[CharacterCodes["r"] = 114] = "r"; + CharacterCodes[CharacterCodes["s"] = 115] = "s"; + CharacterCodes[CharacterCodes["t"] = 116] = "t"; + CharacterCodes[CharacterCodes["u"] = 117] = "u"; + CharacterCodes[CharacterCodes["v"] = 118] = "v"; + CharacterCodes[CharacterCodes["w"] = 119] = "w"; + CharacterCodes[CharacterCodes["x"] = 120] = "x"; + CharacterCodes[CharacterCodes["y"] = 121] = "y"; + CharacterCodes[CharacterCodes["z"] = 122] = "z"; + CharacterCodes[CharacterCodes["A"] = 65] = "A"; + CharacterCodes[CharacterCodes["B"] = 66] = "B"; + CharacterCodes[CharacterCodes["C"] = 67] = "C"; + CharacterCodes[CharacterCodes["D"] = 68] = "D"; + CharacterCodes[CharacterCodes["E"] = 69] = "E"; + CharacterCodes[CharacterCodes["F"] = 70] = "F"; + CharacterCodes[CharacterCodes["G"] = 71] = "G"; + CharacterCodes[CharacterCodes["H"] = 72] = "H"; + CharacterCodes[CharacterCodes["I"] = 73] = "I"; + CharacterCodes[CharacterCodes["J"] = 74] = "J"; + CharacterCodes[CharacterCodes["K"] = 75] = "K"; + CharacterCodes[CharacterCodes["L"] = 76] = "L"; + CharacterCodes[CharacterCodes["M"] = 77] = "M"; + CharacterCodes[CharacterCodes["N"] = 78] = "N"; + CharacterCodes[CharacterCodes["O"] = 79] = "O"; + CharacterCodes[CharacterCodes["P"] = 80] = "P"; + CharacterCodes[CharacterCodes["Q"] = 81] = "Q"; + CharacterCodes[CharacterCodes["R"] = 82] = "R"; + CharacterCodes[CharacterCodes["S"] = 83] = "S"; + CharacterCodes[CharacterCodes["T"] = 84] = "T"; + CharacterCodes[CharacterCodes["U"] = 85] = "U"; + CharacterCodes[CharacterCodes["V"] = 86] = "V"; + CharacterCodes[CharacterCodes["W"] = 87] = "W"; + CharacterCodes[CharacterCodes["X"] = 88] = "X"; + CharacterCodes[CharacterCodes["Y"] = 89] = "Y"; + CharacterCodes[CharacterCodes["Z"] = 90] = "Z"; + CharacterCodes[CharacterCodes["ampersand"] = 38] = "ampersand"; + CharacterCodes[CharacterCodes["asterisk"] = 42] = "asterisk"; + CharacterCodes[CharacterCodes["at"] = 64] = "at"; + CharacterCodes[CharacterCodes["backslash"] = 92] = "backslash"; + CharacterCodes[CharacterCodes["backtick"] = 96] = "backtick"; + CharacterCodes[CharacterCodes["bar"] = 124] = "bar"; + CharacterCodes[CharacterCodes["caret"] = 94] = "caret"; + CharacterCodes[CharacterCodes["closeBrace"] = 125] = "closeBrace"; + CharacterCodes[CharacterCodes["closeBracket"] = 93] = "closeBracket"; + CharacterCodes[CharacterCodes["closeParen"] = 41] = "closeParen"; + CharacterCodes[CharacterCodes["colon"] = 58] = "colon"; + CharacterCodes[CharacterCodes["comma"] = 44] = "comma"; + CharacterCodes[CharacterCodes["dot"] = 46] = "dot"; + CharacterCodes[CharacterCodes["doubleQuote"] = 34] = "doubleQuote"; + CharacterCodes[CharacterCodes["equals"] = 61] = "equals"; + CharacterCodes[CharacterCodes["exclamation"] = 33] = "exclamation"; + CharacterCodes[CharacterCodes["greaterThan"] = 62] = "greaterThan"; + CharacterCodes[CharacterCodes["hash"] = 35] = "hash"; + CharacterCodes[CharacterCodes["lessThan"] = 60] = "lessThan"; + CharacterCodes[CharacterCodes["minus"] = 45] = "minus"; + CharacterCodes[CharacterCodes["openBrace"] = 123] = "openBrace"; + CharacterCodes[CharacterCodes["openBracket"] = 91] = "openBracket"; + CharacterCodes[CharacterCodes["openParen"] = 40] = "openParen"; + CharacterCodes[CharacterCodes["percent"] = 37] = "percent"; + CharacterCodes[CharacterCodes["plus"] = 43] = "plus"; + CharacterCodes[CharacterCodes["question"] = 63] = "question"; + CharacterCodes[CharacterCodes["semicolon"] = 59] = "semicolon"; + CharacterCodes[CharacterCodes["singleQuote"] = 39] = "singleQuote"; + CharacterCodes[CharacterCodes["slash"] = 47] = "slash"; + CharacterCodes[CharacterCodes["tilde"] = 126] = "tilde"; + CharacterCodes[CharacterCodes["backspace"] = 8] = "backspace"; + CharacterCodes[CharacterCodes["formFeed"] = 12] = "formFeed"; + CharacterCodes[CharacterCodes["byteOrderMark"] = 65279] = "byteOrderMark"; + CharacterCodes[CharacterCodes["tab"] = 9] = "tab"; + CharacterCodes[CharacterCodes["verticalTab"] = 11] = "verticalTab"; + })(CharacterCodes = ts.CharacterCodes || (ts.CharacterCodes = {})); + var Extension; + (function (Extension) { + Extension["Ts"] = ".ts"; + Extension["Tsx"] = ".tsx"; + Extension["Dts"] = ".d.ts"; + Extension["Js"] = ".js"; + Extension["Jsx"] = ".jsx"; + })(Extension = ts.Extension || (ts.Extension = {})); + var TransformFlags; + (function (TransformFlags) { + TransformFlags[TransformFlags["None"] = 0] = "None"; + TransformFlags[TransformFlags["TypeScript"] = 1] = "TypeScript"; + TransformFlags[TransformFlags["ContainsTypeScript"] = 2] = "ContainsTypeScript"; + TransformFlags[TransformFlags["ContainsJsx"] = 4] = "ContainsJsx"; + TransformFlags[TransformFlags["ContainsESNext"] = 8] = "ContainsESNext"; + TransformFlags[TransformFlags["ContainsES2017"] = 16] = "ContainsES2017"; + TransformFlags[TransformFlags["ContainsES2016"] = 32] = "ContainsES2016"; + TransformFlags[TransformFlags["ES2015"] = 64] = "ES2015"; + TransformFlags[TransformFlags["ContainsES2015"] = 128] = "ContainsES2015"; + TransformFlags[TransformFlags["Generator"] = 256] = "Generator"; + TransformFlags[TransformFlags["ContainsGenerator"] = 512] = "ContainsGenerator"; + TransformFlags[TransformFlags["DestructuringAssignment"] = 1024] = "DestructuringAssignment"; + TransformFlags[TransformFlags["ContainsDestructuringAssignment"] = 2048] = "ContainsDestructuringAssignment"; + TransformFlags[TransformFlags["ContainsDecorators"] = 4096] = "ContainsDecorators"; + TransformFlags[TransformFlags["ContainsPropertyInitializer"] = 8192] = "ContainsPropertyInitializer"; + TransformFlags[TransformFlags["ContainsLexicalThis"] = 16384] = "ContainsLexicalThis"; + TransformFlags[TransformFlags["ContainsCapturedLexicalThis"] = 32768] = "ContainsCapturedLexicalThis"; + TransformFlags[TransformFlags["ContainsLexicalThisInComputedPropertyName"] = 65536] = "ContainsLexicalThisInComputedPropertyName"; + TransformFlags[TransformFlags["ContainsDefaultValueAssignments"] = 131072] = "ContainsDefaultValueAssignments"; + TransformFlags[TransformFlags["ContainsParameterPropertyAssignments"] = 262144] = "ContainsParameterPropertyAssignments"; + TransformFlags[TransformFlags["ContainsSpread"] = 524288] = "ContainsSpread"; + TransformFlags[TransformFlags["ContainsObjectSpread"] = 1048576] = "ContainsObjectSpread"; + TransformFlags[TransformFlags["ContainsRest"] = 524288] = "ContainsRest"; + TransformFlags[TransformFlags["ContainsObjectRest"] = 1048576] = "ContainsObjectRest"; + TransformFlags[TransformFlags["ContainsComputedPropertyName"] = 2097152] = "ContainsComputedPropertyName"; + TransformFlags[TransformFlags["ContainsBlockScopedBinding"] = 4194304] = "ContainsBlockScopedBinding"; + TransformFlags[TransformFlags["ContainsBindingPattern"] = 8388608] = "ContainsBindingPattern"; + TransformFlags[TransformFlags["ContainsYield"] = 16777216] = "ContainsYield"; + TransformFlags[TransformFlags["ContainsHoistedDeclarationOrCompletion"] = 33554432] = "ContainsHoistedDeclarationOrCompletion"; + TransformFlags[TransformFlags["ContainsDynamicImport"] = 67108864] = "ContainsDynamicImport"; + TransformFlags[TransformFlags["HasComputedFlags"] = 536870912] = "HasComputedFlags"; + TransformFlags[TransformFlags["AssertTypeScript"] = 3] = "AssertTypeScript"; + TransformFlags[TransformFlags["AssertJsx"] = 4] = "AssertJsx"; + TransformFlags[TransformFlags["AssertESNext"] = 8] = "AssertESNext"; + TransformFlags[TransformFlags["AssertES2017"] = 16] = "AssertES2017"; + TransformFlags[TransformFlags["AssertES2016"] = 32] = "AssertES2016"; + TransformFlags[TransformFlags["AssertES2015"] = 192] = "AssertES2015"; + TransformFlags[TransformFlags["AssertGenerator"] = 768] = "AssertGenerator"; + TransformFlags[TransformFlags["AssertDestructuringAssignment"] = 3072] = "AssertDestructuringAssignment"; + TransformFlags[TransformFlags["NodeExcludes"] = 536872257] = "NodeExcludes"; + TransformFlags[TransformFlags["ArrowFunctionExcludes"] = 601249089] = "ArrowFunctionExcludes"; + TransformFlags[TransformFlags["FunctionExcludes"] = 601281857] = "FunctionExcludes"; + TransformFlags[TransformFlags["ConstructorExcludes"] = 601015617] = "ConstructorExcludes"; + TransformFlags[TransformFlags["MethodOrAccessorExcludes"] = 601015617] = "MethodOrAccessorExcludes"; + TransformFlags[TransformFlags["ClassExcludes"] = 539358529] = "ClassExcludes"; + TransformFlags[TransformFlags["ModuleExcludes"] = 574674241] = "ModuleExcludes"; + TransformFlags[TransformFlags["TypeExcludes"] = -3] = "TypeExcludes"; + TransformFlags[TransformFlags["ObjectLiteralExcludes"] = 540087617] = "ObjectLiteralExcludes"; + TransformFlags[TransformFlags["ArrayLiteralOrCallOrNewExcludes"] = 537396545] = "ArrayLiteralOrCallOrNewExcludes"; + TransformFlags[TransformFlags["VariableDeclarationListExcludes"] = 546309441] = "VariableDeclarationListExcludes"; + TransformFlags[TransformFlags["ParameterExcludes"] = 536872257] = "ParameterExcludes"; + TransformFlags[TransformFlags["CatchClauseExcludes"] = 537920833] = "CatchClauseExcludes"; + TransformFlags[TransformFlags["BindingPatternExcludes"] = 537396545] = "BindingPatternExcludes"; + TransformFlags[TransformFlags["TypeScriptClassSyntaxMask"] = 274432] = "TypeScriptClassSyntaxMask"; + TransformFlags[TransformFlags["ES2015FunctionSyntaxMask"] = 163840] = "ES2015FunctionSyntaxMask"; + })(TransformFlags = ts.TransformFlags || (ts.TransformFlags = {})); + var EmitFlags; + (function (EmitFlags) { + EmitFlags[EmitFlags["SingleLine"] = 1] = "SingleLine"; + EmitFlags[EmitFlags["AdviseOnEmitNode"] = 2] = "AdviseOnEmitNode"; + EmitFlags[EmitFlags["NoSubstitution"] = 4] = "NoSubstitution"; + EmitFlags[EmitFlags["CapturesThis"] = 8] = "CapturesThis"; + EmitFlags[EmitFlags["NoLeadingSourceMap"] = 16] = "NoLeadingSourceMap"; + EmitFlags[EmitFlags["NoTrailingSourceMap"] = 32] = "NoTrailingSourceMap"; + EmitFlags[EmitFlags["NoSourceMap"] = 48] = "NoSourceMap"; + EmitFlags[EmitFlags["NoNestedSourceMaps"] = 64] = "NoNestedSourceMaps"; + EmitFlags[EmitFlags["NoTokenLeadingSourceMaps"] = 128] = "NoTokenLeadingSourceMaps"; + EmitFlags[EmitFlags["NoTokenTrailingSourceMaps"] = 256] = "NoTokenTrailingSourceMaps"; + EmitFlags[EmitFlags["NoTokenSourceMaps"] = 384] = "NoTokenSourceMaps"; + EmitFlags[EmitFlags["NoLeadingComments"] = 512] = "NoLeadingComments"; + EmitFlags[EmitFlags["NoTrailingComments"] = 1024] = "NoTrailingComments"; + EmitFlags[EmitFlags["NoComments"] = 1536] = "NoComments"; + EmitFlags[EmitFlags["NoNestedComments"] = 2048] = "NoNestedComments"; + EmitFlags[EmitFlags["HelperName"] = 4096] = "HelperName"; + EmitFlags[EmitFlags["ExportName"] = 8192] = "ExportName"; + EmitFlags[EmitFlags["LocalName"] = 16384] = "LocalName"; + EmitFlags[EmitFlags["InternalName"] = 32768] = "InternalName"; + EmitFlags[EmitFlags["Indented"] = 65536] = "Indented"; + EmitFlags[EmitFlags["NoIndentation"] = 131072] = "NoIndentation"; + EmitFlags[EmitFlags["AsyncFunctionBody"] = 262144] = "AsyncFunctionBody"; + EmitFlags[EmitFlags["ReuseTempVariableScope"] = 524288] = "ReuseTempVariableScope"; + EmitFlags[EmitFlags["CustomPrologue"] = 1048576] = "CustomPrologue"; + EmitFlags[EmitFlags["NoHoisting"] = 2097152] = "NoHoisting"; + EmitFlags[EmitFlags["HasEndOfDeclarationMarker"] = 4194304] = "HasEndOfDeclarationMarker"; + EmitFlags[EmitFlags["Iterator"] = 8388608] = "Iterator"; + EmitFlags[EmitFlags["NoAsciiEscaping"] = 16777216] = "NoAsciiEscaping"; + })(EmitFlags = ts.EmitFlags || (ts.EmitFlags = {})); + var ExternalEmitHelpers; + (function (ExternalEmitHelpers) { + ExternalEmitHelpers[ExternalEmitHelpers["Extends"] = 1] = "Extends"; + ExternalEmitHelpers[ExternalEmitHelpers["Assign"] = 2] = "Assign"; + ExternalEmitHelpers[ExternalEmitHelpers["Rest"] = 4] = "Rest"; + ExternalEmitHelpers[ExternalEmitHelpers["Decorate"] = 8] = "Decorate"; + ExternalEmitHelpers[ExternalEmitHelpers["Metadata"] = 16] = "Metadata"; + ExternalEmitHelpers[ExternalEmitHelpers["Param"] = 32] = "Param"; + ExternalEmitHelpers[ExternalEmitHelpers["Awaiter"] = 64] = "Awaiter"; + ExternalEmitHelpers[ExternalEmitHelpers["Generator"] = 128] = "Generator"; + ExternalEmitHelpers[ExternalEmitHelpers["Values"] = 256] = "Values"; + ExternalEmitHelpers[ExternalEmitHelpers["Read"] = 512] = "Read"; + ExternalEmitHelpers[ExternalEmitHelpers["Spread"] = 1024] = "Spread"; + ExternalEmitHelpers[ExternalEmitHelpers["Await"] = 2048] = "Await"; + ExternalEmitHelpers[ExternalEmitHelpers["AsyncGenerator"] = 4096] = "AsyncGenerator"; + ExternalEmitHelpers[ExternalEmitHelpers["AsyncDelegator"] = 8192] = "AsyncDelegator"; + ExternalEmitHelpers[ExternalEmitHelpers["AsyncValues"] = 16384] = "AsyncValues"; + ExternalEmitHelpers[ExternalEmitHelpers["ExportStar"] = 32768] = "ExportStar"; + ExternalEmitHelpers[ExternalEmitHelpers["ForOfIncludes"] = 256] = "ForOfIncludes"; + ExternalEmitHelpers[ExternalEmitHelpers["ForAwaitOfIncludes"] = 16384] = "ForAwaitOfIncludes"; + ExternalEmitHelpers[ExternalEmitHelpers["AsyncGeneratorIncludes"] = 6144] = "AsyncGeneratorIncludes"; + ExternalEmitHelpers[ExternalEmitHelpers["AsyncDelegatorIncludes"] = 26624] = "AsyncDelegatorIncludes"; + ExternalEmitHelpers[ExternalEmitHelpers["SpreadIncludes"] = 1536] = "SpreadIncludes"; + ExternalEmitHelpers[ExternalEmitHelpers["FirstEmitHelper"] = 1] = "FirstEmitHelper"; + ExternalEmitHelpers[ExternalEmitHelpers["LastEmitHelper"] = 32768] = "LastEmitHelper"; + })(ExternalEmitHelpers = ts.ExternalEmitHelpers || (ts.ExternalEmitHelpers = {})); + var EmitHint; + (function (EmitHint) { + EmitHint[EmitHint["SourceFile"] = 0] = "SourceFile"; + EmitHint[EmitHint["Expression"] = 1] = "Expression"; + EmitHint[EmitHint["IdentifierName"] = 2] = "IdentifierName"; + EmitHint[EmitHint["Unspecified"] = 3] = "Unspecified"; + })(EmitHint = ts.EmitHint || (ts.EmitHint = {})); })(ts || (ts = {})); var ts; (function (ts) { @@ -153,7 +1161,7 @@ var ts; })(ts || (ts = {})); var ts; (function (ts) { - ts.versionMajorMinor = "2.5"; + ts.versionMajorMinor = "2.6"; ts.version = ts.versionMajorMinor + ".0"; })(ts || (ts = {})); (function (ts) { @@ -267,6 +1275,12 @@ var ts; return getCanonicalFileName(nonCanonicalizedPath); } ts.toPath = toPath; + var Comparison; + (function (Comparison) { + Comparison[Comparison["LessThan"] = -1] = "LessThan"; + Comparison[Comparison["EqualTo"] = 0] = "EqualTo"; + Comparison[Comparison["GreaterThan"] = 1] = "GreaterThan"; + })(Comparison = ts.Comparison || (ts.Comparison = {})); function length(array) { return array ? array.length : 0; } @@ -438,10 +1452,9 @@ var ts; ts.removeWhere = removeWhere; function filterMutate(array, f) { var outIndex = 0; - for (var _i = 0, array_3 = array; _i < array_3.length; _i++) { - var item = array_3[_i]; - if (f(item)) { - array[outIndex] = item; + for (var i = 0; i < array.length; i++) { + if (f(array[i], i, array)) { + array[outIndex] = array[i]; outIndex++; } } @@ -487,8 +1500,8 @@ var ts; var result; if (array) { result = []; - for (var _i = 0, array_4 = array; _i < array_4.length; _i++) { - var v = array_4[_i]; + for (var _i = 0, array_3 = array; _i < array_3.length; _i++) { + var v = array_3[_i]; if (v) { if (isArray(v)) { addRange(result, v); @@ -558,11 +1571,13 @@ var ts; ts.sameFlatMap = sameFlatMap; function mapDefined(array, mapFn) { var result = []; - for (var i = 0; i < array.length; i++) { - var item = array[i]; - var mapped = mapFn(item, i); - if (mapped !== undefined) { - result.push(mapped); + if (array) { + for (var i = 0; i < array.length; i++) { + var item = array[i]; + var mapped = mapFn(item, i); + if (mapped !== undefined) { + result.push(mapped); + } } } return result; @@ -630,8 +1645,8 @@ var ts; function some(array, predicate) { if (array) { if (predicate) { - for (var _i = 0, array_5 = array; _i < array_5.length; _i++) { - var v = array_5[_i]; + for (var _i = 0, array_4 = array; _i < array_4.length; _i++) { + var v = array_4[_i]; if (predicate(v)) { return true; } @@ -656,8 +1671,8 @@ var ts; var result; if (array) { result = []; - loop: for (var _i = 0, array_6 = array; _i < array_6.length; _i++) { - var item = array_6[_i]; + loop: for (var _i = 0, array_5 = array; _i < array_5.length; _i++) { + var item = array_5[_i]; for (var _a = 0, result_1 = result; _a < result_1.length; _a++) { var res = result_1[_a]; if (areEqual ? areEqual(res, item) : res === item) { @@ -745,8 +1760,8 @@ var ts; ts.relativeComplement = relativeComplement; function sum(array, prop) { var result = 0; - for (var _i = 0, array_7 = array; _i < array_7.length; _i++) { - var v = array_7[_i]; + for (var _i = 0, array_6 = array; _i < array_6.length; _i++) { + var v = array_6[_i]; result += v[prop]; } return result; @@ -1006,8 +2021,8 @@ var ts; ts.equalOwnProperties = equalOwnProperties; function arrayToMap(array, makeKey, makeValue) { var result = createMap(); - for (var _i = 0, array_8 = array; _i < array_8.length; _i++) { - var value = array_8[_i]; + for (var _i = 0, array_7 = array; _i < array_7.length; _i++) { + var value = array_7[_i]; result.set(makeKey(value), makeValue ? makeValue(value) : value); } return result; @@ -1167,11 +2182,11 @@ var ts; ts.getLocaleSpecificMessage = getLocaleSpecificMessage; function createFileDiagnostic(file, start, length, message) { var end = start + length; - Debug.assert(start >= 0, "start must be non-negative, is " + start); - Debug.assert(length >= 0, "length must be non-negative, is " + length); + Debug.assertGreaterThanOrEqual(start, 0); + Debug.assertGreaterThanOrEqual(length, 0); if (file) { - Debug.assert(start <= file.text.length, "start must be within the bounds of the file. " + start + " > " + file.text.length); - Debug.assert(end <= file.text.length, "end must be the bounds of the file. " + end + " > " + file.text.length); + Debug.assertLessThanOrEqual(start, file.text.length); + Debug.assertLessThanOrEqual(end, file.text.length); } var text = getLocaleSpecificMessage(message); if (arguments.length > 4) { @@ -1380,19 +2395,23 @@ var ts; return normalized; } function normalizePath(path) { + return normalizePathAndParts(path).path; + } + ts.normalizePath = normalizePath; + function normalizePathAndParts(path) { path = normalizeSlashes(path); var rootLength = getRootLength(path); var root = path.substr(0, rootLength); - var normalized = getNormalizedParts(path, rootLength); - if (normalized.length) { - var joinedParts = root + normalized.join(ts.directorySeparator); - return pathEndsWithDirectorySeparator(path) ? joinedParts + ts.directorySeparator : joinedParts; + var parts = getNormalizedParts(path, rootLength); + if (parts.length) { + var joinedParts = root + parts.join(ts.directorySeparator); + return { path: pathEndsWithDirectorySeparator(path) ? joinedParts + ts.directorySeparator : joinedParts, parts: parts }; } else { - return root; + return { path: root, parts: parts }; } } - ts.normalizePath = normalizePath; + ts.normalizePathAndParts = normalizePathAndParts; function pathEndsWithDirectorySeparator(path) { return path.charCodeAt(path.length - 1) === directorySeparatorCharCode; } @@ -1655,8 +2674,28 @@ var ts; ts.fileExtensionIsOneOf = fileExtensionIsOneOf; var reservedCharacterPattern = /[^\w\s\/]/g; var wildcardCharCodes = [42, 63]; - var singleAsteriskRegexFragmentFiles = "([^./]|(\\.(?!min\\.js$))?)*"; - var singleAsteriskRegexFragmentOther = "[^/]*"; + ts.commonPackageFolders = ["node_modules", "bower_components", "jspm_packages"]; + var implicitExcludePathRegexPattern = "(?!(" + ts.commonPackageFolders.join("|") + ")(/|$))"; + var filesMatcher = { + singleAsteriskRegexFragment: "([^./]|(\\.(?!min\\.js$))?)*", + doubleAsteriskRegexFragment: "(/" + implicitExcludePathRegexPattern + "[^/.][^/]*)*?", + replaceWildcardCharacter: function (match) { return replaceWildcardCharacter(match, filesMatcher.singleAsteriskRegexFragment); } + }; + var directoriesMatcher = { + singleAsteriskRegexFragment: "[^/]*", + doubleAsteriskRegexFragment: "(/" + implicitExcludePathRegexPattern + "[^/.][^/]*)*?", + replaceWildcardCharacter: function (match) { return replaceWildcardCharacter(match, directoriesMatcher.singleAsteriskRegexFragment); } + }; + var excludeMatcher = { + singleAsteriskRegexFragment: "[^/]*", + doubleAsteriskRegexFragment: "(/.+?)?", + replaceWildcardCharacter: function (match) { return replaceWildcardCharacter(match, excludeMatcher.singleAsteriskRegexFragment); } + }; + var wildcardMatchers = { + files: filesMatcher, + directories: directoriesMatcher, + exclude: excludeMatcher + }; function getRegularExpressionForWildcard(specs, basePath, usage) { var patterns = getRegularExpressionsForWildcards(specs, basePath, usage); if (!patterns || !patterns.length) { @@ -1671,18 +2710,16 @@ var ts; if (specs === undefined || specs.length === 0) { return undefined; } - var replaceWildcardCharacter = usage === "files" ? replaceWildCardCharacterFiles : replaceWildCardCharacterOther; - var singleAsteriskRegexFragment = usage === "files" ? singleAsteriskRegexFragmentFiles : singleAsteriskRegexFragmentOther; - var doubleAsteriskRegexFragment = usage === "exclude" ? "(/.+?)?" : "(/[^/.][^/]*)*?"; return flatMap(specs, function (spec) { - return spec && getSubPatternFromSpec(spec, basePath, usage, singleAsteriskRegexFragment, doubleAsteriskRegexFragment, replaceWildcardCharacter); + return spec && getSubPatternFromSpec(spec, basePath, usage, wildcardMatchers[usage]); }); } function isImplicitGlob(lastPathComponent) { return !/[.*?]/.test(lastPathComponent); } ts.isImplicitGlob = isImplicitGlob; - function getSubPatternFromSpec(spec, basePath, usage, singleAsteriskRegexFragment, doubleAsteriskRegexFragment, replaceWildcardCharacter) { + function getSubPatternFromSpec(spec, basePath, usage, _a) { + var singleAsteriskRegexFragment = _a.singleAsteriskRegexFragment, doubleAsteriskRegexFragment = _a.doubleAsteriskRegexFragment, replaceWildcardCharacter = _a.replaceWildcardCharacter; var subpattern = ""; var hasRecursiveDirectoryWildcard = false; var hasWrittenComponent = false; @@ -1714,16 +2751,24 @@ var ts; subpattern += ts.directorySeparator; } if (usage !== "exclude") { + var componentPattern = ""; if (component.charCodeAt(0) === 42) { - subpattern += "([^./]" + singleAsteriskRegexFragment + ")?"; + componentPattern += "([^./]" + singleAsteriskRegexFragment + ")?"; component = component.substr(1); } else if (component.charCodeAt(0) === 63) { - subpattern += "[^./]"; + componentPattern += "[^./]"; component = component.substr(1); } + componentPattern += component.replace(reservedCharacterPattern, replaceWildcardCharacter); + if (componentPattern !== component) { + subpattern += implicitExcludePathRegexPattern; + } + subpattern += componentPattern; + } + else { + subpattern += component.replace(reservedCharacterPattern, replaceWildcardCharacter); } - subpattern += component.replace(reservedCharacterPattern, replaceWildcardCharacter); } hasWrittenComponent = true; } @@ -1733,12 +2778,6 @@ var ts; } return subpattern; } - function replaceWildCardCharacterFiles(match) { - return replaceWildcardCharacter(match, singleAsteriskRegexFragmentFiles); - } - function replaceWildCardCharacterOther(match) { - return replaceWildcardCharacter(match, singleAsteriskRegexFragmentOther); - } function replaceWildcardCharacter(match, singleAsteriskRegexFragment) { return match === "*" ? singleAsteriskRegexFragment : match === "?" ? "[^/]" : "\\" + match; } @@ -1875,14 +2914,7 @@ var ts; if (!extraFileExtensions || extraFileExtensions.length === 0 || !needAllExtensions) { return needAllExtensions ? allSupportedExtensions : ts.supportedTypeScriptExtensions; } - var extensions = allSupportedExtensions.slice(0); - for (var _i = 0, extraFileExtensions_1 = extraFileExtensions; _i < extraFileExtensions_1.length; _i++) { - var extInfo = extraFileExtensions_1[_i]; - if (extensions.indexOf(extInfo.extension) === -1) { - extensions.push(extInfo.extension); - } - } - return extensions; + return deduplicate(allSupportedExtensions.concat(extraFileExtensions.map(function (e) { return e.extension; }))); } ts.getSupportedExtensions = getSupportedExtensions; function hasJavaScriptFileExtension(fileName) { @@ -1906,6 +2938,13 @@ var ts; return false; } ts.isSupportedSourceFileName = isSupportedSourceFileName; + var ExtensionPriority; + (function (ExtensionPriority) { + ExtensionPriority[ExtensionPriority["TypeScriptFiles"] = 0] = "TypeScriptFiles"; + ExtensionPriority[ExtensionPriority["DeclarationAndJavaScriptFiles"] = 2] = "DeclarationAndJavaScriptFiles"; + ExtensionPriority[ExtensionPriority["Highest"] = 0] = "Highest"; + ExtensionPriority[ExtensionPriority["Lowest"] = 2] = "Lowest"; + })(ExtensionPriority = ts.ExtensionPriority || (ts.ExtensionPriority = {})); function getExtensionPriority(path, supportedExtensions) { for (var i = supportedExtensions.length - 1; i >= 0; i--) { if (fileExtensionIs(path, supportedExtensions[i])) { @@ -1999,6 +3038,13 @@ var ts; getSignatureConstructor: function () { return Signature; }, getSourceMapSourceConstructor: function () { return SourceMapSource; }, }; + var AssertionLevel; + (function (AssertionLevel) { + AssertionLevel[AssertionLevel["None"] = 0] = "None"; + AssertionLevel[AssertionLevel["Normal"] = 1] = "Normal"; + AssertionLevel[AssertionLevel["Aggressive"] = 2] = "Aggressive"; + AssertionLevel[AssertionLevel["VeryAggressive"] = 3] = "VeryAggressive"; + })(AssertionLevel = ts.AssertionLevel || (ts.AssertionLevel = {})); var Debug; (function (Debug) { Debug.currentAssertionLevel = 0; @@ -2010,12 +3056,37 @@ var ts; function assert(expression, message, verboseDebugInfo, stackCrawlMark) { if (!expression) { if (verboseDebugInfo) { - message += "\r\nVerbose Debug Information: " + verboseDebugInfo(); + message += "\r\nVerbose Debug Information: " + (typeof verboseDebugInfo === "string" ? verboseDebugInfo : verboseDebugInfo()); } fail(message ? "False expression: " + message : "False expression.", stackCrawlMark || assert); } } Debug.assert = assert; + function assertEqual(a, b, msg, msg2) { + if (a !== b) { + var message = msg ? msg2 ? msg + " " + msg2 : msg : ""; + fail("Expected " + a + " === " + b + ". " + message); + } + } + Debug.assertEqual = assertEqual; + function assertLessThan(a, b, msg) { + if (a >= b) { + fail("Expected " + a + " < " + b + ". " + (msg || "")); + } + } + Debug.assertLessThan = assertLessThan; + function assertLessThanOrEqual(a, b) { + if (a > b) { + fail("Expected " + a + " <= " + b); + } + } + Debug.assertLessThanOrEqual = assertLessThanOrEqual; + function assertGreaterThanOrEqual(a, b) { + if (a < b) { + fail("Expected " + a + " >= " + b); + } + } + Debug.assertGreaterThanOrEqual = assertGreaterThanOrEqual; function fail(message, stackCrawlMark) { debugger; var e = new Error(message ? "Debug Failure. " + message : "Debug Failure."); @@ -2150,6 +3221,10 @@ var ts; Debug.fail("File " + path + " has unknown extension."); } ts.extensionFromPath = extensionFromPath; + function isAnySupportedFileExtension(path) { + return tryGetExtensionFromPath(path) !== undefined; + } + ts.isAnySupportedFileExtension = isAnySupportedFileExtension; function tryGetExtensionFromPath(path) { return find(ts.supportedTypescriptExtensionsForExtractExtension, function (e) { return fileExtensionIs(path, e); }) || find(ts.supportedJavascriptExtensions, function (e) { return fileExtensionIs(path, e); }); } @@ -2161,6 +3236,12 @@ var ts; })(ts || (ts = {})); var ts; (function (ts) { + function setStackTraceLimit() { + if (Error.stackTraceLimit < 100) { + Error.stackTraceLimit = 100; + } + } + ts.setStackTraceLimit = setStackTraceLimit; var FileWatcherEventKind; (function (FileWatcherEventKind) { FileWatcherEventKind[FileWatcherEventKind["Created"] = 0] = "Created"; @@ -2210,7 +3291,7 @@ var ts; watcher.referenceCount += 1; return; } - watcher = _fs.watch(dirPath, { persistent: true }, function (eventName, relativeFileName) { return fileEventHandler(eventName, relativeFileName, dirPath); }); + watcher = _fs.watch(dirPath || ".", { persistent: true }, function (eventName, relativeFileName) { return fileEventHandler(eventName, relativeFileName, dirPath); }); watcher.referenceCount = 1; dirWatchers.set(dirPath, watcher); return; @@ -2334,6 +3415,11 @@ var ts; function readDirectory(path, extensions, excludes, includes, depth) { return ts.matchFiles(path, extensions, excludes, includes, useCaseSensitiveFileNames, process.cwd(), depth, getAccessibleFileSystemEntries); } + var FileSystemEntryKind; + (function (FileSystemEntryKind) { + FileSystemEntryKind[FileSystemEntryKind["File"] = 0] = "File"; + FileSystemEntryKind[FileSystemEntryKind["Directory"] = 1] = "Directory"; + })(FileSystemEntryKind || (FileSystemEntryKind = {})); function fileSystemEntryExists(path, entryKind) { try { var stat = _fs.statSync(path); @@ -3031,6 +4117,8 @@ var ts; Expected_at_least_0_arguments_but_got_a_minimum_of_1: diag(2557, ts.DiagnosticCategory.Error, "Expected_at_least_0_arguments_but_got_a_minimum_of_1_2557", "Expected at least {0} arguments, but got a minimum of {1}."), Expected_0_type_arguments_but_got_1: diag(2558, ts.DiagnosticCategory.Error, "Expected_0_type_arguments_but_got_1_2558", "Expected {0} type arguments, but got {1}."), Type_0_has_no_properties_in_common_with_type_1: diag(2559, ts.DiagnosticCategory.Error, "Type_0_has_no_properties_in_common_with_type_1_2559", "Type '{0}' has no properties in common with type '{1}'."), + Value_of_type_0_has_no_properties_in_common_with_type_1_Did_you_mean_to_call_it: diag(2560, ts.DiagnosticCategory.Error, "Value_of_type_0_has_no_properties_in_common_with_type_1_Did_you_mean_to_call_it_2560", "Value of type '{0}' has no properties in common with type '{1}'. Did you mean to call it?"), + Base_class_expressions_cannot_reference_class_type_parameters: diag(2561, ts.DiagnosticCategory.Error, "Base_class_expressions_cannot_reference_class_type_parameters_2561", "Base class expressions cannot reference class type parameters."), JSX_element_attributes_type_0_may_not_be_a_union_type: diag(2600, ts.DiagnosticCategory.Error, "JSX_element_attributes_type_0_may_not_be_a_union_type_2600", "JSX element attributes type '{0}' may not be a union type."), The_return_type_of_a_JSX_element_constructor_must_return_an_object_type: diag(2601, ts.DiagnosticCategory.Error, "The_return_type_of_a_JSX_element_constructor_must_return_an_object_type_2601", "The return type of a JSX element constructor must return an object type."), JSX_element_implicitly_has_type_any_because_the_global_type_JSX_Element_does_not_exist: diag(2602, ts.DiagnosticCategory.Error, "JSX_element_implicitly_has_type_any_because_the_global_type_JSX_Element_does_not_exist_2602", "JSX element implicitly has type 'any' because the global type 'JSX.Element' does not exist."), @@ -3218,6 +4306,7 @@ var ts; Do_not_emit_outputs: diag(6010, ts.DiagnosticCategory.Message, "Do_not_emit_outputs_6010", "Do not emit outputs."), Allow_default_imports_from_modules_with_no_default_export_This_does_not_affect_code_emit_just_typechecking: diag(6011, ts.DiagnosticCategory.Message, "Allow_default_imports_from_modules_with_no_default_export_This_does_not_affect_code_emit_just_typech_6011", "Allow default imports from modules with no default export. This does not affect code emit, just typechecking."), Skip_type_checking_of_declaration_files: diag(6012, ts.DiagnosticCategory.Message, "Skip_type_checking_of_declaration_files_6012", "Skip type checking of declaration files."), + Do_not_resolve_the_real_path_of_symlinks: diag(6013, ts.DiagnosticCategory.Message, "Do_not_resolve_the_real_path_of_symlinks_6013", "Do not resolve the real path of symlinks."), Specify_ECMAScript_target_version_Colon_ES3_default_ES5_ES2015_ES2016_ES2017_or_ESNEXT: diag(6015, ts.DiagnosticCategory.Message, "Specify_ECMAScript_target_version_Colon_ES3_default_ES5_ES2015_ES2016_ES2017_or_ESNEXT_6015", "Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', or 'ESNEXT'."), Specify_module_code_generation_Colon_none_commonjs_amd_system_umd_es2015_or_ESNext: diag(6016, ts.DiagnosticCategory.Message, "Specify_module_code_generation_Colon_none_commonjs_amd_system_umd_es2015_or_ESNext_6016", "Specify module code generation: 'none', commonjs', 'amd', 'system', 'umd', 'es2015', or 'ESNext'."), Print_this_message: diag(6017, ts.DiagnosticCategory.Message, "Print_this_message_6017", "Print this message."), @@ -3471,6 +4560,8 @@ var ts; Rewrite_as_the_indexed_access_type_0: diag(90026, ts.DiagnosticCategory.Message, "Rewrite_as_the_indexed_access_type_0_90026", "Rewrite as the indexed access type '{0}'."), Convert_function_to_an_ES2015_class: diag(95001, ts.DiagnosticCategory.Message, "Convert_function_to_an_ES2015_class_95001", "Convert function to an ES2015 class"), Convert_function_0_to_class: diag(95002, ts.DiagnosticCategory.Message, "Convert_function_0_to_class_95002", "Convert function '{0}' to class"), + Extract_function: diag(95003, ts.DiagnosticCategory.Message, "Extract_function_95003", "Extract function"), + Extract_function_into_0: diag(95004, ts.DiagnosticCategory.Message, "Extract_function_into_0_95004", "Extract function into '{0}'"), }; })(ts || (ts = {})); var ts; @@ -3491,19 +4582,6 @@ var ts; return undefined; } ts.getDeclarationOfKind = getDeclarationOfKind; - function findDeclaration(symbol, predicate) { - var declarations = symbol.declarations; - if (declarations) { - for (var _i = 0, declarations_2 = declarations; _i < declarations_2.length; _i++) { - var declaration = declarations_2[_i]; - if (predicate(declaration)) { - return declaration; - } - } - } - return undefined; - } - ts.findDeclaration = findDeclaration; var stringWriter = createSingleLineStringWriter(); var stringWriterAcquired = false; function createSingleLineStringWriter() { @@ -3566,9 +4644,13 @@ var ts; function moduleResolutionIsEqualTo(oldResolution, newResolution) { return oldResolution.isExternalLibraryImport === newResolution.isExternalLibraryImport && oldResolution.extension === newResolution.extension && - oldResolution.resolvedFileName === newResolution.resolvedFileName; + oldResolution.resolvedFileName === newResolution.resolvedFileName && + packageIdIsEqual(oldResolution.packageId, newResolution.packageId); } ts.moduleResolutionIsEqualTo = moduleResolutionIsEqualTo; + function packageIdIsEqual(a, b) { + return a === b || a && b && a.name === b.name && a.version === b.version; + } function typeDirectiveIsEqualTo(oldResolution, newResolution) { return oldResolution.resolvedFileName === newResolution.resolvedFileName && oldResolution.primary === newResolution.primary; } @@ -3633,14 +4715,6 @@ var ts; return file.fileName + "(" + (loc.line + 1) + "," + (loc.character + 1) + ")"; } ts.nodePosToString = nodePosToString; - function getStartPosOfNode(node) { - return node.pos; - } - ts.getStartPosOfNode = getStartPosOfNode; - function isDefined(value) { - return value !== undefined; - } - ts.isDefined = isDefined; function getEndLinePosition(line, sourceFile) { ts.Debug.assert(line >= 0); var lineStarts = ts.getLineStarts(sourceFile); @@ -3671,6 +4745,25 @@ var ts; return !nodeIsMissing(node); } ts.nodeIsPresent = nodeIsPresent; + function isRecognizedTripleSlashComment(text, commentPos, commentEnd) { + if (text.charCodeAt(commentPos + 1) === 47 && + commentPos + 2 < commentEnd && + text.charCodeAt(commentPos + 2) === 47) { + var textSubStr = text.substring(commentPos, commentEnd); + return textSubStr.match(ts.fullTripleSlashReferencePathRegEx) || + textSubStr.match(ts.fullTripleSlashAMDReferencePathRegEx) || + textSubStr.match(fullTripleSlashReferenceTypeReferenceDirectiveRegEx) || + textSubStr.match(defaultLibReferenceRegEx) ? + true : false; + } + return false; + } + ts.isRecognizedTripleSlashComment = isRecognizedTripleSlashComment; + function isPinnedComment(text, comment) { + return text.charCodeAt(comment.pos + 1) === 42 && + text.charCodeAt(comment.pos + 2) === 33; + } + ts.isPinnedComment = isPinnedComment; function getTokenPosOfNode(node, sourceFile, includeJsDoc) { if (nodeIsMissing(node)) { return node.pos; @@ -3727,15 +4820,20 @@ var ts; var escapeText = getEmitFlags(node) & 16777216 ? escapeString : escapeNonAsciiString; switch (node.kind) { case 9: - return '"' + escapeText(node.text) + '"'; + if (node.singleQuote) { + return "'" + escapeText(node.text, 39) + "'"; + } + else { + return '"' + escapeText(node.text, 34) + '"'; + } case 13: - return "`" + escapeText(node.text) + "`"; + return "`" + escapeText(node.text, 96) + "`"; case 14: - return "`" + escapeText(node.text) + "${"; + return "`" + escapeText(node.text, 96) + "${"; case 15: - return "}" + escapeText(node.text) + "${"; + return "}" + escapeText(node.text, 96) + "${"; case 16: - return "}" + escapeText(node.text) + "`"; + return "}" + escapeText(node.text, 96) + "`"; case 8: return node.text; } @@ -3987,13 +5085,9 @@ var ts; } ts.isPrologueDirective = isPrologueDirective; function getLeadingCommentRangesOfNode(node, sourceFileOfNode) { - return ts.getLeadingCommentRanges(sourceFileOfNode.text, node.pos); + return node.kind !== 10 ? ts.getLeadingCommentRanges(sourceFileOfNode.text, node.pos) : undefined; } ts.getLeadingCommentRangesOfNode = getLeadingCommentRangesOfNode; - function getLeadingCommentRangesOfNodeFromText(node, text) { - return ts.getLeadingCommentRanges(text, node.pos); - } - ts.getLeadingCommentRangesOfNodeFromText = getLeadingCommentRangesOfNodeFromText; function getJSDocCommentRanges(node, text) { var commentRanges = (node.kind === 146 || node.kind === 145 || @@ -4001,7 +5095,7 @@ var ts; node.kind === 187 || node.kind === 185) ? ts.concatenate(ts.getTrailingCommentRanges(text, node.pos), ts.getLeadingCommentRanges(text, node.pos)) : - getLeadingCommentRangesOfNodeFromText(node, text); + ts.getLeadingCommentRanges(text, node.pos); return ts.filter(commentRanges, function (comment) { return text.charCodeAt(comment.pos + 1) === 42 && text.charCodeAt(comment.pos + 2) === 42 && @@ -4010,8 +5104,9 @@ var ts; } ts.getJSDocCommentRanges = getJSDocCommentRanges; ts.fullTripleSlashReferencePathRegEx = /^(\/\/\/\s*/; - ts.fullTripleSlashReferenceTypeReferenceDirectiveRegEx = /^(\/\/\/\s*/; + var fullTripleSlashReferenceTypeReferenceDirectiveRegEx = /^(\/\/\/\s*/; ts.fullTripleSlashAMDReferencePathRegEx = /^(\/\/\/\s*/; + var defaultLibReferenceRegEx = /^(\/\/\/\s*/; function isPartOfTypeNode(node) { if (158 <= node.kind && node.kind <= 173) { return true; @@ -4238,21 +5333,11 @@ var ts; } ts.getPropertyAssignment = getPropertyAssignment; function getContainingFunction(node) { - while (true) { - node = node.parent; - if (!node || ts.isFunctionLike(node)) { - return node; - } - } + return ts.findAncestor(node.parent, ts.isFunctionLike); } ts.getContainingFunction = getContainingFunction; function getContainingClass(node) { - while (true) { - node = node.parent; - if (!node || ts.isClassLike(node)) { - return node; - } - } + return ts.findAncestor(node.parent, ts.isClassLike); } ts.getContainingClass = getContainingClass; function getThisContainer(node, includeArrowFunctions) { @@ -4859,6 +5944,12 @@ var ts; return node && node.dotDotDotToken !== undefined; } ts.isDeclaredRestParam = isDeclaredRestParam; + var AssignmentKind; + (function (AssignmentKind) { + AssignmentKind[AssignmentKind["None"] = 0] = "None"; + AssignmentKind[AssignmentKind["Definite"] = 1] = "Definite"; + AssignmentKind[AssignmentKind["Compound"] = 2] = "Compound"; + })(AssignmentKind = ts.AssignmentKind || (ts.AssignmentKind = {})); function getAssignmentTargetKind(node) { var parent = node.parent; while (true) { @@ -5056,14 +6147,14 @@ var ts; ts.getAncestor = getAncestor; function getFileReferenceFromReferencePath(comment, commentRange) { var simpleReferenceRegEx = /^\/\/\/\s*/gim; + var isNoDefaultLibRegEx = new RegExp(defaultLibReferenceRegEx.source, "gim"); if (simpleReferenceRegEx.test(comment)) { if (isNoDefaultLibRegEx.test(comment)) { return { isNoDefaultLib: true }; } else { var refMatchResult = ts.fullTripleSlashReferencePathRegEx.exec(comment); - var refLibResult = !refMatchResult && ts.fullTripleSlashReferenceTypeReferenceDirectiveRegEx.exec(comment); + var refLibResult = !refMatchResult && fullTripleSlashReferenceTypeReferenceDirectiveRegEx.exec(comment); var match = refMatchResult || refLibResult; if (match) { var pos = commentRange.pos + match[1].length + match[2].length; @@ -5094,6 +6185,14 @@ var ts; return 2 <= token && token <= 7; } ts.isTrivia = isTrivia; + var FunctionFlags; + (function (FunctionFlags) { + FunctionFlags[FunctionFlags["Normal"] = 0] = "Normal"; + FunctionFlags[FunctionFlags["Generator"] = 1] = "Generator"; + FunctionFlags[FunctionFlags["Async"] = 2] = "Async"; + FunctionFlags[FunctionFlags["Invalid"] = 4] = "Invalid"; + FunctionFlags[FunctionFlags["AsyncGenerator"] = 3] = "AsyncGenerator"; + })(FunctionFlags = ts.FunctionFlags || (ts.FunctionFlags = {})); function getFunctionFlags(node) { if (!node) { return 4; @@ -5244,10 +6343,11 @@ var ts; return ts.getParseTreeNode(sourceFile, ts.isSourceFile) || sourceFile; } ts.getOriginalSourceFile = getOriginalSourceFile; - function getOriginalSourceFiles(sourceFiles) { - return ts.sameMap(sourceFiles, getOriginalSourceFile); - } - ts.getOriginalSourceFiles = getOriginalSourceFiles; + var Associativity; + (function (Associativity) { + Associativity[Associativity["Left"] = 0] = "Left"; + Associativity[Associativity["Right"] = 1] = "Right"; + })(Associativity = ts.Associativity || (ts.Associativity = {})); function getExpressionAssociativity(expression) { var operator = getOperator(expression); var hasArguments = expression.kind === 182 && expression.arguments !== undefined; @@ -5481,7 +6581,9 @@ var ts; } } ts.createDiagnosticCollection = createDiagnosticCollection; - var escapedCharsRegExp = /[\\\"\u0000-\u001f\t\v\f\b\r\n\u2028\u2029\u0085]/g; + var doubleQuoteEscapedCharsRegExp = /[\\\"\u0000-\u001f\t\v\f\b\r\n\u2028\u2029\u0085]/g; + var singleQuoteEscapedCharsRegExp = /[\\\'\u0000-\u001f\t\v\f\b\r\n\u2028\u2029\u0085]/g; + var backtickQuoteEscapedCharsRegExp = /[\\\`\u0000-\u001f\t\v\f\b\r\n\u2028\u2029\u0085]/g; var escapedCharsMap = ts.createMapFromTemplate({ "\0": "\\0", "\t": "\\t", @@ -5492,11 +6594,16 @@ var ts; "\n": "\\n", "\\": "\\\\", "\"": "\\\"", + "\'": "\\\'", + "\`": "\\\`", "\u2028": "\\u2028", "\u2029": "\\u2029", "\u0085": "\\u0085" }); - function escapeString(s) { + function escapeString(s, quoteChar) { + var escapedCharsRegExp = quoteChar === 96 ? backtickQuoteEscapedCharsRegExp : + quoteChar === 39 ? singleQuoteEscapedCharsRegExp : + doubleQuoteEscapedCharsRegExp; return s.replace(escapedCharsRegExp, getReplacement); } ts.escapeString = escapeString; @@ -5514,8 +6621,8 @@ var ts; return "\\u" + paddedHexCode; } var nonAsciiCharacters = /[^\u0000-\u007F]/g; - function escapeNonAsciiString(s) { - s = escapeString(s); + function escapeNonAsciiString(s, quoteChar) { + s = escapeString(s, quoteChar); return nonAsciiCharacters.test(s) ? s.replace(nonAsciiCharacters, function (c) { return get16BitUnicodeEscapeSequence(c.charCodeAt(0)); }) : s; @@ -5856,7 +6963,7 @@ var ts; var currentDetachedCommentInfo; if (removeComments) { if (node.pos === 0) { - leadingComments = ts.filter(ts.getLeadingCommentRanges(text, node.pos), isPinnedComment); + leadingComments = ts.filter(ts.getLeadingCommentRanges(text, node.pos), isPinnedCommentLocal); } } else { @@ -5888,9 +6995,8 @@ var ts; } } return currentDetachedCommentInfo; - function isPinnedComment(comment) { - return text.charCodeAt(comment.pos + 1) === 42 && - text.charCodeAt(comment.pos + 2) === 33; + function isPinnedCommentLocal(comment) { + return isPinnedComment(text, comment); } } ts.emitDetachedComments = emitDetachedComments; @@ -5961,9 +7067,13 @@ var ts; } ts.hasModifiers = hasModifiers; function hasModifier(node, flags) { - return (getModifierFlags(node) & flags) !== 0; + return !!getSelectedModifierFlags(node, flags); } ts.hasModifier = hasModifier; + function getSelectedModifierFlags(node, flags) { + return getModifierFlags(node) & flags; + } + ts.getSelectedModifierFlags = getSelectedModifierFlags; function getModifierFlags(node) { if (node.modifierFlagsCache & 536870912) { return node.modifierFlagsCache & ~536870912; @@ -6039,21 +7149,6 @@ var ts; return false; } ts.isDestructuringAssignment = isDestructuringAssignment; - function isSupportedExpressionWithTypeArguments(node) { - return isSupportedExpressionWithTypeArgumentsRest(node.expression); - } - ts.isSupportedExpressionWithTypeArguments = isSupportedExpressionWithTypeArguments; - function isSupportedExpressionWithTypeArgumentsRest(node) { - if (node.kind === 71) { - return true; - } - else if (ts.isPropertyAccessExpression(node)) { - return isSupportedExpressionWithTypeArgumentsRest(node.expression); - } - else { - return false; - } - } function isExpressionWithTypeArgumentsInClassExtendsClause(node) { return tryGetClassExtendingExpressionWithTypeArguments(node) !== undefined; } @@ -6166,72 +7261,6 @@ var ts; return carriageReturnLineFeed; } ts.getNewLineCharacter = getNewLineCharacter; - function isSimpleExpression(node) { - return isSimpleExpressionWorker(node, 0); - } - ts.isSimpleExpression = isSimpleExpression; - function isSimpleExpressionWorker(node, depth) { - if (depth <= 5) { - var kind = node.kind; - if (kind === 9 - || kind === 8 - || kind === 12 - || kind === 13 - || kind === 71 - || kind === 99 - || kind === 97 - || kind === 101 - || kind === 86 - || kind === 95) { - return true; - } - else if (kind === 179) { - return isSimpleExpressionWorker(node.expression, depth + 1); - } - else if (kind === 180) { - return isSimpleExpressionWorker(node.expression, depth + 1) - && isSimpleExpressionWorker(node.argumentExpression, depth + 1); - } - else if (kind === 192 - || kind === 193) { - return isSimpleExpressionWorker(node.operand, depth + 1); - } - else if (kind === 194) { - return node.operatorToken.kind !== 40 - && isSimpleExpressionWorker(node.left, depth + 1) - && isSimpleExpressionWorker(node.right, depth + 1); - } - else if (kind === 195) { - return isSimpleExpressionWorker(node.condition, depth + 1) - && isSimpleExpressionWorker(node.whenTrue, depth + 1) - && isSimpleExpressionWorker(node.whenFalse, depth + 1); - } - else if (kind === 190 - || kind === 189 - || kind === 188) { - return isSimpleExpressionWorker(node.expression, depth + 1); - } - else if (kind === 177) { - return node.elements.length === 0; - } - else if (kind === 178) { - return node.properties.length === 0; - } - else if (kind === 181) { - if (!isSimpleExpressionWorker(node.expression, depth + 1)) { - return false; - } - for (var _i = 0, _a = node.arguments; _i < _a.length; _i++) { - var argument = _a[_i]; - if (!isSimpleExpressionWorker(argument, depth + 1)) { - return false; - } - } - return true; - } - } - return false; - } function formatEnum(value, enumObject, isFlags) { if (value === void 0) { value = 0; } var members = getEnumMembers(enumObject); @@ -6300,18 +7329,6 @@ var ts; return formatEnum(flags, ts.ObjectFlags, true); } ts.formatObjectFlags = formatObjectFlags; - function getRangePos(range) { - return range ? range.pos : -1; - } - ts.getRangePos = getRangePos; - function getRangeEnd(range) { - return range ? range.end : -1; - } - ts.getRangeEnd = getRangeEnd; - function movePos(pos, value) { - return ts.positionIsSynthesized(pos) ? -1 : pos + value; - } - ts.movePos = movePos; function createRange(pos, end) { return { pos: pos, end: end }; } @@ -6340,14 +7357,6 @@ var ts; return range.pos === range.end; } ts.isCollapsedRange = isCollapsedRange; - function collapseRangeToStart(range) { - return isCollapsedRange(range) ? range : moveRangeEnd(range, range.pos); - } - ts.collapseRangeToStart = collapseRangeToStart; - function collapseRangeToEnd(range) { - return isCollapsedRange(range) ? range : moveRangePos(range, range.end); - } - ts.collapseRangeToEnd = collapseRangeToEnd; function createTokenRange(pos, token) { return createRange(pos, pos + ts.tokenToString(token).length); } @@ -6400,22 +7409,6 @@ var ts; function isInitializedVariable(node) { return node.initializer !== undefined; } - function isMergedWithClass(node) { - if (node.symbol) { - for (var _i = 0, _a = node.symbol.declarations; _i < _a.length; _i++) { - var declaration = _a[_i]; - if (declaration.kind === 229 && declaration !== node) { - return true; - } - } - } - return false; - } - ts.isMergedWithClass = isMergedWithClass; - function isFirstDeclarationOfKind(node, kind) { - return node.symbol && getDeclarationOfKind(node.symbol, kind) === node; - } - ts.isFirstDeclarationOfKind = isFirstDeclarationOfKind; function isWatchSet(options) { return options.watch && options.hasOwnProperty("watch"); } @@ -6616,6 +7609,20 @@ var ts; return ts.hasModifier(node, 92) && node.parent.kind === 152 && ts.isClassLike(node.parent.parent); } ts.isParameterPropertyDeclaration = isParameterPropertyDeclaration; + function isEmptyBindingPattern(node) { + if (ts.isBindingPattern(node)) { + return ts.every(node.elements, isEmptyBindingElement); + } + return false; + } + ts.isEmptyBindingPattern = isEmptyBindingPattern; + function isEmptyBindingElement(node) { + if (ts.isOmittedExpression(node)) { + return true; + } + return isEmptyBindingPattern(node.name); + } + ts.isEmptyBindingElement = isEmptyBindingElement; function walkUpBindingElementsAndPatterns(node) { while (node && (node.kind === 176 || ts.isBindingPattern(node))) { node = node.parent; @@ -7696,6 +8703,18 @@ var ts; return isUnaryExpressionKind(ts.skipPartiallyEmittedExpressions(node).kind); } ts.isUnaryExpression = isUnaryExpression; + function isUnaryExpressionWithWrite(expr) { + switch (expr.kind) { + case 193: + return true; + case 192: + return expr.operator === 43 || + expr.operator === 44; + default: + return false; + } + } + ts.isUnaryExpressionWithWrite = isUnaryExpressionWithWrite; function isExpressionKind(kind) { return kind === 195 || kind === 197 @@ -7880,9 +8899,19 @@ var ts; var kind = node.kind; return isStatementKindButNotDeclarationKind(kind) || isDeclarationStatementKind(kind) - || kind === 207; + || isBlockStatement(node); } ts.isStatement = isStatement; + function isBlockStatement(node) { + if (node.kind !== 207) + return false; + if (node.parent !== undefined) { + if (node.parent.kind === 224 || node.parent.kind === 260) { + return false; + } + } + return !ts.isFunctionBlock(node); + } function isModuleReference(node) { var kind = node.kind; return kind === 248 @@ -9540,6 +10569,16 @@ var ts; })(ts || (ts = {})); var ts; (function (ts) { + var SignatureFlags; + (function (SignatureFlags) { + SignatureFlags[SignatureFlags["None"] = 0] = "None"; + SignatureFlags[SignatureFlags["Yield"] = 1] = "Yield"; + SignatureFlags[SignatureFlags["Await"] = 2] = "Await"; + SignatureFlags[SignatureFlags["Type"] = 4] = "Type"; + SignatureFlags[SignatureFlags["RequireCompleteParameterList"] = 8] = "RequireCompleteParameterList"; + SignatureFlags[SignatureFlags["IgnoreMissingOpenBrace"] = 16] = "IgnoreMissingOpenBrace"; + SignatureFlags[SignatureFlags["JSDoc"] = 32] = "JSDoc"; + })(SignatureFlags || (SignatureFlags = {})); var NodeConstructor; var TokenConstructor; var IdentifierConstructor; @@ -11377,11 +12416,31 @@ var ts; var node = parseTokenNode(); return token() === 23 ? undefined : node; } - function parseLiteralTypeNode() { + function parseLiteralTypeNode(negative) { var node = createNode(173); - node.literal = parseSimpleUnaryExpression(); - finishNode(node); - return node; + var unaryMinusExpression; + if (negative) { + unaryMinusExpression = createNode(192); + unaryMinusExpression.operator = 38; + nextToken(); + } + var expression; + switch (token()) { + case 9: + case 8: + expression = parseLiteralLikeNode(token()); + break; + case 101: + case 86: + expression = parseTokenNode(); + } + if (negative) { + unaryMinusExpression.operand = expression; + finishNode(unaryMinusExpression); + expression = unaryMinusExpression; + } + node.literal = expression; + return finishNode(node); } function nextTokenIsNumericLiteral() { return nextToken() === 8; @@ -11413,7 +12472,7 @@ var ts; case 86: return parseLiteralTypeNode(); case 38: - return lookAhead(nextTokenIsNumericLiteral) ? parseLiteralTypeNode() : parseTypeReference(); + return lookAhead(nextTokenIsNumericLiteral) ? parseLiteralTypeNode(true) : parseTypeReference(); case 105: case 95: return parseTokenNode(); @@ -11462,6 +12521,7 @@ var ts; case 101: case 86: case 134: + case 39: return true; case 38: return lookAhead(nextTokenIsNumericLiteral); @@ -11780,7 +12840,7 @@ var ts; if (!arrowFunction) { return undefined; } - var isAsync = !!(ts.getModifierFlags(arrowFunction) & 256); + var isAsync = ts.hasModifier(arrowFunction, 256); var lastToken = token(); arrowFunction.equalsGreaterThanToken = parseExpectedToken(36, false, ts.Diagnostics._0_expected, "=>"); arrowFunction.body = (lastToken === 36 || lastToken === 17) @@ -11896,7 +12956,7 @@ var ts; function parseParenthesizedArrowFunctionExpressionHead(allowAmbiguity) { var node = createNode(187); node.modifiers = parseModifiersForArrowFunction(); - var isAsync = (ts.getModifierFlags(node) & 256) ? 2 : 0; + var isAsync = ts.hasModifier(node, 256) ? 2 : 0; fillSignature(56, isAsync | (allowAmbiguity ? 0 : 8), node); if (!node.parameters) { return undefined; @@ -12629,7 +13689,7 @@ var ts; parseExpected(89); node.asteriskToken = parseOptionalToken(39); var isGenerator = node.asteriskToken ? 1 : 0; - var isAsync = (ts.getModifierFlags(node) & 256) ? 2 : 0; + var isAsync = ts.hasModifier(node, 256) ? 2 : 0; node.name = isGenerator && isAsync ? doInYieldAndAwaitContext(parseOptionalIdentifier) : isGenerator ? doInYieldContext(parseOptionalIdentifier) : @@ -12854,10 +13914,13 @@ var ts; function parseCatchClause() { var result = createNode(260); parseExpected(74); - if (parseExpected(19)) { + if (parseOptional(19)) { result.variableDeclaration = parseVariableDeclaration(); + parseExpected(20); + } + else { + result.variableDeclaration = undefined; } - parseExpected(20); result.block = parseBlock(false); return finishNode(result); } @@ -13861,6 +14924,39 @@ var ts; : undefined; }); } + var ParsingContext; + (function (ParsingContext) { + ParsingContext[ParsingContext["SourceElements"] = 0] = "SourceElements"; + ParsingContext[ParsingContext["BlockStatements"] = 1] = "BlockStatements"; + ParsingContext[ParsingContext["SwitchClauses"] = 2] = "SwitchClauses"; + ParsingContext[ParsingContext["SwitchClauseStatements"] = 3] = "SwitchClauseStatements"; + ParsingContext[ParsingContext["TypeMembers"] = 4] = "TypeMembers"; + ParsingContext[ParsingContext["ClassMembers"] = 5] = "ClassMembers"; + ParsingContext[ParsingContext["EnumMembers"] = 6] = "EnumMembers"; + ParsingContext[ParsingContext["HeritageClauseElement"] = 7] = "HeritageClauseElement"; + ParsingContext[ParsingContext["VariableDeclarations"] = 8] = "VariableDeclarations"; + ParsingContext[ParsingContext["ObjectBindingElements"] = 9] = "ObjectBindingElements"; + ParsingContext[ParsingContext["ArrayBindingElements"] = 10] = "ArrayBindingElements"; + ParsingContext[ParsingContext["ArgumentExpressions"] = 11] = "ArgumentExpressions"; + ParsingContext[ParsingContext["ObjectLiteralMembers"] = 12] = "ObjectLiteralMembers"; + ParsingContext[ParsingContext["JsxAttributes"] = 13] = "JsxAttributes"; + ParsingContext[ParsingContext["JsxChildren"] = 14] = "JsxChildren"; + ParsingContext[ParsingContext["ArrayLiteralMembers"] = 15] = "ArrayLiteralMembers"; + ParsingContext[ParsingContext["Parameters"] = 16] = "Parameters"; + ParsingContext[ParsingContext["RestProperties"] = 17] = "RestProperties"; + ParsingContext[ParsingContext["TypeParameters"] = 18] = "TypeParameters"; + ParsingContext[ParsingContext["TypeArguments"] = 19] = "TypeArguments"; + ParsingContext[ParsingContext["TupleElementTypes"] = 20] = "TupleElementTypes"; + ParsingContext[ParsingContext["HeritageClauses"] = 21] = "HeritageClauses"; + ParsingContext[ParsingContext["ImportOrExportSpecifiers"] = 22] = "ImportOrExportSpecifiers"; + ParsingContext[ParsingContext["Count"] = 23] = "Count"; + })(ParsingContext || (ParsingContext = {})); + var Tristate; + (function (Tristate) { + Tristate[Tristate["False"] = 0] = "False"; + Tristate[Tristate["True"] = 1] = "True"; + Tristate[Tristate["Unknown"] = 2] = "Unknown"; + })(Tristate || (Tristate = {})); var JSDocParser; (function (JSDocParser) { function parseJSDocTypeExpressionForTests(content, start, length) { @@ -13913,6 +15009,17 @@ var ts; var _a; } JSDocParser.parseJSDocComment = parseJSDocComment; + var JSDocState; + (function (JSDocState) { + JSDocState[JSDocState["BeginningOfLine"] = 0] = "BeginningOfLine"; + JSDocState[JSDocState["SawAsterisk"] = 1] = "SawAsterisk"; + JSDocState[JSDocState["SavingComments"] = 2] = "SavingComments"; + })(JSDocState || (JSDocState = {})); + var PropertyLikeParse; + (function (PropertyLikeParse) { + PropertyLikeParse[PropertyLikeParse["Property"] = 0] = "Property"; + PropertyLikeParse[PropertyLikeParse["Parameter"] = 1] = "Parameter"; + })(PropertyLikeParse || (PropertyLikeParse = {})); function parseJSDocCommentWorker(start, length) { var content = sourceText; start = start || 0; @@ -14545,8 +15652,8 @@ var ts; array._children = undefined; array.pos += delta; array.end += delta; - for (var _i = 0, array_9 = array; _i < array_9.length; _i++) { - var node = array_9[_i]; + for (var _i = 0, array_8 = array; _i < array_8.length; _i++) { + var node = array_8[_i]; visitNode(node); } } @@ -14618,8 +15725,8 @@ var ts; array.intersectsChange = true; array._children = undefined; adjustIntersectingElement(array, changeStart, changeRangeOldEnd, changeRangeNewEnd, delta); - for (var _i = 0, array_10 = array; _i < array_10.length; _i++) { - var node = array_10[_i]; + for (var _i = 0, array_9 = array; _i < array_9.length; _i++) { + var node = array_9[_i]; visitNode(node); } return; @@ -14767,6 +15874,10 @@ var ts; } } } + var InvalidPosition; + (function (InvalidPosition) { + InvalidPosition[InvalidPosition["Value"] = -1] = "Value"; + })(InvalidPosition || (InvalidPosition = {})); })(IncrementalParser || (IncrementalParser = {})); })(ts || (ts = {})); var ts; @@ -15131,6 +16242,12 @@ var ts; category: ts.Diagnostics.Module_Resolution_Options, description: ts.Diagnostics.Allow_default_imports_from_modules_with_no_default_export_This_does_not_affect_code_emit_just_typechecking }, + { + name: "preserveSymlinks", + type: "boolean", + category: ts.Diagnostics.Module_Resolution_Options, + description: ts.Diagnostics.Do_not_resolve_the_real_path_of_symlinks, + }, { name: "sourceRoot", type: "string", @@ -15742,7 +16859,7 @@ var ts; var text = valueExpression.text; if (option && typeof option.type !== "string") { var customOption = option; - if (!customOption.type.has(text)) { + if (!customOption.type.has(text.toLowerCase())) { errors.push(createDiagnosticForInvalidCustomType(customOption, function (message, arg0, arg1) { return ts.createDiagnosticForNodeInSourceFile(sourceFile, valueExpression, message, arg0, arg1); })); } } @@ -15993,12 +17110,10 @@ var ts; } } else { - var specs = includeSpecs ? [] : ["node_modules", "bower_components", "jspm_packages"]; var outDir = raw["compilerOptions"] && raw["compilerOptions"]["outDir"]; if (outDir) { - specs.push(outDir); + excludeSpecs = [outDir]; } - excludeSpecs = specs; } if (fileNames === undefined && includeSpecs === undefined) { includeSpecs = ["**/*"]; @@ -16249,7 +17364,7 @@ var ts; return value; } else if (typeof option.type !== "string") { - return option.type.get(value); + return option.type.get(typeof value === "string" ? value.toLowerCase() : value); } return normalizeNonListOptionValue(option, basePath, value); } @@ -16324,23 +17439,13 @@ var ts; }; } function validateSpecs(specs, errors, allowTrailingRecursion, jsonSourceFile, specKey) { - var validSpecs = []; - for (var _i = 0, specs_1 = specs; _i < specs_1.length; _i++) { - var spec = specs_1[_i]; - if (!allowTrailingRecursion && invalidTrailingRecursionPattern.test(spec)) { - errors.push(createDiagnostic(ts.Diagnostics.File_specification_cannot_end_in_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0, spec)); - } - else if (invalidMultipleRecursionPatterns.test(spec)) { - errors.push(createDiagnostic(ts.Diagnostics.File_specification_cannot_contain_multiple_recursive_directory_wildcards_Asterisk_Asterisk_Colon_0, spec)); - } - else if (invalidDotDotAfterRecursiveWildcardPattern.test(spec)) { - errors.push(createDiagnostic(ts.Diagnostics.File_specification_cannot_contain_a_parent_directory_that_appears_after_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0, spec)); - } - else { - validSpecs.push(spec); + return specs.filter(function (spec) { + var diag = specToDiagnostic(spec, allowTrailingRecursion); + if (diag !== undefined) { + errors.push(createDiagnostic(diag, spec)); } - } - return validSpecs; + return diag === undefined; + }); function createDiagnostic(message, spec) { if (jsonSourceFile && jsonSourceFile.jsonObject) { for (var _i = 0, _a = ts.getPropertyAssignment(jsonSourceFile.jsonObject, specKey); _i < _a.length; _i++) { @@ -16358,6 +17463,17 @@ var ts; return ts.createCompilerDiagnostic(message, spec); } } + function specToDiagnostic(spec, allowTrailingRecursion) { + if (!allowTrailingRecursion && invalidTrailingRecursionPattern.test(spec)) { + return ts.Diagnostics.File_specification_cannot_end_in_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0; + } + else if (invalidMultipleRecursionPatterns.test(spec)) { + return ts.Diagnostics.File_specification_cannot_contain_multiple_recursive_directory_wildcards_Asterisk_Asterisk_Colon_0; + } + else if (invalidDotDotAfterRecursiveWildcardPattern.test(spec)) { + return ts.Diagnostics.File_specification_cannot_contain_a_parent_directory_that_appears_after_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0; + } + } function getWildcardDirectories(include, exclude, path, useCaseSensitiveFileNames) { var rawExcludeRegex = ts.getRegularExpressionForWildcard(exclude, path, "exclude"); var excludeRegex = rawExcludeRegex && new RegExp(rawExcludeRegex, useCaseSensitiveFileNames ? "" : "i"); @@ -16482,12 +17598,20 @@ var ts; "crypto", "stream", "util", "assert", "tty", "domain", "constants", "process", "v8", "timers", "console" ]; - var nodeCoreModules = ts.arrayToMap(JsTyping.nodeCoreModuleList, function (x) { return x; }); + var nodeCoreModules = ts.arrayToSet(JsTyping.nodeCoreModuleList); function loadSafeList(host, safeListPath) { var result = ts.readConfigFile(safeListPath, function (path) { return host.readFile(path); }); return ts.createMapFromTemplate(result.config); } JsTyping.loadSafeList = loadSafeList; + function loadTypesMap(host, typesMapPath) { + var result = ts.readConfigFile(typesMapPath, function (path) { return host.readFile(path); }); + if (result.config) { + return ts.createMapFromTemplate(result.config.simpleMap); + } + return undefined; + } + JsTyping.loadTypesMap = loadTypesMap; function discoverTypings(host, log, fileNames, projectRootPath, safeList, packageNameToTypingLocation, typeAcquisition, unresolvedImports) { if (!typeAcquisition || !typeAcquisition.enable) { return { cachedTypingPaths: [], newTypingNames: [], filesToWatch: [] }; @@ -16639,6 +17763,7 @@ var ts; Arguments.LogFile = "--logFile"; Arguments.EnableTelemetry = "--enableTelemetry"; Arguments.TypingSafeListLocation = "--typingSafeListLocation"; + Arguments.TypesMapLocation = "--typesMapLocation"; Arguments.NpmLocation = "--npmLocation"; })(Arguments = server.Arguments || (server.Arguments = {})); function hasArgument(argumentName) { @@ -16664,6 +17789,12 @@ var ts; return compilerOptions.traceResolution && host.trace !== undefined; } ts.isTraceEnabled = isTraceEnabled; + function withPackageId(packageId, r) { + return r && { path: r.path, extension: r.ext, packageId: packageId }; + } + function noPackageId(r) { + return withPackageId(undefined, r); + } var Extensions; (function (Extensions) { Extensions[Extensions["TypeScript"] = 0] = "TypeScript"; @@ -16679,12 +17810,11 @@ var ts; } function createResolvedModuleWithFailedLookupLocations(resolved, isExternalLibraryImport, failedLookupLocations) { return { - resolvedModule: resolved && { resolvedFileName: resolved.path, extension: resolved.extension, isExternalLibraryImport: isExternalLibraryImport }, + resolvedModule: resolved && { resolvedFileName: resolved.path, extension: resolved.extension, isExternalLibraryImport: isExternalLibraryImport, packageId: resolved.packageId }, failedLookupLocations: failedLookupLocations }; } - function tryReadPackageJsonFields(readTypes, packageJsonPath, baseDirectory, state) { - var jsonContent = readJson(packageJsonPath, state.host); + function tryReadPackageJsonFields(readTypes, jsonContent, baseDirectory, state) { return readTypes ? tryReadFromField("typings") || tryReadFromField("types") : tryReadFromField("main"); function tryReadFromField(fieldName) { if (!ts.hasProperty(jsonContent, fieldName)) { @@ -16778,7 +17908,9 @@ var ts; } var resolvedTypeReferenceDirective; if (resolved) { - resolved = realpath(resolved, host, traceEnabled); + if (!options.preserveSymlinks) { + resolved = realPath(resolved, host, traceEnabled); + } if (traceEnabled) { trace(host, ts.Diagnostics.Type_reference_directive_0_was_successfully_resolved_to_1_primary_Colon_2, typeReferenceDirectiveName, resolved, primary); } @@ -17079,7 +18211,7 @@ var ts; if (extension !== undefined) { var path_1 = tryFile(candidate, failedLookupLocations, false, state); if (path_1 !== undefined) { - return { path: path_1, extension: extension }; + return { path: path_1, extension: extension, packageId: undefined }; } } return loader(extensions, candidate, failedLookupLocations, !directoryProbablyExists(ts.getDirectoryPath(candidate), state.host), state); @@ -17100,7 +18232,7 @@ var ts; function resolveJavaScriptModule(moduleName, initialDir, host) { var _a = nodeModuleNameResolverWorker(moduleName, initialDir, { moduleResolution: ts.ModuleResolutionKind.NodeJs, allowJs: true }, host, undefined, true), resolvedModule = _a.resolvedModule, failedLookupLocations = _a.failedLookupLocations; if (!resolvedModule) { - throw new Error("Could not resolve JS module " + moduleName + " starting at " + initialDir + ". Looked in: " + failedLookupLocations.join(", ")); + throw new Error("Could not resolve JS module '" + moduleName + "' starting at '" + initialDir + "'. Looked in: " + failedLookupLocations.join(", ")); } return resolvedModule.resolvedFileName; } @@ -17126,16 +18258,22 @@ var ts; trace(host, ts.Diagnostics.Loading_module_0_from_node_modules_folder_target_file_type_1, moduleName, Extensions[extensions]); } var resolved_1 = loadModuleFromNodeModules(extensions, moduleName, containingDirectory, failedLookupLocations, state, cache); - return resolved_1 && { value: resolved_1.value && { resolved: { path: realpath(resolved_1.value.path, host, traceEnabled), extension: resolved_1.value.extension }, isExternalLibraryImport: true } }; + if (!resolved_1) + return undefined; + var resolvedValue = resolved_1.value; + if (!compilerOptions.preserveSymlinks) { + resolvedValue = resolvedValue && __assign({}, resolved_1.value, { path: realPath(resolved_1.value.path, host, traceEnabled), extension: resolved_1.value.extension }); + } + return { value: resolvedValue && { resolved: resolvedValue, isExternalLibraryImport: true } }; } else { - var candidate = ts.normalizePath(ts.combinePaths(containingDirectory, moduleName)); + var _a = ts.normalizePathAndParts(ts.combinePaths(containingDirectory, moduleName)), candidate = _a.path, parts = _a.parts; var resolved_2 = nodeLoadModuleByRelativeName(extensions, candidate, failedLookupLocations, false, state, true); - return resolved_2 && toSearchResult({ resolved: resolved_2, isExternalLibraryImport: false }); + return resolved_2 && toSearchResult({ resolved: resolved_2, isExternalLibraryImport: ts.contains(parts, "node_modules") }); } } } - function realpath(path, host, traceEnabled) { + function realPath(path, host, traceEnabled) { if (!host.realpath) { return path; } @@ -17161,7 +18299,7 @@ var ts; } var resolvedFromFile = loadModuleFromFile(extensions, candidate, failedLookupLocations, onlyRecordFailures, state); if (resolvedFromFile) { - return resolvedFromFile; + return noPackageId(resolvedFromFile); } } if (!onlyRecordFailures) { @@ -17179,6 +18317,9 @@ var ts; return !host.directoryExists || host.directoryExists(directoryName); } ts.directoryProbablyExists = directoryProbablyExists; + function loadModuleFromFileNoPackageId(extensions, candidate, failedLookupLocations, onlyRecordFailures, state) { + return noPackageId(loadModuleFromFile(extensions, candidate, failedLookupLocations, onlyRecordFailures, state)); + } function loadModuleFromFile(extensions, candidate, failedLookupLocations, onlyRecordFailures, state) { var resolvedByAddingExtension = tryAddingExtensions(candidate, extensions, failedLookupLocations, onlyRecordFailures, state); if (resolvedByAddingExtension) { @@ -17208,9 +18349,9 @@ var ts; case Extensions.JavaScript: return tryExtension(".js") || tryExtension(".jsx"); } - function tryExtension(extension) { - var path = tryFile(candidate + extension, failedLookupLocations, onlyRecordFailures, state); - return path && { path: path, extension: extension }; + function tryExtension(ext) { + var path = tryFile(candidate + ext, failedLookupLocations, onlyRecordFailures, state); + return path && { path: path, ext: ext }; } } function tryFile(fileName, failedLookupLocations, onlyRecordFailures, state) { @@ -17233,12 +18374,20 @@ var ts; function loadNodeModuleFromDirectory(extensions, candidate, failedLookupLocations, onlyRecordFailures, state, considerPackageJson) { if (considerPackageJson === void 0) { considerPackageJson = true; } var directoryExists = !onlyRecordFailures && directoryProbablyExists(candidate, state.host); + var packageId; if (considerPackageJson) { var packageJsonPath = pathToPackageJson(candidate); if (directoryExists && state.host.fileExists(packageJsonPath)) { - var fromPackageJson = loadModuleFromPackageJson(packageJsonPath, extensions, candidate, failedLookupLocations, state); + if (state.traceEnabled) { + trace(state.host, ts.Diagnostics.Found_package_json_at_0, packageJsonPath); + } + var jsonContent = readJson(packageJsonPath, state.host); + if (typeof jsonContent.name === "string" && typeof jsonContent.version === "string") { + packageId = { name: jsonContent.name, version: jsonContent.version }; + } + var fromPackageJson = loadModuleFromPackageJson(jsonContent, extensions, candidate, failedLookupLocations, state); if (fromPackageJson) { - return fromPackageJson; + return withPackageId(packageId, fromPackageJson); } } else { @@ -17248,13 +18397,10 @@ var ts; failedLookupLocations.push(packageJsonPath); } } - return loadModuleFromFile(extensions, ts.combinePaths(candidate, "index"), failedLookupLocations, !directoryExists, state); + return withPackageId(packageId, loadModuleFromFile(extensions, ts.combinePaths(candidate, "index"), failedLookupLocations, !directoryExists, state)); } - function loadModuleFromPackageJson(packageJsonPath, extensions, candidate, failedLookupLocations, state) { - if (state.traceEnabled) { - trace(state.host, ts.Diagnostics.Found_package_json_at_0, packageJsonPath); - } - var file = tryReadPackageJsonFields(extensions !== Extensions.JavaScript, packageJsonPath, candidate, state); + function loadModuleFromPackageJson(jsonContent, extensions, candidate, failedLookupLocations, state) { + var file = tryReadPackageJsonFields(extensions !== Extensions.JavaScript, jsonContent, candidate, state); if (!file) { return undefined; } @@ -17270,11 +18416,15 @@ var ts; } } var nextExtensions = extensions === Extensions.DtsOnly ? Extensions.TypeScript : extensions; - return nodeLoadModuleByRelativeName(nextExtensions, file, failedLookupLocations, onlyRecordFailures, state, false); + var result = nodeLoadModuleByRelativeName(nextExtensions, file, failedLookupLocations, onlyRecordFailures, state, false); + if (result) { + ts.Debug.assert(result.packageId === undefined); + return { path: result.path, ext: result.extension }; + } } function resolvedIfExtensionMatches(extensions, path) { - var extension = ts.tryGetExtensionFromPath(path); - return extension !== undefined && extensionIsOk(extensions, extension) ? { path: path, extension: extension } : undefined; + var ext = ts.tryGetExtensionFromPath(path); + return ext !== undefined && extensionIsOk(extensions, ext) ? { path: path, ext: ext } : undefined; } function extensionIsOk(extensions, extension) { switch (extensions) { @@ -17291,7 +18441,7 @@ var ts; } function loadModuleFromNodeModulesFolder(extensions, moduleName, nodeModulesFolder, nodeModulesFolderExists, failedLookupLocations, state) { var candidate = ts.normalizePath(ts.combinePaths(nodeModulesFolder, moduleName)); - return loadModuleFromFile(extensions, candidate, failedLookupLocations, !nodeModulesFolderExists, state) || + return loadModuleFromFileNoPackageId(extensions, candidate, failedLookupLocations, !nodeModulesFolderExists, state) || loadNodeModuleFromDirectory(extensions, candidate, failedLookupLocations, !nodeModulesFolderExists, state); } function loadModuleFromNodeModules(extensions, moduleName, directory, failedLookupLocations, state, cache) { @@ -17365,7 +18515,7 @@ var ts; if (traceEnabled) { trace(host, ts.Diagnostics.Resolution_for_module_0_was_found_in_cache, moduleName); } - return { value: result.resolvedModule && { path: result.resolvedModule.resolvedFileName, extension: result.resolvedModule.extension } }; + return { value: result.resolvedModule && { path: result.resolvedModule.resolvedFileName, extension: result.resolvedModule.extension, packageId: result.resolvedModule.packageId } }; } } function classicNameResolver(moduleName, containingFile, compilerOptions, host, cache) { @@ -17376,7 +18526,7 @@ var ts; var resolved = tryResolve(Extensions.TypeScript) || tryResolve(Extensions.JavaScript); return createResolvedModuleWithFailedLookupLocations(resolved && resolved.value, false, failedLookupLocations); function tryResolve(extensions) { - var resolvedUsingSettings = tryLoadModuleUsingOptionalResolutionSettings(extensions, moduleName, containingDirectory, loadModuleFromFile, failedLookupLocations, state); + var resolvedUsingSettings = tryLoadModuleUsingOptionalResolutionSettings(extensions, moduleName, containingDirectory, loadModuleFromFileNoPackageId, failedLookupLocations, state); if (resolvedUsingSettings) { return { value: resolvedUsingSettings }; } @@ -17388,7 +18538,7 @@ var ts; return resolutionFromCache; } var searchName = ts.normalizePath(ts.combinePaths(directory, moduleName)); - return toSearchResult(loadModuleFromFile(extensions, searchName, failedLookupLocations, false, state)); + return toSearchResult(loadModuleFromFileNoPackageId(extensions, searchName, failedLookupLocations, false, state)); }); if (resolved_3) { return resolved_3; @@ -17399,7 +18549,7 @@ var ts; } else { var candidate = ts.normalizePath(ts.combinePaths(containingDirectory, moduleName)); - return toSearchResult(loadModuleFromFile(extensions, candidate, failedLookupLocations, false, state)); + return toSearchResult(loadModuleFromFileNoPackageId(extensions, candidate, failedLookupLocations, false, state)); } } } @@ -17488,11 +18638,12 @@ var ts; } typingsInstaller.validatePackageName = validatePackageName; var TypingsInstaller = (function () { - function TypingsInstaller(installTypingHost, globalCachePath, safeListPath, throttleLimit, log) { + function TypingsInstaller(installTypingHost, globalCachePath, safeListPath, typesMapLocation, throttleLimit, log) { if (log === void 0) { log = nullLog; } this.installTypingHost = installTypingHost; this.globalCachePath = globalCachePath; this.safeListPath = safeListPath; + this.typesMapLocation = typesMapLocation; this.throttleLimit = throttleLimit; this.log = log; this.packageNameToTypingLocation = ts.createMap(); @@ -17503,7 +18654,7 @@ var ts; this.installRunCount = 1; this.inFlightRequestCount = 0; if (this.log.isEnabled()) { - this.log.writeLine("Global cache location '" + globalCachePath + "', safe file path '" + safeListPath + "'"); + this.log.writeLine("Global cache location '" + globalCachePath + "', safe file path '" + safeListPath + "', types map path " + typesMapLocation); } this.processCacheLocation(this.globalCachePath); } @@ -17531,6 +18682,7 @@ var ts; } }; TypingsInstaller.prototype.install = function (req) { + var _this = this; if (this.log.isEnabled()) { this.log.writeLine("Got install request " + JSON.stringify(req)); } @@ -17541,9 +18693,9 @@ var ts; this.processCacheLocation(req.cachePath); } if (this.safeList === undefined) { - this.safeList = ts.JsTyping.loadSafeList(this.installTypingHost, this.safeListPath); + this.initializeSafeList(); } - var discoverTypingsResult = ts.JsTyping.discoverTypings(this.installTypingHost, this.log.isEnabled() ? this.log.writeLine : undefined, req.fileNames, req.projectRootPath, this.safeList, this.packageNameToTypingLocation, req.typeAcquisition, req.unresolvedImports); + var discoverTypingsResult = ts.JsTyping.discoverTypings(this.installTypingHost, this.log.isEnabled() ? (function (s) { return _this.log.writeLine(s); }) : undefined, req.fileNames, req.projectRootPath, this.safeList, this.packageNameToTypingLocation, req.typeAcquisition, req.unresolvedImports); if (this.log.isEnabled()) { this.log.writeLine("Finished typings discovery: " + JSON.stringify(discoverTypingsResult)); } @@ -17558,6 +18710,18 @@ var ts; } } }; + TypingsInstaller.prototype.initializeSafeList = function () { + if (this.typesMapLocation) { + var safeListFromMap = ts.JsTyping.loadTypesMap(this.installTypingHost, this.typesMapLocation); + if (safeListFromMap) { + this.log.writeLine("Loaded safelist from types map file '" + this.typesMapLocation + "'"); + this.safeList = safeListFromMap; + return; + } + this.log.writeLine("Failed to load safelist from types map file '" + this.typesMapLocation + "'"); + } + this.safeList = ts.JsTyping.loadSafeList(this.installTypingHost, this.safeListPath); + }; TypingsInstaller.prototype.processCacheLocation = function (cacheLocation) { if (this.log.isEnabled()) { this.log.writeLine("Processing cache location '" + cacheLocation + "'"); @@ -17727,14 +18891,15 @@ var ts; _this.sendResponse(_this.createSetTypings(req, currentlyCachedTypings.concat(installedTypingFiles))); } finally { - _this.sendResponse({ + var response = { kind: server.EventEndInstallTypes, eventId: requestId, projectName: req.projectName, packagesToInstall: scopedTypings, installSuccess: ok, typingsInstallerVersion: ts.version - }); + }; + _this.sendResponse(response); } }); }; @@ -17820,20 +18985,21 @@ var ts; var path = require("path"); var FileLog = (function () { function FileLog(logFile) { + var _this = this; this.logFile = logFile; this.logEnabled = true; + this.isEnabled = function () { + return _this.logEnabled && _this.logFile !== undefined; + }; + this.writeLine = function (text) { + try { + fs.appendFileSync(_this.logFile, text + ts.sys.newLine); + } + catch (e) { + _this.logEnabled = false; + } + }; } - FileLog.prototype.isEnabled = function () { - return this.logEnabled && this.logFile !== undefined; - }; - FileLog.prototype.writeLine = function (text) { - try { - fs.appendFileSync(this.logFile, text + ts.sys.newLine); - } - catch (e) { - this.logEnabled = false; - } - }; return FileLog; }()); function getDefaultNPMLocation(processName) { @@ -17868,8 +19034,8 @@ var ts; } var NodeTypingsInstaller = (function (_super) { __extends(NodeTypingsInstaller, _super); - function NodeTypingsInstaller(globalTypingsCacheLocation, typingSafeListLocation, npmLocation, throttleLimit, log) { - var _this = _super.call(this, ts.sys, globalTypingsCacheLocation, typingSafeListLocation ? ts.toPath(typingSafeListLocation, "", ts.createGetCanonicalFileName(ts.sys.useCaseSensitiveFileNames)) : ts.toPath("typingSafeList.json", __dirname, ts.createGetCanonicalFileName(ts.sys.useCaseSensitiveFileNames)), throttleLimit, log) || this; + function NodeTypingsInstaller(globalTypingsCacheLocation, typingSafeListLocation, typesMapLocation, npmLocation, throttleLimit, log) { + var _this = _super.call(this, ts.sys, globalTypingsCacheLocation, typingSafeListLocation ? ts.toPath(typingSafeListLocation, "", ts.createGetCanonicalFileName(ts.sys.useCaseSensitiveFileNames)) : ts.toPath("typingSafeList.json", __dirname, ts.createGetCanonicalFileName(ts.sys.useCaseSensitiveFileNames)), typesMapLocation ? ts.toPath(typesMapLocation, "", ts.createGetCanonicalFileName(ts.sys.useCaseSensitiveFileNames)) : ts.toPath("typesMap.json", __dirname, ts.createGetCanonicalFileName(ts.sys.useCaseSensitiveFileNames)), throttleLimit, log) || this; _this.npmPath = npmLocation !== undefined ? npmLocation : getDefaultNPMLocation(process.argv[0]); if (_this.npmPath.indexOf(" ") !== -1 && _this.npmPath[0] !== "\"") { _this.npmPath = "\"" + _this.npmPath + "\""; @@ -17884,7 +19050,7 @@ var ts; if (_this.log.isEnabled()) { _this.log.writeLine("Updating " + TypesRegistryPackageName + " npm package..."); } - _this.execSync(_this.npmPath + " install " + TypesRegistryPackageName, { cwd: globalTypingsCacheLocation, stdio: "ignore" }); + _this.execSync(_this.npmPath + " install --ignore-scripts " + TypesRegistryPackageName, { cwd: globalTypingsCacheLocation, stdio: "ignore" }); if (_this.log.isEnabled()) { _this.log.writeLine("Updated " + TypesRegistryPackageName + " npm package"); } @@ -17930,7 +19096,7 @@ var ts; if (this.log.isEnabled()) { this.log.writeLine("#" + requestId + " with arguments'" + JSON.stringify(args) + "'."); } - var command = this.npmPath + " install " + args.join(" ") + " --save-dev --user-agent=\"typesInstaller/" + ts.version + "\""; + var command = this.npmPath + " install --ignore-scripts " + args.join(" ") + " --save-dev --user-agent=\"typesInstaller/" + ts.version + "\""; var start = Date.now(); var stdout; var stderr; @@ -17954,6 +19120,7 @@ var ts; var logFilePath = server.findArgument(server.Arguments.LogFile); var globalTypingsCacheLocation = server.findArgument(server.Arguments.GlobalCacheLocation); var typingSafeListLocation = server.findArgument(server.Arguments.TypingSafeListLocation); + var typesMapLocation = server.findArgument(server.Arguments.TypesMapLocation); var npmLocation = server.findArgument(server.Arguments.NpmLocation); var log = new FileLog(logFilePath); if (log.isEnabled()) { @@ -17967,8 +19134,10 @@ var ts; } process.exit(0); }); - var installer = new NodeTypingsInstaller(globalTypingsCacheLocation, typingSafeListLocation, npmLocation, 5, log); + var installer = new NodeTypingsInstaller(globalTypingsCacheLocation, typingSafeListLocation, typesMapLocation, npmLocation, 5, log); installer.listen(); })(typingsInstaller = server.typingsInstaller || (server.typingsInstaller = {})); })(server = ts.server || (ts.server = {})); })(ts || (ts = {})); + +//# sourceMappingURL=typingsInstaller.js.map From 2fede097f30a8f893384ec60a72c70e0f32c163a Mon Sep 17 00:00:00 2001 From: Andy Date: Thu, 24 Aug 2017 08:03:05 -0700 Subject: [PATCH 226/237] Add helper functions for adding an item to an array only if it's not already contained (#17833) * Add helper functions for adding an item to an array only if it's not already contained * One more use of appendIfUnique --- src/compiler/checker.ts | 65 +++++++++-------------------------------- src/compiler/core.ts | 26 +++++++++++++++++ src/compiler/factory.ts | 8 ++--- 3 files changed, 42 insertions(+), 57 deletions(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 82f41bc31e64c..4a07f349c9a89 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -1881,10 +1881,9 @@ namespace ts { // The ES6 spec permits export * declarations in a module to circularly reference the module itself. For example, // module 'a' can 'export * from "b"' and 'b' can 'export * from "a"' without error. function visit(symbol: Symbol): SymbolTable { - if (!(symbol && symbol.flags & SymbolFlags.HasExports && !contains(visitedSymbols, symbol))) { + if (!(symbol && symbol.flags & SymbolFlags.HasExports && pushIfUnique(visitedSymbols, symbol))) { return; } - visitedSymbols.push(symbol); const symbols = cloneMap(symbol.exports); // All export * declarations are collected in an __export symbol by the binder const exportStars = symbol.exports.get(InternalSymbolName.ExportStar); @@ -2060,10 +2059,10 @@ namespace ts { } function getAccessibleSymbolChainFromSymbolTableWorker(symbols: SymbolTable, visitedSymbolTables: SymbolTable[]): Symbol[] { - if (contains(visitedSymbolTables, symbols)) { + if (!pushIfUnique(visitedSymbolTables, symbols)) { return undefined; } - visitedSymbolTables.push(symbols); + const result = trySymbolTable(symbols); visitedSymbolTables.pop(); return result; @@ -2276,14 +2275,7 @@ namespace ts { // since we will do the emitting later in trackSymbol. if (shouldComputeAliasToMakeVisible) { getNodeLinks(declaration).isVisible = true; - if (aliasesToMakeVisible) { - if (!contains(aliasesToMakeVisible, anyImportSyntax)) { - aliasesToMakeVisible.push(anyImportSyntax); - } - } - else { - aliasesToMakeVisible = [anyImportSyntax]; - } + aliasesToMakeVisible = appendIfUnique(aliasesToMakeVisible, anyImportSyntax); } return true; } @@ -3981,9 +3973,7 @@ namespace ts { forEach(declarations, declaration => { getNodeLinks(declaration).isVisible = true; const resultNode = getAnyImportSyntax(declaration) || declaration; - if (!contains(result, resultNode)) { - result.push(resultNode); - } + pushIfUnique(result, resultNode); if (isInternalModuleImportEqualsDeclaration(declaration)) { // Add the referenced top container visible @@ -4793,12 +4783,7 @@ namespace ts { function appendTypeParameters(typeParameters: TypeParameter[], declarations: ReadonlyArray): TypeParameter[] { for (const declaration of declarations) { const tp = getDeclaredTypeOfTypeParameter(getSymbolOfNode(declaration)); - if (!typeParameters) { - typeParameters = [tp]; - } - else if (!contains(typeParameters, tp)) { - typeParameters.push(tp); - } + typeParameters = appendIfUnique(typeParameters, tp); } return typeParameters; } @@ -5521,9 +5506,7 @@ namespace ts { if (!match) { return undefined; } - if (!contains(result, match)) { - (result || (result = [])).push(match); - } + result = appendIfUnique(result, match); } return result; } @@ -6073,12 +6056,7 @@ namespace ts { const modifiers = prop ? getDeclarationModifierFlagsFromSymbol(prop) : 0; if (prop && !(modifiers & excludeModifiers)) { commonFlags &= prop.flags; - if (!props) { - props = [prop]; - } - else if (!contains(props, prop)) { - props.push(prop); - } + props = appendIfUnique(props, prop); checkFlags |= (isReadonlySymbol(prop) ? CheckFlags.Readonly : 0) | (!(modifiers & ModifierFlags.NonPublicAccessibilityModifier) ? CheckFlags.ContainsPublic : 0) | (modifiers & ModifierFlags.Protected ? CheckFlags.ContainsProtected : 0) | @@ -6237,12 +6215,7 @@ namespace ts { let result: TypeParameter[]; forEach(getEffectiveTypeParameterDeclarations(declaration), node => { const tp = getDeclaredTypeOfTypeParameter(node.symbol); - if (!contains(result, tp)) { - if (!result) { - result = []; - } - result.push(tp); - } + result = appendIfUnique(result, tp); }); return result; } @@ -11715,9 +11688,7 @@ namespace ts { if (type === declaredType && declaredType === initialType) { return type; } - if (!contains(antecedentTypes, type)) { - antecedentTypes.push(type); - } + pushIfUnique(antecedentTypes, type); // If an antecedent type is not a subset of the declared type, we need to perform // subtype reduction. This happens when a "foreign" type is injected into the control // flow using the instanceof operator or a user defined type predicate. @@ -11783,9 +11754,7 @@ namespace ts { if (cached) { return cached; } - if (!contains(antecedentTypes, type)) { - antecedentTypes.push(type); - } + pushIfUnique(antecedentTypes, type); // If an antecedent type is not a subset of the declared type, we need to perform // subtype reduction. This happens when a "foreign" type is injected into the control // flow using the instanceof operator or a user defined type predicate. @@ -16826,9 +16795,7 @@ namespace ts { ? Diagnostics.Type_of_iterated_elements_of_a_yield_Asterisk_operand_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member : Diagnostics.Type_of_yield_operand_in_an_async_generator_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member); } - if (!contains(aggregatedTypes, type)) { - aggregatedTypes.push(type); - } + pushIfUnique(aggregatedTypes, type); } }); @@ -16880,9 +16847,7 @@ namespace ts { if (type.flags & TypeFlags.Never) { hasReturnOfTypeNever = true; } - else if (!contains(aggregatedTypes, type)) { - aggregatedTypes.push(type); - } + pushIfUnique(aggregatedTypes, type); } else { hasReturnWithNoExpression = true; @@ -16893,9 +16858,7 @@ namespace ts { return undefined; } if (strictNullChecks && aggregatedTypes.length && hasReturnWithNoExpression) { - if (!contains(aggregatedTypes, undefinedType)) { - aggregatedTypes.push(undefinedType); - } + pushIfUnique(aggregatedTypes, undefinedType); } return aggregatedTypes; } diff --git a/src/compiler/core.ts b/src/compiler/core.ts index eae2e5ee33648..07824ab5d04b4 100644 --- a/src/compiler/core.ts +++ b/src/compiler/core.ts @@ -771,6 +771,32 @@ namespace ts { return to; } + /** + * @return Whether the value was added. + */ + export function pushIfUnique(array: T[], toAdd: T): boolean { + if (contains(array, toAdd)) { + return false; + } + else { + array.push(toAdd); + return true; + } + } + + /** + * Unlike `pushIfUnique`, this can take `undefined` as an input, and returns a new array. + */ + export function appendIfUnique(array: T[] | undefined, toAdd: T): T[] { + if (array) { + pushIfUnique(array, toAdd); + return array; + } + else { + return [toAdd]; + } + } + /** * Stable sort of an array. Elements equal to each other maintain their relative position in the array. */ diff --git a/src/compiler/factory.ts b/src/compiler/factory.ts index daec1bce1e8b5..1d92c0f5315d8 100644 --- a/src/compiler/factory.ts +++ b/src/compiler/factory.ts @@ -2636,9 +2636,7 @@ namespace ts { if (some(helpers)) { const emitNode = getOrCreateEmitNode(node); for (const helper of helpers) { - if (!contains(emitNode.helpers, helper)) { - emitNode.helpers = append(emitNode.helpers, helper); - } + emitNode.helpers = appendIfUnique(emitNode.helpers, helper); } } return node; @@ -2680,9 +2678,7 @@ namespace ts { const helper = sourceEmitHelpers[i]; if (predicate(helper)) { helpersRemoved++; - if (!contains(targetEmitNode.helpers, helper)) { - targetEmitNode.helpers = append(targetEmitNode.helpers, helper); - } + targetEmitNode.helpers = appendIfUnique(targetEmitNode.helpers, helper); } else if (helpersRemoved > 0) { sourceEmitHelpers[i - helpersRemoved] = helper; From e2141ad4694c3dc4d93388d5ee0d8bb0c7cbaa84 Mon Sep 17 00:00:00 2001 From: Andy Date: Thu, 24 Aug 2017 09:55:01 -0700 Subject: [PATCH 227/237] Mark some arrays as readonly (#17725) * Mark some arrays as readonly * Avoid unnecessary allocations and style changes * Fix lint --- src/compiler/comments.ts | 2 +- src/compiler/core.ts | 2 +- src/compiler/declarationEmitter.ts | 2 +- src/compiler/factory.ts | 4 +- src/compiler/program.ts | 40 +++++++++------- src/compiler/scanner.ts | 2 +- src/compiler/transformer.ts | 2 +- src/compiler/tsc.ts | 6 +-- src/compiler/types.ts | 44 ++++++++--------- src/compiler/utilities.ts | 2 +- src/harness/fourslash.ts | 7 +-- src/harness/harness.ts | 10 ++-- src/harness/projectsRunner.ts | 47 ++++++++++--------- src/harness/unittests/moduleResolution.ts | 2 +- src/harness/unittests/programMissingFiles.ts | 10 ++-- .../unittests/reuseProgramStructure.ts | 6 +-- src/server/session.ts | 2 +- src/services/findAllReferences.ts | 28 +++++------ src/services/goToDefinition.ts | 2 +- src/services/importTracker.ts | 14 +++--- src/services/navigateTo.ts | 2 +- src/services/services.ts | 15 +++--- src/services/shims.ts | 4 +- src/services/types.ts | 2 +- 24 files changed, 133 insertions(+), 124 deletions(-) diff --git a/src/compiler/comments.ts b/src/compiler/comments.ts index adf15c7e28d5c..025a4f36d26be 100644 --- a/src/compiler/comments.ts +++ b/src/compiler/comments.ts @@ -21,7 +21,7 @@ namespace ts { let declarationListContainerEnd = -1; let currentSourceFile: SourceFile; let currentText: string; - let currentLineMap: number[]; + let currentLineMap: ReadonlyArray; let detachedCommentsInfo: { nodePos: number, detachedCommentEndPos: number}[]; let hasWrittenComment = false; let disabled: boolean = printerOptions.removeComments; diff --git a/src/compiler/core.ts b/src/compiler/core.ts index 07824ab5d04b4..6eb17f1fb782f 100644 --- a/src/compiler/core.ts +++ b/src/compiler/core.ts @@ -715,7 +715,7 @@ namespace ts { return result; } - export function sum, K extends string>(array: T[], prop: K): number { + export function sum, K extends string>(array: ReadonlyArray, prop: K): number { let result = 0; for (const v of array) { // Note: we need the following type assertion because of GH #17069 diff --git a/src/compiler/declarationEmitter.ts b/src/compiler/declarationEmitter.ts index 47a3be6efeaf3..3de2091502949 100644 --- a/src/compiler/declarationEmitter.ts +++ b/src/compiler/declarationEmitter.ts @@ -60,7 +60,7 @@ namespace ts { let enclosingDeclaration: Node; let resultHasExternalModuleIndicator: boolean; let currentText: string; - let currentLineMap: number[]; + let currentLineMap: ReadonlyArray; let currentIdentifiers: Map; let isCurrentFileExternalModule: boolean; let reportedDeclarationError = false; diff --git a/src/compiler/factory.ts b/src/compiler/factory.ts index 1d92c0f5315d8..9d7f6c82a7ae7 100644 --- a/src/compiler/factory.ts +++ b/src/compiler/factory.ts @@ -2339,13 +2339,13 @@ namespace ts { : node; } - export function createBundle(sourceFiles: SourceFile[]) { + export function createBundle(sourceFiles: ReadonlyArray) { const node = createNode(SyntaxKind.Bundle); node.sourceFiles = sourceFiles; return node; } - export function updateBundle(node: Bundle, sourceFiles: SourceFile[]) { + export function updateBundle(node: Bundle, sourceFiles: ReadonlyArray) { if (node.sourceFiles !== sourceFiles) { return createBundle(sourceFiles); } diff --git a/src/compiler/program.ts b/src/compiler/program.ts index 305058285f999..800e2f9e619d0 100644 --- a/src/compiler/program.ts +++ b/src/compiler/program.ts @@ -205,13 +205,15 @@ namespace ts { } export function getPreEmitDiagnostics(program: Program, sourceFile?: SourceFile, cancellationToken?: CancellationToken): Diagnostic[] { - let diagnostics = program.getOptionsDiagnostics(cancellationToken).concat( - program.getSyntacticDiagnostics(sourceFile, cancellationToken), - program.getGlobalDiagnostics(cancellationToken), - program.getSemanticDiagnostics(sourceFile, cancellationToken)); + const diagnostics = [ + ...program.getOptionsDiagnostics(cancellationToken), + ...program.getSyntacticDiagnostics(sourceFile, cancellationToken), + ...program.getGlobalDiagnostics(cancellationToken), + ...program.getSemanticDiagnostics(sourceFile, cancellationToken) + ]; if (program.getCompilerOptions().declaration) { - diagnostics = diagnostics.concat(program.getDeclarationDiagnostics(sourceFile, cancellationToken)); + addRange(diagnostics, program.getDeclarationDiagnostics(sourceFile, cancellationToken)); } return sortAndDeduplicateDiagnostics(diagnostics); @@ -223,7 +225,7 @@ namespace ts { getNewLine(): string; } - export function formatDiagnostics(diagnostics: Diagnostic[], host: FormatDiagnosticsHost): string { + export function formatDiagnostics(diagnostics: ReadonlyArray, host: FormatDiagnosticsHost): string { let output = ""; for (const diagnostic of diagnostics) { @@ -399,7 +401,7 @@ namespace ts { * @param oldProgram - Reuses an old program structure. * @returns A 'Program' object. */ - export function createProgram(rootNames: string[], options: CompilerOptions, host?: CompilerHost, oldProgram?: Program): Program { + export function createProgram(rootNames: ReadonlyArray, options: CompilerOptions, host?: CompilerHost, oldProgram?: Program): Program { let program: Program; let files: SourceFile[] = []; let commonSourceDirectory: string; @@ -996,7 +998,7 @@ namespace ts { } function emitWorker(program: Program, sourceFile: SourceFile, writeFileCallback: WriteFileCallback, cancellationToken: CancellationToken, emitOnlyDtsFiles?: boolean, customTransformers?: CustomTransformers): EmitResult { - let declarationDiagnostics: Diagnostic[] = []; + let declarationDiagnostics: ReadonlyArray = []; if (options.noEmit) { return { diagnostics: declarationDiagnostics, sourceMaps: undefined, emittedFiles: undefined, emitSkipped: true }; @@ -1006,10 +1008,12 @@ namespace ts { // immediately bail out. Note that we pass 'undefined' for 'sourceFile' so that we // get any preEmit diagnostics, not just the ones if (options.noEmitOnError) { - const diagnostics = program.getOptionsDiagnostics(cancellationToken).concat( - program.getSyntacticDiagnostics(sourceFile, cancellationToken), - program.getGlobalDiagnostics(cancellationToken), - program.getSemanticDiagnostics(sourceFile, cancellationToken)); + const diagnostics = [ + ...program.getOptionsDiagnostics(cancellationToken), + ...program.getSyntacticDiagnostics(sourceFile, cancellationToken), + ...program.getGlobalDiagnostics(cancellationToken), + ...program.getSemanticDiagnostics(sourceFile, cancellationToken) + ]; if (diagnostics.length === 0 && program.getCompilerOptions().declaration) { declarationDiagnostics = program.getDeclarationDiagnostics(/*sourceFile*/ undefined, cancellationToken); @@ -1060,8 +1064,8 @@ namespace ts { function getDiagnosticsHelper( sourceFile: SourceFile, - getDiagnostics: (sourceFile: SourceFile, cancellationToken: CancellationToken) => Diagnostic[], - cancellationToken: CancellationToken): Diagnostic[] { + getDiagnostics: (sourceFile: SourceFile, cancellationToken: CancellationToken) => ReadonlyArray, + cancellationToken: CancellationToken): ReadonlyArray { if (sourceFile) { return getDiagnostics(sourceFile, cancellationToken); } @@ -1073,15 +1077,15 @@ namespace ts { })); } - function getSyntacticDiagnostics(sourceFile: SourceFile, cancellationToken: CancellationToken): Diagnostic[] { + function getSyntacticDiagnostics(sourceFile: SourceFile, cancellationToken: CancellationToken): ReadonlyArray { return getDiagnosticsHelper(sourceFile, getSyntacticDiagnosticsForFile, cancellationToken); } - function getSemanticDiagnostics(sourceFile: SourceFile, cancellationToken: CancellationToken): Diagnostic[] { + function getSemanticDiagnostics(sourceFile: SourceFile, cancellationToken: CancellationToken): ReadonlyArray { return getDiagnosticsHelper(sourceFile, getSemanticDiagnosticsForFile, cancellationToken); } - function getDeclarationDiagnostics(sourceFile: SourceFile, cancellationToken: CancellationToken): Diagnostic[] { + function getDeclarationDiagnostics(sourceFile: SourceFile, cancellationToken: CancellationToken): ReadonlyArray { const options = program.getCompilerOptions(); // collect diagnostics from the program only once if either no source file was specified or out/outFile is set (bundled emit) if (!sourceFile || options.out || options.outFile) { @@ -1092,7 +1096,7 @@ namespace ts { } } - function getSyntacticDiagnosticsForFile(sourceFile: SourceFile): Diagnostic[] { + function getSyntacticDiagnosticsForFile(sourceFile: SourceFile): ReadonlyArray { // For JavaScript files, we report semantic errors for using TypeScript-only // constructs from within a JavaScript file as syntactic errors. if (isSourceFileJavaScript(sourceFile)) { diff --git a/src/compiler/scanner.ts b/src/compiler/scanner.ts index 09defaaf77399..a130d8427daad 100644 --- a/src/compiler/scanner.ts +++ b/src/compiler/scanner.ts @@ -343,7 +343,7 @@ namespace ts { } /* @internal */ - export function getLineStarts(sourceFile: SourceFileLike): number[] { + export function getLineStarts(sourceFile: SourceFileLike): ReadonlyArray { return sourceFile.lineMap || (sourceFile.lineMap = computeLineStarts(sourceFile.text)); } diff --git a/src/compiler/transformer.ts b/src/compiler/transformer.ts index d61195ad74b54..341c0c9cd45ec 100644 --- a/src/compiler/transformer.ts +++ b/src/compiler/transformer.ts @@ -92,7 +92,7 @@ namespace ts { * @param transforms An array of `TransformerFactory` callbacks. * @param allowDtsFiles A value indicating whether to allow the transformation of .d.ts files. */ - export function transformNodes(resolver: EmitResolver, host: EmitHost, options: CompilerOptions, nodes: T[], transformers: TransformerFactory[], allowDtsFiles: boolean): TransformationResult { + export function transformNodes(resolver: EmitResolver, host: EmitHost, options: CompilerOptions, nodes: ReadonlyArray, transformers: ReadonlyArray>, allowDtsFiles: boolean): TransformationResult { const enabledSyntaxKindFeatures = new Array(SyntaxKind.Count); let lexicalEnvironmentVariableDeclarations: VariableDeclaration[]; let lexicalEnvironmentFunctionDeclarations: FunctionDeclaration[]; diff --git a/src/compiler/tsc.ts b/src/compiler/tsc.ts index db25afe45b62a..d5e584c7ac561 100644 --- a/src/compiler/tsc.ts +++ b/src/compiler/tsc.ts @@ -469,7 +469,7 @@ namespace ts { let diagnostics: Diagnostic[]; // First get and report any syntactic errors. - diagnostics = program.getSyntacticDiagnostics(); + diagnostics = program.getSyntacticDiagnostics().slice(); // If we didn't have any syntactic errors, then also try getting the global and // semantic errors. @@ -477,13 +477,13 @@ namespace ts { diagnostics = program.getOptionsDiagnostics().concat(program.getGlobalDiagnostics()); if (diagnostics.length === 0) { - diagnostics = program.getSemanticDiagnostics(); + diagnostics = program.getSemanticDiagnostics().slice(); } } // Otherwise, emit and report any errors we ran into. const emitOutput = program.emit(); - diagnostics = diagnostics.concat(emitOutput.diagnostics); + addRange(diagnostics, emitOutput.diagnostics); reportDiagnostics(sortAndDeduplicateDiagnostics(diagnostics), compilerHost); diff --git a/src/compiler/types.ts b/src/compiler/types.ts index 8fe602ea6f94f..fe18839b9048c 100644 --- a/src/compiler/types.ts +++ b/src/compiler/types.ts @@ -2254,7 +2254,7 @@ namespace ts { */ export interface SourceFileLike { readonly text: string; - lineMap: number[]; + lineMap: ReadonlyArray; } @@ -2286,16 +2286,16 @@ namespace ts { */ /* @internal */ redirectInfo?: RedirectInfo | undefined; - amdDependencies: AmdDependency[]; + amdDependencies: ReadonlyArray; moduleName: string; - referencedFiles: FileReference[]; - typeReferenceDirectives: FileReference[]; + referencedFiles: ReadonlyArray; + typeReferenceDirectives: ReadonlyArray; languageVariant: LanguageVariant; isDeclarationFile: boolean; // this map is used by transpiler to supply alternative names for dependencies (i.e. in case of bundling) /* @internal */ - renamedDependencies?: Map; + renamedDependencies?: ReadonlyMap; /** * lib.d.ts should have a reference comment like @@ -2331,12 +2331,12 @@ namespace ts { /* @internal */ jsDocDiagnostics?: Diagnostic[]; // Stores additional file-level diagnostics reported by the program - /* @internal */ additionalSyntacticDiagnostics?: Diagnostic[]; + /* @internal */ additionalSyntacticDiagnostics?: ReadonlyArray; // Stores a line map for the file. // This field should never be used directly to obtain line map, use getLineMap function instead. - /* @internal */ lineMap: number[]; - /* @internal */ classifiableNames?: UnderscoreEscapedMap; + /* @internal */ lineMap: ReadonlyArray; + /* @internal */ classifiableNames?: ReadonlyUnderscoreEscapedMap; // Stores a mapping 'external module reference text' -> 'resolved file name' | undefined // It is used to resolve module names in the checker. // Content of this field should never be used directly - use getResolvedModuleFileName/setResolvedModuleFileName functions instead @@ -2351,7 +2351,7 @@ namespace ts { export interface Bundle extends Node { kind: SyntaxKind.Bundle; - sourceFiles: SourceFile[]; + sourceFiles: ReadonlyArray; } export interface JsonSourceFile extends SourceFile { @@ -2398,19 +2398,19 @@ namespace ts { /** * Get a list of root file names that were passed to a 'createProgram' */ - getRootFileNames(): string[]; + getRootFileNames(): ReadonlyArray; /** * Get a list of files in the program */ - getSourceFiles(): SourceFile[]; + getSourceFiles(): ReadonlyArray; /** * Get a list of file names that were passed to 'createProgram' or referenced in a * program source file but could not be located. */ /* @internal */ - getMissingFilePaths(): Path[]; + getMissingFilePaths(): ReadonlyArray; /** * Emits the JavaScript and declaration files. If targetSourceFile is not specified, then @@ -2424,11 +2424,11 @@ namespace ts { */ emit(targetSourceFile?: SourceFile, writeFile?: WriteFileCallback, cancellationToken?: CancellationToken, emitOnlyDtsFiles?: boolean, customTransformers?: CustomTransformers): EmitResult; - getOptionsDiagnostics(cancellationToken?: CancellationToken): Diagnostic[]; - getGlobalDiagnostics(cancellationToken?: CancellationToken): Diagnostic[]; - getSyntacticDiagnostics(sourceFile?: SourceFile, cancellationToken?: CancellationToken): Diagnostic[]; - getSemanticDiagnostics(sourceFile?: SourceFile, cancellationToken?: CancellationToken): Diagnostic[]; - getDeclarationDiagnostics(sourceFile?: SourceFile, cancellationToken?: CancellationToken): Diagnostic[]; + getOptionsDiagnostics(cancellationToken?: CancellationToken): ReadonlyArray; + getGlobalDiagnostics(cancellationToken?: CancellationToken): ReadonlyArray; + getSyntacticDiagnostics(sourceFile?: SourceFile, cancellationToken?: CancellationToken): ReadonlyArray; + getSemanticDiagnostics(sourceFile?: SourceFile, cancellationToken?: CancellationToken): ReadonlyArray; + getDeclarationDiagnostics(sourceFile?: SourceFile, cancellationToken?: CancellationToken): ReadonlyArray; /** * Gets a type checker that can be used to semantically analyze source files in the program. @@ -2522,7 +2522,7 @@ namespace ts { export interface EmitResult { emitSkipped: boolean; /** Contains declaration emit diagnostics */ - diagnostics: Diagnostic[]; + diagnostics: ReadonlyArray; emittedFiles: string[]; // Array of files the compiler wrote to disk /* @internal */ sourceMaps: SourceMapData[]; // Array of sourceMapData if compiler emitted sourcemaps } @@ -2531,9 +2531,9 @@ namespace ts { export interface TypeCheckerHost { getCompilerOptions(): CompilerOptions; - getSourceFiles(): SourceFile[]; + getSourceFiles(): ReadonlyArray; getSourceFile(fileName: string): SourceFile; - getResolvedTypeReferenceDirectives(): Map; + getResolvedTypeReferenceDirectives(): ReadonlyMap; } export interface TypeChecker { @@ -4137,7 +4137,7 @@ namespace ts { export interface SourceMapSource { fileName: string; text: string; - /* @internal */ lineMap: number[]; + /* @internal */ lineMap: ReadonlyArray; skipTrivia?: (pos: number) => number; } @@ -4244,7 +4244,7 @@ namespace ts { /* @internal */ export interface EmitHost extends ScriptReferenceHost { - getSourceFiles(): SourceFile[]; + getSourceFiles(): ReadonlyArray; /* @internal */ isSourceFileFromExternalLibrary(file: SourceFile): boolean; diff --git a/src/compiler/utilities.ts b/src/compiler/utilities.ts index f1a8dfd676b70..d906ab4f6b1e7 100644 --- a/src/compiler/utilities.ts +++ b/src/compiler/utilities.ts @@ -2572,7 +2572,7 @@ namespace ts { * @param host An EmitHost. * @param targetSourceFile An optional target source file to emit. */ - export function getSourceFilesToEmit(host: EmitHost, targetSourceFile?: SourceFile): SourceFile[] { + export function getSourceFilesToEmit(host: EmitHost, targetSourceFile?: SourceFile): ReadonlyArray { const options = host.getCompilerOptions(); const isSourceFileFromExternalLibrary = (file: SourceFile) => host.isSourceFileFromExternalLibrary(file); if (options.outFile || options.out) { diff --git a/src/harness/fourslash.ts b/src/harness/fourslash.ts index 32c9fb67da0d0..ab33fa87997bc 100644 --- a/src/harness/fourslash.ts +++ b/src/harness/fourslash.ts @@ -490,7 +490,8 @@ namespace FourSlash { } private getDiagnostics(fileName: string): ts.Diagnostic[] { - return this.languageService.getSyntacticDiagnostics(fileName).concat(this.languageService.getSemanticDiagnostics(fileName)); + return ts.concatenate(this.languageService.getSyntacticDiagnostics(fileName), + this.languageService.getSemanticDiagnostics(fileName)); } private getAllDiagnostics(): ts.Diagnostic[] { @@ -1148,7 +1149,7 @@ namespace FourSlash { this.testDiagnostics(expected, diagnostics); } - private testDiagnostics(expected: string, diagnostics: ts.Diagnostic[]) { + private testDiagnostics(expected: string, diagnostics: ReadonlyArray) { const realized = ts.realizeDiagnostics(diagnostics, "\r\n"); const actual = stringify(realized); assert.equal(actual, expected); @@ -1585,7 +1586,7 @@ namespace FourSlash { public printErrorList() { const syntacticErrors = this.languageService.getSyntacticDiagnostics(this.activeFile.fileName); const semanticErrors = this.languageService.getSemanticDiagnostics(this.activeFile.fileName); - const errorList = syntacticErrors.concat(semanticErrors); + const errorList = ts.concatenate(syntacticErrors, semanticErrors); Harness.IO.log(`Error list (${errorList.length} errors)`); if (errorList.length) { diff --git a/src/harness/harness.ts b/src/harness/harness.ts index bf5cde2bc4832..9443844cf9a55 100644 --- a/src/harness/harness.ts +++ b/src/harness/harness.ts @@ -207,7 +207,7 @@ namespace Utils { return a !== undefined && typeof a.pos === "number"; } - export function convertDiagnostics(diagnostics: ts.Diagnostic[]) { + export function convertDiagnostics(diagnostics: ReadonlyArray) { return diagnostics.map(convertDiagnostic); } @@ -337,7 +337,7 @@ namespace Utils { } } - export function assertDiagnosticsEquals(array1: ts.Diagnostic[], array2: ts.Diagnostic[]) { + export function assertDiagnosticsEquals(array1: ReadonlyArray, array2: ReadonlyArray) { if (array1 === array2) { return; } @@ -1284,12 +1284,12 @@ namespace Harness { return normalized; } - export function minimalDiagnosticsToString(diagnostics: ts.Diagnostic[]) { + export function minimalDiagnosticsToString(diagnostics: ReadonlyArray) { return ts.formatDiagnostics(diagnostics, { getCanonicalFileName, getCurrentDirectory: () => "", getNewLine: () => Harness.IO.newLine() }); } - export function getErrorBaseline(inputFiles: TestFile[], diagnostics: ts.Diagnostic[]) { - diagnostics.sort(ts.compareDiagnostics); + export function getErrorBaseline(inputFiles: ReadonlyArray, diagnostics: ReadonlyArray) { + diagnostics = diagnostics.slice().sort(ts.compareDiagnostics); let outputLines = ""; // Count up all errors that were found in files other than lib.d.ts so we don't miss any let totalErrorsReportedInNonLibraryFiles = 0; diff --git a/src/harness/projectsRunner.ts b/src/harness/projectsRunner.ts index 752767d970688..6c13261d757a3 100644 --- a/src/harness/projectsRunner.ts +++ b/src/harness/projectsRunner.ts @@ -5,7 +5,7 @@ interface ProjectRunnerTestCase { scenario: string; projectRoot: string; // project where it lives - this also is the current directory when compiling - inputFiles: string[]; // list of input files to be given to program + inputFiles: ReadonlyArray; // list of input files to be given to program resolveMapRoot?: boolean; // should we resolve this map root and give compiler the absolute disk path as map root? resolveSourceRoot?: boolean; // should we resolve this source root and give compiler the absolute disk path as map root? baselineCheck?: boolean; // Verify the baselines of output files, if this is false, we will write to output to the disk but there is no verification of baselines @@ -15,8 +15,8 @@ interface ProjectRunnerTestCase { interface ProjectRunnerTestCaseResolutionInfo extends ProjectRunnerTestCase { // Apart from actual test case the results of the resolution - resolvedInputFiles: string[]; // List of files that were asked to read by compiler - emittedFiles: string[]; // List of files that were emitted by the compiler + resolvedInputFiles: ReadonlyArray; // List of files that were asked to read by compiler + emittedFiles: ReadonlyArray; // List of files that were emitted by the compiler } interface BatchCompileProjectTestCaseEmittedFile extends Harness.Compiler.GeneratedFile { @@ -24,12 +24,12 @@ interface BatchCompileProjectTestCaseEmittedFile extends Harness.Compiler.Genera } interface CompileProjectFilesResult { - configFileSourceFiles: ts.SourceFile[]; + configFileSourceFiles: ReadonlyArray; moduleKind: ts.ModuleKind; program?: ts.Program; compilerOptions?: ts.CompilerOptions; - errors: ts.Diagnostic[]; - sourceMapData?: ts.SourceMapData[]; + errors: ReadonlyArray; + sourceMapData?: ReadonlyArray; } interface BatchCompileProjectTestCaseResult extends CompileProjectFilesResult { @@ -125,17 +125,17 @@ class ProjectRunner extends RunnerBase { return Harness.IO.resolvePath(testCase.projectRoot); } - function compileProjectFiles(moduleKind: ts.ModuleKind, configFileSourceFiles: ts.SourceFile[], - getInputFiles: () => string[], + function compileProjectFiles(moduleKind: ts.ModuleKind, configFileSourceFiles: ReadonlyArray, + getInputFiles: () => ReadonlyArray, getSourceFileTextImpl: (fileName: string) => string, writeFile: (fileName: string, data: string, writeByteOrderMark: boolean) => void, compilerOptions: ts.CompilerOptions): CompileProjectFilesResult { const program = ts.createProgram(getInputFiles(), compilerOptions, createCompilerHost()); - let errors = ts.getPreEmitDiagnostics(program); + const errors = ts.getPreEmitDiagnostics(program); const emitResult = program.emit(); - errors = ts.concatenate(errors, emitResult.diagnostics); + ts.addRange(errors, emitResult.diagnostics); const sourceMapData = emitResult.sourceMaps; // Clean up source map data that will be used in baselining @@ -235,7 +235,7 @@ class ProjectRunner extends RunnerBase { compilerOptions, sourceMapData: projectCompilerResult.sourceMapData, outputFiles, - errors: errors ? errors.concat(projectCompilerResult.errors) : projectCompilerResult.errors, + errors: errors ? ts.concatenate(errors, projectCompilerResult.errors) : projectCompilerResult.errors, }; function createCompilerOptions() { @@ -422,16 +422,21 @@ class ProjectRunner extends RunnerBase { } function getErrorsBaseline(compilerResult: CompileProjectFilesResult) { - const inputFiles = ts.map(compilerResult.configFileSourceFiles.concat( - compilerResult.program ? - ts.filter(compilerResult.program.getSourceFiles(), sourceFile => !Harness.isDefaultLibraryFile(sourceFile.fileName)) : - []), - (sourceFile): Harness.Compiler.TestFile => ({ - unitName: ts.isRootedDiskPath(sourceFile.fileName) ? - RunnerBase.removeFullPaths(sourceFile.fileName) : - sourceFile.fileName, - content: sourceFile.text - })); + const inputSourceFiles = compilerResult.configFileSourceFiles.slice(); + if (compilerResult.program) { + for (const sourceFile of compilerResult.program.getSourceFiles()) { + if (!Harness.isDefaultLibraryFile(sourceFile.fileName)) { + inputSourceFiles.push(sourceFile); + } + } + } + + const inputFiles = inputSourceFiles.map(sourceFile => ({ + unitName: ts.isRootedDiskPath(sourceFile.fileName) ? + RunnerBase.removeFullPaths(sourceFile.fileName) : + sourceFile.fileName, + content: sourceFile.text + })); return Harness.Compiler.getErrorBaseline(inputFiles, compilerResult.errors); } diff --git a/src/harness/unittests/moduleResolution.ts b/src/harness/unittests/moduleResolution.ts index 79aafb4986d83..ed8dcf0c7b4c7 100644 --- a/src/harness/unittests/moduleResolution.ts +++ b/src/harness/unittests/moduleResolution.ts @@ -425,7 +425,7 @@ export = C; readFile: notImplemented }; const program = createProgram(rootFiles, options, host); - const diagnostics = sortAndDeduplicateDiagnostics(program.getSemanticDiagnostics().concat(program.getOptionsDiagnostics())); + const diagnostics = sortAndDeduplicateDiagnostics([...program.getSemanticDiagnostics(), ...program.getOptionsDiagnostics()]); assert.equal(diagnostics.length, diagnosticCodes.length, `Incorrect number of expected diagnostics, expected ${diagnosticCodes.length}, got '${Harness.Compiler.minimalDiagnosticsToString(diagnostics)}'`); for (let i = 0; i < diagnosticCodes.length; i++) { assert.equal(diagnostics[i].code, diagnosticCodes[i], `Expected diagnostic code ${diagnosticCodes[i]}, got '${diagnostics[i].code}': '${diagnostics[i].messageText}'`); diff --git a/src/harness/unittests/programMissingFiles.ts b/src/harness/unittests/programMissingFiles.ts index 668b684a2501b..ea644599de1c6 100644 --- a/src/harness/unittests/programMissingFiles.ts +++ b/src/harness/unittests/programMissingFiles.ts @@ -48,18 +48,18 @@ namespace ts { const program = createProgram(["./nonexistent.ts"], options, testCompilerHost); const missing = program.getMissingFilePaths(); assert.isDefined(missing); - assert.deepEqual(missing, ["d:/pretend/nonexistent.ts"]); // Absolute path + assert.deepEqual(missing, ["d:/pretend/nonexistent.ts" as Path]); // Absolute path }); it("handles multiple missing root files", () => { const program = createProgram(["./nonexistent0.ts", "./nonexistent1.ts"], options, testCompilerHost); - const missing = program.getMissingFilePaths().sort(); + const missing = program.getMissingFilePaths().slice().sort(); assert.deepEqual(missing, ["d:/pretend/nonexistent0.ts", "d:/pretend/nonexistent1.ts"]); }); it("handles a mix of present and missing root files", () => { const program = createProgram(["./nonexistent0.ts", emptyFileRelativePath, "./nonexistent1.ts"], options, testCompilerHost); - const missing = program.getMissingFilePaths().sort(); + const missing = program.getMissingFilePaths().slice().sort(); assert.deepEqual(missing, ["d:/pretend/nonexistent0.ts", "d:/pretend/nonexistent1.ts"]); }); @@ -67,7 +67,7 @@ namespace ts { const program = createProgram(["./nonexistent.ts", "./nonexistent.ts"], options, testCompilerHost); const missing = program.getMissingFilePaths(); assert.isDefined(missing); - assert.deepEqual(missing, ["d:/pretend/nonexistent.ts"]); + assert.deepEqual(missing, ["d:/pretend/nonexistent.ts" as Path]); }); it("normalizes file paths", () => { @@ -81,7 +81,7 @@ namespace ts { it("handles missing triple slash references", () => { const program = createProgram([referenceFileRelativePath], options, testCompilerHost); - const missing = program.getMissingFilePaths().sort(); + const missing = program.getMissingFilePaths().slice().sort(); assert.isDefined(missing); assert.deepEqual(missing, [ // From absolute reference diff --git a/src/harness/unittests/reuseProgramStructure.ts b/src/harness/unittests/reuseProgramStructure.ts index 5062f4c4b39ee..0c2a4a7052b78 100644 --- a/src/harness/unittests/reuseProgramStructure.ts +++ b/src/harness/unittests/reuseProgramStructure.ts @@ -21,7 +21,7 @@ namespace ts { } interface ProgramWithSourceTexts extends Program { - sourceTexts?: NamedSourceText[]; + sourceTexts?: ReadonlyArray; host: TestCompilerHost; } @@ -106,7 +106,7 @@ namespace ts { return file; } - function createTestCompilerHost(texts: NamedSourceText[], target: ScriptTarget, oldProgram?: ProgramWithSourceTexts): TestCompilerHost { + function createTestCompilerHost(texts: ReadonlyArray, target: ScriptTarget, oldProgram?: ProgramWithSourceTexts): TestCompilerHost { const files = arrayToMap(texts, t => t.name, t => { if (oldProgram) { let oldFile = oldProgram.getSourceFile(t.name); @@ -162,7 +162,7 @@ namespace ts { return program; } - function updateProgram(oldProgram: ProgramWithSourceTexts, rootNames: string[], options: CompilerOptions, updater: (files: NamedSourceText[]) => void, newTexts?: NamedSourceText[]) { + function updateProgram(oldProgram: ProgramWithSourceTexts, rootNames: ReadonlyArray, options: CompilerOptions, updater: (files: NamedSourceText[]) => void, newTexts?: NamedSourceText[]) { if (!newTexts) { newTexts = (oldProgram).sourceTexts.slice(0); } diff --git a/src/server/session.ts b/src/server/session.ts index c5b6957681181..0b3038a408d87 100644 --- a/src/server/session.ts +++ b/src/server/session.ts @@ -425,7 +425,7 @@ namespace ts.server { private semanticCheck(file: NormalizedPath, project: Project) { try { - let diags: Diagnostic[] = []; + let diags: ReadonlyArray = emptyArray; if (!isDeclarationFileInJSOnlyNonConfiguredProject(project, file)) { diags = project.getLanguageService().getSemanticDiagnostics(file); } diff --git a/src/services/findAllReferences.ts b/src/services/findAllReferences.ts index ad26dae21158b..4c8563b1b94fa 100644 --- a/src/services/findAllReferences.ts +++ b/src/services/findAllReferences.ts @@ -41,7 +41,7 @@ namespace ts.FindAllReferences { readonly implementations?: boolean; } - export function findReferencedSymbols(program: Program, cancellationToken: CancellationToken, sourceFiles: SourceFile[], sourceFile: SourceFile, position: number): ReferencedSymbol[] | undefined { + export function findReferencedSymbols(program: Program, cancellationToken: CancellationToken, sourceFiles: ReadonlyArray, sourceFile: SourceFile, position: number): ReferencedSymbol[] | undefined { const referencedSymbols = findAllReferencedSymbols(program, cancellationToken, sourceFiles, sourceFile, position); if (!referencedSymbols || !referencedSymbols.length) { @@ -60,7 +60,7 @@ namespace ts.FindAllReferences { return out; } - export function getImplementationsAtPosition(program: Program, cancellationToken: CancellationToken, sourceFiles: SourceFile[], sourceFile: SourceFile, position: number): ImplementationLocation[] { + export function getImplementationsAtPosition(program: Program, cancellationToken: CancellationToken, sourceFiles: ReadonlyArray, sourceFile: SourceFile, position: number): ImplementationLocation[] { // A node in a JSDoc comment can't have an implementation anyway. const node = getTouchingPropertyName(sourceFile, position, /*includeJsDocComment*/ false); const referenceEntries = getImplementationReferenceEntries(program, cancellationToken, sourceFiles, node); @@ -68,7 +68,7 @@ namespace ts.FindAllReferences { return map(referenceEntries, entry => toImplementationLocation(entry, checker)); } - function getImplementationReferenceEntries(program: Program, cancellationToken: CancellationToken, sourceFiles: SourceFile[], node: Node): Entry[] | undefined { + function getImplementationReferenceEntries(program: Program, cancellationToken: CancellationToken, sourceFiles: ReadonlyArray, node: Node): Entry[] | undefined { if (node.kind === SyntaxKind.SourceFile) { return undefined; } @@ -93,16 +93,16 @@ namespace ts.FindAllReferences { } } - export function findReferencedEntries(program: Program, cancellationToken: CancellationToken, sourceFiles: SourceFile[], sourceFile: SourceFile, position: number, options?: Options): ReferenceEntry[] | undefined { + export function findReferencedEntries(program: Program, cancellationToken: CancellationToken, sourceFiles: ReadonlyArray, sourceFile: SourceFile, position: number, options?: Options): ReferenceEntry[] | undefined { const x = flattenEntries(findAllReferencedSymbols(program, cancellationToken, sourceFiles, sourceFile, position, options)); return map(x, toReferenceEntry); } - export function getReferenceEntriesForNode(node: Node, program: Program, sourceFiles: SourceFile[], cancellationToken: CancellationToken, options: Options = {}): Entry[] | undefined { + export function getReferenceEntriesForNode(node: Node, program: Program, sourceFiles: ReadonlyArray, cancellationToken: CancellationToken, options: Options = {}): Entry[] | undefined { return flattenEntries(Core.getReferencedSymbolsForNode(node, program, sourceFiles, cancellationToken, options)); } - function findAllReferencedSymbols(program: Program, cancellationToken: CancellationToken, sourceFiles: SourceFile[], sourceFile: SourceFile, position: number, options?: Options): SymbolAndEntries[] | undefined { + function findAllReferencedSymbols(program: Program, cancellationToken: CancellationToken, sourceFiles: ReadonlyArray, sourceFile: SourceFile, position: number, options?: Options): SymbolAndEntries[] | undefined { const node = getTouchingPropertyName(sourceFile, position, /*includeJsDocComment*/ true); return Core.getReferencedSymbolsForNode(node, program, sourceFiles, cancellationToken, options); } @@ -264,7 +264,7 @@ namespace ts.FindAllReferences { /* @internal */ namespace ts.FindAllReferences.Core { /** Core find-all-references algorithm. Handles special cases before delegating to `getReferencedSymbolsForSymbol`. */ - export function getReferencedSymbolsForNode(node: Node, program: Program, sourceFiles: SourceFile[], cancellationToken: CancellationToken, options: Options = {}): SymbolAndEntries[] | undefined { + export function getReferencedSymbolsForNode(node: Node, program: Program, sourceFiles: ReadonlyArray, cancellationToken: CancellationToken, options: Options = {}): SymbolAndEntries[] | undefined { if (node.kind === ts.SyntaxKind.SourceFile) { return undefined; } @@ -313,7 +313,7 @@ namespace ts.FindAllReferences.Core { } } - function getReferencedSymbolsForModule(program: Program, symbol: Symbol, sourceFiles: SourceFile[]): SymbolAndEntries[] { + function getReferencedSymbolsForModule(program: Program, symbol: Symbol, sourceFiles: ReadonlyArray): SymbolAndEntries[] { Debug.assert(!!symbol.valueDeclaration); const references = findModuleReferences(program, sourceFiles, symbol).map(reference => { @@ -349,7 +349,7 @@ namespace ts.FindAllReferences.Core { } /** getReferencedSymbols for special node kinds. */ - function getReferencedSymbolsSpecial(node: Node, sourceFiles: SourceFile[], cancellationToken: CancellationToken): SymbolAndEntries[] | undefined { + function getReferencedSymbolsSpecial(node: Node, sourceFiles: ReadonlyArray, cancellationToken: CancellationToken): SymbolAndEntries[] | undefined { if (isTypeKeyword(node.kind)) { return getAllReferencesForKeyword(sourceFiles, node.kind, cancellationToken); } @@ -380,7 +380,7 @@ namespace ts.FindAllReferences.Core { } /** Core find-all-references algorithm for a normal symbol. */ - function getReferencedSymbolsForSymbol(symbol: Symbol, node: Node, sourceFiles: SourceFile[], checker: TypeChecker, cancellationToken: CancellationToken, options: Options): SymbolAndEntries[] { + function getReferencedSymbolsForSymbol(symbol: Symbol, node: Node, sourceFiles: ReadonlyArray, checker: TypeChecker, cancellationToken: CancellationToken, options: Options): SymbolAndEntries[] { symbol = skipPastExportOrImportSpecifier(symbol, node, checker); // Compute the meaning from the location and the symbol it references @@ -474,7 +474,7 @@ namespace ts.FindAllReferences.Core { readonly markSeenReExportRHS = nodeSeenTracker(); constructor( - readonly sourceFiles: SourceFile[], + readonly sourceFiles: ReadonlyArray, /** True if we're searching for constructor references. */ readonly isForConstructor: boolean, readonly checker: TypeChecker, @@ -759,7 +759,7 @@ namespace ts.FindAllReferences.Core { } } - function getAllReferencesForKeyword(sourceFiles: SourceFile[], keywordKind: ts.SyntaxKind, cancellationToken: CancellationToken): SymbolAndEntries[] { + function getAllReferencesForKeyword(sourceFiles: ReadonlyArray, keywordKind: ts.SyntaxKind, cancellationToken: CancellationToken): SymbolAndEntries[] { const references: NodeEntry[] = []; for (const sourceFile of sourceFiles) { cancellationToken.throwIfCancellationRequested(); @@ -1259,7 +1259,7 @@ namespace ts.FindAllReferences.Core { return [{ definition: { type: "symbol", symbol: searchSpaceNode.symbol, node: superKeyword }, references }]; } - function getReferencesForThisKeyword(thisOrSuperKeyword: Node, sourceFiles: SourceFile[], cancellationToken: CancellationToken): SymbolAndEntries[] { + function getReferencesForThisKeyword(thisOrSuperKeyword: Node, sourceFiles: ReadonlyArray, cancellationToken: CancellationToken): SymbolAndEntries[] { let searchSpaceNode = getThisContainer(thisOrSuperKeyword, /* includeArrowFunctions */ false); // Whether 'this' occurs in a static context within a class. @@ -1355,7 +1355,7 @@ namespace ts.FindAllReferences.Core { } } - function getReferencesForStringLiteral(node: StringLiteral, sourceFiles: SourceFile[], cancellationToken: CancellationToken): SymbolAndEntries[] { + function getReferencesForStringLiteral(node: StringLiteral, sourceFiles: ReadonlyArray, cancellationToken: CancellationToken): SymbolAndEntries[] { const references: NodeEntry[] = []; for (const sourceFile of sourceFiles) { diff --git a/src/services/goToDefinition.ts b/src/services/goToDefinition.ts index f60349e4ea56b..cb2be7d484caf 100644 --- a/src/services/goToDefinition.ts +++ b/src/services/goToDefinition.ts @@ -279,7 +279,7 @@ namespace ts.GoToDefinition { return createDefinitionInfo(decl, symbolKind, symbolName, containerName); } - function findReferenceInPosition(refs: FileReference[], pos: number): FileReference { + function findReferenceInPosition(refs: ReadonlyArray, pos: number): FileReference { for (const ref of refs) { if (ref.pos <= pos && pos <= ref.end) { return ref; diff --git a/src/services/importTracker.ts b/src/services/importTracker.ts index 1bbf175c7feb7..d4301db2f8332 100644 --- a/src/services/importTracker.ts +++ b/src/services/importTracker.ts @@ -7,12 +7,12 @@ namespace ts.FindAllReferences { /** For rename imports/exports `{ foo as bar }`, `foo` is not a local, so it may be added as a reference immediately without further searching. */ singleReferences: Identifier[]; /** List of source files that may (or may not) use the symbol via a namespace. (For UMD modules this is every file.) */ - indirectUsers: SourceFile[]; + indirectUsers: ReadonlyArray; } export type ImportTracker = (exportSymbol: Symbol, exportInfo: ExportInfo, isForRename: boolean) => ImportsResult; /** Creates the imports map and returns an ImportTracker that uses it. Call this lazily to avoid calling `getDirectImportsMap` unnecessarily. */ - export function createImportTracker(sourceFiles: SourceFile[], checker: TypeChecker, cancellationToken: CancellationToken): ImportTracker { + export function createImportTracker(sourceFiles: ReadonlyArray, checker: TypeChecker, cancellationToken: CancellationToken): ImportTracker { const allDirectImports = getDirectImportsMap(sourceFiles, checker, cancellationToken); return (exportSymbol, exportInfo, isForRename) => { const { directImports, indirectUsers } = getImportersForExport(sourceFiles, allDirectImports, exportInfo, checker, cancellationToken); @@ -38,12 +38,12 @@ namespace ts.FindAllReferences { /** Returns import statements that directly reference the exporting module, and a list of files that may access the module through a namespace. */ function getImportersForExport( - sourceFiles: SourceFile[], + sourceFiles: ReadonlyArray, allDirectImports: Map, { exportingModuleSymbol, exportKind }: ExportInfo, checker: TypeChecker, cancellationToken: CancellationToken - ): { directImports: Importer[], indirectUsers: SourceFile[] } { + ): { directImports: Importer[], indirectUsers: ReadonlyArray } { const markSeenDirectImport = nodeSeenTracker(); const markSeenIndirectUser = nodeSeenTracker(); const directImports: Importer[] = []; @@ -54,7 +54,7 @@ namespace ts.FindAllReferences { return { directImports, indirectUsers: getIndirectUsers() }; - function getIndirectUsers(): SourceFile[] { + function getIndirectUsers(): ReadonlyArray { if (isAvailableThroughGlobal) { // It has `export as namespace`, so anything could potentially use it. return sourceFiles; @@ -313,7 +313,7 @@ namespace ts.FindAllReferences { | { kind: "import", literal: StringLiteral } /** or */ | { kind: "reference", referencingFile: SourceFile, ref: FileReference }; - export function findModuleReferences(program: Program, sourceFiles: SourceFile[], searchModuleSymbol: Symbol): ModuleReference[] { + export function findModuleReferences(program: Program, sourceFiles: ReadonlyArray, searchModuleSymbol: Symbol): ModuleReference[] { const refs: ModuleReference[] = []; const checker = program.getTypeChecker(); for (const referencingFile of sourceFiles) { @@ -343,7 +343,7 @@ namespace ts.FindAllReferences { } /** Returns a map from a module symbol Id to all import statements that directly reference the module. */ - function getDirectImportsMap(sourceFiles: SourceFile[], checker: TypeChecker, cancellationToken: CancellationToken): Map { + function getDirectImportsMap(sourceFiles: ReadonlyArray, checker: TypeChecker, cancellationToken: CancellationToken): Map { const map = createMap(); for (const sourceFile of sourceFiles) { diff --git a/src/services/navigateTo.ts b/src/services/navigateTo.ts index 122ada0901928..6d84769082d1c 100644 --- a/src/services/navigateTo.ts +++ b/src/services/navigateTo.ts @@ -2,7 +2,7 @@ namespace ts.NavigateTo { type RawNavigateToItem = { name: string; fileName: string; matchKind: PatternMatchKind; isCaseSensitive: boolean; declaration: Declaration }; - export function getNavigateToItems(sourceFiles: SourceFile[], checker: TypeChecker, cancellationToken: CancellationToken, searchValue: string, maxResultCount: number, excludeDtsFiles: boolean): NavigateToItem[] { + export function getNavigateToItems(sourceFiles: ReadonlyArray, checker: TypeChecker, cancellationToken: CancellationToken, searchValue: string, maxResultCount: number, excludeDtsFiles: boolean): NavigateToItem[] { const patternMatcher = createPatternMatcher(searchValue); let rawItems: RawNavigateToItem[] = []; diff --git a/src/services/services.ts b/src/services/services.ts index 7354e706cc946..bada7ff021d0a 100644 --- a/src/services/services.ts +++ b/src/services/services.ts @@ -495,7 +495,7 @@ namespace ts { public path: Path; public text: string; public scriptSnapshot: IScriptSnapshot; - public lineMap: number[]; + public lineMap: ReadonlyArray; public statements: NodeArray; public endOfFileToken: Token; @@ -545,7 +545,7 @@ namespace ts { return ts.getLineAndCharacterOfPosition(this, position); } - public getLineStarts(): number[] { + public getLineStarts(): ReadonlyArray { return getLineStarts(this); } @@ -1336,10 +1336,10 @@ namespace ts { } /// Diagnostics - function getSyntacticDiagnostics(fileName: string) { + function getSyntacticDiagnostics(fileName: string): Diagnostic[] { synchronizeHostData(); - return program.getSyntacticDiagnostics(getValidSourceFile(fileName), cancellationToken); + return program.getSyntacticDiagnostics(getValidSourceFile(fileName), cancellationToken).slice(); } /** @@ -1356,18 +1356,17 @@ namespace ts { const semanticDiagnostics = program.getSemanticDiagnostics(targetSourceFile, cancellationToken); if (!program.getCompilerOptions().declaration) { - return semanticDiagnostics; + return semanticDiagnostics.slice(); } // If '-d' is enabled, check for emitter error. One example of emitter error is export class implements non-export interface const declarationDiagnostics = program.getDeclarationDiagnostics(targetSourceFile, cancellationToken); - return concatenate(semanticDiagnostics, declarationDiagnostics); + return [...semanticDiagnostics, ...declarationDiagnostics]; } function getCompilerOptionsDiagnostics() { synchronizeHostData(); - return program.getOptionsDiagnostics(cancellationToken).concat( - program.getGlobalDiagnostics(cancellationToken)); + return [...program.getOptionsDiagnostics(cancellationToken), ...program.getGlobalDiagnostics(cancellationToken)]; } function getCompletionsAtPosition(fileName: string, position: number): CompletionInfo { diff --git a/src/services/shims.ts b/src/services/shims.ts index 40d4ff2e93597..9851d8e6c890d 100644 --- a/src/services/shims.ts +++ b/src/services/shims.ts @@ -568,7 +568,7 @@ namespace ts { } } - export function realizeDiagnostics(diagnostics: Diagnostic[], newLine: string): { message: string; start: number; length: number; category: string; code: number; }[] { + export function realizeDiagnostics(diagnostics: ReadonlyArray, newLine: string): { message: string; start: number; length: number; category: string; code: number; }[] { return diagnostics.map(d => realizeDiagnostic(d, newLine)); } @@ -641,7 +641,7 @@ namespace ts { }); } - private realizeDiagnostics(diagnostics: Diagnostic[]): { message: string; start: number; length: number; category: string; }[] { + private realizeDiagnostics(diagnostics: ReadonlyArray): { message: string; start: number; length: number; category: string; }[] { const newLine = getNewLineOrDefaultFromHost(this.host); return ts.realizeDiagnostics(diagnostics, newLine); } diff --git a/src/services/types.ts b/src/services/types.ts index f4f323b8e9f71..609eaf11de507 100644 --- a/src/services/types.ts +++ b/src/services/types.ts @@ -68,7 +68,7 @@ namespace ts { getLineAndCharacterOfPosition(pos: number): LineAndCharacter; getLineEndOfPosition(pos: number): number; - getLineStarts(): number[]; + getLineStarts(): ReadonlyArray; getPositionOfLineAndCharacter(line: number, character: number): number; update(newText: string, textChangeRange: TextChangeRange): SourceFile; } From c4ed55459773092597d0dc1cb500bf176daa62d0 Mon Sep 17 00:00:00 2001 From: Andy Date: Thu, 24 Aug 2017 10:27:07 -0700 Subject: [PATCH 228/237] Simplify `isExpression` check (#17741) --- src/compiler/checker.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 4a07f349c9a89..24a9a868c4aa2 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -15220,7 +15220,7 @@ namespace ts { // example, given a 'function wrap(cb: (x: T) => U): (x: T) => U' and a call expression // 'let f: (x: string) => number = wrap(s => s.length)', we infer from the declared type of 'f' to the // return type of 'wrap'. - if (isExpression(node)) { + if (node.kind !== SyntaxKind.Decorator) { const contextualType = getContextualType(node); if (contextualType) { // We clone the contextual mapper to avoid disturbing a resolution in progress for an From 610104bef8ab3493daa0595d099321556aad7b0d Mon Sep 17 00:00:00 2001 From: Ron Buckton Date: Thu, 24 Aug 2017 13:40:20 -0700 Subject: [PATCH 229/237] Switch to arrow for ts class wrapper IIFE --- src/compiler/factory.ts | 43 +++++++++++++- src/compiler/transformers/es2015.ts | 59 ++----------------- src/compiler/transformers/ts.ts | 5 +- src/compiler/types.ts | 1 + src/compiler/utilities.ts | 6 +- .../reference/decoratorOnClassMethod11.js | 1 + .../reference/decoratorOnClassMethod12.js | 1 + .../inferringClassMembersFromAssignments.js | 1 + tests/baselines/reference/superAccess2.js | 1 + ...thisInArrowFunctionInStaticInitializer1.js | 1 + .../reference/thisInConstructorParameter2.js | 1 + .../reference/thisInInvalidContexts.js | 1 + .../thisInInvalidContextsExternalModule.js | 1 + .../reference/thisInOuterClassBody.js | 1 + .../reference/typeOfThisInStaticMembers2.js | 1 + 15 files changed, 64 insertions(+), 60 deletions(-) diff --git a/src/compiler/factory.ts b/src/compiler/factory.ts index 9d7f6c82a7ae7..4492c3ed47426 100644 --- a/src/compiler/factory.ts +++ b/src/compiler/factory.ts @@ -2372,6 +2372,24 @@ namespace ts { ); } + export function createImmediatelyInvokedArrowFunction(statements: Statement[]): CallExpression; + export function createImmediatelyInvokedArrowFunction(statements: Statement[], param: ParameterDeclaration, paramValue: Expression): CallExpression; + export function createImmediatelyInvokedArrowFunction(statements: Statement[], param?: ParameterDeclaration, paramValue?: Expression) { + return createCall( + createArrowFunction( + /*modifiers*/ undefined, + /*typeParameters*/ undefined, + /*parameters*/ param ? [param] : [], + /*type*/ undefined, + /*equalsGreaterThanToken*/ undefined, + createBlock(statements, /*multiLine*/ true) + ), + /*typeArguments*/ undefined, + /*argumentsArray*/ paramValue ? [paramValue] : [] + ); + } + + export function createComma(left: Expression, right: Expression) { return createBinary(left, SyntaxKind.CommaToken, right); } @@ -4036,8 +4054,31 @@ namespace ts { } } + /** + * Determines whether a node is a parenthesized expression that can be ignored when recreating outer expressions. + * + * A parenthesized expression can be ignored when all of the following are true: + * + * - It's `pos` and `end` are not -1 + * - It does not have a custom source map range + * - It does not have a custom comment range + * - It does not have synthetic leading or trailing comments + * + * If an outermost parenthesized expression is ignored, but the containing expression requires a parentheses around + * the expression to maintain precedence, a new parenthesized expression should be created automatically when + * the containing expression is created/updated. + */ + function isIgnorableParen(node: Expression) { + return node.kind === SyntaxKind.ParenthesizedExpression + && nodeIsSynthesized(node) + && nodeIsSynthesized(getSourceMapRange(node)) + && nodeIsSynthesized(getCommentRange(node)) + && !some(getSyntheticLeadingComments(node)) + && !some(getSyntheticTrailingComments(node)); + } + export function recreateOuterExpressions(outerExpression: Expression | undefined, innerExpression: Expression, kinds = OuterExpressionKinds.All): Expression { - if (outerExpression && isOuterExpression(outerExpression, kinds)) { + if (outerExpression && isOuterExpression(outerExpression, kinds) && !isIgnorableParen(outerExpression)) { return updateOuterExpression( outerExpression, recreateOuterExpressions(outerExpression.expression, innerExpression) diff --git a/src/compiler/transformers/es2015.ts b/src/compiler/transformers/es2015.ts index ce907d49bee8d..e9c84be51766a 100644 --- a/src/compiler/transformers/es2015.ts +++ b/src/compiler/transformers/es2015.ts @@ -339,64 +339,12 @@ namespace ts { && !(node).expression; } - function isClassLikeVariableStatement(node: Node) { - if (!isVariableStatement(node)) return false; - const variable = singleOrUndefined((node).declarationList.declarations); - return variable - && variable.initializer - && isIdentifier(variable.name) - && (isClassLike(variable.initializer) - || (isAssignmentExpression(variable.initializer) - && isIdentifier(variable.initializer.left) - && isClassLike(variable.initializer.right))); - } - - function isTypeScriptClassWrapper(node: Node) { - const call = tryCast(node, isCallExpression); - if (!call || isParseTreeNode(call) || - some(call.typeArguments) || - some(call.arguments)) { - return false; - } - - const func = tryCast(skipOuterExpressions(call.expression), isFunctionExpression); - if (!func || isParseTreeNode(func) || - some(func.typeParameters) || - some(func.parameters) || - func.type || - !func.body) { - return false; - } - - const statements = func.body.statements; - if (statements.length < 2) { - return false; - } - - const firstStatement = statements[0]; - if (isParseTreeNode(firstStatement) || - !isClassLike(firstStatement) && - !isClassLikeVariableStatement(firstStatement)) { - return false; - } - - const lastStatement = elementAt(statements, -1); - const returnStatement = tryCast(isVariableStatement(lastStatement) ? elementAt(statements, -2) : lastStatement, isReturnStatement); - if (!returnStatement || - !returnStatement.expression || - !isIdentifier(skipOuterExpressions(returnStatement.expression))) { - return false; - } - - return true; - } - function shouldVisitNode(node: Node): boolean { return (node.transformFlags & TransformFlags.ContainsES2015) !== 0 || convertedLoopState !== undefined || (hierarchyFacts & HierarchyFacts.ConstructorWithCapturedSuper && (isStatement(node) || (node.kind === SyntaxKind.Block))) || (isIterationStatement(node, /*lookInLabeledStatements*/ false) && shouldConvertIterationStatementBody(node)) - || isTypeScriptClassWrapper(node); + || (getEmitFlags(node) & EmitFlags.TypeScriptClassWrapper) !== 0; } function visitor(node: Node): VisitResult { @@ -3308,13 +3256,14 @@ namespace ts { * @param node a CallExpression. */ function visitCallExpression(node: CallExpression) { - if (isTypeScriptClassWrapper(node)) { + if (getEmitFlags(node) & EmitFlags.TypeScriptClassWrapper) { return visitTypeScriptClassWrapper(node); } if (node.transformFlags & TransformFlags.ES2015) { return visitCallExpressionWithPotentialCapturedThisAssignment(node, /*assignToCapturedThis*/ true); } + return updateCall( node, visitNode(node.expression, callExpressionVisitor, isExpression), @@ -3357,7 +3306,7 @@ namespace ts { // We skip any outer expressions in a number of places to get to the innermost // expression, but we will restore them later to preserve comments and source maps. - const body = cast(skipOuterExpressions(node.expression), isFunctionExpression).body; + const body = cast(cast(skipOuterExpressions(node.expression), isArrowFunction).body, isBlock); // The class statements are the statements generated by visiting the first statement of the // body (1), while all other statements are added to remainingStatements (2) diff --git a/src/compiler/transformers/ts.ts b/src/compiler/transformers/ts.ts index 4c679ea1eee84..71a3c7dcb7a0a 100644 --- a/src/compiler/transformers/ts.ts +++ b/src/compiler/transformers/ts.ts @@ -613,13 +613,16 @@ namespace ts { addRange(statements, context.endLexicalEnvironment()); + const iife = createImmediatelyInvokedArrowFunction(statements); + setEmitFlags(iife, EmitFlags.TypeScriptClassWrapper); + const varStatement = createVariableStatement( /*modifiers*/ undefined, createVariableDeclarationList([ createVariableDeclaration( getLocalName(node, /*allowComments*/ false, /*allowSourceMaps*/ false), /*type*/ undefined, - createImmediatelyInvokedFunctionExpression(statements) + iife ) ]) ); diff --git a/src/compiler/types.ts b/src/compiler/types.ts index fe18839b9048c..3ef38e0e4b741 100644 --- a/src/compiler/types.ts +++ b/src/compiler/types.ts @@ -4184,6 +4184,7 @@ namespace ts { HasEndOfDeclarationMarker = 1 << 22, // Declaration has an associated NotEmittedStatement to mark the end of the declaration Iterator = 1 << 23, // The expression to a `yield*` should be treated as an Iterator when down-leveling, not an Iterable. NoAsciiEscaping = 1 << 24, // When synthesizing nodes that lack an original node or textSourceNode, we want to write the text on the node with ASCII escaping substitutions. + /*@internal*/ TypeScriptClassWrapper = 1 << 25, // The node is an IIFE class wrapper created by the ts transform. } export interface EmitHelper { diff --git a/src/compiler/utilities.ts b/src/compiler/utilities.ts index d906ab4f6b1e7..de752faaf6ae8 100644 --- a/src/compiler/utilities.ts +++ b/src/compiler/utilities.ts @@ -2068,9 +2068,9 @@ namespace ts { || kind === SyntaxKind.SourceFile; } - export function nodeIsSynthesized(node: TextRange): boolean { - return positionIsSynthesized(node.pos) - || positionIsSynthesized(node.end); + export function nodeIsSynthesized(range: TextRange): boolean { + return positionIsSynthesized(range.pos) + || positionIsSynthesized(range.end); } export function getOriginalSourceFile(sourceFile: SourceFile) { diff --git a/tests/baselines/reference/decoratorOnClassMethod11.js b/tests/baselines/reference/decoratorOnClassMethod11.js index 2600681c64746..e29c4076c9154 100644 --- a/tests/baselines/reference/decoratorOnClassMethod11.js +++ b/tests/baselines/reference/decoratorOnClassMethod11.js @@ -17,6 +17,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key, }; var M; (function (M) { + var _this = this; var C = /** @class */ (function () { function C() { } diff --git a/tests/baselines/reference/decoratorOnClassMethod12.js b/tests/baselines/reference/decoratorOnClassMethod12.js index 494cb083a20f3..0063e0225bc44 100644 --- a/tests/baselines/reference/decoratorOnClassMethod12.js +++ b/tests/baselines/reference/decoratorOnClassMethod12.js @@ -28,6 +28,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key, }; var M; (function (M) { + var _this = this; var S = /** @class */ (function () { function S() { } diff --git a/tests/baselines/reference/inferringClassMembersFromAssignments.js b/tests/baselines/reference/inferringClassMembersFromAssignments.js index 3fa72bce2cf5b..90f87734b2e1e 100644 --- a/tests/baselines/reference/inferringClassMembersFromAssignments.js +++ b/tests/baselines/reference/inferringClassMembersFromAssignments.js @@ -124,6 +124,7 @@ var stringOrNumberOrUndefined = C.inStaticNestedArrowFunction; //// [output.js] +var _this = this; var C = /** @class */ (function () { function C() { var _this = this; diff --git a/tests/baselines/reference/superAccess2.js b/tests/baselines/reference/superAccess2.js index de755361a16ca..d3aac217e2229 100644 --- a/tests/baselines/reference/superAccess2.js +++ b/tests/baselines/reference/superAccess2.js @@ -35,6 +35,7 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); +var _this = this; var P = /** @class */ (function () { function P() { } diff --git a/tests/baselines/reference/thisInArrowFunctionInStaticInitializer1.js b/tests/baselines/reference/thisInArrowFunctionInStaticInitializer1.js index 97e958ace5ec1..2d58fd455ac4a 100644 --- a/tests/baselines/reference/thisInArrowFunctionInStaticInitializer1.js +++ b/tests/baselines/reference/thisInArrowFunctionInStaticInitializer1.js @@ -9,6 +9,7 @@ class Vector { } //// [thisInArrowFunctionInStaticInitializer1.js] +var _this = this; function log(a) { } var Vector = /** @class */ (function () { function Vector() { diff --git a/tests/baselines/reference/thisInConstructorParameter2.js b/tests/baselines/reference/thisInConstructorParameter2.js index 6a27183800c2d..a5e4f4d8b5712 100644 --- a/tests/baselines/reference/thisInConstructorParameter2.js +++ b/tests/baselines/reference/thisInConstructorParameter2.js @@ -10,6 +10,7 @@ class P { } //// [thisInConstructorParameter2.js] +var _this = this; var P = /** @class */ (function () { function P(z, zz) { if (z === void 0) { z = this; } diff --git a/tests/baselines/reference/thisInInvalidContexts.js b/tests/baselines/reference/thisInInvalidContexts.js index 635eff25cf4a1..1e24cc4d9e2c2 100644 --- a/tests/baselines/reference/thisInInvalidContexts.js +++ b/tests/baselines/reference/thisInInvalidContexts.js @@ -59,6 +59,7 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); +var _this = this; //'this' in static member initializer var ErrClass1 = /** @class */ (function () { function ErrClass1() { diff --git a/tests/baselines/reference/thisInInvalidContextsExternalModule.js b/tests/baselines/reference/thisInInvalidContextsExternalModule.js index ea69a582730e3..daadace2cfa09 100644 --- a/tests/baselines/reference/thisInInvalidContextsExternalModule.js +++ b/tests/baselines/reference/thisInInvalidContextsExternalModule.js @@ -60,6 +60,7 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); +var _this = this; //'this' in static member initializer var ErrClass1 = /** @class */ (function () { function ErrClass1() { diff --git a/tests/baselines/reference/thisInOuterClassBody.js b/tests/baselines/reference/thisInOuterClassBody.js index 2b4e3a1aabdb6..d5bf689b49a13 100644 --- a/tests/baselines/reference/thisInOuterClassBody.js +++ b/tests/baselines/reference/thisInOuterClassBody.js @@ -21,6 +21,7 @@ class Foo { } //// [thisInOuterClassBody.js] +var _this = this; var Foo = /** @class */ (function () { function Foo() { this.x = this; diff --git a/tests/baselines/reference/typeOfThisInStaticMembers2.js b/tests/baselines/reference/typeOfThisInStaticMembers2.js index 72243cdd3e619..1cfec3a3fa1d6 100644 --- a/tests/baselines/reference/typeOfThisInStaticMembers2.js +++ b/tests/baselines/reference/typeOfThisInStaticMembers2.js @@ -8,6 +8,7 @@ class C2 { } //// [typeOfThisInStaticMembers2.js] +var _this = this; var C = /** @class */ (function () { function C() { } From ccd0158c406727d7a1ec81bdc579e8c6e6607f9d Mon Sep 17 00:00:00 2001 From: Ron Buckton Date: Thu, 24 Aug 2017 15:06:06 -0700 Subject: [PATCH 230/237] Added additional test --- .../reference/asyncArrowInClassES5.js | 21 +++++++++++++++++++ .../reference/asyncArrowInClassES5.symbols | 12 +++++++++++ .../reference/asyncArrowInClassES5.types | 13 ++++++++++++ tests/cases/compiler/asyncArrowInClassES5.ts | 9 ++++++++ 4 files changed, 55 insertions(+) create mode 100644 tests/baselines/reference/asyncArrowInClassES5.js create mode 100644 tests/baselines/reference/asyncArrowInClassES5.symbols create mode 100644 tests/baselines/reference/asyncArrowInClassES5.types create mode 100644 tests/cases/compiler/asyncArrowInClassES5.ts diff --git a/tests/baselines/reference/asyncArrowInClassES5.js b/tests/baselines/reference/asyncArrowInClassES5.js new file mode 100644 index 0000000000000..f0204f7319bda --- /dev/null +++ b/tests/baselines/reference/asyncArrowInClassES5.js @@ -0,0 +1,21 @@ +//// [asyncArrowInClassES5.ts] +// https://github.com/Microsoft/TypeScript/issues/16924 +// Should capture `this` + +class Test { + static member = async (x: string) => { }; +} + + +//// [asyncArrowInClassES5.js] +// https://github.com/Microsoft/TypeScript/issues/16924 +// Should capture `this` +var _this = this; +var Test = /** @class */ (function () { + function Test() { + } + Test.member = function (x) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) { + return [2 /*return*/]; + }); }); }; + return Test; +}()); diff --git a/tests/baselines/reference/asyncArrowInClassES5.symbols b/tests/baselines/reference/asyncArrowInClassES5.symbols new file mode 100644 index 0000000000000..a6cc9f75d6e3a --- /dev/null +++ b/tests/baselines/reference/asyncArrowInClassES5.symbols @@ -0,0 +1,12 @@ +=== tests/cases/compiler/asyncArrowInClassES5.ts === +// https://github.com/Microsoft/TypeScript/issues/16924 +// Should capture `this` + +class Test { +>Test : Symbol(Test, Decl(asyncArrowInClassES5.ts, 0, 0)) + + static member = async (x: string) => { }; +>member : Symbol(Test.member, Decl(asyncArrowInClassES5.ts, 3, 12)) +>x : Symbol(x, Decl(asyncArrowInClassES5.ts, 4, 27)) +} + diff --git a/tests/baselines/reference/asyncArrowInClassES5.types b/tests/baselines/reference/asyncArrowInClassES5.types new file mode 100644 index 0000000000000..8da6d5d2eaf26 --- /dev/null +++ b/tests/baselines/reference/asyncArrowInClassES5.types @@ -0,0 +1,13 @@ +=== tests/cases/compiler/asyncArrowInClassES5.ts === +// https://github.com/Microsoft/TypeScript/issues/16924 +// Should capture `this` + +class Test { +>Test : Test + + static member = async (x: string) => { }; +>member : (x: string) => Promise +>async (x: string) => { } : (x: string) => Promise +>x : string +} + diff --git a/tests/cases/compiler/asyncArrowInClassES5.ts b/tests/cases/compiler/asyncArrowInClassES5.ts new file mode 100644 index 0000000000000..2712372d35706 --- /dev/null +++ b/tests/cases/compiler/asyncArrowInClassES5.ts @@ -0,0 +1,9 @@ +// @noEmitHelpers: true +// @lib: es2015 +// @target: es5 +// https://github.com/Microsoft/TypeScript/issues/16924 +// Should capture `this` + +class Test { + static member = async (x: string) => { }; +} From 2f1bd8cff91210584f5952e5228050aebb83122b Mon Sep 17 00:00:00 2001 From: Wesley Wigham Date: Thu, 24 Aug 2017 15:52:04 -0700 Subject: [PATCH 231/237] Escape \0 followed by a number as a hex escape to avoid printing an octal literal (#18026) --- src/compiler/utilities.ts | 7 ++++++- ...uldNotPrintNullEscapesIntoOctalLiterals.js | 15 +++++++++++++++ ...tPrintNullEscapesIntoOctalLiterals.symbols | 8 ++++++++ ...NotPrintNullEscapesIntoOctalLiterals.types | 19 +++++++++++++++++++ ...uldNotPrintNullEscapesIntoOctalLiterals.ts | 6 ++++++ 5 files changed, 54 insertions(+), 1 deletion(-) create mode 100644 tests/baselines/reference/shouldNotPrintNullEscapesIntoOctalLiterals.js create mode 100644 tests/baselines/reference/shouldNotPrintNullEscapesIntoOctalLiterals.symbols create mode 100644 tests/baselines/reference/shouldNotPrintNullEscapesIntoOctalLiterals.types create mode 100644 tests/cases/compiler/shouldNotPrintNullEscapesIntoOctalLiterals.ts diff --git a/src/compiler/utilities.ts b/src/compiler/utilities.ts index d906ab4f6b1e7..6d53f9e8e996c 100644 --- a/src/compiler/utilities.ts +++ b/src/compiler/utilities.ts @@ -2380,6 +2380,7 @@ namespace ts { "\u2029": "\\u2029", // paragraphSeparator "\u0085": "\\u0085" // nextLine }); + const escapedNullRegExp = /\\0[0-9]/g; /** * Based heavily on the abstract 'Quote'/'QuoteJSONString' operation from ECMA-262 (24.3.2.2), @@ -2391,7 +2392,11 @@ namespace ts { quoteChar === CharacterCodes.backtick ? backtickQuoteEscapedCharsRegExp : quoteChar === CharacterCodes.singleQuote ? singleQuoteEscapedCharsRegExp : doubleQuoteEscapedCharsRegExp; - return s.replace(escapedCharsRegExp, getReplacement); + return s.replace(escapedCharsRegExp, getReplacement).replace(escapedNullRegExp, nullReplacement); + } + + function nullReplacement(c: string) { + return "\\x00" + c.charAt(c.length - 1); } function getReplacement(c: string) { diff --git a/tests/baselines/reference/shouldNotPrintNullEscapesIntoOctalLiterals.js b/tests/baselines/reference/shouldNotPrintNullEscapesIntoOctalLiterals.js new file mode 100644 index 0000000000000..4654558135c94 --- /dev/null +++ b/tests/baselines/reference/shouldNotPrintNullEscapesIntoOctalLiterals.js @@ -0,0 +1,15 @@ +//// [shouldNotPrintNullEscapesIntoOctalLiterals.ts] +"use strict"; +`\x001`; +`\u00001`; +`\u{00000000}1`; +`\u{000000}1`; +`\u{0}1`; + +//// [shouldNotPrintNullEscapesIntoOctalLiterals.js] +"use strict"; +"\x001"; +"\x001"; +"\x001"; +"\x001"; +"\x001"; diff --git a/tests/baselines/reference/shouldNotPrintNullEscapesIntoOctalLiterals.symbols b/tests/baselines/reference/shouldNotPrintNullEscapesIntoOctalLiterals.symbols new file mode 100644 index 0000000000000..3ffb259aed0c9 --- /dev/null +++ b/tests/baselines/reference/shouldNotPrintNullEscapesIntoOctalLiterals.symbols @@ -0,0 +1,8 @@ +=== tests/cases/compiler/shouldNotPrintNullEscapesIntoOctalLiterals.ts === +"use strict"; +No type information for this code.`\x001`; +No type information for this code.`\u00001`; +No type information for this code.`\u{00000000}1`; +No type information for this code.`\u{000000}1`; +No type information for this code.`\u{0}1`; +No type information for this code. \ No newline at end of file diff --git a/tests/baselines/reference/shouldNotPrintNullEscapesIntoOctalLiterals.types b/tests/baselines/reference/shouldNotPrintNullEscapesIntoOctalLiterals.types new file mode 100644 index 0000000000000..8f76e66255853 --- /dev/null +++ b/tests/baselines/reference/shouldNotPrintNullEscapesIntoOctalLiterals.types @@ -0,0 +1,19 @@ +=== tests/cases/compiler/shouldNotPrintNullEscapesIntoOctalLiterals.ts === +"use strict"; +>"use strict" : "use strict" + +`\x001`; +>`\x001` : "\x001" + +`\u00001`; +>`\u00001` : "\x001" + +`\u{00000000}1`; +>`\u{00000000}1` : "\x001" + +`\u{000000}1`; +>`\u{000000}1` : "\x001" + +`\u{0}1`; +>`\u{0}1` : "\x001" + diff --git a/tests/cases/compiler/shouldNotPrintNullEscapesIntoOctalLiterals.ts b/tests/cases/compiler/shouldNotPrintNullEscapesIntoOctalLiterals.ts new file mode 100644 index 0000000000000..fbbab43319a8b --- /dev/null +++ b/tests/cases/compiler/shouldNotPrintNullEscapesIntoOctalLiterals.ts @@ -0,0 +1,6 @@ +"use strict"; +`\x001`; +`\u00001`; +`\u{00000000}1`; +`\u{000000}1`; +`\u{0}1`; \ No newline at end of file From 336df751eab01595e451b0de6e5c9ecf551083b0 Mon Sep 17 00:00:00 2001 From: Wesley Wigham Date: Thu, 24 Aug 2017 15:53:09 -0700 Subject: [PATCH 232/237] Fix issue #16803 do not error on getters/setters (#18031) --- src/compiler/checker.ts | 17 ++++++++++----- src/compiler/core.ts | 4 ++++ .../exportEqualsClassNoRedeclarationError.js | 19 +++++++++++++++++ ...ortEqualsClassNoRedeclarationError.symbols | 17 +++++++++++++++ ...xportEqualsClassNoRedeclarationError.types | 18 ++++++++++++++++ ...rtEqualsClassRedeclarationError.errors.txt | 21 +++++++++++++++++++ .../exportEqualsClassRedeclarationError.js | 21 +++++++++++++++++++ .../exportEqualsClassNoRedeclarationError.ts | 10 +++++++++ .../exportEqualsClassRedeclarationError.ts | 11 ++++++++++ 9 files changed, 133 insertions(+), 5 deletions(-) create mode 100644 tests/baselines/reference/exportEqualsClassNoRedeclarationError.js create mode 100644 tests/baselines/reference/exportEqualsClassNoRedeclarationError.symbols create mode 100644 tests/baselines/reference/exportEqualsClassNoRedeclarationError.types create mode 100644 tests/baselines/reference/exportEqualsClassRedeclarationError.errors.txt create mode 100644 tests/baselines/reference/exportEqualsClassRedeclarationError.js create mode 100644 tests/cases/compiler/exportEqualsClassNoRedeclarationError.ts create mode 100644 tests/cases/compiler/exportEqualsClassRedeclarationError.ts diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 24a9a868c4aa2..21db77b5e391c 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -497,6 +497,8 @@ namespace ts { const builtinGlobals = createSymbolTable(); builtinGlobals.set(undefinedSymbol.escapedName, undefinedSymbol); + const isNotOverloadAndNotAccessor = and(isNotOverload, isNotAccessor); + initializeTypeChecker(); return checker; @@ -22257,7 +22259,7 @@ namespace ts { if (flags & (SymbolFlags.Namespace | SymbolFlags.Interface | SymbolFlags.Enum)) { return; } - const exportedDeclarationsCount = countWhere(declarations, isNotOverload); + const exportedDeclarationsCount = countWhere(declarations, isNotOverloadAndNotAccessor); if (flags & SymbolFlags.TypeAlias && exportedDeclarationsCount <= 2) { // it is legal to merge type alias with other values // so count should be either 1 (just type alias) or 2 (type alias + merged value) @@ -22273,11 +22275,16 @@ namespace ts { }); links.exportsChecked = true; } + } - function isNotOverload(declaration: Declaration): boolean { - return (declaration.kind !== SyntaxKind.FunctionDeclaration && declaration.kind !== SyntaxKind.MethodDeclaration) || - !!(declaration as FunctionDeclaration).body; - } + function isNotAccessor(declaration: Declaration): boolean { + // Accessors check for their own matching duplicates, and in contexts where they are valid, there are already duplicate identifier checks + return !isAccessor(declaration); + } + + function isNotOverload(declaration: Declaration): boolean { + return (declaration.kind !== SyntaxKind.FunctionDeclaration && declaration.kind !== SyntaxKind.MethodDeclaration) || + !!(declaration as FunctionDeclaration).body; } function checkSourceElement(node: Node): void { diff --git a/src/compiler/core.ts b/src/compiler/core.ts index 6eb17f1fb782f..f94ac9a75c5e2 100644 --- a/src/compiler/core.ts +++ b/src/compiler/core.ts @@ -2626,4 +2626,8 @@ namespace ts { export function isCheckJsEnabledForFile(sourceFile: SourceFile, compilerOptions: CompilerOptions) { return sourceFile.checkJsDirective ? sourceFile.checkJsDirective.enabled : compilerOptions.checkJs; } + + export function and(f: (arg: T) => boolean, g: (arg: T) => boolean) { + return (arg: T) => f(arg) && g(arg); + } } diff --git a/tests/baselines/reference/exportEqualsClassNoRedeclarationError.js b/tests/baselines/reference/exportEqualsClassNoRedeclarationError.js new file mode 100644 index 0000000000000..834d10a48d673 --- /dev/null +++ b/tests/baselines/reference/exportEqualsClassNoRedeclarationError.js @@ -0,0 +1,19 @@ +//// [exportEqualsClassNoRedeclarationError.ts] +class SomeClass { + static get someProp(): number { + return 0; + } + + static set someProp(value: number) {} +} +export = SomeClass; + +//// [exportEqualsClassNoRedeclarationError.js] +"use strict"; +class SomeClass { + static get someProp() { + return 0; + } + static set someProp(value) { } +} +module.exports = SomeClass; diff --git a/tests/baselines/reference/exportEqualsClassNoRedeclarationError.symbols b/tests/baselines/reference/exportEqualsClassNoRedeclarationError.symbols new file mode 100644 index 0000000000000..386efa1bdaa7a --- /dev/null +++ b/tests/baselines/reference/exportEqualsClassNoRedeclarationError.symbols @@ -0,0 +1,17 @@ +=== tests/cases/compiler/exportEqualsClassNoRedeclarationError.ts === +class SomeClass { +>SomeClass : Symbol(SomeClass, Decl(exportEqualsClassNoRedeclarationError.ts, 0, 0)) + + static get someProp(): number { +>someProp : Symbol(SomeClass.someProp, Decl(exportEqualsClassNoRedeclarationError.ts, 0, 17), Decl(exportEqualsClassNoRedeclarationError.ts, 3, 5)) + + return 0; + } + + static set someProp(value: number) {} +>someProp : Symbol(SomeClass.someProp, Decl(exportEqualsClassNoRedeclarationError.ts, 0, 17), Decl(exportEqualsClassNoRedeclarationError.ts, 3, 5)) +>value : Symbol(value, Decl(exportEqualsClassNoRedeclarationError.ts, 5, 24)) +} +export = SomeClass; +>SomeClass : Symbol(SomeClass, Decl(exportEqualsClassNoRedeclarationError.ts, 0, 0)) + diff --git a/tests/baselines/reference/exportEqualsClassNoRedeclarationError.types b/tests/baselines/reference/exportEqualsClassNoRedeclarationError.types new file mode 100644 index 0000000000000..cba7b57a4e872 --- /dev/null +++ b/tests/baselines/reference/exportEqualsClassNoRedeclarationError.types @@ -0,0 +1,18 @@ +=== tests/cases/compiler/exportEqualsClassNoRedeclarationError.ts === +class SomeClass { +>SomeClass : SomeClass + + static get someProp(): number { +>someProp : number + + return 0; +>0 : 0 + } + + static set someProp(value: number) {} +>someProp : number +>value : number +} +export = SomeClass; +>SomeClass : SomeClass + diff --git a/tests/baselines/reference/exportEqualsClassRedeclarationError.errors.txt b/tests/baselines/reference/exportEqualsClassRedeclarationError.errors.txt new file mode 100644 index 0000000000000..4eccf0cc1ca92 --- /dev/null +++ b/tests/baselines/reference/exportEqualsClassRedeclarationError.errors.txt @@ -0,0 +1,21 @@ +tests/cases/compiler/exportEqualsClassRedeclarationError.ts(2,16): error TS2300: Duplicate identifier 'someProp'. +tests/cases/compiler/exportEqualsClassRedeclarationError.ts(6,16): error TS2300: Duplicate identifier 'someProp'. +tests/cases/compiler/exportEqualsClassRedeclarationError.ts(7,16): error TS2300: Duplicate identifier 'someProp'. + + +==== tests/cases/compiler/exportEqualsClassRedeclarationError.ts (3 errors) ==== + class SomeClass { + static get someProp(): number { + ~~~~~~~~ +!!! error TS2300: Duplicate identifier 'someProp'. + return 0; + } + + static set someProp(value: number) {} + ~~~~~~~~ +!!! error TS2300: Duplicate identifier 'someProp'. + static set someProp(value: number) {} + ~~~~~~~~ +!!! error TS2300: Duplicate identifier 'someProp'. + } + export = SomeClass; \ No newline at end of file diff --git a/tests/baselines/reference/exportEqualsClassRedeclarationError.js b/tests/baselines/reference/exportEqualsClassRedeclarationError.js new file mode 100644 index 0000000000000..f0134c466269d --- /dev/null +++ b/tests/baselines/reference/exportEqualsClassRedeclarationError.js @@ -0,0 +1,21 @@ +//// [exportEqualsClassRedeclarationError.ts] +class SomeClass { + static get someProp(): number { + return 0; + } + + static set someProp(value: number) {} + static set someProp(value: number) {} +} +export = SomeClass; + +//// [exportEqualsClassRedeclarationError.js] +"use strict"; +class SomeClass { + static get someProp() { + return 0; + } + static set someProp(value) { } + static set someProp(value) { } +} +module.exports = SomeClass; diff --git a/tests/cases/compiler/exportEqualsClassNoRedeclarationError.ts b/tests/cases/compiler/exportEqualsClassNoRedeclarationError.ts new file mode 100644 index 0000000000000..0e5c582411175 --- /dev/null +++ b/tests/cases/compiler/exportEqualsClassNoRedeclarationError.ts @@ -0,0 +1,10 @@ +// @target: es6 +// @module: commonjs +class SomeClass { + static get someProp(): number { + return 0; + } + + static set someProp(value: number) {} +} +export = SomeClass; \ No newline at end of file diff --git a/tests/cases/compiler/exportEqualsClassRedeclarationError.ts b/tests/cases/compiler/exportEqualsClassRedeclarationError.ts new file mode 100644 index 0000000000000..237aca399f098 --- /dev/null +++ b/tests/cases/compiler/exportEqualsClassRedeclarationError.ts @@ -0,0 +1,11 @@ +// @target: es6 +// @module: commonjs +class SomeClass { + static get someProp(): number { + return 0; + } + + static set someProp(value: number) {} + static set someProp(value: number) {} +} +export = SomeClass; \ No newline at end of file From f824e7214ddda789baa6379ff599c5f5012a42b6 Mon Sep 17 00:00:00 2001 From: Wesley Wigham Date: Thu, 24 Aug 2017 16:48:11 -0700 Subject: [PATCH 233/237] Give mapped type properties a synthetic declaration name (#18023) * Escape symbol names which are not valid identifiers and wrap them in quotes * Pass forward type, do work in getNameOfSymbol * Minimal test * Fix nit --- src/compiler/checker.ts | 16 +++++++++++++++- src/compiler/types.ts | 1 + .../reference/declarationQuotedMembers.js | 17 +++++++++++++++++ .../reference/declarationQuotedMembers.symbols | 9 +++++++++ .../reference/declarationQuotedMembers.types | 9 +++++++++ .../cases/compiler/declarationQuotedMembers.ts | 3 +++ 6 files changed, 54 insertions(+), 1 deletion(-) create mode 100644 tests/baselines/reference/declarationQuotedMembers.js create mode 100644 tests/baselines/reference/declarationQuotedMembers.symbols create mode 100644 tests/baselines/reference/declarationQuotedMembers.types create mode 100644 tests/cases/compiler/declarationQuotedMembers.ts diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 21db77b5e391c..55d26bb48ea34 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -3114,6 +3114,12 @@ namespace ts { return "(Anonymous function)"; } } + if ((symbol as TransientSymbol).syntheticLiteralTypeOrigin) { + const stringValue = (symbol as TransientSymbol).syntheticLiteralTypeOrigin.value; + if (!isIdentifierText(stringValue, compilerOptions.target)) { + return `"${escapeString(stringValue, CharacterCodes.doubleQuote)}"`; + } + } return unescapeLeadingUnderscores(symbol.escapedName); } @@ -5724,7 +5730,14 @@ namespace ts { } setStructuredTypeMembers(type, members, emptyArray, emptyArray, stringIndexInfo, undefined); - function addMemberForKeyType(t: Type, propertySymbol?: Symbol) { + function addMemberForKeyType(t: Type, propertySymbolOrIndex?: Symbol | number) { + let propertySymbol: Symbol; + // forEachType delegates to forEach, which calls with a numeric second argument + // the type system currently doesn't catch this incompatibility, so we annotate + // the function ourselves to indicate the runtime behavior and deal with it here + if (typeof propertySymbolOrIndex === "object") { + propertySymbol = propertySymbolOrIndex; + } // Create a mapper from T to the current iteration type constituent. Then, if the // mapped type is itself an instantiated type, combine the iteration mapper with the // instantiation mapper. @@ -5744,6 +5757,7 @@ namespace ts { prop.syntheticOrigin = propertySymbol; prop.declarations = propertySymbol.declarations; } + prop.syntheticLiteralTypeOrigin = t as StringLiteralType; members.set(propName, prop); } else if (t.flags & TypeFlags.String) { diff --git a/src/compiler/types.ts b/src/compiler/types.ts index fe18839b9048c..e3c8661deba35 100644 --- a/src/compiler/types.ts +++ b/src/compiler/types.ts @@ -2972,6 +2972,7 @@ namespace ts { leftSpread?: Symbol; // Left source for synthetic spread property rightSpread?: Symbol; // Right source for synthetic spread property syntheticOrigin?: Symbol; // For a property on a mapped or spread type, points back to the original property + syntheticLiteralTypeOrigin?: StringLiteralType; // For a property on a mapped type, indicates the type whose text to use as the declaration name, instead of the symbol name isDiscriminantProperty?: boolean; // True if discriminant synthetic property resolvedExports?: SymbolTable; // Resolved exports of module exportsChecked?: boolean; // True if exports of external module have been checked diff --git a/tests/baselines/reference/declarationQuotedMembers.js b/tests/baselines/reference/declarationQuotedMembers.js new file mode 100644 index 0000000000000..ab40231eb3ed5 --- /dev/null +++ b/tests/baselines/reference/declarationQuotedMembers.js @@ -0,0 +1,17 @@ +//// [declarationQuotedMembers.ts] +export declare const mapped: { [K in 'a-b-c']: number } +export const example = mapped; + +//// [declarationQuotedMembers.js] +"use strict"; +exports.__esModule = true; +exports.example = exports.mapped; + + +//// [declarationQuotedMembers.d.ts] +export declare const mapped: { + [K in 'a-b-c']: number; +}; +export declare const example: { + "a-b-c": number; +}; diff --git a/tests/baselines/reference/declarationQuotedMembers.symbols b/tests/baselines/reference/declarationQuotedMembers.symbols new file mode 100644 index 0000000000000..3bf1a2829b0de --- /dev/null +++ b/tests/baselines/reference/declarationQuotedMembers.symbols @@ -0,0 +1,9 @@ +=== tests/cases/compiler/declarationQuotedMembers.ts === +export declare const mapped: { [K in 'a-b-c']: number } +>mapped : Symbol(mapped, Decl(declarationQuotedMembers.ts, 0, 20)) +>K : Symbol(K, Decl(declarationQuotedMembers.ts, 0, 32)) + +export const example = mapped; +>example : Symbol(example, Decl(declarationQuotedMembers.ts, 1, 12)) +>mapped : Symbol(mapped, Decl(declarationQuotedMembers.ts, 0, 20)) + diff --git a/tests/baselines/reference/declarationQuotedMembers.types b/tests/baselines/reference/declarationQuotedMembers.types new file mode 100644 index 0000000000000..c9f6c047b7e5a --- /dev/null +++ b/tests/baselines/reference/declarationQuotedMembers.types @@ -0,0 +1,9 @@ +=== tests/cases/compiler/declarationQuotedMembers.ts === +export declare const mapped: { [K in 'a-b-c']: number } +>mapped : { a-b-c: number; } +>K : K + +export const example = mapped; +>example : { a-b-c: number; } +>mapped : { a-b-c: number; } + diff --git a/tests/cases/compiler/declarationQuotedMembers.ts b/tests/cases/compiler/declarationQuotedMembers.ts new file mode 100644 index 0000000000000..08bae2c3754d7 --- /dev/null +++ b/tests/cases/compiler/declarationQuotedMembers.ts @@ -0,0 +1,3 @@ +// @declaration: true +export declare const mapped: { [K in 'a-b-c']: number } +export const example = mapped; \ No newline at end of file From 643a7e7e3326a54ddf6fa590146ac8cfde4c6e98 Mon Sep 17 00:00:00 2001 From: Wesley Wigham Date: Thu, 24 Aug 2017 17:08:57 -0700 Subject: [PATCH 234/237] Call dynamic import transform on expression used by export equal statement (#18028) * Call dynamic import transform on expression used by export equal statement * Use Debug.fail --- src/compiler/transformers/module/module.ts | 46 +++++++++++-------- .../importCallExpressionInExportEqualsAMD.js | 22 +++++++++ ...ortCallExpressionInExportEqualsAMD.symbols | 10 ++++ ...mportCallExpressionInExportEqualsAMD.types | 14 ++++++ .../importCallExpressionInExportEqualsCJS.js | 18 ++++++++ ...ortCallExpressionInExportEqualsCJS.symbols | 10 ++++ ...mportCallExpressionInExportEqualsCJS.types | 14 ++++++ .../importCallExpressionInExportEqualsUMD.js | 39 ++++++++++++++++ ...ortCallExpressionInExportEqualsUMD.symbols | 10 ++++ ...mportCallExpressionInExportEqualsUMD.types | 14 ++++++ .../importCallExpressionInExportEqualsAMD.ts | 9 ++++ .../importCallExpressionInExportEqualsCJS.ts | 9 ++++ .../importCallExpressionInExportEqualsUMD.ts | 9 ++++ 13 files changed, 204 insertions(+), 20 deletions(-) create mode 100644 tests/baselines/reference/importCallExpressionInExportEqualsAMD.js create mode 100644 tests/baselines/reference/importCallExpressionInExportEqualsAMD.symbols create mode 100644 tests/baselines/reference/importCallExpressionInExportEqualsAMD.types create mode 100644 tests/baselines/reference/importCallExpressionInExportEqualsCJS.js create mode 100644 tests/baselines/reference/importCallExpressionInExportEqualsCJS.symbols create mode 100644 tests/baselines/reference/importCallExpressionInExportEqualsCJS.types create mode 100644 tests/baselines/reference/importCallExpressionInExportEqualsUMD.js create mode 100644 tests/baselines/reference/importCallExpressionInExportEqualsUMD.symbols create mode 100644 tests/baselines/reference/importCallExpressionInExportEqualsUMD.types create mode 100644 tests/cases/conformance/dynamicImport/importCallExpressionInExportEqualsAMD.ts create mode 100644 tests/cases/conformance/dynamicImport/importCallExpressionInExportEqualsCJS.ts create mode 100644 tests/cases/conformance/dynamicImport/importCallExpressionInExportEqualsUMD.ts diff --git a/src/compiler/transformers/module/module.ts b/src/compiler/transformers/module/module.ts index a0f593e511138..23bae8714c854 100644 --- a/src/compiler/transformers/module/module.ts +++ b/src/compiler/transformers/module/module.ts @@ -430,26 +430,32 @@ namespace ts { */ function addExportEqualsIfNeeded(statements: Statement[], emitAsReturn: boolean) { if (currentModuleInfo.exportEquals) { - if (emitAsReturn) { - const statement = createReturn(currentModuleInfo.exportEquals.expression); - setTextRange(statement, currentModuleInfo.exportEquals); - setEmitFlags(statement, EmitFlags.NoTokenSourceMaps | EmitFlags.NoComments); - statements.push(statement); - } - else { - const statement = createStatement( - createAssignment( - createPropertyAccess( - createIdentifier("module"), - "exports" - ), - currentModuleInfo.exportEquals.expression - ) - ); + const expressionResult = importCallExpressionVisitor(currentModuleInfo.exportEquals.expression); + if (expressionResult) { + if (expressionResult instanceof Array) { + return Debug.fail("export= expression should never be replaced with multiple expressions!"); + } + if (emitAsReturn) { + const statement = createReturn(expressionResult); + setTextRange(statement, currentModuleInfo.exportEquals); + setEmitFlags(statement, EmitFlags.NoTokenSourceMaps | EmitFlags.NoComments); + statements.push(statement); + } + else { + const statement = createStatement( + createAssignment( + createPropertyAccess( + createIdentifier("module"), + "exports" + ), + expressionResult + ) + ); - setTextRange(statement, currentModuleInfo.exportEquals); - setEmitFlags(statement, EmitFlags.NoComments); - statements.push(statement); + setTextRange(statement, currentModuleInfo.exportEquals); + setEmitFlags(statement, EmitFlags.NoComments); + statements.push(statement); + } } } } @@ -497,7 +503,7 @@ namespace ts { } } - function importCallExpressionVisitor(node: Node): VisitResult { + function importCallExpressionVisitor(node: Expression): VisitResult { // This visitor does not need to descend into the tree if there is no dynamic import, // as export/import statements are only transformed at the top level of a file. if (!(node.transformFlags & TransformFlags.ContainsDynamicImport)) { diff --git a/tests/baselines/reference/importCallExpressionInExportEqualsAMD.js b/tests/baselines/reference/importCallExpressionInExportEqualsAMD.js new file mode 100644 index 0000000000000..f2fda1fadd79f --- /dev/null +++ b/tests/baselines/reference/importCallExpressionInExportEqualsAMD.js @@ -0,0 +1,22 @@ +//// [tests/cases/conformance/dynamicImport/importCallExpressionInExportEqualsAMD.ts] //// + +//// [something.ts] +export = 42; + +//// [index.ts] +export = async function() { + const something = await import("./something"); +}; + +//// [something.js] +define(["require", "exports"], function (require, exports) { + "use strict"; + return 42; +}); +//// [index.js] +define(["require", "exports"], function (require, exports) { + "use strict"; + return async function () { + const something = await new Promise(function (resolve_1, reject_1) { require(["./something"], resolve_1, reject_1); }); + }; +}); diff --git a/tests/baselines/reference/importCallExpressionInExportEqualsAMD.symbols b/tests/baselines/reference/importCallExpressionInExportEqualsAMD.symbols new file mode 100644 index 0000000000000..cd8d7d3804190 --- /dev/null +++ b/tests/baselines/reference/importCallExpressionInExportEqualsAMD.symbols @@ -0,0 +1,10 @@ +=== tests/cases/conformance/dynamicImport/something.ts === +export = 42; +No type information for this code. +No type information for this code.=== tests/cases/conformance/dynamicImport/index.ts === +export = async function() { + const something = await import("./something"); +>something : Symbol(something, Decl(index.ts, 1, 9)) +>"./something" : Symbol("tests/cases/conformance/dynamicImport/something", Decl(something.ts, 0, 0)) + +}; diff --git a/tests/baselines/reference/importCallExpressionInExportEqualsAMD.types b/tests/baselines/reference/importCallExpressionInExportEqualsAMD.types new file mode 100644 index 0000000000000..b590130d1cff5 --- /dev/null +++ b/tests/baselines/reference/importCallExpressionInExportEqualsAMD.types @@ -0,0 +1,14 @@ +=== tests/cases/conformance/dynamicImport/something.ts === +export = 42; +No type information for this code. +No type information for this code.=== tests/cases/conformance/dynamicImport/index.ts === +export = async function() { +>async function() { const something = await import("./something");} : () => Promise + + const something = await import("./something"); +>something : 42 +>await import("./something") : 42 +>import("./something") : Promise<42> +>"./something" : "./something" + +}; diff --git a/tests/baselines/reference/importCallExpressionInExportEqualsCJS.js b/tests/baselines/reference/importCallExpressionInExportEqualsCJS.js new file mode 100644 index 0000000000000..5d7e28161164d --- /dev/null +++ b/tests/baselines/reference/importCallExpressionInExportEqualsCJS.js @@ -0,0 +1,18 @@ +//// [tests/cases/conformance/dynamicImport/importCallExpressionInExportEqualsCJS.ts] //// + +//// [something.ts] +export = 42; + +//// [index.ts] +export = async function() { + const something = await import("./something"); +}; + +//// [something.js] +"use strict"; +module.exports = 42; +//// [index.js] +"use strict"; +module.exports = async function () { + const something = await Promise.resolve().then(function () { return require("./something"); }); +}; diff --git a/tests/baselines/reference/importCallExpressionInExportEqualsCJS.symbols b/tests/baselines/reference/importCallExpressionInExportEqualsCJS.symbols new file mode 100644 index 0000000000000..cd8d7d3804190 --- /dev/null +++ b/tests/baselines/reference/importCallExpressionInExportEqualsCJS.symbols @@ -0,0 +1,10 @@ +=== tests/cases/conformance/dynamicImport/something.ts === +export = 42; +No type information for this code. +No type information for this code.=== tests/cases/conformance/dynamicImport/index.ts === +export = async function() { + const something = await import("./something"); +>something : Symbol(something, Decl(index.ts, 1, 9)) +>"./something" : Symbol("tests/cases/conformance/dynamicImport/something", Decl(something.ts, 0, 0)) + +}; diff --git a/tests/baselines/reference/importCallExpressionInExportEqualsCJS.types b/tests/baselines/reference/importCallExpressionInExportEqualsCJS.types new file mode 100644 index 0000000000000..b590130d1cff5 --- /dev/null +++ b/tests/baselines/reference/importCallExpressionInExportEqualsCJS.types @@ -0,0 +1,14 @@ +=== tests/cases/conformance/dynamicImport/something.ts === +export = 42; +No type information for this code. +No type information for this code.=== tests/cases/conformance/dynamicImport/index.ts === +export = async function() { +>async function() { const something = await import("./something");} : () => Promise + + const something = await import("./something"); +>something : 42 +>await import("./something") : 42 +>import("./something") : Promise<42> +>"./something" : "./something" + +}; diff --git a/tests/baselines/reference/importCallExpressionInExportEqualsUMD.js b/tests/baselines/reference/importCallExpressionInExportEqualsUMD.js new file mode 100644 index 0000000000000..e0c6e2a925fd7 --- /dev/null +++ b/tests/baselines/reference/importCallExpressionInExportEqualsUMD.js @@ -0,0 +1,39 @@ +//// [tests/cases/conformance/dynamicImport/importCallExpressionInExportEqualsUMD.ts] //// + +//// [something.ts] +export = 42; + +//// [index.ts] +export = async function() { + const something = await import("./something"); +}; + +//// [something.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"; + return 42; +}); +//// [index.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"; + var __syncRequire = typeof module === "object" && typeof module.exports === "object"; + return async function () { + const something = await (__syncRequire ? Promise.resolve().then(function () { return require("./something"); }) : new Promise(function (resolve_1, reject_1) { require(["./something"], resolve_1, reject_1); })); + }; +}); diff --git a/tests/baselines/reference/importCallExpressionInExportEqualsUMD.symbols b/tests/baselines/reference/importCallExpressionInExportEqualsUMD.symbols new file mode 100644 index 0000000000000..cd8d7d3804190 --- /dev/null +++ b/tests/baselines/reference/importCallExpressionInExportEqualsUMD.symbols @@ -0,0 +1,10 @@ +=== tests/cases/conformance/dynamicImport/something.ts === +export = 42; +No type information for this code. +No type information for this code.=== tests/cases/conformance/dynamicImport/index.ts === +export = async function() { + const something = await import("./something"); +>something : Symbol(something, Decl(index.ts, 1, 9)) +>"./something" : Symbol("tests/cases/conformance/dynamicImport/something", Decl(something.ts, 0, 0)) + +}; diff --git a/tests/baselines/reference/importCallExpressionInExportEqualsUMD.types b/tests/baselines/reference/importCallExpressionInExportEqualsUMD.types new file mode 100644 index 0000000000000..b590130d1cff5 --- /dev/null +++ b/tests/baselines/reference/importCallExpressionInExportEqualsUMD.types @@ -0,0 +1,14 @@ +=== tests/cases/conformance/dynamicImport/something.ts === +export = 42; +No type information for this code. +No type information for this code.=== tests/cases/conformance/dynamicImport/index.ts === +export = async function() { +>async function() { const something = await import("./something");} : () => Promise + + const something = await import("./something"); +>something : 42 +>await import("./something") : 42 +>import("./something") : Promise<42> +>"./something" : "./something" + +}; diff --git a/tests/cases/conformance/dynamicImport/importCallExpressionInExportEqualsAMD.ts b/tests/cases/conformance/dynamicImport/importCallExpressionInExportEqualsAMD.ts new file mode 100644 index 0000000000000..77f348bd3fa11 --- /dev/null +++ b/tests/cases/conformance/dynamicImport/importCallExpressionInExportEqualsAMD.ts @@ -0,0 +1,9 @@ +// @module: amd +// @target: esnext +// @filename: something.ts +export = 42; + +// @filename: index.ts +export = async function() { + const something = await import("./something"); +}; \ No newline at end of file diff --git a/tests/cases/conformance/dynamicImport/importCallExpressionInExportEqualsCJS.ts b/tests/cases/conformance/dynamicImport/importCallExpressionInExportEqualsCJS.ts new file mode 100644 index 0000000000000..efda80d4995db --- /dev/null +++ b/tests/cases/conformance/dynamicImport/importCallExpressionInExportEqualsCJS.ts @@ -0,0 +1,9 @@ +// @module: commonjs +// @target: esnext +// @filename: something.ts +export = 42; + +// @filename: index.ts +export = async function() { + const something = await import("./something"); +}; \ No newline at end of file diff --git a/tests/cases/conformance/dynamicImport/importCallExpressionInExportEqualsUMD.ts b/tests/cases/conformance/dynamicImport/importCallExpressionInExportEqualsUMD.ts new file mode 100644 index 0000000000000..fc0865914fbd0 --- /dev/null +++ b/tests/cases/conformance/dynamicImport/importCallExpressionInExportEqualsUMD.ts @@ -0,0 +1,9 @@ +// @module: umd +// @target: esnext +// @filename: something.ts +export = 42; + +// @filename: index.ts +export = async function() { + const something = await import("./something"); +}; \ No newline at end of file From 62eaaf92069dc450128cd93320db877460722fde Mon Sep 17 00:00:00 2001 From: Wesley Wigham Date: Thu, 24 Aug 2017 17:12:42 -0700 Subject: [PATCH 235/237] Fix crash when attempting to merge an import with a local declaration (#18032) * There should be no crash when attempting to merge an import with a local declaration * Show symbol has actually merged within the module --- src/compiler/checker.ts | 2 + .../noCrashOnImportShadowing.errors.txt | 33 +++++++++++++ .../reference/noCrashOnImportShadowing.js | 46 +++++++++++++++++++ .../compiler/noCrashOnImportShadowing.ts | 25 ++++++++++ 4 files changed, 106 insertions(+) create mode 100644 tests/baselines/reference/noCrashOnImportShadowing.errors.txt create mode 100644 tests/baselines/reference/noCrashOnImportShadowing.js create mode 100644 tests/cases/compiler/noCrashOnImportShadowing.ts diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 4bdfa4b7250f2..4405a31db28f7 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -19180,6 +19180,8 @@ namespace ts { : DeclarationSpaces.ExportNamespace; case SyntaxKind.ClassDeclaration: case SyntaxKind.EnumDeclaration: + // A NamespaceImport declares an Alias, which is allowed to merge with other values within the module + case SyntaxKind.NamespaceImport: return DeclarationSpaces.ExportType | DeclarationSpaces.ExportValue; case SyntaxKind.ImportEqualsDeclaration: let result = DeclarationSpaces.None; diff --git a/tests/baselines/reference/noCrashOnImportShadowing.errors.txt b/tests/baselines/reference/noCrashOnImportShadowing.errors.txt new file mode 100644 index 0000000000000..c1d1dbcdef1a1 --- /dev/null +++ b/tests/baselines/reference/noCrashOnImportShadowing.errors.txt @@ -0,0 +1,33 @@ +tests/cases/compiler/index.ts(4,1): error TS2693: 'B' only refers to a type, but is being used as a value here. +tests/cases/compiler/index.ts(9,10): error TS2304: Cannot find name 'OriginalB'. + + +==== tests/cases/compiler/b.ts (0 errors) ==== + export const zzz = 123; + +==== tests/cases/compiler/a.ts (0 errors) ==== + import * as B from "./b"; + + interface B { + x: string; + } + + const x: B = { x: "" }; + B.zzz; + + export { B }; + +==== tests/cases/compiler/index.ts (2 errors) ==== + import { B } from "./a"; + + const x: B = { x: "" }; + B.zzz; + ~ +!!! error TS2693: 'B' only refers to a type, but is being used as a value here. + + import * as OriginalB from "./b"; + OriginalB.zzz; + + const y: OriginalB = x; + ~~~~~~~~~ +!!! error TS2304: Cannot find name 'OriginalB'. \ No newline at end of file diff --git a/tests/baselines/reference/noCrashOnImportShadowing.js b/tests/baselines/reference/noCrashOnImportShadowing.js new file mode 100644 index 0000000000000..7ca2116954d6f --- /dev/null +++ b/tests/baselines/reference/noCrashOnImportShadowing.js @@ -0,0 +1,46 @@ +//// [tests/cases/compiler/noCrashOnImportShadowing.ts] //// + +//// [b.ts] +export const zzz = 123; + +//// [a.ts] +import * as B from "./b"; + +interface B { + x: string; +} + +const x: B = { x: "" }; +B.zzz; + +export { B }; + +//// [index.ts] +import { B } from "./a"; + +const x: B = { x: "" }; +B.zzz; + +import * as OriginalB from "./b"; +OriginalB.zzz; + +const y: OriginalB = x; + +//// [b.js] +"use strict"; +exports.__esModule = true; +exports.zzz = 123; +//// [a.js] +"use strict"; +exports.__esModule = true; +var B = require("./b"); +var x = { x: "" }; +B.zzz; +//// [index.js] +"use strict"; +exports.__esModule = true; +var x = { x: "" }; +B.zzz; +var OriginalB = require("./b"); +OriginalB.zzz; +var y = x; diff --git a/tests/cases/compiler/noCrashOnImportShadowing.ts b/tests/cases/compiler/noCrashOnImportShadowing.ts new file mode 100644 index 0000000000000..69e8b6a0f8c01 --- /dev/null +++ b/tests/cases/compiler/noCrashOnImportShadowing.ts @@ -0,0 +1,25 @@ +// @filename: b.ts +export const zzz = 123; + +// @filename: a.ts +import * as B from "./b"; + +interface B { + x: string; +} + +const x: B = { x: "" }; +B.zzz; + +export { B }; + +// @filename: index.ts +import { B } from "./a"; + +const x: B = { x: "" }; +B.zzz; + +import * as OriginalB from "./b"; +OriginalB.zzz; + +const y: OriginalB = x; \ No newline at end of file From 3a0ab74ed6d5201ac703089f72915d23ef15242e Mon Sep 17 00:00:00 2001 From: Andy Date: Fri, 25 Aug 2017 09:53:28 -0700 Subject: [PATCH 236/237] Test for action description of code actions, and simplify description for extracting method to file (#18030) * Test for action description of code actions, and simplify description for extracting method to file * Add unit test file missing from tsconfig.json (only affects gulp) and update tests * Use the actual number * Use "module scope" or "global scope" instead of "this file" --- src/compiler/diagnosticMessages.json | 2 +- src/harness/fourslash.ts | 47 +++++++++++++------ src/harness/tsconfig.json | 1 + src/services/refactors/extractMethod.ts | 18 +++---- .../reference/extractMethod/extractMethod1.js | 8 ++-- .../extractMethod/extractMethod10.js | 6 +-- .../extractMethod/extractMethod11.js | 6 +-- .../extractMethod/extractMethod12.js | 2 +- .../reference/extractMethod/extractMethod2.js | 8 ++-- .../reference/extractMethod/extractMethod3.js | 8 ++-- .../reference/extractMethod/extractMethod4.js | 8 ++-- .../reference/extractMethod/extractMethod5.js | 8 ++-- .../reference/extractMethod/extractMethod6.js | 8 ++-- .../reference/extractMethod/extractMethod7.js | 8 ++-- .../reference/extractMethod/extractMethod8.js | 8 ++-- .../reference/extractMethod/extractMethod9.js | 8 ++-- tests/cases/fourslash/extract-method1.ts | 7 ++- tests/cases/fourslash/extract-method10.ts | 9 +++- tests/cases/fourslash/extract-method13.ts | 12 ++++- tests/cases/fourslash/extract-method14.ts | 6 ++- tests/cases/fourslash/extract-method15.ts | 6 ++- tests/cases/fourslash/extract-method18.ts | 7 ++- tests/cases/fourslash/extract-method19.ts | 9 ++-- tests/cases/fourslash/extract-method2.ts | 7 ++- tests/cases/fourslash/extract-method21.ts | 6 ++- tests/cases/fourslash/extract-method24.ts | 6 ++- tests/cases/fourslash/extract-method25.ts | 6 ++- tests/cases/fourslash/extract-method3.ts | 2 +- tests/cases/fourslash/extract-method5.ts | 6 ++- tests/cases/fourslash/extract-method7.ts | 6 ++- tests/cases/fourslash/fourslash.ts | 4 +- 31 files changed, 163 insertions(+), 90 deletions(-) diff --git a/src/compiler/diagnosticMessages.json b/src/compiler/diagnosticMessages.json index 8121f036ceabb..9a3492e5c377a 100644 --- a/src/compiler/diagnosticMessages.json +++ b/src/compiler/diagnosticMessages.json @@ -3696,7 +3696,7 @@ "code": 95003 }, - "Extract function into '{0}'": { + "Extract function into {0}": { "category": "Message", "code": 95004 } diff --git a/src/harness/fourslash.ts b/src/harness/fourslash.ts index ab33fa87997bc..3010fc5353345 100644 --- a/src/harness/fourslash.ts +++ b/src/harness/fourslash.ts @@ -2761,20 +2761,25 @@ namespace FourSlash { }); } - public verifyRefactorAvailable(negative: boolean, name?: string, subName?: string) { + public verifyRefactorAvailable(negative: boolean, name: string, actionName?: string) { const selection = this.getSelection(); let refactors = this.languageService.getApplicableRefactors(this.activeFile.fileName, selection) || []; - if (name) { - refactors = refactors.filter(r => r.name === name && (subName === undefined || r.actions.some(a => a.name === subName))); - } + refactors = refactors.filter(r => r.name === name && (actionName === undefined || r.actions.some(a => a.name === actionName))); const isAvailable = refactors.length > 0; - if (negative && isAvailable) { - this.raiseError(`verifyApplicableRefactorAvailableForRange failed - expected no refactor but found some: ${refactors.map(r => r.name).join(", ")}`); + if (negative) { + if (isAvailable) { + this.raiseError(`verifyApplicableRefactorAvailableForRange failed - expected no refactor but found: ${refactors.map(r => r.name).join(", ")}`); + } } - else if (!negative && !isAvailable) { - this.raiseError(`verifyApplicableRefactorAvailableForRange failed - expected a refactor but found none.`); + else { + if (!isAvailable) { + this.raiseError(`verifyApplicableRefactorAvailableForRange failed - expected a refactor but found none.`); + } + if (refactors.length > 1) { + this.raiseError(`${refactors.length} available refactors both have name ${name} and action ${actionName}`); + } } } @@ -2794,14 +2799,22 @@ namespace FourSlash { } } - public applyRefactor(refactorName: string, actionName: string) { + public applyRefactor({ refactorName, actionName, actionDescription }: FourSlashInterface.ApplyRefactorOptions) { const range = this.getSelection(); const refactors = this.languageService.getApplicableRefactors(this.activeFile.fileName, range); - const refactor = ts.find(refactors, r => r.name === refactorName); + const refactor = refactors.find(r => r.name === refactorName); if (!refactor) { this.raiseError(`The expected refactor: ${refactorName} is not available at the marker location.`); } + const action = refactor.actions.find(a => a.name === actionName); + if (!action) { + this.raiseError(`The expected action: ${action} is not included in: ${refactor.actions.map(a => a.name)}`); + } + if (action.description !== actionDescription) { + this.raiseError(`Expected action description to be ${JSON.stringify(actionDescription)}, got: ${JSON.stringify(action.description)}`); + } + const editInfo = this.languageService.getEditsForRefactor(this.activeFile.fileName, this.formatCodeSettings, range, refactorName, actionName); for (const edit of editInfo.edits) { this.applyEdits(edit.fileName, edit.textChanges, /*isFormattingEdit*/ false); @@ -3682,8 +3695,8 @@ namespace FourSlashInterface { this.state.verifyApplicableRefactorAvailableForRange(this.negative); } - public refactorAvailable(name?: string, subName?: string) { - this.state.verifyRefactorAvailable(this.negative, name, subName); + public refactorAvailable(name: string, actionName?: string) { + this.state.verifyRefactorAvailable(this.negative, name, actionName); } } @@ -4081,8 +4094,8 @@ namespace FourSlashInterface { this.state.enableFormatting = false; } - public applyRefactor(refactorName: string, actionName: string) { - this.state.applyRefactor(refactorName, actionName); + public applyRefactor(options: ApplyRefactorOptions) { + this.state.applyRefactor(options); } } @@ -4295,4 +4308,10 @@ namespace FourSlashInterface { return { classificationType, text, textSpan }; } } + + export interface ApplyRefactorOptions { + refactorName: string; + actionName: string; + actionDescription: string; + } } diff --git a/src/harness/tsconfig.json b/src/harness/tsconfig.json index 9165e59cb0a1a..1469079bcaaf3 100644 --- a/src/harness/tsconfig.json +++ b/src/harness/tsconfig.json @@ -125,6 +125,7 @@ "./unittests/printer.ts", "./unittests/transform.ts", "./unittests/customTransforms.ts", + "./unittests/extractMethods.ts", "./unittests/textChanges.ts", "./unittests/telemetry.ts", "./unittests/programMissingFiles.ts" diff --git a/src/services/refactors/extractMethod.ts b/src/services/refactors/extractMethod.ts index 90e3304169576..f32321aff2a17 100644 --- a/src/services/refactors/extractMethod.ts +++ b/src/services/refactors/extractMethod.ts @@ -560,32 +560,32 @@ namespace ts.refactor.extractMethod { return "constructor"; case SyntaxKind.FunctionExpression: return scope.name - ? `function expression ${scope.name.getText()}` + ? `function expression ${scope.name.text}` : "anonymous function expression"; case SyntaxKind.FunctionDeclaration: - return `function ${scope.name.getText()}`; + return `function '${scope.name.text}'`; case SyntaxKind.ArrowFunction: return "arrow function"; case SyntaxKind.MethodDeclaration: - return `method ${scope.name.getText()}`; + return `method '${scope.name.getText()}`; case SyntaxKind.GetAccessor: - return `get ${scope.name.getText()}`; + return `'get ${scope.name.getText()}'`; case SyntaxKind.SetAccessor: - return `set ${scope.name.getText()}`; + return `'set ${scope.name.getText()}'`; } } else if (isModuleBlock(scope)) { - return `namespace ${scope.parent.name.getText()}`; + return `namespace '${scope.parent.name.getText()}'`; } else if (isClassLike(scope)) { return scope.kind === SyntaxKind.ClassDeclaration - ? `class ${scope.name.text}` + ? `class '${scope.name.text}'` : scope.name.text - ? `class expression ${scope.name.text}` + ? `class expression '${scope.name.text}'` : "anonymous class expression"; } else if (isSourceFile(scope)) { - return `file '${scope.fileName}'`; + return scope.externalModuleIndicator ? "module scope" : "global scope"; } else { return "unknown"; diff --git a/tests/baselines/reference/extractMethod/extractMethod1.js b/tests/baselines/reference/extractMethod/extractMethod1.js index 60c7e301616e8..10bf2648383bf 100644 --- a/tests/baselines/reference/extractMethod/extractMethod1.js +++ b/tests/baselines/reference/extractMethod/extractMethod1.js @@ -14,7 +14,7 @@ namespace A { } } } -==SCOPE::function a== +==SCOPE::function 'a'== namespace A { let x = 1; function foo() { @@ -34,7 +34,7 @@ namespace A { } } } -==SCOPE::namespace B== +==SCOPE::namespace 'B'== namespace A { let x = 1; function foo() { @@ -55,7 +55,7 @@ namespace A { } } } -==SCOPE::namespace A== +==SCOPE::namespace 'A'== namespace A { let x = 1; function foo() { @@ -76,7 +76,7 @@ namespace A { return a; } } -==SCOPE::file '/a.ts'== +==SCOPE::global scope== namespace A { let x = 1; function foo() { diff --git a/tests/baselines/reference/extractMethod/extractMethod10.js b/tests/baselines/reference/extractMethod/extractMethod10.js index 02923b7ab50c7..b2397744680b2 100644 --- a/tests/baselines/reference/extractMethod/extractMethod10.js +++ b/tests/baselines/reference/extractMethod/extractMethod10.js @@ -9,7 +9,7 @@ namespace A { } } } -==SCOPE::class C== +==SCOPE::class 'C'== namespace A { export interface I { x: number }; class C { @@ -24,7 +24,7 @@ namespace A { } } } -==SCOPE::namespace A== +==SCOPE::namespace 'A'== namespace A { export interface I { x: number }; class C { @@ -39,7 +39,7 @@ namespace A { return a1.x + 10; } } -==SCOPE::file '/a.ts'== +==SCOPE::global scope== namespace A { export interface I { x: number }; class C { diff --git a/tests/baselines/reference/extractMethod/extractMethod11.js b/tests/baselines/reference/extractMethod/extractMethod11.js index 77565e7b0a778..21392a07a7a4b 100644 --- a/tests/baselines/reference/extractMethod/extractMethod11.js +++ b/tests/baselines/reference/extractMethod/extractMethod11.js @@ -11,7 +11,7 @@ namespace A { } } } -==SCOPE::class C== +==SCOPE::class 'C'== namespace A { let y = 1; class C { @@ -30,7 +30,7 @@ namespace A { } } } -==SCOPE::namespace A== +==SCOPE::namespace 'A'== namespace A { let y = 1; class C { @@ -49,7 +49,7 @@ namespace A { return { __return: a1.x + 10, z }; } } -==SCOPE::file '/a.ts'== +==SCOPE::global scope== namespace A { let y = 1; class C { diff --git a/tests/baselines/reference/extractMethod/extractMethod12.js b/tests/baselines/reference/extractMethod/extractMethod12.js index 8ff6e130dad2a..7cebab5d3c582 100644 --- a/tests/baselines/reference/extractMethod/extractMethod12.js +++ b/tests/baselines/reference/extractMethod/extractMethod12.js @@ -13,7 +13,7 @@ namespace A { } } } -==SCOPE::class C== +==SCOPE::class 'C'== namespace A { let y = 1; class C { diff --git a/tests/baselines/reference/extractMethod/extractMethod2.js b/tests/baselines/reference/extractMethod/extractMethod2.js index 28c27993d7165..3c0d2e7c7b01c 100644 --- a/tests/baselines/reference/extractMethod/extractMethod2.js +++ b/tests/baselines/reference/extractMethod/extractMethod2.js @@ -12,7 +12,7 @@ namespace A { } } } -==SCOPE::function a== +==SCOPE::function 'a'== namespace A { let x = 1; function foo() { @@ -30,7 +30,7 @@ namespace A { } } } -==SCOPE::namespace B== +==SCOPE::namespace 'B'== namespace A { let x = 1; function foo() { @@ -48,7 +48,7 @@ namespace A { } } } -==SCOPE::namespace A== +==SCOPE::namespace 'A'== namespace A { let x = 1; function foo() { @@ -66,7 +66,7 @@ namespace A { return foo(); } } -==SCOPE::file '/a.ts'== +==SCOPE::global scope== namespace A { let x = 1; function foo() { diff --git a/tests/baselines/reference/extractMethod/extractMethod3.js b/tests/baselines/reference/extractMethod/extractMethod3.js index e5903ead18199..cb28e2755e708 100644 --- a/tests/baselines/reference/extractMethod/extractMethod3.js +++ b/tests/baselines/reference/extractMethod/extractMethod3.js @@ -11,7 +11,7 @@ namespace A { } } } -==SCOPE::function a== +==SCOPE::function 'a'== namespace A { function foo() { } @@ -28,7 +28,7 @@ namespace A { } } } -==SCOPE::namespace B== +==SCOPE::namespace 'B'== namespace A { function foo() { } @@ -45,7 +45,7 @@ namespace A { } } } -==SCOPE::namespace A== +==SCOPE::namespace 'A'== namespace A { function foo() { } @@ -62,7 +62,7 @@ namespace A { return foo(); } } -==SCOPE::file '/a.ts'== +==SCOPE::global scope== namespace A { function foo() { } diff --git a/tests/baselines/reference/extractMethod/extractMethod4.js b/tests/baselines/reference/extractMethod/extractMethod4.js index 6b9e2eed099d3..07029b2d05063 100644 --- a/tests/baselines/reference/extractMethod/extractMethod4.js +++ b/tests/baselines/reference/extractMethod/extractMethod4.js @@ -13,7 +13,7 @@ namespace A { } } } -==SCOPE::function a== +==SCOPE::function 'a'== namespace A { function foo() { } @@ -32,7 +32,7 @@ namespace A { } } } -==SCOPE::namespace B== +==SCOPE::namespace 'B'== namespace A { function foo() { } @@ -51,7 +51,7 @@ namespace A { } } } -==SCOPE::namespace A== +==SCOPE::namespace 'A'== namespace A { function foo() { } @@ -70,7 +70,7 @@ namespace A { return foo(); } } -==SCOPE::file '/a.ts'== +==SCOPE::global scope== namespace A { function foo() { } diff --git a/tests/baselines/reference/extractMethod/extractMethod5.js b/tests/baselines/reference/extractMethod/extractMethod5.js index cf63cb2a93214..96a76e426b14f 100644 --- a/tests/baselines/reference/extractMethod/extractMethod5.js +++ b/tests/baselines/reference/extractMethod/extractMethod5.js @@ -14,7 +14,7 @@ namespace A { } } } -==SCOPE::function a== +==SCOPE::function 'a'== namespace A { let x = 1; export function foo() { @@ -34,7 +34,7 @@ namespace A { } } } -==SCOPE::namespace B== +==SCOPE::namespace 'B'== namespace A { let x = 1; export function foo() { @@ -55,7 +55,7 @@ namespace A { } } } -==SCOPE::namespace A== +==SCOPE::namespace 'A'== namespace A { let x = 1; export function foo() { @@ -76,7 +76,7 @@ namespace A { return a; } } -==SCOPE::file '/a.ts'== +==SCOPE::global scope== namespace A { let x = 1; export function foo() { diff --git a/tests/baselines/reference/extractMethod/extractMethod6.js b/tests/baselines/reference/extractMethod/extractMethod6.js index 99f52e9febbe0..d1244ac959649 100644 --- a/tests/baselines/reference/extractMethod/extractMethod6.js +++ b/tests/baselines/reference/extractMethod/extractMethod6.js @@ -14,7 +14,7 @@ namespace A { } } } -==SCOPE::function a== +==SCOPE::function 'a'== namespace A { let x = 1; export function foo() { @@ -34,7 +34,7 @@ namespace A { } } } -==SCOPE::namespace B== +==SCOPE::namespace 'B'== namespace A { let x = 1; export function foo() { @@ -56,7 +56,7 @@ namespace A { } } } -==SCOPE::namespace A== +==SCOPE::namespace 'A'== namespace A { let x = 1; export function foo() { @@ -78,7 +78,7 @@ namespace A { return { __return: foo(), a }; } } -==SCOPE::file '/a.ts'== +==SCOPE::global scope== namespace A { let x = 1; export function foo() { diff --git a/tests/baselines/reference/extractMethod/extractMethod7.js b/tests/baselines/reference/extractMethod/extractMethod7.js index 09d5edaa2c05d..da400d8b05128 100644 --- a/tests/baselines/reference/extractMethod/extractMethod7.js +++ b/tests/baselines/reference/extractMethod/extractMethod7.js @@ -16,7 +16,7 @@ namespace A { } } } -==SCOPE::function a== +==SCOPE::function 'a'== namespace A { let x = 1; export namespace C { @@ -38,7 +38,7 @@ namespace A { } } } -==SCOPE::namespace B== +==SCOPE::namespace 'B'== namespace A { let x = 1; export namespace C { @@ -62,7 +62,7 @@ namespace A { } } } -==SCOPE::namespace A== +==SCOPE::namespace 'A'== namespace A { let x = 1; export namespace C { @@ -86,7 +86,7 @@ namespace A { return { __return: C.foo(), a }; } } -==SCOPE::file '/a.ts'== +==SCOPE::global scope== namespace A { let x = 1; export namespace C { diff --git a/tests/baselines/reference/extractMethod/extractMethod8.js b/tests/baselines/reference/extractMethod/extractMethod8.js index fe9cf2a92f0fd..d298387b9026e 100644 --- a/tests/baselines/reference/extractMethod/extractMethod8.js +++ b/tests/baselines/reference/extractMethod/extractMethod8.js @@ -8,7 +8,7 @@ namespace A { } } } -==SCOPE::function a== +==SCOPE::function 'a'== namespace A { let x = 1; namespace B { @@ -22,7 +22,7 @@ namespace A { } } } -==SCOPE::namespace B== +==SCOPE::namespace 'B'== namespace A { let x = 1; namespace B { @@ -36,7 +36,7 @@ namespace A { } } } -==SCOPE::namespace A== +==SCOPE::namespace 'A'== namespace A { let x = 1; namespace B { @@ -50,7 +50,7 @@ namespace A { return 1 + a1 + x; } } -==SCOPE::file '/a.ts'== +==SCOPE::global scope== namespace A { let x = 1; namespace B { diff --git a/tests/baselines/reference/extractMethod/extractMethod9.js b/tests/baselines/reference/extractMethod/extractMethod9.js index fcc5dcd23de07..609e3535d5762 100644 --- a/tests/baselines/reference/extractMethod/extractMethod9.js +++ b/tests/baselines/reference/extractMethod/extractMethod9.js @@ -8,7 +8,7 @@ namespace A { } } } -==SCOPE::function a== +==SCOPE::function 'a'== namespace A { export interface I { x: number }; namespace B { @@ -22,7 +22,7 @@ namespace A { } } } -==SCOPE::namespace B== +==SCOPE::namespace 'B'== namespace A { export interface I { x: number }; namespace B { @@ -36,7 +36,7 @@ namespace A { } } } -==SCOPE::namespace A== +==SCOPE::namespace 'A'== namespace A { export interface I { x: number }; namespace B { @@ -50,7 +50,7 @@ namespace A { return a1.x + 10; } } -==SCOPE::file '/a.ts'== +==SCOPE::global scope== namespace A { export interface I { x: number }; namespace B { diff --git a/tests/cases/fourslash/extract-method1.ts b/tests/cases/fourslash/extract-method1.ts index 7f5c2ac2d500a..ff061295c8c6b 100644 --- a/tests/cases/fourslash/extract-method1.ts +++ b/tests/cases/fourslash/extract-method1.ts @@ -13,8 +13,11 @@ //// } goTo.select('start', 'end') -verify.refactorAvailable('Extract Method'); -edit.applyRefactor('Extract Method', "scope_0"); +edit.applyRefactor({ + refactorName: "Extract Method", + actionName: "scope_0", + actionDescription: "Extract function into class 'Foo'", +}); verify.currentFileContentIs( `class Foo { someMethod(m: number) { diff --git a/tests/cases/fourslash/extract-method10.ts b/tests/cases/fourslash/extract-method10.ts index 1a02bfa00f53e..ffbee7350e259 100644 --- a/tests/cases/fourslash/extract-method10.ts +++ b/tests/cases/fourslash/extract-method10.ts @@ -1,6 +1,11 @@ /// -//// (x => x)(/*1*/x => x/*2*/)(1); +//// export {}; // Make this a module +//// (x => x)(/*1*/x => x/*2*/)(1); goTo.select('1', '2'); -edit.applyRefactor('Extract Method', 'scope_0'); +edit.applyRefactor({ + refactorName: "Extract Method", + actionName: 'scope_0', + actionDescription: "Extract function into module scope", +}); diff --git a/tests/cases/fourslash/extract-method13.ts b/tests/cases/fourslash/extract-method13.ts index b9b7c0096aabc..14a146a80c509 100644 --- a/tests/cases/fourslash/extract-method13.ts +++ b/tests/cases/fourslash/extract-method13.ts @@ -10,10 +10,18 @@ //// } goTo.select('a', 'b'); -edit.applyRefactor('Extract Method', 'scope_0'); +edit.applyRefactor({ + refactorName: "Extract Method", + actionName: "scope_0", + actionDescription: "Extract function into class 'C'", +}); goTo.select('c', 'd'); -edit.applyRefactor('Extract Method', 'scope_0'); +edit.applyRefactor({ + refactorName: "Extract Method", + actionName: "scope_0", + actionDescription: "Extract function into class 'C'", +}); verify.currentFileContentIs(`class C { static j = C.newFunction_1(); diff --git a/tests/cases/fourslash/extract-method14.ts b/tests/cases/fourslash/extract-method14.ts index c8bab1b3a56d7..696bb664bd358 100644 --- a/tests/cases/fourslash/extract-method14.ts +++ b/tests/cases/fourslash/extract-method14.ts @@ -11,7 +11,11 @@ //// } goTo.select('a', 'b'); -edit.applyRefactor('Extract Method', 'scope_1'); +edit.applyRefactor({ + refactorName: "Extract Method", + actionName: "scope_1", + actionDescription: "Extract function into global scope", +}); verify.currentFileContentIs(`function foo() { var i = 10; var __return: any; diff --git a/tests/cases/fourslash/extract-method15.ts b/tests/cases/fourslash/extract-method15.ts index ef62bd3fd3f74..93aa357cfee2e 100644 --- a/tests/cases/fourslash/extract-method15.ts +++ b/tests/cases/fourslash/extract-method15.ts @@ -9,7 +9,11 @@ //// } goTo.select('a', 'b'); -edit.applyRefactor('Extract Method', 'scope_1'); +edit.applyRefactor({ + refactorName: "Extract Method", + actionName: "scope_1", + actionDescription: "Extract function into global scope", +}); verify.currentFileContentIs(`function foo() { var i = 10; diff --git a/tests/cases/fourslash/extract-method18.ts b/tests/cases/fourslash/extract-method18.ts index 9d87979a1ed1c..d99d14bac73f6 100644 --- a/tests/cases/fourslash/extract-method18.ts +++ b/tests/cases/fourslash/extract-method18.ts @@ -9,8 +9,11 @@ //// } goTo.select('a', 'b') -verify.refactorAvailable('Extract Method'); -edit.applyRefactor('Extract Method', "scope_1"); +edit.applyRefactor({ + refactorName: "Extract Method", + actionName: "scope_1", + actionDescription: "Extract function into global scope", +}); verify.currentFileContentIs(`function fn() { const x = { m: 1 }; newFunction(x); diff --git a/tests/cases/fourslash/extract-method19.ts b/tests/cases/fourslash/extract-method19.ts index 54f79311cc72b..e4fb3e6e1110e 100644 --- a/tests/cases/fourslash/extract-method19.ts +++ b/tests/cases/fourslash/extract-method19.ts @@ -5,12 +5,15 @@ //// function fn() { //// /*a*/console.log("hi");/*b*/ //// } -//// +//// //// function newFunction() { } goTo.select('a', 'b') -verify.refactorAvailable('Extract Method'); -edit.applyRefactor('Extract Method', "scope_0"); +edit.applyRefactor({ + refactorName: "Extract Method", + actionName: "scope_0", + actionDescription: "Extract function into function 'fn'", +}); verify.currentFileContentIs(`function fn() { newFunction_1(); diff --git a/tests/cases/fourslash/extract-method2.ts b/tests/cases/fourslash/extract-method2.ts index 0a4f346307b5f..508836c419922 100644 --- a/tests/cases/fourslash/extract-method2.ts +++ b/tests/cases/fourslash/extract-method2.ts @@ -10,8 +10,11 @@ //// } //// } goTo.select('start', 'end') -verify.refactorAvailable('Extract Method'); -edit.applyRefactor('Extract Method', "scope_2"); +edit.applyRefactor({ + refactorName: "Extract Method", + actionName: "scope_2", + actionDescription: "Extract function into global scope", +}); verify.currentFileContentIs( `namespace NS { class Q { diff --git a/tests/cases/fourslash/extract-method21.ts b/tests/cases/fourslash/extract-method21.ts index 0168daf5fcb02..c32df5b59798e 100644 --- a/tests/cases/fourslash/extract-method21.ts +++ b/tests/cases/fourslash/extract-method21.ts @@ -12,7 +12,11 @@ goTo.select('start', 'end') verify.refactorAvailable('Extract Method'); -edit.applyRefactor('Extract Method', "scope_0"); +edit.applyRefactor({ + refactorName: "Extract Method", + actionName: "scope_0", + actionDescription: "Extract function into class 'Foo'", +}); verify.currentFileContentIs(`class Foo { static method() { diff --git a/tests/cases/fourslash/extract-method24.ts b/tests/cases/fourslash/extract-method24.ts index 9eebc00316bd6..615cb2ac4d2f8 100644 --- a/tests/cases/fourslash/extract-method24.ts +++ b/tests/cases/fourslash/extract-method24.ts @@ -7,7 +7,11 @@ //// } goTo.select('a', 'b') -edit.applyRefactor('Extract Method', 'scope_1'); +edit.applyRefactor({ + refactorName: "Extract Method", + actionName: "scope_1", + actionDescription: "Extract function into global scope", +}); verify.currentFileContentIs(`function M() { let a = [1,2,3]; let x = 0; diff --git a/tests/cases/fourslash/extract-method25.ts b/tests/cases/fourslash/extract-method25.ts index ac7e7a2300497..8585dd06fd4ea 100644 --- a/tests/cases/fourslash/extract-method25.ts +++ b/tests/cases/fourslash/extract-method25.ts @@ -8,7 +8,11 @@ //// } goTo.select('a', 'b') -edit.applyRefactor('Extract Method', 'scope_0'); +edit.applyRefactor({ + refactorName: "Extract Method", + actionName: "scope_0", + actionDescription: "Extract function into function 'fn'", +}); verify.currentFileContentIs(`function fn() { var q = newFunction() q[0]++ diff --git a/tests/cases/fourslash/extract-method3.ts b/tests/cases/fourslash/extract-method3.ts index af543121eebf2..27a520d0555a4 100644 --- a/tests/cases/fourslash/extract-method3.ts +++ b/tests/cases/fourslash/extract-method3.ts @@ -10,7 +10,7 @@ //// } //// } -// Don't offer to to 'extract method' a single identifier +// Don't offer to 'extract method' a single identifier goTo.marker('a'); verify.not.refactorAvailable('Extract Method'); diff --git a/tests/cases/fourslash/extract-method5.ts b/tests/cases/fourslash/extract-method5.ts index ac09f92cc0520..10294298b085b 100644 --- a/tests/cases/fourslash/extract-method5.ts +++ b/tests/cases/fourslash/extract-method5.ts @@ -9,7 +9,11 @@ //// } goTo.select('start', 'end'); -edit.applyRefactor('Extract Method', 'scope_0'); +edit.applyRefactor({ + refactorName: "Extract Method", + actionName: "scope_0", + actionDescription: "Extract function into function 'f'", +}); verify.currentFileContentIs( `function f() { var x: 1 | 2 | 3 = newFunction(); diff --git a/tests/cases/fourslash/extract-method7.ts b/tests/cases/fourslash/extract-method7.ts index 4c95c6a551d57..95c9cbe9897ec 100644 --- a/tests/cases/fourslash/extract-method7.ts +++ b/tests/cases/fourslash/extract-method7.ts @@ -7,7 +7,11 @@ //// } goTo.select('a', 'b'); -edit.applyRefactor('Extract Method', 'scope_0'); +edit.applyRefactor({ + refactorName: "Extract Method", + actionName: "scope_0", + actionDescription: "Extract function into global scope", +}); verify.currentFileContentIs(`function fn(x = newFunction()) { } function newFunction() { diff --git a/tests/cases/fourslash/fourslash.ts b/tests/cases/fourslash/fourslash.ts index abb2c38c6b47a..652ed4812c04a 100644 --- a/tests/cases/fourslash/fourslash.ts +++ b/tests/cases/fourslash/fourslash.ts @@ -159,7 +159,7 @@ declare namespace FourSlashInterface { codeFixDiagnosticsAvailableAtMarkers(markerNames: string[], diagnosticCode?: number): void; applicableRefactorAvailableForRange(): void; - refactorAvailable(name?: string, subName?: string); + refactorAvailable(name: string, actionName?: string); } class verify extends verifyNegatable { assertHasRanges(ranges: Range[]): void; @@ -310,7 +310,7 @@ declare namespace FourSlashInterface { enableFormatting(): void; disableFormatting(): void; - applyRefactor(refactorName: string, actionName: string): void; + applyRefactor(options: { refactorName: string, actionName: string, actionDescription: string }): void; } class debug { printCurrentParameterHelp(): void; From fe1242c8a902a2f530e5fb91b8f8f3e90bd4f4a6 Mon Sep 17 00:00:00 2001 From: Andy Date: Fri, 25 Aug 2017 09:53:56 -0700 Subject: [PATCH 237/237] Don't try to extract `import` to a method (#18025) --- src/compiler/utilities.ts | 117 ++++++++++-------- src/services/refactors/extractMethod.ts | 27 ++-- .../extract-method-not-for-import.ts | 10 ++ 3 files changed, 87 insertions(+), 67 deletions(-) create mode 100644 tests/cases/fourslash/extract-method-not-for-import.ts diff --git a/src/compiler/utilities.ts b/src/compiler/utilities.ts index 7462bf02adccd..9f679011dd02b 100644 --- a/src/compiler/utilities.ts +++ b/src/compiler/utilities.ts @@ -4951,54 +4951,60 @@ namespace ts { || kind === SyntaxKind.NoSubstitutionTemplateLiteral; } - function isLeftHandSideExpressionKind(kind: SyntaxKind): boolean { - return kind === SyntaxKind.PropertyAccessExpression - || kind === SyntaxKind.ElementAccessExpression - || kind === SyntaxKind.NewExpression - || kind === SyntaxKind.CallExpression - || kind === SyntaxKind.JsxElement - || kind === SyntaxKind.JsxSelfClosingElement - || kind === SyntaxKind.TaggedTemplateExpression - || kind === SyntaxKind.ArrayLiteralExpression - || kind === SyntaxKind.ParenthesizedExpression - || kind === SyntaxKind.ObjectLiteralExpression - || kind === SyntaxKind.ClassExpression - || kind === SyntaxKind.FunctionExpression - || kind === SyntaxKind.Identifier - || kind === SyntaxKind.RegularExpressionLiteral - || kind === SyntaxKind.NumericLiteral - || kind === SyntaxKind.StringLiteral - || kind === SyntaxKind.NoSubstitutionTemplateLiteral - || kind === SyntaxKind.TemplateExpression - || kind === SyntaxKind.FalseKeyword - || kind === SyntaxKind.NullKeyword - || kind === SyntaxKind.ThisKeyword - || kind === SyntaxKind.TrueKeyword - || kind === SyntaxKind.SuperKeyword - || kind === SyntaxKind.ImportKeyword - || kind === SyntaxKind.NonNullExpression - || kind === SyntaxKind.MetaProperty; - } - /* @internal */ export function isLeftHandSideExpression(node: Node): node is LeftHandSideExpression { - return isLeftHandSideExpressionKind(skipPartiallyEmittedExpressions(node).kind); - } - - function isUnaryExpressionKind(kind: SyntaxKind): boolean { - return kind === SyntaxKind.PrefixUnaryExpression - || kind === SyntaxKind.PostfixUnaryExpression - || kind === SyntaxKind.DeleteExpression - || kind === SyntaxKind.TypeOfExpression - || kind === SyntaxKind.VoidExpression - || kind === SyntaxKind.AwaitExpression - || kind === SyntaxKind.TypeAssertionExpression - || isLeftHandSideExpressionKind(kind); + switch (node.kind) { + case SyntaxKind.PropertyAccessExpression: + case SyntaxKind.ElementAccessExpression: + case SyntaxKind.NewExpression: + case SyntaxKind.CallExpression: + case SyntaxKind.JsxElement: + case SyntaxKind.JsxSelfClosingElement: + case SyntaxKind.TaggedTemplateExpression: + case SyntaxKind.ArrayLiteralExpression: + case SyntaxKind.ParenthesizedExpression: + case SyntaxKind.ObjectLiteralExpression: + case SyntaxKind.ClassExpression: + case SyntaxKind.FunctionExpression: + case SyntaxKind.Identifier: + case SyntaxKind.RegularExpressionLiteral: + case SyntaxKind.NumericLiteral: + case SyntaxKind.StringLiteral: + case SyntaxKind.NoSubstitutionTemplateLiteral: + case SyntaxKind.TemplateExpression: + case SyntaxKind.FalseKeyword: + case SyntaxKind.NullKeyword: + case SyntaxKind.ThisKeyword: + case SyntaxKind.TrueKeyword: + case SyntaxKind.SuperKeyword: + case SyntaxKind.NonNullExpression: + case SyntaxKind.MetaProperty: + return true; + case SyntaxKind.PartiallyEmittedExpression: + return isLeftHandSideExpression((node as PartiallyEmittedExpression).expression); + case SyntaxKind.ImportKeyword: + return node.parent.kind === SyntaxKind.CallExpression; + default: + return false; + } } /* @internal */ export function isUnaryExpression(node: Node): node is UnaryExpression { - return isUnaryExpressionKind(skipPartiallyEmittedExpressions(node).kind); + switch (node.kind) { + case SyntaxKind.PrefixUnaryExpression: + case SyntaxKind.PostfixUnaryExpression: + case SyntaxKind.DeleteExpression: + case SyntaxKind.TypeOfExpression: + case SyntaxKind.VoidExpression: + case SyntaxKind.AwaitExpression: + case SyntaxKind.TypeAssertionExpression: + return true; + case SyntaxKind.PartiallyEmittedExpression: + return isUnaryExpression((node as PartiallyEmittedExpression).expression); + default: + return isLeftHandSideExpression(node); + } } /* @internal */ @@ -5014,21 +5020,22 @@ namespace ts { } } - function isExpressionKind(kind: SyntaxKind) { - return kind === SyntaxKind.ConditionalExpression - || kind === SyntaxKind.YieldExpression - || kind === SyntaxKind.ArrowFunction - || kind === SyntaxKind.BinaryExpression - || kind === SyntaxKind.SpreadElement - || kind === SyntaxKind.AsExpression - || kind === SyntaxKind.OmittedExpression - || kind === SyntaxKind.CommaListExpression - || isUnaryExpressionKind(kind); - } - /* @internal */ export function isExpression(node: Node): node is Expression { - return isExpressionKind(skipPartiallyEmittedExpressions(node).kind); + switch (node.kind) { + case SyntaxKind.ConditionalExpression: + case SyntaxKind.YieldExpression: + case SyntaxKind.ArrowFunction: + case SyntaxKind.BinaryExpression: + case SyntaxKind.SpreadElement: + case SyntaxKind.AsExpression: + case SyntaxKind.OmittedExpression: + case SyntaxKind.CommaListExpression: + case SyntaxKind.PartiallyEmittedExpression: + return true; + default: + return isUnaryExpression(node); + } } export function isAssertionExpression(node: Node): node is AssertionExpression { diff --git a/src/services/refactors/extractMethod.ts b/src/services/refactors/extractMethod.ts index f32321aff2a17..820212011a964 100644 --- a/src/services/refactors/extractMethod.ts +++ b/src/services/refactors/extractMethod.ts @@ -231,18 +231,7 @@ namespace ts.refactor.extractMethod { if (errors) { return { errors }; } - - // If our selection is the expression in an ExpressionStatement, expand - // the selection to include the enclosing Statement (this stops us - // from trying to care about the return value of the extracted function - // and eliminates double semicolon insertion in certain scenarios) - const range = isStatement(start) - ? [start] - : start.parent && start.parent.kind === SyntaxKind.ExpressionStatement - ? [start.parent as Statement] - : start as Expression; - - return { targetRange: { range, facts: rangeFacts, declarations } }; + return { targetRange: { range: getStatementOrExpressionRange(start), facts: rangeFacts, declarations } }; } function createErrorResult(sourceFile: SourceFile, start: number, length: number, message: DiagnosticMessage): RangeToExtract { @@ -459,6 +448,20 @@ namespace ts.refactor.extractMethod { } } + function getStatementOrExpressionRange(node: Node): Statement[] | Expression { + if (isStatement(node)) { + return [node]; + } + else if (isExpression(node)) { + // If our selection is the expression in an ExpressionStatement, expand + // the selection to include the enclosing Statement (this stops us + // from trying to care about the return value of the extracted function + // and eliminates double semicolon insertion in certain scenarios) + return isExpressionStatement(node.parent) ? [node.parent] : node; + } + return undefined; + } + function isValidExtractionTarget(node: Node): node is Scope { // Note that we don't use isFunctionLike because we don't want to put the extracted closure *inside* a method return (node.kind === SyntaxKind.FunctionDeclaration) || isSourceFile(node) || isModuleBlock(node) || isClassLike(node); diff --git a/tests/cases/fourslash/extract-method-not-for-import.ts b/tests/cases/fourslash/extract-method-not-for-import.ts new file mode 100644 index 0000000000000..a72d793611d62 --- /dev/null +++ b/tests/cases/fourslash/extract-method-not-for-import.ts @@ -0,0 +1,10 @@ +/// + +// @Filename: /a.ts +////i/**/mport _ from "./b"; + +// @Filename: /b.ts +////export default function f() {} + +goTo.marker(""); +verify.not.refactorAvailable('Extract Method');