Move functions in to a higher scope

- Prevents them from accessing eq's local vars, which could cause bugs.
This commit is contained in:
Ben Christel
2016-07-19 15:02:08 -07:00
parent a0bce8031e
commit d9ded15c45

View File

@@ -231,21 +231,21 @@ getJasmineRequireObj().matchersUtil = function(j$) {
return extraKeys;
}
}
function has(obj, key) {
return Object.prototype.hasOwnProperty.call(obj, key);
}
function has(obj, key) {
return Object.prototype.hasOwnProperty.call(obj, key);
}
function isFunction(obj) {
return typeof obj === 'function';
}
function isFunction(obj) {
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;
}
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;
}
};