Update TaskScheduler.js

removing error through since Promise does not handle it - instead resolver is used.