zhoupan / jmesa

Automatically exported from code.google.com/p/jmesa
0 stars 0 forks source link

Make jquery.jmesa.js "lint free" #186

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
I think that it is not a bad idea to modify JMesa's javascript to make it
be able to pass JSLint's validator using "The Good Parts" button.

Mostly this involves several changes:

1) Scoping the inadvertently global variable 'classes' so that it local instead

2) Changing '==' and '!=' to '===' and '!=='

3) Using [] and {} instead of 'new Array()' and 'new Object()'

along with a few other small tweaks and whitespace rules.  Obviously, the
javascript is working fine as it is, but JSLint is good at catching common
JavaScript error that occur because of its dynamic nature (like #1 above)
and its forgiving parser.

I don't want to hold up the next release for this, but I have already made
the changes and I am testing them in my own project right now.  The only
thing that I will need help testing the worksheet because I don't use that yet.

What do you think?

Original issue reported on code.google.com by bgo...@e1b.org on 2 Apr 2009 at 2:17

GoogleCodeExporter commented 9 years ago
If you are confident of the changes I will test out the worksheet part. I think 
if
you already have the work done then we should just make the change...I am all 
for
improving the framework! It will delay the release a little, but I think the
developers that requested the changes they needed are running off of custom 
builds
anyway. Maybe we just say that this change is the last for the next release.

Also, could you include how to test with JSLint's validator?

Original comment by jeff.johnston.mn@gmail.com on 2 Apr 2009 at 4:39

GoogleCodeExporter commented 9 years ago
actually, I'm not so confident yet, I just wanted to see what you thought of the
idea.  To run JSLint I usually just go to jslint.com, paste in the code, hit 
"The
Good Parts" button and then hit the "JSLint" button.  I'm sure there's a way to
integrate it into ant using Rhino (which I think we have in the repository 
already,
right?)

Original comment by bgo...@e1b.org on 2 Apr 2009 at 5:15

GoogleCodeExporter commented 9 years ago
How about if we wait until after the next release then...I'll do a release this
weekend. We get JMesa lint free after that!

Yep, Rhino is under the name js-1.7R1.jar.

Original comment by jeff.johnston.mn@gmail.com on 2 Apr 2009 at 6:54

GoogleCodeExporter commented 9 years ago

Original comment by jeff.johnston.mn@gmail.com on 13 Apr 2010 at 7:11