Skip to content

Commit

Permalink
added support for shebang starting files for esprima-bin-wrapper
Browse files Browse the repository at this point in the history
  • Loading branch information
dorellang committed Oct 27, 2018
1 parent 33e5e00 commit 59fdaa5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion esprima-bin-wrapper/dist/esprima-bin-wrapper.node.js

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions esprima-bin-wrapper/esprima-bin-wrapper.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ class FileProcessor {
processSourceCode(filePath, sourceCode){
let ast;
try {
sourceCode = sourceCode.replace(
/(^#!.*)/, m => Array(m.length + 1).join(' ')
);
ast = this.parseFn(sourceCode);
} catch (e) {
return {
Expand Down

0 comments on commit 59fdaa5

Please sign in to comment.