[core][js] don’t use const for modules as objects: const don’t allow to be “redefined” even in a condition which wouldn’t allow redefinition