diff --git a/acorn/src/location.js b/acorn/src/location.js index a7a2d6cf..ef526550 100644 --- a/acorn/src/location.js +++ b/acorn/src/location.js @@ -12,6 +12,9 @@ const pp = Parser.prototype pp.raise = function(pos, message) { let loc = getLineInfo(this.input, pos) message += " (" + loc.line + ":" + loc.column + ")" + if (this.sourceFile) { + message += " in " + this.sourceFile + } let err = new SyntaxError(message) err.pos = pos; err.loc = loc; err.raisedAt = this.pos throw err