vscode icon indicating copy to clipboard operation
vscode copied to clipboard

Javascript short circuit syntax not respected by syntax highlighting

Open bradbart opened this issue 10 years ago • 1 comments

  • VSCode Version: 1.0.0 fa6d0
  • OS Version: Windows 10

Steps to Reproduce:

  1. Write a function in a javascript function with the following definition:
function test(err) {
    err && return; 
    console.log('error'); 
}

Even though this syntax is valid, VS code underlines the return statement indicating that it expects an expression and that the console.log code is unreachable.

bradbart avatar Apr 29 '16 04:04 bradbart

This issue was moved to Microsoft/TypeScript#8530

dbaeumer avatar May 09 '16 12:05 dbaeumer