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...
Real people. Real stories. See how Yahoo! Groups impacts members worldwide.

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 1 - 30 of 1020   Newest  |  < Newer  |  Older >  |  Oldest
Messages: Show Message Summaries   (Group by Topic) Sort by Date v  
#30 From: "Douglas Crockford" <douglas@...>
Date: Fri Apr 18, 2008 11:14 pm
Subject: Labels and scope
douglascrock...
Online Now Online Now
Send Email Send Email
 
I corrected an error in JSLint that created a scope around labeled
statements.

function a() {
foo:
     for (var i = 0; false;) {
     }
     return i;
}

As a result, it used to find an error on the return statement because
i was out of scope.

#29 From: "Douglas Crockford" <douglas@...>
Date: Fri Apr 18, 2008 9:27 pm
Subject: JavaScript URLs
douglascrock...
Online Now Online Now
Send Email Send Email
 
JSLint now rejects a string that starts with 'javascript:'. It
previously rejected a string that contained 'javascript:'.

Thanks to Timo.

#28 From: "Douglas Crockford" <douglas@...>
Date: Thu Apr 17, 2008 6:30 pm
Subject: Re: escape & unescape
douglascrock...
Online Now Online Now
Send Email Send Email
 
--- In jslint_com@yahoogroups.com, "Re Miya" <remiya_ws@...> wrote:
> This is the first time I heard that escape and unescape do not do URL
> encoding correctly, and are not in the official standard. Where can I
> find more information about this issue? Will this issue be resolved in
> the next JavaScript releases?
>
> What solution would you propose for escape and unescape?

See
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/script56/html/j\
s56jsmthescape.asp

#27 From: "Douglas Crockford" <douglas@...>
Date: Thu Apr 17, 2008 6:07 pm
Subject: Reserved words
douglascrock...
Online Now Online Now
Send Email Send Email
 
The ECMAScript standard reserves the following words:

abstract boolean byte char double final float implements int interface
long native package private protected public short static synchronized
throws transient volatile

None of those words are actually reserved by the 4 current browsers.
They will not be reserved in the next edition of the ECMAScript
standard. So I want to unreserved them in JSLint.

Will this cause a problem for other implentations of ECMAScript? In
particular, could that be a problem for Rhino?

#26 From: "Re Miya" <remiya_ws@...>
Date: Wed Apr 16, 2008 6:17 pm
Subject: Re: escape & unescape
remiya_ws
Offline Offline
Send Email Send Email
 
--- In jslint_com@yahoogroups.com, "Douglas Crockford" <douglas@...>
wrote:
>
> escape & unescape do not do url encoding correctly and they are not in
> the official standard. JSLint no longer accepts them. If you want
> JSLint to pass crappy legacy code containing them, insert
>
>     /*global escape, unescape */
>
> in your program.

Hello Douglas,

This is the first time I heard that escape and unescape do not do URL
encoding correctly, and are not in the official standard. Where can I
find more information about this issue? Will this issue be resolved in
the next JavaScript releases?

What solution would you propose for escape and unescape?

Best regards.

#25 From: "Douglas Crockford" <douglas@...>
Date: Wed Apr 16, 2008 2:04 am
Subject: escape & unescape
douglascrock...
Online Now Online Now
Send Email Send Email
 
escape & unescape do not do url encoding correctly and they are not in
the official standard. JSLint no longer accepts them. If you want
JSLint to pass crappy legacy code containing them, insert

     /*global escape, unescape */

in your program.

#24 From: "Douglas Crockford" <douglas@...>
Date: Tue Apr 15, 2008 4:26 pm
Subject: ADsafe and the Excluded Members
douglascrock...
Online Now Online Now
Send Email Send Email
 
I added arguments to the set of excluded members. The set now contains

apply arguments call callee caller constructor
eval prototype unwatch valueOf watch

#23 From: "hass0002" <sayed.hashimi@...>
Date: Tue Apr 15, 2008 5:30 am
Subject: MSBuild + JSLint
hass0002
Offline Offline
Send Email Send Email
 
