Skip to content

Commit 062703b

Browse files
committed
Format
1 parent 42e19e3 commit 062703b

File tree

2 files changed

+11
-8
lines changed

2 files changed

+11
-8
lines changed

src/compiler/checker.ts

+10-7
Original file line numberDiff line numberDiff line change
@@ -469,6 +469,7 @@ import {
469469
isAutoAccessorPropertyDeclaration,
470470
isAwaitExpression,
471471
isBinaryExpression,
472+
isBinaryLogicalOperator,
472473
isBindableObjectDefinePropertyCall,
473474
isBindableStaticElementAccessExpression,
474475
isBindableStaticNameExpression,
@@ -913,6 +914,7 @@ import {
913914
OptionalTypeNode,
914915
or,
915916
orderedRemoveItemAt,
917+
OuterExpression,
916918
OuterExpressionKinds,
917919
ParameterDeclaration,
918920
parameterIsThisKeyword,
@@ -928,6 +930,7 @@ import {
928930
PatternAmbientModule,
929931
PlusToken,
930932
PostfixUnaryExpression,
933+
PredicateSemantics,
931934
PrefixUnaryExpression,
932935
PrivateIdentifier,
933936
Program,
@@ -1114,9 +1117,6 @@ import {
11141117
WideningContext,
11151118
WithStatement,
11161119
YieldExpression,
1117-
PredicateSemantics,
1118-
OuterExpression,
1119-
isBinaryLogicalOperator,
11201120
} from "./_namespaces/ts.js";
11211121
import * as moduleSpecifiers from "./_namespaces/ts.moduleSpecifiers.js";
11221122
import * as performance from "./_namespaces/ts.performance.js";
@@ -44145,13 +44145,16 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
4414544145
function checkTruthinessOfType(type: Type, node: Node) {
4414644146
if (type.flags & TypeFlags.Void) {
4414744147
error(node, Diagnostics.An_expression_of_type_void_cannot_be_tested_for_truthiness);
44148-
} else {
44148+
}
44149+
else {
4414944150
const semantics = getSyntacticTruthySemantics(node);
4415044151
if (semantics !== PredicateSemantics.Sometimes) {
44151-
error(node,
44152+
error(
44153+
node,
4415244154
semantics === PredicateSemantics.Always ?
44153-
Diagnostics.This_expression_is_always_truthy_Did_you_mean_to_test_something_else :
44154-
Diagnostics.This_expression_is_always_falsy_Did_you_mean_to_test_something_else)
44155+
Diagnostics.This_expression_is_always_truthy_Did_you_mean_to_test_something_else :
44156+
Diagnostics.This_expression_is_always_falsy_Did_you_mean_to_test_something_else,
44157+
);
4415544158
}
4415644159
}
4415744160

src/compiler/types.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -925,7 +925,7 @@ export const enum PredicateSemantics {
925925
None = 0,
926926
Always = 1 << 0,
927927
Never = 1 << 1,
928-
Sometimes = Always | Never
928+
Sometimes = Always | Never,
929929
}
930930

931931
/** @internal */

0 commit comments

Comments
 (0)