LoginSignup
0
0

More than 5 years have passed since last update.

JSLintでnewcap:trueを指定しても小文字から始まるコンストラクタに警告を返す

Posted at

古いJSLintでは、'use strict'があると、newcap:trueを上書きしてしまうようです。

/*jslint newcap:true*/
(function () {
    "use strict";
    var o;
    function myClass() {
    }

    // A constructor name 'myClass' should start with an uppercase letter. となる
    //o = new myClass();

    // use strictより後にnewcap:trueすると警告は出ない
    /*jslint newcap:true*/
    o = new myClass();
}());

2012-04-15に修正されています。
https://github.com/douglascrockford/JSLint/commit/4f2bf65ed59a0ba16fb22a6a90f76fc0060a2c22

Brackets Sprint 26に同梱のJSLintで現象を確認しました。jslint.jsのeditionは2012-01-13となっていました。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0