MCPcopy
hub / github.com/mysqljs/mysql / wrapCallbackInDomain

Function wrapCallbackInDomain

lib/Connection.js:499–517  ·  view source on GitHub ↗
(ee, fn)

Source from the content-addressed store, hash-verified

497}
498
499function wrapCallbackInDomain(ee, fn) {
500 if (typeof fn !== 'function') {
501 return undefined;
502 }
503
504 if (fn.domain) {
505 return fn;
506 }
507
508 var domain = process.domain;
509
510 if (domain) {
511 return domain.bind(fn);
512 } else if (ee) {
513 return unwrapFromDomain(wrapToDomain(ee, fn));
514 } else {
515 return fn;
516 }
517}
518
519function wrapToDomain(ee, fn) {
520 return function () {

Callers 1

Connection.jsFile · 0.85

Calls 2

unwrapFromDomainFunction · 0.85
wrapToDomainFunction · 0.85

Tested by

no test coverage detected