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

Function copySymbolProperties

packages/zone.js/lib/common/utils.ts:394–416  ·  view source on GitHub ↗
(src: any, dest: any)

Source from the content-addressed store, hash-verified

392}
393
394export function copySymbolProperties(src: any, dest: any) {
395 if (typeof (Object as any).getOwnPropertySymbols !== 'function') {
396 return;
397 }
398 const symbols: any = (Object as any).getOwnPropertySymbols(src);
399 symbols.forEach((symbol: any) => {
400 const desc = Object.getOwnPropertyDescriptor(src, symbol);
401 Object.defineProperty(dest, symbol, {
402 get: function () {
403 return src[symbol];
404 },
405 set: function (value: any) {
406 if (desc && (!desc.writable || typeof desc.set !== 'function')) {
407 // if src[symbol] is not writable or not have a setter, just return
408 return;
409 }
410 src[symbol] = value;
411 },
412 enumerable: desc ? desc.enumerable : true,
413 configurable: desc ? desc.configurable : true,
414 });
415 });
416}
417
418let shouldCopySymbolProperties = false;
419

Callers 1

patchMethodFunction · 0.85

Calls 1

forEachMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…