MCPcopy Create free account
hub / github.com/gaearon/react-hot-loader / copyMethodDescriptors

Function copyMethodDescriptors

src/proxy/createClassProxy.js:76–94  ·  view source on GitHub ↗
(target, source)

Source from the content-addressed store, hash-verified

74 });
75
76const copyMethodDescriptors = (target, source) => {
77 if (source) {
78 // it is possible to use `function-double` to construct an ideal clone, but does not make a sence
79 const keys = Object.getOwnPropertyNames(source);
80
81 keys.forEach(key => safeDefineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)));
82
83 safeDefineProperty(target, 'toString', {
84 configurable: true,
85 writable: false,
86 enumerable: false,
87 value: function toString() {
88 return String(source);
89 },
90 });
91 }
92
93 return target;
94};
95
96const knownClassComponents = [];
97

Callers 2

lifeCycleWrapperFactoryFunction · 0.85
methodWrapperFactoryFunction · 0.85

Calls 1

safeDefinePropertyFunction · 0.90

Tested by

no test coverage detected