MCPcopy Create free account
hub / github.com/ampproject/amphtml / DependencyLib

Function DependencyLib

third_party/inputmask/inputmask.dependencyLib.js:35–48  ·  view source on GitHub ↗
(elem)

Source from the content-addressed store, hash-verified

33 return elem instanceof window.Element;
34 }
35 function DependencyLib(elem) {
36 if (elem instanceof DependencyLib) {
37 return elem;
38 }
39 if (!(this instanceof DependencyLib)) {
40 return new DependencyLib(elem);
41 }
42 if (elem !== undefined && elem !== null && elem !== window) {
43 this[0] = elem.nodeName ? elem : elem[0] !== undefined && elem[0].nodeName ? elem[0] : document.querySelector(elem);
44 if (this[0] !== undefined && this[0] !== null) {
45 this[0].eventRegistry = this[0].eventRegistry || {};
46 }
47 }
48 }
49 function getWindow(elem) {
50 return isWindow(elem) ? elem : elem.nodeType === 9 ? elem.defaultView || elem.parentWindow : false;
51 }

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected