MCPcopy
hub / github.com/amark/gun / callFnAsync

Function callFnAsync

test/mocha.js:4221–4235  ·  view source on GitHub ↗
(fn)

Source from the content-addressed store, hash-verified

4219 }
4220
4221 function callFnAsync(fn) {
4222 fn.call(ctx, function(err) {
4223 if (err instanceof Error || toString.call(err) === '[object Error]') {
4224 return done(err);
4225 }
4226 if (err) {
4227 if (Object.prototype.toString.call(err) === '[object Object]') {
4228 return done(new Error('done() invoked with non-Error: '
4229 + JSON.stringify(err)));
4230 }
4231 return done(new Error('done() invoked with non-Error: ' + err));
4232 }
4233 done();
4234 });
4235 }
4236};
4237
4238}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})

Callers 1

mocha.jsFile · 0.85

Calls 1

doneFunction · 0.70

Tested by

no test coverage detected