// promise based completion function.
if (isPromise(result)) {
.then(list => {
this.shim.process.nextTick(() => {
done(null, list);
});
.catch(err => {
this.shim.process.nextTick(() => {
done(err, undefined);
});
}
// synchronous completion function.
return done(null, result);