Profile cover photo
Profile photo
Roderick Obrist
About
Roderick's posts

Post has attachment

Post has attachment

Post has attachment

Post has attachment

Post has attachment

Post has attachment

Post has attachment

I have started using the /properties/ directive in my JSLint backed IDE, and I believe it solves the typo in property access problem quite well.

I can think of numerous reasons why native methods/properties are not added into the properties directive. But at the same time it would be nice if I don't need to keep adding these into each script, as it does become a bit tedious after a while.

I'm wondering if there is any reason not to add a option to assume native properties e.g.

/jslint native: true/
which is the equivalent of:

/properties some, forEach, hasOwnProperty, length, map, reduce, getTime, concat, replace, test ....../

Or perhaps even:

/properties customProp1, customProp2, native:es6/
/properties customProp1, customProp2, native:es5/
/properties customProp1, customProp2, native:es3/

Which solves the problems like:
1. Which native properties do you assume?
2. If native option is true and there is no property directive, what do you do.

Does anyone have any thoughts to add to this?

Case 1:
try {
    fail();
} catch (e) {
    //Expected 'ignore' and instead saw 'e'.
   // This is good behaviour
}

Case 2:
try {
    fail();
} catch (ignore) {
    // No errors
   // This is good behaviour
}


Is this supposed to happen?

Case 3:
try {
    fail();
} catch (e) {
    errorHandler("custom description, not referencing e");
    // No errors
   // I would have expected : Expected 'ignore' and instead saw 'e'.
}

Case 4:
try {
    fail();
} catch (ignore) {
    errorHandler("custom description, not referencing ignore");
   //Unexpected 'ignore'.
   // I would have expected there to be no errors
}

It does not seem intuitive to me, but I know how to live it it. Thought I would let you know +Douglas Crockford 

I don't know if this is intentional or not, but:

alert("hello" + " world");  //good

alert("hello"+ " world");  //Missing space between 'hello' and '+'.

alert("hello"     + " world"); // good?

Note there are multiple spaces between "hello" and +, I thought JSLint would expect there to be absolutley one.
Wait while more posts are being loaded