get global and function scope in javascript using mozilla parse AST