def _all_files(self, root):
        '''
        helper for __init__: recurse over js root directory and collect all js files
        '''
        rv = []
        old = os.getcwd()
        os.chdir(root)

        for path, subdirs, files in os.walk('.'):
            for name in files:
                for pattern in self.js_patterns:
                    if fnmatch.fnmatch(name, pattern):
                        path = os.path.normpath(path)
                        if path == '.':
                            path=''
                        rv.append((path, name))
        os.chdir(old)
        return rv

        helper for __init__: recurse over js root directory and collect all js files
        
recipes/Python/498265_Server_side_JavaScript_dependency/recipe-498265.py