MCPcopy Create free account
hub / github.com/devote/HTML5-History-API / maybeBindToGlobal

Function maybeBindToGlobal

history.js:508–516  ·  view source on GitHub ↗

* This method attempts to bind a function to global. * * @param {Function} [func] The function to be bound * @return {Function} Returns the bound function or func

(func)

Source from the content-addressed store, hash-verified

506 * @return {Function} Returns the bound function or func
507 */
508 function maybeBindToGlobal(func) {
509 if (func && global &&
510 global['EventTarget'] &&
511 typeof global['EventTarget'].prototype.addEventListener === 'function' &&
512 typeof func.bind === 'function') {
513 return func.bind(global);
514 }
515 return func;
516 }
517
518 /**
519 * Initializing storage for the custom state's object

Callers 1

history.jsFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected