Valid JavaScript with in
inside for
produces syntax errors and invalid JavaScript output
#54769
Labels
Milestone
Bug Report
π Search Terms
for in syntax error
π Version & Regression Information
β― Playground Link
Playground link with relevant code
π» Code
π Actual behavior
When run, this code should print
false
six times. Eachfalse
is the value ofx
which has been default-initialized.π Expected behavior
TypeScript incorrectly generates syntax errors and generates the following invalid JavaScript output:
This came up because I was using VSCode to look at some JavaScript language tests and it was incorrectly showing syntax errors. I'm reporting this because it doesn't seem ideal that VSCode's JavaScript language support would treat valid JavaScript as invalid, and also because I believe the fix for this is relatively straightforward (probably something to do with
DisallowInContext
in the parser?).The text was updated successfully, but these errors were encountered: