Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
GoogleCodeExporter opened this issue Apr 2, 2015 · 1 comment
Open

Comments

@GoogleCodeExporter
Copy link

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 [email protected] on 24 Jan 2012 at 4:34

@GoogleCodeExporter
Copy link
Author

Should be fixed in the latest version.

Original comment by [email protected] on 19 Feb 2013 at 2:48

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant