MCPcopy Index your code
hub / github.com/NativeScript/capacitor / getProxy

Method getProxy

testing/browser.ts:364–394  ·  view source on GitHub ↗
(parent: any, prop: any, proxyClass: any)

Source from the content-addressed store, hash-verified

362 }
363
364 getProxy(parent: any, prop: any, proxyClass: any) {
365 if (parent && prop && parent[NS_PROXY_CHILDREN][prop]) {
366 return parent[NS_PROXY_CHILDREN][prop][NS_PROXY];
367 }
368
369 // eslint-disable-next-line @typescript-eslint/no-empty-function
370 const func = function () {};
371
372 (<any>func)[NS_PROXY_ID] = this.getNextId();
373 (<any>func)[NS_PROXY_PROP] = prop;
374 (<any>func)[NS_PROXY_CHILDREN] = {};
375 (<any>func)[NS_PROXY_IS_FUNCTION] = parent == null;
376 (<any>func)[NS_PROXY_HAS_WAITING_VALUE] = false;
377
378 //nativeLog("Prop", prop, parent == null ? "Null" : "Has Parent", func[NS_PROXY_IS_FUNCTION] ? "Func" : "Good");
379
380 if (parent) {
381 (<any>func)[NS_PROXY_PARENT] = parent;
382 (<any>func)[NS_PROXY_FULL_PROP] =
383 parent[NS_PROXY_FULL_PROP] + '.' + prop;
384 parent[NS_PROXY_CHILDREN][prop] = func;
385 } else {
386 (<any>func)[NS_PROXY_FULL_PROP] = prop;
387 }
388
389 // Create Proxy Object
390 const newProxy = new Proxy(func, proxyClass);
391 (<any>func)[NS_PROXY] = newProxy;
392
393 return newProxy;
394 }
395
396 // eslint-disable-next-line @typescript-eslint/no-unused-vars
397 _getter(target: any, prop: any, _receiver: any) {

Callers 4

constructorMethod · 0.95
marshallStringMethod · 0.95
_getterMethod · 0.80
_setterMethod · 0.80

Calls 1

getNextIdMethod · 0.95

Tested by

no test coverage detected