[core][js] test if variable <exports> exists