You could do this instead:
```js
locator.ready.then(function () {
  locator.listBundleNames().forEach(function (bundleName) {
    self.registerBundle(locator.getBundle(bundleName));
  });
}).then(function (res) {
  setTimeout(function () {
    callback(null, res);
  }, 0);
}, function (err) {
  setTimeout(function () {
    callback(err);
  }, 0);
});
```