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

Incorrect column in parse error #173

Closed
btmills opened this issue Jul 22, 2015 · 2 comments
Closed

Incorrect column in parse error #173

btmills opened this issue Jul 22, 2015 · 2 comments

Comments

@btmills
Copy link
Member

btmills commented Jul 22, 2015

Originally discovered by @feross in eslint/eslint#3128:

// test.js
try {
    require("espree").parse("function fn(a, a) {\n}", { ecmaFeatures: { modules: true } });
} catch (err) {
    console.error(require("util").inspect(err));
}
$ node test.js
{ [Error: Line 1: Strict mode function may not have duplicate parameter names]
  index: 15,
  lineNumber: 1,
  column: -4,
  description: 'Strict mode function may not have duplicate parameter names' }

Notice that the column number is -4, when it should be 16 (if I counted correctly). The \n is required, or the column will be correct.

@nzakas
Copy link
Member

nzakas commented Jul 22, 2015

Yeah, that's weird.

@nzakas
Copy link
Member

nzakas commented Jul 22, 2015

Working on this

@nzakas nzakas closed this as completed in 38576c5 Jul 22, 2015
nzakas added a commit that referenced this issue Jul 22, 2015
Fix: Incorrect error location (fixes #173)
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

2 participants