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

Compiler errors do not include line/column information #304

Open
xonev opened this issue Mar 21, 2014 · 2 comments
Open

Compiler errors do not include line/column information #304

xonev opened this issue Mar 21, 2014 · 2 comments
Labels

Comments

@xonev
Copy link

xonev commented Mar 21, 2014

Errors thrown in compiler.coffee do not include line or column information.

For example, if you try to compile a file that contains this:

fn = ->
  return i for i in [1..3]

You will get this output, which contains no information about where the error was generated:

$ node_modules/.bin/coffee --compile < test-compile-error.coffee

/Users/xonev/workspace/project/node_modules/coffee-script-redux/lib/compiler.js:154
    throw new Error('expr: Cannot use a ' + s.type + ' as a value');
          ^
Error: expr: Cannot use a ReturnStatement as a value
    at expr (/Users/xonev/workspace/project/node_modules/coffee-script-redux/lib/compiler.js:154:11)
    at expr (/Users/xonev/workspace/project/node_modules/coffee-script-redux/lib/compiler.js:136:52)
    at makeReturn (/Users/xonev/workspace/project/node_modules/coffee-script-redux/lib/compiler.js:183:35)
    at class$.exports.Compiler.expression (/Users/xonev/workspace/project/node_modules/coffee-script-redux/lib/compiler.js:1141:20)
    at class$.<anonymous> (/Users/xonev/workspace/project/node_modules/coffee-script-redux/lib/compiler.js:2377:86)
    at class$.exports.Compiler.Compiler.compile.walk (/Users/xonev/workspace/project/node_modules/coffee-script-redux/lib/compiler.js:2289:19)
    at class$.exports.Compiler.Compiler.compile.walk (/Users/xonev/workspace/project/node_modules/coffee-script-redux/lib/compiler.js:2280:68)
    at class$.exports.Compiler.Compiler.compile.walk (/Users/xonev/workspace/project/node_modules/coffee-script-redux/lib/compiler.js:2280:68)
    at Compiler.i [as compile] (/Users/xonev/workspace/project/node_modules/coffee-script-redux/lib/compiler.js:2376:20)
    at Function.exports.Compiler.cache$2 [as compile] (/Users/xonev/workspace/project/node_modules/coffee-script-redux/lib/compiler.js:655:44)

Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

@hmaurer
Copy link

hmaurer commented Apr 8, 2014

#248

@michaelficarra
Copy link
Owner

Since this example is better isolated, I'm going to close the earlier issue as a duplicate of this one.

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

No branches or pull requests

3 participants