Implement spies for get/set functions on accessor properties
This commit is contained in:
committed by
Joe Cellucci
parent
8624a52ee0
commit
56191cfb2e
@@ -55,5 +55,17 @@ getJasmineRequireObj().util = function() {
|
||||
return cloned;
|
||||
};
|
||||
|
||||
util.getPropertyDescriptor = function(obj, methodName) {
|
||||
var descriptor,
|
||||
proto = obj;
|
||||
|
||||
do {
|
||||
descriptor = Object.getOwnPropertyDescriptor(proto, methodName);
|
||||
proto = Object.getPrototypeOf(proto);
|
||||
} while (!descriptor && proto);
|
||||
|
||||
return descriptor;
|
||||
};
|
||||
|
||||
return util;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user