mirror of
https://github.com/angular/angular-cli.git
synced 2025-05-16 18:43:42 +08:00
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`.
This commit is contained in:
parent
0e4e490448
commit
13fce451d8
@ -33,7 +33,7 @@ export function deepCopy<T>(value: T): T {
|
||||
for (const key of Object.getOwnPropertyNames(valueCasted)) {
|
||||
copy[key] = deepCopy(valueCasted[key]);
|
||||
}
|
||||
valueCasted[copySymbol] = undefined;
|
||||
delete valueCasted[copySymbol];
|
||||
|
||||
return copy;
|
||||
} else {
|
||||
|
Loading…
x
Reference in New Issue
Block a user