colhountech / js2-mode

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

js2-missing-semi-one-line-override does not work in a loop #127

Open GoogleCodeExporter opened 8 years ago

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

1. Set js2-missing-semi-one-line-override to t.

2. Opening a js file with content:

/* -*- mode:js2 -*- */
for(var i = 0; i < 5; i++) {
  function identity(x) {return x}
}
function identity2(x) {return x}

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

I expected to see no warnings but the first {return x} is underlined with a 
warning face while the second {return x} is not.

js2-mode 20090814 in GNU Emacs 24.0.50.1 on Windows 7.

The minimal example above may be contrived but I found the bug while trying the 
following code from a blog post:

function wrap(callback) {
  callback();
}
console.log('Simple wrap');
for(var i = 0; i < 5; i++) {
  wrap(function() {console.log(i)});
}

Original issue reported on code.google.com by jisang.y...@gmail.com on 24 Jan 2012 at 4:34

GoogleCodeExporter commented 8 years ago
Should be fixed in the latest version.

Original comment by raa...@gmail.com on 19 Feb 2013 at 2:48