MCPcopy Index your code
hub / github.com/angular/angular / isPropertyPatched

Function isPropertyPatched

packages/zone.js/test/browser/browser.spec.ts:421–441  ·  view source on GitHub ↗
(obj: any, prop: string, prototype?: any)

Source from the content-addressed store, hash-verified

419
420 it('should patch all possible on properties on native prototype', function () {
421 function isPropertyPatched(obj: any, prop: string, prototype?: any) {
422 let desc = Object.getOwnPropertyDescriptor(obj, prop);
423 if (!desc && prototype) {
424 // when patch window object, use prototype to check prop exist or not
425 const prototypeDesc = Object.getOwnPropertyDescriptor(prototype, prop);
426 if (prototypeDesc) {
427 desc = {enumerable: true, configurable: true};
428 }
429 }
430 // if the descriptor not exists or is not configurable
431 // just return
432 if (!desc || !desc.configurable) {
433 return true;
434 }
435
436 const onPropPatchedSymbol = zoneSymbol('on' + prop + 'patched');
437 if (obj.hasOwnProperty(onPropPatchedSymbol) && obj[onPropPatchedSymbol]) {
438 return true;
439 }
440 return false;
441 }
442
443 function isPropertiesPatched(obj: any, properties: string[] | null, prototype?: any) {
444 if (properties) {

Callers 1

isPropertiesPatchedFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…