From 13fce451d8c24365d5b62c52178ceb96c70e7535 Mon Sep 17 00:00:00 2001 From: Charles Lyding <19598772+clydin@users.noreply.github.com> Date: Wed, 4 May 2022 11:48:11 -0400 Subject: [PATCH] refactor(@angular-devkit/core): delete `deepCopy` temporary symbol property after use The `deepCopy` utility function previously set its internal tracking symbol property to `undefined` after completion. However, this still caused the property to exist with a value of `undefined`. Jasmine 4.1 now checks for symbols with its `toEqual` expectation which resulted in failing tests. The internal tracking symbol property is now removed instead via `delete`. --- packages/angular_devkit/core/src/utils/object.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/angular_devkit/core/src/utils/object.ts b/packages/angular_devkit/core/src/utils/object.ts index 0895ac4130..5ad7de7dbd 100644 --- a/packages/angular_devkit/core/src/utils/object.ts +++ b/packages/angular_devkit/core/src/utils/object.ts @@ -33,7 +33,7 @@ export function deepCopy(value: T): T { for (const key of Object.getOwnPropertyNames(valueCasted)) { copy[key] = deepCopy(valueCasted[key]); } - valueCasted[copySymbol] = undefined; + delete valueCasted[copySymbol]; return copy; } else {