Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion internal/checker/checker.go
Original file line number Diff line number Diff line change
Expand Up @@ -12572,7 +12572,7 @@ func (c *Checker) isIndirectCall(node *ast.Node) bool {
right := node.AsBinaryExpression().Right
return ast.IsParenthesizedExpression(node.Parent) && ast.IsNumericLiteral(left) && left.Text() == "0" &&
(ast.IsCallExpression(node.Parent.Parent) && node.Parent.Parent.Expression() == node.Parent ||
ast.IsTaggedTemplateExpression(node.Parent.Parent) && (ast.IsAccessExpression(right) || ast.IsIdentifier(right) && right.Text() == "eval"))
ast.IsTaggedTemplateExpression(node.Parent.Parent)) && (ast.IsAccessExpression(right) || ast.IsIdentifier(right) && right.Text() == "eval")
}

func (c *Checker) checkInstanceOfExpression(left *ast.Expression, right *ast.Expression, leftType *Type, rightType *Type, checkMode CheckMode) *Type {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,10 @@ commaOperatorLeftSideUnused.ts(38,7): error TS2695: Left side of comma operator
commaOperatorLeftSideUnused.ts(39,7): error TS2695: Left side of comma operator is unused and has no side effects.
commaOperatorLeftSideUnused.ts(40,7): error TS2695: Left side of comma operator is unused and has no side effects.
commaOperatorLeftSideUnused.ts(41,7): error TS2695: Left side of comma operator is unused and has no side effects.
commaOperatorLeftSideUnused.ts(42,7): error TS2695: Left side of comma operator is unused and has no side effects.


==== commaOperatorLeftSideUnused.ts (23 errors) ====
==== commaOperatorLeftSideUnused.ts (24 errors) ====
var xx: any;
var yy: any;

Expand Down Expand Up @@ -112,6 +113,8 @@ commaOperatorLeftSideUnused.ts(41,7): error TS2695: Left side of comma operator
~~~
!!! error TS2695: Left side of comma operator is unused and has no side effects.
xx = (0, xx)();
~
!!! error TS2695: Left side of comma operator is unused and has no side effects.

// OK cases
xx = (xx ? x++ : 4, 10);
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
evalAfter0.ts(4,2): error TS2695: Left side of comma operator is unused and has no side effects.


==== evalAfter0.ts (1 errors) ====
(0,eval)("10"); // fine: special case for eval

declare var eva;
(0,eva)("10"); // error: no side effect left of comma (suspect of missing method name or something)
~
!!! error TS2695: Left side of comma operator is unused and has no side effects.

This file was deleted.

Loading