We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent fd80409 commit 27675fcCopy full SHA for 27675fc
src/compiler/checker.ts
@@ -15929,7 +15929,7 @@ namespace ts {
15929
checkAssignmentOperator(rightType);
15930
return getRegularTypeOfObjectLiteral(rightType);
15931
case SyntaxKind.CommaToken:
15932
- if (!compilerOptions.allowUnreachableCode && isSideEffectFree(left)) {
+ if (!compilerOptions.allowUnreachableCode && isSideEffectFree(left) && right.text!=="eval") {
15933
error(left, Diagnostics.Left_side_of_comma_operator_is_unused_and_has_no_side_effects);
15934
}
15935
return rightType;
tests/cases/compiler/evalAfter0.ts
@@ -0,0 +1,3 @@
1
+(0,eval)("10");
2
+
3
+(0,alert)("10");
0 commit comments