decord/source/1067_getNativeImplementation.js

73 lines
2.3 KiB
JavaScript
Raw Normal View History

2026-07-29 08:29:29 +00:00
// Module ID: 1067
// Function ID: 1068
// Name: getNativeImplementation
// Dependencies: [1039, 817, 1035]
// Module 1067 (getNativeImplementation)
const require = arg1;
const dependencyMap = arg6;
function getNativeImplementation(fetch) {
if (table[fetch]) {
return tmp6;
} else {
const tmp9 = require(1039) /* WINDOW */.WINDOW[fetch];
let obj = tmp9;
if (obj2.isNativeFunction(tmp9)) {
const bindResult = obj.bind(tmp7(1039).WINDOW);
tmp5[fetch] = bindResult;
return bindResult;
} else {
const _document = tmp7(1039).WINDOW.document;
if (_document) {
2026-08-04 21:03:28 +00:00
if (typeof _document.createElement === "function") {
2026-07-29 08:29:29 +00:00
try {
const element = <iframe />;
element.hidden = true;
const head = _document.head;
head.appendChild(element);
const contentWindow = element.contentWindow;
let tmp15;
if (contentWindow != null) {
tmp15 = contentWindow[fetch];
}
if (tmp15) {
obj = contentWindow[fetch];
}
const head2 = _document.head;
head2.removeChild(element);
} catch (tmp17) {
if (tmp3(tmp[2]).DEBUG_BUILD) {
const debug = tmp3(tmp[1]).debug;
const _HermesInternal = HermesInternal;
debug.warn("Could not create sandbox iframe for " + tmp2 + " check, bailing to window." + tmp2 + ": ", tmp17);
}
}
}
}
if (obj) {
const bindResult1 = obj.bind(tmp7(1039).WINDOW);
tmp5[fetch] = bindResult1;
let tmp24 = bindResult1;
} else {
tmp24 = obj;
}
return tmp24;
}
obj2 = require(817) /* registerSpanErrorInstrumentation */;
}
}
Object.defineProperty(arg5, Symbol.toStringTag, { value: "Module" });
let closure_2 = {};
arg5.clearCachedImplementation = function clearCachedImplementation(fetch) {
closure_2[fetch] = undefined;
};
arg5.fetch = function fetch() {
const items = [...arguments];
return getNativeImplementation("fetch")(...items);
};
arg5.getNativeImplementation = getNativeImplementation;
arg5.setTimeout = function setTimeout() {
const items = [...arguments];
return getNativeImplementation("setTimeout")(...items);
};