Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into identical_enum_types
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelMitchell-at committed Nov 11, 2024
2 parents 79a33d5 + ef802b1 commit 52885f2
Show file tree
Hide file tree
Showing 193 changed files with 22,577 additions and 984 deletions.
13 changes: 2 additions & 11 deletions Herebyfile.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -604,14 +604,6 @@ export const knip = task({
run: () => exec(process.execPath, ["node_modules/knip/bin/knip.js", "--tags=+internal,-knipignore", "--exclude=duplicates,enumMembers", ...(cmdLineOptions.fix ? ["--fix"] : [])]),
});

const { main: cancellationToken, watch: watchCancellationToken } = entrypointBuildTask({
name: "cancellation-token",
project: "src/cancellationToken",
srcEntrypoint: "./src/cancellationToken/cancellationToken.ts",
builtEntrypoint: "./built/local/cancellationToken/cancellationToken.js",
output: "./built/local/cancellationToken.js",
});

const { main: typingsInstaller, watch: watchTypingsInstaller } = entrypointBuildTask({
name: "typings-installer",
buildDeps: [generateDiagnostics],
Expand Down Expand Up @@ -661,14 +653,14 @@ const copyBuiltLocalDiagnosticMessages = task({
export const otherOutputs = task({
name: "other-outputs",
description: "Builds miscelaneous scripts and documents distributed with the LKG",
dependencies: [cancellationToken, typingsInstaller, watchGuard, generateTypesMap, copyBuiltLocalDiagnosticMessages],
dependencies: [typingsInstaller, watchGuard, generateTypesMap, copyBuiltLocalDiagnosticMessages],
});

export const watchOtherOutputs = task({
name: "watch-other-outputs",
description: "Builds miscelaneous scripts and documents distributed with the LKG",
hiddenFromTaskList: true,
dependencies: [watchCancellationToken, watchTypingsInstaller, watchWatchGuard, generateTypesMap, copyBuiltLocalDiagnosticMessages],
dependencies: [watchTypingsInstaller, watchWatchGuard, generateTypesMap, copyBuiltLocalDiagnosticMessages],
});

export const local = task({
Expand Down Expand Up @@ -916,7 +908,6 @@ export const produceLKG = task({
}

const expectedFiles = [
"built/local/cancellationToken.js",
"built/local/tsc.js",
"built/local/_tsc.js",
"built/local/tsserver.js",
Expand Down
1 change: 0 additions & 1 deletion knip.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
"includeEntryExports": true,
"entry": [
"Herebyfile.mjs",
"src/cancellationToken/cancellationToken.ts",
"src/testRunner/_namespaces/Harness.ts",
"src/tsc/tsc.ts",
"src/tsserver/server.ts",
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "typescript",
"author": "Microsoft Corp.",
"homepage": "https://www.typescriptlang.org/",
"version": "5.7.0",
"version": "5.8.0",
"license": "Apache-2.0",
"description": "TypeScript is a language for application scale JavaScript development",
"keywords": [
Expand Down
1 change: 0 additions & 1 deletion scripts/produceLKG.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ async function copyTypesMap() {
}

async function copyScriptOutputs() {
await copyFromBuiltLocal("cancellationToken.js");
await copyFromBuiltLocal("tsc.js");
await copyFromBuiltLocal("_tsc.js");
await copyFromBuiltLocal("tsserver.js");
Expand Down
69 changes: 0 additions & 69 deletions src/cancellationToken/cancellationToken.ts

This file was deleted.

9 changes: 0 additions & 9 deletions src/cancellationToken/tsconfig.json

This file was deleted.

14 changes: 14 additions & 0 deletions src/compiler/binder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -543,6 +543,7 @@ function createBinder(): (file: SourceFile, options: CompilerOptions) => void {
var preSwitchCaseFlow: FlowNode | undefined;
var activeLabelList: ActiveLabel | undefined;
var hasExplicitReturn: boolean;
var inReturnPosition: boolean;
var hasFlowEffects: boolean;

// state used for emit helpers
Expand Down Expand Up @@ -622,6 +623,7 @@ function createBinder(): (file: SourceFile, options: CompilerOptions) => void {
currentExceptionTarget = undefined;
activeLabelList = undefined;
hasExplicitReturn = false;
inReturnPosition = false;
hasFlowEffects = false;
inAssignmentPattern = false;
emitFlags = NodeFlags.None;
Expand Down Expand Up @@ -967,7 +969,9 @@ function createBinder(): (file: SourceFile, options: CompilerOptions) => void {
const saveContainer = container;
const saveThisParentContainer = thisParentContainer;
const savedBlockScopeContainer = blockScopeContainer;
const savedInReturnPosition = inReturnPosition;

if (node.kind === SyntaxKind.ArrowFunction && node.body.kind !== SyntaxKind.Block) inReturnPosition = true;
// Depending on what kind of node this is, we may have to adjust the current container
// and block-container. If the current node is a container, then it is automatically
// considered the current block-container as well. Also, for containers that we know
Expand Down Expand Up @@ -1071,6 +1075,7 @@ function createBinder(): (file: SourceFile, options: CompilerOptions) => void {
bindChildren(node);
}

inReturnPosition = savedInReturnPosition;
container = saveContainer;
thisParentContainer = saveThisParentContainer;
blockScopeContainer = savedBlockScopeContainer;
Expand Down Expand Up @@ -1571,7 +1576,10 @@ function createBinder(): (file: SourceFile, options: CompilerOptions) => void {
}

function bindReturnOrThrow(node: ReturnStatement | ThrowStatement): void {
const savedInReturnPosition = inReturnPosition;
inReturnPosition = true;
bind(node.expression);
inReturnPosition = savedInReturnPosition;
if (node.kind === SyntaxKind.ReturnStatement) {
hasExplicitReturn = true;
if (currentReturnTarget) {
Expand Down Expand Up @@ -2016,10 +2024,16 @@ function createBinder(): (file: SourceFile, options: CompilerOptions) => void {
hasFlowEffects = false;
bindCondition(node.condition, trueLabel, falseLabel);
currentFlow = finishFlowLabel(trueLabel);
if (inReturnPosition) {
node.flowNodeWhenTrue = currentFlow;
}
bind(node.questionToken);
bind(node.whenTrue);
addAntecedent(postExpressionLabel, currentFlow);
currentFlow = finishFlowLabel(falseLabel);
if (inReturnPosition) {
node.flowNodeWhenFalse = currentFlow;
}
bind(node.colonToken);
bind(node.whenFalse);
addAntecedent(postExpressionLabel, currentFlow);
Expand Down
Loading

0 comments on commit 52885f2

Please sign in to comment.