Skip to content

Commit 13fce45

Browse files
clydindgp1130
authored andcommitted
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`.
1 parent 0e4e490 commit 13fce45

File tree

1 file changed

+1
-1
lines changed
  • packages/angular_devkit/core/src/utils

1 file changed

+1
-1
lines changed

packages/angular_devkit/core/src/utils/object.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ export function deepCopy<T>(value: T): T {
3333
for (const key of Object.getOwnPropertyNames(valueCasted)) {
3434
copy[key] = deepCopy(valueCasted[key]);
3535
}
36-
valueCasted[copySymbol] = undefined;
36+
delete valueCasted[copySymbol];
3737

3838
return copy;
3939
} else {

0 commit comments

Comments
 (0)