[Pkg-javascript-commits] [node-lexical-scope] 20/83: shebang test passes

Bastien Roucariès rouca at moszumanska.debian.org
Fri Dec 15 09:45:47 UTC 2017


This is an automated email from the git hooks/post-receive script.

rouca pushed a commit to branch master
in repository node-lexical-scope.

commit f33154abd6eaadea181c42d289d8cb8c996234c4
Author: James Halliday <mail at substack.net>
Date:   Sun Feb 24 16:34:12 2013 -0800

    shebang test passes
---
 index.js | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/index.js b/index.js
index 1237ede..7724809 100644
--- a/index.js
+++ b/index.js
@@ -5,7 +5,9 @@ module.exports = function (src) {
     var implicit = {};
     var exported = {};
     
-    falafel(String(src), function (node) {
+    src = String(src).replace(/^#![^\n]*\n/, '');
+    
+    falafel(src, function (node) {
         if (node.type === 'VariableDeclaration') {
             // take off the leading `var `
             var id = getScope(node);
@@ -20,7 +22,7 @@ module.exports = function (src) {
         }
     });
     
-    falafel(String(src), function (node) {
+    falafel(src, function (node) {
         if (node.type === 'Identifier'
         && lookup(node) === undefined) {
             if (node.parent.type === 'MemberExpression'

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/node-lexical-scope.git



More information about the Pkg-javascript-commits mailing list