Skip to content

Commit

Permalink
Merge pull request #657 from djorg83/master
Browse files Browse the repository at this point in the history
log filename when file fails to parse using esprima
  • Loading branch information
gotwarlost authored Jun 29, 2016
2 parents 5dbd62c + 91bb666 commit fef889b
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions lib/instrumenter.js
Original file line number Diff line number Diff line change
Expand Up @@ -455,13 +455,18 @@
if (!this.opts.noAutoWrap) {
code = LEADER_WRAP + code + TRAILER_WRAP;
}
program = ESP.parse(code, {
loc: true,
range: true,
tokens: this.opts.preserveComments,
comment: true,
sourceType: this.opts.esModules ? 'module' : 'script'
});
try {
program = ESP.parse(code, {
loc: true,
range: true,
tokens: this.opts.preserveComments,
comment: true,
sourceType: this.opts.esModules ? 'module' : 'script'
});
} catch (e) {
console.log('Failed to parse file: ' + filename);
throw e;
}
if (this.opts.preserveComments) {
program = ESPGEN.attachComments(program, program.comments, program.tokens);
}
Expand Down

0 comments on commit fef889b

Please sign in to comment.