Hi,
I have created an MSBuild task that can be used to automate the
process of running the JSLint tool on Javascript files. You can read
about it on my blog at
http://www.sedodream.com/PermaLink,guid,8e4c1e41-393b-402b-8251-10f3f59a54e2.asp\
x.
If you are interested in it please take a look & let me know what you
think.

It also can be used to integrate in to the Visual Studio build process.

Thanks,
Sayed Ibrahim Hashimi

#22 From: "Douglas Crockford" <douglas@...>
Date: Mon Apr 14, 2008 5:39 pm
Subject: Re: Unsafe characters
douglascrock...
Online Now Online Now
Send Email Send Email
 
--- In jslint_com@yahoogroups.com, Cory Bennett <coryb@...> wrote:
> I got this error from jslint:
> Unsafe character.
>         fn("FAILEDâ€"" + message);
>
> The 'â€"' is char 226 or 0xe2.  It is not ascii, but I was wondering
why it
> mattered since it is in a quoted string.

There are characters that are handled inconsistently in the various
implementations, and so must be escaped when placed in strings, and
must never be used outside of strings:

\u0000-\u001f
\u007f-\u009f
\u00ad
\u0600-\u0604
\u070f
\u17b4
\u17b5
\u200c-\u200f
\u2028-\u202f
\u2060-\u206f
\ufeff
\ufff0-\uffff

#21 From: Cory Bennett <coryb@...>
Date: Mon Apr 14, 2008 8:44 am
Subject: Unsafe characters
corynbennett
Online Now Online Now
Send Email Send Email
 
Hello,

I got this error from jslint:
Unsafe character.
         fn("FAILED—" + message);

The '—' is char 226 or 0xe2.  It is not ascii, but I was wondering why it
mattered since it is in a quoted string.  I didnt not see any reference
to "Unsafe character" on the website.

Thanks
-Cory

#20 From: "Douglas Crockford" <douglas@...>
Date: Thu Apr 10, 2008 3:28 am
Subject: Re: ADsafe and the Standard Globals
douglascrock...
Online Now Online Now
Send Email Send Email
 
--- In jslint_com@yahoogroups.com, "hass0002" <sayed.hashimi@...> wrote:
>
> --- In jslint_com@yahoogroups.com, "Douglas Crockford" <douglas@>
> wrote:
> >
> > I relaxed ADsafe to allow limited access to the standard globals.
> >
> Do you think it would be a good idea to include a version comment in
> the JSLint source file? I'm working on something and I think it would
> be good to say what version of the JSLint it is using.

I use dates.

#19 From: "hass0002" <sayed.hashimi@...>
Date: Thu Apr 10, 2008 2:32 am
Subject: Re: ADsafe and the Standard Globals
hass0002
Offline Offline
Send Email Send Email
 
--- In jslint_com@yahoogroups.com, "Douglas Crockford" <douglas@...>
wrote:
>
> I relaxed ADsafe to allow limited access to the standard globals.
>
Do you think it would be a good idea to include a version comment in
the JSLint source file? I'm working on something and I think it would
be good to say what version of the JSLint it is using.

Sayed Ibrahim Hashimi

#18 From: "Douglas Crockford" <douglas@...>
Date: Wed Apr 9, 2008 11:51 pm
Subject: ADsafe and the Standard Globals
douglascrock...
Online Now Online Now
Send Email Send Email
 
I relaxed ADsafe to allow limited access to the standard globals.

#17 From: "Douglas Crockford" <douglas@...>
Date: Tue Apr 8, 2008 11:31 pm
Subject: glovar
douglascrock...
Online Now Online Now
Send Email Send Email
 
I have added a glovar option. When glovar: true, then var cannot be
used to declare global variables.

Fiann O'Hagan convinced me that many programmers have a reasonable
expectation that top level var scopes to the compilation unit, like
C's static. It doesn't, and unmet expectations can induce bugs.
Further, var at the top level in implemented inconsistently, so

     var foo = this.foo || {};

does not do what you would expect on IE7.

JSLint will give the best results if you use the /*global*/ comment to
declare your globals.

     /*global foo*/

#16 From: "Douglas Crockford" <douglas@...>
Date: Sat Apr 5, 2008 3:04 pm
Subject: Warning
douglascrock...
Online Now Online Now
Send Email Send Email
 
I added a warning to the web page edition at http://www.JSLint.com/:

     WARNING: JSLint will hurt your feelings.

I relaxed the ADsafe restriction on the [ ] operator slightly. It will
now accept subscript values that are number literals or string
literals that are not legal identifiers.

#15 From: "Douglas Crockford" <douglas@...>
Date: Wed Apr 2, 2008 9:20 pm
Subject: Confusing decimal point
douglascrock...
Online Now Online Now
Send Email Send Email
 
When confronted with a number literal like

     .0725

JSLint no longer reports

     Don't use extra leading zeros '0725'.

but it does report

     A leading decimal point can be confused with a dot: '.0725'.

#14 From: "Douglas Crockford" <douglas@...>
Date: Mon Mar 31, 2008 9:45 pm
Subject: Re: Option Constructor
douglascrock...
Online Now Online Now
Send Email Send Email
 
--- In jslint_com@yahoogroups.com, "Chris" <Nielsen.Chris@...> wrote:
>
> When "Assume a Browser" is checked, why does the following code cause
> a problem?
>
> var o = new Option();
>
> Is there some browser that does not support the Option constructor?

That's a blast from the past.

JSLint now accepts it.

#13 From: "Chris" <Nielsen.Chris@...>
Date: Mon Mar 31, 2008 8:46 pm
Subject: Option Constructor
altearius
Offline Offline
Send Email Send Email
 
Howdy,

When "Assume a Browser" is checked, why does the following code cause
a problem?

var o = new Option();

Is there some browser that does not support the Option constructor?

- Chris

#12 From: "Douglas Crockford" <douglas@...>
Date: Mon Mar 31, 2008 4:04 pm
Subject: FormField
douglascrock...
Online Now Online Now
Send Email Send Email
 
JSLint now recognizes Konfabulator's FormFiled constructor.

#11 From: "Douglas Crockford" <douglas@...>
Date: Sat Mar 29, 2008 1:41 pm
Subject: arguments
douglascrock...
Online Now Online Now
Send Email Send Email
 
JSLint now prohibits assignment to the arguments pseudoarray.

The problem is that arguments is not a snapshot of the arguments that
are bound to the parameters. It remains linked, so changing an
elements of the arguments array changes a parameter.

#10 From: "Jacob Davenport" <jacob@...>
Date: Thu Mar 20, 2008 5:22 pm
Subject: Re: [jslint] else
jpdavenportjr
Offline Offline
Send Email Send Email
 
--- Douglas Crockford wrote:
> This isn't Perl. JavaScript has a dangerous semicolon
> insertion mechanism. More rigor is demanded.

It certainly isn't Perl.  I'd argue it's much easier to write bad code
in Perl than JavaScript, but at least it doesn't insert semicolons for
you.  You've made that point many times.

Do any browsers actually insert a semicolon after an unbrace carriage
return?  I don't think I'm being unsafe with breaking the unbrace and
else statements with a carriage return.  Doing so has the advantage
that the "else" is lined up with the "if" statement, makes the code
more readable, and the blocks more defined.

If unbrace-return-else is actually dangerous, about which I'd like you
to convince me, perhaps we can change jslint to catch it.  If it's not
dangerous, there's no need to change anything.

#9 From: Douglas Crockford <douglas@...>
Date: Thu Mar 20, 2008 4:19 pm
Subject: Re: [jslint] else
douglascrock...
Online Now Online Now
Send Email Send Email
 
This isn't Perl. JavaScript has a dangerous semicolon insertion mechanism. More
rigor is demanded.

Jacob Davenport wrote:
> In the world of Perl, we have this great book called Perl Best
> Practices, and there Conway argues that "else" should be written like
> this:
>
> if (ping == pong) {
>   dostuff();
> }
> else {
>   otherstuff();
> }
>
> So, I do the same in JavaScript, avoiding putting else on the same
> line as the unbrace.  jslint doesn't seem to mind this formatting when
> checking for white space.
>
> Views?
>
>
> ------------------------------------
>
> Yahoo! Groups Links
>
>
>
>

#8 From: "Jacob Davenport" <jacob@...>
Date: Thu Mar 20, 2008 3:18 pm
Subject: else
jpdavenportjr
Offline Offline
Send Email Send Email
 
In the world of Perl, we have this great book called Perl Best
Practices, and there Conway argues that "else" should be written like
this:

if (ping == pong) {
   dostuff();
}
else {
   otherstuff();
}

So, I do the same in JavaScript, avoiding putting else on the same
line as the unbrace.  jslint doesn't seem to mind this formatting when
checking for white space.

Views?

#7 From: "Donavon West" <donavonwest@...>
Date: Sat Mar 15, 2008 5:34 pm
Subject: Re: . in RegExp literals
donavon.west
Offline Offline
Send Email Send Email
 
--- In jslint_com@yahoogroups.com, "Douglas Crockford" <douglas@...>
wrote:
>
> I have been convinced that . in Regular Expression literals is
> dangerous because it usually does not precisely match what was
> intended. That can lead to reliability and even secure problems.
>
> JSLint now has a 'regexp' option to reject /./.
>
I think this is a good option. I'm not sure if I will use it (at least
not at first) but this has me thinking more about my regular
expressions and using "." haphazardly.

