ViewsFormBase::getForm() stashes the current JS, allows all multistep forms to run, and then restores the JS.
This should be removed once #1839338: [meta] Remove drupal_set_*() drupal_add_*() in favour of #attached/response for out-of-band stuff is all but finished.