Skip to content

Commit f2c0bbb

Browse files
Update baselines.
1 parent e4a6208 commit f2c0bbb

File tree

6,738 files changed

+99941
-84671
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

6,738 files changed

+99941
-84671
lines changed

tests/baselines/reference/1.0lib-noErrors.js

+38
Original file line numberDiff line numberDiff line change
@@ -1158,4 +1158,42 @@ MERCHANTABLITY OR NON-INFRINGEMENT.
11581158
See the Apache Version 2.0 License for specific language governing permissions
11591159
and limitations under the License.
11601160
***************************************************************************** */
1161+
11611162
/// <reference no-default-lib="true"/>
1163+
1164+
1165+
1166+
1167+
1168+
1169+
1170+
1171+
1172+
1173+
1174+
1175+
1176+
1177+
1178+
1179+
1180+
1181+
1182+
1183+
1184+
1185+
1186+
1187+
1188+
1189+
1190+
1191+
1192+
1193+
1194+
1195+
1196+
1197+
1198+
1199+

tests/baselines/reference/2dArrays.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,7 @@ var Ship = /** @class */ (function () {
2828
}());
2929
var Board = /** @class */ (function () {
3030
function Board() {
31-
}
32-
Board.prototype.allShipsSunk = function () {
31+
}Board.prototype.allShipsSunk = function () {
3332
return this.ships.every(function (val) { return val.isSunk; });
3433
};
3534
return Board;

tests/baselines/reference/APISample_Watch.js

+17-3
Original file line numberDiff line numberDiff line change
@@ -90,12 +90,17 @@ watchMain();
9090
* Please log a "breaking change" issue for any API breaking change affecting this issue
9191
*/
9292
exports.__esModule = true;
93+
9394
var ts = require("typescript");
95+
9496
var formatHost = {
9597
getCanonicalFileName: function (path) { return path; },
9698
getCurrentDirectory: ts.sys.getCurrentDirectory,
9799
getNewLine: function () { return ts.sys.newLine; }
98-
};
100+
}
101+
102+
;
103+
99104
function watchMain() {
100105
var configPath = ts.findConfigFile(/*searchPath*/ "./", ts.sys.fileExists, "tsconfig.json");
101106
if (!configPath) {
@@ -111,7 +116,11 @@ function watchMain() {
111116
// Between `createEmitAndSemanticDiagnosticsBuilderProgram` and `createSemanticDiagnosticsBuilderProgram`, the only difference is emit.
112117
// For pure type-checking scenarios, or when another tool/process handles emit, using `createSemanticDiagnosticsBuilderProgram` may be more desirable.
113118
// Note that there is another overload for `createWatchCompilerHost` that takes a set of root files.
114-
var host = ts.createWatchCompilerHost(configPath, {}, ts.sys, ts.createSemanticDiagnosticsBuilderProgram, reportDiagnostic, reportWatchStatusChanged);
119+
var host = ts.createWatchCompilerHost(configPath, {}, ts.sys,
120+
ts.createSemanticDiagnosticsBuilderProgram,
121+
reportDiagnostic,
122+
reportWatchStatusChanged);
123+
115124
// You can technically override any given hook on the host, though you probably don't need to.
116125
// Note that we're assuming `origCreateProgram` and `origPostProgramCreate` doesn't use `this` at all.
117126
var origCreateProgram = host.createProgram;
@@ -120,16 +129,21 @@ function watchMain() {
120129
return origCreateProgram(rootNames, options, host, oldProgram);
121130
};
122131
var origPostProgramCreate = host.afterProgramCreate;
132+
123133
host.afterProgramCreate = function (program) {
124134
console.log("** We finished making the program! **");
125135
origPostProgramCreate(program);
126136
};
127137
// `createWatchProgram` creates an initial program, watches files, and updates the program over time.
128138
ts.createWatchProgram(host);
129139
}
140+
130141
function reportDiagnostic(diagnostic) {
131-
console.error("Error", diagnostic.code, ":", ts.flattenDiagnosticMessageText(diagnostic.messageText, formatHost.getNewLine()));
142+
console.error("Error", diagnostic.code, ":",
143+
ts.flattenDiagnosticMessageText(diagnostic.messageText, formatHost.getNewLine())
144+
);
132145
}
146+
133147
/**
134148
* Prints a diagnostic every time the watch status changes.
135149
* This is mainly for messages like "Starting compilation" or "Compilation completed".

tests/baselines/reference/APISample_WatchWithDefaults.js

+4
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,9 @@ watchMain();
6262
* Please log a "breaking change" issue for any API breaking change affecting this issue
6363
*/
6464
exports.__esModule = true;
65+
6566
var ts = require("typescript");
67+
6668
function watchMain() {
6769
var configPath = ts.findConfigFile(/*searchPath*/ "./", ts.sys.fileExists, "tsconfig.json");
6870
if (!configPath) {
@@ -79,6 +81,7 @@ function watchMain() {
7981
// For pure type-checking scenarios, or when another tool/process handles emit, using `createSemanticDiagnosticsBuilderProgram` may be more desirable.
8082
// Note that there is another overload for `createWatchCompilerHost` that takes a set of root files.
8183
var host = ts.createWatchCompilerHost(configPath, {}, ts.sys);
84+
8285
// You can technically override any given hook on the host, though you probably don't need to.
8386
// Note that we're assuming `origCreateProgram` and `origPostProgramCreate` doesn't use `this` at all.
8487
var origCreateProgram = host.createProgram;
@@ -87,6 +90,7 @@ function watchMain() {
8790
return origCreateProgram(rootNames, options, host, oldProgram);
8891
};
8992
var origPostProgramCreate = host.afterProgramCreate;
93+
9094
host.afterProgramCreate = function (program) {
9195
console.log("** We finished making the program! **");
9296
origPostProgramCreate(program);

tests/baselines/reference/APISample_WatchWithOwnWatchHost.js

+6
Original file line numberDiff line numberDiff line change
@@ -69,14 +69,18 @@ watchMain();
6969
* Please log a "breaking change" issue for any API breaking change affecting this issue
7070
*/
7171
exports.__esModule = true;
72+
7273
var ts = require("typescript");
74+
7375
function watchMain() {
7476
// get list of files and compiler options somehow
7577
var files = [];
7678
var options = {};
79+
7780
var host = {
7881
rootFiles: files,
7982
options: options,
83+
8084
useCaseSensitiveFileNames: function () { return ts.sys.useCaseSensitiveFileNames; },
8185
getNewLine: function () { return ts.sys.newLine; },
8286
getCurrentDirectory: ts.sys.getCurrentDirectory,
@@ -91,6 +95,7 @@ function watchMain() {
9195
watchDirectory: ts.sys.watchDirectory,
9296
createProgram: ts.createAbstractBuilder
9397
};
98+
9499
// You can technically override any given hook on the host, though you probably don't need to.
95100
// Note that we're assuming `origCreateProgram` and `origPostProgramCreate` doesn't use `this` at all.
96101
var origCreateProgram = host.createProgram;
@@ -99,6 +104,7 @@ function watchMain() {
99104
return origCreateProgram(rootNames, options, host, oldProgram);
100105
};
101106
var origPostProgramCreate = host.afterProgramCreate;
107+
102108
host.afterProgramCreate = function (program) {
103109
console.log("** We finished making the program! **");
104110
origPostProgramCreate(program);

tests/baselines/reference/APISample_compile.js

+6-2
Original file line numberDiff line numberDiff line change
@@ -54,11 +54,15 @@ compile(process.argv.slice(2), {
5454
*/
5555
exports.__esModule = true;
5656
exports.compile = void 0;
57+
5758
var ts = require("typescript");
59+
5860
function compile(fileNames, options) {
5961
var program = ts.createProgram(fileNames, options);
6062
var emitResult = program.emit();
63+
6164
var allDiagnostics = ts.getPreEmitDiagnostics(program);
65+
6266
allDiagnostics.forEach(function (diagnostic) {
6367
var message = ts.flattenDiagnosticMessageText(diagnostic.messageText, '\n');
6468
if (!diagnostic.file) {
@@ -68,11 +72,11 @@ function compile(fileNames, options) {
6872
var _a = diagnostic.file.getLineAndCharacterOfPosition(diagnostic.start), line = _a.line, character = _a.character;
6973
console.log(diagnostic.file.fileName + " (" + (line + 1) + "," + (character + 1) + "): " + message);
7074
});
75+
7176
var exitCode = emitResult.emitSkipped ? 1 : 0;
7277
console.log("Process exiting with code '" + exitCode + "'.");
7378
process.exit(exitCode);
74-
}
75-
exports.compile = compile;
79+
}exports.compile = compile;
7680
compile(process.argv.slice(2), {
7781
noEmitOnError: true, noImplicitAny: true,
7882
target: ts.ScriptTarget.ES5, module: ts.ModuleKind.CommonJS

tests/baselines/reference/APISample_jsdoc.js

+15-1
Original file line numberDiff line numberDiff line change
@@ -129,19 +129,26 @@ function getSomeOtherTags(node: ts.Node) {
129129
* Please log a "breaking change" issue for any API breaking change affecting this issue
130130
*/
131131
exports.__esModule = true;
132+
132133
var ts = require("typescript");
134+
133135
// excerpted from https://github.com/YousefED/typescript-json-schema
134136
// (converted from a method and modified; for example, `this: any` to compensate, among other changes)
135-
function parseCommentsIntoDefinition(symbol, definition, otherAnnotations) {
137+
function parseCommentsIntoDefinition(
138+
symbol,
139+
definition,
140+
otherAnnotations) {
136141
var _this = this;
137142
if (!symbol) {
138143
return;
139144
}
140145
// the comments for a symbol
141146
var comments = symbol.getDocumentationComment(undefined);
147+
142148
if (comments.length) {
143149
definition.description = comments.map(function (comment) { return comment.kind === "lineBreak" ? comment.text : comment.text.trim().replace(/\r\n/g, "\n"); }).join("");
144150
}
151+
145152
// jsdocs are separate from comments
146153
var jsdocs = symbol.getJsDocTags();
147154
jsdocs.forEach(function (doc) {
@@ -156,6 +163,8 @@ function parseCommentsIntoDefinition(symbol, definition, otherAnnotations) {
156163
}
157164
});
158165
}
166+
167+
159168
function getAnnotations(node) {
160169
var _this = this;
161170
var symbol = node.symbol;
@@ -171,10 +180,12 @@ function getAnnotations(node) {
171180
if (value !== undefined) {
172181
result[jsDocTag.name] = value;
173182
}
183+
174184
return result;
175185
}, {});
176186
return Object.keys(annotations).length ? annotations : undefined;
177187
}
188+
178189
// these examples are artificial and mostly nonsensical
179190
function parseSpecificTags(node) {
180191
if (node.kind === ts.SyntaxKind.Parameter) {
@@ -193,6 +204,7 @@ function parseSpecificTags(node) {
193204
}
194205
}
195206
}
207+
196208
function getReturnTypeFromJSDoc(node) {
197209
if (node.kind === ts.SyntaxKind.FunctionDeclaration) {
198210
return ts.getJSDocReturnType(node);
@@ -202,9 +214,11 @@ function getReturnTypeFromJSDoc(node) {
202214
return type.type;
203215
}
204216
}
217+
205218
function getAllTags(node) {
206219
ts.getJSDocTags(node);
207220
}
221+
208222
function getSomeOtherTags(node) {
209223
var tags = [];
210224
tags.push(ts.getJSDocAugmentsTag(node));

tests/baselines/reference/APISample_linter.js

+7-2
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,9 @@ fileNames.forEach(fileName => {
7979
*/
8080
exports.__esModule = true;
8181
exports.delint = void 0;
82+
8283
var ts = require("typescript");
84+
8385
function delint(sourceFile) {
8486
delintNode(sourceFile);
8587
function delintNode(node) {
@@ -92,6 +94,7 @@ function delint(sourceFile) {
9294
report(node, "A looping statement's contents should be wrapped in a block body.");
9395
}
9496
break;
97+
9598
case ts.SyntaxKind.IfStatement:
9699
var ifStatement = node;
97100
if (ifStatement.thenStatement.kind !== ts.SyntaxKind.Block) {
@@ -103,6 +106,7 @@ function delint(sourceFile) {
103106
report(ifStatement.elseStatement, "An else statement's contents should be wrapped in a block body.");
104107
}
105108
break;
109+
106110
case ts.SyntaxKind.BinaryExpression:
107111
var op = node.operatorToken.kind;
108112
if (op === ts.SyntaxKind.EqualsEqualsToken || op == ts.SyntaxKind.ExclamationEqualsToken) {
@@ -112,12 +116,13 @@ function delint(sourceFile) {
112116
}
113117
ts.forEachChild(node, delintNode);
114118
}
119+
115120
function report(node, message) {
116121
var _a = sourceFile.getLineAndCharacterOfPosition(node.getStart()), line = _a.line, character = _a.character;
117122
console.log(sourceFile.fileName + " (" + (line + 1) + "," + (character + 1) + "): " + message);
118123
}
119-
}
120-
exports.delint = delint;
124+
}exports.delint = delint;
125+
121126
var fileNames = process.argv.slice(2);
122127
fileNames.forEach(function (fileName) {
123128
// Parse a file

tests/baselines/reference/APISample_parseConfig.js

+4-2
Original file line numberDiff line numberDiff line change
@@ -51,13 +51,16 @@ export function createProgram(rootFiles: string[], compilerOptionsJson: string):
5151
*/
5252
exports.__esModule = true;
5353
exports.createProgram = void 0;
54+
5455
var ts = require("typescript");
56+
5557
function printError(error) {
5658
if (!error) {
5759
return;
5860
}
5961
console.log((error.file && error.file.fileName) + ": " + error.messageText);
6062
}
63+
6164
function createProgram(rootFiles, compilerOptionsJson) {
6265
var _a = ts.parseConfigFileTextToJson("tsconfig.json", compilerOptionsJson), config = _a.config, error = _a.error;
6366
if (error) {
@@ -74,5 +77,4 @@ function createProgram(rootFiles, compilerOptionsJson) {
7477
return undefined;
7578
}
7679
return ts.createProgram(rootFiles, settings.options);
77-
}
78-
exports.createProgram = createProgram;
80+
}exports.createProgram = createProgram;

tests/baselines/reference/APISample_transform.js

+3
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,10 @@ console.log(JSON.stringify(result));
3030
* Please log a "breaking change" issue for any API breaking change affecting this issue
3131
*/
3232
exports.__esModule = true;
33+
3334
var ts = require("typescript");
35+
3436
var source = "let x: string = 'string'";
37+
3538
var result = ts.transpile(source, { module: ts.ModuleKind.CommonJS });
3639
console.log(JSON.stringify(result));

0 commit comments

Comments
 (0)