Check for descriptor
This commit is contained in:
@@ -1993,7 +1993,7 @@ getJasmineRequireObj().SpyRegistry = function(j$) {
|
||||
}
|
||||
|
||||
var descriptor = Object.getOwnPropertyDescriptor(obj, methodName);
|
||||
if (!(descriptor.writable || descriptor.set)) {
|
||||
if (descriptor && !(descriptor.writable || descriptor.set)) {
|
||||
throw new Error(methodName + ' is not declared writable or has no setter');
|
||||
}
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@ getJasmineRequireObj().SpyRegistry = function(j$) {
|
||||
}
|
||||
|
||||
var descriptor = Object.getOwnPropertyDescriptor(obj, methodName);
|
||||
if (!(descriptor.writable || descriptor.set)) {
|
||||
if (descriptor && !(descriptor.writable || descriptor.set)) {
|
||||
throw new Error(methodName + ' is not declared writable or has no setter');
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user