Presumably putting this into a shared compat file means others might want to use it. Can we add some documentation (even just one sentence as a description) about what this does? It's a public function and not immediately obvious unless I track down where it is used below.