This function: function isValidBZ (val) { return /^(?:[1-9]\d*|0)$/.test(val); } triggers the JSLint warning "Wrap the /regexp/ literal in parens to...
... This case is decidable, which is why JavaScript parsers are able to work, but there are problems in the language because it can be difficult to determine...
The current version of JSlint (at least on Rhino) only reads the Javascript from an existing file. If it could also optionally read from standard-input, I...
The current version of JSlint (at least on Rhino) exits with code 1 if it cannot read the file and 0 otherwise. If it instead would exit with 0 only if the...
The current version of JSlint (at least on Rhino) processes a single file. Since Rhino takes a noticeable time to start up (as much as 10 seconds), it would...
Right now, the code var a; while (a = f()) { ... causes JSLint to complain -- which is right in many cases: you are doing an assignment when you meant to do a...
If JSLint produced messages that looked like jsdir/jsfile.js:968: 'v' is already defined. then I could run run JSLint from inside emacs (or, I believe,...
I believe the standard technique works (add extra parens): while ((a = f())) { -jamie...
James Clark
sbj@...
Jan 9, 2009 9:54 pm
352
... Hi guys Sorry to dig up an old thread, but I don't quite understand Douglas' response, and this is a topic that's I've been curious about ever since I...
... "var true;" or "var (1==1);" wouldn't be valid, so there's no ambiguity about "var row=rows[i]" - it's obviously an assignment. The problem with for(var i...
... Thanks for the reply. I've never seen an example of where the slash in regex literals could be ambiguous for either humans or the parser. As far as I know,...
... I see... so wrapping the assignment in braces is simply a way to signify that yes, you intended to do an assignment. Slightly more verbose, but in the end...
... SVN. JSLint/Rhino is composed of two files: http://www.JSLint.com/fulljslint.js and http://www.JSLint.com/rhino/rhino.js You don't need to change...
It turned out *really well* -- it runs literally 100 times faster -- but I don't know how to share it. Should I just put it in a message here or is there an...
2009/1/9 M. Lorton <mlorton@...> ... Take a look at JSLint4Java, which embeds JSLint and does what you want, as well as being usable as an Ant task. Dan....
Daniel Cassidy
mail@...
Jan 13, 2009 4:59 pm
360
... jslint4java works, but it is in need of an update to the latest jslint. Unfortunately I've left it in a bit of a state. I'm hoping to get to working on it...
Hope this might help someone- I use jslint in my build process from ant as well and it works great (although it's a really old version of jslint...) If you...
2009/1/13 <dom@...> ... Just copying a newer JSLint into the jar works for me. If you're not finding time to work on jslint4java, would you be...
Daniel Cassidy
mail@...
Jan 14, 2009 8:48 pm
363
... I don't want to be maintaining Rhino stuff, but I do want to encourage sharing between the Rhino users. So please post it here, or upload a file here...
2009/1/10 Andy Stevens <insomniacpenguin@...> ... As well as that, the two loops are *not* equivalent. The first loops until it reaches *either* the...
Daniel Cassidy
mail@...
Jan 15, 2009 3:06 pm
365
... (granted in this specific case the DOM API guarantees the array will not contain any falsy values, but the same is not true for many other arrays)....
Daniel Cassidy
mail@...
Jan 15, 2009 3:07 pm
366
... Wow, that's good to know. I hadn't considered that possibility, and if I had run into a falsy (killing the loop) it could have really screwed something...
... Yes, it will do. I haven't advertised that though. :) The only thing is that you won't get access to the new options and so on (via Java). Which is not...
Here are two javascript mistakes I have recently made which jslint might be able to check for: 1. using the same variable in two nested loops var i; for (i =...
James Clark
sbj@...
Jan 21, 2009 9:16 pm
369
So, what changed? Is there some way besides looking at posts on this group to find the answer to this question?...
Part of my project uses a statement like the following: var b = new Array(a.length); but jslint complains: Use the array literal notation []. My theory here is...
James Clark
sbj@...
Jan 30, 2009 4:53 pm
372
... If you can demonstrate a significant performance advantage, then I will relax the test. Stylistically, I think [] is better, but I will bow to a compelling...
... I did a little experimenting and web-searching. I have found nothing conclusive, but some quickly-thrown-together tests found no significant difference in...