Make saveArgumentsByValue clone Date objects correctly

* Fixes #1885
This commit is contained in:
Dan Cortel
2022-01-26 18:32:05 +02:00
parent 9ab039e330
commit 83e9f88952
2 changed files with 28 additions and 0 deletions

View File

@@ -64,6 +64,8 @@ getJasmineRequireObj().util = function(j$) {
// All falsey values are either primitives, `null`, or `undefined.
if (!argsAsArray[i] || str.match(primitives)) {
clonedArgs.push(argsAsArray[i]);
} else if (str === '[object Date]') {
clonedArgs.push(new Date(argsAsArray[i].valueOf()));
} else {
clonedArgs.push(j$.util.clone(argsAsArray[i]));
}