Implement spies for get/set functions on accessor properties

This commit is contained in:
Sukharev Maxim
2015-12-30 13:01:19 +07:00
committed by Joe Cellucci
parent 8624a52ee0
commit 56191cfb2e
4 changed files with 258 additions and 0 deletions

View File

@@ -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;
};