-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Description
It appears that when coffee-script compile the file correctly, but results in a javascript file that has a ReferenceError (I.E. it fails inside the require(module)), the resulting sourcemap will not properly map the location of the error, and results in a stack trace frame with 0:0.
Test case:
badJsSyntax.coffee
exports.innerErr = () ->
throw new Error("Inside Inner Err");
exports.outerErr = () ->
exports.innerErr()
zzz
exports.nestedErr = () ->
anotherErr.throwErr()testCase:
it("should show proper coffee stack when we have syntax error in JS but not coffeescript", function() {
try {
require("./badJsSyntax")
} catch (err) {
var lines = err.stack.split("\n")
expect(err.message).to.match(/zzz is not defined/)
expect(lines[1]).to.match(/badJsSyntax.coffee:5:1\)$/)
expect(lines[1]).to.match(/badJsSyntax.coffee:16:4\)$/)
}
});Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels