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