Skip to content

Commit 351ccc9

Browse files
committed
Merge remote-tracking branch 'upstream/main' into noFloatingPromises
2 parents b2a2f6a + 3236ac9 commit 351ccc9

File tree

1,837 files changed

+4652
-33678
lines changed

Some content is hidden

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

1,837 files changed

+4652
-33678
lines changed

.github/workflows/accept-baselines-fix-lints.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
git config user.email "[email protected]"
1717
git config user.name "TypeScript Bot"
1818
npm install
19-
git rm -r --quiet tests/baselines/reference :^tests/baselines/reference/docker :^tests/baselines/reference/user
19+
git rm -r --quiet tests/baselines/reference
2020
npx hereby runtests-parallel --ci --fix || true
2121
npx hereby baseline-accept
2222
git add ./src

.gitignore

Lines changed: 1 addition & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ node_modules/
22
.node_modules/
33
built/*
44
tests/cases/rwc/*
5-
tests/cases/test262/*
65
tests/cases/perf/*
76
!tests/cases/webharness/compilerToString.js
87
test-args.txt
@@ -14,7 +13,6 @@ tests/baselines/local.old/*
1413
tests/services/baselines/local/*
1514
tests/baselines/prototyping/local/*
1615
tests/baselines/rwc/*
17-
tests/baselines/test262/*
1816
tests/baselines/reference/projectOutput/*
1917
tests/baselines/local/projectOutput/*
2018
tests/baselines/reference/testresults.tap
@@ -34,7 +32,6 @@ tests/webTestServer.js.map
3432
tests/webhost/*.d.ts
3533
tests/webhost/webtsc.js
3634
tests/cases/**/*.js
37-
!tests/cases/docker/*.js/
3835
tests/cases/**/*.js.map
3936
*.config
4037
scripts/eslint/built/
@@ -59,29 +56,9 @@ internal/
5956
yarn.lock
6057
yarn-error.log
6158
.parallelperf.*
62-
tests/cases/user/*/package-lock.json
63-
tests/cases/user/*/node_modules/
64-
tests/cases/user/*/**/*.js
65-
tests/cases/user/*/**/*.js.map
66-
tests/cases/user/*/**/*.d.ts
67-
!tests/cases/user/zone.js/
68-
!tests/cases/user/bignumber.js/
69-
!tests/cases/user/discord.js/
7059
tests/baselines/reference/dt
7160
.failed-tests
7261
TEST-results.xml
7362
package-lock.json
74-
tests/cases/user/npm/npm
75-
tests/cases/user/TypeScript-React-Starter/TypeScript-React-Starter
76-
tests/cases/user/TypeScript-Node-Starter/TypeScript-Node-Starter
77-
tests/cases/user/TypeScript-React-Native-Starter/TypeScript-React-Native-Starter
78-
tests/cases/user/TypeScript-Vue-Starter/TypeScript-Vue-Starter
79-
tests/cases/user/TypeScript-WeChat-Starter/TypeScript-WeChat-Starter
80-
tests/cases/user/create-react-app/create-react-app
81-
tests/cases/user/fp-ts/fp-ts
82-
tests/cases/user/webpack/webpack
83-
tests/cases/user/puppeteer/puppeteer
84-
tests/cases/user/axios-src/axios-src
85-
tests/cases/user/prettier/prettier
8663
.eslintcache
87-
*v8.log
64+
*v8.log

CONTRIBUTING.md

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -81,10 +81,7 @@ hereby tests # Build the test infrastructure using the built compile
8181
hereby runtests # Run tests using the built compiler and test infrastructure.
8282
# You can override the specific suite runner used or specify a test for this command.
8383
# Use --tests=<testPath> for a specific test and/or --runner=<runnerName> for a specific suite.
84-
# Valid runners include conformance, compiler, fourslash, project, user, and docker
85-
# The user and docker runners are extended test suite runners - the user runner
86-
# works on disk in the tests/cases/user directory, while the docker runner works in containers.
87-
# You'll need to have the docker executable in your system path for the docker runner to work.
84+
# Valid runners include conformance, compiler, fourslash, and project
8885
hereby runtests-parallel # Like runtests, but split across multiple threads. Uses a number of threads equal to the system
8986
# core count by default. Use --workers=<number> to adjust this.
9087
hereby baseline-accept # This replaces the baseline test results with the results obtained from hereby runtests.

package-lock.json

Lines changed: 276 additions & 276 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

scripts/build/tests.mjs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ export const localBaseline = "tests/baselines/local/";
1414
export const refBaseline = "tests/baselines/reference/";
1515
export const localRwcBaseline = "internal/baselines/rwc/local";
1616
export const refRwcBaseline = "internal/baselines/rwc/reference";
17-
export const localTest262Baseline = "internal/baselines/test262/local";
1817

1918
/**
2019
* @param {string} runJs

scripts/configurePrerelease.mjs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import assert from "assert";
2+
import { execFileSync } from "child_process";
23
import { readFileSync, writeFileSync } from "fs";
34
import { normalize, relative } from "path";
45
import url from "url";
@@ -11,6 +12,7 @@ const __filename = url.fileURLToPath(new URL(import.meta.url));
1112
name: string;
1213
version: string;
1314
keywords: string[];
15+
gitHead?: string;
1416
}} PackageJson
1517
*/
1618

