Is it possible to get a list of reserved words(variables, functions, object names) in JS?
<p>There is a lot of great information <a href="http://stackoverflow.com/questions/26255/reserved-keywords-in-javascript">on this SO thread</a></p>

<p>I can grab the keywords from websites provided there, <strong>BUT</strong> I am asking is it possible to grab reserved keywords in real time ? Maybe there is some structure where they are stored?</p>

<p>For global objects in window, I can grab them with this:</p>

<pre><code>for(var i in window) doSomethingWith(i)
</code></pre>

<p>But I also need all the language specific keywords like: <strong>if, case, switch,</strong> etc.</p>

<p><strong>SORRY</strong> I didn't want to write "then". I was coding in <strong>Pascal</strong> in the last hour(remembering old times) and god damn it stuck into my head!</p>

<p><strong>What I want to do:</strong> It may sound strange, however I am building an app where you can create elements, they have names, values, formulas and formulas are pure JS formulas, except I run a regular expression to modify variables a bit and want to leave the javascript syntax.</p>

<p>For example if formula is: <code>if (a &lt; b) { c = d; }</code>
In this case I would like to modify only <strong>a, b, c</strong> and <strong>d</strong>.</p>

<p>If formula would be something like: <code>switch(a) { case 0: a=b; break; case 1: b=c; ... }</code>
In this case I would like to filter out "<strong>switch, break, case</strong>".</p>

<p>Well maybe I should delete this question</p>
