Eri*_*edt 7 javascript error-handling jslint use-strict webstorm
JSLint给出了"严格违规"错误,尽管我在一个隐藏全局范围的函数中使用了"this"上下文.
function test() {
"use strict";
this.a = "b";
}
Run Code Online (Sandbox Code Playgroud)
为了记录,我在Webstorm中使用内置的JSLint解析器.
Eri*_*edt 10
这是因为JSLint无法将您的函数识别为构造函数.按照惯例,您必须使用大写字母.
function Test() {
"use strict";
this.a = "b";
}
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
1824 次 |
最近记录: |