#6 From: "Douglas Crockford" <douglas@...>
Date: Sat Mar 15, 2008 12:25 pm
Subject: . in RegExp literals
douglascrock...
Online Now Online Now
Send Email Send Email
 
I have been convinced that . in Regular Expression literals is
dangerous because it usually does not precisely match what was
intended. That can lead to reliability and even secure problems.

JSLint now has a 'regexp' option to reject /./.

#5 From: "Douglas Crockford" <douglas@...>
Date: Thu Mar 13, 2008 12:35 pm
Subject: RegExp literals
douglascrock...
Online Now Online Now
Send Email Send Email
 
JSLint now allows the letters in the tag, g i m, to appear in any
order. I had been expecting they would always be in alphabetical order.

#4 From: "Douglas Crockford" <douglas@...>
Date: Wed Mar 12, 2008 6:56 pm
Subject: sidebar
douglascrock...
Online Now Online Now
Send Email Send Email
 
An option has been added to support Windows Sidebar. It is the same as
the browser option, except that it also predefines System.

#3 From: "Douglas Crockford" <douglas@...>
Date: Wed Mar 12, 2008 6:55 pm
Subject: Re: Modifications I've made.
douglascrock...
Online Now Online Now
Send Email Send Email
 
JSLint also replaces tabs with 4 spaces.

