Why does JSBin display a lint on “new function() { … }”?
04:01 10 Dec 2011

http://jsbin.com/ufihev/3/edit

Pretty simple code :

var t = new function () //line 1
    {
        this.a1 = function () {

            return function () {
                alert("1");
            };
        }();
        this.a2 = function () {
            alert("a2");
        };

    }; //line 16
t.a1();

But jsBin red line bellow tells me :

Line 1: var t = new function () --- Weird construction. Delete 'new'.

Line 16: }; --- Missing '()' invoking a constructor.

The code is working fine.

What am I doing wrong?

javascript