MCPcopy Create free account
hub / github.com/caseywebdev/react-list / describeNativeComponentFrame

Function describeNativeComponentFrame

docs/index.js:809–964  ·  view source on GitHub ↗
(fn, construct)

Source from the content-addressed store, hash-verified

807 return "\n" + prefix + name + suffix;
808 }
809 function describeNativeComponentFrame(fn, construct) {
810 if (!fn || reentry) return "";
811 var frame = componentFrameCache.get(fn);
812 if (void 0 !== frame) return frame;
813 reentry = !0;
814 frame = Error.prepareStackTrace;
815 Error.prepareStackTrace = void 0;
816 var previousDispatcher = null;
817 previousDispatcher = ReactSharedInternals.H;
818 ReactSharedInternals.H = null;
819 disableLogs();
820 try {
821 var RunInRootFrame = {
822 DetermineComponentFrameRoot: function () {
823 try {
824 if (construct) {
825 var Fake = function () {
826 throw Error();
827 };
828 Object.defineProperty(Fake.prototype, "props", {
829 set: function () {
830 throw Error();
831 }
832 });
833 if ("object" === typeof Reflect && Reflect.construct) {
834 try {
835 Reflect.construct(Fake, []);
836 } catch (x) {
837 var control = x;
838 }
839 Reflect.construct(fn, [], Fake);
840 } else {
841 try {
842 Fake.call();
843 } catch (x$0) {
844 control = x$0;
845 }
846 fn.call(Fake.prototype);
847 }
848 } else {
849 try {
850 throw Error();
851 } catch (x$1) {
852 control = x$1;
853 }
854 (Fake = fn()) &&
855 "function" === typeof Fake.catch &&
856 Fake.catch(function () {});
857 }
858 } catch (sample) {
859 if (sample && control && "string" === typeof sample.stack)
860 return [sample.stack, control.stack];
861 }
862 return [null, null];
863 }
864 };
865 RunInRootFrame.DetermineComponentFrameRoot.displayName =
866 "DetermineComponentFrameRoot";

Callers 2

describeFiberFunction · 0.85

Calls 3

disableLogsFunction · 0.85
reenableLogsFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…