예제 #1
0
    def _analyzeClassDepsNode(self, node, depsList, inLoadContext, inDefer=False):
        # helper functions
        not_jsignored = inverse(gs.test_ident_is_jsignored)
        browser_sans_this = [x for x in lang.GLOBALS if x!='this']
        not_builtin = inverse(gs.test_ident_is_builtin(browser_sans_this))
        not_jsignore_envcall = inverse(lambda d: gs.name_is_jsignored(
            d.name+('.'+d.attribute if d.attribute else ''), d.node))
        # ensure a complete hint tree for ignore checking
        root_node = node.getRoot()
        if not hasattr(root_node, 'hint'):
            root_node = jshints.create_hints_tree(root_node)

        code_deps = pipeline(
            self.dependencies_from_ast(node)
            , bind(filter, not_jsignored)
            , bind(filter, not_builtin)
            , bind(map, self.depsItem_from_node)
        )
        envcall_deps = pipeline(
            self.dependencies_from_envcalls(node)
            , bind(filter, not_jsignore_envcall)
        )
        dependencies = code_deps + envcall_deps

        [setattr(x,'node',None) for x in dependencies]  # remove AST links (for easier caching)
        depsList.extend(dependencies)
예제 #2
0
    def _analyzeClassDepsNode(self, node, depsList, inLoadContext, inDefer=False):
        # helper functions
        not_jsignored = inverse(gs.test_ident_is_jsignored)
        browser_sans_this = [x for x in lang.GLOBALS if x!='this']
        not_builtin = inverse(gs.test_ident_is_builtin(browser_sans_this))
        not_jsignore_envcall = inverse(lambda d: gs.name_is_jsignored(
            d.name+('.'+d.attribute if d.attribute else ''), d.node))
        # ensure a complete hint tree for ignore checking
        root_node = node.getRoot()
        if not hasattr(root_node, 'hint'):
            root_node = jshints.create_hints_tree(root_node)

        code_deps = pipeline(
            self.dependencies_from_ast(node)
            , bind(filter, not_jsignored)
            , bind(filter, not_builtin)
            , bind(map, self.depsItem_from_node)
        )
        envcall_deps = pipeline(
            self.dependencies_from_envcalls(node)
            , bind(filter, not_jsignore_envcall)
        )
        dependencies = code_deps + envcall_deps
        
        [setattr(x,'node',None) for x in dependencies]  # remove AST links (for easier caching)
        depsList.extend(dependencies)
예제 #3
0
 def filter_jshints(self, global_nodes):
     new_nodes = {}
     for key, nodes in global_nodes.items():
         new_nodes[key] = [
             node for node in nodes if not gs.name_is_jsignored(key, node)
         ]
     return new_nodes
예제 #4
0
파일: lint.py 프로젝트: choubayu/qooxdoo
 def filter_jshints(self, global_nodes):
     new_nodes = {}
     for key, nodes in global_nodes.items():
         new_nodes[key] = [node for node in nodes
             if not gs.name_is_jsignored(key,node)]
     return new_nodes