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:
@@ -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]));
|
||||
|
||||
Reference in New Issue
Block a user