编辑:Syntastic配置为使用的JSLintSyntastic Vim中声称的功能可能无法返回
EDIT2:我使用JavascriptLint,不JSLint的
在下面的代码syntastic警告function inside does not always return a value
function(){
switch(age){
case 1:
return 'won';
case 2:
return 'too';
case 3:
return 'tree';
default:
throw 'wow man, you are old!';
break; //technically redundant
}
}
我知道default
不会返回一个值,但throw
会结束执行。这是一个Syntastic错误,还是应该改变我的编码风格?我应该在throw
之后发出return
声明吗?
Syntastic只是使用GCC进行语法检查。如果你使用'-Wall'编译GCC,你会得到同样的警告吗? –
我构建了我的合成器以使用jslint(描述[here](http://stackoverflow.com/questions/7926356/how-do-i-get-a-syntax-check-to-work-in-with-vim ))。 – puk
如果我使用'jsl -process',我会遇到同样的问题。 C/C++不是'gcc'吗? – puk