title: Date variable works, but functions on it do not
body: <p>I'm using TypeScript 1.4 in an ASP.NET MVC 5 project.</p>
  
  <p>I have a field of type Date, and it works partially:</p>
  
  <pre><code>var dob: Date = result.dateOfBirth;
  alert(dob);
  var dobAsString = dob.toDateString();
  </code></pre>
  
  <p>In the code above, the first two lines work, showing the value as "1968-11-16T00:00:00", as expected. But the last line doesn't work, in fact the rest of the code below that line isn't even executed -- it just breaks, without error message.</p>
  
  <p>This behavior persists no matter which Date function I apply in the last line; I could also use <code>dob.getFullYear()</code> etc. and it would fail every time. Yet the variable is of the right type and has the right value. The compiler also finds the Date functions, it compiles without a hitch but at runtime it fails. Any ideas?</p>