MCPcopy Create free account
hub / github.com/NativeScript/SimDeck / applyToPrototype

Function applyToPrototype

packages/nativescript-inspector/src/index.ts:153–166  ·  view source on GitHub ↗
(prototype: any)

Source from the content-addressed store, hash-verified

151 };
152
153 const applyToPrototype = (prototype: any): void => {
154 if (!prototype) return;
155 safeCall(() => {
156 for (const name of Object.keys(shimMethods)) {
157 if (typeof prototype[name] !== "function") {
158 Object.defineProperty(prototype, name, {
159 configurable: true,
160 writable: true,
161 value: shimMethods[name],
162 });
163 }
164 }
165 }, undefined);
166 };
167
168 // Walk every common ancestor a NativeScript view-like node can inherit
169 // from. `ViewBase` covers the full tree — including ActionBar-side

Callers 1

Calls 1

safeCallFunction · 0.85

Tested by

no test coverage detected