-
Notifications
You must be signed in to change notification settings - Fork 12.9k
Closed
Labels
FixedA PR has been merged for this issueA PR has been merged for this issueHelp WantedYou can do thisYou can do thisSuggestionAn idea for TypeScriptAn idea for TypeScript
Milestone
Description
TypeScript Version: 2.1.4
(0,eval)('var x = 10');
Expected behavior:
Compile fine.
Actual behavior:
error TS2695: Left side of comma operator is unused and has no side effects.
See also at TS Playground.
(0,eval)
is a well-used convenience syntax for invoking eval
with a global scope (as opposed to the scope of the caller).
One possible workaround is: (eval||null)
. But that's longer and most of all — hard to Google the reasoning behind. Whereas (0,eval)
is easy to find a detailed explanation for.
Please make it not error.
gcnewbasarat
Metadata
Metadata
Assignees
Labels
FixedA PR has been merged for this issueA PR has been merged for this issueHelp WantedYou can do thisYou can do thisSuggestionAn idea for TypeScriptAn idea for TypeScript