scoped_c_thread_locale::c_locale() contains the line
*clocale = newlocale(LC_ALL, "C", nullptr);
This fails use with Emscripten (v1.39.8) as null is returned when category_mask is LC_ALL.
newlocal man page compared with _create_locale(LC_ALL, a few lines above and _create_locale docs suggest that LC_ALL_MASK is the proper category_mask argument:
*clocale = newlocale(LC_ALL_MASK, "C", nullptr);
History shows this call, once added (Steve Gates 8/28/2014), was always this way.