yoya / js2-mode

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

A block is a statement terminator, the parser does not recognize that #77

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1.

function a ()
{
  a = function () {
  }
}

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

js2-mode fails to recognize that the assignment statement is properly
terminated by the block and marks the line with the closing brace to
indicate that there is a semicolon missing.

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

js2-20080521.el on Emacs 22.1.1 (i386-pc-freebsd)

Original issue reported on code.google.com by hans.hue...@gmail.com on 4 Jun 2008 at 7:27

GoogleCodeExporter commented 8 years ago
The assignment statement is not properly terminated. Javascript (the language,
ECMAScript) does semicolon insertion which is why that code doesn't fail in an
interpreter. 

http://www.mozilla.org/js/language/js20-2000-07/rationale/syntax.html
http://javascript.crockford.com/code.html

The orange under the closing bracket of the above assignment statement is a 
warning.

This ticket should be closed as invalid.

Original comment by waw...@gmail.com on 4 Oct 2008 at 9:57

GoogleCodeExporter commented 8 years ago
This is not a bug, as waw325 observes.

You can disable warnings for missing trailing semicolons by customizing the 
variable
`js2-strict-missing-semi-warning`.

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