mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-08 18:17:48 +00:00
Move more code out of the try-block in _.attempt.
This commit is contained in:
@@ -10676,14 +10676,14 @@
|
|||||||
* }
|
* }
|
||||||
*/
|
*/
|
||||||
function attempt() {
|
function attempt() {
|
||||||
var length = arguments.length,
|
var func = arguments[0],
|
||||||
func = arguments[0];
|
length = arguments.length,
|
||||||
|
args = Array(length ? length - 1 : 0);
|
||||||
|
|
||||||
|
while (--length > 0) {
|
||||||
|
args[length - 1] = arguments[length];
|
||||||
|
}
|
||||||
try {
|
try {
|
||||||
var args = Array(length ? length - 1 : 0);
|
|
||||||
while (--length > 0) {
|
|
||||||
args[length - 1] = arguments[length];
|
|
||||||
}
|
|
||||||
return func.apply(undefined, args);
|
return func.apply(undefined, args);
|
||||||
} catch(e) {
|
} catch(e) {
|
||||||
return isError(e) ? e : new Error(e);
|
return isError(e) ? e : new Error(e);
|
||||||
|
|||||||
Reference in New Issue
Block a user