I have the following code:var dateStr;dateStr = day + month + this.padStr(date.getDate()) + " " +date.getFullYear() + " " + this.padStr(date.getHours())+ ":" +...
2640
m_blasz
Oct 8, 2011 2:40 pm
Yuck. Sorry about the formatting, it looks like I don't know how to format code on here...Here39;s an image of the code,...
2641
Merlin
harry152566
Oct 8, 2011 2:51 pm
... ... The next line should be indented 8 spaces." This is no longer correct. The next line should be indented by the number of spaces defined in the indent...
2642
m_blasz
Oct 8, 2011 3:02 pm
... Any reference/reason to why it's no longer correct? I've seen it used in other languages....
2643
m_blasz
Oct 8, 2011 3:06 pm
I have 2 questions. 1. Is there a JSLint option to tolerate variable assignments in if statements? If so, which one? 2. Why should we 'Move the invocation into...
2644
Merlin
harry152566
Oct 8, 2011 3:13 pm
... The basic idea is to indent continuation lines so that they are recognised as such. The standard indentation in JSLint is (by default) four spaces (set in...
2645
Merlin
harry152566
Oct 8, 2011 3:59 pm
... No. There are ways around it, if you really must: var a, b; if (a === b) { a = 1; } // OK if (a = b) { a = 1; } // NOT OK if (!!(a = b)) { a = 1; } // OK ...
2646
Satyam
satyamutsa
Oct 8, 2011 4:45 pm
Reduced to its simplest, this: <html> <head> <style> p { text-shadow: 0 0 2px rgba(255, 255, 255, 0.6); } </style> </head> </html> Produces: Problem at line 5...
2647
m_blasz
Oct 8, 2011 6:48 pm
I have the following code: var id = +/\d+/.exec(rId)[0]; and get the following error: Problem at line 240 character 24: Unexpected '\39;. The code is valid so it...
2648
Merlin
harry152566
Oct 8, 2011 9:47 pm
... Just because code is valid JavaScript does not mean that it is also acceptable to JSLint. JSLint is a code quality tool which enforces stricter standards...
2649
Merlin
harry152566
Oct 8, 2011 9:52 pm
2650
Douglas Crockford
douglascrock...
Oct 9, 2011 5:30 am
... Thank you for reducing to its simplest. That is very helpful. Please try it now....
2651
cse_html_validator
cse_html_val...
Oct 11, 2011 5:08 pm
Some here may be interested in this. I've integrated JSLint into CSE HTML Validator v11 (for Windows). There's currently a free BETA available here: ...
2652
Rob Richardson
erobrich@...
Oct 11, 2011 5:33 pm
Is it possible to ADSAFE the contents of an iframe src=http://some-random-site.com/? Rob...
2653
Douglas Crockford
douglascrock...
Oct 11, 2011 5:58 pm
... You will have to depend on some-random-site.com enforcing ADsafe rules....
2654
Rob Richardson
erobrich@...
Oct 11, 2011 7:55 pm
Bummer. I feared that was the case. Thanks for the quick reply. Rob ... From: jslint_com@yahoogroups.com [mailto:jslint_com@yahoogroups.com] On Behalf Of...
2655
Merlin
harry152566
Oct 14, 2011 12:54 pm
var fred; if (!fred) { fred = {}; } var FRED; if (!FRED) { FRED = {}; } var JSON; if (!JSON) { JSON = {}; } Error: Problem at line 13 character 5: Read only. ...
2656
Douglas Crockford
douglascrock...
Oct 14, 2011 1:26 pm
... It is a global object provided by ES5....
2657
sandyhead25
Oct 25, 2011 8:34 pm
Consider the following code. var a = function () { "use strict"; var b = [], c = b.length, d = 0; for (; d < c; d += 1) { return ""; } }; The point of...
2658
Douglas Crockford
douglascrock...
Oct 25, 2011 8:45 pm
... It is the former. JSLint expects that either all 3 clauses are empty, or they are all used. The first clause is expected to initialize the induction...
I am no longer able to upgrade to JSLint to pick up bug fixes and new features because of these two rules: - "this" can't be used in named functions. I...
2661
Tom Worster
thefsb
Oct 27, 2011 9:20 pm
... i want jslint to tell be about these in my code. ... i don't mind either way as it's easy to address in the build system. i don't entirely understand why...
2662
paulcrowder1979
Oct 28, 2011 3:08 pm
... Who's running JSLint on third-party code?...
2663
sandyhead25
Oct 28, 2011 4:15 pm
... Strict mode is the future of the language. The language is dead set on a course for increased readability and more terse syntax. ... Events are treated as...
2664
Erik Eckhardt
vorpalmage
Oct 28, 2011 4:16 pm
1. It's nice that *you* want jslint to tell you about these in your code. Someone else doesn't want it. You sound like my 5-year-old son who always has to...
2665
John Hawkinson
john.hawkinson
Oct 28, 2011 4:29 pm
... Only that it is cumbersome, expensive, and inefficient to do so. Forks are not free. They add huge maintenance hassles. They also are rude to the...
2666
Chris
altearius
Nov 3, 2011 6:44 pm
I recent debugged some code that followed this pattern: var a, b, c; a === b = c; When executed, this results in a syntax error, due to invalid left-hand side...
2667
Douglas Crockford
douglascrock...
Nov 3, 2011 7:11 pm
... Thanks. Please try it now....
2668
mathew
metavariable
Nov 14, 2011 7:23 pm
... Someone else already suggested running a beautifier on the code. Here are three more solutions: 1. Have the unit tests run an EOL whitespace check. 2. Have...