... This is a good argument for eliminating -in-. I have never found it to be useful, and you have identified a case where it is dangerous. In any case, there...
1972
John Hawkinson
john.hawkinson
Feb 24, 2011 2:03 am
Douglas Crockford <douglas@...> wrote on Thu, 24 Feb 2011 ... I assume you mean (typeof obj[w] === 'number39;)? Doesn't this present a problem if...
1973
Rob Richardson
erobrich@...
Feb 24, 2011 2:14 am
I agree -in- is quite dangerous, but how would one enumerate an object's properties without it? Rob ... useful, and you have identified a case where it is...
1974
Douglas Crockford
douglascrock...
Feb 24, 2011 2:20 am
... I was talking about the -in- infix operator. This confusion is another justification for getting rid of it....
1975
bluflonalgul
Feb 24, 2011 9:41 am
I think there is this case where the 'for in' loops on a object used as a record. Does it makes sense here to had such tests mentioned in your option.forin ? ...
1976
Douglas Crockford
douglascrock...
Feb 24, 2011 1:41 pm
... Yes, because some third party code could insert something into Object.prototype without your knowledge and approval. So program defensively, so that your...
1977
Douglas Crockford
douglascrock...
Feb 24, 2011 5:32 pm
JSLint now gives a warning on the -in- prefix operator. It is recommended that name in object be written as object[name] !== undefined or as ...
1978
Rob Richardson
erobrich@...
Feb 24, 2011 5:59 pm
The error message for a missing semicolon seems confusing to the novice as it highlights the beginning of the subsequent line rather than the end of the...
1979
Douglas Crockford
douglascrock...
Feb 24, 2011 6:19 pm
JSLint now produces better error messages for missing ; and ,....
1980
Rob Richardson
erobrich@...
Feb 24, 2011 6:30 pm
Thank you. ... From: jslint_com@yahoogroups.com [mailto:jslint_com@yahoogroups.com] On Behalf Of Douglas Crockford Sent: Thursday, February 24, 2011 11:20 AM ...
1981
martijnbeulens
Feb 25, 2011 4:21 pm
Hi Guys, I've updated the JsLint engine to the 2011-02-24 version in dwlint. I also re-arranged the checkboxes in the config section. Hope it helps you ...
1982
Chris
altearius
Feb 25, 2011 5:15 pm
... JSLint does not complain about the following code, which features assignment inside a conditional: /*global document */ var p; if ((p =...
1983
Joshua Bell
inexorabletash
Feb 25, 2011 5:58 pm
Assignment expressions are fairly rightly considered a Bad Thing by JSLint and most of the sane world, since they are usually bugs not intentional code, e.g.: ...
1984
Cheney, Edward A SSG ...
sandyhead25
Feb 25, 2011 9:09 pm
Classification: UNCLASSIFIED Joshua, Use a single regex for all possible conditions: (/(first pattern)|(second pattern)/) Then you can test with a single...
1985
zbordie_flickr
Feb 26, 2011 4:06 pm
Hi there, I'm trying to build a tool that detects javascript code in any kind of language or file format, for example PHP, ASP.NET, etc. . Not just HTML. Since...
1986
Douglas Crockford
douglascrock...
Feb 26, 2011 6:00 pm
... JSLint contains an XML parser. A very early version of JSLint tried to use it to do what you are suggesting. The difficulty of looking for script in PHP...
1987
paulb777
Feb 26, 2011 7:15 pm
Install New Software to http://svn.codespot.com/a/eclipselabs.org/mobile-web-development-with-phonegap/tags/r1.2/download Choose jslint4java and, if needed,...
1988
Luke Page
page.luke...
Feb 26, 2011 10:02 pm
Hi, I'm scanning the jslint tree after processing to detect todo comments and warn about them. I also have a plan to validate vsdoc/jsdoc as well. Do you have...
1989
Marc Draco
smidoid
Feb 26, 2011 10:18 pm
This is a little O/T, sorry for that in advance. I agree with Douglas on pretty much everything (he's even helped to get me physically fitter!) with one...
1990
Douglas Crockford
douglascrock...
Feb 27, 2011 12:14 am
... Comments are being collected for a JSMax future feature. It is not finished yet, and I am not announcing if or when it ever will be finished. I have to...
1991
Martin Cooper
mfncooper
Feb 27, 2011 12:33 am
Working with Node.js (and probably other SSJS solutions), it's pretty common to find yourself working with the file system and using file permissions the...
1992
Douglas Crockford
douglascrock...
Feb 27, 2011 12:46 am
... No. Try this: fs.mkdir(dirname, parseInt('755', 8), callback); Octal is really hazardous, and it is rarely useful. For those rare useful cases, it is worth...
1993
Cheney, Edward A SSG ...
sandyhead25
Feb 27, 2011 1:18 pm
Classification: UNCLASSIFIED ... This is the logic I use for Pretty Diff: if (apilang === "auto") { autotest = true; if (new RegExp(/^(92;s*<)/).test(apisource)...
1994
zbordie_flickr
Feb 28, 2011 10:45 am
Like I said, I'm not trying to validate the JS. I'm trying to find out where it starts and where it ends. I have no problem with dynamically generated code....
1995
martijnbeulens
Feb 28, 2011 4:19 pm
In dwlint 1.0.0.5 a very nasty bug occurred when dwlint ran multiple times over a large JS document. I corrected the mistake and publsihed a new version....
1996
Douglas Crockford
douglascrock...
Feb 28, 2011 6:39 pm
The place to express yourself in programming is in the quality of your ideas, and the efficiency of execution. The role of style is the same as in literature....
1997
Erik Eckhardt
vorpalmage
Feb 28, 2011 7:11 pm
Douglas, That makes eminent sense. As a would-be writer myself, you're speaking my language. I appreciate the parallel. I'm sure others do, too. Erik On Mon,...
1998
Rob Richardson
erobrich@...
Feb 28, 2011 7:51 pm
I have to disagree. If there was a consistent style taught by all and/or enforced by all, it would be reasonable to apply it universally to all in a tool we...
1999
Luke Page
page.luke...
Feb 28, 2011 9:16 pm
The prime example of this fragmentation can be seen with the recently announced jshint.. I'm surprised no one here has yet mentioned it. I agree that...
2000
Luke Page
page.luke...
Feb 28, 2011 9:26 pm
I have made modifications to my own version along these lines.. 1. Fixed what looks like a typo in discard that appends prev.postcomments concat...