Skip to content

Commit 68361cc

Browse files
committed
More manual fixups
1 parent 24cf9e0 commit 68361cc

File tree

5 files changed

+26
-9
lines changed

5 files changed

+26
-9
lines changed

src/compiler/binder.ts

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -998,11 +998,12 @@ function createBinder(): (file: SourceFile, options: CompilerOptions) => void {
998998
const saveExceptionTarget = currentExceptionTarget;
999999
const saveActiveLabelList = activeLabelList;
10001000
const saveHasExplicitReturn = hasExplicitReturn;
1001-
const isImmediatelyInvoked = (containerFlags & ContainerFlags.IsFunctionExpression &&
1001+
const isImmediatelyInvoked = (
1002+
containerFlags & ContainerFlags.IsFunctionExpression &&
10021003
!hasSyntacticModifier(node, ModifierFlags.Async) &&
10031004
!(node as FunctionLikeDeclaration).asteriskToken &&
1004-
!!getImmediatelyInvokedFunctionExpression(node)) ||
1005-
node.kind === SyntaxKind.ClassStaticBlockDeclaration;
1005+
!!getImmediatelyInvokedFunctionExpression(node)
1006+
) || node.kind === SyntaxKind.ClassStaticBlockDeclaration;
10061007
// A non-async, non-generator IIFE is considered part of the containing control flow. Return statements behave
10071008
// similarly to break statements that exit to a label just past the statement body.
10081009
if (!isImmediatelyInvoked) {
@@ -2298,7 +2299,11 @@ function createBinder(): (file: SourceFile, options: CompilerOptions) => void {
22982299
function declareModuleSymbol(node: ModuleDeclaration): ModuleInstanceState {
22992300
const state = getModuleInstanceState(node);
23002301
const instantiated = state !== ModuleInstanceState.NonInstantiated;
2301-
declareSymbolAndAddToSymbolTable(node, instantiated ? SymbolFlags.ValueModule : SymbolFlags.NamespaceModule, instantiated ? SymbolFlags.ValueModuleExcludes : SymbolFlags.NamespaceModuleExcludes);
2302+
declareSymbolAndAddToSymbolTable(
2303+
node,
2304+
instantiated ? SymbolFlags.ValueModule : SymbolFlags.NamespaceModule,
2305+
instantiated ? SymbolFlags.ValueModuleExcludes : SymbolFlags.NamespaceModuleExcludes,
2306+
);
23022307
return state;
23032308
}
23042309

src/compiler/builderState.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,14 @@ import {
3636
} from "./_namespaces/ts";
3737

3838
/** @internal */
39-
export function getFileEmitOutput(program: Program, sourceFile: SourceFile, emitOnlyDtsFiles: boolean, cancellationToken?: CancellationToken, customTransformers?: CustomTransformers, forceDtsEmit?: boolean): EmitOutput {
39+
export function getFileEmitOutput(
40+
program: Program,
41+
sourceFile: SourceFile,
42+
emitOnlyDtsFiles: boolean,
43+
cancellationToken?: CancellationToken,
44+
customTransformers?: CustomTransformers,
45+
forceDtsEmit?: boolean,
46+
): EmitOutput {
4047
const outputFiles: OutputFile[] = [];
4148
const { emitSkipped, diagnostics } = program.emit(sourceFile, writeFile, cancellationToken, emitOnlyDtsFiles, customTransformers, forceDtsEmit);
4249
return { outputFiles, emitSkipped, diagnostics };

src/compiler/moduleSpecifiers.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -705,7 +705,9 @@ function tryGetModuleNameFromAmbientModule(moduleSymbol: Symbol, checker: TypeCh
705705
const topNamespace = getTopNamespace(d);
706706
if (
707707
!(topNamespace?.parent?.parent
708-
&& isModuleBlock(topNamespace.parent) && isAmbientModule(topNamespace.parent.parent) && isSourceFile(topNamespace.parent.parent.parent))
708+
&& isModuleBlock(topNamespace.parent)
709+
&& isAmbientModule(topNamespace.parent.parent)
710+
&& isSourceFile(topNamespace.parent.parent.parent))
709711
) return;
710712
const exportAssignment = (topNamespace.parent.parent.symbol.exports?.get("export=" as __String)?.valueDeclaration as ExportAssignment)?.expression as PropertyAccessExpression | Identifier;
711713
if (!exportAssignment) return;

src/compiler/parser.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7633,7 +7633,10 @@ namespace Parser {
76337633
const savedDisallowIn = inDisallowInContext();
76347634
setDisallowInContext(inForStatementInitializer);
76357635

7636-
declarations = parseDelimitedList(ParsingContext.VariableDeclarations, inForStatementInitializer ? parseVariableDeclaration : parseVariableDeclarationAllowExclamation);
7636+
declarations = parseDelimitedList(
7637+
ParsingContext.VariableDeclarations,
7638+
inForStatementInitializer ? parseVariableDeclaration : parseVariableDeclarationAllowExclamation,
7639+
);
76377640

76387641
setDisallowInContext(savedDisallowIn);
76397642
}

src/compiler/program.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4326,8 +4326,8 @@ export function createProgram(rootNamesOrOptions: readonly string[] | CreateProg
43264326
options.outDir || // there is --outDir specified
43274327
options.rootDir || // there is --rootDir specified
43284328
options.sourceRoot || // there is --sourceRoot specified
4329-
options.mapRoot
4330-
) { // there is --mapRoot specified
4329+
options.mapRoot // there is --mapRoot specified
4330+
) {
43314331
// Precalculate and cache the common source directory
43324332
const dir = getCommonSourceDirectory();
43334333

0 commit comments

Comments
 (0)