pombreda / js2-mode

Automatically exported from code.google.com/p/js2-mode
0 stars 0 forks source link

handling prototypejs #85

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. open a prototypejs file

What is the expected output? What do you see instead?

What version of the product are you using? On what operating system?

Mac OS X leopard, GNU Emacs 23.0.60.1 (i386-apple-darwin9.4.0, *Step 9.0)
of 2008-07-18 

Please provide any additional information below.

 js2-mode attempts to correct good code. It keeps telling me I need ';'
when there isn't one needed.

Here is an example:
$A(idsToExpand).each(function(id) {Element.setClassName(id, 'collapsed',
!value)});

it underlines this part: "Element.setClassName(id, 'collapsed', !value)"
and says : "missing ; after statement"

Original issue reported on code.google.com by mixan...@gmail.com on 22 Jul 2008 at 12:07

GoogleCodeExporter commented 9 years ago
There should be a semicolon after the close paren on the inner function as well 
as
the one at the end of the whole statement, as below. I think js2-mode is 
handling
this correctly.

$A(idsToExpand).each(function(id) {Element.setClassName(id, 'collapsed', 
!value);});

Original comment by dereksla...@gmail.com on 23 Jul 2008 at 7:43

GoogleCodeExporter commented 9 years ago
I believe it's giving you a warning underline, not an error underline. The 
semicolon
should be there, but doesn't have to be.

The mode it just trying to take away some of the rope that ECMA handed you.

Original comment by waw...@gmail.com on 5 Oct 2008 at 1:49

GoogleCodeExporter commented 9 years ago
Strictly speaking, the warning is correct.

Personally I find it annoying enough that I added a customization setting,
`js2-missing-semi-one-line-override`, that squelches the warning for 1-line 
functions
that are missing a final semi inside the close-curly.  If you set that variable 
to
`t` the warning will go away.

Original comment by steve.ye...@gmail.com on 23 Jul 2009 at 11:21