title: How to parse a Javascript file and get all the used variables?
body: <p>I am gathering a lot of Javascript code from untrusted people and have to integrate it in my project. As is is untrusted, I would like to check if it doesn't do something nasty.</p>
  
  <p>My main concern is the variables the code uses. 
  To check it is OK, I would like to parse all the code and verify the name of the variables. For instance, that all the variables are included in <code>window.sandboxedVariables</code>. </p>
  
  <p>Is it possible to parse a Javascript code (in any language but preferably Javascript or bash) and get the list of all the variables ? Is it possible to do the same with the imported libraries ?</p>
  
  <p>Is it possible to do with Uglify ? I read a bit the API documentation and found nothing specific.</p>
  
  <p>Thank you very much !</p>