It feels like this code shouldn't be in assets.js. It's not for the assets page, it is for import.

It's even more important because in the requireJS branch, this JavaScript has moved back to the assets_index.html file.