mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-09 10:27:49 +00:00
Ducktype in _.isError for ES6 support.
This commit is contained in:
@@ -9871,9 +9871,8 @@
|
|||||||
if (!isObjectLike(value)) {
|
if (!isObjectLike(value)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
var Ctor = value.constructor;
|
|
||||||
return (objectToString.call(value) == errorTag) ||
|
return (objectToString.call(value) == errorTag) ||
|
||||||
(typeof Ctor == 'function' && objectToString.call(Ctor.prototype) == errorTag);
|
(typeof value.message == 'string' && typeof value.name == 'string');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -364,7 +364,9 @@
|
|||||||
this.message = message;
|
this.message = message;
|
||||||
}
|
}
|
||||||
|
|
||||||
CustomError.prototype = lodashStable.create(Error.prototype);
|
CustomError.prototype = lodashStable.create(Error.prototype, {
|
||||||
|
'constructor': CustomError
|
||||||
|
});
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Removes all own enumerable properties from a given object.
|
* Removes all own enumerable properties from a given object.
|
||||||
|
|||||||
Reference in New Issue
Block a user