Making sure invalid JS throws proper exception