@@ -51,6 +53,7 @@ function main() {
5153
// Finally write the changes to disk.
5254
// Modify the package.json structure
5355
packageJsonValue.version = `${majorMinor}.${prereleasePatch}`;
56+
packageJsonValue.gitHead = execFileSync("git", ["rev-parse", "HEAD"], { encoding: "utf8" }).trim();
5457
writeFileSync(packageJsonFilePath, JSON.stringify(packageJsonValue, /*replacer:*/ undefined, /*space:*/ 4));
5558
writeFileSync(tsFilePath, modifiedTsFileContents);
5659
}

src/.eslintrc.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"extends": "../.eslintrc.json",
33
"parserOptions": {
44
"tsconfigRootDir": "src",
5-
"project": "./tsconfig-base.json"
5+
"project": "./tsconfig-eslint.json"
66
},
77
"rules": {
88
"@typescript-eslint/no-unnecessary-type-assertion": "error",

src/compiler/binder.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -488,7 +488,7 @@ function initFlowNode<T extends FlowNode>(node: T) {
488488
return node;
489489
}
490490

491-
const binder = createBinder();
491+
const binder = /* @__PURE__ */ createBinder();
492492

493493
/** @internal */
494494
export function bindSourceFile(file: SourceFile, options: CompilerOptions) {

src/compiler/checker.ts

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1710,7 +1710,10 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
17101710
createIndexInfo,
17111711
getAnyType: () => anyType,
17121712
getStringType: () => stringType,
1713+
getStringLiteralType,
17131714
getNumberType: () => numberType,
1715+
getNumberLiteralType,
1716+
getBigIntType: () => bigintType,
17141717
createPromiseType,
17151718
createArrayType,
17161719
getElementTypeOfArrayType,
@@ -19107,6 +19110,10 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
1910719110
return isTypeRelatedTo(source, target, subtypeRelation);
1910819111
}
1910919112

19113+
function isTypeStrictSubtypeOf(source: Type, target: Type): boolean {
19114+
return isTypeRelatedTo(source, target, strictSubtypeRelation);
19115+
}
19116+
1911019117
function isTypeAssignableTo(source: Type, target: Type): boolean {
1911119118
return isTypeRelatedTo(source, target, assignableRelation);
1911219119
}
@@ -20704,9 +20711,9 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
2070420711
const propDeclaration = prop.valueDeclaration as ObjectLiteralElementLike;
2070520712
Debug.assertNode(propDeclaration, isObjectLiteralElementLike);
2070620713

20707-
errorNode = propDeclaration;
20708-
2070920714
const name = propDeclaration.name!;
20715+
errorNode = name;
20716+
2071020717
if (isIdentifier(name)) {
2071120718
suggestion = getSuggestionForNonexistentProperty(name, errorTarget);
2071220719
}
@@ -27270,7 +27277,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
2727027277
// prototype object types.
2727127278
const directlyRelated = mapType(matching || type, checkDerived ?
2727227279
t => isTypeDerivedFrom(t, c) ? t : isTypeDerivedFrom(c, t) ? c : neverType :
27273-
t => isTypeSubtypeOf(c, t) && !isTypeIdenticalTo(c, t) ? c : isTypeSubtypeOf(t, c) ? t : neverType);
27280+
t => isTypeStrictSubtypeOf(t, c) ? t : isTypeStrictSubtypeOf(c, t) ? c : isTypeSubtypeOf(t, c) ? t : isTypeSubtypeOf(c, t) ? c : neverType);
2727427281
// If no constituents are directly related, create intersections for any generic constituents that
2727527282
// are related by constraint.
2727627283
return directlyRelated.flags & TypeFlags.Never ?
@@ -38247,7 +38254,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
3824738254
}
3824838255

3824938256
function checkAccessorDeclaration(node: AccessorDeclaration) {
38250-
if (isIdentifier(node.name) && idText(node.name) === "constructor") {
38257+
if (isIdentifier(node.name) && idText(node.name) === "constructor" && isClassLike(node.parent)) {
3825138258
error(node.name, Diagnostics.Class_constructor_may_not_be_an_accessor);
3825238259
}
3825338260
addLazyDiagnostic(checkAccessorDeclarationDiagnostics);

src/compiler/diagnosticMessages.json

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4281,11 +4281,11 @@
42814281
"category": "Error",
42824282
"code": 5098
42834283
},
4284-
"Flag '{0}' is deprecated and will stop functioning in TypeScript {1}. Specify compilerOption '\"ignoreDeprecations\": \"{2}\"' to silence this error.": {
4284+
"Option '{0}' is deprecated and will stop functioning in TypeScript {1}. Specify compilerOption '\"ignoreDeprecations\": \"{2}\"' to silence this error.": {
42854285
"category": "Error",
42864286
"code": 5101
42874287
},
4288-
"Flag '{0}' is deprecated. Please remove it from your configuration.": {
4288+
"Option '{0}' has been removed. Please remove it from your configuration.": {
42894289
"category": "Error",
42904290
"code": 5102
42914291
},
@@ -4305,6 +4305,14 @@
43054305
"category": "Message",
43064306
"code": 5106
43074307
},
4308+
"Option '{0}={1}' is deprecated and will stop functioning in TypeScript {2}. Specify compilerOption '\"ignoreDeprecations\": \"{3}\"' to silence this error.": {
4309+
"category": "Error",
4310+
"code": 5107
4311+
},
4312+
"Option '{0}={1}' has been removed. Please remove it from your configuration.": {
4313+
"category": "Error",
4314+
"code": 5108
4315+
},
43084316

43094317
"Generates a sourcemap for each corresponding '.d.ts' file.": {
43104318
"category": "Message",

0 commit comments

Comments
 (0)