Move JSAutoCompartment call up.

I'm hoping it will fix a crash.