Bug 828472 - Introduce AutoJSContext and SafeAutoJSContext helpers and use them for date handling in nsHTMLInputElement. f=bz r=bholley