[Pkg-javascript-commits] [node-lexical-scope] 03/83: first pass at globals, doesn't add member expressions anymore

Bastien Roucariès rouca at moszumanska.debian.org
Fri Dec 15 09:45:45 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 5983475cf8a83b1094e6476fcea411953f72f3b6
Author: James Halliday <mail at substack.net>
Date:   Sun Feb 17 14:18:41 2013 +1000

    first pass at globals, doesn't add member expressions anymore
---
 index.js | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/index.js b/index.js
index a574e31..8998250 100644
--- a/index.js
+++ b/index.js
@@ -18,6 +18,16 @@ module.exports = function (src) {
         }
     });
     
+    falafel(String(src), function (node) {
+        if (node.type === 'Identifier'
+        && lookup(node) === undefined) {
+            if (node.parent.type === 'MemberExpression'
+            && node.parent.property === node) return;
+            
+            globals[node.name] = true;
+        }
+    });
+    
     return { locals: locals, globals: globals };
     
     function lookup (node) {

-- 
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