Build distribution
This commit is contained in:
@@ -1988,8 +1988,8 @@ getJasmineRequireObj().matchersUtil = function(j$) {
|
|||||||
// Objects with different constructors are not equivalent, but `Object`s
|
// Objects with different constructors are not equivalent, but `Object`s
|
||||||
// or `Array`s from different frames are.
|
// or `Array`s from different frames are.
|
||||||
var aCtor = a.constructor, bCtor = b.constructor;
|
var aCtor = a.constructor, bCtor = b.constructor;
|
||||||
if (aCtor !== bCtor && !(isFunction(aCtor) && aCtor instanceof aCtor &&
|
if (aCtor !== bCtor && !(isObjectConstructor(aCtor) &&
|
||||||
isFunction(bCtor) && bCtor instanceof bCtor)) {
|
isObjectConstructor(bCtor))) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -2041,14 +2041,22 @@ getJasmineRequireObj().matchersUtil = function(j$) {
|
|||||||
|
|
||||||
return extraKeys;
|
return extraKeys;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
function has(obj, key) {
|
function has(obj, key) {
|
||||||
return Object.prototype.hasOwnProperty.call(obj, key);
|
return Object.prototype.hasOwnProperty.call(obj, key);
|
||||||
}
|
}
|
||||||
|
|
||||||
function isFunction(obj) {
|
function isFunction(obj) {
|
||||||
return typeof obj === 'function';
|
return typeof obj === 'function';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function isObjectConstructor(ctor) {
|
||||||
|
// aCtor instanceof aCtor is true for the Object and Function
|
||||||
|
// constructors (since a constructor is-a Function and a function is-a
|
||||||
|
// Object). We don't just compare ctor === Object because the constructor
|
||||||
|
// might come from a different frame with different globals.
|
||||||
|
return isFunction(ctor) && ctor instanceof ctor;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user