Fix lint warning in CallTracker.

The previous code was using `== null` to handle both `null` and
`undefined`, resulting in a jshint warning. The conditional is meant to
check for non-primitive values, and it happens to be the case that a
falsey value in JS is always a primitive, or `null` or `undefined`.
This commit is contained in:
Zaven Muradyan
2017-10-15 12:27:45 -07:00
parent f6342ad4fe
commit 20d86b2a00

View File

@@ -14,7 +14,8 @@ getJasmineRequireObj().CallTracker = function(j$) {
var str = Object.prototype.toString.apply(argsAsArray[i]),
primitives = /^\[object (Boolean|String|RegExp|Number)/;
if (argsAsArray[i] == null || str.match(primitives)) {
// All falsey values are either primitives, `null`, or `undefined.
if (!argsAsArray[i] || str.match(primitives)) {
clonedArgs.push(argsAsArray[i]);
} else {
clonedArgs.push(j$.util.clone(argsAsArray[i]));