[Pkg-javascript-commits] [node-detective] 92/119: let acorn handle shebangs
Bastien Roucariès
rouca at moszumanska.debian.org
Wed Sep 6 09:44:38 UTC 2017
This is an automated email from the git hooks/post-receive script.
rouca pushed a commit to branch master
in repository node-detective.
commit 64c80714f980f84f1efafcf62e6d1655ddf0fa58
Author: Andres Suarez <zertosh at gmail.com>
Date: Sat May 23 20:00:48 2015 -0400
let acorn handle shebangs
acorn can skip them itself https://github.com/marijnh/acorn/blob/1.0.0/src/state.js#L54 more elegantly
---
index.js | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/index.js b/index.js
index 73b4d1b..d7c1aa5 100644
--- a/index.js
+++ b/index.js
@@ -12,7 +12,8 @@ function parse (src, opts) {
allowReserved: defined(opts.allowReserved, true),
allowReturnOutsideFunction: defined(
opts.allowReturnOutsideFunction, true
- )
+ ),
+ allowHashBang: defined(opts.allowHashBang, true)
});
}
var escodegen = require('escodegen');
@@ -52,7 +53,6 @@ exports.find = function (src, opts) {
var word = opts.word === undefined ? 'require' : opts.word;
if (typeof src !== 'string') src = String(src);
- src = src.replace(/^#![^\n]*\n/, '');
var isRequire = opts.isRequire || function (node) {
var c = node.callee;
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/node-detective.git
More information about the Pkg-javascript-commits
mailing list