Search the web
Sign In
New User? Sign Up
jslint_com · JSLint.com
? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Want your group to be featured on the Yahoo! Groups website? Add a group photo to Flickr.

Best of Y! Groups

   Check them out and nominate your group.
Having problems with message search? Fill out this form to ensure your group is one of the first to be migrated to the new message search system.

Messages

  Messages Help
Advanced
Messages 457 - 486 of 993   Oldest  |  < Older  |  Newer >  |  Newest
Messages: Simplify | Expand   (Group by Topic) Author Sort by Date ^
457
Widget Tester Widget (version 8.2) with JSLint 2009-04-30 is now at http://tinyurl.com/5unocx . This version has the option to download and use the latest...
Merlin
harry152566
Offline Send Email
May 1, 2009
12:09 pm
458
var global; (function () { var local; }()); Note that it lists local as Unused, but not global. I'm not sure if this is considered a bug or not, but it seems a...
pauanyu
Offline Send Email
May 1, 2009
4:23 pm
459
In a formal sense, it's a bug, but how could it be fixed? A global variable might be used by a different script, or by a bit of Javascript in an event...
Michael Lorton
mlorton
Offline Send Email
May 1, 2009
4:26 pm
460
test = function () {}; self.test = function () {}; window.test = function () {}; test(); JSLint sees the first three lines as different, even though they are...
pauanyu
Offline Send Email
May 1, 2009
4:31 pm
461
... As to your first point.. JSLint supports the /*global */ construct for global variables defined elsewhere....
pauanyu
Offline Send Email
May 1, 2009
4:36 pm
462
The /*global */ tag solves the reverse problem: how tell if a variable used here is declared elsewhere. Perhaps we need a /*external */ tag that asserts a...
Michael Lorton
mlorton
Offline Send Email
May 1, 2009
4:47 pm
463
I believe that unless you are in a browser, ”test” would be undefined in this case. First example is missing a “var”, second and third defines...
Jakob Kruse
thekrucible
Offline Send Email
May 1, 2009
4:53 pm
464
... Yes, and there's an "assume a browser" option that specifies browser objects (like window). You also don't need a var to declare a global variable, but...
pauanyu
Offline Send Email
May 1, 2009
5:03 pm
465
Actually, that is very common. The purpose of most libraries is to declare global variables for use elsewhere. /Jakob From: jslint_com@yahoogroups.com...
Jakob Kruse
thekrucible
Offline Send Email
May 1, 2009
8:25 pm
466
Again, the ”assume a browser” option of JSLint, AFAIK, only means that you don’t have to explicitly define the global object “window” and others. It...
Jakob Kruse
thekrucible
Offline Send Email
May 1, 2009
8:37 pm
467
The /*jslint */ comment can now specify the indent....
Douglas Crockford
douglascrock...
Offline Send Email
May 1, 2009
9:36 pm
468
... What are you proposing, that JSLint not allow access to window and self when assuming a browser? I think that is a reasonable restriction. A better...
Douglas Crockford
douglascrock...
Offline Send Email
May 1, 2009
9:47 pm
469
... I agree....
Merlin
harry152566
Offline Send Email
May 1, 2009
10:58 pm
470
... Using JavaScript also in a server-side context, "test", "self.test" and "window.test" are three different things. For me the actual behaviour is ok. ...
santini.alberto
Offline Send Email
May 1, 2009
11:05 pm
471
... No, my proposal is that since declaring a global variable with var is exactly the same as assigning a property to the window object, JSLint should be...
pauanyu
Offline Send Email
May 2, 2009
4:07 am
472
Declaring a global variable with var is not the same as assigning a property to the window object. In a browser, the two actions have the same effect, but a....
Michael Lorton
mlorton
Offline Send Email
May 2, 2009
4:53 am
473
You're right, of course, but even a library should avoid polluting the global names space any more than necessary. I prefer to have all the library's...
Michael Lorton
mlorton
Offline Send Email
May 2, 2009
5:01 am
474
... Yes, you do. Without "var", you're not creating a variable, but a property of the global object, which in the case of browsers is window (aka self). ... ...
crlender
Offline Send Email
May 2, 2009
8:30 am
475
The "Assume a browser" no longer supplies 'window' and 'self'. Having multiple representations of global variable access is a source of confusion. When feature...
Douglas Crockford
douglascrock...
Offline Send Email
May 2, 2009
2:29 pm
476
Douglas, I appreciate your diligence in keeping the list up-to-date with the latest changes as you deploy them. Is there any chance that you could be persuaded...
Mike West
mikewest_y
Offline Send Email
May 3, 2009
8:37 am
477
... I am curious, why is: if (typeof foo === 'undefined') { better than: if (!foo) { ?...
pauanyu
Offline Send Email
May 4, 2009
5:30 pm
478
... In your example, if foo is not declared, it will result in a ReferenceError being thrown. This won't happen if you test with the typeof operator. I think...
crlender
Offline Send Email
May 4, 2009
5:59 pm
479
Hello! I think really neat would be something that generates the jslint-options-string (/*jslint ... */). I am writing a small Javascript Library and had the...
christian.wirkus
christian.wi...
Offline Send Email
May 5, 2009
12:01 pm
480
... I see; thank you. Another question, why use: if (typeof console === 'object') { Instead of: if (console instanceof Object) { ? As far as I know, if...
pauanyu
Offline Send Email
May 5, 2009
12:48 pm
481
I disagree. Not with the ”single object” approach, that is a very good practice, but that libraries usually refer to themselves. I have a multitude of...
Jakob Kruse
thekrucible
Offline Send Email
May 5, 2009
4:12 pm
482
Really? Your libraries never have externally available functions or data that they themselves use? You could always do this, I suppose: var myModule = (...
Michael Lorton
mlorton
Offline Send Email
May 5, 2009
4:23 pm
483
Yes, really. I fail to see why I would want to reference the global from within its own declaration? That said, this discussion has gotten quite a bit off...
Jakob Kruse
thekrucible
Offline Send Email
May 5, 2009
5:21 pm
484
... I agree, but the idea was to be more of a helpful hint. If you declare a variable but don't use it, JSLint doesn't throw an error. Instead, it lists the...
pauanyu
Offline Send Email
May 5, 2009
5:52 pm
485
Internet Explorer has a window.execScript() method that basically does the same thing as eval(), except that it always executes scripts in the global scope: ...
crlender
Offline Send Email
May 5, 2009
6:54 pm
486
... Interesting idea. http://www.JSLint.com/index.html now provides assistance in building /*jslint*/ and /*global*/ comments....
Douglas Crockford
douglascrock...
Offline Send Email
May 6, 2009
12:57 am
Messages 457 - 486 of 993   Oldest  |  < Older  |  Newer >  |  Newest
Advanced
Add to My Yahoo!      XML What's This?

Copyright © 2009 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines - Help