I can't recommend use of eval. Instead, try http://www.JSON.org/json2.js

#2 From: "jpdavenportjr" <jacob@...>
Date: Wed Mar 12, 2008 5:13 pm
Subject: Modifications I've made.
jpdavenportjr
Offline Offline
Send Email Send Email
 
Here at the US Courts we use YUI for our electronic case management
system, and recently use JLint to clean up our JavaScript code.

Although I personally prefer spaces for indentation over tabs, all the
other programmers here prefer tabs, so I changed my copy of the JLint
code to first change tabs to four spaces before processing.  A better
change would be to have an option for spaces versus tabs.

Our software is called "CMECF".  YUI has the YAHOO object, and I
created the CMECF object, so I added the option to "Assume CMECF object."

I tolerate eval by default because I eval JSON objects.  But if others
have found that parseJSON is sufficiently fast, I might change.  Views?

Douglas, thank you for a very helpful tool.

#1 From: "Douglas Crockford" <douglas@...>
Date: Tue Mar 11, 2008 4:35 pm
Subject: Expected a conditional expression and instead saw an assignment.
douglascrock...
Online Now Online Now
Send Email Send Email
 
Added a more descriptive error message for if, do, for, and while
statements.

Messages 1 - 30 of 1020   Newest  |  < Newer  |  Older >  |  Oldest
Advanced
Add to My Yahoo!      XML What's This?

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