bv-ui-core 2.9.9 → 2.9.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -11,7 +11,6 @@ var waitForBody = require('../waitForBody');
|
|
|
11
11
|
var constructors = {};
|
|
12
12
|
// eslint-disable-next-line no-useless-escape
|
|
13
13
|
var constructorNameRegExp = /function\s+([^\(\s]+)/;
|
|
14
|
-
var iframe;
|
|
15
14
|
|
|
16
15
|
var getOriginalConstructor = function getOriginalConstructor (constructor) {
|
|
17
16
|
return new Promise(function (resolve) {
|
|
@@ -24,25 +23,30 @@ var getOriginalConstructor = function getOriginalConstructor (constructor) {
|
|
|
24
23
|
constructorName = constructorNameRegExp.exec(constructor.toString())[1];
|
|
25
24
|
}
|
|
26
25
|
|
|
27
|
-
if (
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
iframe.style.display = 'none';
|
|
31
|
-
iframe.height = '0';
|
|
32
|
-
iframe.width = '0';
|
|
33
|
-
iframe.tabIndex = '-1';
|
|
34
|
-
iframe.title = 'empty';
|
|
35
|
-
iframe.className = 'hidden';
|
|
36
|
-
document.body.appendChild(iframe);
|
|
26
|
+
if (constructors[constructorName]) {
|
|
27
|
+
resolve(constructors[constructorName]);
|
|
28
|
+
return;
|
|
37
29
|
}
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
30
|
+
const tempIframe = document.createElement('iframe');
|
|
31
|
+
tempIframe.src = 'about:blank';
|
|
32
|
+
tempIframe.style.display = 'none';
|
|
33
|
+
tempIframe.style.position = 'absolute';
|
|
34
|
+
tempIframe.style.left = '-9999px';
|
|
35
|
+
tempIframe.height = '0';
|
|
36
|
+
tempIframe.width = '0';
|
|
37
|
+
tempIframe.tabIndex = '-1';
|
|
38
|
+
tempIframe.title = '';
|
|
39
|
+
tempIframe.setAttribute('aria-hidden', 'true');
|
|
40
|
+
tempIframe.setAttribute('role', 'presentation');
|
|
41
|
+
|
|
42
|
+
document.body.appendChild(tempIframe);
|
|
43
|
+
|
|
44
|
+
constructors[constructorName] = tempIframe.contentWindow[constructorName];
|
|
45
|
+
document.body.removeChild(tempIframe);
|
|
46
|
+
|
|
43
47
|
resolve(constructors[constructorName]);
|
|
44
48
|
});
|
|
45
49
|
});
|
|
46
50
|
};
|
|
47
51
|
|
|
48
|
-
module.exports = getOriginalConstructor;
|
|
52
|
+
module.exports = getOriginalConstructor;
|