title: Javascript syntax test cases
body: <p>I'm creating a text editor and I've just finished writing the highlighting algorithms to have each of the syntax appear in a different color, and render in the right position using the proper parse trees.</p>
  
  <p>I was wondering if anyone could provide me with, or the location of a test or series of test cases to make sure nothing will break. The test case(s) should cover all of JavaScript syntax as it is used on the web including edge cases (i.e., including syntax like <code>throw</code> although it is rarely used), DOM creation and manipulation etc.</p>
  
  <p>I have added the following static test case. It <em>should</em> cover all the syntax.</p>
  
  <p>There are a few things to note: since the code is being parse recursively on a grammar level, only basic cases are required. For example, to the editor:</p>
  
  <p>a[1]; and a[1][2][3][4][5]; would be the <em>same</em> syntax. Since the second line, is just recursively more subs then the the first line.</p>
  
  <p>The test case I have created has been moved to an answer below.</p>