Skip to content

Commit 5d559e3

Browse files
authored
Update submodule to rev without ES5 transforms, unicodeES5Identifier (#1230)
1 parent ad9559e commit 5d559e3

File tree

5,815 files changed

+32087
-309323
lines changed

Some content is hidden

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

5,815 files changed

+32087
-309323
lines changed

_submodules/TypeScript

Submodule TypeScript updated 8297 files

internal/tsoptions/tsconfigparsing_test.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -942,7 +942,6 @@ func TestParseSrcCompiler(t *testing.T) {
942942
"transformers/classThis.ts",
943943
"transformers/declarations.ts",
944944
"transformers/destructuring.ts",
945-
"transformers/es2015.ts",
946945
"transformers/es2016.ts",
947946
"transformers/es2017.ts",
948947
"transformers/es2018.ts",
@@ -951,7 +950,6 @@ func TestParseSrcCompiler(t *testing.T) {
951950
"transformers/es2021.ts",
952951
"transformers/esDecorators.ts",
953952
"transformers/esnext.ts",
954-
"transformers/generators.ts",
955953
"transformers/jsx.ts",
956954
"transformers/legacyDecorators.ts",
957955
"transformers/namedEvaluation.ts",
Lines changed: 7 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,14 @@
11
--- old.2dArrays.js
22
+++ new.2dArrays.js
3-
@@= skipped -17, +17 lines =@@
3+
@@= skipped -20, +20 lines =@@
4+
class Cell {
45
}
5-
6-
//// [2dArrays.js]
7-
-var Cell = /** @class */ (function () {
8-
- function Cell() {
9-
- }
10-
- return Cell;
11-
-}());
12-
-var Ship = /** @class */ (function () {
13-
- function Ship() {
14-
- }
15-
- return Ship;
16-
-}());
17-
-var Board = /** @class */ (function () {
18-
- function Board() {
19-
- }
20-
- Board.prototype.allShipsSunk = function () {
21-
+class Cell {
22-
+}
23-
+class Ship {
6+
class Ship {
247
+ isSunk;
25-
+}
26-
+class Board {
8+
}
9+
class Board {
2710
+ ships;
2811
+ cells;
29-
+ allShipsSunk() {
12+
allShipsSunk() {
3013
return this.ships.every(function (val) { return val.isSunk; });
31-
- };
32-
- return Board;
33-
-}());
34-
+ }
35-
+}
14+
}

testdata/baselines/reference/submodule/compiler/APISample_Watch.js.diff

Lines changed: 3 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -11,40 +11,7 @@
1111
- */
1212
Object.defineProperty(exports, "__esModule", { value: true });
1313
-var ts = require("typescript");
14-
-var formatHost = {
15-
- getCanonicalFileName: function (path) { return path; },
1614
+const ts = require("typescript");
17-
+const formatHost = {
18-
+ getCanonicalFileName: path => path,
19-
getCurrentDirectory: ts.sys.getCurrentDirectory,
20-
- getNewLine: function () { return ts.sys.newLine; },
21-
+ getNewLine: () => ts.sys.newLine,
22-
};
23-
function watchMain() {
24-
- var configPath = ts.findConfigFile(/*searchPath*/ "./", ts.sys.fileExists, "tsconfig.json");
25-
+ const configPath = ts.findConfigFile(/*searchPath*/ "./", ts.sys.fileExists, "tsconfig.json");
26-
if (!configPath) {
27-
throw new Error("Could not find a valid 'tsconfig.json'.");
28-
}
29-
@@= skipped -27, +22 lines =@@
30-
// Between `createEmitAndSemanticDiagnosticsBuilderProgram` and `createSemanticDiagnosticsBuilderProgram`, the only difference is emit.
31-
// For pure type-checking scenarios, or when another tool/process handles emit, using `createSemanticDiagnosticsBuilderProgram` may be more desirable.
32-
// Note that there is another overload for `createWatchCompilerHost` that takes a set of root files.
33-
- var host = ts.createWatchCompilerHost(configPath, {}, ts.sys, ts.createSemanticDiagnosticsBuilderProgram, reportDiagnostic, reportWatchStatusChanged);
34-
+ const host = ts.createWatchCompilerHost(configPath, {}, ts.sys, ts.createSemanticDiagnosticsBuilderProgram, reportDiagnostic, reportWatchStatusChanged);
35-
// You can technically override any given hook on the host, though you probably don't need to.
36-
// Note that we're assuming `origCreateProgram` and `origPostProgramCreate` doesn't use `this` at all.
37-
- var origCreateProgram = host.createProgram;
38-
- host.createProgram = function (rootNames, options, host, oldProgram) {
39-
+ const origCreateProgram = host.createProgram;
40-
+ host.createProgram = (rootNames, options, host, oldProgram) => {
41-
console.log("** We're about to create the program! **");
42-
return origCreateProgram(rootNames, options, host, oldProgram);
43-
};
44-
- var origPostProgramCreate = host.afterProgramCreate;
45-
- host.afterProgramCreate = function (program) {
46-
+ const origPostProgramCreate = host.afterProgramCreate;
47-
+ host.afterProgramCreate = program => {
48-
console.log("** We finished making the program! **");
49-
origPostProgramCreate(program);
50-
};
15+
const formatHost = {
16+
getCanonicalFileName: path => path,
17+
getCurrentDirectory: ts.sys.getCurrentDirectory,

testdata/baselines/reference/submodule/compiler/APISample_WatchWithDefaults.js.diff

Lines changed: 2 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -12,30 +12,5 @@
1212
-var ts = require("typescript");
1313
+const ts = require("typescript");
1414
function watchMain() {
15-
- var configPath = ts.findConfigFile(/*searchPath*/ "./", ts.sys.fileExists, "tsconfig.json");
16-
+ const configPath = ts.findConfigFile(/*searchPath*/ "./", ts.sys.fileExists, "tsconfig.json");
17-
if (!configPath) {
18-
throw new Error("Could not find a valid 'tsconfig.json'.");
19-
}
20-
@@= skipped -21, +17 lines =@@
21-
// Between `createEmitAndSemanticDiagnosticsBuilderProgram` and `createSemanticDiagnosticsBuilderProgram`, the only difference is emit.
22-
// For pure type-checking scenarios, or when another tool/process handles emit, using `createSemanticDiagnosticsBuilderProgram` may be more desirable.
23-
// Note that there is another overload for `createWatchCompilerHost` that takes a set of root files.
24-
- var host = ts.createWatchCompilerHost(configPath, {}, ts.sys);
25-
+ const host = ts.createWatchCompilerHost(configPath, {}, ts.sys);
26-
// You can technically override any given hook on the host, though you probably don't need to.
27-
// Note that we're assuming `origCreateProgram` and `origPostProgramCreate` doesn't use `this` at all.
28-
- var origCreateProgram = host.createProgram;
29-
- host.createProgram = function (rootNames, options, host, oldProgram) {
30-
+ const origCreateProgram = host.createProgram;
31-
+ host.createProgram = (rootNames, options, host, oldProgram) => {
32-
console.log("** We're about to create the program! **");
33-
return origCreateProgram(rootNames, options, host, oldProgram);
34-
};
35-
- var origPostProgramCreate = host.afterProgramCreate;
36-
- host.afterProgramCreate = function (program) {
37-
+ const origPostProgramCreate = host.afterProgramCreate;
38-
+ host.afterProgramCreate = program => {
39-
console.log("** We finished making the program! **");
40-
origPostProgramCreate(program);
41-
};
15+
const configPath = ts.findConfigFile(/*searchPath*/ "./", ts.sys.fileExists, "tsconfig.json");
16+
if (!configPath) {

testdata/baselines/reference/submodule/compiler/APISample_WatchWithOwnWatchHost.js.diff

Lines changed: 1 addition & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -13,40 +13,4 @@
1313
+const ts = require("typescript");
1414
function watchMain() {
1515
// get list of files and compiler options somehow
16-
- var files = [];
17-
- var options = {};
18-
- var host = {
19-
+ const files = [];
20-
+ const options = {};
21-
+ const host = {
22-
rootFiles: files,
23-
- options: options,
24-
- useCaseSensitiveFileNames: function () { return ts.sys.useCaseSensitiveFileNames; },
25-
- getNewLine: function () { return ts.sys.newLine; },
26-
+ options,
27-
+ useCaseSensitiveFileNames: () => ts.sys.useCaseSensitiveFileNames,
28-
+ getNewLine: () => ts.sys.newLine,
29-
getCurrentDirectory: ts.sys.getCurrentDirectory,
30-
- getDefaultLibFileName: function (options) { return ts.getDefaultLibFilePath(options); },
31-
+ getDefaultLibFileName: options => ts.getDefaultLibFilePath(options),
32-
fileExists: ts.sys.fileExists,
33-
readFile: ts.sys.readFile,
34-
directoryExists: ts.sys.directoryExists,
35-
@@= skipped -29, +25 lines =@@
36-
};
37-
// You can technically override any given hook on the host, though you probably don't need to.
38-
// Note that we're assuming `origCreateProgram` and `origPostProgramCreate` doesn't use `this` at all.
39-
- var origCreateProgram = host.createProgram;
40-
- host.createProgram = function (rootNames, options, host, oldProgram) {
41-
+ const origCreateProgram = host.createProgram;
42-
+ host.createProgram = (rootNames, options, host, oldProgram) => {
43-
console.log("** We're about to create the program! **");
44-
return origCreateProgram(rootNames, options, host, oldProgram);
45-
};
46-
- var origPostProgramCreate = host.afterProgramCreate;
47-
- host.afterProgramCreate = function (program) {
48-
+ const origPostProgramCreate = host.afterProgramCreate;
49-
+ host.afterProgramCreate = program => {
50-
console.log("** We finished making the program! **");
51-
origPostProgramCreate(program);
52-
};
16+
const files = [];

testdata/baselines/reference/submodule/compiler/APISample_compile.js.diff

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -15,23 +15,4 @@
1515
+const ts = require("typescript");
1616
function compile(fileNames, options) {
1717
var program = ts.createProgram(fileNames, options);
18-
var emitResult = program.emit();
19-
var allDiagnostics = ts.getPreEmitDiagnostics(program);
20-
- allDiagnostics.forEach(function (diagnostic) {
21-
+ allDiagnostics.forEach(diagnostic => {
22-
var message = ts.flattenDiagnosticMessageText(diagnostic.messageText, '\n');
23-
if (!diagnostic.file) {
24-
console.log(message);
25-
return;
26-
}
27-
- var _a = diagnostic.file.getLineAndCharacterOfPosition(diagnostic.start), line = _a.line, character = _a.character;
28-
- console.log("".concat(diagnostic.file.fileName, " (").concat(line + 1, ",").concat(character + 1, "): ").concat(message));
29-
+ var { line, character } = diagnostic.file.getLineAndCharacterOfPosition(diagnostic.start);
30-
+ console.log(`${diagnostic.file.fileName} (${line + 1},${character + 1}): ${message}`);
31-
});
32-
var exitCode = emitResult.emitSkipped ? 1 : 0;
33-
- console.log("Process exiting with code '".concat(exitCode, "'."));
34-
+ console.log(`Process exiting with code '${exitCode}'.`);
35-
process.exit(exitCode);
36-
}
37-
compile(process.argv.slice(2), {
18+
var emitResult = program.emit();

testdata/baselines/reference/submodule/compiler/APISample_jsdoc.js.diff

Lines changed: 1 addition & 90 deletions
Original file line numberDiff line numberDiff line change
@@ -15,93 +15,4 @@
1515
+const ts = require("typescript");
1616
// excerpted from https://github.com/YousefED/typescript-json-schema
1717
// (converted from a method and modified; for example, `this: any` to compensate, among other changes)
18-
function parseCommentsIntoDefinition(symbol, definition, otherAnnotations) {
19-
- var _this = this;
20-
if (!symbol) {
21-
return;
22-
}
23-
// the comments for a symbol
24-
- var comments = symbol.getDocumentationComment(undefined);
25-
+ let comments = symbol.getDocumentationComment(undefined);
26-
if (comments.length) {
27-
- definition.description = comments.map(function (comment) { return comment.kind === "lineBreak" ? comment.text : comment.text.trim().replace(/\r\n/g, "\n"); }).join("");
28-
+ definition.description = comments.map(comment => comment.kind === "lineBreak" ? comment.text : comment.text.trim().replace(/\r\n/g, "\n")).join("");
29-
}
30-
// jsdocs are separate from comments
31-
- var jsdocs = symbol.getJsDocTags(this.checker);
32-
- jsdocs.forEach(function (doc) {
33-
+ const jsdocs = symbol.getJsDocTags(this.checker);
34-
+ jsdocs.forEach(doc => {
35-
// if we have @TJS-... annotations, we have to parse them
36-
- var name = doc.name, text = doc.text;
37-
- if (_this.userValidationKeywords[name]) {
38-
- definition[name] = _this.parseValue(text);
39-
+ const { name, text } = doc;
40-
+ if (this.userValidationKeywords[name]) {
41-
+ definition[name] = this.parseValue(text);
42-
}
43-
else {
44-
// special annotations
45-
@@= skipped -35, +28 lines =@@
46-
});
47-
}
48-
function getAnnotations(node) {
49-
- var _this = this;
50-
- var symbol = node.symbol;
51-
+ const symbol = node.symbol;
52-
if (!symbol) {
53-
return undefined;
54-
}
55-
- var jsDocTags = symbol.getJsDocTags(this.checker);
56-
+ const jsDocTags = symbol.getJsDocTags(this.checker);
57-
if (!jsDocTags || !jsDocTags.length) {
58-
return undefined;
59-
}
60-
- var annotations = jsDocTags.reduce(function (result, jsDocTag) {
61-
- var value = _this.parseJsDocTag(jsDocTag);
62-
+ const annotations = jsDocTags.reduce((result, jsDocTag) => {
63-
+ const value = this.parseJsDocTag(jsDocTag);
64-
if (value !== undefined) {
65-
result[jsDocTag.name] = value;
66-
}
67-
@@= skipped -24, +23 lines =@@
68-
return ts.getJSDocParameterTags(node);
69-
}
70-
if (node.kind === ts.SyntaxKind.FunctionDeclaration) {
71-
- var func = node;
72-
+ const func = node;
73-
if (ts.hasJSDocParameterTags(func)) {
74-
- var flat = [];
75-
- for (var _i = 0, _a = func.parameters.map(ts.getJSDocParameterTags); _i < _a.length; _i++) {
76-
- var tags = _a[_i];
77-
+ const flat = [];
78-
+ for (const tags of func.parameters.map(ts.getJSDocParameterTags)) {
79-
if (tags)
80-
- flat.push.apply(flat, tags);
81-
+ flat.push(...tags);
82-
}
83-
return flat;
84-
}
85-
@@= skipped -16, +15 lines =@@
86-
if (node.kind === ts.SyntaxKind.FunctionDeclaration) {
87-
return ts.getJSDocReturnType(node);
88-
}
89-
- var type = ts.getJSDocType(node);
90-
+ let type = ts.getJSDocType(node);
91-
if (type && type.kind === ts.SyntaxKind.FunctionType) {
92-
return type.type;
93-
}
94-
@@= skipped -9, +9 lines =@@
95-
ts.getJSDocTags(node);
96-
}
97-
function getSomeOtherTags(node) {
98-
- var tags = [];
99-
+ const tags = [];
100-
tags.push(ts.getJSDocAugmentsTag(node));
101-
tags.push(ts.getJSDocClassTag(node));
102-
tags.push(ts.getJSDocReturnTag(node));
103-
- var type = ts.getJSDocTypeTag(node);
104-
+ const type = ts.getJSDocTypeTag(node);
105-
if (type) {
106-
tags.push(type);
107-
}
18+
function parseCommentsIntoDefinition(symbol, definition, otherAnnotations) {

testdata/baselines/reference/submodule/compiler/APISample_linter.js.diff

Lines changed: 1 addition & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -15,42 +15,4 @@
1515
+const ts = require("typescript");
1616
function delint(sourceFile) {
1717
delintNode(sourceFile);
18-
function delintNode(node) {
19-
@@= skipped -21, +16 lines =@@
20-
}
21-
break;
22-
case ts.SyntaxKind.IfStatement:
23-
- var ifStatement = node;
24-
+ let ifStatement = node;
25-
if (ifStatement.thenStatement.kind !== ts.SyntaxKind.Block) {
26-
report(ifStatement.thenStatement, "An if statement's contents should be wrapped in a block body.");
27-
}
28-
@@= skipped -11, +11 lines =@@
29-
}
30-
break;
31-
case ts.SyntaxKind.BinaryExpression:
32-
- var op = node.operatorToken.kind;
33-
+ let op = node.operatorToken.kind;
34-
if (op === ts.SyntaxKind.EqualsEqualsToken || op == ts.SyntaxKind.ExclamationEqualsToken) {
35-
report(node, "Use '===' and '!=='.");
36-
}
37-
@@= skipped -9, +9 lines =@@
38-
ts.forEachChild(node, delintNode);
39-
}
40-
function report(node, message) {
41-
- var _a = sourceFile.getLineAndCharacterOfPosition(node.getStart()), line = _a.line, character = _a.character;
42-
- console.log("".concat(sourceFile.fileName, " (").concat(line + 1, ",").concat(character + 1, "): ").concat(message));
43-
+ let { line, character } = sourceFile.getLineAndCharacterOfPosition(node.getStart());
44-
+ console.log(`${sourceFile.fileName} (${line + 1},${character + 1}): ${message}`);
45-
}
46-
}
47-
-var fileNames = process.argv.slice(2);
48-
-fileNames.forEach(function (fileName) {
49-
+const fileNames = process.argv.slice(2);
50-
+fileNames.forEach(fileName => {
51-
// Parse a file
52-
- var sourceFile = ts.createSourceFile(fileName, readFileSync(fileName).toString(), ts.ScriptTarget.ES2015, /*setParentNodes */ true);
53-
+ let sourceFile = ts.createSourceFile(fileName, readFileSync(fileName).toString(), ts.ScriptTarget.ES2015, /*setParentNodes */ true);
54-
// delint it
55-
delint(sourceFile);
56-
});
18+
function delintNode(node) {

testdata/baselines/reference/submodule/compiler/APISample_parseConfig.js.diff

Lines changed: 1 addition & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -15,26 +15,4 @@
1515
+const ts = require("typescript");
1616
function printError(error) {
1717
if (!error) {
18-
return;
19-
}
20-
- console.log("".concat(error.file && error.file.fileName, ": ").concat(error.messageText));
21-
+ console.log(`${error.file && error.file.fileName}: ${error.messageText}`);
22-
}
23-
function createProgram(rootFiles, compilerOptionsJson) {
24-
- var _a = ts.parseConfigFileTextToJson("tsconfig.json", compilerOptionsJson), config = _a.config, error = _a.error;
25-
+ const { config, error } = ts.parseConfigFileTextToJson("tsconfig.json", compilerOptionsJson);
26-
if (error) {
27-
printError(error);
28-
return undefined;
29-
}
30-
- var basePath = process.cwd();
31-
- var settings = ts.convertCompilerOptionsFromJson(config.config["compilerOptions"], basePath);
32-
+ const basePath = process.cwd();
33-
+ const settings = ts.convertCompilerOptionsFromJson(config.config["compilerOptions"], basePath);
34-
if (!settings.options) {
35-
- for (var _i = 0, _b = settings.errors; _i < _b.length; _i++) {
36-
- var err = _b[_i];
37-
+ for (const err of settings.errors) {
38-
printError(err);
39-
}
40-
return undefined;
18+
return;

0 commit comments

Comments
 (0)