Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to fix JSLint "missing new" error

Code below passed through JSLint causes an error:

Problem at line 8 character 9: Missing 'new'.

ResizeGrid();

How to fix?

"use strict";

var ResizeGrid;

function t() {
    var x;
    if (x) {
        ResizeGrid();
    }
}
like image 655
Andrus Avatar asked Sep 27 '11 12:09

Andrus


1 Answers

Tick Tolerate uncapitalized constructors or rename to resizeGrid(); to prevent lint from assuming its a function constructor (although calling an undefined var like that will raise other errors).

like image 180
Alex K. Avatar answered Sep 23 '22 10:09

Alex K.