JSLint warns: unexpected /*member when I add a new function to an object. What is this warning about? Sam...
1007
Douglas Crockford
douglascrock...
Nov 28, 2009 1:01 pm
... You have a /*member */ comment that lists all of the allowed member names, and you are declaring a member name that is not on the list....
1008
Douglas Crockford
douglascrock...
Dec 2, 2009 9:24 pm
I am thinking to remove the Disallow undefined variables. I added the option originally to make the transition easier for people with sloppy code. But that was...
1009
Dominic Mitchell
happygiraffe...
Dec 2, 2009 10:19 pm
... I'm not bothered by this — it seems like a very sensible idea. -Dom [Non-text portions of this message have been removed]...
1010
Aseem
aseem.kishor...
Dec 2, 2009 10:27 pm
I think the intention is right, but to be honest, I've turned it off on a few occasions as a workaround to allow code to be in a different order. By default,...
1011
Dominic Mitchell
happygiraffe...
Dec 2, 2009 11:00 pm
I've updated my jslint wrapper: - Now supports the "predef" option. - Uses jslint 2009-11-24, which adds the "devel" option. As usual, it's available from...
1012
pauanyu
Dec 3, 2009 12:45 pm
How about changing the "Disallow undefined variables" to "Allow using a function before it was defined"? That would handle Aseem's use-case while still...
1013
Tim Beadle
timbeadle
Dec 3, 2009 6:27 pm
2009/12/3 pauanyu <pcxunlimited@...> ... That sounds like a good idea - it would help people transition (I've done some of that to scripts I've taken...
1014
Aseem
aseem.kishor...
Dec 3, 2009 8:32 pm
That will definitely work for the meantime. But I've been meaning to ask (and this is a good time to), what's really wrong with referencing functions *inside*...
1015
Stefan Weiss
weiss@...
Dec 4, 2009 5:43 pm
... Nor will it in the first example. Function declarations are hoisted, which means that 'bar' is guaranteed to be available before the first statement in a...
1016
Aseem
aseem.kishor...
Dec 4, 2009 6:09 pm
Good post, I agree. Just a quick note -- ... Yes, this will work: bar(); function bar () { // ... } But I said it "feels" wrong, because in terms of...
1017
martijnbeulens
Dec 4, 2009 8:21 pm
Dear Sam, I've got no idea what's happening with the site reports, i can not reproduce this, a screenshot would be nice then i can look into it further. Next...
1018
Stefan Weiss
weiss@...
Dec 5, 2009 4:33 am
Hello Aseem. I agree with your post, except for one nitpick: ... That isn't a function declaration, so it won't be hoisted, and it won't be available at...
1019
samckayak
Dec 14, 2009 12:27 pm
When an array or object contains functions: var aFunct=[]; aFunct[0]=fnMyFunction; What are the pros and cons of invoking the function using either of the...
1020
Stefan Weiss
weiss@...
Dec 14, 2009 2:09 pm
... Technically, both versions are correct, but since the parentheses around aFunct[0] are redundant, and there are no ambiguities in aFunct[0](), I can't see...
1021
Joe C
v_2joecr
Dec 15, 2009 5:44 am
I've noticed that JSlint insists that all the times I put an alert box in that it is listad as an "Implied global". I don't see how that is possible since it...
1022
Dominic Mitchell
happygiraffe...
Dec 15, 2009 10:14 am
2009/12/15 Joe C <v2joecr@...> ... Try selecting the "devel" option before validation. -Dom [Non-text portions of this message have been removed]...
1023
donavon.west
Dec 16, 2009 7:24 pm
In JavaScript/ECMAScript, undefined is NOT a reserved word, but I get the error "Expected an identifier and instead saw 'undefined39; (a reserved word)" when...
1024
Aseem Kishore
aseem.kishor...
Dec 16, 2009 8:10 pm
Yeah I've run into that too. I know that jQuery uses that technique, as it allows for munging of the undefined name. I think it might also improve lookup...
1025
Douglas Crockford
douglascrock...
Dec 16, 2009 8:13 pm
... undefined should have been a reserved word. To avoid confusion, it is best to treat it as such....
1026
Douglas Crockford
douglascrock...
Dec 16, 2009 8:58 pm
... I don't recommend adopting lousy practices because something "might" be faster or because jQuery does it. If you can demonstrate a significant performance...
1027
donavon.west
Dec 16, 2009 10:55 pm
But the fact remains that undefined is NOT a reserved word yet JSLint erroneously reporting that it is. What I'm doing in the example given (which you call...
1028
samckayak
Dec 17, 2009 1:08 pm
... Sounds like you use JSLint as a syntax checker. Equally important is JSLint's ability to define a safe, reliable, readable subset of JavaScript....
1029
donavon.west
Dec 17, 2009 3:01 pm
Using undefined in such a way is not even remotely in the same ballpark as using exec(). Again undefined is NOT a reserved word. Keep the in JSLint warning if...
1030
Jakob Kruse
thekrucible
Dec 17, 2009 5:02 pm
Everyone, Related to the discussion on ’undefined’, ‘private’ is also reported as a reserved word, but ‘final’ is not. The YUI Compressor chokes on...
1031
jameswcryer
Dec 21, 2009 10:16 pm
Hi, I use the following syntax quite regularly for generating HTML rather than using the +="" or similar techniques. var htmlstring = '\ <h1>Title</h1>92; <p>\ ...
1032
Douglas Crockford
douglascrock...
Dec 21, 2009 11:42 pm
... It is not allowed by the third edition of the standard....
1033
Michael S. Mikowski
z_mikowski
Dec 22, 2009 9:46 pm
I have found the following style construct: var htmlstring; ... htmlstring = '<h1>Title</h1>39; + '<p>' + 'Some text' + '</p>' ; preferential for at least two...
1034
jameswcryer
Dec 23, 2009 5:10 pm
A good point well made, and yes we're using YUICompressor. Cheers, James....
1035
Nicklas Widlund Bjurman
lordmetroid
Jan 4, 2010 9:02 pm
Hi jslint.com mailing list, As a programmer of server side JavaScript software I would be very convenient if jslint also supported other APIs other than the...